管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-18 cbbbc6bd2d854270b9342ce2ff2a3432aaca22cf
src/views/Archive/index.vue
@@ -1,41 +1,44 @@
<template>
  <div class="archive box_div">
  <div
    class="archive box_div"
    v-loading="loading"
    element-loading-background="rgba(0, 0, 0, 0.8)"
  >
    <div class="top_header">
      <div class="top_left">
        <My-bread :list="[`${$t('synthesis.synthesis')}`, `${$t('synthesis.archive')}`]"></My-bread>
      </div>
    </div>
    <div class="box_item ">
        <div class="box_left">资料类别</div>
        <div class="box_cont">
          <div v-if="isShowFirstCheck">
            <el-checkbox-group v-model="checkedDataType">
              <el-checkbox
                @change="handleCheckedDataTypeChange(item)"
                v-for="(item, index)  in showList"
                :label="item.name"
                :key="index"
              >{{item.name}}</el-checkbox>
            </el-checkbox-group>
          </div>
          <div
            v-if="!isShowFirstCheck"
            class="menu_div"
            v-for="(item, index) in showList"
            :key="index"
            @click="changeListDataType(item)"
          >
      <div class="box_left">资料类别</div>
      <div class="box_cont">
            <div
              :class="{menuActive:dataTypeName == item.name}"
              style="margin-left: 5px"
            >{{ item.name }}</div>
          </div>
        <div v-if="isShowFirstCheck">
          <el-checkbox-group v-model="checkedDataType">
            <el-checkbox
              @change="handleCheckedDataTypeChange(item)"
              v-for="(item, index)  in showList"
              :label="item.name"
              :key="index"
            >{{item.name}}</el-checkbox>
          </el-checkbox-group>
        </div>
        <div
          v-if="!isShowFirstCheck"
          class="menu_div"
          v-for="(item, index) in showList"
          :key="index"
          @click="changeListDataType(item)"
        >
          <div
            :class="{menuActive:dataTypeName == item.name}"
            style="margin-left: 5px"
          >{{ item.name }}</div>
        </div>
      </div>
      <div class="box_right">
        <div
          class="menu_div subpage_Div"
@@ -150,7 +153,7 @@
                @change="handleChange1"
                :props="{
              label: 'name',
              value: 'id',
              value: 'code',
              children: 'children',
              checkStrictly: true,
              emitPath: false,
@@ -168,7 +171,7 @@
              <el-button
                icon="el-icon-search"
                @click="searchDataLibSelectTabs"
                size="mini"
                size="small"
              >{{
              $t('common.iquery')
            }}</el-button>
@@ -176,7 +179,7 @@
                icon="el-icon-refresh"
                @click="restDataLibSelectTabs"
                type="info"
                size="mini"
                size="small"
              >{{
              $t('common.reset')
            }}</el-button>
@@ -184,7 +187,7 @@
            <el-form-item>
              <el-button
                @click="getSpaceMapVisibale"
                size="mini"
                size="small"
              >{{
              $t('synthesis.rangequery')
            }}</el-button>
@@ -192,7 +195,7 @@
            <el-form-item>
              <el-button
                @click="getdownloadList"
                size="mini"
                size="small"
              >{{
              $t('synthesis.DownloadList')
            }}</el-button>
@@ -202,14 +205,14 @@
        <div v-if="isMenuActive">
          <ul>
            <li
              v-for="(item, index) in dataType"
              v-for="(item, index) in dataTypeList"
              :key="index"
            >
              <div
                class="menu_div"
                @click="getShowTable(item)"
              >
                {{ item.tabDesc }}
                {{ item.tabDesc }} <span style="margin-left:20px">{{item.rows}}条</span>
              </div>
            </li>
          </ul>
@@ -253,7 +256,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
@@ -265,14 +268,16 @@
      :title="dialogtitle"
      :visible.sync="dialogVisible"
      width="90%"
      top="5vh"
      top="10vh"
      :modal="false"
      style="z-index:999"
      :before-close="handleClose"
    >
      <!-- 条件-->
      <el-dialog
        width="37%"
        :visible.sync="conditionVisible"
        append-to-body
        :modal="false"
        title="查询条件"
        :before-close="handleconditionClose"
      >
@@ -283,6 +288,7 @@
        >
          <el-form-item>
            <el-select
              :popper-append-to-body="false"
              @change="fieldChange($event)"
              v-model="formSql.field"
            >
