cloud-web-corejs 1.0.268 → 1.0.270
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/src/components/excelExport/exportFieldDialog.vue +375 -367
- package/src/components/excelExport/exportType.js +49 -0
- package/src/components/excelExport/mixins.js +1153 -1144
- package/src/components/table/config.js +6 -4
- package/src/components/table/index.js +78 -22
- package/src/components/table/state.js +42 -0
- package/src/components/table/vxeFilter/index.js +4 -2
- package/src/components/table/vxeFilter/mixin.js +10 -4
- package/src/components/xform/form-designer/form-widget/dialog/vabSearchDialog.vue +2 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/event-handler/afterColumnsCreated-editor.vue +30 -0
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +1 -0
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +1 -0
- package/src/components/xform/form-render/container-item/data-table-mixin.js +32 -2
- package/src/views/user/wf/wf_manage/list.vue +17 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getTableStateValue } from './state';
|
|
2
|
+
|
|
1
3
|
let modules = {};
|
|
2
4
|
|
|
3
5
|
modules = {
|
|
@@ -33,7 +35,7 @@ modules = {
|
|
|
33
35
|
}, ' ' + tableDataInfo.visibleData.length + ' ')
|
|
34
36
|
];
|
|
35
37
|
if (pager) {
|
|
36
|
-
if (pager && $grid
|
|
38
|
+
if (pager && getTableStateValue($grid, 'isQueryAllPage')) {
|
|
37
39
|
celems.push(h('span', '/'));
|
|
38
40
|
celems.push(h('span', {
|
|
39
41
|
attrs: {
|
|
@@ -42,7 +44,7 @@ modules = {
|
|
|
42
44
|
}, ' ' + pager.total));
|
|
43
45
|
}
|
|
44
46
|
|
|
45
|
-
let iconClass = $grid
|
|
47
|
+
let iconClass = getTableStateValue($grid, 'isQueryAllPage') ? 'icon-yincang' : 'el-icon-view';
|
|
46
48
|
|
|
47
49
|
celems.push(h('i', {
|
|
48
50
|
attrs: {
|
|
@@ -53,8 +55,8 @@ modules = {
|
|
|
53
55
|
let refTarget = $grid.$vnode.data.ref;
|
|
54
56
|
let that = $grid.params.originOption.vue;
|
|
55
57
|
let tableName = $grid.params.originOption.tableName;
|
|
56
|
-
$grid.$vxeTableUtil.checkQueryTotal(that, refTarget,
|
|
57
|
-
|
|
58
|
+
$grid.$vxeTableUtil.checkQueryTotal(that, refTarget,
|
|
59
|
+
!getTableStateValue($grid, 'isQueryAllPage'));
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
}));
|
|
@@ -8,6 +8,7 @@ import { extendDeeply } from "../../utils/index.js";
|
|
|
8
8
|
import corejsConfig from "@/corejsConfig";
|
|
9
9
|
import settingConfig from "@/settings.js";
|
|
10
10
|
import { getCellValue, createParams } from "./util/index";
|
|
11
|
+
import { getTableStateValue, setTableState } from "./state";
|
|
11
12
|
|
|
12
13
|
let configUtil = {
|
|
13
14
|
Sortable,
|
|
@@ -78,6 +79,15 @@ async function initVxeTable(option) {
|
|
|
78
79
|
$grid.originOption = originOption;
|
|
79
80
|
option.vue = that;
|
|
80
81
|
|
|
82
|
+
// 运行时状态先收集到局部对象,末尾并入 nOption.params 随 vxeOption 传给表格实例,
|
|
83
|
+
// 保证页面 v-if 销毁重建 grid 后状态不丢(详见 ./state.js)
|
|
84
|
+
let tableState = {
|
|
85
|
+
tableName: tableName || null,
|
|
86
|
+
isQueryAllPage: true,
|
|
87
|
+
exportColumns: null,
|
|
88
|
+
exportItemColumns: null,
|
|
89
|
+
};
|
|
90
|
+
|
|
81
91
|
let isQueryAllPage = true;
|
|
82
92
|
if (option.isQueryAllPage !== null && option.isQueryAllPage !== undefined) {
|
|
83
93
|
isQueryAllPage = option.isQueryAllPage;
|
|
@@ -85,7 +95,7 @@ async function initVxeTable(option) {
|
|
|
85
95
|
|
|
86
96
|
let searchColumns = null;
|
|
87
97
|
if (tableName) {
|
|
88
|
-
$grid
|
|
98
|
+
setTableState($grid, "tableName", tableName);
|
|
89
99
|
if (option.path) {
|
|
90
100
|
await getTableData(that, option.tableRef, "isQueryAllPage", (res1) => {
|
|
91
101
|
let result = res1.objx ? res1.objx.data : null;
|
|
@@ -113,7 +123,7 @@ async function initVxeTable(option) {
|
|
|
113
123
|
json.searchColumns
|
|
114
124
|
);
|
|
115
125
|
$grid.searchColumns = searchColumns;
|
|
116
|
-
initExportColumns($grid, json);
|
|
126
|
+
initExportColumns($grid, tableState, json);
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
if (!searchColumns || !searchColumns.length) {
|
|
@@ -137,10 +147,11 @@ async function initVxeTable(option) {
|
|
|
137
147
|
option.isQueryAllPage = isQueryAllPage;
|
|
138
148
|
let nOption = initOption(option);
|
|
139
149
|
|
|
140
|
-
// isQueryAllPage
|
|
141
|
-
// pager 插槽与代理 ajax.query
|
|
150
|
+
// isQueryAllPage 的事实源是 $grid.params(checkQueryTotal 也写这里),
|
|
151
|
+
// pager 插槽与代理 ajax.query 均读它,初始化必须回写,
|
|
142
152
|
// 否则首屏恒为 undefined:既丢用户存的偏好,也让页面配置的 false 不生效。
|
|
143
|
-
|
|
153
|
+
tableState.isQueryAllPage = isQueryAllPage;
|
|
154
|
+
setTableState($grid, "isQueryAllPage", isQueryAllPage);
|
|
144
155
|
|
|
145
156
|
if (tableName) {
|
|
146
157
|
nOption.tableName = tableName;
|
|
@@ -157,12 +168,14 @@ async function initVxeTable(option) {
|
|
|
157
168
|
// nOption.getCellValue = getCellValue;
|
|
158
169
|
// nOption.createParams = createParams;
|
|
159
170
|
// nOption.searchColumns = searchColumns;
|
|
160
|
-
//
|
|
171
|
+
// 运行时可变状态(tableName / isQueryAllPage / exportColumns / exportItemColumns)
|
|
172
|
+
// 一并放进 params:params 随 vxeOption 由页面持有,grid 被 v-if 销毁重建后依然带着这些值
|
|
161
173
|
let params = {
|
|
162
174
|
originOption,
|
|
163
175
|
getCellValue,
|
|
164
176
|
createParams,
|
|
165
177
|
searchColumns,
|
|
178
|
+
...tableState,
|
|
166
179
|
};
|
|
167
180
|
if (!nOption.params) nOption.params = {};
|
|
168
181
|
Object.assign(nOption.params, params);
|
|
@@ -193,6 +206,35 @@ function handleToolbar($grid, option) {
|
|
|
193
206
|
}
|
|
194
207
|
}
|
|
195
208
|
|
|
209
|
+
/**
|
|
210
|
+
* grid 被 v-if 销毁重建后调用(页面把 showTable 从 false 切回 true 之类)。
|
|
211
|
+
*
|
|
212
|
+
* 状态类(tableName / isQueryAllPage / exportColumns…)已经随 params 跨重建存活,
|
|
213
|
+
* 这里只重做「绑在实例或 DOM 上、params 带不走」的那部分:
|
|
214
|
+
* - columnDrop:Sortable 绑的是旧表头 DOM,重建后新表头上什么都没有,列拖拽会静默失效;
|
|
215
|
+
* - handleToolbar:$grid.connect(toolbar) 是实例间的连接,重建后失联。
|
|
216
|
+
* 必须等新 grid 渲染出表头再绑,所以整体放在 $nextTick 里。
|
|
217
|
+
*/
|
|
218
|
+
function rebindGrid(that, tableRef) {
|
|
219
|
+
let $grid = getGrid(that, tableRef);
|
|
220
|
+
let originOption = $grid && $grid.params && $grid.params.originOption;
|
|
221
|
+
if (!originOption) {
|
|
222
|
+
// 没走过 initVxeTable 的表格没有 params.originOption,无从重绑
|
|
223
|
+
return Promise.resolve(false);
|
|
224
|
+
}
|
|
225
|
+
$grid.originOption = originOption;
|
|
226
|
+
// vxeFilter 已改为直接 import 工具函数,这里补挂只为兼容直接读 $table.getCellValue 的业务代码
|
|
227
|
+
if ($grid.$refs && $grid.$refs.xTable) {
|
|
228
|
+
$grid.$refs.xTable.getCellValue = getCellValue;
|
|
229
|
+
$grid.$refs.xTable.createParams = createParams;
|
|
230
|
+
}
|
|
231
|
+
return $grid.$nextTick().then(() => {
|
|
232
|
+
columnDrop(that, originOption.tableName, tableRef);
|
|
233
|
+
handleToolbar($grid, originOption);
|
|
234
|
+
return true;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
196
238
|
//操作列自动补全
|
|
197
239
|
function handleCustomAlign(option) {
|
|
198
240
|
let selfConfig = getSelfConfig();
|
|
@@ -270,6 +312,16 @@ function columnDrop(t, tableName, tableRef) {
|
|
|
270
312
|
if (!$table) {
|
|
271
313
|
return;
|
|
272
314
|
}
|
|
315
|
+
// 表头尚未渲染(grid 刚被 v-if 重建、DOM 还没就绪)时 querySelector 返回 null,
|
|
316
|
+
// Sortable.create(null) 会直接抛错,这里降级为不绑定,由调用方在 $nextTick 后重试
|
|
317
|
+
const headerElem =
|
|
318
|
+
$table.$el &&
|
|
319
|
+
$table.$el.querySelector(
|
|
320
|
+
".body--wrapper>.vxe-table--header .vxe-header--row"
|
|
321
|
+
);
|
|
322
|
+
if (!headerElem) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
273
325
|
// if (!$table.params) $table.params = {};
|
|
274
326
|
if ($table.sortable) {
|
|
275
327
|
$table.sortable.destroy();
|
|
@@ -278,9 +330,7 @@ function columnDrop(t, tableName, tableRef) {
|
|
|
278
330
|
let dragStartIndex = -1;
|
|
279
331
|
let dragEndIndex = -1;
|
|
280
332
|
$table.sortable = configUtil.Sortable.create(
|
|
281
|
-
|
|
282
|
-
".body--wrapper>.vxe-table--header .vxe-header--row"
|
|
283
|
-
),
|
|
333
|
+
headerElem,
|
|
284
334
|
{
|
|
285
335
|
handle: ".vxe-header--column:not(.col--fixed)",
|
|
286
336
|
onMove: (a, b, c) => {
|
|
@@ -546,7 +596,7 @@ function initOption(opts) {
|
|
|
546
596
|
" " + tableDataInfo.visibleData.length + " "
|
|
547
597
|
),
|
|
548
598
|
];
|
|
549
|
-
if (pager && $grid
|
|
599
|
+
if (pager && getTableStateValue($grid, "isQueryAllPage")) {
|
|
550
600
|
celems.push(
|
|
551
601
|
h(
|
|
552
602
|
"span",
|
|
@@ -648,7 +698,7 @@ function initOption(opts) {
|
|
|
648
698
|
}
|
|
649
699
|
|
|
650
700
|
let $grid = getGrid(that, opts.tableRef);
|
|
651
|
-
let isQueryAllPage = $grid
|
|
701
|
+
let isQueryAllPage = getTableStateValue($grid, "isQueryAllPage");
|
|
652
702
|
let pathStr1 = "";
|
|
653
703
|
if (isQueryAllPage === false) {
|
|
654
704
|
queryParams.searchCount = false;
|
|
@@ -926,11 +976,13 @@ function addTableJson(that, $grid, tableName, columns, success) {
|
|
|
926
976
|
columns: saveColumn,
|
|
927
977
|
searchColumns: searchColumns,
|
|
928
978
|
};
|
|
929
|
-
|
|
930
|
-
|
|
979
|
+
let exportColumns = getTableStateValue($grid, "exportColumns");
|
|
980
|
+
let exportItemColumns = getTableStateValue($grid, "exportItemColumns");
|
|
981
|
+
if (exportColumns && exportColumns.length) {
|
|
982
|
+
jsonData.exportColumns = exportColumns;
|
|
931
983
|
}
|
|
932
|
-
if (
|
|
933
|
-
jsonData.exportItemColumns =
|
|
984
|
+
if (exportItemColumns && exportItemColumns.length) {
|
|
985
|
+
jsonData.exportItemColumns = exportItemColumns;
|
|
934
986
|
}
|
|
935
987
|
let json = encodeURIComponent(JSON.stringify(jsonData));
|
|
936
988
|
|
|
@@ -1020,12 +1072,14 @@ function initColumn(option, syncColumns) {
|
|
|
1020
1072
|
return newColumns;
|
|
1021
1073
|
}
|
|
1022
1074
|
|
|
1023
|
-
function initExportColumns($grid, json) {
|
|
1075
|
+
function initExportColumns($grid, tableState, json) {
|
|
1024
1076
|
if (json?.exportColumns?.length) {
|
|
1025
|
-
|
|
1077
|
+
tableState.exportColumns = json.exportColumns;
|
|
1078
|
+
setTableState($grid, "exportColumns", json.exportColumns);
|
|
1026
1079
|
}
|
|
1027
1080
|
if (json?.exportItemColumns?.length) {
|
|
1028
|
-
|
|
1081
|
+
tableState.exportItemColumns = json.exportItemColumns;
|
|
1082
|
+
setTableState($grid, "exportItemColumns", json.exportItemColumns);
|
|
1029
1083
|
}
|
|
1030
1084
|
}
|
|
1031
1085
|
|
|
@@ -1141,7 +1195,7 @@ function getTableData(that, tableRef, type, success) {
|
|
|
1141
1195
|
)
|
|
1142
1196
|
return false;
|
|
1143
1197
|
let $grid = getGrid(that, tableRef);
|
|
1144
|
-
let tableName = $grid
|
|
1198
|
+
let tableName = getTableStateValue($grid, "tableName");
|
|
1145
1199
|
let url = USER_PREFIX + "/table_column/getTableData";
|
|
1146
1200
|
let param = {
|
|
1147
1201
|
tableName: tableName,
|
|
@@ -1163,7 +1217,7 @@ function addTableData(that, tableRef, value, success) {
|
|
|
1163
1217
|
)
|
|
1164
1218
|
return false;
|
|
1165
1219
|
let $grid = getGrid(that, tableRef);
|
|
1166
|
-
let tableName = $grid
|
|
1220
|
+
let tableName = getTableStateValue($grid, "tableName");
|
|
1167
1221
|
if (tableName) {
|
|
1168
1222
|
that.$http({
|
|
1169
1223
|
method: "post",
|
|
@@ -1180,8 +1234,7 @@ function addTableData(that, tableRef, value, success) {
|
|
|
1180
1234
|
|
|
1181
1235
|
function checkQueryTotal(that, tableRef, value) {
|
|
1182
1236
|
let $grid = getGrid(that, tableRef);
|
|
1183
|
-
$grid
|
|
1184
|
-
let tableName = $grid.tableName;
|
|
1237
|
+
setTableState($grid, "isQueryAllPage", value);
|
|
1185
1238
|
let option = $grid.getProxyInfo();
|
|
1186
1239
|
let pagerConfig = $grid.pagerConfig;
|
|
1187
1240
|
|
|
@@ -1201,6 +1254,7 @@ function getPagerConfigLayouts(opts) {
|
|
|
1201
1254
|
modules = {
|
|
1202
1255
|
initVxeTable,
|
|
1203
1256
|
columnDrop,
|
|
1257
|
+
rebindGrid,
|
|
1204
1258
|
initOption,
|
|
1205
1259
|
getTableJson,
|
|
1206
1260
|
addTableJson,
|
|
@@ -1212,6 +1266,8 @@ modules = {
|
|
|
1212
1266
|
checkQueryTotal,
|
|
1213
1267
|
getCellValue,
|
|
1214
1268
|
createParams,
|
|
1269
|
+
getTableStateValue,
|
|
1270
|
+
setTableState,
|
|
1215
1271
|
};
|
|
1216
1272
|
|
|
1217
1273
|
if (!configUtil.Vue.prototype.$vxeTableUtil)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表格运行时状态收口。
|
|
3
|
+
*
|
|
4
|
+
* 背景:initVxeTable 早期把 tableName / isQueryAllPage / exportColumns 等运行时状态
|
|
5
|
+
* 直接挂在 vxe-grid 实例上。页面若用 v-if 销毁重建 grid 而不重跑 initVxeTable
|
|
6
|
+
* (如 pmd/product_problem_record/list.vue 里 showTable false→true 那一段),
|
|
7
|
+
* 新实例上这些属性全为 undefined,表现为:
|
|
8
|
+
* - 导出字段勾选丢失,且下次 addTableJson 会把服务端已存的 exportColumns 一并抹掉;
|
|
9
|
+
* - “查询全部页”偏好静默存不进去(tableName 取不到);
|
|
10
|
+
* - 分页器 total 与切换图标状态错乱(isQueryAllPage 恒 falsy)。
|
|
11
|
+
* 同源问题还导致过筛选面板的 $table.getCellValue is not a function。
|
|
12
|
+
*
|
|
13
|
+
* 现在统一存放在 $grid.params 上:params 对象随 vxeOption 由页面持有,
|
|
14
|
+
* 重建时原样传给新实例,因此状态可以跨重建存活。
|
|
15
|
+
*
|
|
16
|
+
* 兼容:写入时同步回写 $grid 实例属性,读取时 params 里没有再回落到实例属性。
|
|
17
|
+
* 未经 initVxeTable 初始化的表格(xform 自建 option 等)行为与改造前完全一致。
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** 读状态:优先 params,回落实例属性 */
|
|
21
|
+
export function getTableStateValue($grid, key) {
|
|
22
|
+
if (!$grid) return undefined;
|
|
23
|
+
let params = $grid.params;
|
|
24
|
+
if (params) {
|
|
25
|
+
let value = params[key];
|
|
26
|
+
if (value !== undefined && value !== null) return value;
|
|
27
|
+
}
|
|
28
|
+
return $grid[key];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** 写状态:params 与实例属性同时写,保证新旧读法都拿到同一个值 */
|
|
32
|
+
export function setTableState($grid, key, value) {
|
|
33
|
+
if (!$grid) return;
|
|
34
|
+
// params 是 prop 对象,只改其中的 key,不整体重新赋值
|
|
35
|
+
if ($grid.params) $grid.params[key] = value;
|
|
36
|
+
$grid[key] = value;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
getTableStateValue,
|
|
41
|
+
setTableState,
|
|
42
|
+
};
|
|
@@ -3,6 +3,8 @@ import XEUtils from 'xe-utils';
|
|
|
3
3
|
import FilterComplex from './FilterComplex.vue';
|
|
4
4
|
import FilterContent from './FilterContent.vue';
|
|
5
5
|
import FilterInput from './FilterInput.vue';
|
|
6
|
+
// 同 mixin.js:直接引用工具函数,避免依赖 $table 实例上的补丁方法
|
|
7
|
+
import { getCellValue } from '../util/index';
|
|
6
8
|
|
|
7
9
|
let moudule = {};
|
|
8
10
|
let configUtil = {
|
|
@@ -77,7 +79,7 @@ configUtil.VXETable.renderer.add('FilterContent', {
|
|
|
77
79
|
const {
|
|
78
80
|
vals
|
|
79
81
|
} = option.data;
|
|
80
|
-
let cellValue =
|
|
82
|
+
let cellValue = getCellValue(obj);
|
|
81
83
|
return vals.includes(cellValue);
|
|
82
84
|
}
|
|
83
85
|
});
|
|
@@ -140,7 +142,7 @@ configUtil.VXETable.renderer.add('FilterInput', {
|
|
|
140
142
|
data
|
|
141
143
|
} = option;
|
|
142
144
|
|
|
143
|
-
let cellValue =
|
|
145
|
+
let cellValue = getCellValue(obj);
|
|
144
146
|
|
|
145
147
|
if (cellValue) {
|
|
146
148
|
return cellValue.indexOf(data) > -1;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
// 直接引用工具函数,不走 $table 实例上的补丁方法:
|
|
2
|
+
// initVxeTable 只把 getCellValue/createParams 挂在初始化时的那个 xTable 实例上,
|
|
3
|
+
// 页面若用 v-if 销毁重建 vxe-grid(如 product_problem_record/list.vue),
|
|
4
|
+
// 新实例上没有这两个方法,筛选面板会报 $table.getCellValue is not a function
|
|
5
|
+
import { getCellValue, createParams } from "../util/index";
|
|
6
|
+
|
|
1
7
|
let modules = {};
|
|
2
8
|
|
|
3
9
|
modules = {
|
|
@@ -51,7 +57,7 @@ modules = {
|
|
|
51
57
|
let lsm = {};
|
|
52
58
|
let colValList = [];
|
|
53
59
|
fullData.map((row, $rowIndex) => {
|
|
54
|
-
let cellValue =
|
|
60
|
+
let cellValue = getCellValue({
|
|
55
61
|
row,
|
|
56
62
|
$rowIndex,
|
|
57
63
|
$table,
|
|
@@ -100,19 +106,19 @@ modules = {
|
|
|
100
106
|
return false;
|
|
101
107
|
}
|
|
102
108
|
const vals = option1.data.vals || [];
|
|
103
|
-
let param =
|
|
109
|
+
let param = createParams({
|
|
104
110
|
$table: $table,
|
|
105
111
|
row,
|
|
106
112
|
column: filterColumn,
|
|
107
113
|
});
|
|
108
|
-
let cellValue =
|
|
114
|
+
let cellValue = getCellValue(param);
|
|
109
115
|
return !vals.includes(cellValue);
|
|
110
116
|
});
|
|
111
117
|
return item == null;
|
|
112
118
|
});
|
|
113
119
|
let lsm2 = {};
|
|
114
120
|
datas.map((row, $rowIndex) => {
|
|
115
|
-
let cellValue =
|
|
121
|
+
let cellValue = getCellValue({
|
|
116
122
|
row,
|
|
117
123
|
$rowIndex,
|
|
118
124
|
$table,
|
|
@@ -79,6 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
<script>
|
|
81
81
|
import {selectDialogMixins} from '../../../../../mixins/selectDialog/index.js';
|
|
82
|
+
import {getTableStateValue} from '../../../../../components/table/state';
|
|
82
83
|
|
|
83
84
|
export default {
|
|
84
85
|
name: "vabSearchDialog",
|
|
@@ -234,7 +235,7 @@ export default {
|
|
|
234
235
|
}
|
|
235
236
|
|
|
236
237
|
var $grid = this.$refs[tableRef];
|
|
237
|
-
let isQueryAllPage = $grid
|
|
238
|
+
let isQueryAllPage = getTableStateValue($grid, 'isQueryAllPage');
|
|
238
239
|
let pathStr1 = "";
|
|
239
240
|
if (isQueryAllPage === false) {
|
|
240
241
|
queryParams.searchCount = false;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-form-item label="afterColumnsCreated" label-width="150px">
|
|
3
|
+
<a href="javascript:void(0);" class="a-link link-oneLind" @click="editEventHandler('afterColumnsCreated', eventParams)">
|
|
4
|
+
<span>{{ optionModel.afterColumnsCreated }}</span>
|
|
5
|
+
<i class="el-icon-edit"></i>
|
|
6
|
+
</a>
|
|
7
|
+
</el-form-item>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import i18n from "../../../../../../components/xform/utils/i18n";
|
|
12
|
+
import eventMixin from "../../../../../../components/xform/form-designer/setting-panel/property-editor/event-handler/eventMixin";
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: "afterColumnsCreated-editor",
|
|
16
|
+
mixins: [i18n, eventMixin],
|
|
17
|
+
props: {
|
|
18
|
+
designer: Object,
|
|
19
|
+
selectedWidget: Object,
|
|
20
|
+
optionModel: Object,
|
|
21
|
+
},
|
|
22
|
+
data() {
|
|
23
|
+
return {
|
|
24
|
+
eventParams: ["columns", "$grid"],
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped></style>
|
|
@@ -258,6 +258,7 @@ const EVENT_PROPERTIES = {
|
|
|
258
258
|
'onCheckboxChange': 'onCheckboxChange-editor',
|
|
259
259
|
'onSearchTable': 'onSearchTable-editor',
|
|
260
260
|
'onResetTable': 'onResetTable-editor',
|
|
261
|
+
'afterColumnsCreated': 'afterColumnsCreated-editor',
|
|
261
262
|
|
|
262
263
|
//tree事件
|
|
263
264
|
onNodeClick: "onNodeClick-editor",
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
markMaskedExportColumns,
|
|
10
10
|
} from "../../../../components/xform/utils/textMaskUtil";
|
|
11
11
|
import tableConfig from "../../../../components/table/config.js";
|
|
12
|
+
import { getTableStateValue } from "../../../../components/table/state";
|
|
12
13
|
import { extendDeeply } from "../../../../utils/index.js";
|
|
13
14
|
import {
|
|
14
15
|
assembleAxiosConfig,
|
|
@@ -576,11 +577,39 @@ modules = {
|
|
|
576
577
|
(this.widget.options.tableColumns = e),
|
|
577
578
|
this.$nextTick(function () {
|
|
578
579
|
t.$refs.dataTable.doLayout();
|
|
580
|
+
t.emitAfterColumnsCreated(e);
|
|
579
581
|
});
|
|
580
582
|
},
|
|
581
583
|
setTableColumn: function (e) {
|
|
582
584
|
this.setTableColumns(e);
|
|
583
585
|
},
|
|
586
|
+
/**
|
|
587
|
+
* 表头(列)创建完成后的统一出口:首次建表和 setTableColumns 两条链路都经这里。
|
|
588
|
+
*
|
|
589
|
+
* 脚本签名:function (dataId, formCode, columns, $grid)
|
|
590
|
+
* columns —— 列配置数组(含 checkbox 列、分组表头 children)
|
|
591
|
+
* $grid —— vxe-grid 实例,需要活列对象时用 $grid.getTableColumn()
|
|
592
|
+
*
|
|
593
|
+
* 注意:表头每次重建都会触发,脚本必须幂等。
|
|
594
|
+
* @param {Array} columns 列配置。
|
|
595
|
+
*/
|
|
596
|
+
emitAfterColumnsCreated(columns) {
|
|
597
|
+
const script = this.widget.options.afterColumnsCreated;
|
|
598
|
+
if (!script) return;
|
|
599
|
+
// 列刚写进 vxeOption,DOM 表头还没渲染完,等一拍脚本才能操作表头节点
|
|
600
|
+
this.$nextTick(() => {
|
|
601
|
+
try {
|
|
602
|
+
this.handleCustomEvent(
|
|
603
|
+
script,
|
|
604
|
+
["columns", "$grid"],
|
|
605
|
+
[columns || [], this.getGridTable()]
|
|
606
|
+
);
|
|
607
|
+
} catch (error) {
|
|
608
|
+
// handleCustomEvent 已按配置弹「前端脚本异常」,这里吞掉避免打断建表后续流程
|
|
609
|
+
console.error("afterColumnsCreated 脚本执行异常", error);
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
},
|
|
584
613
|
getTableData: function () {
|
|
585
614
|
return this.widget.options.tableData;
|
|
586
615
|
},
|
|
@@ -1018,7 +1047,7 @@ modules = {
|
|
|
1018
1047
|
if (this.widget.options.showPagination) {
|
|
1019
1048
|
let proxyInfo = $grid.getProxyInfo();
|
|
1020
1049
|
let searchCount = true;
|
|
1021
|
-
let isQueryAllPage = $grid
|
|
1050
|
+
let isQueryAllPage = getTableStateValue($grid, "isQueryAllPage");
|
|
1022
1051
|
if (isQueryAllPage === false) {
|
|
1023
1052
|
searchCount = false;
|
|
1024
1053
|
}
|
|
@@ -1504,7 +1533,7 @@ modules = {
|
|
|
1504
1533
|
}
|
|
1505
1534
|
|
|
1506
1535
|
// let $grid = this.getGridTable();
|
|
1507
|
-
let isQueryAllPage = $grid
|
|
1536
|
+
let isQueryAllPage = getTableStateValue($grid, "isQueryAllPage");
|
|
1508
1537
|
let pathStr1 = "";
|
|
1509
1538
|
/* if (isQueryAllPage === false) {
|
|
1510
1539
|
queryParams.searchCount = false;
|
|
@@ -1713,6 +1742,7 @@ modules = {
|
|
|
1713
1742
|
}
|
|
1714
1743
|
this.$vxeTableUtil.initVxeTable(tableOption).then((opts) => {
|
|
1715
1744
|
this.vxeOption = opts;
|
|
1745
|
+
this.emitAfterColumnsCreated(opts?.columns || columns);
|
|
1716
1746
|
if (!isQueryTable) {
|
|
1717
1747
|
setTimeout(() => {
|
|
1718
1748
|
this.loadAccessData(1);
|
|
@@ -312,6 +312,18 @@
|
|
|
312
312
|
</el-select>
|
|
313
313
|
</template>
|
|
314
314
|
</vxe-form-item>
|
|
315
|
+
<vxe-form-item
|
|
316
|
+
:title="$t1('禁用用户') + ':'"
|
|
317
|
+
field="disabledUserName"
|
|
318
|
+
>
|
|
319
|
+
<template v-slot>
|
|
320
|
+
<el-input
|
|
321
|
+
v-model="formData2.disabledUserName"
|
|
322
|
+
size="small"
|
|
323
|
+
clearable
|
|
324
|
+
/>
|
|
325
|
+
</template>
|
|
326
|
+
</vxe-form-item>
|
|
315
327
|
</vxe-form>
|
|
316
328
|
</template>
|
|
317
329
|
</vxe-grid>
|
|
@@ -925,6 +937,11 @@ export default {
|
|
|
925
937
|
field: "candidateNames",
|
|
926
938
|
width: 150,
|
|
927
939
|
},
|
|
940
|
+
{
|
|
941
|
+
title: this.$t1("禁用用户"),
|
|
942
|
+
field: "disabledUserNames",
|
|
943
|
+
width: 200,
|
|
944
|
+
},
|
|
928
945
|
{
|
|
929
946
|
title: this.$t1("流程状态"),
|
|
930
947
|
field: "stat",
|