5035e007 by 任超

style:加载动画

1 parent a43f28a2
...@@ -15,7 +15,9 @@ export function getQlxxDictList (data) { ...@@ -15,7 +15,9 @@ export function getQlxxDictList (data) {
15 data 15 data
16 }) 16 })
17 } 17 }
18 // 获取字典子级列表 18 /*
19 获取字典子级列表
20 */
19 export function getChildDictList (bsmDict) { 21 export function getChildDictList (bsmDict) {
20 return request({ 22 return request({
21 url: '/sys/dict/getChildDictList', 23 url: '/sys/dict/getChildDictList',
...@@ -25,3 +27,13 @@ export function getChildDictList (bsmDict) { ...@@ -25,3 +27,13 @@ export function getChildDictList (bsmDict) {
25 } 27 }
26 }) 28 })
27 } 29 }
30 /*
31 编辑字典数据
32 */
33 export function editDictNode (data) {
34 return request({
35 url: '/sys/dict/editDictNode',
36 method: 'post',
37 data
38 })
39 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -10,9 +10,11 @@ ...@@ -10,9 +10,11 @@
10 10
11 <template> 11 <template>
12 <div :class="['lb-table', customClass]"> 12 <div :class="['lb-table', customClass]">
13 <el-table v-if="!heightNumSetting" ref="elTable" :border='border' :row-class-name="tableRowClassName" 13 <el-table v-if="!heightNumSetting" ref="elTable" :border='border' v-loading="loading" element-loading-text="拼命加载中"
14 :show-header='showHeader' :header-cell-style="{ background: '#f5f7fa' }" v-bind="$attrs" :height="tableHeight" 14 element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)"
15 v-on="$listeners" :data="data" style="width: 100%" :span-method="this.merge ? this.mergeMethod : this.spanMethod"> 15 :row-class-name="tableRowClassName" :show-header='showHeader' :header-cell-style="{ background: '#f5f7fa' }"
16 v-bind="$attrs" :height="tableHeight" v-on="$listeners" :data="data" style="width: 100%"
17 :span-method="this.merge ? this.mergeMethod : this.spanMethod">
16 <lb-column v-bind="$attrs" v-for="(item, index) in column" :key="index" :column="item"> 18 <lb-column v-bind="$attrs" v-for="(item, index) in column" :key="index" :column="item">
17 </lb-column> 19 </lb-column>
18 </el-table> 20 </el-table>
...@@ -39,6 +41,10 @@ export default { ...@@ -39,6 +41,10 @@ export default {
39 column: Array, 41 column: Array,
40 data: Array, 42 data: Array,
41 spanMethod: Function, 43 spanMethod: Function,
44 loading: {
45 type: Boolean,
46 default: false,
47 },
42 pagination: { 48 pagination: {
43 type: Boolean, 49 type: Boolean,
44 default: true, 50 default: true,
......
1 <template> 1 <template>
2 <!-- 编辑 --> 2 <!-- 编辑 -->
3 <dialogBox submitForm="submitForm" @closeDialog="closeDialog" v-model="myValue" title="字典信息"> 3 <dialogBox submitForm="submitForm" @closeDialog="closeDialog" @submitForm="handleSubmit" v-model="myValue"
4 :isSave="details.isenable == 1" title="字典信息" :saveloding="saveloding">
4 <el-form :model="ruleForm" ref="ruleForm" label-width="120px"> 5 <el-form :model="ruleForm" ref="ruleForm" label-width="120px">
5 <el-row :gutter="20"> 6 <el-row :gutter="20">
6 <el-col :span="6"> 7 <el-col :span="6">
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
23 24
24 <script> 25 <script>
25 import { getUuid, upward, down, removeTreeListItem } from '@/utils/operation' 26 import { getUuid, upward, down, removeTreeListItem } from '@/utils/operation'
27 import { editDictNode } from '@/api/dict'
26 export default { 28 export default {
27 props: { 29 props: {
28 value: { type: Boolean, default: false }, 30 value: { type: Boolean, default: false },
...@@ -40,7 +42,8 @@ export default { ...@@ -40,7 +42,8 @@ export default {
40 dcode: '', 42 dcode: '',
41 dname: '' 43 dname: ''
42 }, 44 },
43 column: [ 45 column: [],
46 columns: [
44 { 47 {
45 width: '60', 48 width: '60',
46 renderHeader: (h, scope) => { 49 renderHeader: (h, scope) => {
...@@ -166,6 +169,7 @@ export default { ...@@ -166,6 +169,7 @@ export default {
166 } 169 }
167 ], 170 ],
168 tableData: [], 171 tableData: [],
172 saveloding: false
169 } 173 }
170 }, 174 },
171 watch: { 175 watch: {
...@@ -176,7 +180,9 @@ export default { ...@@ -176,7 +180,9 @@ export default {
176 handler: function (newValue) { 180 handler: function (newValue) {
177 this.tableData = _.cloneDeep(newValue.dataList) 181 this.tableData = _.cloneDeep(newValue.dataList)
178 if (newValue.isenable == 2) { 182 if (newValue.isenable == 2) {
179 this.column = this.column.slice(0, 3) 183 this.column = this.columns.slice(0, 3)
184 } else {
185 this.column = this.columns
180 } 186 }
181 this.ruleForm = newValue.rowData 187 this.ruleForm = newValue.rowData
182 this.addIndexes() 188 this.addIndexes()
...@@ -206,7 +212,18 @@ export default { ...@@ -206,7 +212,18 @@ export default {
206 handleMinus (index, row) { 212 handleMinus (index, row) {
207 removeTreeListItem(this.tableData, row.bsmDict) 213 removeTreeListItem(this.tableData, row.bsmDict)
208 }, 214 },
209 async handleSubmit () { 215 handleSubmit () {
216 this.saveloding = true
217 editDictNode({
218 bsmDict: this.details.rowData.bsmDict,
219 typeid: this.details.rowData.typeid,
220 children: this.tableData
221 }).then(res => {
222 if (res.code === 200) {
223 this.saveloding = false
224 this.$emit('input', false)
225 }
226 })
210 }, 227 },
211 closeDialog () { 228 closeDialog () {
212 this.$emit('input', false) 229 this.$emit('input', false)
...@@ -248,6 +265,7 @@ export default { ...@@ -248,6 +265,7 @@ export default {
248 } 265 }
249 ) 266 )
250 this.addIndexes() 267 this.addIndexes()
268 this.key++
251 }, 269 },
252 // 上移下移 270 // 上移下移
253 moveUpward (index, row) { 271 moveUpward (index, row) {
......
...@@ -25,9 +25,9 @@ ...@@ -25,9 +25,9 @@
25 </div> 25 </div>
26 <!-- 表格 --> 26 <!-- 表格 -->
27 <div class="from-clues-content"> 27 <div class="from-clues-content">
28 <lb-table :page-size="pageData.pageSize" :current-page.sync="pageData.currentPage" :total="tableData.total" 28 <lb-table :page-size="pageData.pageSize" :loading="loading" :current-page.sync="pageData.currentPage"
29 @size-change="handleSizeChange" @p-current-change="handleCurrentChange" :column="tableData.columns" 29 :total="tableData.total" @size-change="handleSizeChange" @p-current-change="handleCurrentChange"
30 :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" /> 33 <editDialog v-model="isDialog" :details="details" />
...@@ -49,6 +49,7 @@ export default { ...@@ -49,6 +49,7 @@ export default {
49 }, 49 },
50 data () { 50 data () {
51 return { 51 return {
52 loading: false,
52 isDialog: false, 53 isDialog: false,
53 details: { 54 details: {
54 dataList: [], 55 dataList: [],
...@@ -69,7 +70,9 @@ export default { ...@@ -69,7 +70,9 @@ export default {
69 methods: { 70 methods: {
70 // 初始化数据 71 // 初始化数据
71 fetchData () { 72 fetchData () {
73 this.loading = true
72 getQlxxDictList({ ...this.ruleForm, ...this.pageData }).then(res => { 74 getQlxxDictList({ ...this.ruleForm, ...this.pageData }).then(res => {
75 this.loading = false
73 let { records, total } = res.result 76 let { records, total } = res.result
74 this.tableData.data = records 77 this.tableData.data = records
75 this.tableData.total = total 78 this.tableData.total = total
......