@@ -296,7 +302,10 @@
            </el-select>
          </el-form-item>
          <el-form-item>
            <el-select v-model="formSql.condition">
            <el-select
              :popper-append-to-body="false"
              v-model="formSql.condition"
            >
              <el-option
                v-for="item in condOption"
                :key="item.value"
@@ -334,7 +343,6 @@
      <el-dialog
        width="30%"
        :visible.sync="innerVisible"
        append-to-body
      >
        <div class="contentBox">
          <ul>
@@ -352,7 +360,7 @@
      <el-dialog
        width="30%"
        :visible.sync="outerVisible"
        append-to-body
        :modal="false"
      >
        <el-form
          :model="fromfile"
@@ -427,7 +435,7 @@
            </el-table>
          </el-form-item>
          <el-form-item>
          <!-- <el-form-item>
            <el-row :gutter="20">
              <el-col
@@ -444,6 +452,56 @@
                >取消</el-button>
              </el-col>
            </el-row>
          </el-form-item> -->
        </el-form>
      </el-dialog>
      <el-dialog
        :title="$t('common.passworld')"
        :visible.sync="downloadLogVisible"
        width="30%"
        top="10vh"
        :modal="false"
        :show-close="false"
        :before-close="handleCloseDown"
      >
        <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="download1('codeForm')"
            >{{$t('common.confirm')}}</el-button>
            <el-button
              type="info"
              size="small"
              @click="closeDown1('codeForm')"
            >{{$t('common.cancel')}}</el-button>
          </el-form-item>
        </el-form>
      </el-dialog>
@@ -487,6 +545,13 @@
              icon="el-icon-search"
            >{{$t('common.reset')}}</el-button>
          </el-form-item>
          <el-form-item>
            <el-button
              type="info"
              @click="downloadForm()"
              icon="el-icon-download"
            >{{$t('common.download')}}</el-button>
          </el-form-item>
        </el-form>
        <el-divider class="eldivider" />
        <div style="width:100%;height:400px;">
@@ -520,7 +585,7 @@
            ></el-table-column>
            <el-table-column
              v-if="isMenuActive"
              min-width="80"
              min-width="120"
              align="center"
              :label="$t('common.operate')"
            >
@@ -545,7 +610,7 @@
              @size-change="handleSizeChange1"
              @current-change="handleCurrentChange1"
              :current-page="listTypeData.pageIndex"
              :page-sizes="[10, 20, 30, 40]"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="listTypeData.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="count1"
@@ -731,7 +796,7 @@
              @size-change="batchSizeChange"
              @current-change="batchCurrentChange"
              :current-page="batchPage.pageIndex"
              :page-sizes="[10, 20, 30, 40]"
              :page-sizes="[10, 20, 50, 100]"
              :page-size="batchPage.pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="batchPage.count"
@@ -874,6 +939,9 @@
      }
    };
    return {
      dataTypeList: [],
      loading: false,
      downloadLogVisible: false,
      downloadListVisible: false,
      data_type: [],
      project_name: [],
@@ -943,9 +1011,9 @@
      listData: {
        pageIndex: 1,
        pageSize: 10,
        depid: null,
        dirid: null,
        name: null
        depcode: null,
        dirs: null,
        tab: null
      },
      count: 0,
      count1: 0,
@@ -975,6 +1043,10 @@
        pageSize: 10,
        count: 0,
        name: null,
      },
      queryList: {
        showList1: '',
        showList2: ''
      }
    };
  },
