Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev

This commit is contained in:
gongjiale 2023-01-10 11:19:32 +08:00
commit 31f3c10abb
4 changed files with 80 additions and 50 deletions

View File

@ -114,6 +114,7 @@ export default {
} }
this.$store.state.user.id = res.data.id this.$store.state.user.id = res.data.id
this.$store.state.user.name = res.data.realName 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.superAdmin = res.data.superAdmin
this.$store.state.user.roleIdList = [] this.$store.state.user.roleIdList = []
if (res.data.roleIdList) { if (res.data.roleIdList) {

View File

@ -65,10 +65,23 @@
<div class="baseTitle"> <div class="baseTitle">
组合能力 组合能力
</div> </div>
<div class="baseInner"> <div class="baseInner1">
<!-- <scene-one-input :dataForm="dataForm" title="场景痛点" @update="updateDataForm" ref="scenePainDom" <div class="info-inner">
:keyTextObj="painKeyTextObj"></scene-one-input> --> <ability-add :dataForm="dataForm" @update="updateDataForm" @updateCount="updateCount" ref="abilityAdd1"
<InfrastructureModal v-model="dataForm" :dataForm="dataForm" @update="updateDataForm" type="基础设施" title="基础设施" :typeList="baseTypeList"></ability-add>
</div>
<div style="border-bottom: 1px dashed #d3d3d3;margin-bottom: 23px;"></div>
<div class="info-inner">
<ability-add :dataForm="dataForm" @update="updateDataForm" @updateCount="updateCount" ref="abilityAdd2"
title="组件服务" :typeList="componetTypeList"></ability-add>
</div>
<div style="border-bottom: 1px dashed #d3d3d3;margin-bottom: 23px;"></div>
<div class="info-inner">
<ability-add :dataForm="dataForm" @update="updateDataForm" @updateCount="updateCount" ref="abilityAdd3"
title="数据资源" :typeList="dataTypeList"></ability-add>
</div>
<!-- <InfrastructureModal v-model="dataForm" :dataForm="dataForm" @update="updateDataForm" type="基础设施"
:modalType="modalType" ref="jcssDom"></InfrastructureModal> :modalType="modalType" ref="jcssDom"></InfrastructureModal>
<el-form-item label="基础设施总数" > <el-form-item label="基础设施总数" >
<el-input v-model="dataForm.infrastructureCount" onkeyup="value=value.replace(/[^\d]/g,0)" placeholder="请输入基础设施总数"></el-input> <el-input v-model="dataForm.infrastructureCount" onkeyup="value=value.replace(/[^\d]/g,0)" placeholder="请输入基础设施总数"></el-input>
@ -82,7 +95,7 @@
:getDataParams="getListParams['组件服务']"></combine-ability> :getDataParams="getListParams['组件服务']"></combine-ability>
<el-form-item label="组件服务总数" > <el-form-item label="组件服务总数" >
<el-input v-model="dataForm.componentCount" placeholder="请输入组件服务总数"></el-input> <el-input v-model="dataForm.componentCount" placeholder="请输入组件服务总数"></el-input>
</el-form-item> </el-form-item> -->
</div> </div>
</div> </div>
</el-form> </el-form>
@ -103,7 +116,7 @@ import { getFuseResourceList, getListParams } from './assignedScene/add-update-s
import qs from 'qs' import qs from 'qs'
// import SceneUseStep from './components/scene-use-step.vue' // import SceneUseStep from './components/scene-use-step.vue'
// import SceneOneInput from './components/scene-one-input.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 CombineAbility from '../components/combine-ability.vue'
// import CommonQuestion from '../components/common-question.vue' // import CommonQuestion from '../components/common-question.vue'
// import InfrastructureModal from './components/infrastructure-modal.vue' // import InfrastructureModal from './components/infrastructure-modal.vue'
@ -127,15 +140,15 @@ export const modalTypeText = {
export default { export default {
components: { components: {
CombineAbility, // CombineAbility,
InfrastructureModal // InfrastructureModal,
AbilityAdd
// SceneUseStep, // SceneUseStep,
// CombineAbility, // CombineAbility,
// SceneOneInput, // SceneOneInput,
// upload, // upload,
// CommonQuestion, // CommonQuestion,
// InfrastructureModal, // InfrastructureModal,
// AbilityAdd
}, },
watch: { watch: {
@ -310,12 +323,25 @@ export default {
add: 'post', add: 'post',
update: 'put' update: 'put'
} }
this.dataForm.fuseResourceList = this.getFuseResourceList() // this.dataForm.fuseResourceList = this.getFuseResourceList()
if (this.imageUrl == '') { if (this.imageUrl == '') {
this.$message.error('请上传图片!') this.$message.error('请上传图片!')
return return
} }
this.dataForm.fuseAttrList.find(v => v.attrType == '服务图片').attrValue = this.imageUrl || '' 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 this.$http
[methodsObj[this.modalType]]('/fuse', this.dataForm) [methodsObj[this.modalType]]('/fuse', this.dataForm)
.then(({ data: res }) => { .then(({ data: res }) => {
@ -353,13 +379,15 @@ export default {
this.imageUrl = _imgObj.attrValue this.imageUrl = _imgObj.attrValue
// //
Object.keys(this.getListParams).map(k => { Object.keys(this.getListParams).map((k, index) => {
const arr = data.fuseResourceList.filter(v => v.type == k) // const arr = data.fuseResourceList.filter(v => v.type == k)
const arr2 = [] // const arr2 = []
arr.map(v => { // arr.map(v => {
arr2.push(v.resourceId) // arr2.push(v.resourceId)
}) // })
this.abilityListObj[k] = arr2 // console.log('2', arr2)
// this.abilityListObj[k] = arr2
this.$refs['abilityAdd' + (index + 1)].getDataInfo(data)
}) })
console.log('this.dataForm----详情-------->', this.dataForm) console.log('this.dataForm----详情-------->', this.dataForm)

View File

@ -1,7 +1,6 @@
<template> <template>
<div> <div>
<div class="info-title">{{ title }}</div> <div class="info-title">{{ title }}</div>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label="使用总数"> <el-form-item label="使用总数">
<el-input <el-input
@ -153,11 +152,14 @@ export default {
this.count = dataForm.dataSourceCount this.count = dataForm.dataSourceCount
} }
const fuseAttrList = dataForm.fuseAttrList || [] const fuseAttrList = dataForm.fuseResourceList || []
const obj = fuseAttrList.find((v) => v.attrType === this.title) || {} const obj = fuseAttrList.filter((v) => v.type === this.title)
const attrValue = JSON.parse(obj.attrValue || '[]') console.log('回显数据=======>', obj)
if (attrValue.length > 0) { if (obj.length > 0) {
attrValue.map((v) => { obj.map((v) => {
v.name = v.resourceName
v.dept = v.deptName
v.type = v.typeSecond
arr.push(v) arr.push(v)
}) })
} else { } else {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: hisense.guoyue * @Author: hisense.guoyue
* @LastEditors: Light * @LastEditors: Light
* @LastEditTime: 2022-11-25 17:24:25 * @LastEditTime: 2023-01-09 11:22:49
* @Description: 资金报表 * @Description: 资金报表
--> -->
<template> <template>
@ -74,7 +74,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<!--提供部门 传id--> <!--提供部门 传id-->
<el-form-item> <el-form-item>
<span>提供部门</span> <span>提供部门</span>
<el-select <el-select
@ -233,7 +232,7 @@ export default {
data () { data () {
return { return {
disabled: true, disabled: !(this.$store.state.user.superAdmin === 1 || this.$store.state.user.roleIdList.indexOf('运维管理员') !== -1),
exportExcelCondition: '', exportExcelCondition: '',
token: Cookies.get('ucsToken'), token: Cookies.get('ucsToken'),
// //
@ -255,7 +254,7 @@ export default {
// date: '', // date: '',
startDate: '', startDate: '',
endDate: '', endDate: '',
provideDept: '', provideDept: (this.$store.state.user.superAdmin === 1 || this.$store.state.user.roleIdList.indexOf('运维管理员') !== -1) ? '' : this.$store.state.user.deptId,
applyDept: '', applyDept: '',
resourceType: '', resourceType: '',
resourceName: '', resourceName: '',
@ -304,8 +303,8 @@ export default {
this.dataForm.resourceType = '' this.dataForm.resourceType = ''
this.dataForm.resourceName = '' this.dataForm.resourceName = ''
this.dataForm.applyDept = '' this.dataForm.applyDept = ''
this.dataForm.provideDept = '' this.dataForm.provideDept = (this.$store.state.user.superAdmin === 1 || this.$store.state.user.roleIdList.indexOf('运维管理员') !== -1) ? '' : this.$store.state.user.deptId
this.dataForm.applyResult = '' this.dataForm.applyResult = '通过'
this.currentPage = 1 this.currentPage = 1
this.init() this.init()
} }
@ -322,27 +321,27 @@ export default {
this.offerDepartSelects.push({ label: val.name, value: val.id }) this.offerDepartSelects.push({ label: val.name, value: val.id })
}) })
}) })
this.$http.get('/sys/user/info').then(res => {
this.dataForm.provideDept = res.data.data.deptId
this.init() this.init()
if (res.data.data.superAdmin == 1) { // this.$http.get('/sys/user/info').then(res => {
this.disabled = false // this.dataForm.provideDept = res.data.data.deptId
this.dataForm.provideDept = '' // if (res.data.data.superAdmin == 1) {
this.init() // this.disabled = false
return // this.dataForm.provideDept = ''
} // this.init()
if (res.data.data.roleIdList) { // return
res.data.data.roleIdList.map(val => { // }
this.$http.get('/sys/role/' + val).then(res1 => { // if (res.data.data.roleIdList) {
if (res1.data.data.name === '运维管理员') { // res.data.data.roleIdList.map(val => {
this.disabled = false // this.$http.get('/sys/role/' + val).then(res1 => {
this.dataForm.provideDept = '' // if (res1.data.data.name === '') {
this.init() // this.disabled = false
} // this.dataForm.provideDept = ''
}) // this.init()
}) // }
} // })
}) // })
// }
// })
} }
} }
</script> </script>