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 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 A, ref as $, computed as G, resolveComponent as s, openBlock as o, createBlock as r, mergeProps as J, withModifiers as Q, unref as k, withCtx as a, createElementBlock as x, Fragment as w, renderList as B, createVNode as i, createTextVNode as V, toDisplayString as m, withKeys as W, renderSlot as X, createCommentVNode as L } from "vue";
2
- const R = /* @__PURE__ */ A({
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(h, { expose: K, emit: C }) {
11
- const _ = h, n = $({}), y = $(), v = G(() => Object.assign({
12
- labelPosition: "right",
13
- disabled: !1,
14
- submitButtonText: "提交",
15
- resetButtonText: "重置",
16
- cancelButtonText: "取消"
17
- }, _ == null ? void 0 : _.options));
18
- K({
19
- formRef: y
20
- }), _.fieldList.map((t) => {
21
- const u = t.type === "checkbox" ? [] : "";
22
- _.model ? n.value = _.model : n.value[t.field] = t.value || u;
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 T = (t) => {
25
- t && t.validate((u) => {
26
- if (u)
27
- C("submit", n.value);
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
- }, S = (t) => {
32
- t && T(y.value);
33
- }, Y = (t) => {
43
+ }, y = (t) => {
44
+ t && Y(A.value);
45
+ }, O = (t) => {
34
46
  t && t.resetFields();
35
47
  };
36
- return (t, u) => {
37
- const D = s("el-radio"), F = s("el-radio-group"), b = s("el-form-item"), M = s("el-checkbox"), N = s("el-checkbox-group"), H = s("el-option"), j = s("el-select"), z = s("el-date-picker"), I = s("el-input"), U = s("el-button"), O = s("el-form");
38
- return o(), r(O, J({
39
- onSubmit: u[3] || (u[3] = Q(() => {
40
- }, ["prevent"])),
41
- model: n.value
42
- }, k(v), {
43
- ref_key: "formRef",
44
- ref: y
45
- }), {
46
- default: a(() => [
47
- (o(!0), x(w, null, B(h.fieldList, (e, q) => (o(), r(b, { key: q }, {
48
- default: a(() => [
49
- e.type === "radio" ? (o(), r(b, {
50
- key: 0,
51
- label: e.label,
52
- rules: e.rules,
53
- prop: [e.field]
54
- }, {
55
- default: a(() => [
56
- i(F, {
57
- modelValue: n.value[e.field],
58
- "onUpdate:modelValue": (l) => n.value[e.field] = l,
59
- disabled: e.disabled
60
- }, {
61
- default: a(() => {
62
- var l;
63
- return [
64
- (o(!0), x(w, null, B((l = e.options) == null ? void 0 : l.data, (d) => {
65
- var p, c;
66
- return o(), r(D, {
67
- label: d[((p = e.options) == null ? void 0 : p.valueKey) || "value"],
68
- size: "large",
69
- key: d[((c = e.options) == null ? void 0 : c.valueKey) || "value"]
70
- }, {
71
- default: a(() => {
72
- var f;
73
- return [
74
- V(m(d[((f = e.options) == null ? void 0 : f.labelkey) || "label"]), 1)
75
- ];
76
- }),
77
- _: 2
78
- }, 1032, ["label"]);
79
- }), 128))
80
- ];
81
- }),
82
- _: 2
83
- }, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
84
- ]),
85
- _: 2
86
- }, 1032, ["label", "rules", "prop"])) : e.type === "checkbox" ? (o(), r(b, {
87
- key: 1,
88
- label: e.label,
89
- rules: e.rules,
90
- prop: [e.field]
91
- }, {
92
- default: a(() => [
93
- i(N, {
94
- modelValue: n.value[e.field],
95
- "onUpdate:modelValue": (l) => n.value[e.field] = l,
96
- disabled: e.disabled
97
- }, {
98
- default: a(() => {
99
- var l;
100
- return [
101
- (o(!0), x(w, null, B((l = e.options) == null ? void 0 : l.data, (d) => {
102
- var p, c;
103
- return o(), r(M, {
104
- key: d[((p = e.options) == null ? void 0 : p.valueKey) || "value"],
105
- label: d[((c = e.options) == null ? void 0 : c.valueKey) || "value"]
106
- }, {
107
- default: a(() => {
108
- var f;
109
- return [
110
- V(m(d[((f = e.options) == null ? void 0 : f.labelkey) || "label"]), 1)
111
- ];
112
- }),
113
- _: 2
114
- }, 1032, ["label"]);
115
- }), 128))
116
- ];
117
- }),
118
- _: 2
119
- }, 1032, ["modelValue", "onUpdate:modelValue", "disabled"])
120
- ]),
121
- _: 2
122
- }, 1032, ["label", "rules", "prop"])) : e.type === "select" ? (o(), r(b, {
123
- key: 2,
124
- label: e.label,
125
- rules: e.rules,
126
- prop: [e.field]
127
- }, {
128
- default: a(() => {
129
- var l;
130
- return [
131
- i(j, {
132
- modelValue: n.value[e.field],
133
- "onUpdate:modelValue": (d) => n.value[e.field] = d,
134
- placeholder: ((l = e.options) == null ? void 0 : l.placeholder) || "请选择",
135
- clearable: e.clearable
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: a(() => {
138
- var d;
398
+ default: n(() => {
399
+ var o;
139
400
  return [
140
- (o(!0), x(w, null, B((d = e.options) == null ? void 0 : d.data, (p) => {
141
- var c, f, P;
142
- return o(), r(H, {
143
- key: p[((c = e.options) == null ? void 0 : c.valueKey) || "value"],
144
- label: p[((f = e.options) == null ? void 0 : f.labelkey) || "label"],
145
- value: p[((P = e.options) == null ? void 0 : P.valueKey) || "value"]
146
- }, null, 8, ["label", "value"]);
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", "placeholder", "clearable"])
152
- ];
153
- }),
154
- _: 2
155
- }, 1032, ["label", "rules", "prop"])) : e.type === "datetime" ? (o(), r(b, {
156
- key: 3,
157
- label: e.label,
158
- rules: e.rules,
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: a(() => [
208
- V(m(k(v).submitButtonText), 1)
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
- _: 1
211
- }),
212
- k(v).showResetButton ? (o(), r(U, {
213
- key: 0,
214
- type: "info",
215
- onClick: u[1] || (u[1] = (e) => Y(y.value))
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: a(() => [
218
- V(m(k(v).resetButtonText), 1)
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
- _: 1
221
- })) : L("", !0),
222
- k(v).showCancelButton ? (o(), r(U, {
223
- key: 1,
224
- onClick: u[2] || (u[2] = (e) => C("cancel"))
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: a(() => [
227
- V(m(k(v).cancelButtonText), 1)
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
- _: 1
230
- })) : L("", !0)
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
- }, 16, ["model"]);
617
+ });
238
618
  };
239
619
  }
240
620
  });
241
- function g(h, K = {}) {
242
- g.installed || (g.installed = !0, h.component("common-el-form", R));
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
- R.install = g;
630
+ m.install = R;
245
631
  export {
246
- R as default
632
+ m as default
247
633
  };
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinosoft-common-form",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "",
5
5
  "main": "common-form.es.js",
6
6
  "scripts": {
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