From 9dedc69f2c18b28cf18807531b6c8b81e6ad77e3 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期日, 26 二月 2023 14:05:18 +0800
Subject: [PATCH] 资料馆界面重构,优化

---
 src/views/Archive/index.vue | 1122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 1,107 insertions(+), 15 deletions(-)

diff --git a/src/views/Archive/index.vue b/src/views/Archive/index.vue
index 48de824..ff1a79a 100644
--- a/src/views/Archive/index.vue
+++ b/src/views/Archive/index.vue
@@ -4,6 +4,7 @@
       <My-bread :list="[`${$t('synthesis.synthesis')}`, `${$t('synthesis.archive')}`]"></My-bread>
       <!-- 涓嬭浇鍒楄〃 -->
       <i
+        @click="getdownloadList"
         class="el-icon-tickets"
         :title="$t('synthesis.DownloadList')"
       ></i>
@@ -61,7 +62,7 @@
           </el-select>
         </el-form-item>
         <!-- 椤圭洰鍚嶇О -->
-        <el-form-item :title="$t('archiveObj.dataClass')">
+        <el-form-item :title="$t('archiveObj.entryName')">
           <el-select
             :popper-append-to-body="false"
             v-model="formInline.item"
@@ -122,19 +123,23 @@
               class="el-input__icon el-icon-search"
             ></i></el-input>
         </el-form-item>
+        <!-- 绌洪棿鏌ヨ -->
         <el-form-item style="float:right">
           <el-button
             type="primary"
             size="small"
             icon="el-icon-search"
+            @click="getSpaceMapVisibale"
           >{{$t('synthesis.rangequery')}}</el-button>
 
         </el-form-item>
+        <!-- 閲嶇疆 -->
         <el-form-item style="float:right">
           <el-button
             type="info"
             size="small"
             icon="el-icon-refresh"
+            @click="setQuerAllTablesRefresh"
           >{{$t('common.reset')}}</el-button>
 
         </el-form-item>
@@ -165,6 +170,7 @@
                   style="margin-left:10px"
                   class="el-icon-download"
                   :title="$t('common.download')"
+                  @click="setCardDownload(item)"
                 ></i>
                 <i
                   v-show="!item.isShow"
