管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-05-27 0af4ecb9b2047b8ba6d00e891050cf2d68b829a6
src/views/datamanage/uploadmanage.vue
@@ -129,6 +129,7 @@
            size="small"
            :title="$t('dataManage.vmobj.keyword')"
            v-model="formInline.name"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuedataName')"
          > <i
              @click="getTableData"
              :title="$t('common.iquery')"
@@ -440,7 +441,7 @@
      :close-on-click-modal="false"
      :show-close="false"
    >
      <div style="width:100%;height:30vh">
      <div style="width:100%; ">
        <el-form
          ref="form"
          :model="insertLayer"
@@ -458,7 +459,28 @@
              v-model="insertLayer.number"
            ></el-input>
          </el-form-item>
          <el-form-item :label="$t('dataManage.vmobj.minLevel')">
          <el-form-item
            :label="$t('dataManage.vmobj.labe14')"
            v-show="formInline.type =='DOM'"
          >
            <el-select
              style="width:100%"
              v-model="insertLayer.noData"
            >
              <el-option
                label="黑色"
                value="0"
              ></el-option>
              <el-option
                label="白色"
                value="255"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item
            v-show="formInline.type !='DEM'"
            :label="$t('dataManage.vmobj.minLevel')"
          >
            <!-- <el-input
              v-model="insertLayer.min"
              :placeholder="$t('dataManage.vmobj.labe11')"
@@ -477,7 +499,10 @@
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('dataManage.vmobj.maxLevel')">
          <el-form-item
            :label="$t('dataManage.vmobj.maxLevel')"
            v-show="formInline.type !='DEM'"
          >
            <!-- <el-input
              v-model="insertLayer.max"
              :placeholder="$t('dataManage.vmobj.labe12')"
