sinosoft-common-form 1.0.0 → 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/README.md +200 -0
- package/common-form.es.js +598 -212
- package/common-form.umd.js +1 -1
- package/download.png +0 -0
- package/man.png +0 -0
- package/package.json +1 -1
- package/style.css +1 -0
- package/woman.png +0 -0
package/README.md
CHANGED
|
@@ -27,3 +27,203 @@ Form 方法
|
|
|
27
27
|
| 事件名 | 说明 | 回调参数 |
|
|
28
28
|
|--------|--------------------------|----------|
|
|
29
29
|
| submit | 点击确认按钮拿到表单数据 | model |
|
|
30
|
+
|
|
31
|
+
参考用例:
|
|
32
|
+
@/components/index.vue
|
|
33
|
+
<template>
|
|
34
|
+
<s-form
|
|
35
|
+
:fieldList="fieldList"
|
|
36
|
+
:model="model"
|
|
37
|
+
:options="options"
|
|
38
|
+
@submit="handleBaseSubmit"
|
|
39
|
+
@cancel="cancelClick"
|
|
40
|
+
>
|
|
41
|
+
<!-- 如果不使用默认的按钮可以使用插槽自定义内容, 插槽返回的model就是当前表单的数据 -->
|
|
42
|
+
<!-- <template #buttons="{ model }">
|
|
43
|
+
<el-button">提交</el-button>
|
|
44
|
+
</template> -->
|
|
45
|
+
</s-form>
|
|
46
|
+
<!-- </el-card> -->
|
|
47
|
+
</template>
|
|
48
|
+
<script lang="ts" setup>
|
|
49
|
+
import { exampleForm } from '../config/form'
|
|
50
|
+
import { ref, reactive } from 'vue'
|
|
51
|
+
import { default as sForm } from '../package/Index.vue'
|
|
52
|
+
|
|
53
|
+
// 本项目EasyForm组件自动引入,如复制此代码,需根据路径引入Form组件后使用
|
|
54
|
+
const fieldList: Form.FieldItem[] = exampleForm.baseForExample
|
|
55
|
+
// 按钮配置
|
|
56
|
+
const options = reactive({
|
|
57
|
+
showButtonText: true,
|
|
58
|
+
showResetButton: true,
|
|
59
|
+
showCancelButton: true,
|
|
60
|
+
submitButtonText: '提交',
|
|
61
|
+
resetButtonText: '重置',
|
|
62
|
+
cancelButtonText: '取消',
|
|
63
|
+
})
|
|
64
|
+
const model = ref<Record<string, any>>({
|
|
65
|
+
// 地址项字段
|
|
66
|
+
addressStreet: '',
|
|
67
|
+
addressHouse: '',
|
|
68
|
+
addressMansion: '',
|
|
69
|
+
block: '',
|
|
70
|
+
floor: '',
|
|
71
|
+
flat: '',
|
|
72
|
+
addressLang: '1',
|
|
73
|
+
addressNation:'',
|
|
74
|
+
addressCity:'',
|
|
75
|
+
addressArea:'',
|
|
76
|
+
addressAreaC:'',
|
|
77
|
+
// 姓名项字段
|
|
78
|
+
nameEnFamily: '',
|
|
79
|
+
nameEn: '',
|
|
80
|
+
nameChFamily: '',
|
|
81
|
+
nameCh: '',
|
|
82
|
+
// 单选字段
|
|
83
|
+
radioValue: '',
|
|
84
|
+
// 性别字段
|
|
85
|
+
gender: 1,
|
|
86
|
+
// 多选字段
|
|
87
|
+
hobbies: [1],
|
|
88
|
+
// 下拉字段
|
|
89
|
+
job: 3,
|
|
90
|
+
// 密码字段
|
|
91
|
+
password:'',
|
|
92
|
+
// 只读字段
|
|
93
|
+
readonly: '只读输入框',
|
|
94
|
+
// 日期字段
|
|
95
|
+
date: new Date(2000, 1, 1, 12, 0, 0),
|
|
96
|
+
// 留言板字段
|
|
97
|
+
summary: 'lalalallallaa'
|
|
98
|
+
})
|
|
99
|
+
/**
|
|
100
|
+
* 注意: model数据模型非必填项,如果仅仅是用于数据收集,model参数可以不用填,表单的submit事件会返回所有搜集的数据对象
|
|
101
|
+
* 如果是编辑的情况下,页面需要回显数据,则model数据模型必须要填写
|
|
102
|
+
*/
|
|
103
|
+
const handleBaseSubmit = (model: Record<string, any>) => {
|
|
104
|
+
console.log(model)
|
|
105
|
+
}
|
|
106
|
+
const cancelClick = () => {
|
|
107
|
+
console.log('cancleClick')
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
<style lang="scss" scoped></style>
|
|
111
|
+
|
|
112
|
+
配置文件:
|
|
113
|
+
@/config/form.ts
|
|
114
|
+
|
|
115
|
+
// 表单各项配置示例
|
|
116
|
+
export const exampleForm = {
|
|
117
|
+
<!-- 基本表单实例 -->
|
|
118
|
+
baseForExample: [
|
|
119
|
+
<!-- 标题栏 -->
|
|
120
|
+
{ type: 'title', title: '地址'},
|
|
121
|
+
<!-- 地址项配置 -->
|
|
122
|
+
{
|
|
123
|
+
type: 'address', //表单选项类型
|
|
124
|
+
disabled: false , //是否可编辑
|
|
125
|
+
rules: [{ required: false, message: 'name is required' }], //校验规则
|
|
126
|
+
field:{ //定义v-model绑定字段
|
|
127
|
+
addressStreet: 'addressStreet',
|
|
128
|
+
addressHouse: 'addressHouse',
|
|
129
|
+
addressMansion: 'addressMansion',
|
|
130
|
+
block: 'block',
|
|
131
|
+
floor: 'floor',
|
|
132
|
+
flat: 'flat',
|
|
133
|
+
addressLang: 'addressLang',
|
|
134
|
+
addressNation: 'addressNation',
|
|
135
|
+
addressCity: 'addressCity',
|
|
136
|
+
addressArea: 'addressArea',
|
|
137
|
+
addressAreaC: 'addressAreaC',
|
|
138
|
+
},
|
|
139
|
+
optionsLang: { //语言下拉选项
|
|
140
|
+
data: [
|
|
141
|
+
{ label: '中文地址', value: '1' },
|
|
142
|
+
{ label: '英文地址', value: '2' }]
|
|
143
|
+
},
|
|
144
|
+
optionsSelectNation: { //国家下拉选项
|
|
145
|
+
data: [{ label: '國家', value: 1 }, { label: '國家1', value: 2 }, { label: '國家2', value: 3 }]
|
|
146
|
+
},
|
|
147
|
+
optionsSelectCity: { //城市下拉选项
|
|
148
|
+
data: [{ label: '城市', value: 1 }, { label: '城市1', value: 2 }, { label: '城市2', value: 3 }]
|
|
149
|
+
},
|
|
150
|
+
optionsSelectArea: { //区域下拉选项
|
|
151
|
+
data: [{ label: '區域', value: 1 }, { label: '區域1', value: 2 }, { label: '區域2', value: 3 }]
|
|
152
|
+
},
|
|
153
|
+
optionsSelectAreaC: { //子区域下拉选项
|
|
154
|
+
data: [{ label: '子地區', value: 1 }, { label: '子地區1', value: 2 }, { label: '子地區2', value: 3 }]
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
<!-- 姓名项配置 -->
|
|
158
|
+
{ label: '姓名',
|
|
159
|
+
type: 'name', //表单选项类型
|
|
160
|
+
disabled: false , //是否可编辑
|
|
161
|
+
rules: [{ required: true, message: 'name is required' }] ,//校验规则
|
|
162
|
+
placeholderNameChFamily: '請輸入中文姓',
|
|
163
|
+
placeholderNameEnFamily: '請輸入英文姓',
|
|
164
|
+
placeholderNameEn: '請輸入英文名',
|
|
165
|
+
placeholderNameCh: '請輸入中文名',
|
|
166
|
+
field: { //定义v-model绑定字段
|
|
167
|
+
nameEnFamily: 'nameEnFamily',
|
|
168
|
+
nameEn: 'nameEn',
|
|
169
|
+
nameChFamily: 'nameChFamily',
|
|
170
|
+
nameCh: 'nameCh'
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
<!-- 单选配置 -->
|
|
174
|
+
{ label: '单选',
|
|
175
|
+
field: {'radioValue': 'radioValue'},
|
|
176
|
+
type: 'radio',
|
|
177
|
+
options: { data: [{ label: '男', value: 1 }, { label: '女', value: 0 }] }
|
|
178
|
+
},
|
|
179
|
+
<!-- 性别配置 -->
|
|
180
|
+
{ label: '性别',
|
|
181
|
+
field: {'radioValue': 'gender'},
|
|
182
|
+
type: 'gender',
|
|
183
|
+
options: { data: [{ label: '男', value: 1 }, { label: '女', value: 0 }] }
|
|
184
|
+
},
|
|
185
|
+
<!-- 日期配置 -->
|
|
186
|
+
{ label: '日期',
|
|
187
|
+
field: {date: 'date'},
|
|
188
|
+
type: 'datetime',
|
|
189
|
+
placeholder: '请选择日期'
|
|
190
|
+
},
|
|
191
|
+
<!-- 多选配置 -->
|
|
192
|
+
{ label: '多选',
|
|
193
|
+
field: {checkboxValue: 'hobbies'},
|
|
194
|
+
type: 'checkbox',
|
|
195
|
+
ways: 'row', //column or row
|
|
196
|
+
options: { data: [{ label: '吃饭', value: 1 }, { label: '睡觉', value: 2 }, { label: '写代码', value: 3 }] }
|
|
197
|
+
},
|
|
198
|
+
<!-- 下拉框配置 -->
|
|
199
|
+
{ label: '下拉',
|
|
200
|
+
field: {selectValue:'job'},
|
|
201
|
+
type: 'select',
|
|
202
|
+
options: { data: [{ label: '吃饭', value: 1 }, { label: '睡觉', value: 2 }, { label: '写代码', value: 3 }] }
|
|
203
|
+
},
|
|
204
|
+
<!-- 密码输入框配置 -->
|
|
205
|
+
{ label: '密码',
|
|
206
|
+
field: 'password',
|
|
207
|
+
type: 'password',
|
|
208
|
+
placeholder: '这是一个密码输入框'
|
|
209
|
+
},
|
|
210
|
+
<!-- 只读输入框配置 -->
|
|
211
|
+
{ label: '只读',
|
|
212
|
+
field: 'readonly',
|
|
213
|
+
readonly: true,
|
|
214
|
+
placeholder: '这是一个只读输入框'
|
|
215
|
+
},
|
|
216
|
+
<!-- 日期配置 -->
|
|
217
|
+
{ label: '日期',
|
|
218
|
+
field: {date: 'date'},
|
|
219
|
+
type: 'datetime',
|
|
220
|
+
placeholder: '请选择日期'
|
|
221
|
+
},
|
|
222
|
+
<!-- 留言板配置 -->
|
|
223
|
+
{ label: '留言板',
|
|
224
|
+
field: 'summary',
|
|
225
|
+
type: 'textarea',
|
|
226
|
+
placeholder: '留言板'
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
} as Record<string, Form.FieldItem[]>
|
package/common-form.es.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as X, ref as D, computed as Z, resolveComponent as x, openBlock as d, createBlock as u, withCtx as n, createVNode as r, mergeProps as ee, withModifiers as le, unref as $, createElementBlock as _, Fragment as C, renderList as P, normalizeClass as ae, createElementVNode as I, toDisplayString as N, createTextVNode as w, withKeys as V, createCommentVNode as E, normalizeStyle as oe, renderSlot as de, pushScopeId as ne, popScopeId as re } from "vue";
|
|
2
|
+
const se = (U) => (ne("data-v-999098b8"), U = U(), re(), U), ue = { class: "header-title" }, pe = /* @__PURE__ */ se(() => /* @__PURE__ */ I("span", { class: "title-left" }, null, -1)), te = { class: "title-content" }, ce = { class: "item-address" }, ye = {
|
|
3
|
+
key: 0,
|
|
4
|
+
class: "item-address"
|
|
5
|
+
}, be = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "item-address"
|
|
8
|
+
}, fe = ["src"], ve = /* @__PURE__ */ X({
|
|
3
9
|
__name: "Index",
|
|
4
10
|
props: {
|
|
5
11
|
fieldList: null,
|
|
@@ -7,241 +13,621 @@ const R = /* @__PURE__ */ A({
|
|
|
7
13
|
options: null
|
|
8
14
|
},
|
|
9
15
|
emits: ["submit", "reset", "cancel"],
|
|
10
|
-
setup(
|
|
11
|
-
const
|
|
12
|
-
labelPosition: "
|
|
13
|
-
disabled: !1
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
setup(U, { expose: T, emit: F }) {
|
|
17
|
+
const K = U, a = D({}), A = D(), S = Z(() => Object.assign({
|
|
18
|
+
labelPosition: "top",
|
|
19
|
+
disabled: !1
|
|
20
|
+
// showButtonText: true,
|
|
21
|
+
// showResetButton: true,
|
|
22
|
+
// submitButtonText: '提交',
|
|
23
|
+
// resetButtonText: '重置',
|
|
24
|
+
// cancelButtonText: '取消'
|
|
25
|
+
}, K == null ? void 0 : K.options));
|
|
26
|
+
console.log(
|
|
27
|
+
K == null ? void 0 : K.options,
|
|
28
|
+
"_oppppppppppp0ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp",
|
|
29
|
+
S
|
|
30
|
+
), T({
|
|
31
|
+
formRef: A
|
|
32
|
+
}), K.fieldList.map((t) => {
|
|
33
|
+
const k = t.type === "checkbox" ? [] : "";
|
|
34
|
+
K.model ? a.value = K.model : a.value[t.field] = t.value || k;
|
|
23
35
|
});
|
|
24
|
-
const
|
|
25
|
-
t && t.validate((
|
|
26
|
-
if (
|
|
27
|
-
|
|
36
|
+
const Y = (t) => {
|
|
37
|
+
t && t.validate((k) => {
|
|
38
|
+
if (k)
|
|
39
|
+
F("submit", a.value);
|
|
28
40
|
else
|
|
29
41
|
return !1;
|
|
30
42
|
});
|
|
31
|
-
},
|
|
32
|
-
t &&
|
|
33
|
-
},
|
|
43
|
+
}, y = (t) => {
|
|
44
|
+
t && Y(A.value);
|
|
45
|
+
}, O = (t) => {
|
|
34
46
|
t && t.resetFields();
|
|
35
47
|
};
|
|
36
|
-
return (t,
|
|
37
|
-
const
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
48
|
+
return (t, k) => {
|
|
49
|
+
const g = x("el-form-item"), z = x("el-button"), M = x("el-radio"), H = x("el-radio-group"), L = x("el-option"), B = x("el-select"), b = x("el-input"), j = x("el-checkbox"), q = x("el-checkbox-group"), G = x("el-date-picker"), J = x("el-form"), Q = x("el-card");
|
|
50
|
+
return d(), u(Q, { class: "mb-5" }, {
|
|
51
|
+
default: n(() => [
|
|
52
|
+
r(J, ee({
|
|
53
|
+
onSubmit: k[3] || (k[3] = le(() => {
|
|
54
|
+
}, ["prevent"])),
|
|
55
|
+
model: a.value
|
|
56
|
+
}, $(S), {
|
|
57
|
+
"label-position": $(S).labelPosition,
|
|
58
|
+
ref_key: "formRef",
|
|
59
|
+
ref: A
|
|
60
|
+
}), {
|
|
61
|
+
default: n(() => [
|
|
62
|
+
(d(!0), _(C, null, P(U.fieldList, (e, W) => (d(), _("div", {
|
|
63
|
+
key: W,
|
|
64
|
+
class: ae(
|
|
65
|
+
e.type === "title" || e.type === "address" ? "form-item-title" : "form-item"
|
|
66
|
+
)
|
|
67
|
+
}, [
|
|
68
|
+
e.type === "title" ? (d(), u(g, { key: 0 }, {
|
|
69
|
+
default: n(() => [
|
|
70
|
+
I("div", ue, [
|
|
71
|
+
pe,
|
|
72
|
+
I("span", te, N(e.title), 1)
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
_: 2
|
|
76
|
+
}, 1024)) : e.type === "address" ? (d(), u(g, {
|
|
77
|
+
key: 1,
|
|
78
|
+
rules: e.rules,
|
|
79
|
+
prop: [e.field],
|
|
80
|
+
class: "container-address"
|
|
81
|
+
}, {
|
|
82
|
+
default: n(() => {
|
|
83
|
+
var o, p, c, f;
|
|
84
|
+
return [
|
|
85
|
+
r(z, {
|
|
86
|
+
style: { "margin-bottom": "20px", "margin-right": "60px" },
|
|
87
|
+
onClick: t.downLoad
|
|
88
|
+
}, {
|
|
89
|
+
default: n(() => [
|
|
90
|
+
w(" 載入已有地址 ")
|
|
91
|
+
]),
|
|
92
|
+
_: 1
|
|
93
|
+
}, 8, ["onClick"]),
|
|
94
|
+
r(H, {
|
|
95
|
+
style: { "margin-bottom": "20px" },
|
|
96
|
+
modelValue: a.value[e.field.addressLang],
|
|
97
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressLang] = l,
|
|
98
|
+
disabled: e.disabled
|
|
99
|
+
}, {
|
|
100
|
+
default: n(() => {
|
|
101
|
+
var l;
|
|
102
|
+
return [
|
|
103
|
+
(d(!0), _(C, null, P((l = e.optionsLang) == null ? void 0 : l.data, (s) => {
|
|
104
|
+
var v, h;
|
|
105
|
+
return d(), u(M, {
|
|
106
|
+
label: s[((v = e.optionsLang) == null ? void 0 : v.valueKey) || "value"],
|
|
107
|
+
size: "large",
|
|
108
|
+
key: s[((h = e.optionsLang) == null ? void 0 : h.valueKey) || "value"]
|
|
109
|
+
}, {
|
|
110
|
+
default: n(() => {
|
|
111
|
+
var i;
|
|
112
|
+
return [
|
|
113
|
+
w(N(s[((i = e.optionsLang) == null ? void 0 : i.labelkey) || "label"]), 1)
|
|
114
|
+
];
|
|
115
|
+
}),
|
|
116
|
+
_: 2
|
|
117
|
+
}, 1032, ["label"]);
|
|
118
|
+
}), 128))
|
|
119
|
+
];
|
|
120
|
+
}),
|
|
121
|
+
_: 2
|
|
122
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled"]),
|
|
123
|
+
I("div", ce, [
|
|
124
|
+
r(B, {
|
|
125
|
+
style: { "margin-right": "40px", width: "20%" },
|
|
126
|
+
modelValue: a.value[e.field.addressNation],
|
|
127
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressNation] = l,
|
|
128
|
+
placeholder: ((o = e.optionsSelectNation) == null ? void 0 : o.placeholder) || "请选择",
|
|
129
|
+
clearable: e.clearable
|
|
130
|
+
}, {
|
|
131
|
+
default: n(() => {
|
|
132
|
+
var l;
|
|
133
|
+
return [
|
|
134
|
+
(d(!0), _(C, null, P((l = e.optionsSelectNation) == null ? void 0 : l.data, (s) => {
|
|
135
|
+
var v, h, i;
|
|
136
|
+
return d(), u(L, {
|
|
137
|
+
key: s[((v = e.optionsSelectNation) == null ? void 0 : v.valueKey) || "value"],
|
|
138
|
+
label: s[((h = e.optionsSelectNation) == null ? void 0 : h.labelkey) || "label"],
|
|
139
|
+
value: s[((i = e.optionsSelectNation) == null ? void 0 : i.valueKey) || "value"]
|
|
140
|
+
}, null, 8, ["label", "value"]);
|
|
141
|
+
}), 128))
|
|
142
|
+
];
|
|
143
|
+
}),
|
|
144
|
+
_: 2
|
|
145
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "clearable"]),
|
|
146
|
+
r(B, {
|
|
147
|
+
style: { "margin-right": "40px", width: "20%" },
|
|
148
|
+
modelValue: a.value[e.field.addressCity],
|
|
149
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressCity] = l,
|
|
150
|
+
placeholder: ((p = e.optionsSelectCity) == null ? void 0 : p.placeholder) || "请选择",
|
|
151
|
+
clearable: e.clearable
|
|
152
|
+
}, {
|
|
153
|
+
default: n(() => {
|
|
154
|
+
var l;
|
|
155
|
+
return [
|
|
156
|
+
(d(!0), _(C, null, P((l = e.optionsSelectCity) == null ? void 0 : l.data, (s) => {
|
|
157
|
+
var v, h, i;
|
|
158
|
+
return d(), u(L, {
|
|
159
|
+
key: s[((v = e.optionsSelectCity) == null ? void 0 : v.valueKey) || "value"],
|
|
160
|
+
label: s[((h = e.optionsSelectCity) == null ? void 0 : h.labelkey) || "label"],
|
|
161
|
+
value: s[((i = e.optionsSelectCity) == null ? void 0 : i.valueKey) || "value"]
|
|
162
|
+
}, null, 8, ["label", "value"]);
|
|
163
|
+
}), 128))
|
|
164
|
+
];
|
|
165
|
+
}),
|
|
166
|
+
_: 2
|
|
167
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "clearable"]),
|
|
168
|
+
r(B, {
|
|
169
|
+
style: { "margin-right": "40px", width: "20%" },
|
|
170
|
+
modelValue: a.value[e.field.addressArea],
|
|
171
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressArea] = l,
|
|
172
|
+
placeholder: ((c = e.optionsSelectArea) == null ? void 0 : c.placeholder) || "请选择",
|
|
173
|
+
clearable: e.clearable
|
|
174
|
+
}, {
|
|
175
|
+
default: n(() => {
|
|
176
|
+
var l;
|
|
177
|
+
return [
|
|
178
|
+
(d(!0), _(C, null, P((l = e.optionsSelectArea) == null ? void 0 : l.data, (s) => {
|
|
179
|
+
var v, h, i;
|
|
180
|
+
return d(), u(L, {
|
|
181
|
+
key: s[((v = e.optionsSelectArea) == null ? void 0 : v.valueKey) || "value"],
|
|
182
|
+
label: s[((h = e.optionsSelectArea) == null ? void 0 : h.labelkey) || "label"],
|
|
183
|
+
value: s[((i = e.optionsSelectArea) == null ? void 0 : i.valueKey) || "value"]
|
|
184
|
+
}, null, 8, ["label", "value"]);
|
|
185
|
+
}), 128))
|
|
186
|
+
];
|
|
187
|
+
}),
|
|
188
|
+
_: 2
|
|
189
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "clearable"]),
|
|
190
|
+
r(B, {
|
|
191
|
+
style: { "margin-right": "40px", width: "20%" },
|
|
192
|
+
modelValue: a.value[e.field.addressAreaC],
|
|
193
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressAreaC] = l,
|
|
194
|
+
placeholder: ((f = e.optionsSelectAreaC) == null ? void 0 : f.placeholder) || "请选择",
|
|
195
|
+
clearable: e.clearable
|
|
196
|
+
}, {
|
|
197
|
+
default: n(() => {
|
|
198
|
+
var l;
|
|
199
|
+
return [
|
|
200
|
+
(d(!0), _(C, null, P((l = e.optionsSelectAreaC) == null ? void 0 : l.data, (s) => {
|
|
201
|
+
var v, h, i;
|
|
202
|
+
return d(), u(L, {
|
|
203
|
+
key: s[((v = e.optionsSelectAreaC) == null ? void 0 : v.valueKey) || "value"],
|
|
204
|
+
label: s[((h = e.optionsSelectAreaC) == null ? void 0 : h.labelkey) || "label"],
|
|
205
|
+
value: s[((i = e.optionsSelectAreaC) == null ? void 0 : i.valueKey) || "value"]
|
|
206
|
+
}, null, 8, ["label", "value"]);
|
|
207
|
+
}), 128))
|
|
208
|
+
];
|
|
209
|
+
}),
|
|
210
|
+
_: 2
|
|
211
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "clearable"])
|
|
212
|
+
]),
|
|
213
|
+
r(b, {
|
|
214
|
+
class: "item-address",
|
|
215
|
+
modelValue: a.value[e.field.addressStreet],
|
|
216
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressStreet] = l,
|
|
217
|
+
readonly: e.readonly,
|
|
218
|
+
type: e.type ?? "text",
|
|
219
|
+
placeholder: "输入街道名称和编号",
|
|
220
|
+
disabled: e.disabled,
|
|
221
|
+
showPassword: e.showPassword,
|
|
222
|
+
clearable: e.clearable,
|
|
223
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
224
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
225
|
+
r(b, {
|
|
226
|
+
class: "item-address",
|
|
227
|
+
modelValue: a.value[e.field.addressHouse],
|
|
228
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressHouse] = l,
|
|
229
|
+
readonly: e.readonly,
|
|
230
|
+
type: e.type ?? "text",
|
|
231
|
+
placeholder: "屋院名稱",
|
|
232
|
+
disabled: e.disabled,
|
|
233
|
+
showPassword: e.showPassword,
|
|
234
|
+
clearable: e.clearable,
|
|
235
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
236
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
237
|
+
r(b, {
|
|
238
|
+
class: "item-address",
|
|
239
|
+
modelValue: a.value[e.field.addressMansion],
|
|
240
|
+
"onUpdate:modelValue": (l) => a.value[e.field.addressMansion] = l,
|
|
241
|
+
readonly: e.readonly,
|
|
242
|
+
type: e.type ?? "text",
|
|
243
|
+
placeholder: "大廈名稱",
|
|
244
|
+
disabled: e.disabled,
|
|
245
|
+
showPassword: e.showPassword,
|
|
246
|
+
clearable: e.clearable,
|
|
247
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
248
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
249
|
+
a.value.addressLang == "1" ? (d(), _("div", ye, [
|
|
250
|
+
r(b, {
|
|
251
|
+
style: { width: "24%" },
|
|
252
|
+
modelValue: a.value[e.field.block],
|
|
253
|
+
"onUpdate:modelValue": (l) => a.value[e.field.block] = l,
|
|
254
|
+
readonly: e.readonly,
|
|
255
|
+
type: e.type ?? "text",
|
|
256
|
+
placeholder: "請輸入英文姓",
|
|
257
|
+
disabled: e.disabled,
|
|
258
|
+
showPassword: e.showPassword,
|
|
259
|
+
clearable: e.clearable,
|
|
260
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
261
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
262
|
+
w(" 座 "),
|
|
263
|
+
r(b, {
|
|
264
|
+
style: { width: "24%", "margin-left": "60px" },
|
|
265
|
+
modelValue: a.value[e.field.floor],
|
|
266
|
+
"onUpdate:modelValue": (l) => a.value[e.field.floor] = l,
|
|
267
|
+
readonly: e.readonly,
|
|
268
|
+
type: e.type ?? "text",
|
|
269
|
+
placeholder: "請輸入英文姓",
|
|
270
|
+
disabled: e.disabled,
|
|
271
|
+
showPassword: e.showPassword,
|
|
272
|
+
clearable: e.clearable,
|
|
273
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
274
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
275
|
+
w(" 樓 "),
|
|
276
|
+
r(b, {
|
|
277
|
+
style: { width: "24%", "margin-left": "60px" },
|
|
278
|
+
modelValue: a.value[e.field.flat],
|
|
279
|
+
"onUpdate:modelValue": (l) => a.value[e.field.flat] = l,
|
|
280
|
+
readonly: e.readonly,
|
|
281
|
+
type: e.type ?? "text",
|
|
282
|
+
placeholder: "請輸入英文姓",
|
|
283
|
+
disabled: e.disabled,
|
|
284
|
+
showPassword: e.showPassword,
|
|
285
|
+
clearable: e.clearable,
|
|
286
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
287
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
288
|
+
w(" 室 ")
|
|
289
|
+
])) : E("", !0),
|
|
290
|
+
a.value.addressLang == "2" ? (d(), _("div", be, [
|
|
291
|
+
r(b, {
|
|
292
|
+
style: { width: "24%" },
|
|
293
|
+
modelValue: a.value[e.field.block],
|
|
294
|
+
"onUpdate:modelValue": (l) => a.value[e.field.block] = l,
|
|
295
|
+
readonly: e.readonly,
|
|
296
|
+
type: e.type ?? "text",
|
|
297
|
+
placeholder: "請輸入英文姓",
|
|
298
|
+
disabled: e.disabled,
|
|
299
|
+
showPassword: e.showPassword,
|
|
300
|
+
clearable: e.clearable,
|
|
301
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
302
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
303
|
+
w(" Block "),
|
|
304
|
+
r(b, {
|
|
305
|
+
style: { width: "24%", "margin-left": "60px" },
|
|
306
|
+
modelValue: a.value[e.field.floor],
|
|
307
|
+
"onUpdate:modelValue": (l) => a.value[e.field.floor] = l,
|
|
308
|
+
readonly: e.readonly,
|
|
309
|
+
type: e.type ?? "text",
|
|
310
|
+
placeholder: "請輸入英文姓",
|
|
311
|
+
disabled: e.disabled,
|
|
312
|
+
showPassword: e.showPassword,
|
|
313
|
+
clearable: e.clearable,
|
|
314
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
315
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
316
|
+
w(" Floor "),
|
|
317
|
+
r(b, {
|
|
318
|
+
style: { width: "24%", "margin-left": "60px" },
|
|
319
|
+
modelValue: a.value[e.field.flat],
|
|
320
|
+
"onUpdate:modelValue": (l) => a.value[e.field.flat] = l,
|
|
321
|
+
readonly: e.readonly,
|
|
322
|
+
type: e.type ?? "text",
|
|
323
|
+
placeholder: "請輸入英文姓",
|
|
324
|
+
disabled: e.disabled,
|
|
325
|
+
showPassword: e.showPassword,
|
|
326
|
+
clearable: e.clearable,
|
|
327
|
+
onKeyup: V((l) => y(e.enterable), ["enter"])
|
|
328
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "disabled", "showPassword", "clearable", "onKeyup"]),
|
|
329
|
+
w(" Flat ")
|
|
330
|
+
])) : E("", !0)
|
|
331
|
+
];
|
|
332
|
+
}),
|
|
333
|
+
_: 2
|
|
334
|
+
}, 1032, ["rules", "prop"])) : e.type === "name" ? (d(), u(g, {
|
|
335
|
+
key: 2,
|
|
336
|
+
label: e.label,
|
|
337
|
+
rules: e.rules,
|
|
338
|
+
prop: [e.field.nameEnFamily] && [e.field.nameEn] && [
|
|
339
|
+
e.field.nameCh
|
|
340
|
+
] && [e.field.nameChFamily],
|
|
341
|
+
class: "container"
|
|
342
|
+
}, {
|
|
343
|
+
default: n(() => [
|
|
344
|
+
r(b, {
|
|
345
|
+
class: "item-name",
|
|
346
|
+
modelValue: a.value[e.field.nameEnFamily],
|
|
347
|
+
"onUpdate:modelValue": (o) => a.value[e.field.nameEnFamily] = o,
|
|
348
|
+
readonly: e.readonly,
|
|
349
|
+
type: e.type ?? "text",
|
|
350
|
+
placeholder: e.placeholderNameEnFamily,
|
|
351
|
+
disabled: e.disabled,
|
|
352
|
+
onKeyup: V((o) => y(e.enterable), ["enter"])
|
|
353
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "onKeyup"]),
|
|
354
|
+
r(b, {
|
|
355
|
+
class: "item-name",
|
|
356
|
+
modelValue: a.value[e.field.nameChFamily],
|
|
357
|
+
"onUpdate:modelValue": (o) => a.value[e.field.nameChFamily] = o,
|
|
358
|
+
readonly: e.readonly,
|
|
359
|
+
type: e.type ?? "text",
|
|
360
|
+
placeholder: e.placeholderNameChFamily,
|
|
361
|
+
disabled: e.disabled,
|
|
362
|
+
onKeyup: V((o) => y(e.enterable), ["enter"])
|
|
363
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "onKeyup"]),
|
|
364
|
+
r(b, {
|
|
365
|
+
class: "item-name",
|
|
366
|
+
modelValue: a.value[e.field.nameEn],
|
|
367
|
+
"onUpdate:modelValue": (o) => a.value[e.field.nameEn] = o,
|
|
368
|
+
readonly: e.readonly,
|
|
369
|
+
type: e.type ?? "text",
|
|
370
|
+
placeholder: e.placeholderNameEn,
|
|
371
|
+
disabled: e.disabled,
|
|
372
|
+
onKeyup: V((o) => y(e.enterable), ["enter"])
|
|
373
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "onKeyup"]),
|
|
374
|
+
r(b, {
|
|
375
|
+
class: "item-name",
|
|
376
|
+
modelValue: a.value[e.field.nameCh],
|
|
377
|
+
"onUpdate:modelValue": (o) => a.value[e.field.nameCh] = o,
|
|
378
|
+
readonly: e.readonly,
|
|
379
|
+
type: e.type ?? "text",
|
|
380
|
+
placeholder: e.placeholderNameCh,
|
|
381
|
+
disabled: e.disabled,
|
|
382
|
+
onKeyup: V((o) => y(e.enterable), ["enter"])
|
|
383
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "onKeyup"])
|
|
384
|
+
]),
|
|
385
|
+
_: 2
|
|
386
|
+
}, 1032, ["label", "rules", "prop"])) : e.type === "gender" ? (d(), u(g, {
|
|
387
|
+
key: 3,
|
|
388
|
+
label: e.label,
|
|
389
|
+
rules: e.rules,
|
|
390
|
+
prop: [e.field.radioValue]
|
|
391
|
+
}, {
|
|
392
|
+
default: n(() => [
|
|
393
|
+
r(H, {
|
|
394
|
+
modelValue: a.value[e.field.radioValue],
|
|
395
|
+
"onUpdate:modelValue": (o) => a.value[e.field.radioValue] = o,
|
|
396
|
+
disabled: e.disabled
|
|
136
397
|
}, {
|
|
137
|
-
default:
|
|
138
|
-
var
|
|
398
|
+
default: n(() => {
|
|
399
|
+
var o;
|
|
139
400
|
return [
|
|
140
|
-
(
|
|
141
|
-
var c, f
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
},
|
|
401
|
+
(d(!0), _(C, null, P((o = e.options) == null ? void 0 : o.data, (p) => {
|
|
402
|
+
var c, f;
|
|
403
|
+
return d(), u(M, {
|
|
404
|
+
label: p[((c = e.options) == null ? void 0 : c.valueKey) || "value"],
|
|
405
|
+
size: "large",
|
|
406
|
+
key: p[((f = e.options) == null ? void 0 : f.valueKey) || "value"]
|
|
407
|
+
}, {
|
|
408
|
+
default: n(() => [
|
|
409
|
+
I("img", {
|
|
410
|
+
src: p.label === "男" ? "../../public/man.png" : "../../public/woman.png",
|
|
411
|
+
style: { width: "44px", height: "44px", "margin-right": "4px" },
|
|
412
|
+
alt: ""
|
|
413
|
+
}, null, 8, fe)
|
|
414
|
+
]),
|
|
415
|
+
_: 2
|
|
416
|
+
}, 1032, ["label"]);
|
|
147
417
|
}), 128))
|
|
148
418
|
];
|
|
149
419
|
}),
|
|
150
420
|
_: 2
|
|
151
|
-
}, 1032, ["modelValue", "onUpdate:modelValue", "
|
|
152
|
-
]
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
prop: [e.field]
|
|
160
|
-
}, {
|
|
161
|
-
default: a(() => [
|
|
162
|
-
i(z, {
|
|
163
|
-
modelValue: n.value[e.field],
|
|
164
|
-
"onUpdate:modelValue": (l) => n.value[e.field] = l,
|
|
165
|
-
readonly: e.readonly,
|
|
166
|
-
type: "datetime",
|
|
167
|
-
placeholder: e.placeholder || e.label,
|
|
168
|
-
"default-time": t.defaultTime,
|
|
169
|
-
"value-format": e.format || "YYYY-MM-DD HH:mm:ss"
|
|
170
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "placeholder", "default-time", "value-format"])
|
|
171
|
-
]),
|
|
172
|
-
_: 2
|
|
173
|
-
}, 1032, ["label", "rules", "prop"])) : (o(), r(b, {
|
|
174
|
-
key: 4,
|
|
175
|
-
label: e.label,
|
|
176
|
-
rules: e.rules,
|
|
177
|
-
prop: [e.field]
|
|
178
|
-
}, {
|
|
179
|
-
default: a(() => [
|
|
180
|
-
i(I, {
|
|
181
|
-
modelValue: n.value[e.field],
|
|
182
|
-
"onUpdate:modelValue": (l) => n.value[e.field] = l,
|
|
183
|
-
readonly: e.readonly,
|
|
184
|
-
type: e.type ?? "text",
|
|
185
|
-
placeholder: e.placeholder || e.label,
|
|
186
|
-
disabled: e.disabled,
|
|
187
|
-
showPassword: e.showPassword,
|
|
188
|
-
clearable: e.clearable,
|
|
189
|
-
onKeyup: W((l) => S(e.enterable), ["enter"])
|
|
190
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "showPassword", "clearable", "onKeyup"])
|
|
191
|
-
]),
|
|
192
|
-
_: 2
|
|
193
|
-
}, 1032, ["label", "rules", "prop"]))
|
|
194
|
-
]),
|
|
195
|
-
_: 2
|
|
196
|
-
}, 1024))), 128)),
|
|
197
|
-
i(b, null, {
|
|
198
|
-
default: a(() => [
|
|
199
|
-
X(t.$slots, "buttons", {
|
|
200
|
-
model: n.value,
|
|
201
|
-
formRef: y.value
|
|
202
|
-
}, () => [
|
|
203
|
-
i(U, {
|
|
204
|
-
type: "primary",
|
|
205
|
-
onClick: u[0] || (u[0] = (e) => T(y.value))
|
|
421
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
422
|
+
]),
|
|
423
|
+
_: 2
|
|
424
|
+
}, 1032, ["label", "rules", "prop"])) : e.type === "radio" ? (d(), u(g, {
|
|
425
|
+
key: 4,
|
|
426
|
+
label: e.label,
|
|
427
|
+
rules: e.rules,
|
|
428
|
+
prop: [e.field.radioValue]
|
|
206
429
|
}, {
|
|
207
|
-
default:
|
|
208
|
-
|
|
430
|
+
default: n(() => [
|
|
431
|
+
r(H, {
|
|
432
|
+
modelValue: a.value[e.field.radioValue],
|
|
433
|
+
"onUpdate:modelValue": (o) => a.value[e.field.radioValue] = o,
|
|
434
|
+
disabled: e.disabled
|
|
435
|
+
}, {
|
|
436
|
+
default: n(() => {
|
|
437
|
+
var o;
|
|
438
|
+
return [
|
|
439
|
+
(d(!0), _(C, null, P((o = e.options) == null ? void 0 : o.data, (p) => {
|
|
440
|
+
var c, f;
|
|
441
|
+
return d(), u(M, {
|
|
442
|
+
label: p[((c = e.options) == null ? void 0 : c.valueKey) || "value"],
|
|
443
|
+
size: "large",
|
|
444
|
+
key: p[((f = e.options) == null ? void 0 : f.valueKey) || "value"]
|
|
445
|
+
}, {
|
|
446
|
+
default: n(() => {
|
|
447
|
+
var l;
|
|
448
|
+
return [
|
|
449
|
+
w(N(p[((l = e.options) == null ? void 0 : l.labelkey) || "label"]), 1)
|
|
450
|
+
];
|
|
451
|
+
}),
|
|
452
|
+
_: 2
|
|
453
|
+
}, 1032, ["label"]);
|
|
454
|
+
}), 128))
|
|
455
|
+
];
|
|
456
|
+
}),
|
|
457
|
+
_: 2
|
|
458
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
|
|
209
459
|
]),
|
|
210
|
-
_:
|
|
211
|
-
}),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
460
|
+
_: 2
|
|
461
|
+
}, 1032, ["label", "rules", "prop"])) : e.type === "checkbox" ? (d(), u(g, {
|
|
462
|
+
key: 5,
|
|
463
|
+
label: e.label,
|
|
464
|
+
rules: e.rules,
|
|
465
|
+
prop: [e.field.checkboxValue]
|
|
216
466
|
}, {
|
|
217
|
-
default:
|
|
218
|
-
|
|
467
|
+
default: n(() => [
|
|
468
|
+
r(q, {
|
|
469
|
+
modelValue: a.value[e.field.checkboxValue],
|
|
470
|
+
"onUpdate:modelValue": (o) => a.value[e.field.checkboxValue] = o,
|
|
471
|
+
disabled: e.disabled,
|
|
472
|
+
style: oe(
|
|
473
|
+
e.ways === "row" ? "display: flex; align-items: flex-start;flex-flow: row nowrap; " : "display: flex; align-items: flex-start;flex-flow: column nowrap; "
|
|
474
|
+
)
|
|
475
|
+
}, {
|
|
476
|
+
default: n(() => {
|
|
477
|
+
var o;
|
|
478
|
+
return [
|
|
479
|
+
(d(!0), _(C, null, P((o = e.options) == null ? void 0 : o.data, (p) => {
|
|
480
|
+
var c, f;
|
|
481
|
+
return d(), u(j, {
|
|
482
|
+
key: p[((c = e.options) == null ? void 0 : c.valueKey) || "value"],
|
|
483
|
+
label: p[((f = e.options) == null ? void 0 : f.valueKey) || "value"]
|
|
484
|
+
}, {
|
|
485
|
+
default: n(() => {
|
|
486
|
+
var l;
|
|
487
|
+
return [
|
|
488
|
+
w(N(p[((l = e.options) == null ? void 0 : l.labelkey) || "label"]), 1)
|
|
489
|
+
];
|
|
490
|
+
}),
|
|
491
|
+
_: 2
|
|
492
|
+
}, 1032, ["label"]);
|
|
493
|
+
}), 128))
|
|
494
|
+
];
|
|
495
|
+
}),
|
|
496
|
+
_: 2
|
|
497
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "disabled", "style"])
|
|
219
498
|
]),
|
|
220
|
-
_:
|
|
221
|
-
})) :
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
499
|
+
_: 2
|
|
500
|
+
}, 1032, ["label", "rules", "prop"])) : e.type === "select" ? (d(), u(g, {
|
|
501
|
+
key: 6,
|
|
502
|
+
label: e.label,
|
|
503
|
+
rules: e.rules,
|
|
504
|
+
prop: [e.field.selectValue]
|
|
225
505
|
}, {
|
|
226
|
-
default:
|
|
227
|
-
|
|
506
|
+
default: n(() => {
|
|
507
|
+
var o;
|
|
508
|
+
return [
|
|
509
|
+
r(B, {
|
|
510
|
+
modelValue: a.value[e.field.selectValue],
|
|
511
|
+
"onUpdate:modelValue": (p) => a.value[e.field.selectValue] = p,
|
|
512
|
+
placeholder: ((o = e.options) == null ? void 0 : o.placeholder) || "请选择",
|
|
513
|
+
clearable: e.clearable
|
|
514
|
+
}, {
|
|
515
|
+
default: n(() => {
|
|
516
|
+
var p;
|
|
517
|
+
return [
|
|
518
|
+
(d(!0), _(C, null, P((p = e.options) == null ? void 0 : p.data, (c) => {
|
|
519
|
+
var f, l, s;
|
|
520
|
+
return d(), u(L, {
|
|
521
|
+
key: c[((f = e.options) == null ? void 0 : f.valueKey) || "value"],
|
|
522
|
+
label: c[((l = e.options) == null ? void 0 : l.labelkey) || "label"],
|
|
523
|
+
value: c[((s = e.options) == null ? void 0 : s.valueKey) || "value"]
|
|
524
|
+
}, null, 8, ["label", "value"]);
|
|
525
|
+
}), 128))
|
|
526
|
+
];
|
|
527
|
+
}),
|
|
528
|
+
_: 2
|
|
529
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "placeholder", "clearable"])
|
|
530
|
+
];
|
|
531
|
+
}),
|
|
532
|
+
_: 2
|
|
533
|
+
}, 1032, ["label", "rules", "prop"])) : e.type === "datetime" ? (d(), u(g, {
|
|
534
|
+
key: 7,
|
|
535
|
+
label: e.label,
|
|
536
|
+
rules: e.rules,
|
|
537
|
+
prop: [e.field.date]
|
|
538
|
+
}, {
|
|
539
|
+
default: n(() => [
|
|
540
|
+
r(G, {
|
|
541
|
+
modelValue: a.value[e.field],
|
|
542
|
+
"onUpdate:modelValue": (o) => a.value[e.field] = o,
|
|
543
|
+
readonly: e.readonly,
|
|
544
|
+
type: "datetime",
|
|
545
|
+
placeholder: e.placeholder || e.label,
|
|
546
|
+
"default-time": t.defaultTime,
|
|
547
|
+
"value-format": e.format || "YYYY-MM-DD HH:mm:ss"
|
|
548
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "placeholder", "default-time", "value-format"])
|
|
549
|
+
]),
|
|
550
|
+
_: 2
|
|
551
|
+
}, 1032, ["label", "rules", "prop"])) : (d(), u(g, {
|
|
552
|
+
key: 8,
|
|
553
|
+
label: e.label,
|
|
554
|
+
rules: e.rules,
|
|
555
|
+
prop: [e.field]
|
|
556
|
+
}, {
|
|
557
|
+
default: n(() => [
|
|
558
|
+
r(b, {
|
|
559
|
+
modelValue: a.value[e.field],
|
|
560
|
+
"onUpdate:modelValue": (o) => a.value[e.field] = o,
|
|
561
|
+
readonly: e.readonly,
|
|
562
|
+
type: e.type ?? "text",
|
|
563
|
+
placeholder: e.placeholder || e.label,
|
|
564
|
+
disabled: e.disabled,
|
|
565
|
+
showPassword: e.showPassword,
|
|
566
|
+
clearable: e.clearable,
|
|
567
|
+
onKeyup: V((o) => y(e.enterable), ["enter"])
|
|
568
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "readonly", "type", "placeholder", "disabled", "showPassword", "clearable", "onKeyup"])
|
|
228
569
|
]),
|
|
229
|
-
_:
|
|
230
|
-
}
|
|
231
|
-
])
|
|
570
|
+
_: 2
|
|
571
|
+
}, 1032, ["label", "rules", "prop"]))
|
|
572
|
+
], 2))), 128)),
|
|
573
|
+
r(g, null, {
|
|
574
|
+
default: n(() => [
|
|
575
|
+
de(t.$slots, "buttons", {
|
|
576
|
+
model: a.value,
|
|
577
|
+
formRef: A.value
|
|
578
|
+
}, () => [
|
|
579
|
+
$(S).showButtonText ? (d(), u(z, {
|
|
580
|
+
key: 0,
|
|
581
|
+
type: "primary",
|
|
582
|
+
onClick: k[0] || (k[0] = (e) => Y(A.value))
|
|
583
|
+
}, {
|
|
584
|
+
default: n(() => [
|
|
585
|
+
w(N($(S).submitButtonText), 1)
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
})) : E("", !0),
|
|
589
|
+
$(S).showResetButton ? (d(), u(z, {
|
|
590
|
+
key: 1,
|
|
591
|
+
type: "info",
|
|
592
|
+
onClick: k[1] || (k[1] = (e) => O(A.value))
|
|
593
|
+
}, {
|
|
594
|
+
default: n(() => [
|
|
595
|
+
w(N($(S).resetButtonText), 1)
|
|
596
|
+
]),
|
|
597
|
+
_: 1
|
|
598
|
+
})) : E("", !0),
|
|
599
|
+
$(S).showCancelButton ? (d(), u(z, {
|
|
600
|
+
key: 2,
|
|
601
|
+
onClick: k[2] || (k[2] = (e) => F("cancel"))
|
|
602
|
+
}, {
|
|
603
|
+
default: n(() => [
|
|
604
|
+
w(N($(S).cancelButtonText), 1)
|
|
605
|
+
]),
|
|
606
|
+
_: 1
|
|
607
|
+
})) : E("", !0)
|
|
608
|
+
], !0)
|
|
609
|
+
]),
|
|
610
|
+
_: 3
|
|
611
|
+
})
|
|
232
612
|
]),
|
|
233
613
|
_: 3
|
|
234
|
-
})
|
|
614
|
+
}, 16, ["model", "label-position"])
|
|
235
615
|
]),
|
|
236
616
|
_: 3
|
|
237
|
-
}
|
|
617
|
+
});
|
|
238
618
|
};
|
|
239
619
|
}
|
|
240
620
|
});
|
|
241
|
-
|
|
242
|
-
|
|
621
|
+
const he = (U, T) => {
|
|
622
|
+
const F = U.__vccOpts || U;
|
|
623
|
+
for (const [K, a] of T)
|
|
624
|
+
F[K] = a;
|
|
625
|
+
return F;
|
|
626
|
+
}, m = /* @__PURE__ */ he(ve, [["__scopeId", "data-v-999098b8"]]);
|
|
627
|
+
function R(U, T = {}) {
|
|
628
|
+
R.installed || (R.installed = !0, U.component("common-form", m));
|
|
243
629
|
}
|
|
244
|
-
|
|
630
|
+
m.install = R;
|
|
245
631
|
export {
|
|
246
|
-
|
|
632
|
+
m as default
|
|
247
633
|
};
|
package/common-form.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,c){typeof exports=="object"&&typeof module<"u"?module.exports=c(require("vue")):typeof define=="function"&&define.amd?define(["vue"],c):(e=typeof globalThis<"u"?globalThis:e||self,e.Form=c(e.Vue))})(this,function(e){"use strict";const c=e.defineComponent({__name:"Index",props:{fieldList:null,model:null,options:null},emits:["submit","reset","cancel"],setup(k,{expose:m,emit:B}){const f=k,t=e.ref({}),u=e.ref(),b=e.computed(()=>Object.assign({labelPosition:"right",disabled:!1,submitButtonText:"提交",resetButtonText:"重置",cancelButtonText:"取消"},f==null?void 0:f.options));m({formRef:u}),f.fieldList.map(n=>{const a=n.type==="checkbox"?[]:"";f.model?t.value=f.model:t.value[n.field]=n.value||a});const h=n=>{n&&n.validate(a=>{if(a)B("submit",t.value);else return!1})},V=n=>{n&&h(u.value)},C=n=>{n&&n.resetFields()};return(n,a)=>{const w=e.resolveComponent("el-radio"),g=e.resolveComponent("el-radio-group"),i=e.resolveComponent("el-form-item"),N=e.resolveComponent("el-checkbox"),T=e.resolveComponent("el-checkbox-group"),U=e.resolveComponent("el-option"),K=e.resolveComponent("el-select"),S=e.resolveComponent("el-date-picker"),D=e.resolveComponent("el-input"),_=e.resolveComponent("el-button"),F=e.resolveComponent("el-form");return e.openBlock(),e.createBlock(F,e.mergeProps({onSubmit:a[3]||(a[3]=e.withModifiers(()=>{},["prevent"])),model:t.value},e.unref(b),{ref_key:"formRef",ref:u}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.fieldList,(l,L)=>(e.openBlock(),e.createBlock(i,{key:L},{default:e.withCtx(()=>[l.type==="radio"?(e.openBlock(),e.createBlock(i,{key:0,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>[e.createVNode(g,{modelValue:t.value[l.field],"onUpdate:modelValue":o=>t.value[l.field]=o,disabled:l.disabled},{default:e.withCtx(()=>{var o;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((o=l.options)==null?void 0:o.data,r=>{var d,s;return e.openBlock(),e.createBlock(w,{label:r[((d=l.options)==null?void 0:d.valueKey)||"value"],size:"large",key:r[((s=l.options)==null?void 0:s.valueKey)||"value"]},{default:e.withCtx(()=>{var p;return[e.createTextVNode(e.toDisplayString(r[((p=l.options)==null?void 0:p.labelkey)||"label"]),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["label","rules","prop"])):l.type==="checkbox"?(e.openBlock(),e.createBlock(i,{key:1,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>[e.createVNode(T,{modelValue:t.value[l.field],"onUpdate:modelValue":o=>t.value[l.field]=o,disabled:l.disabled},{default:e.withCtx(()=>{var o;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((o=l.options)==null?void 0:o.data,r=>{var d,s;return e.openBlock(),e.createBlock(N,{key:r[((d=l.options)==null?void 0:d.valueKey)||"value"],label:r[((s=l.options)==null?void 0:s.valueKey)||"value"]},{default:e.withCtx(()=>{var p;return[e.createTextVNode(e.toDisplayString(r[((p=l.options)==null?void 0:p.labelkey)||"label"]),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["label","rules","prop"])):l.type==="select"?(e.openBlock(),e.createBlock(i,{key:2,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>{var o;return[e.createVNode(K,{modelValue:t.value[l.field],"onUpdate:modelValue":r=>t.value[l.field]=r,placeholder:((o=l.options)==null?void 0:o.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var r;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((r=l.options)==null?void 0:r.data,d=>{var s,p,x;return e.openBlock(),e.createBlock(U,{key:d[((s=l.options)==null?void 0:s.valueKey)||"value"],label:d[((p=l.options)==null?void 0:p.labelkey)||"label"],value:d[((x=l.options)==null?void 0:x.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"])]}),_:2},1032,["label","rules","prop"])):l.type==="datetime"?(e.openBlock(),e.createBlock(i,{key:3,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>[e.createVNode(S,{modelValue:t.value[l.field],"onUpdate:modelValue":o=>t.value[l.field]=o,readonly:l.readonly,type:"datetime",placeholder:l.placeholder||l.label,"default-time":n.defaultTime,"value-format":l.format||"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue","readonly","placeholder","default-time","value-format"])]),_:2},1032,["label","rules","prop"])):(e.openBlock(),e.createBlock(i,{key:4,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>[e.createVNode(D,{modelValue:t.value[l.field],"onUpdate:modelValue":o=>t.value[l.field]=o,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholder||l.label,disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(o=>V(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","showPassword","clearable","onKeyup"])]),_:2},1032,["label","rules","prop"]))]),_:2},1024))),128)),e.createVNode(i,null,{default:e.withCtx(()=>[e.renderSlot(n.$slots,"buttons",{model:t.value,formRef:u.value},()=>[e.createVNode(_,{type:"primary",onClick:a[0]||(a[0]=l=>h(u.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).submitButtonText),1)]),_:1}),e.unref(b).showResetButton?(e.openBlock(),e.createBlock(_,{key:0,type:"info",onClick:a[1]||(a[1]=l=>C(u.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).resetButtonText),1)]),_:1})):e.createCommentVNode("",!0),e.unref(b).showCancelButton?(e.openBlock(),e.createBlock(_,{key:1,onClick:a[2]||(a[2]=l=>B("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(b).cancelButtonText),1)]),_:1})):e.createCommentVNode("",!0)])]),_:3})]),_:3},16,["model"])}}});function y(k,m={}){y.installed||(y.installed=!0,k.component("common-el-form",c))}return c.install=y,c});
|
|
1
|
+
(function(e,x){typeof exports=="object"&&typeof module<"u"?module.exports=x(require("vue")):typeof define=="function"&&define.amd?define(["vue"],x):(e=typeof globalThis<"u"?globalThis:e||self,e.Form=x(e.Vue))})(this,function(e){"use strict";const x=h=>(e.pushScopeId("data-v-999098b8"),h=h(),e.popScopeId(),h),F={class:"header-title"},L=x(()=>e.createElementVNode("span",{class:"title-left"},null,-1)),T={class:"title-content"},$={class:"item-address"},A={key:0,class:"item-address"},D={key:1,class:"item-address"},I=["src"],z=e.defineComponent({__name:"Index",props:{fieldList:null,model:null,options:null},emits:["submit","reset","cancel"],setup(h,{expose:K,emit:B}){const V=h,o=e.ref({}),_=e.ref(),k=e.computed(()=>Object.assign({labelPosition:"top",disabled:!1},V==null?void 0:V.options));console.log(V==null?void 0:V.options,"_oppppppppppp0ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp",k),K({formRef:_}),V.fieldList.map(r=>{const f=r.type==="checkbox"?[]:"";V.model?o.value=V.model:o.value[r.field]=r.value||f});const E=r=>{r&&r.validate(f=>{if(f)B("submit",o.value);else return!1})},p=r=>{r&&E(_.value)},M=r=>{r&&r.resetFields()};return(r,f)=>{const w=e.resolveComponent("el-form-item"),N=e.resolveComponent("el-button"),S=e.resolveComponent("el-radio"),P=e.resolveComponent("el-radio-group"),C=e.resolveComponent("el-option"),g=e.resolveComponent("el-select"),c=e.resolveComponent("el-input"),H=e.resolveComponent("el-checkbox"),R=e.resolveComponent("el-checkbox-group"),Y=e.resolveComponent("el-date-picker"),j=e.resolveComponent("el-form"),O=e.resolveComponent("el-card");return e.openBlock(),e.createBlock(O,{class:"mb-5"},{default:e.withCtx(()=>[e.createVNode(j,e.mergeProps({onSubmit:f[3]||(f[3]=e.withModifiers(()=>{},["prevent"])),model:o.value},e.unref(k),{"label-position":e.unref(k).labelPosition,ref_key:"formRef",ref:_}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.fieldList,(l,q)=>(e.openBlock(),e.createElementBlock("div",{key:q,class:e.normalizeClass(l.type==="title"||l.type==="address"?"form-item-title":"form-item")},[l.type==="title"?(e.openBlock(),e.createBlock(w,{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",F,[L,e.createElementVNode("span",T,e.toDisplayString(l.title),1)])]),_:2},1024)):l.type==="address"?(e.openBlock(),e.createBlock(w,{key:1,rules:l.rules,prop:[l.field],class:"container-address"},{default:e.withCtx(()=>{var d,n,s,y;return[e.createVNode(N,{style:{"margin-bottom":"20px","margin-right":"60px"},onClick:r.downLoad},{default:e.withCtx(()=>[e.createTextVNode(" 載入已有地址 ")]),_:1},8,["onClick"]),e.createVNode(P,{style:{"margin-bottom":"20px"},modelValue:o.value[l.field.addressLang],"onUpdate:modelValue":a=>o.value[l.field.addressLang]=a,disabled:l.disabled},{default:e.withCtx(()=>{var a;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=l.optionsLang)==null?void 0:a.data,t=>{var b,u;return e.openBlock(),e.createBlock(S,{label:t[((b=l.optionsLang)==null?void 0:b.valueKey)||"value"],size:"large",key:t[((u=l.optionsLang)==null?void 0:u.valueKey)||"value"]},{default:e.withCtx(()=>{var i;return[e.createTextVNode(e.toDisplayString(t[((i=l.optionsLang)==null?void 0:i.labelkey)||"label"]),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",$,[e.createVNode(g,{style:{"margin-right":"40px",width:"20%"},modelValue:o.value[l.field.addressNation],"onUpdate:modelValue":a=>o.value[l.field.addressNation]=a,placeholder:((d=l.optionsSelectNation)==null?void 0:d.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var a;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=l.optionsSelectNation)==null?void 0:a.data,t=>{var b,u,i;return e.openBlock(),e.createBlock(C,{key:t[((b=l.optionsSelectNation)==null?void 0:b.valueKey)||"value"],label:t[((u=l.optionsSelectNation)==null?void 0:u.labelkey)||"label"],value:t[((i=l.optionsSelectNation)==null?void 0:i.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"]),e.createVNode(g,{style:{"margin-right":"40px",width:"20%"},modelValue:o.value[l.field.addressCity],"onUpdate:modelValue":a=>o.value[l.field.addressCity]=a,placeholder:((n=l.optionsSelectCity)==null?void 0:n.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var a;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=l.optionsSelectCity)==null?void 0:a.data,t=>{var b,u,i;return e.openBlock(),e.createBlock(C,{key:t[((b=l.optionsSelectCity)==null?void 0:b.valueKey)||"value"],label:t[((u=l.optionsSelectCity)==null?void 0:u.labelkey)||"label"],value:t[((i=l.optionsSelectCity)==null?void 0:i.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"]),e.createVNode(g,{style:{"margin-right":"40px",width:"20%"},modelValue:o.value[l.field.addressArea],"onUpdate:modelValue":a=>o.value[l.field.addressArea]=a,placeholder:((s=l.optionsSelectArea)==null?void 0:s.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var a;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=l.optionsSelectArea)==null?void 0:a.data,t=>{var b,u,i;return e.openBlock(),e.createBlock(C,{key:t[((b=l.optionsSelectArea)==null?void 0:b.valueKey)||"value"],label:t[((u=l.optionsSelectArea)==null?void 0:u.labelkey)||"label"],value:t[((i=l.optionsSelectArea)==null?void 0:i.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"]),e.createVNode(g,{style:{"margin-right":"40px",width:"20%"},modelValue:o.value[l.field.addressAreaC],"onUpdate:modelValue":a=>o.value[l.field.addressAreaC]=a,placeholder:((y=l.optionsSelectAreaC)==null?void 0:y.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var a;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((a=l.optionsSelectAreaC)==null?void 0:a.data,t=>{var b,u,i;return e.openBlock(),e.createBlock(C,{key:t[((b=l.optionsSelectAreaC)==null?void 0:b.valueKey)||"value"],label:t[((u=l.optionsSelectAreaC)==null?void 0:u.labelkey)||"label"],value:t[((i=l.optionsSelectAreaC)==null?void 0:i.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"])]),e.createVNode(c,{class:"item-address",modelValue:o.value[l.field.addressStreet],"onUpdate:modelValue":a=>o.value[l.field.addressStreet]=a,readonly:l.readonly,type:l.type??"text",placeholder:"输入街道名称和编号",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createVNode(c,{class:"item-address",modelValue:o.value[l.field.addressHouse],"onUpdate:modelValue":a=>o.value[l.field.addressHouse]=a,readonly:l.readonly,type:l.type??"text",placeholder:"屋院名稱",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createVNode(c,{class:"item-address",modelValue:o.value[l.field.addressMansion],"onUpdate:modelValue":a=>o.value[l.field.addressMansion]=a,readonly:l.readonly,type:l.type??"text",placeholder:"大廈名稱",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),o.value.addressLang=="1"?(e.openBlock(),e.createElementBlock("div",A,[e.createVNode(c,{style:{width:"24%"},modelValue:o.value[l.field.block],"onUpdate:modelValue":a=>o.value[l.field.block]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" 座 "),e.createVNode(c,{style:{width:"24%","margin-left":"60px"},modelValue:o.value[l.field.floor],"onUpdate:modelValue":a=>o.value[l.field.floor]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" 樓 "),e.createVNode(c,{style:{width:"24%","margin-left":"60px"},modelValue:o.value[l.field.flat],"onUpdate:modelValue":a=>o.value[l.field.flat]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" 室 ")])):e.createCommentVNode("",!0),o.value.addressLang=="2"?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(c,{style:{width:"24%"},modelValue:o.value[l.field.block],"onUpdate:modelValue":a=>o.value[l.field.block]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" Block "),e.createVNode(c,{style:{width:"24%","margin-left":"60px"},modelValue:o.value[l.field.floor],"onUpdate:modelValue":a=>o.value[l.field.floor]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" Floor "),e.createVNode(c,{style:{width:"24%","margin-left":"60px"},modelValue:o.value[l.field.flat],"onUpdate:modelValue":a=>o.value[l.field.flat]=a,readonly:l.readonly,type:l.type??"text",placeholder:"請輸入英文姓",disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(a=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","disabled","showPassword","clearable","onKeyup"]),e.createTextVNode(" Flat ")])):e.createCommentVNode("",!0)]}),_:2},1032,["rules","prop"])):l.type==="name"?(e.openBlock(),e.createBlock(w,{key:2,label:l.label,rules:l.rules,prop:[l.field.nameEnFamily]&&[l.field.nameEn]&&[l.field.nameCh]&&[l.field.nameChFamily],class:"container"},{default:e.withCtx(()=>[e.createVNode(c,{class:"item-name",modelValue:o.value[l.field.nameEnFamily],"onUpdate:modelValue":d=>o.value[l.field.nameEnFamily]=d,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholderNameEnFamily,disabled:l.disabled,onKeyup:e.withKeys(d=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","onKeyup"]),e.createVNode(c,{class:"item-name",modelValue:o.value[l.field.nameChFamily],"onUpdate:modelValue":d=>o.value[l.field.nameChFamily]=d,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholderNameChFamily,disabled:l.disabled,onKeyup:e.withKeys(d=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","onKeyup"]),e.createVNode(c,{class:"item-name",modelValue:o.value[l.field.nameEn],"onUpdate:modelValue":d=>o.value[l.field.nameEn]=d,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholderNameEn,disabled:l.disabled,onKeyup:e.withKeys(d=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","onKeyup"]),e.createVNode(c,{class:"item-name",modelValue:o.value[l.field.nameCh],"onUpdate:modelValue":d=>o.value[l.field.nameCh]=d,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholderNameCh,disabled:l.disabled,onKeyup:e.withKeys(d=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","onKeyup"])]),_:2},1032,["label","rules","prop"])):l.type==="gender"?(e.openBlock(),e.createBlock(w,{key:3,label:l.label,rules:l.rules,prop:[l.field.radioValue]},{default:e.withCtx(()=>[e.createVNode(P,{modelValue:o.value[l.field.radioValue],"onUpdate:modelValue":d=>o.value[l.field.radioValue]=d,disabled:l.disabled},{default:e.withCtx(()=>{var d;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((d=l.options)==null?void 0:d.data,n=>{var s,y;return e.openBlock(),e.createBlock(S,{label:n[((s=l.options)==null?void 0:s.valueKey)||"value"],size:"large",key:n[((y=l.options)==null?void 0:y.valueKey)||"value"]},{default:e.withCtx(()=>[e.createElementVNode("img",{src:n.label==="男"?"../../public/man.png":"../../public/woman.png",style:{width:"44px",height:"44px","margin-right":"4px"},alt:""},null,8,I)]),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["label","rules","prop"])):l.type==="radio"?(e.openBlock(),e.createBlock(w,{key:4,label:l.label,rules:l.rules,prop:[l.field.radioValue]},{default:e.withCtx(()=>[e.createVNode(P,{modelValue:o.value[l.field.radioValue],"onUpdate:modelValue":d=>o.value[l.field.radioValue]=d,disabled:l.disabled},{default:e.withCtx(()=>{var d;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((d=l.options)==null?void 0:d.data,n=>{var s,y;return e.openBlock(),e.createBlock(S,{label:n[((s=l.options)==null?void 0:s.valueKey)||"value"],size:"large",key:n[((y=l.options)==null?void 0:y.valueKey)||"value"]},{default:e.withCtx(()=>{var a;return[e.createTextVNode(e.toDisplayString(n[((a=l.options)==null?void 0:a.labelkey)||"label"]),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])]),_:2},1032,["label","rules","prop"])):l.type==="checkbox"?(e.openBlock(),e.createBlock(w,{key:5,label:l.label,rules:l.rules,prop:[l.field.checkboxValue]},{default:e.withCtx(()=>[e.createVNode(R,{modelValue:o.value[l.field.checkboxValue],"onUpdate:modelValue":d=>o.value[l.field.checkboxValue]=d,disabled:l.disabled,style:e.normalizeStyle(l.ways==="row"?"display: flex; align-items: flex-start;flex-flow: row nowrap; ":"display: flex; align-items: flex-start;flex-flow: column nowrap; ")},{default:e.withCtx(()=>{var d;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((d=l.options)==null?void 0:d.data,n=>{var s,y;return e.openBlock(),e.createBlock(H,{key:n[((s=l.options)==null?void 0:s.valueKey)||"value"],label:n[((y=l.options)==null?void 0:y.valueKey)||"value"]},{default:e.withCtx(()=>{var a;return[e.createTextVNode(e.toDisplayString(n[((a=l.options)==null?void 0:a.labelkey)||"label"]),1)]}),_:2},1032,["label"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","disabled","style"])]),_:2},1032,["label","rules","prop"])):l.type==="select"?(e.openBlock(),e.createBlock(w,{key:6,label:l.label,rules:l.rules,prop:[l.field.selectValue]},{default:e.withCtx(()=>{var d;return[e.createVNode(g,{modelValue:o.value[l.field.selectValue],"onUpdate:modelValue":n=>o.value[l.field.selectValue]=n,placeholder:((d=l.options)==null?void 0:d.placeholder)||"请选择",clearable:l.clearable},{default:e.withCtx(()=>{var n;return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((n=l.options)==null?void 0:n.data,s=>{var y,a,t;return e.openBlock(),e.createBlock(C,{key:s[((y=l.options)==null?void 0:y.valueKey)||"value"],label:s[((a=l.options)==null?void 0:a.labelkey)||"label"],value:s[((t=l.options)==null?void 0:t.valueKey)||"value"]},null,8,["label","value"])}),128))]}),_:2},1032,["modelValue","onUpdate:modelValue","placeholder","clearable"])]}),_:2},1032,["label","rules","prop"])):l.type==="datetime"?(e.openBlock(),e.createBlock(w,{key:7,label:l.label,rules:l.rules,prop:[l.field.date]},{default:e.withCtx(()=>[e.createVNode(Y,{modelValue:o.value[l.field],"onUpdate:modelValue":d=>o.value[l.field]=d,readonly:l.readonly,type:"datetime",placeholder:l.placeholder||l.label,"default-time":r.defaultTime,"value-format":l.format||"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue","readonly","placeholder","default-time","value-format"])]),_:2},1032,["label","rules","prop"])):(e.openBlock(),e.createBlock(w,{key:8,label:l.label,rules:l.rules,prop:[l.field]},{default:e.withCtx(()=>[e.createVNode(c,{modelValue:o.value[l.field],"onUpdate:modelValue":d=>o.value[l.field]=d,readonly:l.readonly,type:l.type??"text",placeholder:l.placeholder||l.label,disabled:l.disabled,showPassword:l.showPassword,clearable:l.clearable,onKeyup:e.withKeys(d=>p(l.enterable),["enter"])},null,8,["modelValue","onUpdate:modelValue","readonly","type","placeholder","disabled","showPassword","clearable","onKeyup"])]),_:2},1032,["label","rules","prop"]))],2))),128)),e.createVNode(w,null,{default:e.withCtx(()=>[e.renderSlot(r.$slots,"buttons",{model:o.value,formRef:_.value},()=>[e.unref(k).showButtonText?(e.openBlock(),e.createBlock(N,{key:0,type:"primary",onClick:f[0]||(f[0]=l=>E(_.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).submitButtonText),1)]),_:1})):e.createCommentVNode("",!0),e.unref(k).showResetButton?(e.openBlock(),e.createBlock(N,{key:1,type:"info",onClick:f[1]||(f[1]=l=>M(_.value))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).resetButtonText),1)]),_:1})):e.createCommentVNode("",!0),e.unref(k).showCancelButton?(e.openBlock(),e.createBlock(N,{key:2,onClick:f[2]||(f[2]=l=>B("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(k).cancelButtonText),1)]),_:1})):e.createCommentVNode("",!0)],!0)]),_:3})]),_:3},16,["model","label-position"])]),_:3})}}}),G="",U=((h,K)=>{const B=h.__vccOpts||h;for(const[V,o]of K)B[V]=o;return B})(z,[["__scopeId","data-v-999098b8"]]);function m(h,K={}){m.installed||(m.installed=!0,h.component("common-form",U))}return U.install=m,U});
|
package/download.png
ADDED
|
Binary file
|
package/man.png
ADDED
|
Binary file
|
package/package.json
CHANGED
package/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.form-item[data-v-999098b8]{width:50%;display:inline-block;padding-right:100px;box-sizing:border-box}.form-item-title[data-v-999098b8]{width:100%}.container[data-v-999098b8]{padding:10px}.item-name[data-v-999098b8]{width:50%;padding-right:10px;padding-bottom:20px;box-sizing:border-box}.container-address[data-v-999098b8]{display:flex;padding:10px}.item-address[data-v-999098b8]{width:100%;padding-right:10px;padding-bottom:20px;box-sizing:border-box}label[data-v-999098b8]{display:block}.title-left[data-v-999098b8]{border:2px solid #216fed;border-radius:2px;width:0px;height:18px;margin-right:8px}.title-content[data-v-999098b8]{font-size:16px;font-family:PingFangSC-Semibold,PingFang SC;font-weight:600;color:#2c3c4d;line-height:22px}
|
package/woman.png
ADDED
|
Binary file
|