合并调整完成

This commit is contained in:
Cain 2025-03-12 22:41:38 +08:00
parent cbe6c15c28
commit 8b0b7d608c
7 changed files with 91 additions and 79 deletions

View File

@ -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

View File

@ -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',

View File

@ -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: '字典详情',

59
src/typings/app.d.ts vendored
View File

@ -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;

View File

@ -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<Api.DictionaryType.DictionaryType[]>([]);
// 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;

View File

@ -95,7 +95,6 @@ const Delete = async (id: number) => {
if (res.error) return;
onDeleted();
}
</script>
<template>

View File

@ -9,6 +9,7 @@ import { useAuthStore } from '@/store/modules/auth';
import { translateOptions } from '@/utils/common';
import { fetchAddCategory, fetchEditCategory } from '@/service/api'
// import { categoryTypeOptions } from '@/constants/business';
import dict from '@/utils/dict';
//
defineOptions({
@ -28,6 +29,8 @@ interface Emits {
(e: 'submitted'): void;
}
let key = "字典类型";
const categoryTypeOptions = ref([
{ value: '1', label: '网站' },
{ value: '2', label: '文献' }
@ -96,10 +99,8 @@ function handleUpdateModelWhenEdit() {
}
//
function handleUpdateDictWhenEdit() {
categoryTypeOptions.value = [
{ value: '1', label: '网站' },
{ value: '2', label: '文献666' }
];
console.log(dict.type);
categoryTypeOptions.value = dict.type[key];
}
//