chore: project

This commit is contained in:
xiaojunnuo
2026-02-21 23:20:26 +08:00
parent 06c69d23be
commit faf08f6513
21 changed files with 125 additions and 36 deletions
@@ -77,16 +77,46 @@ export const useProjectStore = defineStore("app.project", () => {
return myProjects.value;
}
const isRead = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value;
});
const isWrite = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value?.permission === "write" || currentProject.value?.permission === "admin";
});
const isAdmin = computed(() => {
if (!isEnterprise.value) {
return true;
}
return currentProject.value?.permission === "admin";
});
function $reset() {
myProjects.value = [];
currentProjectId.value = "";
}
return {
projects,
myProjects,
currentProject,
currentProjectId,
isEnterprise,
isRead,
isWrite,
isAdmin,
getSearchForm,
loadMyProjects,
changeCurrentProject,
reload,
init,
$reset,
};
});