From 616d806c2df607c6d8a944b12ff9dbd8b42a981d Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Tue, 12 Jul 2022 15:58:57 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=8A=E6=9E=B6=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/api/personalCenter.js | 8 + .../views/capacityOnTheShelf/Application.vue | 13 +- .../capacityOnTheShelf/BusinessComponent.vue | 11 + .../DevelopmentComponents.vue | 11 + .../views/capacityOnTheShelf/FilesUpload.vue | 68 + .../capacityOnTheShelf/LayerServices.vue | 11 + .../components/PutOnTheShelf.vue | 1220 +++++++++-------- 7 files changed, 798 insertions(+), 544 deletions(-) create mode 100644 front/src/views/capacityOnTheShelf/FilesUpload.vue diff --git a/front/src/api/personalCenter.js b/front/src/api/personalCenter.js index 67079961..892ff59d 100644 --- a/front/src/api/personalCenter.js +++ b/front/src/api/personalCenter.js @@ -231,3 +231,11 @@ export function queryResourceRelByKeyId(params) { params, }) } +// 文件上传接口 +export function filesUpload(data) { + return request({ + url: window.SITE_CONFIG.apiURL + '/upload', + method: 'post', + data, + }) +} diff --git a/front/src/views/capacityOnTheShelf/Application.vue b/front/src/views/capacityOnTheShelf/Application.vue index d2483801..38d71e39 100644 --- a/front/src/views/capacityOnTheShelf/Application.vue +++ b/front/src/views/capacityOnTheShelf/Application.vue @@ -99,6 +99,7 @@ import mybus from '@/myplugins/mybus' const showView = ref('基本信息') const router = useRouter() + let shiyongshouce = ref({}) const navList = ref([]) const navList2 = ref([]) const fileList = ref({}) @@ -285,7 +286,9 @@ } init() mybus.on('chageDataFrom', (obj) => { - console.log(obj, dataFrom.value.infoList) + if (obj.attrType == '使用手册' && obj.attrValue != null) { + shiyongshouce.value = obj + } dataFrom.value.infoList = dataFrom.value.infoList.filter( (item) => item.attrType !== obj.attrType ) @@ -293,6 +296,14 @@ obj.attrValue = '' } dataFrom.value.infoList.push(obj) + if (shiyongshouce.value.attrValue) { + dataFrom.value.infoList.map((syscitem, syscindex) => { + if (syscitem.attrType == '使用手册') { + dataFrom.value.infoList[syscindex] = shiyongshouce.value + } + }) + } + console.log('数据变更=================》', obj, dataFrom.value.infoList) }) mybus.on('chageFileList', (obj) => { fileList.value = obj diff --git a/front/src/views/capacityOnTheShelf/BusinessComponent.vue b/front/src/views/capacityOnTheShelf/BusinessComponent.vue index 8a515f72..42f6ceba 100644 --- a/front/src/views/capacityOnTheShelf/BusinessComponent.vue +++ b/front/src/views/capacityOnTheShelf/BusinessComponent.vue @@ -173,6 +173,7 @@ ], }, ]) + let shiyongshouce = ref({}) const navList = ref([]) const navList2 = ref([]) const fileList = ref({}) @@ -297,6 +298,9 @@ } init() mybus.on('chageDataFrom', (obj) => { + if (obj.attrType == '使用手册' && obj.attrValue != null) { + shiyongshouce.value = obj + } dataFrom.value.infoList = dataFrom.value.infoList.filter( (item) => item.attrType !== obj.attrType ) @@ -304,6 +308,13 @@ obj.attrValue = '' } dataFrom.value.infoList.push(obj) + if (shiyongshouce.value.attrValue) { + dataFrom.value.infoList.map((syscitem, syscindex) => { + if (syscitem.attrType == '使用手册') { + dataFrom.value.infoList[syscindex] = shiyongshouce.value + } + }) + } console.log('数据变更=================》', obj, dataFrom.value.infoList) }) mybus.on('chageFileList', (obj) => { diff --git a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue index 1f43e8ce..135e5e0f 100644 --- a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue +++ b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue @@ -173,6 +173,7 @@ ], }, ]) + let shiyongshouce = ref({}) const navList = ref([]) const navList2 = ref([]) const fileList = ref({}) @@ -297,6 +298,9 @@ } init() mybus.on('chageDataFrom', (obj) => { + if (obj.attrType == '使用手册' && obj.attrValue != null) { + shiyongshouce.value = obj + } dataFrom.value.infoList = dataFrom.value.infoList.filter( (item) => item.attrType !== obj.attrType ) @@ -304,6 +308,13 @@ obj.attrValue = '' } dataFrom.value.infoList.push(obj) + if (shiyongshouce.value.attrValue) { + dataFrom.value.infoList.map((syscitem, syscindex) => { + if (syscitem.attrType == '使用手册') { + dataFrom.value.infoList[syscindex] = shiyongshouce.value + } + }) + } console.log('数据变更=================》', obj, dataFrom.value.infoList) }) mybus.on('chageFileList', (obj) => { diff --git a/front/src/views/capacityOnTheShelf/FilesUpload.vue b/front/src/views/capacityOnTheShelf/FilesUpload.vue new file mode 100644 index 00000000..ce675fe4 --- /dev/null +++ b/front/src/views/capacityOnTheShelf/FilesUpload.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/front/src/views/capacityOnTheShelf/LayerServices.vue b/front/src/views/capacityOnTheShelf/LayerServices.vue index c6a7ae55..507eba4a 100644 --- a/front/src/views/capacityOnTheShelf/LayerServices.vue +++ b/front/src/views/capacityOnTheShelf/LayerServices.vue @@ -121,6 +121,7 @@ ], }, ]) + let shiyongshouce = ref({}) const navList = ref([]) const navList2 = ref([]) const fileList = ref({}) @@ -245,6 +246,9 @@ } init() mybus.on('chageDataFrom', (obj) => { + if (obj.attrType == '使用手册' && obj.attrValue != null) { + shiyongshouce.value = obj + } dataFrom.value.infoList = dataFrom.value.infoList.filter( (item) => item.attrType !== obj.attrType ) @@ -252,6 +256,13 @@ obj.attrValue = '' } dataFrom.value.infoList.push(obj) + if (shiyongshouce.value.attrValue) { + dataFrom.value.infoList.map((syscitem, syscindex) => { + if (syscitem.attrType == '使用手册') { + dataFrom.value.infoList[syscindex] = shiyongshouce.value + } + }) + } console.log('数据变更=================》', obj, dataFrom.value.infoList) }) mybus.on('chageFileList', (obj) => { diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue index 96eae8fe..9cbd5f94 100644 --- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue +++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue @@ -16,14 +16,21 @@ +
+ +
From f593a9785445f60b6ed319c396169e5180565795 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Tue, 12 Jul 2022 16:54:35 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/capacityOnTheShelf/Algorithm.vue | 11 +++++++++++ front/src/views/capacityOnTheShelf/Application.vue | 4 ++-- .../capacityOnTheShelf/DevelopmentComponents.vue | 4 ++-- front/src/views/capacityOnTheShelf/FilesUpload.vue | 2 +- front/src/views/capacityOnTheShelf/LayerServices.vue | 4 ++-- .../capacityOnTheShelf/components/PutOnTheShelf.vue | 12 +++++++++++- .../DeveloperOwningDepartmentAndServiceProvider.vue | 2 ++ 7 files changed, 31 insertions(+), 8 deletions(-) diff --git a/front/src/views/capacityOnTheShelf/Algorithm.vue b/front/src/views/capacityOnTheShelf/Algorithm.vue index 61d51591..7bfd8929 100644 --- a/front/src/views/capacityOnTheShelf/Algorithm.vue +++ b/front/src/views/capacityOnTheShelf/Algorithm.vue @@ -192,6 +192,7 @@ ], }, ]) + let shiyongshouce = ref({}) const navList = ref([]) const navList2 = ref([]) const fileList = ref({}) @@ -315,6 +316,9 @@ } init() mybus.on('chageDataFrom', (obj) => { + if (obj.attrType == '技术文档' && obj.attrValue != null) { + shiyongshouce.value = obj + } dataFrom.value.infoList = dataFrom.value.infoList.filter( (item) => item.attrType !== obj.attrType ) @@ -322,6 +326,13 @@ obj.attrValue = '' } dataFrom.value.infoList.push(obj) + if (shiyongshouce.value.attrValue) { + dataFrom.value.infoList.map((syscitem, syscindex) => { + if (syscitem.attrType == '技术文档') { + dataFrom.value.infoList[syscindex] = shiyongshouce.value + } + }) + } console.log('数据变更=================》', obj, dataFrom.value.infoList) }) mybus.on('chageFileList', (obj) => { diff --git a/front/src/views/capacityOnTheShelf/Application.vue b/front/src/views/capacityOnTheShelf/Application.vue index 38d71e39..4ec9bbfc 100644 --- a/front/src/views/capacityOnTheShelf/Application.vue +++ b/front/src/views/capacityOnTheShelf/Application.vue @@ -286,7 +286,7 @@ } init() mybus.on('chageDataFrom', (obj) => { - if (obj.attrType == '使用手册' && obj.attrValue != null) { + if (obj.attrType == '技术文档' && obj.attrValue != null) { shiyongshouce.value = obj } dataFrom.value.infoList = dataFrom.value.infoList.filter( @@ -298,7 +298,7 @@ dataFrom.value.infoList.push(obj) if (shiyongshouce.value.attrValue) { dataFrom.value.infoList.map((syscitem, syscindex) => { - if (syscitem.attrType == '使用手册') { + if (syscitem.attrType == '技术文档') { dataFrom.value.infoList[syscindex] = shiyongshouce.value } }) diff --git a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue index 135e5e0f..d66cb874 100644 --- a/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue +++ b/front/src/views/capacityOnTheShelf/DevelopmentComponents.vue @@ -298,7 +298,7 @@ } init() mybus.on('chageDataFrom', (obj) => { - if (obj.attrType == '使用手册' && obj.attrValue != null) { + if (obj.attrType == '技术文档' && obj.attrValue != null) { shiyongshouce.value = obj } dataFrom.value.infoList = dataFrom.value.infoList.filter( @@ -310,7 +310,7 @@ dataFrom.value.infoList.push(obj) if (shiyongshouce.value.attrValue) { dataFrom.value.infoList.map((syscitem, syscindex) => { - if (syscitem.attrType == '使用手册') { + if (syscitem.attrType == '技术文档') { dataFrom.value.infoList[syscindex] = shiyongshouce.value } }) diff --git a/front/src/views/capacityOnTheShelf/FilesUpload.vue b/front/src/views/capacityOnTheShelf/FilesUpload.vue index ce675fe4..9140988c 100644 --- a/front/src/views/capacityOnTheShelf/FilesUpload.vue +++ b/front/src/views/capacityOnTheShelf/FilesUpload.vue @@ -47,7 +47,7 @@ const res = resData mybus.emit('showTextFunctionEmit', false) let infoList = ref({ - attrType: '使用手册', + attrType: '技术文档', attrValue: res.data.data, delFlag: 0, }) diff --git a/front/src/views/capacityOnTheShelf/LayerServices.vue b/front/src/views/capacityOnTheShelf/LayerServices.vue index 507eba4a..37da99ce 100644 --- a/front/src/views/capacityOnTheShelf/LayerServices.vue +++ b/front/src/views/capacityOnTheShelf/LayerServices.vue @@ -246,7 +246,7 @@ } init() mybus.on('chageDataFrom', (obj) => { - if (obj.attrType == '使用手册' && obj.attrValue != null) { + if (obj.attrType == '技术文档' && obj.attrValue != null) { shiyongshouce.value = obj } dataFrom.value.infoList = dataFrom.value.infoList.filter( @@ -258,7 +258,7 @@ dataFrom.value.infoList.push(obj) if (shiyongshouce.value.attrValue) { dataFrom.value.infoList.map((syscitem, syscindex) => { - if (syscitem.attrType == '使用手册') { + if (syscitem.attrType == '技术文档') { dataFrom.value.infoList[syscindex] = shiyongshouce.value } }) diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue index 9cbd5f94..7ecb6a0e 100644 --- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue +++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue @@ -146,8 +146,18 @@ :list="props.fileList" tip="支持文件类型,大小不超过100M" > -
+
上传附件 diff --git a/front/src/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue b/front/src/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue index 81931869..ec1d4bd8 100644 --- a/front/src/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue +++ b/front/src/views/detailsAll/components/Developer/DeveloperOwningDepartmentAndServiceProvider.vue @@ -138,6 +138,7 @@ let obj = props.dataList.infoList.filter( (item) => item.attrType === '技术文档' )[0] + debugger console.log('dataFrom.value.link', obj.attrValue) window.open( window.SITE_CONFIG.previewUrl + @@ -149,6 +150,7 @@ let obj = props.dataList.infoList.filter( (item) => item.attrType === '使用手册' )[0] + debugger console.log('dataFrom.value.link', obj.attrValue) window.open( window.SITE_CONFIG.previewUrl + From 57df5fe2206170aeffd4a55e8abb85989a30d9a0 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Tue, 12 Jul 2022 17:08:58 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=96=87=E6=A1=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/src/views/capacityOnTheShelf/FilesUpload.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front/src/views/capacityOnTheShelf/FilesUpload.vue b/front/src/views/capacityOnTheShelf/FilesUpload.vue index 9140988c..6f059550 100644 --- a/front/src/views/capacityOnTheShelf/FilesUpload.vue +++ b/front/src/views/capacityOnTheShelf/FilesUpload.vue @@ -24,7 +24,7 @@ import * as fontJs from '/public/static/js/font.js' import { filesUpload } from '@/api/personalCenter' import mybus from '@/myplugins/mybus' - let text = '' + let text = ref('') let iconfontJs = fontJs const props = defineProps({ data: { type: Array, default: null }, @@ -44,11 +44,12 @@ // formData.append('name', this.route.currentRoute.query.id + '.md') // FileSaver.saveAs(blob, '开发指南.md') filesUpload(formData).then((resData) => { - const res = resData + const res = resData.data.data + text.value = res mybus.emit('showTextFunctionEmit', false) let infoList = ref({ attrType: '技术文档', - attrValue: res.data.data, + attrValue: res, delFlag: 0, }) mybus.emit('chageDataFrom', infoList.value) From 570a582818ba371b9214f2462571ff98d2284276 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Tue, 12 Jul 2022 17:13:03 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=8A=80=E6=9C=AF=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PutOnTheShelf.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue index 7ecb6a0e..06f1be99 100644 --- a/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue +++ b/front/src/views/capacityOnTheShelf/components/PutOnTheShelf.vue @@ -157,10 +157,11 @@ tip="支持文件类型,大小不超过100M" >
- 上传附件 + 编辑富文本
div { width: 100%;