2021-04-12 13:00:59 +08:00
|
|
|
|
import bus from '@/libs/bus'
|
|
|
|
|
|
import { tableSet } from '@/components/common/js/tools'
|
|
|
|
|
|
import { fromRoute } from '@/components/common/js/constants'
|
2021-12-22 14:20:13 +08:00
|
|
|
|
import routerPathParams from '@/components/common/mixin/routerPathParams'
|
2022-03-17 16:42:56 +08:00
|
|
|
|
import defaultData from '@/components/chart/defaultLineData'
|
2022-10-17 11:46:41 +08:00
|
|
|
|
import deleteButton from '@/components/common/deleteButton'
|
2022-03-17 16:42:56 +08:00
|
|
|
|
import lodash from 'lodash'
|
2021-04-12 13:00:59 +08:00
|
|
|
|
export default {
|
2022-10-17 11:46:41 +08:00
|
|
|
|
components: {
|
|
|
|
|
|
deleteButton
|
|
|
|
|
|
},
|
2021-12-22 14:20:13 +08:00
|
|
|
|
mixins: [routerPathParams],
|
2021-12-23 19:10:52 +08:00
|
|
|
|
props: {
|
2021-12-23 20:24:18 +08:00
|
|
|
|
switchTab: {
|
2021-12-23 19:10:52 +08:00
|
|
|
|
type: String,
|
|
|
|
|
|
default: ''
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
fromRoute: fromRoute,
|
|
|
|
|
|
// 侧滑
|
|
|
|
|
|
rightBox: {
|
|
|
|
|
|
show: false
|
|
|
|
|
|
},
|
|
|
|
|
|
pageObj: { // 分页对象
|
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
|
pageSize: this.$CONSTANTS.defaultPageSize,
|
2021-10-09 16:47:38 +08:00
|
|
|
|
pages: 1,
|
2021-04-12 13:00:59 +08:00
|
|
|
|
total: 0
|
|
|
|
|
|
},
|
2022-03-04 14:03:49 +08:00
|
|
|
|
orderBy: 'id',
|
2021-04-12 13:00:59 +08:00
|
|
|
|
/* 工具参数 */
|
|
|
|
|
|
tools: {
|
2021-05-19 11:32:41 +08:00
|
|
|
|
loading: true, // 是否显示table加载动画
|
2021-04-29 22:24:38 +08:00
|
|
|
|
customTableTitle: [], // 自定义列工具的数据
|
|
|
|
|
|
extraTableTitle: [] // 特殊页面(asset)额外的列
|
2021-04-12 13:00:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
mainTableHeight: this.$tableHeight.normal, // 主列表table高度
|
|
|
|
|
|
batchDeleteObjs: [],
|
|
|
|
|
|
object: {},
|
|
|
|
|
|
|
|
|
|
|
|
tableData: [],
|
|
|
|
|
|
searchLabel: {}, // 搜索参数
|
|
|
|
|
|
scrollbarWrap: null,
|
|
|
|
|
|
delFlag: false,
|
2021-04-20 14:38:24 +08:00
|
|
|
|
fromBottom: false,
|
2021-04-21 12:55:09 +08:00
|
|
|
|
operationWidth: '165', // 操作列宽
|
2023-08-30 17:30:36 +08:00
|
|
|
|
searchCheckBox: {},
|
|
|
|
|
|
detailType: 'list',
|
|
|
|
|
|
preferenceLoading: true
|
2021-04-12 13:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-10-14 15:43:11 +08:00
|
|
|
|
provide () {
|
|
|
|
|
|
return {
|
2023-04-19 17:32:37 +08:00
|
|
|
|
getTableData: this.getTableData,
|
|
|
|
|
|
delCallBack: this.delCallBack
|
2022-10-14 15:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
methods: {
|
|
|
|
|
|
sortableShow: tableSet.sortableShow,
|
|
|
|
|
|
propTitle: tableSet.propTitle,
|
|
|
|
|
|
asce: tableSet.asce,
|
|
|
|
|
|
desc: tableSet.desc,
|
|
|
|
|
|
strTodate: tableSet.strTodate,
|
2021-04-13 10:00:48 +08:00
|
|
|
|
tableOperation ([command, row]) {
|
2021-04-12 13:00:59 +08:00
|
|
|
|
switch (command) {
|
|
|
|
|
|
case 'edit': {
|
|
|
|
|
|
this.edit(row)
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
case 'delete': {
|
2021-04-13 10:00:48 +08:00
|
|
|
|
this.del(row)
|
2021-04-12 13:00:59 +08:00
|
|
|
|
break
|
|
|
|
|
|
}
|
2021-05-11 20:47:22 +08:00
|
|
|
|
case 'copy': {
|
|
|
|
|
|
this.copy(row)
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
2021-04-12 13:00:59 +08:00
|
|
|
|
default:
|
|
|
|
|
|
break
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
isBuildIn (row) {
|
|
|
|
|
|
return (row.buildIn && row.buildIn == 1) || (row.builtIn && row.builtIn == 1)
|
|
|
|
|
|
},
|
2021-04-13 10:00:48 +08:00
|
|
|
|
selectionChange (objs) {
|
|
|
|
|
|
this.batchDeleteObjs = objs
|
|
|
|
|
|
},
|
2021-04-16 21:10:31 +08:00
|
|
|
|
getTableData (params) {
|
|
|
|
|
|
if (params && Object.keys(params).length > 0) {
|
|
|
|
|
|
for (const key in params) {
|
|
|
|
|
|
this.$set(this.searchLabel, key, params[key])
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-10-13 18:24:09 +08:00
|
|
|
|
if (this.orderBy) {
|
|
|
|
|
|
this.$set(this.searchLabel, 'orderBy', this.orderBy)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
delete this.searchLabel.orderBy
|
|
|
|
|
|
}
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.$set(this.searchLabel, 'pageNo', this.pageObj.pageNo)
|
|
|
|
|
|
this.$set(this.searchLabel, 'pageSize', this.pageObj.pageSize)
|
|
|
|
|
|
this.tools.loading = true
|
2021-12-23 20:24:18 +08:00
|
|
|
|
const dataListParam = {
|
|
|
|
|
|
...this.searchLabel,
|
|
|
|
|
|
...this.searchCheckBox
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.switchTab) {
|
|
|
|
|
|
dataListParam.switchTab = this.switchTab
|
2021-12-22 14:20:13 +08:00
|
|
|
|
}
|
2022-09-19 10:57:58 +08:00
|
|
|
|
let path = this.$route.fullPath.match(/\/(\S*)\?/)
|
|
|
|
|
|
if (!path) {
|
|
|
|
|
|
path = ''
|
|
|
|
|
|
} else {
|
|
|
|
|
|
path = path[1]
|
|
|
|
|
|
}
|
2021-12-23 20:24:18 +08:00
|
|
|
|
this.updatePath(dataListParam, path)
|
2021-04-21 12:55:09 +08:00
|
|
|
|
this.$get(this.url, { ...this.searchLabel, ...this.searchCheckBox }).then(response => {
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.tools.loading = false
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
for (let i = 0; i < response.data.list.length; i++) {
|
|
|
|
|
|
response.data.list[i].status = response.data.list[i].status + ''
|
|
|
|
|
|
}
|
2022-02-25 14:07:17 +08:00
|
|
|
|
if (this.needAlertDaysData) {
|
|
|
|
|
|
response.data.list.forEach(item => {
|
|
|
|
|
|
item.trendLoading = true
|
2022-03-04 13:59:25 +08:00
|
|
|
|
item.left = 0
|
|
|
|
|
|
item.top = 0
|
|
|
|
|
|
item.alertNumtooltipShow = false
|
2022-02-25 14:07:17 +08:00
|
|
|
|
item.alertDaysData = [
|
|
|
|
|
|
{
|
|
|
|
|
|
metric: { priority: 'P1' },
|
|
|
|
|
|
values: [[0, 0]]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
metric: { priority: 'P2' },
|
|
|
|
|
|
values: [[0, 0]]
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
metric: { priority: 'P3' },
|
|
|
|
|
|
values: [[0, 0]]
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.tableData = response.data.list
|
2022-01-18 10:06:33 +08:00
|
|
|
|
const globalSearchId = this.$store.getters.getGlobalSearchId
|
|
|
|
|
|
let detailViewRightObj = ''
|
2023-09-27 15:31:00 +08:00
|
|
|
|
if (this.tableId === 'notebookTable' && this.detailType === 'view') { // 防止详情视图编辑后切换到别的数据
|
|
|
|
|
|
const obj = this.tableData.find(item => item.id === this.detailViewRightObj.id)
|
|
|
|
|
|
if (obj) {
|
|
|
|
|
|
detailViewRightObj = obj
|
|
|
|
|
|
} else {
|
|
|
|
|
|
detailViewRightObj = this.tableData[0]
|
|
|
|
|
|
}
|
2022-01-18 10:06:33 +08:00
|
|
|
|
} else {
|
2023-09-27 15:31:00 +08:00
|
|
|
|
if (globalSearchId) {
|
|
|
|
|
|
detailViewRightObj = this.tableData.find(item => item.id === globalSearchId)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
detailViewRightObj = this.tableData[0]
|
|
|
|
|
|
}
|
2022-01-18 10:06:33 +08:00
|
|
|
|
}
|
2023-06-05 14:52:04 +08:00
|
|
|
|
this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.pageObj.total = response.data.total
|
2021-10-09 16:47:38 +08:00
|
|
|
|
this.pageObj.pages = response.data.pages
|
2022-03-01 15:19:43 +08:00
|
|
|
|
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.scrollbarWrap = this.$refs.dataTable.$refs.dataTable.bodyWrapper
|
|
|
|
|
|
this.toTopBtnHandler(this.scrollbarWrap)
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2021-10-13 18:24:09 +08:00
|
|
|
|
if (this.detailType === 'view') {
|
2021-11-26 15:42:06 +08:00
|
|
|
|
this.$refs.dataDetail && (this.$refs.dataDetail.$refs.dataTable.scrollTop = 0)
|
2021-10-13 18:24:09 +08:00
|
|
|
|
}
|
2023-08-21 15:10:54 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.error || response.msg)
|
2021-04-12 13:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
del (row) {
|
2021-04-20 14:38:24 +08:00
|
|
|
|
const self = this
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.$confirm(this.$t('tip.confirmDelete'), {
|
|
|
|
|
|
confirmButtonText: this.$t('tip.yes'),
|
|
|
|
|
|
cancelButtonText: this.$t('tip.no'),
|
2022-08-26 15:56:19 +08:00
|
|
|
|
type: 'warning',
|
|
|
|
|
|
beforeClose: (action, instance, done) => {
|
|
|
|
|
|
if (action === 'confirm') {
|
|
|
|
|
|
this.$delete(this.url + '?ids=' + row.id).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
self.delFlag = true
|
|
|
|
|
|
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') })
|
|
|
|
|
|
self.getTableData()
|
|
|
|
|
|
bus.$emit('delTableRow', [row.id])
|
|
|
|
|
|
} else if (response.data && response.data.list && response.code !== 200) {
|
|
|
|
|
|
self.delFlag = true
|
|
|
|
|
|
this.$refs.deleteButton && this.$refs.deleteButton.showProcess(response.data.list)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.$message.error(response.msg)
|
|
|
|
|
|
}
|
|
|
|
|
|
done()
|
|
|
|
|
|
})
|
2021-04-12 13:00:59 +08:00
|
|
|
|
} else {
|
2022-08-26 15:56:19 +08:00
|
|
|
|
done()
|
2021-04-12 13:00:59 +08:00
|
|
|
|
}
|
2022-08-26 15:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}).then(() => {
|
|
|
|
|
|
|
2021-04-12 13:00:59 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
newObject () {
|
|
|
|
|
|
return JSON.parse(JSON.stringify(this.blankObject))
|
|
|
|
|
|
},
|
|
|
|
|
|
pageNo (val) {
|
|
|
|
|
|
this.pageObj.pageNo = val
|
2021-10-13 11:12:26 +08:00
|
|
|
|
this.getTableData()
|
2021-04-12 13:00:59 +08:00
|
|
|
|
},
|
2023-08-30 17:30:36 +08:00
|
|
|
|
async pageSize (val) {
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.pageObj.pageSize = val
|
2023-08-30 17:30:36 +08:00
|
|
|
|
this.setPreference()
|
2021-10-13 11:12:26 +08:00
|
|
|
|
this.getTableData()
|
2021-04-12 13:00:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
add () {
|
|
|
|
|
|
this.object = this.newObject()
|
|
|
|
|
|
this.rightBox.show = true
|
|
|
|
|
|
},
|
|
|
|
|
|
closeRightBox (refresh) {
|
|
|
|
|
|
this.rightBox.show = false
|
2021-09-14 16:41:19 +08:00
|
|
|
|
this.copyFlag = false
|
2021-04-12 13:00:59 +08:00
|
|
|
|
if (refresh) {
|
|
|
|
|
|
this.delFlag = true
|
|
|
|
|
|
this.getTableData()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-06-01 14:26:09 +08:00
|
|
|
|
closeSilenceBox (refresh) {
|
|
|
|
|
|
this.silenceBoxShow = false
|
|
|
|
|
|
if (refresh) {
|
|
|
|
|
|
this.delFlag = true
|
|
|
|
|
|
this.getTableData()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
edit (u) {
|
2021-04-26 21:42:15 +08:00
|
|
|
|
this.$get(`${this.url}/${u.id}`).then(response => {
|
|
|
|
|
|
if (response.code === 200) {
|
|
|
|
|
|
this.object = response.data
|
|
|
|
|
|
this.rightBox.show = true
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2021-04-12 13:00:59 +08:00
|
|
|
|
},
|
2022-10-31 17:49:48 +08:00
|
|
|
|
copy (u, copyParams) {
|
2023-06-05 14:52:04 +08:00
|
|
|
|
const copyName = this.$lodash.get(copyParams, 'copyName', '-copy')
|
2022-10-31 17:49:48 +08:00
|
|
|
|
this.object = { ...u, name: u.name + copyName, id: '' }
|
2021-08-26 14:51:38 +08:00
|
|
|
|
if (this.object.name.length > 64) {
|
|
|
|
|
|
const length = this.object.name.length - 64
|
2023-06-21 13:41:13 +08:00
|
|
|
|
this.object.name = u.name.substring(0, u.name.length - length) + copyName
|
2021-08-26 14:51:38 +08:00
|
|
|
|
}
|
2021-05-11 20:47:22 +08:00
|
|
|
|
this.rightBox.show = true
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
esc () {
|
|
|
|
|
|
this.rightBox.show = false
|
|
|
|
|
|
},
|
|
|
|
|
|
dragend () {
|
|
|
|
|
|
this.$nextTick(() => {
|
2022-03-01 15:19:43 +08:00
|
|
|
|
if (this.$refs.dataTable) {
|
|
|
|
|
|
this.$refs.dataTable.$refs.dataTable && this.$refs.dataTable.$refs.dataTable.doLayout()
|
|
|
|
|
|
}
|
2021-04-12 13:00:59 +08:00
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
search (searchObj) {
|
|
|
|
|
|
this.searchLabel = {}
|
|
|
|
|
|
this.pageObj.pageNo = 1
|
|
|
|
|
|
for (const item in searchObj) {
|
2021-04-23 20:06:58 +08:00
|
|
|
|
if (typeof searchObj[item] !== 'undefined' && searchObj[item] !== null && searchObj[item] !== '') {
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.$set(this.searchLabel, item, searchObj[item])
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getTableData()
|
|
|
|
|
|
},
|
|
|
|
|
|
tableDataSort (orderBy) {
|
2021-10-13 18:24:09 +08:00
|
|
|
|
this.orderBy = orderBy
|
2021-04-12 13:00:59 +08:00
|
|
|
|
this.getTableData()
|
|
|
|
|
|
},
|
|
|
|
|
|
tableTitleReset (src, dist) {
|
|
|
|
|
|
dist.forEach(item => {
|
|
|
|
|
|
const title = src.find(t => t.prop === item.prop)
|
|
|
|
|
|
if (title && title.label) {
|
|
|
|
|
|
item.label = title.label
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
toTop (wrap) {
|
|
|
|
|
|
let currentTop = wrap.scrollTop
|
|
|
|
|
|
const interval = currentTop / 10
|
|
|
|
|
|
const intervalFunc = setInterval(function () { // 花200ms分10次回到顶部,模拟动画效果
|
|
|
|
|
|
if (currentTop === 0) {
|
|
|
|
|
|
clearInterval(intervalFunc)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
currentTop = (currentTop - interval) < interval * 0.5 ? 0 : currentTop - interval
|
|
|
|
|
|
wrap.scrollTop = currentTop
|
|
|
|
|
|
}
|
|
|
|
|
|
}, 20)
|
|
|
|
|
|
},
|
2021-04-22 16:35:15 +08:00
|
|
|
|
clickTab (showTabInfo, showTab) {
|
|
|
|
|
|
this.$emit('changeShowTab', showTab)
|
|
|
|
|
|
},
|
2021-04-12 13:00:59 +08:00
|
|
|
|
toTopBtnHandler (wrap) {
|
|
|
|
|
|
const vm = this
|
|
|
|
|
|
wrap.addEventListener('scroll', bus.debounce(function () {
|
|
|
|
|
|
vm.tools.showTopBtn = wrap.scrollTop > 50
|
|
|
|
|
|
vm.tools.tableHover = wrap.scrollTop > 50
|
|
|
|
|
|
}, 100))
|
2021-04-29 22:24:38 +08:00
|
|
|
|
},
|
|
|
|
|
|
showClickSearch () {
|
|
|
|
|
|
const index = this.dataListLayout.indexOf('clickSearch')
|
|
|
|
|
|
if (index > -1) {
|
|
|
|
|
|
this.dataListLayout.splice(index, 1)
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.dataListLayout.push('clickSearch')
|
|
|
|
|
|
}
|
2023-08-30 17:30:36 +08:00
|
|
|
|
this.setPreference()
|
2021-06-01 14:26:09 +08:00
|
|
|
|
},
|
|
|
|
|
|
addSilence (row, type) {
|
2021-12-31 16:41:30 +08:00
|
|
|
|
this.blankSilenceObject.startAt = bus.timeFormate(bus.getOffsetTimezoneData(), 'YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
|
this.blankSilenceObject.endAt = bus.timeFormate(bus.getOffsetTimezoneData(1), 'YYYY-MM-DD HH:mm:ss')
|
2021-06-01 14:26:09 +08:00
|
|
|
|
this.objectSilence = JSON.parse(JSON.stringify(this.blankSilenceObject))
|
2021-06-01 15:19:47 +08:00
|
|
|
|
this.objectSilence.name = 'Quick silence'
|
2021-06-01 14:26:09 +08:00
|
|
|
|
if (type !== 'alertMessage' && type !== 'alertRule') {
|
|
|
|
|
|
this.objectSilence.matchers = [
|
|
|
|
|
|
{ name: type, value: row.name, regex: 0 },
|
|
|
|
|
|
{ name: type + '_id', value: row.id, regex: 0 }
|
|
|
|
|
|
]
|
|
|
|
|
|
} else if (type === 'alertMessage') {
|
2023-06-05 14:52:04 +08:00
|
|
|
|
let labels = this.$lodash.cloneDeep(row.labels)
|
2022-07-12 17:42:01 +08:00
|
|
|
|
if (typeof labels === 'string') labels = JSON.parse(labels)
|
2021-06-01 14:26:09 +08:00
|
|
|
|
this.objectSilence.matchers = []
|
2022-09-22 17:07:22 +08:00
|
|
|
|
const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id', 'rule_id', 'rule_name']
|
2021-06-01 14:26:09 +08:00
|
|
|
|
Object.keys(labels).forEach((key, i) => {
|
2021-11-25 14:18:43 +08:00
|
|
|
|
if (filterArr.indexOf(key) != -1) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2021-06-01 14:26:09 +08:00
|
|
|
|
this.objectSilence.matchers.push(
|
|
|
|
|
|
{ name: key, value: labels[key], regex: 0 }
|
|
|
|
|
|
)
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (type === 'alertRule') {
|
|
|
|
|
|
this.objectSilence.matchers = [
|
2022-09-22 17:07:22 +08:00
|
|
|
|
{ name: 'rule_id', value: row.id, regex: 0 },
|
|
|
|
|
|
{ name: 'rule_name', value: row.name, regex: 0 }
|
2021-06-01 14:26:09 +08:00
|
|
|
|
]
|
|
|
|
|
|
}
|
|
|
|
|
|
this.silenceBoxShow = true
|
|
|
|
|
|
},
|
2022-12-18 19:46:51 +08:00
|
|
|
|
metricTarget (row, type) {
|
|
|
|
|
|
const protocol = row.configs[0].config.protocol
|
|
|
|
|
|
const host = row.configs[0].config.host
|
|
|
|
|
|
const port = row.configs[0].config.port
|
|
|
|
|
|
const metricsPath = row.configs[0].config.metrics_path
|
|
|
|
|
|
const params = row.configs[0].config.params
|
|
|
|
|
|
let str = ''
|
|
|
|
|
|
if (!lodash.isEmpty(params)) {
|
|
|
|
|
|
for (const key in params) {
|
2023-05-25 15:37:18 +08:00
|
|
|
|
const arr = params[key]
|
|
|
|
|
|
if (arr.length > 1) {
|
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
|
str += key + '=' + item + '&'
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
str += key + '=' + params[key][0] + '&'
|
|
|
|
|
|
}
|
2022-12-18 19:46:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-12-19 14:50:42 +08:00
|
|
|
|
const linkTarget = `${protocol}://${host}:${port + metricsPath}${str ? '?' + str.slice(0, str.length - 1) : ''}`
|
|
|
|
|
|
// window.open(linkTarget, 'target')
|
|
|
|
|
|
window.open(linkTarget)
|
2022-12-18 19:46:51 +08:00
|
|
|
|
},
|
2022-03-17 16:42:56 +08:00
|
|
|
|
topology (row, type) {
|
|
|
|
|
|
const chartInfo = lodash.cloneDeep(defaultData)
|
|
|
|
|
|
chartInfo.id = row.id
|
|
|
|
|
|
chartInfo.type = 'topologyLink'
|
|
|
|
|
|
chartInfo.linkType = type
|
|
|
|
|
|
chartInfo.datasource = 'topology'
|
2022-06-08 14:18:09 +08:00
|
|
|
|
chartInfo.name = this.$t('overall.topology')
|
2022-03-17 16:42:56 +08:00
|
|
|
|
this.$store.dispatch('showTopology', chartInfo)
|
|
|
|
|
|
},
|
2021-06-01 14:26:09 +08:00
|
|
|
|
closeDialog () {
|
|
|
|
|
|
this.silenceBoxShow = false
|
2021-09-09 16:00:37 +08:00
|
|
|
|
},
|
|
|
|
|
|
showText (row) {
|
|
|
|
|
|
this.dialogShowText = true
|
|
|
|
|
|
this.dialogText = row.alertRule.trbShot
|
2023-08-30 17:30:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 获取用户偏好
|
|
|
|
|
|
async getPreference () {
|
|
|
|
|
|
this.preferenceLoading = true
|
|
|
|
|
|
const res = await this.$get('/sys/user/preference', { key: this.tableId })
|
|
|
|
|
|
let tableHeaders
|
|
|
|
|
|
if (res.data[this.tableId]) {
|
|
|
|
|
|
const data = JSON.parse(res.data[this.tableId])
|
|
|
|
|
|
this.pageObj.pageSize = data.pageSize
|
|
|
|
|
|
this.detailType = data.view
|
|
|
|
|
|
this.dataListLayout = data.layout
|
|
|
|
|
|
tableHeaders = data.tableHeaders
|
|
|
|
|
|
}
|
|
|
|
|
|
this.preferenceLoading = false
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.setCustomTableTitle(tableHeaders)
|
|
|
|
|
|
})
|
|
|
|
|
|
// 请求完用户偏好 打开底部弹窗
|
|
|
|
|
|
if (this.fromBottom || this.projectPopTable) { return }
|
|
|
|
|
|
const q = this.$route.query
|
|
|
|
|
|
if (q.bottomBox && JSON.parse(q.bottomBox)) {
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
this.detailType = q.detailType
|
|
|
|
|
|
const detailType = this.detailType === 'list' ? 'dataList' : 'detailList'
|
|
|
|
|
|
this.$refs[detailType].bottomBox.showSubList = JSON.parse(q.bottomBox)
|
|
|
|
|
|
this.$refs[detailType].bottomBox.targetTab = q.targetTab
|
|
|
|
|
|
this.$refs[detailType].bottomBox.object = JSON.parse(q.selectObj)
|
|
|
|
|
|
})
|
|
|
|
|
|
} else if (this.detailType === 'view' && q.detailType && q.selectObj) {
|
|
|
|
|
|
this.detailType = q.detailType
|
|
|
|
|
|
this.detailViewRightObj = JSON.parse(q.selectObj)
|
|
|
|
|
|
this.$store.commit('setGlobalSearchId', this.detailViewRightObj.id)
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 设置用户偏好
|
|
|
|
|
|
setPreference () {
|
|
|
|
|
|
const params = {
|
|
|
|
|
|
pageSize: this.pageObj.pageSize,
|
|
|
|
|
|
view: this.detailType || 'list',
|
|
|
|
|
|
tableHeaders: this.tools.customTableTitle
|
|
|
|
|
|
}
|
|
|
|
|
|
if (this.dataListLayout) {
|
|
|
|
|
|
params.layout = this.dataListLayout
|
|
|
|
|
|
}
|
|
|
|
|
|
this.$put('/sys/user/preference', { [this.tableId]: JSON.stringify(params) }).then(res => {
|
|
|
|
|
|
if (res.code !== 200) {
|
|
|
|
|
|
this.$message.error(res.msg || res.error)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
setCustomTableTitle (tableHeaders) {
|
|
|
|
|
|
let tableTitle = ''
|
|
|
|
|
|
if (this.$refs.dataTable) {
|
|
|
|
|
|
tableTitle = this.$refs.dataTable.tableTitle
|
|
|
|
|
|
} else if (this.$refs.dataDetail) {
|
|
|
|
|
|
tableTitle = this.$refs.dataDetail.tableTitle
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!tableTitle || !this.tableId) {
|
|
|
|
|
|
return
|
|
|
|
|
|
}
|
2023-12-04 16:29:20 +08:00
|
|
|
|
let preferenceTableTitle = (tableHeaders && tableHeaders.length) ? tableHeaders : tableTitle
|
|
|
|
|
|
preferenceTableTitle = preferenceTableTitle.filter(item => tableTitle.find(t => item.prop === t.prop || item.type === 'label'))
|
|
|
|
|
|
|
|
|
|
|
|
// 先根据本地缓存中的prop进行排序
|
|
|
|
|
|
tableTitle.sort((a, b) => {
|
|
|
|
|
|
const indexA = preferenceTableTitle.findIndex(item => item.prop === a.prop)
|
|
|
|
|
|
const indexB = preferenceTableTitle.findIndex(item => item.prop === b.prop)
|
|
|
|
|
|
if (indexA === -1) return 1
|
|
|
|
|
|
if (indexB === -1) return -1
|
|
|
|
|
|
return indexA - indexB
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-04-24 16:37:51 +08:00
|
|
|
|
this.tools.customTableTitle = tableTitle.map((item) => {
|
|
|
|
|
|
// 设置表头显示隐藏
|
|
|
|
|
|
const findItem = preferenceTableTitle.find(t => item.prop === t.prop)
|
|
|
|
|
|
item.show = findItem ? findItem.show : item.show
|
|
|
|
|
|
// 设置表头宽度
|
|
|
|
|
|
if (findItem && findItem.width != undefined) {
|
|
|
|
|
|
item.width = findItem.width
|
|
|
|
|
|
}
|
2023-12-04 16:29:20 +08:00
|
|
|
|
return item
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2024-04-24 16:37:51 +08:00
|
|
|
|
// asset label
|
|
|
|
|
|
const arr = preferenceTableTitle.filter(item => item.type === 'label')
|
|
|
|
|
|
arr.forEach(item => {
|
|
|
|
|
|
item.minWidth = item.label.length * 16 + 20
|
|
|
|
|
|
})
|
|
|
|
|
|
this.tools.customTableTitle = this.tools.customTableTitle.concat(arr)
|
2023-08-30 17:30:36 +08:00
|
|
|
|
},
|
|
|
|
|
|
updateCustomTableTitle (custom) {
|
|
|
|
|
|
this.tools.customTableTitle = custom
|
|
|
|
|
|
this.setPreference()
|
2021-04-12 13:00:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
tableData: {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
if (n.length === 0 && this.pageObj.pageNo > 1) {
|
|
|
|
|
|
this.pageNo(this.pageObj.pageNo - 1)
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* if (!this.delFlag) { // 不是删除时回到顶部
|
|
|
|
|
|
this.$refs.dataTable.bodyWrapper.scrollTop = 0
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.delFlag = false
|
|
|
|
|
|
} */
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
'tools.customTableTitle': {
|
|
|
|
|
|
deep: true,
|
|
|
|
|
|
handler (n) {
|
|
|
|
|
|
this.dragend()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
2022-04-06 10:45:32 +08:00
|
|
|
|
|
2021-12-22 14:20:13 +08:00
|
|
|
|
created () {
|
2022-03-24 09:46:14 +08:00
|
|
|
|
let path = ''
|
|
|
|
|
|
if (this.$route.fullPath.match(/\/(\S*)\?/)) {
|
|
|
|
|
|
path = this.$route.fullPath.match(/\/(\S*)\?/)[1]
|
|
|
|
|
|
}
|
2022-03-10 10:20:08 +08:00
|
|
|
|
if (this.$route.query.orderBy && !this.isSubList) {
|
2022-03-04 13:59:25 +08:00
|
|
|
|
this.orderBy = this.$route.query.orderBy
|
2022-06-20 16:39:54 +08:00
|
|
|
|
} else if (this.isSubList) {
|
|
|
|
|
|
return
|
2022-03-04 13:59:25 +08:00
|
|
|
|
}
|
2021-12-22 19:54:51 +08:00
|
|
|
|
let searchKeys = {}
|
|
|
|
|
|
if (path === 'dc') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'ids',
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
location: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'location',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'location',
|
|
|
|
|
|
name: 'Location',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
state: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'state',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'dcState',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'selectString',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
2024-04-19 14:34:41 +08:00
|
|
|
|
},
|
|
|
|
|
|
remark: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'remark',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'remark',
|
|
|
|
|
|
name: this.$t('overall.remark'),
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (path === 'i18n') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'ids',
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
code: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'code',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'code',
|
|
|
|
|
|
name: 'Code',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
value: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'value',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'value',
|
|
|
|
|
|
name: 'Value',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
lang: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'lang',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'lang',
|
|
|
|
|
|
name: 'Lang',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (path === 'model') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'ids',
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
brandIds: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'brandIds',
|
|
|
|
|
|
type: 'number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'brandIds',
|
|
|
|
|
|
name: 'Brand',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'brand',
|
2021-12-24 14:44:04 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'brandSelect'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
2021-12-24 14:44:04 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-23 14:54:00 +08:00
|
|
|
|
} else if (path === 'operationLog') {
|
2021-12-22 19:54:51 +08:00
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 11,
|
|
|
|
|
|
label: 'type',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
username: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'username',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 12,
|
|
|
|
|
|
label: 'username',
|
|
|
|
|
|
name: 'User',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
operation: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'operation',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 13,
|
|
|
|
|
|
label: 'operation',
|
|
|
|
|
|
name: 'Operation',
|
|
|
|
|
|
type: 'selectString',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
state: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'state',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 16,
|
|
|
|
|
|
label: 'state',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'selectString',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
operaId: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'operaId',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 14,
|
|
|
|
|
|
label: 'operaId',
|
|
|
|
|
|
name: 'Resources',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
params: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'params',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 17,
|
|
|
|
|
|
label: 'params',
|
|
|
|
|
|
name: 'Params',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (path === 'agent') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'ids',
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
2024-05-16 09:58:42 +08:00
|
|
|
|
statuses: {
|
2021-12-22 19:54:51 +08:00
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2024-05-16 09:58:42 +08:00
|
|
|
|
propertyName: 'statuses',
|
2021-12-22 19:54:51 +08:00
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'promState',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
2024-05-16 09:58:42 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'promState'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
2024-05-16 09:58:42 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
2023-12-04 16:29:20 +08:00
|
|
|
|
dcIds: {
|
2021-12-22 19:54:51 +08:00
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2023-12-04 16:29:20 +08:00
|
|
|
|
propertyName: 'dcIds',
|
2021-12-22 19:54:51 +08:00
|
|
|
|
type: 'number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
name: 'Date center',
|
|
|
|
|
|
type: 'dc',
|
|
|
|
|
|
label: 'dcIds',
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
2021-12-24 14:44:04 +08:00
|
|
|
|
listStr: 'dcSelect'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
2021-12-24 14:44:04 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'promType',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
2024-05-16 09:58:42 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'promType'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
},
|
2024-05-16 09:58:42 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2024-04-19 14:55:45 +08:00
|
|
|
|
},
|
|
|
|
|
|
host: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'host',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'host',
|
|
|
|
|
|
name: 'IP',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
2021-12-22 19:54:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (path === 'roles') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-22 19:54:51 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-23 20:24:18 +08:00
|
|
|
|
} else if (path === 'template' && this.switchTab) {
|
2021-12-23 19:10:52 +08:00
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 19:10:52 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 19:10:52 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
gname: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 19:10:52 +08:00
|
|
|
|
propertyName: 'gname',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'gname',
|
|
|
|
|
|
name: 'Group',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-01-17 13:59:18 +08:00
|
|
|
|
} else if (path === 'credentials') {
|
2021-12-23 20:24:18 +08:00
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 20:24:18 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 20:24:18 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 20:24:18 +08:00
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'credentialType',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-01-17 13:59:18 +08:00
|
|
|
|
} else if (path === 'mib') {
|
2021-12-23 20:24:18 +08:00
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 20:24:18 +08:00
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
2022-01-05 10:34:22 +08:00
|
|
|
|
isSearchInput: true,
|
2021-12-23 20:24:18 +08:00
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-03-03 10:33:29 +08:00
|
|
|
|
} else if (path === 'ipam') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
2022-08-26 15:56:19 +08:00
|
|
|
|
state: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'state',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ipamState',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
2022-03-03 10:33:29 +08:00
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ipamType',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
addr: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'addr',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'addr',
|
|
|
|
|
|
name: 'Addr',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
mask: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'mask',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'mask',
|
|
|
|
|
|
name: 'Mask',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
vlan: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'vlan',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'vlan',
|
|
|
|
|
|
name: 'Vlan',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
2023-12-04 16:29:20 +08:00
|
|
|
|
dcIds: {
|
2022-03-03 10:33:29 +08:00
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
2023-12-04 16:29:20 +08:00
|
|
|
|
propertyName: 'dcIds',
|
2022-03-03 18:06:45 +08:00
|
|
|
|
type: 'number',
|
2022-03-03 10:33:29 +08:00
|
|
|
|
defaultJson: {
|
2022-03-03 18:06:45 +08:00
|
|
|
|
name: 'Date center',
|
|
|
|
|
|
type: 'dc',
|
|
|
|
|
|
label: 'dcIds',
|
2022-03-03 10:33:29 +08:00
|
|
|
|
disabled: false,
|
2022-03-03 18:06:45 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'dcSelect'
|
2022-03-03 10:33:29 +08:00
|
|
|
|
},
|
2022-03-03 18:06:45 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-03-03 10:33:29 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-08-22 12:16:23 +08:00
|
|
|
|
} else if (path === 'recordRule') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
state: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'state',
|
|
|
|
|
|
type: 'Number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'recordState',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-22 12:16:23 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-22 12:16:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'Number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'recordType',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-22 12:16:23 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-22 12:16:23 +08:00
|
|
|
|
},
|
|
|
|
|
|
expr: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'expr',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'expr',
|
|
|
|
|
|
name: 'Expression',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-08-26 15:56:19 +08:00
|
|
|
|
} else if (path === 'issue') {
|
|
|
|
|
|
searchKeys = {
|
|
|
|
|
|
// key: path 键
|
|
|
|
|
|
// value: vue set 参数
|
|
|
|
|
|
pageNo: { target: this.pageObj, propertyName: 'pageNo', type: 'number' },
|
|
|
|
|
|
pageSize: { target: this.pageObj, propertyName: 'pageSize', type: 'number' },
|
|
|
|
|
|
orderBy: { target: this.$data, propertyName: 'orderBy', type: 'string' },
|
|
|
|
|
|
ids: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'ids',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'ids',
|
|
|
|
|
|
name: 'ID',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
name: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'name',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
id: 'name',
|
|
|
|
|
|
label: 'name',
|
|
|
|
|
|
name: 'Name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
type: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'type',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'issueType',
|
|
|
|
|
|
name: 'Type',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'issueType',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
state: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'state',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
type: 'number',
|
2022-08-26 15:56:19 +08:00
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'issueState',
|
|
|
|
|
|
name: 'State',
|
|
|
|
|
|
readonly: true,
|
|
|
|
|
|
type: 'select',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
priority: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'priority',
|
|
|
|
|
|
type: 'Number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'priority',
|
|
|
|
|
|
name: 'Priority',
|
|
|
|
|
|
type: 'select',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
assetsId: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'assetsId',
|
|
|
|
|
|
type: 'Number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'assetsId',
|
|
|
|
|
|
name: 'Assets id',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
assetName: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'assetName',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'assetName',
|
|
|
|
|
|
name: 'Assets name',
|
|
|
|
|
|
type: 'input',
|
|
|
|
|
|
val: ''
|
|
|
|
|
|
},
|
|
|
|
|
|
jsonKey: 'val'
|
|
|
|
|
|
},
|
|
|
|
|
|
cid: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'cid',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'cid',
|
|
|
|
|
|
name: 'Create user',
|
|
|
|
|
|
type: 'issue',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
uid: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'uid',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'uid',
|
|
|
|
|
|
name: 'Update user',
|
|
|
|
|
|
type: 'issue',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
rid: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'rid',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'rid',
|
|
|
|
|
|
name: 'Reporter',
|
|
|
|
|
|
type: 'issue',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
aid: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'aid',
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'aid',
|
|
|
|
|
|
name: 'Assignee',
|
|
|
|
|
|
type: 'issue',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
starrd: {
|
|
|
|
|
|
target: this.searchLabel,
|
|
|
|
|
|
isSearchInput: true,
|
|
|
|
|
|
propertyName: 'starrd',
|
|
|
|
|
|
type: 'Number',
|
|
|
|
|
|
defaultJson: {
|
|
|
|
|
|
disabled: false,
|
|
|
|
|
|
label: 'starrd',
|
|
|
|
|
|
name: 'Starrd',
|
|
|
|
|
|
type: 'select',
|
2022-09-05 10:07:34 +08:00
|
|
|
|
val: '',
|
|
|
|
|
|
valnum: '',
|
|
|
|
|
|
listStr: 'issue'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
},
|
2022-09-05 10:07:34 +08:00
|
|
|
|
jsonKey: 'valnum'
|
2022-08-26 15:56:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-12-22 14:20:13 +08:00
|
|
|
|
}
|
|
|
|
|
|
this.initQueryFromPath(searchKeys)
|
|
|
|
|
|
},
|
2023-08-30 17:30:36 +08:00
|
|
|
|
async mounted () {
|
|
|
|
|
|
// 先设置默认的表头
|
2022-10-28 14:07:06 +08:00
|
|
|
|
let tableTitle = ''
|
|
|
|
|
|
if (this.$refs.dataTable) {
|
|
|
|
|
|
tableTitle = this.$refs.dataTable.tableTitle
|
|
|
|
|
|
} else if (this.$refs.dataDetail) {
|
|
|
|
|
|
tableTitle = this.$refs.dataDetail.tableTitle
|
2022-03-10 16:55:49 +08:00
|
|
|
|
}
|
2023-08-30 17:30:36 +08:00
|
|
|
|
if (tableTitle && this.tableId) {
|
|
|
|
|
|
this.tools.customTableTitle = tableTitle
|
2021-05-13 11:40:22 +08:00
|
|
|
|
}
|
2023-08-30 17:30:36 +08:00
|
|
|
|
if (!this.fromBottom && !this.projectPopTable) {
|
|
|
|
|
|
await this.getPreference()
|
2021-10-13 11:12:26 +08:00
|
|
|
|
this.getTableData()
|
2021-04-20 14:38:24 +08:00
|
|
|
|
}
|
2021-04-12 13:00:59 +08:00
|
|
|
|
},
|
|
|
|
|
|
beforeDestroy () {
|
|
|
|
|
|
if (this.scrollbarWrap) {
|
|
|
|
|
|
this.scrollbarWrap.removeEventListener('scroll', bus.debounce)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|