@@ -190,6 +196,7 @@
               <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('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>
               <div class="cardItem"> {{$t('dataManage.vmobj.createontime')}} : {{format(item.createTime)}} </div>
@@ -202,14 +209,11 @@
               <div class="cardItem"> {{$t('archiveObj.dataType')}} : {{ item.mold }} </div>
               <div class="cardItem"> {{$t('dataManage.vmobj.row')}} : {{ item.rows }} </div>
               <!-- <div class="cardItem"> {{$t('archiveObj.storageType')}} : {{ item.tableType }} </div> -->
-
             </div>
           </el-card>
         </div>
-
       </div>
       <div class="archBottomBox">
-
         <div class="pagination_box">
           <el-pagination
             @size-change="handleSizeChange"
@@ -224,19 +228,539 @@
         </div>
       </div>
     </div>
+    <!-- 鏂囦欢璇︽儏 -->
+    <el-dialog
+      :title="$t('common.details')"
+      :visible.sync="showinfoBox1"
+      :close-on-click-modal="false"
+      width="30%"
+    >
+      <div class="contentBox">
+        <p>{{ $t('dataManage.vmobj.name') }}锛歿{ itemdetail1.name }}</p>
+        <el-divider></el-divider>
+        <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('archiveObj.downloads') }}锛歿{ itemdetail1.downCount }} 娆�</p>
+        <el-divider></el-divider>
+        <p>{{ $t('archiveObj.label9') }}锛歿{ itemdetail1.lastUser }} </p>
+        <el-divider></el-divider>
+        <p>{{ $t('archiveObj.label8') }}锛歿{setInfoBoxTime(itemdetail1.lastTime) }} </p>
+        <el-divider></el-divider>
+
+        <p>{{ $t('dataManage.vmobj.depName') }}锛歿{ itemdetail1.depName }}</p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.gather') }}锛歿{
+              setInfoBoxTime(itemdetail1.gather)
+            }}
+        </p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.describe') }}锛歿{ itemdetail1.describe }}
+        </p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.createonuser') }}锛歿{ itemdetail1.uname }}
+        </p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.createontime') }}锛歿{
+              setInfoBoxTime(itemdetail1.createTime)
+            }}
+        </p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.updateonuser') }}锛歿{
+              itemdetail1.updateUser
+            }}
+        </p>
+        <el-divider></el-divider>
+        <p>
+          {{ $t('dataManage.vmobj.updateontime') }}锛歿{
+              setInfoBoxTime(itemdetail1.updateTime)
+            }}
+        </p>
+      </div>
+    </el-dialog>
+    <!-- 鏁版嵁搴撹鎯� -->
+    <el-dialog
+      :title=" this.listBankData.title"
+      :visible.sync="dialogVisible"
+      :close-on-click-modal="false"
+      width="90%"
+      top="12vh"
+    >
+
+      <!-- 瀵嗙爜妗� -->
+      <el-dialog
+        :title="$t('common.passworld')"
+        :visible.sync="downloadLogVisible"
+        :close-on-click-modal="false"
+        top="15vh"
+        width="30%"
+        :show-close="false"
+        :modal="false"
+      >
+        <el-form
+          :model="codeForm"
+          :rules="rules"
+          ref="codeForm"
+          label-width="100px"
+          class="codeForm"
+        >
+          <el-form-item
+            :label="$t('common.passworld')"
+            prop="password"
+          >
+            <el-input
+              size="small"
+              type="password"
+              v-model="codeForm.password"
+              show-password
+            ></el-input>
+          </el-form-item>
+          <el-form-item
+            :label="$t('common.SPassword')"
+            prop="repassword"
+          >
+            <el-input
+              size="small"
+              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>
+
+      <!-- 鏁版嵁搴搕able璇︽儏 -->
+      <el-dialog
+        width="30%"
+        :visible.sync="itemDetailVisible"
+        :modal="false"
+      >
+        <div
+          class="contentBox"
+          style="height:60vh;overflow:auto"
+        >
+          <ul>
+            <li v-for="(item, index) in itemdetail">
+              <p>
+                <label> {{ item.label }}:</label>
+                <label class="boxlabel">{{ item.value }}</label>
+              </p>
+              <el-divider></el-divider>
+            </li>
+          </ul>
+        </div>
+      </el-dialog>
+      <!-- 鏌ヨ鏉′欢 -->
+      <!-- 鏉′欢-->
+      <el-dialog
+        width="43%"
+        :visible.sync="conditionVisible"
+        :modal="false"
+        title="鏌ヨ鏉′欢"
+        :show-close="false"
+      >
+        <el-form
+          :inline="true"
+          :model="formSql"
+          class="demo-form-inline"
+        >
+          <el-form-item>
+            <el-select
+              size="small"
+              :popper-append-to-body="false"
+              @change="fieldChange($event)"
+              v-model="formSql.field"
+            >
+              <el-option
+                v-for="item in filedsOption"
+                :key="item.field"
+                :label="item.alias"
+                :value="item.field"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-select
+              size="small"
+              :popper-append-to-body="false"
+              v-model="formSql.condition"
+            >
+              <el-option
+                v-for="item in condOption"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item v-show="!fromSqlflag">
+            <el-input
+              size="small"
+              v-model="formSql.value"
+            ></el-input>
+          </el-form-item>
+          <el-form-item v-show="fromSqlflag">
+            <el-date-picker
+              size="small"
+              v-model="formSql.date"
+              type="date"
+              placeholder="閫夋嫨鏃ユ湡"
+              value-format="yyyy-MM-dd"
+            >
+            </el-date-picker>
+          </el-form-item>
+        </el-form>
+        <span
+          slot="footer"
+          class="dialog-footer"
+        >
+          <el-button
+            size="small"
+            @click="startFiledAndcondition"
+          >鍙� 娑�</el-button>
+          <el-button
+            size="small"
+            type="primary"
+            @click="appendQueryFilter"
+          >纭� 瀹�</el-button>
+        </span>
+      </el-dialog>
+      <div style="height:68vh">
+        <el-form
+          :model="formInline"
+          :inline="true"
+        >
+          <el-form-item>
+            <el-input
+              type="input"
+              v-model="formInline.fileName"
+              class="nm-skin-pretty"
+              show-word-limit
+              :rows="2"
+              resize='none'
+              disabled
+              size="small"
+              style="width: 650px;"
+              :placeholder="$t('archiveObj.label7')"
+            ></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="success"
+              size="small"
+              icon="el-icon-plus"
+              @click="conditionVisible = true"
+            >{{$t('common.append')}}</el-button>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="primary"
+              size="small"
+              icon="el-icon-search"
+              @click="submitForm()"
+            >{{$t('common.iquery')}}</el-button>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="info"
+              size="small"
+              icon="el-icon-search"
+              @click="resetForm()"
+            >{{$t('common.reset')}}</el-button>
+          </el-form-item>
+          <el-form-item>
+            <el-button
+              type="warning"
+              size="small"
+              icon="el-icon-download"
+              @click="downloadLogVisible = true"
+            >{{$t('common.download')}}</el-button>
+          </el-form-item>
+        </el-form>
+        <el-divider />
+        <el-table
+          ref="filterTable"
+          :data="tableData"
+          border
+          style="width: 100%"
+          height="calc(100% - 150px)"
+          @selection-change="handleSelectionChange"
+        >
+          <el-table-column
+            type="selection"
+            align="center"
+            width="55"
+          />
+          <el-table-column
+            width="60"
+            type="index"
+            align="center"
+            :label="$t('common.index')"
+          />
+          <el-table-column
+            v-for="(item, index) in attributeData"
+            :key="index"
+            :label="item.alias"
+            :prop="item.field"
+            show-overflow-tooltip
+            align="center"
+            min-width="150"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            :label="$t('common.operate')"
+            min-width="150"
+          >
+            <template slot-scope="scope">
+              <el-link
+                class="elLink"
+                @click="showDetail(scope.$index, scope.row)"
+              >{{ $t('common.details') }}</el-link>
+              <el-link
+                class="elLink"
+                @click="getAttachTable(scope.$index, scope.row)"
+                style="margin-left: 20px"
+              >{{ $t('common.enclosure') }}</el-link>
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="archBottomBox">
+          <div class="pagination_box">
+            <el-pagination
+              @size-change="handleSizeChange1"
+              @current-change="handleCurrentChange1"
+              :current-page="listBankData.pageIndex"
+              :page-sizes="[10, 20, 50, 100]"
+              :page-size="listBankData.pageSize"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="listBankData.count"
+            >
+            </el-pagination>
+          </div>
+        </div>
+      </div>
+    </el-dialog>
+    <!-- 瀵嗙爜妗� -->
+    <el-dialog
+      :title="$t('common.passworld')"
+      :visible.sync="passWorldVisible"
+      :close-on-click-modal="false"
+      top="15vh"
+      width="30%"
+      :show-close="false"
+    >
+      <el-form
+        :model="codeForm"
+        :rules="rules"
+        ref="codeForm"
+        label-width="100px"
+        class="codeForm"
+      >
+        <el-form-item
+          :label="$t('common.passworld')"
+          prop="password"
+        >
+          <el-input
+            size="small"
+            type="password"
+            v-model="codeForm.password"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item
+          :label="$t('common.SPassword')"
+          prop="repassword"
+        >
+          <el-input
+            size="small"
+            type="password"
+            v-model="codeForm.repassword"
+            show-password
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button
+            class="primary"
+            size="small"
+            @click="download('codeForm')"
+          >{{$t('common.confirm')}}</el-button>
+          <el-button
+            type="info"
+            size="small"
+            @click="closeDown('codeForm')"
+          >{{$t('common.cancel')}}</el-button>
+        </el-form-item>
+      </el-form>
+    </el-dialog>
+    <!-- 涓嬭浇鍒楄〃 -->
+    <el-dialog
+      :visible.sync="downloadListVisible"
+      width="90%"
+      top="14vh"
+      :close-on-click-modal="false"
+    >
+      <div class="downloadBox">
+        <div class="archdowntop">
+          <el-table
+            :data="downloadTableData"
+            style="width: 100%"
+            height="calc(100% - 5px)"
+          >
+            <el-table-column
+              type="index"
+              width="50"
+              :label="$t('common.index')"
+            >
+            </el-table-column>
+            <el-table-column
+              property="descr"
+              :label="$t('common.title')"
+            > </el-table-column>
+            <el-table-column
+              property="name"
+              :label="$t('common.fileNme')"
+            > </el-table-column>
+            <el-table-column
+              property="createName"
+              :label="$t('operatManage.BWL.requestUser')"
+            > </el-table-column>
+            <el-table-column
+              property="createTime"
+              :formatter="formatData"
+              :label="$t('dataApply.careatetime')"
+            >
+            </el-table-column>
+
+            <el-table-column
+              :label="$t('common.download')"
+              width="120"
+            >
+              <template slot-scope="scope">
+                <el-link
+                  @click.native.prevent="downloadMap(scope.$index, scope.row)"
+                  :underline="false"
+                >涓嬭浇</el-link>
+              </template>
+            </el-table-column>
+          </el-table>
+        </div>
+        <div class="archdownbottom">
+          <el-pagination
+            @size-change="downloadSizeChange"
+            @current-change="downloadCurrentChange"
+            :current-page="downloadPage.pageIndex"
+            :page-sizes="[10, 20, 50, 100]"
+            :page-size="downloadPage.pageSize"
+            layout="total, sizes, prev, pager, next, jumper"
+            :total="downloadPage.count"
+          >
+          </el-pagination>
+        </div>
+
+      </div>
+    </el-dialog>
+    <!--绌洪棿鏌ヨ -->
+    <el-dialog
+      :title=" $t('synthesis.rangequery')"
+      :visible.sync="dialogMapVisible"
+      width="90%"
+      top="10vh"
+      :close-on-click-modal="false"
+    >
+      <div style="height:73vh">
+        <map-sdk v-if='showMapVisible'></map-sdk>
+      </div>
+    </el-dialog>
+    <iframe
+      id="downFrame"
+      src=""
+      style="display: none; border: 0; padding: 0; height: 0; width: 0"
+    ></iframe>
   </div>
 </template>
 
 <script>
