diff --git a/src/api/system/dictionary.ts b/src/api/system/dictionary.ts
index 9fef3ddc..055d0c4b 100644
--- a/src/api/system/dictionary.ts
+++ b/src/api/system/dictionary.ts
@@ -18,4 +18,14 @@ export const addDictionary = (data:any) => request.patch('/dictionary',data)
/**
* 删除字典
*/
-export const deleteDictionary =(id:string) => request.delete(`/dictionary/${id}`)
\ No newline at end of file
+export const deleteDictionary =(id:string) => request.delete(`/dictionary/${id}`)
+
+/**
+ * 查询字典项
+ */
+export const queryDicItem = (data:any)=>request.post('/dictionary-item/_query',data)
+
+/**
+ * 保存字典项
+ */
+export const saveDicItem = (data:any) => request.patch('/dictionary-item',data)
\ No newline at end of file
diff --git a/src/views/system/Dictionary/components/Left.vue b/src/views/system/Dictionary/components/Left.vue
index 4d6c7d4a..29b2aeda 100644
--- a/src/views/system/Dictionary/components/Left.vue
+++ b/src/views/system/Dictionary/components/Left.vue
@@ -12,9 +12,9 @@
-
+
-
+
selectDic(item.data)">
{{ item.name }}
updateDic(item.data)">
@@ -42,15 +42,18 @@ const saveShow = ref(false)
const addType = ref('add')
const listData = ref([])
const editData = ref()
-const selectedKeys = ref([])
+const selectedKeys:any = ref([])
const showSave = () =>{
saveShow.value = true
addType.value = 'add'
}
-const queryData = () =>{
+const queryData = (first?:Boolean) =>{
getDicList({sorts: [{ name: 'createTime', order: 'desc' }]}).then((res:any)=>{
if(res.status === 200){
listData.value = res.result
+ if(first){
+ selectDic(res.result[0])
+ }
}
})
}
@@ -102,14 +105,11 @@ const updateDic = (data:any)=>{
* 切换选中字典
*/
const selectDic = (selectKeys:any)=>{
- selectedKeys.value = selectKeys
- const selectData = listData.value.filter((item:any)=>{
- return item.id = selectKeys[0]
- })[0]
- emit('selectData',selectData)
+ selectedKeys.value = [selectKeys.id]
+ emit('selectData',selectKeys)
}
onMounted(()=>{
- queryData()
+ queryData(true)
})
\ No newline at end of file
diff --git a/src/views/system/Dictionary/components/Right/index.vue b/src/views/system/Dictionary/components/Right/index.vue
index 597c37f2..f8b8c8e1 100644
--- a/src/views/system/Dictionary/components/Right/index.vue
+++ b/src/views/system/Dictionary/components/Right/index.vue
@@ -5,16 +5,138 @@
说明:{{ data.describe }}
创建日期:{{ data.name }}
+
+