mirror of https://github.com/certd/certd
🔱: [client] sync upgrade with 3 commits [trident-sync]
chore: 一些小优化 chore: docpull/14/head
parent
59f22ab17e
commit
02466ea0bd
|
@ -8,6 +8,7 @@ import UiAntdv from "@fast-crud/ui-antdv";
|
|||
import _ from "lodash-es";
|
||||
import { useCrudPermission } from "../permission";
|
||||
import { GetSignedUrl } from "/@/views/crud/component/uploader/s3/api";
|
||||
import { message, notification } from "ant-design-vue";
|
||||
|
||||
function install(app: any, options: any = {}) {
|
||||
app.use(UiAntdv);
|
||||
|
@ -95,6 +96,13 @@ function install(app: any, options: any = {}) {
|
|||
width: "120px"
|
||||
}
|
||||
},
|
||||
async afterSubmit({ mode }) {
|
||||
if (mode === "add") {
|
||||
notification.success({ message: "添加成功" });
|
||||
} else if (mode === "edit") {
|
||||
notification.success({ message: "保存成功" });
|
||||
}
|
||||
},
|
||||
wrapperCol: {
|
||||
span: null
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
|||
return {
|
||||
output: {},
|
||||
crudOptions: {
|
||||
//大量数据的crud配置
|
||||
request: {
|
||||
pageRequest,
|
||||
addRequest,
|
||||
|
|
|
@ -3,6 +3,7 @@ import mockUtil from "/src/mock/base";
|
|||
const options: any = {
|
||||
name: "AdvancedBigData",
|
||||
idGenerator: 0,
|
||||
//此处copy多次,模拟大量数据
|
||||
copyTimes: 1000
|
||||
};
|
||||
const list = [
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
//此处演示从后台获取crudOptions配置字符串
|
||||
export const crudOptions = `
|
||||
({crudExpose,dict}) => {
|
||||
return {
|
||||
|
|
|
@ -29,6 +29,7 @@ export default defineComponent({
|
|||
// 页面打开后获取列表数据
|
||||
onMounted(async () => {
|
||||
const customValue = {};
|
||||
//异步初始化fs,createCrudOptions为异步方法
|
||||
const { crudExpose, context } = await useFsAsync({ crudRef, crudBinding, createCrudOptions, context: customValue });
|
||||
// 刷新数据
|
||||
await crudExpose.doRefresh();
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
<a-modal v-model:visible="dialogShow" width="80%" title="fs-crud in dialog">
|
||||
<div style="height: 400px; position: relative">
|
||||
<!-- 在此处显示fs-crud页面 -->
|
||||
<fs-in-dialog></fs-in-dialog>
|
||||
</div>
|
||||
</a-modal>
|
||||
|
@ -17,6 +18,7 @@
|
|||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref } from "vue";
|
||||
//将fs-crud做成的页面在此处引入
|
||||
import FsInDialog from "./crud/index.vue";
|
||||
export default defineComponent({
|
||||
name: "InDialog",
|
||||
|
|
|
@ -11,17 +11,17 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onMounted } from "vue";
|
||||
import { defineComponent, ref, onMounted, reactive } from "vue";
|
||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, useCrud, useFs, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||
import _ from "lodash-es";
|
||||
|
||||
//此处为crudOptions配置
|
||||
const createCrudOptions = function ({}: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
//本地模拟后台crud接口方法 ----开始
|
||||
const records = [{ id: 1, name: "Hello World", type: 1 }];
|
||||
const records = reactive([{ id: 1, name: "Hello World", type: 1 }]);
|
||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||
return {
|
||||
records: [...records],
|
||||
records,
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
total: records.length
|
||||
|
|
Loading…
Reference in New Issue