mirror of
https://github.com/certd/certd.git
synced 2026-04-28 16:17:25 +08:00
chore: project permission
This commit is contained in:
@@ -3,21 +3,25 @@
|
|||||||
<template #overlay>
|
<template #overlay>
|
||||||
<a-menu @click="handleMenuClick">
|
<a-menu @click="handleMenuClick">
|
||||||
<a-menu-item v-for="item in projectStore.myProjects" :key="item.id">
|
<a-menu-item v-for="item in projectStore.myProjects" :key="item.id">
|
||||||
{{ item.name }}
|
<div class="flex items-center justify-between w-full">
|
||||||
|
<span class="mr-1">{{ item.name }}</span>
|
||||||
|
<fs-values-format :model-value="item.permission" :dict="projectPermissionDict"></fs-values-format>
|
||||||
|
</div>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
</template>
|
</template>
|
||||||
<div class="rounded pl-3 pr-3 px-2 py-1 flex-center flex pointer items-center bg-accent h-10 button-text" title="当前项目">
|
<div class="rounded pl-3 pr-3 px-2 py-1 flex-center flex pointer items-center bg-accent h-10 button-text" title="当前项目">
|
||||||
<fs-icon icon="ion:apps" class="mr-1"></fs-icon>
|
<!-- <fs-icon icon="ion:apps" class="mr-1"></fs-icon> -->
|
||||||
|
<fs-icon :icon="currentIcon" class="mr-5"></fs-icon>
|
||||||
当前项目:{{ projectStore.currentProject?.name || "..." }}
|
当前项目:{{ projectStore.currentProject?.name || "..." }}
|
||||||
<fs-icon icon="ion:chevron-down-outline" class="ml-1"></fs-icon>
|
|
||||||
</div>
|
</div>
|
||||||
</a-dropdown>
|
</a-dropdown>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted } from "vue";
|
import { computed, onMounted } from "vue";
|
||||||
import { useProjectStore } from "/@/store/project";
|
import { useProjectStore } from "/@/store/project";
|
||||||
|
import { useDicts } from "/@/views/certd/dicts";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "ProjectSelector",
|
name: "ProjectSelector",
|
||||||
});
|
});
|
||||||
@@ -25,12 +29,18 @@ defineOptions({
|
|||||||
const projectStore = useProjectStore();
|
const projectStore = useProjectStore();
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await projectStore.reload();
|
await projectStore.reload();
|
||||||
|
console.log(projectStore.myProjects);
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleMenuClick({ key }: any) {
|
function handleMenuClick({ key }: any) {
|
||||||
projectStore.changeCurrentProject(key);
|
projectStore.changeCurrentProject(key);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
const { projectPermissionDict } = useDicts();
|
||||||
|
|
||||||
|
const currentIcon = computed(() => {
|
||||||
|
return projectPermissionDict.dataMap[projectStore.currentProject?.permission || ""]?.icon || "";
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<style lang="less">
|
<style lang="less">
|
||||||
.project-selector {
|
.project-selector {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ export type UseCrudPermissionExtraProps = {
|
|||||||
export type UseCrudPermissionExtra = (props: UseCrudPermissionExtraProps) => any;
|
export type UseCrudPermissionExtra = (props: UseCrudPermissionExtraProps) => any;
|
||||||
export type UseCrudPermissionCompProps = {
|
export type UseCrudPermissionCompProps = {
|
||||||
isProjectPermission?: boolean;
|
isProjectPermission?: boolean;
|
||||||
|
projectPermission?: string;
|
||||||
prefix?: string;
|
prefix?: string;
|
||||||
extra?: UseCrudPermissionExtra;
|
extra?: UseCrudPermissionExtra;
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
@@ -69,17 +70,17 @@ export function useCrudPermission({ permission }: UseCrudPermissionProps) {
|
|||||||
|
|
||||||
let addPermission = "add";
|
let addPermission = "add";
|
||||||
if (isProjectPermission) {
|
if (isProjectPermission) {
|
||||||
addPermission = "write";
|
addPermission = per.projectPermission || "write";
|
||||||
}
|
}
|
||||||
|
|
||||||
let editPermission = "edit";
|
let editPermission = "edit";
|
||||||
if (isProjectPermission) {
|
if (isProjectPermission) {
|
||||||
editPermission = "write";
|
editPermission = per.projectPermission || "write";
|
||||||
}
|
}
|
||||||
|
|
||||||
let removePermission = "remove";
|
let removePermission = "remove";
|
||||||
if (isProjectPermission) {
|
if (isProjectPermission) {
|
||||||
removePermission = "write";
|
removePermission = per.projectPermission || "write";
|
||||||
}
|
}
|
||||||
return LodashMerge(
|
return LodashMerge(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -241,6 +241,10 @@ export const certdResources = [
|
|||||||
icon: "mi:user-check",
|
icon: "mi:user-check",
|
||||||
auth: true,
|
auth: true,
|
||||||
isMenu: true,
|
isMenu: true,
|
||||||
|
show: () => {
|
||||||
|
const projectStore = useProjectStore();
|
||||||
|
return !projectStore.isEnterprise;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,7 +22,10 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const api = createAddonApi({ from: "user", addonType: "" });
|
const api = createAddonApi({ from: "user", addonType: "" });
|
||||||
addonProvide(api);
|
addonProvide(api);
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
|
const { crudBinding, crudRef, crudExpose } = useFs({
|
||||||
|
createCrudOptions,
|
||||||
|
context: { api, permission: { isProjectPermission: true } },
|
||||||
|
});
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -18,7 +18,12 @@ import createCrudOptions from "./crud";
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "BasicGroupManager",
|
name: "BasicGroupManager",
|
||||||
setup() {
|
setup() {
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
const { crudBinding, crudRef, crudExpose } = useFs({
|
||||||
|
createCrudOptions,
|
||||||
|
context: {
|
||||||
|
permission: { isProjectPermission: true },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { useSettingStore } from "/@/store/settings";
|
|||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import CnameTip from "/@/components/plugins/cert/domains-verify-plan-editor/cname-tip.vue";
|
import CnameTip from "/@/components/plugins/cert/domains-verify-plan-editor/cname-tip.vue";
|
||||||
import { useCnameImport } from "./use";
|
import { useCnameImport } from "./use";
|
||||||
|
import { useCrudPermission } from "/@/plugin/permission";
|
||||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const crudBinding = crudExpose.crudBinding;
|
const crudBinding = crudExpose.crudBinding;
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -45,6 +46,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
{ label: t("certd.validation_timed_out"), value: "timeout", color: "red" },
|
{ label: t("certd.validation_timed_out"), value: "timeout", color: "red" },
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const { hasActionPermission } = useCrudPermission(context);
|
||||||
return {
|
return {
|
||||||
crudOptions: {
|
crudOptions: {
|
||||||
settings: {
|
settings: {
|
||||||
@@ -75,6 +78,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
icon: "ion:add-circle-outline",
|
icon: "ion:add-circle-outline",
|
||||||
},
|
},
|
||||||
import: {
|
import: {
|
||||||
|
show: hasActionPermission("write"),
|
||||||
title: "导入CNAME记录",
|
title: "导入CNAME记录",
|
||||||
type: "primary",
|
type: "primary",
|
||||||
text: "批量导入",
|
text: "批量导入",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||||
<template #pagination-left>
|
<template #pagination-left>
|
||||||
<a-tooltip :title="t('certd.batch_delete')">
|
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batch_delete')">
|
||||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@@ -27,13 +27,20 @@ import createCrudOptions from "./crud";
|
|||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { DeleteBatch } from "./api";
|
import { DeleteBatch } from "./api";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
|
import { useCrudPermission } from "/@/plugin/permission";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "CnameRecord",
|
name: "CnameRecord",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
|
||||||
|
const context: any = {
|
||||||
|
permission: { isProjectPermission: true },
|
||||||
|
};
|
||||||
|
|
||||||
|
const { hasActionPermission } = useCrudPermission(context);
|
||||||
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||||
|
|
||||||
const selectedRowKeys = context.selectedRowKeys;
|
const selectedRowKeys = context.selectedRowKeys;
|
||||||
const handleBatchDelete = () => {
|
const handleBatchDelete = () => {
|
||||||
|
|||||||
@@ -4,16 +4,22 @@ import { GetMyProjectList } from "./project/api";
|
|||||||
const projectPermissionDict = dict({
|
const projectPermissionDict = dict({
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
label: "read",
|
value: "read",
|
||||||
value: "只读",
|
label: "只读",
|
||||||
|
color: "cyan",
|
||||||
|
icon: "material-symbols:folder-eye-outline-sharp",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "write",
|
value: "write",
|
||||||
value: "读写",
|
label: "读写",
|
||||||
|
color: "green",
|
||||||
|
icon: "material-symbols:edit-square-outline-rounded",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "admin",
|
value: "admin",
|
||||||
value: "管理员",
|
label: "管理员",
|
||||||
|
color: "orange",
|
||||||
|
icon: "material-symbols:manage-accounts-rounded",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||||
<template #pagination-left>
|
<template #pagination-left>
|
||||||
<a-tooltip :title="t('certd.batchDelete')">
|
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batchDelete')">
|
||||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,13 +20,20 @@ import createCrudOptions from "./crud";
|
|||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { DeleteBatch } from "./api";
|
import { DeleteBatch } from "./api";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
|
import { useCrudPermission } from "/@/plugin/permission";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "PipelineHistory",
|
name: "PipelineHistory",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
|
||||||
|
const context: any = {
|
||||||
|
permission: { isProjectPermission: true },
|
||||||
|
};
|
||||||
|
|
||||||
|
const { hasActionPermission } = useCrudPermission(context);
|
||||||
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||||
|
|
||||||
const selectedRowKeys = context.selectedRowKeys;
|
const selectedRowKeys = context.selectedRowKeys;
|
||||||
const handleBatchDelete = () => {
|
const handleBatchDelete = () => {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const { t } = useI18n();
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: "CertStore",
|
name: "CertStore",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: { isProjectPermission: true } } });
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="helper">{{ t("monitor.setting.cronTrigger") }}</div>
|
<div class="helper">{{ t("monitor.setting.cronTrigger") }}</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
|
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
|
||||||
<loading-button type="primary" html-type="button" :click="doSave">{{ t("certd.save") }}</loading-button>
|
<loading-button type="primary" html-type="button" :click="doSave" :disabled="!hasActionPermission('write')">{{ t("certd.save") }}</loading-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -55,6 +55,7 @@ import { utils } from "/@/utils";
|
|||||||
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
import NotificationSelector from "/@/views/certd/notification/notification-selector/index.vue";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
import { useSettingStore } from "/src/store/settings";
|
import { useSettingStore } from "/src/store/settings";
|
||||||
|
import { useCrudPermission } from "/@/plugin/permission";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
@@ -73,6 +74,8 @@ async function loadUserSettings() {
|
|||||||
merge(formState, data);
|
merge(formState, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { hasActionPermission } = useCrudPermission({ permission: { isProjectPermission: true } });
|
||||||
|
|
||||||
loadUserSettings();
|
loadUserSettings();
|
||||||
const doSave = async (form: any) => {
|
const doSave = async (form: any) => {
|
||||||
await utils.sleep(300);
|
await utils.sleep(300);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default defineComponent({
|
|||||||
setup() {
|
setup() {
|
||||||
const api = createNotificationApi();
|
const api = createNotificationApi();
|
||||||
notificationProvide(api);
|
notificationProvide(api);
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api } });
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { api, permission: { isProjectPermission: true } } });
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import { OPEN_API_DOC } from "/@/views/certd/open/openkey/api";
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: "OpenKey",
|
name: "OpenKey",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: { isProjectPermission: true } } });
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -124,11 +124,11 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
|||||||
click() {
|
click() {
|
||||||
openCertApplyDialog({ key: "CertApply" });
|
openCertApplyDialog({ key: "CertApply" });
|
||||||
},
|
},
|
||||||
show: hasActionPermission("add"),
|
show: hasActionPermission("write"),
|
||||||
},
|
},
|
||||||
uploadCert: {
|
uploadCert: {
|
||||||
order: 2,
|
order: 2,
|
||||||
show: hasActionPermission("uploadCert"),
|
show: hasActionPermission("write"),
|
||||||
text: t("certd.commercialCertHosting"),
|
text: t("certd.commercialCertHosting"),
|
||||||
type: "primary",
|
type: "primary",
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
|||||||
@@ -14,12 +14,16 @@
|
|||||||
import { defineComponent, onActivated, onMounted } from "vue";
|
import { defineComponent, onActivated, onMounted } from "vue";
|
||||||
import { useFs } from "@fast-crud/fast-crud";
|
import { useFs } from "@fast-crud/fast-crud";
|
||||||
import createCrudOptions from "./crud";
|
import createCrudOptions from "./crud";
|
||||||
import { createApi } from "./api";
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PipelineGroupManager",
|
name: "PipelineGroupManager",
|
||||||
setup() {
|
setup() {
|
||||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: {} });
|
const { crudBinding, crudRef, crudExpose } = useFs({
|
||||||
|
createCrudOptions,
|
||||||
|
context: {
|
||||||
|
permission: { isProjectPermission: true },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
// 页面打开后获取列表数据
|
// 页面打开后获取列表数据
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -37,11 +37,11 @@
|
|||||||
<div v-if="selectedRowKeys.length > 0" class="batch-actions">
|
<div v-if="selectedRowKeys.length > 0" class="batch-actions">
|
||||||
<div class="batch-actions-inner">
|
<div class="batch-actions-inner">
|
||||||
<span>{{ t("certd.selectedCount", { count: selectedRowKeys.length }) }}</span>
|
<span>{{ t("certd.selectedCount", { count: selectedRowKeys.length }) }}</span>
|
||||||
<fs-button icon="ion:trash-outline" class="color-red" type="link" :text="t('certd.batchDelete')" @click="batchDelete"></fs-button>
|
<fs-button v-if="hasActionPermission('write')" icon="ion:trash-outline" class="color-red" type="link" :text="t('certd.batchDelete')" @click="batchDelete"></fs-button>
|
||||||
<batch-rerun :selected-row-keys="selectedRowKeys" @change="batchFinished"></batch-rerun>
|
<batch-rerun :selected-row-keys="selectedRowKeys" @change="batchFinished"></batch-rerun>
|
||||||
<change-group :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-group>
|
<change-group v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-group>
|
||||||
<change-notification :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-notification>
|
<change-notification v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-notification>
|
||||||
<change-trigger :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-trigger>
|
<change-trigger v-if="hasActionPermission('write')" :selected-row-keys="selectedRowKeys" @change="batchFinished"></change-trigger>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #form-bottom>
|
<template #form-bottom>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<fs-crud ref="crudRef" v-bind="crudBinding">
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
||||||
<template #pagination-left>
|
<template #pagination-left>
|
||||||
<a-tooltip :title="t('certd.batchDelete')">
|
<a-tooltip v-if="hasActionPermission('write')" :title="t('certd.batchDelete')">
|
||||||
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@@ -32,13 +32,21 @@ import createCrudOptions from "./crud";
|
|||||||
import { message, Modal } from "ant-design-vue";
|
import { message, Modal } from "ant-design-vue";
|
||||||
import { DeleteBatch } from "./api";
|
import { DeleteBatch } from "./api";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
|
import { useCrudPermission } from "/@/plugin/permission";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "CnameRecord",
|
name: "CnameRecord",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
const context: any = {
|
||||||
|
permission: {
|
||||||
|
isProjectPermission: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const { hasActionPermission } = useCrudPermission({ permission: context.permission });
|
||||||
|
context.hasActionPermission = hasActionPermission;
|
||||||
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||||
|
|
||||||
const selectedRowKeys = context.selectedRowKeys;
|
const selectedRowKeys = context.selectedRowKeys;
|
||||||
const handleBatchDelete = () => {
|
const handleBatchDelete = () => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import * as api from "./api";
|
|||||||
import { useSettingStore } from "/@/store/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
import { useUserStore } from "/@/store/user";
|
import { useUserStore } from "/@/store/user";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
import { userDict } from "../../dicts";
|
import { useDicts } from "../../dicts";
|
||||||
|
|
||||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -35,6 +35,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
|||||||
const selectedRowKeys: Ref<any[]> = ref([]);
|
const selectedRowKeys: Ref<any[]> = ref([]);
|
||||||
context.selectedRowKeys = selectedRowKeys;
|
context.selectedRowKeys = selectedRowKeys;
|
||||||
|
|
||||||
|
const { userDict } = useDicts();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
crudOptions: {
|
crudOptions: {
|
||||||
settings: {
|
settings: {
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ const { t } = useI18n();
|
|||||||
defineOptions({
|
defineOptions({
|
||||||
name: "MyProjectManager",
|
name: "MyProjectManager",
|
||||||
});
|
});
|
||||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
const context: any = { permission: { isProjectPermission: true, projectPermission: "admin" } };
|
||||||
|
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||||
|
|
||||||
const selectedRowKeys = context.selectedRowKeys;
|
const selectedRowKeys = context.selectedRowKeys;
|
||||||
const handleBatchDelete = () => {
|
const handleBatchDelete = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user