Browse Source

add something

chuwu 6 năm trước cách đây
mục cha
commit
e6e88130dc

+ 49 - 33
src/assets/scss/reset.scss

@@ -39,42 +39,58 @@ $size1: 12px; //辅助文字大小
     transition: all $time ease-in-out;
 }
 
-.el-button--mini,
-.el-button--mini.is-round {
-    padding: 5px 20px;
-}
-
-.el-button {
+.el-dialog__headerbtn {
+    top: -24px;
+    right: -24px;
+    width: 24px;
+    height: 24px;
+    border-radius: 50%;
+    color: #8E9CC1;
+    background-color: #fff;
+}
+
+.el-dialog__header {
+    border-bottom: 1px solid #C2CEDB;
     box-sizing: border-box;
-    border-color: $auxiliary1;
-}
-
-.el-button span {
-    color: $color4;
-}
-
-.el-button:focus,
-.el-button:hover {
-    background-color: $bg1;
-    border-color: $auxiliary1;
-}
-
-.el-button span {
-    display: inline-block;
-    line-height: 20px;
-    height: 20px;
-}
-
-* {
-    font-family: $fontFamily;
-    font-size: $allSize;
-    color: $allColor;
-}
-
-.color {
-    color: $allColor;
+    .el-dialog__title {
+        height: 20px;
+        line-height: 20px;
+        font-size: 14px;
+    }
 }
 
+// .el-button--mini,
+// .el-button--mini.is-round {
+//     padding: 5px 20px;
+// }
+// .el-button {
+//     box-sizing: border-box;
+//     border-color: $auxiliary1;
+// }
+// .el-button span {
+//     color: $color4;
+// }
+// .el-button:focus,
+// .el-button:hover {
+//     background-color: $bg1;
+//     border-color: $auxiliary1;
+// }
+// .el-button span {
+//     display: inline-block;
+//     line-height: 20px;
+//     height: 20px;
+// }
+// * {
+//     font-family: $fontFamily;
+//     font-size: $allSize;
+//     color: $allColor;
+// }
+// .color {
+//     color: $allColor;
+// }
+// .el-input__inner:hover{
+//     border-color: 
+// }
 //文字色
 @each $i,
 $color in $colorList {

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

@@ -22,7 +22,7 @@
             </div>
             <div class="right-view saga-border">
                 <div class="find-tags" v-for="tag in tagList">
-                    <el-tag :key="type == 'type' ? tag.EquipmentType : tag.EquipmentParameter" @click="changeName(type == 'type' ? tag.EquipmentType : tag.EquipmentParameter)" @close="closeTag(tag)" closable>
+                    <el-tag :key="type == 'type' ? tag.EquipmentType : tag.EquipmentParameter" @click="changeName(type == 'type' ? tag.EquipmentType : tag.EquipmentParameter)" @close="closeTag(type == 'type' ? tag.EquipmentType : tag.EquipmentParameter)" closable>
                         {{type == 'type' ? (tag.EquipmentType + "(" + tag.PointCount + ")") : (tag.EquipmentParameter + "(" + tag.PointCount + ")")}}
                     </el-tag>
                 </div>
@@ -133,7 +133,7 @@
                 let param = {
                     data: {
                         DataSourceId: this.datasourceId,
-                        Key: this.type == "type" ? tag.EquipmentType : tag.EquipmentType
+                        Key: this.type == "type" ? tag : tag
                     },
                     type: this.protocolType
                 }

+ 99 - 0
src/components/config_point/step3_point/3_identify.vue

@@ -0,0 +1,99 @@
+<template>
+    <el-collapse v-model="activeName" @change="handleChange" accordion>
+        <el-collapse-item v-for="(item,index) in renderData" :name="index">
+            <template slot="title">
+                {{item.Group}}
+            </template>
+            <div class="collapse-item">
+                <handsontable-component :ref="index"></handsontable-component>
+            </div>
+        </el-collapse-item>
+    </el-collapse>
+</template>
+<script>
+    import handsontableComponent from "components/common/handsontable"
+    import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+export default {
+    name: "nullIdentify",
+    props: {
+        renderData: {
+            type: Array,
+            default: function(){
+                return []
+            }
+        }
+    },
+    data(){ return {
+        activeName: "1"
+    }},
+    computed: {
+            ...mapGetters("project", [
+                "projectId",
+                "datasourceId",
+                "protocolType"
+            ])
+        },
+    created(){},
+    mounted(){},
+    methods:{
+        handleChange(){
+            console.log(this.activeName)
+            let allData =this.renderData[this.activeName].PointList,data = {
+                data: allData,
+                colHeaders: ['设备标识','原始点位描述','位置标签','备注'],
+                columns: [
+                    {
+                        data: 'own'
+                    },
+                    {
+                        data: 'Description',
+                        readOnly:true,
+                    },
+                    {
+                        data: 'LocationFlag',
+                        readOnly:true,
+                    },
+                    {
+                        data: 'Remarks',
+                        readOnly:true,
+                    }
+                ],
+                maxRows: allData.length,
+            }
+            if(this.protocolType == 'knx'){
+                data.colHeaders.splice(2,0,'原始点位地址')
+                data.columns.splice(2,0,{
+                    data: 'GroupAddress',
+                    readOnly: true
+                })
+            }
+            if(this.protocolType == 'modbus-tcp'){
+                data.colHeaders.splice(2,0,'原始点位地址')
+                data.columns.splice(2,0,{
+                    data: 'RegistersAddress',
+                    readOnly: true
+                })
+            }
+            console.log(this.activeName,this.$refs)
+            this.$refs[this.activeName].init(data)             
+        }
+    },
+    watch:{
+        renderData: {
+            deep: true,
+            handler: function(){
+                console.log("changeData",this.renderData)
+            }
+        }
+    },
+    components: {
+        handsontableComponent
+    }
+}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 50 - 0
src/components/config_point/step3_point/3_temps.vue

@@ -0,0 +1,50 @@
+<template>
+    <el-collapse v-model="activeName" @change="handleChange" accordion>
+        <el-collapse-item name="1">
+            <template slot="title">
+            ①确定与数据字典中信息点得对应
+            </template>
+            <div class="collapse-item">
+                确定与数据字典中信息点得对应
+            </div>
+        </el-collapse-item>
+        <el-collapse-item name="2">
+            <template slot="title">
+            ②确定值得处理方式
+            </template>
+            <div class="collapse-item">
+                确定值得处理方式
+            </div>
+        </el-collapse-item>
+        <el-collapse-item name="3">
+            <template slot="title">
+            三确认并维护涉及到得原始呆腻味对应得设备标识
+            </template>
+            <div class="collapse-item">
+                
+            </div>
+        </el-collapse-item>
+    </el-collapse>
+</template>
+<script>
+    export default {
+        name: "tempsThree",
+        data() {
+            return {
+                activeName: 1
+            }
+        },
+        created() {},
+        mounted() {},
+        methods: {
+            handleChange(val){
+                console.log(this.activeName)
+            }
+        }
+    }
+</script>
+<style lang="scss" scoped>
+.collapse-item{
+    height: 170px;
+}
+</style>

+ 14 - 14
src/components/config_point/dialog_main.vue

@@ -3,17 +3,10 @@
     <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>
-        <!-- <div class="own-collape">
-            <el-collapse v-model="activeName" accordion>
-                <el-collapse-item name="1">
-                    <template slot="title">
-                        一致性 Consistency23333
-                    </template>
-                <div>与现实生活一致:与现实生活的流程、逻辑保持一致,遵循用户习惯的语言和概念;</div>
-                <div>在界面中一致:所有的元素和结构需保持一致,比如:设计样式、图标和文本、元素的位置等。</div>
-            </el-collapse-item>
-        </el-collapse>
-        </div> -->
+        <div class="own-collape">
+            <ident-collape ref="ident" :renderData="identDataArr"></ident-collape>
+            <!-- <temp-collape ref="collape2"></temp-collape> -->
+        </div>
     </div>
 </template>
 <script>
@@ -25,6 +18,8 @@
         getStandParam,
         getNullofParam
     } from "fetch/point_http"
+    import tempCollape from "./3_temps"
+    import identCollape from "./3_identify"
     import {
         mapGetters,
         mapActions
@@ -37,7 +32,8 @@
                 activeName: '1',
                 typeArr: [],
                 identifyArr: [],
-                KeyEquipmentType: ""
+                KeyEquipmentType: "",
+                identDataArr: []
             }
         },
         computed: {
@@ -77,6 +73,7 @@
                         type: this.protocolType
                     },res =>{
                         console.log(res)
+                        this.identDataArr = res.Content
                     })
                 }
             },
