From 038aada592806f15d4e44b62f8b6f9e165afbcb3 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期三, 12 四月 2023 15:13:26 +0800 Subject: [PATCH] 数据上传页面修改;资料馆,信息管理 下载添加数据申请流程 --- src/views/datamanage/metadataManage.vue | 201 ++++++++++++++++++++++++---- src/api/api.js | 16 ++ src/assets/lang/zh.js | 2 src/views/Archive/index.vue | 183 ++++++++++++++++++++++--- src/assets/lang/en.js | 2 src/views/datamanage/dataUpdata.vue | 7 6 files changed, 352 insertions(+), 59 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 4f080ae..a79f170 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -84,7 +84,16 @@ //璇锋眰鍦板潃 return request.get('/meta/selectById', { params: params }); } - +//鍏冩暟鎹�=>鏌ヨDB涓孩鍑虹殑鍗曚綅ID +export function meta_selectMetaOverflowDep(params) { + //璇锋眰鍦板潃 + return request.post('/meta/selectMetaOverflowDep', params); +} +//鍏冩暟鎹�=>鏍规嵁鍗曚綅缂栫爜鏁扮粍鏌ヨ鍗曚綅 +export function meta_selectDepsByCodes(params) { + //璇锋眰鍦板潃 + return request.get('/meta/selectDepsByCodes?' + params); +} //缁勭粐鏈烘瀯鏍规嵁id鏌ヨ export function selectDep(params) { @@ -744,7 +753,10 @@ export function dataLib_selectDbOverflowDep(params) { return request.post('/dataLib/selectDbOverflowDep', params); } - +//璧勬枡棣�=>鏌ヨDB涓孩鍑虹殑鍗曚綅ID +export function dataLib_selectMetaOverflowDep(params) { + return request.post('/dataLib/selectMetaOverflowDep', params); +} diff --git a/src/assets/lang/en.js b/src/assets/lang/en.js index 65c41ea..1d52ddf 100644 --- a/src/assets/lang/en.js +++ b/src/assets/lang/en.js @@ -858,6 +858,8 @@ dFile: "Single file upload", dFiles: "Overall project upload", SurveyDiscipline: "Survey Discipline", + SurveyingAndMapping: 'Surveying and Mapping', + SurveysDiscipline: "Surveys Discipline", GeologicalDisasterSpecialty: "Geological Disaster Specialty", CavernSpecialty: "Cavern Specialty", diff --git a/src/assets/lang/zh.js b/src/assets/lang/zh.js index d2980bf..4838cc6 100644 --- a/src/assets/lang/zh.js +++ b/src/assets/lang/zh.js @@ -872,6 +872,8 @@ dFile: "鍗曟枃浠朵笂浼�", dFiles: "椤圭洰鏁翠綋涓婁紶", SurveyDiscipline: "娴嬮噺涓撲笟", + SurveyingAndMapping: '娴嬬粯涓撲笟', + SurveysDiscipline: "鍕樺療涓撲笟", GeologicalDisasterSpecialty: "鍦扮伨涓撲笟", CavernSpecialty: "娲炲簱涓撲笟", diff --git a/src/views/Archive/index.vue b/src/views/Archive/index.vue index c4c5f86..35cf831 100644 --- a/src/views/Archive/index.vue +++ b/src/views/Archive/index.vue @@ -1198,6 +1198,59 @@ </el-form-item> </el-form> </el-dialog> + <el-dialog + title="鏁版嵁鐢宠" + :visible.sync="dialogInsertFile" + width="30%" + top="10vh" + :modal="false" + :close-on-click-modal="false" + :show-close="false" + > + <el-form + ref="form" + :model="fileFrom" + label-width="100px" + > + <el-form-item label="瀹℃牳鍗曚綅"> + <div> + <ul> + <li v-for="item in fileFrom.depid"> + {{ item.name }} + </li> + </ul> + </div> + </el-form-item> + + <el-form-item label="鎻忚堪"> + <el-input + type="textarea" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="fileFrom.descr" + maxlength="50" + show-word-limit + > + </el-input> + </el-form-item> + <el-form-item> + <el-button + class="primary" + size="small" + @click="getFileInsertApply()" + >{{ + $t("common.confirm") + }}</el-button> + <el-button + type="info" + size="small" + @click="handleInsertFileClose()" + >{{ + $t("common.cancel") + }}</el-button> + </el-form-item> + </el-form> + + </el-dialog> <iframe id="downFrame" src="" @@ -1233,7 +1286,8 @@ dataLib_deletes, dataLib_selectDbOverflowDep, dataLib_selectDepsByIds, - apply_insertApply + apply_insertApply, + dataLib_selectMetaOverflowDep } from '../../api/api'; import { dataLibView } from '@/api/screen.js' export default { @@ -1378,6 +1432,14 @@ dialogInsertVisible: false, dialogVisible1: false, multipleSelection: [], + dialogInsertFile: false, + fileFrom: { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null + } }; }, @@ -1946,8 +2008,6 @@ filter = this.listBankData.filter; ids = null; } - - var obj = { entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach filter: filter, @@ -2046,39 +2106,74 @@ this.passWorldVisible = false; var password = this.codeForm.repassword var std = []; + var ids = []; for (var i in this.multipleSelection1) { std.push(this.multipleSelection1[i].id) + ids.push(this.multipleSelection1[i].id) } - var obj = { - pwd: encrypt.encrypt(password), - ids: std - }; + // var obj = { + + // }; this.closeDown(); this.closeDownx(); - const res = await dataLib_downloadReq(JSON.stringify(obj)); - if (res.code != 200) { - this.$message.error('涓嬭浇璇锋眰澶辫触'); - return - } - if (!res.result) { - return - } - var downObj = { - guid: res.result, - pwd: encodeURIComponent(encrypt.encrypt(password)) - } - const data = await dataLib_selectDownloadFile(downObj) + + var obj = { + ids: std, + }; + const data = await dataLib_selectMetaOverflowDep(obj) 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)); + if (data.result.length == 0) { + const res = await dataLib_downloadReq(JSON.stringify({ + pwd: encrypt.encrypt(password), + ids: std + })); + if (res.code != 200) { + this.$message.error('涓嬭浇璇锋眰澶辫触'); + return + } + if (!res.result) { + return + } + var downObj = { + guid: res.result, + pwd: encodeURIComponent(encrypt.encrypt(password)) + } - $("#downFrame").attr("src", url).click(); - + 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(); + } else { + var val = "" + var std = []; + for (var i in data.result) { + if (val == "") { + val += "codes=" + data.result[i] + } else { + val += "&codes=" + data.result[i] + } + std.push({ + name: data.result[i], + }) + } + const data1 = await dataLib_selectDepsByIds(val) + if (data1.code != 200) { + return + } + this.fileFrom.depid = data1.result + this.fileFrom.ids = ids; + this.fileFrom.pwd = encr(password); + this.fileFrom.depcodes = data.result; + this.dialogInsertFile = true; + } this.monthdata.filter((res) => { return res.ischecked = false; @@ -2090,6 +2185,44 @@ this.codeForm.password = ''; this.codeForm.repassword = ''; }, + + async getFileInsertApply() { + this.dialogInsertFile = false + + var obj = { + ids: this.fileFrom.ids, + pwd: this.fileFrom.pwd, + tabs: ["鍏冩暟鎹〃"], + entities: ["sysmeta"], + descr: this.fileFrom.descr, + depcodes: this.fileFrom.depcodes + }; + + const data = await apply_insertApply(JSON.stringify(obj)) + this.handleInsertFileClose(); + if (data.code != 200) { + this.$message.error("鏁版嵁鐢宠澶辫触") + return + } + this.$message({ + message: "鏁版嵁鐢宠鎴愬姛", + type: "success", + }) + + + }, + handleInsertFileClose() { + this.dialogInsertFile = false + this.fileFrom = { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null + } + }, + + //鏂囦欢涓嬭浇 setCardDownload(res) { // this.multipleSelection1 = []; diff --git a/src/views/datamanage/dataUpdata.vue b/src/views/datamanage/dataUpdata.vue index 1fea7ff..cbeda1f 100644 --- a/src/views/datamanage/dataUpdata.vue +++ b/src/views/datamanage/dataUpdata.vue @@ -158,7 +158,7 @@ </el-option>--> <el-option - :label="$t('shuJuGuanLi.pselect.SurveyDiscipline')" + :label="$t('shuJuGuanLi.pselect.SurveyingAndMapping')" value="娴嬮噺涓撲笟" /> <el-option @@ -991,7 +991,7 @@ <el-button class="elBotton" size="small" - @click="commonTestQuay" + @click="commonTestQuay()" >纭� 瀹�</el-button> </span> </el-dialog> @@ -2178,7 +2178,6 @@ // if (this.formCheckAll.diZaiType != "NO") { // this.formCheckAll.isDiZai = "YES"; // } - // this.sc = { label1: '璐ㄦ', label2: '鏂囦欢璐ㄦ杩涘害锛�' @@ -2209,6 +2208,7 @@ this.formCheckAll.wbsPath = path; } } + this.formCheckAll.sjfl = '鏁板瓧鍖栨垚鏋�' const data = await dataUpload_uploadChecks(this.formCheckAll); if (data.code != 200) { this.$message.error("鏁版嵁璐ㄦ鎻愪氦澶辫触"); @@ -2262,6 +2262,7 @@ this.quayTestForms.sjzy = this.formInline.specialtyId; this.quayTestForms.zipPath = this.multipleSelection[this.taskStatus].path; + this.quayTestForms.sjfl = '鏁板瓧鍖栨垚鏋�' const data = await dataUpload_uploadChecks(this.quayTestForms); if (data.code != 200) { this.$message.error("鏁版嵁璐ㄦ鎻愪氦澶辫触"); diff --git a/src/views/datamanage/metadataManage.vue b/src/views/datamanage/metadataManage.vue index cda589d..38d2227 100644 --- a/src/views/datamanage/metadataManage.vue +++ b/src/views/datamanage/metadataManage.vue @@ -891,7 +891,59 @@ </div> </el-dialog> + <el-dialog + title="鏁版嵁鐢宠" + :visible.sync="dialogInsertFile" + width="30%" + top="10vh" + :modal="false" + :close-on-click-modal="false" + :show-close="false" + > + <el-form + ref="form" + :model="fileFrom" + label-width="100px" + > + <el-form-item label="瀹℃牳鍗曚綅"> + <div> + <ul> + <li v-for="item in fileFrom.depid"> + {{ item.name }} + </li> + </ul> + </div> + </el-form-item> + <el-form-item label="鎻忚堪"> + <el-input + type="textarea" + placeholder="璇疯緭鍏ュ唴瀹�" + v-model="fileFrom.descr" + maxlength="50" + show-word-limit + > + </el-input> + </el-form-item> + <el-form-item> + <el-button + class="primary" + size="small" + @click="getFileInsertApply()" + >{{ + $t("common.confirm") + }}</el-button> + <el-button + type="info" + size="small" + @click="handleInsertFileClose()" + >{{ + $t("common.cancel") + }}</el-button> + </el-form-item> + </el-form> + + </el-dialog> <iframe id="downFrame" src="" @@ -904,6 +956,7 @@ import $ from "jquery" import { getToken } from "@/utils/auth" import { + encr, deleteMeta, insertMeta, meta_downloadReq, @@ -918,6 +971,9 @@ sign_getPublicKey, updateMeta, meta_selectById, + meta_selectMetaOverflowDep, + meta_selectDepsByCodes, + apply_insertApply } from "../../api/api" import MyBread from "../../components/MyBread.vue" @@ -1048,6 +1104,14 @@ isJpg: false, src: "", }, + dialogInsertFile: false, + fileFrom: { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null + } } }, created() { @@ -1586,44 +1650,123 @@ }) }, async download() { - var std = [] + var ids = [] for (var i in this.multipleSelection) { - std.push(this.multipleSelection[i].id) + ids.push(this.multipleSelection[i].id) } var obj = { - pwd: encrypt.encrypt(this.codeForm.repassword), - ids: std, - } - const res = await meta_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 meta_selectDownloadFile(downObj) - + ids: ids, + }; + const data = await meta_selectMetaOverflowDep(obj) if (data.code != 200) { - this.$message.error("涓嬭浇璇锋眰澶辫触") return } - var token = getToken() - var url = - BASE_URL + - "/meta/downloadFile?token=" + - token + - "&guid=" + - res.result + - "&pwd=" + - encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)) + var password = this.codeForm.repassword + if (data.result.length == 0) { + var obj = { + pwd: encrypt.encrypt(this.codeForm.repassword), + ids: ids, + } + const res = await meta_downloadReq(JSON.stringify(obj)) + if (res.code != 200) { + this.$message.error("涓嬭浇璇锋眰澶辫触") + return + } - $("#downFrame").attr("src", url).click() + var downObj = { + guid: res.result, + pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)), + } + const data1 = await meta_selectDownloadFile(downObj) + if (data1.code != 200) { + this.$message.error("涓嬭浇璇锋眰澶辫触") + return + } + var token = getToken() + var url = + BASE_URL + + "/meta/downloadFile?token=" + + token + + "&guid=" + + res.result + + "&pwd=" + + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)) + + $("#downFrame").attr("src", url).click() + } else { + var val = "" + var std = []; + for (var i in data.result) { + if (val == "") { + val += "codes=" + data.result[i] + } else { + val += "&codes=" + data.result[i] + } + std.push({ + name: data.result[i], + }) + } + const data1 = await meta_selectDepsByCodes(val) + if (data1.code != 200) { + return + } + + this.fileFrom.depid = data1.result + this.fileFrom.ids = ids; + this.fileFrom.pwd = encr(password); + this.fileFrom.depcodes = data.result; + this.dialogInsertFile = true; + } + this.closeDown() }, + + async getFileInsertApply() { + this.dialogInsertFile = false + + var obj = { + ids: this.fileFrom.ids, + pwd: this.fileFrom.pwd, + tabs: ["鍏冩暟鎹〃"], + entities: ["sysmeta"], + descr: this.fileFrom.descr, + depcodes: this.fileFrom.depcodes + }; + + const data = await apply_insertApply(JSON.stringify(obj)) + this.handleInsertFileClose(); + if (data.code != 200) { + this.$message.error("鏁版嵁鐢宠澶辫触") + return + } + this.$message({ + message: "鏁版嵁鐢宠鎴愬姛", + type: "success", + }) + + + }, + handleInsertFileClose() { + this.dialogInsertFile = false + this.fileFrom = { + descr: null, + depid: null, + ids: null, + pwd: null, + depcodes: null + } + }, + + + + + + + + + + + closeDown() { this.showCodeBox = false this.codeForm.password = "" -- Gitblit v1.9.3