diff --git a/src/api/cs-device-boot/EquipmentDelivery.ts b/src/api/cs-device-boot/EquipmentDelivery.ts index 904182f..82cc211 100644 --- a/src/api/cs-device-boot/EquipmentDelivery.ts +++ b/src/api/cs-device-boot/EquipmentDelivery.ts @@ -110,3 +110,11 @@ export function queryDictType(data?: any) { params: data }) } +//根据监测点id获取监测点详情 +export function getById(data?: any) { + return createAxios({ + url: '/cs-device-boot/csline/getById', + method: 'POST', + params: data + }) +} diff --git a/src/api/cs-device-boot/planData.ts b/src/api/cs-device-boot/planData.ts index d373a97..a7183be 100644 --- a/src/api/cs-device-boot/planData.ts +++ b/src/api/cs-device-boot/planData.ts @@ -85,3 +85,11 @@ export function delDevice(data: any) { data }) } +//方案数据-》根据测试项获取暂态事件 +export function getEventByItem(data: any) { + return createAxios({ + url: '/cs-harmonic-boot/data/getEventByItem', + method: 'POST', + params: data + }) +} diff --git a/src/api/user-boot/user.ts b/src/api/user-boot/user.ts index 08ffdc2..629354c 100644 --- a/src/api/user-boot/user.ts +++ b/src/api/user-boot/user.ts @@ -150,3 +150,11 @@ export const getAllUserSimpleList = () => { method: 'GET' }) } + + +export const getSysConfig =()=> { + return request({ + url: "/system-boot/config/getSysConfig", + method: "get", + }); +} \ No newline at end of file diff --git a/src/components/echarts/shushiboxi.vue b/src/components/echarts/shushiboxi.vue index 7207e5e..5e2b694 100644 --- a/src/components/echarts/shushiboxi.vue +++ b/src/components/echarts/shushiboxi.vue @@ -496,6 +496,7 @@ export default { colors.push('#CC0000') break } + if (waveDatas[0].unit === '电压') { if (this.value === 1) { @@ -506,6 +507,8 @@ export default { } else { unit = 'A' } + + //把剩余的DIV先拼接好 for (var step = 1; step < waveDatas.length; step++) { var waveId = 'wave' + step diff --git a/src/components/table/fieldRender/index.vue b/src/components/table/fieldRender/index.vue index 6aefbd5..bb0a2ee 100644 --- a/src/components/table/fieldRender/index.vue +++ b/src/components/table/fieldRender/index.vue @@ -4,13 +4,13 @@ + :model-value="fieldValue.toString()" :loading="row.loading" inline-prompt :active-value="field.activeValue" + :active-text="field.activeText" :inactive-value="field.inactiveValue" :inactive-text="field.inactiveText" />
+ :src="fieldValue.length > 100 ? fieldValue : fullUrl(fieldValue)">
@@ -196,7 +196,7 @@ const handlerCommand = (item: OptButton) => { .el-image { height: 36px; - width: 36px; + // width: 36px; } .table-operate-text { diff --git a/src/components/tree/point.vue b/src/components/tree/point.vue index daf1404..5567621 100644 --- a/src/components/tree/point.vue +++ b/src/components/tree/point.vue @@ -158,9 +158,41 @@ const onMenuCollapse = () => { menuCollapse.value = !menuCollapse.value proxy.eventBus.emit('cnTreeCollapse', menuCollapse) } -const filterNode = (value: string, data: any) => { +const filterNode = (value: string, data: any, node: any) => { if (!value) return true - return data.name.includes(value) + // return data.name.includes(value) + if (data.name) { + + return chooseNode(value, data, node) + } +} + +// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符. +const chooseNode = (value: string, data: any, node: any) => { + + if (data.name.indexOf(value) !== -1) { + return true + } + const level = node.level + // 如果传入的节点本身就是一级节点就不用校验了 + if (level === 1) { + return false + } + // 先取当前节点的父节点 + let parentData = node.parent + // 遍历当前节点的父节点 + let index = 0 + while (index < level - 1) { + // 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤 + if (parentData.data.name.indexOf(value) !== -1) { + return true + } + // 否则的话再往上一层做匹配 + parentData = parentData.parent + index++ + } + // 没匹配到返回false + return false } //治理 const treeRef1 = ref>() diff --git a/src/layouts/admin/components/logo.vue b/src/layouts/admin/components/logo.vue index 172370b..e83e394 100644 --- a/src/layouts/admin/components/logo.vue +++ b/src/layouts/admin/components/logo.vue @@ -1,19 +1,20 @@ diff --git a/src/views/govern/device/planData/components/treeTransfers.vue b/src/views/govern/device/planData/components/treeTransfers.vue index 98b5647..377e238 100644 --- a/src/views/govern/device/planData/components/treeTransfers.vue +++ b/src/views/govern/device/planData/components/treeTransfers.vue @@ -189,9 +189,41 @@ export default { this.$forceUpdate() }, //组件搜索 - filterNode(value, data) { + filterNode(value, data, node) { if (!value) return true - return data.name.indexOf(value) !== -1 + // return data.name.includes(value) + if (data.name) { + + return this.chooseNode(value, data, node) + } + }, + +// 过滤父节点 / 子节点 (如果输入的参数是父节点且能匹配,则返回该节点以及其下的所有子节点;如果参数是子节点,则返回该节点的父节点。name是中文字符,enName是英文字符. + chooseNode(value, data, node) { + + if (data.name.indexOf(value) !== -1) { + return true + } + const level = node.level + // 如果传入的节点本身就是一级节点就不用校验了 + if (level === 1) { + return false + } + // 先取当前节点的父节点 + let parentData = node.parent + // 遍历当前节点的父节点 + let index = 0 + while (index < level - 1) { + // 如果匹配到直接返回,此处name值是中文字符,enName是英文字符。判断匹配中英文过滤 + if (parentData.data.name.indexOf(value) !== -1) { + return true + } + // 否则的话再往上一层做匹配 + parentData = parentData.parent + index++ + } + // 没匹配到返回false + return false } } } diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index a75e213..f375f23 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -102,8 +102,8 @@
- - + +
@@ -117,6 +117,17 @@ :label="item.name" :value="item.id"> + + + + + + + + @@ -124,12 +135,8 @@ :value="item.id"> - - - - - - + + @@ -162,8 +169,8 @@
- - 暂态数据 + + @@ -192,12 +199,15 @@ import { color, gradeColor3 } from '@/components/echarts/color' import TableHeader from '@/components/table/header/index.vue' import { useConfig } from '@/stores/config' import { getDeviceList } from '@/api/cs-device-boot/planData' +import transient from './components/transient.vue' const dictData = useDictData() defineOptions({ // name: 'govern/device/planData/index' }) +const childTab = ref('0') const num = ref(0) const config = useConfig() +const transientRef = ref() color[0] = config.layout.elementUiPrimary[0] //电压等级 const voltageLevelList = dictData.getBasicData('Dev_Voltage_Stand') @@ -249,6 +259,41 @@ queryByCode('portable-harmonic').then(res => { }) queryStatistical(res.data.id).then(vv => { legendDictList.value = vv.data + indexOptions.value.map((item: any, index: any) => { + if (!countDataCopy.value[index]) { + countDataCopy.value[index] = { + index: item.id, + countOptions: [], + count: [], + name: indexOptions.value.find((vv: any) => { + return vv.id == item.id + })?.name + } + } + legendDictList.value?.selectedList?.map((vv: any, vvs: any) => { + //查找相等的指标 + if (item.id == vv.dataType) { + vv.eleEpdPqdVOS.map((kk: any, kks: any) => { + if (kk.harmStart && kk.harmEnd) { + range(0, 0, 0) + + if (kk.showName == '间谐波电压含有率') { + countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map( + (item: any) => { + return item - 0.5 + } + ) + } else { + countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1) + } + if (!countDataCopy.value[index].count || countDataCopy.value[index].count.length == 0) { + countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0] + } + } + }) + } + }) + }) }) }) const activeName: any = ref() @@ -284,21 +329,23 @@ const nodeClick = async (e: anyObj) => { if (res.data.records.length == 1) { activeName.value = res.data.records[0].id } else { - res.data.records.map((item: any, index: any) => { - //多层 + + for (const item of res.data.records) { if (item.id == e.id) { - activeName.value = item.id - return - } else { - activeName.value = res.data.records[0].id - return + activeName.value = item.id; + break; // 找到匹配项后停止遍历 } - }) + } + // 如果没有找到匹配项,默认设置为第一个元素的id + if (activeName.value !== e.id) { // 假设e.id是一个用于比较的初始值,表示未找到匹配项 + activeName.value = res.data.records[0].id; + } } + // if (searchForm.value.index.length == 0) { // searchForm.value.index = [indexOptions.value[0].id] // } - + schemeTreeRef.value.getPlanData(deviceData.value) await setTimeout(() => { loading.value = true @@ -307,6 +354,7 @@ const nodeClick = async (e: anyObj) => { } else { init(false) } + transientRef.value && transientRef.value.init() }, 100) loading.value = false @@ -326,6 +374,8 @@ const onIndexChange = (val: any) => { } }) searchForm.value.index = pp + formatCountOptions() + // if (val.length == 0) { // searchForm.value.index = [indexOptions.value[0].id] // } @@ -402,7 +452,7 @@ const init = (flag: boolean) => { //选择的指标使用方法处理 - formatCountOptions(searchForm.value.index) + formatCountOptions() //查询历史趋势 historyDataList.value = [] let middleTitle = '' @@ -822,46 +872,61 @@ const handleExport = async () => { return } const countData: any = ref([]) +const countDataCopy: any = ref([]) const tableHeaderRef = ref() -//根据选择的指标处理谐波次数 -const formatCountOptions = (list: any) => { - countData.value = [] - if (list.length != 0) { - list.map((item: any, index: any) => { - if (!countData.value[index]) { - countData.value[index] = { - index: item, - countOptions: [], - count: [], - name: indexOptions.value.find((vv: any) => { - return vv.id == item - })?.name - } - } - legendDictList.value?.selectedList?.map((vv: any, vvs: any) => { - //查找相等的指标 - if (item == vv.dataType) { - vv.eleEpdPqdVOS.map((kk: any, kks: any) => { - if (kk.harmStart && kk.harmEnd) { - range(0, 0, 0) - if (kk.showName == '间谐波电压含有率') { - countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map( - (item: any) => { - return item - 0.5 - } - ) - } else { - countData.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1) - } - if (!countData.value[index].count || countData.value[index].count.length == 0) { - countData.value[index].count = countData.value[index].countOptions[0] - } - } - }) +//根据选择的指标处理谐波次数 +const formatCountOptions = () => { + + countData.value = [] + console.log(123, indexOptions.value); + + if (searchForm.value.index.length != 0) { + searchForm.value.index.forEach((item: any, index: any) => { + countDataCopy.value.forEach((vv: any, vvs: any) => { + if (vv.index == item) { + countData.value.push(vv) } }) + }) + // indexOptions.value.map((item: any, index: any) => { + // if (!countDataCopy.value[index]) { + // countDataCopy.value[index] = { + // index: item.id, + // countOptions: [], + // count: [], + // name: indexOptions.value.find((vv: any) => { + // return vv.id == item.id + // })?.name + // } + // } + // legendDictList.value?.selectedList?.map((vv: any, vvs: any) => { + // //查找相等的指标 + // if (item.id == vv.dataType) { + // vv.eleEpdPqdVOS.map((kk: any, kks: any) => { + // if (kk.harmStart && kk.harmEnd) { + // range(0, 0, 0) + + // if (kk.showName == '间谐波电压含有率') { + // countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1).map( + // (item: any) => { + // return item - 0.5 + // } + // ) + // } else { + // countDataCopy.value[index].countOptions = range(kk.harmStart, kk.harmEnd, 1) + // } + // if (!countDataCopy.value[index].count || countDataCopy.value[index].count.length == 0) { + // countDataCopy.value[index].count = countDataCopy.value[index].countOptions[0] + // } + // } + // }) + // } + // }) + // }) + console.log("🚀 ~ vv.eleEpdPqdVOS.map ~ countData.value:", countDataCopy.value) + countData.value.map((item: any, key: any) => { if (item.name.includes('谐波电流有效值')) { item.name = '谐波电流次数' @@ -922,26 +987,24 @@ watch( () => searchForm.value.index, (val: any, oldval: any) => { - if (val) { + // if (val) { + // let list = val + // setTimeout(() => { + // formatCountOptions(list) + // }, 100) + // countData.value.map((item: any, key: any) => { + // if ( + // list.findIndex((vv: any) => { + // return vv == item.index + // }) == -1 + // ) { + // countData.value.splice(key, 1) + // } + // }) - - let list = val - setTimeout(() => { - formatCountOptions(list) - }, 100) - countData.value.map((item: any, key: any) => { - if ( - list.findIndex((vv: any) => { - return vv == item.index - }) == -1 - ) { - countData.value.splice(key, 1) - } - }) - - init(false) - } + // init(false) + // } }, { deep: true, @@ -949,6 +1012,7 @@ watch( } ) onMounted(() => { + setTimeout(() => { init(true) }, 1500) diff --git a/src/views/govern/manage/engineering.vue b/src/views/govern/manage/engineering.vue index 5051097..76d33d4 100644 --- a/src/views/govern/manage/engineering.vue +++ b/src/views/govern/manage/engineering.vue @@ -64,8 +64,23 @@ const deletes = (row: any) => { ElMessageBox.prompt('二次校验密码确认', '·', { confirmButtonText: '确认', cancelButtonText: '取消', - customClass: 'customInput', - inputType: 'text' + customClass: 'customInput', + inputType: 'text', + beforeClose: (action, instance, done) => { + + if (action === 'confirm') { + if (instance.inputValue == null) { + return ElMessage.warning('请输入密码') + } else if (instance.inputValue?.length > 32) { + return ElMessage.warning('密码长度不能超过32位,当前密码长度为' + instance.inputValue.length) + } else { + done(); + } + + } else { + done(); + } + } }).then(({ value }) => { passwordConfirm(value).then(res => { auditEngineering({ diff --git a/src/views/govern/manage/factory.vue b/src/views/govern/manage/factory.vue index 82b15d2..eb4219e 100644 --- a/src/views/govern/manage/factory.vue +++ b/src/views/govern/manage/factory.vue @@ -47,11 +47,11 @@ :before-close="resetForm" draggable width="800px"> - - @@ -72,6 +72,9 @@ + + + @@ -41,14 +42,14 @@ const options = ref([ { name: 'APF模块', value: 3 }, { name: '星型接线', value: 4 }, { name: '角型接线', value: 5 }, - { name: 'v型接线', value: 6 }, + { name: 'V型接线', value: 6 }, ]) const tableStore = new TableStore({ showPage: false, url: '/system-boot/dictTree/query', method: 'POST', paramsPOST: true, - publicHeight: 60, + // publicHeight: 60, column: [ { title: '序号', width: 80, formatter: (row: any) => { @@ -141,7 +142,7 @@ onMounted(() => { const addMenu = () => { console.log(bindingRef) - addRef.value.open('新增菜单', { + addRef.value.open('新增', { sort: tableStore.table.data.length ? tableStore.table.data[tableStore.table.data.length - 1].sort + 1 : 1, code: '', pid: '', diff --git a/src/views/system/subject/form/index.vue b/src/views/system/subject/form/index.vue index 58f1b8e..d89e3a4 100644 --- a/src/views/system/subject/form/index.vue +++ b/src/views/system/subject/form/index.vue @@ -105,7 +105,7 @@ import { addTheme, updateTheme } from '@/api/system/subject/index' const emit = defineEmits(['Cancels']) const configStore = ref({ // 后台主页面切换动画,可选值 - mainAnimation: 'slide-right', + mainAnimation: 'el-fade-in', elementUiPrimary: ['#0e8780', '#0e8780'], tableHeaderBackground: ['#F3F6F9', '#F3F6F9'], tableHeaderColor: ['#111', '#fff'], diff --git a/src/views/system/subject/index.vue b/src/views/system/subject/index.vue index a5c775c..3280e9f 100644 --- a/src/views/system/subject/index.vue +++ b/src/views/system/subject/index.vue @@ -41,7 +41,7 @@ const tableStore: any = new TableStore({ }, { field: 'name', title: '主题名称' }, { field: 'remark', title: '描述' }, - // { field: 'logoUrl', title: '主题图标', render: 'image' }, + { field: 'logoUrl', title: '主题图标', render: 'image' }, { title: '操作', diff --git a/src/views/user/login.vue b/src/views/user/login.vue index 3ec1167..5b50195 100644 --- a/src/views/user/login.vue +++ b/src/views/user/login.vue @@ -7,29 +7,47 @@