diff --git a/back/src/views/modules/ability/IntegratedServices-add.vue b/back/src/views/modules/ability/IntegratedServices-add.vue index 6eb8ea73..5e713d2b 100644 --- a/back/src/views/modules/ability/IntegratedServices-add.vue +++ b/back/src/views/modules/ability/IntegratedServices-add.vue @@ -31,12 +31,21 @@ - - + + + + + 点击上传 +
只能上传图片文件
+ +
+
@@ -44,8 +53,10 @@
组合能力
- + + v.attrType == '服务图片').attrValue = this.imageUrl || ''; this.$http [methodsObj[this.modalType]]("/fuse", this.dataForm) .then(({ data: res }) => { @@ -249,8 +277,55 @@ export default { for (const key in this.refsParseArray) { this.$refs[key] && this.$refs[key].getDataInfo && this.$refs[key].getDataInfo(data) } + let _imgObj = data.fuseAttrList.find(v => v.attrType == '服务图片') || {}; + this.imageUrl = _imgObj.attrValue; + console.log('this.dataForm----详情-------->', this.dataForm); }) }, + beforeAvatarUpload(file) { + const isImage = + file.type === 'image/jpeg' || + file.type === 'image/jpg' || + file.type === 'image/png' + // const isLt2M = file.size / 1024 / 1024 < 2 + + if (!isImage) { + this.$message.error('上传头像图片只能是 jpg/png 格式!') + } + // if (!isLt2M) { + // this.$message.error('上传头像图片大小不能超过 2MB!') + // } + return isImage + }, + addUploadRemoveFile(file, fileList) { + this.$refs.addUpload.clearFiles() + this.imageUrl = '' + }, + editBeforeAvatarUpload(file) { + const isImage = + file.type === 'image/jpeg' || + file.type === 'image/jpg' || + file.type === 'image/png' + // const isLt2M = file.size / 1024 / 1024 < 2 + + if (!isImage) { + this.$message.error('上传头像图片只能是 jpg/png 格式!') + } + // if (!isLt2M) { + // this.$message.error('上传头像图片大小不能超过 2MB!') + // } + return isImage + }, + editUploadRemoveFile(file, fileList) { + this.$refs.editUpload.clearFiles() + this.imageUrl = '' + }, + eidtHandleAvatarSuccess(res, file) { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.imageUrl = res.data + }, }, beforeDestroy() { this.clearForm() @@ -372,4 +447,17 @@ export default { font-size: 18px; margin-bottom: 10px; } + +.title { + text-align: center; + font-weight: 600; + font-size: 18px; + margin-bottom: 10px; +} + +.avatar { + height: 100px; + width: 100px; + display: block; +} diff --git a/back/src/views/modules/ability/IntegratedServices.vue b/back/src/views/modules/ability/IntegratedServices.vue index 78628527..093f4156 100644 --- a/back/src/views/modules/ability/IntegratedServices.vue +++ b/back/src/views/modules/ability/IntegratedServices.vue @@ -57,7 +57,7 @@ import { type } from "os"; export const tableColumns = { 'name': '融合服务名称', 'description': '融合服务描述', - 'applicationArea': '支撑场景', + 'applicationArea': '应用领域', } export default { @@ -78,7 +78,7 @@ export default { name: "", order: 'desc', orderField: 'create_date', - type: '融合服务' + type: '打包模式' }, qp: false, modalType: 'add', diff --git a/back/src/views/modules/ability/assignedScene/add-update-scene.vue b/back/src/views/modules/ability/assignedScene/add-update-scene.vue index 68ab8772..d093a402 100644 --- a/back/src/views/modules/ability/assignedScene/add-update-scene.vue +++ b/back/src/views/modules/ability/assignedScene/add-update-scene.vue @@ -31,9 +31,15 @@
- - - + + + + 点击上传 +
只能上传图片文件
+ +
@@ -55,8 +61,6 @@
组合能力
- { return { @@ -122,13 +123,12 @@ export const getDescJson = (text) => { }, } } - // 弹框的方法 export const getListParams = { '数据资源': getJson('数据资源'), '组件服务': getJson('组件服务'), + '基础设施': '' } - // 模态框标题 export const modalTypeText = { add: '挂接', @@ -166,7 +166,7 @@ export default { }, data() { return { - fileUploadUrl: `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('ucsToken')}`, + fileUploadUrl: window.SITE_CONFIG.apiURL + '/upload', moreKeyTextObj: { nameObj: { text: '能力名称', @@ -197,13 +197,12 @@ export default { "attrType": "解决方案", "attrValue": [{ description: "" }], }, - ], - "fuseResourceList": [ { - "resourceId": '', - "sequence": "" - } + "attrType": "服务图片", + "attrValue": "", + }, ], + "fuseResourceList": [], }, rules: { name: [ @@ -240,7 +239,12 @@ export default { }, getListParams: getListParams, abilityListObj: {}, - imgData: [] + imgData: [], + // 限定图片 + handleExceed() { + this.$message({ type: 'error', message: '最多支持一张图片上传' }) + }, + imageUrl: '', }; }, props: { @@ -321,10 +325,14 @@ export default { 'update': 'put' } this.dataForm.fuseResourceList = this.getFuseResourceList() + if (this.imageUrl == '') { + this.$message.error("请上传图片!"); + return; + } + this.dataForm.fuseAttrList.find(v => v.attrType == '服务图片').attrValue = this.imageUrl || ''; let _obj = Object.assign({}, this.dataForm, { type: '赋能场景' }) - this.$http [methodsObj[this.modalType]]("/fuse", _obj) .then(({ data: res }) => { @@ -357,11 +365,61 @@ export default { for (const key in this.refsParseArray) { this.$refs[key] && this.$refs[key].getDataInfo && this.$refs[key].getDataInfo(data) } + let _imgObj = data.fuseAttrList.find(v => v.attrType == '服务图片') || {}; + this.imageUrl = _imgObj.attrValue console.log('this.dataForm----详情-------->', this.dataForm); }) }, - changeInfoList() { + handleAvatarSuccess(res, file) { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.imageUrl = res.data + }, + beforeAvatarUpload(file) { + const isImage = + file.type === 'image/jpeg' || + file.type === 'image/jpg' || + file.type === 'image/png' + // const isLt2M = file.size / 1024 / 1024 < 2 + if (!isImage) { + this.$message.error('上传头像图片只能是 jpg/png 格式!') + } + // if (!isLt2M) { + // this.$message.error('上传头像图片大小不能超过 2MB!') + // } + return isImage + }, + addUploadRemoveFile(file, fileList) { + this.$refs.addUpload.clearFiles() + this.imageUrl = '' + }, + editBeforeAvatarUpload(file) { + const isImage = + file.type === 'image/jpeg' || + file.type === 'image/jpg' || + file.type === 'image/png' + // const isLt2M = file.size / 1024 / 1024 < 2 + + if (!isImage) { + this.$message.error('上传头像图片只能是 jpg/png 格式!') + } + // if (!isLt2M) { + // this.$message.error('上传头像图片大小不能超过 2MB!') + // } + return isImage + }, + editUploadRemoveFile(file, fileList) { + this.$refs.editUpload.clearFiles() + this.imageUrl = '' + }, + eidtHandleAvatarSuccess(res, file) { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.imageUrl = res.data + // this.imageUrl = URL.createObjectURL(file.raw); }, }, beforeDestroy() { @@ -486,4 +544,10 @@ export default { font-size: 18px; margin-bottom: 10px; } + +.avatar { + height: 100px; + width: 100px; + display: block; +} diff --git a/back/src/views/modules/ability/assignedScene/components/display-list.vue b/back/src/views/modules/ability/assignedScene/components/display-list.vue new file mode 100644 index 00000000..34e4a90b --- /dev/null +++ b/back/src/views/modules/ability/assignedScene/components/display-list.vue @@ -0,0 +1,81 @@ + + + \ No newline at end of file diff --git a/back/src/views/modules/ability/assignedScene/components/infrastructure-modal.vue b/back/src/views/modules/ability/assignedScene/components/infrastructure-modal.vue index f0960ab8..0d05d598 100644 --- a/back/src/views/modules/ability/assignedScene/components/infrastructure-modal.vue +++ b/back/src/views/modules/ability/assignedScene/components/infrastructure-modal.vue @@ -46,7 +46,7 @@
- @@ -64,7 +64,6 @@
- + +