diff --git a/src/constants/business.ts b/src/constants/business.ts index 80e7a9b..9cc6cf2 100644 --- a/src/constants/business.ts +++ b/src/constants/business.ts @@ -1,5 +1,6 @@ import { $t } from '@/locales'; import { transformRecordToNumberOption } from '@/utils/common'; +import { type Api } from '@/typings/api'; export const yesOrNoRecord: Record = { '0': 'common.yesOrNo.no', @@ -24,9 +25,7 @@ export const isImportantRecord: Record = { +export const podsType: Record = { 1: 'page.pods.type.client', 2: 'page.pods.type.server' }; @@ -83,13 +82,6 @@ export const groupConfigStatusRecord: Record = { - 1: 'page.groupConfig.typeDict.government', - 2: 'page.groupConfig.typeDict.usMilitary', - 3: 'page.groupConfig.typeDict.usNavy', -} -export const groupConfigTypeOptions = transformRecordToNumberOption(groupConfigTypeRecord); export const groupConfigStatusOptions = transformRecordToNumberOption(groupConfigStatusRecord, true); @@ -427,7 +419,6 @@ export const jobExecutorEnum: Workflow.JobTagType = { // CategoryType export const categoryTypeRecord: Record = { 0: 'page.category.type.website', - 1: 'page.category.type.literature', -} + 1: 'page.category.type.literature' +}; export const categoryTypeOptions = transformRecordToNumberOption(categoryTypeRecord); - diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 5a3236a..1ae526f 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -506,6 +506,27 @@ const local: App.I18n.Schema = { addCategory: '新增分类', editCategory: '编辑分类' }, + dictionary: { + title:'字典', + dictionId:'字典编号', + dictionaryName: '字典名称', + dictionaryType: '字典类型', + dictionaryStatus: '状态', + remark:'备注', + createTime: '创建时间', + form:{ + dictionaryNamePlaceHolder: '请输入字典名称', + dictionaryName: '字典名称', + dictionaryTypePlaceHolder: '请输入字典名称', + dictionaryType: '字典类型', + dictionaryStatusPlaceHolder: '请输入字典名称', + dictionaryStatus: '状态', + createTime: '创建时间' + }, + addDictionary: '新增字典', + editDictionary: '编辑字典' + + }, namespace: { title: '命名空间', name: '名称', diff --git a/src/service/api/dictionary.ts b/src/service/api/dictionary.ts new file mode 100644 index 0000000..60fc70c --- /dev/null +++ b/src/service/api/dictionary.ts @@ -0,0 +1,69 @@ +import { request } from '../request'; + +/** get dictConfig list */ +export function fetchGetDictionaryConfigList(params?: Api.DictionaryConfig.DictionaryConfigSearchParams) { + return request({ + url: '/dict/list', + method: 'get', + params + }); +} + +export function fetchGetAllDictionaryNameList(params?: Api.DictionaryConfig.DictionaryConfigSearchParams) { + return request({ + url: '/dict/all/dict-name/list', + method: 'get', + params + }); +} + +/** add dictConfig */ +export function fetchAddDictionaryConfig(data: Api.DictionaryConfig.DictionaryConfigRequestVO) { + return request({ + url: '/dict', + method: 'post', + data + }); +} + +/** edit dictConfig */ +export function fetchEditDictionaryConfig(data: Api.DictionaryConfig.DictionaryConfigRequestVO) { + return request({ + url: '/dict', + method: 'put', + data + }); +} + +export function fetchUpdateDictionaryStatus(data: Api.DictionaryConfig.DictionaryConfigRequestVO) { + return request({ + url: '/dict/status', + method: 'put', + data + }); +} + +/** get partition table list */ +// export function fetchGetPartitionTableList() { +// return request({ +// url: '/dict/partition-table/list', +// method: 'get' +// }); +// } + +/** get all dict config list */ +export function fetchGetAllDictionaryConfigList(data: string[]) { + return request({ + url: '/dict/all/dict-config/list', + method: 'post', + data + }); +} + +/** delete dict by id */ +export function fetchDeleteDictionary(dictName: string) { + return request({ + url: `/dict/${dictName}`, + method: 'delete' + }); +} diff --git a/src/service/api/index.ts b/src/service/api/index.ts index 8f0ce21..a5e9b61 100644 --- a/src/service/api/index.ts +++ b/src/service/api/index.ts @@ -14,3 +14,4 @@ export * from './job'; export * from './job-batch'; export * from './user'; export * from './category'; +export * from './dictionary'; diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 531f346..41e1e48 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -1058,7 +1058,6 @@ declare namespace Api { isImportant: Common.EnableStatusNumber; }; - /** JobTask list */ type JobList = Common.PaginatingQueryRecord; @@ -1361,18 +1360,12 @@ declare namespace Api { throwable: string; }; } - - - - - /** + /** * category Category * * backend api module: "Category" */ namespace Category { - - type CategoryType = '网站' | '文献'; type RowData = Category & { @@ -1396,9 +1389,35 @@ declare namespace Api { } interface Result { - status: 1, -    message: string, -    data: RowData[] + status: 1; + message: string; + data: RowData[]; } } + namespace DictionaryConfig { + type CommonSearchParams = Pick; + type DictionaryConfig = Common.CommonRecord<{ + dictName: string; + dictType: string; + dictStatus: string; + createTime: string; + }>; + type DictionaryConfigSearchParams = CommonType.RecordNullable< + Pick & + CommonSearchParams + >; + type DictionaryConfigList = { + dictId: number; + dictName: string; + dictType: string; + dictStatus: string; + createTime: string; + }; + type DictionaryConfigRequestVO = { + dictName: string; + dictType: string; + dictStatus: string; + createTime: string; + }; + } } diff --git a/src/views/category/modules/category.vue b/src/views/category/modules/category.vue index fc5a60c..d7f2968 100644 --- a/src/views/category/modules/category.vue +++ b/src/views/category/modules/category.vue @@ -53,7 +53,7 @@ async function reset() {