cnhis-design-vue 2.1.143 → 2.1.145
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/CHANGELOG.md +41 -3
- package/es/age/index.js +2 -2
- package/es/big-table/index.js +26 -26
- package/es/button/index.js +445 -285
- package/es/button/style.css +1 -1
- package/es/captcha/index.js +3 -3
- package/es/card-reader-sdk/index.js +1 -1
- package/es/checkbox/index.js +1 -1
- package/es/color-picker/index.js +1 -1
- package/es/drag-layout/index.js +3 -3
- package/es/editor/index.js +1 -1
- package/es/ellipsis/index.js +1 -1
- package/es/fabric-chart/index.js +379 -186
- package/es/fabric-chart/style.css +1 -1
- package/es/form-table/index.js +20 -20
- package/es/full-calendar/index.js +4 -4
- package/es/index/index.js +1766 -953
- package/es/index/style.css +1 -1
- package/es/input/index.js +1 -1
- package/es/map/index.js +1 -1
- package/es/multi-chat/index.js +74 -58
- package/es/multi-chat/style.css +1 -1
- package/es/multi-chat-client/index.js +70 -54
- package/es/multi-chat-client/style.css +1 -1
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +4 -4
- package/es/multi-chat-setting/index.js +64 -47
- package/es/multi-chat-setting/style.css +1 -1
- package/es/multi-chat-sip/index.js +1 -1
- package/es/radio/index.js +1 -1
- package/es/scale-container/index.js +1 -1
- package/es/scale-view/index.js +27 -27
- package/es/select/index.js +4 -4
- package/es/select-label/index.js +3 -3
- package/es/select-person/index.js +2 -2
- package/es/select-tag/index.js +4 -4
- package/es/shortcut-setter/index.js +2 -2
- package/es/slider-tree/index.js +1 -1
- package/es/table-filter/index.js +1100 -529
- package/es/table-filter/style.css +1 -1
- package/es/tag/index.js +1 -1
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +1926 -1139
- package/lib/cui.umd.js +1926 -1139
- package/lib/cui.umd.min.js +34 -34
- package/package.json +1 -1
- package/packages/button/src/ButtonPrint/index.vue +21 -13
- package/packages/button/src/ButtonPrint/new.vue +270 -291
- package/packages/button/src/ButtonPrint/old.vue +33 -4
- package/packages/fabric-chart/src/FabricChart.vue +10 -1
- package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +0 -1
- package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +200 -89
- package/packages/fabric-chart/src/mixins/eventCommon.js +1 -1
- package/packages/fabric-chart/src/utils/index.js +8 -0
- package/packages/multi-chat/chat/client/clientChat.vue +14 -2
- package/packages/multi-chat/chat/index.vue +14 -2
- package/packages/multi-chat/setting/index.vue +13 -1
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +21 -71
- package/packages/table-filter/src/mixins/printNew.js +184 -0
|
@@ -61,6 +61,9 @@ export default {
|
|
|
61
61
|
isOtherEntry: {
|
|
62
62
|
type: Boolean,
|
|
63
63
|
default: false
|
|
64
|
+
},
|
|
65
|
+
decrypt: {
|
|
66
|
+
type: Function
|
|
64
67
|
}
|
|
65
68
|
},
|
|
66
69
|
data() {
|
|
@@ -187,7 +190,16 @@ export default {
|
|
|
187
190
|
})
|
|
188
191
|
.then(({ data }) => {
|
|
189
192
|
if (data.result === "SUCCESS") {
|
|
190
|
-
|
|
193
|
+
let useObj = data?.obj || {}
|
|
194
|
+
const {isEncrypt, obj} = useObj;
|
|
195
|
+
if(isEncrypt && obj && this.decrypt && typeof this.decrypt === 'function') {
|
|
196
|
+
try {
|
|
197
|
+
useObj = JSON.parse(this.decrypt(obj)) || {};
|
|
198
|
+
} catch(err) {
|
|
199
|
+
console.log(err)
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const { vendor } = useObj;
|
|
191
203
|
this.skdVender = vendor;
|
|
192
204
|
}
|
|
193
205
|
});
|
|
@@ -311,10 +311,13 @@
|
|
|
311
311
|
:authorizationKey="item.__printConfig && item.__printConfig.authorizationKey"
|
|
312
312
|
:templateNumber="item.__printConfig && item.__printConfig.number"
|
|
313
313
|
:hisParams="item.__printConfig && item.__printConfig.hisParams"
|
|
314
|
+
:newPrintSetting="item.__newPrintSetting"
|
|
315
|
+
:printFormatByNumberData="item.__printFormatByNumberData"
|
|
314
316
|
:params="getPrintBtnParams(item)"
|
|
315
317
|
:prevFn="() => printBtnPrevFn(clickRowData, item, 2, j)"
|
|
316
318
|
@success="receivePrintSuccess"
|
|
317
319
|
@error="receivePrintError"
|
|
320
|
+
@saveOuterPrint="(val) => saveOuterPrint(val, item)"
|
|
318
321
|
></PrintBtn>
|
|
319
322
|
</template>
|
|
320
323
|
</li>
|
|
@@ -439,6 +442,7 @@ import { durationMixin, $utils, filterApiFn, outQuickSearchFn, outQuickSearchDef
|
|
|
439
442
|
import tableSearchCon from '../mixins/tableSearchCon';
|
|
440
443
|
import OutQuickMethod from '../mixins/out-quick-method'
|
|
441
444
|
import dynamicMethod from '../components/render-widget/mixins/dynamic-method'
|
|
445
|
+
import printNew from '../mixins/printNew'
|
|
442
446
|
import svgIcon from '@/component/svg/index.vue';
|
|
443
447
|
import 'text-security/text-security.css';
|
|
444
448
|
import create from '@/core/create';
|
|
@@ -491,7 +495,7 @@ const BTNOBJ = {
|
|
|
491
495
|
|
|
492
496
|
export default create({
|
|
493
497
|
name: 'base-search',
|
|
494
|
-
mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn, outQuickSearchDefCommon, OutQuickMethod, dynamicMethod],
|
|
498
|
+
mixins: [durationMixin, $utils, filterApiFn, tableSearchCon, outQuickSearchFn, outQuickSearchDefCommon, OutQuickMethod, dynamicMethod, printNew],
|
|
495
499
|
directives: { resize, preventReClick },
|
|
496
500
|
props: {
|
|
497
501
|
width: {
|
|
@@ -687,6 +691,9 @@ export default create({
|
|
|
687
691
|
}
|
|
688
692
|
},
|
|
689
693
|
computed: {
|
|
694
|
+
isLowCode() {
|
|
695
|
+
return this.libSource === 'lowCode';
|
|
696
|
+
},
|
|
690
697
|
isOrgAdmin() {
|
|
691
698
|
return this.isAdmin;
|
|
692
699
|
},
|
|
@@ -1590,7 +1597,8 @@ export default create({
|
|
|
1590
1597
|
});
|
|
1591
1598
|
|
|
1592
1599
|
let printNumberList = (await this.getPrintNumber(rowPrintBtnList)) || [];
|
|
1593
|
-
|
|
1600
|
+
let configObj = await this.getPrintUserConfigReuqestAll(printNumberList, rowPrintBtnList)
|
|
1601
|
+
rowPrintBtnList = this.setPrintNumberToBtnList(printNumberList, rowPrintBtnList, configObj);
|
|
1594
1602
|
// this.rowPrintBtnList = rowPrintBtnList;
|
|
1595
1603
|
// 添加批量打印策略:strategy: MULTI(循环多条, 默认值, 为空时使用该策略) ONCE(聚合一条)
|
|
1596
1604
|
this.rowPrintBtnList = rowPrintBtnList.map(item => {
|
|
@@ -1968,77 +1976,14 @@ export default create({
|
|
|
1968
1976
|
table: i
|
|
1969
1977
|
};
|
|
1970
1978
|
// paramsArray.push(utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj })));
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
return paramsArray;
|
|
1975
|
-
},
|
|
1976
|
-
setPrintNumberToBtnList(printNumberList = [], btnList = []) {
|
|
1977
|
-
let cloneList = cloneDeep(btnList);
|
|
1978
|
-
|
|
1979
|
-
printNumberList.forEach((item, index) => {
|
|
1980
|
-
const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
|
|
1981
|
-
if (i > -1) {
|
|
1982
|
-
cloneList[i].__printConfig = {
|
|
1983
|
-
number: item.number,
|
|
1984
|
-
authorizationKey: item.authorizationKey,
|
|
1985
|
-
port: item.port,
|
|
1986
|
-
versionType: item.versionType,
|
|
1987
|
-
hisParams: { reportid: item.number }
|
|
1988
|
-
};
|
|
1979
|
+
let resParams = utils.setParamsValue(setData[0].params, Object.assign(paramsData, { obj, table: i })) || {}
|
|
1980
|
+
if(btn?.__printConfig?.number) {
|
|
1981
|
+
resParams.templateNumbers = [btn.__printConfig.number]
|
|
1989
1982
|
}
|
|
1990
|
-
|
|
1991
|
-
// number: item.number,
|
|
1992
|
-
// authorizationKey: item.authorizationKey,
|
|
1993
|
-
// port: item.port,
|
|
1994
|
-
// versionType: item.versionType,
|
|
1995
|
-
// hisParams: { reportid: item.number }
|
|
1996
|
-
// };
|
|
1983
|
+
paramsArray.push(resParams);
|
|
1997
1984
|
});
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
},
|
|
2001
|
-
async getPrintNumber(list) {
|
|
2002
|
-
if (!list?.length) return;
|
|
2003
|
-
|
|
2004
|
-
let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
|
|
2005
|
-
|
|
2006
|
-
let printNumberCacheKeys = Object.keys(this.printNumberCache);
|
|
2007
|
-
let haveCache = printNumberCacheKeys.includes(ids);
|
|
2008
|
-
if (haveCache) {
|
|
2009
|
-
let printNumberList = this.printNumberCache[ids];
|
|
2010
|
-
this.printBtnStrategys = printNumberList;
|
|
2011
|
-
return Promise.resolve(printNumberList);
|
|
2012
|
-
}
|
|
2013
|
-
|
|
2014
|
-
let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
|
|
2015
|
-
|
|
2016
|
-
const { status, data } = res;
|
|
2017
|
-
if (status) {
|
|
2018
|
-
let resList = data?.list || [];
|
|
2019
|
-
this.printBtnStrategys = resList;
|
|
2020
|
-
list = resList.map(item => {
|
|
2021
|
-
return {
|
|
2022
|
-
number: item.number,
|
|
2023
|
-
authorizationKey: data.authorizationKey,
|
|
2024
|
-
versionType: data.versionType,
|
|
2025
|
-
port: data.port,
|
|
2026
|
-
id: item.id,
|
|
2027
|
-
...item
|
|
2028
|
-
};
|
|
2029
|
-
});
|
|
2030
|
-
let len = list?.length || 0;
|
|
2031
|
-
if (len > 0) {
|
|
2032
|
-
this.setPrintNumberCache({
|
|
2033
|
-
ids,
|
|
2034
|
-
list
|
|
2035
|
-
});
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
return list;
|
|
2039
|
-
}
|
|
2040
|
-
return list;
|
|
2041
|
-
},
|
|
1985
|
+
return paramsArray;
|
|
1986
|
+
},
|
|
2042
1987
|
async receivePrintSuccessAboutPrint(res, info) {
|
|
2043
1988
|
const printBtn = this.printBtn;
|
|
2044
1989
|
const templateId = info.templateId;
|
|
@@ -2378,6 +2323,11 @@ export default create({
|
|
|
2378
2323
|
justify-content: space-between;
|
|
2379
2324
|
text-align: left;
|
|
2380
2325
|
background: #fff;
|
|
2326
|
+
.rowPrintBtn-btn {
|
|
2327
|
+
/deep/ .newprint-button-outer {
|
|
2328
|
+
margin: 0px 8px 8px 0px;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2381
2331
|
}
|
|
2382
2332
|
.bease-left {
|
|
2383
2333
|
display: flex;
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
2
|
+
export default {
|
|
3
|
+
data() {
|
|
4
|
+
return {
|
|
5
|
+
printConfigCache: {}
|
|
6
|
+
};
|
|
7
|
+
},
|
|
8
|
+
methods: {
|
|
9
|
+
setPrintConfigCache(key, value, isUpdate) {
|
|
10
|
+
let cacheItem = this.printConfigCache[key];
|
|
11
|
+
if (!cacheItem) {
|
|
12
|
+
if (isUpdate) return;
|
|
13
|
+
this.printConfigCache[key] = value;
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
Object.assign(cacheItem, { ...value });
|
|
17
|
+
},
|
|
18
|
+
async handlePrintFormatByNumber(printItem) {
|
|
19
|
+
if (!this.isLowCode || !printItem?.number || !printItem?.authorizationKey) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let params = {
|
|
23
|
+
number: printItem.number,
|
|
24
|
+
authorizationKey: printItem.authorizationKey
|
|
25
|
+
};
|
|
26
|
+
let res = await this.handleGetConfigApi(params, 'requestGetPrintFormatByNumber');
|
|
27
|
+
return res;
|
|
28
|
+
},
|
|
29
|
+
async handlePrintNumberList(list, config) {
|
|
30
|
+
if (!list || !list.length) return [];
|
|
31
|
+
const { isNew, data } = config || {};
|
|
32
|
+
let i = 0,
|
|
33
|
+
item,
|
|
34
|
+
len = list.length;
|
|
35
|
+
let resList = [];
|
|
36
|
+
for (; i < len; i++) {
|
|
37
|
+
item = list[i];
|
|
38
|
+
let obj = { ...item };
|
|
39
|
+
if (isNew) {
|
|
40
|
+
obj = {
|
|
41
|
+
number: item.number,
|
|
42
|
+
authorizationKey: data?.authorizationKey,
|
|
43
|
+
port: data?.port,
|
|
44
|
+
versionType: data?.versionType,
|
|
45
|
+
id: item.id,
|
|
46
|
+
...item
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (obj.versionType == 2) {
|
|
50
|
+
let formatRes = await this.handlePrintFormatByNumber(obj);
|
|
51
|
+
formatRes && (obj.__printFormatByNumberData = formatRes);
|
|
52
|
+
}
|
|
53
|
+
resList.push(obj);
|
|
54
|
+
}
|
|
55
|
+
return resList;
|
|
56
|
+
},
|
|
57
|
+
async saveOuterPrint(list, item) {
|
|
58
|
+
if (!item?.id) return;
|
|
59
|
+
let formatIds = '';
|
|
60
|
+
if (list.length) {
|
|
61
|
+
formatIds = list
|
|
62
|
+
.map(v => v.key)
|
|
63
|
+
.filter(Boolean)
|
|
64
|
+
.join(',');
|
|
65
|
+
}
|
|
66
|
+
let templateId = item.__printConfig?.id;
|
|
67
|
+
let params = {
|
|
68
|
+
// id: item.__configItem?.id,
|
|
69
|
+
buttonId: item.id,
|
|
70
|
+
templateId,
|
|
71
|
+
formatIds
|
|
72
|
+
};
|
|
73
|
+
let res = await this.handleGetConfigApi(params, 'requestSavePrintUserConfig');
|
|
74
|
+
if (!res) return;
|
|
75
|
+
// 保存成功后 打印按钮的宽度有调整, 如果是按钮自适应则需要重新计算按钮宽度
|
|
76
|
+
this.setPrintConfigCache(templateId, { formatIds }, true);
|
|
77
|
+
this.pageResize({ type: 'resize' });
|
|
78
|
+
},
|
|
79
|
+
async getPrintUserConfigReuqestAll(printNumberList = [], btnList = []) {
|
|
80
|
+
if (!this.isLowCode) return;
|
|
81
|
+
if (!printNumberList.length) return;
|
|
82
|
+
if (!btnList.length) return;
|
|
83
|
+
let reqList = [];
|
|
84
|
+
printNumberList.forEach((item, index) => {
|
|
85
|
+
let btnItem = btnList.find(v => v.settingObj[0].trigger_id == item.id);
|
|
86
|
+
if (!~btnItem) return;
|
|
87
|
+
let cacheItem = this.printConfigCache[item.id];
|
|
88
|
+
if (cacheItem) {
|
|
89
|
+
reqList.push(Promise.resolve({ [item.id]: cacheItem, _id: item.id }));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let params = {
|
|
93
|
+
buttonId: btnItem.id,
|
|
94
|
+
templateId: item.id
|
|
95
|
+
};
|
|
96
|
+
reqList.push(this.handleGetConfigApi(params, 'requestGetPrintUserConfig'));
|
|
97
|
+
});
|
|
98
|
+
if (!reqList.length) return;
|
|
99
|
+
let res = await Promise.allSettled(reqList);
|
|
100
|
+
if (!res?.length) return;
|
|
101
|
+
let resObj = {};
|
|
102
|
+
res.map(v => {
|
|
103
|
+
if (v.status !== 'fulfilled' || !v.value || !Object.keys(v.value).length) return null;
|
|
104
|
+
let obj = v.value;
|
|
105
|
+
this.setPrintConfigCache(obj._id, obj[obj._id]);
|
|
106
|
+
Object.assign(resObj, { ...v.value });
|
|
107
|
+
});
|
|
108
|
+
return Promise.resolve(resObj);
|
|
109
|
+
},
|
|
110
|
+
async getPrintNumber(list) {
|
|
111
|
+
if (!list?.length) return;
|
|
112
|
+
let ids = list.map(item => item.settingObj[0].trigger_id).join(',');
|
|
113
|
+
|
|
114
|
+
let printNumberCacheKeys = Object.keys(this.printNumberCache);
|
|
115
|
+
let haveCache = printNumberCacheKeys.includes(ids);
|
|
116
|
+
if (haveCache) {
|
|
117
|
+
let printNumberList = this.printNumberCache[ids];
|
|
118
|
+
let hasId = printNumberList?.length && printNumberList?.every(item => !!item.id);
|
|
119
|
+
if (hasId) {
|
|
120
|
+
this.printBtnStrategys = printNumberList;
|
|
121
|
+
let hasPrintFormat = printNumberList.every(item => !!item.__printFormatByNumberData);
|
|
122
|
+
if (!hasPrintFormat) {
|
|
123
|
+
printNumberList = await this.handlePrintNumberList(printNumberList);
|
|
124
|
+
}
|
|
125
|
+
return Promise.resolve(printNumberList);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let res = await this.handleGetConfigApi({ ids }, 'requestGetByIds');
|
|
130
|
+
let newList = await this.handleGetByIdsList(res, { ids, list });
|
|
131
|
+
return Promise.resolve(newList);
|
|
132
|
+
},
|
|
133
|
+
async handleGetByIdsList(res, config) {
|
|
134
|
+
const { ids, list: oldList } = config;
|
|
135
|
+
const { status, data } = res;
|
|
136
|
+
if (!status) return oldList;
|
|
137
|
+
let resList = data?.list || [];
|
|
138
|
+
this.printBtnStrategys = resList;
|
|
139
|
+
let list = await this.handlePrintNumberList(resList, { isNew: true, data });
|
|
140
|
+
let len = list?.length || 0;
|
|
141
|
+
if (len) {
|
|
142
|
+
this.setPrintNumberCache({ ids, list });
|
|
143
|
+
}
|
|
144
|
+
return list;
|
|
145
|
+
},
|
|
146
|
+
setPrintNumberToBtnList(printNumberList = [], btnList = [], configObj = {}) {
|
|
147
|
+
let cloneList = cloneDeep(btnList);
|
|
148
|
+
|
|
149
|
+
printNumberList.forEach((item, index) => {
|
|
150
|
+
const i = cloneList.findIndex(v => v.settingObj[0].trigger_id == item.id);
|
|
151
|
+
if (!~i) return;
|
|
152
|
+
let cItem = cloneList[i];
|
|
153
|
+
let printConfig = {
|
|
154
|
+
number: item.number,
|
|
155
|
+
authorizationKey: item.authorizationKey,
|
|
156
|
+
port: item.port,
|
|
157
|
+
versionType: item.versionType,
|
|
158
|
+
hisParams: { reportid: item.number },
|
|
159
|
+
id: item.id
|
|
160
|
+
};
|
|
161
|
+
cItem.__printConfig = printConfig;
|
|
162
|
+
if (!this.isLowCode) return;
|
|
163
|
+
let configItem = configObj[item.id] || {};
|
|
164
|
+
let outerPrintKeys = (configItem.formatIds && configItem.formatIds?.split(',').filter(Boolean)) || [];
|
|
165
|
+
let formatList = item.__printFormatByNumberData?.obj?.[0]?.format || [];
|
|
166
|
+
// 如果仅存在一个格式,哪怕没默认格式,按钮也展示 打印{格式名称},点击名称就是直接打印
|
|
167
|
+
let defaultFormatId = formatList.find(v => v.defaultFlag == 1)?.id || '';
|
|
168
|
+
// 低代码都走新的打印逻辑
|
|
169
|
+
let newPrintSetting = {
|
|
170
|
+
isShowPrintAll: false,
|
|
171
|
+
isShowOutSetting: true,
|
|
172
|
+
customProps: {},
|
|
173
|
+
outerPrintKeys,
|
|
174
|
+
defaultFormatId
|
|
175
|
+
};
|
|
176
|
+
cItem.__configItem = configItem || {};
|
|
177
|
+
cItem.__newPrintSetting = newPrintSetting;
|
|
178
|
+
cItem.__printFormatByNumberData = item.__printFormatByNumberData;
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
return cloneList;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|