mooho-base-admin-plus 2.10.80 → 2.10.82

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "2.10.80",
4
+ "version": "2.10.82",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "license": "MIT",
7
7
  "private": false,
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: {
@@ -59,6 +43,18 @@
59
43
  modelValue: {
60
44
  type: String
61
45
  },
46
+ /**
47
+ * 原始数据
48
+ */
49
+ rawData: {
50
+ type: Object
51
+ },
52
+ /**
53
+ * 字段代码
54
+ */
55
+ columnCode: {
56
+ type: Object
57
+ },
62
58
  /**
63
59
  * 数据源
64
60
  */
@@ -188,6 +184,17 @@
188
184
  }
189
185
  });
190
186
  } else {
187
+ if (this.rawData && this.columnCode.endsWith('ID')) {
188
+ let selected = this.parseData(this.rawData, this.columnCode.substring(0, this.columnCode.length - 2));
189
+
190
+ if (selected != null) {
191
+ this.selected = this.parseData(selected, this.sourceDisplayCode);
192
+ this.selectedData = selected;
193
+
194
+ return;
195
+ }
196
+ }
197
+
191
198
  let filter = {
192
199
  page: 1,
193
200
  per: 1
@@ -225,33 +232,66 @@
225
232
  },
226
233
  // 弹出选择框
227
234
  dialogSelectOpen() {
228
- if (!this.readonly && this.source) {
229
- // if (this.param) {
230
- // // 参数完整
231
- // this.loadDataEnable = true;
232
- // } else {
233
- // // 参数不完整
234
- // this.loadDataEnable = false;
235
- // }
236
-
237
- //this.$refs.dialogTable.loadData();
238
-
239
- setTimeout(async () => {
240
- for (let key in this.$refs.dialogTable.filterData) {
241
- delete this.$refs.dialogTable.filterData[key];
242
- }
235
+ let that = this.$parent;
243
236
 
244
- if (this.multi) {
245
- if (this.selectedData != null) {
246
- this.$refs.dialogTable.setSelected(this.selectedData);
237
+ while (that.$parent != null) {
238
+ if (that.$refs['dialogTable'] != null) {
239
+ break;
240
+ } else {
241
+ that = that.$parent;
242
+ }
243
+ }
244
+
245
+ if (this.multi) {
246
+ this.dialogTable = that.$refs.multiDialogTable;
247
+ } else {
248
+ this.dialogTable = that.$refs.dialogTable;
249
+ }
250
+
251
+ this.dialogTable.init(this.source, () => {
252
+ if (!this.readonly && this.source) {
253
+ // if (this.param) {
254
+ // // 参数完整
255
+ // this.loadDataEnable = true;
256
+ // } else {
257
+ // // 参数不完整
258
+ // this.loadDataEnable = false;
259
+ // }
260
+
261
+ //this.$refs.dialogTable.loadData();
262
+
263
+ setTimeout(async () => {
264
+ for (let key in this.dialogTable.filterData) {
265
+ delete this.dialogTable.filterData[key];
266
+ }
267
+
268
+ if (this.multi) {
269
+ if (this.selectedData != null) {
270
+ this.dialogTable.setSelected(this.selectedData);
271
+ } else {
272
+ this.dialogTable.setSelected([]);
273
+ }
274
+
275
+ that.openMultiDialogTable(this.param, this.multiSave);
247
276
  } else {
248
- this.$refs.dialogTable.setSelected([]);
277
+ that.openDialogTable(this.param, this.dialogCheck);
249
278
  }
250
- }
279
+ });
280
+ }
281
+ });
282
+ },
251
283
 
252
- this.$refs.dialogTable.open(this.param);
253
- });
254
- }
284
+ // 弹出选择框移除内容
285
+ dialogSelectRemove() {
286
+ /**
287
+ * 拖动完成事件
288
+ * @property {object} args { index1 来源行序号, index2 目标行序号 }
289
+ */
290
+ this.$emit('update:modelValue', null);
291
+ this.selected = null;
292
+ this.selectedData = null;
293
+
294
+ this.$emit('on-change');
255
295
  },
256
296
  // 弹出选择框选中
257
297
  dialogCheck(row) {
@@ -272,23 +312,11 @@
272
312
  */
273
313
  this.$emit('on-change', row);
274
314
 
275
- this.$refs.dialogTable.close();
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');
315
+ this.dialogTable.close();
288
316
  },
289
317
  // 多选保存
290
318
  multiSave() {
291
- let selectedData = this.$refs.dialogTable.getSelected();
319
+ let selectedData = this.dialogTable.getSelected();
292
320
  let data =
293
321
  selectedData.length == 0
294
322
  ? null
@@ -321,18 +349,7 @@
321
349
  */
322
350
  this.$emit('on-change', data, displayData);
323
351
 
324
- this.$refs.dialogTable.close();
325
- },
326
- // 关闭
327
- close() {
328
- this.$refs.dialogTable.close();
329
- },
330
- // 双击行选中
331
-
332
- dialogTableRowDblclick(row) {
333
- if (!this.multi) {
334
- this.dialogCheck(row);
335
- }
352
+ this.dialogTable.close();
336
353
  }
337
354
  }
338
355
  };
