组件服务-挂接

This commit is contained in:
gaoyuanwei 2022-07-20 15:04:52 +08:00
parent 9cdbc6ef61
commit 29a5016590
2 changed files with 34 additions and 34 deletions

View File

@ -2,7 +2,7 @@ import Cookies from 'js-cookie'
import qs from 'qs'
import { deepClone } from '@/utils/form-generator/index'
export default {
data () {
data() {
/* eslint-disable */
return {
// 设置属性
@ -38,19 +38,19 @@ export default {
}
/* eslint-enable */
},
created () {
created() {
if (this.mixinViewModuleOptions.createdIsNeed) {
this.query()
}
},
activated () {
activated() {
if (this.mixinViewModuleOptions.activatedIsNeed) {
this.query()
}
},
methods: {
// 获取数据列表
query () {
query() {
this.dataListLoading = true
this.$http.get(
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
@ -109,11 +109,11 @@ export default {
}
console.log('数据列表', this.dataList, this.mixinViewModuleOptions.getDataListURL)
if (this.dataList[0].type === '组件服务') {
this.dataList.map(val => {
val.infoList = val.infoList.filter(item => item.attrType === '部署位置' || item.attrType === '组件类型' || item.attrType === '应用领域')
})
}
// if (this.dataList[0].type === '组件服务') {
// this.dataList.map(val => {
// val.infoList = val.infoList.filter(item => item.attrType === '部署位置' || item.attrType === '组件类型' || item.attrType === '应用领域')
// })
// }
if (this.mixinViewModuleOptions.requestCallback) {
this.mixinViewModuleOptions.requestCallback(res.data)
}
@ -123,11 +123,11 @@ export default {
})
},
// 多选
dataListSelectionChangeHandle (val) {
dataListSelectionChangeHandle(val) {
this.dataListSelections = val
},
// 排序
dataListSortChangeHandle (data) {
dataListSortChangeHandle(data) {
if (!data.order || !data.prop) {
this.order = ''
this.orderField = ''
@ -138,13 +138,13 @@ export default {
this.query()
},
// 分页, 每页条数
pageSizeChangeHandle (val) {
pageSizeChangeHandle(val) {
this.page = 1
this.limit = val
this.query()
},
// 分页, 当前页
pageCurrentChangeHandle (val) {
pageCurrentChangeHandle(val) {
this.page = val
this.query()
},
@ -153,7 +153,7 @@ export default {
this.query()
},
// 新增
addOrUpdateHandle (id) {
addOrUpdateHandle(id) {
this.addOrUpdateVisible = true
this.disabled = false
this.$nextTick(() => {
@ -164,7 +164,7 @@ export default {
},
// 组件服务新增
addOrUpdateHandleAI (id) {
addOrUpdateHandleAI(id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
@ -222,7 +222,7 @@ export default {
}, 100)
},
// 应用资源新增
addOrUpdateHandleServe (id) {
addOrUpdateHandleServe(id) {
// const infoList = []
let showList = []
this.$http.get('category/getCategoryTree').then(({ data: res }) => {
@ -280,7 +280,7 @@ export default {
}, 100)
},
// 修改
UpdateHandle (val) {
UpdateHandle(val) {
this.addOrUpdateVisible = true
this.disabled = false
const cloneVal = deepClone(val)
@ -305,7 +305,7 @@ export default {
})
},
// 关闭当前窗口
closeCurrentTab (data) {
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) {
@ -317,7 +317,7 @@ export default {
}
},
// 删除
deleteHandle (id) {
deleteHandle(id) {
if (this.mixinViewModuleOptions.deleteIsBatch && !id && this.dataListSelections.length <= 0) {
return this.$message({
message: this.$t('prompt.deleteBatch'),
@ -351,7 +351,7 @@ export default {
}).catch(() => { })
},
deleteHandle2 (id) {
deleteHandle2(id) {
console.log('删除========================》', id, this.dataListSelections)
const ids = []
if (id) {
@ -369,7 +369,7 @@ export default {
})
},
// 导出
exportHandle () {
exportHandle() {
var params = qs.stringify({
token: Cookies.get('ucsToken'),
...this.dataForm

View File

@ -299,19 +299,19 @@ export default {
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
? res.data.list
: res.data
this.dataList.map((item, index) => {
const dataListSinforList = []
item.infoList.map((itemson, indexson) => {
if (
itemson.attrType === '部署位置' ||
itemson.attrType === '组件类型' ||
itemson.attrType === '应用领域'
) {
dataListSinforList.push(itemson)
}
})
this.dataList[index].infoList = dataListSinforList
})
// this.dataList.map((item, index) => {
// const dataListSinforList = []
// item.infoList.map((itemson, indexson) => {
// if (
// itemson.attrType === '' ||
// itemson.attrType === '' ||
// itemson.attrType === ''
// ) {
// dataListSinforList.push(itemson)
// }
// })
// this.dataList[index].infoList = dataListSinforList
// })
console.log('this.dataList', this.dataList)
this.total = this.mixinViewModuleOptions.getDataListIsPage
? res.data.total