修改测试bug

This commit is contained in:
GGJ
2024-12-11 11:33:44 +08:00
parent 22d85dfca1
commit 26c971f3b0
10 changed files with 197 additions and 108 deletions

View File

@@ -54,7 +54,7 @@ interface Props {
showSearch?: boolean showSearch?: boolean
nextFlag?: boolean //控制时间是否可以往后推 nextFlag?: boolean //控制时间是否可以往后推
theCurrentTime?: boolean //控制时间前3天展示上个月时间 theCurrentTime?: boolean //控制时间前3天展示上个月时间
showReset?: boolean //控制时间前3天展示上个月时间 showReset?: boolean //是否显示重置
} }
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {

View File

@@ -26,7 +26,7 @@ import { defaultAttribute } from '@/components/table/defaultAttribute'
import { mainHeight } from '@/utils/layout' import { mainHeight } from '@/utils/layout'
const emit = defineEmits(['back']) const emit = defineEmits(['back'])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const tableHeight = mainHeight(550) const tableHeight = mainHeight(440)
const height = ref(0) const height = ref(0)
height.value = window.innerHeight < 1080 ? 230 : 450 height.value = window.innerHeight < 1080 ? 230 : 450

View File

@@ -109,6 +109,13 @@
:value="item.value" /> :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="数据来源" v-if="dataSet.includes('_items')">
<el-select v-model="formInline.targetType" >
<el-option v-for="item in dataSource" :key="item.id" :label="item.name"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="关键字" v-if="!dataSet.includes('_')"> <el-form-item label="关键字" v-if="!dataSet.includes('_')">
<el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable <el-input style="width: 160px" v-model="searchValue" autocomplete="off" clearable
@input="handleSearch" placeholder="请输入关键词"></el-input> @input="handleSearch" placeholder="请输入关键词"></el-input>
@@ -640,6 +647,7 @@ const handleaddDevice = () => {
const deviceId: any = ref('') const deviceId: any = ref('')
const lineId: any = ref('') const lineId: any = ref('')
const dataLevel: any = ref('') const dataLevel: any = ref('')
const dataSource=ref([])
const nodeClick = async (e: anyObj) => { const nodeClick = async (e: anyObj) => {
// console.log("🚀 ~ nodeClick ~ e:", e) // console.log("🚀 ~ nodeClick ~ e:", e)
if (e.level == 2) return if (e.level == 2) return
@@ -698,6 +706,7 @@ const nodeClick = async (e: anyObj) => {
if (item.type === 'event') { if (item.type === 'event') {
item.id = item.id + '_event' item.id = item.id + '_event'
} }
// 测试项日志
if (item.type === 'items') { if (item.type === 'items') {
item.id = item.id + '_items' item.id = item.id + '_items'
} }

View File

@@ -14,7 +14,7 @@
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item > <el-form-item>
<!-- <el-select style="min-width: 120px !important" v-model="searchForm.dataLevel"> <!-- <el-select style="min-width: 120px !important" v-model="searchForm.dataLevel">
<el-option value="Primary" label="一次值"></el-option> <el-option value="Primary" label="一次值"></el-option>
<el-option value="Secondary" label="二次值"></el-option> <el-option value="Secondary" label="二次值"></el-option>
@@ -68,7 +68,7 @@ import { color } from '@/components/echarts/color'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
const dictData = useDictData() const dictData = useDictData()
defineOptions({ defineOptions({
name: 'govern/device/control' // name: 'govern/device/control'
}) })
const props = defineProps({ const props = defineProps({
TrendList: { TrendList: {
@@ -86,7 +86,7 @@ const num = ref(0)
//值类型 //值类型
const pageHeight = ref(mainHeight(290)) const pageHeight = ref(mainHeight(290))
const loading = ref(true) const loading = ref(true)
const searchForm:any = ref({}) const searchForm: any = ref({})
const tableHeaderRef = ref() const tableHeaderRef = ref()
const typeOptions = [ const typeOptions = [
{ {
@@ -229,7 +229,7 @@ const init = async () => {
if (item.phase == null) { if (item.phase == null) {
key = item.unit key = item.unit
} else { } else {
key = item.unit key = item.anotherName
} }
if (!acc[key]) { if (!acc[key]) {
@@ -283,8 +283,17 @@ const init = async () => {
const xname = params[0].value[0] const xname = params[0].value[0]
let str = `${xname}<br>` let str = `${xname}<br>`
params.forEach((el: any, index: any) => { params.forEach((el: any, index: any) => {
let marker = ''
if (el.value[3] == 'dashed') {
for (let i = 0; i < 3; i++) {
marker += `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
}
} else {
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
}
let unit = el.value[2] ? el.value[2] : '' let unit = el.value[2] ? el.value[2] : ''
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1]}${unit} str += `${marker}${el.seriesName.split('(')[0]}${el.value[1]}${unit}
<br>` <br>`
}) })
return str return str
@@ -398,7 +407,7 @@ const init = async () => {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0) yMethodList.push(cc.statisticalData?.toFixed(2) - 0)
} }
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit]) seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
}) })
// console.log(kk); // console.log(kk);
@@ -412,7 +421,7 @@ const init = async () => {
symbol: 'none', symbol: 'none',
data: seriesList, data: seriesList,
lineStyle: lineStyle[lineS], lineStyle: lineStyle[lineS],
yAxisIndex: index yAxisIndex: setList.indexOf(kk[0].unit)
}) })
}) })
let [min, max] = yMethod(yMethodList) let [min, max] = yMethod(yMethodList)
@@ -572,6 +581,7 @@ const countData: any = ref([])
//根据选择的指标处理谐波次数 //根据选择的指标处理谐波次数
const formatCountOptions = (list: any) => { const formatCountOptions = (list: any) => {
countData.value = []
if (list.length != 0) { if (list.length != 0) {
list.map((item: any, index: any) => { list.map((item: any, index: any) => {
if (!countData.value[index]) { if (!countData.value[index]) {
@@ -632,6 +642,14 @@ const onCountChange = (val: any, index: any) => {
const flag = ref(true) const flag = ref(true)
const onIndexChange = (val: any) => { const onIndexChange = (val: any) => {
num.value += 1 num.value += 1
let pp: any = []
indexOptions.value.forEach((item: any) => {
const filteredResult = val.filter(vv => item.id == vv);
if (filteredResult.length > 0) {
pp.push(filteredResult[0]);
}
})
searchForm.value.index = pp
flag.value = true flag.value = true

View File

@@ -1,9 +1,9 @@
<template> <template>
<!-- 测试项日志 -->
<div :style="{ height: height }"> <div :style="{ height: height }">
<vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key"> <vxe-table height="auto" auto-resize :data="dataList" v-bind="defaultAttribute" :key="key">
<vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter" <vxe-column v-for="item in column" :field="item.field" :title="item.title" :formatter="formatter"
:min-width="item.width"></vxe-column> :min-width="item.width" :sortable="item.sortable"></vxe-column>
<vxe-column title="操作" fixed="right" width="100"> <vxe-column title="操作" fixed="right" width="100">
<template v-slot:default="scoped"> <template v-slot:default="scoped">
<el-button link type="danger" @click="remove(scoped.row)">删除</el-button> <el-button link type="danger" @click="remove(scoped.row)">删除</el-button>
@@ -26,24 +26,25 @@ const voltageLevelList: any = dictData.getBasicData('Dev_Voltage_Stand')
import { deleteItem } from '@/api/cs-device-boot/csGroup' import { deleteItem } from '@/api/cs-device-boot/csGroup'
const volConTypeList = dictData.getBasicData('Dev_Connect') const volConTypeList = dictData.getBasicData('Dev_Connect')
const emit = defineEmits(['onSubmit']) const emit = defineEmits(['onSubmit'])
const height = mainHeight(325).height const height = mainHeight(295).height
const dataList = ref([]) const dataList = ref([])
const key: any = ref(0) const key: any = ref(0)
const column: any = ref([ const column: any = ref([
{ field: 'itemName', title: '名称', width: '100px' }, { field: 'startTime', title: '数据起始时间', width: '140px', sortable: true },
{ field: 'startTime', title: '数据起始时间', width: '140px' }, { field: 'endTime', title: '数据结束时间', width: '140px', sortable: true },
{ field: 'endTime', title: '数据结束时间', width: '140px' }, { field: 'itemName', title: '数据来源', width: '100px' },
{ field: 'statisticalInterval', title: '统计间隔', width: '100px' }, { field: 'statisticalInterval', title: '统计间隔', width: '100px', },
{ field: 'voltageLevel', title: '电压等级', width: '100px' }, { field: '', title: '时间间隔', width: '140px', },
{ field: 'volConType', title: ' 电压接线方式', width: '100px' }, { field: 'voltageLevel', title: '电压等级', width: '100px',sortable: true },
{ field: 'capacitySi', title: '用户协议容量', width: '100px' }, { field: 'volConType', title: ' 电压接线方式', width: '100px', sortable: true },
{ field: 'capacitySscb', title: '基准短路容量', width: '100px' }, { field: 'capacitySi', title: '用户协议容量(MVA)', width: '140px', },
{ field: 'capacitySscmin', title: '最小短路容量', width: '100px' }, { field: 'capacitySscb', title: '基准短路容量(MVA)', width: '140px', },
{ field: 'capacitySt', title: '供电设备容量', width: '100px' }, { field: 'capacitySscmin', title: '最小短路容量(MVA)', width: '140px', },
{ field: 'location', title: ' 测试位置', width: '100px' }, { field: 'capacitySt', title: '供电设备容量(MVA)', width: '140px', },
{ field: 'location', title: ' 测试位置', width: '100px', },
{ field: 'ct', title: 'CT', width: '70px' }, { field: 'ct', title: 'CT', width: '70px', },
{ field: 'pt', title: 'PT', width: '70px' }, { field: 'pt', title: 'PT', width: '70px', },
]) ])
const setData = (data: any) => { const setData = (data: any) => {

View File

@@ -1,5 +1,6 @@
<template> <template>
<div class="default-main device-manage" :style="{ height: pageHeight.height }"> <div class="default-main device-manage" :style="{ height: pageHeight.height }">
<!-- @node-change="nodeClick" --> <!-- @node-change="nodeClick" -->
<schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" @onAdd="onAdd" @bind="bind" <schemeTree @node-change="nodeClick" @node-click="nodeClick" @init="nodeClick" @onAdd="onAdd" @bind="bind"
ref="schemeTreeRef"></schemeTree> ref="schemeTreeRef"></schemeTree>
@@ -102,21 +103,23 @@
<div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0"> <div v-if="JSON.stringify(echartsData) != '{}' && deviceData?.records?.length != 0">
<!-- <h3 class="mt10 mb10">历史趋势</h3> --> <!-- <h3 class="mt10 mb10">历史趋势</h3> -->
<el-tabs type="border-card" class="mt10"> <el-tabs type="border-card" class="mt10">
<el-tab-pane label="历史趋势"> <div class="history_trend" v-if="titleList != '(未绑定数据)'"> <el-tab-pane label="历史趋势">
<div class="history_trend" v-if="titleList != '(未绑定数据)'">
<div class="history_header" ref="headerRef"> <div class="history_header" ref="headerRef">
<!-- <el-form :model="searchForm" class="history_select" id="history_select"> --> <!-- <el-form :model="searchForm" class="history_select" id="history_select"> -->
<TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange"> <TableHeader :showSearch="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select :key="num"> <template v-slot:select :key="num">
<el-form-item for="-" label="统计指标"> <el-form-item for="-" label="统计指标">
<el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip <el-select style="min-width: 200px" collapse-tags collapse-tags-tooltip
v-model="searchForm.index" placeholder="请选择统计指标" @change="onIndexChange($event)" v-model="searchForm.index" placeholder="请选择统计指标"
multiple :multiple-limit="3"> @change="onIndexChange($event)" multiple :multiple-limit="3">
<el-option v-for="item in indexOptions" :key="item.id" :label="item.name" <el-option v-for="item in indexOptions" :key="item.id"
:value="item.id"></el-option> :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item for="-" label="统计类型" label-width="80px"> <el-form-item for="-" label="统计类型" label-width="80px">
<el-select style="width: 120px" v-model="searchForm.type" placeholder="请选择值类型"> <el-select style="width: 120px" v-model="searchForm.type"
placeholder="请选择值类型">
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name" <el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
:value="item.id"></el-option> :value="item.id"></el-option>
</el-select> </el-select>
@@ -143,20 +146,25 @@
<!-- <el-button type="primary" icon="el-icon-Download" @click="handleExport"> <!-- <el-button type="primary" icon="el-icon-Download" @click="handleExport">
数据导出 数据导出
</el-button> --> </el-button> -->
<el-button type="primary" icon="el-icon-Search" @click="init(true)">查询</el-button> <el-button type="primary" icon="el-icon-Search"
@click="init(true)">查询</el-button>
</template> </template>
</TableHeader> </TableHeader>
</div> </div>
<!-- <div class="history_title"> <!-- <div class="history_title">
<p>{{ chartTitle }}</p> <p>{{ chartTitle }}</p>
</div> --> </div> -->
<div class="history_chart mt5" v-loading="loading" :style="EcharHeight" :key="EcharHeight.height" <div class="history_chart mt5" v-loading="loading" :style="EcharHeight"
ref="chartRef"> :key="EcharHeight.height" ref="chartRef">
<MyEchart ref="historyChart" v-if="echartsData" :isExport="true" :options="echartsData" /> <MyEchart ref="historyChart" v-if="echartsData" :isExport="true"
:options="echartsData" />
</div> </div>
</div> </div>
<el-empty :style="EcharHeight" v-else description="未绑定数据" /></el-tab-pane> <el-empty :style="EcharHeight" v-else description="未绑定数据" />
<el-tab-pane label="暂态数据">Config</el-tab-pane> </el-tab-pane>
<el-tab-pane label="暂态数据">
暂态数据
</el-tab-pane>
</el-tabs> </el-tabs>
@@ -310,6 +318,14 @@ const nodeClick = async (e: anyObj) => {
} }
const onIndexChange = (val: any) => { const onIndexChange = (val: any) => {
num.value += 1 num.value += 1
let pp: any = []
indexOptions.value.forEach((item: any) => {
const filteredResult = val.filter(vv => item.id == vv);
if (filteredResult.length > 0) {
pp.push(filteredResult[0]);
}
})
searchForm.value.index = pp
// if (val.length == 0) { // if (val.length == 0) {
// searchForm.value.index = [indexOptions.value[0].id] // searchForm.value.index = [indexOptions.value[0].id]
// } // }
@@ -469,7 +485,7 @@ const init = (flag: boolean) => {
if (item.phase == null) { if (item.phase == null) {
key = item.unit key = item.unit
} else { } else {
key = item.unit key = item.anotherName
} }
if (!acc[key]) { if (!acc[key]) {
acc[key] = [] acc[key] = []
@@ -493,6 +509,7 @@ const init = (flag: boolean) => {
// textStyle: { // textStyle: {
// color: '#000', // color: '#000',
// fontSize: '16' // fontSize: '16'
// }, // },
// }, // },
@@ -543,9 +560,18 @@ const init = (flag: boolean) => {
const xname = params[0].value[0] const xname = params[0].value[0]
let str = `${xname}<br>` let str = `${xname}<br>`
params.forEach((el: any, index: any) => { params.forEach((el: any, index: any) => {
let marker = ''
str += `${el.marker}${el.seriesName.split('(')[0]}${el.value[1] ? el.value[1] + ' ' + (el.value[2] || '') : '-' if (el.value[3] == 'dashed') {
for (let i = 0; i < 3; i++) {
marker+= `<span style="display:inline-block;border: 2px ${el.color} solid;margin-right:5px;width:10px;height:0px;background-color:#ffffff00;"></span>`
}
} else {
marker = `<span style="display:inline-block;border: 2px ${el.color} ${el.value[3]};margin-right:5px;width:40px;height:0px;background-color:#ffffff00;"></span>`
}
str += `${marker}${el.seriesName.split('(')[0]}${el.value[1] ? el.value[1] + ' ' + (el.value[2] || '') : '-'
}<br>` }<br>`
}) })
return str return str
} }
@@ -590,13 +616,15 @@ const init = (flag: boolean) => {
...(index > 0 ? right : null) ...(index > 0 ? right : null)
}) })
}) })
console.log("🚀 ~ result.forEach ~ result:", result) // console.log("🚀 ~ result.forEach ~ result:", result)
let ABCName = [...new Set(chartsList.map((item: any) => { return item.anotherName == '电压负序分量' ? '电压不平衡' : item.anotherName == '电压正序分量' ? '电压不平衡' : item.anotherName == '电压零序分量' ? '电压不平衡' : item.anotherName }))]; let ABCName = [...new Set(chartsList.map((item: any) => { return item.anotherName == '电压负序分量' ? '电压不平衡' : item.anotherName == '电压正序分量' ? '电压不平衡' : item.anotherName == '电压零序分量' ? '电压不平衡' : item.anotherName }))];
// console.log("🚀 ~ result.forEach ~ result:", result)
result.forEach((item: any, index: any) => { result.forEach((item: any, index: any) => {
let yMethodList: any = [] let yMethodList: any = []
@@ -623,6 +651,10 @@ const init = (flag: boolean) => {
ABCList.forEach((kk: any) => { ABCList.forEach((kk: any) => {
let colorName = kk[0].phase?.charAt(0).toUpperCase() let colorName = kk[0].phase?.charAt(0).toUpperCase()
@@ -632,9 +664,9 @@ const init = (flag: boolean) => {
let seriesList: any = [] let seriesList: any = []
kk.forEach((cc: any) => { kk.forEach((cc: any) => {
if (cc.statisticalData !== null) { if (cc.statisticalData !== null) {
yMethodList.push(cc.statisticalData?.toFixed(2) - 0) yMethodList.push(cc.statisticalData?.toFixed(2))
} }
seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit]) seriesList.push([cc.time, cc.statisticalData?.toFixed(2), cc.unit, lineStyle[lineS].type])
}) })
echartsData.value.options.series.push({ echartsData.value.options.series.push({
name: kk[0].phase name: kk[0].phase
@@ -646,7 +678,7 @@ const init = (flag: boolean) => {
symbol: 'none', symbol: 'none',
lineStyle: lineStyle[lineS], lineStyle: lineStyle[lineS],
data: seriesList, data: seriesList,
yAxisIndex: index yAxisIndex: setList.indexOf(kk[0].unit)
}) })
}) })
@@ -793,6 +825,7 @@ const countData: any = ref([])
const tableHeaderRef = ref() const tableHeaderRef = ref()
//根据选择的指标处理谐波次数 //根据选择的指标处理谐波次数
const formatCountOptions = (list: any) => { const formatCountOptions = (list: any) => {
countData.value = []
if (list.length != 0) { if (list.length != 0) {
list.map((item: any, index: any) => { list.map((item: any, index: any) => {
if (!countData.value[index]) { if (!countData.value[index]) {
@@ -852,7 +885,7 @@ const formatCountOptions = (list: any) => {
const flag = ref(false) const flag = ref(false)
const selectChange = (e: boolean) => { const selectChange = (e: boolean) => {
flag.value = e flag.value = e
console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value) // console.log("🚀 ~ handleChange ~ activeColName.value:", activeColName.value, flag.value)
if (activeColName.value == '0') { if (activeColName.value == '0') {
if (flag.value) { if (flag.value) {
@@ -888,7 +921,11 @@ const handleChange = () => {
watch( watch(
() => searchForm.value.index, () => searchForm.value.index,
(val: any, oldval: any) => { (val: any, oldval: any) => {
if (val) { if (val) {
let list = val let list = val
setTimeout(() => { setTimeout(() => {
formatCountOptions(list) formatCountOptions(list)
@@ -902,6 +939,7 @@ watch(
countData.value.splice(key, 1) countData.value.splice(key, 1)
} }
}) })
init(false) init(false)
} }
}, },

View File

@@ -38,7 +38,7 @@
:show-file-list="false" :auto-upload="false" :on-change="bulkImport"> :show-file-list="false" :auto-upload="false" :on-change="bulkImport">
<el-button type="primary" class="ml10" icon="el-icon-Tickets">批量导入</el-button> <el-button type="primary" class="ml10" icon="el-icon-Tickets">批量导入</el-button>
</el-upload> </el-upload>
<el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">新增设备</el-button> <el-button type="primary" class="ml10" @click="add" icon="el-icon-Plus">设备出厂管理</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref="tableRef"></Table> <Table ref="tableRef"></Table>
@@ -132,7 +132,7 @@ const rules = reactive({
cntractNo: [{ required: true, message: '合同号不能为空', trigger: 'blur' }] cntractNo: [{ required: true, message: '合同号不能为空', trigger: 'blur' }]
}) })
const dialogFormVisible = ref(false) const dialogFormVisible = ref(false)
const dialogTitle = ref('新增设备') const dialogTitle = ref('设备出厂管理')
const loading = ref<boolean>(false) const loading = ref<boolean>(false)
const devModelOptions: any = ref([]) const devModelOptions: any = ref([])
queryByCode('Device_Type').then(res => { queryByCode('Device_Type').then(res => {
@@ -249,7 +249,7 @@ const tableStore = new TableStore({
width: 100, width: 100,
render: 'tag', render: 'tag',
custom: { custom: {
1: 'primary', 1: 'error',
2: 'success', 2: 'success',
// 3: 'primary', // 3: 'primary',
// 4: 'primary', // 4: 'primary',
@@ -270,7 +270,7 @@ const tableStore = new TableStore({
{ {
title: '操作', title: '操作',
align: 'center', align: 'center',
width: '180', width: '220',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
//直连装置注册 //直连装置注册
@@ -567,7 +567,7 @@ const bulkImport = (e: any) => {
// 新增 // 新增
const add = () => { const add = () => {
dialogFormVisible.value = true dialogFormVisible.value = true
dialogTitle.value = '新增设备' dialogTitle.value = '设备出厂管理'
} }
// 确认 // 确认
@@ -577,7 +577,7 @@ const onSubmit = () => {
ruleFormRef.value.validate((valid: any) => { ruleFormRef.value.validate((valid: any) => {
if (valid) { if (valid) {
if (dialogTitle.value == '新增设备') { if (dialogTitle.value == '设备出厂管理') {
addEquipmentDelivery(form).then(res => { addEquipmentDelivery(form).then(res => {
ElMessage.success('新增成功') ElMessage.success('新增成功')
if (devTypeOptions.value.filter((item: any) => item.value == form.devType)[0].code == 'Portable') { if (devTypeOptions.value.filter((item: any) => item.value == form.devType)[0].code == 'Portable') {

View File

@@ -8,11 +8,11 @@
<el-form-item label="编码"> <el-form-item label="编码">
<el-input v-model="form.code" placeholder="请输入编码" /> <el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item> </el-form-item>
<el-form-item label="类型"> <!-- <el-form-item label="类型">
<el-select v-model="form.type" placeholder="请选择类型"> <el-select v-model="form.type" placeholder="请选择类型">
<el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.value" /> <el-option v-for="item in options" :key="item.value" :label="item.name" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注" /> <el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item> </el-form-item>
@@ -49,7 +49,7 @@ const form = reactive({
name: '', name: '',
code: '', code: '',
remark: '', remark: '',
type: 2, // type: 2,
sort: 100, sort: 100,
pid: '', pid: '',
id: '' id: ''

View File

@@ -1,6 +1,6 @@
<template> <template>
<el-dialog class="cn-operate-dialog statistical-type-binding" v-model="dialogVisible" title="绑定指标" <el-dialog class="cn-operate-dialog statistical-type-binding" v-model="dialogVisible" title="绑定指标"
style="width: 1040px" @closed="close"> style="width: 1200px" @closed="close">
<el-scrollbar style="padding-right: 0"> <el-scrollbar style="padding-right: 0">
<div class="box"> <div class="box">
<div class="box-left"> <div class="box-left">
@@ -42,7 +42,14 @@
}" :options="toData"> }" :options="toData">
<template #default="{ node, data }"> <template #default="{ node, data }">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-tooltip placement="bottom" :hide-after="0">
<template #content>
<span>{{ data.label}}</span>
</template>
<div class="hide-txt">{{ data.label }}</div> <div class="hide-txt">{{ data.label }}</div>
</el-tooltip>
<template v-if="node.level === 1"> <template v-if="node.level === 1">
<div class="ml5">({{ data.children.length }})</div> <div class="ml5">({{ data.children.length }})</div>
<div style="flex: 1"></div> <div style="flex: 1"></div>
@@ -337,7 +344,7 @@ const dicDeleteGroup = (data: any) => {
const newGroup = () => { const newGroup = () => {
addRef.value.open('新增菜单', { addRef.value.open('新建分组', {
sort: toData.value.length ? toData.value[toData.value.length - 1].sort + 1 : 1, sort: toData.value.length ? toData.value[toData.value.length - 1].sort + 1 : 1,
code: '', code: '',
pid: pid.value, pid: pid.value,
@@ -348,7 +355,7 @@ const newGroup = () => {
} }
const editGroup = (data: any) => { const editGroup = (data: any) => {
getDictTreeById(data.id).then(res => { getDictTreeById(data.id).then(res => {
addRef.value.open('修改菜单', { addRef.value.open('修改分组', {
sort: res.data.sort || 100, sort: res.data.sort || 100,
code: res.data.code || '', code: res.data.code || '',
pid: res.data.pid || '', pid: res.data.pid || '',
@@ -411,7 +418,7 @@ defineExpose({ open })
.statistical-type-binding { .statistical-type-binding {
.box { .box {
display: flex; display: flex;
width: 1000px; width: 1160px;
height: calc(60vh - 95px); height: calc(60vh - 95px);
margin: 0 auto; margin: 0 auto;
text-align: left; text-align: left;
@@ -429,7 +436,8 @@ defineExpose({ open })
.box-left { .box-left {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
flex: 1; // flex: 1;
width: 450px;
.el-cascader-menu { .el-cascader-menu {
padding-right: 0; padding-right: 0;
@@ -440,16 +448,19 @@ defineExpose({ open })
} }
.el-cascader-panel { .el-cascader-panel {
height: 100%; height: calc(60vh - 140px);
.el-cascader-menu__list { .el-cascader-menu__list {
height: 100% !important; height: 100% !important;
overflow-y: auto !important; overflow-y: auto !important;
padding-bottom: 50px !important; // padding-bottom: 50px !important;
box-sizing: border-box; box-sizing: border-box;
} }
} }
} }
.box-right{
flex: 1;
}
.hide-txt { .hide-txt {
width: 150px; width: 150px;

View File

@@ -1,11 +1,19 @@
<template> <template>
<div class='default-main'> <div class='default-main'>
<TableHeader> <TableHeader :showReset='false'>
<template v-slot:operation> <template v-slot:operation>
<el-button :icon='Plus' type='primary' @click='addMenu'>新增</el-button> <el-button :icon='Plus' type='primary' @click='addMenu'>新增</el-button>
</template> </template>
</TableHeader> </TableHeader>
<el-tabs type="border-card">
<el-tab-pane v-for="item in tabPane" :label="item.name">
<Table ref='tableRef' /> <Table ref='tableRef' />
</el-tab-pane>
</el-tabs>
<PopupBinding ref='bindingRef'></PopupBinding> <PopupBinding ref='bindingRef'></PopupBinding>
<PopupAdd ref='addRef' @over='init'></PopupAdd> <PopupAdd ref='addRef' @over='init'></PopupAdd>
</div> </div>
@@ -24,6 +32,7 @@ import { dicDelete } from '@/api/system-boot/dic'
defineOptions({ defineOptions({
name: 'govern/setting/statisticalType' name: 'govern/setting/statisticalType'
}) })
const tabPane = [{ name: '在线监测' }, { name: '治理' }, { name: '测试' }]
const tableRef = ref() const tableRef = ref()
const bindingRef = ref() const bindingRef = ref()
const addRef = ref() const addRef = ref()
@@ -39,10 +48,13 @@ const tableStore = new TableStore({
url: '/system-boot/dictTree/query', url: '/system-boot/dictTree/query',
method: 'POST', method: 'POST',
paramsPOST: true, paramsPOST: true,
publicHeight: 60,
column: [ column: [
{ title: '序号', width: 80,formatter: (row: any) => { {
title: '序号', width: 80, formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
} }, }
},
{ title: '统计类型', field: 'name' }, { title: '统计类型', field: 'name' },
{ {
title: '类型', field: 'type', title: '类型', field: 'type',