@@ -551,6 +576,7 @@
  publish_update,
  publish_insert,
} from '../../api/api.js'
import { conditions } from '../Archive/Archive';
export default {
  components: {
@@ -583,6 +609,9 @@
        value: 'DOM',
        label: '影像数据(.tif, .img)'
      }, {
        value: 'DEM',
        label: '高程数据(.tif)'
      }, {
        value: 'MPT',
        label: '场景数据(.mpt)'
      }, {
@@ -608,7 +637,7 @@
      detailsDialogVisible: false,
      itemdetail: {},
      insertDialogVisible: false,
      insertLayer: { name: '', number: null, min: 4, max: 18 },
      insertLayer: { name: '', number: null, min: 4, max: 18, noData: '0' },
      loadDialogVisible: false,
      options: [],
      isFullscreen: false,
@@ -627,7 +656,7 @@
    },
    setOptions() {
      var std = [];
      for (var i = 0; i < 21; i++) {
      for (var i = 0; i < 23; i++) {
        std.push({
          value: i,
          label: i
@@ -644,32 +673,31 @@
    },
    //发布提交
    async setinsertLayerSubmit() {
      var min = this.insertLayer.min;
      var max = this.insertLayer.max;
      var name = this.insertLayer.name;
      if (this.formInline.type == 'DEM') {
        min = 0;
        max = 18;
      }
      if (!name) {
        this.$message.error("名称不能为空")
        return
      }
      if (!min) {
        this.$message.error("请输入最小级别(0 ~ 20)")
        return
      } else {
        if (parseInt(min) < 0 || parseInt(min) > 20) {
          this.$message.error(" 最小级别不能小于 0 或大于 20 ")
          return
        }
      }
      if (!max) {
        this.$message.error("请输入最大级别(0 ~ 20)")
      if (parseInt(min) < 0 || parseInt(min) > 20) {
        this.$message.error("最小级别不能小于 0 或大于 20 ")
        return
      } else {
        if (parseInt(max) < 0 || parseInt(max) > 20) {
          this.$message.error(" 最大级别不能小于 0 或大于 20 ")
          return
        }
      }
      if (parseInt(max) < 0 || parseInt(max) > 20) {
        this.$message.error(" 最大级别不能小于 0 或大于 20 ")
        return
      }
      if (parseInt(min) > parseInt(max)) {
        this.$message.error("最小级别不得大于最大级别")
        return
@@ -685,20 +713,21 @@
        max: max,
        name: name,
        ids: std,
        type: this.formInline.type
        type: this.formInline.type,
        noData: this.insertLayer.noData
      }
      this.loadDialogVisible = true
      this.insertDialogVisible = false;
      const data = await publish_insert(obj);
      if (data.code != 200 || data.count > 0) {
        this.$message.error("数据发布失败")
      } else {
      if (data.code == 200 && data.result > 0) {
        this.$message({
          message: '数据发布成功',
          type: 'success'
        });
      } else {
        this.$message.error("数据发布失败")
      }
      this.loadDialogVisible = false
      this.getTableData();
@@ -707,25 +736,28 @@
    //数据发布
    async setPagePublish() {
      if (this.multipleSelection.length == 0) {
        this.$message.error("请选择要发布的数据")
        this.$message("请选择要发布的数据")
        return
      }
      if (this.formInline.type == "DOM") {
        this.insertLayer.name = this.formInline.dirName;
      if (this.formInline.type == "DOM" || this.formInline.type == "DEM") {
        this.insertLayer.name = this.multipleSelection[0].name.split('.')[0];
        this.insertLayer.number = this.multipleSelection.length
        this.insertLayer.noData = '0';
        this.insertDialogVisible = true;
      } else {
        var std = [];
        for (var i in this.multipleSelection) {
          std.push(this.multipleSelection[i].id)
        }
        var obj = {
          dircode: this.formInline.dirid,
          depcode: this.formInline.depid,
          ids: std,
          type: this.formInline.type
        }
        this.loadDialogVisible = true
        this.insertDialogVisible = false;
@@ -750,6 +782,11 @@
    },
    //修改提交
    async setEditLayerSubmit() {
      if (this.editLayer.url) {
        var url = this.editLayer.url;
        this.editLayer.url = url.replace(iisHost, "{host}");
      }
      const data = await publish_update(this.editLayer);
      if (data.code != 200) {
        this.$message.error("数据修改失败")
@@ -865,13 +902,13 @@
    //分页切换
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      this.getTableData();
      this.getTableData_one();
    },
    //每页显示数量
    handleSizeChange(val) {
      this.listData.pageSize = val;
      this.listData.pageIndex = 1;
      this.getTableData();
      this.getTableData_one();
    },
    //tabs切換
    setTabsChange(res) {
@@ -907,17 +944,17 @@
      if (this.active == "first") {
        this.listData = {
          pageIndex: 1,
          pageSize: 100,
          pageSize: 10,
          count: 0
        }
        this.showPageSize = [100, 200, 500, 1000]
        this.showPageSize = [10, 50, 100, 200]
      } else {
        this.listData = {
          pageIndex: 1,
          pageSize: 10,
          count: 0
        }
        this.showPageSize = [10, 20, 50, 100]
        this.showPageSize = [10, 50, 100, 200]
      }
      this.formInline.type = this.typeOption[0].value;
@@ -972,8 +1009,13 @@
    },
    //获取Table表格数据
    async getTableData() {
      this.tableData = [];
      this.listData.count = 0;
      this.listData.pageIndex = 1;
      this.getTableData_one();
    },
    async getTableData_one() {
      this.tableData = [];
      if (this.active == "first") {
        this.listData.depcode = this.formInline.depid;
@@ -1013,18 +1055,20 @@
        if (data.result) {
          var that = this
          var val = data.result.filter((res) => {
            if (res.createTime) {
              res.createTime = that.format(res.createTime);
          var val = data.result.filter((rs) => {
            if (rs.createTime) {
              rs.createTime = that.format(rs.createTime);
            }
            if (res.updateTime) {
              res.updateTime = that.format(res.updateTime);
            if (rs.updateTime) {
              rs.updateTime = that.format(rs.updateTime);
            }
            if (res.url) {
              res.url = res.url.replace("{host}", iisHost);
            if (rs.url) {
              rs.url = rs.url.replace("{host}", iisHost);
            }
            return res
            return rs
          })
          this.tableData = val;
          this.listData.count = data.count;
        }