gcs-ui-lib 1.0.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/.env.development +5 -0
- package/.env.production +7 -0
- package/.eslintrc.js +5 -0
- package/README.md +97 -0
- package/_webpack.config.js +135 -0
- package/babel.config.js +16 -0
- package/lib/demo.html +10 -0
- package/lib/fonts/SIMSUN.5e0c362c.5e0c362c.ttf +0 -0
- package/lib/fonts/element-icons.535877f5.535877f5.woff +0 -0
- package/lib/fonts/element-icons.732389de.732389de.ttf +0 -0
- package/lib/fonts/iconfont.09d221ee.09d221ee.woff +0 -0
- package/lib/fonts/iconfont.1c4bfacc.1c4bfacc.ttf +0 -0
- package/lib/fonts/iconfont.a6f34dc7.a6f34dc7.woff2 +0 -0
- package/lib/fonts/iconfont.f4c32765.f4c32765.ttf +0 -0
- package/lib/gcs-ui-lib.common.js +106776 -0
- package/lib/gcs-ui-lib.css +3 -0
- package/lib/gcs-ui-lib.umd.js +106786 -0
- package/lib/gcs-ui-lib.umd.min.js +330 -0
- package/lib/img/bankbackground(1).e1f6e40f.jpg +0 -0
- package/lib/img/busibackground(2).7e09bf1f.jpg +0 -0
- package/lib/img/document.193a282d.svg +8 -0
- package/lib/img/folder.8e019792.svg +9 -0
- package/lib/img/icon.fc86764f.gif +0 -0
- package/npm +1 -0
- package/package.json +101 -0
- package/packages/AutoFillDetail/index.js +7 -0
- package/packages/AutoFillDetail/src/components/fillDetail.vue +188 -0
- package/packages/AutoFillDetail/src/demo/index.vue +18 -0
- package/packages/AutoFillDetail/src/main.vue +283 -0
- package/packages/AutoFillDetection/index.js +7 -0
- package/packages/AutoFillDetection/src/components/FillInfo.vue +36 -0
- package/packages/AutoFillDetection/src/components/HandEntred.vue +226 -0
- package/packages/AutoFillDetection/src/components/RuleHit.vue +105 -0
- package/packages/AutoFillDetection/src/components/SelectEntries.vue +192 -0
- package/packages/AutoFillDetection/src/components/config.js +359 -0
- package/packages/AutoFillDetection/src/demo/index.vue +18 -0
- package/packages/AutoFillDetection/src/main.vue +130 -0
- package/packages/AutoFillList/index.js +7 -0
- package/packages/AutoFillList/src/components/ImportRules.vue +407 -0
- package/packages/AutoFillList/src/components/ImportRulesDialog.vue +40 -0
- package/packages/AutoFillList/src/components/config.js +616 -0
- package/packages/AutoFillList/src/demo/index.vue +28 -0
- package/packages/AutoFillList/src/main.vue +559 -0
- package/packages/AutoFillRuleHistory/index.js +7 -0
- package/packages/AutoFillRuleHistory/src/demo/index.vue +23 -0
- package/packages/AutoFillRuleHistory/src/main.vue +422 -0
- package/packages/AutoFillService/index.js +7 -0
- package/packages/AutoFillService/src/components/BudgetAccountDialogForSetting.vue +588 -0
- package/packages/AutoFillService/src/components/BudgetAccountSettingDialog.vue +377 -0
- package/packages/AutoFillService/src/components/ConditionGroup.vue +413 -0
- package/packages/AutoFillService/src/components/CustomInput.vue +191 -0
- package/packages/AutoFillService/src/components/FillComponent.vue +371 -0
- package/packages/AutoFillService/src/components/SelectBudgetAccountDialog.vue +161 -0
- package/packages/AutoFillService/src/components/SelectDialog.vue +211 -0
- package/packages/AutoFillService/src/components/basic.vue +308 -0
- package/packages/AutoFillService/src/components/config.js +549 -0
- package/packages/AutoFillService/src/components/fillDetail.vue +145 -0
- package/packages/AutoFillService/src/components/fillRules.vue +787 -0
- package/packages/AutoFillService/src/components/paymentCategory.vue +297 -0
- package/packages/AutoFillService/src/components/paymentCategoryT.vue +292 -0
- package/packages/AutoFillService/src/customTemplate/FillBigDecimal.vue +50 -0
- package/packages/AutoFillService/src/customTemplate/FillDate.vue +54 -0
- package/packages/AutoFillService/src/customTemplate/FillInput.vue +33 -0
- package/packages/AutoFillService/src/customTemplate/FillMultiSelect.vue +70 -0
- package/packages/AutoFillService/src/customTemplate/FillSelect.vue +72 -0
- package/packages/AutoFillService/src/demo/index.vue +30 -0
- package/packages/AutoFillService/src/main.vue +432 -0
- package/packages/Bank/index.js +7 -0
- package/packages/Bank/src/demo/index.vue +18 -0
- package/packages/Bank/src/main.vue +70 -0
- package/packages/BranchBank/index.js +7 -0
- package/packages/BranchBank/src/demo/index.vue +18 -0
- package/packages/BranchBank/src/main.vue +97 -0
- package/packages/ConfigurableForm/index.js +7 -0
- package/packages/ConfigurableForm/src/components/config.js +63 -0
- package/packages/ConfigurableForm/src/components/detail.vue +158 -0
- package/packages/ConfigurableForm/src/demo/index.vue +279 -0
- package/packages/ConfigurableForm/src/main.vue +529 -0
- package/packages/DynamicForm/index.js +7 -0
- package/packages/DynamicForm/src/components/Amount.vue +51 -0
- package/packages/DynamicForm/src/components/AmountRange.vue +76 -0
- package/packages/DynamicForm/src/components/CheckboxGroup.vue +63 -0
- package/packages/DynamicForm/src/components/DMY.vue +126 -0
- package/packages/DynamicForm/src/components/Date.vue +51 -0
- package/packages/DynamicForm/src/components/DateRange.vue +51 -0
- package/packages/DynamicForm/src/components/Dialog.vue +247 -0
- package/packages/DynamicForm/src/components/Input.vue +48 -0
- package/packages/DynamicForm/src/components/InputNumber.vue +69 -0
- package/packages/DynamicForm/src/components/InputNumberRange.vue +47 -0
- package/packages/DynamicForm/src/components/LazySelect.vue +311 -0
- package/packages/DynamicForm/src/components/RadioGroup.vue +43 -0
- package/packages/DynamicForm/src/components/Rate.vue +57 -0
- package/packages/DynamicForm/src/components/Select.vue +307 -0
- package/packages/DynamicForm/src/components/Switch.vue +32 -0
- package/packages/DynamicForm/src/components/Textarea.vue +58 -0
- package/packages/DynamicForm/src/components/TimeSelect.vue +61 -0
- package/packages/DynamicForm/src/components/unitTreeSelect.vue +141 -0
- package/packages/DynamicForm/src/components/urlLinkInput.vue +100 -0
- package/packages/DynamicForm/src/demo/index.vue +486 -0
- package/packages/DynamicForm/src/fileUpload.js +232 -0
- package/packages/DynamicForm/src/formConfig.js +2910 -0
- package/packages/DynamicForm/src/helpers.js +18 -0
- package/packages/DynamicForm/src/main.vue +1095 -0
- package/packages/FileImport/index.js +7 -0
- package/packages/FileImport/src/demo/index.vue +29 -0
- package/packages/FileImport/src/main.vue +306 -0
- package/packages/MultiCurrencyStatistics/index.js +7 -0
- package/packages/MultiCurrencyStatistics/src/demo/index.vue +320 -0
- package/packages/MultiCurrencyStatistics/src/main.vue +200 -0
- package/packages/SelectTicket/index.js +7 -0
- package/packages/SelectTicket/src/Tree/index.vue +13 -0
- package/packages/SelectTicket/src/demo/index.vue +139 -0
- package/packages/SelectTicket/src/header.js +276 -0
- package/packages/SelectTicket/src/main.vue +581 -0
- package/packages/SelectTicket/src/printDialog/dialogO.vue +116 -0
- package/packages/SelectTicket/src/printDialog/index.vue +69 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/README.MD +6 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/mixins/index.js +35 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/obverse.vue +768 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/overview.vue +115 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/printList.vue +127 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation/reverse.vue +205 -0
- package/packages/SelectTicket/src/ticketDetail/billInformation//351/231/204/345/212/240/344/277/235/350/257/201/344/277/241/346/201/257/345/255/227/346/256/265/345/257/271/347/205/247.md +246 -0
- package/packages/SelectTicket/src/ticketDetail/dialog.vue +73 -0
- package/packages/SelectTicket/src/ticketDetail/img/bankbackground(1).jpg +0 -0
- package/packages/SelectTicket/src/ticketDetail/img/busibackground(2).jpg +0 -0
- package/packages/SelectTicket/src/ticketDetail/img/icon.gif +0 -0
- package/packages/SelectTicket/src/ticketDetail/img/icon2.png +0 -0
- package/packages/SelectTicket/src/ticketDetail/img/noData.png +0 -0
- package/packages/SelectTicket/src/ticketDetail/index.vue +188 -0
- package/packages/SelectTreeUnit/index.js +7 -0
- package/packages/SelectTreeUnit/src/Tree/document.svg +8 -0
- package/packages/SelectTreeUnit/src/Tree/folder.svg +9 -0
- package/packages/SelectTreeUnit/src/Tree/index.vue +239 -0
- package/packages/SelectTreeUnit/src/demo/index.vue +219 -0
- package/packages/SelectTreeUnit/src/forEachs.js +16 -0
- package/packages/SelectTreeUnit/src/main.vue +1136 -0
- package/packages/SelectTreeUnitForm/index.js +7 -0
- package/packages/SelectTreeUnitForm/src/Tree/document.svg +8 -0
- package/packages/SelectTreeUnitForm/src/Tree/folder.svg +9 -0
- package/packages/SelectTreeUnitForm/src/Tree/index.vue +254 -0
- package/packages/SelectTreeUnitForm/src/demo/index.vue +230 -0
- package/packages/SelectTreeUnitForm/src/forEachs.js +16 -0
- package/packages/SelectTreeUnitForm/src/main.vue +1068 -0
- package/packages/StreamRefill/index.js +7 -0
- package/packages/StreamRefill/src/components/FillBigDecimal.vue +50 -0
- package/packages/StreamRefill/src/components/FillDate.vue +56 -0
- package/packages/StreamRefill/src/components/FillInput.vue +36 -0
- package/packages/StreamRefill/src/components/FillMultiSelect.vue +54 -0
- package/packages/StreamRefill/src/components/FillSelect.vue +51 -0
- package/packages/StreamRefill/src/demo/index.vue +254 -0
- package/packages/StreamRefill/src/main.vue +335 -0
- package/packages/Trade/index.js +7 -0
- package/packages/Trade/src/components/all/index.vue +913 -0
- package/packages/Trade/src/components/dynamicColumnMixin.js +69 -0
- package/packages/Trade/src/components/getDCloumn.js +15 -0
- package/packages/Trade/src/components/i18n.json +3337 -0
- package/packages/Trade/src/components/pendingEvent/index.vue +934 -0
- package/packages/Trade/src/components/server-config.js +60 -0
- package/packages/Trade/src/components/setUnitName.js +10 -0
- package/packages/Trade/src/components/specialHandle.js +171 -0
- package/packages/Trade/src/components/topendingTabs.js +21 -0
- package/packages/Trade/src/demo/index.vue +43 -0
- package/packages/Trade/src/main.vue +86 -0
- package/packages/ValidateQuota/index.js +58 -0
- package/packages/ValidateQuota/src/demo/index.vue +190 -0
- package/packages/ValidateQuota/src/main.vue +71 -0
- package/packages/ZipImport/index.js +7 -0
- package/packages/ZipImport/src/demo/index.vue +139 -0
- package/packages/ZipImport/src/main.vue +330 -0
- package/packages/approvel/index.js +8 -0
- package/packages/approvel/src/demo/index.vue +28 -0
- package/packages/approvel/src/main.vue +26 -0
- package/packages/approvel/src/progress.vue +167 -0
- package/packages/approvel/src/url.json +29 -0
- package/packages/extends/ElSelect.vue +180 -0
- package/packages/imgs/list-select.png +0 -0
- package/packages/imgs/list-unselect.png +0 -0
- package/packages/imgs/list.png +0 -0
- package/packages/imgs/tree-select.png +0 -0
- package/packages/imgs/tree-unselect.png +0 -0
- package/packages/imgs/tree.png +0 -0
- package/packages/inputTag/index.js +7 -0
- package/packages/inputTag/src/demo/index.vue +355 -0
- package/packages/inputTag/src/main.vue +502 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +19 -0
- package/src/App.vue +61 -0
- package/src/api/aims.js +8 -0
- package/src/api/common.js +254 -0
- package/src/api/fileApi.js +33 -0
- package/src/api/setting.js +249 -0
- package/src/config/appSettings.js +12 -0
- package/src/config/favicon.ico +0 -0
- package/src/css/autoFill.scss +252 -0
- package/src/css/selectTreeUnit.scss +254 -0
- package/src/filter/filter.js +1 -0
- package/src/filter/index.js +274 -0
- package/src/fonts/demo.css +539 -0
- package/src/fonts/iconfont.css +21 -0
- package/src/fonts/iconfont.js +1 -0
- package/src/fonts/iconfont.json +23 -0
- package/src/fonts/iconfont.ttf +0 -0
- package/src/index.js +161 -0
- package/src/locale/format.js +47 -0
- package/src/locale/index.js +48 -0
- package/src/locale/lang/cn2hk.json +1270 -0
- package/src/locale/lang/en.js +73 -0
- package/src/locale/lang/es.js +7 -0
- package/src/locale/lang/index.js +66 -0
- package/src/locale/lang/ja.js +7 -0
- package/src/locale/lang/zh.js +74 -0
- package/src/locale/lang/zht.js +27 -0
- package/src/main.js +49 -0
- package/src/preview/page/Aside/index.vue +60 -0
- package/src/preview/router.js +107 -0
- package/src/utils/auth.js +12 -0
- package/src/utils/directive/asciiWidth.js +107 -0
- package/src/utils/directive/clickOutside.js +21 -0
- package/src/utils/directive/vtitle.js +140 -0
- package/src/utils/excel.js +538 -0
- package/src/utils/index.js +581 -0
- package/src/utils/request.js +157 -0
- package/src/utils/requestCache.js +68 -0
- package/src/utils/session.js +36 -0
- package/src/utils/thems.js +62 -0
- package/src/utils/token.js +26 -0
- package/src/utils/tools.js +317 -0
- package/src/utils/utils.js +513 -0
- package/types/favicon.ico +0 -0
- package/vue.config.js +49 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span>
|
|
3
|
+
<N20-select-lazy
|
|
4
|
+
v-model="_value"
|
|
5
|
+
:filter-method="filterFn"
|
|
6
|
+
@scroll-bottom="getNextList"
|
|
7
|
+
class="input-w"
|
|
8
|
+
filterable
|
|
9
|
+
:clearable="items.clearable ? items.clearable : true"
|
|
10
|
+
v-bind="$attrs"
|
|
11
|
+
@change="changeFn"
|
|
12
|
+
>
|
|
13
|
+
<el-option
|
|
14
|
+
v-for="item in options"
|
|
15
|
+
v-title="item.label"
|
|
16
|
+
:style="{
|
|
17
|
+
'max-width': $attrs['show-overflow-tooltip'] ? '224px' : 'none',
|
|
18
|
+
}"
|
|
19
|
+
:show-overflow-tooltip="true"
|
|
20
|
+
class="text-ellipsis"
|
|
21
|
+
:key="item.value + items.prop"
|
|
22
|
+
:label="item.label | $l"
|
|
23
|
+
:value="item.value"
|
|
24
|
+
>
|
|
25
|
+
{{ labelKey ? item._label : item.label | $l }}
|
|
26
|
+
</el-option>
|
|
27
|
+
</N20-select-lazy>
|
|
28
|
+
</span>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
/* 各属性,方法参考el-select */
|
|
33
|
+
import {dayjs, SelectLazy as N20SelectLazy} from "n20-common-lib";
|
|
34
|
+
import {getDataForGet, getDataForPost} from "@/api/common";
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: "SelectLazy",
|
|
38
|
+
components: {N20SelectLazy},
|
|
39
|
+
props: {
|
|
40
|
+
value: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "",
|
|
43
|
+
},
|
|
44
|
+
items: {
|
|
45
|
+
type: Object,
|
|
46
|
+
default: () => {
|
|
47
|
+
return {
|
|
48
|
+
options: [],
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
variable: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: () => {
|
|
55
|
+
return {};
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
label: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: "",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
_value: {
|
|
65
|
+
get() {
|
|
66
|
+
return this.value || this.label;
|
|
67
|
+
},
|
|
68
|
+
set(value) {
|
|
69
|
+
if (["", null, undefined].includes(value)) {
|
|
70
|
+
this.$emit(`update:label`, "");
|
|
71
|
+
this.$emit("input", "");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
let res = this.getName(value);
|
|
75
|
+
if (!res.length) {
|
|
76
|
+
this.$emit(`update:label`, value);
|
|
77
|
+
} else {
|
|
78
|
+
this.$emit(`update:label`, res.join(","));
|
|
79
|
+
this.$emit("input", value);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
labelKey() {
|
|
84
|
+
return (
|
|
85
|
+
this.items?.api?.labelKey.includes(",") ||
|
|
86
|
+
this.items?.api?.labelKey.includes("{")
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
// 判断数据类型,格式化回显数据
|
|
90
|
+
valueType() {
|
|
91
|
+
return typeof this.value;
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
data() {
|
|
95
|
+
return {
|
|
96
|
+
options: null,
|
|
97
|
+
query: "",
|
|
98
|
+
current: 1,
|
|
99
|
+
total: 0,
|
|
100
|
+
requestBody: {},
|
|
101
|
+
useDefault: true,
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
mounted() {
|
|
105
|
+
this.init();
|
|
106
|
+
},
|
|
107
|
+
methods: {
|
|
108
|
+
getName(value) {
|
|
109
|
+
let temp = [];
|
|
110
|
+
if (Array.isArray(value)) {
|
|
111
|
+
for (let i of value) {
|
|
112
|
+
let res = (this.options || []).find((row) => row.value === i);
|
|
113
|
+
// 如果label显示的2个字段,则取第一个字段的值
|
|
114
|
+
if (res)
|
|
115
|
+
temp.push(res[this.items?.api?.labelKey.split(",")[0] || "label"]);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
let res = (this.options || []).find((row) => row.value === value);
|
|
119
|
+
if (res){
|
|
120
|
+
const regex = /\{label:(.*?)\}/;
|
|
121
|
+
const match = this.items?.api?.labelKey.match(regex);
|
|
122
|
+
if(match && match.length > 1){
|
|
123
|
+
const label = match[1];
|
|
124
|
+
temp.push(res[label]);
|
|
125
|
+
}else{
|
|
126
|
+
temp.push(res[this.items?.api?.labelKey.split(",")[0] || "label"]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
return temp;
|
|
131
|
+
},
|
|
132
|
+
init(status) {
|
|
133
|
+
if (!this.items?.api?.apiUrl || !this.items?.api?.requestMethod) {
|
|
134
|
+
this.options = JSON.parse(this.items.options) || [];
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
this.setRequestBody();
|
|
138
|
+
if (["GET", "get"].includes(this.items?.api?.requestMethod)) {
|
|
139
|
+
getDataForGet(
|
|
140
|
+
this.items?.api?.apiUrl,
|
|
141
|
+
this.requestBody,
|
|
142
|
+
this.$attrs.headers
|
|
143
|
+
).then((res) => {
|
|
144
|
+
this.setValue(res, status);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (["POST", "post"].includes(this.items?.api?.requestMethod)) {
|
|
148
|
+
getDataForPost(
|
|
149
|
+
this.items?.api?.apiUrl,
|
|
150
|
+
this.requestBody,
|
|
151
|
+
this.$attrs.headers
|
|
152
|
+
).then((res) => {
|
|
153
|
+
this.setValue(res, status);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
setValue(res, status) {
|
|
158
|
+
let temp =
|
|
159
|
+
(this.items?.api?.dataProp
|
|
160
|
+
? new Function("res", `return res.${this.items?.api?.dataProp}`)(res)
|
|
161
|
+
: res.data) || [];
|
|
162
|
+
temp = temp?.map((item) => {
|
|
163
|
+
if (this.items?.api?.labelKey.includes(",")) {
|
|
164
|
+
let keyArr = this.items?.api?.labelKey.split(",");
|
|
165
|
+
let label = "";
|
|
166
|
+
keyArr.map((key, index) => {
|
|
167
|
+
if (index === keyArr.length - 1) {
|
|
168
|
+
label += item[key];
|
|
169
|
+
} else {
|
|
170
|
+
label += item[key] + " ";
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
item._label = label;
|
|
174
|
+
item.label = item[keyArr[0]];
|
|
175
|
+
} else if (
|
|
176
|
+
this.items?.api?.labelKey &&
|
|
177
|
+
this.items?.api?.labelKey.includes("{")
|
|
178
|
+
) {
|
|
179
|
+
let regex = /\{([^}]+)\}/g;
|
|
180
|
+
item._label = this.items?.api?.labelKey.replace(
|
|
181
|
+
regex,
|
|
182
|
+
(match, p1) => {
|
|
183
|
+
if (p1.includes("label:")) {
|
|
184
|
+
item.label = item[p1.replace("label:", "")];
|
|
185
|
+
return item[p1.replace("label:", "")];
|
|
186
|
+
}
|
|
187
|
+
return item[p1];
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
} else {
|
|
191
|
+
item.label = item[this.items?.api?.labelKey || "label"];
|
|
192
|
+
}
|
|
193
|
+
if (this.items?.api?.valueKey.includes(",")) {
|
|
194
|
+
let keyArr = this.items?.api?.valueKey.split(",");
|
|
195
|
+
let value = "";
|
|
196
|
+
keyArr.map((key, index) => {
|
|
197
|
+
if (index === keyArr.length - 1) {
|
|
198
|
+
value += item[key];
|
|
199
|
+
} else {
|
|
200
|
+
value += item[key] + ",";
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
item.value = value;
|
|
204
|
+
} else {
|
|
205
|
+
item.value = item[this.items?.api?.valueKey || "value"];
|
|
206
|
+
}
|
|
207
|
+
if (this.valueType === "string") {
|
|
208
|
+
item.value = String(item.value);
|
|
209
|
+
}
|
|
210
|
+
if (this.valueType === "number") {
|
|
211
|
+
item.value = Number(item.value);
|
|
212
|
+
}
|
|
213
|
+
return item;
|
|
214
|
+
});
|
|
215
|
+
this.useDefault = false;
|
|
216
|
+
if (status) {
|
|
217
|
+
this.options = [...this.options, ...temp];
|
|
218
|
+
} else {
|
|
219
|
+
this.options = temp;
|
|
220
|
+
}
|
|
221
|
+
this.total = res?.total || 0;
|
|
222
|
+
let select = this.options.find(
|
|
223
|
+
(item) => item[this.items?.api?.valueKey || "value"] === this.query
|
|
224
|
+
);
|
|
225
|
+
if (!select) return;
|
|
226
|
+
this.$emit("change", select);
|
|
227
|
+
},
|
|
228
|
+
setRequestBody() {
|
|
229
|
+
let page = {};
|
|
230
|
+
if (!this.items?.api?.page?.reqKey) {
|
|
231
|
+
page = {
|
|
232
|
+
[this.items?.api?.page?.size]: 20,
|
|
233
|
+
[this.items?.api?.page?.current]: this.current,
|
|
234
|
+
};
|
|
235
|
+
} else if (this.items?.api?.page?.reqKey) {
|
|
236
|
+
page = {
|
|
237
|
+
[this.items?.api?.page?.reqKey]: {
|
|
238
|
+
[this.items?.api?.page?.size]: 20,
|
|
239
|
+
[this.items?.api?.page?.current]: this.current,
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
if (!this.items?.api?.page?.size) {
|
|
244
|
+
page = {};
|
|
245
|
+
}
|
|
246
|
+
// 模糊搜索关键字查询
|
|
247
|
+
let searchObj = JSON.parse(
|
|
248
|
+
this.items?.api?.reqKeys ? this.items?.api?.reqKeys : "{}"
|
|
249
|
+
);
|
|
250
|
+
Object.keys(searchObj).map((t) => {
|
|
251
|
+
searchObj[t] = this.changVariable(searchObj[t]);
|
|
252
|
+
if (
|
|
253
|
+
Object.prototype.toString.call(searchObj[t]) === "[object String]" &&
|
|
254
|
+
searchObj[t].includes(".")
|
|
255
|
+
) {
|
|
256
|
+
let [key, subkey] = searchObj[t].split(".");
|
|
257
|
+
this.$attrs.formData[key] &&
|
|
258
|
+
(searchObj[t] = this.$attrs.formData[key][subkey]);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
// 接口请求参数
|
|
262
|
+
this.requestBody = {
|
|
263
|
+
...(this.items?.api?.data || {}),
|
|
264
|
+
...searchObj,
|
|
265
|
+
...page,
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
filterFn(val) {
|
|
269
|
+
this.query = val;
|
|
270
|
+
if (
|
|
271
|
+
JSON.parse(this.items?.api?.reqKeys ? this.items?.api?.reqKeys : "{}")
|
|
272
|
+
.canInput
|
|
273
|
+
) {
|
|
274
|
+
this.$emit("input", "");
|
|
275
|
+
this.$emit(`update:label`, val);
|
|
276
|
+
}
|
|
277
|
+
this.init();
|
|
278
|
+
},
|
|
279
|
+
getNextList() {
|
|
280
|
+
if (!this.items?.api?.page?.size) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
if (this.current * 20 > this.total) return;
|
|
284
|
+
this.current += 1;
|
|
285
|
+
this.init(true);
|
|
286
|
+
},
|
|
287
|
+
changeFn(val) {
|
|
288
|
+
let item = this.options.find((t) => t.value == val);
|
|
289
|
+
this.$emit("change", item);
|
|
290
|
+
},
|
|
291
|
+
changVariable(val) {
|
|
292
|
+
if (val === "${inputValue}")
|
|
293
|
+
return this.useDefault
|
|
294
|
+
? this.items?.api?.defaultInputValue || this._value || ""
|
|
295
|
+
: this.query;
|
|
296
|
+
if (!val) {
|
|
297
|
+
return val || "";
|
|
298
|
+
}
|
|
299
|
+
let str = String(val);
|
|
300
|
+
if (str === "${nowDate}") {
|
|
301
|
+
return dayjs().format("YYYY-MM-DD");
|
|
302
|
+
}
|
|
303
|
+
if (str && str.includes("$")) {
|
|
304
|
+
let key = str.replace("${", "").replace("}", "");
|
|
305
|
+
return this.variable[key] || "";
|
|
306
|
+
}
|
|
307
|
+
return val || "";
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
};
|
|
311
|
+
</script>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio-group v-model="_value" v-bind="$attrs" v-on="$listeners">
|
|
3
|
+
<el-radio
|
|
4
|
+
:label="String(item.value)"
|
|
5
|
+
v-for="(item, index) in JSON.parse(this.items.options || '[]')"
|
|
6
|
+
:key="index"
|
|
7
|
+
>{{ item.label | $l }}</el-radio
|
|
8
|
+
>
|
|
9
|
+
</el-radio-group>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: "Radio",
|
|
14
|
+
props: {
|
|
15
|
+
value: {
|
|
16
|
+
type: [String,Number],
|
|
17
|
+
default: "1",
|
|
18
|
+
},
|
|
19
|
+
items: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => {
|
|
22
|
+
return {
|
|
23
|
+
options: [],
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
_value: {
|
|
30
|
+
get() {
|
|
31
|
+
let res = JSON.parse(this.items.options || "[]").find((row) => row.value == this.value);
|
|
32
|
+
this.$emit(`update:label`, res?.label);
|
|
33
|
+
return String(this.value);
|
|
34
|
+
},
|
|
35
|
+
set(value) {
|
|
36
|
+
let res = JSON.parse(this.items.options || "[]").find((row) => row.value == value);
|
|
37
|
+
this.$emit(`update:label`, res?.label);
|
|
38
|
+
this.$emit("input", String(value));
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @fileName Rate
|
|
3
|
+
* @filePath E:\code\jiuhengxing\T20\gts-invest_web 投资理财\invset\src\views\dynamicForms\components\Rate.vue
|
|
4
|
+
* @author wanghailing
|
|
5
|
+
* @date 2023-08-14 13:43:43
|
|
6
|
+
* @description 参数1
|
|
7
|
+
!-->
|
|
8
|
+
<template>
|
|
9
|
+
<InputNumber
|
|
10
|
+
:max="999.999999"
|
|
11
|
+
:min="0"
|
|
12
|
+
:type="type"
|
|
13
|
+
:is-clearable="true"
|
|
14
|
+
v-model="_value"
|
|
15
|
+
:d-num="6"
|
|
16
|
+
suffix="‰"
|
|
17
|
+
:placeholder="$attrs.placeholder ? $attrs.placeholder : '请输入' | $l"
|
|
18
|
+
v-bind="$attrs"
|
|
19
|
+
v-on="$listeners"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
import {InputNumber} from "n20-common-lib";
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'Rate',
|
|
28
|
+
components: {InputNumber},
|
|
29
|
+
props: {
|
|
30
|
+
value: {
|
|
31
|
+
type: [String, Number],
|
|
32
|
+
default: "",
|
|
33
|
+
},
|
|
34
|
+
items: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: () => {},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
_value: {
|
|
41
|
+
get() {
|
|
42
|
+
return this.value;
|
|
43
|
+
},
|
|
44
|
+
set(value) {
|
|
45
|
+
this.$emit("input", value);
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
data() {
|
|
50
|
+
return {
|
|
51
|
+
type: "rate",
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
</script>
|
|
56
|
+
<style scoped lang='scss'>
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-select
|
|
3
|
+
class="input-w"
|
|
4
|
+
v-model="_value"
|
|
5
|
+
:placeholder="$attrs.placeholder ? $attrs.placeholder : '请选择' | $l"
|
|
6
|
+
:multiple="items.multiple || false"
|
|
7
|
+
:filterable="items.filterable || true"
|
|
8
|
+
:key="items.prop"
|
|
9
|
+
v-bind="$attrs"
|
|
10
|
+
:disabled="disabled"
|
|
11
|
+
@change="changeFn"
|
|
12
|
+
:clearable="items.clearable ? items.clearable : true"
|
|
13
|
+
:filter-method="$attrs['filter-method'] || filterMethod"
|
|
14
|
+
@clear="clearFn"
|
|
15
|
+
@click.native="clickFn"
|
|
16
|
+
>
|
|
17
|
+
<el-option
|
|
18
|
+
v-for="item in options"
|
|
19
|
+
v-title="item.label"
|
|
20
|
+
:style="{
|
|
21
|
+
'max-width': $attrs['show-overflow-tooltip'] ? '224px' : 'none',
|
|
22
|
+
}"
|
|
23
|
+
:show-overflow-tooltip="true"
|
|
24
|
+
class="text-ellipsis"
|
|
25
|
+
:key="item.value + items.prop"
|
|
26
|
+
:label="item.label | $l"
|
|
27
|
+
:value="item.value"
|
|
28
|
+
>
|
|
29
|
+
{{ labelKey ? item._label : item.label | $l }}
|
|
30
|
+
</el-option>
|
|
31
|
+
</el-select>
|
|
32
|
+
</template>
|
|
33
|
+
<script>
|
|
34
|
+
import clickoutside from "element-ui/src/utils/clickoutside";
|
|
35
|
+
import { getDataForPost, getDataForGet } from "@/api/common";
|
|
36
|
+
export default {
|
|
37
|
+
name: "CustomSelect",
|
|
38
|
+
props: {
|
|
39
|
+
value: {
|
|
40
|
+
type: [String, Array, Number],
|
|
41
|
+
default: undefined,
|
|
42
|
+
},
|
|
43
|
+
disabled: {
|
|
44
|
+
type: [Boolean, Array, Number],
|
|
45
|
+
default: false,
|
|
46
|
+
},
|
|
47
|
+
items: {
|
|
48
|
+
type: Object,
|
|
49
|
+
default: () => {
|
|
50
|
+
return {
|
|
51
|
+
options: [],
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
variable: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default: () => {
|
|
58
|
+
return {};
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
label: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "",
|
|
64
|
+
},
|
|
65
|
+
formData: Object
|
|
66
|
+
},
|
|
67
|
+
directives: {
|
|
68
|
+
clickoutside,
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
_value: {
|
|
72
|
+
get() {
|
|
73
|
+
return this.value || this.label;
|
|
74
|
+
},
|
|
75
|
+
set(value) {
|
|
76
|
+
if (["", null, undefined].includes(value)) {
|
|
77
|
+
this.$emit(`update:label`, "");
|
|
78
|
+
this.$emit("input", "");
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
let res = this.getName(value);
|
|
82
|
+
if (res.length == 0) {
|
|
83
|
+
this.$emit(`update:label`, value);
|
|
84
|
+
} else {
|
|
85
|
+
this.$emit(`update:label`, res.join(","));
|
|
86
|
+
this.$emit("input", value);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
labelKey() {
|
|
91
|
+
return (
|
|
92
|
+
this.items?.api?.labelKey.includes(",") ||
|
|
93
|
+
this.items?.api?.labelKey.includes("{")
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
// 判断数据类型,格式化回显数据
|
|
97
|
+
valueType() {
|
|
98
|
+
return typeof this.value;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
data() {
|
|
102
|
+
return {
|
|
103
|
+
options: [],
|
|
104
|
+
optionsCopy: [],
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
mounted() {
|
|
108
|
+
// this.$nextTick(() => {
|
|
109
|
+
// this.init();
|
|
110
|
+
// });
|
|
111
|
+
// this.init();
|
|
112
|
+
},
|
|
113
|
+
watch: {
|
|
114
|
+
variable: {
|
|
115
|
+
handler(newVal, oldVal) {
|
|
116
|
+
let doc = [
|
|
117
|
+
"payCountry",
|
|
118
|
+
"bankNo",
|
|
119
|
+
"recBankNo",
|
|
120
|
+
"currencyNo",
|
|
121
|
+
"recCountry",
|
|
122
|
+
"countryNo",
|
|
123
|
+
];
|
|
124
|
+
let flag = true;
|
|
125
|
+
for (let i of doc) {
|
|
126
|
+
if (
|
|
127
|
+
!newVal[i] &&
|
|
128
|
+
this.items?.api?.reqKeys.includes('${' + i + '}')
|
|
129
|
+
) {
|
|
130
|
+
flag = false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
flag && this.init();
|
|
134
|
+
},
|
|
135
|
+
deep: true,
|
|
136
|
+
immediate: true,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
methods: {
|
|
140
|
+
getName(value) {
|
|
141
|
+
let temp = [];
|
|
142
|
+
if (Array.isArray(value)) {
|
|
143
|
+
for (let i of value) {
|
|
144
|
+
let res = (this.options || []).find((row) => row.value === i);
|
|
145
|
+
// 如果label显示的2个字段,则取第一个字段的值
|
|
146
|
+
if (res) temp.push(res["label"]);
|
|
147
|
+
}
|
|
148
|
+
} else {
|
|
149
|
+
let res = (this.options || []).find((row) => row.value === value);
|
|
150
|
+
if (res) temp.push(res["label"]);
|
|
151
|
+
}
|
|
152
|
+
return temp;
|
|
153
|
+
},
|
|
154
|
+
changeFn(val) {
|
|
155
|
+
let item = this.options.find((t) => t.value == val);
|
|
156
|
+
this.$emit("change", item);
|
|
157
|
+
},
|
|
158
|
+
init() {
|
|
159
|
+
// this._value = this.items.defaultValue
|
|
160
|
+
if (!this.items?.api?.apiUrl || !this.items?.api?.requestMethod) {
|
|
161
|
+
this.options = JSON.parse(this.items.options || "{}") || [];
|
|
162
|
+
this.optionsCopy = JSON.parse(this.items.options || "{}") || [];
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
let searchObj = JSON.parse(this.items?.api?.reqKeys || "{}");
|
|
166
|
+
Object.keys(searchObj).map((t) => {
|
|
167
|
+
searchObj[t] = this.changVariable(searchObj[t]);
|
|
168
|
+
});
|
|
169
|
+
if (["GET", "get"].includes(this.items?.api?.requestMethod)) {
|
|
170
|
+
getDataForGet(
|
|
171
|
+
this.items?.api?.apiUrl,
|
|
172
|
+
searchObj || {},
|
|
173
|
+
this.$attrs.headers
|
|
174
|
+
).then((res) => {
|
|
175
|
+
this.setValue(res);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (["POST", "post"].includes(this.items?.api?.requestMethod)) {
|
|
179
|
+
getDataForPost(
|
|
180
|
+
this.items?.api?.apiUrl,
|
|
181
|
+
searchObj || {},
|
|
182
|
+
this.$attrs.headers
|
|
183
|
+
).then((res) => {
|
|
184
|
+
this.setValue(res);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
setValue(res) {
|
|
189
|
+
this.options = (res.data || res || []).map((item) => {
|
|
190
|
+
if (
|
|
191
|
+
this.items?.api?.labelKey.includes(",") &&
|
|
192
|
+
!this.items?.api?.labelKey.includes("{")
|
|
193
|
+
) {
|
|
194
|
+
let keyArr = this.items?.api?.labelKey.split(",");
|
|
195
|
+
let label = "";
|
|
196
|
+
keyArr.map((key, index) => {
|
|
197
|
+
if (index == keyArr.length - 1) {
|
|
198
|
+
label += item[key];
|
|
199
|
+
} else {
|
|
200
|
+
label += item[key] + " ";
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
item._label = label;
|
|
204
|
+
item.label = item[keyArr[0]];
|
|
205
|
+
} else if (
|
|
206
|
+
this.items?.api?.labelKey &&
|
|
207
|
+
this.items?.api?.labelKey.includes("{")
|
|
208
|
+
) {
|
|
209
|
+
let regex = /\{([^}]+)\}/g;
|
|
210
|
+
var modifiedStr = this.items?.api?.labelKey.replace(
|
|
211
|
+
regex,
|
|
212
|
+
(match, p1) => {
|
|
213
|
+
if (p1.includes("label:")) {
|
|
214
|
+
item.label = item[p1.replace("label:", "")];
|
|
215
|
+
return item[p1.replace("label:", "")];
|
|
216
|
+
}
|
|
217
|
+
return item[p1];
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
item._label = modifiedStr;
|
|
221
|
+
} else {
|
|
222
|
+
item.label = item[this.items?.api?.labelKey || "label"];
|
|
223
|
+
}
|
|
224
|
+
if (this.items?.api?.valueKey.includes(",")) {
|
|
225
|
+
let keyArr = this.items?.api?.valueKey.split(",");
|
|
226
|
+
let value = "";
|
|
227
|
+
keyArr.map((key, index) => {
|
|
228
|
+
if (index == keyArr.length - 1) {
|
|
229
|
+
value += item[key];
|
|
230
|
+
} else {
|
|
231
|
+
value += item[key] + ",";
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
item.value = value;
|
|
235
|
+
} else {
|
|
236
|
+
item.value = item[this.items?.api?.valueKey || "value"];
|
|
237
|
+
}
|
|
238
|
+
if (this.valueType == "string") {
|
|
239
|
+
item.value = String(item.value);
|
|
240
|
+
}
|
|
241
|
+
if (this.valueType == "number") {
|
|
242
|
+
item.value = Number(item.value);
|
|
243
|
+
}
|
|
244
|
+
return item;
|
|
245
|
+
});
|
|
246
|
+
this.optionsCopy = this.options;
|
|
247
|
+
let name = this.getName(this._value);
|
|
248
|
+
if (name.length == 0) {
|
|
249
|
+
this.$emit(`update:label`, this._value);
|
|
250
|
+
} else {
|
|
251
|
+
this.$emit(`update:label`, name.join(","));
|
|
252
|
+
this.$emit("input", this._value);
|
|
253
|
+
}
|
|
254
|
+
if (
|
|
255
|
+
this.options &&
|
|
256
|
+
this.options.length == 1 &&
|
|
257
|
+
this.items.prop == "paymentWay"
|
|
258
|
+
) {
|
|
259
|
+
// 若只有一个付款方式需要自动带出
|
|
260
|
+
const valueKey = this.items?.api?.valueKey;
|
|
261
|
+
this._value = this.options[0][valueKey];
|
|
262
|
+
}
|
|
263
|
+
this.$emit("selectInit",this.optionsCopy)
|
|
264
|
+
},
|
|
265
|
+
filterMethod(val) {
|
|
266
|
+
if (
|
|
267
|
+
JSON.parse(this.items?.api?.reqKeys ? this.items?.api?.reqKeys : "{}")
|
|
268
|
+
.canInput
|
|
269
|
+
) {
|
|
270
|
+
this.$emit("input", "");
|
|
271
|
+
this.$emit(`update:label`, val);
|
|
272
|
+
}
|
|
273
|
+
if (val || val == 0) {
|
|
274
|
+
this.options = this.optionsCopy.filter((item) => {
|
|
275
|
+
if (item.label.includes(val)) {
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.options = this.optionsCopy;
|
|
282
|
+
},
|
|
283
|
+
clickFn() {
|
|
284
|
+
if (this.options.length < 1) {
|
|
285
|
+
this.options = this.optionsCopy;
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
clearFn() {
|
|
289
|
+
this.options = this.optionsCopy;
|
|
290
|
+
},
|
|
291
|
+
changVariable(val) {
|
|
292
|
+
if (!val) {
|
|
293
|
+
return val || "";
|
|
294
|
+
}
|
|
295
|
+
let str = String(val);
|
|
296
|
+
if (str == "${nowDate}") {
|
|
297
|
+
return dayjs().format("YYYY-MM-DD");
|
|
298
|
+
}
|
|
299
|
+
if (str && str.includes("$")) {
|
|
300
|
+
let key = str.replace("${", "").replace("}", "");
|
|
301
|
+
return this.variable[key] || "";
|
|
302
|
+
}
|
|
303
|
+
return val || "";
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
};
|
|
307
|
+
</script>
|