@tplc/business 0.3.93 → 0.3.95

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 CHANGED
@@ -2,6 +2,38 @@
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.95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.93...v0.3.95) (2025-03-21)
6
+
7
+
8
+ ### 🚀 Chore | 构建/工程依赖/工具
9
+
10
+ * **release:** 0.3.94 ([b3f9898](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/b3f9898ef5864ec6bb655590343f7b599950ed82))
11
+
12
+
13
+ ### ✨ Features | 新功能
14
+
15
+ * 差协议弹出 ([53ecf7d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/53ecf7dd6ee37cf94abaf3d8ffb2ad8adfcc1841))
16
+ * 新增字段 ([efedb08](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/efedb08a1c3a01b4f2a61ad1a5a5b15168e59119))
17
+
18
+ ### [0.3.94](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.1.71...v0.3.94) (2025-03-21)
19
+
20
+
21
+ ### 🚀 Chore | 构建/工程依赖/工具
22
+
23
+ * **release:** 0.1.72 ([400430d](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/400430db387cf82e0c0e6f216c1ccd995b137f82))
24
+ * **release:** 0.3.91 ([5802f24](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/5802f24980a6fb4cfebf7a048e5d19e0dba8baf0))
25
+ * **release:** 0.3.92 ([07fa5e8](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/07fa5e82f05b7d5c2d2d53c9bd4a500f00c3fa6a))
26
+ * **release:** 0.3.93 ([7561a9b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/7561a9be483cda4c50ef7ae4fabd8df5fe7729d7))
27
+
28
+
29
+ ### ✨ Features | 新功能
30
+
31
+ * search ([44a5a00](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/44a5a00c99e269fe73650afb3428f1fb799b215b))
32
+ * 搜索支持输入 ([345275a](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/345275a417f3399739c512d628796d163862f0cc))
33
+ * 支持搜索输入 ([048387b](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/048387bde999bec89539232dfc4bdff9fd68b54e))
34
+ * 新增字段 ([efedb08](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/efedb08a1c3a01b4f2a61ad1a5a5b15168e59119))
35
+ * 背景颜色 ([422624c](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/422624c66c8ed859dcbe228541b777d7aa4edcc1))
36
+
5
37
  ### [0.3.93](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.92...v0.3.93) (2025-03-20)
6
38
 
7
39
 
@@ -7,6 +7,7 @@
7
7
  @chooseavatar="onChooseAvatar"
8
8
  :class="customClass"
9
9
  :style="customStyle"
10
+ show-message-card
10
11
  >
11
12
  <slot />
12
13
  </button>
@@ -5,7 +5,7 @@
5
5
  <wd-popup closable position="center" custom-class="!bg-transparent" v-model="show">
6
6
  <view class="agreement-popup">
7
7
  <view class="title">{{ data?.name }}</view>
8
- <view class="max-h-60vh overflow-y-auto">
8
+ <view class="max-h-60vh overflow-y-auto w-full">
9
9
  <mpHtml :content="data?.content" />
10
10
  </view>
11
11
  </view>
@@ -45,18 +45,22 @@
45
45
  "
46
46
  v-bind="field.props"
47
47
  />
48
- <wd-calendar
48
+ <wd-datetime-picker
49
49
  v-else-if="field.frontInputType === 'date'"
50
50
  :label="field.fieldCustomName"
51
51
  v-model="form[field.field]"
52
52
  :required="field.requiredFlag"
53
53
  :prop="field.field"
54
+ :type="getDateType(field.frontInputTypeValue)"
54
55
  :rules="
55
56
  field.requiredFlag
56
57
  ? [{ required: true, message: t('请选择') + field.fieldCustomName }]
57
58
  : []
58
59
  "
59
- v-bind="field.props"
60
+ v-bind="{
61
+ ...field.props,
62
+ ...getDateOptions(field.frontInputContent),
63
+ }"
60
64
  />
61
65
  <!-- radio -->
62
66
  <wd-cell
@@ -95,30 +99,69 @@
95
99
  {{ item }}
96
100
  </wd-radio>
97
101
  </wd-radio-group>
102
+ <!-- checkbox -->
103
+ <wd-checkbox-group
104
+ v-else-if="field.frontInputType === 'checkbox'"
105
+ v-model="form[field.field]"
106
+ v-bind="field.props"
107
+ >
108
+ <wd-checkbox
109
+ v-for="item in getColumns(field.frontInputContent)"
110
+ :key="item"
111
+ :modelValue="item"
112
+ >
113
+ {{ item }}
114
+ </wd-checkbox>
115
+ </wd-checkbox-group>
116
+ <!-- checkboxTag -->
117
+ <wd-checkbox-group
118
+ v-else-if="field.frontInputType === 'checkboxTag'"
119
+ v-model="form[field.field]"
120
+ v-bind="field.props"
121
+ shape="button"
122
+ >
123
+ <wd-checkbox
124
+ v-for="item in getColumns(field.frontInputContent)"
125
+ :key="item"
126
+ :modelValue="item"
127
+ >
128
+ {{ item }}
129
+ </wd-checkbox>
130
+ </wd-checkbox-group>
98
131
  <wd-upload
