Browse Source

提交点位修改

chuwu 5 years ago
parent
commit
4da34c8564

+ 9 - 6
src/components/config_point/cut_string.vue

@@ -4,7 +4,10 @@
           <span
             :key="index"
             @click="checkItem(item,index)"
-            :class="{'bg': (arr.indexOf(index) > -1)} "
+            :class="{
+                    'bg': (arr.indexOf(index) > -1),
+                    'saga-warning': (closedStr.indexOf(index) > -1)
+            } "
             class="cut-string saga-border pointer border-hover"
           >{{item}}</span>
 </template>
@@ -67,14 +70,14 @@
         box-sizing: border-box;
         margin: 0 5px;
     }
-    .bg {
-        background: #409EFF;
-        color: #fff;
-        border-color: #409EFF;
-    }
     .saga-warning{
         color: #fff;
         background-color: #e6a23c;
         border-color: #e6a23c;
     }
+    .bg {
+        background: #409EFF;
+        color: #fff;
+        border-color: #409EFF;
+    }
 </style>

+ 29 - 13
src/components/config_point/select_one.vue

@@ -1,6 +1,6 @@
 <!--
     @param name 表头文案
-    @param isOK 是否显示前一级的完成
+    @param isSelected 是否显示前一级的完成
     @param renderData 数据
     @param infosKey  dom中显示renderData中的某个字段
 -->
@@ -9,14 +9,16 @@
     <div class="select-own-one saga-border">
         <p>{{name}}</p>
         <ul v-if="renderData.length">
-            <li v-for="(item,index) in renderData" :key="item">
-                <div @click="checkItem(item,index)"  :class="index == active ? 'saga-active-select': ''" class="select-item select-bg border-bottom pointer">
-                    <span v-if="isOK"></span>
+            <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">
+                    <span v-if="isSelected" :class="{'is-checked': item[isCheckInfo]}" class="el-checkbox__input">
+                        <span class="el-checkbox__inner"></span>
+                    </span>
                     {{item[infosKey]}}
                 </div>
             </li>
         </ul>
-        <div v-else>
+        <div class="center" v-else>
             暂无数据
         </div>
     </div>
