Browse Source

优化问题

FinalYu 2 years ago
parent
commit
a89fb6e5f4

+ 14 - 12
chuanyi_client2/package-lock.json

@@ -2837,6 +2837,13 @@
         "regenerator-runtime": "^0.11.0"
       }
     },
+    "node_modules/babel-runtime/node_modules/core-js": {
+      "version": "2.6.12",
+      "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
+      "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
+      "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
+      "hasInstallScript": true
+    },
     "node_modules/balanced-match": {
       "version": "1.0.2",
       "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -4396,13 +4403,6 @@
         "webpack": "^5.1.0"
       }
     },
-    "node_modules/core-js": {
-      "version": "2.6.12",
-      "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
-      "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
-      "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.",
-      "hasInstallScript": true
-    },
     "node_modules/core-util-is": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz",
@@ -19218,6 +19218,13 @@
       "requires": {
         "core-js": "^2.4.0",
         "regenerator-runtime": "^0.11.0"
+      },
+      "dependencies": {
+        "core-js": {
+          "version": "2.6.12",
+          "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
+          "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
+        }
       }
     },
     "balanced-match": {
@@ -20528,11 +20535,6 @@
         "serialize-javascript": "^6.0.0"
       }
     },
-    "core-js": {
-      "version": "2.6.12",
-      "resolved": "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz",
-      "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
-    },
     "core-util-is": {
       "version": "1.0.3",
       "resolved": "https://registry.npmmirror.com/core-util-is/-/core-util-is-1.0.3.tgz",

+ 18 - 7
chuanyi_client2/src/components/HeaderMain/index.vue

@@ -189,7 +189,7 @@
                      :highlight-current="true"
                      :default-expand-all="true">
               <span class="custom-tree-node" slot-scope="{ node, data }">
-                <svg-icon v-if="!data.children" icon-class="file"/>
+                <svg-icon v-if="!data.children || data.children.length == 0" icon-class="file"/>
                 <svg-icon v-else-if="node.expanded" icon-class="folder-open"/>
                 <svg-icon v-else icon-class="folder"/>
                 <span :title='node.label || "-"' style="margin-left: 2px;">{{ node.label }}</span>
@@ -370,7 +370,7 @@ export default {
       if (e.paneName == '1') {
         this.gotoPageByName('/groupItem')
       } else {
-        this.gotoPageByName('/index')
+        this.gotoPageByName('/reportTemplate')
       }
     },
     /** 页面跳转 */
@@ -551,8 +551,12 @@ export default {
     getChooseItemData(item) {
       let arr = []
       for (let i in item.itemList) {
+        let temp = item.itemList[i]
         arr.push({
-          'label': item.itemList[i].itemName
+          'label': temp.itemName,
+          'nodeIdentifier': temp.nodeIdentifier,
+          'nodeIndex': temp.nodeIndex,
+          'dataType': temp.dataType
         })
       }
       this.chooseItemDataListByTree = arr
@@ -737,7 +741,10 @@ export default {
         const nodeId = checkedNode.$treeNodeId;
         let channelName = this.treeFindPath(this.itemDataListByTree, data => data.$treeNodeId === nodeId, "label")
         let temp = {
-          'label': channelName.join('.')
+          'label': channelName.join('.'),
+          'nodeIdentifier': checkedNode.nodeIdentifier,
+          'nodeIndex': checkedNode.nodeIndex,
+          'dataType': checkedNode.dataType
         }
         chooseChannelNameList.push(temp)
       }
@@ -801,10 +808,14 @@ export default {
         return
       }
       let itemList = []
-      let itemNameList = this.chooseItemDataListByTree.map(map => { return map.label })
-      for (let i in itemNameList) {
+      // let itemNameList = this.chooseItemDataListByTree.map(map => { return map.label })
+      for (let i in this.chooseItemDataListByTree) {
+        let temp = this.chooseItemDataListByTree[i]
         itemList.push({
-          'itemName': itemNameList[i]
+          'itemName': temp.label,
+          'nodeIdentifier': temp.nodeIdentifier,
+          'nodeIndex': temp.nodeIndex,
+          'dataType': temp.dataType,
         })
       }
       this.groupBasicForm.itemList = itemList

+ 12 - 0
chuanyi_client2/src/components/LeftMenu/index.vue

@@ -57,6 +57,9 @@
                         v-model="datasourceForm.desc"
                         placeholder="请输入备注"></el-input>
             </el-form-item>
+            <el-form-item style="margin-top: 10px;">
+              <el-tag type="info" style="width: 100%;">数据类型:{{ chooseDatasourceType }}</el-tag>
+            </el-form-item>
           </el-form>
         </div>
         <!-- 服务连接列表 -->
@@ -159,6 +162,7 @@ export default {
       connDialogTitle: '选择OPC服务',
       connDialogVisible: false,
       labelPosition: 'top',
+      chooseDatasourceType: '',
       // 选择的服务类型
       chooseServerType: null,
       // 选择的连接服务
@@ -248,6 +252,7 @@ export default {
     /** 添加数据源配置 */
     createDatasourceEvent() {
       this.changeNavType(0)
+      this.chooseDatasourceType = ''
       this.datasourceDialogVisible = true
     },
     /** 修改菜单点击项 */
@@ -286,6 +291,7 @@ export default {
         const loading = showLoading(_this, '删除中,请稍候···')
         delDataSourceById(data.id).then(res => {
           loading.close()
+          this.chooseDatasourceType = ''
           // 刷新右侧数据源类型列表
           _this.getMyDatasourceList()
           _this.$message({
@@ -309,6 +315,7 @@ export default {
       this.chooseConnServer = conn
       this.datasourceForm.datasourceName = conn.dataSourceName
       this.datasourceForm.desc = conn.dataSourceDescribe
+      this.chooseDatasourceType = conn.dataSourceTypeName
     },
     /** 数据类型树点击事件 */
     handleNodeClick(data, node, target) {
@@ -318,6 +325,11 @@ export default {
       }
       this.$refs['datasourceForm'].resetFields()
       this.chooseServerType = data
+      if (data.children && data.children.length > 0) {
+        this.chooseDatasourceType = ''
+      } else {
+        this.chooseDatasourceType = data.label
+      }
     },
     /** 数据源配置事件 */
     handleDatasourceConfig() {

+ 4 - 0
chuanyi_client2/src/router/index.js

@@ -41,6 +41,10 @@ const routes = [
                 component: () => import('@/views/home/index')
             },
             {
+                path: 'reportTemplate',
+                component: () => import('@/views/report_template/index')
+            },
+            {
                 path: 'groupItem',
                 component: () => import('@/views/group_item/index')
             },

+ 23 - 0
chuanyi_client2/src/views/report_template/index.vue

@@ -0,0 +1,23 @@
+<template>
+
+</template>
+
+<script>
+
+export default {
+  name: 'index',
+  data() {
+    return {
+    }
+  },
+  mounted() {
+  },
+  created() {
+  },
+  methods: {
+  }
+}
+</script>
+
+<style rel="stylesheet/scss" lang="scss">
+</style>