@@ -100,7 +97,9 @@
         },
         components: {
             selectOne,
-            handsontableComponent
+            handsontableComponent,
+            tempCollape,
+            identCollape
         }
     }
 </script>
@@ -108,9 +107,10 @@
     .steps3-dialog-main {
         height: 400px;
         .own-collape {
+            border: 1px solid #ccc;
             float: right;
             width: calc(100% - 520px);
-            height: 100%;
+            height: 340px;
             position: relative;
         }
     }

+ 1 - 1
src/element_config/index.js

@@ -69,7 +69,7 @@ import {
     Notification
 } from 'element-ui';
 
-Vue.prototype.$ELEMENT = { size: 'small', zIndex: 3000 };
+Vue.prototype.$ELEMENT = { size: 'mini', zIndex: 3000 };
 
 Vue.use(Pagination);
 Vue.use(Dialog);

+ 8 - 0
src/utils/tools.js

@@ -26,4 +26,12 @@ tools.delObjKey = (obj, key) => {
     }
 }
 
+tools.deepCopy = (obj) => {
+    let temp = obj.constructor === Array ? [] : {}
+    for (let val in obj) {
+        temp[val] = typeof obj[val] == 'object' ? tools.deepCopy(obj[val]) : obj[val]
+    }
+    return temp
+}
+
 export default tools

