|
@@ -1,10 +1,12 @@
|
|
import { ProFormColumnsType } from "@ant-design/pro-components";
|
|
import { ProFormColumnsType } from "@ant-design/pro-components";
|
|
|
|
+import { useModel } from "@umijs/max";
|
|
|
|
|
|
function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any, paymentCategory: any, isGlobalConfig: boolean }): ProFormColumnsType<{
|
|
function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]: any }, paymentType: any, paymentCategory: any, isGlobalConfig: boolean }): ProFormColumnsType<{
|
|
name: string;
|
|
name: string;
|
|
state: string;
|
|
state: string;
|
|
}>[] {
|
|
}>[] {
|
|
let { paragraphList, enumList, paymentType, paymentCategory, isGlobalConfig } = props
|
|
let { paragraphList, enumList, paymentType, paymentCategory, isGlobalConfig } = props
|
|
|
|
+ let {getEnum} = useModel('global')
|
|
return [
|
|
return [
|
|
{
|
|
{
|
|
title: '付费方式',
|
|
title: '付费方式',
|
|
@@ -26,8 +28,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
|
|
],
|
|
],
|
|
},
|
|
},
|
|
valueEnum: () => {
|
|
valueEnum: () => {
|
|
- let arr = enumList?.PAYMENT_TYPE?.values
|
|
|
|
- return new Map(arr?.map(({ value, description }: any) => [value, description]))
|
|
|
|
|
|
+ return getEnum("PAYMENT_TYPE","map")
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -45,8 +46,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
|
|
},
|
|
},
|
|
hideInForm: paymentType[0] != 2,
|
|
hideInForm: paymentType[0] != 2,
|
|
valueEnum: () => {
|
|
valueEnum: () => {
|
|
- let arr = enumList?.PAYMENT_OPTION?.values
|
|
|
|
- return new Map(arr?.map(({ value, description }: any) => [value, description]))
|
|
|
|
|
|
+ return getEnum("PAYMENT_OPTION","map")
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|
|
@@ -70,8 +70,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
|
|
},
|
|
},
|
|
hideInForm: paymentType[0] == 0,
|
|
hideInForm: paymentType[0] == 0,
|
|
valueEnum: () => {
|
|
valueEnum: () => {
|
|
- let arr = [{ value: 0, description: "现金" }, { value: 1, description: "书币" }]
|
|
|
|
- return new Map(arr?.map(({ value, description }: any) => [value, description]))
|
|
|
|
|
|
+ return getEnum("PAYMENT_CATEGORY","map")
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{//单本
|
|
{//单本
|
|
@@ -129,8 +128,7 @@ function formConfig(props: { paragraphList?: any[], enumList?: { [key: string]:
|
|
},
|
|
},
|
|
hideInForm: paymentType[0] == 0 || isGlobalConfig,
|
|
hideInForm: paymentType[0] == 0 || isGlobalConfig,
|
|
valueEnum: () => {
|
|
valueEnum: () => {
|
|
- let arr = enumList?.VIP_FREE?.values
|
|
|
|
- return new Map(arr?.map(({ value, description }: any) => [value, description]))
|
|
|
|
|
|
+ return getEnum("VIP_FREE","map")
|
|
}
|
|
}
|
|
},
|
|
},
|
|
{
|
|
{
|