浏览代码

修改全局el-tooltip__popper

shaun-sheep 4 年之前
父节点
当前提交
964d20f966
共有 2 个文件被更改,包括 87 次插入89 次删除
  1. 44 50
      src/views/legendLibrary/addForm.vue
  2. 43 39
      src/views/legendLibrary/index.vue

+ 44 - 50
src/views/legendLibrary/addForm.vue

@@ -211,69 +211,69 @@ export default {
             options: [
                 {
                     id: 'None',
-                    name: '非图例'
+                    name: '非图例',
                 },
                 {
                     id: 'Zone',
-                    name: '区域'
+                    name: '区域',
                 },
                 {
                     id: 'Image',
-                    name: '图标'
+                    name: '图标',
                 },
                 {
                     id: 'Line',
-                    name: '线条'
-                }
+                    name: '线条',
+                },
             ],
             kuan: [
                 { id: '16', name: '16' },
                 { id: '32', name: '32' },
-                { id: '64', name: '64' }
+                { id: '64', name: '64' },
             ],
             gao: [
                 { id: '16', name: '16' },
                 { id: '32', name: '32' },
-                { id: '64', name: '64' }
+                { id: '64', name: '64' },
             ],
             selectedIds: [],
             borderLineOption: [
                 {
                     id: 'solid',
-                    src: require('@/assets/imgs/1pxlines.png')
+                    src: require('@/assets/imgs/1pxlines.png'),
                 },
                 {
                     id: 'dashed',
-                    src: require('@/assets/imgs/dashedLines.png')
+                    src: require('@/assets/imgs/dashedLines.png'),
                 },
                 {
                     id: 'dotted',
-                    src: require('@/assets/imgs/dotLines.png')
-                }
+                    src: require('@/assets/imgs/dotLines.png'),
+                },
             ],
             linepxOption: [
                 {
                     id: 1,
-                    src: require('@/assets/imgs/1pxline.jpg')
+                    src: require('@/assets/imgs/1pxline.jpg'),
                 },
                 {
                     id: 2,
-                    src: require('@/assets/imgs/2pxline.jpg')
+                    src: require('@/assets/imgs/2pxline.jpg'),
                 },
                 {
                     id: 3,
-                    src: require('@/assets/imgs/3pxline.jpg')
-                }
+                    src: require('@/assets/imgs/3pxline.jpg'),
+                },
             ],
             fileList: [],
             file: '',
             // this.ruleForm.Url 图标的key,/serve/topology-wanda/Picture/query/${this.ruleForm.Url}
             value: '',
             linepxObject: {
-                src: ''
+                src: '',
             },
             borderLineOptionObject: {
-                src: ''
+                src: '',
             },
             canvasWidth: 28,
             canvasHeight: 28,
@@ -286,7 +286,7 @@ export default {
             key: 1,
             InfoLocals: undefined, //工程信息化
             // InfoSystems: undefined, //工程信息化专业/系统
-            InfoTypeIds: undefined //铺位可视化typeid
+            InfoTypeIds: undefined, //铺位可视化typeid
         }
     },
     props: ['ruleForm', 'title', 'InfosList', 'InfoTypeIdList'],
