@tplc/business 0.3.95 → 0.3.97

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,20 @@
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.97](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.96...v0.3.97) (2025-03-21)
6
+
7
+
8
+ ### ✨ Features | 新功能
9
+
10
+ * 新增tag ([74b9c29](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/74b9c2971b69986c6c0428406eeca0a57d66eef4))
11
+
12
+ ### [0.3.96](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.95...v0.3.96) (2025-03-21)
13
+
14
+
15
+ ### ✨ Features | 新功能
16
+
17
+ * 调整底部数据 ([9f72871](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/commit/9f72871c2c3b3a70c2140828182cd3ecd527a3f7))
18
+
5
19
  ### [0.3.95](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.3.93...v0.3.95) (2025-03-21)
6
20
 
7
21
 
@@ -10,11 +10,7 @@
10
10
  :label="field.fieldCustomName"
11
11
  :required="field.requiredFlag"
12
12
  :prop="field.field"
13
- :rules="
14
- field.requiredFlag
15
- ? [{ required: true, message: t('请输入') + field.fieldCustomName }]
16
- : []
17
- "
13
+ :rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
18
14
  v-bind="field.props"
19
15
  />
20
16
  <wd-textarea
@@ -24,11 +20,7 @@
24
20
  :label="field.fieldCustomName"
25
21
  :required="field.requiredFlag"
26
22
  :prop="field.field"
27
- :rules="
28
- field.requiredFlag
29
- ? [{ required: true, message: t('请输入') + field.fieldCustomName }]
30
- : []
31
- "
23
+ :rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
32
24
  v-bind="field.props"
33
25
  />
34
26
  <wd-picker
@@ -38,11 +30,7 @@
38
30
  v-model="form[field.field]"
39
31
  :required="field.requiredFlag"
40
32
  :prop="field.field"
41
- :rules="
42
- field.requiredFlag
43
- ? [{ required: true, message: t('请选择') + field.fieldCustomName }]
44
- : []
45
- "
33
+ :rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
46
34
  v-bind="field.props"
47
35
  />
48
36
  <wd-datetime-picker
@@ -52,11 +40,7 @@
52
40
  :required="field.requiredFlag"
53
41
  :prop="field.field"
54
42
  :type="getDateType(field.frontInputTypeValue)"
55
- :rules="
56
- field.requiredFlag
57
- ? [{ required: true, message: t('请选择') + field.fieldCustomName }]
58
- : []
59
- "
43
+ :rules="field.requiredFlag ? [{ required: true, message: t('内容不能为空') }] : []"
60
44
  v-bind="{
61
45
  ...field.props,
62
46
  ...getDateOptions(field.frontInputContent),
@@ -69,6 +53,16 @@
69
53
  :required="field.requiredFlag"
70
54
  :prop="field.field"
71
55
  title-width="230rpx"
56
+ :rules="
57
+ field.requiredFlag
58
+ ? [
59
+ {
60
+ required: true,
61
+ message: t('内容不能为空'),
62
+ },
63
+ ]
64
+ : []
65
+ "
72
66
  >
73
67
  <wd-radio-group
74
68
  v-if="field.frontInputType === 'radio'"
@@ -235,12 +229,7 @@ const submit = () => {
235
229
  if (!valid) return
236
230
  if (props.submitUrl) {
237
231
  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
- }
232
+ acc[cur.field] = form.value[cur.field]
244
233
  return acc
245
234
  }, {})
