管道基础大数据平台系统开发-【前端】-新系統界面
src/views/Archive/index.vue
@@ -123,6 +123,19 @@
              class="el-input__icon el-icon-search"
            ></i></el-input>
        </el-form-item>
        <!-- 批量下載 -->
        <el-form-item
          style="float:right"
          v-if="formInline.dataType =='type2'"
        >
          <el-button
            type="success"
            size="small"
            icon="el-icon-download"
            @click="setCardDownload"
          >{{$t('common.download')}}</el-button>
        </el-form-item>
        <!-- 空间查询 -->
        <el-form-item style="float:right">
          <el-button
@@ -162,6 +175,12 @@
            >
              <span v-show="formInline.dataType =='type2'">
                <el-checkbox
                  v-model="item.ischecked"
                  @change="handleCheckedDataTypeChange(item)"
                  style="margin-right:10px"
                >
                </el-checkbox>
                <span v-if="item.ismeta > 0">
                  <el-link
                    style="color: #409eff"
@@ -181,17 +200,25 @@
              <span v-show="formInline.dataType !='type2'">{{item.tabDesc}}</span>
              <div style="float: right; padding: 3px 0">
                <i
                  v-show="formInline.dataType=='type2' "
                  v-if="showView(item, /[]/)"
                  class="el-icon-view"
                  :title="$t('common.preview')"
                  @click="setAttatchFileView(index, item)"
                ></i>
                <i
                  style="margin-left:10px"
                  class="el-icon-tickets"
                  :title="$t('common.details')"
                  @click="setCardDetails(item)"
                ></i>
                <i
                <!-- <i
                  v-show="formInline.dataType=='type2'"
                  style="margin-left:10px"
                  class="el-icon-download"
                  :title="$t('common.download')"
                  @click="setCardDownload(item)"
                ></i>
                ></i> -->
                <i
                  v-show="!item.isShow"
                  style="margin-left:10px"
@@ -216,6 +243,8 @@
              <div class="cardItem"> {{$t('archiveObj.dataType')}} : {{ item.mold }} </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.format')}} : {{ item.type }} </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.size')}} : {{stateFormatSizes(item.sizes)}} </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.tab')}} : {{ item.tab }} </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.row')}} : {{ item.rows }} </div>
              <div class="cardItem"> {{$t('archiveObj.downloads')}} : {{ item.downCount }} 次 </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.createonuser')}} : {{item.uname}} </div>
              <div class="cardItem"> {{$t('dataManage.vmobj.depName')}} : {{item.depName}} </div>
@@ -232,6 +261,7 @@
            </div>
          </el-card>
        </div>
      </div>
      <div class="archBottomBox">
        <div style="margin-top:10px">
@@ -261,6 +291,10 @@
        <p>{{ $t('dataManage.vmobj.format') }}:{{ itemdetail1.type }}</p>
        <el-divider></el-divider>
        <p>{{ $t('common.size') }}:{{ stateFormatSizes(itemdetail1.sizes) }}</p>
        <el-divider></el-divider>
        <p>{{ $t('dataManage.vmobj.tab') }}:{{  itemdetail1.tab }}</p>
        <el-divider></el-divider>
        <p>{{ $t('dataManage.vmobj.row') }}:{{itemdetail1.rows }}</p>
        <el-divider></el-divider>
        <p>{{ $t('archiveObj.downloads') }}:{{ itemdetail1.downCount }} 次</p>
        <el-divider></el-divider>
@@ -518,6 +552,7 @@
            </el-form-item>
          </el-form>
          <el-table
            @cell-dblclick="copyText"
            :data="tableAttach"
            ref="filterTable"
            height="calc(100% - 130px)"
@@ -616,6 +651,7 @@
        </el-form>
        <el-divider />
        <el-table
          @cell-dblclick="copyText"
          ref="filterTable"
          :data="tableData"
          border