@@ -301,10 +301,10 @@ export default {
         //业下设备分类和位置分类树形结构
         initQueryDeviceAndPOsition() {
             let postParams = {}
-            queryDeviceAndPOsition({ postParams }).then(res => {
-                this.deviceList = res.data.map(i => {
+            queryDeviceAndPOsition({ postParams }).then((res) => {
+                this.deviceList = res.data.map((i) => {
                     i.children &&
-                        i.children.map(child => {
+                        i.children.map((child) => {
                             child.id = child.id + child.type
                             child.name = child.name
                         })
@@ -321,7 +321,7 @@ export default {
             this.file = file.file
             var reader = new FileReader()
             reader.readAsDataURL(this.file)
-            reader.onload = e => {
+            reader.onload = (e) => {
                 this.view.url = e.target.result
             }
         },
@@ -333,9 +333,9 @@ export default {
                 this.ruleForm.FillColor = this.hexify(this.ruleForm.FillColor)
             }
             let postParams = {
-                Content: [this.ruleForm]
+                Content: [this.ruleForm],
             }
-            createLegend({ postParams }).then(res => {
+            createLegend({ postParams }).then((res) => {
                 if (res.Result == 'success') {
                     this.$message.success('添加图例成功!')
                     this.$emit('addSuccess')
@@ -353,9 +353,9 @@ export default {
                 this.ruleForm.FillColor = this.hexify(this.ruleForm.FillColor)
             }
             let postParams = {
-                Content: [this.ruleForm]
+                Content: [this.ruleForm],
             }
-            updateLegend({ postParams }).then(res => {
+            updateLegend({ postParams }).then((res) => {
                 if (res.Result == 'success') {
                     this.$message.success('图例修改成功!')
                     this.$emit('updateSuccess')
@@ -433,7 +433,7 @@ export default {
         //线条类型改变
         changeLineType(val) {
             if (val) {
-                this.borderLineOptionObject = val && this.borderLineOption.find(item => item.id == val)
+                this.borderLineOptionObject = val && this.borderLineOption.find((item) => item.id == val)
                 this.$nextTick(() => {
                     if (this.$refs.select1 && this.$refs.select1.$el) {
                         this.$refs.select1.$el.children[0].children[0].setAttribute(
@@ -494,7 +494,7 @@ export default {
                         formData.append('file', this.file)
                     }
                     let postParams = formData
-                    uploadImg({ postParams }).then(res => {
+                    uploadImg({ postParams }).then((res) => {
                         if (res.Result == 'success') {
                             this.$set(vm.ruleForm, 'Url', res.EntityList[0])
                             this.$message.success('图标上传成功!')
@@ -520,18 +520,12 @@ export default {
 
         //位置/设备
         treeConfirmDevice(id, info) {
-            console.log('%ctreeConfirmDevice=============','color:blue')
-            console.log(id, info)
-            console.log('%ctreeConfirmDevice=============','color:blue')
             let InfoSystem = [],
                 InfoSystems = [],
                 InfoLocal = []
-            this.deviceList.forEach(i => {
+            this.deviceList.forEach((i) => {
                 i.children.length > 0 &&
-                    i.children.forEach(j => {
-                          console.log('%this.deviceList.forEach=============','color:blue')
-                          console.log(id)
-                          console.log('%this.deviceList.forEach=============','color:blue')
+                    i.children.forEach((j) => {
                         if (id.includes(j.id)) {
                             InfoSystems.push(i)
                         }
@@ -539,22 +533,22 @@ export default {
             })
             InfoSystem = JSON.parse(JSON.stringify(InfoSystems))
                 .reduce((prev, element) => {
-                    if (!prev.find(el => el.id == element.id)) {
+                    if (!prev.find((el) => el.id == element.id)) {
                         prev.push(element)
                     }
                     return prev
                 }, [])
-                .map(i => {
+                .map((i) => {
                     if (i.children.length) {
                         delete i.children
                     }
                     return i
                 })
-            InfoLocal = info.map(i => {
+            InfoLocal = info.map((i) => {
                 return {
                     type: i.id.split('')[i.id.length - 1],
                     name: i.name,
-                    id: i.id.substr(0, i.id.length - 1)
+                    id: i.id.substr(0, i.id.length - 1),
                 }
             })
             this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
@@ -564,21 +558,21 @@ export default {
             // //console.log('focusChange', status)
         },
         visualization() {
-            getVisualization({}).then(res => {
+            getVisualization({}).then((res) => {
                 this.typeVisualization =
                     res.Data &&
-                    res.Data.map(i => {
+                    res.Data.map((i) => {
                         return {
                             id: i.Id,
                             name: i.Name,
                             children: i.Children
-                                ? i.Children.map(j => {
+                                ? i.Children.map((j) => {
                                       return {
                                           id: j.Id,
-                                          name: j.Id + '-' + j.Name
+                                          name: j.Id + '-' + j.Name,
                                       }
                                   })
-                                : []
+                                : [],
                         }
                     })
             })
@@ -587,12 +581,12 @@ export default {
             return {
                 id: data.Id,
                 name: data.Name,
-                children: data.Children ? data.Children.map(i => this.getTree(i)) : []
+                children: data.Children ? data.Children.map((i) => this.getTree(i)) : [],
             }
         },
         focusChange(status) {
             //console.log('focusChange', status)
-        }
+        },
     },
     mounted() {
         console.log(this.ruleForm, 'form')
@@ -616,9 +610,9 @@ export default {
                     }
                     this.initGraph()
                 }
-            }
-        }
-    }
+            },
+        },
+    },
 }
 </script>
 

+ 43 - 39
src/views/legendLibrary/index.vue

@@ -188,7 +188,7 @@ import {
     deleteLegend,
     queryTypeId,
     getVisualization,
-    queryRelation
+    queryRelation,
 } from '@/api/legendLibrary.js'
 
 function hexToRgba(hex) {
@@ -224,40 +224,40 @@ export default {
                 { id: 'test1', name: '选择项' },
                 { id: 'test2', name: '单平米' },
                 { id: 'test3', name: '下级分项' },
-                { id: 'test4', name: '滑动平均滑动平均' }
+                { id: 'test4', name: '滑动平均滑动平均' },
             ],
             stateSelect: [
                 { id: '1', name: '正常' },
-                { id: '0', name: '已作废' }
+                { id: '0', name: '已作废' },
             ],
             Type: 'all', //所属分类
             selText: '图例库管理',
             selVal: '0',
             dataSelect: [
                 { id: '0', name: '图例库管理' },
-                { id: '1', name: '图例绘制规则' }
+                { id: '1', name: '图例绘制规则' },
             ],
             typeOptions: [
                 {
                     id: 'all',
-                    name: '全部'
+                    name: '全部',
                 },
                 {
                     id: 'None',
-                    name: '非图例'
+                    name: '非图例',
                 },
                 {
                     id: 'Zone',
-                    name: '区域'
+                    name: '区域',
                 },
                 {
                     id: 'Image',
-                    name: '图标'
+                    name: '图标',
                 },
                 {
                     id: 'Line',
-                    name: '线条'
-                }
+                    name: '线条',
+                },
             ],
             TypeId: '',
             typeIdSelect: [{ id: 'Zone', name: '铺位面' }],
@@ -275,7 +275,7 @@ export default {
             GraphCategoryIds: [], //说明书位置勾选集合
             InfoLocals: [], //工程信息化
             InfoSystems: [], //工程信息化专业/系统
-            InfoTypeIds: [] //铺位可视化typeid
+            InfoTypeIds: [], //铺位可视化typeid
         }
     },
     filters: {
@@ -285,12 +285,12 @@ export default {
             } else {
                 return val
             }
-        }
+        },
     },
     watch: {
         selVal(n, o) {
             if (n === o) return
-            this.selText = this.dataSelect.find(d => d.id === n).name
+            this.selText = this.dataSelect.find((d) => d.id === n).name
             console.log(n, o)
             if (n == 0) {
                 this.$router.push({ path: 'legendLibrary' })
@@ -298,13 +298,13 @@ export default {
             if (n == 1) {
                 this.$router.push({ path: 'legendRules' })
             }
-        }
+        },
     },
     methods: {
         //业下设备分类和位置分类树形结构
         initQueryDeviceAndPOsition() {
             let postParams = {}
-            queryDeviceAndPOsition({ postParams }).then(res => {
+            queryDeviceAndPOsition({ postParams }).then((res) => {
                 // let data = res.data
                 // data.forEach(data => {
                 //     const map = {
@@ -340,8 +340,8 @@ export default {
         //说明书位置
         instruction() {
             let getParams = {}
-            getLegendTree({ getParams }).then(res => {
-                this.positionSelect = res.Content && res.Content.map(i => this.getTree(i))
+            getLegendTree({ getParams }).then((res) => {
+                this.positionSelect = res.Content && res.Content.map((i) => this.getTree(i))
             })
         },
         //监听取消 修改的时候取消会导致表格不刷新
@@ -355,26 +355,26 @@ export default {
         },
         getTypeId() {
             let postParams = {}
-            queryTypeId({ postParams }).then(res => {
+            queryTypeId({ postParams }).then((res) => {
                 this.typeIdSelect = res.Content
             })
         },
         visualization() {
-            getVisualization({}).then(res => {
+            getVisualization({}).then((res) => {
                 this.typeVisualization =
                     res.Data &&
-                    res.Data.map(i => {
+                    res.Data.map((i) => {
                         return {
                             id: i.Id,
                             name: i.Name,
                             children: i.Children
-                                ? i.Children.map(j => {
+                                ? i.Children.map((j) => {
                                       return {
                                           id: j.Id,
-                                          name: j.Id + '-' + j.Name
+                                          name: j.Id + '-' + j.Name,
                                       }
                                   })
-                                : []
+                                : [],
                         }
                     })
             })
@@ -384,7 +384,7 @@ export default {
             return {
                 id: data.Id,
                 name: data.Name,
-                children: child ? child.map(i => this.getTree(i)) : []
+                children: child ? child.map((i) => this.getTree(i)) : [],
             }
         },
         add() {
@@ -396,15 +396,15 @@ export default {
         modalConfirm() {
             let postParams = [
                 {
-                    Id: this.deleteObject.Id
-                }
+                    Id: this.deleteObject.Id,
+                },
             ]
             deleteLegend({ postParams })
-                .then(res => {
+                .then((res) => {
                     if (res.Result == 'success') {
                         this.$message({
                             type: 'success',
-                            message: '作废成功!'
+                            message: '作废成功!',
                         })
                         this.modalStatusTip = false
                         this.getTableList()
@@ -413,7 +413,7 @@ export default {
                 .catch(() => {
                     this.$message({
                         type: 'info',
-                        message: '已取消删除'
+                        message: '已取消删除',
                     })
                 })
         },
@@ -428,7 +428,7 @@ export default {
         getTableListPosition(val) {
             let postParams = val.map(({ id }) => id)
             let data = {}
-            queryRelation({ data, postParams }).then(res => {
+            queryRelation({ data, postParams }).then((res) => {
                 this.tableData = res.data.Content
                 this.loading = false
                 this.total = res.Total
@@ -437,10 +437,10 @@ export default {
         transformDate(arr) {
             arr.map(({ GraphCategorys, InfoLocal, InfoSystems, InfoTypes }) => {
                 if (GraphCategorys.length) {
-                    GraphCategorys.map(i => i)
+                    GraphCategorys.map((i) => i)
                 }
                 if (InfoLocal.length) {
-                    GraphCategorys.map(i => {
+                    GraphCategorys.map((i) => {
                         i.name
                     })
                 }
@@ -463,15 +463,15 @@ export default {
                 Name: this.keyword,
                 PageNumber: this.currentPage,
                 PageSize: this.size,
-                Type: this.Type == 'all' ? undefined : this.Type
+                Type: this.Type == 'all' ? undefined : this.Type,
             }
-            graphElementSearch({ postParams }).then(res => {
+            graphElementSearch({ postParams }).then((res) => {
                 this.key++
                 // this.tableData = res.Content
                 this.total = res.Total
                 this.tableData =
                     res.Content &&
-                    res.Content.map(i => {
+                    res.Content.map((i) => {
                         if (i.FillColor.length == '9') {
                             i.FillColor = hexToRgba(i.FillColor)
                         }
@@ -506,9 +506,9 @@ export default {
             let InfoSystem = []
             this.InfoSystems = []
             this.InfoLocals = []
-            this.deviceList.forEach(i => {
+            this.deviceList.forEach((i) => {
                 i.children.length > 0 &&
-                    i.children.forEach(j => {
+                    i.children.forEach((j) => {
                         if (id.includes(j.id)) {
                             InfoSystem.push(i.id)
                         }
@@ -525,7 +525,7 @@ export default {
         },
         focusChange(status) {
             // console.log('focusChange', status)
-        }
+        },
     },
     mounted() {
         this.getTypeId()
@@ -533,7 +533,7 @@ export default {
         this.visualization()
         this.getTableList()
         this.initQueryDeviceAndPOsition()
-    }
+    },
 }
 </script>
 <style lang="less" scoped>
@@ -652,6 +652,10 @@ export default {
 }
 </style>
 <style lang="less">
+.el-tooltip__popper {
+    max-width: 600px !important;
+    line-height: 20px !important;
+}
 @media screen and (max-height: 800px) {
     .legend-library-bottom {
         overflow-y: auto;