@dckj-npm/dc-material 0.1.378 → 0.1.379

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.
@@ -905,7 +905,7 @@ var CustomFormMeta = {
905
905
  getValue: function getValue(target) {
906
906
  var _target$parent58, _target$parent58$getP, _target$parent59, _target$parent59$getP, _target$parent59$getP2;
907
907
  var t = (_target$parent58 = target.parent) === null || _target$parent58 === void 0 ? void 0 : (_target$parent58$getP = _target$parent58.getPropValue) === null || _target$parent58$getP === void 0 ? void 0 : _target$parent58$getP.call(_target$parent58, 'componentType');
908
- return ((_target$parent59 = target.parent) === null || _target$parent59 === void 0 ? void 0 : (_target$parent59$getP = _target$parent59.getPropValue) === null || _target$parent59$getP === void 0 ? void 0 : (_target$parent59$getP2 = _target$parent59$getP.call(_target$parent59, 'componentProps')) === null || _target$parent59$getP2 === void 0 ? void 0 : _target$parent59$getP2.format) || (t === 'DateTimePicker' ? 'YYYY-MM-DD HH:mm' : 'YYYY-MM-DD');
908
+ return ((_target$parent59 = target.parent) === null || _target$parent59 === void 0 ? void 0 : (_target$parent59$getP = _target$parent59.getPropValue) === null || _target$parent59$getP === void 0 ? void 0 : (_target$parent59$getP2 = _target$parent59$getP.call(_target$parent59, 'componentProps')) === null || _target$parent59$getP2 === void 0 ? void 0 : _target$parent59$getP2.format) || (t === 'DateTimePicker' ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD');
909
909
  },
910
910
  setValue: function setValue(target, value) {
911
911
  var _target$parent60, _target$parent60$getP, _target$parent61, _target$parent61$setP;
@@ -1771,6 +1771,187 @@ var CustomFormMeta = {
1771
1771
  }
1772
1772
  },
1773
1773
  // ─────────────────────────────────────────────────────────────────────
1774
+ // 提交参数配置
1775
+ // ─────────────────────────────────────────────────────────────────────
1776
+ {
1777
+ title: {
1778
+ label: '提交参数配置',
1779
+ tip: '控制表单提交时如何将字段值构建为请求参数,支持三种模式:\n\n① 直接透传(passthrough,默认)\n字段名与接口参数名完全一致时无需配置——表单字段值直接作为请求 body,零配置即可工作。\n\n② 字段重命名(rename)\n表单字段名与接口参数名不一致时使用,按规则将指定字段重命名,其余字段仍按原名透传。\n例如:表单字段 user_name → 接口参数 username\n\n③ 动态表单格式(itemList)\n后端接口接收 itemList:[{columnName,columnValue},...] 格式时使用,适合 /dynamicFormTableRecord/ 等接口。\n例如:{user_name:"张三"} → [{columnName:"user_name",columnValue:"张三"}]'
1780
+ },
1781
+ name: 'submitMapping',
1782
+ setter: {
1783
+ componentName: 'ObjectSetter',
1784
+ props: {
1785
+ config: {
1786
+ items: [
1787
+ // ── 模式选择 ──────────────────────────────────────────────
1788
+ {
1789
+ title: {
1790
+ label: '参数构建模式',
1791
+ tip: '选择提交时参数的构建方式:\n· 直接透传:字段名与接口参数名一致,直接发送;最简单,首选。\n· 字段重命名:字段名与接口参数名不一致,在下方按需配置重命名规则即可。\n· 动态表单格式:接口接收 itemList:[{columnName,columnValue}] 格式,需完整配置字段映射列表。'
1792
+ },
1793
+ name: 'mode',
1794
+ setter: {
1795
+ componentName: 'SelectSetter',
1796
+ props: {
1797
+ options: [{
1798
+ label: '① 直接透传(字段名与接口参数名一致)',
1799
+ value: 'passthrough'
1800
+ }, {
1801
+ label: '② 字段重命名(字段名与接口参数名不一致)',
1802
+ value: 'rename'
1803
+ }, {
1804
+ label: '③ 动态表单格式(itemList 格式)',
1805
+ value: 'itemList'
1806
+ }]
1807
+ },
1808
+ initialValue: 'passthrough'
1809
+ }
1810
+ },
1811
+ // ── rename 模式:字段重命名映射 ───────────────────────────
1812
+ {
1813
+ title: {
1814
+ label: '字段重命名规则',
1815
+ tip: '每行配置一条重命名规则,将表单字段名映射到接口参数名。\n· 来源字段(表单字段名):填写表单项中 field 的值,例如 user_name\n· 目标参数名(接口参数名):接口实际接收的参数名,例如 username\n\n未在此处列出的字段,将按原名透传到请求参数中。\n不需要填写表单中所有字段,只填需要重命名的字段即可。'
1816
+ },
1817
+ name: 'fieldRenameMap',
1818
+ condition: function condition(target) {
1819
+ var _target$parent123, _target$parent123$get;
1820
+ return ((_target$parent123 = target.parent) === null || _target$parent123 === void 0 ? void 0 : (_target$parent123$get = _target$parent123.getPropValue) === null || _target$parent123$get === void 0 ? void 0 : _target$parent123$get.call(_target$parent123, 'mode')) === 'rename';
1821
+ },
1822
+ setter: {
1823
+ componentName: 'ArraySetter',
1824
+ props: {
1825
+ itemSetter: {
1826
+ componentName: 'ObjectSetter',
1827
+ props: {
1828
+ config: {
1829
+ items: [{
1830
+ title: {
1831
+ label: '来源字段(表单字段名)',
1832
+ tip: '表单项中 field 的值,即当前使用的字段名,例如:user_name'
1833
+ },
1834
+ name: 'fromField',
1835
+ important: true,
1836
+ display: 'inline',
1837
+ setter: {
1838
+ componentName: 'StringSetter',
1839
+ isRequired: true,
1840
+ initialValue: ''
1841
+ }
1842
+ }, {
1843
+ title: {
1844
+ label: '目标参数名(接口参数名)',
1845
+ tip: '接口实际接收的参数名,例如:username'
1846
+ },
1847
+ name: 'toField',
1848
+ important: true,
1849
+ display: 'inline',
1850
+ setter: {
1851
+ componentName: 'StringSetter',
1852
+ isRequired: true,
1853
+ initialValue: ''
1854
+ }
1855
+ }]
1856
+ }
1857
+ },
1858
+ initialValue: function initialValue() {
1859
+ return {
1860
+ fromField: '',
1861
+ toField: ''
1862
+ };
1863
+ }
1864
+ }
1865
+ },
1866
+ initialValue: []
1867
+ }
1868
+ },
1869
+ // ── itemList 模式:目标字段名 ──────────────────────────────
1870
+ {
1871
+ title: {
1872
+ label: '目标字段名(itemList 写入位置)',
1873
+ tip: '组装后的 [{columnName,columnValue},...] 数组写入 finalValues 的字段名,默认 itemList。\n需与数据源静态 options.params 中预设的字段名一致,提交时该值会被组装结果覆盖。\n通常保持默认值 itemList 即可。'
1874
+ },
1875
+ name: 'targetField',
1876
+ condition: function condition(target) {
1877
+ var _target$parent124, _target$parent124$get;
1878
+ return ((_target$parent124 = target.parent) === null || _target$parent124 === void 0 ? void 0 : (_target$parent124$get = _target$parent124.getPropValue) === null || _target$parent124$get === void 0 ? void 0 : _target$parent124$get.call(_target$parent124, 'mode')) === 'itemList';
1879
+ },
1880
+ setter: {
1881
+ componentName: 'StringSetter',
1882
+ initialValue: 'itemList'
1883
+ }
1884
+ },
1885
+ // ── itemList 模式:字段映射列表 ────────────────────────────
1886
+ {
1887
+ title: {
1888
+ label: '字段映射列表',
1889
+ tip: '每行定义一条映射规则,决定哪些字段进入 itemList,以及每项的 columnName。\n\n· 接口字段名(columnName):dynamicFormTableRecord 表的字段标识,与后端 schema 一致。\n· 来源字段(field):从哪个表单字段取值,填写表单项的 field 名,例如 user_name。\n· 模板(template):用 {字段名} 引用并拼接多个表单字段,与 field 二选一。\n 例如:{banquet_date} {banquet_time} → "2026-03-12 18:00"(将日期和时间合并为一个值)\n\n来源字段与模板只需填一项,两者都填时 field 优先。\n未在此处列出的表单字段不会进入 itemList(也不会出现在请求参数里)。'
1890
+ },
1891
+ name: 'items',
1892
+ condition: function condition(target) {
1893
+ var _target$parent125, _target$parent125$get;
1894
+ return ((_target$parent125 = target.parent) === null || _target$parent125 === void 0 ? void 0 : (_target$parent125$get = _target$parent125.getPropValue) === null || _target$parent125$get === void 0 ? void 0 : _target$parent125$get.call(_target$parent125, 'mode')) === 'itemList';
1895
+ },
1896
+ setter: {
1897
+ componentName: 'ArraySetter',
1898
+ props: {
1899
+ itemSetter: {
1900
+ componentName: 'ObjectSetter',
1901
+ props: {
1902
+ config: {
1903
+ items: [{
1904
+ title: {
1905
+ label: '接口字段名(columnName)',
1906
+ tip: 'dynamicFormTableRecord 中的字段标识,例如:user_name、banquet_time、guest_count'
1907
+ },
1908
+ name: 'columnName',
1909
+ important: true,
1910
+ display: 'inline',
1911
+ setter: {
1912
+ componentName: 'StringSetter',
1913
+ isRequired: true,
1914
+ initialValue: ''
1915
+ }
1916
+ }, {
1917
+ title: {
1918
+ label: '来源字段',
1919
+ tip: '从哪个表单字段取值,填写表单项的 field 名,例如:user_name\n与「模板」二选一,只需填一项。'
1920
+ },
1921
+ name: 'field',
1922
+ setter: {
1923
+ componentName: 'StringSetter',
1924
+ initialValue: ''
1925
+ }
1926
+ }, {
1927
+ title: {
1928
+ label: '模板',
1929
+ tip: '用 {字段名} 引用并拼接多个字段值,例如:{banquet_date} {banquet_time}\n与「来源字段」二选一,只需填一项。'
1930
+ },
1931
+ name: 'template',
1932
+ setter: {
1933
+ componentName: 'StringSetter',
1934
+ initialValue: ''
1935
+ }
1936
+ }]
1937
+ }
1938
+ },
1939
+ initialValue: function initialValue() {
1940
+ return {
1941
+ columnName: '',
1942
+ field: ''
1943
+ };
1944
+ }
1945
+ }
1946
+ },
1947
+ initialValue: []
1948
+ }
1949
+ }]
1950
+ }
1951
+ }
1952
+ }
1953
+ },
1954
+ // ─────────────────────────────────────────────────────────────────────
1774
1955
  // 分组六:操作按钮
1775
1956
  // ─────────────────────────────────────────────────────────────────────
1776
1957
  {
@@ -1860,28 +2041,28 @@ var CustomFormMeta = {
1860
2041
  },
1861
2042
  extraProps: {
1862
2043
  setValue: function setValue(target, value) {
1863
- var _target$parent123, _target$parent123$get, _target$parent125, _target$parent125$get, _target$parent127, _target$parent127$set;
2044
+ var _target$parent126, _target$parent126$get, _target$parent128, _target$parent128$get, _target$parent130, _target$parent130$set;
1864
2045
  // 根据操作类型自动填充默认文字(仅当文字为空时)
1865
2046
  var textMap = {
1866
2047
  submit: '立即预订',
1867
2048
  reset: '重置',
1868
2049
  custom: '按钮'
1869
2050
  };
1870
- if (!((_target$parent123 = target.parent) !== null && _target$parent123 !== void 0 && (_target$parent123$get = _target$parent123.getPropValue) !== null && _target$parent123$get !== void 0 && _target$parent123$get.call(_target$parent123, 'text'))) {
1871
- var _target$parent124, _target$parent124$set;
1872
- (_target$parent124 = target.parent) === null || _target$parent124 === void 0 ? void 0 : (_target$parent124$set = _target$parent124.setPropValue) === null || _target$parent124$set === void 0 ? void 0 : _target$parent124$set.call(_target$parent124, 'text', textMap[value] || '按钮');
2051
+ if (!((_target$parent126 = target.parent) !== null && _target$parent126 !== void 0 && (_target$parent126$get = _target$parent126.getPropValue) !== null && _target$parent126$get !== void 0 && _target$parent126$get.call(_target$parent126, 'text'))) {
2052
+ var _target$parent127, _target$parent127$set;
2053
+ (_target$parent127 = target.parent) === null || _target$parent127 === void 0 ? void 0 : (_target$parent127$set = _target$parent127.setPropValue) === null || _target$parent127$set === void 0 ? void 0 : _target$parent127$set.call(_target$parent127, 'text', textMap[value] || '按钮');
1873
2054
  }
1874
2055
  // 根据操作类型自动设置默认样式
1875
- if (!((_target$parent125 = target.parent) !== null && _target$parent125 !== void 0 && (_target$parent125$get = _target$parent125.getPropValue) !== null && _target$parent125$get !== void 0 && _target$parent125$get.call(_target$parent125, 'type'))) {
1876
- var _target$parent126, _target$parent126$set;
2056
+ if (!((_target$parent128 = target.parent) !== null && _target$parent128 !== void 0 && (_target$parent128$get = _target$parent128.getPropValue) !== null && _target$parent128$get !== void 0 && _target$parent128$get.call(_target$parent128, 'type'))) {
2057
+ var _target$parent129, _target$parent129$set;
1877
2058
  var typeMap = {
1878
2059
  submit: 'primary',
1879
2060
  reset: 'normal',
1880
2061
  custom: 'normal'
1881
2062
  };
1882
- (_target$parent126 = target.parent) === null || _target$parent126 === void 0 ? void 0 : (_target$parent126$set = _target$parent126.setPropValue) === null || _target$parent126$set === void 0 ? void 0 : _target$parent126$set.call(_target$parent126, 'type', typeMap[value] || 'normal');
2063
+ (_target$parent129 = target.parent) === null || _target$parent129 === void 0 ? void 0 : (_target$parent129$set = _target$parent129.setPropValue) === null || _target$parent129$set === void 0 ? void 0 : _target$parent129$set.call(_target$parent129, 'type', typeMap[value] || 'normal');
1883
2064
  }
1884
- (_target$parent127 = target.parent) === null || _target$parent127 === void 0 ? void 0 : (_target$parent127$set = _target$parent127.setPropValue) === null || _target$parent127$set === void 0 ? void 0 : _target$parent127$set.call(_target$parent127, 'action', value);
2065
+ (_target$parent130 = target.parent) === null || _target$parent130 === void 0 ? void 0 : (_target$parent130$set = _target$parent130.setPropValue) === null || _target$parent130$set === void 0 ? void 0 : _target$parent130$set.call(_target$parent130, 'action', value);
1885
2066
  }
1886
2067
  }
1887
2068
  },
@@ -1917,8 +2098,8 @@ var CustomFormMeta = {
1917
2098
  },
1918
2099
  name: 'submitValidate',
1919
2100
  condition: function condition(target) {
1920
- var _target$parent128, _target$parent128$get;
1921
- return ((_target$parent128 = target.parent) === null || _target$parent128 === void 0 ? void 0 : (_target$parent128$get = _target$parent128.getPropValue) === null || _target$parent128$get === void 0 ? void 0 : _target$parent128$get.call(_target$parent128, 'action')) === 'submit';
2101
+ var _target$parent131, _target$parent131$get;
2102
+ return ((_target$parent131 = target.parent) === null || _target$parent131 === void 0 ? void 0 : (_target$parent131$get = _target$parent131.getPropValue) === null || _target$parent131$get === void 0 ? void 0 : _target$parent131$get.call(_target$parent131, 'action')) === 'submit';
1922
2103
  },
1923
2104
  setter: {
1924
2105
  componentName: 'BoolSetter',
@@ -1929,17 +2110,23 @@ var CustomFormMeta = {
1929
2110
  {
1930
2111
  title: {
1931
2112
  label: '提交数据源(Fetch)',
1932
- tip: '点击后弹出 Fetch 数据源配置面板,配置表单提交的接口信息:\n\n· 请求地址(URL):后端接口地址,例如 /api/booking/create\n· 请求方式:POST / PUT / PATCH 等\n· 请求参数:支持绑定到表单字段值,提交时自动携带当前填写的数据\n 例如:将 body.user_name 绑定到表单字段 user_name 的值\n\n配置完成后,点击此按钮(立即预订)校验通过时,会自动发起该接口请求,无需在 onSubmit 事件中手写调用逻辑。\n\n多按钮场景:每个提交按钮可配置独立的接口(如"保存草稿""正式提交"对应不同接口)。\n\n仅对「提交表单」类型按钮生效。'
2113
+ tip: '绑定页面级 Fetch 数据源,点击提交按钮校验通过后自动调用该数据源发起请求。\n\n【配置步骤】\n1. 在页面左侧「数据源」面板新建一个 fetch 类型数据源\n · 填写接口地址(URI)、请求方式(POST/PUT)、鉴权 Headers\n · isInit 设为 false(提交时才触发,不需要页面初始化时自动加载)\n2. 在此处点击「变量」按钮,选择 this.dataSourceMap.<数据源ID>\n\n【参数说明】\n表单提交时会将所有字段值(含 computedFields / submitMapping 处理后的 itemList)\n作为覆盖参数传入 .load(values),与数据源静态 params 合并,无需手写 onSubmit。\n\n【多按钮场景】\n每个「提交表单」按钮可绑定独立的数据源,如"保存草稿"绑定草稿接口,"正式提交"绑定提交接口。\n\n仅对「提交表单」类型按钮生效。'
1933
2114
  },
1934
- name: 'fetchConfig',
2115
+ name: 'dataSource',
1935
2116
  condition: function condition(target) {
1936
- var _target$parent129, _target$parent129$get;
1937
- return ((_target$parent129 = target.parent) === null || _target$parent129 === void 0 ? void 0 : (_target$parent129$get = _target$parent129.getPropValue) === null || _target$parent129$get === void 0 ? void 0 : _target$parent129$get.call(_target$parent129, 'action')) === 'submit';
2117
+ var _target$parent132, _target$parent132$get;
2118
+ return ((_target$parent132 = target.parent) === null || _target$parent132 === void 0 ? void 0 : (_target$parent132$get = _target$parent132.getPropValue) === null || _target$parent132$get === void 0 ? void 0 : _target$parent132$get.call(_target$parent132, 'action')) === 'submit';
1938
2119
  },
1939
2120
  setter: {
1940
- componentName: 'DataSourceSetter',
2121
+ componentName: 'MixedSetter',
1941
2122
  props: {
1942
- buttonText: '配置提交接口'
2123
+ setters: [{
2124
+ componentName: 'VariableSetter',
2125
+ title: '绑定数据源变量'
2126
+ }, {
2127
+ componentName: 'ExpressionSetter',
2128
+ title: '表达式'
2129
+ }]
1943
2130
  }
1944
2131
  }
1945
2132
  },
@@ -1951,8 +2138,8 @@ var CustomFormMeta = {
1951
2138
  },
1952
2139
  name: 'onClick',
1953
2140
  condition: function condition(target) {
1954
- var _target$parent130, _target$parent130$get;
1955
- return ((_target$parent130 = target.parent) === null || _target$parent130 === void 0 ? void 0 : (_target$parent130$get = _target$parent130.getPropValue) === null || _target$parent130$get === void 0 ? void 0 : _target$parent130$get.call(_target$parent130, 'action')) === 'custom';
2141
+ var _target$parent133, _target$parent133$get;
2142
+ return ((_target$parent133 = target.parent) === null || _target$parent133 === void 0 ? void 0 : (_target$parent133$get = _target$parent133.getPropValue) === null || _target$parent133$get === void 0 ? void 0 : _target$parent133$get.call(_target$parent133, 'action')) === 'custom';
1956
2143
  },
1957
2144
  setter: {
1958
2145
  componentName: 'FunctionSetter'
@@ -122,7 +122,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
122
122
  packageName = '@dckj-npm/dc-material';
123
123
  }
124
124
  if (version === void 0) {
125
- version = '0.1.378';
125
+ version = '0.1.379';
126
126
  }
127
127
  if (basicLibraryVersion === void 0) {
128
128
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dckj-npm/dc-material",
3
- "version": "0.1.378",
3
+ "version": "0.1.379",
4
4
  "description": "dc低代码物料",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "componentConfig": {
116
116
  "isComponentLibrary": true,
117
- "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.378/build/lowcode/assets-prod.json"
117
+ "materialSchema": "https://unpkg.com/@dckj-npm/dc-material@0.1.379/build/lowcode/assets-prod.json"
118
118
  },
119
119
  "lcMeta": {
120
120
  "type": "component"
121
121
  },
122
- "homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.378/build/index.html"
122
+ "homepage": "https://unpkg.com/@dckj-npm/dc-material@0.1.379/build/index.html"
123
123
  }