NEZ-2895 fix: Tooltip.title & Tooltip.Legends.Alias 支持 变量取值

This commit is contained in:
zhangyu
2023-06-20 16:59:46 +08:00
parent d5bf4733d8
commit 2150fa71d1
57 changed files with 256 additions and 234 deletions

View File

@@ -445,9 +445,9 @@ export default {
} }
}, },
statMouseEnter (that, e) { statMouseEnter (that, e) {
this.tooltip.title = this.$loadsh.cloneDeep(that.legend) this.tooltip.title = this.$lodash.cloneDeep(that.legend)
this.tooltip.value = this.$loadsh.cloneDeep(that.showValue) this.tooltip.value = this.$lodash.cloneDeep(that.showValue)
this.tooltip.mapping = this.$loadsh.cloneDeep(that.mapping) this.tooltip.mapping = this.$lodash.cloneDeep(that.mapping)
this.tooltip.show = true this.tooltip.show = true
this.$nextTick(() => { this.$nextTick(() => {
const windowWidth = window.innerWidth// 窗口宽度 const windowWidth = window.innerWidth// 窗口宽度

View File

@@ -226,7 +226,7 @@ export default {
datas = [...datas, ...data.values] datas = [...datas, ...data.values]
}) })
}) })
const timeSorted = this.$loadsh.sortBy(datas, function (o) { return o[0] }) const timeSorted = this.$lodash.sortBy(datas, function (o) { return o[0] })
const valueSorted = datas.sort((a, b) => { const valueSorted = datas.sort((a, b) => {
const a1 = isNaN(a[1]) || !a[1] ? 0 : Number(a[1]) const a1 = isNaN(a[1]) || !a[1] ? 0 : Number(a[1])
const b1 = isNaN(b[1]) || !b[1] ? 0 : Number(b[1]) const b1 = isNaN(b[1]) || !b[1] ? 0 : Number(b[1])

View File

@@ -39,8 +39,8 @@ export default {
const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) { const labelValue = display.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2) const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
let value = null let value = null
if (self.$loadsh.get(myParams, label)) { if (self.$lodash.get(myParams, label)) {
value = self.$loadsh.get(myParams, label) value = self.$lodash.get(myParams, label)
} }
// return value || label // return value || label
return value || '' return value || ''

View File

@@ -62,7 +62,7 @@ export default {
this.dropdownMenuShow = false this.dropdownMenuShow = false
}, },
duplicate () { duplicate () {
const obj = this.$loadsh.cloneDeep(this.chartInfo) const obj = this.$lodash.cloneDeep(this.chartInfo)
obj.elements = obj.oldElements obj.elements = obj.oldElements
delete obj.oldElements delete obj.oldElements
this.$store.dispatch('dispatchEditChart', { this.$store.dispatch('dispatchEditChart', {
@@ -109,7 +109,7 @@ export default {
confirmReg.push(item) confirmReg.push(item)
} }
}) })
confirmReg = this.$loadsh.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 confirmReg = this.$lodash.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题
return item.name.length return item.name.length
}, 'desc') }, 'desc')
if (confirmReg.length) { if (confirmReg.length) {

View File

@@ -512,11 +512,11 @@ export default {
} }
this.showHidden = {} this.showHidden = {}
this.dataList.forEach(item => { this.dataList.forEach(item => {
const visibility = this.$loadsh.get(item, 'param.enable.visibility', false) const visibility = this.$lodash.get(item, 'param.enable.visibility', false)
const varName = this.$loadsh.get(item, 'param.visibility.varName') const varName = this.$lodash.get(item, 'param.visibility.varName')
const operator = this.$loadsh.get(item, 'param.visibility.operator') const operator = this.$lodash.get(item, 'param.visibility.operator')
const varValue = this.$loadsh.get(item, 'param.visibility.varValue') const varValue = this.$lodash.get(item, 'param.visibility.varValue')
const result = this.$loadsh.get(item, 'param.visibility.result') const result = this.$lodash.get(item, 'param.visibility.result')
// 相反结果 若result为show则contraryResult为hidden // 相反结果 若result为show则contraryResult为hidden
const contraryResult = result === 'show' ? 'hidden' : 'show' const contraryResult = result === 'show' ? 'hidden' : 'show'
// 是否启用显示隐藏功能 // 是否启用显示隐藏功能
@@ -557,15 +557,15 @@ export default {
} }
} }
if (flag === true) { if (flag === true) {
this.$loadsh.set(this.showHidden, item.id + '.visibility', result) this.$lodash.set(this.showHidden, item.id + '.visibility', result)
} else { } else {
this.$loadsh.set(this.showHidden, item.id + '.visibility', contraryResult) this.$lodash.set(this.showHidden, item.id + '.visibility', contraryResult)
} }
// 隐藏图表的悬浮文字赋值 // 隐藏图表的悬浮文字赋值
if (this.$loadsh.get(this.showHidden[item.id], 'visibility') === 'hidden') { if (this.$lodash.get(this.showHidden[item.id], 'visibility') === 'hidden') {
const hiddenText = `${varName}=${varValue}”Hidden` const hiddenText = `${varName}=${varValue}”Hidden`
this.$loadsh.set(this.showHidden, item.id + '.hiddenText', hiddenText) this.$lodash.set(this.showHidden, item.id + '.hiddenText', hiddenText)
} }
} }
}) })
@@ -576,13 +576,13 @@ export default {
} }
for (let i = 0; i < this.copyDataList.length; i++) { for (let i = 0; i < this.copyDataList.length; i++) {
const item = this.copyDataList[i] const item = this.copyDataList[i]
if ((this.$loadsh.get(this.showHidden[item.id], 'visibility') && this.$loadsh.get(this.showHidden[item.id], 'visibility') === 'hidden') && item.id !== -2) { if ((this.$lodash.get(this.showHidden[item.id], 'visibility') && this.$lodash.get(this.showHidden[item.id], 'visibility') === 'hidden') && item.id !== -2) {
this.copyDataList.splice(i, 1) this.copyDataList.splice(i, 1)
i-- i--
} }
} }
this.tempList.forEach(item => { this.tempList.forEach(item => {
if ((!this.$loadsh.get(this.showHidden[item.id], 'visibility') || this.$loadsh.get(this.showHidden[item.id], 'visibility') === 'show') && item.id !== -2 && !this.copyDataList.find(chart => chart.id === item.id)) { if ((!this.$lodash.get(this.showHidden[item.id], 'visibility') || this.$lodash.get(this.showHidden[item.id], 'visibility') === 'show') && item.id !== -2 && !this.copyDataList.find(chart => chart.id === item.id)) {
this.copyDataList.push(item) this.copyDataList.push(item)
} }
}) })
@@ -615,21 +615,21 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
// 先让数组根据 y 排序 之后直接判断顺序 即可判断 Group 是否相邻 // 先让数组根据 y 排序 之后直接判断顺序 即可判断 Group 是否相邻
let arr = this.$loadsh.cloneDeep(this.copyDataList) let arr = this.$lodash.cloneDeep(this.copyDataList)
arr = this.$loadsh.orderBy(arr, function (item) { arr = this.$lodash.orderBy(arr, function (item) {
return item.y return item.y
}) })
const variablesRepeat = {} const variablesRepeat = {}
for (let index = 0; index < arr.length; index++) { // 遍历找出所有需要 repeat的group 按照 name进行多次的分组 for (let index = 0; index < arr.length; index++) { // 遍历找出所有需要 repeat的group 按照 name进行多次的分组
const item = arr[index] const item = arr[index]
const repeatVariable = this.$loadsh.get(item.param.repeat, 'variable') const repeatVariable = this.$lodash.get(item.param.repeat, 'variable')
const repeatEnable = this.$loadsh.get(item.param.enable, 'repeat') const repeatEnable = this.$lodash.get(item.param.enable, 'repeat')
const visibility = this.$loadsh.get(this.showHidden[item.id], 'visibility') !== 'hidden' const visibility = this.$lodash.get(this.showHidden[item.id], 'visibility') !== 'hidden'
if (item.type === 'group' && repeatVariable && repeatEnable && visibility) { if (item.type === 'group' && repeatVariable && repeatEnable && visibility) {
const itemPrev = arr[index - 1] const itemPrev = arr[index - 1]
const repeatPrevVariable = this.$loadsh.get(itemPrev.param.repeat, 'variable') const repeatPrevVariable = this.$lodash.get(itemPrev.param.repeat, 'variable')
const repeatPrevEnable = this.$loadsh.get(itemPrev.param.enable, 'repeat') const repeatPrevEnable = this.$lodash.get(itemPrev.param.enable, 'repeat')
const itemVisibility = this.$loadsh.get(this.showHidden[itemPrev.id], 'visibility') !== 'hidden' const itemVisibility = this.$lodash.get(this.showHidden[itemPrev.id], 'visibility') !== 'hidden'
if (itemPrev && itemPrev.type === 'group' && repeatPrevVariable === repeatVariable && repeatPrevEnable && itemVisibility) { if (itemPrev && itemPrev.type === 'group' && repeatPrevVariable === repeatVariable && repeatPrevEnable && itemVisibility) {
const arr = variablesRepeat[repeatVariable] const arr = variablesRepeat[repeatVariable]
arr[arr.length - 1].repeatArr.push(item) arr[arr.length - 1].repeatArr.push(item)
@@ -656,7 +656,7 @@ export default {
group.repeatArr.forEach(item => { group.repeatArr.forEach(item => {
if (subIndex > 0) { if (subIndex > 0) {
// 复制数据 重新设置id // 复制数据 重新设置id
const repeatItem = this.$loadsh.cloneDeep(item) const repeatItem = this.$lodash.cloneDeep(item)
repeatItem.id = item.id + '-' + 'repeat-' + subIndex repeatItem.id = item.id + '-' + 'repeat-' + subIndex
repeatItem.i = repeatItem.id repeatItem.i = repeatItem.id
repeatItem.repeatIndex = subIndex repeatItem.repeatIndex = subIndex

View File

@@ -246,8 +246,8 @@ export default {
return label return label
} }
let value = null let value = null
if (params && self.$loadsh.get(myParams, label)) { if (params && self.$lodash.get(myParams, label)) {
value = self.$loadsh.get(myParams, label) value = self.$lodash.get(myParams, label)
} }
if (label) { if (label) {
const reg = new RegExp(label + '=".+?"', 'g') const reg = new RegExp(label + '=".+?"', 'g')

View File

@@ -204,7 +204,7 @@ export default {
this.chartInfo.oldElements = this.chartInfo.elements ? JSON.parse(JSON.stringify(this.chartInfo.elements)) : [] this.chartInfo.oldElements = this.chartInfo.elements ? JSON.parse(JSON.stringify(this.chartInfo.elements)) : []
} }
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartInfo.elements = this.$loadsh.cloneDeep(this.chartInfo.oldElements.filter(item => item.state)) // 处理不显示的表达式 this.chartInfo.elements = this.$lodash.cloneDeep(this.chartInfo.oldElements.filter(item => item.state)) // 处理不显示的表达式
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
this.chartInfo.elements = this.chartInfo.elements.map((item, index) => { // 处理表达式的变量 this.chartInfo.elements = this.chartInfo.elements.map((item, index) => { // 处理表达式的变量
// group图表设置repeat的表达式替换 // group图表设置repeat的表达式替换
@@ -403,9 +403,9 @@ export default {
if (this.from === fromRoute.chartTemp || this.from === fromRoute.dashboardTemp) { if (this.from === fromRoute.chartTemp || this.from === fromRoute.dashboardTemp) {
let tempData let tempData
if (this.chartInfo.type === 'assetInfo') { if (this.chartInfo.type === 'assetInfo') {
tempData = this.$loadsh.cloneDeep(assetInfoData.data) tempData = this.$lodash.cloneDeep(assetInfoData.data)
} else if (this.chartInfo.type === 'endpointInfo') { } else if (this.chartInfo.type === 'endpointInfo') {
tempData = this.$loadsh.cloneDeep(endpointInfoData.data) tempData = this.$lodash.cloneDeep(endpointInfoData.data)
} else { } else {
tempData = [chartTempData.data.result] tempData = [chartTempData.data.result]
} }
@@ -659,7 +659,7 @@ export default {
confirmReg.push(item) confirmReg.push(item)
} }
}) })
confirmReg = this.$loadsh.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 confirmReg = this.$lodash.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题
return item.name.length return item.name.length
}, 'desc') }, 'desc')
if (confirmReg.length) { if (confirmReg.length) {
@@ -873,7 +873,7 @@ export default {
}, },
variablesArr: { variablesArr: {
handler (n) { handler (n) {
const elements = this.$loadsh.cloneDeep(this.chartInfo.oldElements) || [] const elements = this.$lodash.cloneDeep(this.chartInfo.oldElements) || []
const variables = elements.map((element) => { const variables = elements.map((element) => {
return this.variablesReplace(element.expression) return this.variablesReplace(element.expression)
}) })

View File

@@ -173,18 +173,18 @@ export default {
height: this.terminal.height, height: this.terminal.height,
cols: this.terminal.cols, cols: this.terminal.cols,
rows: this.terminal.rows, rows: this.terminal.rows,
host: this.$loadsh.get(this.terminal, 'custom.host', ''), host: this.$lodash.get(this.terminal, 'custom.host', ''),
port: this.$loadsh.get(this.terminal, 'custom.port', ''), port: this.$lodash.get(this.terminal, 'custom.port', ''),
assetId: this.$loadsh.get(this.terminal, 'assetId', ''), assetId: this.$lodash.get(this.terminal, 'assetId', ''),
accountId: this.$loadsh.get(this.terminal, 'accountId', ''), accountId: this.$lodash.get(this.terminal, 'accountId', ''),
authProtocol: this.$loadsh.get(this.terminal, 'custom.authProtocol', ''), authProtocol: this.$lodash.get(this.terminal, 'custom.authProtocol', ''),
authProtocolPort: this.$loadsh.get(this.terminal, 'custom.authProtocolPort', ''), authProtocolPort: this.$lodash.get(this.terminal, 'custom.authProtocolPort', ''),
authType: this.$loadsh.get(this.terminal, 'custom.authType', ''), authType: this.$lodash.get(this.terminal, 'custom.authType', ''),
authUsername: this.$loadsh.get(this.terminal, 'custom.authUsername', ''), authUsername: this.$lodash.get(this.terminal, 'custom.authUsername', ''),
authPin: this.$loadsh.get(this.terminal, 'custom.authPin', ''), authPin: this.$lodash.get(this.terminal, 'custom.authPin', ''),
authPriKey: this.$loadsh.get(this.terminal, 'custom.authPriKey', ''), authPriKey: this.$lodash.get(this.terminal, 'custom.authPriKey', ''),
authUserTip: this.$loadsh.get(this.terminal, 'custom.authUserTip', ''), authUserTip: this.$lodash.get(this.terminal, 'custom.authUserTip', ''),
authPinTip: this.$loadsh.get(this.terminal, 'custom.authPinTip', '') authPinTip: this.$lodash.get(this.terminal, 'custom.authPinTip', '')
} }
this.$post('/terminal/login', params).then(res => { this.$post('/terminal/login', params).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@@ -611,8 +611,8 @@ export default {
this[key] = orderType this[key] = orderType
let isDirArr = this.oldFileList.filter(item => item.isDir) let isDirArr = this.oldFileList.filter(item => item.isDir)
let isRegArr = this.oldFileList.filter(item => !item.isDir) let isRegArr = this.oldFileList.filter(item => !item.isDir)
isDirArr = this.$loadsh.orderBy(isDirArr, [user => user.name.toLowerCase()], [orderType]) isDirArr = this.$lodash.orderBy(isDirArr, [user => user.name.toLowerCase()], [orderType])
isRegArr = this.$loadsh.orderBy(isRegArr, [user => user.name.toLowerCase()], [orderType]) isRegArr = this.$lodash.orderBy(isRegArr, [user => user.name.toLowerCase()], [orderType])
this.fileList = [] this.fileList = []
if (orderType === 'asc') { if (orderType === 'asc') {
this.fileList = this.fileList.concat(isDirArr, isRegArr) this.fileList = this.fileList.concat(isDirArr, isRegArr)
@@ -623,8 +623,8 @@ export default {
this[key] = orderType this[key] = orderType
let isDirArr = this.oldFileList.filter(item => item.isDir) let isDirArr = this.oldFileList.filter(item => item.isDir)
let isRegArr = this.oldFileList.filter(item => !item.isDir) let isRegArr = this.oldFileList.filter(item => !item.isDir)
isDirArr = this.$loadsh.orderBy(isDirArr, order, orderType) isDirArr = this.$lodash.orderBy(isDirArr, order, orderType)
isRegArr = this.$loadsh.orderBy(isRegArr, order, orderType) isRegArr = this.$lodash.orderBy(isRegArr, order, orderType)
this.fileList = [] this.fileList = []
if (orderType === 'asc') { if (orderType === 'asc') {
this.fileList = this.fileList.concat(isDirArr, isRegArr) this.fileList = this.fileList.concat(isDirArr, isRegArr)

View File

@@ -643,18 +643,18 @@ export default {
height: terminal.height, height: terminal.height,
cols: terminal.cols, cols: terminal.cols,
rows: terminal.rows, rows: terminal.rows,
host: this.$loadsh.get(terminal, 'custom.host', ''), host: this.$lodash.get(terminal, 'custom.host', ''),
port: this.$loadsh.get(terminal, 'custom.port', ''), port: this.$lodash.get(terminal, 'custom.port', ''),
assetId: this.$loadsh.get(terminal, 'assetId', ''), assetId: this.$lodash.get(terminal, 'assetId', ''),
accountId: this.$loadsh.get(terminal, 'accountId', ''), accountId: this.$lodash.get(terminal, 'accountId', ''),
authProtocol: this.$loadsh.get(terminal, 'custom.authProtocol', ''), authProtocol: this.$lodash.get(terminal, 'custom.authProtocol', ''),
authProtocolPort: this.$loadsh.get(terminal, 'custom.authProtocolPort', ''), authProtocolPort: this.$lodash.get(terminal, 'custom.authProtocolPort', ''),
authType: this.$loadsh.get(terminal, 'custom.authType', ''), authType: this.$lodash.get(terminal, 'custom.authType', ''),
authUsername: this.$loadsh.get(terminal, 'custom.authUsername', ''), authUsername: this.$lodash.get(terminal, 'custom.authUsername', ''),
authPin: this.$loadsh.get(terminal, 'custom.authPin', ''), authPin: this.$lodash.get(terminal, 'custom.authPin', ''),
authPriKey: this.$loadsh.get(terminal, 'custom.authPriKey', ''), authPriKey: this.$lodash.get(terminal, 'custom.authPriKey', ''),
authUserTip: this.$loadsh.get(terminal, 'custom.authUserTip', ''), authUserTip: this.$lodash.get(terminal, 'custom.authUserTip', ''),
authPinTip: this.$loadsh.get(terminal, 'custom.authPinTip', ''), authPinTip: this.$lodash.get(terminal, 'custom.authPinTip', ''),
parentWindow: !!father parentWindow: !!father
} }
this.$post('/terminal/login', params).then(res => { this.$post('/terminal/login', params).then(res => {
@@ -744,18 +744,18 @@ export default {
height: terminal.height, height: terminal.height,
cols: terminal.cols, cols: terminal.cols,
rows: terminal.rows, rows: terminal.rows,
host: this.$loadsh.get(terminal, 'custom.host', ''), host: this.$lodash.get(terminal, 'custom.host', ''),
port: this.$loadsh.get(terminal, 'custom.port', ''), port: this.$lodash.get(terminal, 'custom.port', ''),
assetId: this.$loadsh.get(terminal, 'assetId', ''), assetId: this.$lodash.get(terminal, 'assetId', ''),
accountId: this.$loadsh.get(terminal, 'accountId', ''), accountId: this.$lodash.get(terminal, 'accountId', ''),
authProtocol: this.$loadsh.get(terminal, 'custom.authProtocol', ''), authProtocol: this.$lodash.get(terminal, 'custom.authProtocol', ''),
authProtocolPort: this.$loadsh.get(terminal, 'custom.authProtocolPort', ''), authProtocolPort: this.$lodash.get(terminal, 'custom.authProtocolPort', ''),
authType: this.$loadsh.get(terminal, 'custom.authType', ''), authType: this.$lodash.get(terminal, 'custom.authType', ''),
authUsername: this.$loadsh.get(terminal, 'custom.authUsername', ''), authUsername: this.$lodash.get(terminal, 'custom.authUsername', ''),
authPin: this.$loadsh.get(terminal, 'custom.authPin', ''), authPin: this.$lodash.get(terminal, 'custom.authPin', ''),
authPriKey: this.$loadsh.get(terminal, 'custom.authPriKey', ''), authPriKey: this.$lodash.get(terminal, 'custom.authPriKey', ''),
authUserTip: this.$loadsh.get(terminal, 'custom.authUserTip', ''), authUserTip: this.$lodash.get(terminal, 'custom.authUserTip', ''),
authPinTip: this.$loadsh.get(terminal, 'custom.authPinTip', '') authPinTip: this.$lodash.get(terminal, 'custom.authPinTip', '')
} }
this.$post('/terminal/login', params).then(res => { this.$post('/terminal/login', params).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@@ -801,7 +801,7 @@ export default {
if (!document.getElementById('topology-canvas' + this.topologyIndexF)) { if (!document.getElementById('topology-canvas' + this.topologyIndexF)) {
return return
} }
data = this.$loadsh.cloneDeep(data) data = this.$lodash.cloneDeep(data)
const canvasOptions = { const canvasOptions = {
rotateCursor: '/static/roteCursor.cur', rotateCursor: '/static/roteCursor.cur',
disableEmptyLine: true, disableEmptyLine: true,
@@ -945,7 +945,7 @@ export default {
data.background = '#FFFFFF00' data.background = '#FFFFFF00'
} }
if (!res.data.topo.newData) { if (!res.data.topo.newData) {
data.pens = this.$loadsh.orderBy(data.pens, 'type', 'desc') // 先处理线 再处理点 因为新版本 将连线开始结束放在的 点上控制 data.pens = this.$lodash.orderBy(data.pens, 'type', 'desc') // 先处理线 再处理点 因为新版本 将连线开始结束放在的 点上控制
data.pens = data.pens.map(item => { data.pens = data.pens.map(item => {
if (item.type === 0) { if (item.type === 0) {
item = disposeTopoOldData(item, data.pens) item = disposeTopoOldData(item, data.pens)
@@ -977,7 +977,7 @@ export default {
} }
return item return item
}) })
data.pens = this.$loadsh.orderBy(data.pens, 'type', 'asc') data.pens = this.$lodash.orderBy(data.pens, 'type', 'asc')
} }
resolve(data) resolve(data)
}, 100) }, 100)
@@ -1221,7 +1221,7 @@ export default {
}, },
onUpdateProps (node) { onUpdateProps (node) {
const obj = this.$loadsh.cloneDeep(node) const obj = this.$lodash.cloneDeep(node)
delete obj.x delete obj.x
delete obj.y delete obj.y
delete obj.center delete obj.center

View File

@@ -125,7 +125,7 @@ export default {
findData (key) { findData (key) {
if (key) { if (key) {
const obj = { const obj = {
...this.$loadsh.cloneDeep(this.infoData[key]), ...this.$lodash.cloneDeep(this.infoData[key]),
type: key type: key
} }
if (key === 'dc') { if (key === 'dc') {
@@ -139,7 +139,7 @@ export default {
findData2 (key) { findData2 (key) {
if (key) { if (key) {
const obj = { const obj = {
...this.$loadsh.cloneDeep(this.infoData[key]), ...this.$lodash.cloneDeep(this.infoData[key]),
type: key, type: key,
position: { position: {
top: 0, top: 0,

View File

@@ -616,8 +616,8 @@ export default {
this.panelData = response.data.list this.panelData = response.data.list
if (this.panelData.length > 0) { if (this.panelData.length > 0) {
this.filter.dashboardId = this.panelData[0].id this.filter.dashboardId = this.panelData[0].id
this.showPanel = this.$loadsh.cloneDeep(this.panelData[0]) this.showPanel = this.$lodash.cloneDeep(this.panelData[0])
this.variables = this.$loadsh.cloneDeep(this.$loadsh.get(this, 'showPanel.param.variables', []) || []) this.variables = this.$lodash.cloneDeep(this.$lodash.get(this, 'showPanel.param.variables', []) || [])
this.getData(this.filter) this.getData(this.filter)
} }
} }
@@ -634,8 +634,8 @@ export default {
this.panelData = response.data.list this.panelData = response.data.list
if (this.panelData.length > 0) { if (this.panelData.length > 0) {
this.filter.dashboardId = this.panelData[0].id this.filter.dashboardId = this.panelData[0].id
this.showPanel = this.$loadsh.cloneDeep(this.panelData[0]) this.showPanel = this.$lodash.cloneDeep(this.panelData[0])
this.variables = this.$loadsh.cloneDeep(this.$loadsh.get(this, 'showPanel.param.variables', []) || []) this.variables = this.$lodash.cloneDeep(this.$lodash.get(this, 'showPanel.param.variables', []) || [])
this.getData(this.filter) this.getData(this.filter)
} else { } else {
this.chartListLoading = false this.chartListLoading = false
@@ -838,12 +838,12 @@ export default {
// 时间选择器设置默认时间范围 // 时间选择器设置默认时间范围
setDefaultTimeRange () { setDefaultTimeRange () {
this.$nextTick(() => { this.$nextTick(() => {
let nowTimeType = this.$loadsh.cloneDeep(this.timeData[3]) let nowTimeType = this.$lodash.cloneDeep(this.timeData[3])
const defaultTimeRange = this.$loadsh.get(this.showPanel, 'param.defaultTimeRange') const defaultTimeRange = this.$lodash.get(this.showPanel, 'param.defaultTimeRange')
if (defaultTimeRange) { if (defaultTimeRange) {
nowTimeType = this.timeData.find(item => item.id == defaultTimeRange) nowTimeType = this.timeData.find(item => item.id == defaultTimeRange)
} }
this.nowTimeType = this.$loadsh.cloneDeep(nowTimeType) this.nowTimeType = this.$lodash.cloneDeep(nowTimeType)
// 刷新时间范围 // 刷新时间范围
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType) this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType)
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType) this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
@@ -856,8 +856,8 @@ export default {
// 设置默认刷新 // 设置默认刷新
setDefaultRefresh () { setDefaultRefresh () {
this.$nextTick(() => { this.$nextTick(() => {
let refresh = this.$loadsh.cloneDeep(this.intervalList[0]) let refresh = this.$lodash.cloneDeep(this.intervalList[0])
const defaultRefresh = this.$loadsh.get(this.showPanel, 'param.refresh') const defaultRefresh = this.$lodash.get(this.showPanel, 'param.refresh')
if (defaultRefresh) { if (defaultRefresh) {
refresh = this.intervalList.find(item => item.value == defaultRefresh) refresh = this.intervalList.find(item => item.value == defaultRefresh)
} }

View File

@@ -104,7 +104,7 @@ export default {
n.map(item => { n.map(item => {
if (!item.position) { if (!item.position) {
const obj = { const obj = {
...this.$loadsh.cloneDeep(item), ...this.$lodash.cloneDeep(item),
type: 'user', type: 'user',
position: { position: {
top: 0, top: 0,

View File

@@ -152,7 +152,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.inputDateQuery = this.handlerTableData(this.tableData) this.inputDateQuery = this.handlerTableData(this.tableData)
this.pageObj.total = this.tableData.length this.pageObj.total = this.tableData.length
if (!this.scrollbarWrap) { if (!this.scrollbarWrap) {

View File

@@ -146,7 +146,7 @@ export default {
this.process = false this.process = false
this.finish = false this.finish = false
this.forceDelete = 0 this.forceDelete = 0
this.deleteData = this.$loadsh.cloneDeep(this.deleteObjs).map(item => { this.deleteData = this.$lodash.cloneDeep(this.deleteObjs).map(item => {
item.type = this.from item.type = this.from
return item return item
}) })
@@ -166,7 +166,7 @@ export default {
this.process = false this.process = false
this.finish = false this.finish = false
this.forceDelete = 0 this.forceDelete = 0
this.deleteData = this.$loadsh.cloneDeep(this.deleteObjs).map(item => { this.deleteData = this.$lodash.cloneDeep(this.deleteObjs).map(item => {
item.type = this.from item.type = this.from
return item return item
}) })

View File

@@ -149,7 +149,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {
@@ -234,7 +234,7 @@ export default {
}) })
}, },
copy (u, copyParams) { copy (u, copyParams) {
const copyName = this.$loadsh.get(copyParams, 'copyName', '-copy') const copyName = this.$lodash.get(copyParams, 'copyName', '-copy')
this.object = { ...u, name: u.name + copyName, id: '' } this.object = { ...u, name: u.name + copyName, id: '' }
if (this.object.name.length > 64) { if (this.object.name.length > 64) {
const length = this.object.name.length - 64 const length = this.object.name.length - 64
@@ -316,7 +316,7 @@ export default {
{ name: type + '_id', value: row.id, regex: 0 } { name: type + '_id', value: row.id, regex: 0 }
] ]
} else if (type === 'alertMessage') { } else if (type === 'alertMessage') {
let labels = this.$loadsh.cloneDeep(row.labels) let labels = this.$lodash.cloneDeep(row.labels)
if (typeof labels === 'string') labels = JSON.parse(labels) if (typeof labels === 'string') labels = JSON.parse(labels)
this.objectSilence.matchers = [] this.objectSilence.matchers = []
const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id', 'rule_id', 'rule_name'] const filterArr = ['alertname', 'severity_id', 'severity', 'rule_type', 'nz_agent_id', 'rule_id', 'rule_name']

View File

@@ -111,7 +111,7 @@ export default {
}, 100) }, 100)
}, },
detailViewRightShow (item) { detailViewRightShow (item) {
this.detailViewRightObj = this.$loadsh.cloneDeep(item) this.detailViewRightObj = this.$lodash.cloneDeep(item)
}, },
orderDetail (order, orderType) { orderDetail (order, orderType) {
if (orderType === 'ascending') { if (orderType === 'ascending') {

View File

@@ -111,6 +111,47 @@ export default {
node.addEventListener('animationend', handleAnimationEnd, { once: true }) node.addEventListener('animationend', handleAnimationEnd, { once: true })
}) })
},
handleLegendAlias (legend, aliasExpression, params) {
const self = this
const myParams = JSON.parse(JSON.stringify(params))
myParams.$labels = JSON.parse(JSON.stringify(params))
myParams.$value = myParams.value
if (/\{\{.+\}\}/.test(aliasExpression)) {
const labelValue = aliasExpression.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
if (!legend) {
return label
}
let value = null
if (params && self.$lodash.get(myParams, label)) {
value = self.$lodash.get(myParams, label)
}
if (label) {
const reg = new RegExp(label + '=".+?"', 'g')
if (reg.test(legend)) {
const ans = legend.match(reg)
let find = ''
ans.forEach(item => {
const index = legend.indexOf(item)
if (legend[index - 1] !== '_') {
find = item
}
})
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
}
}
return value || ''
})
return labelValue
} else {
if (!aliasExpression) {
return legend
// let result =legend.substr(legend.indexOf('"') + 1,legend.lastIndexOf('"') - legend.indexOf('"') - 1);
// return result
}
return aliasExpression
}
} }
} }
} }

View File

@@ -171,8 +171,8 @@ export default {
} }
} }
}) })
arr = this.$loadsh.uniqBy(arr, 'value') arr = this.$lodash.uniqBy(arr, 'value')
// arr = this.$loadsh.uniqBy(arr, 'label') // arr = this.$lodash.uniqBy(arr, 'label')
arr.filter(item => item.value) arr.filter(item => item.value)
response = arr response = arr
} }
@@ -201,7 +201,7 @@ export default {
label: item label: item
} }
}) })
arr = this.$loadsh.uniqBy(arr, 'value') arr = this.$lodash.uniqBy(arr, 'value')
arr.filter(item => item.value) arr.filter(item => item.value)
resolve(arr) resolve(arr)
}) })
@@ -230,7 +230,7 @@ export default {
label: item label: item
} }
}) })
arr = this.$loadsh.uniqBy(arr, 'value') arr = this.$lodash.uniqBy(arr, 'value')
arr = arr.filter(item => item.value) arr = arr.filter(item => item.value)
resolve(arr) resolve(arr)
}) })
@@ -254,7 +254,7 @@ export default {
label: item[label] label: item[label]
} }
}) })
arr = this.$loadsh.uniqBy(arr, 'value') arr = this.$lodash.uniqBy(arr, 'value')
arr.filter(item => item.value) arr.filter(item => item.value)
resolve(arr) resolve(arr)
}) })

View File

@@ -91,7 +91,7 @@ export default {
this.$emit('stopPlaylist') this.$emit('stopPlaylist')
}, },
changePlay () { changePlay () {
let data = this.$loadsh.cloneDeep(this.playlistDashboard[this.currentIndex]) let data = this.$lodash.cloneDeep(this.playlistDashboard[this.currentIndex])
if (!data) { if (!data) {
data = { data = {
id: this.playlistObj.dashboardIds[this.currentIndex], id: this.playlistObj.dashboardIds[this.currentIndex],

View File

@@ -259,7 +259,7 @@ export default {
}) })
}, },
startPlay (val) { startPlay (val) {
const data = this.$loadsh.cloneDeep(val) const data = this.$lodash.cloneDeep(val)
data.dashboardIds = JSON.parse(data.dashboardIds) data.dashboardIds = JSON.parse(data.dashboardIds)
if (data.dashboardIds.length) { if (data.dashboardIds.length) {
this.esc() this.esc()

View File

@@ -735,7 +735,7 @@ export default {
this.$get('visual/dashboard/' + this.params.dashboardId).then(res => { this.$get('visual/dashboard/' + this.params.dashboardId).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.panel = res.data this.panel = res.data
if (!this.$loadsh.get(this.panel, 'param.report', '')) { if (!this.$lodash.get(this.panel, 'param.report', '')) {
this.panel = { this.panel = {
...this.panel, ...this.panel,
param: { param: {
@@ -760,13 +760,13 @@ export default {
} }
} }
this.panel.param.report.schedule.type = this.panel.param.report.schedule.type + '' this.panel.param.report.schedule.type = this.panel.param.report.schedule.type + ''
const startTime = this.$loadsh.get(this.panel, 'param.report.schedule.stime', '') const startTime = this.$lodash.get(this.panel, 'param.report.schedule.stime', '')
if (startTime !== '') { if (startTime !== '') {
this.panel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss') this.panel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {
this.panel.param.report.schedule.stime = '' this.panel.param.report.schedule.stime = ''
} }
const endTime = this.$loadsh.get(this.panel, 'param.report.schedule.etime', '') const endTime = this.$lodash.get(this.panel, 'param.report.schedule.etime', '')
if (endTime !== '') { if (endTime !== '') {
this.panel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss') this.panel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {

View File

@@ -146,7 +146,7 @@ export default {
getTopology(this.meta2dId).paste() getTopology(this.meta2dId).paste()
}, },
isNull (val) { isNull (val) {
return this.$loadsh.isNull(val) return this.$lodash.isNull(val)
} }
} }
} }

View File

@@ -127,7 +127,7 @@ export default {
const endTime = new Date().getTime() const endTime = new Date().getTime()
const startTime = endTime - 60 * this.params.timeType * 1000 const startTime = endTime - 60 * this.params.timeType * 1000
this.getQueryValues(this.querysArray, startTime, endTime).then((arr) => { this.getQueryValues(this.querysArray, startTime, endTime).then((arr) => {
this.clacTopoData(this.$loadsh.cloneDeep(this.topoData), arr).then((data) => { this.clacTopoData(this.$lodash.cloneDeep(this.topoData), arr).then((data) => {
if (!getTopology(this.meta2dId)) { if (!getTopology(this.meta2dId)) {
return return
} }
@@ -346,10 +346,13 @@ export default {
if (!positionShow) { if (!positionShow) {
return return
} }
console.log(pen)
this.chartParams = { this.chartParams = {
...pen.data.tooltip, ...pen.data.tooltip,
unit: this.params.unit, unit: this.params.unit,
statistic: this.params.statistic statistic: this.params.statistic,
legend: pen.data.legend,
parent: pen.data.parent
} }
this.timer3 = setTimeout(() => { this.timer3 = setTimeout(() => {
let ePosition = window.ePosition let ePosition = window.ePosition

View File

@@ -97,47 +97,6 @@ export default {
}) })
}) })
}, },
handleLegendAlias (legend, aliasExpression, params) {
const self = this
const myParams = JSON.parse(JSON.stringify(params))
myParams.$labels = JSON.parse(JSON.stringify(params))
myParams.$value = myParams.value
if (/\{\{.+\}\}/.test(aliasExpression)) {
const labelValue = aliasExpression.replace(/(\{\{.+?\}\})/g, function (i) {
const label = i.substr(i.indexOf('{{') + 2, i.indexOf('}}') - i.indexOf('{{') - 2)
if (!legend) {
return label
}
let value = null
if (params && self.$loadsh.get(myParams, label)) {
value = self.$loadsh.get(myParams, label)
}
if (label) {
const reg = new RegExp(label + '=".+?"', 'g')
if (reg.test(legend)) {
const ans = legend.match(reg)
let find = ''
ans.forEach(item => {
const index = legend.indexOf(item)
if (legend[index - 1] !== '_') {
find = item
}
})
value = find.substr(find.indexOf('"') + 1, find.lastIndexOf('"') - find.indexOf('"') - 1)
}
}
return value || ''
})
return labelValue
} else {
if (!aliasExpression) {
return legend
// let result =legend.substr(legend.indexOf('"') + 1,legend.lastIndexOf('"') - legend.indexOf('"') - 1);
// return result
}
return aliasExpression
}
},
clacTopoData (data, queryValues) { // 主要处理 属性为原始属性 处理动画属性对原始属性的影响 clacTopoData (data, queryValues) { // 主要处理 属性为原始属性 处理动画属性对原始属性的影响
return new Promise(resolve => { // 处理加载数据 return new Promise(resolve => { // 处理加载数据
if (!data) { if (!data) {

View File

@@ -464,7 +464,7 @@ export default {
if (!this.elements.length) { if (!this.elements.length) {
this.addExpression() this.addExpression()
} else { } else {
const expressionsShow = this.$loadsh.cloneDeep(this.expressionsShow) const expressionsShow = this.$lodash.cloneDeep(this.expressionsShow)
this.elements.forEach((item, index) => { this.elements.forEach((item, index) => {
this.expressions.push(item.expression) this.expressions.push(item.expression)
this.expressionName.push(item.name) this.expressionName.push(item.name)
@@ -477,7 +477,7 @@ export default {
// expressionsShow调整顺序 // expressionsShow调整顺序
expressionsShow.forEach((subItem) => { expressionsShow.forEach((subItem) => {
if (item.name == subItem.oldName) { if (item.name == subItem.oldName) {
this.$set(this.expressionsShow, index, this.$loadsh.cloneDeep(subItem)) this.$set(this.expressionsShow, index, this.$lodash.cloneDeep(subItem))
} }
}) })
}) })
@@ -492,7 +492,7 @@ export default {
this.expressions = [] this.expressions = []
this.expressionsShow = [] this.expressionsShow = []
this.expressionName = [] this.expressionName = []
this.elements = this.$loadsh.cloneDeep(this.querysArray) this.elements = this.$lodash.cloneDeep(this.querysArray)
this.dataTimeType = this.params.timeType || 1 this.dataTimeType = this.params.timeType || 1
this.dataStatistic = this.params.statistic || 'last' this.dataStatistic = this.params.statistic || 'last'
this.dataUnit = this.params.unit || 1 this.dataUnit = this.params.unit || 1

View File

@@ -789,6 +789,31 @@
</div> </div>
</div> </div>
</div> </div>
<!--source-->
<div class="form-row-title">
{{$t('dashboard.dashboard.chartForm.datasource')}}
</div>
<div class="el-form">
<div class="form-row-content">
<div class="form-row-item form-row-item-full">
<div class="form-row-key">
{{$t('dashboard.dashboard.chartForm.legend')}}
</div>
<div class="form-row-value">
<div style="display: inline-block;width: calc(30% - 3px)">
<el-select v-model="pen.data.parent" size="small" clearable @change="penDataParentChange">
<el-option class="text-ellipsis" v-for="item in queryValues.filter(query => query.type === 'title')" :key="item.id" :value="item.name" :label='item.name' :title="item.name" style="width: 133px;"></el-option>
</el-select>
</div>
<div style="display: inline-block;width: calc(70% - 13px);margin-left: 10px">
<el-select v-model="pen.data.legend" size="small" filterable allow-create clearable default-first-option>
<el-option class="text-ellipsis" v-for="item in queryValues.filter(query => (query.parent === pen.data.parent) && query.type === 'item')" :key="item.id" :value="item.name" :label='item.name' :title="item.name" style="width: 302px;"></el-option>
</el-select>
</div>
</div>
</div>
</div>
</div>
<!-- valueMapping --> <!-- valueMapping -->
<div class="form-row-title"> <div class="form-row-title">
@@ -806,23 +831,6 @@
<transition name="el-zoom-in-top"> <transition name="el-zoom-in-top">
<div class="el-form" v-show="elements.valueMapping && pen.data.enable.valueMapping"> <div class="el-form" v-show="elements.valueMapping && pen.data.enable.valueMapping">
<div class="form-row-content"> <div class="form-row-content">
<div class="form-row-item form-row-item-full">
<div class="form-row-key">
{{$t('dashboard.dashboard.chartForm.legend')}}
</div>
<div class="form-row-value">
<div style="display: inline-block;width: calc(30% - 3px)">
<el-select v-model="pen.data.parent" size="small" clearable @change="penDataParentChange">
<el-option class="text-ellipsis" v-for="item in queryValues.filter(query => query.type === 'title')" :key="item.id" :value="item.name" :label='item.name' :title="item.name" style="width: 133px;"></el-option>
</el-select>
</div>
<div style="display: inline-block;width: calc(70% - 13px);margin-left: 10px">
<el-select v-model="pen.data.legend" size="small" filterable allow-create clearable default-first-option>
<el-option class="text-ellipsis" v-for="item in queryValues.filter(query => (query.parent === pen.data.parent) && query.type === 'item')" :key="item.id" :value="item.name" :label='item.name' :title="item.name" style="width: 302px;"></el-option>
</el-select>
</div>
</div>
</div>
<div class="form-row-item form-row-item-full chart-config"> <div class="form-row-item form-row-item-full chart-config">
<el-row class="el-form"> <el-row class="el-form">
<draggable <draggable

View File

@@ -1,11 +1,11 @@
<template> <template>
<div class="tooltip-box" style="width: 400px;height: 300px;display: flex;flex-direction: column"> <div class="tooltip-box" style="width: 400px;height: 300px;display: flex;flex-direction: column">
<div v-if="params.titleShow && params.title" style="margin-bottom: 5px" class="tooltip-box-title">{{params.title}}</div> <div v-if="params.titleShow && params.title" style="margin-bottom: 5px" class="tooltip-box-title">{{ title || params.title}}</div>
<div <div
v-if="params.chartType === 'text'" v-if="params.chartType === 'text'"
> >
{{params.content}} {{content || params.content}}
</div> </div>
<panelChart <panelChart
v-else v-else
@@ -38,7 +38,10 @@ export default {
}, },
data () { data () {
return { return {
chartInfo: { ...defaultLineData, loaded: false } chartInfo: { ...defaultLineData, loaded: false },
dataSource: {},
title: '',
content: ''
} }
}, },
mounted () { mounted () {
@@ -55,7 +58,13 @@ export default {
this.chartInfo.id = this.meta2dId + 'meta2DTooltip' this.chartInfo.id = this.meta2dId + 'meta2DTooltip'
const chartData = [] const chartData = []
const elements = [] const elements = []
const obj = {} const source = this.queryValues.find(query => query.name === this.params.legend && query.parent === this.params.parent)
if (source) {
this.dataSource = source
console.log(this.params.title, this.dataSource.elements.expression, this.dataSource.metric)
this.title = this.handleLegendAlias(this.params.title, this.params.title, this.dataSource.metric) || this.params.title
this.content = this.handleLegendAlias(this.params.content, this.params.content, this.dataSource.metric) || this.params.content
}
this.params.legends.forEach(item => { this.params.legends.forEach(item => {
const findItem = this.queryValues.find(query => query.name === item.legend && query.parent === item.parent) const findItem = this.queryValues.find(query => query.name === item.legend && query.parent === item.parent)
// if (findItem) { // if (findItem) {
@@ -93,6 +102,8 @@ export default {
} }
} }
} }
},
methods: {
} }
} }
</script> </script>

View File

@@ -148,7 +148,7 @@ export default {
} else { } else {
this.redoFlag = false this.redoFlag = false
} }
if (historyIndex > -1 && !this.$loadsh.isNull(historyIndex)) { if (historyIndex > -1 && !this.$lodash.isNull(historyIndex)) {
this.undoFlag = true this.undoFlag = true
} else { } else {
this.undoFlag = false this.undoFlag = false

View File

@@ -784,7 +784,7 @@ export default {
if (!document.getElementById('topology-canvas' + this.topologyIndexF)) { if (!document.getElementById('topology-canvas' + this.topologyIndexF)) {
return return
} }
data = this.$loadsh.cloneDeep(data) data = this.$lodash.cloneDeep(data)
if (!getTopology(this.topologyIndex)) { if (!getTopology(this.topologyIndex)) {
let canvas = new Topology('topology-canvas' + this.topologyIndexF, canvasOptions) let canvas = new Topology('topology-canvas' + this.topologyIndexF, canvasOptions)
// canvas.open(data) // canvas.open(data)

View File

@@ -801,7 +801,7 @@ export default {
if (!document.getElementById('topology-canvas' + this.topologyIndexF)) { if (!document.getElementById('topology-canvas' + this.topologyIndexF)) {
return return
} }
data = this.$loadsh.cloneDeep(data) data = this.$lodash.cloneDeep(data)
const canvasOptions = { const canvasOptions = {
rotateCursor: '/static/roteCursor.cur', rotateCursor: '/static/roteCursor.cur',
disableEmptyLine: true, disableEmptyLine: true,
@@ -943,7 +943,7 @@ export default {
} }
}) })
if (!res.data.topo.newData) { if (!res.data.topo.newData) {
data.pens = this.$loadsh.orderBy(data.pens, 'type', 'desc') // 先处理线 再处理点 因为新版本 将连线开始结束放在的 点上控制 data.pens = this.$lodash.orderBy(data.pens, 'type', 'desc') // 先处理线 再处理点 因为新版本 将连线开始结束放在的 点上控制
data.pens = data.pens.map(item => { data.pens = data.pens.map(item => {
if (item.type === 0) { if (item.type === 0) {
item = disposeTopoOldData(item, data.pens) item = disposeTopoOldData(item, data.pens)
@@ -975,7 +975,7 @@ export default {
} }
return item return item
}) })
data.pens = this.$loadsh.orderBy(data.pens, 'type', 'asc') data.pens = this.$lodash.orderBy(data.pens, 'type', 'asc')
} }
if (!data.data) { if (!data.data) {
this.projectInfoShow = true this.projectInfoShow = true
@@ -1651,7 +1651,7 @@ export default {
}, },
onUpdateProps (node) { // 更新pen onUpdateProps (node) { // 更新pen
const obj = this.$loadsh.cloneDeep(node) const obj = this.$lodash.cloneDeep(node)
delete obj.x delete obj.x
delete obj.y delete obj.y
delete obj.center delete obj.center

View File

@@ -104,7 +104,7 @@ export default {
if (data.type === 0 || data.type === 1) { if (data.type === 0 || data.type === 1) {
data.lineWidth = data.data.lineWidth data.lineWidth = data.data.lineWidth
} }
const obj = this.$loadsh.cloneDeep(data) const obj = this.$lodash.cloneDeep(data)
delete obj.x delete obj.x
delete obj.y delete obj.y
delete obj.center delete obj.center

View File

@@ -735,8 +735,8 @@ export default {
immediate: true, immediate: true,
handler (n, o) { handler (n, o) {
this.isEdit = true this.isEdit = true
const obj = this.$loadsh.cloneDeep(n) const obj = this.$lodash.cloneDeep(n)
this.editAlertRule = this.$loadsh.cloneDeep(obj) this.editAlertRule = this.$lodash.cloneDeep(obj)
// 获取缓存中的告警等级列表 // 获取缓存中的告警等级列表
const severityData = JSON.parse(localStorage.getItem('nz-severityDataWeight')) const severityData = JSON.parse(localStorage.getItem('nz-severityDataWeight'))
// 给condition赋值 // 给condition赋值

View File

@@ -219,7 +219,7 @@ export default {
} }
this.$refs.endpointEditForm.validate((valid) => { this.$refs.endpointEditForm.validate((valid) => {
if (valid && !this.showError) { if (valid && !this.showError) {
const params = this.$loadsh.cloneDeep(this.editData) const params = this.$lodash.cloneDeep(this.editData)
if (params.editType === 1) { if (params.editType === 1) {
delete params.enable delete params.enable
} else { } else {

View File

@@ -1396,7 +1396,7 @@ export default {
if (!this.chartConfig.elements.length) { if (!this.chartConfig.elements.length) {
this.addExpression() this.addExpression()
} else { } else {
const expressionsShow = this.$loadsh.cloneDeep(this.expressionsShow) const expressionsShow = this.$lodash.cloneDeep(this.expressionsShow)
this.chartConfig.elements.forEach((item, index) => { this.chartConfig.elements.forEach((item, index) => {
this.expressions.push(item.expression) this.expressions.push(item.expression)
this.expressionName.push(item.name) this.expressionName.push(item.name)
@@ -1409,7 +1409,7 @@ export default {
// expressionsShow调整顺序 // expressionsShow调整顺序
expressionsShow.forEach((subItem) => { expressionsShow.forEach((subItem) => {
if (item.name == subItem.oldName) { if (item.name == subItem.oldName) {
this.$set(this.expressionsShow, index, this.$loadsh.cloneDeep(subItem)) this.$set(this.expressionsShow, index, this.$lodash.cloneDeep(subItem))
} }
}) })
}) })

View File

@@ -614,8 +614,8 @@ export default {
delete item.chartId delete item.chartId
}) })
} }
this.editChart = this.$loadsh.cloneDeep(obj) this.editChart = this.$lodash.cloneDeep(obj)
this.oldData = this.$loadsh.cloneDeep(obj) this.oldData = this.$lodash.cloneDeep(obj)
if (this.stableTime) { if (this.stableTime) {
clearTimeout(this.stableTime) clearTimeout(this.stableTime)
this.stableTime = null this.stableTime = null

View File

@@ -280,7 +280,7 @@ export default {
this.editChartTemp.varIds = this.$refs.transfer.selectedData.map(item => item.id) this.editChartTemp.varIds = this.$refs.transfer.selectedData.map(item => item.id)
} }
this.$refs.userForm.validate((valid) => { this.$refs.userForm.validate((valid) => {
const params = this.$loadsh.cloneDeep(this.editChartTemp) const params = this.$lodash.cloneDeep(this.editChartTemp)
params.pid = Number(params.pid) params.pid = Number(params.pid)
if (valid) { if (valid) {
if (params.id) { if (params.id) {

View File

@@ -211,7 +211,7 @@ export default {
methods: { methods: {
// 选中的模板变化 // 选中的模板变化
tempChange: bus.debounce(function (val) { tempChange: bus.debounce(function (val) {
const newValue = this.$loadsh.get(val, ['0', 'varType']) const newValue = this.$lodash.get(val, ['0', 'varType'])
const oldValue = this.templateType const oldValue = this.templateType
this.templateType = newValue this.templateType = newValue
// 判断varType是否变化 // 判断varType是否变化
@@ -228,7 +228,7 @@ export default {
getDashboardTempData () { getDashboardTempData () {
if (this.from === 'integration') { if (this.from === 'integration') {
this.editDashboard.tmplId = String(this.$parent.tempId) this.editDashboard.tmplId = String(this.$parent.tempId)
this.templateList = this.$loadsh.cloneDeep(this.$parent.panelData) this.templateList = this.$lodash.cloneDeep(this.$parent.panelData)
} else { } else {
this.$get('visual/dashboard', { type: 'template', pageSize: -1 }).then(response => { this.$get('visual/dashboard', { type: 'template', pageSize: -1 }).then(response => {
if (response.code === 200) { if (response.code === 200) {
@@ -268,7 +268,7 @@ export default {
return return
} }
this.prevent_opt.save = true this.prevent_opt.save = true
const params = this.$loadsh.cloneDeep(this.editDashboard) const params = this.$lodash.cloneDeep(this.editDashboard)
this.$refs.form.validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
// 模板varType ≠ 0时link有效且必填 // 模板varType ≠ 0时link有效且必填

View File

@@ -775,7 +775,7 @@ export default {
'editPanel.param.report.schedule.stime': { 'editPanel.param.report.schedule.stime': {
deep: true, deep: true,
handler (n) { handler (n) {
const startTime = this.$loadsh.get(this.editPanel, 'param.report.schedule.stime', '') const startTime = this.$lodash.get(this.editPanel, 'param.report.schedule.stime', '')
if (startTime !== '') { if (startTime !== '') {
this.editPanel.param.report.schedule.stime = bus this.editPanel.param.report.schedule.stime = bus
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss') .timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')
@@ -785,7 +785,7 @@ export default {
'editPanel.param.report.schedule.etime': { 'editPanel.param.report.schedule.etime': {
deep: true, deep: true,
handler (n) { handler (n) {
const endTime = this.$loadsh.get(this.editPanel, 'param.report.schedule.etime', '') const endTime = this.$lodash.get(this.editPanel, 'param.report.schedule.etime', '')
if (endTime !== '') { if (endTime !== '') {
this.editPanel.param.report.schedule.etime = bus this.editPanel.param.report.schedule.etime = bus
.timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss') .timeFormate(new Date(n), 'YYYY-MM-DD HH:mm:ss')

View File

@@ -166,7 +166,7 @@ export default {
deep: true, deep: true,
handler (n) { handler (n) {
this.isEdit = true this.isEdit = true
this.editPlaylist = this.$loadsh.cloneDeep(n) this.editPlaylist = this.$lodash.cloneDeep(n)
} }
} }
} }

View File

@@ -445,7 +445,7 @@ export default {
setSearchList (str) { setSearchList (str) {
this.selectIndex = -1 this.selectIndex = -1
if (!str) { if (!str) {
this.searchList = this.$loadsh.cloneDeep(this.oldSearchList) this.searchList = this.$lodash.cloneDeep(this.oldSearchList)
return return
} }
this.searchList = this.oldSearchList.filter(item => item.name.indexOf(str) !== -1) this.searchList = this.oldSearchList.filter(item => item.name.indexOf(str) !== -1)
@@ -497,7 +497,7 @@ export default {
}, },
editTag (tag, index) { editTag (tag, index) {
this.editTagIndex = index this.editTagIndex = index
this.editTagObj = this.$loadsh.cloneDeep(this.selectArr[index]) this.editTagObj = this.$lodash.cloneDeep(this.selectArr[index])
this.dialogShow = true this.dialogShow = true
this.editDialogObj.value = this.editTagObj.value this.editDialogObj.value = this.editTagObj.value
const keyStr = this.editTagObj.key const keyStr = this.editTagObj.key
@@ -556,7 +556,7 @@ export default {
return findItem.value.indexOf(item) === index // 因为indexOf 只能查找到第一个 return findItem.value.indexOf(item) === index // 因为indexOf 只能查找到第一个
}) })
} else { } else {
this.selectArr[this.editTagIndex] = this.$loadsh.cloneDeep(this.editTagObj) this.selectArr[this.editTagIndex] = this.$lodash.cloneDeep(this.editTagObj)
} }
}, },
querySearch (queryString, cb) { querySearch (queryString, cb) {
@@ -584,7 +584,7 @@ export default {
obj.selectionStart = obj.selectionEnd = len obj.selectionStart = obj.selectionEnd = len
}, 100) }, 100)
} }
// this.searchStr = this.$loadsh.cloneDeep(this.searchStr) // this.searchStr = this.$lodash.cloneDeep(this.searchStr)
}, },
clickOutside () { // 点击页面其他地方触发 clickOutside () { // 点击页面其他地方触发
this.visible = false this.visible = false
@@ -593,7 +593,7 @@ export default {
this.valueShow = false // value 的下拉 this.valueShow = false // value 的下拉
this.inputWidth = 400 this.inputWidth = 400
this.searchStr = '' this.searchStr = ''
this.searchList = this.$loadsh.cloneDeep(this.oldSearchList) this.searchList = this.$lodash.cloneDeep(this.oldSearchList)
this.symbolList = [] this.symbolList = []
this.valueList = [] this.valueList = []
} }

View File

@@ -215,7 +215,7 @@ export default {
this.getItem() this.getItem()
this.getUtcStr() this.getUtcStr()
this.getRangeHistoryArr() this.getRangeHistoryArr()
const timeTemp = this.$loadsh.cloneDeep(this.searchTime) const timeTemp = this.$lodash.cloneDeep(this.searchTime)
this.oldSearchTime[0] = timeTemp[0] this.oldSearchTime[0] = timeTemp[0]
this.oldSearchTime[1] = timeTemp[1] this.oldSearchTime[1] = timeTemp[1]
// 监听dateFormat变化 改变日期格式 // 监听dateFormat变化 改变日期格式
@@ -230,7 +230,7 @@ export default {
const timeEnd = this.momentStrToTimestamp(this.oldSearchTime[1], this.timeFormatMain) const timeEnd = this.momentStrToTimestamp(this.oldSearchTime[1], this.timeFormatMain)
this.$set(this.oldSearchTime, 0, this.momentTz(timeStart)) this.$set(this.oldSearchTime, 0, this.momentTz(timeStart))
this.$set(this.oldSearchTime, 1, this.momentTz(timeEnd)) this.$set(this.oldSearchTime, 1, this.momentTz(timeEnd))
this.searchTime = this.$loadsh.cloneDeep(this.oldSearchTime) this.searchTime = this.$lodash.cloneDeep(this.oldSearchTime)
this.$emit('change', this.searchTime) this.$emit('change', this.searchTime)
// 更新vuex日期格式 // 更新vuex日期格式
this.$store.commit('setTimeFormatMain', localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss') this.$store.commit('setTimeFormatMain', localStorage.getItem('nz-default-dateFormat') || 'YYYY-MM-DD HH:mm:ss')
@@ -297,7 +297,7 @@ export default {
if (this.oldSearchTimeError[0] || this.oldSearchTimeError[1]) { if (this.oldSearchTimeError[0] || this.oldSearchTimeError[1]) {
return return
} }
this.searchTime = this.$loadsh.cloneDeep(this.oldSearchTime) this.searchTime = this.$lodash.cloneDeep(this.oldSearchTime)
this.showTime = this.nowTimeType = { this.showTime = this.nowTimeType = {
id: 0, id: 0,
text: this.searchTime[0] + ' ' + this.$t('dashboard.dashboard.to') + ' ' + this.searchTime[1], text: this.searchTime[0] + ' ' + this.$t('dashboard.dashboard.to') + ' ' + this.searchTime[1],
@@ -319,7 +319,7 @@ export default {
this.$emit('change', this.searchTime) this.$emit('change', this.searchTime)
}, },
showDropdown (value) { showDropdown (value) {
const timeTemp = this.$loadsh.cloneDeep(this.searchTime) const timeTemp = this.$lodash.cloneDeep(this.searchTime)
this.oldSearchTime[0] = timeTemp[0] this.oldSearchTime[0] = timeTemp[0]
this.oldSearchTime[1] = timeTemp[1] this.oldSearchTime[1] = timeTemp[1]
this.oldSearchTimeError[0] = false this.oldSearchTimeError[0] = false
@@ -468,7 +468,7 @@ export default {
this.$set(this.showTime, 'id', nowTimeType.id) this.$set(this.showTime, 'id', nowTimeType.id)
this.$set(this.showTime, 'text', nowTimeType.text) this.$set(this.showTime, 'text', nowTimeType.text)
this.setSearchTime(nowTimeType.type, nowTimeType.value) this.setSearchTime(nowTimeType.type, nowTimeType.value)
const timeTemp = this.$loadsh.cloneDeep(this.searchTime) const timeTemp = this.$lodash.cloneDeep(this.searchTime)
this.oldSearchTime[0] = timeTemp[0] this.oldSearchTime[0] = timeTemp[0]
this.oldSearchTime[1] = timeTemp[1] this.oldSearchTime[1] = timeTemp[1]
this.oldSearchTimeError[0] = false this.oldSearchTimeError[0] = false

View File

@@ -337,7 +337,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -810,7 +810,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -170,7 +170,7 @@ export default {
}, },
edit (row) { edit (row) {
this.object = { this.object = {
...this.$loadsh.cloneDeep(row), ...this.$lodash.cloneDeep(row),
checkDay: '', checkDay: '',
checkDays: '', checkDays: '',
datepicker: '' datepicker: ''

View File

@@ -264,7 +264,7 @@ export default {
} }
}, },
copy (u, copyParams) { copy (u, copyParams) {
const copyName = this.$loadsh.get(copyParams, 'copyName', '-copy') const copyName = this.$lodash.get(copyParams, 'copyName', '-copy')
this.object = { ...u, name: u.name + copyName, id: '' } this.object = { ...u, name: u.name + copyName, id: '' }
if (this.object.name.length > 64) { if (this.object.name.length > 64) {
const length = this.object.name.length - 64 const length = this.object.name.length - 64

View File

@@ -168,7 +168,7 @@ export default {
this.$get('visual/dashboard/' + u.id).then(res => { this.$get('visual/dashboard/' + u.id).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.object = res.data this.object = res.data
if (!this.$loadsh.get(this.object, 'param.report', '')) { if (!this.$lodash.get(this.object, 'param.report', '')) {
this.object = { this.object = {
...this.object, ...this.object,
param: { param: {
@@ -193,13 +193,13 @@ export default {
} }
} }
this.object.param.report.schedule.type = this.object.param.report.schedule.type + '' this.object.param.report.schedule.type = this.object.param.report.schedule.type + ''
const startTime = this.$loadsh.get(this.object, 'param.report.schedule.stime', '') const startTime = this.$lodash.get(this.object, 'param.report.schedule.stime', '')
if (startTime !== '') { if (startTime !== '') {
this.object.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.object.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss') this.object.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.object.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {
this.object.param.report.schedule.stime = '' this.object.param.report.schedule.stime = ''
} }
const endTime = this.$loadsh.get(this.object, 'param.report.schedule.etime', '') const endTime = this.$lodash.get(this.object, 'param.report.schedule.etime', '')
if (endTime !== '') { if (endTime !== '') {
this.object.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.object.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss') this.object.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.object.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {

View File

@@ -195,7 +195,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -246,7 +246,7 @@ export default {
n.map(item => { n.map(item => {
if (!item.position) { if (!item.position) {
const obj = { const obj = {
...this.$loadsh.cloneDeep(item), ...this.$lodash.cloneDeep(item),
type: 'user', type: 'user',
position: { position: {
top: 0, top: 0,

View File

@@ -468,7 +468,7 @@ export default {
this.$get('visual/dashboard/' + u.id).then(res => { this.$get('visual/dashboard/' + u.id).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.panel = res.data this.panel = res.data
if (!this.$loadsh.get(this.panel, 'param.report', '')) { if (!this.$lodash.get(this.panel, 'param.report', '')) {
this.panel = { this.panel = {
...this.panel, ...this.panel,
param: { param: {
@@ -493,13 +493,13 @@ export default {
} }
} }
this.panel.param.report.schedule.type = this.panel.param.report.schedule.type + '' this.panel.param.report.schedule.type = this.panel.param.report.schedule.type + ''
const startTime = this.$loadsh.get(this.panel, 'param.report.schedule.stime', '') const startTime = this.$lodash.get(this.panel, 'param.report.schedule.stime', '')
if (startTime !== '') { if (startTime !== '') {
this.panel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss') this.panel.param.report.schedule.stime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.stime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {
this.panel.param.report.schedule.stime = '' this.panel.param.report.schedule.stime = ''
} }
const endTime = this.$loadsh.get(this.panel, 'param.report.schedule.etime', '') const endTime = this.$lodash.get(this.panel, 'param.report.schedule.etime', '')
if (endTime !== '') { if (endTime !== '') {
this.panel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss') this.panel.param.report.schedule.etime = this.utcTimeToTimezoneStr(this.panel.param.report.schedule.etime, 'YYYY-MM-DD HH:mm:ss')
} else { } else {
@@ -777,7 +777,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.variablesInit = false this.variablesInit = false
this.showPanel = val this.showPanel = val
this.variables = this.$loadsh.cloneDeep(this.$loadsh.get(this, 'showPanel.param.variables', []) || []) this.variables = this.$lodash.cloneDeep(this.$lodash.get(this, 'showPanel.param.variables', []) || [])
this.showPanel.type = 'dashboard' this.showPanel.type = 'dashboard'
this.filter.dashboardId = this.showPanel.id this.filter.dashboardId = this.showPanel.id
this.dashboardId = this.showPanel.id this.dashboardId = this.showPanel.id
@@ -911,7 +911,7 @@ export default {
this.$message.error(response) this.$message.error(response)
} }
} }
this.variables = this.$loadsh.get(this, 'showPanel.param.variables', []) || [] this.variables = this.$lodash.get(this, 'showPanel.param.variables', []) || []
function handler (panelData) { function handler (panelData) {
panelData.forEach(panel => { panelData.forEach(panel => {
@@ -1124,12 +1124,12 @@ export default {
setDefaultTimeRange () { setDefaultTimeRange () {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$route.query.searchTime) return if (this.$route.query.searchTime) return
let nowTimeType = this.$loadsh.cloneDeep(this.timeData[3]) let nowTimeType = this.$lodash.cloneDeep(this.timeData[3])
const defaultTimeRange = this.$loadsh.get(this.showPanel, 'param.defaultTimeRange') const defaultTimeRange = this.$lodash.get(this.showPanel, 'param.defaultTimeRange')
if (defaultTimeRange) { if (defaultTimeRange) {
nowTimeType = this.timeData.find(item => item.id == defaultTimeRange) nowTimeType = this.timeData.find(item => item.id == defaultTimeRange)
} }
this.nowTimeType = this.$loadsh.cloneDeep(nowTimeType) this.nowTimeType = this.$lodash.cloneDeep(nowTimeType)
// 刷新时间范围 // 刷新时间范围
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType) this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType)
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType) this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
@@ -1143,8 +1143,8 @@ export default {
setDefaultRefresh () { setDefaultRefresh () {
this.$nextTick(() => { this.$nextTick(() => {
if (this.$route.query.refresh) return if (this.$route.query.refresh) return
let refresh = this.$loadsh.cloneDeep(this.intervalList[0]) let refresh = this.$lodash.cloneDeep(this.intervalList[0])
const defaultRefresh = this.$loadsh.get(this.showPanel, 'param.refresh') const defaultRefresh = this.$lodash.get(this.showPanel, 'param.refresh')
if (defaultRefresh) { if (defaultRefresh) {
refresh = this.intervalList.find(item => item.value == defaultRefresh) refresh = this.intervalList.find(item => item.value == defaultRefresh)
} }

View File

@@ -150,8 +150,8 @@ export default {
this.panelData = response.data.list this.panelData = response.data.list
if (this.panelData.length > 0) { if (this.panelData.length > 0) {
this.filter.dashboardId = this.panelData[0].id this.filter.dashboardId = this.panelData[0].id
this.showPanel = this.$loadsh.cloneDeep(this.panelData[0]) this.showPanel = this.$lodash.cloneDeep(this.panelData[0])
this.variables = this.$loadsh.get(this.panelData, '[0].param.variables') this.variables = this.$lodash.get(this.panelData, '[0].param.variables')
this.getData(this.filter) this.getData(this.filter)
} }
} }

View File

@@ -716,7 +716,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -461,7 +461,7 @@ export default {
} else { } else {
detailViewRightObj = this.tableData[0] detailViewRightObj = this.tableData[0]
} }
this.detailViewRightObj = this.$loadsh.cloneDeep(detailViewRightObj) this.detailViewRightObj = this.$lodash.cloneDeep(detailViewRightObj)
this.pageObj.total = response.data.total this.pageObj.total = response.data.total
this.pageObj.pages = response.data.pages this.pageObj.pages = response.data.pages
if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) { if (!this.scrollbarWrap && this.$refs.dataTable && this.$refs.dataTable.$refs.dataTable) {

View File

@@ -17,7 +17,7 @@ import router from '@/router'
import VueResource from 'vue-resource' import VueResource from 'vue-resource'
import axios from 'axios' import axios from 'axios'
import { hasPermission, hasButton } from '@/permission' import { hasPermission, hasButton } from '@/permission'
import loadsh from 'lodash' import lodash from 'lodash'
import plTable from 'pl-table' import plTable from 'pl-table'
import VueClipboard from 'vue-clipboard2' import VueClipboard from 'vue-clipboard2'
import 'pl-table/themes/index.css' import 'pl-table/themes/index.css'
@@ -109,7 +109,7 @@ Vue.prototype.$post = post
Vue.prototype.$get = get Vue.prototype.$get = get
Vue.prototype.$put = put Vue.prototype.$put = put
Vue.prototype.$delete = del Vue.prototype.$delete = del
Vue.prototype.$loadsh = loadsh // JavaScript 实用工具库 https://www.lodashjs.com/ Vue.prototype.$lodash = lodash // JavaScript 实用工具库 https://www.lodashjs.com/
Vue.prototype.$CONSTANTS = constants Vue.prototype.$CONSTANTS = constants
Vue.prototype.$TOOLS = tools Vue.prototype.$TOOLS = tools
Vue.prototype.$bottomBoxWindow = bottomBoxWindow // 底部上滑框控制 Vue.prototype.$bottomBoxWindow = bottomBoxWindow // 底部上滑框控制

View File

@@ -38,7 +38,7 @@ Vue.prototype.$post = post
Vue.prototype.$get = get Vue.prototype.$get = get
Vue.prototype.$put = put Vue.prototype.$put = put
Vue.prototype.$delete = del Vue.prototype.$delete = del
Vue.prototype.$loadsh = loadsh Vue.prototype.$lodash = loadsh
Vue.prototype.$CONSTANTS = constants Vue.prototype.$CONSTANTS = constants
Vue.prototype.$TOOLS = tools Vue.prototype.$TOOLS = tools
Vue.prototype.$bottomBoxWindow = bottomBoxWindow // 底部上滑框控制 Vue.prototype.$bottomBoxWindow = bottomBoxWindow // 底部上滑框控制

View File

@@ -320,7 +320,7 @@ export default new Vue({
}, },
// 数组对象扁平化 // 数组对象扁平化
flatten (arr) { flatten (arr) {
const tempArr = this.$loadsh.cloneDeep(arr) const tempArr = this.$lodash.cloneDeep(arr)
// 递归调用 // 递归调用
function handler (tempArr) { function handler (tempArr) {
const newArr = [] const newArr = []