管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-05-10 86cdd4e6eece0ee4679e62ae347ec003db7d7425
src/views/datamanage/styleManage.vue
@@ -67,6 +67,13 @@
                size="small"
              >{{ $t('common.empty') }}
              </el-button>
              <el-button
                @click="handleDownload('ruleForm')"
                icon="el-icon-download"
                type="success"
                size="small"
              >{{ $t('common.download') }}
              </el-button>
            </el-form-item>
          </div>
        </div>
@@ -165,12 +172,12 @@
              size="small"
            >{{ $t('common.update') }}
            </el-button>
            <el-button
            <!-- <el-button
              @click="handleDownload(scope.$index, scope.row)"
              type="success"
              plain
              size="small"
            >{{ $t('common.download') }}
            >{{ $t('common.download') }} -->
            </el-button>
          </template>
        </el-table-column>
@@ -183,7 +190,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-sizes="[10, 50,100,200]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
@@ -269,7 +276,7 @@
          <el-divider></el-divider>
          <p>
            <label> {{ $t('dataManage.styleObj.createUser') }}:</label>
            <label class="boxlabel">{{ itemdetail.createUser }}</label>
            <label class="boxlabel">{{ itemdetail.createName }}</label>
          </p>
          <el-divider></el-divider>
          <p>
@@ -279,7 +286,7 @@
          <el-divider></el-divider>
          <p>
            <label> {{ $t('dataManage.styleObj.updateUser') }}:</label>
            <label class="boxlabel">{{ itemdetail.updateUser }}</label>
            <label class="boxlabel">{{ itemdetail.updateName }}</label>
          </p>
          <el-divider></el-divider>
          <p>
@@ -430,16 +437,16 @@
            :label-width="formLabelWidth"
          >
            <el-select
              v-model="upform.status"
              v-model="status"
              style="width:85%"
              :placeholder="$t('common.choose')"
            >
              <el-option
                value="0"
                value='0'
                :label="$t('dataManage.styleObj.deactivate')"
              ></el-option>
              <el-option
                value="1"
                value='1'
                :label="$t('dataManage.styleObj.enable')"
              ></el-option>
            </el-select>
@@ -620,6 +627,7 @@
              v-model="insertform.name"
              autocomplete="off"
              style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.name')"
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -630,6 +638,7 @@
              v-model="insertform.type"
              autocomplete="off"
              style="width:85%"
               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.type')"
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -638,9 +647,10 @@
          >
            <el-select
              v-model="insertform.dirid"
              placeholder="请选择"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('dataManage.styleObj.dirid')"
              style="width:85%"
              @focus="setOptionWidth"
            >
              <el-option
                :value="insertform.dirid"
@@ -682,9 +692,10 @@
          >
            <el-select
              v-model="insertform.depid"
              placeholder="请选择"
               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('dataManage.styleObj.depid')"
              style="width:85%"
              @focus="setOptionWidth"
            >
              <el-option
                :value="insertform.depid"
@@ -728,6 +739,7 @@
              v-model="insertform.ver"
              autocomplete="off"
              style="width:85%"
               :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.ver')"
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -737,7 +749,8 @@
            <el-select
              v-model="insertform.status"
              style="width:85%"
              :placeholder="$t('common.choose')"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('dataManage.styleObj.status')"
            >
              <el-option
                value="0"
@@ -757,6 +770,7 @@
              v-model="insertform.precision"
              autocomplete="off"
              style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.precision')"
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -767,6 +781,7 @@
              v-model="insertform.descr"
              autocomplete="off"
              style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.descr')"
            ></el-input>
          </el-form-item>
          <el-form-item
@@ -780,6 +795,7 @@
                  disabled
                  autocomplete="off"
                  style="width:100%"
                />
              </div>
              <div>
@@ -882,6 +898,7 @@
              v-model="insertform.bak"
              autocomplete="off"
              style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('dataManage.styleObj.bak')"
            ></el-input>
          </el-form-item>
        </el-form>