@@ -292,13 +292,15 @@
292
292
  <template v-else-if="column.controlType === 'DialogSelect'">
293
293
  <dialog-select
294
294
  :model-value="parseData(data, column.code)"
295
+ :raw-data="data"
296
+ :column-code="column.code"
295
297
  @update:model-value="$event => setData(data, column.code, $event)"
296
298
  :readonly="readonly || column.isReadonly"
297
299
  :source="column.source"
298
300
  :source-data-code="column.sourceDataCode"
299
301
  :source-display-code="column.sourceDisplayCode"
300
302
  :param="getParam(data, column)"
301
- :controlWidth="column.controlWidth"
303
+ :control-width="column.controlWidth"
302
304
  @on-change="selected => onSelectDataChange(column, selected)"
303
305
  ></dialog-select>
304
306
  </template>
@@ -312,7 +314,7 @@
312
314
  :source-data-code="column.sourceDataCode"
313
315
  :source-display-code="column.sourceDisplayCode"
314
316
  :param="getParam(data, column)"
315
- :controlWidth="column.controlWidth"
317
+ :control-width="column.controlWidth"
316
318
  @on-change="selected => onSelectDataChange(column, selected)"
317
319
  ></dialog-select>
318
320
  </template>
@@ -279,6 +279,8 @@
279
279
  <template v-else-if="column.controlType === 'DialogSelect'">
280
280
  <dialog-select
281
281
  :model-value="parseData(rowData(row, index), column.code)"
282
+ :raw-data="rowData(row, index)"
283
+ :column-code="column.code"
282
284
  size="small"
283
285
  @update:model-value="$event => setData(rowData(row, index), column.code, $event)"
