组件服务-挂接

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

View File

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