cloud-web-corejs 1.0.54-dev.730 → 1.0.54-dev.732
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
|
@@ -371,6 +371,44 @@ function getSelfConfig() {
|
|
|
371
371
|
return selfConfig;
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
function applyTableFeatureDisabled(result, that) {
|
|
375
|
+
let userState = that?.$store?.state?.user || {};
|
|
376
|
+
let sortDisabled = userState.tableSortDisabled === true;
|
|
377
|
+
let filterDisabled = userState.tableFilterDisabled === true;
|
|
378
|
+
if (!sortDisabled && !filterDisabled) return;
|
|
379
|
+
|
|
380
|
+
let handleColumns = (columns) => {
|
|
381
|
+
(columns || []).forEach((column) => {
|
|
382
|
+
if (sortDisabled) {
|
|
383
|
+
column.sortable = false;
|
|
384
|
+
}
|
|
385
|
+
if (filterDisabled) {
|
|
386
|
+
column.filterType = false;
|
|
387
|
+
delete column.filters;
|
|
388
|
+
delete column.filterRender;
|
|
389
|
+
delete column.filterMethod;
|
|
390
|
+
}
|
|
391
|
+
if (column.children && column.children.length) {
|
|
392
|
+
handleColumns(column.children);
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
handleColumns(result.columns);
|
|
398
|
+
if (sortDisabled) {
|
|
399
|
+
if (result.proxyConfig) result.proxyConfig.sort = false;
|
|
400
|
+
if (result.sortConfig) {
|
|
401
|
+
result.sortConfig.showIcon = false;
|
|
402
|
+
delete result.sortConfig.defaultSort;
|
|
403
|
+
delete result.sortConfig.sortMethod;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (filterDisabled) {
|
|
407
|
+
if (result.proxyConfig) result.proxyConfig.filter = false;
|
|
408
|
+
if (result.filterConfig) result.filterConfig.showIcon = false;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
374
412
|
function initColumnDefaulAttrs(columns, opts) {
|
|
375
413
|
let tableConfig = configUtil.tableConfig || {};
|
|
376
414
|
let selfConfig = getSelfConfig();
|
|
@@ -802,6 +840,7 @@ function initOption(opts) {
|
|
|
802
840
|
}
|
|
803
841
|
|
|
804
842
|
result = configUtil.extendDeeply(defaultOptions, config);
|
|
843
|
+
applyTableFeatureDisabled(result, that);
|
|
805
844
|
|
|
806
845
|
let pageSize = result.pagerConfig.pageSize;
|
|
807
846
|
let pageSizes = result.pagerConfig.pageSizes;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
languageSettingListPage,
|
|
7
7
|
getFileServerInfo,
|
|
8
8
|
getLoginConfig,
|
|
9
|
+
getLogicParamValue,
|
|
9
10
|
} from "../../api/user";
|
|
10
11
|
import { getToken, setToken, clearToken } from "../../utils/auth";
|
|
11
12
|
import router, { resetRouter } from "@base/router";
|
|
@@ -44,6 +45,8 @@ state = {
|
|
|
44
45
|
userFlag: null,
|
|
45
46
|
fileServerInfo: null,
|
|
46
47
|
loginConfig: null,
|
|
48
|
+
tableSortDisabled: false,
|
|
49
|
+
tableFilterDisabled: false,
|
|
47
50
|
utcTransformOffset: 0,// 时区偏移量,单位:小时
|
|
48
51
|
};
|
|
49
52
|
|
|
@@ -96,6 +99,12 @@ mutations = {
|
|
|
96
99
|
SET_LOGIN_CONFIG: (state, loginConfig) => {
|
|
97
100
|
state.loginConfig = loginConfig;
|
|
98
101
|
},
|
|
102
|
+
SET_TABLE_SORT_DISABLED: (state, tableSortDisabled) => {
|
|
103
|
+
state.tableSortDisabled = tableSortDisabled;
|
|
104
|
+
},
|
|
105
|
+
SET_TABLE_FILTER_DISABLED: (state, tableFilterDisabled) => {
|
|
106
|
+
state.tableFilterDisabled = tableFilterDisabled;
|
|
107
|
+
},
|
|
99
108
|
SET_UTC_TRANSFORM_OFFSET: (state, utcTransformOffset) => {
|
|
100
109
|
state.utcTransformOffset = utcTransformOffset;
|
|
101
110
|
},
|
|
@@ -144,7 +153,7 @@ actions = {
|
|
|
144
153
|
},
|
|
145
154
|
|
|
146
155
|
// get user info
|
|
147
|
-
getInfo2({ commit, state }) {
|
|
156
|
+
getInfo2({ commit, state, dispatch }) {
|
|
148
157
|
return new Promise((resolve, reject) => {
|
|
149
158
|
configUtil
|
|
150
159
|
.getInfo({
|
|
@@ -208,6 +217,7 @@ actions = {
|
|
|
208
217
|
}).catch((error) => {
|
|
209
218
|
console.error(error);
|
|
210
219
|
}),
|
|
220
|
+
dispatch("initTableFeatureDisabled"),
|
|
211
221
|
];
|
|
212
222
|
if (settingConfig.utcTransformEnabled) {
|
|
213
223
|
requests.push(
|
|
@@ -310,6 +320,8 @@ actions = {
|
|
|
310
320
|
commit("SET_LOGIN_ACCOUNT", "");
|
|
311
321
|
commit("SET_COMPANY_CODE", "");
|
|
312
322
|
commit("SET_USER_ID", "");
|
|
323
|
+
commit("SET_TABLE_SORT_DISABLED", false);
|
|
324
|
+
commit("SET_TABLE_FILTER_DISABLED", false);
|
|
313
325
|
configUtil.clearToken();
|
|
314
326
|
configUtil.resetRouter();
|
|
315
327
|
sessionStorage.removeItem("easyweb");
|
|
@@ -346,6 +358,25 @@ actions = {
|
|
|
346
358
|
},
|
|
347
359
|
changeCompanyInfo({ commit, dispatch }, row) {
|
|
348
360
|
commit("SET_COMPANY_CODE", row.companyCode);
|
|
361
|
+
return dispatch("initTableFeatureDisabled");
|
|
362
|
+
},
|
|
363
|
+
initTableFeatureDisabled({ commit }) {
|
|
364
|
+
commit("SET_TABLE_SORT_DISABLED", false);
|
|
365
|
+
commit("SET_TABLE_FILTER_DISABLED", false);
|
|
366
|
+
return getLogicParamValue({
|
|
367
|
+
data: { paramCode: "tableSortFilterDisabled" },
|
|
368
|
+
failMsg: false,
|
|
369
|
+
errorMsg: false,
|
|
370
|
+
success: (res) => {
|
|
371
|
+
let values = typeof res?.objx === "string" ? res.objx.split(",") : [];
|
|
372
|
+
let sortValue = values.length > 0 ? values[0].trim() : "";
|
|
373
|
+
let filterValue = values.length > 1 ? values[1].trim() : "";
|
|
374
|
+
commit("SET_TABLE_SORT_DISABLED", sortValue === "1");
|
|
375
|
+
commit("SET_TABLE_FILTER_DISABLED", filterValue === "1");
|
|
376
|
+
},
|
|
377
|
+
}).catch((error) => {
|
|
378
|
+
console.error(error);
|
|
379
|
+
});
|
|
349
380
|
},
|
|
350
381
|
initLoginConfig({ commit, dispatch }, loginConfig) {
|
|
351
382
|
return new Promise((resolve, reject) => {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@close="dialogClose"
|
|
13
13
|
v-el-drag-dialog
|
|
14
14
|
v-el-dialog-center
|
|
15
|
+
:fullscreen="true"
|
|
15
16
|
>
|
|
16
17
|
<div class="n-list">
|
|
17
18
|
<div class="item" v-for="(item, index) in page.records" :key="index" :class="{ on: currentIndex == index }"
|
|
@@ -140,7 +141,7 @@ export default {
|
|
|
140
141
|
this.currentRow = item;
|
|
141
142
|
this.handleRead(index)
|
|
142
143
|
},
|
|
143
|
-
handleRead(index, callback) {
|
|
144
|
+
handleRead(index, callback) {
|
|
144
145
|
if(this.page.records.length <= index)return
|
|
145
146
|
let row = this.page.records[index];
|
|
146
147
|
if (row.readed !== 1) {
|