@@ -1025,12 +1097,67 @@
    },
  },
  methods: {
    downloadMap(index, rows) {
      //     var token = '?token=' + getToken();
      //
      //  var url = BASE_URL + '/dataLib/downloadFile' + token + '&guid=' + rows.guid+ '&pwd='+  rows.pwd
      var token = getToken()
    handleCloseDown() {
    },
    download1() {
      if (this.codeForm.password == '' || this.codeForm.repassword == '') {
        return this.$message.error('密码不能为空');
      }
      if (this.codeForm.password != this.codeForm.repassword) {
        return;
      }
      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}$/;
      if (!passwordreg.test(this.codeForm.password)) {
        return;
      }
      this.downloadLogVisible = false;
      var obj = {
        entities: [this.listTypeData.name], // bpachydrogeology,bhydrogeologyattach
        filter: this.listTypeData.filter,
        pwd: encrypt.encrypt(this.codeForm.password)
      };
      this.loading = true;
      var that = this;
      $.ajax({
        url: BASE_URL + "/dataLib/downloadEntityReq?token=" + getToken(),
        type: "POST",
        data: JSON.stringify(obj),
        dataType: 'json', // html、json、jsonp、script、text
        contentType: "application/json", // "application/x-www-form-urlencoded"
        success: (data) => {
          if (data.code == 200) {
            that.downloadflie(data, this.codeForm.password)
          }
        },
        error: function (e) {
        }
      });
    },
    downloadflie(data, pwd) {
      this.codeForm = {
        password: '',
        repassword: '',
      }
      var token = getToken()
      var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + data.result + "&pwd=" + encrypt.encrypt(pwd);
      $("#downFrame").attr("src", url).click();
      this.loading = false;
    },
    closeDown1() {
      this.codeForm = {
        password: '',
        repassword: '',
      }
      this.downloadLogVisible = false;
    },
    downloadForm() {
      this.downloadLogVisible = true;
    },
    downloadMap(index, rows) {
      var token = getToken()
      var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + rows.guid + "&pwd=" + rows.pwd;
      $("#downFrame").attr("src", url).click();
    },
@@ -1062,7 +1189,7 @@
      }
      this.downloadTableData = data.result;
      console.log(this.downloadTableData, data.result.length, this.downloadPage)
      this.downloadPage.count = data.count;
    },
    handleCheckedEntryNameChange(res) {
@@ -1076,6 +1203,20 @@
          }
        }
      }
      var std = "";
      for (var i in this.checkedEntryName) {
        for (var j in this.showList1) {
          if (this.showList1[j].name == this.checkedEntryName[i]) {
            if (std.length != 0) {
              std += ","
            }
            std += this.showList1[j].id
          }
        }
      }
      this.queryList.showList2 = std;
      this.getQueryShowListData();
    },
    handleCheckedDataTypeChange(res) {
      if (this.checkedDataType.indexOf(res.name) != -1) {
@@ -1088,16 +1229,80 @@
          }
        }
      }
      var std = "";
      for (var i in this.checkedDataType) {
        for (var j in this.showList) {
          if (this.showList[j].name == this.checkedDataType[i]) {
            if (std.length != 0) {
              std += ","
            }
            std += this.showList[j].id
          }
        }
      }
      this.queryList.showList1 = std;
      this.getQueryShowListData();
    },
    changeListDataType(res) {
      if (this.isShowFirstCheck == false) {
        this.dataTypeName = res.name;
        this.queryList.showList1 = res.id;
        this.getQueryShowListData();
      }
    },
    getQueryShowListData() {
      var a1 = "";
      if (this.queryList.showList1 != "" && this.queryList.showList1 != null) {
        a1 = this.queryList.showList1;
      }
      if (this.queryList.showList2 != "" && this.queryList.showList2 != null) {
        if (a1.length != 0) {
          a1 += ","
        }
        a1 += this.queryList.showList2;
      }
      this.listData.dirs = a1;
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10;
      if (this.isMenuActive == true) {
        this.getDataLibSelectTabs()
      } else {
        this.queryInfo();
      }
    },
    restDataLibSelectTabs() {
      this.formInline.tab = ""
      this.queryList = {
        showList1: null,
        showList2: null,
      }
      this.formInline.depid = this.companyOption1[0].code;
      this.listData.depcode = this.companyOption1[0].code;
      this.checkedDataType = []
      this.dataTypeName = '不限';
      this.dataTypeName = null;
      this.checkedDataType = ['不限'];
      this.isShowFirstCheck = false
      this.checkedDataType = []
      this.dataTypeName = '不限';
      this.queryList.showList1 = null;
      this.isShowSecondCheck = false;
      this.checkedEntryName = []
      this.EntryName = '不限';
      this.queryList.showList2 = null;
      this.getQueryShowListData();
    },
    changeListEntryName(res) {
      if (this.isShowSecondCheck == false) {
        this.EntryName = res.name;
        this.queryList.showList2 = res.id;
        this.getQueryShowListData();
      }
    },
    getSpaceMapVisibale() {
@@ -1125,6 +1330,17 @@
      this.$store.state.download = false;
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = null;
      sgworld.Creator.SimpleGraphic.clear();
      if (this.entityaLayers.length != 0) {
        for (var i in this.entityaLayers) {
          sgworld.Viewer.entities.remove(this.entityaLayers[i]);
        }
        this.entityaLayers = [];
      }
    },
    moreEvent(res) {
      switch (res) {
@@ -1143,9 +1359,13 @@
          if (this.isShowFirstCheck == false) {
            this.checkedDataType = []
            this.dataTypeName = '不限';
            this.queryList.showList1 = null;
            this.getQueryShowListData();
          } else {
            this.dataTypeName = null;
            this.checkedDataType = ['不限']
            this.checkedDataType = ['不限'];
            this.queryList.showList1 = null;
            this.getQueryShowListData();
          }
          break;
@@ -1154,9 +1374,13 @@
          if (this.isShowSecondCheck == false) {
            this.checkedEntryName = []
            this.EntryName = '不限';
            this.queryList.showList2 = null;
            this.getQueryShowListData();
          } else {
            this.EntryName = null;
            this.checkedEntryName = ['不限']
            this.queryList.showList2 = null;
            this.getQueryShowListData();
          }
          break;
      }
@@ -1166,27 +1390,12 @@
      this.formInline.tab = ""
      switch (res) {
        case 1:
          this.listData = {
            pageIndex: 1,
            pageSize: 10,
          }
          this.getDataLibSelectTabs();
          this.isMenuActive = true;
          this.getQueryShowListData();
          break;
        case 2:
          this.listData = {
            pageIndex: 1,
            pageSize: 10,
            depid: null,
            dirid: null,
            name: null,
            verid: null
          }
          this.isMenuActive = false;
          this.getMetaData();
          this.getQueryShowListData();
          break;
      }
    },
