Compare commits

...

2 Commits

Author SHA1 Message Date
unknown 9d4aa897ee Merge branch 'hi-ucs-pre' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-pre 2022-11-02 15:02:32 +08:00
unknown 9a5b1732c5 能力盘点系统修改 2022-11-02 15:02:10 +08:00
6 changed files with 568 additions and 416 deletions

View File

@ -2,382 +2,403 @@ import Cookies from 'js-cookie'
import qs from 'qs'
import { deepClone } from '@/utils/form-generator/index'
export default {
data () {
/* eslint-disable */
return {
// 设置属性
mixinViewModuleOptions: {
createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?
activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口?
getDataListURL: '', // 数据列表接口API地址
getDataListIsPage: false, // 数据列表接口,是否需要分页?
deleteURL: '', // 删除接口API地址
deleteIsBatch: false, // 删除接口,是否需要批量?
deleteIsBatchKey: 'id', // 删除接口批量状态下由那个key进行标记操作比如piduid...
exportURL: '', // 导出接口API地址
requestCallback: null // 获取列表以后执行的回调
},
flag: false,
time: null,
// 默认属性
dataForm: {
}, // 查询条件
dataList: [
{
infoList: []
data() {
/* eslint-disable */
return {
// 设置属性
mixinViewModuleOptions: {
createdIsNeed: true, // 此页面是否在创建时,调用查询数据列表接口?
activatedIsNeed: false, // 此页面是否在激活(进入)时,调用查询数据列表接口?
getDataListURL: '', // 数据列表接口API地址
getDataListIsPage: false, // 数据列表接口,是否需要分页?
deleteURL: '', // 删除接口API地址
deleteIsBatch: false, // 删除接口,是否需要批量?
deleteIsBatchKey: 'id', // 删除接口批量状态下由那个key进行标记操作比如piduid...
exportURL: '', // 导出接口API地址
requestCallback: null // 获取列表以后执行的回调
},
flag: false,
time: null,
// 默认属性
dataForm: {}, // 查询条件
dataList: [{
infoList: []
}], // 数据列表
order: '', // 排序ascdesc
orderField: '', // 排序,字段
page: 1, // 当前页码
limit: 10, // 每页数
total: 0, // 总条数
dataListLoading: false, // 数据列表loading状态
dataListSelections: [], // 数据列表,多选项
addOrUpdateVisible: false // 新增更新弹窗visible状态
}
], // 数据列表
order: '', // 排序ascdesc
orderField: '', // 排序,字段
page: 1, // 当前页码
limit: 10, // 每页数
total: 0, // 总条数
dataListLoading: false, // 数据列表loading状态
dataListSelections: [], // 数据列表,多选项
addOrUpdateVisible: false // 新增更新弹窗visible状态
}
/* eslint-enable */
},
created () {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.query()
}
},
activated () {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query()
}
},
methods: {
// 获取数据列表
query () {
this.dataListLoading = true
this.$http.get(
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
// order: this.order,
// orderField: this.orderField,
// type: '组件服务',
name: '',
page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
...this.dataForm
})
/* eslint-enable */
},
created() {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.query()
}
},
activated() {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query()
}
},
methods: {
// 获取数据列表
query() {
this.dataListLoading = true
this.$http.get(
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
// order: this.order,
// orderField: this.orderField,
// type: '组件服务',
name: '',
page: this.mixinViewModuleOptions.getDataListIsPage ? this.page : null,
limit: this.mixinViewModuleOptions.getDataListIsPage ? this.limit : null,
...this.dataForm
})
).then(({ data: res }) => {
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
this.dataList.map((item, index) => {
if (this.dataList[index].type != null) {
switch (item.type) {
case 1: this.dataList[index].type = '省'; break
case 2: this.dataList[index].type = '市'; break
case 3: this.dataList[index].type = '区'; break
case 4: this.dataList[index].type = '企业'; break
).then(({ data: res }) => {
if (res.code !== 0) {
this.dataList = []
this.total = 0
return this.$message.error(res.msg)
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
this.dataList.map((item, index) => {
if (this.dataList[index].type != null) {
switch (item.type) {
case 1:
this.dataList[index].type = '省';
break
case 2:
this.dataList[index].type = '市';
break
case 3:
this.dataList[index].type = '区';
break
case 4:
this.dataList[index].type = '企业';
break
}
}
if (item.children != null) {
item.children.map((item2, index2) => {
switch (item2.type) {
case 1:
this.dataList[index].children[index2].type = '省';
break
case 2:
this.dataList[index].children[index2].type = '市';
break
case 3:
this.dataList[index].children[index2].type = '区';
break
case 4:
this.dataList[index].children[index2].type = '企业';
break
}
})
}
})
// 我的代办特殊处理
if (this.mixinViewModuleOptions.getDataListURL === '/act/task/myToDoTaskPage') {
this.$http.get('/sys/user/info').then(userRes => {
console.log('当前用户信息===========>', userRes.data.data.id)
const userId = userRes.data.data.id
this.dataList = this.dataList.filter(item => {
// userId creator
console.log(item.params.creator)
if (!(item.params.creator === userId) && !(item.params.userId === userId)) {
return item
}
})
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
})
} else {
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
}
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
if (this.dataList[0].type === '组件服务') {
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域' || item.attrType === '组件类型')
})
} else if (this.dataList[0].type === '应用资源') {
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域')
})
} else if (this.dataList[0].type === '应用系统') {
this.dataList.forEach((item) => {
item.belongProject = "城市信息模型";
item.belongSystem = "信息模型技术平台";
});
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域')
})
}
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data)
}
this.dataListLoading = false
}).catch(() => {
this.dataListLoading = false
})
},
// 多选
dataListSelectionChangeHandle(val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle(data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
return false
}
}
if (item.children != null) {
item.children.map((item2, index2) => {
switch (item2.type) {
case 1: this.dataList[index].children[index2].type = '省'; break
case 2: this.dataList[index].children[index2].type = '市'; break
case 3: this.dataList[index].children[index2].type = '区'; break
case 4: this.dataList[index].children[index2].type = '企业'; break
}
this.order = data.order.replace(/ending$/, '')
this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
this.query()
},
// 分页, 每页条数
pageSizeChangeHandle(val) {
this.page = 1
this.limit = val
this.query()
},
// 分页, 当前页
pageCurrentChangeHandle(val) {
this.page = val
this.query()
},
getDataList: function() {
this.page = 1
this.query()
},
// 新增
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
}
})
// 我的代办特殊处理
if (this.mixinViewModuleOptions.getDataListURL === '/act/task/myToDoTaskPage') {
this.$http.get('/sys/user/info').then(userRes => {
console.log('当前用户信息===========>', userRes.data.data.id)
const userId = userRes.data.data.id
this.dataList = this.dataList.filter(item => {
// userId creator
console.log(item.params.creator)
if (!(item.params.creator === userId) && !(item.params.userId === userId)) {
return item
}
})
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
})
} else {
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
}
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
if (this.dataList[0].type === '组件服务') {
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域' || item.attrType === '组件类型')
})
} else if (this.dataList[0].type === '应用资源') {
this.dataList.map(val => {
val.infoList2 = val.infoList.filter(item => item.attrType === '应用领域')
})
}
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data)
}
this.dataListLoading = false
}).catch(() => {
this.dataListLoading = false
})
},
// 多选
dataListSelectionChangeHandle (val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle (data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
return false
}
this.order = data.order.replace(/ending$/, '')
this.orderField = data.prop.replace(/([A-Z])/g, '_$1').toLowerCase()
this.query()
},
// 分页, 每页条数
pageSizeChangeHandle (val) {
this.page = 1
this.limit = val
this.query()
},
// 分页, 当前页
pageCurrentChangeHandle (val) {
this.page = val
this.query()
},
getDataList: function () {
this.page = 1
this.query()
},
// 新增
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
})
},
},
// 组件服务新增
addOrUpdateHandleAI (id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
showList = res.data.filter(item => item.name === '组件服务')[0].children
showList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2) => {
const options = []
if (item2.isLinkToDic == 'true') {
this.$http.get('/sys/dict/data/page?page=1&limit=99&dictTypeId=' + item2.linkValue).then(({ data: res }) => {
res.data.list.forEach((val) => {
options.push(val.dictLabel)
})
item2.options = options
}).catch(() => { })
}
item2.note1 = ''
// if (item.name !== '必填信息' && item.name !== '服务接口信息') {
// infoList.push({
// attrType: item2.name,
// attrValue: '',
// delFlag: 0,
// options: options
// })
// }
})
}
})
console.log(res, showList)
this.flag = true
}).catch(() => { })
// 组件服务新增
addOrUpdateHandleAI(id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
showList = res.data.filter(item => item.name === '组件服务')[0].children
showList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2) => {
const options = []
if (item2.isLinkToDic == 'true') {
this.$http.get('/sys/dict/data/page?page=1&limit=99&dictTypeId=' + item2.linkValue).then(({ data: res }) => {
res.data.list.forEach((val) => {
options.push(val.dictLabel)
})
item2.options = options
}).catch(() => {})
}
item2.note1 = ''
// if (item.name !== '必填信息' && item.name !== '服务接口信息') {
// infoList.push({
// attrType: item2.name,
// attrValue: '',
// delFlag: 0,
// options: options
// })
// }
})
}
})
console.log(res, showList)
this.flag = true
}).catch(() => {})
// 定时器
this.time = setInterval(() => {
console.log('定时器')
if (this.flag) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
// this.$refs.addOrUpdate.dataForm.infoList = infoList
this.$refs.addOrUpdate.dataForm.showList = showList
this.$refs.addOrUpdate.dataForm.showListAll = showList
this.$refs.addOrUpdate.checkList = []
showList.forEach(val => {
this.$refs.addOrUpdate.checkList.push(val.name)
})
console.log('this.$refs.addOrUpdate.dataForm.showList', this.$refs.addOrUpdate.dataForm.showList)
})
this.flag = false
clearInterval(this.time)
}
}, 100)
},
// 应用资源新增
addOrUpdateHandleServe (id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
showList = res.data.filter(item => item.name === '应用资源')[0].children
showList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2) => {
const options = []
if (item2.isLinkToDic == 'true') {
this.$http.get('/sys/dict/data/page?page=1&limit=99&dictTypeId=' + item2.linkValue).then(({ data: res }) => {
res.data.list.forEach((val) => {
options.push(val.dictLabel)
})
item2.options = options
}).catch(() => { })
}
item2.note1 = ''
// if (item.name !== '必填信息' && item.name !== '服务接口信息') {
// infoList.push({
// attrType: item2.name,
// attrValue: '',
// delFlag: 0,
// options: options
// })
// }
})
}
})
console.log(res, showList)
this.flag = true
}).catch(() => { })
// 定时器
this.time = setInterval(() => {
console.log('定时器')
if (this.flag) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
// this.$refs.addOrUpdate.dataForm.infoList = infoList
this.$refs.addOrUpdate.dataForm.showList = showList
this.$refs.addOrUpdate.dataForm.showListAll = showList
this.$refs.addOrUpdate.checkList = []
showList.forEach(val => {
this.$refs.addOrUpdate.checkList.push(val.name)
})
console.log('this.$refs.addOrUpdate.dataForm.showList', this.$refs.addOrUpdate.dataForm.showList)
})
this.flag = false
clearInterval(this.time)
}
}, 100)
},
// 应用资源新增
addOrUpdateHandleServe(id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
showList = res.data.filter(item => item.name === '应用资源')[0].children
showList.forEach((item, index) => {
if (item.children && item.children.length > 0) {
item.children.forEach((item2) => {
const options = []
if (item2.isLinkToDic == 'true') {
this.$http.get('/sys/dict/data/page?page=1&limit=99&dictTypeId=' + item2.linkValue).then(({ data: res }) => {
res.data.list.forEach((val) => {
options.push(val.dictLabel)
})
item2.options = options
}).catch(() => {})
}
item2.note1 = ''
// if (item.name !== '必填信息' && item.name !== '服务接口信息') {
// infoList.push({
// attrType: item2.name,
// attrValue: '',
// delFlag: 0,
// options: options
// })
// }
})
}
})
console.log(res, showList)
this.flag = true
}).catch(() => {})
// 定时器
this.time = setInterval(() => {
console.log('定时器')
if (this.flag) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
// this.$refs.addOrUpdate.dataForm.infoList = infoList
this.$refs.addOrUpdate.dataForm.showList = showList
this.$refs.addOrUpdate.dataForm.showListAll = showList
this.$refs.addOrUpdate.checkList = []
showList.forEach(val => {
this.$refs.addOrUpdate.checkList.push(val.name)
// 定时器
this.time = setInterval(() => {
console.log('定时器')
if (this.flag) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = false
this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.init()
// this.$refs.addOrUpdate.dataForm.infoList = infoList
this.$refs.addOrUpdate.dataForm.showList = showList
this.$refs.addOrUpdate.dataForm.showListAll = showList
this.$refs.addOrUpdate.checkList = []
showList.forEach(val => {
this.$refs.addOrUpdate.checkList.push(val.name)
})
console.log('this.$refs.addOrUpdate.dataForm.showList', this.$refs.addOrUpdate.dataForm.showList)
})
this.flag = false
clearInterval(this.time)
}
}, 100)
},
// 修改
UpdateHandle(val) {
this.addOrUpdateVisible = true
this.disabled = false
const cloneVal = deepClone(val)
console.log('修改的数据', cloneVal)
cloneVal.infoList.forEach(item => {
delete item.createDate
delete item.creator
delete item.id
delete item.updateDate
delete item.updater
delete item.note1
delete item.note2
delete item.note3
delete item.note4
delete item.note5
})
console.log('this.$refs.addOrUpdate.dataForm.showList', this.$refs.addOrUpdate.dataForm.showList)
})
this.flag = false
clearInterval(this.time)
}
}, 100)
},
// 修改
UpdateHandle (val) {
this.addOrUpdateVisible = true
this.disabled = false
const cloneVal = deepClone(val)
console.log('修改的数据', cloneVal)
cloneVal.infoList.forEach(item => {
delete item.createDate
delete item.creator
delete item.id
delete item.updateDate
delete item.updater
delete item.note1
delete item.note2
delete item.note3
delete item.note4
delete item.note5
})
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = true
this.$refs.addOrUpdate.dataFormUpdate = cloneVal
this.$refs.addOrUpdate.init()
console.log('===========================', this.$refs.addOrUpdate.dataFormUpdate)
})
},
// 关闭当前窗口
closeCurrentTab (data) {
var tabName = this.$store.state.contentTabsActiveName
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
return false
}
if (tabName === this.$store.state.contentTabsActiveName) {
this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
}
},
// 删除
deleteHandle (id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('delete') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.delete(
`${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,
this.mixinViewModuleOptions.deleteIsBatch ? {
data: id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])
} : {}
).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.query()
this.$nextTick(() => {
this.$refs.addOrUpdate.UpdateState = true
this.$refs.addOrUpdate.dataFormUpdate = cloneVal
this.$refs.addOrUpdate.init()
console.log('===========================', this.$refs.addOrUpdate.dataFormUpdate)
})
},
// 关闭当前窗口
closeCurrentTab(data) {
var tabName = this.$store.state.contentTabsActiveName
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
if (this.$store.state.contentTabs.length <= 0) {
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
return false
}
})
}).catch(() => { })
}).catch(() => { })
},
if (tabName === this.$store.state.contentTabsActiveName) {
this.$router.push({ name: this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1].name })
}
},
// 删除
deleteHandle(id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { handle: this.$t('delete') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.delete(
`${this.mixinViewModuleOptions.deleteURL}${this.mixinViewModuleOptions.deleteIsBatch ? '' : '/' + id}`,
this.mixinViewModuleOptions.deleteIsBatch ? {
data: id ? [id] : this.dataListSelections.map(item => item[this.mixinViewModuleOptions.deleteIsBatchKey])
} : {}
).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.query()
}
})
}).catch(() => {})
}).catch(() => {})
},
deleteHandle2 (id) {
console.log('删除========================》', id, this.dataListSelections)
const ids = []
if (id) {
ids.push(id)
} else {
if (this.dataListSelections.length > 0) {
this.dataListSelections.forEach(item => {
ids.push(item.id)
})
deleteHandle2(id) {
console.log('删除========================》', id, this.dataListSelections)
const ids = []
if (id) {
ids.push(id)
} else {
if (this.dataListSelections.length > 0) {
this.dataListSelections.forEach(item => {
ids.push(item.id)
})
}
}
this.$http.post('/resource/delete', { ids: ids }).then(res => {
console.log('删除成功', res)
this.getDataList()
})
},
// 导出
exportHandle() {
var params = qs.stringify({
token: Cookies.get('ucsToken'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG.apiURL}${this.mixinViewModuleOptions.exportURL}?${params}`
}
}
this.$http.post('/resource/delete', { ids: ids }).then(res => {
console.log('删除成功', res)
this.getDataList()
})
},
// 导出
exportHandle () {
var params = qs.stringify({
token: Cookies.get('ucsToken'),
...this.dataForm
})
window.location.href = `${window.SITE_CONFIG.apiURL}${this.mixinViewModuleOptions.exportURL}?${params}`
}
}
}
}