+import MapSdk from '../../components/mapsdk.vue'
 import MyBread from "../../components/MyBread.vue";
-import { selectdepTab, dataLib_selectProject, dataLib_selectDirTypes, dataLib_selectByPageForMeta, dataLib_selectTabs } from '../../api/api';
+import { conditions } from './Archive.js';
+import $ from 'jquery'
+import { getToken } from '@/utils/auth';
+import {
+  selectdepTab,
+  dataLib_selectProject,
+  dataLib_selectDirTypes,
+  dataLib_selectByPageForMeta,
+  dataLib_selectTabs,
+  dataLib_selectFields,
+  dataLib_selectDomains,
+  dataLib_selectByPage,
+  sign_getPublicKey,
+  dataLib_downloadReq,
+  dataLib_selectDownloadFile,
+  dataLib_selectPageCountForDownload
+} from '../../api/api';
 export default {
   components: {
-    MyBread,
+    MyBread, MapSdk
   },
   data() {
+    var repasswordValidator = (rule, value, callback) => {
+      if (value === '') {
+        callback(new Error('璇峰啀娆¤緭鍏ュ瘑鐮�'));
+      } else if (value !== this.codeForm.password) {
+        callback(new Error('涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷�!'));
+      } else {
+        callback();
+      }
+    };
+    var passwordValidator = (rule, value, callback) => {
+      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(value)) {
+        callback(
+          new Error('瀵嗙爜蹇呴』鐢辨暟瀛椼�佸瓧姣嶃�佺壒娈婂瓧绗︾粍鍚�,璇疯緭鍏�13-20浣�')
+        );
+      } else {
+        callback();
+      }
+    };
     return {
+      fromSqlflag: false,
+      filedsOption: [],
+      condOption: [],
+      codeForm: {
+        password: '',
+        repassword: '',
+      },
+      rules: {
+        password: [{ required: true, message: '璇疯緭鍏ュ瘑鐮�', trigger: 'blur' }, { validator: passwordValidator, trigger: 'blur' }],
+        repassword: [
+          { required: true, message: '璇疯緭鍏ョ‘璁ゅ瘑鐮�', trigger: 'blur' },
+          { validator: repasswordValidator, trigger: 'blur' },
+        ],
+      },
       formInline: {
+        fileName: "",//楂樼骇鎼滅储
         dataType: "type2", //鏁版嵁绫诲瀷
         category: [], //鏌ヨ绫诲埆,
         item: [],
@@ -256,21 +780,488 @@
         pageSize: 10,
         count: 0,
       },
-      monthdata: [
-      ]
+      listBankData: {
+        pageIndex: 1,
+        pageSize: 10,
+        count: 0,
+        name: "",
+        title: "",
+      },
+      monthdata: [],
+      itemdetail1: {},
+      showinfoBox1: false,
+      dialogVisible: false,
+      formSql: {
+        field: '',
+        condition: '',
+        value: '',
+        type: '',
+        date: '',
+      },
+      downloadPage: {
+        pageIndex: 1,
+        pageSize: 10,
+        count: 0,
+        name: null,
+      },
+      attributeData: [],
+      tableData: [],
+      multipleSelection1: [],
+      passWorldVisible: false,
+      itemdetail: [],
+      itemDetailVisible: false,
+      downloadLogVisible: false,
+      conditionVisible: false,
+      downloadListVisible: false,
+      downloadTableData: [],
+      dialogMapVisible: false,
+      showMapVisible: false,
     };
   },
   mounted() {
     this.getDepTreeData();
     this.getCategorySelectData();
     this.getItemSelectData();
-    this.getAllTabesData();
+    this.signGetPublicKey();
   },
   methods: {
-    //鍗$墖璇︽儏鐐瑰嚮浜嬩欢
-    setCardDetails(res) {
+
+
+    getSpaceMapVisibale() {
+      sgworld.Creator.SimpleGraphic.clear();
+      for (var i in this.$store.state.queryInfo) {
+        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);
+        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
+        this.$store.state.primitLayer = null;
+      }
+      this.dialogMapVisible = true;
+      this.showMapVisible = true;
+      this.$store.state.mapMenuBoolean = true;
+      this.$store.state.mapMenuBoxFlag = '1';
+      this.$store.state.mapPopBoolean = false;
+      this.$store.state.mapPopBoxFlag = null;
+      this.$store.state.download = 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();
+    },
+    async getdownloadListData() {
+      const data = await dataLib_selectPageCountForDownload(this.downloadPage);
+      if (data.code != 200) {
+        this.downloadListVisible = false;
+        return this.$message.error('涓嬭浇鍒楄〃鑾峰彇澶辫触');
+      }
+
+      this.downloadTableData = data.result;
+
+      this.downloadPage.count = data.count;
+    },
+    downloadSizeChange(val) {
+      this.downloadPage.pageIndex = 1;
+      this.downloadPage.pageSize = val;
+      this.getdownloadListData();
+    },
+    downloadCurrentChange(val) {
+      this.downloadPage.pageIndex = val;
+      this.getdownloadListData();
+    },
+    getdownloadList() {
+      this.downloadPage = {
+        pageIndex: 1,
+        pageSize: 10,
+        count: 0,
+        name: null,
+      }
+      this.downloadListVisible = true;
+      this.getdownloadListData();
+    },
+    appendQueryFilter() {
+      if (this.formSql.type == "date" || this.formSql.type == "datetime") {
+        if (this.formSql.date == null) {
+          this.$message.error('璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!');
+          return;
+        }
+      } else {
+        if (this.formSql.value == "") {
+          this.$message.error('璇疯緭鍏ヨ鏌ヨ鐨勪俊鎭�!');
+          return;
+        }
+      }
+
+      if (this.formInline.fileName != "") {
+        this.formInline.fileName += " and ";
+      }
+      var val;
+
+      if (this.formSql.type == "long" || this.formSql.type == "integer") {
+
+        val = parseInt(this.formSql.value);
+      } else if (this.formSql.type == 'double') {
+
+        if (this.formSql.value.indexOf(".") != -1) {
+          val = this.formSql.value;
+        } else {
+          val = parseFloat(this.formSql.value).toFixed(1)
+        }
+      } else if (this.formSql.type == "date" || this.formSql.type == "datetime") {
+        var time = new Date(this.formSql.date);
+        var m = time.getMonth() + 1;
+        var d = time.getDate();
+        var y = time.getFullYear();
+        val = "'" + y +
+          '-' +
+          this.add0(m) +
+          '-' +
+          this.add0(d) + "'";
+      } else {
+        val = "'" + this.formSql.value + "'";
+      }
+      this.formInline.fileName += this.formSql.field + " " + this.formSql.condition + " " + val;
+
+      this.startFiledAndcondition();
+    },
+    startFiledAndcondition() {
+      this.conditionVisible = false;
+      this.conditionChange(this.filedsOption[0]);
+      this.formSql.value = "";
+      this.formSql.date = new Date();
+    },
+
+    fieldChange(value) {
+      var obj = {}
+      obj = this.filedsOption.find(function (item) {
+        return item.field === value;
+      })
+      this.conditionChange(obj)
+
+    },
+    conditionChange(res) {
+      this.formSql.field = res.field;
+      this.formSql.type = res.type;
+      if (res.type == "date" || res.type == "datetime") {
+        this.fromSqlflag = true
+      } else {
+        this.fromSqlflag = false
+      }
+      var std = [];
+      this.condOption = [];
+      if (res.type == 'text' || res.type == 'blob') {
+        std = conditions[0]
+      } else if (res.type == 'date' || res.type == 'datetime') {
+        std = conditions[2]
+      } else {
+        std = conditions[1]
+      }
+      for (var i in std) {
+        this.condOption.push({
+          label: std[i],
+          value: std[i],
+        })
+      }
+      this.formSql.condition = this.condOption[0].value
+    },
+    async 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;
+      }
+      var obj = {
+        entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach
+        filter: this.formInline.filter,
+        pwd: encrypt.encrypt(this.codeForm.password),
+        depcodes: [this.listData.depcode],
+        dirs: this.listData.dirs
+
+      };
+
+      var that = this;
+      $.ajax({
+        url: BASE_URL + "/dataLib/downloadEntityReq?token=" + getToken(),
+        type: "POST",
+        data: JSON.stringify(obj),
+        dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext
+        contentType: "application/json", // "application/x-www-form-urlencoded"
+        success: (data) => {
+          if (data.code == 200) {
+            that.downloadflie(data, this.codeForm.password)
+
+          }
+        },
+        error: function (e) {
+        }
+      });
+      this.closeDown1();
+    },
+    downloadflie(data, pwd) {
+
+      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.downloadLogVisible = false;
+      this.codeForm.password = '';
+      this.codeForm.repassword = '';
+    },
+    //鏂囦欢璇︽儏
+    showDetail(index, row) {
+      var std = [];
+      for (var i in this.attributeData) {
+        std.push({
+          label: this.attributeData[i].alias,
+          value: row[this.attributeData[i].field],
+        });
+      }
+      this.itemdetail = std;
+      this.itemDetailVisible = true;
+    },
+    async download() {
+      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.passWorldVisible = false;
+      var std = [];
+      for (var i in this.multipleSelection1) {
+        std.push(this.multipleSelection1[i].id)
+      }
+      var obj = {
+        pwd: encrypt.encrypt(this.codeForm.repassword),
+        ids: std
+      };
+      const res = await dataLib_downloadReq(JSON.stringify(obj));
+
+      if (res.code != 200) {
+        this.$message.error('涓嬭浇璇锋眰澶辫触');
+        return
+      }
+
+      var downObj = {
+        guid: res.result,
+        pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
+      }
+
+      const data = await dataLib_selectDownloadFile(downObj)
+      if (data.code != 200) {
+        this.$message.error('涓嬭浇璇锋眰澶辫触');
+        return
+      }
+      var token = getToken()
+      var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + res.result + "&pwd=" + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
+
+      $("#downFrame").attr("src", url).click();
+      this.closeDown();
+    },
+    closeDown() {
+      this.passWorldVisible = false;
+      this.codeForm.password = '';
+      this.codeForm.repassword = '';
+    },
+    //鏂囦欢涓嬭浇
+    setCardDownload(res) {
+      this.multipleSelection1 = [];
+      this.multipleSelection1.push(res);
+      if (this.multipleSelection1.length == 0) {
+        this.$message({
+          message: '璇峰厛閫夋嫨瑕佷笅杞界殑鏂囦欢',
+          type: 'warning'
+        });
+        return;
+      }
+      this.passWorldVisible = true;
+    },
+    //閲嶇疆
+    setQuerAllTablesRefresh() {
+      this.formInline = {
+        fileName: "",//楂樼骇鎼滅储
+        dataType: "type2", //鏁版嵁绫诲瀷
+        category: [], //鏌ヨ绫诲埆,
+        item: [],
+        depcode: this.depOption[0].code,
+        depName: this.depOption[0].name,
+        keywords: '',
+      }
+      this.getAllTabesData();
+    },
+    handleSelectionChange() {
+
+    },
+    //鍗$墖璇︽儏鐐瑰嚮浜嬩欢
+    async setCardDetails(res) {
+      switch (this.formInline.dataType) {
+        case "type1":
+          this.getBankTableData(res);
+          this.formInline.fileName = ""
+          break;
+        case "type2":
+          this.itemdetail1 = res
+          this.showinfoBox1 = true;
+          break;
+      }
+    },
+    //鑾峰彇鏁版嵁搴撴暟鎹�
+    getBankTableData(res) {
+      this.listBankData.name = res.entity;
+      this.listBankData.pageIndex = 1;
+      this.listBankData.pageSize = 10;
+      this.listBankData.title = res.tabDesc;
+      this.filedsLayer = this.getBankTableFiled();
+      this.getCollapseTable(this.filedsLayer);
+    },
+    async getCollapseTable(res) {
+      res.then((val) => {
+        this.attributeData = val;
+      });
+      if (this.formInline.fileName != "") {
+        this.listBankData.filter = this.formInline.fileName;
+      } else {
+        this.listBankData.filter = null;
+      }
+      this.listBankData.dirs = "";
+      if (this.formInline.category.length != 0) {
+        this.listBankData.dirs += this.formInline.category.toString();
+      }
+      if (this.formInline.item.length != 0) {
+        if (this.listBankData.dirs.length != 0) {
+          this.listBankData.dirs += ","
+        }
+        this.listBankData.dirs += this.formInline.item.toString();
+      }
+      this.listBankData.depcode = this.listData.depcode;
+      const data = await dataLib_selectByPage(this.listBankData);
+      if (data.code != 200) {
+        this.$message.error('璋冪敤鍒楄〃澶辫触,璇疯仈绯诲伐浣滀汉鍛�!');
+        return;
+      }
+
+      var res_val = this.attributeData;
+
+      for (var i in data.result) {
+        let val_Data = data.result[i];
+
+        for (var j in res_val) {
+          if (res_val[j].domainNa != null && res_val[j].domainNa != undefined) {
+            val_Data[res_val[j].field] = res_val[j].domainNa;
+          }
+        }
+      }
+      for (var i in data.result) {
+        if (data.result[i].createtime != null) {
+          data.result[i].createtime = this.format(data.result[i].createtime)
+        }
+        if (data.result[i].updatetime != null) {
+          data.result[i].updatetime = this.format(data.result[i].updatetime)
+        }
+      }
+      this.listBankData.count = data.count;
+
+      this.tableData = data.result;
+
+      this.dialogVisible = true;
+    },
+    //鑾峰彇鏁版嵁琛ㄥ瓧娈典俊鎭�
+    async getBankTableFiled() {
+      const fileds = await dataLib_selectFields({
+        name: this.listBankData.name,
+      });
+      if (fileds.code != 200) {
+        this.$message.error('鍒楄〃璋冪敤澶辫触');
+        return;
+      }
+
+      const domains = await dataLib_selectDomains({
+        name: this.listBankData.name,
+      });
+
+      if (domains.code != 200) {
+        this.$message.error('鍒楄〃璋冪敤澶辫触');
+        return;
+      }
+      var data1 = fileds.result;
+      var data2 = domains.result;
+      this.formInline.fileName = ""
+      var std = [];
+      this.filedsOption = [];
+      for (var i in data1) {
+
+        if (data1[i].type != 'geometry' && data1[i].type != 'null') {
+          this.filedsOption.push(data1[i])
+        }
+
+        if (data1[i].showtype == 1) {
+          if (data1[i].domainNa != null) {
+            data1[i].domainNa = this.getDomainNaFild(data1[i].domainNa, data2);
+          }
+          std.push(data1[i]);
+        }
+      }
+
+      this.startFiledAndcondition();
+      return std;
+    },
+    //鍊煎煙瀛楁鍖归厤
+    getDomainNaFild(res, result) {
+      for (var i in result) {
+        if (result[i].domName == res) {
+          return result[i].codeDesc;
+        }
+      }
+      return null;
+    },
+    startFiledAndcondition() {
+      this.conditionVisible = false;
+      this.conditionChange(this.filedsOption[0]);
+      this.formSql.value = "";
+      this.formSql.date = new Date();
+    },
+    conditionChange(res) {
+      this.formSql.field = res.field;
+      this.formSql.type = res.type;
+      if (res.type == "date" || res.type == "datetime") {
+        this.fromSqlflag = true
+      } else {
+        this.fromSqlflag = false
+      }
+      var std = [];
+      this.condOption = [];
+      if (res.type == 'text' || res.type == 'blob') {
+        std = conditions[0]
+      } else if (res.type == 'date' || res.type == 'datetime') {
+        std = conditions[2]
+      } else {
+        std = conditions[1]
+      }
+      for (var i in std) {
+        this.condOption.push({
+          label: std[i],
+          value: std[i],
+        })
+      }
+      this.formSql.condition = this.condOption[0].value
+    },
+
     //瀛樺偍绫诲瀷鍒囨崲
     setDataTypeChange() {
       this.listData.pageIndex = 1;
@@ -305,6 +1296,14 @@
         s
       );
     },
