Parcourir la source

专业设备可视化回显,根据产品修改top

shaun-sheep il y a 4 ans
Parent
commit
c9d5d25ce3

+ 2 - 2
public/systemConf.js

@@ -25,8 +25,8 @@ var __systemConf = {
     conf: {
         // 阿里云
         editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
-        wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
-        // wandaBmGuideUrl: 'http://192.168.200.100:8090/wandaBmGuide/', //管理书地址
+        // wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
+        wandaBmGuideUrl: 'http://192.168.200.100:8090/wandaBmGuide/', //管理书地址
     },
 }
 window.__systemConf = __systemConf

+ 27 - 21
src/views/legendLibrary/addForm.vue

@@ -102,6 +102,8 @@
                         @change='treeConfirmDevice'
                         :hideClear='true'
                         :lastStage='true'
+                        :selectedIds='InfosList'
+                        :notNull='true'
                     />
                 </span>
                 <TreeSelect
@@ -115,7 +117,7 @@
                     @change='treeConfirm'
                     @focusChange='focusChange'
                     :hideClear='true'
-                    :selectedIds='selectedIds'
+                    :selectedIds='InfoTypeIdList'
                     :lastStage='true'
                 />
             </div>
@@ -197,15 +199,14 @@ export default {
 
             // majorList: [], //专业
             deviceList: [],
-            key: 1
-        }
-    },
-    props: ['ruleForm', 'title'],
-    computed: {
-        form() {
-            console.log(this.ruleForm)
+            key: 1,
+            InfoLocals: undefined, //工程信息化
+            // InfoSystems: undefined, //工程信息化专业/系统
+            InfoTypeIds: undefined //铺位可视化typeid
         }
     },
