|
@@ -75,7 +75,6 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
|
|
|
},
|
|
|
componentProps: {
|
|
|
api: async function (params) {
|
|
|
- console.log('params', params);
|
|
|
const res = (await categoryApi(params)) as any as TreeNode[];
|
|
|
// const treeData = makeTree(res);
|
|
|
return res.filter((i) => i.level === 'L1');
|
|
@@ -147,7 +146,10 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
|
|
|
setup(_, { emit }) {
|
|
|
const { createMessage } = useMessage();
|
|
|
|
|
|
- const [registerForm, { validate, getFieldsValue, resetFields, setFieldsValue }] = useForm({
|
|
|
+ const [
|
|
|
+ registerForm,
|
|
|
+ { validate, getFieldsValue, resetFields, setFieldsValue, updateSchema },
|
|
|
+ ] = useForm({
|
|
|
labelWidth: 120,
|
|
|
schemas,
|
|
|
showActionButtonGroup: false,
|
|
@@ -167,6 +169,17 @@ wapBannerUrl: "https://4dkk.4dage.com/shop/huafa/20220302/23135195983e96.png?x-o
|
|
|
isShow: String(data.isShow),
|
|
|
wapBannerUrl: [data.wapBannerUrl],
|
|
|
});
|
|
|
+ updateSchema({
|
|
|
+ field: 'parentId',
|
|
|
+ componentProps: {
|
|
|
+ api: async function (params) {
|
|
|
+ const res = (await categoryApi(params)) as any as TreeNode[];
|
|
|
+ return res.filter((i) => i.level === 'L1' && i.id !== data.id);
|
|
|
+ },
|
|
|
+ labelField: 'name',
|
|
|
+ valueField: 'id',
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
async function handleOk() {
|