@@ -739,6 +775,7 @@
      <div class="downloadBox">
        <div class="archdowntop">
          <el-table
            @cell-dblclick="copyText"
            :data="downloadTableData"
            style="width: 100%"
            height="calc(100% - 5px)"
@@ -816,6 +853,7 @@
      <div style="height: 65vh; width: 100%">
        <el-table
          @cell-dblclick="copyText"
          ref="filterTable"
          :data="metaDataTable1"
          style="width: 100%"
@@ -920,6 +958,7 @@
          </el-form-item>
        </el-form>
        <el-table
          @cell-dblclick="copyText"
          ref="filterTable"
          :data="metaDataTable"
          style="width: 100%"
@@ -1030,14 +1069,134 @@
        v-if="dialog.isJpg"
        class="pdfClass"
      >
        <img
        <el-image
          style="width:100%; height:100%"
          :src="dialog.src"
          alt=""
        />
          :preview-src-list="[dialog.src]"
        >
        </el-image>
      </div>
    </el-dialog>
    <el-dialog
      title="数据申请"
      :visible.sync="dialogInsertVisible"
      width="30%"
      top="35vh"
      :modal="false"
      :before-close="handleInsertClose"
    >
      <div style="width: 100%; max-height: 450px; overflow-y: auto">
        <el-form
          ref="form"
          :model="ruleForm"
          label-width="100px"
        >
          <el-form-item label="审核单位">
            <div>
              <ul>
                <li v-for="item in ruleForm.depid">
                  {{ item.name }}
                </li>
              </ul>
            </div>
          </el-form-item>
          <el-form-item label="表名">
            <div>
              <ul>
                <li v-for="item in ruleForm.tabs">
                  {{ item.tabDesc }}
                </li>
              </ul>
            </div>
          </el-form-item>
          <el-form-item label="条件">
            <el-input
              :title="ruleForm.wkt"
              v-model="ruleForm.wkt"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item label="描述">
            <el-input
              type="textarea"
              placeholder="请输入内容"
              v-model="ruleForm.descr"
              maxlength="50"
              show-word-limit
            >
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-button
              class="primary"
              size="small"
              @click="getInsertDown"
            >{{
              $t("common.confirm")
            }}</el-button>
            <el-button
              type="info"
              size="small"
              @click="closeInsertDown"
            >{{
              $t("common.cancel")
            }}</el-button>
          </el-form-item>
        </el-form>
      </div>
    </el-dialog>
    <el-dialog
      :title="$t('common.passworld')"
      :visible.sync="dialogVisible1"
      width="30%"
      top="35vh"
      :modal="false"
      :before-close="handleCloseDown1"
    >
      <el-form
        :model="codeForm"
        :rules="rules"
        ref="codeForm"
        label-width="100px"
        class="codeForm"
      >
        <el-form-item
          :label="$t('common.passworld')"
          prop="password"
        >
          <el-input
            type="password"
            v-model="codeForm.password"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item
          :label="$t('common.SPassword')"
          prop="repassword"
        >
          <el-input
            type="password"
            v-model="codeForm.repassword"
            show-password
          ></el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            class="primary"
            size="small"
            @click="downloadx('codeForm')"
          >{{ $t("common.confirm") }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="closeDownx('codeForm')"
          >{{
            $t("common.cancel")
          }}</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <iframe
      id="downFrame"
      src=""
@@ -1070,6 +1229,7 @@
  dataLib_selectFiles,
  dataLib_deletes
} from '../../api/api';
import { dataLibView } from '@/api/screen.js'
export default {
  components: {
    MyBread, MapSdk
@@ -1096,6 +1256,7 @@
      }
    };
    return {
      fromfile: { file: '' },
      fromSqlflag: false,
      filedsOption: [],
@@ -1198,16 +1359,108 @@
        isPdf: false,
        isJpg: false,
        src: ''
      }
      },
      checkedDataType: [],
      ruleForm: {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      },
      dialogInsertVisible: false,
      dialogVisible1: false,
    };
  },
  mounted() {
    this.getDepTreeData();
    this.getCategorySelectData();
    this.getItemSelectData();
    this.signGetPublicKey();
    this.$bus.$on("setDialogInsertVisible", (res) => {
      if (res == true) {
        this.dialogVisible1 = true;
      } else {
        this.setDialogInsertVisible(res);
      }
    })
  },
  methods: {
    handleCloseDown1() {
      this.$confirm("确认关闭?")
        .then(_ => {
          this.closeDownx();
        })
        .catch(_ => { })
    },
    downloadx() {
      this.$bus.$emit("setInsertDown", this.codeForm)
      this.closeDownx();
    },
    closeDownx() {
      this.dialogVisible1 = false;
      this.codeForm = {
        password: '',
        repassword: '',
      }
    },
    getInsertDown() {
      this.dialogInsertVisible = false;
      this.dialogVisible1 = true;
      //
    },
    closeInsertDown() {
      this.ruleForm = {
        depname: [],
        tabs: [],
        pwd: null,
        repwd: null,
        wkt: null,
        descr: null,
      }
      this.dialogInsertVisible = false
    },
    handleInsertClose() {
      this.$confirm("确认关闭?")
        .then(_ => {
          this.closeInsertDown()
        })
        .catch(_ => { })
    },
    setDialogInsertVisible(res) {
      this.ruleForm = res;
      this.dialogInsertVisible = true;
    },
    copyText(row, column, cell, event) {
      // 双击复制
      let save = function (e) {
        e.clipboardData.setData('text/plain', event.target.innerText);
        e.preventDefault();  //阻止默认行为
      }
      document.addEventListener('copy', save);//添加一个copy事件
      document.execCommand("copy");//执行copy方法
      this.$message({ message: '复制成功', type: 'success' })//提示
    },
    //批量下载复选框chagne
    handleCheckedDataTypeChange(res) {
      var std = 0;
      for (var i = 0; i < this.multipleSelection1.length; i++) {
        if (res.guid == this.multipleSelection1[i].guid) {
          std = i;
        }
      }
      if (std == 0) {
        this.multipleSelection1.push(res);
      } else {
        this.multipleSelection1.splice(std, 1)
      }
      console.log(this.multipleSelection1)
    },
    matchState(state = "", reg) {
      var row = state.row;
      var name = row.name;
@@ -1257,20 +1510,44 @@
    },
    //附件查看
    setAttatchDetail(index, row) {
      this.refreshAttatchDetail()
      var name = row.name;
      if (name.indexOf('.pdf') != -1) {
        this.dialog.dialogVisible = true;
        this.dialog.isPdf = true;
        var url = BASE_URL + "/res/downloadForView?guid=" + row.guid + "&token=" + getToken();
        var url = BASE_URL + "/comprehensive/downloadForView?guid=" + row.guid + "&token=" + getToken();
        this.dialog.src = url
      } else if (name.indexOf('.jpg') != -1 || name.indexOf('.gif') != -1 || name.indexOf('.png') != -1 || name.indexOf('.jpeg') != -1) {
        this.dialog.dialogVisible = true;
        this.dialog.isJpg = true;
        var url = BASE_URL + "/res/downloadForView?guid=" + row.guid + "&token=" + getToken();
        var url = BASE_URL + "/comprehensive/downloadForView?guid=" + row.guid + "&token=" + getToken();
        this.dialog.src = url
      }
    },
    setAttatchFileView(index, row) {
      this.refreshAttatchDetail()
      var name = `${row.name}.${row.type}`;
      if (name.indexOf('.pdf') != -1) {
        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.dialogVisible = true;
      var url = BASE_URL + "/dataLib/downloadForView?guid=" + row.guid + "&token=" + getToken();
      this.dialog.src = url;
    },
    showView(res) {
      var name = res.type
      if (name) {
        if (name.indexOf('pdf') != -1 || name.indexOf('jpg') != -1 || name.indexOf('gif') != -1 || name.indexOf('png') != -1 || name.indexOf('jpeg') != -1) {
          return true
        } else {
          return false
        }
      }
    },
    //附件刪除
    async setAttachDel() {
@@ -1392,10 +1669,13 @@
      this.metaDataTable1 = [data.result];
    },
    getSpaceMapVisibale() {
      sgworld.Creator.SimpleGraphic.clear();
      for (var i in this.$store.state.queryInfo) {
        sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
      if (window.sgworld) {
        window.sgworld.Creator.SimpleGraphic.clear();
        for (var i in this.$store.state.queryInfo) {
          window.sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
      }
      this.$store.state.queryInfo = [];
      if (this.$store.state.primitLayer != null) {
        sgworld.Viewer.entities.remove(this.$store.state.primitLayer);
@@ -1545,7 +1825,7 @@
      }
      var obj = {
        entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach
        filter: this.formInline.filter,
        filter: this.listBankData.filter,
        pwd: encrypt.encrypt(this.codeForm.password),
        depcodes: [this.listData.depcode],
        dirs: this.listData.dirs
@@ -1637,6 +1917,11 @@
      $("#downFrame").attr("src", url).click();
      this.closeDown();
      this.monthdata.filter((res) => {
        return res.ischecked = false;
      })
      this.multipleSelection1 = [];
    },
    closeDown() {
      this.passWorldVisible = false;
@@ -1645,8 +1930,8 @@
    },
    //文件下载
    setCardDownload(res) {
      this.multipleSelection1 = [];
      this.multipleSelection1.push(res);
      // this.multipleSelection1 = [];
      // this.multipleSelection1.push(res);
      if (this.multipleSelection1.length == 0) {
        this.$message({
          message: '请先选择要下载的文件',
@@ -1739,13 +2024,26 @@
        }
      }
      for (var i in data.result) {
        if (data.result[i].createtime != null) {
        if (data.result[i].createtime) {
          data.result[i].createtime = this.format(data.result[i].createtime)
        }
        if (data.result[i].updatetime != null) {
        if (data.result[i].updatetime) {
          data.result[i].updatetime = this.format(data.result[i].updatetime)
        }
        data.result[i].createuser = data.result[i].createName
        data.result[i].updateuser = data.result[i].updateName
        if (data.result[i].verName) {
          data.result[i].verid = data.result[i].verName
        }
        if (data.result[i].depName) {
          data.result[i].depid = data.result[i].depName
        }
        if (data.result[i].dirName) {
          data.result[i].dirid = data.result[i].dirName
        }
      }
      this.listBankData.count = data.count;
      this.tableData = data.result;
@@ -1900,7 +2198,6 @@
      this.listData.pageIndex = 1;
      this.listData.pageSize = val;
      switch (this.formInline.dataType) {
        case "type2"://文件数据
          this.getQueryFileData();
          break;
@@ -1913,7 +2210,6 @@
    handleCurrentChange(val) {
      this.listData.pageIndex = val;
      switch (this.formInline.dataType) {
        case "type2"://文件数据
          this.getQueryFileData();
          break;
@@ -1994,7 +2290,7 @@
    //查询文件数据
    async getQueryFileData() {
      this.listData.dirs = "";
      this.listData.count = 0;
      if (this.formInline.category.length != 0) {
        this.listData.dirs += this.formInline.category.toString();
      }
@@ -2010,18 +2306,21 @@
      if (data.code != 200) {
        this.$message.error('文件数据列表调用失败');
      }
      var val = data.result;
      if (val) {
        val = val.filter((res) => {
          var type = "." + res.type;
          res.name = res.name.replaceAll(type, "")
          res.mold = "文件"
          res.isShow = false
          res.mold = "文件";
          res.isShow = false;
          res.ischecked = false;
          return res;
        })
        this.monthdata = val;
        this.listData.count = data.count;
      } else {
        this.monthdata = [];
        this.listData.count = 0;