+    props: ['ruleForm', 'title', 'InfosList', 'InfoTypeIdList'],
+
     methods: {
         //业下设备分类和位置分类树形结构
         initQueryDeviceAndPOsition() {
@@ -215,7 +216,7 @@ export default {
             })
         },
         handleRemove(file, fileList) {
-            console.log(file, fileList, 'file')
+            // console.log(file, fileList, 'file')
             this.ruleForm.Url = ''
         },
         getFile(file) {
@@ -266,7 +267,7 @@ export default {
             let postParams = {
                 Content: [this.ruleForm]
             }
-            this.ruleForm.InfoSystem = this.ruleForm.InfoSystems ? this.ruleForm.InfoSystems : this.ruleForm.InfoSystem
+
             updateLegend({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
@@ -373,7 +374,6 @@ export default {
                     break
             }
             var hex = '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1) + opacity
-            console.log(hex, 'hrc')
             return hex
         },
         // 背景颜色改变
@@ -457,20 +457,26 @@ export default {
 
         //位置/设备
         treeConfirmDevice(id, info) {
+            console.log(id)
             // this.$set(this.ruleForm, 'InfoLocal', data)
             let InfoSystem = []
             let InfoLocal = []
-            for (let i = 0; i < info.length; i++) {
-                let type = info[i]
-                if (type.name.includes('/')) {
-                    InfoLocal.push(type)
-                    //位置/设备
-                    this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
-                } else {
-                    InfoSystem.push(type)
-                    //专业
-                    this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
+            if (info && info.length > 0) {
+                for (let i = 0; i < info.length; i++) {
+                    let type = info[i]
+                    if (type.name.includes('/')) {
+                        InfoLocal.push(type)
+                        //位置/设备
+                        this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
+                    } else {
+                        InfoSystem.push(type)
+                        //专业
+                        this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
+                    }
                 }
+            } else {
+                this.$set(this.ruleForm, 'InfoLocal', [])
+                this.$set(this.ruleForm, 'InfoSystem', [])
             }
         },
         focusChange(status) {

+ 24 - 1
src/views/legendLibrary/addLegend.vue

@@ -2,7 +2,15 @@
     <div class='add-legend'>
         <el-dialog :title='title' :visible.sync='dialogVisible'>
             <!-- <add-list v-show='title=="" && GraphCategoryId' ref='searchList' :GraphCategoryId='GraphCategoryId' @mesg='mesg'></add-list> -->
-            <add-form ref='add' :ruleForm='info' @addSuccess='addSuccess' @updateSuccess='updateSuccess' :title='title'></add-form>
+            <add-form
+                ref='add'
+                :InfosList='InfosList'
+                :InfoTypeIdList='InfoTypeIdList'
+                :ruleForm='info'
+                @addSuccess='addSuccess'
+                @updateSuccess='updateSuccess'
+                :title='title'
+            ></add-form>
             <span slot='footer' class='dialog-footer'>
                 <el-button @click='dialogVisible = false,cancal()' size='small'>取 消</el-button>
                 <el-button type='primary' @click='save' size='small'>确 定</el-button>
@@ -33,6 +41,9 @@ export default {
     data() {
         return {
             dialogVisible: false,
+            InfoTypeIdList: [],
+            InfosList: [],
+
             info: {
                 Name: '',
                 Type: 'None',
@@ -78,6 +89,8 @@ export default {
                 }
             } else if (title == '添加图例库') {
                 this.dialogVisible = true
+                this.InfoTypeIdList = []
+                this.InfosList = []
                 this.info = {
                     Name: '',
                     Type: 'None',
@@ -92,6 +105,13 @@ export default {
             } else if (title == '修改图例库') {
                 this.dialogVisible = true
                 this.info = row
+                this.InfosList = []
+                this.InfoTypeIdList = []
+
+                // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
+                this.InfosList = [...row.InfoLocal.map(({ id }) => id)]
+                this.InfoTypeIdList = row.InfoTypeId
+                console.log(this.InfosList, this.InfoTypeIdList)
                 console.log(this.info)
                 // 图例库规则中的transform
             } else if (title == '' && this.$refs.searchList) {
@@ -117,6 +137,9 @@ export default {
                 InfoLocal: [], //工程信息化位置与设备分类
                 InfoSystem: [] //工程信息化专业/系统
             }
+            this.InfoTypeIdList = []
+            this.InfosList = []
+
             this.$refs.add.fileList = []
         },
         mesg() {

+ 2 - 5
src/views/legendLibrary/index.vue

@@ -1,17 +1,15 @@
 <template>
     <div class='legend-library'>
-        <div class='nav'>
+        <!-- <div class='nav'>
             <img class='img-menu' src='@/assets/imgs/menu.png' alt />
             <el-divider direction='vertical'></el-divider>
             <img class='img-logo' src='@/assets/imgs/logo_tu.png' alt />
             <span class='nav-span1'>万达管理说明书</span>
             <span class='circular'></span>
-            <!-- <span style='color:#1F2329'>图例库管理</span>
-            <i class='el-icon-caret-bottom'></i>-->
             <Dropdown v-model='selVal' :data='dataSelect'>
                 <span style=' font-size: 14px;color: #1f2329 ;'>{{selText}}</span>
             </Dropdown>
-        </div>
+        </div>-->
         <div class='legend-library-top'>
             图例库管理
             <span class='library-btn'>
@@ -447,7 +445,6 @@ export default {
                 this.key++
                 // this.tableData = res.Content
                 this.total = res.Total
-                console.log(res.Content)
                 this.tableData = res.Content.map(i => {
                     if (i.FillColor.length == '9') {
                         i.FillColor = hexToRgba(i.FillColor)

+ 15 - 5
src/views/legendRules/index.vue

@@ -1,20 +1,27 @@
 <template>
     <!-- 图例库首页 -->
     <div class='legend-rules'>
-        <div class='nav'>
+        <!-- <div class='nav'>
             <img class='img-menu' src='@/assets/imgs/menu.png' alt />
             <el-divider direction='vertical'></el-divider>
             <img class='img-logo' src='@/assets/imgs/logo_tu.png' alt />
             <span style='color:#1F2329'>万达管理说明书</span>
             <span class='circular'></span>
-            <!-- <span style='color:#1F2329'>图例绘制规则</span>
-            <i class='el-icon-caret-bottom'></i>-->
             <Dropdown v-model='selVal' :data='dataSelect'>
                 <span style=' font-size: 14px;color: #1f2329 ;'>{{selText}}</span>
             </Dropdown>
-        </div>
+        </div>-->
         <div class='legend-rules-top'>
-            图例绘制规则
+            <span
+                class='el-icon-arrow-left'
+                @click='goBack'
+                style='float: left;
+                        cursor: pointer;
+                        font-size: 25px;
+                        display: inline-block;
+                        margin-top: 10px;
+                        padding-left: 20px;'
+            ></span>图例绘制规则
             <el-button type='primary' class='rules-button' size='small' @click='add'>添加图例</el-button>
         </div>
         <div class='legend-rules-bottom'>
@@ -135,6 +142,9 @@ export default {
         }
     },
     methods: {
+        goBack() {
+            this.$router.push({ path: 'legendLibrary' })
+        },
         buttonClickHandle(obj) {
             let index = Number(obj.item.index.split('-')[1])
             let _this = this