@@ -1207,9 +1416,12 @@
        this.$message.error('单位列表获取失败');
        return;
      }
      this.formInline.depid = 1;
      // this.formInline.depid = 1;
      this.companyOption1 = this.treeData(res.result);
      // this.getMetaData();
      this.formInline.depid = this.companyOption1[0].code;
      this.listData.depcode = this.companyOption1[0].code;
      this.getQueryShowListData();
    },
    // 查询
@@ -1346,8 +1558,7 @@
      this.codeForm.repassword = '';
    },
    getMetaData() {
      this.listData.dirid = this.formInline.dirid
      this.listData.depid = this.formInline.depid;
      dataLib_selectByPageForMeta(this.listData).then((res) => {
        this.tableData1 = res.result;
@@ -1362,10 +1573,9 @@
      this.getMetaData();
    },
    handleChange1(value) {
      this.listData.pageSize = 10;
      this.listData.pageIndex = 1;
      this.formInline.depid = value;
      this.getMetaData();
      this.listData.depcode = value;
      this.getQueryShowListData();
    },
    //树列表生成
    treeData(source) {
@@ -1384,13 +1594,7 @@
        this.queryInfo();
      }
    },
    restDataLibSelectTabs() {
      this.formInline.tab = ""
      this.listData.pageIndex = 1;
      this.listData.pageSize = 10
      this.searchDataLibSelectTabs();
    },
    async getDataLibSelectTabs() {
      this.listData.tab = this.formInline.tab
      const data = await dataLib_selectTabs(this.listData);
@@ -1398,13 +1602,13 @@
        this.$message.error('列表调用失败');
        return;
      }
      this.count = data.count;
      this.dataType = data.result;
      this.dataTypeList = data.result;
    },
    showDetail1(row) {
      this.showinfoBox1 = true;
      this.itemdetail1 = row;
    },
    // 关闭查看
@@ -1434,6 +1638,7 @@
      this.getCollapseTable(this.filedsLayer);
    },
    async showDetail2(res) {
      var val = res.tab.split(".");
      const data = await dataLib_selectTabFields({
@@ -1601,7 +1806,8 @@
      } else {
        this.listTypeData.filter = null;
      }
      this.listTypeData.depcode = this.listData.depcode;
      this.listTypeData.dirs = this.listData.dirs
      const data = await dataLib_selectByPage(this.listTypeData);
      if (data.code != 200) {
        this.$message.error('调用列表失败,请联系工作人员!');
@@ -1948,8 +2154,8 @@
    width: calc(100% - 60px);
    height: auto;
    margin: 5px 30px;
    padding-bottom:5px ;
 border-bottom: 1px solid #dcdfe6;
    padding-bottom: 5px;
    border-bottom: 1px solid #dcdfe6;
    align-items: center;
    display: flex;
    float: left;
@@ -2067,14 +2273,11 @@
    border-radius: 10px;
  }
}
.contentBox {
  height: 60vh;
  overflow: auto;
}
.downloadBox {
  z-index: 999;
  /deeep/.el-form-item {
    margin-bottom: 0px;
  }
   /deeep/ .el-dialog__wrapper{
    z-index: 999;
  }
}
</style>