Browse Source

add some components

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

+ 23 - 0
src/components/config_point/examine_main.vue

@@ -0,0 +1,23 @@
+<template>
+    <div>
+        <select-one :name="'原始点位描述中识别的设备类型'"></select-one>
+        <select-one :name="'已标准化的设备标识'"></select-one>
+    </div>
+</template>
+<script>
+    import selectOne from "components/config_point/select_one"
+    export default {
+        components:{
+            selectOne
+        },
+        data() {
+            return {}
+        },
+        created() {},
+        mounted() {},
+        methods: {}
+    }
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 80 - 0
src/components/config_point/find_keyword.vue

@@ -0,0 +1,80 @@
+<template>
+    <div>
+        <p class="center">请从下面的原始点位描述中选择"{{title == 'type' ? "设备类型" : "设备参数"}}"关键字</p>
+        <div class="h10"></div>
+        <cut-string :string="Description" ref="cutString"></cut-string>
+        <div class="h10"></div>
+        <el-button @click="getCutString">此条无法识别</el-button>
+        <el-button @click="getCutString">继续发现关键字</el-button>
+    </div>
+</template>
+<script>
+    import cutString from "components/config_point/cut_string"
+    import {
+        findKeysWord,
+        findKeysWordType
+    } from "fetch/point_http"
+    import {
+        mapGetters,
+        mapActions
+    } from "vuex";
+    export default {
+        props: {
+            type: String,
+            default: "type", //arguments or type
+        },
+        computed: {
+            ...mapGetters("project", [
+                "projectId",
+                "datasourceId",
+                "protocolType"
+            ])
+        },
+        components: {
+            cutString
+        },
+        data() {
+            return {
+                title: "",
+                Description: ""
+            }
+        },
+        created() {},
+        mounted() {},
+        methods: {
+            getCutString() {
+                console.log(this.$refs.cutString.getData())
+            },
+            changeType() {
+                if(this.type == "type"){
+                    findKeysWordType({
+                        data: {
+                            DataSourceId: this.datasourceId,
+                            ProjectId: this.projectId
+                        },
+                        type: this.protocolType
+                    },res => {
+                        console.log(res)
+                        this.Description = res.Content.Description
+                    })
+                }else{
+                    findKeysWord({
+                        data: {
+                            DataSourceId: this.datasourceId,
+                            ProjectId: this.projectId
+                        },
+                        type: this.protocolType
+                    },res => {
+                        this.Description = res.Content.Description
+                        console.log(res)
+                    })
+                }
+            }
+        }
+    }
+</script>
+<style lang="scss" scoped>
+    .h10 {
+        height: 10px;
+    }
+</style>

+ 79 - 0
src/fetch/point_http.js

@@ -0,0 +1,79 @@
+import {get, post, request } from './request'
+
+let point = '/pointconfig'
+
+//添加数据源信息
+export function createDataSource(param, success) {
+    let data = param
+    return post(`${point}/datasource/create`, data, success)
+}
+
+//根据id删除数据源
+export function delDataSource(param, success) {
+    let data = param
+    return post(`${point}/datasource/delete`, data, success)
+}
+
+//查询数据源信息
+export function queryDataSource(param, success) {
+    let data = param
+    return post(`${point}/datasource/query`, data, success)
+}
+
+//查询数据源信息-包含统计信息
+export function queryDataSourceCount(param, success) {
+    let data = param
+    return post(`${point}/datasource/queryWithCount`, data, success)
+}
+
+//更新数据源信息
+export function updateDataSource(param, success) {
+    let data = param
+    return post(`${point}/datasource/update`, data, success)
+}
+
+/**  --------------任何点位接口必传一个type---------------------   */
+//查询point list
+export function queryPoint(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/query`, data, success)
+}
+
+//更新point
+export function updatePoint(param, success) {
+    let data = param.data,
+        key;
+    data.Projection = []
+    data.Content.map(item => {
+        for (key in item) {
+            if (data.Projection.indexOf(key) == -1) {
+                data.Projection.push(key)
+            }
+        }
+    })
+    return post(`${point}/point/${param.type}/update`, data, success)
+}
+
+//删除point
+export function deletePoint(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/delete`, data, success)
+}
+
+//添加point
+export function createPoint(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/create`, data, success)
+}
+
+//发现关键字(设备参数)
+export function findKeysWord(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/next-equipment-parameter`, data, success)
+}
+
+//发现关键字(设备类型)
+export function findKeysWordType(param, success) {
+    let data = param.data
+    return post(`${point}/point/${param.type}/next-equipment-type`, data, success)
+}

+ 29 - 0
src/store/common/project.js

@@ -0,0 +1,29 @@
+const project_mess = {
+    namespaced: true,
+    state: {
+        projectId: "1234567890", //项目id
+        datasourceId: "", //数据源id
+        protocolType: "", //数据源类型
+    },
+    mutations: {
+        set_project(state, val) {
+            state.projectId = val
+        },
+        set_datasource(state, val) {
+            state.datasourceId = val
+        },
+        set_protocol_type(state, val) {
+            state.protocolType = val
+        }
+    },
+    actions: {
+
+    },
+    getters: {
+        projectId: state => state.projectId,
+        datasourceId: state => state.datasourceId,
+        protocolType: state => state.protocolType
+    }
+}
+
+export default project_mess

+ 1 - 1
src/utils/handsontable/delType.js

@@ -113,7 +113,7 @@ export function showTypes(arr, infosKey = '') {
                         data: item.DataSource || ""
                     }
                 };
-            } else if (item.InputMode == "Own" && !onlyRead) {
+            } else if (item.InputMode == "Own") {
                 return {
                     data: infosKey + item.InfoPointCode,
                     // renderer: text.idType,

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

@@ -28,7 +28,7 @@ export default [{
     },
     {
         InfoPointName: "数据字典设备类&信息点",
-        InfoPointCode: "Remarks",
+        InfoPointCode: "PhysicalRelated",
         InputMode: "B1",
         Visible: true,
         FirstTag: ""
@@ -49,8 +49,8 @@ export default [{
     },
     {
         InfoPointName: "操作",
-        InfoPointCode: "KeyEquipmentParameter",
-        InputMode: "B1",
+        InfoPointCode: "Caozuo",
+        InputMode: "Own",
         Visible: true,
         FirstTag: ""
     }

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

@@ -75,7 +75,7 @@
                     type: this.protocolType,
                     data: {
                         Filters: {
-                            Id: this.datasourceId,
+                            DatasourceId: this.datasourceId,
                         },
                         "PageNumber": 1,
                         "PageSize": 50,