|
@@ -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'>
|