Browse Source

修改点位表

chuwu 5 years ago
parent
commit
77cd92a644

+ 75 - 75
package.json

@@ -1,76 +1,76 @@
 {
-  "name": "sagacloud-admin",
-  "version": "1.0.0",
-  "description": "A Vue.js project",
-  "author": "yaoll <yaolinlin@sagacloud.cn>",
-  "private": true,
-  "scripts": {
-    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
-    "start": "npm run dev",
-    "build": "node build/build.js"
-  },
-  "dependencies": {
-    "axios": "^0.18.0",
-    "echarts": "^4.1.0",
-    "element-ui": "^2.6.1",
-    "font-awesome": "^4.7.0",
-    "handsontable-pro": "^6.2.3",
-    "jquery": "^3.3.1",
-    "vue": "^2.5.2",
-    "vue-axios": "^2.1.4",
-    "vue-router": "^3.0.1",
-    "vuex": "^3.1.0"
-  },
-  "devDependencies": {
-    "ajv": "^6.9.1",
-    "autoprefixer": "^7.1.2",
-    "babel-core": "^6.22.1",
-    "babel-helper-vue-jsx-merge-props": "^2.0.3",
-    "babel-loader": "^7.1.1",
-    "babel-plugin-syntax-jsx": "^6.18.0",
-    "babel-plugin-transform-runtime": "^6.22.0",
-    "babel-plugin-transform-vue-jsx": "^3.5.0",
-    "babel-preset-env": "^1.3.2",
-    "babel-preset-stage-2": "^6.22.0",
-    "chalk": "^2.0.1",
-    "copy-webpack-plugin": "^4.0.1",
-    "css-loader": "^0.28.0",
-    "extract-text-webpack-plugin": "^3.0.0",
-    "file-loader": "^1.1.4",
-    "friendly-errors-webpack-plugin": "^1.6.1",
-    "html-webpack-plugin": "^2.30.1",
-    "less": "^3.9.0",
-    "less-loader": "^4.1.0",
-    "node-notifier": "^5.1.2",
-    "node-sass": "^4.11.0",
-    "optimize-css-assets-webpack-plugin": "^3.2.0",
-    "ora": "^1.2.0",
-    "portfinder": "^1.0.13",
-    "postcss-import": "^11.0.0",
-    "postcss-loader": "^2.0.8",
-    "postcss-url": "^7.2.1",
-    "rimraf": "^2.6.0",
-    "sass-loader": "^7.1.0",
-    "semver": "^5.3.0",
-    "shelljs": "^0.7.6",
-    "swiper": "^4.0.0",
-    "uglifyjs-webpack-plugin": "^1.1.1",
-    "url-loader": "^0.5.8",
-    "vue-loader": "^13.3.0",
-    "vue-style-loader": "^3.0.1",
-    "vue-template-compiler": "^2.5.2",
-    "webpack": "^3.6.0",
-    "webpack-bundle-analyzer": "^2.9.0",
-    "webpack-dev-server": "^2.9.1",
-    "webpack-merge": "^4.1.0"
-  },
-  "engines": {
-    "node": ">= 6.0.0",
-    "npm": ">= 3.0.0"
-  },
-  "browserslist": [
-    "> 1%",
-    "last 2 versions",
-    "not ie <= 8"
-  ]
-}
+    "name": "sagacloud-admin",
+    "version": "1.0.0",
+    "description": "A Vue.js project",
+    "author": "yaoll <yaolinlin@sagacloud.cn>",
+    "private": true,
+    "scripts": {
+        "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
+        "start": "npm run dev",
+        "build": "node build/build.js"
+    },
+    "dependencies": {
+        "axios": "^0.18.0",
+        "echarts": "^4.1.0",
+        "element-ui": "^2.6.1",
+        "font-awesome": "^4.7.0",
+        "handsontable-pro": "^3.0.0",
+        "jquery": "^3.3.1",
+        "vue": "^2.5.2",
+        "vue-axios": "^2.1.4",
+        "vue-router": "^3.0.1",
+        "vuex": "^3.1.0"
+    },
+    "devDependencies": {
+        "ajv": "^6.9.1",
+        "autoprefixer": "^7.1.2",
+        "babel-core": "^6.22.1",
+        "babel-helper-vue-jsx-merge-props": "^2.0.3",
+        "babel-loader": "^7.1.1",
+        "babel-plugin-syntax-jsx": "^6.18.0",
+        "babel-plugin-transform-runtime": "^6.22.0",
+        "babel-plugin-transform-vue-jsx": "^3.5.0",
+        "babel-preset-env": "^1.3.2",
+        "babel-preset-stage-2": "^6.22.0",
+        "chalk": "^2.0.1",
+        "copy-webpack-plugin": "^4.0.1",
+        "css-loader": "^0.28.0",
+        "extract-text-webpack-plugin": "^3.0.0",
+        "file-loader": "^1.1.4",
+        "friendly-errors-webpack-plugin": "^1.6.1",
+        "html-webpack-plugin": "^2.30.1",
+        "less": "^3.9.0",
+        "less-loader": "^4.1.0",
+        "node-notifier": "^5.1.2",
+        "node-sass": "^4.11.0",
+        "optimize-css-assets-webpack-plugin": "^3.2.0",
+        "ora": "^1.2.0",
+        "portfinder": "^1.0.13",
+        "postcss-import": "^11.0.0",
+        "postcss-loader": "^2.0.8",
+        "postcss-url": "^7.2.1",
+        "rimraf": "^2.6.0",
+        "sass-loader": "^7.1.0",
+        "semver": "^5.3.0",
+        "shelljs": "^0.7.6",
+        "swiper": "^4.0.0",
+        "uglifyjs-webpack-plugin": "^1.1.1",
+        "url-loader": "^0.5.8",
+        "vue-loader": "^13.3.0",
+        "vue-style-loader": "^3.0.1",
+        "vue-template-compiler": "^2.5.2",
+        "webpack": "^3.6.0",
+        "webpack-bundle-analyzer": "^2.9.0",
+        "webpack-dev-server": "^2.9.1",
+        "webpack-merge": "^4.1.0"
+    },
+    "engines": {
+        "node": ">= 6.0.0",
+        "npm": ">= 3.0.0"
+    },
+    "browserslist": [
+        "> 1%",
+        "last 2 versions",
+        "not ie <= 8"
+    ]
+}

+ 37 - 18
src/components/common/handsontable.vue

@@ -12,6 +12,10 @@
     import Handsontable from "handsontable-pro"
     import 'handsontable-pro/dist/handsontable.full.css'
     import zhCN from 'handsontable-pro/languages/zh-CN';
