mooho-base-admin-plus 2.10.79 → 2.10.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/history.md +2 -0
- package/package/mooho-base-admin-plus.min.esm.js +116 -85
- package/package/mooho-base-admin-plus.min.js +3 -3
- package/package.json +1 -1
- package/src/App.vue +31 -0
- package/src/components/input/dialog-select.vue +59 -65
- package/src/components/view/view-table-excel.vue +24 -6
- package/src/mixins/page.js +17 -15
- package/token.txt +1 -1
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
<div id="app">
|
|
3
3
|
<router-view />
|
|
4
4
|
<loader />
|
|
5
|
+
<modal-table ref="multiDialogTable" :autoLoad="false" :select-enable="true" :check-cross-page="true" :footer-enable="true">
|
|
6
|
+
<template #footer>
|
|
7
|
+
<Button type="primary" custom-icon="fa fa-save" @click="multiSave">{{ $t('Front_Btn_OK') }}</Button>
|
|
8
|
+
<Button type="default" custom-icon="fa fa-times" @click="$refs.dialogTable.close()">{{ $t('Front_Btn_Close') }}</Button>
|
|
9
|
+
</template>
|
|
10
|
+
</modal-table>
|
|
11
|
+
<modal-table ref="dialogTable" :autoLoad="false" :check-cross-page="true" @on-row-dblclick="dialogTableRowDblclick">
|
|
12
|
+
<template #command="{ row }">
|
|
13
|
+
<Button size="small" type="primary" custom-icon="fa fa-check" @click="dialogCheck(row)">{{ $t('Front_Btn_Select') }}</Button>
|
|
14
|
+
</template>
|
|
15
|
+
</modal-table>
|
|
5
16
|
</div>
|
|
6
17
|
</template>
|
|
7
18
|
<script>
|
|
@@ -17,6 +28,12 @@
|
|
|
17
28
|
export default {
|
|
18
29
|
name: 'app',
|
|
19
30
|
components: { loader },
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
dialogCheck: null,
|
|
34
|
+
multiSave: null
|
|
35
|
+
};
|
|
36
|
+
},
|
|
20
37
|
computed: {},
|
|
21
38
|
methods: {
|
|
22
39
|
...mapMutations('admin/layout', ['setDevice', 'setBodyHeight']),
|
|
@@ -37,6 +54,20 @@
|
|
|
37
54
|
},
|
|
38
55
|
handleSetBodyHeight() {
|
|
39
56
|
this.setBodyHeight(document.body.offsetHeight);
|
|
57
|
+
},
|
|
58
|
+
// 打开多选表格
|
|
59
|
+
openMultiDialogTable(param, multiSave) {
|
|
60
|
+
this.multiSave = multiSave;
|
|
61
|
+
this.$refs.multiDialogTable.open(param);
|
|
62
|
+
},
|
|
63
|
+
// 打开单选表格
|
|
64
|
+
openDialogTable(param, dialogCheck) {
|
|
65
|
+
this.dialogCheck = dialogCheck;
|
|
66
|
+
this.$refs.dialogTable.open(param);
|
|
67
|
+
},
|
|
68
|
+
// 双击行选中
|
|
69
|
+
dialogTableRowDblclick(row) {
|
|
70
|
+
this.dialogCheck(row);
|
|
40
71
|
}
|
|
41
72
|
},
|
|
42
73
|
mounted() {
|
|
@@ -14,23 +14,6 @@
|
|
|
14
14
|
<Button :size="size" custom-icon="fa fa-search" @click="dialogSelectOpen()"></Button>
|
|
15
15
|
</template>
|
|
16
16
|
</Input>
|
|
17
|
-
<modal-table
|
|
18
|
-
ref="dialogTable"
|
|
19
|
-
:view-code="source"
|
|
20
|
-
:autoLoad="false"
|
|
21
|
-
:select-enable="multi"
|
|
22
|
-
:check-cross-page="true"
|
|
23
|
-
:footer-enable="multi"
|
|
24
|
-
@on-row-dblclick="dialogTableRowDblclick"
|
|
25
|
-
>
|
|
26
|
-
<template #command="{ row }">
|
|
27
|
-
<Button size="small" v-if="!multi" type="primary" custom-icon="fa fa-check" @click="dialogCheck(row)">{{ $t('Front_Btn_Select') }}</Button>
|
|
28
|
-
</template>
|
|
29
|
-
<template #footer>
|
|
30
|
-
<Button type="primary" custom-icon="fa fa-save" @click="multiSave">{{ $t('Front_Btn_OK') }}</Button>
|
|
31
|
-
<Button type="default" custom-icon="fa fa-times" @click="close()">{{ $t('Front_Btn_Close') }}</Button>
|
|
32
|
-
</template>
|
|
33
|
-
</modal-table>
|
|
34
17
|
</div>
|
|
35
18
|
</template>
|
|
36
19
|
<script>
|
|
@@ -49,7 +32,8 @@
|
|
|
49
32
|
return {
|
|
50
33
|
//changed: false,
|
|
51
34
|
selected: null,
|
|
52
|
-
selectedData: null
|
|
35
|
+
selectedData: null,
|
|
36
|
+
dialogTable: null
|
|
53
37
|
};
|
|
54
38
|
},
|
|
55
39
|
props: {
|
|
@@ -225,33 +209,66 @@
|
|
|
225
209
|
},
|
|
226
210
|
// 弹出选择框
|
|
227
211
|
dialogSelectOpen() {
|
|
228
|
-
|
|
229
|
-
// if (this.param) {
|
|
230
|
-
// // 参数完整
|
|
231
|
-
// this.loadDataEnable = true;
|
|
232
|
-
// } else {
|
|
233
|
-
// // 参数不完整
|
|
234
|
-
// this.loadDataEnable = false;
|
|
235
|
-
// }
|
|
212
|
+
let that = this.$parent;
|
|
236
213
|
|
|
237
|
-
|
|
214
|
+
while (that.$parent != null) {
|
|
215
|
+
if (that.$refs['dialogTable'] != null) {
|
|
216
|
+
break;
|
|
217
|
+
} else {
|
|
218
|
+
that = that.$parent;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
238
221
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
222
|
+
if (this.multi) {
|
|
223
|
+
this.dialogTable = that.$refs.multiDialogTable;
|
|
224
|
+
} else {
|
|
225
|
+
this.dialogTable = that.$refs.dialogTable;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
this.dialogTable.init(this.source, () => {
|
|
229
|
+
if (!this.readonly && this.source) {
|
|
230
|
+
// if (this.param) {
|
|
231
|
+
// // 参数完整
|
|
232
|
+
// this.loadDataEnable = true;
|
|
233
|
+
// } else {
|
|
234
|
+
// // 参数不完整
|
|
235
|
+
// this.loadDataEnable = false;
|
|
236
|
+
// }
|
|
237
|
+
|
|
238
|
+
//this.$refs.dialogTable.loadData();
|
|
239
|
+
|
|
240
|
+
setTimeout(async () => {
|
|
241
|
+
for (let key in this.dialogTable.filterData) {
|
|
242
|
+
delete this.dialogTable.filterData[key];
|
|
243
|
+
}
|
|
243
244
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
if (this.multi) {
|
|
246
|
+
if (this.selectedData != null) {
|
|
247
|
+
this.dialogTable.setSelected(this.selectedData);
|
|
248
|
+
} else {
|
|
249
|
+
this.dialogTable.setSelected([]);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
that.openMultiDialogTable(this.param, this.multiSave);
|
|
247
253
|
} else {
|
|
248
|
-
this
|
|
254
|
+
that.openDialogTable(this.param, this.dialogCheck);
|
|
249
255
|
}
|
|
250
|
-
}
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
},
|
|
251
260
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
261
|
+
// 弹出选择框移除内容
|
|
262
|
+
dialogSelectRemove() {
|
|
263
|
+
/**
|
|
264
|
+
* 拖动完成事件
|
|
265
|
+
* @property {object} args { index1 来源行序号, index2 目标行序号 }
|
|
266
|
+
*/
|
|
267
|
+
this.$emit('update:modelValue', null);
|
|
268
|
+
this.selected = null;
|
|
269
|
+
this.selectedData = null;
|
|
270
|
+
|
|
271
|
+
this.$emit('on-change');
|
|
255
272
|
},
|
|
256
273
|
// 弹出选择框选中
|
|
257
274
|
dialogCheck(row) {
|
|
@@ -272,23 +289,11 @@
|
|
|
272
289
|
*/
|
|
273
290
|
this.$emit('on-change', row);
|
|
274
291
|
|
|
275
|
-
this
|
|
276
|
-
},
|
|
277
|
-
// 弹出选择框移除内容
|
|
278
|
-
dialogSelectRemove() {
|
|
279
|
-
/**
|
|
280
|
-
* 拖动完成事件
|
|
281
|
-
* @property {object} args { index1 来源行序号, index2 目标行序号 }
|
|
282
|
-
*/
|
|
283
|
-
this.$emit('update:modelValue', null);
|
|
284
|
-
this.selected = null;
|
|
285
|
-
this.selectedData = null;
|
|
286
|
-
|
|
287
|
-
this.$emit('on-change');
|
|
292
|
+
this.dialogTable.close();
|
|
288
293
|
},
|
|
289
294
|
// 多选保存
|
|
290
295
|
multiSave() {
|
|
291
|
-
let selectedData = this
|
|
296
|
+
let selectedData = this.dialogTable.getSelected();
|
|
292
297
|
let data =
|
|
293
298
|
selectedData.length == 0
|
|
294
299
|
? null
|
|
@@ -321,18 +326,7 @@
|
|
|
321
326
|
*/
|
|
322
327
|
this.$emit('on-change', data, displayData);
|
|
323
328
|
|
|
324
|
-
this
|
|
325
|
-
},
|
|
326
|
-
// 关闭
|
|
327
|
-
close() {
|
|
328
|
-
this.$refs.dialogTable.close();
|
|
329
|
-
},
|
|
330
|
-
// 双击行选中
|
|
331
|
-
|
|
332
|
-
dialogTableRowDblclick(row) {
|
|
333
|
-
if (!this.multi) {
|
|
334
|
-
this.dialogCheck(row);
|
|
335
|
-
}
|
|
329
|
+
this.dialogTable.close();
|
|
336
330
|
}
|
|
337
331
|
}
|
|
338
332
|
};
|
|
@@ -280,9 +280,7 @@
|
|
|
280
280
|
column.type = 'numeric';
|
|
281
281
|
} else if (item.controlType === 'Check') {
|
|
282
282
|
column.type = 'checkbox';
|
|
283
|
-
} else if (item.controlType === 'Select') {
|
|
284
|
-
column.editor = 'select';
|
|
285
|
-
|
|
283
|
+
} else if (item.controlType === 'Select' || item.controlType == 'ComboSelect') {
|
|
286
284
|
let dataSource = [];
|
|
287
285
|
|
|
288
286
|
if (column.isStaticItem) {
|
|
@@ -366,9 +364,29 @@
|
|
|
366
364
|
}
|
|
367
365
|
}
|
|
368
366
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
367
|
+
if (item.controlType == 'Select') {
|
|
368
|
+
column.editor = 'select';
|
|
369
|
+
column.selectOptions = dataSource.map(option => {
|
|
370
|
+
return option.id;
|
|
371
|
+
});
|
|
372
|
+
} else if (item.controlType == 'ComboSelect') {
|
|
373
|
+
column.type = 'autocomplete';
|
|
374
|
+
column.dropdownMenu = true;
|
|
375
|
+
column.strict = true;
|
|
376
|
+
column.source = (query, process) => {
|
|
377
|
+
let searchResult = [];
|
|
378
|
+
if (query) {
|
|
379
|
+
const lowerQuery = query.toLowerCase();
|
|
380
|
+
searchResult = dataSource.filter(data => {
|
|
381
|
+
return data.name.toLowerCase().includes(lowerQuery);
|
|
382
|
+
});
|
|
383
|
+
} else {
|
|
384
|
+
searchResult = [...dataSource];
|
|
385
|
+
}
|
|
386
|
+
const showNames = searchResult.map(item => item.name);
|
|
387
|
+
process(showNames);
|
|
388
|
+
};
|
|
389
|
+
}
|
|
372
390
|
} else if (item.controlType === 'Date') {
|
|
373
391
|
column.type = 'date';
|
|
374
392
|
column.dateFormat = 'YYYY-MM-DD';
|
package/src/mixins/page.js
CHANGED
|
@@ -105,25 +105,27 @@ export default {
|
|
|
105
105
|
//return JSON.parse(JSON.stringify(model));
|
|
106
106
|
},
|
|
107
107
|
allow(key) {
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
if (this.userPermissions) {
|
|
109
|
+
if (key.startsWith('permission/')) {
|
|
110
|
+
// 全局权限
|
|
111
|
+
return this.userPermissions[key];
|
|
112
|
+
} else {
|
|
113
|
+
// 页面权限点
|
|
114
|
+
let url = this.$router.currentRoute.value.fullPath.substr(1).split('?')[0];
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
if (this.userPermissions[url + '$' + key] == true) {
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
118
119
|
|
|
119
|
-
|
|
120
|
+
let count = Object.keys(this.userPermissions).filter(item => item.startsWith(url + '$')).length;
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
// 未分权限点
|
|
123
|
+
if (this.userPermissions[url] == true && count == 0) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
125
126
|
|
|
126
|
-
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
127
129
|
}
|
|
128
130
|
},
|
|
129
131
|
getCache(type, id) {
|
package/token.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
echo "//registry.npmjs.org/:_authToken=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" >> .npmrc
|
|
2
|
-
npm config set //registry.npmjs.org/:_authToken=
|
|
2
|
+
npm config set //registry.npmjs.org/:_authToken=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
|