View File

@ -2,7 +2,7 @@
<div>
<el-dialog
:visible.sync="visible"
title="关联应用"
title="关联标签"
@close="close"
:close-on-click-modal="false"
:close-on-press-escape="false"
@ -13,7 +13,7 @@
v-model="transferValue"
filterable
:filter-method="filterMethod"
filter-placeholder="请输入应用名称"
filter-placeholder="请输入标签名称"
:titles="nameArray"
:props="{
key: 'id',
@ -24,7 +24,7 @@
</div>
<template slot="footer">
<el-button @click="visible = false">{{ $t("cancel") }}</el-button>
<el-button type="primary" @click="confirmSubmitHandle()">{{
<el-button type="primary" @click="visible = false">{{
$t("confirm")
}}</el-button>
</template>
@ -42,6 +42,140 @@ export default {
visible: true,
transferData: [], //穿
transferValue: [], //id
linkedData:[
{
id: "1534805370156834818",
dictTypeId: "1534805229031088130",
name: "视频类",
dictValue: "1",
remark: "",
sort: 0,
createDate: "2022-06-09 15:51:30",
updateDate: "2022-07-01 14:20:04",
status: 1
},
{
id: "1536670196898336769",
dictTypeId: "1534805229031088130",
name: "图片类",
dictValue: "2",
remark: "",
sort: 1,
createDate: "2022-06-14 19:21:40",
updateDate: "2022-07-01 14:20:27",
status: 1
},
{
id: "1534805309289095170",
dictTypeId: "1534805229031088130",
name: "文本类",
dictValue: "3",
remark: "",
sort: 2,
createDate: "2022-06-09 15:51:16",
updateDate: "2022-07-01 14:19:52",
status: 1
},
{
id: "1542753737822306305",
dictTypeId: "1534805229031088130",
name: "语音类",
dictValue: "4",
remark: "",
sort: 3,
createDate: "2022-07-01 14:15:29",
updateDate: "2022-07-01 14:15:29",
status: 1
},
{
id: "1536670305505644545",
dictTypeId: "1534805229031088130",
name: "其他",
dictValue: "5",
remark: "",
sort: 4,
createDate: "2022-06-14 19:22:05",
updateDate: "2022-07-01 14:15:11",
status: 1
}
],//
labelData:[{
id: "1513714443263451137",
dictTypeId: "1513714403530809346",
name: "接口",
dictValue: "1",
remark: "",
sort: 1,
createDate: "2022-04-12 11:03:41",
updateDate: "2022-04-12 11:03:41",
status: 1
},
{
id: "1513714474334855170",
dictTypeId: "1513714403530809346",
name: "SDK",
dictValue: "2",
remark: "",
sort: 2,
createDate: "2022-04-12 11:03:49",
updateDate: "2022-04-12 11:03:49",
status: 1
},
{
id: "1513714504261214210",
dictTypeId: "1513714403530809346",
name: "Web页面",
dictValue: "3",
remark: "",
sort: 3,
createDate: "2022-04-12 11:03:56",
updateDate: "2022-04-12 11:03:56",
status: 1
},
{
id: "1513714541603102722",
dictTypeId: "1513714403530809346",
name: "其他",
dictValue: "99",
remark: "",
sort: 99,
createDate: "2022-04-12 11:04:05",
updateDate: "2022-04-12 11:04:05",
status: 1
}, {
id: "1539453444552638466",
dictTypeId: "1539453183746621441",
name: "视频资源",
dictValue: "1",
remark: "",
sort: 0,
createDate: "2022-06-22 11:41:18",
updateDate: "2022-06-22 11:41:18",
status: 1
},
{
id: "1539453481407987714",
dictTypeId: "1539453183746621441",
name: "感知资源",
dictValue: "2",
remark: "",
sort: 0,
createDate: "2022-06-22 11:41:26",
updateDate: "2022-06-22 11:41:26",
status: 1
},
{
id: "1539453516610781185",
dictTypeId: "1539453183746621441",
name: "云资源",
dictValue: "3",
remark: "",
sort: 0,
createDate: "2022-06-22 11:41:35",
updateDate: "2022-06-22 11:41:35",
status: 1
}
]
};
},
props: {
@ -51,7 +185,7 @@ export default {
},
nameArray: {
type: Array,
default: ["未关联应用名称", "已关联应用名称"],
default: ["未关联标签名称", "已关联标签名称"],
},
},
computed: {},
@ -86,16 +220,15 @@ export default {
},
},
mounted() {
if (this.relateInfo && this.relateInfo.responseData) {
const alreadLinkedArr = this.relateInfo.responseData.alreadLinked || [];
this.transferData = alreadLinkedArr.concat(
this.relateInfo.responseData.notLinked || []
);
alreadLinkedArr.length &&
alreadLinkedArr.forEach((item) => {
this.transferValue.push(item.id);
});
}
if (this.relateInfo) {
const alreadLinkedArr = this.linkedData;
this.transferData = alreadLinkedArr.concat(
this.labelData
);
alreadLinkedArr.length &&
alreadLinkedArr.forEach((item) => {
this.transferValue.push(item.id);
}); }
},
};
</script>

