mirror of https://github.com/certd/certd
🔱: [client] sync upgrade with 5 commits [trident-sync]
refactor: 1 refactor: 1.11.1 refactor: 1.11.1 perf: useFs优化,增加context:UseFsContextpull/14/head
parent
6ec697b010
commit
9f1f36774d
|
@ -3,6 +3,14 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.11.1](https://github.com/fast-crud/fast-crud/compare/v1.11.0...v1.11.1) (2023-03-17)
|
||||
|
||||
**Note:** Version bump only for package @fast-crud/fs-admin-antdv
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.11.0](https://github.com/fast-crud/fast-crud/compare/v1.10.0...v1.11.0) (2023-03-16)
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@fast-crud/fs-admin-antdv",
|
||||
"version": "1.11.0",
|
||||
"version": "1.11.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
@ -24,9 +24,9 @@
|
|||
"@ant-design/icons-vue": "^6.1.0",
|
||||
"@aws-sdk/client-s3": "^3.292.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.292.0",
|
||||
"@fast-crud/fast-crud": "^1.11.0",
|
||||
"@fast-crud/fast-extends": "^1.11.0",
|
||||
"@fast-crud/ui-antdv": "^1.11.0",
|
||||
"@fast-crud/fast-crud": "^1.11.1",
|
||||
"@fast-crud/fast-extends": "^1.11.1",
|
||||
"@fast-crud/ui-antdv": "^1.11.1",
|
||||
"@iconify/iconify": "^3.1.0",
|
||||
"@iconify/json": "^2.2.35",
|
||||
"@purge-icons/generated": "^0.9.0",
|
||||
|
|
|
@ -3,7 +3,7 @@ import cascaderData from "./cascader-data";
|
|||
import pcaDataLittle from "./pca-data-little";
|
||||
// @ts-ignore
|
||||
import { TreeNodesLazyLoader, getPcaData } from "./pcas-data";
|
||||
|
||||
import _ from "lodash-es";
|
||||
const openStatus = [
|
||||
{ value: "1", label: "打开", color: "success", icon: "ion:radio-button-on" },
|
||||
{ value: "2", label: "停止", color: "cyan" },
|
||||
|
@ -22,6 +22,20 @@ const textStatus = [
|
|||
{ id: "0", text: "关闭", color: "red" }
|
||||
];
|
||||
|
||||
let manyStatus = [
|
||||
{ value: "1", label: "打开", color: "success", icon: "ion:radio-button-on" },
|
||||
{ value: "2", label: "停止", color: "cyan" },
|
||||
{ value: "0", label: "关闭", color: "red", icon: "ion:radio-button-off" }
|
||||
];
|
||||
for (let i = 0; i < 8; i++) {
|
||||
manyStatus = manyStatus.concat(_.cloneDeep(manyStatus));
|
||||
}
|
||||
let idIndex = 0;
|
||||
for (const item of manyStatus) {
|
||||
idIndex++;
|
||||
item.value = idIndex + "";
|
||||
}
|
||||
|
||||
export function GetTreeChildrenByParentId(parentId: any) {
|
||||
return TreeNodesLazyLoader.getChildren(parentId);
|
||||
}
|
||||
|
@ -53,6 +67,17 @@ export default [
|
|||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/mock/dicts/ManyOpenStatusEnum",
|
||||
method: "get",
|
||||
handle() {
|
||||
return {
|
||||
code: 0,
|
||||
msg: "success",
|
||||
data: manyStatus
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
path: "/mock/dicts/moreOpenStatusEnum",
|
||||
method: "get",
|
||||
|
|
|
@ -24,10 +24,10 @@ function install(app: any, options: any = {}) {
|
|||
},
|
||||
/**
|
||||
* useCrud时会被执行
|
||||
* @param context,useCrud的参数
|
||||
* @param props,useCrud的参数
|
||||
*/
|
||||
commonOptions(context: UseCrudProps): CrudOptions {
|
||||
const crudBinding = context.crudExpose?.crudBinding;
|
||||
commonOptions(props: UseCrudProps): CrudOptions {
|
||||
const crudBinding = props.crudExpose?.crudBinding;
|
||||
const opts: CrudOptions = {
|
||||
table: {
|
||||
size: "small",
|
||||
|
@ -92,7 +92,8 @@ function install(app: any, options: any = {}) {
|
|||
};
|
||||
|
||||
// 从 useCrud({permission}) 里获取permission参数,去设置各个按钮的权限
|
||||
const crudPermission = useCrudPermission({ permission: context.permission });
|
||||
const permission = props.context?.permission || null;
|
||||
const crudPermission = useCrudPermission({ permission });
|
||||
return crudPermission.merge(opts);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -57,70 +57,70 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
|||
title: "字典1",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict1"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict1"
|
||||
})
|
||||
},
|
||||
dict2: {
|
||||
title: "字典2",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict2"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict2"
|
||||
})
|
||||
},
|
||||
dict3: {
|
||||
title: "字典3",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict3"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict3"
|
||||
})
|
||||
},
|
||||
dict4: {
|
||||
title: "字典4",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict4"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict4"
|
||||
})
|
||||
},
|
||||
dict5: {
|
||||
title: "字典5",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict5"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict5"
|
||||
})
|
||||
},
|
||||
dict6: {
|
||||
title: "字典6",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict6"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict6"
|
||||
})
|
||||
},
|
||||
dict7: {
|
||||
title: "字典7",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict7"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict7"
|
||||
})
|
||||
},
|
||||
dict8: {
|
||||
title: "字典8",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict8"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict8"
|
||||
})
|
||||
},
|
||||
dict9: {
|
||||
title: "字典9",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict9"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict9"
|
||||
})
|
||||
},
|
||||
dict10: {
|
||||
title: "字典10",
|
||||
type: "dict-select",
|
||||
dict: dict({
|
||||
url: "/mock/dicts/OpenStatusEnum?from=dict10"
|
||||
url: "/mock/dicts/ManyOpenStatusEnum?from=dict10"
|
||||
})
|
||||
},
|
||||
text1: {
|
||||
|
|
|
@ -29,7 +29,7 @@ export default defineComponent({
|
|||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
const customValue = {};
|
||||
const { crudExpose, extraExport } = await useFsAsync({ crudRef, crudBinding, createCrudOptions, customValue });
|
||||
const { crudExpose, context } = await useFsAsync({ crudRef, crudBinding, createCrudOptions, context: customValue });
|
||||
// 刷新数据
|
||||
await crudExpose.doRefresh();
|
||||
});
|
||||
|
|
|
@ -11,7 +11,7 @@ export default defineComponent({
|
|||
name: "FormLinkage",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions, context: customValue });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -2,7 +2,8 @@ import * as api from "./api.js";
|
|||
import _ from "lodash-es";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
|
||||
export default function ({ crudExpose, localDataRef }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const localDataRef = context.localDataRef;
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
const { page } = query;
|
||||
//总数据
|
||||
|
|
|
@ -36,7 +36,7 @@ export default defineComponent({
|
|||
const ret = await GetList({ page: { offset: 0, limit: 99999999 }, query: {}, sort: {} });
|
||||
localDataRef.value = ret.records;
|
||||
|
||||
const { crudExpose } = useFs({ crudBinding, crudRef, createCrudOptions, localDataRef });
|
||||
const { crudExpose } = useFs({ crudBinding, crudRef, createCrudOptions, context: { localDataRef } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
await crudExpose.doRefresh();
|
||||
|
|
|
@ -3,7 +3,7 @@ import { ref, shallowRef } from "vue";
|
|||
import SubTable from "./sub-table/index.vue";
|
||||
import { AddReq, compute, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
|
||||
export default function ({ crudExpose, asideTableRef }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { asideTableRef } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
|
|
|
@ -26,7 +26,7 @@ export default defineComponent({
|
|||
setup() {
|
||||
const asideTableRef = ref();
|
||||
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, asideTableRef });
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions, context: { asideTableRef } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as api from "./api";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
|
||||
export default function ({ crudExpose, props, ctx }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { props, ctx } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
|
|
|
@ -20,7 +20,7 @@ export default defineComponent({
|
|||
},
|
||||
emits: ["update:modelValue"],
|
||||
setup(props, ctx) {
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, props, ctx });
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { props, ctx } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -18,7 +18,6 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
|||
};
|
||||
|
||||
return {
|
||||
output: {},
|
||||
crudOptions: {
|
||||
settings: {
|
||||
viewFormUseCellComponent: true
|
||||
|
|
|
@ -19,8 +19,8 @@ import { useFs, UseFsProps } from "@fast-crud/fast-crud";
|
|||
export default defineComponent({
|
||||
name: "BasisColumnMergePlugin",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const context: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import * as api from "./api";
|
||||
export default function ({ crudExpose, customValue }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
|
@ -17,8 +17,6 @@ export default function ({ crudExpose, customValue }: CreateCrudOptionsProps): C
|
|||
};
|
||||
|
||||
return {
|
||||
//自定义变量返回
|
||||
customExport: {},
|
||||
crudOptions: {
|
||||
// 自定义crudOptions配置
|
||||
request: {
|
||||
|
|
|
@ -19,9 +19,6 @@ import createCrudOptions from "./crud";
|
|||
export default defineComponent({
|
||||
name: "FsCrudFirst",
|
||||
setup() {
|
||||
// 演示自定义变量传递, 将会传递给createCrudOptions
|
||||
const customValue: any = {};
|
||||
|
||||
// // crud组件的ref
|
||||
// const crudRef: Ref = ref();
|
||||
// // crud 配置的ref
|
||||
|
@ -35,7 +32,7 @@ export default defineComponent({
|
|||
|
||||
// =======以上为fs的初始化代码=========
|
||||
// =======你可以简写为下面这一行========
|
||||
const { crudRef, crudBinding, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const { crudRef, crudBinding, crudExpose, context } = useFs({ createCrudOptions, context: {} });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -16,7 +16,7 @@ import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, Edi
|
|||
import _ from "lodash-es";
|
||||
|
||||
//此处为crudOptions配置
|
||||
const createCrudOptions = function ({ crudOptions, customValue }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const createCrudOptions = function ({}: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
//本地模拟后台crud接口方法 ----开始
|
||||
const records = [{ id: 1, name: "Hello World", type: 1 }];
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
|
@ -88,9 +88,6 @@ const createCrudOptions = function ({ crudOptions, customValue }: CreateCrudOpti
|
|||
export default defineComponent({
|
||||
name: "FsCrudHelloWorld",
|
||||
setup() {
|
||||
// 演示自定义变量传递, 将会传递给createCrudOptions
|
||||
const customValue: any = {};
|
||||
|
||||
// // crud组件的ref
|
||||
// const crudRef: Ref = ref();
|
||||
// // crud 配置的ref
|
||||
|
@ -98,13 +95,13 @@ export default defineComponent({
|
|||
// // 暴露的方法
|
||||
// const { crudExpose } = useExpose({ crudRef, crudBinding });
|
||||
// // 你的crud配置
|
||||
// const { crudOptions, customExport } = createCrudOptions({ crudExpose, customValue });
|
||||
// const { crudOptions, customExport } = createCrudOptions({ crudExpose, context });
|
||||
// // 初始化crud配置
|
||||
// const { resetCrudOptions, appendCrudBinding } = useCrud({ crudExpose, crudOptions });
|
||||
|
||||
// =======以上为fs的初始化代码=========
|
||||
// =======你可以简写为下面这一行========
|
||||
const { crudRef, crudBinding, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const { crudRef, crudBinding, crudExpose, context } = useFs({ createCrudOptions, context: {} });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -21,8 +21,7 @@ import _ from "lodash-es";
|
|||
export default defineComponent({
|
||||
name: "BasisReset",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport, crudOptions, resetCrudOptions, appendBindingOptions } = useFs({ createCrudOptions, customValue } as UseFsProps);
|
||||
const { crudBinding, crudRef, crudExpose, context, crudOptions, resetCrudOptions, appendBindingOptions } = useFs({ createCrudOptions, context: {} });
|
||||
|
||||
setTimeout(() => {
|
||||
//合并新的crudOptions
|
||||
|
|
|
@ -19,7 +19,6 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
|||
};
|
||||
|
||||
return {
|
||||
output: {},
|
||||
crudOptions: {
|
||||
request: {
|
||||
pageRequest,
|
||||
|
|
|
@ -18,7 +18,7 @@ import createCrudOptions from "./crud.js";
|
|||
export default defineComponent({
|
||||
name: "BasisValueChange",
|
||||
setup() {
|
||||
const { crudBinding, crudRef, crudExpose, output } = useFs({ createCrudOptions });
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
@ -28,7 +28,7 @@ export default defineComponent({
|
|||
return {
|
||||
crudBinding,
|
||||
crudRef,
|
||||
...output
|
||||
...context
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
@ -18,8 +18,8 @@ import createCrudOptions from "./crud";
|
|||
export default defineComponent({
|
||||
name: "DictSharedManager",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const context: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -20,7 +20,7 @@ export default defineComponent({
|
|||
setup() {
|
||||
// crud组件的ref
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue });
|
||||
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions, context: customValue });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -15,8 +15,7 @@ import createCrudOptions from "./crud.jsx";
|
|||
export default defineComponent({
|
||||
name: "FormBase",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue } as UseFsProps);
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
|
|
|
@ -19,7 +19,7 @@ export default defineComponent({
|
|||
name: "FormCustomForm",
|
||||
setup(props, ctx) {
|
||||
// 页面打开后获取列表数据
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions } as UseFsProps);
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions });
|
||||
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
|
|
|
@ -16,7 +16,7 @@ export default defineComponent({
|
|||
name: "FormSingleColumn",
|
||||
setup() {
|
||||
const customValue: any = {}; //自定义变量,传给createCrudOptions的额外参数(可以任意命名,任意多个)
|
||||
const { crudBinding, crudRef, crudExpose, customExport } = useFs({ createCrudOptions, customValue } as UseFsProps);
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: customValue });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
|
|
|
@ -26,7 +26,7 @@ export default defineComponent({
|
|||
setup() {
|
||||
// 此处传入permission进行通用按钮权限设置,会通过commonOptions去设置actionbar和rowHandle的按钮的show属性
|
||||
// 更多关于按钮权限的源代码设置,请参考 ./src/plugin/fast-crud/index.js (75-77行)
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, permission: "sys:auth:per" });
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: "sys:auth:per" } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as api from "./api";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
|
||||
export default function ({ crudExpose, authz }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return await api.GetList(query);
|
||||
};
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent, onMounted, ref} from "vue";
|
||||
import {useFs} from "@fast-crud/fast-crud";
|
||||
import { defineComponent, onMounted, ref } from "vue";
|
||||
import { useFs } from "@fast-crud/fast-crud";
|
||||
import createCrudOptions from "./crud";
|
||||
import * as permissionApi from "../permission/api";
|
||||
import * as api from "./api";
|
||||
import {message} from "ant-design-vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import FsPermissionTree from "../permission/fs-permission-tree.vue";
|
||||
import {UseCrudPermissionCompProps, UseCrudPermissionExtraProps} from "/@/plugin/permission";
|
||||
import { UseCrudPermissionCompProps, UseCrudPermissionExtraProps } from "/@/plugin/permission";
|
||||
|
||||
function useAuthz() {
|
||||
const checkedKeys = ref();
|
||||
|
@ -101,7 +101,7 @@ export default defineComponent({
|
|||
// 此处传入permission进行通用按钮权限设置,会通过commonOptions去设置actionbar和rowHandle的按钮的show属性
|
||||
// 更多关于按钮权限的源代码设置,请参考 ./src/plugin/fast-crud/index.js (75-77行)
|
||||
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, authz, permission });
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { authz, permission } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
|
@ -17,7 +17,7 @@ export default defineComponent({
|
|||
// 初始化crud配置
|
||||
// 此处传入权限前缀进行通用按钮权限设置,会通过commonOptions去设置actionbar和rowHandle的按钮的show属性
|
||||
// 更多关于按钮权限的源代码设置,请参考 ./src/plugin/fast-crud/index.js (75-77行)
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, permission: "sys:auth:user" });
|
||||
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: "sys:auth:user" } });
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Reference in New Issue