@@ -26,22 +28,21 @@
         name: "select_one",
         props: {
             name: {
-                type: String,
                 default: "原始点位描述"
             },
-            isOK: {
-                type: Boolean,
+            isSelected:{
                 default: false
             },
+            isCheckInfo: {
+                default: ""
+            },
             renderData: {
-                type: Array,
                 default: function() {
                     return [
                     ]
                 }
             },
             infosKey: {
-                type: String,
                 default: "name"
             }
         },
@@ -79,13 +80,28 @@
 }
     .select-own-one {
         display: inline-block;
-        height: 100%;
         height: 340px;
         width: 230px;
-        overflow-y: auto;
+        overflow: hidden;
+        p{
+            line-height: 40px;
+            height: 40px;
+        }
+        ul{
+            height: 300px;
+            max-height: 300px;
+            overflow-y: auto;
+            li{
+                // padding-left: 10px;
+                box-sizing: border-box;
+                div{
+                    padding-left: 10px;
+                }
+            }
+        }
     }
     .border-bottom{
-        border-bottom: 3px solid #ccc;
+        border-bottom: 1px solid #ccc;
     }
     .select-item{
         height: 30px;

+ 100 - 92
src/components/config_point/step3_point/3_temps.vue

@@ -1,100 +1,85 @@
 <template>
     <div>
-        <el-collapse v-if="renderData.length" v-model="activeName" @change="collapseChange" accordion>
-            <el-collapse-item name="1">
-                <template slot="title">①确定与数据字典中信息点得对应
-                </template>
-                <div class="collapse-item">
-                    <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>
-                        </el-form-item>
-                    </el-form>
-                    <div class="mess-main">
-                        <div></div>
-                        <div></div>
-                    </div>
-                    <div class="center">
-                        <el-button>下一步</el-button>
-                    </div>
+        <el-steps :active="activeName" align-center>
+            <el-step title="步骤1" description="确定与数据字典中信息点得对应"></el-step>
+            <el-step title="步骤2" description="确定值得处理方式"></el-step>
+            <el-step title="步骤3" description="确认并维护涉及到得原始点位对应得设备标识"></el-step>
+        </el-steps>
+        <div class="collapse-item" v-show="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>
+                </el-form-item>
+            </el-form>
+            <div class="mess-main">
+                <div>
+                    <p>原始点位说明</p>
+                    <p></p>
                 </div>
-            </el-collapse-item>
-            <el-collapse-item name="2">
-                <template slot="title">
-                    ②确定值得处理方式
-                </template>
-                <div class="collapse-item">
-                    <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
-                        <el-form-item label='值处理方式' prop='DataRuleType'>
-                            <el-select v-model='form2.DataRuleType' placeholder='请选择'>
-                                <el-option
-                                    v-for='item in handleTypeArr'
-                                    :key='item.value'
-                                    :label='item.label'
-                                    :value='item.value'
-                                ></el-option>
-                            </el-select>
-                        </el-form-item>
-                        <!-- components -->
-                        <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
-                        <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
-                        <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
-                        <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
-                        <split-handle :devFlag="false" ref='splitHandle' v-else></split-handle>
-                    </el-form>
+                <div>
+                    <p>数据字典值说明</p>
+                    <p></p>
                 </div>
-                </el-collapse-item>
-                <el-collapse-item name="3">
-                <template slot="title">
-                    三确认并维护涉及到得原始呆腻味对应得设备标识
-                </template>
-            <div class="collapse-item">
-                <handsontable-component ref="handsontable"></handsontable-component>
             </div>
-            </el-collapse-item>
-        </el-collapse>
-        <div v-else class="center">
-            暂无数据
+            <div class="center">
+                <el-button @click="next">下一步</el-button>
+            </div>
+        </div>
+        <div class="collapse-item"  v-show="activeName == 1">
+            <div class="flex-around">
+                <div class="point-despoint"></div>
+                <div class="point-despoint"></div>
+            </div>
+            <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
+                <el-form-item label='值处理方式' prop='DataRuleType'>
+                    <el-select v-model='form2.DataRuleType' placeholder='请选择'>
+                        <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
+                    </el-select>
+                </el-form-item>
+                <!-- components -->
+                <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
+                <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
+                <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
+                <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
+                <split-handle :devFlag="false" ref='splitHandle' v-else></split-handle>
+            </el-form>
+            <div class="center">
+                <el-button>下一步</el-button>
+            </div>
+        </div>
+        <div class="collapse-item" v-show="activeName == 2">
+            <handsontable-component ref="handsontable"></handsontable-component>
         </div>
     </div>
 </template>
 <script>
-//components
-import noHandle from '@/components/config_point/step3_edit/no_handle'
-import autoHandle from '@/components/config_point/step3_edit/auto_handle'
-import enumHandle from '@/components/config_point/step3_edit/enum_handle'
-import formulaHandle from '@/components/config_point/step3_edit/formula_handle'
-import splitHandle from '@/components/config_point/step3_edit/split_handle'
-import handsontableComponent from "@/components/common/handsontable"
-
-
-import { getEquipmentAll, getQueryProperty } from '@/fetch/data_plat'
-import { batchCreate } from '@/fetch/point_http'
+    //components
+    import noHandle from '@/components/config_point/step3_edit/no_handle'
+    import autoHandle from '@/components/config_point/step3_edit/auto_handle'
+    import enumHandle from '@/components/config_point/step3_edit/enum_handle'
+    import formulaHandle from '@/components/config_point/step3_edit/formula_handle'
+    import splitHandle from '@/components/config_point/step3_edit/split_handle'
+    import handsontableComponent from "@/components/common/handsontable"
+    import {
+        getEquipmentAll,
+        getQueryProperty
+    } from '@/fetch/data_plat'
+    import {
+        batchCreate
+    } from '@/fetch/point_http'
     export default {
         name: "tempsThree",
         props: {
             renderData: {
-                type:Array,
-                default: function(){
+                type: Array,
+                default: function() {
                     return []
                 }
             }
         },
         data() {
             return {
-                activeName: 1,
+                activeName: 0,
                 form1: {
                     dict: []
                 },
@@ -107,8 +92,7 @@ import { batchCreate } from '@/fetch/point_http'
                 infoDict: {}, //信息点字典
                 InfomationPoint: null, //信息点
                 unitObj: {}, //传给自动单位转换的obj
-                handleTypeArr: [
-                    {
+                handleTypeArr: [{
                         label: '无需处理,直接使用',
                         value: '无需处理,直接使用'
                     },
@@ -130,11 +114,15 @@ import { batchCreate } from '@/fetch/point_http'
                     }
                 ],
                 form2: {
-                    ValueDescription: '', 
+                    ValueDescription: '',
                     DataRuleType: '无需处理,直接使用'
                 },
                 rules: {
-                    DataRuleType: [{ required: true, message: '请选择值处理方式', trigger: 'change' }]
+                    DataRuleType: [{
+                        required: true,
+                        message: '请选择值处理方式',
+                        trigger: 'change'
+                    }]
                 },
             }
         },
@@ -143,7 +131,7 @@ import { batchCreate } from '@/fetch/point_http'
             this.init()
             console.log(this.renderData)
         },
-        components:{
+        components: {
             noHandle,
             autoHandle,
             enumHandle,
@@ -154,13 +142,12 @@ import { batchCreate } from '@/fetch/point_http'
         methods: {
             collapseChange(val) {
                 console.log(this.activeName)
-                if(this.activeName == 3){
+                if (this.activeName == 3) {
                     let setting = {
                         data: this.renderData,
                         maxRows: this.length,
-                        colHeaders: ['设备标识','原始点位描述','位置标签','备注'],
-                        columns: [
-                            {
+                        colHeaders: ['设备标识', '原始点位描述', '位置标签', '备注'],
+                        columns: [{
                                 data: 'EquipmentMark'
                             },
                             {
@@ -182,6 +169,9 @@ import { batchCreate } from '@/fetch/point_http'
                     })
                 }
             },
+            next(){
+                this.activeName += 1
+            },
             validateDict(rule, value, cb) {
                 if (value.length < 4) {
                     cb(new Error('请选到第四级(可能本设备没有信息点)'))
@@ -190,13 +180,18 @@ import { batchCreate } from '@/fetch/point_http'
                 }
             },
             handleChange(arr) {
+                console.log(arr, 'arr')
+                console.log(this.infoDict, 'infoDict')
                 this.unitObj = this.infoDict[arr[3]]
-                console.log(this.unitObj)
                 this.InfomationPoint = this.unitObj.infoPointName
             },
             handleItemChange(val) {
+                console.log(val, 'vals')
                 if (val.length == 3) {
-                    let params = { type: val[2] }
+                    let params = {
+                        type: val[2]
+                    }
+                    console.log(params, 'params')
                     getQueryProperty(params, res => {
                         if (res.Result == 'success') {
                             let data = res.Content
@@ -214,9 +209,9 @@ import { batchCreate } from '@/fetch/point_http'
                             data.forEach(item => {
                                 this.infoDict[item.infoPointCode] = item
                             })
+                            console.log(this.infoDict)
                             this.optionObj = {}
                             this.getOptionItem(this.options, val[2])
-
                             if (arr.length) {
                                 this.optionObj.content = arr
                             } else {
@@ -233,11 +228,15 @@ import { batchCreate } from '@/fetch/point_http'
                     }
                     if (arr[i].content && arr[i].content.length > 0) {
                         this.getOptionItem(arr[i].content, code)
+                    }else{
+                        this.$set(arr,'content',[])
                     }
                 }
             },
             getEqAll() {
-                let params = { format: true }
+                let params = {
+                    format: true
+                }
                 getEquipmentAll(params, res => {
                     if (res.Result == 'success') {
                         this.options = res.Content
@@ -252,8 +251,17 @@ import { batchCreate } from '@/fetch/point_http'
     }
 </script>
 <style lang="scss" scoped>
+    .flex-around {
+        display: flex;
+        justify-content: space-around;
+        .point-despoint {
+            width: 160px;
+            border: 1px solid #DCDFE6;
+            height: 100px;
+        }
+    }
     .collapse-item {
-        height: 170px;
+        height: 190px;
         overflow-y: auto;
     }
 </style>

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

@@ -1,7 +1,7 @@
 <!--steps3的左侧-->
 <template>
     <div class="steps3-dialog-main">
-        <select-one  @check="typeCheck" :renderData="typeArr" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
+        <select-one  @check="typeCheck" :renderData="typeArr" :isSelected="true" isCheckInfo="EquipmentMarkStandardized" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
         <select-one  @check="paramCheck" :renderData="identifyArr" infosKey="ownMess" :name="'已标准化的设备标识'"></select-one>
         <div class="own-collape">
             <ident-collape v-if="!isNull" ref="ident" @saved="resetTwo" :renderData="identDataArr"></ident-collape>

+ 2 - 2
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" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
-        <select-one  @check="paramCheck" :renderData="identifyArr" infosKey="ownMess" :name="'已标准化的设备标识'"></select-one>
+        <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>
         <div class="own-collape">
             <temp-collape ref="ident" :renderData="identDataArr"></temp-collape>
         </div>

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

@@ -4,11 +4,11 @@
             <span>此项目包括<i style="color:#409EFF;">{{list.length}}</i>个数据源</span>
             <div style="float:right;">
                 <el-button type="primary">同步配置文件到云端</el-button>
-                <el-button type="primary">添加数据源</el-button>
+                <el-button type="primary" @click="addItem">添加数据源</el-button>
             </div>
         </div>
         <div class="saga-origin-list" v-loading="isLoading">
-            <el-scrollbar>
+            <!-- <el-scrollbar> -->
                 <div class="disIne border-hover saga-list-item margin5" v-for="(item,index) in list" :key="index">
                     <data-origin :id="'origin' + index" :renderData="item">
                         <div class="center">
@@ -20,7 +20,7 @@
                 <!-- <div class="disIne saga-list-item margin5 center pointer" @click="addItem">
                     <i class="add-icon margin50">+</i>
                 </div> -->
-            </el-scrollbar>
+            <!-- </el-scrollbar> -->
         </div>
     </div>
 </template>

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

@@ -148,8 +148,8 @@
                     }
                     .point-title{
                         float: left;
-                        padding-left: 10px;
-                        padding-right: 22px;
+                        // padding-left: 10px;
+                        // padding-right: 22px;
                         width: 168px;
                     }
                 } // height: 80px;

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

@@ -11,7 +11,7 @@
         <!-- <div class="center">
             <pagination :page="pages" @change="changePage"></pagination>
         </div> -->
-        <own-dialog :width="'1000px'" :dialogVisible="isDialogShow" @cancel="close">
+        <own-dialog :width="'1000px'" :title=" isDataform ? '根据关键内容批量对应数据字典' : '根据关键内容批量标准化设备标识' " :dialogVisible="isDialogShow" @cancel="close">
             <dialog-main v-if="!isDataform"></dialog-main>
             <steps-main v-if="isDataform"></steps-main>
         </own-dialog>