View File

@ -73,14 +73,14 @@
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
prop="belongProject"
label="归属项目"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
prop="belongSystem"
label="归属系统"
header-align="center"
align="center"
@ -303,10 +303,16 @@ export default {
orderType: 'DESC',
pageNum: this.currentPage,
pageSize: 10,
type: '组件服务',
type: 'GIS图层',
};
this.$http.post(`/resource/pageWithAttrs`, params).then((res) => {
this.dataList = res.data.data.records;
if(this.dataList.length>0){
this.dataList.forEach((item)=>{
item.belongProject = "城市信息模型";
item.belongSystem = "信息模型技术平台";
});
}
this.total = parseInt(res.data.data.total);
})
},

View File

@ -75,14 +75,14 @@
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
prop="belongProject"
label="归属项目"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
prop="belongSystem"
label="归属系统"
header-align="center"
align="center"
@ -222,18 +222,18 @@ export default {
creator: '',
selectType: 0,
delFlag: 0,
type: '应用资源'
type: '应用系统'
},
qp: false,
relateApplicationResourceVisible: false,
relationData: {}, // 穿
topNameArray: [], //
radio: '应用资源',
radio: '应用系统',
insertList: [],
putOnTheShelfList: [],
showPutOnTheShelfFlag2: false,
submitFrom: {
type: '应用资源',
type: '应用系统',
deptId: '',
delFlag: 0,
infoList: [
@ -244,7 +244,7 @@ export default {
// }
]
},
typeInput: '应用资源'
typeInput: '应用系统'
}
},
watch: {},
@ -255,7 +255,7 @@ export default {
},
created () {
this.dataForm.name = ''
this.dataForm.type = '应用资源'
this.dataForm.type = '应用系统'
},
mounted () {
// window.addEventListener('resize', this.a)
@ -276,7 +276,7 @@ export default {
limit: 10,
delFlag: 0,
creator: '',
type: '应用资源',
type: '应用系统',
name: ''
})
)
@ -289,10 +289,16 @@ export default {
}
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
? res.data.list
: res.data
: res.data
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total
: 0
: 0;
if(this.dataList.length>0){
this.dataList.forEach((item)=>{
item.belongProject = "城市信息模型";
item.belongSystem = "信息模型技术平台";
});
}
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data)
}
@ -351,7 +357,7 @@ export default {
// type: '',
pageNum: 1,
pageSize: this.limit,
type: '应用资源',
type: '应用系统',
creator: '',
selectType: 0,
delFlag: 0,
@ -453,7 +459,7 @@ export default {
linkType: '1',
responseData: res.data
}
this.topNameArray = ['未关联组件名称', '已关联组件名称']
this.topNameArray = ['未关联标签名称', '已关联标签名称']
console.log(' this.relationData', this.relationData)
//
})
@ -526,9 +532,9 @@ export default {
this.showPutOnTheShelfFlag2 = false
this.insertList = []
this.putOnTheShelfList = []
this.radio = '应用资源'
this.radio = '应用系统'
this.submitFrom = {
type: '应用资源',
type: '应用系统',
deptId: '',
delFlag: 0,
infoList: [
@ -719,8 +725,8 @@ export default {
UpdateData (item) {
this.$http.get('/category/getCategoryTree').then(res => {
this.insertList = res.data.data.filter(item => item.name === '应用资源一')[0]
this.radio = '应用资源'
// this.radio = item.infoList.filter(val => val.attrType === '')[0].attrValue
this.radio = '应用系统'
// this.radio = item.infoList.filter(val => val.attrType === '')[0].attrValue
this.putOnTheShelfList = this.insertList.children
// this.putOnTheShelfList = this.insertList.children.filter(item => item.name === this.radio)[0].children
this.putOnTheShelfList.map(parent => {

View File

@ -70,20 +70,6 @@
label="能力描述"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
label="归属项目"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
prop="deptName"
label="归属系统"
header-align="center"
align="center"
></el-table-column>
<el-table-column
:show-overflow-tooltip="true"
@ -303,7 +289,7 @@ export default {
orderType: 'DESC',
pageNum: this.currentPage,
pageSize: 10,
type: '组件服务',
type: 'GIS图层',
};
this.$http.post(`/resource/pageWithAttrs`, params).then((res) => {
this.dataList = res.data.data.records;

View File

@ -293,7 +293,7 @@ export default {
orderType: 'DESC',
pageNum: this.currentPage,
pageSize: 10,
type: '组件服务',
type: 'GIS图层',
};
this.$http.post(`/resource/pageWithAttrs`, params).then((res) => {
this.dataList = res.data.data.records;