+    import tools from '@/utils/scan/tools'
+    import "@/assets/js/chosen.jquery.min";
+    import "@/assets/js/handsontable-chosen-editor";
+    import '@/assets/css/chosen.css'
     export default {
         props: {
             id: {
@@ -27,7 +31,9 @@
         data() {
             return {
                 hot: null,
-                filtersArr: []
+                filtersArr: [],
+                data: [],
+                deepArr: [], //删除存储数组
             }
         },
         created() {},
@@ -42,9 +48,9 @@
                     height: document.getElementById(this.id).parentNode.clientHeight
                 }
             },
-            afterDocumentKeyDown(e) {
-                this.$emit("keyDown", e)
-            },
+            // afterDocumentKeyDown(e) {
+            //     this.$emit("keyDown", e)
+            // },
             trimmedRows() {
                 var plugin = this.hot.getPlugin("trimRows").trimmedRows;
                 let dataLength = this.hot.getSourceData().length;
@@ -73,13 +79,14 @@
                 return a;
             },
             //右键删除
-            romoveFm(index, amout) {
-                console.log(index, amout)
-                this.$emit("delete", index, amout)
+            removeFm(index, amout) {
+                let delData = tools.differenceArr(this.data, this.deepArr)
+                console.log(delData,this.data, this.deepArr,'delData')
+                this.$emit("delete", delData)
             },
             //数据发生修改后(失焦)
             tdChange(changeData, source) {
-                this.$emit("change",changeData,source)
+                this.$emit("change", changeData, source)
             },
             /**
              * 获取被排序后的数组
@@ -148,6 +155,8 @@
             },
             init(settings) {
                 var hotElement = document.getElementById(this.id)
+                this.data = settings.data
+                this.deepArr = this.deepCopy(settings.data)
                 var hotSettings = Object.assign({
                     width: this.getElement().width,
                     rowHeaders: true,
@@ -167,26 +176,25 @@
                     ],
                     afterOnCellMouseDown: this.tableDown, //鼠标单击
                     afterChange: this.tdChange, //修改后
-                    afterRemoveRow: this.romoveFm, //右键删除
+                    afterRemoveRow: this.removeFm, //右键删除
                     afterFilter: this.trimmedRows, //排序
-                    afterDocumentKeyDown: this.afterDocumentKeyDown, //鼠标单击
+                    // afterDocumentKeyDown: this.afterDocumentKeyDown, //鼠标单击
                 }, settings);
-                console.log(hotSettings, settings,this.hot,'hot')
-                if(!!this.hot){
+                hotSettings.maxRows = settings.maxRows
+                console.log(hotSettings, settings, this.hot, 'hot')
+                if (!!this.hot && this.hot.hasOwnProperty('destroy')) {
                     this.hot.destroy();
                     this.hot = null
                 }
                 this.hot = new Handsontable(hotElement, hotSettings);
                 console.log(this.hot)
                 // this.hot.view.wt.update('onCellDblClick', (row,cell) => { 
-
                 //     //Get editor and begin edit mode on current cell (maintain current double click functionality) 
                 //     var activeEditor = this.hot.getActiveEditor(); 
                 //     console.log(this.hot,activeEditor)
                 //     activeEditor.beginEditing(); 
                 //     this.onDblClick(activeEditor,row,cell)
                 //     //Do whatever you want... 
-
                 // }); 
                 let pro = document.getElementById("hot-display-license-info");
                 if (!!pro) {
@@ -194,7 +202,6 @@
                 }
                 return this.hot
             },
-
             //双击
             // onDblClick(activeEditor,row,cell){
             //     console.log(111,activeEditor,row,cell)
@@ -230,14 +237,26 @@
                     this.getInfors(infos, rowArr);
                 }
             },
-            getInfors(obj,row){
-                this.$emit("mouseDown",obj,row)
+            getInfors(obj, row) {
+                this.$emit("mouseDown", obj, row)
+            },
+            //工具函数浅复制深拷贝,防止共用存储空间
+            deepCopy(obj) {
+                var out = [],
+                    i = 0,
+                    len = obj.length;
+                for (; i < len; i++) {
+                    if (obj[i] instanceof Array) {
+                        out[i] = this.deepcopy(obj[i]);
+                    } else out[i] = obj[i];
+                }
+                return out;
             }
         }
     }
 </script>
 <style lang="scss">
-    .htDropdownMenu:not(.htGhostTable){
+    .htDropdownMenu:not(.htGhostTable) {
         z-index: 4060;
     }
 </style>

+ 25 - 16
src/components/common/jsmind.vue

@@ -33,35 +33,44 @@
         },
         methods: {
             initData(options, data) {
-                let option = Object.assign({
-                        container: this.id,
-                        editable: true,
-                        theme: 'orange'
-                    }, options),
-                    el = {
+                let el = {
                         container: this.id,
                         editable: true, //是否启用编辑
                         theme: "greensea", //主题
                         mode: "side", //显示模式
                         support_html: true //是否支持节点里的HTML元素
-                    };
+                    },
+                    option = Object.assign({
+                        container: this.id,
+                        editable: true,
+                        theme: 'orange'
+                    }, options);
                 this.jm = new jsMind(el)
                 this.jm.show(data)
                 console.log(this.jm)
-                this.jm.view.container.addEventListener('click',this.click)
+                this.jm.view.container.addEventListener('click', this.click)
+                this.jm.view.container.addEventListener('mouseover', this.hoverElement)
                 return this.jm
             },
-            click(e){
-                let event = e || window.event,target = event.target || event.srcEvent,val = target.innerHTML;
-                console.log(event,target,target)
-                if(target.nodeName == "JMEXPANDER"){
+            hoverElement(e) {
+                console.log()
+                let nodeid = e.target.getAttribute('nodeid')
+                if (!!nodeid) {
+                    e.target.setAttribute('title', e.target.innerHTML)
+                }
+            },
+            click(e) {
+                let event = e || window.event,
+                    target = event.target || event.srcEvent,
+                    val = target.innerHTML;
+                console.log(event, target, target)
+                if (target.nodeName == "JMEXPANDER") {
                     console.log(target.innerHTML)
                     //-为展开
-                    if(val == "-"){
+                    if (val == "-") {
                         console.log(this.jm.get_node(target.getAttribute("nodeid")))
-                        this.$emit("openNode",this.jm.get_node(target.getAttribute("nodeid")))
-                    }else{
-
+                        this.$emit("openNode", this.jm.get_node(target.getAttribute("nodeid")))
+                    } else {
                     }
                 }
             }

+ 1 - 1
src/components/config_point/data_origin.vue

@@ -8,7 +8,7 @@
             </div>
         </div>
         <div class="doughnut-view">
-            <doughnut v-if="renderData.Sum" width="200" height="200" :renderData="echartsData" :id="id"></doughnut>
+            <doughnut v-if="renderData.Sum" width="200" height="200" :name="renderData.Name" :renderData="echartsData" :id="id"></doughnut>
             <div v-else class="center">暂无数据</div>
         </div>
         <slot></slot>

+ 1 - 5
src/components/config_point/examine_main.vue

@@ -56,7 +56,7 @@
                 inputValue: "",
                 header: ['原始点位描述', '值/单位说明', '*识别的设备类型关键字', '*识别的设备参数关键字'],
                 type: [{
-                        data: 'RoutingKey',
+                        data: 'Description',
                         readOnly: true
                     },
                     {
@@ -145,10 +145,6 @@
                 console.log(param.data)
                 queryPoint(param, res => {
                     this.hotData = res.Content
-                    console.log(res)
-                    if (!!this.hot) {
-                        this.hot.destroy()
-                    }
                     settings = {
                         data: this.hotData,
                         colHeaders: this.header,

+ 19 - 12
src/components/config_point/find_keyword.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="view-find-word">
         <div class="saga-border">
-            <p class="center">请从下面的原始点位描述中选择"{{title != 'type' ? "设备类型" : "设备参数"}}"关键字</p>
+            <p class="center">请从下面的原始点位描述中选择"{{type == 'type' ? "设备类型" : "设备参数"}}"关键字</p>
             <div class="h10"></div>
             <div>
                 <cut-string v-if="!!Description" :string="Description" ref="cutString"></cut-string>
@@ -17,7 +17,7 @@
         <div class="h10"></div>
         <div class="find-data">
             <div class="left-view saga-border">
-                <doughnut v-if="!!sum" type="left" width="200" height="200" :renderData="echartsData"></doughnut>
+                <doughnut v-if="!!sum" type="left" :name="dataName" width="200" height="200" :renderData="echartsData"></doughnut>
                 <div v-else class="center">暂无数据</div>
             </div>
             <div class="right-view saga-border">
@@ -49,7 +49,8 @@
         setParamTer,
         setTypeTer,
         delParamTer,
-        delTypeTer
+        delTypeTer,
+        updatePoint
     } from "@/fetch/point_http"
     import {
         mapGetters,
@@ -88,7 +89,8 @@
                     cancel: "取消",
                     confirm: "确定"
                 },
-                Id: ""
+                Id: "",
+                dataName: ""
             }
         },
         created() {},
@@ -217,17 +219,18 @@
                     }
                 }, res => {
                     let data = res.Content[0]
+                    this.dataName = res.Content[0].Name
                     this.echartsData = [{
-                            name: "无法识别-" + data.Ignorestandard,
-                            value: data.Ignorestandard
+                            name: "无法识别-" + (this.type != 'type' ? data.Equipmentparameterignorestandard : data.Equipmenttypeignorestandard),
+                            value: (this.type != 'type' ? data.Equipmentparameterignorestandard : data.Equipmenttypeignorestandard)
                         },
                         {
-                            name: "未识别-" + data.Notstandard,
-                            value: data.Notstandard
+                            name: "未识别-" + (this.type != 'type' ? data.Equipmentparameternotstandard : data.Equipmenttypenotstandard),
+                            value: (this.type != 'type' ? data.Equipmentparameternotstandard : data.Equipmenttypenotstandard)
                         },
                         {
-                            name: "已识别-" + data.Notrelated,
-                            value: data.Notrelated
+                            name: "已识别-" + (this.type != 'type' ? data.Equipmentparameterstandard : data.Equipmenttypestandard),
+                            value: (this.type != 'type' ? data.Equipmentparameterstandard : data.Equipmenttypestandard)
                         }
                     ]
                     this.sum = data.Sum
@@ -260,13 +263,17 @@
                         Content: [
                             {
                                 Id: this.Id,
-
+                                [this.type == 'type' ? 'IgnoreKeyEquipmentType' : 'IgnoreKeyEquipmentParameter']: true
                             }
                         ]
                     },
                     type: this.protocolType
                 }
-                updatePoint()
+                updatePoint(param,res => {
+                    console.log(res)
+                    this.$message.success("设置无法识别成功")
+                    this.changeType()
+                })
             }
         },
         watch:{

+ 12 - 6
src/components/config_point/location_flag.vue

@@ -1,12 +1,12 @@
 <template>
     <div class="localtion-falg">
         <div class="select-flag dcenter">
-            <el-tag class="localtion-tag" @close="delTags(item)" :key="item" color="#FFF6E7" type="warning" size="small" v-for="item in localtionArr" closable>{{item}}</el-tag>
+            <el-tag class="localtion-tag" @close="delTags(item)" :key="index" color="#FFF6E7" type="warning" size="small" v-for="(item,index) in localtionArr" closable>{{item}}</el-tag>
         </div>
         <div class="localtion-do-point dcenter pointer">更多可用标签</div>
         <div class="localtion-view">
             <div class="location-tag-view">
-                <el-tag @click="addToActive(item.Name)" :key="item.Name" class="default-tag pointer" v-for="item in queryLocaltionArr" size="small" color="#fff">{{item.Name}}</el-tag>
+                <el-tag @click="addToActive(item.Name)" :key="index" class="default-tag pointer" v-for="(item,index) in queryLocaltionArr" size="small" color="#fff">{{item.Name}}</el-tag>
             </div>
         </div>
         <div class="center">
@@ -77,8 +77,8 @@
                 this.changeTags()
             },
             changeTags(){
-                this.renderData.LocationFlag = this.localtionArr
-                this.$emit("changeTag")
+                // this.renderData.LocationFlag = this.localtionArr
+                this.$emit("changeTag",this.localtionArr)
             },
             queryData(){
                 queryLocaltionFlag({},res => {
@@ -89,7 +89,11 @@
             //添加位置标签
             addLocaltion(){
                 let param = {
-                    Name: this.localtionName
+                    Name: this.localtionName.trim()
+                }
+                if(!param.Name){
+                    this.$message("请确定输入字符不为空")
+                    return false
                 }
                 addLocaltionFlag(param,res => {
                     this.queryData()
@@ -98,7 +102,9 @@
                 })
             },
             changeData(){
-                this.localtionArr = this.renderData.LocationFlag || []
+                this.localtionArr = this.renderData.LocationFlag ? this.renderData.LocationFlag.map(item => {
+                    return item
+                }) : []
             }
         },
         watch: {

+ 44 - 21
src/components/config_point/select_one.vue

@@ -10,11 +10,12 @@
         <p>{{name}}</p>
         <ul v-if="renderData.length">
             <li v-for="(item,index) in renderData" :key="index">
-                <div @click="checkItem(item,index)"  :class="index == active ? 'saga-active-select': ''" class="select-item border-bottom pointer">
+                <div @click="checkItem(item,index)" :class="index == active ? 'saga-active-select': ''" class="select-item border-bottom pointer">
                     <span v-if="isSelected" :class="{'is-checked': item[isCheckInfo]}" class="el-checkbox__input">
-                        <span class="el-checkbox__inner"></span>
+                            <span class="el-checkbox__inner"></span>
                     </span>
-                    {{item[infosKey]}}
+                    {{overString(item[infosKey])}}
+                    <i v-if="isDel" @click.stop="delItem(item)" class="el-icon-error saga-delete pointer"></i>
                 </div>
             </li>
         </ul>
@@ -30,7 +31,7 @@
             name: {
                 default: "原始点位描述"
             },
-            isSelected:{
+            isSelected: {
                 default: false
             },
             isCheckInfo: {
@@ -38,12 +39,14 @@
             },
             renderData: {
                 default: function() {
-                    return [
-                    ]
+                    return []
                 }
             },
             infosKey: {
                 default: "name"
+            },
+            isDel: {
+                default: false
             }
         },
         data() {
@@ -54,18 +57,28 @@
         created() {},
         mounted() {},
         methods: {
-            checkItem(item,index){
-                this.$emit("check",item)
+            checkItem(item, index) {
+                this.$emit("check", item)
                 this.active = index
             },
-            change(){
-                this.$emit("check",this.renderData[this.active])
+            delItem(item){
+                this.$emit('deleteItem',item)
+            },
+            change() {
+                this.$emit("check", this.renderData[this.active])
+            },
+            overString(val) {
+                if (val.length > 13) {
+                    return val.substring(0, 13) + '...'
+                } else {
+                    return val
+                }
             }
         },
         watch: {
             renderData: {
                 deep: true,
-                handler: function (){
+                handler: function() {
                     this.change()
                     //do something
                     console.log("change")
@@ -75,39 +88,49 @@
     }
 </script>
 <style lang="scss" scoped>
-.saga-active-select{
-    background-color: #9FC5F8;
-}
+    .saga-active-select {
+        background-color: #9FC5F8;
+    }
     .select-own-one {
         display: inline-block;
         height: 340px;
         width: 230px;
         overflow: hidden;
-        p{
+        p {
             line-height: 40px;
             height: 40px;
         }
-        ul{
+        ul {
             height: 300px;
             max-height: 300px;
             overflow-y: auto;
-            li{
+            li {
                 // padding-left: 10px;
                 box-sizing: border-box;
-                div{
+                div {
                     padding-left: 10px;
                 }
             }
         }
     }
-    .border-bottom{
+    .border-bottom {
         border-bottom: 1px solid #ccc;
     }
-    .select-item{
+    .select-item {
         height: 30px;
         line-height: 30px;
     }
-    .select-item:hover{
+    .saga-delete {
+        display: none;
+        float:right;
+        line-height: 31px;
+        padding-right: 10px;
+        box-sizing: border-box;
+    }
+    .select-item:hover {
         background-color: #9FC5F8;
+        .saga-delete {
+            display: inline;
+        }
     }
 </style>

+ 5 - 1
src/components/config_point/step3_point/3_identify.vue

@@ -94,6 +94,7 @@ export default {
                 ],
                 maxRows: allData.length,
             }
+            console.log(allData)
             if(this.protocolType == 'knx'){
                 data.colHeaders.splice(2,0,'原始点位地址')
                 data.columns.splice(2,0,{
@@ -109,7 +110,10 @@ export default {
                 })
             }
             this.$nextTick(_ => {
-                this.hotArr[this.activeName-1] = this.$refs.handsontable[this.activeName-1].init(data) 
+                console.log(this.activeName-1)
+                this.$nextTick( _ => {
+                    this.hotArr[this.activeName-1] = this.$refs.handsontable[this.activeName-1].init(data) 
+                })
             })            
         }
     },

+ 52 - 37
src/components/config_point/step3_point/3_temps.vue

@@ -5,7 +5,7 @@
             <el-step title="步骤2" description="确定值得处理方式"></el-step>
             <el-step title="步骤3" description="确认并维护涉及到得原始点位对应得设备标识"></el-step>
         </el-steps>
-        <div class="collapse-item" v-show="activeName == 0">
+        <div class="collapse-item" v-if="activeName == 0">
             <el-form class="form" :rules="rules" ref="form" :model="form1" label-width="120px">
                 <el-form-item label="对应数据字典" prop="dict" :rules="[{ required: true, message: '请输入对应数据字典', trigger: 'change' },{ validator: validateDict, trigger: ['blur', 'change'] }]">
                     <el-cascader style="width: 100%;" :options="options" v-model="form1.dict" @change="handleChange" :props="props" filterable @active-item-change="handleItemChange"></el-cascader>
@@ -25,7 +25,7 @@
                 <el-button @click="next">下一步</el-button>
             </div>
         </div>
-        <div class="collapse-item" v-show="activeName == 1">
+        <div class="collapse-item" v-if="activeName == 1">
             <div class="flex-around">
                 <div class="point-despoint">
                     <p>原始点位说明</p>
@@ -54,7 +54,7 @@
                 <el-button @click="next">下一步</el-button>
             </div>
         </div>
-        <div class="collapse-item" v-show="activeName == 2">
+        <div class="collapse-item" v-if="activeName == 2">
             <div style="height:150px;">
                 <handsontable-component ref="handsontable"></handsontable-component>
             </div>
@@ -139,7 +139,7 @@
                         value: '需按拆分枚举转换'
                     }
                 ],
-                dealType: {},//处理方式
+                dealType: {}, //处理方式
                 form2: {
                     ValueDescription: '',
                     DataRuleType: '无需处理,直接使用'
@@ -168,6 +168,15 @@
         },
         methods: {
             getMain(param) {
+                this.activeName = 0
+                this.dealType = {}
+                this.form1 = {
+                    dict: []
+                }
+                this.form2 = {
+                    ValueDescription: '',
+                    DataRuleType: '无需处理,直接使用'
+                }
                 let params = {
                     data: {
                         DataSourceId: this.datasourceId,
@@ -182,38 +191,48 @@
                 })
             },
             //保存
-            save(){
+            save() {
                 let data = this.hot.getSourceData()
+                console.log(data, ' data')
                 let params = data.map(item => {
-                    console.log(item ,' item')
-                    return Object.assign(this.dealType,{DataSourceId: this.datasourceId,PointId: item.Id,EquipmentMark:item.EquipmentMark})
-                }),sameFalg = false,magFalg = false;
-                params.map((item,index) => {
-                    if(!item.EquipmentMark){
+                        console.log(item.EquipmentMark,'EquipmentMark')
+                        let obj = Object.assign({}, {
+                            DataSourceId: this.datasourceId,
+                            PointId: item.Id,
+                            EquipmentMark: item.EquipmentMark
+                        })
+                        return Object.assign(obj,this.dealType)
+                    }),
+                    sameFalg = false,
+                    magFalg = false;
+                    console.log(params,'params',this.dealType)
+                params.map((item, index) => {
+                    if (!item.EquipmentMark) {
                         magFalg = true
                     }
-                    params.map((child,childIndex) => {
-                        if(childIndex != index && child.EquipmentMark == item.EquipmentMark){
+                    params.map((child, childIndex) => {
+                        console.log(childIndex != index,child.EquipmentMark,item.EquipmentMark,childIndex,index,item,child)
+                        if (childIndex != index && child.EquipmentMark == item.EquipmentMark) {
                             sameFalg = true
                         }
                     })
                 })
-                if(magFalg){
-                    this.confirm("点位中存在空的设备标识",params)
-                }else if(sameFalg){
-                    this.confirm("点位中存在设备标识相同的点位",params)
-                }else{
+                if (magFalg) {
+                    this.confirm("点位中存在空的设备标识", params)
+                } else if (sameFalg) {
+                    this.confirm("点位中存在设备标识相同的点位", params)
+                } else {
                     this.createParam(params)
                 }
                 console.log(params)
             },
-            confirm(assage,params){
+            confirm(assage, params) {
                 this.$confirm(assage).then(_ => {
                     this.createParam(params)
                 }).catch(_ => {})
             },
-            createParam(params){
-                batchCreate(params,res => {
+            createParam(params) {
+                batchCreate(params, res => {
                     this.$message.success("处理成功")
                     this.$emit("changed")
                 })
@@ -233,12 +252,12 @@
                         console.log(isOk, obj)
                         if (isOk) {
                             console.log(this.form1)
-                            this.form2 = Object.assign(this.form2,this.form1)
+                            this.form2 = Object.assign(this.form2, this.form1)
                             console.log(this.form2)
                             this.activeName += 1
                         }
                     })
-                }else if (this.activeName == 1) {
+                } else if (this.activeName == 1) {
                     this.$refs['form2'].validate(valid => {
                         if (valid) {
                             var flag = this.form2.DataRuleType
@@ -246,7 +265,7 @@
                                 case '无需处理,直接使用':
                                     // this.$refs.noHandle.getForm(noHandle => {
                                     //     if (noHandle) {
-                                            this.saveForm(this.form2, {})
+                                    this.saveForm(this.form2, {})
                                     //     } else {
                                     //         this.errMsg()
                                     //     }
@@ -322,7 +341,7 @@
                 }
             },
             saveForm(basic, other) {
-                console.log(basic.dict, other,'basic, other')
+                console.log(basic.dict, other, 'basic, other')
                 let type = basic.DataRuleType
                 let basicParams = {
                     SpecialtyCode: basic.dict[0],
@@ -342,7 +361,7 @@
                 switch (type) {
                     case '无需处理,直接使用':
                         otherParams = {
-                            EquipmentMark: other.EquipmentMark
+                            // EquipmentMark: other.EquipmentMark
                         }
                         break
                     case '需自动单位转换':
@@ -356,7 +375,7 @@
                         }])
                         otherParams = {
                             DataRuleContent: DataRuleContent1,
-                            EquipmentMark: other.EquipmentMark
+                            // EquipmentMark: other.EquipmentMark
                         }
                         break
                     case '需按设置枚举转换':
@@ -368,13 +387,12 @@
                             }]) :
                             undefined
                         otherParams = {
-                            EquipmentMark: other.EquipmentMark,
+                            // EquipmentMark: other.EquipmentMark,
                             DataRuleContent: DataRuleContent2
                         }
                         break
                     case '需按公式转换':
-                        let subRule = other.from ?
-                            {
+                        let subRule = other.from ? {
                                 seq: 1,
                                 ruletype: 'type4',
                                 content: [{
@@ -386,14 +404,11 @@
                         let extractRule = {
                             seq: 2,
                             ruletype: 'type5',
-                            content: other.extract ?
-                                [{
-                                    extract: 'number'
-                                }] :
-                                []
+                            content: other.extract ? [{
+                                extract: 'number'
+                            }] : []
                         }
-                        let countRule = other.mark ?
-                            {
+                        let countRule = other.mark ? {
                                 seq: 3,
                                 ruletype: 'type6',
                                 content: [{
@@ -412,7 +427,7 @@
                         }
                         DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
                         otherParams = {
-                            EquipmentMark: other.EquipmentMark,
+                            // EquipmentMark: other.EquipmentMark,
                             DataRuleContent: DataRuleContent3
                         }
                         break

+ 4 - 1
src/components/config_point/step3_point/dialog_main.vue

@@ -9,7 +9,7 @@
                 <div class="own-table-view">
                     <handsontable-component ref="handsontable"></handsontable-component>
                     <div class="center">
-                        <el-button type="primary" @click="">保存</el-button>
+                        <el-button type="primary" @click="saveData">保存</el-button>
                     </div>
                 </div>
             </div>
@@ -150,6 +150,9 @@
                     })
                 }
             },
+            saveData(){
+                console.log(this.identDataArr,222)
+            },
             //通过type获取param的list
             getParamList(item){
                 this.Typs = item

+ 56 - 18
src/components/config_point/step3_point/steps3_main.vue

@@ -1,8 +1,8 @@
 <!--steps3的左侧-->
 <template>
     <div class="steps3-dialog-main">
-        <select-one  @check="typeCheck" :renderData="typeArr" :isSelected="true" isCheckInfo="EquipmentMarkStandardized" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
-        <select-one  @check="paramCheck" :renderData="identifyArr" :isSelected="true" isCheckInfo="PhysicalRelated" infosKey="ownMess" :name="'原始点位描述中识别的设备参数'"></select-one>
+        <select-one @check="typeCheck" :renderData="typeArr" :isSelected="true" isCheckInfo="PhysicalRelated" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
+        <select-one @check="paramCheck" :isDel="true" @deleteItem="deleteItem" :renderData="identifyArr" :isSelected="true" isCheckInfo="PhysicalRelated" infosKey="ownMess" :name="'原始点位描述中识别的设备参数'"></select-one>
         <div class="own-collape">
             <temp-collape ref="ident" :renderData="identDataArr" @changed="changed"></temp-collape>
         </div>
@@ -15,7 +15,8 @@
         queryPoint,
         updatePoint,
         groupParamRelated,
-        getNullofParam
+        getNullofParam,
+        deleteRelationList
     } from "@/fetch/point_http"
     import tempCollape from "./3_temps"
     import identCollape from "./3_identify"
@@ -47,25 +48,63 @@
         },
         mounted() {},
         methods: {
-            getData(){
+            getData() {
                 groupRelated({
                     data: {
                         DataSourceId: this.datasourceId
                     },
                     type: this.protocolType
-                },res => {
+                }, res => {
                     this.typeArr = res.Content
                 })
             },
-            typeCheck(item){
-                console.log(item,"item")
+            typeCheck(item) {
+                console.log(item, "item")
                 this.getParamList(item)
             },
-            changed(){
-                this.identifyArr
+            //删除设备参数
+            deleteItem(item) {
+                console.log(item, 'item')
+                this.$confirm(`<p style='text-align:center;'>确定删除设备参数与数字字典的对应关系</p><p style='text-align:center;'>删除需重新配置</p>`, '提示', {
+                    dangerouslyUseHTMLString: true
+                }).then(_ => {
+                    deleteRelationList({
+                        DataSourceId: this.datasourceId,
+                        EquipmentParameter: item.EquipmentParameter,
+                        EquipmentType: item.EquipmentType
+                    }, res => {
+                        this.$message.success("删除成功")
+                        this.changed()
+                    })
+                }).catch(_ => {
+                    this.$message("取消删除")
+                })
+            },
+            //改变后重新获取两个选择的状态
+            changed() {
+                groupParamRelated({
+                    data: {
+                        DataSourceId: this.datasourceId,
+                        KeyEquipmentType: this.KeyEquipmentType
+                    },
+                    type: this.protocolType
+                }, res => {
+                    this.identifyArr = res.Content.map(item => {
+                        item.ownMess = item.EquipmentParameter
+                        return item
+                    })
+                })
+                groupRelated({
+                    data: {
+                        DataSourceId: this.datasourceId
+                    },
+                    type: this.protocolType
+                }, res => {
+                    this.typeArr = res.Content
+                })
             },
-            paramCheck(param){
-                if(param.EquipmentMark == "空"){
+            paramCheck(param) {
+                if (param.EquipmentMark == "空") {
                     //空查询分组信息
                     getNullofParam({
                         data: {
@@ -73,12 +112,11 @@
                             KeyEquipmentType: this.KeyEquipmentType
                         },
                         type: this.protocolType
-                    },res =>{
-                        console.log(res)
+                    }, res => {
                         this.identDataArr = res.Content
                         this.$refs.ident.getMain(param)
                     })
-                }else{
+                } else {
                     //不是空的情况查询点位列表
                     console.log(param)
                     queryPoint({
@@ -93,15 +131,15 @@
                             PageSize: 100
                         },
                         type: this.protocolType
-                    },res => {
-                        console.log(res,"reslist")
+                    }, res => {
+                        console.log(res, "reslist")
                         this.identDataArr = res.Content
                         this.$refs.ident.getMain(param)
                     })
                 }
             },
             //通过type获取param的list
-            getParamList(item){
+            getParamList(item) {
                 this.KeyEquipmentType = item.EquipmentType
                 groupParamRelated({
                     data: {
@@ -109,7 +147,7 @@
                         KeyEquipmentType: item.EquipmentType
                     },
                     type: this.protocolType
-                },res => {
+                }, res => {
                     this.identifyArr = res.Content.map(item => {
                         item.ownMess = item.EquipmentParameter
                         return item

+ 30 - 31
src/components/echarts/doughnut.vue

@@ -18,7 +18,9 @@
                 default: function() {
                     return []
                 }
-            }
+            },
+            type: {},
+            name: ""
         },
         data() {
             return {
@@ -38,6 +40,7 @@
                         formatter: "{b}: ({d}%)"
                     },
                     legend: {
+                        show: this.type != 'left' ? true : false,
                         orient: 'vertical',
                         right: 10,
                         top: 30,
@@ -46,30 +49,18 @@
                             return item.name
                         })
                     },
-                    graphic: {
-                        type: 'text',
-                        left: '70px',
-                        top: '60px',
-                        style: {
-                            text: '数据源\n1111',
-                            textAlign: 'center',
-                            fill: '#000',
-                            width: 30,
-                            height: 30
-                        }
-                    },
                     series: [{
                         name: '',
                         type: 'pie',
                         radius: ['40%', '60%'],
-                        center:['90px','70px'],
+                        center: this.type != 'left' ? ['90px','70px'] : ['150px', '150px'],
                         itemStyle: {
                             normal: {
                                 label: {
-                                    show: false,
+                                    show: this.type != 'left' ? false : true,
                                     textStyle: {
                                         color: '#3c4858',
-                                        fontSize: "9"
+                                        fontSize: "12"
                                     },
                                     formatter: function(val) { //让series 中的文字进行换行
                                         return val.name.split("-")[0];
@@ -79,9 +70,9 @@
                                     text: 'aaaa'
                                 },
                                 labelLine: {
-                                    show: false,
+                                    show: this.type != 'left' ? false : true,
                                     lineStyle: {
-                                        color: '#3c4858'
+                                        // color: '#3c4858'
                                     }
                                 }
                             },
@@ -92,26 +83,34 @@
                                 textColor: '#000'
                             }
                         },
-                        // data: [{
-                        //         value: 20,
-                        //         name: "1"
-                        //     },
-                        //     {
-                        //         value: 20,
-                        //         name: "2"
-                        //     },
-                        //     {
-                        //         value: 15,
-                        //         name: "3"
-                        //     }
-                        // ]
                         data: this.renderData
                     }],
                     color: ['#9DA2D6', '#FBACA1', '#FFE37F']
                 }
+                if(this.type == 'type'){
+                    options.graphic = {
+                        type: 'text',
+                        left: this.type != 'left' ? '70px' : '130px',
+                        top: this.type != 'left' ? '60px' : '140px',
+                        style: {
+                            text: `数据源\n${this.delName(this.name) || ''}`,
+                            textAlign: 'center',
+                            fill: '#000',
+                            width: 30,
+                            height: 30
+                        }
+                    }
+                }
                 this.myCharts = echarts.init(document.getElementById(this.id))
                 this.myCharts.setOption(options)
             },
+            delName(val){
+                if(!!val && val.length > 3){
+                    return val.substring(0,3) + '...'
+                }else{
+                    return ''
+                }
+            }
         },
         watch: {
             renderData: {

+ 6 - 0
src/fetch/point_http.js

@@ -310,4 +310,10 @@ export function batchCreate(param, success) {
 export function uploadPointFile(param, success) {
     let data = param.data
     return post(`${point}/point/${param.type}/point-import`, data, success)
+}
+
+//根据id批量删除对应关系
+export function deleteRelationList(param, success) {
+    let data = param
+    return post(`${point}/relation/group-delete`, data, success)
 }

+ 1 - 1
src/fetch/request.js

@@ -13,7 +13,7 @@ function delFilters(obj) {
     let str = "",
         key
     for (key in obj) {
-        if (!obj[key] && typeof obj[key] != "undefined" && obj[key] != 0) {
+        if (!obj[key] && typeof obj[key] != "undefined") {
             str += key + " isNull;"
         } else if (typeof obj[key] == 'string') {
             str += key + "='" + obj[key] + "';"

+ 14 - 2
src/utils/handsontable/delType.js

@@ -1,3 +1,4 @@
+import tools from "@/utils/scan/tools"
 let tagsFun = (instance, td, row, col, prop, value, cellProperties) => {
         if (!!value) {
             let arr = value || [],
@@ -57,7 +58,8 @@ export function showTypes(arr, infosKey = '') {
                 }
             }
 
-            //文件类型
+            console.log(item, '---------------------------------------------------')
+                //文件类型
             if (item.InfoPointCode == "InsuranceFile" ||
                 item.InfoPointCode == "Archive" ||
                 item.InfoPointCode == "CheckReport") {
@@ -71,7 +73,7 @@ export function showTypes(arr, infosKey = '') {
             if (item.InputMode == "D1") {
                 return {
                     data: infosKey + item.InfoPointCode,
-                    // renderer: tools.customDropdownRenderer,
+                    renderer: tools.customDropdownRenderer,
                     editor: "chosen",
                     chosenOptions: {
                         // multiple: true,//多选
@@ -135,6 +137,16 @@ export function showTypes(arr, infosKey = '') {
                     data: infosKey + item.InfoPointCode,
                     renderer: tagsFun,
                 }
+            } else if (item.InputMode == 'select') {
+                return {
+                    data: infosKey + item.InfoPointCode,
+                    renderer: tools.customDropdownRenderer,
+                    editor: "chosen",
+                    chosenOptions: {
+                        // multiple: true,//多选
+                        data: item.DataSource || ""
+                    }
+                }
             } else {
                 return undefined;
             }

+ 27 - 21
src/utils/point_edit/handson_header.js

@@ -1,44 +1,50 @@
 const headers = {
     "modbus-tcp": [{
-            InfoPointName: "从站地址",
-            InfoPointCode: "SlaveID",
+            InfoPointName: "SlaveID",
+            InfoPointCode: "SlaveId",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "寄存器地址(16位)",
-            InfoPointCode: "Address",
+            InfoPointName: "RegistersAddress",
+            InfoPointCode: "RegistersAddress",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "寄存器个数",
-            InfoPointCode: "Quantity",
+            InfoPointName: "RegistersQuality",
+            InfoPointCode: "RegistersQuality",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "位(单双字节)",
-            InfoPointCode: "Convtype",
-            InputMode: "B1",
+            InfoPointName: "ConvertType",
+            InfoPointCode: "ConvertType",
+            InputMode: "select",
             DataSource: [{
-                    Code: "单字",
-                    Name: "单字"
+                    Code: "1",
+                    Name: ""
                 },
                 {
-                    Code: "双字",
+                    Code: "2",
+                    Name: "单字"
+                }, {
+                    Code: "3",
                     Name: "双字"
+                }, {
+                    Code: "4",
+                    Name: "四字"
                 }
             ],
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "翻转规则",
-            InfoPointCode: "ReverseRule",
+            InfoPointName: "RevertRule",
+            InfoPointCode: "RevertRule",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
@@ -46,7 +52,7 @@ const headers = {
     ],
     "bacnet-ip": [{
             InfoPointName: "设备标识",
-            InfoPointCode: "DeviceID",
+            InfoPointCode: "DeviceId",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
@@ -60,17 +66,17 @@ const headers = {
         },
         {
             InfoPointName: "数据类型",
-            InfoPointCode: "Type",
+            InfoPointCode: "DataType",
             DataSource: [{
-                    Code: "analogInput",
+                    Code: "1",
                     Name: "analogInput"
                 },
                 {
-                    Code: "analogOutput",
+                    Code: "2",
                     Name: "analogOutput"
                 }
             ],
-            InputMode: "B1",
+            InputMode: "select",
             Visible: true,
             FirstTag: ""
         }
@@ -90,14 +96,14 @@ const headers = {
         FirstTag: ""
     }],
     "mqtt": [{
-            InfoPointName: "deviceId",
+            InfoPointName: "DeviceId",
             InfoPointCode: "DeviceId",
             InputMode: "B1",
             Visible: true,
             FirstTag: ""
         },
         {
-            InfoPointName: "item",
+            InfoPointName: "Item",
             InfoPointCode: "Item",
             InputMode: "B1",
             Visible: true,

+ 2 - 2
src/utils/point_edit/steps2.js

@@ -6,9 +6,9 @@ export default [{
         FirstTag: ""
     },
     {
-        InfoPointName: "位置",
+        InfoPointName: "位置标签",
         InfoPointCode: "LocationFlag",
-        InputMode: "B1",
+        InputMode: "myOwn",
         Visible: true,
         FirstTag: ""
     },

+ 10 - 3
src/utils/point_edit/steps3.js

@@ -6,15 +6,22 @@ export default [{
         FirstTag: ""
     },
     {
-        InfoPointName: "位置",
+        InfoPointName: "位置标签",
         InfoPointCode: "LocationFlag",
+        InputMode: "myOwn",
+        Visible: true,
+        FirstTag: ""
+    },
+    {
+        InfoPointName: "设备类型关键字",
+        InfoPointCode: "KeyEquipmentType",
         InputMode: "B1",
         Visible: true,
         FirstTag: ""
     },
     {
-        InfoPointName: "关键内容",
-        InfoPointCode: "Remarks",
+        InfoPointName: "设备参数关键字",
+        InfoPointCode: "KeyEquipmentParameter",
         InputMode: "B1",
         Visible: true,
         FirstTag: ""

+ 1 - 1
src/views/point/config_point/steps/index.vue

@@ -35,7 +35,7 @@
             return {
                 activeStep: 1, //活跃的step
                 jsonTitle: [
-                    "原始点位表收集", "原始点位描述关键内识别", "原始点位描述标准化", "点位表处理结果检查"
+                    "原始点位表收集", "原始点位描述关键内识别", "原始点位描述标准化", "点位表处理结果检查"
                 ],
                 activeHeight: 0
             }

+ 55 - 12
src/views/point/config_point/steps/step1.vue

@@ -10,11 +10,11 @@
             <el-button type="primary">获取原始点位当前值</el-button>
         </div>
         <div id="handsontableSteps1" v-loading="isLoading">
-            <handsontable-component v-if="!!allData.length" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
+            <handsontable-component v-if="!!allData.length" @delete="delePoint" ref="handsontable" @mouseDown="clickTable" @change="changeHand"></handsontable-component>
             <div v-else class="center">暂无数据</div>
         </div>
-        <own-dialog :width="'500px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="close">
-            <localtion-falg :renderData="renderData"></localtion-falg>
+        <own-dialog :width="'500px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="closeFalg">
+            <localtion-falg :renderData="renderData" @changeTag="changeLoc"></localtion-falg>
         </own-dialog>
         <own-dialog :width="'300px'" :index="true" title="导出excel模板" :dialogVisible="downloadExcel" @cancel="close">
             <div class="center">
@@ -41,6 +41,9 @@
     import ownDialog from "@/components/el_pack/dialog"
     import localtionFalg from "@/components/config_point/location_flag"
     import pagination from "@/components/common/myPagination"
+    import "@/assets/js/chosen.jquery.min";
+    import "@/assets/js/handsontable-chosen-editor";
+    import Handsontable from "handsontable-pro"
     import {
         mapGetters,
         mapActions
@@ -54,7 +57,8 @@
         updatePoint,
         createPoint,
         downloadTemplete,
-        uploadPointFile
+        uploadPointFile,
+        deletePoint
     } from "@/fetch/point_http"
     import uploadFile from "@/components/common/uploadFile"
     import axios from 'axios'
@@ -109,9 +113,17 @@
         methods: {
             //关闭弹窗
             close() {
-                this.localtionDialog = false
                 this.downloadExcel = false
                 this.updateExcel = false
+                this.getData()
+            },
+            closeFalg() {
+                this.localtionDialog = false
+            },
+            changeLoc(val) {
+                console.log(val, 'val')
+                this.renderData.LocationFlag = val
+                this.changeFlag = false
             },
             downData() {
                 let param = {
@@ -149,7 +161,29 @@
                     console.dirxml(err);
                 })
             },
-
+            //删除点位
+            delePoint(delData) {
+                let param = {
+                    data: delData.map(item => {
+                        return item.Id
+                    }),
+                    type: this.protocolType
+                }
+                console.log(param, 'param')
+                if (!param.length) {
+                    return false
+                }
+                this.$confirm('你确定要删除点位吗?').then(_ => {
+                    console.log(param, 'param')
+                    deletePoint(param, res => {
+                        this.$message.success("删除成功")
+                        this.getData()
+                    })
+                }).catch(_ => {
+                    this.$message("取消删除")
+                    this.getData()
+                })
+            },
             //下载excel模板
             download() {
                 axios({
@@ -215,9 +249,9 @@
             //点击表格
             clickTable(info, row) {
                 let activeCell = this.hot.getActiveEditor()
-                this.renderData = info
                 console.log(activeCell, 'activeCell')
                 if (activeCell.prop == "LocationFlag") {
+                    this.renderData = info
                     this.localtionDialog = true
                 }
             },
@@ -266,7 +300,7 @@
                         "PageSize": this.pages.size,
                     }
                 }
-                if(this.checked){
+                if (this.checked) {
                     param.data.Filters.Used = true
                 }
                 this.oldPage = {
@@ -292,11 +326,19 @@
                     columns: showTypes(header),
                     // colWidths: width,
                     rowHeights: 30,
-                    maxRows: this.allData.length
+                    maxRows: this.allData.length,
+                    contextMenu: {
+                        items: {
+                            remove_row: {
+                                name: "删除点位"
+                            }
+                        }
+                    }
                 }
                 if (!this.allData.length) {
                     return false
                 }
+                console.log(settings, 'settings')
                 this.$nextTick(_ => {
                     this.hot = this.$refs.handsontable.init(settings)
                     console.log(this.hot)
@@ -340,6 +382,7 @@
                     if (createList.length) {
                         this.createList(createList)
                     }
+                    this.getData()
                 } else {
                     this.$message.error("请确保存在数据")
                 }
@@ -406,9 +449,9 @@
                         data: new FormData(),
                         type: this.protocolType
                     };
-                    param.data.set('DataSourceId',this.datasourceId)
-                    param.data.set('Used',this.radio == 1 ? true : false)
-                    param.data.set('multipartFile',this.file.raw)
+                    param.data.set('DataSourceId', this.datasourceId)
+                    param.data.set('Used', this.radio == 1 ? true : false)
+                    param.data.set('multipartFile', this.file.raw)
                     uploadPointFile(param, res => {
                         this.$message.success("上传成功")
                         this.getData()

+ 76 - 16
src/views/point/config_point/steps/step2.vue

@@ -10,8 +10,8 @@
                 <el-button type="primary" @click="saveData">保存</el-button>
             </div>
         </div>
-        <div id="handsontableSteps1">
-            <handsontable-component ref="handsontable"></handsontable-component>
+        <div id="handsontableSteps1" v-loading="isLoading">
+            <handsontable-component @delete="delePoint" @mouseDown="clickTable" @change="changeHand" ref="handsontable"></handsontable-component>
         </div>
         <div class="center">
             <pagination :page="pages" @change="changePage"></pagination>
@@ -23,12 +23,20 @@
             <!-- <find-keyword ref="findKeyword" :type="type"></find-keyword> -->
             <examine-main></examine-main>
         </own-dialog>
+        <!-- <own-dialog :width="'1000px'" :index="true" title="关键内容设别——检查&微调" :dialogVisible="examineDialog" @cancel="close"> -->
+            <!-- <find-keyword ref="findKeyword" :type="type"></find-keyword> -->
+            <!-- <examine-main></examine-main>
+        </own-dialog> -->
+        <own-dialog :width="'500px'" :index="true" title="位置标签" :dialogVisible="localtionDialog" @cancel="localFalgChange">
+            <localtion-falg :renderData="renderData" @changeTag="changeLoc"></localtion-falg>
+        </own-dialog>
     </div>
 </template>
 <script>
     import handsontableComponent from "@/components/common/handsontable"
     import examineMain from "@/components/config_point/examine_main"
     import headerArr from "@/utils/point_edit/steps2.js"
+    import localtionFalg from "@/components/config_point/location_flag"
     import {
         changeHeader,
         showTypes
@@ -40,7 +48,8 @@
     } from "vuex";
     import {
         queryPoint,
-        updatePoint
+        updatePoint,
+        deletePoint
     } from "@/fetch/point_http"
     import findKeyword from "@/components/config_point/find_keyword"
     import pagination from "@/components/common/myPagination"
@@ -66,6 +75,9 @@
                     currentPage: 0,
                     size: 10
                 },
+                localtionDialog: false,
+                renderData: {},
+                isLoading: false
             }
         },
         created() {
@@ -86,23 +98,60 @@
             ])
         },
         methods: {
-
+            clickTable(info, row) {
+                let activeCell = this.hot.getActiveEditor()
+                this.renderData = info
+                console.log(activeCell, 'activeCell')
+                if (activeCell.prop == "LocationFlag") {
+                    this.localtionDialog = true
+                }
+            },
+            changeLoc(val){
+               this.renderData.LocationFlag = val
+                this.changeFlag = false
+            },
+            //修改提示
+            changeHand(changeData, source) {
+                if (!!changeData) {
+                    this.changeFlag = false
+                }
+                return false
+            },
             //刷新
-            reset(){
-                console.log(this.changeFlag,"changeFlag")
-                if(!this.changeFlag){
+            reset() {
+                console.log(this.changeFlag, "changeFlag")
+                if (!this.changeFlag) {
                     this.$confirm("表格数据尚未保存,确定刷新吗?").then(_ => {
                         this.saveData()
-                    }).catch(_ =>{
+                    }).catch(_ => {
                         this.pages.currentPage = this.oldPage.currentPage
                         this.pages.size = this.oldPage.size
                         this.getData()
                     })
-                }else{
+                } else {
                     this.getData()
                 }
             },
-
+            //删除点位
+            delePoint(delData) {
+                let param = {
+                    data: delData.map(item => {
+                        return item.Id
+                    }),
+                    type: this.protocolType
+                }
+                console.log(param, 'param')
+                this.$confirm('你确定要删除点位吗?').then(_ => {
+                    console.log(param, 'param')
+                    deletePoint(param, res => {
+                        this.$message.success("删除成功")
+                        this.getData()
+                    })
+                }).catch(_ => {
+                    this.$message("取消删除")
+                    this.getData()
+                })
+            },
             //页面发生更改
             changePage() {
                 if (!this.changeFlag) {
@@ -122,7 +171,6 @@
                     this.getData()
                 }
             },
-
             /**
              *  @param num 代表着1类型2参数
              * 
@@ -146,9 +194,11 @@
                 this.examineDialog = false
                 this.isChangeData()
             },
-
+            localFalgChange(){
+                this.localtionDialog = false
+            },
             //判断是否修改,修改调用修改接口,否则调用获取最新数据
-            isChangeData(){
+            isChangeData() {
                 if (!this.changeFlag) {
                     this.saveData(false)
                 } else {
@@ -204,6 +254,7 @@
             },
             //获取初始数据
             getData() {
+                this.isLoading = true
                 let width, param, settings
                 width = (document.getElementById("app").clientWidth - 50) / headerArr.length
                 param = {
@@ -228,10 +279,18 @@
                         columns: showTypes(headerArr),
                         colWidths: width,
                         rowHeights: 30,
-                        maxRows: res.Content.length
+                        maxRows: res.Content.length,
+                        contextMenu: {
+                            items: {
+                                remove_row: {
+                                    name: "删除点位"
+                                }
+                            }
+                        }
                     }
                     this.hot = this.$refs.handsontable.init(settings)
                     this.pages.total = res.Total
+                    this.isLoading = false
                     console.log(this.hot)
                 })
             },
@@ -244,7 +303,8 @@
             ownDialog,
             findKeyword,
             examineMain,
-            pagination
+            pagination,
+            localtionFalg
         }
     }
 </script>
@@ -252,7 +312,7 @@
     #handsonStep2 {
         flex: 1;
         display: flex;
-        flex-flow:column;
+        flex-flow: column;
         .btns-view {
             height: 40px;
             line-height: 40px;

+ 13 - 5
src/views/point/config_point/steps/step3.vue

@@ -5,9 +5,12 @@
             <el-button type="primary" @click="dialogShow(2)">根据关键内容批量对应数据字典</el-button>
             <el-checkbox style="float:right;" @change="changeChecked" v-model="checked">只显示未标准化得的原始点位</el-checkbox>
         </div>
-        <div id="handsontableSteps1">
+        <div id="handsontableSteps1" v-if="pages.total">
             <handsontable-component @mouseDown="clickEdit" ref="handsontable"></handsontable-component>
         </div>
+        <div v-else>
+            暂无数据
+        </div>
         <!-- <div class="center">
             <pagination :page="pages" @change="changePage"></pagination>
         </div> -->
@@ -134,11 +137,12 @@
              * down something
              */
             clickEdit(rowData,row){
-                console.log(rowData,row)
-                if(row.row >= 0 && row.col == 7) {
+                let activeCell = this.hot.getActiveEditor()
+                console.log(activeCell.prop)
+                if (activeCell.prop == "Point.Infos.edit") {
                     this.isEditDialogShow = true;
                     this.editData = rowData;
-                }                
+                }               
             },
             closeEdit() {
                 this.isEditDialogShow = false;
@@ -173,8 +177,12 @@
                         rowHeights: 30,
                         maxRows: res.Content.length
                     }
-                    this.hot = this.$refs.handsontable.init(settings)
                     this.pages.total = res.Total
+                    if(this.pages.total){
+                        this.$nextTick(_ => {
+                            this.hot = this.$refs.handsontable.init(settings)
+                        })
+                    }
                     console.log(this.hot)
                 })
             },

