mirror of
https://github.com/certd/certd.git
synced 2026-05-16 21:27:34 +08:00
chore:
This commit is contained in:
@@ -8,21 +8,13 @@
|
||||
<fs-icon :icon="ui.icons.add"></fs-icon>
|
||||
添加
|
||||
</a-button>
|
||||
<fs-permission-tree
|
||||
class="permission-tree mt-10"
|
||||
:tree="crudBinding.data"
|
||||
:checkable="false"
|
||||
:actions="permission"
|
||||
@add="addHandle"
|
||||
@edit="editHandle"
|
||||
@remove="removeHandle"
|
||||
></fs-permission-tree>
|
||||
<fs-permission-tree class="permission-tree mt-10" :tree="crudBinding.data" :checkable="false" :actions="permission" @add="addHandle" @edit="editHandle" @remove="removeHandle"></fs-permission-tree>
|
||||
</fs-crud>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import { defineComponent, onActivated, onMounted, ref } from "vue";
|
||||
import createCrudOptions from "./crud.js";
|
||||
import FsPermissionTree from "./fs-permission-tree.vue";
|
||||
import { usePermission } from "/src/plugin/permission";
|
||||
@@ -40,6 +32,9 @@ export default defineComponent({
|
||||
onMounted(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
|
||||
const { ui } = useUi();
|
||||
|
||||
@@ -59,7 +54,7 @@ export default defineComponent({
|
||||
const permission = ref({
|
||||
add: hasPermissions("1sys:auth:per:add"),
|
||||
edit: hasPermissions("1sys:auth:per:edit"),
|
||||
remove: hasPermissions("1sys:auth:per:remove")
|
||||
remove: hasPermissions("1sys:auth:per:remove"),
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -69,9 +64,9 @@ export default defineComponent({
|
||||
addHandle,
|
||||
editHandle,
|
||||
removeHandle,
|
||||
permission
|
||||
permission,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="less">
|
||||
|
||||
@@ -5,21 +5,13 @@
|
||||
</template>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding" />
|
||||
<a-modal v-model:open="authzDialogVisible" width="860px" title="分配权限" @ok="updatePermission">
|
||||
<fs-permission-tree
|
||||
ref="permissionTreeRef"
|
||||
v-model:checked-keys="checkedKeys"
|
||||
:tree="permissionTreeData"
|
||||
:editable="false"
|
||||
checkable
|
||||
:replace-fields="{ key: 'id', label: 'title' }"
|
||||
>
|
||||
</fs-permission-tree>
|
||||
<fs-permission-tree ref="permissionTreeRef" v-model:checked-keys="checkedKeys" :tree="permissionTreeData" :editable="false" checkable :replace-fields="{ key: 'id', label: 'title' }"> </fs-permission-tree>
|
||||
</a-modal>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import { defineComponent, onActivated, onMounted, ref } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import * as permissionApi from "../permission/api";
|
||||
@@ -87,7 +79,7 @@ function useAuthz() {
|
||||
authzDialogVisible,
|
||||
permissionTreeData,
|
||||
checkedKeys,
|
||||
permissionTreeRef
|
||||
permissionTreeRef,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -102,7 +94,7 @@ export default defineComponent({
|
||||
extra: ({ hasActionPermission }: UseCrudPermissionExtraProps): any => {
|
||||
//额外按钮权限控制
|
||||
return { rowHandle: { buttons: { authz: { show: hasActionPermission("authz") } } } };
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// 初始化crud配置
|
||||
@@ -116,11 +108,14 @@ export default defineComponent({
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
return {
|
||||
crudBinding,
|
||||
crudRef,
|
||||
...authz
|
||||
...authz,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onMounted } from "vue";
|
||||
import { defineComponent, ref, onMounted, onActivated } from "vue";
|
||||
import { useCrud, useExpose, useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
export default defineComponent({
|
||||
@@ -23,11 +23,14 @@ export default defineComponent({
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
onActivated(async () => {
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
|
||||
return {
|
||||
crudBinding,
|
||||
crudRef
|
||||
crudRef,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user