@pisell/materials 6.4.19 → 6.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +7 -7
- package/build/lowcode/preview.js +145 -145
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.js +21 -21
- package/es/components/colorPicker/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +72 -10
- package/es/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +16 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/es/components/dataSourceComponents/dataSourceForm/serve.d.ts +179 -0
- package/es/components/dataSourceComponents/dataSourceForm/serve.js +93 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +39 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +66 -28
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +32 -0
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +24 -0
- package/es/components/dataSourceComponents/dataSourceForm/urlUtils.js +76 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +3 -4
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/es/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/es/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -2
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.js +16 -0
- package/es/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/Switch/index.js +8 -0
- package/es/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/es/components/dataSourceComponents/fields/Switch/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
- package/es/components/dataSourceComponents/fields/index.d.ts +10 -11
- package/es/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/es/components/dataSourceComponents/hooks/useActions.js +20 -14
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +120 -0
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/es/components/date-picker/datePickerCpt.d.ts +0 -1
- package/es/components/filter/components/items/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/es/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/es/components/filter/components/items/text/index.d.ts +0 -1
- package/es/components/filter/index.d.ts +0 -1
- package/es/components/iconfont/index.js +1 -1
- package/es/components/list/index.d.ts +0 -1
- package/es/components/lowCodePage/index.d.ts +0 -1
- package/es/components/page/index.d.ts +6 -0
- package/es/components/pisell-config-provider/index.js +0 -1
- package/es/components/pisellCardList/index.d.ts +4 -0
- package/es/components/pisellCardList/index.js +5 -1
- package/es/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
- package/es/components/pisellInput/components/BankCard/index.d.ts +0 -1
- package/es/components/pisellInput/components/Copy/index.d.ts +0 -1
- package/es/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
- package/es/components/pisellLoading/index.d.ts +0 -1
- package/es/components/pisellTooltip/index.d.ts +0 -1
- package/es/components/pisellWalletPassCard/index.d.ts +4 -0
- package/es/components/pisellWalletPassCard/index.js +17 -4
- package/es/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/Note/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +27 -0
- package/es/components/productCard/cartSkuCard/components/discountReason/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/es/components/productCard/cartSkuCard/components/packages/index.d.ts +11 -0
- package/es/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/sales/index.d.ts +13 -0
- package/es/components/productCard/cartSkuCard/components/specs/index.d.ts +4 -0
- package/es/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/es/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/es/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/es/components/productCard/components/AmountFooter/index.d.ts +0 -1
- package/es/components/productCard/components/Header/EditButton/index.d.ts +0 -1
- package/es/components/productCard/components/MultiDay/index.d.ts +0 -1
- package/es/components/productCard/components/Note/index.d.ts +0 -1
- package/es/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -1
- package/es/components/productCard/components/Packages/components/options/index.d.ts +0 -1
- package/es/components/productCard/components/Packages/index.d.ts +0 -1
- package/es/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
- package/es/components/productCard/status.d.ts +32 -0
- package/es/components/productCard/types.d.ts +84 -0
- package/es/components/qrcode/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/es/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/es/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/es/components/table/Actions/component/Group/PopoverContent.d.ts +1 -0
- package/es/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/es/components/table/BasicTable/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
- package/es/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/es/components/table/Table/SelectField/index.d.ts +0 -1
- package/es/components/table/Table/fields/date/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/index.d.ts +2 -3
- package/es/components/table/Table/fields/link/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/select/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/es/components/table/Table/fields/text/index.d.ts +0 -1
- package/es/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/SortRow/index.d.ts +0 -1
- package/es/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/es/components/table/TableFilter/SortIcon.d.ts +1 -0
- package/es/components/table/View/index.d.ts +0 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locales/en-US.js +1 -0
- package/es/locales/zh-CN.js +1 -0
- package/es/locales/zh-TW.js +1 -0
- package/lib/components/colorPicker/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.d.ts +3 -0
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +41 -3
- package/lib/components/dataSourceComponents/dataSourceForm/formItem.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingContext.d.ts +16 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +5 -3
- package/lib/components/dataSourceComponents/dataSourceForm/serve.d.ts +179 -0
- package/lib/components/dataSourceComponents/dataSourceForm/serve.js +45 -2
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +39 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +23 -2
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +32 -0
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.d.ts +24 -0
- package/lib/components/dataSourceComponents/dataSourceForm/urlUtils.js +68 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +3 -3
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/filter/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/filter/utils.d.ts +0 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +39 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +100 -0
- package/lib/components/dataSourceComponents/dataSourceTable/type.d.ts +84 -0
- package/lib/components/dataSourceComponents/dataSourceWrapper/index.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/Input.Subdomain/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -2
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.js +52 -0
- package/lib/components/dataSourceComponents/fields/Switch/ReadPretty.less +2 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/Switch/index.js +42 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.d.ts +16 -0
- package/lib/components/dataSourceComponents/fields/Switch/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.d.ts +0 -1
- package/lib/components/dataSourceComponents/fields/index.d.ts +10 -11
- package/lib/components/dataSourceComponents/hooks/useActions.d.ts +18 -0
- package/lib/components/dataSourceComponents/hooks/useActions.js +3 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +120 -0
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.d.ts +4 -0
- package/lib/components/date-picker/datePickerCpt.d.ts +0 -1
- package/lib/components/filter/components/items/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Editor/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/Preview/index.d.ts +0 -1
- package/lib/components/filter/components/items/text/index.d.ts +0 -1
- package/lib/components/filter/index.d.ts +0 -1
- package/lib/components/iconfont/index.js +1 -1
- package/lib/components/list/index.d.ts +0 -1
- package/lib/components/lowCodePage/index.d.ts +0 -1
- package/lib/components/page/index.d.ts +6 -0
- package/lib/components/pisell-config-provider/index.js +0 -1
- package/lib/components/pisellCardList/index.d.ts +4 -0
- package/lib/components/pisellCardList/index.js +5 -1
- package/lib/components/pisellDatePicker/datePickerCpt.d.ts +0 -1
- package/lib/components/pisellInput/components/BankCard/index.d.ts +0 -1
- package/lib/components/pisellInput/components/Copy/index.d.ts +0 -1
- package/lib/components/pisellInput/components/SecurityCode/index.d.ts +0 -1
- package/lib/components/pisellLoading/index.d.ts +0 -1
- package/lib/components/pisellTooltip/index.d.ts +0 -1
- package/lib/components/pisellWalletPassCard/index.d.ts +4 -0
- package/lib/components/pisellWalletPassCard/index.js +12 -2
- package/lib/components/productCard/cartSkuCard/components/AmountFooter/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/MultiDay/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/Note/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/basicInfo/index.d.ts +27 -0
- package/lib/components/productCard/cartSkuCard/components/discountReason/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/holders/index.d.ts +3 -0
- package/lib/components/productCard/cartSkuCard/components/packages/index.d.ts +11 -0
- package/lib/components/productCard/cartSkuCard/components/resources/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/sales/index.d.ts +13 -0
- package/lib/components/productCard/cartSkuCard/components/specs/index.d.ts +4 -0
- package/lib/components/productCard/cartSkuCard/components/timeRange/index.d.ts +7 -0
- package/lib/components/productCard/cartSkuCard/index.d.ts +10 -0
- package/lib/components/productCard/cartSkuCard/locales.d.ts +96 -0
- package/lib/components/productCard/components/AmountFooter/index.d.ts +0 -1
- package/lib/components/productCard/components/Header/EditButton/index.d.ts +0 -1
- package/lib/components/productCard/components/MultiDay/index.d.ts +0 -1
- package/lib/components/productCard/components/Note/index.d.ts +0 -1
- package/lib/components/productCard/components/Packages/components/collapsibleList/utils.d.ts +0 -1
- package/lib/components/productCard/components/Packages/components/options/index.d.ts +0 -1
- package/lib/components/productCard/components/Packages/index.d.ts +0 -1
- package/lib/components/productCard/components/Time/components/SelectHolderMultiple/index.d.ts +0 -1
- package/lib/components/productCard/status.d.ts +32 -0
- package/lib/components/productCard/types.d.ts +84 -0
- package/lib/components/qrcode/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportFile/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportLog/index.d.ts +0 -1
- package/lib/components/table/Actions/component/ExportImport/components/ImportTable/index.d.ts +0 -1
- package/lib/components/table/Actions/component/GallerySetting/index.d.ts +0 -1
- package/lib/components/table/Actions/component/Group/PopoverContent.d.ts +1 -0
- package/lib/components/table/Actions/component/ViewMode/index.d.ts +0 -1
- package/lib/components/table/BasicTable/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Cover/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/RenderFields/index.d.ts +0 -1
- package/lib/components/table/Gallery/components/GalleryItem/components/Title/index.d.ts +0 -1
- package/lib/components/table/Table/SelectField/index.d.ts +0 -1
- package/lib/components/table/Table/fields/date/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/index.d.ts +2 -3
- package/lib/components/table/Table/fields/link/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/select/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/Show/index.d.ts +0 -1
- package/lib/components/table/Table/fields/text/index.d.ts +0 -1
- package/lib/components/table/Table/fields/treeSelect/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/SortRow/index.d.ts +0 -1
- package/lib/components/table/Table/tableConfig/summary/index.d.ts +0 -1
- package/lib/components/table/TableFilter/SortIcon.d.ts +1 -0
- package/lib/components/table/View/index.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/locales/en-US.js +1 -0
- package/lib/locales/zh-CN.js +1 -0
- package/lib/locales/zh-TW.js +1 -0
- package/lowcode/data-source-form/constants.ts +3 -0
- package/lowcode/data-source-form/meta.ts +90 -31
- package/lowcode/data-source-form/utils.ts +132 -19
- package/lowcode/form-item-switch/meta.ts +145 -0
- package/lowcode/form-item-switch/snippets.ts +15 -0
- package/package.json +3 -3
- package/es/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -24
- package/es/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
- package/es/components/dataSourceComponents/hooks/usePlatform.d.ts +0 -5
- package/es/components/filter/types.d.ts +0 -46
- package/es/components/iconfont/index.d.ts +0 -8
- package/es/components/pisellAdjustPrice/index.d.ts +0 -4
- package/es/components/pisellEmpty/index.d.ts +0 -19
- package/es/components/pisellQRScanner/index.d.ts +0 -24
- package/es/components/pisellText/components/Editable/index.d.ts +0 -29
- package/es/components/pisellText/index.d.ts +0 -9
- package/es/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
- package/es/components/select/index.d.ts +0 -9
- package/es/components/sortableList/index.d.ts +0 -11
- package/es/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
- package/es/components/table/Actions/index.d.ts +0 -18
- package/es/components/table/Table/index.d.ts +0 -4
- package/es/components/table/hooks/useTransColumns.d.ts +0 -14
- package/es/components/table/index.d.ts +0 -4
- package/es/components/table/serve.d.ts +0 -13
- package/es/components/tabs/index.d.ts +0 -17
- package/es/components/virtual-keyboard/Amount/index.d.ts +0 -5
- package/es/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/es/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -25
- package/es/components/virtual-keyboard/Number/index.d.ts +0 -6
- package/es/components/walletCard/index.d.ts +0 -71
- package/es/locales/en-US.d.ts +0 -307
- package/es/locales/zh-CN.d.ts +0 -302
- package/es/locales/zh-TW.d.ts +0 -302
- package/lib/components/dataSourceComponents/fields/Input.Mobile/serve.d.ts +0 -24
- package/lib/components/dataSourceComponents/fields/Input.Phone/serve.d.ts +0 -25
- package/lib/components/dataSourceComponents/hooks/usePlatform.d.ts +0 -5
- package/lib/components/filter/types.d.ts +0 -46
- package/lib/components/iconfont/index.d.ts +0 -8
- package/lib/components/pisellAdjustPrice/index.d.ts +0 -4
- package/lib/components/pisellEmpty/index.d.ts +0 -19
- package/lib/components/pisellQRScanner/index.d.ts +0 -24
- package/lib/components/pisellText/components/Editable/index.d.ts +0 -29
- package/lib/components/pisellText/index.d.ts +0 -9
- package/lib/components/productCard/components/Time/components/SelectResource/index.d.ts +0 -18
- package/lib/components/select/index.d.ts +0 -9
- package/lib/components/sortableList/index.d.ts +0 -11
- package/lib/components/table/Actions/component/ExportImport/components/ExportTable/function.d.ts +0 -7
- package/lib/components/table/Actions/index.d.ts +0 -18
- package/lib/components/table/Table/index.d.ts +0 -4
- package/lib/components/table/hooks/useTransColumns.d.ts +0 -14
- package/lib/components/table/index.d.ts +0 -4
- package/lib/components/table/serve.d.ts +0 -13
- package/lib/components/tabs/index.d.ts +0 -17
- package/lib/components/virtual-keyboard/Amount/index.d.ts +0 -5
- package/lib/components/virtual-keyboard/Amount/types.d.ts +0 -44
- package/lib/components/virtual-keyboard/BaseNumberKeyboard/index.d.ts +0 -25
- package/lib/components/virtual-keyboard/Number/index.d.ts +0 -6
- package/lib/components/walletCard/index.d.ts +0 -71
- package/lib/locales/en-US.d.ts +0 -307
- package/lib/locales/zh-CN.d.ts +0 -302
- package/lib/locales/zh-TW.d.ts +0 -302
|
@@ -17,7 +17,9 @@ import useFormSetting from "../provider/hooks/useFormSetting";
|
|
|
17
17
|
import useCtxActions from "../../hooks/useCtxActions";
|
|
18
18
|
import useDataSource from "../../hooks/useDataSource";
|
|
19
19
|
import { filterSystemFields, setFormFieldsUntouched } from "../utils";
|
|
20
|
+
import { getFormSettingParams } from "../urlUtils";
|
|
20
21
|
import "./index.less";
|
|
22
|
+
import { updateTenantSetting } from "../serve";
|
|
21
23
|
// 表单提交按钮
|
|
22
24
|
var SubmitButton = function SubmitButton(props) {
|
|
23
25
|
var children = props.children,
|
|
@@ -43,59 +45,80 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
43
45
|
renderMode = _useFormSetting.renderMode,
|
|
44
46
|
onDataSourceFinish = _useFormSetting.onDataSourceFinish,
|
|
45
47
|
formatSubmitValues = _useFormSetting.formatSubmitValues,
|
|
46
|
-
customSubmit = _useFormSetting.customSubmit
|
|
48
|
+
customSubmit = _useFormSetting.customSubmit,
|
|
49
|
+
beforeSubmit = _useFormSetting.beforeSubmit;
|
|
47
50
|
var _useCtxActions = useCtxActions(),
|
|
48
51
|
setVisible = _useCtxActions.setVisible,
|
|
49
52
|
refreshTableData = _useCtxActions.refreshTableData;
|
|
50
53
|
var _useDataSource = useDataSource(),
|
|
51
54
|
create = _useDataSource.create,
|
|
52
|
-
update = _useDataSource.update
|
|
55
|
+
update = _useDataSource.update,
|
|
56
|
+
dataSource = _useDataSource.dataSource;
|
|
53
57
|
var isDisabled = status === 'disabled';
|
|
54
58
|
var onSubmit = /*#__PURE__*/function () {
|
|
55
59
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
|
|
56
|
-
var res;
|
|
60
|
+
var urlParams, business_code, channel_code, board_code, res;
|
|
57
61
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
58
62
|
while (1) switch (_context.prev = _context.next) {
|
|
59
63
|
case 0:
|
|
60
64
|
setLoading(true);
|
|
61
65
|
_context.prev = 1;
|
|
66
|
+
if (!(dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta)) {
|
|
67
|
+
_context.next = 10;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
// 从URL查询字符串获取参数
|
|
71
|
+
urlParams = getFormSettingParams();
|
|
72
|
+
business_code = urlParams.businessCode;
|
|
73
|
+
channel_code = urlParams.channelCode; // 只有当isBoard参数为1时才设置boardCode
|
|
74
|
+
board_code = urlParams.isBoard && business_code && channel_code ? "".concat(business_code, "+").concat(channel_code) : undefined;
|
|
75
|
+
_context.next = 9;
|
|
76
|
+
return updateTenantSetting({
|
|
77
|
+
business_code: business_code,
|
|
78
|
+
channel_code: channel_code,
|
|
79
|
+
board_code: board_code,
|
|
80
|
+
data: values
|
|
81
|
+
});
|
|
82
|
+
case 9:
|
|
83
|
+
return _context.abrupt("return", _context.sent);
|
|
84
|
+
case 10:
|
|
62
85
|
if (!customSubmit) {
|
|
63
|
-
_context.next =
|
|
86
|
+
_context.next = 14;
|
|
64
87
|
break;
|
|
65
88
|
}
|
|
66
|
-
_context.next =
|
|
89
|
+
_context.next = 13;
|
|
67
90
|
return customSubmit(values);
|
|
68
|
-
case
|
|
91
|
+
case 13:
|
|
69
92
|
return _context.abrupt("return", _context.sent);
|
|
70
|
-
case
|
|
93
|
+
case 14:
|
|
71
94
|
if (!(renderMode === 'edit')) {
|
|
72
|
-
_context.next =
|
|
95
|
+
_context.next = 20;
|
|
73
96
|
break;
|
|
74
97
|
}
|
|
75
|
-
_context.next =
|
|
98
|
+
_context.next = 17;
|
|
76
99
|
return update.runAsync(values);
|
|
77
|
-
case
|
|
100
|
+
case 17:
|
|
78
101
|
return _context.abrupt("return", _context.sent);
|
|
79
|
-
case
|
|
102
|
+
case 20:
|
|
80
103
|
if (!(renderMode === 'add')) {
|
|
81
|
-
_context.next =
|
|
104
|
+
_context.next = 26;
|
|
82
105
|
break;
|
|
83
106
|
}
|
|
84
|
-
_context.next =
|
|
107
|
+
_context.next = 23;
|
|
85
108
|
return create.runAsync(values);
|
|
86
|
-
case
|
|
109
|
+
case 23:
|
|
87
110
|
res = _context.sent;
|
|
88
111
|
form === null || form === void 0 || form.resetFields();
|
|
89
112
|
return _context.abrupt("return", res);
|
|
90
|
-
case
|
|
91
|
-
_context.prev =
|
|
113
|
+
case 26:
|
|
114
|
+
_context.prev = 26;
|
|
92
115
|
setLoading(false);
|
|
93
|
-
return _context.finish(
|
|
94
|
-
case
|
|
116
|
+
return _context.finish(26);
|
|
117
|
+
case 29:
|
|
95
118
|
case "end":
|
|
96
119
|
return _context.stop();
|
|
97
120
|
}
|
|
98
|
-
}, _callee, null, [[1,,
|
|
121
|
+
}, _callee, null, [[1,, 26, 29]]);
|
|
99
122
|
}));
|
|
100
123
|
return function onSubmit(_x) {
|
|
101
124
|
return _ref.apply(this, arguments);
|
|
@@ -130,7 +153,7 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
130
153
|
// 验证表单并提交
|
|
131
154
|
var handleValideFieldsSubmit = /*#__PURE__*/function () {
|
|
132
155
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
133
|
-
var allValues, filteredValues, formattedValues, result, afterSubmitFunc;
|
|
156
|
+
var allValues, filteredValues, formattedValues, canSubmit, result, afterSubmitFunc;
|
|
134
157
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
135
158
|
while (1) switch (_context2.prev = _context2.next) {
|
|
136
159
|
case 0:
|
|
@@ -149,10 +172,24 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
149
172
|
});
|
|
150
173
|
}
|
|
151
174
|
filteredValues = filterSystemFields(allValues); // 格式化提交数据
|
|
152
|
-
formattedValues = formatSubmitValues ? formatSubmitValues(filteredValues) : filteredValues;
|
|
153
|
-
|
|
175
|
+
formattedValues = formatSubmitValues ? formatSubmitValues(filteredValues) : filteredValues; // 提交前校验
|
|
176
|
+
if (!beforeSubmit) {
|
|
177
|
+
_context2.next = 14;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
_context2.next = 11;
|
|
181
|
+
return beforeSubmit(formattedValues);
|
|
182
|
+
case 11:
|
|
183
|
+
canSubmit = _context2.sent;
|
|
184
|
+
if (canSubmit) {
|
|
185
|
+
_context2.next = 14;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
return _context2.abrupt("return");
|
|
189
|
+
case 14:
|
|
190
|
+
_context2.next = 16;
|
|
154
191
|
return onSubmit(formattedValues);
|
|
155
|
-
case
|
|
192
|
+
case 16:
|
|
156
193
|
result = _context2.sent;
|
|
157
194
|
// 数据源提交成功
|
|
158
195
|
if (onDataSourceFinish) {
|
|
@@ -173,19 +210,20 @@ var SubmitButton = function SubmitButton(props) {
|
|
|
173
210
|
}
|
|
174
211
|
}
|
|
175
212
|
setFormFieldsUntouched(form);
|
|
176
|
-
_context2.next =
|
|
213
|
+
_context2.next = 28;
|
|
177
214
|
break;
|
|
178
|
-
case
|
|
179
|
-
_context2.prev =
|
|
215
|
+
case 24:
|
|
216
|
+
_context2.prev = 24;
|
|
180
217
|
_context2.t0 = _context2["catch"](0);
|
|
218
|
+
debugger;
|
|
181
219
|
PisellToast({
|
|
182
220
|
content: "".concat(_context2.t0.message)
|
|
183
221
|
});
|
|
184
|
-
case
|
|
222
|
+
case 28:
|
|
185
223
|
case "end":
|
|
186
224
|
return _context2.stop();
|
|
187
225
|
}
|
|
188
|
-
}, _callee2, null, [[0,
|
|
226
|
+
}, _callee2, null, [[0, 24]]);
|
|
189
227
|
}));
|
|
190
228
|
return function handleValideFieldsSubmit(_x2) {
|
|
191
229
|
return _ref2.apply(this, arguments);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceType } from "../provider/dataSource/DataSourceContext";
|
|
3
|
+
export declare type ModeType = 'edit' | 'add' | 'view' | 'disabled' | 'hidden' | 'tableView';
|
|
4
|
+
export interface DataSourceFormProps {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
dataSource: DataSourceType;
|
|
8
|
+
extraParams?: Record<string, any>;
|
|
9
|
+
showTitle: boolean;
|
|
10
|
+
showDescription: boolean;
|
|
11
|
+
groupInfoPosition: 'top' | 'side';
|
|
12
|
+
variables: any[];
|
|
13
|
+
renderMode?: ModeType;
|
|
14
|
+
currentValue?: 'server' | 'local';
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
size?: 'small' | 'middle' | 'large';
|
|
18
|
+
onDataSourceFinish?: (values: any, result: any) => void;
|
|
19
|
+
__designMode?: string;
|
|
20
|
+
formatSubmitValues?: (values: Record<string, any>) => Record<string, any>;
|
|
21
|
+
formatInitialValues?: (values: Record<string, any>) => Record<string, any>;
|
|
22
|
+
customSubmit?: (values: Record<string, any>) => Promise<any>;
|
|
23
|
+
beforeSubmit?: (values: Record<string, any>) => Promise<boolean> | boolean;
|
|
24
|
+
leaveConfirmConfig?: {
|
|
25
|
+
enable: boolean;
|
|
26
|
+
title: string;
|
|
27
|
+
content: string;
|
|
28
|
+
icon: React.ReactNode;
|
|
29
|
+
okText: string;
|
|
30
|
+
cancelText: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL参数处理工具方法
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 从浏览器URL获取查询参数
|
|
6
|
+
* @returns Record<string, string> URL查询参数对象
|
|
7
|
+
*/
|
|
8
|
+
export declare const getUrlParams: () => Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* 从URL参数中提取formSettingMeta相关的参数
|
|
11
|
+
* @param urlParams URL查询参数对象,如果不传则自动从浏览器获取
|
|
12
|
+
* @returns 包含business_code、channel_code和isBoard参数的对象
|
|
13
|
+
*/
|
|
14
|
+
export declare const getFormSettingParams: (urlParams?: Record<string, string>) => {
|
|
15
|
+
businessCode: string;
|
|
16
|
+
channelCode: string;
|
|
17
|
+
isBoard: boolean;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 根据URL参数更新租户设置数据
|
|
21
|
+
* @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
22
|
+
* @returns Promise<any> 返回更新结果
|
|
23
|
+
*/
|
|
24
|
+
export declare const updateTenantSettingFromUrl: (data: Record<string, any>) => Promise<any>;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
/**
|
|
6
|
+
* URL参数处理工具方法
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { request } from "../../table/utils";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 从浏览器URL获取查询参数
|
|
13
|
+
* @returns Record<string, string> URL查询参数对象
|
|
14
|
+
*/
|
|
15
|
+
export var getUrlParams = function getUrlParams() {
|
|
16
|
+
var urlSearchParams = new URLSearchParams(window.location.search);
|
|
17
|
+
var urlParams = {};
|
|
18
|
+
urlSearchParams.forEach(function (value, key) {
|
|
19
|
+
urlParams[key] = value;
|
|
20
|
+
});
|
|
21
|
+
return urlParams;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* 从URL参数中提取formSettingMeta相关的参数
|
|
26
|
+
* @param urlParams URL查询参数对象,如果不传则自动从浏览器获取
|
|
27
|
+
* @returns 包含business_code、channel_code和isBoard参数的对象
|
|
28
|
+
*/
|
|
29
|
+
export var getFormSettingParams = function getFormSettingParams(urlParams) {
|
|
30
|
+
var params = urlParams || getUrlParams();
|
|
31
|
+
return {
|
|
32
|
+
businessCode: params.businessCode || params.business_code,
|
|
33
|
+
channelCode: params.channelCode || params.channel_code,
|
|
34
|
+
isBoard: params.is_board === '1'
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 根据URL参数更新租户设置数据
|
|
40
|
+
* @param data 要更新的数据对象,如 {"order.prefix":"","order.suffix":"","payment.number":""}
|
|
41
|
+
* @returns Promise<any> 返回更新结果
|
|
42
|
+
*/
|
|
43
|
+
export var updateTenantSettingFromUrl = /*#__PURE__*/function () {
|
|
44
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
45
|
+
var urlParams, businessCode, channelCode, boardCode, requestBody, url;
|
|
46
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
47
|
+
while (1) switch (_context.prev = _context.next) {
|
|
48
|
+
case 0:
|
|
49
|
+
// 从URL获取参数
|
|
50
|
+
debugger;
|
|
51
|
+
urlParams = getFormSettingParams();
|
|
52
|
+
businessCode = urlParams.businessCode;
|
|
53
|
+
channelCode = urlParams.channelCode;
|
|
54
|
+
boardCode = urlParams.isBoard && businessCode && channelCode ? "".concat(businessCode, "+").concat(channelCode) : undefined; // 构建请求体,按照 curl 请求的格式
|
|
55
|
+
requestBody = {
|
|
56
|
+
business_code: businessCode || '',
|
|
57
|
+
channel_code: channelCode || '',
|
|
58
|
+
board_code: boardCode || '',
|
|
59
|
+
data: data
|
|
60
|
+
};
|
|
61
|
+
url = '/tenant/setting';
|
|
62
|
+
return _context.abrupt("return", request.getRequest().post(url, requestBody, {
|
|
63
|
+
headers: {
|
|
64
|
+
'Content-Type': 'application/json'
|
|
65
|
+
}
|
|
66
|
+
}));
|
|
67
|
+
case 8:
|
|
68
|
+
case "end":
|
|
69
|
+
return _context.stop();
|
|
70
|
+
}
|
|
71
|
+
}, _callee);
|
|
72
|
+
}));
|
|
73
|
+
return function updateTenantSettingFromUrl(_x) {
|
|
74
|
+
return _ref.apply(this, arguments);
|
|
75
|
+
};
|
|
76
|
+
}();
|
|
@@ -43,7 +43,7 @@ export declare const withDataSource: <P extends unknown>(WrappedComponent: React
|
|
|
43
43
|
}) => JSX.Element;
|
|
44
44
|
export declare const withOptions: <P extends unknown>(WrappedComponent: React.ComponentType<P>) => (props: P & {
|
|
45
45
|
options?: any;
|
|
46
|
-
optionSourceType?: "default" | "
|
|
46
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
47
47
|
labelField: string;
|
|
48
48
|
valueField: string;
|
|
49
49
|
extraParams?: Record<string, any> | undefined;
|
|
@@ -138,11 +138,10 @@ export var withFormItem = function withFormItem(WrappedComponent, overlayProps)
|
|
|
138
138
|
var renderComponent = useMemo(function () {
|
|
139
139
|
var _overlayProps$innerPr;
|
|
140
140
|
// 使用renderMode属性,避免和组件mode冲突
|
|
141
|
-
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, otherProps, {
|
|
141
|
+
return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, overlayProps === null || overlayProps === void 0 ? void 0 : overlayProps.innerProps, otherProps, {
|
|
142
142
|
mode: propsMode,
|
|
143
|
-
renderMode: effectiveMode
|
|
144
|
-
|
|
145
|
-
style: _objectSpread(_objectSpread({}, innerStyle || {}), (overlayProps === null || overlayProps === void 0 || (_overlayProps$innerPr = overlayProps.innerProps) === null || _overlayProps$innerPr === void 0 ? void 0 : _overlayProps$innerPr.style) || {}),
|
|
143
|
+
renderMode: effectiveMode,
|
|
144
|
+
style: _objectSpread(_objectSpread({}, (overlayProps === null || overlayProps === void 0 || (_overlayProps$innerPr = overlayProps.innerProps) === null || _overlayProps$innerPr === void 0 ? void 0 : _overlayProps$innerPr.style) || {}), innerStyle || {}),
|
|
146
145
|
fieldKey: name,
|
|
147
146
|
isVerification: typeobj === null || typeobj === void 0 ? void 0 : typeobj.enabled,
|
|
148
147
|
size: size
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceTableProps } from './type';
|
|
3
|
+
export interface TableRef {
|
|
4
|
+
refreshCurrentPage: () => void;
|
|
5
|
+
refreshData: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.ForwardRefExoticComponent<DataSourceTableProps & React.RefAttributes<TableRef>>;
|
|
8
|
+
export default _default;
|
|
@@ -89,6 +89,7 @@ var BaseTable = function BaseTable(props, ref) {
|
|
|
89
89
|
}, [dataSourceKey]);
|
|
90
90
|
useEffect(function () {
|
|
91
91
|
if (dataSourceKeyRef.current) {
|
|
92
|
+
if (dataSource !== null && dataSource !== void 0 && dataSource.fromSettingMeta) return;
|
|
92
93
|
list === null || list === void 0 || list.run(queryPageConfig);
|
|
93
94
|
} else {
|
|
94
95
|
list === null || list === void 0 || list.mutate([]);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Drawer } from 'antd';
|
|
3
|
+
import { OperationItem } from '../type';
|
|
4
|
+
declare const useDrawerState: (operationContent?: {
|
|
5
|
+
[key: string]: import("react").ReactNode;
|
|
6
|
+
} | undefined) => {
|
|
7
|
+
drawerVisible: boolean;
|
|
8
|
+
setDrawerVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
9
|
+
openDrawer: (item: OperationItem) => void;
|
|
10
|
+
closeDrawer: () => void;
|
|
11
|
+
drawerContent: import("react").ReactNode;
|
|
12
|
+
Container: {
|
|
13
|
+
(props: import("../../../pisellModal").PisellModalProps): JSX.Element;
|
|
14
|
+
confirm: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
15
|
+
destroy: () => void;
|
|
16
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
17
|
+
};
|
|
18
|
+
info: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
19
|
+
destroy: () => void;
|
|
20
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
21
|
+
};
|
|
22
|
+
error: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
23
|
+
destroy: () => void;
|
|
24
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
25
|
+
};
|
|
26
|
+
warn: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => any;
|
|
27
|
+
warning: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
28
|
+
destroy: () => void;
|
|
29
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
30
|
+
};
|
|
31
|
+
success: (props: import("../../../pisellModal/components/functions").PisellModalFuncProps) => {
|
|
32
|
+
destroy: () => void;
|
|
33
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
|
34
|
+
};
|
|
35
|
+
Information: (props: import("../../../pisellModal/components/Information").InformationProps) => JSX.Element;
|
|
36
|
+
} | typeof Drawer;
|
|
37
|
+
containerProps: {};
|
|
38
|
+
};
|
|
39
|
+
export default useDrawerState;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DataSourceTableProps } from '../type';
|
|
3
|
+
import { OperationItem } from '../type';
|
|
4
|
+
interface UseTablePropsProps {
|
|
5
|
+
data: any;
|
|
6
|
+
originProps: DataSourceTableProps;
|
|
7
|
+
openDrawer: (type: OperationItem) => void;
|
|
8
|
+
closeDrawer: () => void;
|
|
9
|
+
refreshData: () => void;
|
|
10
|
+
handleFilterChange: (changedFields: any, allFields: any) => void;
|
|
11
|
+
tableRef: any;
|
|
12
|
+
getInitialValues: () => Record<string, any>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 处理table的props
|
|
16
|
+
* 转换title
|
|
17
|
+
* @param props
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
21
|
+
currentComponentId: any;
|
|
22
|
+
title: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
23
|
+
pagination: {
|
|
24
|
+
total: number;
|
|
25
|
+
current: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
size: string;
|
|
28
|
+
showSizeChanger: boolean;
|
|
29
|
+
};
|
|
30
|
+
columns: import("./useColumns").Column[];
|
|
31
|
+
subTitle: string | number | boolean | React.ReactFragment | JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
32
|
+
buttons: any[] | null;
|
|
33
|
+
filter: {
|
|
34
|
+
dom: any;
|
|
35
|
+
items: any;
|
|
36
|
+
} | null;
|
|
37
|
+
onRow: (record: any) => any;
|
|
38
|
+
actionButtons: any[] | null;
|
|
39
|
+
__id?: string | undefined;
|
|
40
|
+
currentSettingKey?: string | undefined;
|
|
41
|
+
titleButtons?: {
|
|
42
|
+
show: boolean;
|
|
43
|
+
maxCount: number;
|
|
44
|
+
items: OperationItem[];
|
|
45
|
+
} | undefined;
|
|
46
|
+
tableButtons?: {
|
|
47
|
+
show: boolean;
|
|
48
|
+
maxCount: number;
|
|
49
|
+
items: OperationItem[];
|
|
50
|
+
} | undefined;
|
|
51
|
+
operation?: {
|
|
52
|
+
show: boolean;
|
|
53
|
+
title: string;
|
|
54
|
+
width: number;
|
|
55
|
+
align: "center" | "left" | "right";
|
|
56
|
+
fixed: false | "left" | "right";
|
|
57
|
+
type: "button" | "link";
|
|
58
|
+
items: OperationItem[];
|
|
59
|
+
} | undefined;
|
|
60
|
+
operationContent?: {
|
|
61
|
+
[key: string]: React.ReactNode;
|
|
62
|
+
} | undefined;
|
|
63
|
+
dataSource: import("../../provider/dataSource/DataSourceContext").DataSourceType;
|
|
64
|
+
search?: {
|
|
65
|
+
show: boolean;
|
|
66
|
+
placeholder: string;
|
|
67
|
+
} | undefined;
|
|
68
|
+
__designMode: string;
|
|
69
|
+
componentId: string;
|
|
70
|
+
clickToDetail?: {
|
|
71
|
+
show: boolean;
|
|
72
|
+
useCustomAction: boolean;
|
|
73
|
+
actionType: string;
|
|
74
|
+
openMode: "modal" | "drawer";
|
|
75
|
+
openContentSize: "small" | "middle" | "large";
|
|
76
|
+
openTitle: string;
|
|
77
|
+
key: string;
|
|
78
|
+
} | undefined;
|
|
79
|
+
filterBy?: Record<string, any> | undefined;
|
|
80
|
+
sortBy: string;
|
|
81
|
+
tabs?: {
|
|
82
|
+
show: boolean;
|
|
83
|
+
type: string;
|
|
84
|
+
items: {
|
|
85
|
+
name: string;
|
|
86
|
+
filterBy: Record<string, any>;
|
|
87
|
+
sortBy: string;
|
|
88
|
+
}[];
|
|
89
|
+
} | undefined;
|
|
90
|
+
onValuesChange?: ((changedValues: any, values: any) => void) | undefined;
|
|
91
|
+
extraParams?: {
|
|
92
|
+
list?: Record<string, any> | undefined;
|
|
93
|
+
get?: Record<string, any> | undefined;
|
|
94
|
+
update?: Record<string, any> | undefined;
|
|
95
|
+
create?: Record<string, any> | undefined;
|
|
96
|
+
destroy?: Record<string, any> | undefined;
|
|
97
|
+
} | undefined;
|
|
98
|
+
localSettings?: import("../../../table/types").LocalSettingsType | undefined;
|
|
99
|
+
};
|
|
100
|
+
export default useTableProps;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ColumnType } from 'antd/es/table';
|
|
3
|
+
import { LocalSettingsType } from '../../table/types';
|
|
4
|
+
import { DataSourceType } from '../provider/dataSource/DataSourceContext';
|
|
5
|
+
export declare type OperationItem = {
|
|
6
|
+
label?: string;
|
|
7
|
+
openMode: 'modal' | 'drawer' | 'custom';
|
|
8
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
9
|
+
openTitle: string;
|
|
10
|
+
actionType: 'detail' | 'edit' | 'delete' | 'custom';
|
|
11
|
+
key: string;
|
|
12
|
+
buttonProps?: any;
|
|
13
|
+
onClick?: (record: any) => void;
|
|
14
|
+
afterClose?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export interface DataSourceTableProps {
|
|
17
|
+
__id?: string;
|
|
18
|
+
currentComponentId?: string;
|
|
19
|
+
currentSettingKey?: string;
|
|
20
|
+
title?: string | React.ReactNode | (() => React.ReactNode);
|
|
21
|
+
subTitle?: string | React.ReactNode | (() => React.ReactNode);
|
|
22
|
+
titleButtons?: {
|
|
23
|
+
show: boolean;
|
|
24
|
+
maxCount: number;
|
|
25
|
+
items: OperationItem[];
|
|
26
|
+
};
|
|
27
|
+
tableButtons?: {
|
|
28
|
+
show: boolean;
|
|
29
|
+
maxCount: number;
|
|
30
|
+
items: OperationItem[];
|
|
31
|
+
};
|
|
32
|
+
buttons?: any[];
|
|
33
|
+
operation?: {
|
|
34
|
+
show: boolean;
|
|
35
|
+
title: string;
|
|
36
|
+
width: number;
|
|
37
|
+
align: 'left' | 'center' | 'right';
|
|
38
|
+
fixed: 'left' | 'right' | false;
|
|
39
|
+
type: 'link' | 'button';
|
|
40
|
+
items: OperationItem[];
|
|
41
|
+
};
|
|
42
|
+
operationContent?: {
|
|
43
|
+
[key: string]: React.ReactNode;
|
|
44
|
+
};
|
|
45
|
+
dataSource: DataSourceType;
|
|
46
|
+
columns: ColumnType<any>[];
|
|
47
|
+
filter: any;
|
|
48
|
+
search?: {
|
|
49
|
+
show: boolean;
|
|
50
|
+
placeholder: string;
|
|
51
|
+
};
|
|
52
|
+
__designMode: string;
|
|
53
|
+
componentId: string;
|
|
54
|
+
clickToDetail?: {
|
|
55
|
+
show: boolean;
|
|
56
|
+
useCustomAction: boolean;
|
|
57
|
+
actionType: string;
|
|
58
|
+
openMode: 'modal' | 'drawer';
|
|
59
|
+
openContentSize: 'small' | 'middle' | 'large';
|
|
60
|
+
openTitle: string;
|
|
61
|
+
key: string;
|
|
62
|
+
};
|
|
63
|
+
onRow?: any;
|
|
64
|
+
filterBy?: Record<string, any>;
|
|
65
|
+
sortBy: string;
|
|
66
|
+
tabs?: {
|
|
67
|
+
show: boolean;
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
name: string;
|
|
71
|
+
filterBy: Record<string, any>;
|
|
72
|
+
sortBy: string;
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
onValuesChange?: (changedValues: any, values: any) => void;
|
|
76
|
+
extraParams?: {
|
|
77
|
+
list?: Record<string, any>;
|
|
78
|
+
get?: Record<string, any>;
|
|
79
|
+
update?: Record<string, any>;
|
|
80
|
+
create?: Record<string, any>;
|
|
81
|
+
destroy?: Record<string, any>;
|
|
82
|
+
};
|
|
83
|
+
localSettings?: LocalSettingsType;
|
|
84
|
+
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
declare const Subdomain: React.FC<import("antd").InputProps & {
|
|
3
3
|
onChange: (value: string) => void;
|
|
4
4
|
onBlur?: ((e: React.FocusEvent<HTMLInputElement, Element>) => void) | undefined;
|
|
5
|
-
rootDomain: "custom" | "
|
|
5
|
+
rootDomain: "custom" | "xzero" | "saas";
|
|
6
6
|
customDomain?: string | undefined;
|
|
7
7
|
value?: string | undefined;
|
|
8
8
|
tenantId: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
declare const SelectWithDataSource: (props: import("antd").SelectProps<any, import("antd/es/select").DefaultOptionType> & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps & {
|
|
3
2
|
options?: any;
|
|
4
|
-
optionSourceType?: "default" | "
|
|
3
|
+
optionSourceType?: "default" | "api" | "custom" | undefined;
|
|
5
4
|
labelField: string;
|
|
6
5
|
valueField: string;
|
|
7
6
|
extraParams?: Record<string, any> | undefined;
|