afe73a7d by 任超

style:字典

1 parent 6dbd007b
...@@ -5,4 +5,4 @@ NODE_ENV=development ...@@ -5,4 +5,4 @@ NODE_ENV=development
5 VUE_APP_BASE_API = '/dev-api' 5 VUE_APP_BASE_API = '/dev-api'
6 6
7 # 开发环境 7 # 开发环境
8 VUE_APP_API_BASE_URL = 'http://192.168.2.88:8009' 8 VUE_APP_API_BASE_URL = 'http://192.168.2.95:8009'
......
...@@ -8,4 +8,20 @@ export function getAllDict () { ...@@ -8,4 +8,20 @@ export function getAllDict () {
8 method: 'post' 8 method: 'post'
9 }) 9 })
10 } 10 }
11 11 export function getQlxxDictList (data) {
12 return request({
13 url: '/sys/dict/getQlxxDictList',
14 method: 'post',
15 data
16 })
17 }
18 // 获取字典子级列表
19 export function getChildDictList (bsmDict) {
20 return request({
21 url: '/sys/dict/getChildDictList',
22 method: 'get',
23 params: {
24 bsmDict: bsmDict
25 }
26 })
27 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -323,3 +323,34 @@ aside { ...@@ -323,3 +323,34 @@ aside {
323 background-color: #fff; 323 background-color: #fff;
324 cursor: not-allowed 324 cursor: not-allowed
325 } 325 }
326
327 .allow,
328 .prohibit {
329 position: relative;
330 width: 60px;
331 margin: 0 auto;
332 }
333
334 .allow::before {
335 content: '';
336 position: absolute;
337 left: 5px;
338 top: 45%;
339 background-color: $green;
340 display: inline-block; // 此句为css样式展示重点🏁
341 width: 5px;
342 height: 5px;
343 border-radius: 50%;
344 }
345
346 .prohibit::before {
347 content: '';
348 position: absolute;
349 left: 5px;
350 top: 45%;
351 background-color: $pink;
352 display: inline-block; // 此句为css样式展示重点🏁
353 width: 5px;
354 height: 5px;
355 border-radius: 50%;
356 }
...\ No newline at end of file ...\ No newline at end of file
......
1 <template> 1 <template>
2 <!-- 编辑 --> 2 <!-- 编辑 -->
3 <dialogBox submitForm="submitForm" @closeDialog="closeDialog" v-model="myValue" title="字典信息"> 3 <dialogBox submitForm="submitForm" @closeDialog="closeDialog" v-model="myValue" :isSave="!details.isenable == 2"
4 title="字典信息">
4 <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px"> 5 <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px">
5 <el-row :gutter="20"> 6 <el-row :gutter="20">
6 <el-col :span="12"> 7 <el-col :span="12">
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
15 </el-col> 16 </el-col>
16 </el-row> 17 </el-row>
17 </el-form> 18 </el-form>
18 <lb-table :column="column" :heightNum="520" :key="key" :expand-row-keys="keyList" row-key="dictid" 19 <lb-table :column="column" :heightNum="500" :key="key" :expand-row-keys="keyList" row-key="bsmDict"
19 :tree-props="{ children: 'children' }" :pagination="false" :data="tableData"> 20 :tree-props="{ children: 'children' }" :pagination="false" :data="tableData">
20 </lb-table> 21 </lb-table>
21 </dialogBox> 22 </dialogBox>
...@@ -25,6 +26,10 @@ ...@@ -25,6 +26,10 @@
25 export default { 26 export default {
26 props: { 27 props: {
27 value: { type: Boolean, default: false }, 28 value: { type: Boolean, default: false },
29 details: {
30 type: Object,
31 default: {}
32 }
28 }, 33 },
29 data () { 34 data () {
30 return { 35 return {
...@@ -39,7 +44,13 @@ export default { ...@@ -39,7 +44,13 @@ export default {
39 { 44 {
40 width: '60', 45 width: '60',
41 renderHeader: (h, scope) => { 46 renderHeader: (h, scope) => {
42 return <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i> 47 return (<div>
48 {
49 this.details.isenable == 2 ?
50 <span>序号</span> :
51 <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i>
52 }
53 </div>)
43 }, 54 },
44 render: (h, scope) => { 55 render: (h, scope) => {
45 return ( 56 return (
...@@ -53,12 +64,12 @@ export default { ...@@ -53,12 +64,12 @@ export default {
53 render: (h, scope) => { 64 render: (h, scope) => {
54 return ( 65 return (
55 <div> 66 <div>
56 <el-input placeholder="字典项编码" v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]} 67 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]}
57 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} 68 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
58 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 69 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
59 70
60 71
61 <el-input placeholder="字典项编码" v-show={!scope.row.codeShow} value={scope.row[scope.column.property]} 72 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={!scope.row.codeShow} value={scope.row[scope.column.property]}
62 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} 73 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
63 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 74 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
64 </div> 75 </div>
...@@ -71,11 +82,11 @@ export default { ...@@ -71,11 +82,11 @@ export default {
71 render: (h, scope) => { 82 render: (h, scope) => {
72 return ( 83 return (
73 <div> 84 <div>
74 <el-input placeholder="字典项编码" v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]} 85 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]}
75 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} 86 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
76 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 87 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
77 88
78 <el-input placeholder="字典项名称" v-show={!scope.row.nameShow} value={scope.row[scope.column.property]} 89 <el-input placeholder="字典项名称" disabled={this.details.isenable == 2} v-show={!scope.row.nameShow} value={scope.row[scope.column.property]}
79 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} 90 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
80 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 91 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
81 </div> 92 </div>
...@@ -115,6 +126,16 @@ export default { ...@@ -115,6 +126,16 @@ export default {
115 watch: { 126 watch: {
116 value (val) { 127 value (val) {
117 this.myValue = val 128 this.myValue = val
129 },
130 details: {
131 handler: function (newValue) {
132 this.tableData = newValue.dataList
133 if (newValue.isenable == 2) {
134 this.column = this.column.slice(0, 3)
135 }
136 this.addIndexes()
137 },
138 deep: true
118 } 139 }
119 }, 140 },
120 methods: { 141 methods: {
......
...@@ -23,20 +23,24 @@ class data extends filter { ...@@ -23,20 +23,24 @@ class data extends filter {
23 } 23 }
24 }, 24 },
25 { 25 {
26 prop: "zdlxbm", 26 prop: "dcode",
27 label: "字典类型编码", 27 label: "字典类型编码",
28 }, 28 },
29 { 29 {
30 prop: "zdlxmc", 30 prop: "dname",
31 label: "字典类型名称", 31 label: "字典类型名称",
32 }, 32 },
33 { 33 {
34 prop: "sfyxxg",
35 label: "是否允许修改", 34 label: "是否允许修改",
35 width: '150',
36 render: (h, scope) => { 36 render: (h, scope) => {
37 return ( 37 return (
38 <div> 38 <div>
39 {scope.row.sfyxxg} 39 {
40 scope.row.sfyxxg == '1' ?
41 <div class='allow'>允许</div> :
42 <div class='prohibit'>禁止</div>
43 }
40 </div> 44 </div>
41 ) 45 )
42 } 46 }
...@@ -49,7 +53,11 @@ class data extends filter { ...@@ -49,7 +53,11 @@ class data extends filter {
49 render: (h, scope) => { 53 render: (h, scope) => {
50 return ( 54 return (
51 <div> 55 <div>
52 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope) }}>修改</el-button> 56 {
57 scope.row.sfyxxg == '1' ?
58 <el-button type="text" icon="el-icon-edit-outline" onClick={() => { vm.editClick(scope.row, 1) }}>修改</el-button> :
59 <el-button type="text" icon="el-icon-view" onClick={() => { vm.editClick(scope.row, 2) }}>查看</el-button>
60 }
53 </div> 61 </div>
54 ) 62 )
55 } 63 }
......
...@@ -2,21 +2,21 @@ ...@@ -2,21 +2,21 @@
2 <div class="from-clues"> 2 <div class="from-clues">
3 <!-- 表单部分 --> 3 <!-- 表单部分 -->
4 <div class="from-clues-header"> 4 <div class="from-clues-header">
5 <el-form :model="ruleForm" ref="ruleForm"> 5 <el-form :model="ruleForm">
6 <el-row> 6 <el-row>
7 <el-col :span="6"> 7 <el-col :span="6">
8 <el-form-item label="字典类型编码"> 8 <el-form-item label="字典类型编码">
9 <el-input v-model="ruleForm.zdlxbm" placeholder="字典类型编码"></el-input> 9 <el-input v-model="ruleForm.dcode" placeholder="字典类型编码"></el-input>
10 </el-form-item> 10 </el-form-item>
11 </el-col> 11 </el-col>
12 <el-col :span="6"> 12 <el-col :span="6">
13 <el-form-item label="字典类型名称"> 13 <el-form-item label="字典类型名称">
14 <el-input v-model="ruleForm.zdlxmc" placeholder="字典类型名称"></el-input> 14 <el-input v-model="ruleForm.dname" placeholder="字典类型名称"></el-input>
15 </el-form-item> 15 </el-form-item>
16 </el-col> 16 </el-col>
17 <el-col :span="12" class="btnCol"> 17 <el-col :span="12" class="btnCol">
18 <el-form-item> 18 <el-form-item>
19 <el-button type="primary" @click="fetchData()">查询</el-button> 19 <el-button type="primary" @click="fetchData">查询</el-button>
20 <el-button @click="moreQueryClick()">高级查询</el-button> 20 <el-button @click="moreQueryClick()">高级查询</el-button>
21 </el-form-item> 21 </el-form-item>
22 </el-col> 22 </el-col>
...@@ -30,11 +30,12 @@ ...@@ -30,11 +30,12 @@
30 :data="tableData.data"> 30 :data="tableData.data">
31 </lb-table> 31 </lb-table>
32 </div> 32 </div>
33 <editDialog v-model="isDialog" /> 33 <editDialog v-model="isDialog" :details="details" />
34 </div> 34 </div>
35 </template> 35 </template>
36 <script> 36 <script>
37 import table from "@/utils/mixin/table" 37 import table from "@/utils/mixin/table"
38 import { getQlxxDictList, getChildDictList } from "@/api/dict.js"
38 import { datas, sendThis } from "./dictionaries" 39 import { datas, sendThis } from "./dictionaries"
39 import editDialog from "./components/editDialog.vue" 40 import editDialog from "./components/editDialog.vue"
40 export default { 41 export default {
...@@ -49,30 +50,40 @@ export default { ...@@ -49,30 +50,40 @@ export default {
49 data () { 50 data () {
50 return { 51 return {
51 isDialog: false, 52 isDialog: false,
53 details: {
54 dataList: [],
55 isenable: 1
56 },
52 ruleForm: { 57 ruleForm: {
53 zdlxbm: '', 58 dcode: '',
54 zdlxmc: '' 59 dname: ''
55 }, 60 },
56 tableData: { 61 tableData: {
57 total: 0, 62 total: 0,
58 columns: datas.columns(), 63 columns: datas.columns(),
59 data: [ 64 data: []
60 {
61 zdlxbm: "66666666666666",
62 }
63 ]
64 } 65 }
65 } 66 }
66 }, 67 },
67 methods: { 68 methods: {
68 // 初始化数据 69 // 初始化数据
69 fetchData () { 70 fetchData () {
71 getQlxxDictList({ ...this.ruleForm, ...this.pageData }).then(res => {
72 let { records, total } = res.result
73 this.tableData.data = records
74 this.tableData.total = total
75 })
70 }, 76 },
71 moreQueryClick () { }, 77 moreQueryClick () { },
72 editClick () { 78 editClick (row, val) {
79 this.details.isenable = val
80 getChildDictList(row.bsmDict).then(res => {
73 this.isDialog = true 81 this.isDialog = true
82 let { result } = res
83 this.details.dataList = result
84 })
85 }
74 } 86 }
75 },
76 }; 87 };
77 </script> 88 </script>
78 <style scoped lang="scss"> 89 <style scoped lang="scss">
......