+ 18 - 9
src/views/Home.vue

@@ -1,10 +1,11 @@
 <template>
     <div class="home">
-        <div class="w40 dcenter center">
-            <el-button type="" size="mini">我的按钮</el-button>
+        <div class="w40 dcenter center el_scorll">
+            <el-button type="" size="mini" @click="dialogVisible = true">我的按钮</el-button>
             <el-button type="info" size="mini">我的按钮</el-button>
             <el-button type="primary" size="mini">我的按钮</el-button>
             <el-button type="warning" size="mini">我的按钮</el-button>
+            <el-input></el-input>
             <p v-for="item in 6" :class="'color' + item">文字{{item}}</p>
             <div v-for="item in 3" :class="'theme' + item">背景主题{{item}}</div>
             <div v-for="item in 4" :class="'auxiliary' + item">辅助色彩{{item}}</div>
@@ -13,6 +14,13 @@
             <div v-for="item in 10" :class="['border' + item,'border-radius' + item,'border-color' + item]">border测试</div>
             <div v-for="item in 5" :class="['bg' + item]">背景色测试</div>
         </div>
+        <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
+            <span>这是一段信息</span>
+            <span slot="footer" class="dialog-footer">
+                <el-button @click="dialogVisible = false">取 消</el-button>
+                <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
+            </span>
+        </el-dialog>
     </div>
 </template>
 
@@ -23,18 +31,19 @@
         components: {},
         data() {
             return {
-                testData: ""
+                testData: "",
+                dialogVisible: false
             }
         }
     }
 </script>
 
-<style lang="scss" scoped>
-.w40{
-    width: 40%;
-    *{
-        margin: 5px;
+<style lang="scss">
+    .w40 {
+        width: 40%;
+        * {
+            margin: 5px;
+        }
     }
-}
 </style>
 

+ 9 - 3
src/views/config_point/edit_origin/index.vue

@@ -135,20 +135,22 @@
             },
             btnClick() {
                 console.log(this.formData, "form")
-                let param = this.formData
+                let param = tools.deepCopy(this.formData)
                 tools.delObjKey(param, "CreateTime")
                 tools.delObjKey(param, "LastUpdate")
                 if (!!this.id) {
+                    console.log(param.ProtocolInfo.Port)
                     if(param.ProtocolInfo.Port == ""){
                         delete param.ProtocolType.Port
-                    }else{
-                        param.ProtocolType.Port = Number(param.ProtocolType.Port)
                     }
                     updateDataSource({
                         Content: [param],
                         Projection: []
                     }, res => {
                         console.log(res, 'res')
+                        this.$router.push({
+                            path: '/configPoint'
+                        })
                         this.$message.success("更新成功!")
                     })
                 } else {
@@ -156,6 +158,10 @@
                     console.log(param, "param")
                     createDataSource(param, res => {
                         console.log(res)
+                        this.$router.push({
+                            path: '/configPoint'
+                        })
+                        this.$message.success("创建成功!")
                     })
                 }
             },

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

@@ -28,7 +28,7 @@
         mapActions
     } from "vuex";
     import ownDialog from "components/el_pack/dialog"
-    import dialogMain from "components/config_point/dialog_main"
+    import dialogMain from "components/config_point/step3_point/dialog_main"
     import {
         queryPoint
     } from "fetch/point_http"