lw-cdp-ui 1.3.53 → 1.3.55

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.
@@ -90,54 +90,55 @@ export default {
90
90
  },
91
91
  // 获取组件属性
92
92
  getComponentProps(item) {
93
- let props = {}
93
+ let propsItem = {}
94
+ const { type, startPlaceholder, endPlaceholder, controlsPosition, items, ...options } = item?.options || {}
94
95
  if (item?.options) {
95
96
  // 通用属性
96
- props.placeholder = item.options.placeholder || ''
97
- props.clearable = item.options.clearable || true
98
- if (item.options.type) props.type = item.options.type
97
+ propsItem.placeholder = item.options.placeholder || ''
98
+ propsItem.clearable = item.options.clearable || true
99
+ if (item.options.type) propsItem.type = item.options.type
99
100
  if (item.options?.maxlength) {
100
- props.maxlength = item.options.maxlength
101
- props.showWordLimit = true // 正确启用字数统计
101
+ propsItem.maxlength = item.options.maxlength
102
+ propsItem.showWordLimit = true // 正确启用字数统计
102
103
  }
103
104
  if (item.options?.activeText) {
104
- props.maxlength = item.options.maxlength
105
- props.inlinePrompt = true
105
+ propsItem.maxlength = item.options.maxlength
106
+ propsItem.inlinePrompt = true
106
107
  }
107
108
 
108
109
  // 组件特有属性
109
110
  switch (item.component) {
110
111
  case 'select':
111
- props.filterable = true
112
+ propsItem.filterable = true
112
113
  break
113
114
  case 'date':
114
- props.type = item.options.type || 'date'
115
- props.startPlaceholder = item.options.startPlaceholder || '开始日期'
116
- props.endPlaceholder = item.options.endPlaceholder || '结束日期'
115
+ propsItem.type = type || 'date'
116
+ propsItem.startPlaceholder = startPlaceholder || '开始日期'
117
+ propsItem.endPlaceholder = endPlaceholder || '结束日期'
117
118
  break
118
119
  case 'number':
119
- props.controlsPosition = item.options.controlsPosition || 'right'
120
+ propsItem.controlsPosition = controlsPosition || 'right'
120
121
  break
121
122
  case 'treeSelect':
122
- props.data = item?.options?.items || []
123
+ propsItem.data = items || []
123
124
  break
124
125
  case 'cascader':
125
- props.options = item?.options?.items || []
126
+ propsItem.options = items || []
126
127
  break
127
128
  }
128
129
  }
129
130
 
130
- props = {
131
- ...item.options,
132
- ...props
131
+ propsItem = {
132
+ ...options,
133
+ ...propsItem
134
+ }
135
+ if ( item.component == 'cascader') {
136
+ console.log(propsItem)
133
137
  }
134
138
  // 清除
135
- delete props.disabled
136
- return props
139
+ delete propsItem.disabled
140
+ return propsItem
137
141
  }
138
142
  }
139
143
  }
140
- </script>
141
-
142
- <style>
143
- </style>
144
+ </script>
@@ -36,9 +36,18 @@
36
36
  <el-icon><el-icon-question-filled /></el-icon>
37
37
  </el-tooltip>
38
38
  </template>
39
-
39
+ <!-- cascader 组个组件有问题 动态加载下拉文字不会显示 -->
40
+ <template v-if="item.component == 'cascader'">
41
+ <el-cascader v-model="objItem.value"
42
+ style="width: 100%;"
43
+ :props="item?.options?.props"
44
+ :separator="item?.options?.separator"
45
+ :disabled="item?.options?.disabled"
46
+ :options="item?.options.items"
47
+ clearable></el-cascader>
48
+ </template>
40
49
  <!-- 动态组件 -->
41
- <template v-if="componentType.includes(item.component)">
50
+ <template v-else-if="componentType.includes(item.component)">
42
51
  <FormComponent v-model="objItem.value"
43
52
  :item="item"
44
53
  :disabled="item?.options?.disabled" />
@@ -27,8 +27,18 @@
27
27
  </div>
28
28
  </template>
29
29
  <template #default="{ row, $index, column }">
30
+ <!-- cascader 组个组件有问题 动态加载下拉文字不会显示 -->
31
+ <template v-if="item.component == 'cascader'">
32
+ <el-cascader v-model="row[item.name]"
33
+ style="width: 100%;"
34
+ :props="item?.options?.props"
35
+ :separator="item?.options?.separator"
36
+ :disabled="item?.options?.disabled"
37
+ :options="item?.options.items"
38
+ clearable></el-cascader>
39
+ </template>
30
40
  <!-- 动态组件 -->
31
- <template v-if="componentType.includes(item.component)">
41
+ <template v-else-if="componentType.includes(item.component)">
32
42
  <FormComponent v-model="row[item.name]"
33
43
  :size="config.size || 'small'"
34
44
  :item="item"