管道基础大数据平台系统开发-【前端】-新系統界面
src/views/datamanage/metadataManage.vue
@@ -20,6 +20,7 @@
              <el-select
                :popper-append-to-body="false"
                v-model="queryForm.depName"
                ref="treeSelect"
              >
                <el-option
                  :value="queryForm.depid"
@@ -53,6 +54,7 @@
              <el-select
                :popper-append-to-body="false"
                v-model="queryForm.dirName"
                ref="treeSelect1"
              >
                <el-option
                  :value="queryForm.dirid"
@@ -288,6 +290,13 @@
          prop="rows"
          :label="$t('dataManage.vmobj.row')"
        />
        <el-table-column
          :label="$t('common.dataStatus')"
          :formatter="stateFormat"
        >
        </el-table-column>
        <el-table-column
          prop="uname"
          :label="$t('dataManage.vmobj.createonuser')"
@@ -383,7 +392,7 @@
          <el-divider></el-divider>
          <p>{{ $t("dataManage.vmobj.tab") }}:{{ itemdetail.tab }}</p>
          <el-divider></el-divider>
          <p>{{ $t("dataManage.vmobj.row") }}:{{ itemdetail.row }}</p>
          <p>{{ $t("dataManage.vmobj.row") }}:{{ itemdetail.rows }}</p>
          <el-divider></el-divider>
          <p>
            {{ $t("dataManage.vmobj.createonuser") }}:{{ itemdetail.uname }}
@@ -395,17 +404,15 @@
            }}
          </p>
          <el-divider></el-divider>
          <p>
            {{ $t("dataManage.vmobj.depName") }}:{{
              itemdetail.updateUser
            }}
          <!-- <p>
            {{ $t("dataManage.vmobj.depName") }}:{{ itemdetail.updateUser }}
          </p>
          <el-divider></el-divider>
          <p>
            {{ $t("dataManage.vmobj.depName") }}:{{
              setInfoBoxTime(itemdetail.updateTime)
            }}
          </p>
          </p> -->
        </div>
      </div>
    </div>
@@ -883,12 +890,11 @@
        class="pdfClass"
      >
        <el-image
          style="width:100%; height:100%"
          style="width: 100%; height: 100%"
          :src="dialog.src"
          :preview-src-list="[dialog.src]"
        >
        </el-image>
      </div>
    </el-dialog>
    <el-dialog
