mirror of https://github.com/certd/certd
🔱: [client] sync upgrade with 6 commits [trident-sync]
perf: search校验失败后,refresh保持原来的formData perf(search): validation支持 https://github.com/fast-crud/fast-crud/issues/200 chore: 增加search render示例 chore: 增加search render示例 chore: jsx文档pull/14/head
parent
164b90a22f
commit
9db57f0517
|
@ -8,7 +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";
|
import { notification } from "ant-design-vue";
|
||||||
|
|
||||||
function install(app: any, options: any = {}) {
|
function install(app: any, options: any = {}) {
|
||||||
app.use(UiAntdv);
|
app.use(UiAntdv);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { requestForMock } from "/src/api/service";
|
import { requestForMock } from "/src/api/service";
|
||||||
const request = requestForMock;
|
const request = requestForMock;
|
||||||
const apiPrefix = "/mock/FeatureSearch";
|
const apiPrefix = "/mock/FeatureColumnResize";
|
||||||
export function GetList(query: any) {
|
export function GetList(query: any) {
|
||||||
return request({
|
return request({
|
||||||
url: apiPrefix + "/page",
|
url: apiPrefix + "/page",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { ref } from "vue";
|
|
||||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||||
return await api.GetList(query);
|
return await api.GetList(query);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import mockUtil from "/src/mock/base";
|
import mockUtil from "/src/mock/base";
|
||||||
const options: any = {
|
const options: any = {
|
||||||
name: "FeatureSearch",
|
name: "FeatureColumnResize",
|
||||||
idGenerator: 0
|
idGenerator: 0
|
||||||
};
|
};
|
||||||
const list = [
|
const list = [
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import * as api from "./api";
|
import * as api from "./api";
|
||||||
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
|
import { message } from "ant-design-vue";
|
||||||
|
|
||||||
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||||
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
|
||||||
|
@ -30,6 +31,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||||
delRequest
|
delRequest
|
||||||
},
|
},
|
||||||
search: {
|
search: {
|
||||||
|
validate: true,
|
||||||
initialForm: {
|
initialForm: {
|
||||||
radio: null
|
radio: null
|
||||||
},
|
},
|
||||||
|
@ -73,7 +75,15 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||||
},
|
},
|
||||||
radio: {
|
radio: {
|
||||||
title: "状态",
|
title: "状态",
|
||||||
search: { show: true },
|
search: {
|
||||||
|
show: true,
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请选择状态"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
type: "dict-radio",
|
type: "dict-radio",
|
||||||
dict: statusRef
|
dict: statusRef
|
||||||
},
|
},
|
||||||
|
@ -83,10 +93,41 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
|
||||||
show: true
|
show: true
|
||||||
},
|
},
|
||||||
type: "text",
|
type: "text",
|
||||||
|
form: {
|
||||||
|
component: {
|
||||||
|
vModel: "checked",
|
||||||
|
render({ attrs }) {
|
||||||
|
return <a-switch {...attrs} />;
|
||||||
|
},
|
||||||
|
title: "自定义render,可以继承component的属性,可以触发search的自动查询"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
customRender2: {
|
||||||
|
title: "自定义render2",
|
||||||
|
search: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
type: "text",
|
||||||
|
form: {
|
||||||
|
component: {
|
||||||
|
render({ form }) {
|
||||||
|
//注意此处的v-model写法
|
||||||
|
return <a-switch v-model={[form.customRender2, "checked"]} title={"render配置在component之下,注意vModel的写法,不能触发search的自动查询"} />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
customRender3: {
|
||||||
|
title: "自定义render3",
|
||||||
|
search: {
|
||||||
|
show: true
|
||||||
|
},
|
||||||
|
type: "text",
|
||||||
form: {
|
form: {
|
||||||
render({ form }) {
|
render({ form }) {
|
||||||
//注意此处的v-model写法
|
//注意此处的v-model写法
|
||||||
return <a-input v-model={[form.customRender, "value"]} />;
|
return <a-switch v-model={[form.customRender3, "checked"]} title={"render配置在form之下,注意vModel的写法,不能触发search的自动查询"} />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,10 @@ const options: any = {
|
||||||
};
|
};
|
||||||
const list = [
|
const list = [
|
||||||
{
|
{
|
||||||
radio: "1"
|
radio: "1",
|
||||||
|
customRender: true,
|
||||||
|
customRender2: false,
|
||||||
|
customRender3: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
radio: "2"
|
radio: "2"
|
||||||
|
|
Loading…
Reference in New Issue