w-ui-v1 1.1.46 → 1.1.47

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-ui-v1",
3
- "version": "1.1.46",
3
+ "version": "1.1.47",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
@@ -254,7 +254,15 @@
254
254
  // 获取页面配置
255
255
  function getPageConfig() {
256
256
  pageConfig(props.sourceId).then((res : any) => {
257
- ltmplConfig.value = res.data.ltmplConfig
257
+ // 字段名映射:API返回criterias/primaryCriteria等,统一转为新命名
258
+ const cfg = res.data.ltmplConfig
259
+ ltmplConfig.value = {
260
+ ...cfg,
261
+ criteria: cfg.criterias || cfg.criteria || [],
262
+ primaryCriterion: cfg.primaryCriterion || cfg.primaryCriteria || {},
263
+ secondCriterion: cfg.secondCriterion || cfg.secondCriteria || {},
264
+ thirdCriterion: cfg.thirdCriterion || cfg.thirdCriteria || {},
265
+ }
258
266
  scrolltolower()
259
267
  })
260
268
  }
@@ -89,8 +89,18 @@ watch(() => props.sourceId, (value) => {
89
89
  // 获取页面配置
90
90
  function getPageConfig() {
91
91
  pageConfig(sourceId.value).then(async(res: any) => {
92
- pageData.value = res.data.ltmplConfig
93
- console.log(pageData.value,'322222')
92
+ // 字段名映射:API返回criterias/primaryCriteria,组件使用criteria/primaryCriterion
93
+ const cfg = res.data.ltmplConfig
94
+ pageData.value = {
95
+ criteria: cfg.criterias || cfg.criteria || [],
96
+ buttons: cfg.buttons || [],
97
+ primaryCriterion: cfg.primaryCriterion || cfg.primaryCriteria || {},
98
+ defaultCriteriaValue: cfg.defaultCriteriaValue || {},
99
+ secondCriterion: cfg.secondCriterion || cfg.secondCriteria || {},
100
+ thirdCriterion: cfg.thirdCriterion || cfg.thirdCriteria || {},
101
+ ...cfg
102
+ }
103
+ console.log(pageData.value,'322222')
94
104
  //获取枚举
95
105
  Enumcolumn.value=await getEnumer(pageData.value)
96
106
  })
@@ -167,7 +177,7 @@ defineExpose({
167
177
  <view v-if="props.showSearch">
168
178
  <view >
169
179
  <!-- 搜索 -->
170
- <wSearch :primaryCriterion="pageData.primaryCriteria" :criteria="pageData.criterias" @search="search" v-if="pageData.buttons.includes('query')">
180
+ <wSearch :primaryCriterion="pageData.primaryCriterion" :criteria="pageData.criteria" @search="search" v-if="pageData.buttons.includes('query')">
171
181
  </wSearch>
172
182
 
173
183
  </view>