@ditari/store 5.1.2 → 5.1.3
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/dist/cjs/modules/useDicStore.cjs +1 -1
- package/dist/cjs/modules/useDicStore.cjs.map +1 -1
- package/dist/esm/modules/useDicStore.mjs +1 -1
- package/dist/esm/modules/useDicStore.mjs.map +1 -1
- package/dist/types/modules/useDicStore.d.ts +1 -1
- package/dist/types/modules/useDicStore.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ const useDicStore = pinia.defineStore(types.DATA_DICTIONARY_ID, {
|
|
|
74
74
|
var _a;
|
|
75
75
|
const rs = ((_a = this.dataDic[key]) == null ? void 0 : _a.value) || [];
|
|
76
76
|
const item = rs.find(
|
|
77
|
-
(item2) => item2.value === value
|
|
77
|
+
(item2) => item2.value === String(value)
|
|
78
78
|
);
|
|
79
79
|
return (item == null ? void 0 : item.label) || "";
|
|
80
80
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDicStore.cjs","sources":["../../../src/modules/useDicStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\r\n\r\nimport { DATA_DICTIONARY_ID } from \"../types\";\r\n\r\n// 定义字典项的类型\r\nexport interface DictionaryItem {\r\n value: string; // 字典项的值\r\n label: string; // 字典项的显示文本\r\n}\r\n\r\n// 定义字典列表的类型\r\nexport interface Dictionary {\r\n [key: string]: {\r\n value: DictionaryItem[]; // 数组字典\r\n timestamp: number; // 数据缓存时间戳\r\n };\r\n}\r\n\r\n/**\r\n * {key:[]}\r\n */\r\nexport interface DictionaryList {\r\n [key: string]: DictionaryItem[]; // 数组字典\r\n}\r\n\r\n// 定义 Store 的状态类型\r\nexport interface DataDictionaryState {\r\n dataDic: Dictionary;\r\n cacheDuration: number;\r\n}\r\n\r\nconst useDicStore = defineStore(DATA_DICTIONARY_ID, {\r\n state: (): DataDictionaryState => ({\r\n dataDic: {},\r\n cacheDuration: 5 * 60 * 1000 // 缓存有效期:5分钟(单位:毫秒)\r\n }),\r\n\r\n // 💡 优化:Getters 仅保留无参数的计算属性,如果不需要则保持为空。\r\n getters: {\r\n // 示例:如果需要获取所有字典的 Key 列表,可以放在这里\r\n // getAllKeys: state => Object.keys(state.dataDic),\r\n },\r\n\r\n // 💡 优化:Actions 包含所有数据操作和有参数的查询方法。\r\n actions: {\r\n // --- 缓存/数据操作 Actions (保持不变) ---\r\n\r\n // 检查缓存是否过期\r\n isCacheExpired(name: string): boolean {\r\n // 使用 this 访问 state\r\n if (this.cacheDuration === 0) return false;\r\n const cache = this.dataDic[name];\r\n if (!cache) return true;\r\n const now = Date.now();\r\n return now - cache.timestamp > this.cacheDuration;\r\n },\r\n\r\n // 根据 key 保存字典数据\r\n saveDicByKey(key: string, data: DictionaryItem[]) {\r\n // 修正 data 类型\r\n this.dataDic[key] = {\r\n value: data,\r\n timestamp: Date.now()\r\n };\r\n },\r\n\r\n // 一次性存入数据字典\r\n saveAll(data: DictionaryList) {\r\n Object.entries(data).forEach(([key, value]) => {\r\n this.dataDic[key] = {\r\n value,\r\n timestamp: Date.now() // 统一使用当前时间戳\r\n };\r\n });\r\n },\r\n\r\n // --- 查询 Actions (原 Getters 优化) ---\r\n\r\n /**\r\n * 1. 根据 key 获取字典列表 (原 getDicByKey)\r\n * @param key 字典的 key\r\n */\r\n getDicByKey(key: string): DictionaryItem[] {\r\n // 直接使用 this 访问 state\r\n return this.dataDic[key]?.value || [];\r\n },\r\n\r\n /**\r\n * 2. 返回 value 匹配到的整个对象 (原 getDicObjByValue)\r\n * @param key 字典的 key\r\n * @param value 字典项的值\r\n */\r\n getDicObjByValue(\r\n key: string,\r\n value: string | number\r\n ): DictionaryItem | null {\r\n // 修正 value 类型为 string | number,返回类型为 DictionaryItem | null\r\n const rs = this.dataDic[key]?.value || [];\r\n const result = rs.find(\r\n item => item.value === String(value)\r\n );\r\n // 返回 null 更安全,避免返回空对象 {} as DictionaryItem\r\n return result || null;\r\n },\r\n\r\n /**\r\n * 3. 根据字典名称和字典的 value 获取对应的中文 (原 getDicTextByValue)\r\n */\r\n getDicTextByValue(key: string
|
|
1
|
+
{"version":3,"file":"useDicStore.cjs","sources":["../../../src/modules/useDicStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\r\n\r\nimport { DATA_DICTIONARY_ID } from \"../types\";\r\n\r\n// 定义字典项的类型\r\nexport interface DictionaryItem {\r\n value: string; // 字典项的值\r\n label: string; // 字典项的显示文本\r\n}\r\n\r\n// 定义字典列表的类型\r\nexport interface Dictionary {\r\n [key: string]: {\r\n value: DictionaryItem[]; // 数组字典\r\n timestamp: number; // 数据缓存时间戳\r\n };\r\n}\r\n\r\n/**\r\n * {key:[]}\r\n */\r\nexport interface DictionaryList {\r\n [key: string]: DictionaryItem[]; // 数组字典\r\n}\r\n\r\n// 定义 Store 的状态类型\r\nexport interface DataDictionaryState {\r\n dataDic: Dictionary;\r\n cacheDuration: number;\r\n}\r\n\r\nconst useDicStore = defineStore(DATA_DICTIONARY_ID, {\r\n state: (): DataDictionaryState => ({\r\n dataDic: {},\r\n cacheDuration: 5 * 60 * 1000 // 缓存有效期:5分钟(单位:毫秒)\r\n }),\r\n\r\n // 💡 优化:Getters 仅保留无参数的计算属性,如果不需要则保持为空。\r\n getters: {\r\n // 示例:如果需要获取所有字典的 Key 列表,可以放在这里\r\n // getAllKeys: state => Object.keys(state.dataDic),\r\n },\r\n\r\n // 💡 优化:Actions 包含所有数据操作和有参数的查询方法。\r\n actions: {\r\n // --- 缓存/数据操作 Actions (保持不变) ---\r\n\r\n // 检查缓存是否过期\r\n isCacheExpired(name: string): boolean {\r\n // 使用 this 访问 state\r\n if (this.cacheDuration === 0) return false;\r\n const cache = this.dataDic[name];\r\n if (!cache) return true;\r\n const now = Date.now();\r\n return now - cache.timestamp > this.cacheDuration;\r\n },\r\n\r\n // 根据 key 保存字典数据\r\n saveDicByKey(key: string, data: DictionaryItem[]) {\r\n // 修正 data 类型\r\n this.dataDic[key] = {\r\n value: data,\r\n timestamp: Date.now()\r\n };\r\n },\r\n\r\n // 一次性存入数据字典\r\n saveAll(data: DictionaryList) {\r\n Object.entries(data).forEach(([key, value]) => {\r\n this.dataDic[key] = {\r\n value,\r\n timestamp: Date.now() // 统一使用当前时间戳\r\n };\r\n });\r\n },\r\n\r\n // --- 查询 Actions (原 Getters 优化) ---\r\n\r\n /**\r\n * 1. 根据 key 获取字典列表 (原 getDicByKey)\r\n * @param key 字典的 key\r\n */\r\n getDicByKey(key: string): DictionaryItem[] {\r\n // 直接使用 this 访问 state\r\n return this.dataDic[key]?.value || [];\r\n },\r\n\r\n /**\r\n * 2. 返回 value 匹配到的整个对象 (原 getDicObjByValue)\r\n * @param key 字典的 key\r\n * @param value 字典项的值\r\n */\r\n getDicObjByValue(\r\n key: string,\r\n value: string | number\r\n ): DictionaryItem | null {\r\n // 修正 value 类型为 string | number,返回类型为 DictionaryItem | null\r\n const rs = this.dataDic[key]?.value || [];\r\n const result = rs.find(\r\n item => item.value === String(value)\r\n );\r\n // 返回 null 更安全,避免返回空对象 {} as DictionaryItem\r\n return result || null;\r\n },\r\n\r\n /**\r\n * 3. 根据字典名称和字典的 value 获取对应的中文 (原 getDicTextByValue)\r\n */\r\n getDicTextByValue(\r\n key: string,\r\n value: string | number\r\n ): string {\r\n const rs = this.dataDic[key]?.value || [];\r\n const item = rs.find(\r\n (item: DictionaryItem) =>\r\n item.value === String(value)\r\n );\r\n // 优化:使用 find 比 filter/map/join 效率更高,且只会有一个结果\r\n return item?.label || \"\";\r\n },\r\n\r\n /**\r\n * 4. 根据文字匹配对应的 value (原 getDicValueByText)\r\n */\r\n getDicValueByText(key: string, text: string): string {\r\n const rs = this.dataDic[key]?.value || [];\r\n const item = rs.find(\r\n (item: DictionaryItem) => item.label === text\r\n );\r\n // 优化:使用 find 比 filter/map/join 效率更高,且只会有一个结果\r\n return item?.value || \"\";\r\n }\r\n },\r\n persist: true\r\n});\r\n\r\nexport default useDicStore;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,EAAC;AACxC,MAAA,MAAM,OAAO,EAAA,CAAG,IAAA;AAAA,QACd,CAACA,KAAAA,KAAyBA,KAAAA,CAAK,KAAA,KAAU;AAAA,OAC3C;AAEA,MAAA,OAAA,CAAO,6BAAM,KAAA,KAAS,EAAA;AAAA,IACxB;AAAA,GACF;AAAA,EACA,OAAA,EAAS;AACX,CAAC;;;;"}
|
|
@@ -70,7 +70,7 @@ const useDicStore = defineStore(DATA_DICTIONARY_ID, {
|
|
|
70
70
|
var _a;
|
|
71
71
|
const rs = ((_a = this.dataDic[key]) == null ? void 0 : _a.value) || [];
|
|
72
72
|
const item = rs.find(
|
|
73
|
-
(item2) => item2.value === value
|
|
73
|
+
(item2) => item2.value === String(value)
|
|
74
74
|
);
|
|
75
75
|
return (item == null ? void 0 : item.label) || "";
|
|
76
76
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDicStore.mjs","sources":["../../../src/modules/useDicStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\r\n\r\nimport { DATA_DICTIONARY_ID } from \"../types\";\r\n\r\n// 定义字典项的类型\r\nexport interface DictionaryItem {\r\n value: string; // 字典项的值\r\n label: string; // 字典项的显示文本\r\n}\r\n\r\n// 定义字典列表的类型\r\nexport interface Dictionary {\r\n [key: string]: {\r\n value: DictionaryItem[]; // 数组字典\r\n timestamp: number; // 数据缓存时间戳\r\n };\r\n}\r\n\r\n/**\r\n * {key:[]}\r\n */\r\nexport interface DictionaryList {\r\n [key: string]: DictionaryItem[]; // 数组字典\r\n}\r\n\r\n// 定义 Store 的状态类型\r\nexport interface DataDictionaryState {\r\n dataDic: Dictionary;\r\n cacheDuration: number;\r\n}\r\n\r\nconst useDicStore = defineStore(DATA_DICTIONARY_ID, {\r\n state: (): DataDictionaryState => ({\r\n dataDic: {},\r\n cacheDuration: 5 * 60 * 1000 // 缓存有效期:5分钟(单位:毫秒)\r\n }),\r\n\r\n // 💡 优化:Getters 仅保留无参数的计算属性,如果不需要则保持为空。\r\n getters: {\r\n // 示例:如果需要获取所有字典的 Key 列表,可以放在这里\r\n // getAllKeys: state => Object.keys(state.dataDic),\r\n },\r\n\r\n // 💡 优化:Actions 包含所有数据操作和有参数的查询方法。\r\n actions: {\r\n // --- 缓存/数据操作 Actions (保持不变) ---\r\n\r\n // 检查缓存是否过期\r\n isCacheExpired(name: string): boolean {\r\n // 使用 this 访问 state\r\n if (this.cacheDuration === 0) return false;\r\n const cache = this.dataDic[name];\r\n if (!cache) return true;\r\n const now = Date.now();\r\n return now - cache.timestamp > this.cacheDuration;\r\n },\r\n\r\n // 根据 key 保存字典数据\r\n saveDicByKey(key: string, data: DictionaryItem[]) {\r\n // 修正 data 类型\r\n this.dataDic[key] = {\r\n value: data,\r\n timestamp: Date.now()\r\n };\r\n },\r\n\r\n // 一次性存入数据字典\r\n saveAll(data: DictionaryList) {\r\n Object.entries(data).forEach(([key, value]) => {\r\n this.dataDic[key] = {\r\n value,\r\n timestamp: Date.now() // 统一使用当前时间戳\r\n };\r\n });\r\n },\r\n\r\n // --- 查询 Actions (原 Getters 优化) ---\r\n\r\n /**\r\n * 1. 根据 key 获取字典列表 (原 getDicByKey)\r\n * @param key 字典的 key\r\n */\r\n getDicByKey(key: string): DictionaryItem[] {\r\n // 直接使用 this 访问 state\r\n return this.dataDic[key]?.value || [];\r\n },\r\n\r\n /**\r\n * 2. 返回 value 匹配到的整个对象 (原 getDicObjByValue)\r\n * @param key 字典的 key\r\n * @param value 字典项的值\r\n */\r\n getDicObjByValue(\r\n key: string,\r\n value: string | number\r\n ): DictionaryItem | null {\r\n // 修正 value 类型为 string | number,返回类型为 DictionaryItem | null\r\n const rs = this.dataDic[key]?.value || [];\r\n const result = rs.find(\r\n item => item.value === String(value)\r\n );\r\n // 返回 null 更安全,避免返回空对象 {} as DictionaryItem\r\n return result || null;\r\n },\r\n\r\n /**\r\n * 3. 根据字典名称和字典的 value 获取对应的中文 (原 getDicTextByValue)\r\n */\r\n getDicTextByValue(key: string
|
|
1
|
+
{"version":3,"file":"useDicStore.mjs","sources":["../../../src/modules/useDicStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\r\n\r\nimport { DATA_DICTIONARY_ID } from \"../types\";\r\n\r\n// 定义字典项的类型\r\nexport interface DictionaryItem {\r\n value: string; // 字典项的值\r\n label: string; // 字典项的显示文本\r\n}\r\n\r\n// 定义字典列表的类型\r\nexport interface Dictionary {\r\n [key: string]: {\r\n value: DictionaryItem[]; // 数组字典\r\n timestamp: number; // 数据缓存时间戳\r\n };\r\n}\r\n\r\n/**\r\n * {key:[]}\r\n */\r\nexport interface DictionaryList {\r\n [key: string]: DictionaryItem[]; // 数组字典\r\n}\r\n\r\n// 定义 Store 的状态类型\r\nexport interface DataDictionaryState {\r\n dataDic: Dictionary;\r\n cacheDuration: number;\r\n}\r\n\r\nconst useDicStore = defineStore(DATA_DICTIONARY_ID, {\r\n state: (): DataDictionaryState => ({\r\n dataDic: {},\r\n cacheDuration: 5 * 60 * 1000 // 缓存有效期:5分钟(单位:毫秒)\r\n }),\r\n\r\n // 💡 优化:Getters 仅保留无参数的计算属性,如果不需要则保持为空。\r\n getters: {\r\n // 示例:如果需要获取所有字典的 Key 列表,可以放在这里\r\n // getAllKeys: state => Object.keys(state.dataDic),\r\n },\r\n\r\n // 💡 优化:Actions 包含所有数据操作和有参数的查询方法。\r\n actions: {\r\n // --- 缓存/数据操作 Actions (保持不变) ---\r\n\r\n // 检查缓存是否过期\r\n isCacheExpired(name: string): boolean {\r\n // 使用 this 访问 state\r\n if (this.cacheDuration === 0) return false;\r\n const cache = this.dataDic[name];\r\n if (!cache) return true;\r\n const now = Date.now();\r\n return now - cache.timestamp > this.cacheDuration;\r\n },\r\n\r\n // 根据 key 保存字典数据\r\n saveDicByKey(key: string, data: DictionaryItem[]) {\r\n // 修正 data 类型\r\n this.dataDic[key] = {\r\n value: data,\r\n timestamp: Date.now()\r\n };\r\n },\r\n\r\n // 一次性存入数据字典\r\n saveAll(data: DictionaryList) {\r\n Object.entries(data).forEach(([key, value]) => {\r\n this.dataDic[key] = {\r\n value,\r\n timestamp: Date.now() // 统一使用当前时间戳\r\n };\r\n });\r\n },\r\n\r\n // --- 查询 Actions (原 Getters 优化) ---\r\n\r\n /**\r\n * 1. 根据 key 获取字典列表 (原 getDicByKey)\r\n * @param key 字典的 key\r\n */\r\n getDicByKey(key: string): DictionaryItem[] {\r\n // 直接使用 this 访问 state\r\n return this.dataDic[key]?.value || [];\r\n },\r\n\r\n /**\r\n * 2. 返回 value 匹配到的整个对象 (原 getDicObjByValue)\r\n * @param key 字典的 key\r\n * @param value 字典项的值\r\n */\r\n getDicObjByValue(\r\n key: string,\r\n value: string | number\r\n ): DictionaryItem | null {\r\n // 修正 value 类型为 string | number,返回类型为 DictionaryItem | null\r\n const rs = this.dataDic[key]?.value || [];\r\n const result = rs.find(\r\n item => item.value === String(value)\r\n );\r\n // 返回 null 更安全,避免返回空对象 {} as DictionaryItem\r\n return result || null;\r\n },\r\n\r\n /**\r\n * 3. 根据字典名称和字典的 value 获取对应的中文 (原 getDicTextByValue)\r\n */\r\n getDicTextByValue(\r\n key: string,\r\n value: string | number\r\n ): string {\r\n const rs = this.dataDic[key]?.value || [];\r\n const item = rs.find(\r\n (item: DictionaryItem) =>\r\n item.value === String(value)\r\n );\r\n // 优化:使用 find 比 filter/map/join 效率更高,且只会有一个结果\r\n return item?.label || \"\";\r\n },\r\n\r\n /**\r\n * 4. 根据文字匹配对应的 value (原 getDicValueByText)\r\n */\r\n getDicValueByText(key: string, text: string): string {\r\n const rs = this.dataDic[key]?.value || [];\r\n const item = rs.find(\r\n (item: DictionaryItem) => item.label === text\r\n );\r\n // 优化:使用 find 比 filter/map/join 效率更高,且只会有一个结果\r\n return item?.value || \"\";\r\n }\r\n },\r\n persist: true\r\n});\r\n\r\nexport default useDicStore;\r\n"],"names":["item"],"mappings":";;;;AA+BA,MAAM,WAAA,GAAc,YAAY,kBAAA,EAAoB;AAAA,EAClD,OAAO,OAA4B;A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,OAAA,CAAO,6BAAM,KAAA,KAAS,EAAA;AAAA,IACxB;AAAA,GACF;AAAA,EACA,OAAA,EAAS;AACX,CAAC;;;;"}
|
|
@@ -36,7 +36,7 @@ declare const useDicStore: import("pinia").StoreDefinition<"_STORE_DATA_DICTIONA
|
|
|
36
36
|
/**
|
|
37
37
|
* 3. 根据字典名称和字典的 value 获取对应的中文 (原 getDicTextByValue)
|
|
38
38
|
*/
|
|
39
|
-
getDicTextByValue(key: string, value: string): string;
|
|
39
|
+
getDicTextByValue(key: string, value: string | number): string;
|
|
40
40
|
/**
|
|
41
41
|
* 4. 根据文字匹配对应的 value (原 getDicValueByText)
|
|
42
42
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDicStore.d.ts","sourceRoot":"","sources":["../../../src/modules/useDicStore.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,UAAU;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG;QACb,KAAK,EAAE,cAAc,EAAE,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE,CAAC;CACjC;AAGD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,UAAU,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,WAAW;yBAiBQ,MAAM,GAAG,OAAO;sBAUnB,MAAM,QAAQ,cAAc,EAAE;kBASlC,cAAc;IAW5B;;;OAGG;qBACc,MAAM,GAAG,cAAc,EAAE;IAK1C;;;;OAIG;0BAEI,MAAM,SACJ,MAAM,GAAG,MAAM,GACrB,cAAc,GAAG,IAAI;IAUxB;;OAEG;
|
|
1
|
+
{"version":3,"file":"useDicStore.d.ts","sourceRoot":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