w-ui-v1 1.0.87 → 1.0.89

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.0.87",
3
+ "version": "1.0.89",
4
4
  "description": "w-ui",
5
5
  "author": "wgxshh",
6
6
  "license": "ISC",
@@ -204,6 +204,7 @@ export const downloadFile = (url : any) => {
204
204
 
205
205
  //获取枚举颜色 content: 406795063630012418@R@轴2
206
206
  export const getEnumColor = (enumMap : any[] = [], content : string) => {
207
+ console.log(enumMap,content)
207
208
  if(typeof content!=='string') return null
208
209
  let css=enumMap.find((item : any) => {
209
210
 
package/w-card/w-card.vue CHANGED
@@ -44,7 +44,7 @@ const props = defineProps({
44
44
  default:{}
45
45
  }
46
46
  })
47
-
47
+ console.log(props.enumMap)
48
48
  //更多按钮
49
49
  const moreBtns = computed(() => {
50
50
  let data = []
@@ -230,17 +230,33 @@ const getTitleValue = (value: any, title: string) => {
230
230
  }
231
231
  return data
232
232
  }
233
+
234
+
233
235
  </script>
234
236
 
235
237
  <template>
236
238
  <wd-card >
237
239
  <template #title>
238
- <view class="card-title-class">
239
- <view class="title-icon"></view>
240
- <view style="flex: 1; word-break:break-all">
241
- {{getTitleValue(visibleItems.find((item) => item.id === page.primaryColumn?.id), page.primaryColumn?.title) || ' '}}
242
- </view>
243
- </view>
240
+ <view >
241
+ <view class="card-title-class">
242
+ <view class="title-icon"></view>
243
+ <view style="flex: 1; word-break:break-all">
244
+ {{getTitleValue(visibleItems.find((item) => item.id === page.primaryColumn?.id), page.primaryColumn?.title) || ' '}}
245
+ </view>
246
+ <!-- <view class="status-icon">
247
+ 已完成成成
248
+ </view> -->
249
+ <wd-tag style="font-size: 15px;padding:0 4px;" :bg-color="getEnumColor(enumMap[page.labelColumn.mstrucId],itemData.fieldMap[page.labelColumn.id]).color" v-if="page.labelColumn?.id">
250
+ {{
251
+ itemData.fieldMap[page.labelColumn.id]
252
+ }}
253
+ </wd-tag>
254
+ </view>
255
+ <view style="font-size: 12px;margin-top: 8px;color: #ffaa00;">
256
+ {{getTitleValue(visibleItems.find((item) => item.id === page.secondColumn?.id), page.secondColumn?.title)}}
257
+ </view>
258
+ </view>
259
+
244
260
  </template>
245
261
 
246
262
  <view class="table_collapse">
@@ -333,7 +349,7 @@ const getTitleValue = (value: any, title: string) => {
333
349
 
334
350
  color: #000;
335
351
  // background-color: #F8F8F8;
336
- padding: 20rpx;
352
+ padding:0 0 20rpx 0;
337
353
 
338
354
  /* 添加过渡动画 */
339
355
  .cloum {
@@ -399,6 +415,7 @@ const getTitleValue = (value: any, title: string) => {
399
415
  align-items: center;
400
416
  font-weight: 700 ;
401
417
  gap: 4px;
418
+
402
419
  }
403
420
  .title-icon{
404
421
  width: 8px;
@@ -406,6 +423,18 @@ const getTitleValue = (value: any, title: string) => {
406
423
  border-radius: 100%;
407
424
  background-color: #4d80f0;
408
425
  }
426
+ .status-icon{
427
+ box-sizing: border-box;
428
+ padding: 4px 15px;
429
+ transform: rotate(45deg) translate(15px,-15px);
430
+ text-align: center;
431
+ color: #fff;
432
+ font-size: 12px;
433
+ // width: 85px;
434
+ // height: 15px;
435
+ background-color: #4d80f0;
436
+ clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
437
+ }
409
438
  .btn {
410
439
  margin-left: 10rpx;
411
440
  }
@@ -5,8 +5,8 @@
5
5
  <!-- <view class="search-icon">
6
6
  <wd-icon name="search" size="12px" ></wd-icon>
7
7
  </view> -->
8
- <wd-drop-menu>
9
- <wd-drop-menu-item ref="dropMenu" title="搜索" @opened="handleOpened">
8
+ <wd-drop-menu >
9
+ <wd-drop-menu-item ref="dropMenu" title="更多" @opened="handleOpened">
10
10
  <view v-for="(item, index) in props.criterias" :key="index">
11
11
  <!-- <wSelectPicker :model-value="searchData[item.sourceId] ? searchData[item.sourceId].value : ''"
12
12
  v-if="item.extControlType === 'relselectvalue' || item.extControlType === 'entity-select'" type="radio"
@@ -51,7 +51,15 @@
51
51
  </wd-drop-menu-item>
52
52
  </wd-drop-menu>
53
53
  </view>
54
-
54
+ <view style="flex:1;" v-if="primaryCriteria?.extControlType==='text'">
55
+ <wd-search @clear="search" v-model="searchData[primaryCriteria.id]" :placeholder="`搜索${primaryCriteria.title}`">
56
+ <template #suffix>
57
+ <view @click="search" style="padding:0 8px;">
58
+ <wd-icon name="search" />
59
+ </view>
60
+ </template>
61
+ </wd-search>
62
+ </view>
55
63
  </view>
56
64
  </view>
57
65
  </template>
@@ -73,6 +81,11 @@
73
81
  criterias: {
74
82
  type: Array,
75
83
  default: []
84
+ },
85
+ //主搜索配置
86
+ primaryCriteria:{
87
+ type:Object,
88
+ default:{}
76
89
  }
77
90
  })
78
91
 
@@ -279,7 +292,7 @@
279
292
 
280
293
  <style scoped lang="scss">
281
294
  .search-box {
282
-
295
+ display: flex;
283
296
  .left {
284
297
  // position: relative;
285
298
 
@@ -43,7 +43,8 @@ const dataList = ref([])
43
43
  const pageData = ref<{
44
44
  criterias: []
45
45
  buttons: string[]
46
- }>({ criterias: [], buttons: [] })
46
+ primaryCriteria:{}
47
+ }>({ criterias: [], buttons: [], primaryCriteria:{}})
47
48
  onLoad((option: any) => {
48
49
  sourceId.value = props.sourceId || option.sourceId
49
50
  mainCode.value = props.mainCode ||option.mainCode
@@ -65,11 +66,11 @@ watch(() => props.sourceId, (value) => {
65
66
  immediate: false
66
67
  })
67
68
  // 获取页面配置
68
- function getPageConfig() {
69
- pageConfig(sourceId.value).then((res: any) => {
69
+ function getPageConfig() {
70
+ pageConfig(sourceId.value).then(async(res: any) => {
70
71
  pageData.value = res.data.ltmplConfig
71
72
  //获取枚举
72
- Enumcolumn.value=getEnumer(pageData.value)
73
+ Enumcolumn.value=await getEnumer(pageData.value)
73
74
  })
74
75
  }
75
76
 
@@ -119,16 +120,17 @@ function add() {
119
120
  <template>
120
121
  <z-paging ref="paging" v-model="dataList" :show-loading-more-when-reload="true" @query="queryList">
121
122
  <template #top>
122
- <view class="buttons">
123
+ <view >
123
124
  <!-- 搜索 -->
124
- <wSearch :criterias="pageData.criterias" @search="search" v-if="pageData.buttons.includes('query')">
125
+ <wSearch :primaryCriteria="pageData.primaryCriteria" :criterias="pageData.criterias" @search="search" v-if="pageData.buttons.includes('query')">
125
126
  </wSearch>
126
- <view>
127
- <slot name="buttons"></slot>
128
- <!-- 添加按钮 -->
129
- <wd-button v-if="pageData.buttons.includes('dtmplAdd')" type="icon" icon="add" @click="add" />
130
- </view>
127
+
131
128
  </view>
129
+ <view style="display: flex;justify-content: flex-end;">
130
+ <slot name="buttons"></slot>
131
+ <!-- 添加按钮 -->
132
+ <wd-button v-if="pageData.buttons.includes('dtmplAdd')" type="icon" icon="add" @click="add" />
133
+ </view>
132
134
  </template>
133
135
  <!-- 卡片 -->
134
136
  <view class="card-list" v-if="dataList.length > 0">