lw-cdp-ui 1.3.35 → 1.3.37

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.
@@ -15,12 +15,17 @@
15
15
  </ul>
16
16
  </el-affix>
17
17
 
18
- <el-tabs v-if="blackType === 'tabs'"
19
- v-model="activeIndex">
20
- <el-tab-pane :label="card[0].label"
21
- v-for="(card, index) in formItems"
22
- :name="index"></el-tab-pane>
23
- </el-tabs>
18
+ <div v-if="blackType === 'tabs'"
19
+ class="lw-radio-group">
20
+ <el-radio-group v-model="activeIndex">
21
+ <el-radio-button v-for="(card, index) in formItems"
22
+ :label="card[0].label"
23
+ :value="index" />
24
+ </el-radio-group>
25
+ <div class="btn-list">
26
+ <slot :name="formItems[activeIndex][0]?.options?.component"></slot>
27
+ </div>
28
+ </div>
24
29
 
25
30
  <el-skeleton v-if="renderLoading || Object.keys(form).length == 0"
26
31
  animated />
@@ -34,63 +39,59 @@
34
39
  v-loading="loading"
35
40
  :size="config?.size || 'default'"
36
41
  element-loading-text="Loading...">
37
- <div class="lw-form-mini-card"
38
- :class="{ hide: !isAllHide(card, index) }"
39
- v-for="(card, index) in formItems">
40
- <el-row v-show="activeIndex == index || blackType === 'card'"
41
- :gutter="15">
42
- <template v-for="(item, index) in card">
43
- <el-col :span="item.span || 24"
44
- v-if="!hideHandle(item) && !(blackType == 'tabs' && item.component == 'divider')">
45
- <ViewItem v-if="isView && !item?.options?.isInput"
46
- :item="item"
47
- :form="form"
48
- :index="index">
49
- <!-- 没有组件是component值 就是插槽名称 -->
50
- <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
51
- v-slot:[item.component]>
52
- <slot :name="item.component"
53
- :itemCur="item"
54
- :formCur="form">
55
- <el-tag type="danger">[{{ item.component }}]
56
- 没有这个默认组件也未自定义插槽内容</el-tag>
57
- </slot>
58
- </template>
59
- <template v-if="item?.options?.component"
60
- v-slot:[item?.options?.component]>
61
- <slot :name="item?.options?.component"></slot>
62
- </template>
42
+ <template v-for="(card, index) in formItems">
43
+ <div class="lw-form-mini-card"
44
+ v-if="isAllHide(card, index)">
45
+ <el-row v-show="activeIndex == index || blackType === 'card'"
46
+ :gutter="15">
47
+ <template v-for="(item, index) in card">
48
+ <el-col :span="item.span || 24"
49
+ v-if="!hideHandle(item) && !(blackType == 'tabs' && item.component == 'divider')">
50
+ <ViewItem v-if="isView && !item?.options?.isInput"
51
+ :item="item"
52
+ :form="form"
53
+ :index="index">
54
+ <!-- 没有组件是component值 就是插槽名称 -->
55
+ <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
56
+ v-slot:[item.component]>
57
+ <slot :name="item.component"
58
+ :itemCur="item"
59
+ :formCur="form">
60
+ <el-tag type="danger">[{{ item.component }}]
61
+ 没有这个默认组件也未自定义插槽内容</el-tag>
62
+ </slot>
63
+ </template>
64
+ <template v-if="item?.options?.component"
65
+ v-slot:[item?.options?.component]>
66
+ <slot :name="item?.options?.component"></slot>
67
+ </template>
68
+
69
+ </ViewItem>
70
+ <FormItem v-else
71
+ :item="item"
72
+ :form="form"
73
+ :index="index">
74
+ <!-- 没有组件是component值 就是插槽名称 -->
75
+ <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
76
+ v-slot:[item.component]>
77
+ <slot :name="item.component"
78
+ :itemCur="item"
79
+ :formCur="form">
80
+ <el-tag type="danger">[{{ item.component }}]
81
+ 没有这个默认组件也未自定义插槽内容</el-tag>
82
+ </slot>
83
+ </template>
84
+ <template v-if="item?.options?.component"
85
+ v-slot:[item?.options?.component]>
86
+ <slot :name="item?.options?.component"></slot>
87
+ </template>
88
+ </FormItem>
89
+ </el-col>
90
+ </template>
91
+ </el-row>
92
+ </div>
93
+ </template>
63
94
 
64
- </ViewItem>
65
- <FormItem v-else
66
- :item="item"
67
- :form="form"
68
- :index="index">
69
- <!-- 没有组件是component值 就是插槽名称 -->
70
- <template v-if="!['input', 'upload', 'checkbox', 'checkboxGroup', 'switch', 'select', 'treeSelect', 'cascader', 'date', 'number', 'radio', 'color', 'rate', 'slider','tags', 'divider'].includes(item.component)"
71
- v-slot:[item.component]>
72
- <slot :name="item.component"
73
- :itemCur="item"
74
- :formCur="form">
75
- <el-tag type="danger">[{{ item.component }}]
76
- 没有这个默认组件也未自定义插槽内容</el-tag>
77
- </slot>
78
- </template>
79
- <template v-if="item?.options?.component"
80
- v-slot:[item?.options?.component]>
81
- <slot :name="item?.options?.component"></slot>
82
- </template>
83
- </FormItem>
84
- </el-col>
85
- </template>
86
- </el-row>
87
- </div>
88
- <!-- <el-form-item v-if="!isView">
89
- <slot>
90
- <el-button type="primary"
91
- @click="submit">提交</el-button>
92
- </slot>
93
- </el-form-item> -->
94
95
  </el-form>
95
96
  </template>
96
97
 
@@ -390,7 +391,12 @@ export default {
390
391
  },
391
392
  // 是否全隐藏
392
393
  isAllHide(card, index) {
393
- return card.some(item => !this.hideHandle(item) && (this.activeIndex == index || this.blackType === 'card') && !(this.blackType == 'tabs' && item.component == 'divider'))
394
+ return card.some(
395
+ item =>
396
+ !this.hideHandle(item) &&
397
+ (this.activeIndex == index || this.blackType === 'card') &&
398
+ !(this.blackType == 'tabs' && item.component == 'divider')
399
+ )
394
400
  }
395
401
  }
396
402
  }
@@ -419,7 +425,10 @@ export default {
419
425
  display: none !important;
420
426
  }
421
427
  }
422
- .hide {
423
- display: none;
428
+ .lw-radio-group {
429
+ margin-bottom: 10px;
430
+ display: flex;
431
+ justify-content: space-between;
432
+ align-items: center;
424
433
  }
425
434
  </style>