99
132
  v-else-if="field.frontInputType === 'img'"
100
133
  :label="field.fieldCustomName"
101
134
  accept="image"
102
135
  :limit="1"
136
+ v-model:file-list="imgList[field.field]"
103
137
  :upload-method="customUpload"
104
138
  v-bind="field.props"
105
139
  />
106
140
  </wd-cell>
107
141
  </block>
108
142
  </wd-cell-group>
109
- <view class="text-center text-3 mt-6" v-if="agreementType">
143
+ <view class="text-center text-3 mt-6" v-if="agreementType && fields">
110
144
  <wd-checkbox v-model="form.agreement">
111
145
  <view class="flex">
112
146
  <text>{{ t('同意') }}</text>
113
- <lcb-agreement-view :type="agreementType">
114
- <template v-slot="{ text }">
115
- <text class="text-primary">《{{ text }}》</text>
116
- </template>
117
- </lcb-agreement-view>
147
+ <view @click.stop>
148
+ <lcb-agreement-view :type="agreementType">
149
+ <template v-slot="{ text }">
150
+ <text class="text-primary">《{{ text }}》</text>
151
+ </template>
152
+ </lcb-agreement-view>
153
+ </view>
118
154
  </view>
119
155
  </wd-checkbox>
120
156
  </view>
121
- <wd-button type="primary" @click="submit" block size="large" class="!w-90% my-3">
157
+ <wd-button
158
+ type="primary"
159
+ @click="submit"
160
+ block
161
+ size="large"
162
+ custom-class="!w-90% my-3"
163
+ v-if="fields"
164
+ >
122
165
  {{ t(submitText) }}
123
166
  </wd-button>
124
167
  </wd-form>
@@ -130,6 +173,7 @@ import { ref, watch } from 'vue'
130
173
  import { LcbFormField, LcbFormProps } from './types'
131
174
  import { customUpload } from '../../utils/utils'
132
175
  import { useTranslate } from '@tplc/wot'
