vome-core 0.0.91 → 0.0.92
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.
|
@@ -27,7 +27,7 @@ const props = withDefaults(
|
|
|
27
27
|
modelValue?: number | string | boolean
|
|
28
28
|
activeValue?: number | string | boolean
|
|
29
29
|
inactiveValue?: number | string | boolean
|
|
30
|
-
/**
|
|
30
|
+
/** 二值字典(dict.get),优先于 active/inactive */
|
|
31
31
|
options?: DictOpt[]
|
|
32
32
|
/** 行数据(表格内) */
|
|
33
33
|
scope?: Record<string, unknown>
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
resolveRangePlaceholders,
|
|
66
66
|
} from './style'
|
|
67
67
|
import { resolveCrudComponent } from './registry'
|
|
68
|
-
import {
|
|
68
|
+
import { getDict } from '../../client/dict'
|
|
69
69
|
defineOptions({ name: 'vm-search' })
|
|
70
70
|
|
|
71
71
|
const props = withDefaults(
|
|
@@ -131,15 +131,15 @@ function resolveOptions(
|
|
|
131
131
|
return Array.isArray(list) ? list : []
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/** 筛选项 options:优先 EPS
|
|
134
|
+
/** 筛选项 options:优先 EPS 本地一级字典,禁止请求 /data */
|
|
135
135
|
function optionsOf(item: CrudSearchItem) {
|
|
136
136
|
if (item.dict) {
|
|
137
|
-
return
|
|
137
|
+
return getDict(item.dict).map((row) => {
|
|
138
138
|
let value: string | number | boolean = row.value as string | number | boolean
|
|
139
139
|
if (typeof row.value === 'string' && /^-?\d+(\.\d+)?$/.test(row.value)) {
|
|
140
140
|
value = Number(row.value)
|
|
141
141
|
}
|
|
142
|
-
return { label: String(row.label ?? row.value ?? ''), value }
|
|
142
|
+
return { label: String(row.label ?? row.name ?? row.value ?? ''), value }
|
|
143
143
|
})
|
|
144
144
|
}
|
|
145
145
|
return resolveOptions(item.options)
|
|
@@ -597,13 +597,13 @@ function cellComp(col: CrudColumn) {
|
|
|
597
597
|
return resolveCrudComponent(col.component?.name)
|
|
598
598
|
}
|
|
599
599
|
|
|
600
|
-
/** dict: dict.options('x') →
|
|
600
|
+
/** dict: dict.options('x') → 彩色标签;props 可为 dict.get(...) → switch 等 */
|
|
601
601
|
function resolveDict(col: CrudColumn) {
|
|
602
602
|
const list = col.dict == null ? [] : toValue(col.dict)
|
|
603
603
|
return Array.isArray(list) ? list : []
|
|
604
604
|
}
|
|
605
605
|
|
|
606
|
-
/** props 可为 dict.
|
|
606
|
+
/** props 可为 dict.get(...)(ComputedRef / 数组)→ 作 options */
|
|
607
607
|
function resolveCellOptions(col: CrudColumn) {
|
|
608
608
|
const fromDict = resolveDict(col)
|
|
609
609
|
if (fromDict.length) return fromDict
|
|
@@ -342,7 +342,7 @@ function resolveField(item: CrudFormItem) {
|
|
|
342
342
|
function fieldProps(item: CrudFormItem) {
|
|
343
343
|
const raw = item.component?.props
|
|
344
344
|
const unwrapped = toValue(raw)
|
|
345
|
-
// props: dict.
|
|
345
|
+
// props: dict.get('status') → 直接作 options(switch 等)
|
|
346
346
|
if (Array.isArray(unwrapped)) {
|
|
347
347
|
return {
|
|
348
348
|
options: unwrapped,
|
package/dist/index.js
CHANGED
|
@@ -28007,7 +28007,7 @@ function extractJsonObject(text) {
|
|
|
28007
28007
|
// package.json
|
|
28008
28008
|
var package_default = {
|
|
28009
28009
|
name: "vome-core",
|
|
28010
|
-
version: "0.0.
|
|
28010
|
+
version: "0.0.92",
|
|
28011
28011
|
description: "Vome framework \u2014 shared + Bun/Elysia server + Vue admin",
|
|
28012
28012
|
license: "MIT",
|
|
28013
28013
|
type: "module",
|
package/dist/server/index.js
CHANGED
|
@@ -35864,7 +35864,7 @@ function extractJsonObject(text) {
|
|
|
35864
35864
|
// package.json
|
|
35865
35865
|
var package_default = {
|
|
35866
35866
|
name: "vome-core",
|
|
35867
|
-
version: "0.0.
|
|
35867
|
+
version: "0.0.92",
|
|
35868
35868
|
description: "Vome framework \u2014 shared + Bun/Elysia server + Vue admin",
|
|
35869
35869
|
license: "MIT",
|
|
35870
35870
|
type: "module",
|