diff --git a/src/api/CVT/index.js b/src/api/CVT/index.js new file mode 100644 index 0000000..d9409fe --- /dev/null +++ b/src/api/CVT/index.js @@ -0,0 +1,49 @@ +import request from '@/utils/request' +// 新增cvt系数 +export function addCVT(data) { + return request({ + url: '/device-boot/cvt/add', + method: 'post', + data: data + }) +} +// 删除cvt系数 +export function deleteById(data) { + return request({ + url: '/device-boot/cvt/deleteById', + method: 'post', + params: data + }) +} +// 分页查询cvt +export function queryPage(data) { + return request({ + url: '/device-boot/cvt/queryPage', + method: 'post', + data + }) +} +// 修改cvt系数 +export function updateCvt(data) { + return request({ + url: '/device-boot/cvt/updateCvt', + method: 'post', + data: data + }) +} +// 新增cvt系数绑定 +export function cvtBind(data) { + return request({ + url: '/device-boot/cvtBind/add', + method: 'post', + data: data + }) +} +// 根据监测点id查询绑定cvt系数 +export function queryByLineId(data) { + return request({ + url: '/device-boot/cvtBind/queryByLineId', + method: 'post', + params: data + }) +} diff --git a/src/views/cgy-components/menuTree/index1.vue b/src/views/cgy-components/menuTree/index1.vue index a8de660..924f934 100644 --- a/src/views/cgy-components/menuTree/index1.vue +++ b/src/views/cgy-components/menuTree/index1.vue @@ -489,6 +489,7 @@ export default { watch: { //当前的树节点 currentNode2(newValue) { + console.log("🚀 ~ currentNode2 ~ newValue:", newValue) this.treeMenuData = newValue if (val) { this.$nextTick(() => { diff --git a/src/views/cgy-harmonic-boot/CVT/components/algorithm.vue b/src/views/cgy-harmonic-boot/CVT/components/algorithm.vue index c0e47cb..5397f2b 100644 --- a/src/views/cgy-harmonic-boot/CVT/components/algorithm.vue +++ b/src/views/cgy-harmonic-boot/CVT/components/algorithm.vue @@ -32,6 +32,7 @@ :show-checkbox="true" :default-expanded-keys="expandID" node-key="id" + :filter-node-method="filterNode" :check-strictly="false" :expand-on-click-node="true" :highlight-current="true" @@ -81,13 +82,13 @@ export default { fiveData: [] } }, + created() {}, - watch: { - filterText(val) { - this.$refs.menuTree.filter(val) - } - }, + methods: { + handleFilter(val) { + this.$refs.menuTree.filter(val) + }, // 点击树节点 treeckeck(data, checked, indeterminate) {}, open() { @@ -195,6 +196,28 @@ export default { console.log(this.time) this.dialogVisible = false + }, + // 过滤树节点 + filterNode(value, data, node) { + if (!value) { + return true + } + let _array = [] //这里使用数组存储 只是为了存储值。 + this.getReturnNode(node, _array, value) + let result = false + _array.forEach(item => { + result = result || item + }) + + return result + }, + getReturnNode(node, _array, value) { + let isPass = node.data && node.data.name && node.data.name.indexOf(value) !== -1 + isPass ? _array.push(isPass) : '' + this.index++ + if (!isPass && node.name != 1 && node.parent) { + this.getReturnNode(node.parent, _array, value) + } } }, mounted() { @@ -207,8 +230,13 @@ export default { }, computed: {}, + watch: { + filterText(val) { + console.log('🚀 ~ filterText ~ val:', val) - watch: {} + this.$refs.menuTree.filter(val) + } + } } diff --git a/src/views/cgy-harmonic-boot/CVT/components/cvt.vue b/src/views/cgy-harmonic-boot/CVT/components/cvt.vue index e5729e1..740b180 100644 --- a/src/views/cgy-harmonic-boot/CVT/components/cvt.vue +++ b/src/views/cgy-harmonic-boot/CVT/components/cvt.vue @@ -1,11 +1,11 @@