@oinone/kunlun-vue-admin-base 6.4.0 → 6.4.1
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/dist/oinone-kunlun-vue-admin-base.css +1 -1
- package/dist/oinone-kunlun-vue-admin-base.esm.js +114 -65
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/components/oio-full-screen/OioFullScreen.vue.d.ts +1 -0
- package/dist/types/src/view/quick-fill/QuickFillWidget.d.ts +4 -2
- package/dist/types/src/view/quick-fill/type.d.ts +1 -0
- package/package.json +8 -8
- package/src/basic/table/BaseTableWidget.ts +4 -2
- package/src/components/oio-full-screen/OioFullScreen.vue +10 -1
- package/src/permission/system-permission/components/GroupList.vue +1 -1
- package/src/permission/system-permission/components/PermissionDialog.vue +2 -2
- package/src/permission/system-permission/service/index.ts +2 -5
- package/src/view/quick-fill/Excel.vue +16 -11
- package/src/view/quick-fill/QuickFill.vue +2 -1
- package/src/view/quick-fill/QuickFillWidget.ts +95 -40
- package/src/view/quick-fill/type.ts +1 -0
- package/src/view/view/style/index.scss +28 -7
|
@@ -17101,8 +17101,9 @@ class BaseTableWidget extends BaseElementListViewWidget {
|
|
|
17101
17101
|
}
|
|
17102
17102
|
keyboardConfig.left = keyboardConfig.left || { key: 'Tab', shift: true, desc: '向左移动单元格' };
|
|
17103
17103
|
keyboardConfig.right = keyboardConfig.right || { key: 'Tab', desc: '向右移动单元格' };
|
|
17104
|
-
|
|
17105
|
-
keyboardConfig.
|
|
17104
|
+
// fixme @zbh 20251218 暂未实现
|
|
17105
|
+
// keyboardConfig.up = keyboardConfig.up || { key: 'Enter', ctrl: true, shift: true, desc: '向上移动单元格' };
|
|
17106
|
+
// keyboardConfig.down = keyboardConfig.down || { key: 'Enter', ctrl: true, desc: '向下移动单元格' };
|
|
17106
17107
|
keyboardConfig.enter = keyboardConfig.enter || { key: 'Enter', desc: '提交数据' };
|
|
17107
17108
|
keyboardConfig.cancel = keyboardConfig.cancel || { key: 'Esc', desc: '取消编辑' };
|
|
17108
17109
|
return keyboardConfig;
|
|
@@ -17466,7 +17467,7 @@ class BaseTableWidget extends BaseElementListViewWidget {
|
|
|
17466
17467
|
super.onSortChange(sortList);
|
|
17467
17468
|
this.multipleFieldSort = (((_a = this.sortList) === null || _a === void 0 ? void 0 : _a.length) || 0) >= 2;
|
|
17468
17469
|
nextTick(() => {
|
|
17469
|
-
var _a, _b, _c, _d;
|
|
17470
|
+
var _a, _b, _c, _d, _e;
|
|
17470
17471
|
if ((_a = this.sortList) === null || _a === void 0 ? void 0 : _a.length) {
|
|
17471
17472
|
(((_b = this.tableInstance) === null || _b === void 0 ? void 0 : _b.getSortColumns()) || [])
|
|
17472
17473
|
.filter((v) => { var _a; return !((_a = this.sortList) === null || _a === void 0 ? void 0 : _a.find((vv) => vv.sortField === v.field)); })
|
|
@@ -17477,7 +17478,8 @@ class BaseTableWidget extends BaseElementListViewWidget {
|
|
|
17477
17478
|
})));
|
|
17478
17479
|
}
|
|
17479
17480
|
else {
|
|
17480
|
-
(_d = this.tableInstance) === null || _d === void 0 ? void 0 : _d.
|
|
17481
|
+
(((_d = this.tableInstance) === null || _d === void 0 ? void 0 : _d.getSortColumns()) || []).forEach((v) => { var _a; return (_a = this.tableInstance) === null || _a === void 0 ? void 0 : _a.clearSort(v.field); });
|
|
17482
|
+
(_e = this.tableInstance) === null || _e === void 0 ? void 0 : _e.sort([]);
|
|
17481
17483
|
}
|
|
17482
17484
|
});
|
|
17483
17485
|
}
|
|
@@ -42174,6 +42176,12 @@ var script$44 = defineComponent({
|
|
|
42174
42176
|
const icon = computed(() => {
|
|
42175
42177
|
return props.value ? 'oinone-fullscreen-exit-outlined' : 'oinone-fullscreen-outlined';
|
|
42176
42178
|
});
|
|
42179
|
+
const tooltipTitle = computed(() => {
|
|
42180
|
+
if (props.value) {
|
|
42181
|
+
return translateValueByKey('取消全屏');
|
|
42182
|
+
}
|
|
42183
|
+
return translateValueByKey('全屏');
|
|
42184
|
+
});
|
|
42177
42185
|
const onChange = () => {
|
|
42178
42186
|
visible.value = false;
|
|
42179
42187
|
emit('update:value', !props.value);
|
|
@@ -42182,6 +42190,7 @@ var script$44 = defineComponent({
|
|
|
42182
42190
|
return {
|
|
42183
42191
|
visible,
|
|
42184
42192
|
icon,
|
|
42193
|
+
tooltipTitle,
|
|
42185
42194
|
onChange
|
|
42186
42195
|
};
|
|
42187
42196
|
}
|
|
@@ -42198,7 +42207,7 @@ function render$2w(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
42198
42207
|
visible: _ctx.visible,
|
|
42199
42208
|
"onUpdate:visible": _cache[0] || (_cache[0] = $event => ((_ctx.visible) = $event)),
|
|
42200
42209
|
placement: "bm",
|
|
42201
|
-
title: _ctx
|
|
42210
|
+
title: _ctx.tooltipTitle
|
|
42202
42211
|
}, {
|
|
42203
42212
|
default: withCtx(() => [
|
|
42204
42213
|
createVNode(_component_oio_icon, {
|
|
@@ -102390,15 +102399,17 @@ var script$z = /*#__PURE__*/ defineComponent({
|
|
|
102390
102399
|
const tableHeaderValues = ref([]);
|
|
102391
102400
|
// 表头下拉选项
|
|
102392
102401
|
const selectOptions = computed(() => {
|
|
102393
|
-
|
|
102394
|
-
|
|
102395
|
-
|
|
102396
|
-
|
|
102397
|
-
|
|
102398
|
-
|
|
102399
|
-
|
|
102400
|
-
|
|
102401
|
-
|
|
102402
|
+
return [
|
|
102403
|
+
{
|
|
102404
|
+
label: '不粘贴',
|
|
102405
|
+
key: NON_CUT,
|
|
102406
|
+
value: NON_CUT,
|
|
102407
|
+
readonly: true,
|
|
102408
|
+
field: NON_CUT,
|
|
102409
|
+
originField: NON_CUT
|
|
102410
|
+
},
|
|
102411
|
+
...props.fields
|
|
102412
|
+
];
|
|
102402
102413
|
});
|
|
102403
102414
|
// ======== 状态 =========
|
|
102404
102415
|
const tableRef = ref(null); // 表格引用
|
|
@@ -102951,14 +102962,14 @@ var script$z = /*#__PURE__*/ defineComponent({
|
|
|
102951
102962
|
getTableHeaderValues() {
|
|
102952
102963
|
const fields = [];
|
|
102953
102964
|
for (const tableHeaderValue of tableHeaderValues.value) {
|
|
102954
|
-
const { value } = tableHeaderValue;
|
|
102965
|
+
const { value, originField } = tableHeaderValue;
|
|
102955
102966
|
if (value === NON_CUT) {
|
|
102956
102967
|
fields.push(tableHeaderValue);
|
|
102957
102968
|
}
|
|
102958
102969
|
else {
|
|
102959
102970
|
const target = props.fields.find((v) => v.field === value);
|
|
102960
102971
|
if (target) {
|
|
102961
|
-
fields.push(target);
|
|
102972
|
+
fields.push(Object.assign(Object.assign({}, target), { originField }));
|
|
102962
102973
|
}
|
|
102963
102974
|
}
|
|
102964
102975
|
}
|
|
@@ -103186,7 +103197,8 @@ var script$y = defineComponent({
|
|
|
103186
103197
|
key: fieldName,
|
|
103187
103198
|
value: fieldName,
|
|
103188
103199
|
readonly: field.readonly === true,
|
|
103189
|
-
field: fieldName
|
|
103200
|
+
field: fieldName,
|
|
103201
|
+
originField: fieldName
|
|
103190
103202
|
};
|
|
103191
103203
|
});
|
|
103192
103204
|
if (type.value === QuickFillType.create) {
|
|
@@ -103557,6 +103569,7 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103557
103569
|
onSure(headers, rows) {
|
|
103558
103570
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103559
103571
|
const values = [];
|
|
103572
|
+
const keepValues = [];
|
|
103560
103573
|
/**
|
|
103561
103574
|
* 将excel数据转换成提交的数据格式
|
|
103562
103575
|
* [['值1', '值2'], ['值1', '值2']] -> [{name: '值1', code: '值2'}, {name: '值1', code: '值2'}]
|
|
@@ -103565,40 +103578,39 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103565
103578
|
rows.forEach((row, rowIndex) => {
|
|
103566
103579
|
const rowValue = {};
|
|
103567
103580
|
const relationObjects = {};
|
|
103581
|
+
const keepRowValue = {};
|
|
103582
|
+
const keepRelationObjects = {};
|
|
103568
103583
|
row.forEach((cell, columnIndex) => {
|
|
103569
103584
|
var _a;
|
|
103570
103585
|
if (!cell) {
|
|
103571
103586
|
return;
|
|
103572
103587
|
}
|
|
103573
|
-
const
|
|
103574
|
-
if (!
|
|
103588
|
+
const header = headers[columnIndex];
|
|
103589
|
+
if (!header) {
|
|
103575
103590
|
return;
|
|
103576
103591
|
}
|
|
103577
|
-
const
|
|
103578
|
-
if (
|
|
103579
|
-
|
|
103580
|
-
if (!target) {
|
|
103581
|
-
target = {};
|
|
103582
|
-
relationObjects[name1] = target;
|
|
103583
|
-
}
|
|
103584
|
-
target[name2] = cell;
|
|
103585
|
-
}
|
|
103586
|
-
else {
|
|
103587
|
-
rowValue[fieldName] = cell;
|
|
103592
|
+
const { value, originField } = header;
|
|
103593
|
+
if (value !== NON_CUT) {
|
|
103594
|
+
this.setRowValue(rowValue, relationObjects, value, cell);
|
|
103588
103595
|
}
|
|
103596
|
+
this.setRowValue(keepRowValue, keepRelationObjects, originField, (_a = this.lastCells) === null || _a === void 0 ? void 0 : _a[`${rowIndex + 1}-${columnIndex + 1}`]);
|
|
103589
103597
|
});
|
|
103590
103598
|
Object.entries(relationObjects).forEach(([key, value]) => {
|
|
103591
103599
|
rowValue[key] = JSON.stringify(value);
|
|
103592
103600
|
});
|
|
103601
|
+
Object.entries(keepRelationObjects).forEach(([key, value]) => {
|
|
103602
|
+
keepRowValue[key] = JSON.stringify(value);
|
|
103603
|
+
});
|
|
103593
103604
|
if (Object.keys(rowValue).length > 0) {
|
|
103594
103605
|
values.push(rowValue);
|
|
103606
|
+
keepValues.push(keepRowValue);
|
|
103595
103607
|
}
|
|
103596
103608
|
});
|
|
103597
103609
|
/**
|
|
103598
103610
|
* values -> 可回填的数据
|
|
103599
103611
|
* failures -> 错误信息
|
|
103600
103612
|
*/
|
|
103601
|
-
const { values: resultValues, failures } = yield this.validateExcelValue(headers,
|
|
103613
|
+
const { values: resultValues, failures } = yield this.validateExcelValue(headers, values, keepValues);
|
|
103602
103614
|
const data = resultValues ? JSON.parse(resultValues) : [];
|
|
103603
103615
|
/**
|
|
103604
103616
|
* 如果存在错误,则展示表格,将后端返回数据回填到表格
|
|
@@ -103616,6 +103628,20 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103616
103628
|
}
|
|
103617
103629
|
});
|
|
103618
103630
|
}
|
|
103631
|
+
setRowValue(rowValue, relationObjects, fieldName, cell) {
|
|
103632
|
+
const [name1, name2] = fieldName.split('#');
|
|
103633
|
+
if (name2) {
|
|
103634
|
+
let target = relationObjects[name1];
|
|
103635
|
+
if (!target) {
|
|
103636
|
+
target = {};
|
|
103637
|
+
relationObjects[name1] = target;
|
|
103638
|
+
}
|
|
103639
|
+
target[name2] = cell;
|
|
103640
|
+
}
|
|
103641
|
+
else {
|
|
103642
|
+
rowValue[fieldName] = cell;
|
|
103643
|
+
}
|
|
103644
|
+
}
|
|
103619
103645
|
/**
|
|
103620
103646
|
* 继续提交
|
|
103621
103647
|
*/
|
|
@@ -103634,6 +103660,7 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103634
103660
|
var _a;
|
|
103635
103661
|
// 处理空数据情况
|
|
103636
103662
|
if (!((_a = this.dataSource) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
103663
|
+
this.lastCells = undefined;
|
|
103637
103664
|
return {
|
|
103638
103665
|
rowCount: 0
|
|
103639
103666
|
};
|
|
@@ -103670,6 +103697,7 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103670
103697
|
cells[cellKey] = this.fillFieldValue(field, fieldValue);
|
|
103671
103698
|
});
|
|
103672
103699
|
});
|
|
103700
|
+
this.lastCells = Object.assign({}, cells);
|
|
103673
103701
|
return { cells, rowCount: this.dataSource.length };
|
|
103674
103702
|
}
|
|
103675
103703
|
fillFieldValue(field, value) {
|
|
@@ -103831,13 +103859,20 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103831
103859
|
/**
|
|
103832
103860
|
* 调接口校验excel数据
|
|
103833
103861
|
*/
|
|
103834
|
-
validateExcelValue(headers, values) {
|
|
103862
|
+
validateExcelValue(headers, values, keepValues) {
|
|
103835
103863
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103836
103864
|
const fields = [];
|
|
103837
|
-
const validHeaders =
|
|
103838
|
-
const keepHeaders =
|
|
103865
|
+
const validHeaders = [];
|
|
103866
|
+
const keepHeaders = {};
|
|
103867
|
+
for (const header of headers) {
|
|
103868
|
+
const { value, originField } = header;
|
|
103869
|
+
if (value !== NON_CUT) {
|
|
103870
|
+
validHeaders.push(header);
|
|
103871
|
+
}
|
|
103872
|
+
keepHeaders[originField] = true;
|
|
103873
|
+
}
|
|
103839
103874
|
for (const header of validHeaders) {
|
|
103840
|
-
const { fieldWidget, field: modelField } = this.findModelField(fields, header);
|
|
103875
|
+
const { fieldWidget, field: modelField } = this.findModelField(fields, header.value);
|
|
103841
103876
|
if (!modelField) {
|
|
103842
103877
|
continue;
|
|
103843
103878
|
}
|
|
@@ -103852,27 +103887,52 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103852
103887
|
else {
|
|
103853
103888
|
fields.push({ field: modelField.data, required });
|
|
103854
103889
|
}
|
|
103890
|
+
delete keepHeaders[header.value];
|
|
103855
103891
|
}
|
|
103856
|
-
|
|
103857
|
-
const
|
|
103858
|
-
|
|
103859
|
-
|
|
103860
|
-
|
|
103861
|
-
|
|
103862
|
-
|
|
103863
|
-
|
|
103864
|
-
|
|
103865
|
-
labelFields: modelField.referencesModel.labelFields
|
|
103866
|
-
});
|
|
103892
|
+
if (this.type === QuickFillType.create) {
|
|
103893
|
+
for (const [field] of Object.entries(keepHeaders)) {
|
|
103894
|
+
const { field: modelField } = this.findModelField(fields, field);
|
|
103895
|
+
if (!modelField) {
|
|
103896
|
+
continue;
|
|
103897
|
+
}
|
|
103898
|
+
for (const value of values) {
|
|
103899
|
+
delete value[modelField.data];
|
|
103900
|
+
}
|
|
103867
103901
|
}
|
|
103868
|
-
|
|
103869
|
-
|
|
103902
|
+
}
|
|
103903
|
+
else if (this.type === QuickFillType.update) {
|
|
103904
|
+
for (const [field] of Object.entries(keepHeaders)) {
|
|
103905
|
+
const { field: modelField } = this.findModelField(fields, field);
|
|
103906
|
+
if (!modelField) {
|
|
103907
|
+
continue;
|
|
103908
|
+
}
|
|
103909
|
+
if (isRelationField(modelField)) {
|
|
103910
|
+
fields.push({
|
|
103911
|
+
field: modelField.data,
|
|
103912
|
+
validate: false,
|
|
103913
|
+
labelFields: modelField.referencesModel.labelFields
|
|
103914
|
+
});
|
|
103915
|
+
}
|
|
103916
|
+
else {
|
|
103917
|
+
fields.push({ field: modelField.data, validate: false });
|
|
103918
|
+
}
|
|
103919
|
+
for (let i = 0; i < values.length; i++) {
|
|
103920
|
+
const value = values[i];
|
|
103921
|
+
const keepValue = keepValues[i];
|
|
103922
|
+
const t = keepValue === null || keepValue === void 0 ? void 0 : keepValue[modelField.data];
|
|
103923
|
+
if (t) {
|
|
103924
|
+
value[modelField.data] = t;
|
|
103925
|
+
}
|
|
103926
|
+
else {
|
|
103927
|
+
delete value[modelField.data];
|
|
103928
|
+
}
|
|
103929
|
+
}
|
|
103870
103930
|
}
|
|
103871
103931
|
}
|
|
103872
103932
|
const gqlStr = yield buildSingleItemParam(quickFillFields, {
|
|
103873
103933
|
model: this.model.model,
|
|
103874
103934
|
fields,
|
|
103875
|
-
values
|
|
103935
|
+
values: JSON.stringify(values)
|
|
103876
103936
|
});
|
|
103877
103937
|
const body = `{
|
|
103878
103938
|
quickFillingQuery {
|
|
@@ -103894,15 +103954,7 @@ let QuickFillWidget = class QuickFillWidget extends BaseElementWidget {
|
|
|
103894
103954
|
return rst.data.quickFillingQuery.loadData;
|
|
103895
103955
|
});
|
|
103896
103956
|
}
|
|
103897
|
-
findModelField(fields,
|
|
103898
|
-
const { value, field } = header;
|
|
103899
|
-
let data;
|
|
103900
|
-
if (value === NON_CUT) {
|
|
103901
|
-
data = field;
|
|
103902
|
-
}
|
|
103903
|
-
else {
|
|
103904
|
-
data = value;
|
|
103905
|
-
}
|
|
103957
|
+
findModelField(fields, data) {
|
|
103906
103958
|
let fieldWidget;
|
|
103907
103959
|
const [name1, name2] = data.split('#');
|
|
103908
103960
|
if (name2) {
|
|
@@ -113712,7 +113764,6 @@ const queryRoleList = (options = {
|
|
|
113712
113764
|
name
|
|
113713
113765
|
description
|
|
113714
113766
|
source
|
|
113715
|
-
permissionDataSource
|
|
113716
113767
|
createDate
|
|
113717
113768
|
writeDate
|
|
113718
113769
|
}
|
|
@@ -113743,11 +113794,10 @@ const queryGroups = (options) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
113743
113794
|
id
|
|
113744
113795
|
name
|
|
113745
113796
|
type
|
|
113746
|
-
|
|
113797
|
+
source
|
|
113747
113798
|
active
|
|
113748
113799
|
displayName
|
|
113749
113800
|
comment
|
|
113750
|
-
menuName
|
|
113751
113801
|
roles {
|
|
113752
113802
|
code
|
|
113753
113803
|
name
|
|
@@ -113761,11 +113811,10 @@ const queryGroups = (options) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
113761
113811
|
id
|
|
113762
113812
|
name
|
|
113763
113813
|
type
|
|
113764
|
-
|
|
113814
|
+
source
|
|
113765
113815
|
active
|
|
113766
113816
|
displayName
|
|
113767
113817
|
comment
|
|
113768
|
-
menuName
|
|
113769
113818
|
roles {
|
|
113770
113819
|
code
|
|
113771
113820
|
name
|
|
@@ -114926,7 +114975,7 @@ var script$6 = /*#__PURE__*/ defineComponent({
|
|
|
114926
114975
|
title: withCtx(({ title, data }) => [
|
|
114927
114976
|
createElementVNode("div", null, [
|
|
114928
114977
|
createTextVNode(toDisplayString(title) + " ", 1 /* TEXT */),
|
|
114929
|
-
createElementVNode("span", _hoisted_4$4,
|
|
114978
|
+
createElementVNode("span", _hoisted_4$4, toDisplayString(data.menuName) + "/" + toDisplayString(data.displayValue), 1 /* TEXT */)
|
|
114930
114979
|
])
|
|
114931
114980
|
]),
|
|
114932
114981
|
_: 1 /* STABLE */
|
|
@@ -115522,7 +115571,7 @@ var script$4 = /*#__PURE__*/ defineComponent({
|
|
|
115522
115571
|
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onClick"]))
|
|
115523
115572
|
: createCommentVNode("v-if", true),
|
|
115524
115573
|
createVNode(_component_a_divider, { type: "vertical" }),
|
|
115525
|
-
(item.
|
|
115574
|
+
(item.source === 'MANUAL' && unref(hasDeleteGroupAction))
|
|
115526
115575
|
? (openBlock(), createBlock(_component_a_popconfirm, {
|
|
115527
115576
|
key: 1,
|
|
115528
115577
|
placement: "topLeft",
|