chore: history projectId

This commit is contained in:
xiaojunnuo
2026-02-11 18:11:33 +08:00
parent 806a69fef3
commit 638a7f0ab4
15 changed files with 224 additions and 146 deletions
@@ -52,12 +52,17 @@ export const useProjectStore = defineStore("app.project", () => {
}
const projects = await api.MyProjectList();
myProjects.value = projects;
if (projects.length > 0 && !currentProjectId.value) {
changeCurrentProject(projects[0].id, true);
}
}
function changeCurrentProject(id: string) {
function changeCurrentProject(id: string, silent?: boolean) {
currentProjectId.value = id;
LocalStorage.set("currentProjectId", id);
message.success("切换项目成功");
if (!silent) {
message.success("切换项目成功");
}
}
async function reload() {
@@ -19,6 +19,8 @@ export const projectPermissionDict = dict({
export const myProjectDict = dict({
url: "/enterprise/project/list",
value: "id",
label: "name",
});
export const userDict = dict({
@@ -640,6 +640,9 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
title: t("certd.fields.projectName"),
type: "dict-select",
dict: myProjectDict,
form: {
show: false,
},
},
updateTime: {
title: t("certd.fields.updateTime"),