+ 105 - 50
src/views/point/config_point/steps/step4.vue

@@ -1,8 +1,8 @@
 <template>
     <div class="h100 steps4">
         <div class="btns-view">
-            <el-button type="primary">根据关键内容批量标准化设备标识</el-button>
-            <el-button type="primary">根据关键内容批量对应数据字典</el-button>
+            <el-button type="primary" @click="checkedAll">获取展开点位数据</el-button>
+            <el-button type="primary">获取全部点位数据</el-button>
         </div>
         <div class="center point-border">
             <el-radio-group v-model="activeIndex" @change="clickTabs">
@@ -17,16 +17,16 @@
             <js-mind-component ref="jsmind1"></js-mind-component>
         </div>
         <!-- <el-tabs type="border-card" @tab-click="clickTabs" class="tabs-h" tab-position="bottom">
-                <el-tab-pane>
-                    <span slot="label">
-                            从物理世界角度检查
-                        </span>
-                    
-                </el-tab-pane>
-                <el-tab-pane class="h100" label="从原始点位表角度检查">
-                    <js-mind-component ref="jsmind1" @openNode="openNode"></js-mind-component>
-                </el-tab-pane>
-            </el-tabs> -->
+                    <el-tab-pane>
+                        <span slot="label">
+                                从物理世界角度检查
+                            </span>
+                        
+                    </el-tab-pane>
+                    <el-tab-pane class="h100" label="从原始点位表角度检查">
+                        <js-mind-component ref="jsmind1" @openNode="openNode"></js-mind-component>
+                    </el-tab-pane>
+                </el-tabs> -->
     </div>
 </template>
 <script>
