Browse Source

change bug

chuwu 5 years ago
parent
commit
6790b50b9c

+ 18 - 5
src/components/config_point/cut_string.vue

@@ -4,9 +4,9 @@
           <span
             :key="index"
             @click="checkItem(item,index)"
+            ref="span"
             :class="{
-                    'bg': (arr.indexOf(index) > -1),
-                    'saga-warning': (closedStr.indexOf(index) > -1)
+                'saga-warning': (closedStr.indexOf(index) > -1)
             } "
             class="cut-string saga-border pointer border-hover"
           >{{item}}</span>
@@ -36,13 +36,26 @@
         mounted() {},
         methods: {
             checkItem(item, index) {
-                this.obj[index] = item
-                this.arr.push(index)
+                if(this.obj.hasOwnProperty(index)){
+                    delete this.obj[index]
+                    let classList = this.$refs.span[index].getAttribute('class')
+                    if(classList.indexOf('bg') > -1){
+                        classList = classList.split('bg')
+                    }
+                    this.$refs.span[index].setAttribute('class',classList)
+                    console.log(this.$refs.span[index])
+                }else{
+                    this.obj[index] = item
+                    console.log(this.$refs.span[index].getAttribute('class'))
+                    let classList = this.$refs.span[index].getAttribute('class') + ' bg'
+                    this.$refs.span[index].setAttribute('class',classList)
+                    console.log(this.$refs.span[index])
+                }
+                console.log(this.obj,'this.obj')
             },
             clear() {
                 this.stringArr = this.string.split("")
                 this.obj = {}
-                this.arr = []
             },
             getData() {
                 let string = ""

+ 4 - 4
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" :name="renderData.Name" :renderData="echartsData" :id="id"></doughnut>
+            <doughnut v-if="renderData.Sum" type="type" width="200" height="200" :sum="renderData.Sum" :name="renderData.Name" :renderData="echartsData" :id="id"></doughnut>
             <div v-else class="center">
                 <i class="iconwushuju iconfont"></i>
                 暂无数据
@@ -51,15 +51,15 @@
         methods: {
             changeData() {
                 this.echartsData = [{
-                        name: "未使用-" + this.renderData.Notused,
+                        name: "未使用:" + this.renderData.Notused,
                         value: this.renderData.Notused
                     },
                     {
-                        name: "未关联物理世界-" + this.renderData.Notrelated,
+                        name: "未关联:" + this.renderData.Notrelated,
                         value: this.renderData.Notrelated
                     },
                     {
-                        name: "已关联物理世界-" + this.renderData.Related,
+                        name: "已关联:" + this.renderData.Related ,
                         value: this.renderData.Related
                     }
                 ]

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

@@ -137,7 +137,8 @@
                                 DataSourceId: this.datasourceId,
                                 ProjectId: this.projectId,
                                 KeyEquipmentParameter: this.EquipmentParameter,
-                                KeyEquipmentType: this.EquipmentType
+                                KeyEquipmentType: this.EquipmentType,
+                                Used: true
                             }
                         },
                         type: this.protocolType

+ 4 - 4
src/components/config_point/find_keyword.vue

@@ -17,7 +17,7 @@
         <div class="h10"></div>
         <div class="find-data">
             <div class="left-view saga-border">
-                <doughnut v-if="!!sum" type="left" :name="dataName" width="200" height="200" :renderData="echartsData"></doughnut>
+                <doughnut v-if="!!sum" :sum="sum" type="left" :name="dataName" width="200" height="200" :renderData="echartsData"></doughnut>
                 <div v-else class="center">
                     <i class="iconwushuju iconfont"></i>
                     暂无数据
@@ -224,15 +224,15 @@
                     let data = res.Content[0]
                     this.dataName = res.Content[0].Name
                     this.echartsData = [{
-                            name: "无法识别-" + (this.type != 'type' ? data.Equipmentparameterignorestandard : data.Equipmenttypeignorestandard),
+                            name: "无法识别:" + (this.type != 'type' ? data.Equipmentparameterignorestandard : data.Equipmenttypeignorestandard),
                             value: (this.type != 'type' ? data.Equipmentparameterignorestandard : data.Equipmenttypeignorestandard)
                         },
                         {
-                            name: "未识别-" + (this.type != 'type' ? data.Equipmentparameternotstandard : data.Equipmenttypenotstandard),
+                            name: "未识别:" + (this.type != 'type' ? data.Equipmentparameternotstandard : data.Equipmenttypenotstandard),
                             value: (this.type != 'type' ? data.Equipmentparameternotstandard : data.Equipmenttypenotstandard)
                         },
                         {
-                            name: "已识别-" + (this.type != 'type' ? data.Equipmentparameterstandard : data.Equipmenttypestandard),
+                            name: "已识别:" + (this.type != 'type' ? data.Equipmentparameterstandard : data.Equipmenttypestandard),
                             value: (this.type != 'type' ? data.Equipmentparameterstandard : data.Equipmenttypestandard)
                         }
                     ]

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

@@ -98,7 +98,8 @@
                         data: {
                             Filters: {
                                 equipmentMark: param.EquipmentMark,
-                                KeyEquipmentType: param.EquipmentType
+                                KeyEquipmentType: param.EquipmentType,
+                                Used: true
                             },
                             PageNumber: 1,
                             PageSize: 100

+ 2 - 1
src/components/config_point/step3_point/steps3_main.vue

@@ -123,7 +123,8 @@
                         data: {
                             Filters: {
                                 KeyEquipmentParameter: param.EquipmentParameter,
-                                KeyEquipmentType: param.EquipmentType
+                                KeyEquipmentType: param.EquipmentType,
+                                Used: true
                                 // KeyEquipmentParameter: '温度',
                                 // KeyEquipmentType: '冷机'
                             },

+ 7 - 6
src/components/echarts/doughnut.vue

@@ -20,7 +20,8 @@
                 }
             },
             type: {},
-            name: ""
+            name: "",
+            sum: ""
         },
         data() {
             return {
@@ -87,20 +88,20 @@
                     }],
                     color: ['#9DA2D6', '#FBACA1', '#FFE37F']
                 }
