bd208a6f by renchao@pashanhoo.com

style:系统管理

1 parent 524a0a70
1 <template> 1 <template>
2 <!-- 编辑 --> 2 <div>
3 <dialogBox submitForm="submitForm" @closeDialog="closeDialog" @submitForm="handleSubmit" width="80%" v-model="myValue"
4 :isSave="details.isenable == 1" title="字典信息">
5 <el-form :model="ruleForm" ref="ruleForm" label-width="100px"> 3 <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
6 <el-row :gutter="20"> 4 <el-row :gutter="20">
7 <el-col :span="4"> 5 <el-col :span="4">
...@@ -19,24 +17,27 @@ ...@@ -19,24 +17,27 @@
19 <lb-table :column="column" class="loadingtext" :heightNum="420" :key="key" :expand-row-keys="keyList" 17 <lb-table :column="column" class="loadingtext" :heightNum="420" :key="key" :expand-row-keys="keyList"
20 row-key="bsmDict" :tree-props="{ children: 'children' }" :pagination="false" :data="tableData"> 18 row-key="bsmDict" :tree-props="{ children: 'children' }" :pagination="false" :data="tableData">
21 </lb-table> 19 </lb-table>
22 </dialogBox> 20
21 <div class="text-center">
22 <el-button @click="$popupCacel">取消</el-button>
23 <el-button type="primary" @click="handleSubmit">确定</el-button>
24 </div>
25 </div>
23 </template> 26 </template>
24 27
25 <script> 28 <script>
26 import { getUuid, judgeSort, realMove, findParents, removeTreeListItem } from '@/utils/operation' 29 import { getUuid, judgeSort, realMove, findParents, removeTreeListItem } from '@/utils/operation'
27 import { editDictNode, getChildDictList } from '@/api/user' 30 import { editDictNode, getChildDictList } from '@/api/user'
28 export default { 31 export default {
29 props: { 32 props: {
30 value: { type: Boolean, default: false }, 33 formData: {
31 details: {
32 type: Object, 34 type: Object,
33 default: {} 35 default: () => { }
34 } 36 }
35 }, 37 },
36 data () { 38 data () {
37 return { 39 return {
38 key: 0, 40 key: 0,
39 myValue: this.value,
40 keyList: [], 41 keyList: [],
41 ruleForm: { 42 ruleForm: {
42 dcode: '', 43 dcode: '',
...@@ -49,7 +50,7 @@ ...@@ -49,7 +50,7 @@
49 renderHeader: (h, scope) => { 50 renderHeader: (h, scope) => {
50 return (<div> 51 return (<div>
51 { 52 {
52 this.details.isenable === '0' ? 53 this.formData.isenable === '0' ?
53 <span>序号</span> : 54 <span>序号</span> :
54 <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i> 55 <i class="el-icon-plus" onClick={() => { this.handleAdd() }} style="cursor:pointer;color:#409EFF"></i>
55 } 56 }
...@@ -68,12 +69,12 @@ ...@@ -68,12 +69,12 @@
68 render: (h, scope) => { 69 render: (h, scope) => {
69 return ( 70 return (
70 <div> 71 <div>
71 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]} 72 <el-input placeholder="字典项编码" disabled={this.formData.isenable == 2} v-show={scope.row.codeShow} v-fo value={scope.row[scope.column.property]}
72 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} 73 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
73 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> 74 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
74 75
75 76
76 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={!scope.row.codeShow} value={scope.row[scope.column.property]} 77 <el-input placeholder="字典项编码" disabled={this.formData.isenable == 2} v-show={!scope.row.codeShow} value={scope.row[scope.column.property]}
77 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }} 78 onFocus={() => { this.itemShowFalse(); scope.row.codeShow = true; }}
78 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> 79 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
79 </div> 80 </div>
...@@ -86,11 +87,11 @@ ...@@ -86,11 +87,11 @@
86 render: (h, scope) => { 87 render: (h, scope) => {
87 return ( 88 return (
88 <div> 89 <div>
89 <el-input placeholder="字典项编码" disabled={this.details.isenable == 2} v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]} 90 <el-input placeholder="字典项编码" disabled={this.formData.isenable == 2} v-show={scope.row.nameShow} v-fo value={scope.row[scope.column.property]}
90 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} 91 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
91 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> 92 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
92 93
93 <el-input placeholder="字典项名称" disabled={this.details.isenable == 2} v-show={!scope.row.nameShow} value={scope.row[scope.column.property]} 94 <el-input placeholder="字典项名称" disabled={this.formData.isenable == 2} v-show={!scope.row.nameShow} value={scope.row[scope.column.property]}
94 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }} 95 onFocus={() => { this.itemShowFalse(); scope.row.nameShow = true; }}
95 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> 96 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
96 </div> 97 </div>
...@@ -104,11 +105,11 @@ ...@@ -104,11 +105,11 @@
104 render: (h, scope) => { 105 render: (h, scope) => {
105 return ( 106 return (
106 <div> 107 <div>
107 <el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={scope.row.normcodeShow} v-fo value={scope.row[scope.column.property]} 108 <el-input placeholder="部标编码" disabled={this.formData.isenable == 2} v-show={scope.row.normcodeShow} v-fo value={scope.row[scope.column.property]}
108 onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }} 109 onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }}
109 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> 110 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
110 111
111 <el-input placeholder="部标编码" disabled={this.details.isenable == 2} v-show={!scope.row.normcodeShow} value={scope.row[scope.column.property]} 112 <el-input placeholder="部标编码" disabled={this.formData.isenable == 2} v-show={!scope.row.normcodeShow} value={scope.row[scope.column.property]}
112 onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }} 113 onFocus={() => { this.itemShowFalse(); scope.row.normcodeShow = true; }}
113 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input> 114 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }} maxlength='8'></el-input>
114 </div> 115 </div>
...@@ -121,11 +122,11 @@ ...@@ -121,11 +122,11 @@
121 render: (h, scope) => { 122 render: (h, scope) => {
122 return ( 123 return (
123 <div> 124 <div>
124 <el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={scope.row.normnameShow} v-fo value={scope.row[scope.column.property]} 125 <el-input placeholder="部标名称" disabled={this.formData.isenable == 2} v-show={scope.row.normnameShow} v-fo value={scope.row[scope.column.property]}
125 onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }} 126 onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }}
126 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> 127 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
127 128
128 <el-input placeholder="部标名称" disabled={this.details.isenable == 2} v-show={!scope.row.normnameShow} value={scope.row[scope.column.property]} 129 <el-input placeholder="部标名称" disabled={this.formData.isenable == 2} v-show={!scope.row.normnameShow} value={scope.row[scope.column.property]}
129 onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }} 130 onFocus={() => { this.itemShowFalse(); scope.row.normnameShow = true; }}
130 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input> 131 onInput={(val) => { scope.row[scope.column.property] = val; this.itemShowFalse(); scope.row.codeShow = true; }}></el-input>
131 </div> 132 </div>
...@@ -138,7 +139,7 @@ ...@@ -138,7 +139,7 @@
138 label: '是否禁用', 139 label: '是否禁用',
139 render: (h, scope) => { 140 render: (h, scope) => {
140 return ( 141 return (
141 <el-radio-group disabled={this.details.isenable == 2} v-model={scope.row.isenable}> 142 <el-radio-group disabled={this.formData.isenable == 2} v-model={scope.row.isenable}>
142 <el-radio label="1">启用</el-radio> 143 <el-radio label="1">启用</el-radio>
143 <el-radio label="0">禁用</el-radio> 144 <el-radio label="0">禁用</el-radio>
144 </el-radio-group> 145 </el-radio-group>
...@@ -173,39 +174,28 @@ ...@@ -173,39 +174,28 @@
173 tableData: [] 174 tableData: []
174 } 175 }
175 }, 176 },
176 watch: { 177 mounted () {
177 value (val) { 178 if (this.formData?.bsmDict) {
178 this.myValue = val
179 },
180 'details.bsmDict': {
181 handler: function (newValue) {
182 if (!this.value) return
183 this.$startLoading(); 179 this.$startLoading();
184 getChildDictList(newValue).then(res => { 180 getChildDictList(this.formData.bsmDict).then(res => {
185 this.$endLoading(); 181 this.$endLoading();
186 let { result } = res 182 let { result } = res
187 this.tableData = result ? result : [] 183 this.tableData = result ? result : []
188 this.tableData.forEach((item, index) => { 184 this.tableData.forEach((item, index) => {
189 item.index = index + 1 185 item.index = index + 1
190 }) 186 })
187 this.tableData = judgeSort(this.tableData)
191 }) 188 })
192 }, 189 }
193 immediate: true 190 if (this.formData?.isenable == 2) {
194 },
195 details: {
196 handler: function (newValue) {
197 if (newValue.isenable == 2) {
198 this.column = this.columns.slice(0, 6) 191 this.column = this.columns.slice(0, 6)
199 } else { 192 } else {
200 this.column = this.columns 193 this.column = this.columns
201 } 194 }
202 this.ruleForm = newValue.rowData 195 this.ruleForm = this.formData.rowData
203 this.addIndexes() 196 this.addIndexes()
204 this.key++ 197 this.key++
205 }, 198 },
206 deep: true
207 }
208 },
209 methods: { 199 methods: {
210 // 添加索引 200 // 添加索引
211 addIndexes (data = this.tableData, isAdd = true) { 201 addIndexes (data = this.tableData, isAdd = true) {
...@@ -256,11 +246,13 @@ ...@@ -256,11 +246,13 @@
256 }) 246 })
257 }, 247 },
258 handleSubmit () { 248 handleSubmit () {
249 this.$startLoading();
259 editDictNode({ 250 editDictNode({
260 bsmDict: this.details.rowData.bsmDict, 251 bsmDict: this.formData.rowData.bsmDict,
261 typeid: this.details.rowData.typeid, 252 typeid: this.formData.rowData.typeid,
262 children: this.tableData 253 children: this.tableData
263 }).then(res => { 254 }).then(res => {
255 this.$endLoading();
264 if (res.code === 200) { 256 if (res.code === 200) {
265 this.$message({ 257 this.$message({
266 message: '修改成功', 258 message: '修改成功',
...@@ -268,11 +260,10 @@ ...@@ -268,11 +260,10 @@
268 }) 260 })
269 this.$emit('input', false) 261 this.$emit('input', false)
270 } 262 }
263 }).catch((error) => {
264 this.$endLoading();
271 }) 265 })
272 }, 266 },
273 closeDialog () {
274 this.$emit('input', false)
275 },
276 // 增加下级 267 // 增加下级
277 handleAddSubordinate (row) { 268 handleAddSubordinate (row) {
278 if (!row.children) { 269 if (!row.children) {
...@@ -326,12 +317,13 @@ ...@@ -326,12 +317,13 @@
326 this.keyList = id 317 this.keyList = id
327 } 318 }
328 } 319 }
329 } 320 }
330 </script> 321 </script>
331 <style rel="stylesheet/scss" lang="scss" scoped> 322 <style rel="stylesheet/scss" lang="scss" scoped>
332 @import "~@/styles/dialogBoxheader.scss"; 323 @import "~@/styles/dialogBoxheader.scss";
333 /deep/.el-radio { 324
325 /deep/.el-radio {
334 margin-right: 5px !important; 326 margin-right: 5px !important;
335 } 327 }
336 </style> 328 </style>
337 329
......
1 /*
2 * @Description:
3 * @Autor: renchao
4 * @LastEditTime: 2023-04-11 10:49:40
5 */
1 import filter from '@/utils/filter.js' 6 import filter from '@/utils/filter.js'
2 let vm = null 7 let vm = null
3 8
...@@ -32,7 +37,6 @@ class data extends filter { ...@@ -32,7 +37,6 @@ class data extends filter {
32 }, 37 },
33 { 38 {
34 label: "是否允许修改", 39 label: "是否允许修改",
35 width: '110',
36 render: (h, scope) => { 40 render: (h, scope) => {
37 return ( 41 return (
38 <div> 42 <div>
...@@ -47,9 +51,7 @@ class data extends filter { ...@@ -47,9 +51,7 @@ class data extends filter {
47 }, 51 },
48 { 52 {
49 label: '操作', 53 label: '操作',
50 width: '150', 54 width: '80',
51 align: 'center',
52 fixed: 'right',
53 render: (h, scope) => { 55 render: (h, scope) => {
54 return ( 56 return (
55 <div> 57 <div>
...@@ -64,7 +66,6 @@ class data extends filter { ...@@ -64,7 +66,6 @@ class data extends filter {
64 } 66 }
65 ] 67 ]
66 } 68 }
67
68 } 69 }
69 let datas = new data() 70 let datas = new data()
70 export { 71 export {
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
30 :column="tableData.columns" :data="tableData.data"> 30 :column="tableData.columns" :data="tableData.data">
31 </lb-table> 31 </lb-table>
32 </div> 32 </div>
33 <editDialog v-model="isDialog" :details="details" />
34 </div> 33 </div>
35 </template> 34 </template>
36 <script> 35 <script>
...@@ -49,7 +48,6 @@ export default { ...@@ -49,7 +48,6 @@ export default {
49 }, 48 },
50 data () { 49 data () {
51 return { 50 return {
52 isDialog: false,
53 details: { 51 details: {
54 bsmDict: '', 52 bsmDict: '',
55 isenable: 1, 53 isenable: 1,
...@@ -103,11 +101,12 @@ export default { ...@@ -103,11 +101,12 @@ export default {
103 }); 101 });
104 }); 102 });
105 }, 103 },
104 // 修改
106 editClick (row, val) { 105 editClick (row, val) {
107 this.details.rowData = row 106 this.details.rowData = row
108 this.details.isenable = val 107 this.details.isenable = val
109 this.details.bsmDict = row.bsmDict 108 this.details.bsmDict = row.bsmDict
110 this.isDialog = true 109 this.$popupDialog("字典信息", "system/dictionaries/components/editDialog", this.details)
111 } 110 }
112 } 111 }
113 } 112 }
......