管道基础大数据平台系统开发-【前端】-新系統界面
surprise
2024-04-22 fa7ba545bb58983c8dab5f96cd1f010a48d7420c
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>
@@ -81,6 +88,7 @@
      <el-table
        :data="tableData"
        style="width: 100%"
        border
        height="calc(100% - 57px)"
        @selection-change="handleSelectionChange"
      >
@@ -146,7 +154,7 @@
          :label="$t('dataManage.styleObj.bak')"
        /> -->
        <el-table-column
          min-width="120"
          min-width="200"
          :label="$t('common.operate')"
        >
          <template slot-scope="scope">
@@ -164,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>
@@ -182,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"
@@ -268,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>
@@ -278,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>
@@ -429,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>
@@ -619,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
@@ -629,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
@@ -637,7 +647,7 @@
          >
            <el-select
              v-model="insertform.dirid"
              placeholder="请选择"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('dataManage.styleObj.dirid')"
              style="width:85%"
              @focus="setOptionWidth"
            >
@@ -681,7 +691,7 @@
          >
            <el-select
              v-model="insertform.depid"
              placeholder="请选择"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetree')+$t('dataManage.styleObj.depid')"
              style="width:85%"
              @focus="setOptionWidth"
            >
@@ -727,6 +737,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
@@ -736,7 +747,7 @@
            <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"
@@ -756,6 +767,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
@@ -766,6 +778,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
@@ -881,6 +894,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>
@@ -994,7 +1008,7 @@
      dialogFormVisible: false,
      InsertFormdialog: false,
      showCata: false,
      upform: {},
      upform: { status: '0' },
      formLabelWidth: "130px",
      showinfoBox: false,
      itemdetail: {},
@@ -1052,6 +1066,7 @@
      styleVar: {
        height: "calc(100% - 109px)",
      },
      status: 0,
    };
  },
  created() {
@@ -1252,6 +1267,7 @@
              message: "删除成功!",
              type: "success",
            });
            this.listData.pageIndex = 1;
            this.getRoleTabelData();
          } else {
            this.$message({
@@ -1303,19 +1319,27 @@
      }
    },
    insertFromDataClose() {
      this.InsertFormdialog = false;
      this.insertform = {};
      this.insertFileGuid = "";
      this.insertViewGuid = "";
      this.filesReset();
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
          this.insertform = {};
          this.insertFileGuid = "";
          this.insertViewGuid = "";
          this.filesReset();
        })
        .catch((_) => { });
    },
    handleClose() {
      this.InsertFormdialog = false;
      this.insertform = {
        fileGuid: null,
        viewGuid: null,
      };
      this.filesReset();
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.InsertFormdialog = false;
          this.insertform = {
            fileGuid: null,
            viewGuid: null,
          };
          this.filesReset();
        })
        .catch((_) => { });
    },
    async insertFromData() {
      if (this.insertform.dirid == null || this.insertform.depid == null) {
@@ -1387,6 +1411,7 @@
      if (date === undefined || date === null) {
        return;
      }
      switch (date) {
        case 1:
          return "启用";
@@ -1528,6 +1553,13 @@
        this.upform.vname = this.upform.viewGuid;
        this.upform.viewGuid = this.viewFile;
      }
      if (this.status == '启用') {
        this.status = '1'
      } else if (this.status == '停用') {
        this.status = '0'
      }
      this.upform.status = this.status
      const data = await updateStyle(this.upform);
      if (data.code == 200) {
        this.dialogFormVisible = false;
@@ -1546,9 +1578,13 @@
    },
    removeUpdate() {
      this.upflag = false;
      this.dialogFormVisible = false;
      this.upform = {};
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.upflag = false;
          this.dialogFormVisible = false;
          this.upform = {};
        })
        .catch((_) => { });
      // this.filesReset();
    },
    submitForm(formName) {
@@ -1572,29 +1608,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;
@@ -1602,7 +1681,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("确定是否删除?", "提示", {