From 8b0b7d608ce983d058a1c0fa1d72829b21d896d9 Mon Sep 17 00:00:00 2001 From: Cain <2365469460@qq.com> Date: Wed, 12 Mar 2025 22:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=B0=83=E6=95=B4=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.test | 3 +- src/locales/langs/en-us.ts | 41 ++++++++++++- src/locales/langs/zh-cn.ts | 24 +++++++- src/typings/app.d.ts | 59 +++++++------------ src/utils/dict.ts | 33 +---------- src/views/category/index.vue | 1 - .../modules/category-operate-drawer.vue | 9 +-- 7 files changed, 91 insertions(+), 79 deletions(-) diff --git a/.env.test b/.env.test index 4e93d5d..6bbe541 100644 --- a/.env.test +++ b/.env.test @@ -2,4 +2,5 @@ VITE_BASE_URL=/ # backend service base url, test environment # VITE_SERVICE_BASE_URL=http://localhost:8080/snail-job -VITE_SERVICE_BASE_URL=http://10.18.190.195:8080/snail-job +# VITE_SERVICE_BASE_URL=http://10.18.190.195:8080/snail-job +VITE_SERVICE_BASE_URL=http://10.21.21.29:8080/snail-job diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index efbd450..d3675d7 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -330,6 +330,7 @@ const local: App.I18n.Schema = { dictionary: 'Dictionary', pods: 'Online Machine', namespace: 'Namespace', + group: 'Group Config', notify: 'Notify', notify_recipient: 'Notify Recipient', notify_config: 'Notify Config', @@ -352,7 +353,8 @@ const local: App.I18n.Schema = { job: 'Schedule Task Management', job_task: 'Schedule Task List', job_batch: 'Schedule Task Batch List', - group: 'Group Config' + dictionary_data: 'Dictionary Data', + dictionary_type: 'Dictionary Type', }, page: { common: { @@ -517,6 +519,43 @@ const local: App.I18n.Schema = { addDictionary: 'Add Dictionary', editDictionary: 'Edit Dictionary' }, + dictionaryType: { + title: 'Dictionary Management', + detail: 'Dictionary Details', + dictionaryId: 'Dictionary ID', + dictionaryName: 'Dictionary Name', + dictionaryType: 'Dictionary Type', + dictionaryStatus: 'Status', + remark: 'Remark', + createTime: 'Create Time', + form: { + dictionaryNamePlaceHolder: 'Please enter dictionary name', + dictionaryName: 'Dictionary Name', + dictionaryTypePlaceHolder: 'Please enter dictionary type', + dictionaryType: 'Dictionary Type', + dictionaryStatusPlaceHolder: 'Please enter status', + dictionaryStatus: 'Status', + createTime: 'Create Time' + }, + addDictionary: 'Add Dictionary', + editDictionary: 'Edit Dictionary' + }, + dictionaryData: { + title: 'Dictionary Data', + detail: 'Dictionary Data Details', + dictionaryCode: 'Dictionary Code', + dictionaryLabel: 'Dictionary Label', + dictionaryValue: 'Dictionary Value', + createTime: 'Create Time', + dictionaryType: 'Dictionary Type', + form: { + dictLabel: 'Dictionary Label', + dictValue: 'Dictionary Value', + dictType: 'Dictionary Type' + }, + addDictionary: 'Add Dictionary Entry', + editDictionary: 'Edit Dictionary Entry' + }, namespace: { title: 'Namespace', name: 'Name', diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 4bda22a..8af3914 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -353,8 +353,8 @@ const local: App.I18n.Schema = { job: '数采任务', job_task: '任务管理', job_batch: '执行批次', - dictionary_type: '字典管理', - dictionary_data: '字典数据' + dictionary_data: '字典数据', + dictionary_type: '字典类型', }, page: { common: { @@ -509,6 +509,26 @@ const local: App.I18n.Schema = { addCategory: '新增分类', editCategory: '编辑分类' }, + dictionary: { + title: '字典管理', + dictionId: '字典ID', + dictionaryName: '字典名称', + dictionaryType: '字典类型', + dictionaryStatus: '字典状态', + remark: '备注', + createTime: '创建时间', + form: { + dictionaryNamePlaceHolder: '请输入字典名称', + dictionaryName: '字典名称', + dictionaryTypePlaceHolder: '请选择字典类型', + dictionaryType: '字典类型', + dictionaryStatusPlaceHolder: '请选择字典状态', + dictionaryStatus: '字典状态', + createTime: '创建时间' + }, + addDictionary: '添加字典', + editDictionary: '编辑字典' + }, dictionaryType: { title: '字典管理', detail: '字典详情', diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index e9dd681..f8722dc 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -670,6 +670,24 @@ declare namespace App { }; }; }; + pods: { + title: string; + nodeType: string; + groupName: string; + hostId: string; + hostIp: string; + hostPort: string; + consumerBuckets: string; + updateDt: string; + contextPath: string; + form: { + groupName: string; + }; + type: { + client: string; + server: string; + }; + }; category: { title: string; form: { @@ -679,14 +697,14 @@ declare namespace App { categoryParentName: string; categoryType: string; createTime: string; - }; + }, type: { website: string; literature: string; - }; + }, addCategory: string; editCategory: string; - }; + }, dictionaryType: { title: string; detail: string; @@ -724,41 +742,6 @@ declare namespace App { addDictionary: string; editDictionary: string; }; - pods: { - title: string; - nodeType: string; - groupName: string; - hostId: string; - hostIp: string; - hostPort: string; - consumerBuckets: string; - updateDt: string; - contextPath: string; - form: { - groupName: string; - }; - type: { - client: string; - server: string; - }; - }; - category: { - title: string; - form: { - name: string; - categoryName: string; - categoryStatus: string; - categoryParentName: string; - categoryType: string; - createTime: string; - }, - type: { - website: string; - literature: string; - }, - addCategory: string; - editCategory: string; - }, dictionary: { title: string; dictionId: string; diff --git a/src/utils/dict.ts b/src/utils/dict.ts index f0cddde..08ad8c1 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -1,16 +1,5 @@ import { fetchGetDictionaryDataList, fetchGetDictionaryTypeList } from '@/service/api'; -// export dict -// { -// type:{ -// sys_sex:[ -// {label:"男", -// value: "1"}, -// {label:"女", -// value: "2"} -// ] -// } -// } type indexAbleDictData = { label: string; value: string; @@ -24,26 +13,6 @@ type indexAbleDict = { }; async function init() { - // const dictTypeList = reactive([]); - // const dict: indexAbleDict = { - // type: { - // fruits: [ - // { label: '苹果', value: 'apple' }, - // { label: '香蕉', value: 'banana' }, - // { label: '橙子', value: 'orange' } - // ], - // colors: [ - // { label: '红色', value: 'red' }, - // { label: '绿色', value: 'green' }, - // { label: '蓝色', value: 'blue' } - // ], - // animals: [ - // { label: '狗', value: 'dog' }, - // { label: '猫', value: 'cat' }, - // { label: '鸟', value: 'bird' } - // ] - // } - // }; const typeList: string[] = (await fetchGetDictionaryTypeList()).data?.data.map(item => item.dictType) || []; const dataList: any[] = (await fetchGetDictionaryDataList()).data?.data.map(item => ({ @@ -65,6 +34,6 @@ async function init() { }; return dict; } -const dict = init(); +const dict = await init(); export default dict; diff --git a/src/views/category/index.vue b/src/views/category/index.vue index f9adb9a..ed364e7 100644 --- a/src/views/category/index.vue +++ b/src/views/category/index.vue @@ -95,7 +95,6 @@ const Delete = async (id: number) => { if (res.error) return; onDeleted(); } -