mooho-base-admin-plus 2.10.57 → 2.10.59
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 +5380 -5352
- package/package/mooho-base-admin-plus.min.js +91 -92
- package/package.json +1 -1
- package/src/components/view/view-table-excel.vue +85 -39
- package/src/i18n/locale/en-US.js +1 -1
- package/src/i18n/locale/lang.js +1 -1
- package/src/i18n/locale/zh-CN.js +1 -1
package/package.json
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
import mixinPage from '../../mixins/page';
|
|
38
38
|
import mixin from './mixin';
|
|
39
39
|
import tableSetting from './table-setting.vue';
|
|
40
|
+
import { readonly } from 'vue';
|
|
40
41
|
|
|
41
42
|
// register Handsontable's modules
|
|
42
43
|
registerAllModules();
|
|
@@ -500,24 +501,62 @@
|
|
|
500
501
|
this.hotSetting.contextMenu.items.move_up = {
|
|
501
502
|
name: '整行上移',
|
|
502
503
|
callback: (key, selection, clickEvent) => {
|
|
503
|
-
let
|
|
504
|
+
let rows = [];
|
|
505
|
+
|
|
506
|
+
for (let item of selection) {
|
|
507
|
+
for (let i = item.start.row; i <= item.end.row; i++) {
|
|
508
|
+
rows.push(i);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
rows.sort(function (a, b) {
|
|
513
|
+
return a - b; // 升序排列
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
rows = [...new Set(rows)]; // 去重
|
|
517
|
+
|
|
518
|
+
if (rows[rows.length - 1] - rows[0] != rows.length - 1) {
|
|
519
|
+
this.error('只能选中连续的行执行此操作!');
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
let index = rows[0];
|
|
524
|
+
|
|
504
525
|
if (index > 0) {
|
|
505
|
-
let
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
this.$refs.table.hotInstance.updateData(data);
|
|
526
|
+
let moveRows = this.staticData.splice(index, rows.length);
|
|
527
|
+
this.staticData.splice(index - 1, 0, ...moveRows);
|
|
528
|
+
this.$refs.table.hotInstance.updateData(this.staticData);
|
|
509
529
|
}
|
|
510
530
|
}
|
|
511
531
|
};
|
|
512
532
|
this.hotSetting.contextMenu.items.move_down = {
|
|
513
533
|
name: '整行下移',
|
|
514
534
|
callback: (key, selection, clickEvent) => {
|
|
515
|
-
let
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
let
|
|
519
|
-
|
|
520
|
-
|
|
535
|
+
let rows = [];
|
|
536
|
+
|
|
537
|
+
for (let item of selection) {
|
|
538
|
+
for (let i = item.start.row; i <= item.end.row; i++) {
|
|
539
|
+
rows.push(i);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
rows.sort(function (a, b) {
|
|
544
|
+
return a - b; // 升序排列
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
rows = [...new Set(rows)]; // 去重
|
|
548
|
+
|
|
549
|
+
if (rows[rows.length - 1] - rows[0] != rows.length - 1) {
|
|
550
|
+
this.error('只能选中连续的行执行此操作!');
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
let index = rows[0];
|
|
555
|
+
|
|
556
|
+
if (rows[rows.length - 1] < this.staticData.length - 1) {
|
|
557
|
+
let moveRows = this.staticData.splice(index, rows.length);
|
|
558
|
+
this.staticData.splice(index + 1, 0, ...moveRows);
|
|
559
|
+
this.$refs.table.hotInstance.updateData(this.staticData);
|
|
521
560
|
}
|
|
522
561
|
}
|
|
523
562
|
};
|
|
@@ -528,31 +567,26 @@
|
|
|
528
567
|
this.hotSetting.contextMenu.items.remove_row = {
|
|
529
568
|
name: '整行删除',
|
|
530
569
|
callback: (key, selection, clickEvent) => {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
let rows = [];
|
|
534
|
-
|
|
535
|
-
let data = this.$refs.table.hotInstance.getSourceData();
|
|
570
|
+
this.confirm('确定要删除这些行吗?', async () => {
|
|
571
|
+
let rows = [];
|
|
536
572
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
573
|
+
for (let item of selection) {
|
|
574
|
+
for (let i = item.start.row; i <= item.end.row; i++) {
|
|
575
|
+
rows.push(i);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
540
578
|
|
|
541
|
-
|
|
579
|
+
rows.sort(function (a, b) {
|
|
580
|
+
return b - a; // 降序排列
|
|
581
|
+
});
|
|
542
582
|
|
|
543
|
-
|
|
544
|
-
rows.push(i);
|
|
545
|
-
}
|
|
583
|
+
rows = [...new Set(rows)]; // 去重
|
|
546
584
|
|
|
547
|
-
for (let i
|
|
548
|
-
|
|
549
|
-
ids.push(data[i].id);
|
|
550
|
-
}
|
|
585
|
+
for (let i of rows) {
|
|
586
|
+
this.staticData.splice(i, 1);
|
|
551
587
|
}
|
|
552
|
-
}
|
|
553
588
|
|
|
554
|
-
|
|
555
|
-
this.$refs.table.hotInstance.alter('remove_row', delArr);
|
|
589
|
+
this.$refs.table.hotInstance.updateData(this.staticData);
|
|
556
590
|
});
|
|
557
591
|
}
|
|
558
592
|
};
|
|
@@ -561,7 +595,6 @@
|
|
|
561
595
|
|
|
562
596
|
// 变更事件
|
|
563
597
|
this.$refs.table.hotInstance.addHook('afterChange', changes => {
|
|
564
|
-
//console.log('afterChange', changes);
|
|
565
598
|
if (changes) {
|
|
566
599
|
changes.forEach(([row, property, oldValue, newValue]) => {
|
|
567
600
|
if (!this.readonly && this.tableView.createEnable && row == this.staticData.length - 1 && (oldValue ?? '') != (newValue ?? '')) {
|
|
@@ -590,7 +623,6 @@
|
|
|
590
623
|
|
|
591
624
|
// 粘贴事件
|
|
592
625
|
this.$refs.table.hotInstance.addHook('beforePaste', (data, coords) => {
|
|
593
|
-
//console.log('beforePaste', data, coords);
|
|
594
626
|
// 不含父级表头
|
|
595
627
|
let columns = this.columns.filter(item => {
|
|
596
628
|
return (
|
|
@@ -665,12 +697,7 @@
|
|
|
665
697
|
//this.hotSetting.data = this.data;
|
|
666
698
|
|
|
667
699
|
// 设置数据的可见性和只读属性
|
|
668
|
-
|
|
669
|
-
// //this.setShowStatus(item);
|
|
670
|
-
|
|
671
|
-
// // 只读时禁止选中
|
|
672
|
-
// item._disabled = this.readonly;
|
|
673
|
-
// });
|
|
700
|
+
this.setShowStatus();
|
|
674
701
|
|
|
675
702
|
// 加载数据源
|
|
676
703
|
//this.initDataSource();
|
|
@@ -770,7 +797,7 @@
|
|
|
770
797
|
},
|
|
771
798
|
// 数据变化事件
|
|
772
799
|
onDataChange(data, sender, selected) {
|
|
773
|
-
|
|
800
|
+
this.setShowStatus();
|
|
774
801
|
|
|
775
802
|
//this.$forceUpdate();
|
|
776
803
|
|
|
@@ -817,6 +844,25 @@
|
|
|
817
844
|
rowData(row, index) {
|
|
818
845
|
return this.staticData[index];
|
|
819
846
|
},
|
|
847
|
+
// 设置可见性和只读
|
|
848
|
+
setShowStatus() {
|
|
849
|
+
this.$refs.table.hotInstance.updateSettings({
|
|
850
|
+
cells: (row, col, prop) => {
|
|
851
|
+
let column = this.columns.find(item => item.code == prop);
|
|
852
|
+
|
|
853
|
+
// 判断是否只读
|
|
854
|
+
if (!!(column.readonlyJson || '').trim()) {
|
|
855
|
+
let setting = JSON.parse(column.readonlyJson);
|
|
856
|
+
|
|
857
|
+
if (setting.type == 'Condition' || setting.type == 'Expression') {
|
|
858
|
+
let readOnly = this.judgeCondition(setting, this.staticData[row]);
|
|
859
|
+
|
|
860
|
+
return { readOnly };
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
},
|
|
820
866
|
// 获取多语言名称
|
|
821
867
|
getNameI18n(column) {
|
|
822
868
|
if (column) {
|
package/src/i18n/locale/en-US.js
CHANGED
|
@@ -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};
|
package/src/i18n/locale/lang.js
CHANGED
|
@@ -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};
|
package/src/i18n/locale/zh-CN.js
CHANGED
|
@@ -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};
|