284
286
  :readonly="isReadonly(rowData(row, index), column)"
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"en-US",select:{placeholder:"Select",noMatch:"No matching data",loading:"Loading"},table:{noDataText:"No Data",noFilteredDataText:"No filter data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},datepicker:{selectDate:"Select date",selectTime:"Select time",startTime:"Start Time",endTime:"End Time",clear:"Clear",ok:"OK",datePanelLabel:"[mmmm] [yyyy]",month:"Month",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",year:"Year",weekStartDay:"0",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},months:{m1:"Jan",m2:"Feb",m3:"Mar",m4:"Apr",m5:"May",m6:"Jun",m7:"Jul",m8:"Aug",m9:"Sep",m10:"Oct",m11:"Nov",m12:"Dec"}},transfer:{titles:{source:"Source",target:"Target"},filterPlaceholder:"Search here",notFoundText:"Not Found"},modal:{okText:"OK",cancelText:"Cancel"},poptip:{okText:"OK",cancelText:"Cancel"},page:{prev:"Previous Page",next:"Next Page",total:"Total",item:"item",items:"items",prev5:"Previous 5 Pages",next5:"Next 5 Pages",page:"/page",goto:"Goto",p:""},rate:{star:"Star",stars:"Stars"},time:{before:" ago",after:" after",just:"just now",seconds:" seconds",minutes:" minutes",hours:" hours",days:" days"},tree:{emptyText:"No Data"}}};e(t);export{t as default};
@@ -1 +1 @@
1
- const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
1
+ const e=typeof window!="undefined";function n(i){e&&typeof window.viewuiplus!="undefined"&&("langs"in viewuiplus||(viewuiplus.langs={}),viewuiplus.langs[i.i.locale]=i)}export{n as s};
@@ -1 +1 @@
1
- import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
1
+ import{s as e}from"./lang.js";const t={i:{locale:"zh-CN",select:{placeholder:"\u8BF7\u9009\u62E9",noMatch:"\u65E0\u5339\u914D\u6570\u636E",loading:"\u52A0\u8F7D\u4E2D"},table:{noDataText:"\u6682\u65E0\u6570\u636E",noFilteredDataText:"\u6682\u65E0\u7B5B\u9009\u7ED3\u679C",confirmFilter:"\u7B5B\u9009",resetFilter:"\u91CD\u7F6E",clearFilter:"\u5168\u90E8",sumText:"\u5408\u8BA1"},datepicker:{selectDate:"\u9009\u62E9\u65E5\u671F",selectTime:"\u9009\u62E9\u65F6\u95F4",startTime:"\u5F00\u59CB\u65F6\u95F4",endTime:"\u7ED3\u675F\u65F6\u95F4",clear:"\u6E05\u7A7A",ok:"\u786E\u5B9A",datePanelLabel:"[yyyy\u5E74] [m\u6708]",month:"\u6708",month1:"1 \u6708",month2:"2 \u6708",month3:"3 \u6708",month4:"4 \u6708",month5:"5 \u6708",month6:"6 \u6708",month7:"7 \u6708",month8:"8 \u6708",month9:"9 \u6708",month10:"10 \u6708",month11:"11 \u6708",month12:"12 \u6708",year:"\u5E74",weekStartDay:"0",weeks:{sun:"\u65E5",mon:"\u4E00",tue:"\u4E8C",wed:"\u4E09",thu:"\u56DB",fri:"\u4E94",sat:"\u516D"},months:{m1:"1\u6708",m2:"2\u6708",m3:"3\u6708",m4:"4\u6708",m5:"5\u6708",m6:"6\u6708",m7:"7\u6708",m8:"8\u6708",m9:"9\u6708",m10:"10\u6708",m11:"11\u6708",m12:"12\u6708"}},transfer:{titles:{source:"\u6E90\u5217\u8868",target:"\u76EE\u7684\u5217\u8868"},filterPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",notFoundText:"\u5217\u8868\u4E3A\u7A7A"},modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},poptip:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88"},page:{prev:"\u4E0A\u4E00\u9875",next:"\u4E0B\u4E00\u9875",total:"\u5171",item:"\u6761",items:"\u6761",prev5:"\u5411\u524D 5 \u9875",next5:"\u5411\u540E 5 \u9875",page:"\u6761/\u9875",goto:"\u8DF3\u81F3",p:"\u9875"},rate:{star:"\u661F",stars:"\u661F"},time:{before:"\u524D",after:"\u540E",just:"\u521A\u521A",seconds:"\u79D2",minutes:"\u5206\u949F",hours:"\u5C0F\u65F6",days:"\u5929"},tree:{emptyText:"\u6682\u65E0\u6570\u636E"}}};e(t);export{t as default};
@@ -105,25 +105,27 @@ export default {
105
105
  //return JSON.parse(JSON.stringify(model));
106
106
  },
107
107
  allow(key) {
108
- if (key.startsWith('permission/')) {
109
- // 全局权限
110
- return this.userPermissions[key];
111
- } else {
112
- // 页面权限点
113
- let url = this.$router.currentRoute.value.fullPath.substr(1).split('?')[0];
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
- if (this.userPermissions[url + '$' + key] == true) {
116
- return true;
117
- }
116
+ if (this.userPermissions[url + '$' + key] == true) {
117
+ return true;
118
+ }
118
119
 
119
- let count = Object.keys(this.userPermissions).filter(item => item.startsWith(url + '$')).length;
120
+ let count = Object.keys(this.userPermissions).filter(item => item.startsWith(url + '$')).length;
120
121
 
121
- // 未分权限点
122
- if (this.userPermissions[url] == true && count == 0) {
123
- return true;
124
- }
122
+ // 未分权限点
123
+ if (this.userPermissions[url] == true && count == 0) {
124
+ return true;
125
+ }
125
126
 
126
- return false;
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=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
2
+ npm config set //registry.npmjs.org/:_authToken=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