@@ -930,19 +936,14 @@
            class="primary"
            size="small"
            @click="getFileInsertApply()"
          >{{
              $t("common.confirm")
            }}</el-button>
          >{{ $t("common.confirm") }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="handleInsertFileClose()"
          >{{
              $t("common.cancel")
            }}</el-button>
          >{{ $t("common.cancel") }}</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <iframe
      id="downFrame"
@@ -953,8 +954,8 @@
</template>
<script>
import $ from "jquery"
import { getToken } from "@/utils/auth"
import $ from "jquery";
import { getToken } from "@/utils/auth";
import {
  encr,
  deleteMeta,
@@ -973,10 +974,10 @@
  meta_selectById,
  meta_selectMetaOverflowDep,
  meta_selectDepsByCodes,
  apply_insertApply
} from "../../api/api"
  apply_insertApply,
} from "../../api/api";
import MyBread from "../../components/MyBread.vue"
import MyBread from "../../components/MyBread.vue";
export default {
  name: "metadataManage",
@@ -984,22 +985,22 @@
  data() {
    var repasswordValidator = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请再次输入密码"))
        callback(new Error("请再次输入密码"));
      } else if (value !== this.codeForm.password) {
        callback(new Error("两次输入密码不一致!"))
        callback(new Error("两次输入密码不一致!"));
      } else {
        callback()
        callback();
      }
    }
    };
    var passwordValidator = (rule, value, callback) => {
      var passwordreg =
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/
        /^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
      if (!passwordreg.test(value)) {
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"))
        callback(new Error("密码必须由数字、字母、特殊字符组合,请输入13-20位"));
      } else {
        callback()
        callback();
      }
    }
    };
    return {
      verOptions: [],
      defaultProps: {
@@ -1025,6 +1026,8 @@
        dirid: "",
        depid: "",
        verid: "",
        depName: "",
      },
      behavior: "",
      initialForm: "",
@@ -1110,277 +1113,299 @@
        depid: null,
        ids: null,
        pwd: null,
        depcodes: null
      }
    }
        depcodes: null,
      },
    };
  },
  created() {
    // this.getSelectDictTab();
    this.showPermsBtn()
    this.getQueryDepTree()
    this.showPermsBtn();
    this.getQueryDepTree();
    this.signGetPublicKey()
    this.signGetPublicKey();
  },
  beforeDestroy() {
    this.timer && clearTimeout(this.timer)
    window.removeEventListener("resize", this.onResize)
    this.timer && clearTimeout(this.timer);
    window.removeEventListener("resize", this.onResize);
  },
  mounted() {
    window.addEventListener("resize", this.onResize)
    this.calHeight()
    window.addEventListener("resize", this.onResize);
    this.calHeight();
  },
  watch: {
    "queryForm.depName"() {
      this.$refs.treeSelect.visible = false;
    },
    "queryForm.dirid"() {
      this.$refs.treeSelect1.visible = false;
    },
  },
  methods: {
    stateFormat(row, column) {
      var val = ['shp', 'gdb', 'xls', 'xlsx']
      if (val.indexOf(row.type) > -1 && row.rows > 0) {
        return '已上传,已入库'
      } else if (val.indexOf(row.type) > -1 && row.rows == 0) {
        return '已上传,未入库'
      } else {
        return '已上传'
      }
    },
    //大小值改变
    changeSizeFile(row, column, cellValue, index) {
      if (cellValue >= 1024) {
        return parseFloat(cellValue / 1204).toFixed(3) + "GB"
        return parseFloat(cellValue / 1204).toFixed(3) + "GB";
      } else {
        return cellValue + "MB"
        return cellValue + "MB";
      }
    },
    setRestMetaData() {
      this.fromQueryMeta.name = ""
      this.listMetaData.name = this.fromQueryMeta.name
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = 10
      this.fromQueryMeta.name = "";
      this.listMetaData.name = this.fromQueryMeta.name;
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = 10;
      this.startQueryMetaData()
      this.startQueryMetaData();
    },
    setSearchMetaData() {
      this.listMetaData.name = this.fromQueryMeta.name
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = 10
      this.listMetaData.name = this.fromQueryMeta.name;
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = 10;
      this.startQueryMetaData()
      this.startQueryMetaData();
    },
    //源数据页面切换
    handleMetaSizeChange(val) {
      this.listMetaData.pageIndex = 1
      this.listMetaData.pageSize = val
      this.startQueryMetaData()
      this.listMetaData.pageIndex = 1;
      this.listMetaData.pageSize = val;
      this.startQueryMetaData();
    },
    //源数据页面切换
    handMetaCurrentChange(val) {
      this.listMetaData.pageIndex = val
      this.startQueryMetaData()
      this.listMetaData.pageIndex = val;
      this.startQueryMetaData();
    },
    //元数据查询
    async setMetaDataQuery(row) {
      this.fromQueryMeta.title = row.name
      this.fromQueryMeta.title = row.name;
      this.listMetaData = {
        id: row.metaid,
        // name: "",
        // pageIndex: 1,
        // pageSize: 10,
        // count: 0,
      }
      const data = await meta_selectById(this.listMetaData)
      };
      const data = await meta_selectById(this.listMetaData);
      if (data.code != 200) {
        return
        return;
      }
      this.queryMetaFlag1 = true
      this.metaDataTable1 = [data.result]
      this.queryMetaFlag1 = true;
      this.metaDataTable1 = [data.result];
      // this.listMetaData.count = data.count;
    },
    //源数据查询
    setQueryMetaData(row) {
      this.fromQueryMeta.title = row.name
      this.fromQueryMeta.title = row.name;
      this.listMetaData = {
        metaid: row.id,
        name: "",
        pageIndex: 1,
        pageSize: 10,
        count: 0,
      }
      this.startQueryMetaData()
      this.queryMetaFlag = true
      };
      this.startQueryMetaData();
      this.queryMetaFlag = true;
    },
    async startQueryMetaData() {
      const data = await meta_selectPageAndCountByPid(this.listMetaData)
      const data = await meta_selectPageAndCountByPid(this.listMetaData);
      if (data.code != 200) {
        return
        return;
      }
      this.metaDataTable = data.result
      this.listMetaData.count = data.count
      this.metaDataTable = data.result;
      this.listMetaData.count = data.count;
    },
    onResize() {
      this.timer && clearTimeout(this.timer)
      this.timer && clearTimeout(this.timer);
      this.timer = setTimeout(() => {
        this.calHeight()
      }, 500)
        this.calHeight();
      }, 500);
    },
    calHeight() {
      this.$nextTick(() => {
        const rect = this.$refs.container.getBoundingClientRect()
        this.tableHeight = `${rect.height + 97}px`
        this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`
      })
        const rect = this.$refs.container.getBoundingClientRect();
        this.tableHeight = `${rect.height + 97}px`;
        this.styleVar["height"] = `calc(100% - ${rect.height + 28}px)`;
      });
    },
    async detail(res) {
      var val = res.tab.split(".")
      var val = res.tab.split(".");
      const data = await meta_selectFields({
        ns: val[0],
        tab: val[1],
      })
      });
      if (data.code != 200) {
        this.$message.error("字段列表调用失败")
        return
        this.$message.error("字段列表调用失败");
        return;
      }
      this.dialogVisible = true
      this.dialogVisible = true;
      this.attributeData = data.result
      this.attributeData = data.result;
      this.listLoader = {
        id: res.id,
        pageIndex: 1,
        pageSize: 10,
      }
      this.getDataLoaderSelectDbData()
      };
      this.getDataLoaderSelectDbData();
    },
    async getDataLoaderSelectDbData() {
      const data1 = await meta_selectByPageForUpload(this.listLoader)
      const data1 = await meta_selectByPageForUpload(this.listLoader);
      if (data1.code != 200) {
        this.$message.error("字段列表调用失败")
        return
        this.$message.error("字段列表调用失败");
        return;
      }
      var option = data1.result
      var option = data1.result;
      for (var i in option) {
        option[i].dirid = option[i].dirName
        option[i].depid = option[i].depName
        option[i].createuser = option[i].createName
        option[i].updateuser = option[i].updateName
        option[i].verid = option[i].verName
        option[i].dirid = option[i].dirName;
        option[i].depid = option[i].depName;
        option[i].createuser = option[i].createName;
        option[i].updateuser = option[i].updateName;
        option[i].verid = option[i].verName;
        if (option[i].createtime != null) {
          option[i].createtime = this.setInfoBoxTime(option[i].createtime)
          option[i].createtime = this.setInfoBoxTime(option[i].createtime);
        }
        if (option[i].updatetime != null) {
          option[i].updatetime = this.setInfoBoxTime(option[i].updatetime)
          option[i].updatetime = this.setInfoBoxTime(option[i].updatetime);
        }
      }
      this.dbTableData = data1.result
      this.count1 = data1.count
      this.dbTableData = data1.result;
      this.count1 = data1.count;
    },
    handleLoaderSizeChange(val) {
      this.listLoader.pageIndex = 1
      this.listLoader.pageSize = val
      this.getDataLoaderSelectDbData()
      this.listLoader.pageIndex = 1;
      this.listLoader.pageSize = val;
      this.getDataLoaderSelectDbData();
    },
    handleLoaderCurrentChange(val) {
      this.listLoader.pageIndex = val
      this.getDataLoaderSelectDbData()
      this.listLoader.pageIndex = val;
      this.getDataLoaderSelectDbData();
    },
    async signGetPublicKey() {
      const res = await sign_getPublicKey()
      const res = await sign_getPublicKey();
      if (res && res.code == 200) {
        window.encrypt = new JSEncrypt()
        encrypt.setPublicKey(res.result)
        window.encrypt = new JSEncrypt();
        encrypt.setPublicKey(res.result);
      }
    },
    //单位列表获取
    async getQueryDepTree() {
      const res = await selectdepTab()
      const res = await selectdepTab();
      if (res.code != 200) {
        this.$message.error("单位列表获取失败")
        return
        this.$message.error("单位列表获取失败");
        return;
      }
      this.companyOption1 = this.treeData(res.result)
      this.queryForm.depcode = this.companyOption1[0].code
      this.queryForm.depName = this.companyOption1[0].name
      this.getQueryDirTree()
      this.companyOption1 = this.treeData(res.result);
      this.queryForm.depcode = this.companyOption1[0].code;
      this.queryForm.depName = this.companyOption1[0].name;
      this.getQueryDirTree();
    },
    async getQueryDirTree() {
      const res = await selectdirTab()
      const res = await selectdirTab();
      if (res.code != 200) {
        this.$message.error("单位列表获取失败")
        return
        this.$message.error("单位列表获取失败");
        return;
      }
      this.companyOption = this.treeData(res.result)
      this.queryForm.dirid = this.companyOption[0].id
      this.queryForm.dircode = this.companyOption[0].code
      this.queryForm.dirName = this.companyOption[0].name
      this.getQueryVerList()
      this.companyOption = this.treeData(res.result);
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.dircode = this.companyOption[0].code;
      this.queryForm.dirName = this.companyOption[0].name;
      this.getQueryVerList();
    },
    async getQueryVerList() {
      const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid })
      const data = await meta_selectVerByDirid({ dirid: this.queryForm.dirid });
      if (data.code != 200) {
        this.$message.error("版本列表获取失败")
        return
        this.$message.error("版本列表获取失败");
        return;
      }
      this.verOptions = data.result
      this.queryForm.verid = data.result[0].id
      this.getMetaData()
      this.verOptions = data.result;
      this.queryForm.verid = data.result[0].id;
      this.getMetaData();
    },
    verHandleChange(val) {
      this.queryForm.verid = val
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.getMetaData()
      this.queryForm.verid = val;
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getMetaData();
    },
    handleChange(data, node, nodeData) {
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.queryForm.dircode = data.code
      this.queryForm.dirid = data.id
      this.queryForm.dirName = data.name
      this.getQueryVerList()
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.dircode = data.code;
      this.queryForm.dirid = data.id;
      this.queryForm.dirName = data.name;
      this.getQueryVerList();
    },
    handleChange1(data, node, nodeData) {
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.queryForm.depcode = data.code
      this.queryForm.depName = data.name
      this.getMetaData()
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.queryForm.depcode = data.code;
      this.queryForm.depName = data.name;
      this.getMetaData();
    },
    handleChange2(data, node, nodeData) {
      this.editForm.depid = data.id
      this.editForm.depcode = data.code
      this.editForm.depName = data.name
      this.editForm.depid = data.id;
      this.editForm.depcode = data.code;
      this.editForm.depName = data.name;
    },
    handleChange3(data, node, nodeData) {
      this.editForm.dirid = data.id
      this.editForm.dircode = data.code
      this.editForm.dirName = data.name
      this.editForm.dirid = data.id;
      this.editForm.dircode = data.code;
      this.editForm.dirName = data.name;
    },
    //格式化列表
    formatData(row, column) {
      let data = row[column.property]
      let data = row[column.property];
      if (data == null) {
        return data
        return data;
      }
      return this.format(data)
      return this.format(data);
    },
    setInfoBoxTime(res) {
      if (res == null) {
        return res
        return res;
      }
      return this.format(res)
      return this.format(res);
    },
    setInfoBoxSize(res) {
      if (res >= 1024) {
        return parseFloat(res / 1024).toFixed(3) + " GB"
        return parseFloat(res / 1024).toFixed(3) + " GB";
      } else {
        return res + " MB"
        return res + " MB";
      }
    },
    //格式化时间
    format(shijianchuo) {
      //shijianchuo是整数,否则要parseInt转换
      var time = new Date(shijianchuo)
      var y = time.getFullYear()
      var m = time.getMonth() + 1
      var d = time.getDate()
      var h = time.getHours()
      var mm = time.getMinutes()
      var s = time.getSeconds()
      var time = new Date(shijianchuo);
      var y = time.getFullYear();
      var m = time.getMonth() + 1;
      var d = time.getDate();
      var h = time.getHours();
      var mm = time.getMinutes();
      var s = time.getSeconds();
      return (
        y +
        "-" +
@@ -1393,47 +1418,47 @@
        mm +
        ":" +
        s
      )
      );
    },
    //格式化时间
    add0(m) {
      return m < 10 ? "0" + m : m
      return m < 10 ? "0" + m : m;
    },
    //单位转换
    stateFormatSizes(row, column) {
      if (row.sizes >= 1024) {
        const val = parseFloat(row.sizes / 1024).toFixed(3)
        return val + " GB"
        const val = parseFloat(row.sizes / 1024).toFixed(3);
        return val + " GB";
      } else {
        return row.sizes + " MB"
        return row.sizes + " MB";
      }
    },
    //目录树获取
    async getSelectDictTab() {
      const res = await selectdirTab()
      const res = await selectdirTab();
      if (res.code != 200) {
        this.$message.error("列表调用失败")
        this.$message.error("列表调用失败");
      }
      this.optionCount = this.treeData(res.result)
      this.dirComPanyOption = this.treeData(res.result)
      this.listData.depcode = this.optionCount[0].code
      this.optionCount = this.treeData(res.result);
      this.dirComPanyOption = this.treeData(res.result);
      this.listData.depcode = this.optionCount[0].code;
    },
    handleNodeClick(data) {
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.listData.dirid = data.id
      this.getMetaData()
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.listData.dirid = data.id;
      this.getMetaData();
    },
    getTableDesc(res) {
      this.activeName = res.tab
      this.activeName = res.tab;
    },
    //显示权限按钮
    showPermsBtn() {
      let currentPerms = this.$store.state.currentPerms
      let permsEntity = this.$store.state.permsEntity
      let currentPerms = this.$store.state.currentPerms;
      let permsEntity = this.$store.state.permsEntity;
      permsEntity
        .filter(item => item.perms == currentPerms)
        .map(item => (this.btnStatus[item.tag.substr(1)] = true))
        .filter((item) => item.perms == currentPerms)
        .map((item) => (this.btnStatus[item.tag.substr(1)] = true));
    },
    // ShowWindowFly(res) {
    //   console.log(res);
@@ -1469,83 +1494,83 @@
    // },
    // 请求数据内容
    getMetaData() {
      this.listData.depcode = this.queryForm.depcode
      this.listData.dircode = this.queryForm.dircode
      this.listData.depcode = this.queryForm.depcode;
      this.listData.dircode = this.queryForm.dircode;
      this.listData.verid = this.queryForm.verid
      this.listData.verid = this.queryForm.verid;
      // this.listData.dirid = 57
      select_meta_ByPageAndCount(this.listData).then(res => {
        this.tableData = res.result
        this.count = res.count
      })
      select_meta_ByPageAndCount(this.listData).then((res) => {
        this.tableData = res.result;
        this.count = res.count;
      });
    },
    // 查询
    queryInfo() {
      this.listData.name = this.queryForm.name.trim()
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.getMetaData()
      this.listData.name = this.queryForm.name.trim();
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.getMetaData();
    },
    // 重置查询
    resetInfo(formName) {
      this.$refs[formName].resetFields()
      this.listData.pageSize = 10
      this.listData.pageIndex = 1
      this.listData.name = null
      this.queryForm.dirid = this.companyOption[0].id
      this.queryForm.depid = this.companyOption1[0].id
      this.queryForm.dircode = this.companyOption[0].code
      this.queryForm.depcode = this.companyOption1[0].code
      this.queryForm.dirName = this.companyOption[0].name
      this.queryForm.depName = this.companyOption1[0].name
      this.getQueryVerList()
      this.getMetaData()
      this.$refs[formName].resetFields();
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.listData.name = null;
      this.queryForm.dirid = this.companyOption[0].id;
      this.queryForm.depid = this.companyOption1[0].id;
      this.queryForm.dircode = this.companyOption[0].code;
      this.queryForm.depcode = this.companyOption1[0].code;
      this.queryForm.dirName = this.companyOption[0].name;
      this.queryForm.depName = this.companyOption1[0].name;
      this.getQueryVerList();
      this.getMetaData();
    },
    //新增按钮
    showAddDialog() {
      this.behavior = "新增用户"
      this.editForm = {}
      this.dialogFormVisible = true
      this.behavior = "新增用户";
      this.editForm = {};
      this.dialogFormVisible = true;
    },
    cancelAdd(formName) {
      this.editForm = {}
      this.$refs[formName].resetFields()
      this.editForm = {};
      this.$refs[formName].resetFields();
    },
    sendAdd(formName) {
      this.$refs[formName].validate(valid => {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.fullscreenLoading = true
          this.fullscreenLoading = true;
          insertMeta(this.editForm)
            .then(res => {
            .then((res) => {
              setTimeout(() => {
                this.fullscreenLoading = false
                this.fullscreenLoading = false;
                if (res.code == 200) {
                  this.listData.pageSize = 10
                  this.listData.pageIndex = 1
                  this.getMetaData()
                  this.listData.pageSize = 10;
                  this.listData.pageIndex = 1;
                  this.getMetaData();
                  this.$message({
                    message: "添加成功",
                    type: "success",
                  })
                  this.editForm = {}
                  this.dialogFormVisible = false
                  });
                  this.editForm = {};
                  this.dialogFormVisible = false;
                }
              }, 500)
              }, 500);
            })
            .catch(res => {
              alert("修改失败,请重试!")
              this.fullscreenLoading = false
            })
            .catch((res) => {
              alert("修改失败,请重试!");
              this.fullscreenLoading = false;
            });
        } else {
          console.log("error submit!!")
          return false
          console.log("error submit!!");
          return false;
        }
      })
      });
    },
    // 获取多选选中的对象
    handleSelectionChange(val) {
      this.multipleSelection = val
      this.multipleSelection = val;
    },
    // 删除多条
    deleteMetaInfo() {
@@ -1555,62 +1580,64 @@
        type: "warning",
      })
        .then(() => {
          var std = []
          var std = [];
          for (var i in this.multipleSelection) {
            std.push(this.multipleSelection[i].id)
            std.push(this.multipleSelection[i].id);
          }
          deleteMeta({ ids: std.toString() }).then(res => {
          deleteMeta({ ids: std.toString() }).then((res) => {
            if (res.code == 200) {
              this.$message({
                type: "success",
                message: "删除成功!",
              })
              this.multipleSelection = []
              });
              this.multipleSelection = [];
              // this.listData.pageSize = 10
              this.listData.pageIndex = 1
              this.getMetaData()
              this.listData.pageIndex = 1;
              this.getMetaData();
            } else {
              this.$message.error("删除失败")
              this.multipleSelection = []
              this.$message.error("删除失败");
              this.multipleSelection = [];
            }
          })
          });
        })
        .catch(() => {
          this.$message("已取消删除")
        })
          this.$message("已取消删除");
        });
    },
    // 查看界面
    showDetail(row) {
      // console.log(index, row);
      this.showinfoBox = true
      this.itemdetail = row
      this.showinfoBox = true;
      this.itemdetail = row;
    },
    // 关闭查看
    closeDetial() {
      this.showinfoBox = false
      this.itemdetail = {}
      this.showinfoBox = false;
      this.itemdetail = {};
    },
    // 修改界面
    editInfo(row) {
      // console.log(row);
      delete row.createTime
      delete row.createUser
      delete row.updateUser
      delete row.updateUser
      this.initialForm = JSON.stringify(row) //备份
      this.behavior = "修改信息"
      this.editForm = JSON.parse(JSON.stringify(row))
      this.dialogFormVisible = true
      this.getSelectDictTab()
      delete row.createTime;
      delete row.createUser;
      delete row.updateUser;
      delete row.updateUser;
      this.initialForm = JSON.stringify(row); //备份
      this.behavior = "修改信息";
      this.editForm = JSON.parse(JSON.stringify(row));
      this.dialogFormVisible = true;
      this.getSelectDictTab();
    },
    handleClose(done) {
      this.$confirm("确认关闭?")
        .then(_ => {
          this.editForm = {}
          done()
        .then((_) => {
          this.editForm = {};
          done();
        })
        .catch(_ => { })
        .catch((_) => { });
    },
    // 提交修改
@@ -1621,68 +1648,68 @@
        type: "warning",
      })
        .then(() => {
          this.dialogFormVisible = false
          updateMeta(this.editForm).then(res => {
          this.dialogFormVisible = false;
          updateMeta(this.editForm).then((res) => {
            setTimeout(() => {
              this.fullscreenLoading = false
              this.fullscreenLoading = false;
              if (res.code == 200) {
                this.listData.pageSize = 10
                this.listData.pageIndex = 1
                this.getMetaData()
                this.listData.pageSize = 10;
                this.listData.pageIndex = 1;
                this.getMetaData();
                this.$message({
                  message: "修改成功",
                  type: "success",
                })
                this.editForm = {}
                this.dialogFormVisible = false
                });
                this.editForm = {};
                this.dialogFormVisible = false;
              }
            }, 500)
          })
            }, 500);
          });
        })
        .catch(() => {
          alert("修改失败,请重试!")
          this.fullscreenLoading = false
        })
          alert("修改失败,请重试!");
          this.fullscreenLoading = false;
        });
    },
    cancelEdit() {
      this.$nextTick(() => {
        this.editForm = JSON.parse(this.initialForm)
      })
        this.editForm = JSON.parse(this.initialForm);
      });
    },
    async download() {
      var ids = []
      var ids = [];
      for (var i in this.multipleSelection) {
        ids.push(this.multipleSelection[i].id)
        ids.push(this.multipleSelection[i].id);
      }
      var obj = {
        ids: ids,
      };
      const data = await meta_selectMetaOverflowDep(obj)
      const data = await meta_selectMetaOverflowDep(obj);
      if (data.code != 200) {
        return
        return;
      }
      var password = this.codeForm.repassword
      var password = this.codeForm.repassword;
      if (data.result.length == 0) {
        var obj = {
          pwd: encrypt.encrypt(this.codeForm.repassword),
          ids: ids,
        }
        const res = await meta_downloadReq(JSON.stringify(obj))
        };
        const res = await meta_downloadReq(JSON.stringify(obj));
        if (res.code != 200) {
          this.$message.error("下载请求失败")
          return
          this.$message.error("下载请求失败");
          return;
        }
        var downObj = {
          guid: res.result,
          pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)),
        }
        const data1 = await meta_selectDownloadFile(downObj)
        };
        const data1 = await meta_selectDownloadFile(downObj);
        if (data1.code != 200) {
          this.$message.error("下载请求失败")
          return
          this.$message.error("下载请求失败");
          return;
        }
        var token = getToken()
        var token = getToken();
        var url =
          BASE_URL +
          "/meta/downloadFile?token=" +
@@ -1690,39 +1717,39 @@
          "&guid=" +
          res.result +
          "&pwd=" +
          encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
          encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
        $("#downFrame").attr("src", url).click()
        $("#downFrame").attr("src", url).click();
      } else {
        var val = ""
        var val = "";
        var std = [];
        for (var i in data.result) {
          if (val == "") {
            val += "codes=" + data.result[i]
            val += "codes=" + data.result[i];
          } else {
            val += "&codes=" + data.result[i]
            val += "&codes=" + data.result[i];
          }
          std.push({
            name: data.result[i],
          })
          });
        }
        const data1 = await meta_selectDepsByCodes(val)
        const data1 = await meta_selectDepsByCodes(val);
        if (data1.code != 200) {
          return
          return;
        }
        this.fileFrom.depid = data1.result
        this.fileFrom.depid = data1.result;
        this.fileFrom.ids = ids;
        this.fileFrom.pwd = encr(password);
        this.fileFrom.depcodes = data.result;
        this.dialogInsertFile = true;
      }
      this.closeDown()
      this.closeDown();
    },
    async getFileInsertApply() {
      this.dialogInsertFile = false
      this.dialogInsertFile = false;
      var obj = {
        ids: this.fileFrom.ids,
@@ -1730,118 +1757,106 @@
        tabs: ["元数据表"],
        entities: ["sysmeta"],
        descr: this.fileFrom.descr,
        depcodes: this.fileFrom.depcodes
        depcodes: this.fileFrom.depcodes,
      };
      const data = await apply_insertApply(JSON.stringify(obj))
      const data = await apply_insertApply(JSON.stringify(obj));
      this.handleInsertFileClose();
      if (data.code != 200) {
        this.$message.error("数据申请失败")
        return
        this.$message.error("数据申请失败");
        return;
      }
      this.$message({
        message: "数据申请成功",
        type: "success",
      })
      });
    },
    handleInsertFileClose() {
      this.dialogInsertFile = false
      this.dialogInsertFile = false;
      this.fileFrom = {
        descr: null,
        depid: null,
        ids: null,
        pwd: null,
        depcodes: null
      }
        depcodes: null,
      };
    },
    closeDown() {
      this.showCodeBox = false
      this.codeForm.password = ""
      this.codeForm.repassword = ""
      this.showCodeBox = false;
      this.codeForm.password = "";
      this.codeForm.repassword = "";
    },
    downFormData() {
      if (this.multipleSelection.length == 0) {
        alert("请先选择要下载的文件")
        return
        alert("请先选择要下载的文件");
        return;
      }
      this.showCodeBox = true
      this.showCodeBox = true;
    },
    handleSizeChange(val) {
      this.listData.pageSize = val
      this.listData.pageIndex = 1
      this.getMetaData()
      this.listData.pageSize = val;
      this.listData.pageIndex = 1;
      this.getMetaData();
    },
    handleCurrentChange(val) {
      this.listData.pageIndex = val
      this.getMetaData()
      this.listData.pageIndex = val;
      this.getMetaData();
    },
    //树列表生成
    treeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)) // 对源数据深度克隆
      return cloneData.filter(father => {
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter(child => father.id == child.pid) // 对比ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : "" // 给父级添加一个children属性,并赋值
        return father.pid == 0 // 返回一级菜单
      })
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值
        return father.pid == 0; // 返回一级菜单
      });
    },
    showPreview(row) {
      let name = row.name
      if (!name) return false
      let name = row.name;
      if (!name) return false;
      return (
        name.indexOf("pdf") != -1 ||
        name.indexOf("jpg") != -1 ||
        name.indexOf("gif") != -1 ||
        name.indexOf("png") != -1 ||
        name.indexOf("jpeg") != -1
      )
      );
    },
    handlePreview(row) {
      let name = row.name
      this.refreshAttatchDetail()
      let name = row.name;
      this.refreshAttatchDetail();
      if (name.indexOf(".pdf") != -1) {
        this.dialog.isPdf = true
        this.dialog.isPdf = true;
      } else if (
        name.indexOf(".jpg") != -1 ||
        name.indexOf(".gif") != -1 ||
        name.indexOf(".png") != -1 ||
        name.indexOf(".jpeg") != -1
      ) {
        this.dialog.isJpg = true
        this.dialog.isJpg = true;
      }
      this.dialog.dialogVisible = true
      this.dialog.dialogVisible = true;
      var url =
        BASE_URL +
        "/inquiry/downloadForView?guid=" +
        row.guid +
        "&token=" +
        getToken()
      this.dialog.src = url
        getToken();
      this.dialog.src = url;
    },
    refreshAttatchDetail() {
      this.dialog.src = ""
      this.dialog.dialogVisible = false
      this.dialog.isPdf = false
      this.dialog.isJpg = false
      this.dialog.src = "";
      this.dialog.dialogVisible = false;
      this.dialog.isPdf = false;
      this.dialog.isJpg = false;
    },
  },
}
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
@@ -1887,5 +1902,8 @@
      position: relative;
    }
  }
  .el-divider--horizontal {
    margin: 15px 0;
  }
}
</style>