wui-components-v2 1.1.88 → 1.1.90

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/api/login.ts CHANGED
@@ -12,12 +12,15 @@ export function pubKey(): Promise<any> {
12
12
  }
13
13
 
14
14
  // 登录
15
- export async function login(username: string, password: string, kaptchaToken: string = '', kaptchaText: string = ''): Promise<any> {
15
+ export async function login(
16
+ username: string,
17
+ password: string,
18
+ kaptchaToken: string = '',
19
+ kaptchaText: string = ''
20
+ ): Promise<any> {
16
21
  dayjs.extend(utc)
17
22
  dayjs.extend(timezone)
18
- const datetime = dayjs(new Date())
19
- .tz('Europe/London')
20
- .format('YYYY-MM-DD HH:mm:ss')
23
+ const datetime = dayjs(new Date()).tz('Europe/London').format('YYYY-MM-DD HH:mm:ss')
21
24
  const json = {
22
25
  username,
23
26
  password,
@@ -47,5 +50,6 @@ export function getKaptchaToken(): Promise<any> {
47
50
  export function getUserConfig(): Promise<any> {
48
51
  return req({
49
52
  url: `/v3/current-user`,
53
+ method: 'POST',
50
54
  })
51
55
  }
@@ -51,7 +51,11 @@ export function useCompanyFieldFilter(
51
51
  // 评估单条可用规则(usableRuleCriteria)的就绪/命中状态
52
52
  // criterion 通过 mstrucId 关联同一分组内的其它字段,再拿该字段在 model 中的实时值与 transDefaultValue 比对
53
53
  // 返回值:'empty'(依赖字段无数据)| 'match'(命中)| 'unmatch'(未命中)
54
- const evaluateCriterion = (criterion: any, fieldsMap: Map<string, any>, modelValue: any): 'empty' | 'match' | 'unmatch' => {
54
+ const evaluateCriterion = (
55
+ criterion: any,
56
+ fieldsMap: Map<string, any>,
57
+ modelValue: any
58
+ ): 'empty' | 'match' | 'unmatch' => {
55
59
  const target = criterion?.mstrucId ? fieldsMap.get(criterion.mstrucId) : null
56
60
  // 找不到被关联字段时 fail-open,视为命中,避免误隐藏
57
61
  if (!target) return 'match'
@@ -81,7 +85,7 @@ export function useCompanyFieldFilter(
81
85
  const baseHidden = item?.unusableMode === 'hidden'
82
86
  if (!isEnabled) return baseHidden
83
87
  const criteria = item?.usableRuleCriteria
84
- if (!criteria || criteria.length === 0) return baseHidden
88
+ if (!criteria || criteria.length === 0) return false
85
89
  // 任一依赖字段无数据 -> 隐藏
86
90
  if (criteria.some((c: any) => evaluateCriterion(c, fieldsMap, modelValue) === 'empty')) return true
87
91
  // 依赖就绪后:所有规则命中才显示
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.88",
3
+ "version": "1.1.90",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",