From 68e22e6f16bf3ee1bc1b9d2fc217c20bcd77a84b Mon Sep 17 00:00:00 2001
From: a0049873 <79py69t9wb@privaterelay.appleid.com>
Date: Tue, 10 Jan 2023 09:41:08 +0800
Subject: [PATCH] =?UTF-8?q?=E5=88=86=E6=94=AF=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
back/src/views/main.vue | 1 +
.../ability/IntegratedServices-add.vue | 62 ++++++++++++++-----
.../assignedScene/components/ability-add.vue | 14 +++--
back/src/views/modules/assetReport/index.vue | 53 ++++++++--------
4 files changed, 80 insertions(+), 50 deletions(-)
diff --git a/back/src/views/main.vue b/back/src/views/main.vue
index 4a4c390d..da93162e 100644
--- a/back/src/views/main.vue
+++ b/back/src/views/main.vue
@@ -114,6 +114,7 @@ export default {
}
this.$store.state.user.id = res.data.id
this.$store.state.user.name = res.data.realName
+ this.$store.state.user.deptId = res.data.deptId
this.$store.state.user.superAdmin = res.data.superAdmin
this.$store.state.user.roleIdList = []
if (res.data.roleIdList) {
diff --git a/back/src/views/modules/ability/IntegratedServices-add.vue b/back/src/views/modules/ability/IntegratedServices-add.vue
index 15d9c049..4ef16860 100644
--- a/back/src/views/modules/ability/IntegratedServices-add.vue
+++ b/back/src/views/modules/ability/IntegratedServices-add.vue
@@ -65,10 +65,23 @@
组合能力
-
@@ -103,7 +116,7 @@ import { getFuseResourceList, getListParams } from './assignedScene/add-update-s
import qs from 'qs'
// import SceneUseStep from './components/scene-use-step.vue'
// import SceneOneInput from './components/scene-one-input.vue'
-// import AbilityAdd from './components/ability-add.vue'
+import AbilityAdd from '@/views/modules/ability/assignedScene/components/ability-add.vue'
// import CombineAbility from '../components/combine-ability.vue'
// import CommonQuestion from '../components/common-question.vue'
// import InfrastructureModal from './components/infrastructure-modal.vue'
@@ -127,15 +140,15 @@ export const modalTypeText = {
export default {
components: {
- CombineAbility,
- InfrastructureModal
+ // CombineAbility,
+ // InfrastructureModal,
+ AbilityAdd
// SceneUseStep,
// CombineAbility,
// SceneOneInput,
// upload,
// CommonQuestion,
// InfrastructureModal,
- // AbilityAdd
},
watch: {
@@ -310,12 +323,25 @@ export default {
add: 'post',
update: 'put'
}
- this.dataForm.fuseResourceList = this.getFuseResourceList()
+ // this.dataForm.fuseResourceList = this.getFuseResourceList()
if (this.imageUrl == '') {
this.$message.error('请上传图片!')
return
}
this.dataForm.fuseAttrList.find(v => v.attrType == '服务图片').attrValue = this.imageUrl || ''
+ this.dataForm.fuseResourceList = []
+ for (const key in this.abilityListObj) {
+ this.abilityListObj[key].map((val, index) => {
+ this.dataForm.fuseResourceList.push({
+ type: key,
+ typeSecond: val.type,
+ resourceName: val.name,
+ deptName: val.dept,
+ sequence: index + 1
+ })
+ })
+ }
+ console.log('提交', this.dataForm, this.abilityListObj)
this.$http
[methodsObj[this.modalType]]('/fuse', this.dataForm)
.then(({ data: res }) => {
@@ -353,13 +379,15 @@ export default {
this.imageUrl = _imgObj.attrValue
// 组合能力
- Object.keys(this.getListParams).map(k => {
- const arr = data.fuseResourceList.filter(v => v.type == k)
- const arr2 = []
- arr.map(v => {
- arr2.push(v.resourceId)
- })
- this.abilityListObj[k] = arr2
+ Object.keys(this.getListParams).map((k, index) => {
+ // const arr = data.fuseResourceList.filter(v => v.type == k)
+ // const arr2 = []
+ // arr.map(v => {
+ // arr2.push(v.resourceId)
+ // })
+ // console.log('回显2', arr2)
+ // this.abilityListObj[k] = arr2
+ this.$refs['abilityAdd' + (index + 1)].getDataInfo(data)
})
console.log('this.dataForm----详情-------->', this.dataForm)
diff --git a/back/src/views/modules/ability/assignedScene/components/ability-add.vue b/back/src/views/modules/ability/assignedScene/components/ability-add.vue
index 3a4ff5e8..a806f961 100644
--- a/back/src/views/modules/ability/assignedScene/components/ability-add.vue
+++ b/back/src/views/modules/ability/assignedScene/components/ability-add.vue
@@ -1,7 +1,6 @@
{{ title }}
-
v.attrType === this.title) || {}
- const attrValue = JSON.parse(obj.attrValue || '[]')
- if (attrValue.length > 0) {
- attrValue.map((v) => {
+ const fuseAttrList = dataForm.fuseResourceList || []
+ const obj = fuseAttrList.filter((v) => v.type === this.title)
+ console.log('回显数据=======>', obj)
+ if (obj.length > 0) {
+ obj.map((v) => {
+ v.name = v.resourceName
+ v.dept = v.deptName
+ v.type = v.typeSecond
arr.push(v)
})
} else {
diff --git a/back/src/views/modules/assetReport/index.vue b/back/src/views/modules/assetReport/index.vue
index 5b8c84ad..691f765c 100644
--- a/back/src/views/modules/assetReport/index.vue
+++ b/back/src/views/modules/assetReport/index.vue
@@ -1,7 +1,7 @@
@@ -74,7 +74,6 @@
-
提供部门:
{
- this.dataForm.provideDept = res.data.data.deptId
- this.init()
- if (res.data.data.superAdmin == 1) {
- this.disabled = false
- this.dataForm.provideDept = ''
- this.init()
- return
- }
- if (res.data.data.roleIdList) {
- res.data.data.roleIdList.map(val => {
- this.$http.get('/sys/role/' + val).then(res1 => {
- if (res1.data.data.name === '运维管理员') {
- this.disabled = false
- this.dataForm.provideDept = ''
- this.init()
- }
- })
- })
- }
- })
+ this.init()
+ // this.$http.get('/sys/user/info').then(res => {
+ // this.dataForm.provideDept = res.data.data.deptId
+ // if (res.data.data.superAdmin == 1) {
+ // this.disabled = false
+ // this.dataForm.provideDept = ''
+ // this.init()
+ // return
+ // }
+ // if (res.data.data.roleIdList) {
+ // res.data.data.roleIdList.map(val => {
+ // this.$http.get('/sys/role/' + val).then(res1 => {
+ // if (res1.data.data.name === '运维管理员') {
+ // this.disabled = false
+ // this.dataForm.provideDept = ''
+ // this.init()
+ // }
+ // })
+ // })
+ // }
+ // })
}
}