diff --git a/src/api/cs-harmonic-boot/mxgraph.ts b/src/api/cs-harmonic-boot/mxgraph.ts new file mode 100644 index 0000000..9b62d25 --- /dev/null +++ b/src/api/cs-harmonic-boot/mxgraph.ts @@ -0,0 +1,43 @@ +import createAxios from '@/utils/request' + +//新增组态项目 +export function add(data:any) { + return createAxios({ + url: "/cs-harmonic-boot/csconfiguration/add", + method: "post", + data, + }); + } + //组态项目分页查询 + export function coFqueryPage(data:any) { + return createAxios({ + url: "/cs-harmonic-boot/csconfiguration/queryPage", + method: "post", + data, + }); + } + //修改组态项目 + export function audit(data:any) { + return createAxios({ + url: "/cs-harmonic-boot/csconfiguration/audit", + method: "post", + data, + }); + } + //组态页面分页查询 + export function queryPageData(data:any) { + return createAxios({ + url: "/cs-harmonic-boot/cspage/queryPage", + method: "post", + data, + }); + } + //查询工程列表 + export function deviceTree(data:any) { + return createAxios({ + url: "/cs-device-boot/csLedger/deviceTree", + method: "post", + data, + }); + } + \ No newline at end of file diff --git a/src/views/govern/device/control/tabs/trend.vue b/src/views/govern/device/control/tabs/trend.vue index d90de93..d7048fb 100644 --- a/src/views/govern/device/control/tabs/trend.vue +++ b/src/views/govern/device/control/tabs/trend.vue @@ -221,47 +221,45 @@ const init = async () => { } }, tooltip: { - trigger: 'axis', - textStyle: { - color: '#fff', - fontStyle: 'normal', - opacity: 0.35, - fontSize: 14 - }, - backgroundColor: 'rgba(0,0,0,0.35)', - borderWidth: 0, - axisPointer: { - type: 'cross', - crossStyle: { - color: '#999' - } - }, + trigger: 'axis', + textStyle: { + color: '#fff', + fontStyle: 'normal', + opacity: 0.35, + fontSize: 14 + }, + backgroundColor: 'rgba(0,0,0,0.35)', + borderWidth: 0, + axisPointer: { + type: 'cross', + crossStyle: { + color: '#999' + } + }, - formatter: function (params: any) { - let list = params.filter((item, index, self) => { - return index === self.findIndex(t => t.seriesName === item.seriesName) - }) - var res = - '' + - list[0].value[0] + - list[0].name + - '
' - for (var i = 0, l = list.length; i < l; i++) { - list[i].unit = - echartsData.value.options.yAxis[ - echartsData.value.options.series[list[i].seriesIndex].yAxisIndex - ]?.name - res += - list[i].seriesName + - ' ' + - `
` + - `
${list[ - i - ].value[1].toFixed(2)} ${list[i].unit||''}

` + formatter: function (params: any) { + let list = params.filter((item, index, self) => { + return index === self.findIndex(t => t.seriesName === item.seriesName) + }) + var res = + '' + + list[0].value[0] + + list[0].name + + '
' + for (var i = 0, l = list.length; i < l; i++) { + list[i].unit = + echartsData.value.options.yAxis[ + echartsData.value.options.series[list[i].seriesIndex].yAxisIndex + ]?.name + res += + list[i].seriesName + + ' ' + + `
` + + `
${list[i].value[1]==null?'':list[i].value[1].toFixed(2)} ${list[i].unit || ''}

` + } + return res } - return res - } - }, + }, legend: { //legend使用iconfont图标 @@ -278,15 +276,17 @@ const init = async () => { height: 50 }, - xAxis:{ + xAxis: { type: 'time', - axisLabel: { - formatter: { - day: '{MM}-{dd}', - month: '{MM}', - year: '{yyyy}', - } - },}, + axisLabel: { + formatter: { + day: '{MM}-{dd}', + month: '{MM}', + year: '{yyyy}', + } + }, + }, + // [ // { // type: 'category', @@ -318,7 +318,7 @@ const init = async () => { color: '#000', fontSize: 14 }, - splitNumber:5, + splitNumber: 5, minInterval: 1, axisTick: { show: true @@ -360,7 +360,7 @@ const init = async () => { color: '#000', fontSize: 14 }, - splitNumber:5, + splitNumber: 5, minInterval: 1, axisTick: { show: true @@ -408,7 +408,7 @@ const init = async () => { } else { vv.yAxisIndex = 0 } - + //series数据 echartsData.value.options.series.push({ @@ -424,7 +424,7 @@ const init = async () => { data: historyDataList.value .map((kk: any) => { if (kk.statisticalName == vv.name) { - + return [kk.time, kk.statisticalData] } else { return '' @@ -677,7 +677,7 @@ watch( // immediate: true // } // ) -onMounted(() => { +onMounted(() => { datePickerRef.value.setInterval(5) }) defineExpose({ getTrendRequest }) diff --git a/src/views/govern/mxgraph/graphList/components/popup.vue b/src/views/govern/mxgraph/graphList/components/popup.vue new file mode 100644 index 0000000..b802b01 --- /dev/null +++ b/src/views/govern/mxgraph/graphList/components/popup.vue @@ -0,0 +1,124 @@ + + + diff --git a/src/views/govern/mxgraph/graphList/index.vue b/src/views/govern/mxgraph/graphList/index.vue new file mode 100644 index 0000000..3d93328 --- /dev/null +++ b/src/views/govern/mxgraph/graphList/index.vue @@ -0,0 +1,260 @@ + + +