Browse Source

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

zhulizhen1111 4 years ago
parent
commit
cf1daacb5a

+ 28 - 9
src/views/legendLibrary/addForm.vue

@@ -54,11 +54,15 @@
                     </el-option>
                 </el-select>
 
-                <el-select v-model='ruleForm.LineWidth' placeholder='请选择' size='small' style='width:160px;' ref='select' @change='changeLineWidth'>
+                <!-- <el-select v-model='ruleForm.LineWidth' placeholder='请选择' size='small' style='width:160px;' ref='select' @change='changeLineWidth'>
                     <el-option v-for='item in linepxOption' :key='item.id' :label='item.src' :value='item.id'>
                         <img :src='item.src' alt />
                     </el-option>
-                </el-select>
+                </el-select>-->
+                <div style='position:relative'>
+                    <a-input-number id='inputNumber' v-model='ruleForm.LineWidth' :min='1' :max='10' ref='select' @change='changeLineWidth' />
+                    <span class='line-width'>px</span>
+                </div>
             </div>
         </div>
         <div v-if='ruleForm.Type=="Image"' class='form5'>
@@ -293,13 +297,13 @@ export default {
         //线条宽度
         changeLineWidth(val) {
             this.$set(this.ruleForm, 'LineWidth', val)
-            this.linepxObject = val && this.linepxOption.find(item => item.id == val)
-            if (this.$refs.select && this.$refs.select.$el) {
-                this.$refs.select.$el.children[0].children[0].setAttribute(
-                    'style',
-                    'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
-                )
-            }
+            // this.linepxObject = val && this.linepxOption.find(item => item.id == val)
+            // if (this.$refs.select && this.$refs.select.$el) {
+            //     this.$refs.select.$el.children[0].children[0].setAttribute(
+            //         'style',
+            //         'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
+            //     )
+            // }
 
             if (this.view) {
                 this.view.lineWidth = Number(val)
@@ -373,6 +377,9 @@ export default {
     color: #646c73;
     margin: 16px 0 0 72px;
     font-size: 14px;
+    .ant-input-number {
+        border-radius: 4px 0 0 4px;
+    }
     .form1 {
         margin-bottom: 8px;
         .span1 {
@@ -476,5 +483,17 @@ export default {
     .upload-demo {
         display: flex;
     }
+    .line-width {
+        display: inline-block;
+        width: 35px;
+        height: 32px;
+        background: rgba(239, 240, 241, 1);
+        border-radius: 0 4px 4px 0;
+        border-right: 1px solid rgba(195, 198, 203, 1);
+        border-top: 1px solid rgba(195, 198, 203, 1);
+        border-bottom: 1px solid rgba(195, 198, 203, 1);
+        position: absolute;
+        text-align: center;
+    }
 }
 </style>

+ 103 - 25
src/views/legendLibrary/addLegend.vue

@@ -2,7 +2,7 @@
     <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> -->
-
+            <!-- 
             <Transfer
                 :data='treeData3'
                 :linkage='false'
@@ -10,21 +10,84 @@
                 @confirm='treeConfirm3'
                 v-if='title=="" && GraphCategoryId'
                 ref='searchList'
-            />
-            <template v-else>
-                <add-form ref='add' :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>
-                </span>
-            </template>
+            />-->
+            <!-- <template v-else> -->
+            <add-form ref='add' :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>
+            </span>
+            <!-- </template> -->
         </el-dialog>
+        <TransferSelectModal
+            :modalShow='modalShow4'
+            placeholder='搜索'
+            :linkage='false'
+            :lastStage='true'
+            :data='treeData4'
+            @cancel='treeCancel'
+            @confirm='treeConfirm'
+        />
     </div>
 </template>
 
 <script>
 import addForm from './addForm'
 import addList from '../legendRules/addList'
+const dataArr = [
+    {
+        id: '0',
+        name: '顶级',
+        open: true,
+        checked: 'uncheck',
+        children: [
+            {
+                id: '1',
+                name: '一级1',
+                open: true,
+                checked: 'uncheck',
+                children: [
+                    { id: '12', name: '一二级2', checked: 'uncheck' },
+                    { id: '121', name: '一二级3', checked: 'uncheck' },
+                    { id: '122', name: '一二级4', checked: 'uncheck' },
+                    {
+                        id: '1321',
+                        name: '二级1',
+                        open: true,
+                        checked: 'uncheck',
+                        children: [
+                            { id: '13', name: '二三级2', checked: 'uncheck' },
+                            { id: '131', name: '二三级3', checked: 'uncheck' },
+                            { id: '132', name: '二三级4', checked: 'uncheck' }
+                        ]
+                    }
+                ]
+            },
+            {
+                id: '2',
+                name: '一级2',
+                open: true,
+                checked: 'uncheck',
+                children: [
+                    { id: '222', name: '二二级2', checked: 'uncheck' },
+                    { id: '2221', name: '二二级1', checked: 'uncheck' },
+                    { id: '2222', name: '二二级3', checked: 'uncheck' }
+                ]
+            },
+            {
+                id: '3',
+                name: '一级3',
+                open: true,
+                checked: 'uncheck',
+                children: [
+                    { id: '3220', name: '三二级0', checked: 'uncheck' },
+                    { id: '3221', name: '三二级1', checked: 'uncheck' },
+                    { id: '322', name: '三二级2', checked: 'uncheck' }
+                ]
+            }
+        ]
+    }
+]
 export default {
     data() {
         return {
@@ -40,17 +103,30 @@ export default {
             },
             title: '',
             GraphCategoryId: 'DTXT',
-            treeData3: []
+            modalShow4: false,
+            treeData4: dataArr
         }
     },
     components: { addForm, addList },
     methods: {
         open(row, title, GraphCategoryId) {
-            this.dialogVisible = true
             this.title = title
             this.GraphCategoryId = GraphCategoryId
             console.log(title)
-            if (title == '添加图例库') {
+            if (GraphCategoryId) {
+                //treeSelect
+                this.modalShow4 = true
+
+                this.info = {
+                    Name: '',
+                    Type: 'None',
+                    Unit: '',
+                    FillColor: '',
+                    Url: ''
+                }
+            } else if (title == '添加图例库') {
+                this.dialogVisible = true
+
                 this.info = {
                     Name: '',
                     Type: 'None',
@@ -85,14 +161,24 @@ export default {
             this.cancal()
         },
         save() {
-            this.$refs.add.saveImg()
-            this.dialogVisible = false
-            if (!this.title) {
-                this.$refs.searchList.save()
+            // FillColor,Color,Name
+            if (this.info.Name == '') {
+                this.$message.info('请填写图例名称')
+                return false
+            } else {
+                this.$refs.add.saveImg()
+                this.dialogVisible = false
+                if (!this.title) {
+                    this.$refs.searchList.save()
+                }
             }
         },
-        treeConfirm3(ids) {
+        treeConfirm(ids, dataObj) {
             console.log('确定:::', ids)
+            console.log('确定:::', dataObj)
+        },
+        treeCancel() {
+            this.modalShow4 = false
         }
     }
 }
@@ -100,14 +186,6 @@ export default {
 
 <style lang='less' scoped>
 .add-legend {
-    /deep/ .p-transfer {
-        display: block;
-        width: 90%;
-    }
-    /deep/ .p-transfer-main {
-        box-shadow: none;
-        height: 479px;
-    }
 }
 </style>
 <style lang='less'>

+ 0 - 1
src/views/legendRules/addList.vue

@@ -36,7 +36,6 @@ export default {
             }
             this.data = []
             getTransfer({ getParams }).then(res => {
-                debugger
                 console.log(res)
                 let content = res.Content
                 content.forEach(el => {

+ 1 - 1
vue.config.js

@@ -45,4 +45,4 @@ module.exports = {
     },
     lintOnSave: false,
     publicPath: '/',
-}
+}