lxl
2022-10-26 e3196bc81327e82748c7683c5cad9849b4b228b6
src/views/datamanage/metadataManage.vue
@@ -23,6 +23,7 @@
            >重置</el-button
          >
          <el-button
            v-if="btnStatus.download"
            @click="downFormData"
            icon="el-icon-download"
            type="success"
@@ -37,6 +38,7 @@
            >下载</el-button
          > -->
          <el-button
            v-if="btnStatus.delete"
            @click="DelFormData"
            icon="el-icon-delete"
            type="danger"
@@ -59,21 +61,20 @@
          >
            <el-table-column type="selection" width="55" />
            <el-table-column min-width="150" prop="name" label="数据名称" />
            <el-table-column
              min-width="100"
              prop="create_user"
              prop="createUser"
              label="创建人员"
            />
            <el-table-column
              min-width="100"
              prop="create_time"
              prop="createTime"
              label="创建时间"
            />
            <el-table-column min-width="100" prop="coor_sys" label="坐标系统" />
            <el-table-column min-width="100" prop="cs" label="坐标系统" />
            <el-table-column
              min-width="100"
              prop="accuracy"
              prop="scale"
              label="比例尺/分辨率"
            />
            <el-table-column min-width="100" prop="format" label="存储格式" />
@@ -168,13 +169,15 @@
          <el-divider></el-divider>
          <p>比例尺/分辨率:{{ itemdetail.accuracy }}</p>
          <el-divider></el-divider>
          <p>发布地址:{{ itemdetail.s_url }}
           <el-link
          <p>
            发布地址:{{ itemdetail.s_url }}
            <el-link
              @click="ShowWindowFly(itemdetail.s_url)"
              :underline="false"
              type="primary"
              >详情</el-link
            ></p>
            >
          </p>
          <el-divider></el-divider>
          <p>数据版本:{{ itemdetail.version }}</p>
          <el-divider></el-divider>
@@ -263,8 +266,8 @@
<script>
import {
  queryMetaData,
  queryDataCount,
  select_meta_ByPageAndCount,
  // queryDataCount,
  updateMetaData,
  dltMetaDatas,
  publishMeta,
@@ -315,14 +318,29 @@
      pageSize: 10,
      pageNum: 1,
      searchName: "",
      btnStatus: {
        select: false,
        delete: false,
        upload: false,
        download: false,
        insert: false,
        update: false,
      },
    };
  },
  created() {
    this.getMetaData(10, 1, "");
    this.getMetaCount("");
    this.showPermsBtn();
  },
  methods: {
     ShowWindowFly(res) {
    showPermsBtn() {
      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));
    },
    ShowWindowFly(res) {
      console.log(res);
      if (res == "") return;
      if (res.indexOf(".xls") != -1) {
@@ -356,23 +374,24 @@
    },
    // 请求数据内容
    getMetaData(size, num, name) {
      queryMetaData(size, num, name).then((res) => {
        this.tableData = res.data;
      let params = {
        name: name,
        pageIndex: num,
        pageSize: size,
      };
      select_meta_ByPageAndCount(params).then((res) => {
        // console.log(res);
        this.tableData = res.result;
        this.count = res.count;
      });
    },
    // 请求数据数量
    getMetaCount(name) {
      queryDataCount(name).then((res) => {
        this.count = res.data;
      });
    },
    // 关键字查询
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.searchName = this.ruleForm.name.trim();
          this.getMetaData(10, 1, this.searchName);
          this.getMetaCount(this.searchName);
        } else {
          console.log("error submit!!");
          return false;
@@ -382,7 +401,6 @@
    // 重置查询
    resetForm(formName) {
      this.getMetaData(10, 1, "");
      this.getMetaCount("");
      this.searchName = "";
      this.$refs[formName].resetFields();
    },
@@ -424,7 +442,6 @@
              });
            }
            this.getMetaData(10, 1, "");
            this.getMetaCount("");
          });
        })
        .catch(() => {});
@@ -444,7 +461,6 @@
        .then(() => {
          dltMetaDatas(std).then((res) => {
            this.getMetaData(10, 1, "");
            this.getMetaCount("");
            this.$message({
              type: "success",
              message: "删除成功!",
@@ -507,31 +523,27 @@
      //   .catch(() => {});
    },
    handleStart(row) {
      publishMeta(row.id).then((res) => {
        console.log(res);
        this.getMetaData(10, 1, "");
        this.getMetaCount("");
      });
      // publishMeta(row.id).then((res) => {
      //   console.log(res);
      //   this.getMetaData(10, 1, "");
      // });
    },
    handleStop(row) {
      console.log(row.id);
      unpublishMeta(row.id).then((res) => {
        console.log(res);
        this.getMetaData(10, 1, "");
        this.getMetaCount("");
      });
      // unpublishMeta(row.id).then((res) => {
      //   console.log(res);
      //   this.getMetaData(10, 1, "");
      // });
    },
    // 条数修改
    handleSizeChange(val) {
      this.pageSize = val;
      this.getMetaData(this.pageSize, 1, this.searchName);
      this.getMetaCount(this.searchName);
    },
    // 页数修改
    handleCurrentChange(val) {
      this.pageNum = val;
      this.getMetaData(this.pageSize, this.pageNum, this.searchName);
      this.getMetaCount(this.searchName);
    },
  },
};