@@ -70,6 +70,9 @@
             })
         },
         methods: {
+            checkedAll() {
+                this.mindArr[this.activeIndex].expand_all()
+            },
             //节点选中事件
             // async openNode(node) {
             //     //次级列表children,自定义id ownId,请求参数,请求函数ajaxFun,显示子集的文案text,子集的data
@@ -243,7 +246,7 @@
                         id = this.createRandomId();
                         return {
                             id: id,
-                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
+                            topic: `${item.SpecialtySystem}(${item.PointCount})`,
                             expanded: false,
                             pointType: "system",
                             name: item.SpecialtySystem,
@@ -269,48 +272,54 @@
                             this.jsMind = this.$refs.jsmind1.initData({}, mind)
                         }
                         this.mindArr[this.activeIndex] = this.jsMind
+                        this.setBgColor([data], this.jsMind)
                         this.jsMind.options.editable = false
                     })
                 })
             },
-            delPlatform(arr){
+            delPlatform(arr) {
                 return arr.map(item => {
-                    if(item.hasOwnProperty('EquipmentTypeList')){
+                    if (item.hasOwnProperty('EquipmentTypeList')) {
                         let obj = {
                             id: this.createRandomId(),
-                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
-                            expanded: false
+                            topic: `${item.SpecialtySystem}(${item.PointCount})`,
+                            expanded: false,
+                            DataQuality: item.DataQuality
                         }
-                        if(item.hasOwnProperty("EquipmentTypeList")){
+                        if (item.hasOwnProperty("EquipmentTypeList")) {
                             obj.children = []
                             obj.children = item.EquipmentTypeList.map(child => {
                                 let obj1 = {
                                     id: this.createRandomId(),
-                                    topic: `<div>${child.EquipmentType}</div>`,
+                                    topic: `${child.EquipmentType}`,
                                     children: [],
-                                    expanded: false
+                                    expanded: false,
+                                    DataQuality: child.DataQuality
                                 }
-                                if(child.hasOwnProperty("EquipmentMarkList")){
+                                if (child.hasOwnProperty("EquipmentMarkList")) {
                                     child.EquipmentMarkList.map(node => {
                                         let obj2 = {
                                             id: this.createRandomId(),
-                                            topic: `<div>${node.EquipmentMark}</div>`,
+                                            topic: `${node.EquipmentMark}`,
                                             expanded: false,
-                                            children: []
+                                            children: [],
+                                            DataQuality: node.DataQuality
                                         }
-                                        if(node.hasOwnProperty("InfoList")){
+                                        if (node.hasOwnProperty("InfoList")) {
                                             node.InfoList.map(node1 => {
                                                 let obj3 = {
                                                     id: this.createRandomId(),
                                                     expanded: false,
-                                                    topic: `<div>${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}</div>`,
-                                                    children: []
+                                                    topic: `${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
+                                                    children: [],
+                                                    DataQuality: node1.DataQuality
                                                 }
-                                                if(node1.hasOwnProperty("PointList")){
+                                                if (node1.hasOwnProperty("PointList")) {
                                                     node1.PointList.map(node2 => {
                                                         let obj4 = {
                                                             id: this.createRandomId(),
-                                                            topic: `<div>${node2.Description}(${node2.Address}):${node2.Data.Time}-${node2.Data.Data}-${node2.Data.Unit}</div>`,
+                                                            DataQuality: node2.DataQuality,
+                                                            topic: `${node2.Description}(${node2.Address}):${node2.Data.Time}-${node2.Data.Data}-${node2.Data.Unit}`,
                                                         }
                                                         obj3.children.push(obj4)
                                                     })
@@ -326,55 +335,100 @@
                         }
                         return obj
                     }
-                    if(item.hasOwnProperty("CheckTodos")){
+                    if (item.hasOwnProperty("CheckTodos")) {
                         let obj = {
                             id: this.createRandomId(),
-                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
+                            topic: `${item.SpecialtySystem}(${item.PointCount})`,
                             expanded: false,
+                            DataQuality: item.DataQuality,
                             children: []
                         }
                         obj.children = item.CheckTodos.map(node => {
                             return {
                                 id: this.createRandomId(),
-                                topic: `<div>${node.Description}(${node.Address})</div>`,
+                                topic: `${node.Description}(${node.Address})`,
+                                DataQuality: node.DataQuality
                             }
                         })
                         return obj
                     }
                 })
             },
-            delPoint(arr){
+            setBgColor(data, jm) {
+                data.map(item => {
+                    if (item.DataQuality) {
+                        jm.set_node_color(item.id, "#f0ad4e", "#fff")
+                    }
+                    if (item.children && item.children.length) {
+                        this.setBgColor(item.children, jm)
+                    }
+                })
+            },
+            changeData(arr) {
+                console.log(arr)
+                if (arr && arr instanceof Array) {
+                    return arr.map(item => {
+                        if (item.children && item.children.length) {
+                            return {
+                                id: item.id,
+                                topic: item.topic,
+                                expanded: item.expanded,
+                                children: this.changeData(item.children),
+                                theme: item.DataQuality ? "orange" : "greensea"
+                            };
+                        } else {
+                            return {
+                                id: item.id,
+                                expanded: item.expanded,
+                                topic: item.topic,
+                                theme: item.DataQuality ? "orange" : "greensea"
+                            };
+                        }
+                    });
+                } else {
+                    return {
+                        id: "root",
+                        topic: arr.topic,
+                        children: this.changeData(arr.children)
+                    };
+                }
+            },
+            delPoint(arr) {
                 return arr.map(item => {
-                    if(item.hasOwnProperty('EquipmentTypeList')){
+                    if (item.hasOwnProperty('EquipmentTypeList')) {
                         let obj = {
                             id: this.createRandomId(),
-                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
-                            expanded: false
+                            topic: `${item.SpecialtySystem}(${item.PointCount})`,
+                            expanded: false,
+                            DataQuality: item.DataQuality
                         }
-                        if(item.hasOwnProperty("EquipmentTypeList")){
+                        if (item.hasOwnProperty("EquipmentTypeList")) {
                             obj.children = []
                             obj.children = item.EquipmentTypeList.map(child => {
                                 let obj1 = {
                                     id: this.createRandomId(),
-                                    topic: `<div>${child.EquipmentType}</div>`,
+                                    topic: `${child.EquipmentType}`,
                                     children: [],
-                                    expanded: false
+                                    expanded: false,
+                                    DataQuality: item.DataQuality
                                 }
-                                if(child.hasOwnProperty("OriginalPointList")){
+                                if (child.hasOwnProperty("OriginalPointList")) {
                                     child.OriginalPointList.map(node => {
                                         let obj2 = {
                                             id: this.createRandomId(),
-                                            topic: `<div>${node.Description}(${node.Address}):${node.Data.Time}-${node.Data.Data}-${node.Data.Unit}</div>`,
+                                            topic: `${node.Description}(${node.Address}):${node.Data.Time}-${node.Data.Data}-${node.Data.Unit}`,
                                             expanded: false,
-                                            children: []
+                                            children: [],
+                                            DataQuality: item.DataQuality
                                         }
-                                        if(node.hasOwnProperty("InfoList")){
+                                        if (node.hasOwnProperty("InfoList")) {
                                             node.InfoList.map(node1 => {
                                                 let obj3 = {
                                                     id: this.createRandomId(),
                                                     expanded: false,
-                                                    topic: `<div>${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}</div>`,
-                                                    children: []
+                                                    topic: `${node1.InfomationPoint}(${node1.MeterFunc}):${node1.Data.Time}-${node1.Data.Data}-${node1.Data.Unit}`,
+                                                    children: [],
+                                                    DataQuality: item.DataQuality
                                                 }
                                                 obj2.children.push(obj3)
                                             })
@@ -387,17 +441,19 @@
                         }
                         return obj
                     }
-                    if(item.hasOwnProperty("CheckTodos")){
+                    if (item.hasOwnProperty("CheckTodos")) {
                         let obj = {
                             id: this.createRandomId(),
-                            topic: `<div>${item.SpecialtySystem}(${item.PointCount})</div>`,
+                            topic: `${item.SpecialtySystem}(${item.PointCount})`,
                             expanded: false,
-                            children: []
+                            children: [],
+                            DataQuality: item.DataQuality
                         }
                         obj.children = item.CheckTodos.map(node => {
                             return {
                                 id: this.createRandomId(),
-                                topic: `<div>${node.Description}(${node.Address})</div>`,
+                                topic: `${node.Description}(${node.Address})`,
+                                DataQuality: item.DataQuality
                             }
                         })
                         return obj
@@ -424,8 +480,7 @@
             margin-bottom: 10px;
             text-align: right;
         }
-        .point-border {
-        }
+        .point-border {}
         .jsmind-container {
             flex: 1;
         }