+    //鏍煎紡鍖栧垪琛�
+    formatData(row, column) {
+      let data = row[column.property];
+      if (data == null) {
+        return data;
+      }
+      return this.format(data);
+    },
     //鏍煎紡鍖栨椂闂�
     add0(m) {
       return m < 10 ? '0' + m : m;
@@ -317,7 +1316,12 @@
         return res + ' MB';
       }
     },
-
+    setInfoBoxTime(res) {
+      if (res == null) {
+        return res;
+      }
+      return this.format(res);
+    },
     handleSizeChange(val) {
       this.listData.pageIndex = 1;
       this.listData.pageSize = val;
@@ -328,10 +1332,49 @@
       this.listData.pageIndex = val;
       this.getAllTabesData();
     },
+    // 鍏抽敭瀛楁煡璇�
+    submitForm() {
+      this.listBankData.pageIndex = 1;
+      this.listBankData.pageSize = 10;
+      //鑾峰彇table淇℃伅
+      this.getCollapseTable(this.filedsLayer);
+    },
+    // 閲嶇疆鏌ヨ
+    resetForm() {
+      this.formInline.fileName = ""
+      //鑾峰彇table淇℃伅
+      this.listBankData.pageIndex = 1;
+      this.listBankData.pageSize = 10;
+      //鑾峰彇table淇℃伅
+      this.getCollapseTable(this.filedsLayer);
 
+    },
+    handleSizeChange1(val) {
+      this.listBankData.pageIndex = 1;
+      this.listBankData.pageSize = val;
+      //鑾峰彇table淇℃伅
+      this.getCollapseTable(this.filedsLayer);
 
+    },
+    handleCurrentChange1(val) {
+      this.listBankData.pageIndex = val;
+      //鑾峰彇table淇℃伅
+      this.getCollapseTable(this.filedsLayer);
+    },
     //鏌ヨ鏁版嵁搴撴暟鎹�
     async getQueryBankData() {
+      this.listData.dirs = "";
+      if (this.formInline.category.length != 0) {
+        this.listData.dirs += this.formInline.category.toString();
+      }
+      if (this.formInline.item.length != 0) {
+        if (this.listData.dirs.length != 0) {
+          this.listData.dirs += ","
+        }
+        this.listData.dirs += this.formInline.item.toString();
+      }
+      this.listData.depcode = this.formInline.depcode;
+      this.listData.tab = this.formInline.keywords;
       const data = await dataLib_selectTabs(this.listData);
       if (data.code != 200) {
         this.$message.error('鏁版嵁搴撳垪琛ㄨ皟鐢ㄥけ璐�');
@@ -349,6 +1392,18 @@
     },
     //鏌ヨ鏂囦欢鏁版嵁
     async getQueryFileData() {
+      this.listData.dirs = "";
+      if (this.formInline.category.length != 0) {
+        this.listData.dirs += this.formInline.category.toString();
+      }
+      if (this.formInline.item.length != 0) {
+        if (this.listData.dirs.length != 0) {
+          this.listData.dirs += ","
+        }
+        this.listData.dirs += this.formInline.item.toString();
+      }
+      this.listData.depcode = this.formInline.depcode;
+      this.listData.name = this.formInline.keywords;
       const data = await dataLib_selectByPageForMeta(this.listData);
       if (data.code != 200) {
         this.$message.error('鏂囦欢鏁版嵁鍒楄〃璋冪敤澶辫触');
@@ -361,12 +1416,16 @@
         res.isShow = false
         return res;
       })
+      debugger
       this.monthdata = val;
       this.listData.count = data.count;
     },
     //鏌ヨ鏁版嵁
     getAllTabesData() {
+      this.listData.pageIndex = 1;
+      this.listData.pageSize = 10;
       switch (this.formInline.dataType) {
+
         case "type2"://鏂囦欢鏁版嵁
           this.getQueryFileData();
           break;
@@ -390,23 +1449,25 @@
         this.$message.error('璧勬枡绫诲埆鍒楄〃璋冪敤澶辫触');
       }
       this.categoryOptions = data.result;
-
     },
     //鍏抽敭瀛楁煡璇�
     setSearchKeyWords() {
+
+      this.getAllTabesData();
     },
     //鍗曚綅鏀瑰彉鍊艰Е鍙�
     depChange(data, node, nodeData) {
       this.formInline.depcode = data.code;
       this.formInline.depName = data.name;
+      this.getAllTabesData();
     },
     //璧勬枡绫诲埆涓嬫媺妗嗗�兼敼鍙樿Е鍙�
     categorySelectChange(model, prop, options) {
-
+      this.getAllTabesData();
     },
     // 椤圭洰鍚嶇О涓嬫媺妗嗗�兼敼鍙樿Е鍙�
     itemSelectChange(model, prop, options) {
-
+      this.getAllTabesData();
     },
     //鑾峰彇鍗曚綅鍒楄〃
     async getDepTreeData() {
@@ -417,6 +1478,7 @@
       this.depOption = this.treeData(data.result);
       this.formInline.depcode = this.depOption[0].code
       this.formInline.depName = this.depOption[0].name;
+      this.getAllTabesData();
     },
     //鏍戝垪琛ㄧ敓鎴�
     treeData(source) {
@@ -427,6 +1489,13 @@
         branchArr.length > 0 ? (father.children = branchArr) : ""; // 缁欑埗绾ф坊鍔犱竴涓猚hildren灞炴�э紝骞惰祴鍊�
         return father.pid == 0; // 杩斿洖涓�绾ц彍鍗�
       });
+    },
+    async signGetPublicKey() {
+      const res = await sign_getPublicKey();
+      if (res && res.code == 200) {
+        window.encrypt = new JSEncrypt();
+        encrypt.setPublicKey(res.result);
+      }
     },
   }
 };
@@ -475,8 +1544,31 @@
   /deep/.el-card {
     margin-bottom: 10px !important;
   }
+  /deep/.el-dialog__body {
+    padding: 10px 10px;
+  }
+  /deep/.el-form-item {
+    margin-bottom: 20px;
+  }
   .show {
     display: none;
   }
+  .downloadBox {
+    width: 100%;
+    height: 73vh;
+    flex-direction: column;
+    align-items: center;
+    justify-content: space-between;
+    display: flex;
+    .archdowntop {
+      width: 100%;
+      height: 69vh;
+    }
+    .archdownbottom {
+      width: 100%;
+      display: flex;
+      justify-content: center;
+    }
+  }
 }
 </style>

--
Gitblit v1.9.3