ce
lxl
2022-10-25 c370065634a1d3d56d3046e2f3043906eb3d6202
src/views/datamanage/metadataManage.vue
@@ -22,13 +22,13 @@
            size="small"
            >重置</el-button
          >
          <el-button
          <!-- <el-button
            @click="downFormData"
            icon="el-icon-download"
            type="success"
            size="small"
            >下载</el-button
          >
          > -->
          <!-- <el-button
            @click="downFormData"
            icon="el-icon-download"
@@ -59,21 +59,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 +167,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>
@@ -264,7 +265,7 @@
<script>
import {
  queryMetaData,
  queryDataCount,
  // queryDataCount,
  updateMetaData,
  dltMetaDatas,
  publishMeta,
@@ -319,10 +320,9 @@
  },
  created() {
    this.getMetaData(10, 1, "");
    this.getMetaCount("");
  },
  methods: {
     ShowWindowFly(res) {
    ShowWindowFly(res) {
      console.log(res);
      if (res == "") return;
      if (res.indexOf(".xls") != -1) {
@@ -356,23 +356,24 @@
    },
    // 请求数据内容
    getMetaData(size, num, name) {
      queryMetaData(size, num, name).then((res) => {
        this.tableData = res.data;
      let params = {
        name: name,
        pageIndex: num,
        pageSize: size,
      };
      queryMetaData(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 +383,6 @@
    // 重置查询
    resetForm(formName) {
      this.getMetaData(10, 1, "");
      this.getMetaCount("");
      this.searchName = "";
      this.$refs[formName].resetFields();
    },
@@ -424,7 +424,6 @@
              });
            }
            this.getMetaData(10, 1, "");
            this.getMetaCount("");
          });
        })
        .catch(() => {});
@@ -444,7 +443,6 @@
        .then(() => {
          dltMetaDatas(std).then((res) => {
            this.getMetaData(10, 1, "");
            this.getMetaCount("");
            this.$message({
              type: "success",
              message: "删除成功!",
@@ -507,31 +505,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);
    },
  },
};