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