-                if(this.type == 'type'){
+                // if(this.type == 'type'){
                     options.graphic = {
                         type: 'text',
-                        left: this.type != 'left' ? '70px' : '130px',
-                        top: this.type != 'left' ? '60px' : '140px',
+                        left: this.type != 'left' ? '70px' : '125px',
+                        top: this.type != 'left' ? '65px' : '145px',
                         style: {
-                            text: `数据源\n${this.delName(this.name) || ''}`,
+                            text: `总数:${this.sum|| ''}`,
                             textAlign: 'center',
                             fill: '#000',
                             width: 30,
                             height: 30
                         }
                     }
-                }
+                // }
                 this.myCharts = echarts.init(document.getElementById(this.id))
                 this.myCharts.setOption(options)
             },

+ 2 - 2
src/store/modules/project.js

@@ -2,8 +2,8 @@ const project_mess = {
     namespaced: true,
     state: {
         projectId: "", //项目id
-        datasourceId: "4", //数据源id
-        protocolType: "amqp", //数据源类型
+        datasourceId: "", //数据源id
+        protocolType: "", //数据源类型
         dataName: ""
     },
     mutations: {

+ 4 - 3
src/views/point/config_point/edit_origin/index.vue

@@ -11,7 +11,7 @@
                     <el-input v-model="formData.Name" placeholder="请输入新项目名称"></el-input>
                 </el-form-item>
             </el-form>
-            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="数据源说明再次编辑维护..."></el-input>
+            <el-input type="textarea" class="edit-textarea dcenter block" v-model="formData.Description" placeholder="请维护数据源说明"></el-input>
             <el-form label-width="120px" style="width:400px;" :model="formData" class="dcenter">
                 <el-form-item label="协议类型">
                     <el-select v-model="formData.ProtocolType" filterable placeholder="请选择">
@@ -93,6 +93,7 @@
             // bread
         },
         created() {
+            this.$store.dispatch('setBreadcrumb', [{ label: '系统集成' }, { label: '点位表配置工具' },{ label: this.id ? '编辑数据源' : '添加数据源' }])
         },
         mounted() {
             if (!!this.id) {
@@ -149,7 +150,7 @@
                     }, res => {
                         console.log(res, 'res')
                         this.$router.push({
-                            path: '/configPoint'
+                            path: '/point/pointsetting'
                         })
                         this.$message.success("更新成功!")
                     })
@@ -159,7 +160,7 @@
                     createDataSource(param, res => {
                         console.log(res)
                         this.$router.push({
-                            path: '/configPoint'
+                            path: '/point/pointsetting'
                         })
                         this.$message.success("创建成功!")
                     })

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

@@ -43,7 +43,9 @@
                 activeHeight: 0
             }
         },
-        created() {},
+        created() {
+            this.$store.dispatch('setBreadcrumb', [{ label: '系统集成' }, { label: '点位表配置工具' },{ label: '点位收集' }])            
+        },
         mounted() {
             // console.log(this.$refs.pointStep.parentElement.parentElement.offsetHeight,'pointStep')
             this.resize()

+ 5 - 3
src/views/point/config_point/steps/step1.vue

@@ -106,9 +106,9 @@
         },
         created() {},
         mounted() {
-            if (!this.protocolType) {
+            if (!this.datasourceId) {
                 this.$router.push({
-                    path: "/configPoint"
+                    path: "/point/pointsetting"
                 })
             } else {
                 this.getData()
@@ -267,7 +267,9 @@
             addRow() {
                 if (!!this.allData.length) {
                     let data = this.hot.getSourceData()
-                    data.unshift({})
+                    data.unshift({
+                        Used: true
+                    })
                     this.hot.loadData(data)
                     this.hot.updateSettings({
                         maxRows: data.length

+ 1 - 0
src/views/point/config_point/steps/step2.vue

@@ -265,6 +265,7 @@
                     data: {
                         Filters: {
                             DatasourceId: this.datasourceId,
+                            Used: true
                         },
                         "PageNumber": this.pages.currentPage || 1,
                         "PageSize": this.pages.size,