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,18 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Trade :config="config"></Trade>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import Trade from "../main.vue"; // 真正使用的时候不用导入 已全局use
|
|
7
|
+
export default {
|
|
8
|
+
name: "trade",
|
|
9
|
+
components: {
|
|
10
|
+
Trade, // 真正使用的时候不用导入 已全局use
|
|
11
|
+
},
|
|
12
|
+
data() {
|
|
13
|
+
return {};
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: your name
|
|
3
|
+
* @Date: 2022-03-02 09:41:41
|
|
4
|
+
* @LastEditTime: 2023-12-05 17:10:15
|
|
5
|
+
* @LastEditors: 龚珂 gongke@nstc.com.cn
|
|
6
|
+
* @Description: 支付网点-支持下拉懒加载、模糊查询、支行名和联行号拼接展示
|
|
7
|
+
* @FilePath: \gcs-rec_web\payee-web\payee\src\components\branchBank.vue
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<CLSelectLazy
|
|
11
|
+
v-model="branchBankNo"
|
|
12
|
+
:filter-method="filterFn"
|
|
13
|
+
@scroll-bottom="getNextList"
|
|
14
|
+
v-on="$listeners"
|
|
15
|
+
v-bind="$attrs"
|
|
16
|
+
:placeholder="$l('请选择')"
|
|
17
|
+
@change="handleChange"
|
|
18
|
+
>
|
|
19
|
+
<el-option
|
|
20
|
+
v-for="item in branchBankList"
|
|
21
|
+
:key="item.cnapsNo"
|
|
22
|
+
:label="item['branchBankName']"
|
|
23
|
+
:value="item[valueKey]"
|
|
24
|
+
>
|
|
25
|
+
{{'(' + item.cnapsNo + ')' + item.branchBankName}}
|
|
26
|
+
</el-option>
|
|
27
|
+
</CLSelectLazy>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { getBranchData } from "@/api/common.js";
|
|
32
|
+
import {SelectLazy} from 'n20-common-lib'
|
|
33
|
+
export default {
|
|
34
|
+
name: "NstcBranchBank",
|
|
35
|
+
components: {
|
|
36
|
+
CLSelectLazy:SelectLazy
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
value: {
|
|
40
|
+
type: [String, Array],
|
|
41
|
+
default: "",
|
|
42
|
+
},
|
|
43
|
+
valueKey: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "cnapsNo",
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
branchBankList: [],
|
|
51
|
+
branchBankPage: {
|
|
52
|
+
"page.current": 1,
|
|
53
|
+
"page.size": 20,
|
|
54
|
+
searchKey: "",
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
branchBankNo: {
|
|
60
|
+
get() {
|
|
61
|
+
return this.value;
|
|
62
|
+
},
|
|
63
|
+
set(val) {
|
|
64
|
+
this.$emit("input", val);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
mounted() {
|
|
69
|
+
this.init();
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
methods: {
|
|
73
|
+
async init() {
|
|
74
|
+
const res = await getBranchData(this.branchBankPage);
|
|
75
|
+
this.branchBankList = res?.list || [];
|
|
76
|
+
},
|
|
77
|
+
async filterFn(val) {
|
|
78
|
+
this.branchBankPage["page.size"] = 20;
|
|
79
|
+
this.branchBankPage.searchKey = val;
|
|
80
|
+
const res = await getBranchData(this.branchBankPage);
|
|
81
|
+
this.branchBankList = res?.list || [];
|
|
82
|
+
},
|
|
83
|
+
async getNextList() {
|
|
84
|
+
this.branchBankPage["page.size"] += 20;
|
|
85
|
+
const res = await getBranchData(this.branchBankPage);
|
|
86
|
+
this.branchBankList = res?.list || [];
|
|
87
|
+
},
|
|
88
|
+
handleChange(e){
|
|
89
|
+
const bank = this.branchBankList.find((item) => item.cnapsNo === e);
|
|
90
|
+
this.$emit("set-name", bank.branchBankName);
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
</script>
|
|
95
|
+
|
|
96
|
+
<style lang="scss" scoped>
|
|
97
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 字段属性配置文件
|
|
3
|
+
* 定义不同字段类型对应的组件属性配置
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// 字段属性配置映射
|
|
7
|
+
export const fieldPropsConfig = {
|
|
8
|
+
text: {
|
|
9
|
+
type: "text",
|
|
10
|
+
clearable: true,
|
|
11
|
+
fieldTypeMapping: "el-input",
|
|
12
|
+
default: "",
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
date: {
|
|
16
|
+
type: "date",
|
|
17
|
+
format: "yyyy-MM-dd",
|
|
18
|
+
"value-format": "yyyy-MM-dd",
|
|
19
|
+
clearable: true,
|
|
20
|
+
fieldTypeMapping: "el-date-picker",
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
bigdecimal: {
|
|
25
|
+
controls: true,
|
|
26
|
+
precision: 2,
|
|
27
|
+
isClearable: true,
|
|
28
|
+
min: 0,
|
|
29
|
+
max: 999999999999.99,
|
|
30
|
+
fieldTypeMapping: "cl-input-number",
|
|
31
|
+
default: "",
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
select: {
|
|
35
|
+
clearable: true,
|
|
36
|
+
filterable: true,
|
|
37
|
+
fieldTypeMapping: "el-select",
|
|
38
|
+
default: "",
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
multiselect: {
|
|
42
|
+
multiple: true,
|
|
43
|
+
clearable: true,
|
|
44
|
+
filterable: true,
|
|
45
|
+
"collapse-tags": true,
|
|
46
|
+
fieldTypeMapping: "el-select",
|
|
47
|
+
default: "",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// 字段占位符配置
|
|
52
|
+
export const fieldPlaceholderConfig = {
|
|
53
|
+
select: "请选择",
|
|
54
|
+
multiselect: "请选择",
|
|
55
|
+
date: "请选择",
|
|
56
|
+
text: "请输入",
|
|
57
|
+
bigdecimal: "请输入",
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// 默认配置
|
|
61
|
+
export const defaultFieldProps = {
|
|
62
|
+
clearable: true,
|
|
63
|
+
};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="configurable-form-detail">
|
|
3
|
+
<ClDescriptions :column="3">
|
|
4
|
+
<template v-if="extendAbled.length > 0">
|
|
5
|
+
<template v-for="field in extendAbled">
|
|
6
|
+
<el-descriptions-item
|
|
7
|
+
v-if="field.isEnabled === 1"
|
|
8
|
+
:key="field.fieldNo"
|
|
9
|
+
:labelStyle="labelStyle"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
slot="label"
|
|
13
|
+
v-title="field.fieldName"
|
|
14
|
+
class="text-ellipsis"
|
|
15
|
+
show-overflow-tooltip="true"
|
|
16
|
+
>
|
|
17
|
+
{{ field.fieldName }}
|
|
18
|
+
</div>
|
|
19
|
+
<slot
|
|
20
|
+
name="field"
|
|
21
|
+
:field="field"
|
|
22
|
+
:value="getFieldDisplayValue(field)"
|
|
23
|
+
:old-value="getFieldOldValue(field)"
|
|
24
|
+
>
|
|
25
|
+
<!-- 默认插槽内容 -->
|
|
26
|
+
<div
|
|
27
|
+
v-title="getFieldDisplayValue(field)"
|
|
28
|
+
:show-overflow-tooltip="true"
|
|
29
|
+
class="text-ellipsis"
|
|
30
|
+
>
|
|
31
|
+
{{ getFieldDisplayValue(field) || "--" }}
|
|
32
|
+
</div>
|
|
33
|
+
</slot>
|
|
34
|
+
</el-descriptions-item>
|
|
35
|
+
</template>
|
|
36
|
+
</template>
|
|
37
|
+
<!-- 当没有数据时,提供一个空的占位项 -->
|
|
38
|
+
<el-descriptions-item v-else>
|
|
39
|
+
<div slot="label">暂无数据</div>
|
|
40
|
+
<div>--</div>
|
|
41
|
+
</el-descriptions-item>
|
|
42
|
+
</ClDescriptions>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import { Descriptions } from "n20-common-lib";
|
|
48
|
+
export default {
|
|
49
|
+
name: "Detail",
|
|
50
|
+
components: {
|
|
51
|
+
ClDescriptions: Descriptions,
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
formData: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => ({}),
|
|
57
|
+
},
|
|
58
|
+
extendFields: {
|
|
59
|
+
type: Array,
|
|
60
|
+
default: () => [],
|
|
61
|
+
},
|
|
62
|
+
labelStyle: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "",
|
|
65
|
+
},
|
|
66
|
+
fieldDifferences: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => ({}),
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
extendAbled() {
|
|
73
|
+
return this.extendFields.filter((field) => field.isEnabled === 1);
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
// 格式化字段值
|
|
78
|
+
formatFieldValue(value, field) {
|
|
79
|
+
if (!value && value !== 0) {
|
|
80
|
+
return "";
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// 根据字段类型格式化显示值
|
|
84
|
+
const property = field.fieldProperty?.toLowerCase();
|
|
85
|
+
|
|
86
|
+
switch (property) {
|
|
87
|
+
case "date":
|
|
88
|
+
// 日期格式化
|
|
89
|
+
return this.formatDate(value);
|
|
90
|
+
case "bigdecimal":
|
|
91
|
+
// 数字格式化
|
|
92
|
+
return this.formatNumber(value);
|
|
93
|
+
case "select":
|
|
94
|
+
case "multiselect":
|
|
95
|
+
// 下拉框直接显示label(因为存储的就是label)
|
|
96
|
+
return value;
|
|
97
|
+
default:
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
// 获取字段显示值
|
|
103
|
+
getFieldDisplayValue(field) {
|
|
104
|
+
const value = this.formData[field.fieldNo];
|
|
105
|
+
return this.formatFieldValue(value, field);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// 获取字段的旧值
|
|
109
|
+
getFieldOldValue(field) {
|
|
110
|
+
const oldValue = this.fieldDifferences?.oldValue?.[field.fieldNo];
|
|
111
|
+
return this.formatFieldValue(oldValue, field);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// 格式化日期
|
|
115
|
+
formatDate(value) {
|
|
116
|
+
if (!value) return "";
|
|
117
|
+
// 如果已经是格式化的日期字符串,直接返回
|
|
118
|
+
if (typeof value === "string" && value.includes("-")) {
|
|
119
|
+
return value;
|
|
120
|
+
}
|
|
121
|
+
// 如果是时间戳,转换为日期格式
|
|
122
|
+
try {
|
|
123
|
+
const date = new Date(value);
|
|
124
|
+
return date.toISOString().split("T")[0];
|
|
125
|
+
} catch (error) {
|
|
126
|
+
return value;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// 格式化数字
|
|
131
|
+
formatNumber(value) {
|
|
132
|
+
if (!value && value !== 0) return "";
|
|
133
|
+
const num = parseFloat(value);
|
|
134
|
+
if (isNaN(num)) return value;
|
|
135
|
+
const fixedNum = num.toFixed(2);
|
|
136
|
+
|
|
137
|
+
const [integerPart, decimalPart] = fixedNum.split(".");
|
|
138
|
+
|
|
139
|
+
const integerWithThousand = integerPart.replace(
|
|
140
|
+
/\B(?=(\d{3})+(?!\d))/g,
|
|
141
|
+
","
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
return `${integerWithThousand}.${decimalPart}`;
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
};
|
|
148
|
+
</script>
|
|
149
|
+
|
|
150
|
+
<style scoped lang="scss">
|
|
151
|
+
.configurable-form-detail {
|
|
152
|
+
.text-ellipsis {
|
|
153
|
+
overflow: hidden;
|
|
154
|
+
text-overflow: ellipsis;
|
|
155
|
+
white-space: nowrap;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="configurable-form-example">
|
|
3
|
+
<div class="configurable-form-example__header">
|
|
4
|
+
<h2>动态表单示例</h2>
|
|
5
|
+
<el-form>
|
|
6
|
+
<el-row :gutter="20">
|
|
7
|
+
<el-col :span="12">
|
|
8
|
+
<el-form-item label="单据编号:">
|
|
9
|
+
<el-input v-model="documentNo" placeholder="请输入单据编号" />
|
|
10
|
+
</el-form-item>
|
|
11
|
+
</el-col>
|
|
12
|
+
<el-col :span="12">
|
|
13
|
+
<el-form-item label="模块编号:">
|
|
14
|
+
<el-input v-model="modelNo" placeholder="请输入模块编号" />
|
|
15
|
+
</el-form-item>
|
|
16
|
+
</el-col>
|
|
17
|
+
</el-row>
|
|
18
|
+
</el-form>
|
|
19
|
+
<el-button type="primary" @click="handleSubmit">提交表单</el-button>
|
|
20
|
+
<el-button @click="handleReset">重置表单</el-button>
|
|
21
|
+
<el-button @click="handleValidate">验证表单</el-button>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div >
|
|
25
|
+
<!-- 动态表单组件 -->
|
|
26
|
+
<configurable-form
|
|
27
|
+
ref="configurableForm"
|
|
28
|
+
v-model="formData"
|
|
29
|
+
:document-no="documentNo"
|
|
30
|
+
:model-no="modelNo"
|
|
31
|
+
@extend-length="extendLength"
|
|
32
|
+
>
|
|
33
|
+
<!-- <template #label="{ field, fieldName }">
|
|
34
|
+
<div class="custom-label">
|
|
35
|
+
<span>{{ fieldName }}</span>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<template #field="{ field, value, oldValue }">
|
|
40
|
+
<template v-if="oldValue">
|
|
41
|
+
<div class="custom-field">
|
|
42
|
+
<div v-title="value" class="field-value m-b-ss text-ellipsis">
|
|
43
|
+
<span class="after-color">{{ value || "--" }}</span>
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
v-if="field.fieldDescription"
|
|
47
|
+
class="text-ellipsis flex-box flex-v"
|
|
48
|
+
:show-overflow-tooltip="true"
|
|
49
|
+
>
|
|
50
|
+
<span class="before-color text-ellipsis">{{ oldValue }}</span>
|
|
51
|
+
<el-tooltip content="123" placement="top">
|
|
52
|
+
<i class="n20-icon-xinxitishi m-l-ss color-placeholder"></i>
|
|
53
|
+
</el-tooltip>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</template>
|
|
57
|
+
<template v-else>
|
|
58
|
+
<span>{{ value || "--" }}</span>
|
|
59
|
+
</template>
|
|
60
|
+
</template> -->
|
|
61
|
+
</configurable-form>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<div class="configurable-form-example__footer">
|
|
65
|
+
<h3>表单数据:</h3>
|
|
66
|
+
<pre>{{ JSON.stringify(formData, null, 2) }}</pre>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script>
|
|
72
|
+
import ConfigurableForm from "../main.vue";
|
|
73
|
+
|
|
74
|
+
export default {
|
|
75
|
+
name: "ConfigurableFormExample",
|
|
76
|
+
components: {
|
|
77
|
+
ConfigurableForm,
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
documentNo: "open_account",
|
|
82
|
+
modelNo: "AIMS",
|
|
83
|
+
extendLength: 0,
|
|
84
|
+
formData: {
|
|
85
|
+
textExtend1: "通知账户",
|
|
86
|
+
},
|
|
87
|
+
fieldDifferences: {
|
|
88
|
+
fieldName: "jsonExtend",
|
|
89
|
+
fieldDescription: null,
|
|
90
|
+
differenceType: 2,
|
|
91
|
+
oldValue: {
|
|
92
|
+
id: 133,
|
|
93
|
+
accountId: 3734,
|
|
94
|
+
fmId: null,
|
|
95
|
+
textExtend1: "活期账户",
|
|
96
|
+
textExtend2: null,
|
|
97
|
+
textExtend3: null,
|
|
98
|
+
textExtend4: null,
|
|
99
|
+
textExtend5: null,
|
|
100
|
+
textExtend6: null,
|
|
101
|
+
textExtend7: null,
|
|
102
|
+
textExtend8: null,
|
|
103
|
+
numberExtend1: null,
|
|
104
|
+
dateExtend1: null,
|
|
105
|
+
createTime: "2025-09-17 09:17:51",
|
|
106
|
+
updateTime: "2025-09-17 09:17:51",
|
|
107
|
+
},
|
|
108
|
+
newValue: {
|
|
109
|
+
id: 134,
|
|
110
|
+
accountId: null,
|
|
111
|
+
fmId: 6285,
|
|
112
|
+
textExtend1: "通知账户",
|
|
113
|
+
textExtend2: null,
|
|
114
|
+
textExtend3: null,
|
|
115
|
+
textExtend4: null,
|
|
116
|
+
textExtend5: null,
|
|
117
|
+
textExtend6: null,
|
|
118
|
+
textExtend7: null,
|
|
119
|
+
textExtend8: null,
|
|
120
|
+
numberExtend1: null,
|
|
121
|
+
dateExtend1: null,
|
|
122
|
+
createTime: "2025-09-17 09:18:26",
|
|
123
|
+
updateTime: "2025-09-17 09:18:26",
|
|
124
|
+
},
|
|
125
|
+
elements: null,
|
|
126
|
+
children: {
|
|
127
|
+
differenceType: 2,
|
|
128
|
+
oldValue: {
|
|
129
|
+
id: 133,
|
|
130
|
+
accountId: 3734,
|
|
131
|
+
fmId: null,
|
|
132
|
+
textExtend1: "活期账户",
|
|
133
|
+
textExtend2: null,
|
|
134
|
+
textExtend3: null,
|
|
135
|
+
textExtend4: null,
|
|
136
|
+
textExtend5: null,
|
|
137
|
+
textExtend6: null,
|
|
138
|
+
textExtend7: null,
|
|
139
|
+
textExtend8: null,
|
|
140
|
+
numberExtend1: null,
|
|
141
|
+
dateExtend1: null,
|
|
142
|
+
createTime: "2025-09-17 09:17:51",
|
|
143
|
+
updateTime: "2025-09-17 09:17:51",
|
|
144
|
+
},
|
|
145
|
+
newValue: {
|
|
146
|
+
id: 134,
|
|
147
|
+
accountId: null,
|
|
148
|
+
fmId: 6285,
|
|
149
|
+
textExtend1: "通知账户",
|
|
150
|
+
textExtend2: null,
|
|
151
|
+
textExtend3: null,
|
|
152
|
+
textExtend4: null,
|
|
153
|
+
textExtend5: null,
|
|
154
|
+
textExtend6: null,
|
|
155
|
+
textExtend7: null,
|
|
156
|
+
textExtend8: null,
|
|
157
|
+
numberExtend1: null,
|
|
158
|
+
dateExtend1: null,
|
|
159
|
+
createTime: "2025-09-17 09:18:26",
|
|
160
|
+
updateTime: "2025-09-17 09:18:26",
|
|
161
|
+
},
|
|
162
|
+
children: [
|
|
163
|
+
{
|
|
164
|
+
fieldName: "textExtend1",
|
|
165
|
+
fieldDescription: null,
|
|
166
|
+
differenceType: 2,
|
|
167
|
+
oldValue: "活期账户",
|
|
168
|
+
newValue: "通知账户",
|
|
169
|
+
elements: null,
|
|
170
|
+
children: null,
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
methods: {
|
|
178
|
+
// 提交表单
|
|
179
|
+
async handleSubmit() {
|
|
180
|
+
try {
|
|
181
|
+
const data = await this.$refs.configurableForm.validate();
|
|
182
|
+
console.log("表单数据:", data);
|
|
183
|
+
this.$message.success("表单验证通过");
|
|
184
|
+
} catch (errors) {
|
|
185
|
+
console.error("表单验证失败:", errors);
|
|
186
|
+
this.$message.error("表单验证失败,请检查输入");
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
// 重置表单
|
|
191
|
+
handleReset() {
|
|
192
|
+
this.$refs.configurableForm.resetForm();
|
|
193
|
+
this.$message.success("表单已重置");
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
// 验证表单
|
|
197
|
+
async handleValidate() {
|
|
198
|
+
try {
|
|
199
|
+
await this.$refs.configurableForm.validate();
|
|
200
|
+
this.$message.success("表单验证通过");
|
|
201
|
+
} catch (errors) {
|
|
202
|
+
this.$message.error("表单验证失败");
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
handleFieldChange(field) {},
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
</script>
|
|
210
|
+
|
|
211
|
+
<style scoped lang="scss">
|
|
212
|
+
.configurable-form-example {
|
|
213
|
+
padding: 20px;
|
|
214
|
+
|
|
215
|
+
&__header {
|
|
216
|
+
background: #f5f7fa;
|
|
217
|
+
padding: 20px;
|
|
218
|
+
border-radius: 4px;
|
|
219
|
+
margin-bottom: 20px;
|
|
220
|
+
|
|
221
|
+
h2 {
|
|
222
|
+
margin: 0 0 16px 0;
|
|
223
|
+
color: #303133;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.el-button {
|
|
227
|
+
margin-right: 10px;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
&__content {
|
|
232
|
+
border: 1px solid #dcdfe6;
|
|
233
|
+
border-radius: 4px;
|
|
234
|
+
margin-bottom: 20px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&__footer {
|
|
238
|
+
background: #f9f9f9;
|
|
239
|
+
padding: 16px;
|
|
240
|
+
border-radius: 4px;
|
|
241
|
+
|
|
242
|
+
h3 {
|
|
243
|
+
margin: 0 0 12px 0;
|
|
244
|
+
color: #606266;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
pre {
|
|
248
|
+
background: #fff;
|
|
249
|
+
border: 1px solid #e4e7ed;
|
|
250
|
+
border-radius: 4px;
|
|
251
|
+
padding: 12px;
|
|
252
|
+
margin: 0;
|
|
253
|
+
font-size: 12px;
|
|
254
|
+
color: #606266;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// 自定义标签样式
|
|
259
|
+
// .custom-label {
|
|
260
|
+
// display: flex;
|
|
261
|
+
// align-items: center;
|
|
262
|
+
// font-weight: 600;
|
|
263
|
+
// color: #303133;
|
|
264
|
+
|
|
265
|
+
// .label-icon {
|
|
266
|
+
// margin-right: 6px;
|
|
267
|
+
// font-size: 14px;
|
|
268
|
+
// }
|
|
269
|
+
|
|
270
|
+
// .label-text {
|
|
271
|
+
// flex: 1;
|
|
272
|
+
// }
|
|
273
|
+
|
|
274
|
+
// .required {
|
|
275
|
+
// color: #f56c6c;
|
|
276
|
+
// margin-left: 4px;
|
|
277
|
+
// }
|
|
278
|
+
// }
|
|
279
|
+
</style>
|