From a242b994768bc567f614ffd0eba9932945f158ed Mon Sep 17 00:00:00 2001 From: monkeyhouyi Date: Wed, 4 Sep 2024 16:54:51 +0800 Subject: [PATCH] 附件调试 --- src/components/Generator/components/Upload/UploadFz.vue | 2 +- src/components/InfoForm/index.vue | 32 ++++++++++++++++++++------------ src/views/DisposalSuggestions/Form.vue | 5 ++++- src/views/DisposalSuggestions/HandleForm.vue | 5 ++++- src/views/baseComapnyInfo/index.vue | 58 ++++++++++++++++++++++++++++++++-------------------------- src/views/baseInspectionReport/Form.vue | 17 ++++++++++------- src/views/baseInspectionReport/index.vue | 23 +++++------------------ src/views/baseListHazardousSamples/index.vue | 44 +++++++++++--------------------------------- src/views/basePrincipalResponsibility/Form.vue | 4 ++-- src/views/baseSpecialAction/Form.vue | 1 + src/views/baseSpecialAction/FormPage.vue | 12 ++++++++++++ src/views/baseSystemInfo/DetailForm.vue | 12 +++++++++++- src/views/baseSystemInfo/index.vue | 33 ++++++++++++++++++++++++++++++--- 13 files changed, 143 insertions(+), 105 deletions(-) diff --git a/src/components/Generator/components/Upload/UploadFz.vue b/src/components/Generator/components/Upload/UploadFz.vue index d21cf5b..27f68fe 100644 --- a/src/components/Generator/components/Upload/UploadFz.vue +++ b/src/components/Generator/components/Upload/UploadFz.vue @@ -2,7 +2,7 @@
+ :before-upload="beforeUpload" :on-exceed="handleExceed" :disabled="disabled" :limit="limit" v-if="!disabled"> {{buttonText}}
只能上传不超过{{fileSize}}{{sizeUnit}}的{{accept}}文件 diff --git a/src/components/InfoForm/index.vue b/src/components/InfoForm/index.vue index 5e68982..3f68328 100644 --- a/src/components/InfoForm/index.vue +++ b/src/components/InfoForm/index.vue @@ -1,5 +1,5 @@ @@ -203,6 +203,7 @@ export default { showarea: false, judgmentClassOption: [], areaOptions: [], + btnLoading: false, }; }, computed: { @@ -271,7 +272,9 @@ export default { ...this.suggestionForm, id: this.dataForm.id, }; + this.btnLoading = true; let res = await disposalSuggestions(obj); + if(res.code != 200) return this.btnLoading = false; this.$message({ message: res.msg, type: "success", diff --git a/src/views/DisposalSuggestions/HandleForm.vue b/src/views/DisposalSuggestions/HandleForm.vue index a2850c1..0dbd30f 100644 --- a/src/views/DisposalSuggestions/HandleForm.vue +++ b/src/views/DisposalSuggestions/HandleForm.vue @@ -112,7 +112,7 @@ 取 消 - 确 定 + 确 定 @@ -174,6 +174,7 @@ showarea: false, judgmentClassOption: [], areaOptions: [], + btnLoading: false, }; }, computed: { @@ -242,7 +243,9 @@ ...this.suggestionForm, id: this.dataForm.id, }; + this.btnLoading = true; let res = await disposalSuggestions(obj); + if(res.code != 200) return this.btnLoading = false; this.$message({ message: res.msg, type: "success", diff --git a/src/views/baseComapnyInfo/index.vue b/src/views/baseComapnyInfo/index.vue index e349cf3..6e71ff3 100644 --- a/src/views/baseComapnyInfo/index.vue +++ b/src/views/baseComapnyInfo/index.vue @@ -29,7 +29,7 @@
新增 - + 导出
@@ -162,41 +161,48 @@ export default { }); }, toUpload(response, file, fileList) { - console.log(response, file, fileList); + this.$message({ + showClose: true, + message: response.msg, + type: response.code == 200 ? 'success' : 'error', + close: () => { + response.code == 200 && this.initData(); + } + }); }, exportData(type) { let obj = {}; if(type) { obj = { url: '/Extend/basecomapnyinfo/Actions/GenerateImportTemplate', + responseType: 'blob', method: "GET", } } else { - let _query = { - ...this.query, - }; - let query = {}; - for (let key in _query) { - if (Array.isArray(_query[key])) { - query[key] = _query[key].join(); - } else { - query[key] = _query[key]; - } - } - obj ={ - url: '/Extend/basecomapnyinfo/Actions/ImportByExcel', + obj = { + url: '/Extend/basecomapnyinfo/Actions/Export', method: "POST", - data: query, + data: this.query, } }; request(obj).then((res) => { - console.log(res); - const url = define.APIURl + res.data.url; - const link = document.createElement("a"); - link.href = url; - link.download = res.data.name; - link.click(); - }).catch(() => this.exportBtnLoading = false); + if(type) { + const blob = new Blob([res], {type: 'application/json'}); + const url = window.URL.createObjectURL(blob); + let link = document.createElement('a'); + link.style.display = 'none'; + link.href = url; + link.download = '公司录入模板.xlsx'; + link.click(); + } else { + if(res.code != 200) return; + const url = define.APIURl + res.data.url; + const link = document.createElement("a"); + link.href = url; + link.download = res.data.name; + link.click(); + } + }) }, exportForm(url) { const link = document.createElement("a"); diff --git a/src/views/baseInspectionReport/Form.vue b/src/views/baseInspectionReport/Form.vue index f5236b8..b64d594 100644 --- a/src/views/baseInspectionReport/Form.vue +++ b/src/views/baseInspectionReport/Form.vue @@ -134,21 +134,21 @@
问题来源:
-
{{ dataForm.reportSource || '--' }}
+
{{ sourceOptions.find(v => v.Id == dataForm.reportSource).FullName || '--' }}
应用名称:
-
{{ dataForm.platformName || '--' }}
+
{{ dataForm.platformNameStr || '--' }}
运营主体:
-
{{ dataForm.company || '--' }}
+
{{ dataForm.companyStr || '--' }}
应用类型:
-
{{ dataForm.platformType || '--' }}
+
{{ dataForm.platformTypeStr || '--' }}
- +
归属平台:
{{ dataForm.selfMediaPlatformType || '--' }}
@@ -174,7 +174,7 @@
附件:
- +
@@ -201,6 +201,9 @@ export default { dataForm: { id: undefined, reportSource: undefined, + platformNameStr: undefined, + platformTypeStr: undefined, + companyStr: undefined, platformName: '', selfMediaPlatformType: '', platformType: undefined, @@ -277,6 +280,7 @@ export default { if(!obj) return; this.dataForm.platformName = obj ? obj.id : val; this.dataForm.company = this.companyOptions.find(v => v.id == obj.companyId || v.companyName == obj.companyId).id; + console.log(this.dataForm.company, 'this.dataForm.company'); this.dataForm.platformType = this.platformTypeOptions.find(v => v.Id == obj.systemType || v.FullName == obj.systemType).Id; this.dataForm.selfMediaPlatformType = obj ? obj.platform : ''; }, @@ -331,7 +335,6 @@ export default { this.dataForm.questionType = '其他'; } this.dataForm.selfMediaPlatformType = res.data.selfMediaPlatformType || '--'; - if (!this.dataForm.annex) this.dataForm.annex = []; } }); }, diff --git a/src/views/baseInspectionReport/index.vue b/src/views/baseInspectionReport/index.vue index 3335405..6f636e2 100644 --- a/src/views/baseInspectionReport/index.vue +++ b/src/views/baseInspectionReport/index.vue @@ -39,7 +39,6 @@ :on-error="uploadError" :show-file-list="false" name="excelfile" - accept="image/*" >
导入 @@ -89,7 +88,7 @@ import infoMixin from "@/mixins/info"; import ExportBox from './ExportBox' import { getList, previewDataInterface } from '@/api/systemData/dataInterface' -import { message } from '@/utils/message'; + import define from '@/utils/define' export default { mixins: [infoMixin], components: { NCCForm, ExportBox }, @@ -196,6 +195,9 @@ import { message } from '@/utils/message'; showClose: true, message: response.msg, type: response.code == 200 ? 'success' : 'error', + close: () => { + response.code == 200 && this.initData(); + } }); }, uploadError() { @@ -203,7 +205,6 @@ import { message } from '@/utils/message'; }, exportData(type) { let obj = {} - this.listLoading = true; if(type) { obj = { url: '/Extend/BaseInspectionReport/Actions/GenerateImportTemplate', @@ -211,23 +212,10 @@ import { message } from '@/utils/message'; responseType: 'blob', } } else { - let _query = { - ...this.listQuery, - ...this.query - }; - let query = {} - for (let key in _query) { - if (Array.isArray(_query[key])) { - query[key] = _query[key].join() - } else { - query[key] = _query[key] - } - } obj = { url: '/Extend/BaseInspectionReport/Actions/Export', method: "POST", - data: query, - responseType: 'blob', + data: this.query, } } request(obj).then((res) => { @@ -248,7 +236,6 @@ import { message } from '@/utils/message'; link.click(); } }); - this.listLoading = false; }, search() { this.listQuery = { diff --git a/src/views/baseListHazardousSamples/index.vue b/src/views/baseListHazardousSamples/index.vue index 3a20966..49efccc 100644 --- a/src/views/baseListHazardousSamples/index.vue +++ b/src/views/baseListHazardousSamples/index.vue @@ -40,7 +40,7 @@ - - - + @@ -129,7 +118,7 @@ export default { content: undefined, harmfulInformationTypes: undefined, // 有害类型 company: undefined, - websitePlatform: undefined, + questionType: undefined, }, list: [], listLoading: false, @@ -157,13 +146,11 @@ export default { { prop: "lastModifyUserId", label: "修改用户" }, { prop: "lastModifyTime", label: "修改时间" }, ], - harmfulInformationTypesOptions: [], levelOptions: [ - { fullName: "巡查上报", id: "巡查上报" }, - { fullName: "案件处理", id: "案件处理" }, + { fullName: "核查处置", id: "核查处置" }, + { fullName: "网信执法", id: "网信执法" }, ], companyOptions: [], - websitePlatformOptions: [], // 导出 exportBtnLoading: false, @@ -174,25 +161,16 @@ export default { computed: {}, created() { this.initData(); - this.getharmfulInformationTypesOptions(); this.getcompanyOptions(); - // this.getwebsitePlatformOptions(); }, methods: { - getharmfulInformationTypesOptions() { - getDictionaryDataSelector("577006896326640901").then((res) => { - this.harmfulInformationTypesOptions = res.data.list; - }); - }, getcompanyOptions() { - previewDataInterface("576296400682222853").then((res) => { - this.companyOptions = res.data; - }); - }, - getwebsitePlatformOptions() { - previewDataInterface("576295179435115781").then((res) => { - this.websitePlatformOptions = res.data; - }); + request({ + url: `/Extend/basecomapnyinfo/GetNoPagingList`, + method: "GET", + }).then(({data}) => { + this.companyOptions = data; + }) }, initData() { this.listLoading = true; diff --git a/src/views/basePrincipalResponsibility/Form.vue b/src/views/basePrincipalResponsibility/Form.vue index 61e16ab..a8f573f 100644 --- a/src/views/basePrincipalResponsibility/Form.vue +++ b/src/views/basePrincipalResponsibility/Form.vue @@ -148,7 +148,6 @@ }).then(res =>{ this.dataForm = res.data; this.setTileType(res.data.fileType); - if(!this.dataForm.fileUrl)this.dataForm.fileUrl=[]; this.dialogLoading = false; }).catch(() => this.dialogLoading = false) } @@ -166,7 +165,6 @@ }, dataFormSubmit() { this.$refs['elForm'].validate((valid) => { - console.log(valid); if (valid) { this.dataForm.fileType = this.dataForm.fileType == '0' ? this.dataForm.otherFileType : this.dataForm.fileType; this.btnLoading = true; @@ -176,6 +174,7 @@ method: 'post', data: this.dataForm, }).then((res) => { + if(res.code != 200) return this.btnLoading = false; this.$message({ message: res.msg, type: 'success', @@ -190,6 +189,7 @@ method: 'PUT', data: this.dataForm }).then((res) => { + if(res.code != 200) return this.btnLoading = false; this.$message({ message: res.msg, type: 'success', diff --git a/src/views/baseSpecialAction/Form.vue b/src/views/baseSpecialAction/Form.vue index 7545092..8244fa9 100644 --- a/src/views/baseSpecialAction/Form.vue +++ b/src/views/baseSpecialAction/Form.vue @@ -293,6 +293,7 @@ export default { ...this.dataForm, state: type } + console.log(obj); let url = !this.dataForm.id ? '/Extend/BaseSpecialAction/Release' : '/Extend/BaseSpecialAction/Update'; let method = !this.dataForm.id ? 'PUT' : 'POST'; this.toPostForm(url, method, obj); diff --git a/src/views/baseSpecialAction/FormPage.vue b/src/views/baseSpecialAction/FormPage.vue index 7b87d48..195c815 100644 --- a/src/views/baseSpecialAction/FormPage.vue +++ b/src/views/baseSpecialAction/FormPage.vue @@ -23,6 +23,18 @@ {{ v }}
+
+ 附件: + + +
截止时间: {{ ncc.dateFormat(dataForm.deadline) || '--' }} diff --git a/src/views/baseSystemInfo/DetailForm.vue b/src/views/baseSystemInfo/DetailForm.vue index ab4721f..86a8153 100644 --- a/src/views/baseSystemInfo/DetailForm.vue +++ b/src/views/baseSystemInfo/DetailForm.vue @@ -117,7 +117,8 @@
应用图标:
- {{ dataForm.systemIcon || "--" }} + +
@@ -275,6 +276,7 @@ export default { link: undefined, obtainEvidence: [], annex: [], + systemIcon: '', }, systemTypeOptions: [], systemClassOptions: [], @@ -485,4 +487,12 @@ export default { // } // } // } +.avatar { + width: 100px; + height: 100px; + display: block; + border: 1px dashed #d9d9d9; + border-radius: 6px; + margin-left: 10px; +} diff --git a/src/views/baseSystemInfo/index.vue b/src/views/baseSystemInfo/index.vue index 051f001..a348176 100644 --- a/src/views/baseSystemInfo/index.vue +++ b/src/views/baseSystemInfo/index.vue @@ -50,7 +50,7 @@ - + - +
导出模板 - + +
+ 导入 +
+
导出
@@ -216,6 +227,7 @@ export default { data() { return { loading: false, + uploadHeaders: { Authorization: this.$store.getters.token }, query: { keyword: "", systemType: "", @@ -294,6 +306,16 @@ export default { }, }, methods: { + uploadSuccess(response, file, fileList) { + this.$message({ + showClose: true, + message: response.msg, + type: response.code == 200 ? 'success' : 'error', + close: () => { + response.code == 200 && this.initData(); + } + }); + }, handleSystemTypeChange(val) { this.query.systemClass = ""; this.initSystemClassList(val); @@ -398,6 +420,7 @@ export default { obj = { url: '/Extend/basesysteminfo/Actions/GenerateImportTemplate', method: "GET", + responseType: 'blob', } } else { obj ={ @@ -466,4 +489,8 @@ export default { overflow-y: scroll; } } +.uploadXlax { + display: inline-block; + margin: 0 8px; +} -- libgit2 0.21.4