diff --git a/src/components/detail/common.tsx b/src/components/detail/common.tsx index 81eed866f62242fab0f3e7253ee5a6db563bc0ed..889933cc747eee58c994889143aab2c3e9d1d145 100644 --- a/src/components/detail/common.tsx +++ b/src/components/detail/common.tsx @@ -4,6 +4,7 @@ import { ColumnsConfig, ParamConfig } from '../../interface' import { DetailFieldConfigs as getFieldConfigs } from './' import ParamHelper from '../../util/param' import { CCMSConfig } from '../../main' +import { TreeSelectFieldOption } from '../formFields/treeSelect' /** * 详情页表单项基类配置文件格式定义 @@ -93,6 +94,7 @@ export interface DetailFieldProps { baseRoute: string, loadDomain: (domain: string) => Promise loadPageConfig: (pageID: any) => Promise + loadPageList: () => Promise> handlePageRedirect: (path: string) => void checkPageAuth: (pageID: any) => Promise onUnmount: (reload?: boolean, data?: any) => Promise diff --git a/src/components/detail/group/index.tsx b/src/components/detail/group/index.tsx index 3858b556db6b3b6200d739e4db82a8245088eb42..c80378a3083a861dce1735c5bb9e8cb1a4bb05b7 100644 --- a/src/components/detail/group/index.tsx +++ b/src/components/detail/group/index.tsx @@ -204,6 +204,7 @@ export default class GroupField extends DetailField Promise} loadPageFrameURL={this.props.loadPageFrameURL as (pageID: any) => Promise} loadPageConfig={this.props.loadPageConfig as (pageID: any) => Promise} + loadPageList={this.props.loadPageList} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} onMount={() => { diff --git a/src/components/formFields/any/index.tsx b/src/components/formFields/any/index.tsx index 996a04cb568c22e55b091f4f459472d41bf28609..e7a4a8ae3e5e96ec3ffefb4d91b60dfcef8c9554 100644 --- a/src/components/formFields/any/index.tsx +++ b/src/components/formFields/any/index.tsx @@ -100,6 +100,7 @@ export default class AnyField extends Field : ( type === 'number' @@ -121,6 +122,7 @@ export default class AnyField extends Field : {}} @@ -140,6 +142,7 @@ export default class AnyField extends Field) })} diff --git a/src/components/formFields/common.tsx b/src/components/formFields/common.tsx index c6118a33b7baf4da0bb1d665021c349fb177946f..667e8071342e0f32d8a83cd6370ea7bf254045b8 100644 --- a/src/components/formFields/common.tsx +++ b/src/components/formFields/common.tsx @@ -7,6 +7,7 @@ import { updateCommonPrefixItem } from '../../util/value' import { ConditionConfig } from '../../util/condition' import { StatementConfig } from '../../util/statement' import { isEqual, get } from 'lodash' +import { TreeSelectFieldOption } from './treeSelect' /** * 表单项基类配置文件格式定义 @@ -99,6 +100,7 @@ export interface FieldProps { onReportFields?: (field: string) => Promise // 向父组件上报依赖字段 1.3.0新增 step: { [field: string]: any } // 传递formValue loadDomain: (domain: string) => Promise + loadPageList: () => Promise> } /** @@ -190,10 +192,7 @@ export class Field extends React.Component< } shouldComponentUpdate (nextProps: FieldProps, nextState: S) { - // console.log('nextProps', nextProps, this.props, nextProps.value == this.props.value); - const dependentFieldsArr = this.dependentFields - // console.log('dependentFieldsArr',dependentFieldsArr); let dependentIsChange = false if (dependentFieldsArr && dependentFieldsArr.length) { for (let i = dependentFieldsArr.length; i >= 0; i--) { @@ -212,7 +211,6 @@ export class Field extends React.Component< * record也不比较,需要比较的话就在dependentFieldsArr取出record绝对路径 * */ if (!dependentIsChange && isEqual(this.state, nextState) && nextProps.value === this.props.value && this.props.config === nextProps.config) { - // console.log('no update' ); return false } return true diff --git a/src/components/formFields/custom/index.tsx b/src/components/formFields/custom/index.tsx index 672607ee94060c76da248c1a81ade4a1713f2511..fcbafa767a9da4f23713bd7b4442b8e723d1ba53 100644 --- a/src/components/formFields/custom/index.tsx +++ b/src/components/formFields/custom/index.tsx @@ -64,9 +64,10 @@ export default class CustomField extends Field imple onValueListSplice: this.props.onValueListSplice, base: this.props.baseRoute, loadDomain: this.props.loadDomain, + loadPageList: this.props.loadPageList, bindValidate: this.bindValidate, bindGet: this.bindGet - }); + }) } } } @@ -93,6 +94,7 @@ export default class CustomField extends Field imple onValueListSplice: this.props.onValueListSplice, base: this.props.baseRoute, loadDomain: this.props.loadDomain, + loadPageList: this.props.loadPageList, bindValidate: this.bindValidate, bindGet: this.bindGet } diff --git a/src/components/formFields/form/index.tsx b/src/components/formFields/form/index.tsx index cbf19b9c7e0fa481d653b6c9415101148b92fe8f..f5c0f57d2e7b0b2f7b0a219cfc451f0fbfaf6cff 100644 --- a/src/components/formFields/form/index.tsx +++ b/src/components/formFields/form/index.tsx @@ -521,6 +521,7 @@ export default class FormField extends Field await this.props.loadDomain(domain)} containerPath={getChainPath(this.props.containerPath, this.props.config.field, index)} onReportFields={async (field: string) => await this.handleReportFields(field)} + loadPageList={async () => await this.props.loadPageList()} /> ) }) diff --git a/src/components/formFields/group/index.tsx b/src/components/formFields/group/index.tsx index d5fc658862e5d60f0771dc4cc7cff08b156065e1..57a0d70d3747bf812527071f1b21432bee2ec503 100644 --- a/src/components/formFields/group/index.tsx +++ b/src/components/formFields/group/index.tsx @@ -344,6 +344,7 @@ export default class GroupField extends Field await this.props.loadDomain(domain)} containerPath={getChainPath(this.props.containerPath, this.props.config.field)} onReportFields={async (field: string) => await this.handleReportFields(field)} + loadPageList={async () => await this.props.loadPageList()} /> ) } diff --git a/src/components/formFields/importSubform/index.tsx b/src/components/formFields/importSubform/index.tsx index e16aa6796388468359965d3002bed8310e4831d2..50d51e9febf31f10203252bbbeefdef0ac5f3d79 100644 --- a/src/components/formFields/importSubform/index.tsx +++ b/src/components/formFields/importSubform/index.tsx @@ -455,6 +455,7 @@ export default class ImportSubformField extends Field await this.props.loadDomain(domain)} containerPath={getChainPath(this.props.containerPath, this.props.config.field)} onReportFields={async (field: string) => await this.handleReportFields(field)} + loadPageList={async () => await this.props.loadPageList()} /> ) } diff --git a/src/components/formFields/object/index.tsx b/src/components/formFields/object/index.tsx index b43626a93394c59256544e5aac9de56e05646aba..3f0eaab44a50d3e5b2ec56eaaa2d2a50c091fcdb 100644 --- a/src/components/formFields/object/index.tsx +++ b/src/components/formFields/object/index.tsx @@ -485,6 +485,7 @@ export default class ObjectField extends Field this.props.loadDomain(domain)} containerPath={getChainPath(this.props.containerPath, this.props.config.field, key)} onReportFields={async (field: string) => await this.handleReportFields(field)} + loadPageList={async () => await this.props.loadPageList()} /> ) }) diff --git a/src/components/formFields/tabs/index.tsx b/src/components/formFields/tabs/index.tsx index 8993b5e2a94290eed8c34619776aa684f04545d9..b6316cb0acf2b8c21bb78e9a8935a2d6b4a81ce2 100644 --- a/src/components/formFields/tabs/index.tsx +++ b/src/components/formFields/tabs/index.tsx @@ -398,6 +398,7 @@ export default class TabsField extends Field await this.props.loadDomain(domain)} containerPath={getChainPath(this.props.containerPath, this.props.config.field, tab.field)} onReportFields={async (field: string) => await this.handleReportFields(field)} + loadPageList={async () => await this.props.loadPageList()} /> ) })} diff --git a/src/main.tsx b/src/main.tsx index 9097913b4d96177a8f23eb82f89673b343e6d7a6..7bed1a1281f4782d47085e3c8ce7384ab72e3bc7 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -3,6 +3,8 @@ import marked from 'marked' import Step, { StepProps } from './steps/common' import StepComponents, { StepConfigs } from './steps' import { RichStringConfig } from './interface' +import { TreeSelectFieldOption } from './components/formFields/treeSelect' + /** * 页面配置文件格式定义 * - basic: 页面基本配置 @@ -45,6 +47,7 @@ export interface CCMSProps { loadPageURL: (pageID: any) => Promise loadPageFrameURL: (pageID: any) => Promise loadPageConfig: (pageID: any) => Promise + loadPageList: () => Promise> loadDomain: (domain: string) => Promise handlePageRedirect?: (path: string, replaceHistory: boolean) => void callback: (success: boolean) => void @@ -233,6 +236,7 @@ export default class CCMS extends React.Component { loadPageURL, loadPageFrameURL, loadPageConfig, + loadPageList, loadDomain, handlePageRedirect } = this.props @@ -275,6 +279,7 @@ export default class CCMS extends React.Component { loadPageURL, loadPageFrameURL, loadPageConfig, + loadPageList, loadDomain, handlePageRedirect, handleFormValue diff --git a/src/steps/common.tsx b/src/steps/common.tsx index a9a0d61618d530762c94b511b46aa3054a649ad3..fec990b19a011889e1c0e7b7e293c2bfb11e2f40 100644 --- a/src/steps/common.tsx +++ b/src/steps/common.tsx @@ -1,5 +1,6 @@ import React from 'react' import { CCMSConfig } from '../main' +import { TreeSelectFieldOption } from '../components/formFields/treeSelect' /** * 页面流转步骤基类配置定义 @@ -30,6 +31,7 @@ export interface StepProps { loadPageURL: (pageID: any) => Promise loadPageFrameURL: (pageID: any) => Promise loadPageConfig: (pageID: any) => Promise + loadPageList: () => Promise> baseRoute: string loadDomain: (domain: string) => Promise handlePageRedirect?: (path: string, replaceHistory: boolean) => void diff --git a/src/steps/detail/index.tsx b/src/steps/detail/index.tsx index 7545e8b90ca938e9e8fa13ef1d5575ffff1b48b3..232a28ef83caf7f5a329d3213817107a31fb89e8 100644 --- a/src/steps/detail/index.tsx +++ b/src/steps/detail/index.tsx @@ -384,6 +384,7 @@ export default class DetailStep extends Step { onUnmount={this.props.onUnmount} checkPageAuth={this.props.checkPageAuth} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} handlePageRedirect={() => this.props.handlePageRedirect} diff --git a/src/steps/filter/index.tsx b/src/steps/filter/index.tsx index e6aad5ee0b9d9ff0aaa5d06ec802b40dc36040f8..d35c22a13f83b55ec4328b074406a36ddbb8a37e 100644 --- a/src/steps/filter/index.tsx +++ b/src/steps/filter/index.tsx @@ -507,6 +507,7 @@ export default class FilterStep extends Step { baseRoute={this.props.baseRoute} loadDomain={async (domain: string) => await this.props.loadDomain(domain)} containerPath={''} + loadPageList={async () => await this.props.loadPageList()} /> ) } diff --git a/src/steps/form/index.tsx b/src/steps/form/index.tsx index 45d0e8536bb8a2c01c7ffee1ac5cdf370c4ff451..afe51db1c60a99e79051657c9e62d7d081ed475f 100644 --- a/src/steps/form/index.tsx +++ b/src/steps/form/index.tsx @@ -625,6 +625,7 @@ export default class FormStep extends Step { // ts对clas loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} baseRoute={this.props.baseRoute} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} @@ -739,6 +740,7 @@ export default class FormStep extends Step { // ts对clas baseRoute={this.props.baseRoute} loadDomain={async (domain: string) => await this.props.loadDomain(domain)} containerPath={''} + loadPageList={async () => await this.props.loadPageList()} /> ) } diff --git a/src/steps/header/index.tsx b/src/steps/header/index.tsx index 8e8861f30f1ae5a59358c622623a184f6830d3cd..78cd9c5c278f884ef3898802557bf9b44f29f595 100644 --- a/src/steps/header/index.tsx +++ b/src/steps/header/index.tsx @@ -234,6 +234,7 @@ export default class HeaderStep extends Step { loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} /> @@ -306,6 +307,7 @@ export default class HeaderStep extends Step { loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} baseRoute={this.props.baseRoute} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} diff --git a/src/steps/table/index.tsx b/src/steps/table/index.tsx index cb1c73d2aaa9978386d2e8fe0c2dabadc2d3a00d..b47104ff94c23fe5359d1c485812bd2d161ae3db 100644 --- a/src/steps/table/index.tsx +++ b/src/steps/table/index.tsx @@ -892,6 +892,7 @@ export default class TableStep extends Step { loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} onMount={() => { @@ -931,6 +932,7 @@ export default class TableStep extends Step { loadPageURL={this.props.loadPageURL} loadPageFrameURL={this.props.loadPageFrameURL} loadPageConfig={this.props.loadPageConfig} + loadPageList={this.props.loadPageList} loadDomain={this.props.loadDomain} handlePageRedirect={this.props.handlePageRedirect} onMount={() => { diff --git a/src/util/operation.tsx b/src/util/operation.tsx index 0aae17251e39eeb5fc531b8bd1153579d4d429eb..14222c94c7f9d8057ce35ae4ae7dd5f343d989de 100644 --- a/src/util/operation.tsx +++ b/src/util/operation.tsx @@ -1,10 +1,10 @@ import React from 'react' import queryString from 'query-string' -// import { set } from "lodash"; import { set } from '../util/produce' import { ParamConfig } from '../interface' import { CCMSConfig, CCMSProps } from '../main' import { getParam } from './value' +import { TreeSelectFieldOption } from '../components/formFields/treeSelect' export type OperationConfig = CCMSOperationConfig @@ -57,6 +57,7 @@ interface OperationHelperProps { loadPageURL: (pageID: any) => Promise, loadPageFrameURL: (pageID: any) => Promise, loadPageConfig: (pageID: any) => Promise, + loadPageList: () => Promise>, baseRoute: string, loadDomain: (domain: string) => Promise handlePageRedirect?: (path: string, replaceHistory: boolean) => void @@ -97,6 +98,7 @@ export default class OperationHelper extends React.Component { @@ -152,6 +154,7 @@ export default class OperationHelper extends React.Component { @@ -180,6 +183,7 @@ export default class OperationHelper extends React.Component {