246
235
  await uni.$lcb.http.post(props.submitUrl, {
@@ -265,12 +254,22 @@ const getDateOptions = (frontInputContent: string) => {
265
254
  defaultValue: data.defaultDate,
266
255
  }
267
256
  }
257
+ watch(
258
+ imgList,
259
+ (newVal) => {
260
+ Object.keys(newVal).forEach((key) => {
261
+ form.value[key] = newVal[key][0]?.url || newVal[key][0]?.response
262
+ })
263
+ },
264
+ { deep: true },
265
+ )
268
266
  </script>
269
267
 
270
268
  <style lang="scss">
271
269
  .lcb-form {
272
270
  :deep(.wd-radio) {
273
271
  line-height: inherit !important;
272
+ padding: 0px;
274
273
  }
275
274
  :deep(.wd-radio-group) {
276
275
  text-align: left !important;
@@ -26,7 +26,7 @@ const useSelect = (
26
26
  onMounted(async () => {
27
27
  if (props.apiPath) {
28
28
  // 调用接口获取数据
29
- const { data } = await uni.$lcb.http.get<Option[]>(props.apiPath)
29
+ const { data } = await uni.$lcb.http.post<Option[]>(props.apiPath, props.apiParams || {})
30
30
  options.value = data
31
31
  }
32
32
  })
@@ -31,6 +31,7 @@ export interface Option {
31
31
  export interface FilterItemProps {
32
32
  mode?: 'multiple' | 'single'
33
33
  apiPath?: string
34
+ apiParams?: Record<string, any>
34
35
  options?: Option[]
35
36
  test?: 1
36
37
  }
@@ -59,7 +59,7 @@ defineProps({
59
59
  const form = inject<Ref<Record<string, any>>>(FORM_KEY)
60
60
  const onSearch = ({ value }: { value: string }) => {
61
61
  if (form) {
62
- form.value.search = value
62
+ form.value.keywords = value
63
63
  }
64
64
  }
65
65
  </script>
@@ -108,7 +108,7 @@ getLocation()
108
108
  const form = inject<Ref<Record<string, any>>>(FORM_KEY)
109
109
  const onSearch = (e: { detail: { value: string } }) => {
110
110
  if (form) {
111
- form.value.search = e.detail.value
111
+ form.value.keywords = e.detail.value
112
112
  }
113
113
  }
114
114
  </script>
@@ -0,0 +1,75 @@
1
+ <template>
2
+ <view class="w-100vw">
3
+ <lcb-block v-bind="$props">
4
+ <view
5
+ :class="{
6
+ 'flex flex-wrap': tagsMode === 'tiled',
7
+ 'flex whitespace-nowrap overflow-x-auto': tagsMode === 'scroll',
8
+ }"
9
+ :style="{
10
+ gap: transformValueUnit(gap),
11
+ }"
12
+ >
13
+ <view
14
+ v-for="(item, index) in items"
15
+ :key="index"
16
+ class="lcb-tag"
17
+ :class="{
18
+ 'lcb-tag-active': current === index,
19
+ 'inline-block': tagsMode === 'scroll',
20
+ }"
21
+ :style="{
22
+ fontSize: transformValueUnit(itemFontSize),
23
+ }"
24
+ @click="handleTagClick(item.name, index)"
25
+ >
26
+ {{ item.title }}
27
+ </view>
28
+ </view>
29
+ </lcb-block>
30
+ </view>
31
+ </template>
32
+
33
+ <script setup lang="ts">
34
+ import { FORM_KEY } from '../../../../constants'
35
+ import { LcbTabsProps } from '../../types'
36
+ import { inject, ref, Ref } from 'vue'
37
+ import { transformValueUnit } from '../../../../utils/transform'
38
+
39
+ withDefaults(defineProps<LcbTabsProps>(), {})
40
+ const form = inject<Ref<Record<string, any>>>(FORM_KEY)
41
+ const current = ref()
42
+ defineOptions({
43
+ name: 'LcbTagsItem',
44
+ options: {
45
+ addGlobalClass: true,
46
+ virtualHost: true,
47
+ styleIsolation: 'shared',
48
+ },
49
+ })
50
+ const handleTagClick = (name: string, index: number) => {
51
+ current.value = index
52
+ try {
53
+ const params = JSON.parse(name)
54
+ form!.value = {
55
+ ...form!.value,
56
+ ...params,
57
+ }
58
+ } catch (error) {
59
+ console.error(error)
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <style lang="scss" scoped>
65
+ @import '@tplc/wot/components/common/abstracts/variable';
66
+ .lcb-tag {
67
+ padding: 8rpx 32rpx;
68
+ border-radius: 10000rpx;
69
+ background-color: #eeeeee;
70
+ }
71
+ .lcb-tag-active {
72
+ background-color: $-color-theme;
73
+ color: #ffffff;
74
+ }
75
+ </style>
@@ -1,13 +1,16 @@
1
1
  <template>
2
2
  <wd-sticky v-if="sticky">
3
- <Tabs v-bind="$props" />
3
+ <Tabs v-bind="$props" v-if="mode === 'tabs'" />
4
+ <Tags v-bind="$props" v-else />
4
5
  </wd-sticky>
5
- <Tabs v-else v-bind="$props" />
6
+ <Tabs v-else-if="mode === 'tabs'" v-bind="$props" />
7
+ <Tags v-else v-bind="$props" />
6
8
  </template>
7
9
 
8
10
  <script setup lang="ts">
9
11
  import { LcbTabsProps } from './types'
10
12
  import Tabs from './components/Tabs/index.vue'
13
+ import Tags from './components/Tags/index.vue'
11
14
  defineOptions({
12
15
  name: 'LcbTabs',
13
16
  options: {
@@ -18,6 +21,8 @@ defineOptions({
18
21
  })
19
22
  withDefaults(defineProps<LcbTabsProps>(), {
20
23
  itemFontSize: 28,
24
+ tagsMode: 'tiled',
25
+ gap: 16,
21
26
  })
22
27
  </script>
23
28
 
@@ -12,4 +12,7 @@ export interface LcbTabsProps extends LcbBlockProps {
12
12
  slidable?: 'always' | 'auto'
13
13
  slidableNum?: number
14
14
  itemFontSize?: number
15
+ mode?: 'tabs' | 'block'
16
+ tagsMode?: 'scroll' | 'tiled'
17
+ gap?: number
15
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tplc/business",
3
- "version": "0.3.95",
3
+ "version": "0.3.97",
4
4
  "keywords": [
5
5
  "业务组件"
6
6
  ],
@@ -29,6 +29,7 @@ export interface Option {
29
29
  export interface FilterItemProps {
30
30
  mode?: 'multiple' | 'single'
31
31
  apiPath?: string
32
+ apiParams?: Record<string, any>
32
33
  options?: Option[]
33
34
  test?: 1
34
35
  }
@@ -1,6 +1,6 @@
1
- import type { LcbTagsItemProps } from '../types'
1
+ import { LcbTabsProps } from '../../types'
2
2
  declare const _default: import('vue').DefineComponent<
3
- __VLS_WithDefaults<__VLS_TypePropsToOption<LcbTagsItemProps>, {}>,
3
+ __VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>,
4
4
  {},
5
5
  unknown,
6
6
  {},
@@ -11,9 +11,7 @@ declare const _default: import('vue').DefineComponent<
11
11
  string,
12
12
  import('vue').PublicProps,
13
13
  Readonly<
14
- import('vue').ExtractPropTypes<
15
- __VLS_WithDefaults<__VLS_TypePropsToOption<LcbTagsItemProps>, {}>
16
- >
14
+ import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<LcbTabsProps>, {}>>
17
15
  >,
18
16
  {},
19
17
  {}
@@ -4,6 +4,8 @@ declare const _default: import('vue').DefineComponent<
4
4
  __VLS_TypePropsToOption<LcbTabsProps>,
5
5
  {
6
6
  itemFontSize: number
7
+ tagsMode: string
8
+ gap: number
7
9
  }
8
10
  >,
9
11
  {},
@@ -21,12 +23,16 @@ declare const _default: import('vue').DefineComponent<
21
23
  __VLS_TypePropsToOption<LcbTabsProps>,
22
24
  {
23
25
  itemFontSize: number
26
+ tagsMode: string
27
+ gap: number
24
28
  }
25
29
  >
26
30
  >
27
31
  >,
28
32
  {
33
+ gap: number
29
34
  itemFontSize: number
35
+ tagsMode: 'scroll' | 'tiled'
30
36
  },
31
37
  {}
32
38
  >
@@ -11,4 +11,7 @@ export interface LcbTabsProps extends LcbBlockProps {
11
11
  slidable?: 'always' | 'auto'
12
12
  slidableNum?: number
13
13
  itemFontSize?: number
14
+ mode?: 'tabs' | 'block'
15
+ tagsMode?: 'scroll' | 'tiled'
16
+ gap?: number
14
17
  }
@@ -1,28 +0,0 @@
1
- <template>
2
- <view v-for="(item, index) in items" :key="index" class="px-8rpx py-5rpx">
3
- <view
4
- class="border-solid border-1 flex py-4rpx px-6rpx leading-none"
5
- :style="{
6
- borderRadius: transformValueUnit(tagRadius),
7
- fontSize: transformValueUnit(fontSize),
8
- color: tagColor,
9
- borderColor: tagColor,
10
- }"
11
- >
12
- <view>{{ item }}</view>
13
- </view>
14
- </view>
15
- </template>
16
-
17
- <script setup lang="ts">
18
- import type { LcbTagsItemProps } from '../types'
19
- import { transformValueUnit } from '../../../utils/transform'
20
-
21
- // defineProps<LcbImageProps>() @click="onClickItem(each.urlObj)"
22
-
23
- const props = withDefaults(defineProps<LcbTagsItemProps>(), {})
24
- </script>
25
- <style lang="scss" scoped>
26
- .tag {
27
- }
28
- </style>
@@ -1,42 +0,0 @@
1
- <template>
2
- <lcb-block v-bind="$props">
3
- <scroll-view v-if="mode == 1" scroll-x class="w-full whitespace-nowrap">
4
- <view class="flex shrink-0 h-46rpx relative -mx-8rpx">
5
- <Tag v-bind="itemProps" />
6
- </view>
7
- </scroll-view>
8
- <view v-if="mode == 2" class="flex flex-wrap relative -mx-8rpx">
9
- <Tag v-bind="itemProps" />
10
- </view>
11
- </lcb-block>
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import { LcbTagsProps } from './types'
16
- import Tag from './Tag/index.vue'
17
- import { computed } from 'vue'
18
- import { formatJson } from '../../utils/utils'
19
- defineOptions({
20
- name: 'LcbTags',
21
- options: {
22
- addGlobalClass: true,
23
- virtualHost: true,
24
- styleIsolation: 'shared',
25
- },
26
- })
27
- const props = withDefaults(defineProps<LcbTagsProps>(), {
28
- fontSize: 24,
29
- tagColor: '#000',
30
- })
31
- const itemProps = computed(() => {
32
- const data = props.items
33
- return {
34
- items: typeof data === 'object' ? data : formatJson(data, []),
35
- fontSize: props.fontSize,
36
- tagRadius: props.tagRadius,
37
- tagColor: props.tagColor,
38
- }
39
- })
40
- </script>
41
-
42
- <style lang="scss" scoped></style>
@@ -1,30 +0,0 @@
1
- // interface ActionView {
2
- // title: string
3
- // icon?: string
4
- // link: LcbActionViewProps
5
- // url?: string
6
- // mode: number
7
- // hotSpot?: {
8
- // x: number
9
- // y: number
10
- // width: number
11
- // height: number
12
- // urlObj: LcbActionViewProps
13
- // }[]
14
- // }
15
-
16
- export interface LcbTagsProps {
17
- // Define the component's prop types here
18
- items?: any
19
- mode?: 1 | 2 // 1是不换行滚动 这是加在大部分产品里的用法 2是自然换行
20
- tagRadius?: number
21
- fontSize?: number
22
- tagColor?: string
23
- }
24
-
25
- export interface LcbTagsItemProps {
26
- items: object[]
27
- tagRadius?: number
28
- fontSize?: number
29
- tagColor?: string
30
- }
@@ -1,59 +0,0 @@
1
- import { LcbTagsProps } from './types'
2
- declare const _default: import('vue').DefineComponent<
3
- __VLS_WithDefaults<
4
- __VLS_TypePropsToOption<LcbTagsProps>,
5
- {
6
- fontSize: number
7
- tagColor: 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<LcbTagsProps>,
23
- {
24
- fontSize: number
25
- tagColor: string
26
- }
27
- >
28
- >
29
- >,
30
- {
31
- fontSize: number
32
- tagColor: 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
- }
@@ -1,13 +0,0 @@
1
- export interface LcbTagsProps {
2
- items?: any
3
- mode?: 1 | 2
4
- tagRadius?: number
5
- fontSize?: number
6
- tagColor?: string
7
- }
8
- export interface LcbTagsItemProps {
9
- items: object[]
10
- tagRadius?: number
11
- fontSize?: number
12
- tagColor?: string
13
- }