@tplc/business 0.3.82 → 0.3.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/components/lcb-form/lcb-form.vue +444 -0
- package/components/lcb-form/types.ts +65 -0
- package/components/lcb-list/components/ActionView/index.vue +1 -1
- package/components/lcb-tabs/components/Tabs/index.vue +1 -0
- package/components/lcb-tabs/lcb-tabs.vue +3 -1
- package/components/lcb-tabs/types.ts +1 -0
- package/global.d.ts +1 -0
- package/hooks/useUpload.ts +18 -22
- package/package.json +2 -2
- package/types/components/lcb-form/lcb-form.vue.d.ts +59 -0
- package/types/components/lcb-form/types.d.ts +65 -0
- package/types/components/lcb-nav/lcb-nav.vue.d.ts +1 -1
- package/types/components/lcb-tabs/lcb-tabs.vue.d.ts +17 -3
- package/types/components/lcb-tabs/types.d.ts +1 -0
- package/types/hooks/useUpload.d.ts +1 -1
- package/types/utils/utils.d.ts +2 -0
- package/utils/utils.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.3.84](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.68...v0.3.84) (2025-03-18)
|
|
6
|
+
|
|
7
|
+
### [0.3.83](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.67...v0.3.83) (2025-03-18)
|
|
8
|
+
|
|
5
9
|
### [0.3.82](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.81...v0.3.82) (2025-03-14)
|
|
6
10
|
|
|
7
11
|
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lcb-block>
|
|
3
|
+
<wd-form custom-class="lcb-form" ref="formRef" :model="form">
|
|
4
|
+
<wd-cell-group border>
|
|
5
|
+
<block v-for="field in fields" :key="field.entryFormFieldConfigId">
|
|
6
|
+
<wd-input
|
|
7
|
+
v-if="field.frontInputType === 'input'"
|
|
8
|
+
:placeholder="field.frontPlaceholder || '请输入' + field.fieldCustomName"
|
|
9
|
+
v-model="form[field.field]"
|
|
10
|
+
:label="field.fieldCustomName"
|
|
11
|
+
:required="field.requiredFlag"
|
|
12
|
+
:prop="field.field"
|
|
13
|
+
:rules="
|
|
14
|
+
field.requiredFlag
|
|
15
|
+
? [{ required: true, message: '请输入' + field.fieldCustomName }]
|
|
16
|
+
: []
|
|
17
|
+
"
|
|
18
|
+
v-bind="field.props"
|
|
19
|
+
/>
|
|
20
|
+
<wd-textarea
|
|
21
|
+
v-else-if="field.frontInputType === 'inputArea'"
|
|
22
|
+
:placeholder="field.frontPlaceholder || '请输入' + field.fieldCustomName"
|
|
23
|
+
v-model="form[field.field]"
|
|
24
|
+
:label="field.fieldCustomName"
|
|
25
|
+
:required="field.requiredFlag"
|
|
26
|
+
:prop="field.field"
|
|
27
|
+
:rules="
|
|
28
|
+
field.requiredFlag
|
|
29
|
+
? [{ required: true, message: '请输入' + field.fieldCustomName }]
|
|
30
|
+
: []
|
|
31
|
+
"
|
|
32
|
+
v-bind="field.props"
|
|
33
|
+
/>
|
|
34
|
+
<wd-picker
|
|
35
|
+
v-else-if="field.frontInputType === 'selector'"
|
|
36
|
+
:columns="getColumns(field.frontInputContent)"
|
|
37
|
+
:label="field.fieldCustomName"
|
|
38
|
+
v-model="form[field.field]"
|
|
39
|
+
:required="field.requiredFlag"
|
|
40
|
+
:prop="field.field"
|
|
41
|
+
:rules="
|
|
42
|
+
field.requiredFlag
|
|
43
|
+
? [{ required: true, message: '请选择' + field.fieldCustomName }]
|
|
44
|
+
: []
|
|
45
|
+
"
|
|
46
|
+
v-bind="field.props"
|
|
47
|
+
/>
|
|
48
|
+
<wd-calendar
|
|
49
|
+
v-else-if="field.frontInputType === 'date'"
|
|
50
|
+
:label="field.fieldCustomName"
|
|
51
|
+
v-model="form[field.field]"
|
|
52
|
+
:required="field.requiredFlag"
|
|
53
|
+
:prop="field.field"
|
|
54
|
+
:rules="
|
|
55
|
+
field.requiredFlag
|
|
56
|
+
? [{ required: true, message: '请选择' + field.fieldCustomName }]
|
|
57
|
+
: []
|
|
58
|
+
"
|
|
59
|
+
v-bind="field.props"
|
|
60
|
+
/>
|
|
61
|
+
<!-- radio -->
|
|
62
|
+
<wd-cell
|
|
63
|
+
v-else
|
|
64
|
+
:title="field.fieldCustomName"
|
|
65
|
+
:required="field.requiredFlag"
|
|
66
|
+
:prop="field.field"
|
|
67
|
+
title-width="230rpx"
|
|
68
|
+
>
|
|
69
|
+
<wd-radio-group
|
|
70
|
+
v-if="field.frontInputType === 'radio'"
|
|
71
|
+
v-model="form[field.field]"
|
|
72
|
+
v-bind="field.props"
|
|
73
|
+
inline
|
|
74
|
+
shape="dot"
|
|
75
|
+
>
|
|
76
|
+
<wd-radio
|
|
77
|
+
v-for="item in getColumns(field.frontInputContent)"
|
|
78
|
+
:key="item"
|
|
79
|
+
:value="item"
|
|
80
|
+
>
|
|
81
|
+
{{ item }}
|
|
82
|
+
</wd-radio>
|
|
83
|
+
</wd-radio-group>
|
|
84
|
+
<wd-radio-group
|
|
85
|
+
v-else-if="field.frontInputType === 'radioTag'"
|
|
86
|
+
v-model="form[field.field]"
|
|
87
|
+
v-bind="field.props"
|
|
88
|
+
shape="button"
|
|
89
|
+
>
|
|
90
|
+
<wd-radio
|
|
91
|
+
v-for="item in getColumns(field.frontInputContent)"
|
|
92
|
+
:key="item"
|
|
93
|
+
:value="item"
|
|
94
|
+
>
|
|
95
|
+
{{ item }}
|
|
96
|
+
</wd-radio>
|
|
97
|
+
</wd-radio-group>
|
|
98
|
+
<wd-upload
|
|
99
|
+
v-else-if="field.frontInputType === 'img'"
|
|
100
|
+
:label="field.fieldCustomName"
|
|
101
|
+
accept="image"
|
|
102
|
+
:limit="1"
|
|
103
|
+
:upload-method="customUpload"
|
|
104
|
+
v-bind="field.props"
|
|
105
|
+
/>
|
|
106
|
+
</wd-cell>
|
|
107
|
+
</block>
|
|
108
|
+
</wd-cell-group>
|
|
109
|
+
<wd-button type="primary" @click="submit" block size="large" class="!w-90vw my-3">
|
|
110
|
+
{{ submitText }}
|
|
111
|
+
</wd-button>
|
|
112
|
+
</wd-form>
|
|
113
|
+
</lcb-block>
|
|
114
|
+
</template>
|
|
115
|
+
|
|
116
|
+
<script setup lang="ts">
|
|
117
|
+
import { ref } from 'vue'
|
|
118
|
+
import { LcbFormProps, LcbFormField } from './types'
|
|
119
|
+
import { customUpload } from '../../utils/utils'
|
|
120
|
+
defineOptions({
|
|
121
|
+
name: 'LcbForm',
|
|
122
|
+
options: {
|
|
123
|
+
addGlobalClass: true,
|
|
124
|
+
virtualHost: true,
|
|
125
|
+
styleIsolation: 'shared',
|
|
126
|
+
},
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
const form = ref({})
|
|
130
|
+
const formRef = ref()
|
|
131
|
+
withDefaults(defineProps<LcbFormProps>(), {
|
|
132
|
+
fields: (): LcbFormField[] =>
|
|
133
|
+
[
|
|
134
|
+
{
|
|
135
|
+
agentId: '0',
|
|
136
|
+
childFlag: false,
|
|
137
|
+
conditionField: '0',
|
|
138
|
+
createDate: '2025-03-16 17:55:30',
|
|
139
|
+
editFlag: true,
|
|
140
|
+
entryFormConfigId: '1227996250586357760',
|
|
141
|
+
entryFormFieldConfigId: '1350890233794580480',
|
|
142
|
+
field: 'tu_pian',
|
|
143
|
+
fieldCustomName: '图片',
|
|
144
|
+
fieldName: '图片',
|
|
145
|
+
frontInputContent: '[]',
|
|
146
|
+
frontInputType: 'img',
|
|
147
|
+
frontInputTypeValue: '',
|
|
148
|
+
lastModifyDate: '2025-03-16 17:55:30',
|
|
149
|
+
merchantHeadId: '0',
|
|
150
|
+
merchantId: '0',
|
|
151
|
+
requiredFlag: false,
|
|
152
|
+
weightSort: 999,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
agentId: '0',
|
|
156
|
+
childFlag: false,
|
|
157
|
+
conditionField: '0',
|
|
158
|
+
createDate: '2025-03-16 17:56:28',
|
|
159
|
+
editFlag: true,
|
|
160
|
+
entryFormConfigId: '1227996250586357760',
|
|
161
|
+
entryFormFieldConfigId: '1350890477630443520',
|
|
162
|
+
field: 'dan_xuan_-_biao_qian',
|
|
163
|
+
fieldCustomName: '单选-标签',
|
|
164
|
+
fieldName: '单选-标签',
|
|
165
|
+
frontInputContent: '["一个","二个","三个"]',
|
|
166
|
+
frontInputType: 'radioTag',
|
|
167
|
+
frontInputTypeValue: '1',
|
|
168
|
+
lastModifyDate: '2025-03-16 17:56:28',
|
|
169
|
+
merchantHeadId: '0',
|
|
170
|
+
merchantId: '0',
|
|
171
|
+
requiredFlag: false,
|
|
172
|
+
weightSort: 999,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
agentId: '0',
|
|
176
|
+
childFlag: false,
|
|
177
|
+
conditionField: '0',
|
|
178
|
+
createDate: '2025-03-16 17:56:41',
|
|
179
|
+
editFlag: true,
|
|
180
|
+
entryFormConfigId: '1227996250586357760',
|
|
181
|
+
entryFormFieldConfigId: '1350890535411175424',
|
|
182
|
+
field: 'ri_qi',
|
|
183
|
+
fieldCustomName: '日期',
|
|
184
|
+
fieldName: '日期',
|
|
185
|
+
frontInputContent: '[]',
|
|
186
|
+
frontInputType: 'date',
|
|
187
|
+
frontInputTypeValue: 'year',
|
|
188
|
+
lastModifyDate: '2025-03-16 17:56:41',
|
|
189
|
+
merchantHeadId: '0',
|
|
190
|
+
merchantId: '0',
|
|
191
|
+
requiredFlag: false,
|
|
192
|
+
weightSort: 999,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
agentId: '0',
|
|
196
|
+
childFlag: false,
|
|
197
|
+
conditionField: '0',
|
|
198
|
+
createDate: '2025-03-16 17:58:09',
|
|
199
|
+
editFlag: true,
|
|
200
|
+
entryFormConfigId: '1227996250586357760',
|
|
201
|
+
entryFormFieldConfigId: '1350890904052748288',
|
|
202
|
+
field: '__dan_xuan',
|
|
203
|
+
fieldCustomName: ' 单选',
|
|
204
|
+
fieldName: ' 单选',
|
|
205
|
+
frontInputContent: '["单选 1","单选 2","单选 3"]',
|
|
206
|
+
frontInputType: 'radio',
|
|
207
|
+
frontInputTypeValue: '3',
|
|
208
|
+
lastModifyDate: '2025-03-16 17:58:09',
|
|
209
|
+
merchantHeadId: '0',
|
|
210
|
+
merchantId: '0',
|
|
211
|
+
requiredFlag: false,
|
|
212
|
+
weightSort: 999,
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
agentId: '0',
|
|
216
|
+
childFlag: false,
|
|
217
|
+
conditionField: '0',
|
|
218
|
+
createDate: '2024-04-24 15:21:53',
|
|
219
|
+
editFlag: true,
|
|
220
|
+
entryFormConfigId: '1227996250586357760',
|
|
221
|
+
entryFormFieldConfigId: '1232713130614071296',
|
|
222
|
+
field: 'min_su_suo_zai_cheng_shi',
|
|
223
|
+
fieldCustomName: '民宿所在城市',
|
|
224
|
+
fieldName: '民宿所在城市',
|
|
225
|
+
frontInputContent:
|
|
226
|
+
'["潮州","东莞","佛山","广州","河源","惠州","江门","揭阳","茂名","梅州","清远","汕头","汕尾","韶关","深圳","阳江","云浮","湛江","肇庆","中山","珠海"]',
|
|
227
|
+
frontInputType: 'selector',
|
|
228
|
+
frontInputTypeValue: '',
|
|
229
|
+
lastModifyDate: '2024-04-24 15:21:59',
|
|
230
|
+
merchantHeadId: '0',
|
|
231
|
+
merchantId: '0',
|
|
232
|
+
requiredFlag: true,
|
|
233
|
+
weightSort: 100,
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
agentId: '0',
|
|
237
|
+
childFlag: false,
|
|
238
|
+
conditionField: '0',
|
|
239
|
+
createDate: '2024-04-11 15:11:16',
|
|
240
|
+
editFlag: true,
|
|
241
|
+
entryFormConfigId: '1227996250586357760',
|
|
242
|
+
entryFormFieldConfigId: '1227999416795144192',
|
|
243
|
+
field: 'min_su_ming_cheng',
|
|
244
|
+
fieldCustomName: '民宿名称',
|
|
245
|
+
fieldName: '民宿名称',
|
|
246
|
+
frontInputContent: '[""]',
|
|
247
|
+
frontInputType: 'inputArea',
|
|
248
|
+
frontInputTypeValue: '',
|
|
249
|
+
frontPlaceholder: '多家门店均可填写',
|
|
250
|
+
lastModifyDate: '2024-04-18 17:39:27',
|
|
251
|
+
merchantHeadId: '0',
|
|
252
|
+
merchantId: '0',
|
|
253
|
+
requiredFlag: true,
|
|
254
|
+
weightSort: 99,
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
agentId: '0',
|
|
258
|
+
childFlag: false,
|
|
259
|
+
conditionField: '0',
|
|
260
|
+
createDate: '2024-04-18 17:38:48',
|
|
261
|
+
editFlag: true,
|
|
262
|
+
entryFormConfigId: '1227996250586357760',
|
|
263
|
+
entryFormFieldConfigId: '1230573263041994752',
|
|
264
|
+
field: 'lian_xi_ren',
|
|
265
|
+
fieldCustomName: '联系人',
|
|
266
|
+
fieldName: '联系人',
|
|
267
|
+
frontInputContent: '[]',
|
|
268
|
+
frontInputType: 'input',
|
|
269
|
+
frontInputTypeValue: '',
|
|
270
|
+
frontPlaceholder: '姓名',
|
|
271
|
+
lastModifyDate: '2024-04-18 17:38:48',
|
|
272
|
+
merchantHeadId: '0',
|
|
273
|
+
merchantId: '0',
|
|
274
|
+
requiredFlag: true,
|
|
275
|
+
weightSort: 99,
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
agentId: '0',
|
|
279
|
+
childFlag: false,
|
|
280
|
+
conditionField: '0',
|
|
281
|
+
createDate: '2024-04-11 17:10:34',
|
|
282
|
+
editFlag: true,
|
|
283
|
+
entryFormConfigId: '1227996250586357760',
|
|
284
|
+
entryFormFieldConfigId: '1228029442395611136',
|
|
285
|
+
field: 'lian_xi_fang_shi',
|
|
286
|
+
fieldCustomName: '联系方式',
|
|
287
|
+
fieldName: '联系方式',
|
|
288
|
+
frontInputContent: '[""]',
|
|
289
|
+
frontInputType: 'input',
|
|
290
|
+
frontInputTypeValue: '',
|
|
291
|
+
frontPlaceholder: '手机号码',
|
|
292
|
+
lastModifyDate: '2024-04-11 17:10:51',
|
|
293
|
+
merchantHeadId: '0',
|
|
294
|
+
merchantId: '0',
|
|
295
|
+
requiredFlag: true,
|
|
296
|
+
weightSort: 98.5,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
agentId: '0',
|
|
300
|
+
childFlag: false,
|
|
301
|
+
conditionField: '0',
|
|
302
|
+
createDate: '2024-04-11 16:36:47',
|
|
303
|
+
editFlag: true,
|
|
304
|
+
entryFormConfigId: '1227996250586357760',
|
|
305
|
+
entryFormFieldConfigId: '1228020941497704448',
|
|
306
|
+
field: 'min_su_di_qu',
|
|
307
|
+
fieldCustomName: '民宿地址',
|
|
308
|
+
fieldName: '民宿地区',
|
|
309
|
+
frontInputContent: '[""]',
|
|
310
|
+
frontInputType: 'inputArea',
|
|
311
|
+
frontInputTypeValue: '',
|
|
312
|
+
frontPlaceholder: '具体地址',
|
|
313
|
+
lastModifyDate: '2024-04-11 16:57:44',
|
|
314
|
+
merchantHeadId: '0',
|
|
315
|
+
merchantId: '0',
|
|
316
|
+
requiredFlag: true,
|
|
317
|
+
weightSort: 98,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
agentId: '0',
|
|
321
|
+
childFlag: false,
|
|
322
|
+
conditionField: '0',
|
|
323
|
+
createDate: '2024-04-11 16:51:56',
|
|
324
|
+
editFlag: true,
|
|
325
|
+
entryFormConfigId: '1227996250586357760',
|
|
326
|
+
entryFormFieldConfigId: '1228024751091752960',
|
|
327
|
+
field: 'jia_ge_qu_jian_(_jun_jia_)',
|
|
328
|
+
fieldCustomName: '价格区间',
|
|
329
|
+
fieldName: '价格区间(均价)',
|
|
330
|
+
frontInputContent: '["200元以下","300元-500元","500元-800元","800元-1000元","1000元以上"]',
|
|
331
|
+
frontInputType: 'selector',
|
|
332
|
+
frontInputTypeValue: '',
|
|
333
|
+
frontPlaceholder: '(均价)',
|
|
334
|
+
lastModifyDate: '2024-04-11 16:58:30',
|
|
335
|
+
merchantHeadId: '0',
|
|
336
|
+
merchantId: '0',
|
|
337
|
+
requiredFlag: true,
|
|
338
|
+
weightSort: 97,
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
agentId: '0',
|
|
342
|
+
childFlag: false,
|
|
343
|
+
conditionField: '0',
|
|
344
|
+
createDate: '2024-04-11 16:52:23',
|
|
345
|
+
editFlag: true,
|
|
346
|
+
entryFormConfigId: '1227996250586357760',
|
|
347
|
+
entryFormFieldConfigId: '1228024864048553984',
|
|
348
|
+
field: 'fang_jian_shu_liang',
|
|
349
|
+
fieldCustomName: '房间数量',
|
|
350
|
+
fieldName: '房间数量',
|
|
351
|
+
frontInputContent: '[""]',
|
|
352
|
+
frontInputType: 'input',
|
|
353
|
+
frontInputTypeValue: '',
|
|
354
|
+
frontPlaceholder: '',
|
|
355
|
+
lastModifyDate: '2024-04-11 16:56:39',
|
|
356
|
+
merchantHeadId: '0',
|
|
357
|
+
merchantId: '0',
|
|
358
|
+
requiredFlag: true,
|
|
359
|
+
weightSort: 96,
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
agentId: '0',
|
|
363
|
+
childFlag: false,
|
|
364
|
+
conditionField: '0',
|
|
365
|
+
createDate: '2024-04-18 17:35:09',
|
|
366
|
+
editFlag: true,
|
|
367
|
+
entryFormConfigId: '1227996250586357760',
|
|
368
|
+
entryFormFieldConfigId: '1230572344346812416',
|
|
369
|
+
field: 'shi_fou_chi_you_you_chu_ka',
|
|
370
|
+
fieldCustomName: '是否持有邮储卡',
|
|
371
|
+
fieldName: '是否持有邮储卡',
|
|
372
|
+
frontInputContent: '["是","否"]',
|
|
373
|
+
frontInputType: 'selector',
|
|
374
|
+
frontInputTypeValue: '',
|
|
375
|
+
lastModifyDate: '2024-04-18 17:35:09',
|
|
376
|
+
merchantHeadId: '0',
|
|
377
|
+
merchantId: '0',
|
|
378
|
+
requiredFlag: true,
|
|
379
|
+
weightSort: 96,
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
agentId: '0',
|
|
383
|
+
childFlag: false,
|
|
384
|
+
conditionField: '0',
|
|
385
|
+
createDate: '2024-04-18 17:35:43',
|
|
386
|
+
editFlag: true,
|
|
387
|
+
entryFormConfigId: '1227996250586357760',
|
|
388
|
+
entryFormFieldConfigId: '1230572486072344576',
|
|
389
|
+
field: 'shi_fou_kai_ban_wei_you_fu',
|
|
390
|
+
fieldCustomName: '是否开办微邮付',
|
|
391
|
+
fieldName: '是否开办微邮付',
|
|
392
|
+
frontInputContent: '["是","否"]',
|
|
393
|
+
frontInputType: 'selector',
|
|
394
|
+
frontInputTypeValue: '',
|
|
395
|
+
lastModifyDate: '2024-04-18 17:35:43',
|
|
396
|
+
merchantHeadId: '0',
|
|
397
|
+
merchantId: '0',
|
|
398
|
+
requiredFlag: true,
|
|
399
|
+
weightSort: 96,
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
agentId: '0',
|
|
403
|
+
childFlag: false,
|
|
404
|
+
conditionField: '0',
|
|
405
|
+
createDate: '2024-04-18 17:36:49',
|
|
406
|
+
editFlag: true,
|
|
407
|
+
entryFormConfigId: '1227996250586357760',
|
|
408
|
+
entryFormFieldConfigId: '1230572764020482048',
|
|
409
|
+
field: 'tui_jian_ke_hu_jing_li',
|
|
410
|
+
fieldCustomName: '推荐客户经理',
|
|
411
|
+
fieldName: '推荐客户经理',
|
|
412
|
+
frontInputContent: '[]',
|
|
413
|
+
frontInputType: 'input',
|
|
414
|
+
frontInputTypeValue: '',
|
|
415
|
+
frontPlaceholder: '经理姓名及联系方式',
|
|
416
|
+
lastModifyDate: '2024-04-18 17:36:49',
|
|
417
|
+
merchantHeadId: '0',
|
|
418
|
+
merchantId: '0',
|
|
419
|
+
requiredFlag: false,
|
|
420
|
+
weightSort: 95,
|
|
421
|
+
},
|
|
422
|
+
] as any[],
|
|
423
|
+
submitText: '提交',
|
|
424
|
+
})
|
|
425
|
+
const getColumns = (frontInputContent: string) => {
|
|
426
|
+
return JSON.parse(frontInputContent || '[]')
|
|
427
|
+
}
|
|
428
|
+
const submit = () => {
|
|
429
|
+
formRef.value.validate().then((res) => {
|
|
430
|
+
console.log(res)
|
|
431
|
+
})
|
|
432
|
+
}
|
|
433
|
+
</script>
|
|
434
|
+
|
|
435
|
+
<style lang="scss" scoped>
|
|
436
|
+
.lcb-form {
|
|
437
|
+
:deep(.wd-radio) {
|
|
438
|
+
line-height: inherit;
|
|
439
|
+
}
|
|
440
|
+
:deep(.wd-radio-group) {
|
|
441
|
+
text-align: left;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
</style>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface LcbFormField {
|
|
2
|
+
/**
|
|
3
|
+
* 业务主键ID
|
|
4
|
+
*/
|
|
5
|
+
entryFormFieldConfigId: string
|
|
6
|
+
/**
|
|
7
|
+
* 表单配置主键ID
|
|
8
|
+
*/
|
|
9
|
+
entryFormConfigId: string
|
|
10
|
+
/**
|
|
11
|
+
* 字段
|
|
12
|
+
*/
|
|
13
|
+
field: string
|
|
14
|
+
/**
|
|
15
|
+
* 默认字段名称
|
|
16
|
+
*/
|
|
17
|
+
fieldName: string
|
|
18
|
+
/**
|
|
19
|
+
* 自定义字段名称
|
|
20
|
+
*/
|
|
21
|
+
fieldCustomName: string
|
|
22
|
+
/**
|
|
23
|
+
* 前端输入类型:如text date select img等
|
|
24
|
+
*/
|
|
25
|
+
frontInputType: string
|
|
26
|
+
/**
|
|
27
|
+
* 前端输入类型对应的值 如:year month day
|
|
28
|
+
*/
|
|
29
|
+
frontInputTypeValue: string
|
|
30
|
+
/**
|
|
31
|
+
* 前端输入的固定内容,如[\"计算机\",\"国际金融\",“UI视觉”]
|
|
32
|
+
*/
|
|
33
|
+
frontInputContent: string
|
|
34
|
+
/**
|
|
35
|
+
* 前端文本提示信息
|
|
36
|
+
*/
|
|
37
|
+
frontPlaceholder: string
|
|
38
|
+
/**
|
|
39
|
+
* 文本提示信息
|
|
40
|
+
*/
|
|
41
|
+
frontTip: string
|
|
42
|
+
/**
|
|
43
|
+
* 必填标识
|
|
44
|
+
*/
|
|
45
|
+
requiredFlag: boolean
|
|
46
|
+
/**
|
|
47
|
+
* 是否存在子集
|
|
48
|
+
*/
|
|
49
|
+
childFlag: boolean
|
|
50
|
+
/**
|
|
51
|
+
* 显示条件的字段是什么,数组[field:content,field:content2]
|
|
52
|
+
*/
|
|
53
|
+
conditionField: string
|
|
54
|
+
/**
|
|
55
|
+
* 组件的props
|
|
56
|
+
*/
|
|
57
|
+
props: Record<string, any>
|
|
58
|
+
}
|
|
59
|
+
export interface LcbFormProps {
|
|
60
|
+
fields: LcbFormField[]
|
|
61
|
+
/**
|
|
62
|
+
* 提交按钮的文本
|
|
63
|
+
*/
|
|
64
|
+
submitText?: string
|
|
65
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view class="action-view flex justify-center items-center">
|
|
3
3
|
<wd-button type="info" @click="emits('cancel')" :disabled="disabled">清空</wd-button>
|
|
4
|
-
<wd-button type="primary" custom-class="flex-1" @click="emits('submit')"
|
|
4
|
+
<wd-button type="primary" custom-class="flex-1" @click="emits('submit')">完成</wd-button>
|
|
5
5
|
</view>
|
|
6
6
|
</template>
|
|
7
7
|
|
package/global.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ declare module 'vue' {
|
|
|
15
15
|
'lcb-dynamic-data': (typeof import('@tplc/business/components/lcb-dynamic-data/lcb-dynamic-data.vue'))['default']
|
|
16
16
|
'lcb-fab': (typeof import('@tplc/business/components/lcb-fab/lcb-fab.vue'))['default']
|
|
17
17
|
'lcb-filter-grid': (typeof import('@tplc/business/components/lcb-filter-grid/lcb-filter-grid.vue'))['default']
|
|
18
|
+
'lcb-form': (typeof import('@tplc/business/components/lcb-form/lcb-form.vue'))['default']
|
|
18
19
|
'lcb-gap': (typeof import('@tplc/business/components/lcb-gap/lcb-gap.vue'))['default']
|
|
19
20
|
'lcb-grid': (typeof import('@tplc/business/components/lcb-grid/lcb-grid.vue'))['default']
|
|
20
21
|
'lcb-home-search': (typeof import('@tplc/business/components/lcb-home-search/lcb-home-search.vue'))['default']
|
package/hooks/useUpload.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ref, Ref } from 'vue'
|
|
2
2
|
import { uploadByUrl } from './useUpload.api'
|
|
3
|
-
|
|
4
3
|
/**
|
|
5
4
|
* useUpload 是一个定制化的请求钩子,用于处理上传图片。
|
|
6
5
|
* @param formData 额外传递给后台的数据,如{name: '菲鸽'}。
|
|
7
|
-
* @returns 返回一个对象{loading, data, run},包含请求的加载状态、错误信息、响应数据和手动触发请求的函数。
|
|
6
|
+
* @returns 返回一个对象{loading, error, data, run},包含请求的加载状态、错误信息、响应数据和手动触发请求的函数。
|
|
8
7
|
*/
|
|
9
8
|
export default function useUpload(onSuccess?: (url: string) => void) {
|
|
10
9
|
const data = ref<string>('')
|
|
@@ -26,7 +25,7 @@ export default function useUpload(onSuccess?: (url: string) => void) {
|
|
|
26
25
|
// #ifndef MP-WEIXIN
|
|
27
26
|
uni.chooseImage({
|
|
28
27
|
count: 1,
|
|
29
|
-
success: (res) => {
|
|
28
|
+
success: (res: any) => {
|
|
30
29
|
const name = res.tempFiles[0].name
|
|
31
30
|
uploadFile({ data, name, filePath: res.tempFilePaths[0], onSuccess })
|
|
32
31
|
},
|
|
@@ -54,7 +53,7 @@ export async function uploadFile({
|
|
|
54
53
|
const pageRoute = getCurrentPages().at(-1)?.route || ''
|
|
55
54
|
uni.$lcb.loadingStore?.().changeLoading(pageRoute, true)
|
|
56
55
|
const { uploadUrl, ossType, fileUrl } = await uploadByUrl(`${new Date().getTime()}_${name}`)
|
|
57
|
-
const fun = (fileData) => {
|
|
56
|
+
const fun = (fileData: any) => {
|
|
58
57
|
uni.request({
|
|
59
58
|
url: uploadUrl,
|
|
60
59
|
method: 'PUT',
|
|
@@ -87,22 +86,19 @@ export async function uploadFile({
|
|
|
87
86
|
// #endif
|
|
88
87
|
|
|
89
88
|
// #ifndef H5
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})
|
|
105
|
-
}
|
|
106
|
-
|
|
89
|
+
const fs = uni.getFileSystemManager()
|
|
90
|
+
fs.readFile({
|
|
91
|
+
filePath,
|
|
92
|
+
success: (fileRes) => {
|
|
93
|
+
fun(fileRes.data)
|
|
94
|
+
},
|
|
95
|
+
fail: () => {
|
|
96
|
+
uni.showToast({
|
|
97
|
+
title: '上传失败',
|
|
98
|
+
icon: 'none',
|
|
99
|
+
})
|
|
100
|
+
uni.$lcb.loadingStore?.().changeLoading(pageRoute, false)
|
|
101
|
+
},
|
|
102
|
+
})
|
|
107
103
|
// #endif
|
|
108
104
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tplc/business",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.84",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"业务组件"
|
|
6
6
|
],
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"peerDependencies": {
|
|
13
13
|
"vue": ">=3.2.47",
|
|
14
|
-
"@tplc/wot": "0.1.
|
|
14
|
+
"@tplc/wot": "0.1.68"
|
|
15
15
|
},
|
|
16
16
|
"engines": {
|
|
17
17
|
"node": ">=18",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { LcbFormProps, LcbFormField } from './types'
|
|
2
|
+
declare const _default: import('vue').DefineComponent<
|
|
3
|
+
__VLS_WithDefaults<
|
|
4
|
+
__VLS_TypePropsToOption<LcbFormProps>,
|
|
5
|
+
{
|
|
6
|
+
fields: () => LcbFormField[]
|
|
7
|
+
submitText: string
|
|
8
|
+
}
|
|
9
|
+
>,
|
|
10
|
+
{},
|
|
11
|
+
unknown,
|
|
12
|
+
{},
|
|
13
|
+
{},
|
|
14
|
+
import('vue').ComponentOptionsMixin,
|
|
15
|
+
import('vue').ComponentOptionsMixin,
|
|
16
|
+
{},
|
|
17
|
+
string,
|
|
18
|
+
import('vue').PublicProps,
|
|
19
|
+
Readonly<
|
|
20
|
+
import('vue').ExtractPropTypes<
|
|
21
|
+
__VLS_WithDefaults<
|
|
22
|
+
__VLS_TypePropsToOption<LcbFormProps>,
|
|
23
|
+
{
|
|
24
|
+
fields: () => LcbFormField[]
|
|
25
|
+
submitText: string
|
|
26
|
+
}
|
|
27
|
+
>
|
|
28
|
+
>
|
|
29
|
+
>,
|
|
30
|
+
{
|
|
31
|
+
fields: LcbFormField[]
|
|
32
|
+
submitText: string
|
|
33
|
+
},
|
|
34
|
+
{}
|
|
35
|
+
>
|
|
36
|
+
export default _default
|
|
37
|
+
type __VLS_WithDefaults<P, D> = {
|
|
38
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D
|
|
39
|
+
? __VLS_Prettify<
|
|
40
|
+
P[K] & {
|
|
41
|
+
default: D[K]
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
: P[K]
|
|
45
|
+
}
|
|
46
|
+
type __VLS_Prettify<T> = {
|
|
47
|
+
[K in keyof T]: T[K]
|
|
48
|
+
} & {}
|
|
49
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T
|
|
50
|
+
type __VLS_TypePropsToOption<T> = {
|
|
51
|
+
[K in keyof T]-?: {} extends Pick<T, K>
|
|
52
|
+
? {
|
|
53
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>
|
|
54
|
+
}
|
|
55
|
+
: {
|
|
56
|
+
type: import('vue').PropType<T[K]>
|
|
57
|
+
required: true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface LcbFormField {
|
|
2
|
+
/**
|
|
3
|
+
* 业务主键ID
|
|
4
|
+
*/
|
|
5
|
+
entryFormFieldConfigId: string
|
|
6
|
+
/**
|
|
7
|
+
* 表单配置主键ID
|
|
8
|
+
*/
|
|
9
|
+
entryFormConfigId: string
|
|
10
|
+
/**
|
|
11
|
+
* 字段
|
|
12
|
+
*/
|
|
13
|
+
field: string
|
|
14
|
+
/**
|
|
15
|
+
* 默认字段名称
|
|
16
|
+
*/
|
|
17
|
+
fieldName: string
|
|
18
|
+
/**
|
|
19
|
+
* 自定义字段名称
|
|
20
|
+
*/
|
|
21
|
+
fieldCustomName: string
|
|
22
|
+
/**
|
|
23
|
+
* 前端输入类型:如text date select img等
|
|
24
|
+
*/
|
|
25
|
+
frontInputType: string
|
|
26
|
+
/**
|
|
27
|
+
* 前端输入类型对应的值 如:year month day
|
|
28
|
+
*/
|
|
29
|
+
frontInputTypeValue: string
|
|
30
|
+
/**
|
|
31
|
+
* 前端输入的固定内容,如[\"计算机\",\"国际金融\",“UI视觉”]
|
|
32
|
+
*/
|
|
33
|
+
frontInputContent: string
|
|
34
|
+
/**
|
|
35
|
+
* 前端文本提示信息
|
|
36
|
+
*/
|
|
37
|
+
frontPlaceholder: string
|
|
38
|
+
/**
|
|
39
|
+
* 文本提示信息
|
|
40
|
+
*/
|
|
41
|
+
frontTip: string
|
|
42
|
+
/**
|
|
43
|
+
* 必填标识
|
|
44
|
+
*/
|
|
45
|
+
requiredFlag: boolean
|
|
46
|
+
/**
|
|
47
|
+
* 是否存在子集
|
|
48
|
+
*/
|
|
49
|
+
childFlag: boolean
|
|
50
|
+
/**
|
|
51
|
+
* 显示条件的字段是什么,数组[field:content,field:content2]
|
|
52
|
+
*/
|
|
53
|
+
conditionField: string
|
|
54
|
+
/**
|
|
55
|
+
* 组件的props
|
|
56
|
+
*/
|
|
57
|
+
props: Record<string, any>
|
|
58
|
+
}
|
|
59
|
+
export interface LcbFormProps {
|
|
60
|
+
fields: LcbFormField[]
|
|
61
|
+
/**
|
|
62
|
+
* 提交按钮的文本
|
|
63
|
+
*/
|
|
64
|
+
submitText?: string
|
|
65
|
+
}
|
|
@@ -59,8 +59,8 @@ declare const _default: import('vue').DefineComponent<
|
|
|
59
59
|
title: string
|
|
60
60
|
styleGroup: 1 | 2 | 3 | 4
|
|
61
61
|
fontWeight: number
|
|
62
|
-
textSize: number
|
|
63
62
|
back: boolean
|
|
63
|
+
textSize: number
|
|
64
64
|
topStyle: 1 | 2
|
|
65
65
|
immersionMode: 1 | 2 | 3
|
|
66
66
|
colorMode: 'custom' | 'default'
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { LcbTabsProps } from './types'
|
|
2
2
|
declare const _default: import('vue').DefineComponent<
|
|
3
|
-
__VLS_WithDefaults<
|
|
3
|
+
__VLS_WithDefaults<
|
|
4
|
+
__VLS_TypePropsToOption<LcbTabsProps>,
|
|
5
|
+
{
|
|
6
|
+
itemFontSize: number
|
|
7
|
+
}
|
|
8
|
+
>,
|
|
4
9
|
{},
|
|
5
10
|
unknown,
|
|
6
11
|
{},
|
|
@@ -11,9 +16,18 @@ declare const _default: import('vue').DefineComponent<
|
|
|
11
16
|
string,
|
|
12
17
|
import('vue').PublicProps,
|
|
13
18
|
Readonly<
|
|
14
|
-
import('vue').ExtractPropTypes<
|
|
19
|
+
import('vue').ExtractPropTypes<
|
|
20
|
+
__VLS_WithDefaults<
|
|
21
|
+
__VLS_TypePropsToOption<LcbTabsProps>,
|
|
22
|
+
{
|
|
23
|
+
itemFontSize: number
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
>
|
|
15
27
|
>,
|
|
16
|
-
{
|
|
28
|
+
{
|
|
29
|
+
itemFontSize: number
|
|
30
|
+
},
|
|
17
31
|
{}
|
|
18
32
|
>
|
|
19
33
|
export default _default
|
|
@@ -2,7 +2,7 @@ import { Ref } from 'vue'
|
|
|
2
2
|
/**
|
|
3
3
|
* useUpload 是一个定制化的请求钩子,用于处理上传图片。
|
|
4
4
|
* @param formData 额外传递给后台的数据,如{name: '菲鸽'}。
|
|
5
|
-
* @returns 返回一个对象{loading, data, run},包含请求的加载状态、错误信息、响应数据和手动触发请求的函数。
|
|
5
|
+
* @returns 返回一个对象{loading, error, data, run},包含请求的加载状态、错误信息、响应数据和手动触发请求的函数。
|
|
6
6
|
*/
|
|
7
7
|
export default function useUpload(onSuccess?: (url: string) => void): {
|
|
8
8
|
data: Ref<string>
|
package/types/utils/utils.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UploadMethod } from '@tplc/wot/types/components/wd-upload/types'
|
|
1
2
|
export declare function formatJson(str: string | object | undefined, defVal?: {}): {}
|
|
2
3
|
/** 获取上个页面Exposed */
|
|
3
4
|
export declare const getExposed: () => any
|
|
@@ -19,3 +20,4 @@ export declare const calculateImageHeight: (
|
|
|
19
20
|
column?: number,
|
|
20
21
|
gap?: number,
|
|
21
22
|
) => number
|
|
23
|
+
export declare const customUpload: UploadMethod
|
package/utils/utils.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { isH5 } from '@tplc/wot/components/common/util'
|
|
2
|
+
import { UploadMethod } from '@tplc/wot/types/components/wd-upload/types'
|
|
3
|
+
import { uploadFile } from '../hooks/useUpload'
|
|
1
4
|
import { parse, stringify } from 'qs'
|
|
2
5
|
export function formatJson(str: string | object | undefined, defVal = {}) {
|
|
3
6
|
if (!str) return defVal
|
|
@@ -71,3 +74,13 @@ export const calculateImageHeight = (
|
|
|
71
74
|
) => {
|
|
72
75
|
return ((screenWidth - gap * (2 + column - 1)) / 2) * (imageHeight / imageWidth)
|
|
73
76
|
}
|
|
77
|
+
export const customUpload: UploadMethod = (file, formData, options) => {
|
|
78
|
+
const fileName = (isH5 ? file.name : file.url?.split('/').pop()) || ''
|
|
79
|
+
uploadFile({
|
|
80
|
+
name: fileName,
|
|
81
|
+
filePath: file.url,
|
|
82
|
+
onSuccess: (data: string) => {
|
|
83
|
+
options.onSuccess({ data, statusCode: 200 }, file, formData)
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
}
|