wui-components-v2 1.1.51 → 1.1.53

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.
@@ -40,12 +40,30 @@ export function useCompanyFieldFilter(
40
40
  )
41
41
  }
42
42
 
43
+ const formatFieldsItem=(company:string,item:any)=>{
44
+ const transDefaultValue = item.usableRuleCriterias[0]?.transDefaultValue||''
45
+ const isHidden=item?.unusableMode==='hidden'
46
+ const values = transDefaultValue.split(',').map(v => v.trim())
47
+ if(!company){
48
+ return {
49
+ ...item,
50
+ hidden:isHidden,
51
+ }
52
+ }else{
53
+
54
+ return {
55
+ ...item,
56
+ hidden: values.some(v => v.includes(company))?false:item.hidden,
57
+ }
58
+
59
+ }
60
+ }
43
61
  const filteredFields = computed(() => {
44
62
  const company = selectedCompany.value
45
63
  const allFields = fieldGroup()?.fields
46
64
  if (!allFields)
47
65
  return []
48
- return allFields.filter((item: any) => {
66
+ const formattedFields = allFields.filter((item: any) => {
49
67
  // 如果没有选中公司,所有字段都显示
50
68
  if (!company) {
51
69
  return true
@@ -63,6 +81,7 @@ export function useCompanyFieldFilter(
63
81
  }
64
82
  return true
65
83
  })
84
+ return formattedFields.map((item: any) => formatFieldsItem(company, item))
66
85
  })
67
86
  watch(filteredFields, (val) => {
68
87
  // console.log('filteredFields变化了', val, 'selectedCompany:', selectedCompany.value)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.51",
3
+ "version": "1.1.53",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",