@@ -995,7 +1012,7 @@
      dialogFormVisible: false,
      InsertFormdialog: false,
      showCata: false,
      upform: {},
      upform: { status: '0' },
      formLabelWidth: "130px",
      showinfoBox: false,
      itemdetail: {},
@@ -1053,6 +1070,7 @@
      styleVar: {
        height: "calc(100% - 109px)",
      },
      status: 0,
    };
  },
  created() {
@@ -1253,6 +1271,7 @@
              message: "删除成功!",
              type: "success",
            });
            this.listData.pageIndex = 1;
            this.getRoleTabelData();
          } else {
            this.$message({
@@ -1396,6 +1415,7 @@
      if (date === undefined || date === null) {
        return;
      }
      switch (date) {
        case 1:
          return "启用";
@@ -1537,6 +1557,8 @@
        this.upform.vname = this.upform.viewGuid;
        this.upform.viewGuid = this.viewFile;
      }
      this.upform.status = this.status
      const data = await updateStyle(this.upform);
      if (data.code == 200) {
        this.dialogFormVisible = false;
@@ -1585,29 +1607,72 @@
      this.showinfoBox = true;
      this.itemdetail = row;
      this.itemdetail.createTime = this.formomentTime(
        this.itemdetail.createTime
      );
      this.itemdetail.updateTime = this.formomentTime(
        this.itemdetail.updateTime
      );
      this.itemdetail.imageFile =
        BASE_URL + "/res/download?guid=" + row.viewGuid + "&token=" + token;
      this.itemdetail.imageFile = BASE_URL + "/comprehensive/downloadForView?guid=" + row.viewGuid + "&token=" + token;
    },
    closeDetial() {
      this.showinfoBox = false;
      this.itemdetail = {};
    },
    handleDownload() {
      if (this.multipleSelection.length == 0) {
        return this.$message({
          message: '请选择需要下载的文件',
          type: 'warning'
        });
      }
    handleDownload(index, row) {
      // var data = {
      //   guids: ["e5b6ae0889b88111f13a4b6e048348db", "fa4f299e901a0c46e634f8fcc8185c0c"]
      // };
      // ajax(getUrl("/res/downloadReqForGuids"), "POST", JSON.stringify(data), null, null, function (rs) {
      //   console.log(rs);
      //   alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result);
      // });
      var std = [];
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].fileGuid)
      }
      var token = getToken()
      var url = BASE_URL + "/res/download?token=" + token + "&guid=" + row.fileGuid;
      $.ajax(BASE_URL + "/style/downloadReqForGuids?token=" + token, {
        type: "post",
        data: JSON.stringify({
          guids: std
        }),
        async: true,
        cache: false,
        processData: false,
        contentType: false,
        success: res => {
          if (res.code != 200) {
            return
          }
      $("#downFrame").attr("src", url).click();
          var token = getToken()
          var url = BASE_URL + "/style/downloadFile?token=" + token + "&guid=" + res.result;
          $("#downFrame").attr("src", url).click();
        },
      })
    },
    // handleDownload(index, row) {
    //   var token = getToken()
    //   var url = BASE_URL + "/res/download?token=" + token + "&guid=" + row.fileGuid;
    //   $("#downFrame").attr("src", url).click();
    // },
    handleEdit(index, row) {
      this.upflag = true;
      this.dialogFormVisible = true;
      this.upform = row;
@@ -1615,7 +1680,10 @@
      this.upform.dirValue = row.dirName;
      this.upform.fileGuid = row.fname;
      this.upform.viewGuid = row.vname;
      this.upform.status = this.forMontStatus(row.status);
      // this.upform.status = this.forMontStatus(row.status);
      // this.upform.status = row.status;
      this.status = this.forMontStatus(row.status);
    },
    handleDelete(index, row) {
      this.$confirm("确定是否删除?", "提示", {