176
+ import { DateTimeType } from '@tplc/wot/types/components/wd-datetime-picker-view/types'
133
177
  defineOptions({
134
178
  name: 'LcbForm',
135
179
  options: {
@@ -142,6 +186,7 @@ const { translate: t } = useTranslate()
142
186
  const form = ref({
143
187
  agreement: false,
144
188
  })
189
+ const imgList = ref({})
145
190
  const formRef = ref()
146
191
  const props = withDefaults(defineProps<LcbFormProps>(), {
147
192
  submitText: '提交',
@@ -156,6 +201,19 @@ watch(
156
201
  } = await uni.$lcb.http.post<any>('/entryFormCustom/detail', {
157
202
  entryFormConfigId: newVal,
158
203
  })
204
+ entryFormFieldConfigList.forEach((item) => {
205
+ if (item.value) {
206
+ if (item.frontInputType === 'img') {
207
+ imgList.value[item.field] = [{ url: item.value }]
208
+ } else if (item.frontInputType === 'checkboxTag' || item.frontInputType === 'checkbox') {
209
+ form.value[item.field] = JSON.parse(item.value)
210
+ } else if (item.frontInputType === 'date') {
211
+ form.value[item.field] = Number(item.value)
212
+ } else {
213
+ form.value[item.field] = item.value
214
+ }
215
+ }
216
+ })
159
217
 
160
218
  fields.value = entryFormFieldConfigList
161
219
  }
@@ -173,28 +231,61 @@ const submit = () => {
173
231
  })
174
232
  return
175
233
  }
176
- formRef.value.validate().then(async (res) => {
234
+ formRef.value.validate().then(async ({ valid }) => {
235
+ if (!valid) return
177
236
  if (props.submitUrl) {
237
+ const values = fields.value?.reduce((acc, cur) => {
238
+ if (cur.frontInputType === 'img') {
239
+ const imgInfo = imgList.value[cur.field]?.[0]
240
+ acc[cur.field] = imgInfo?.response || imgInfo?.url
241
+ } else {
242
+ acc[cur.field] = form.value[cur.field]
243
+ }
244
+ return acc
245
+ }, {})
178
246
  await uni.$lcb.http.post(props.submitUrl, {
179
247
  entryFormConfigId: props.formType,
180
- allField: JSON.stringify(res),
181
- })
182
- uni.showToast({
183
- title: t('提交成功'),
184
- icon: 'success',
248
+ allField: JSON.stringify(values),
185
249
  })
186
250
  }
187
251
  })
188
252
  }
253
+ const getDateType = (frontInputTypeValue: string) => {
254
+ return ({
255
+ day: 'date',
256
+ year: 'year',
257
+ month: 'year-month',
258
+ }[frontInputTypeValue] || 'time') as DateTimeType
259
+ }
260
+ const getDateOptions = (frontInputContent: string) => {
261
+ if (frontInputContent.includes('[')) return {}
262
+ const data = JSON.parse(frontInputContent || '{}')
263
+ return {
264
+ ...data,
265
+ defaultValue: data.defaultDate,
266
+ }
267
+ }
189
268
  </script>
190
269
 
191
- <style lang="scss" scoped>
270
+ <style lang="scss">
192
271
  .lcb-form {
193
272
  :deep(.wd-radio) {
194
- line-height: inherit;
273
+ line-height: inherit !important;
195
274
  }
196
275
  :deep(.wd-radio-group) {
197
- text-align: left;
276
+ text-align: left !important;
277
+ display: flex;
278
+ flex-wrap: wrap;
279
+ gap: 8rpx;
280
+ }
281
+ :deep(.wd-checkbox) {
282
+ line-height: inherit !important;
283
+ }
284
+ :deep(.wd-checkbox-group) {
285
+ text-align: left !important;
286
+ display: flex;
287
+ flex-wrap: wrap;
288
+ gap: 8rpx;
198
289
  }
199
290
  }
200
291
  </style>
@@ -57,6 +57,19 @@ export interface LcbFormField {
57
57
  * 组件的props
58
58
  */
59
59
  props: Record<string, any>
60
+ range: string[]
61
+ /**
62
+ * 最小日期
63
+ */
64
+ minDate: number
65
+ /**
66
+ * 最大日期
67
+ */
68
+ maxDate: number
69
+ /**
70
+ * 默认日期
71
+ */
72
+ defaultDate: number
60
73
  }
61
74
  export interface LcbFormProps extends LcbBlockProps {
62
75
  fields: LcbFormField[]
@@ -7,7 +7,9 @@
7
7
  @refresh="$emit('refresh', { item })"
8
8
  @nav="$emit('cancel')"
9
9
  >
10
- <wd-button v-bind="getBtnProps(item)" :size="size">{{ item.buttonName }}</wd-button>
10
+ <wd-button v-bind="getBtnProps(item)" :size="size">
11
+ {{ item.buttonName || item.name }}
12
+ </wd-button>
11
13
  </lcb-action-view>
12
14
  <view class="absolute">
13
15
  <wd-message-box />
@@ -40,8 +42,14 @@ withDefaults(defineProps<LcbOperationActionsProps>(), {
40
42
  const emits = defineEmits(['refresh', 'cancel'])
41
43
  const getBtnProps = (item: IPageBtn) => {
42
44
  return {
43
- type: item.styleContent?.buttonType?.includes?.('theme') ? 'primary' : 'info',
44
- plain: item.styleContent?.buttonType?.includes?.('Hollow'),
45
+ type:
46
+ Number(item.styleContent?.buttonType) === 6 ||
47
+ item.styleContent?.buttonType?.includes?.('theme')
48
+ ? 'primary'
49
+ : 'info',
50
+ plain:
51
+ Number(item.styleContent?.buttonType) === 6 ||
52
+ item.styleContent?.buttonType?.includes?.('Hollow'),
45
53
  size: 'small',
46
54
  ...item.buttonProps,
47
55
  } as ButtonProps
@@ -1,7 +1,10 @@
1
1
  <template>
2
2
  <view class="flex flex-col items-center min-h-56rpx justify-center">
3
3
  <image :src="icon" class="w-5.5 h-5.5 box-border mb-1" v-if="icon" />
4
- <view class="text-24rpx" :style="{ color: iconNameColor || '#000000' }">
4
+ <view
5
+ class="text-24rpx flex-shrink-0 whitespace-nowrap"
6
+ :style="{ color: iconNameColor || '#000000' }"
7
+ >
5
8
  {{ iconName }}
6
9
  </view>
7
10
  </view>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <view @click.stop class="w-full page-btn-view">
3
- <view class="flex gap-5 w-full items-center">
3
+ <view class="flex gap-3 w-full items-center">
4
4
  <block v-for="(item, index) in iconList" :key="item.iconName">
5
5
  <wd-popover
6
6
  mode="menu"
@@ -14,6 +14,7 @@ export interface IconList {
14
14
  export interface IPageBtn {
15
15
  buttonKey: string
16
16
  buttonName: string
17
+ name: string
17
18
  buttonType: number
18
19
  popUpFlag: boolean
19
20
  popUpTip: string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.93",
3
+ "version": "0.3.95",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -56,6 +56,19 @@ export interface LcbFormField {
56
56
  * 组件的props
57
57
  */
58
58
  props: Record<string, any>
59
+ range: string[]
60
+ /**
61
+ * 最小日期
62
+ */
63
+ minDate: number
64
+ /**
65
+ * 最大日期
66
+ */
67
+ maxDate: number
68
+ /**
69
+ * 默认日期
70
+ */
71
+ defaultDate: number
59
72
  }
60
73
  export interface LcbFormProps extends LcbBlockProps {
61
74
  fields: LcbFormField[]
@@ -12,6 +12,7 @@ export interface IconList {
12
12
  export interface IPageBtn {
13
13
  buttonKey: string
14
14
  buttonName: string
15
+ name: string
15
16
  buttonType: number
16
17
  popUpFlag: boolean
17
18
  popUpTip: string