sohelp-eleplus 1.1.20 → 1.1.21
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 +1 -1
- package/sohelp-dyn-select/props.js +4 -4
- package/sohelp-entity-form/index.vue +31 -6
- package/sohelp-grid/components/filter-condition-item.vue +2 -0
- package/sohelp-grid/index.vue +61 -10
- package/sohelp-grid/js/useSohelpGridConfig.js +22 -3
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +8 -37
- package/sohelp-grid-view/filter/config/index.vue +6 -9
- package/sohelp-grid-view/filter/filter-form.vue +11 -13
- package/sohelp-grid-view/index.vue +10 -6
- package/sohelp-import/index.vue +2 -2
- package/sohelp-modal/index.vue +1 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1 -0
- package/sohelp-rich-text/index.vue +3 -21
- package/sohelp-vxe-grid/index.vue +7 -0
package/package.json
CHANGED
|
@@ -7,14 +7,13 @@ export const prop = {
|
|
|
7
7
|
required: true
|
|
8
8
|
},
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
mappingFields:{
|
|
10
|
+
mappingFields: {
|
|
12
11
|
type: Object,
|
|
13
12
|
default: () => {
|
|
14
13
|
return {
|
|
15
14
|
label: 'label',
|
|
16
15
|
value: 'value'
|
|
17
|
-
}
|
|
16
|
+
};
|
|
18
17
|
}
|
|
19
18
|
},
|
|
20
19
|
|
|
@@ -27,6 +26,7 @@ export const prop = {
|
|
|
27
26
|
type: String,
|
|
28
27
|
default: '请选择'
|
|
29
28
|
},
|
|
29
|
+
|
|
30
30
|
modelValue: {
|
|
31
31
|
type: Array || String || Number,
|
|
32
32
|
required: true
|
|
@@ -64,4 +64,4 @@ export const prop = {
|
|
|
64
64
|
* 事件
|
|
65
65
|
*/
|
|
66
66
|
|
|
67
|
-
export const emit = ['update:modelValue','change'];
|
|
67
|
+
export const emit = ['update:modelValue', 'change'];
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
import { useMobile } from '@/utils/use-mobile';
|
|
37
37
|
import { useI18n } from 'vue-i18n';
|
|
38
38
|
import { EleMessage } from '@/components/ele-admin-plus/components';
|
|
39
|
+
import { SohelpInput, SohelpNumberInput } from '../components';
|
|
39
40
|
|
|
40
41
|
const { query } = useRoute();
|
|
41
42
|
const formValue = ref({});
|
|
@@ -88,6 +89,8 @@
|
|
|
88
89
|
* @type {Ref<UnwrapRef<*[]>>}
|
|
89
90
|
*/
|
|
90
91
|
const items = ref([]);
|
|
92
|
+
// 初始化表单配置
|
|
93
|
+
const initFormValue = ref({});
|
|
91
94
|
/**
|
|
92
95
|
* 默认显示1列
|
|
93
96
|
* @type {Ref<UnwrapRef<number>>}
|
|
@@ -167,6 +170,24 @@
|
|
|
167
170
|
const getRef = (refName) => {
|
|
168
171
|
return proFormRef.value.getRef(refName);
|
|
169
172
|
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* placeholder占位符映射
|
|
176
|
+
*/
|
|
177
|
+
const placeholderMap = {
|
|
178
|
+
SohelpSelect: '请选择',
|
|
179
|
+
SohelpTreeSelect: '请选择',
|
|
180
|
+
SohelpDict: '请选择',
|
|
181
|
+
SohelpUserSelect: '请选择用户',
|
|
182
|
+
SohelpDeptSelect: '请选择部门',
|
|
183
|
+
SohelpRoleSelect: '请选择角色',
|
|
184
|
+
SohelpDatePicker: '请选择日期',
|
|
185
|
+
SohelpTimePicker: '请选择时间',
|
|
186
|
+
SohelpDateTimePicker: '请选择日期时间',
|
|
187
|
+
SohelpInput: '请输入',
|
|
188
|
+
SohelpNumberInput: '请输入'
|
|
189
|
+
};
|
|
190
|
+
|
|
170
191
|
/**根据实体表单配置初始化表单数据 */
|
|
171
192
|
const loadConfig = async (refid = props?.refid) => {
|
|
172
193
|
if (!refid) {
|
|
@@ -191,12 +212,13 @@
|
|
|
191
212
|
}
|
|
192
213
|
let editParams = item?.editorParam ? JSON.parse(item.editorParam) : {};
|
|
193
214
|
if (item.editor === 'SohelpDict') {
|
|
194
|
-
editParams['code'] =
|
|
215
|
+
editParams['code'] = editParams?.code || item?.dict;
|
|
195
216
|
}
|
|
196
217
|
if (item['length'] > 0) {
|
|
197
218
|
editParams['maxlength'] = item['length'];
|
|
198
219
|
}
|
|
199
220
|
editParams.readonly = item?.readonly || false;
|
|
221
|
+
editParams.placeholder = item?.placeholder || placeholderMap[item?.editor] || '';
|
|
200
222
|
|
|
201
223
|
return {
|
|
202
224
|
key: item?.name || 'tempKey' + index,
|
|
@@ -216,6 +238,7 @@
|
|
|
216
238
|
};
|
|
217
239
|
})
|
|
218
240
|
.filter((p) => p.hidden !== true);
|
|
241
|
+
|
|
219
242
|
labelWidth.value = props.labelWidth || entityFormConfig.labelWidth || 'auto';
|
|
220
243
|
grid.value = mobile.value ? 1 : entityFormConfig.gridNum || props.gridNum;
|
|
221
244
|
|
|
@@ -278,12 +301,14 @@
|
|
|
278
301
|
* @param _data 数据对象
|
|
279
302
|
*/
|
|
280
303
|
|
|
281
|
-
const setFormData = async (_formData = {}) => {
|
|
304
|
+
const setFormData = async (_formData = {}, params = {}) => {
|
|
305
|
+
const data = { ..._formData, ...params };
|
|
306
|
+
initFormValue.value = params;
|
|
282
307
|
loading.value = true;
|
|
283
|
-
|
|
284
308
|
await isConfigDone();
|
|
285
|
-
Object.assign(formData.value,
|
|
286
|
-
setFormValue(switchFormValue(
|
|
309
|
+
Object.assign(formData.value, data);
|
|
310
|
+
setFormValue(switchFormValue(data));
|
|
311
|
+
emit('update:modelValue', formData.value);
|
|
287
312
|
setTimeout(() => {
|
|
288
313
|
clearValidate();
|
|
289
314
|
}, 0);
|
|
@@ -319,7 +344,7 @@
|
|
|
319
344
|
changedProps[key] = newObj[key];
|
|
320
345
|
}
|
|
321
346
|
}
|
|
322
|
-
return { id: oldObj?.id || newObj?.id || '', ...changedProps };
|
|
347
|
+
return { id: oldObj?.id || newObj?.id || '', ...changedProps, ...initFormValue.value };
|
|
323
348
|
}
|
|
324
349
|
|
|
325
350
|
/**
|
|
@@ -116,8 +116,10 @@
|
|
|
116
116
|
:code="properties?.dict || properties.editorParam?.code"
|
|
117
117
|
style="width: 160px"
|
|
118
118
|
:teleported="teleported"
|
|
119
|
+
:placeholder="properties.editorParam?.placeholder || '请选择'"
|
|
119
120
|
class="filter-condition"
|
|
120
121
|
/>
|
|
122
|
+
|
|
121
123
|
<div v-else-if="properties.editor === 'SohelpProcess'">
|
|
122
124
|
<sohelp-number-range
|
|
123
125
|
v-model="condition.value"
|
package/sohelp-grid/index.vue
CHANGED
|
@@ -201,6 +201,18 @@ const getCellValue = (rowIndex, name) => {
|
|
|
201
201
|
return (gridData[rowIndex] && gridData[rowIndex][name]) ? gridData[rowIndex][name] : "";
|
|
202
202
|
};
|
|
203
203
|
|
|
204
|
+
/**
|
|
205
|
+
* 获取行原始数据
|
|
206
|
+
*/
|
|
207
|
+
const getRowDataByField = (column, row) => {
|
|
208
|
+
if(column.type === 'SohelpTableSelect'){
|
|
209
|
+
const {field} = column;
|
|
210
|
+
return gridData.find(item => item[field].id === row[field]) || row;
|
|
211
|
+
} else{
|
|
212
|
+
return row;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
204
216
|
/**
|
|
205
217
|
* 获取关键字描述
|
|
206
218
|
*/
|
|
@@ -414,6 +426,7 @@ const loadConfig = (param = {}) => {
|
|
|
414
426
|
/**配置刷新功能 */
|
|
415
427
|
config.gridOptions = {
|
|
416
428
|
...config.gridOptions,
|
|
429
|
+
params: gridOptions.params ?? {},
|
|
417
430
|
toolbarConfig: {
|
|
418
431
|
...config.gridOptions?.toolbarConfig,
|
|
419
432
|
refresh: true,
|
|
@@ -427,6 +440,7 @@ const loadConfig = (param = {}) => {
|
|
|
427
440
|
}
|
|
428
441
|
};
|
|
429
442
|
|
|
443
|
+
|
|
430
444
|
//工具栏按钮权限
|
|
431
445
|
Object.assign(formulaMap, config.formulaMap);
|
|
432
446
|
Object.assign(gridOptions, config.gridOptions);
|
|
@@ -475,6 +489,7 @@ const load = async (params = {}, callback) => {
|
|
|
475
489
|
gridOptions.params = params;
|
|
476
490
|
await isConfigDone();
|
|
477
491
|
const $grid = sohelpVxeGridRef.value;
|
|
492
|
+
|
|
478
493
|
if ($grid) {
|
|
479
494
|
const url = props.url || sohelpConfig.value.requestValue;
|
|
480
495
|
if (sohelpConfig.value.requestType != "crud" && !url) {
|
|
@@ -482,6 +497,7 @@ const load = async (params = {}, callback) => {
|
|
|
482
497
|
return { results: [], total: 0 };
|
|
483
498
|
}
|
|
484
499
|
|
|
500
|
+
|
|
485
501
|
let pageConfig = {};
|
|
486
502
|
// 是否分页
|
|
487
503
|
if (gridOptions.pagerConfig?.enabled) {
|
|
@@ -499,6 +515,7 @@ const load = async (params = {}, callback) => {
|
|
|
499
515
|
});
|
|
500
516
|
|
|
501
517
|
|
|
518
|
+
|
|
502
519
|
if (res?.meta?.success) {
|
|
503
520
|
if (res.data) {
|
|
504
521
|
gridOptions.pagerConfig.total = Number(res.data.total);
|
|
@@ -523,12 +540,17 @@ const load = async (params = {}, callback) => {
|
|
|
523
540
|
callback(res);
|
|
524
541
|
}
|
|
525
542
|
}
|
|
543
|
+
|
|
526
544
|
};
|
|
527
545
|
|
|
528
546
|
/**
|
|
529
547
|
* 重新加载数据
|
|
530
548
|
*/
|
|
531
549
|
const reload = async (params = {}) => {
|
|
550
|
+
//取消选中
|
|
551
|
+
selections.value = [];
|
|
552
|
+
sohelpVxeGridRef.value?.clearCheckboxRow();
|
|
553
|
+
|
|
532
554
|
Object.assign(gridOptions.params, params);
|
|
533
555
|
load(gridOptions.params);
|
|
534
556
|
};
|
|
@@ -620,7 +642,10 @@ const getOperationButtonsByType = computed(() => {
|
|
|
620
642
|
* @param item
|
|
621
643
|
*/
|
|
622
644
|
const operationHandler = ({ item, row, $grid }) => {
|
|
645
|
+
|
|
623
646
|
//操作栏事件执行
|
|
647
|
+
$grid.reload = reload;
|
|
648
|
+
$grid.refresh = refresh;
|
|
624
649
|
if (item.handler && typeof item.handler === "string") {
|
|
625
650
|
try {
|
|
626
651
|
const func = new Function("row", "$grid", `return (async () => { ${item.handler} })()`);
|
|
@@ -649,13 +674,15 @@ const operationHandler = ({ item, row, $grid }) => {
|
|
|
649
674
|
if (item.openType === "tab") {
|
|
650
675
|
window.$SohelpModule.openTab(item.refid, { id: row.id }, item.params || {});
|
|
651
676
|
} else if (item.openType === "drawer") {
|
|
652
|
-
console.error("item", item.params);
|
|
653
677
|
window.$SohelpModule.openDrawer(item.refid, { id: row.id }, item.params || {});
|
|
654
678
|
} else {
|
|
655
679
|
window.$SohelpModule.openModal(item.refid, { id: row.id }, item.params || {});
|
|
656
680
|
}
|
|
657
681
|
} else {
|
|
658
682
|
switch (item.code) {
|
|
683
|
+
case "row.delete":
|
|
684
|
+
$grid?.remove(row)
|
|
685
|
+
break;
|
|
659
686
|
case "crud.edit":
|
|
660
687
|
visibleEntityForm.value = true;
|
|
661
688
|
toolbarButtonParams.value = item.params || {};
|
|
@@ -666,7 +693,7 @@ const operationHandler = ({ item, row, $grid }) => {
|
|
|
666
693
|
CrudHttp.detail(props.refid, { id: row.id }).then(res => {
|
|
667
694
|
if (res.meta.success) {
|
|
668
695
|
setTimeout(() => {
|
|
669
|
-
entityFormRef.value.setFormData(res.data);
|
|
696
|
+
entityFormRef.value.setFormData({...res.data});
|
|
670
697
|
}, 10);
|
|
671
698
|
} else {
|
|
672
699
|
EleMessage.error(res.meta.message);
|
|
@@ -697,6 +724,9 @@ const operationHandler = ({ item, row, $grid }) => {
|
|
|
697
724
|
case "crud.delete" :
|
|
698
725
|
remove({ id: [row.id] });
|
|
699
726
|
break;
|
|
727
|
+
case "row.pre-delete":
|
|
728
|
+
$grid?.setPendingRow(row, true);
|
|
729
|
+
break;
|
|
700
730
|
case "workflow.submit":
|
|
701
731
|
submitWorkflow({ id: [row.id] });
|
|
702
732
|
break;
|
|
@@ -755,6 +785,10 @@ const insertField = (data, index = -1) => {
|
|
|
755
785
|
* 刷新列表
|
|
756
786
|
*/
|
|
757
787
|
const refresh = () => {
|
|
788
|
+
//取消选中
|
|
789
|
+
selections.value = [];
|
|
790
|
+
sohelpVxeGridRef.value?.clearCheckboxRow();
|
|
791
|
+
|
|
758
792
|
if (!isPage.value) {
|
|
759
793
|
if (gridOptions.pagerConfig && gridOptions.pagerConfig.enabled) {
|
|
760
794
|
gridOptions.pagerConfig.currentPage = 1;
|
|
@@ -915,12 +949,13 @@ const orgDatasource = computed(async () => {
|
|
|
915
949
|
*/
|
|
916
950
|
const getCrudUpdater = () => {
|
|
917
951
|
const $grid = sohelpVxeGridRef.value;
|
|
952
|
+
const _delete = [...$grid?.getRemoveRecords()?.map(item => item.id),...$grid?.getPendingRecords()?.map(item => item.id)];
|
|
918
953
|
return {
|
|
919
954
|
"inserted": $grid?.getInsertRecords().map(item => {
|
|
920
955
|
return { ...item };
|
|
921
956
|
}) || [],
|
|
922
957
|
"updated": $grid?.getUpdateRecords(),
|
|
923
|
-
"deleted":
|
|
958
|
+
"deleted": _delete
|
|
924
959
|
};
|
|
925
960
|
};
|
|
926
961
|
|
|
@@ -947,12 +982,16 @@ const remove = (params) => {
|
|
|
947
982
|
*/
|
|
948
983
|
const executeToolbarCustomHandler = (button) => {
|
|
949
984
|
const $grid = sohelpVxeGridRef.value;
|
|
985
|
+
$grid.refresh = refresh;
|
|
986
|
+
$grid.reload = reload;
|
|
950
987
|
try {
|
|
951
|
-
let isRows = button.
|
|
988
|
+
let isRows = button.buttonType === 'batch';
|
|
952
989
|
const func = new Function(isRows ? "rows" : "row", "$grid", `return (async () => { ${button.handler} })()`);
|
|
953
990
|
(async () => {
|
|
954
991
|
const context = {
|
|
955
992
|
$message: EleMessage,
|
|
993
|
+
$SohelpModule: window.$SohelpModule,
|
|
994
|
+
$SohelpHttp: window.$SohelpHttp,
|
|
956
995
|
$confirm: (title, callback) => {
|
|
957
996
|
ElMessageBox.confirm(title, "提示", {
|
|
958
997
|
confirmButtonText: "确定",
|
|
@@ -982,7 +1021,6 @@ const toolbarClick = async ({ button }) => {
|
|
|
982
1021
|
let rowIndex = -1;
|
|
983
1022
|
const row = {};
|
|
984
1023
|
|
|
985
|
-
|
|
986
1024
|
const current = $grid?.getCurrentRecord();
|
|
987
1025
|
if (current) {
|
|
988
1026
|
rowIndex = $grid?.getVTRowIndex(current);
|
|
@@ -1026,10 +1064,13 @@ const toolbarClick = async ({ button }) => {
|
|
|
1026
1064
|
if (!toolbarButtonParams.value["title"]) {
|
|
1027
1065
|
toolbarButtonParams.value["title"] = t("grid.toolbar.create");
|
|
1028
1066
|
}
|
|
1067
|
+
|
|
1068
|
+
const {title, ...params} = button.params;
|
|
1069
|
+
|
|
1029
1070
|
CrudHttp.initial(props.refid, { id: row.id }, (res) => {
|
|
1030
1071
|
if (res.meta.success) {
|
|
1031
1072
|
setTimeout(() => {
|
|
1032
|
-
entityFormRef.value.setFormData(res.data);
|
|
1073
|
+
entityFormRef.value.setFormData({...res.data}, params);
|
|
1033
1074
|
}, 10);
|
|
1034
1075
|
} else {
|
|
1035
1076
|
EleMessage.error(res.meta.message);
|
|
@@ -1088,7 +1129,7 @@ const gridEvents = {
|
|
|
1088
1129
|
|
|
1089
1130
|
toolbarButtonClick(config) {
|
|
1090
1131
|
toolbarClick(config);
|
|
1091
|
-
emit("toolbarButtonClick", config);
|
|
1132
|
+
emit("toolbarButtonClick", config, selections.value);
|
|
1092
1133
|
}
|
|
1093
1134
|
|
|
1094
1135
|
};
|
|
@@ -1583,12 +1624,12 @@ v-for="item in sortList" :key="item.title" :header="item.title"
|
|
|
1583
1624
|
<ele-text
|
|
1584
1625
|
:icon="SortUp" style="cursor: pointer;" :underline="false" size="sm"
|
|
1585
1626
|
@click="sortCommand(item.field,'asc')" plain :type="isActiveSort(item.field,'asc')">
|
|
1586
|
-
t("grid.toolbar.asc")
|
|
1627
|
+
{{ t("grid.toolbar.asc") }}
|
|
1587
1628
|
</ele-text>
|
|
1588
1629
|
<ele-text
|
|
1589
1630
|
:icon="SortDown" style="cursor: pointer;margin-left:5px!important" :underline="false"
|
|
1590
1631
|
size="sm" @click="sortCommand(item.field,'desc')" plain
|
|
1591
|
-
:type="isActiveSort(item.field,'desc')">t("grid.toolbar.desc")
|
|
1632
|
+
:type="isActiveSort(item.field,'desc')">{{t("grid.toolbar.desc")}}
|
|
1592
1633
|
</ele-text>
|
|
1593
1634
|
</template>
|
|
1594
1635
|
</ele-card>
|
|
@@ -1635,6 +1676,7 @@ v-for="item in sortList" :key="item.title" :header="item.title"
|
|
|
1635
1676
|
:key="name"
|
|
1636
1677
|
>
|
|
1637
1678
|
|
|
1679
|
+
|
|
1638
1680
|
<sohelp-dict
|
|
1639
1681
|
type="text"
|
|
1640
1682
|
v-model="row[name]"
|
|
@@ -1872,6 +1914,14 @@ v-for="item in getOperationButtonsByType(row, column, 'more')" :key="item.code"
|
|
|
1872
1914
|
<template #valid_slot="{content}">
|
|
1873
1915
|
{{ content }}
|
|
1874
1916
|
</template>
|
|
1917
|
+
|
|
1918
|
+
|
|
1919
|
+
<template v-for="(_,name) in $slots" #[name]="{row, column}">
|
|
1920
|
+
|
|
1921
|
+
|
|
1922
|
+
<slot :name="name" :row="getRowDataByField(column,row)" :column="column"></slot>
|
|
1923
|
+
</template>
|
|
1924
|
+
|
|
1875
1925
|
</vxe-grid>
|
|
1876
1926
|
|
|
1877
1927
|
<!-- workflow -->
|
|
@@ -1920,9 +1970,10 @@ v-for="item in getOperationButtonsByType(row, column, 'more')" :key="item.code"
|
|
|
1920
1970
|
</ele-dropdown>
|
|
1921
1971
|
</template>
|
|
1922
1972
|
|
|
1973
|
+
|
|
1923
1974
|
<sohelp-entity-form
|
|
1924
1975
|
ref="entityFormRef"
|
|
1925
|
-
:refid="props.refid
|
|
1976
|
+
:refid="props.refid"
|
|
1926
1977
|
v-model="entityFormValue"
|
|
1927
1978
|
:data="entityFormData"
|
|
1928
1979
|
:config="entityFormConfig"
|
|
@@ -89,8 +89,9 @@ const switchVxeProperty = (property, sortList, f, formulaMap) => {
|
|
|
89
89
|
editor.editRender.maxlength = property.length;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
// 字典
|
|
93
|
+
if (property.type === 'SohelpDict') {
|
|
94
|
+
editor.editRender['code'] = property.editRender?.code || property.dict;
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
// 取默认显示值
|
|
@@ -171,7 +172,7 @@ const filterFieldsByProperties = (_data) => {
|
|
|
171
172
|
data.filter.field = filterArray(data.filter.field, 'name');
|
|
172
173
|
|
|
173
174
|
//过滤掉不在列表中的sort属性
|
|
174
|
-
data.filter.sort = filterArray(data.filter.sort.filter((item) => data.
|
|
175
|
+
data.filter.sort = filterArray(data.filter.sort.filter((item) => data.list.some((f) => f === item)));
|
|
175
176
|
data.properties = data.properties.filter((item) => item.name && !item.hidden);
|
|
176
177
|
return data;
|
|
177
178
|
};
|
|
@@ -284,6 +285,23 @@ export function useSohelpGridConfig() {
|
|
|
284
285
|
*/
|
|
285
286
|
const isConfigInitialized = ref(false);
|
|
286
287
|
const { t } = useI18n();
|
|
288
|
+
/**
|
|
289
|
+
* placeholder占位符映射
|
|
290
|
+
*/
|
|
291
|
+
const placeholderMap = {
|
|
292
|
+
SohelpSelect: '请选择ss',
|
|
293
|
+
SohelpTreeSelect: '请选择',
|
|
294
|
+
SohelpDict: '请选择',
|
|
295
|
+
SohelpUserSelect: '请选择用户',
|
|
296
|
+
SohelpDeptSelect: '请选择部门',
|
|
297
|
+
SohelpRoleSelect: '请选择角色',
|
|
298
|
+
SohelpDatePicker: '请选择日期',
|
|
299
|
+
SohelpTimePicker: '请选择时间',
|
|
300
|
+
SohelpDateTimePicker: '请选择日期时间',
|
|
301
|
+
SohelpInput: '请输入',
|
|
302
|
+
SohelpNumberInput: '请输入'
|
|
303
|
+
};
|
|
304
|
+
|
|
287
305
|
/**
|
|
288
306
|
* 初始化商邦网格列表配置
|
|
289
307
|
*/
|
|
@@ -318,6 +336,7 @@ export function useSohelpGridConfig() {
|
|
|
318
336
|
console.error('解析editorParam失败:', e);
|
|
319
337
|
}
|
|
320
338
|
}
|
|
339
|
+
param.placeholder = param?.placeholder || placeholderMap[cur?.editor] || '';
|
|
321
340
|
acc[cur.name] = { ...cur, editorParam: param };
|
|
322
341
|
return acc;
|
|
323
342
|
}, {})
|
|
@@ -9,11 +9,7 @@
|
|
|
9
9
|
<el-option label="满足所有条件" value="and" />
|
|
10
10
|
<el-option label="满足任一条件" value="or" />
|
|
11
11
|
</el-select>
|
|
12
|
-
<el-icon
|
|
13
|
-
@click="addSubCondition(0)"
|
|
14
|
-
style="margin-left: 10px; cursor: pointer"
|
|
15
|
-
size="24"
|
|
16
|
-
>
|
|
12
|
+
<el-icon @click="addSubCondition(0)" style="margin-left: 10px; cursor: pointer" size="24">
|
|
17
13
|
<Fold />
|
|
18
14
|
</el-icon>
|
|
19
15
|
<el-dropdown trigger="click">
|
|
@@ -22,11 +18,7 @@
|
|
|
22
18
|
</el-icon>
|
|
23
19
|
<template #dropdown>
|
|
24
20
|
<el-dropdown-menu>
|
|
25
|
-
<el-dropdown-item
|
|
26
|
-
@click="addCondition(item)"
|
|
27
|
-
v-for="item in fields"
|
|
28
|
-
>{{ item.label }}</el-dropdown-item
|
|
29
|
-
>
|
|
21
|
+
<el-dropdown-item @click="addCondition(item)" v-for="item in fields">{{ item.label }}</el-dropdown-item>
|
|
30
22
|
</el-dropdown-menu>
|
|
31
23
|
</template>
|
|
32
24
|
</el-dropdown>
|
|
@@ -35,39 +27,19 @@
|
|
|
35
27
|
v-if="obj.children && obj.children.length"
|
|
36
28
|
v-for="(item, index) in obj.children"
|
|
37
29
|
:style="{
|
|
38
|
-
borderLeft:
|
|
39
|
-
obj.type === 'and' ? '4px solid #38c10b' : '4px solid #c59d0a'
|
|
30
|
+
borderLeft: obj.type === 'and' ? '4px solid #38c10b' : '4px solid #c59d0a'
|
|
40
31
|
}"
|
|
41
32
|
>
|
|
42
|
-
<div
|
|
43
|
-
v-if="!item.type"
|
|
44
|
-
style="
|
|
45
|
-
display: flex;
|
|
46
|
-
align-items: center;
|
|
47
|
-
justify-content: space-between;
|
|
48
|
-
padding: 10px;
|
|
49
|
-
"
|
|
50
|
-
>
|
|
33
|
+
<div v-if="!item.type" style="display: flex; align-items: center; justify-content: space-between; padding: 10px">
|
|
51
34
|
<div style="display: flex; align-items: center; width: 240px">
|
|
52
|
-
<div style="font-size: 16px; margin-right: 10px">{{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<select
|
|
56
|
-
v-model="item.comparison"
|
|
57
|
-
style="border: none; width: auto; background-color: #dedede"
|
|
58
|
-
>
|
|
59
|
-
<option v-for="op in options" :value="op.value">{{
|
|
60
|
-
op.label
|
|
61
|
-
}}</option>
|
|
35
|
+
<div style="font-size: 16px; margin-right: 10px">{{ item.label }}</div>
|
|
36
|
+
<select v-model="item.comparison" style="border: none; width: auto; background-color: #dedede">
|
|
37
|
+
<option v-for="op in options" :value="op.value">{{ op.label }}</option>
|
|
62
38
|
</select>
|
|
63
39
|
</div>
|
|
64
40
|
<div style="display: flex; align-items: center">
|
|
65
41
|
<el-input v-model="item.value" placeholder="请输入" />
|
|
66
|
-
<el-icon
|
|
67
|
-
@click="removeCondition(index)"
|
|
68
|
-
style="margin-left: 8px"
|
|
69
|
-
size="20"
|
|
70
|
-
>
|
|
42
|
+
<el-icon @click="removeCondition(index)" style="margin-left: 8px" size="20">
|
|
71
43
|
<Delete />
|
|
72
44
|
</el-icon>
|
|
73
45
|
</div>
|
|
@@ -185,7 +157,6 @@
|
|
|
185
157
|
});
|
|
186
158
|
}
|
|
187
159
|
|
|
188
|
-
|
|
189
160
|
data.push(row);
|
|
190
161
|
this.obj.children = data.concat(datato);
|
|
191
162
|
},
|
|
@@ -32,10 +32,7 @@
|
|
|
32
32
|
></grid-filter-keywords>
|
|
33
33
|
</template>
|
|
34
34
|
<template #scheme>
|
|
35
|
-
<grid-filter-scheme
|
|
36
|
-
v-model="filterConfig.filter.scheme"
|
|
37
|
-
:properties="propertiesArray"
|
|
38
|
-
></grid-filter-scheme>
|
|
35
|
+
<grid-filter-scheme v-model="filterConfig.filter.scheme" :properties="propertiesArray"></grid-filter-scheme>
|
|
39
36
|
</template>
|
|
40
37
|
<template #config>
|
|
41
38
|
<grid-filter-config v-model="filterConfig"></grid-filter-config>
|
|
@@ -50,7 +47,7 @@
|
|
|
50
47
|
</ele-modal>
|
|
51
48
|
</template>
|
|
52
49
|
<script setup>
|
|
53
|
-
import { defineProps, onMounted, ref, watch } from
|
|
50
|
+
import { defineProps, onMounted, ref, watch } from 'vue';
|
|
54
51
|
|
|
55
52
|
import GridFilterField from './grid-filter-field.vue';
|
|
56
53
|
import GridFilterSort from './grid-filter-sort.vue';
|
|
@@ -75,7 +72,6 @@ import { defineProps, onMounted, ref, watch } from "vue";
|
|
|
75
72
|
const tabsKey = ref(0);
|
|
76
73
|
const propertiesArray = ref([]);
|
|
77
74
|
|
|
78
|
-
|
|
79
75
|
const gridActiveTab = ref('list');
|
|
80
76
|
const gridTabs = [
|
|
81
77
|
{
|
|
@@ -97,7 +93,8 @@ import { defineProps, onMounted, ref, watch } from "vue";
|
|
|
97
93
|
{
|
|
98
94
|
name: 'scheme',
|
|
99
95
|
label: '筛选场景'
|
|
100
|
-
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
101
98
|
name: 'config',
|
|
102
99
|
label: '基本配置'
|
|
103
100
|
}
|
|
@@ -115,7 +112,7 @@ import { defineProps, onMounted, ref, watch } from "vue";
|
|
|
115
112
|
}
|
|
116
113
|
);
|
|
117
114
|
|
|
118
|
-
onMounted(()=>{
|
|
115
|
+
onMounted(() => {
|
|
119
116
|
originFilterConfigValue.value = JSON.parse(JSON.stringify(props.config));
|
|
120
117
|
propertiesArray.value = props.config?.properties
|
|
121
118
|
?.map(({ name, label, hidden }) => {
|
|
@@ -165,7 +162,7 @@ import { defineProps, onMounted, ref, watch } from "vue";
|
|
|
165
162
|
if (res.meta.success) {
|
|
166
163
|
emit('update:modelValue', false);
|
|
167
164
|
moduleCache.clear();
|
|
168
|
-
emit('done',filterConfig.value);
|
|
165
|
+
emit('done', filterConfig.value);
|
|
169
166
|
ElMessage.success(res?.meta.message || '操作成功');
|
|
170
167
|
} else {
|
|
171
168
|
ElMessage.error(res?.meta.message || '操作成功');
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
:properties="propertiesMap?.[item.name]"
|
|
33
33
|
:ref="(el) => setItemRef(el, item.name)"
|
|
34
34
|
></filter-condition-item>
|
|
35
|
-
|
|
35
|
+
</div>
|
|
36
|
+
<template #footer>
|
|
36
37
|
<div
|
|
37
38
|
class="footer-top-right"
|
|
38
39
|
v-if="filterList.length > 0 && config.filter?.config.filterPosition !== 'MODAL'"
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
<ele-text size="xs" :icon="Minus" v-else> 收缩</ele-text>
|
|
55
56
|
</el-link>
|
|
56
57
|
</div>
|
|
57
|
-
</
|
|
58
|
+
</template>
|
|
58
59
|
</ele-card>
|
|
59
60
|
</template>
|
|
60
61
|
|
|
@@ -164,7 +165,7 @@
|
|
|
164
165
|
if (filterPosition?.toUpperCase() === 'TOP') {
|
|
165
166
|
maxRowsConfig.current.index = filterList.value.length;
|
|
166
167
|
maxRowsConfig.height = advancedBoxRef.value?.offsetHeight + 'px';
|
|
167
|
-
const advancedRow = advancedBoxRef.value
|
|
168
|
+
const advancedRow = advancedBoxRef.value?.querySelector('.sohelp-filter-condition');
|
|
168
169
|
if (advancedRow) {
|
|
169
170
|
maxRowsConfig.rowHeight = advancedRow.offsetHeight;
|
|
170
171
|
}
|
|
@@ -279,13 +280,11 @@
|
|
|
279
280
|
}
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
|
|
283
|
-
.footer-top-right {
|
|
284
|
-
text-align: right;
|
|
285
|
-
margin-left: auto;
|
|
286
|
-
}
|
|
287
283
|
}
|
|
288
|
-
|
|
284
|
+
.footer-top-right {
|
|
285
|
+
text-align: right;
|
|
286
|
+
margin-left: auto;
|
|
287
|
+
}
|
|
289
288
|
.sohelp-filter {
|
|
290
289
|
.footer-right {
|
|
291
290
|
display: flex;
|
|
@@ -376,7 +375,7 @@
|
|
|
376
375
|
|
|
377
376
|
.sohelp-filter.right {
|
|
378
377
|
width: 100%;
|
|
379
|
-
height: calc(100% -
|
|
378
|
+
height: calc(100% - 25px);
|
|
380
379
|
padding-left: 10px;
|
|
381
380
|
margin-left: 0px;
|
|
382
381
|
box-sizing: border-box;
|
|
@@ -393,8 +392,7 @@
|
|
|
393
392
|
|
|
394
393
|
:deep(.ele-card-footer) {
|
|
395
394
|
width: calc(100% - 30px);
|
|
396
|
-
|
|
397
|
-
z-index: 99999;
|
|
395
|
+
z-index: 999;
|
|
398
396
|
bottom: 0px;
|
|
399
397
|
position: absolute;
|
|
400
398
|
}
|
|
@@ -422,7 +420,7 @@
|
|
|
422
420
|
|
|
423
421
|
.sohelp-filter.right :deep(.ele-card-body) {
|
|
424
422
|
flex: 1;
|
|
425
|
-
|
|
423
|
+
height: 100%;
|
|
426
424
|
}
|
|
427
425
|
|
|
428
426
|
.sohelp-filter.modal :deep(.ele-card-body) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { computed, nextTick, reactive, ref, watch } from
|
|
2
|
+
import { computed, nextTick, reactive, ref, watch } from 'vue';
|
|
3
3
|
import { useMobile } from '@/utils/use-mobile';
|
|
4
4
|
import SohelpFilter from './filter/index.vue';
|
|
5
5
|
import SohelpGrid from '../sohelp-grid/index.vue';
|
|
@@ -106,8 +106,8 @@ import { computed, nextTick, reactive, ref, watch } from "vue";
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
//工具栏按钮点击事件
|
|
109
|
-
const toolbarButtonClick = (config) => {
|
|
110
|
-
emit('toolbarButtonClick', config);
|
|
109
|
+
const toolbarButtonClick = (config, rows) => {
|
|
110
|
+
emit('toolbarButtonClick', config, rows);
|
|
111
111
|
};
|
|
112
112
|
//右击菜单按钮点击事件
|
|
113
113
|
const menuRightClick = (config) => {
|
|
@@ -138,8 +138,8 @@ import { computed, nextTick, reactive, ref, watch } from "vue";
|
|
|
138
138
|
* @param params
|
|
139
139
|
* @param callback
|
|
140
140
|
*/
|
|
141
|
-
const load =
|
|
142
|
-
|
|
141
|
+
const load = (params = {}, callback) => {
|
|
142
|
+
sohelpGridRef.value.load(params, callback);
|
|
143
143
|
};
|
|
144
144
|
/**
|
|
145
145
|
* 刷新数据
|
|
@@ -258,7 +258,11 @@ import { computed, nextTick, reactive, ref, watch } from "vue";
|
|
|
258
258
|
@operationButtonClick="operationButtonClick"
|
|
259
259
|
@editClosed="editClosed"
|
|
260
260
|
@currentColumnChange="currentColumnChange"
|
|
261
|
-
|
|
261
|
+
>
|
|
262
|
+
<template v-for="(_, name) in $slots" #[name]="slotProps">
|
|
263
|
+
<slot :name="name" v-bind="slotProps" />
|
|
264
|
+
</template>
|
|
265
|
+
</sohelp-grid>
|
|
262
266
|
</template>
|
|
263
267
|
</ele-split-panel>
|
|
264
268
|
</div>
|
package/sohelp-import/index.vue
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<ele-text>支持文件格式:xls、xlsx;大小 ≤ 50MB;最多 10,000 行</ele-text>
|
|
7
7
|
</div>
|
|
8
8
|
<div class="actions">
|
|
9
|
-
<el-button
|
|
10
|
-
<el-button plain @click="openConfig">配置导入列表</el-button>
|
|
9
|
+
<el-button plain :loading="downloadingTemplate" @click="downloadTemplate">下载导入模板</el-button>
|
|
10
|
+
<el-button plain @click="openConfig" v-if="false">配置导入列表</el-button>
|
|
11
11
|
<el-link :underline="false" @click="viewHistory">查看导入历史</el-link>
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
package/sohelp-modal/index.vue
CHANGED
|
@@ -5,15 +5,7 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import {
|
|
9
|
-
watch,
|
|
10
|
-
onMounted,
|
|
11
|
-
onBeforeUnmount,
|
|
12
|
-
onActivated,
|
|
13
|
-
onDeactivated,
|
|
14
|
-
nextTick,
|
|
15
|
-
useAttrs
|
|
16
|
-
} from 'vue';
|
|
8
|
+
import { watch, onMounted, onBeforeUnmount, onActivated, onDeactivated, nextTick, useAttrs } from 'vue';
|
|
17
9
|
import tinymce from 'tinymce/tinymce';
|
|
18
10
|
import 'tinymce/themes/silver';
|
|
19
11
|
import 'tinymce/icons/default';
|
|
@@ -46,13 +38,7 @@
|
|
|
46
38
|
import 'tinymce/plugins/emoticons/js/emojis';
|
|
47
39
|
import { storeToRefs } from 'pinia';
|
|
48
40
|
import { useThemeStore } from '@/store/modules/theme';
|
|
49
|
-
import {
|
|
50
|
-
DEFAULT_CONFIG,
|
|
51
|
-
DARK_CONFIG,
|
|
52
|
-
uuid,
|
|
53
|
-
bindHandlers,
|
|
54
|
-
openAlert
|
|
55
|
-
} from './util';
|
|
41
|
+
import { DEFAULT_CONFIG, DARK_CONFIG, uuid, bindHandlers, openAlert } from './util';
|
|
56
42
|
|
|
57
43
|
const props = defineProps({
|
|
58
44
|
/** 编辑器唯一id */
|
|
@@ -106,11 +92,7 @@
|
|
|
106
92
|
|
|
107
93
|
/** 修改内容 */
|
|
108
94
|
const setContent = (value) => {
|
|
109
|
-
if (
|
|
110
|
-
editorIns &&
|
|
111
|
-
typeof value === 'string' &&
|
|
112
|
-
value !== editorIns.getContent()
|
|
113
|
-
) {
|
|
95
|
+
if (editorIns && typeof value === 'string' && value !== editorIns.getContent()) {
|
|
114
96
|
editorIns.setContent(value);
|
|
115
97
|
}
|
|
116
98
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
@page-change="pageChangeEvent"
|
|
7
7
|
ref="sohelpVxeGridRef"
|
|
8
8
|
@menuClick="menuEvents"
|
|
9
|
+
:id="getId()"
|
|
9
10
|
@toolbarButtonClick="onToolbarButtonClick"
|
|
10
11
|
@checkboxChange="onCheckboxChange"
|
|
11
12
|
@checkboxAll="onCheckboxAllChange"
|
|
@@ -53,6 +54,7 @@
|
|
|
53
54
|
import { merge, cloneDeep } from 'lodash-es'; // 正确导入
|
|
54
55
|
import DefaultProps from './DefaultProps';
|
|
55
56
|
import { Search } from '@element-plus/icons-vue';
|
|
57
|
+
import { uuid } from '../utils/core.js';
|
|
56
58
|
import DefaultGridOptions from './DefaultGridOptions';
|
|
57
59
|
|
|
58
60
|
/**判断配置是否初始化完毕*/
|
|
@@ -78,6 +80,11 @@
|
|
|
78
80
|
const keywords = ref('');
|
|
79
81
|
const props = defineProps(cloneDeep(DefaultProps));
|
|
80
82
|
|
|
83
|
+
/** 自动生成ID */
|
|
84
|
+
const getId = () => {
|
|
85
|
+
return 'sohelp-grid-' + uuid();
|
|
86
|
+
};
|
|
87
|
+
|
|
81
88
|
/**列表实例*/
|
|
82
89
|
const sohelpVxeGridRef = ref(null);
|
|
83
90
|
|