mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
chore: history projectId
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user