|
@@ -22,6 +22,7 @@ export const mapFormItemInput = (field, title, config = {}) => ({
|
|
|
* @param field 字段
|
|
* @param field 字段
|
|
|
* @param title 标题
|
|
* @param title 标题
|
|
|
* @param config 其他配置
|
|
* @param config 其他配置
|
|
|
|
|
+ * @param config.props.type select/treeSelect
|
|
|
*/
|
|
*/
|
|
|
export const mapFormItemSelect = (field, title, config = {}) => ({
|
|
export const mapFormItemSelect = (field, title, config = {}) => ({
|
|
|
field,
|
|
field,
|
|
@@ -29,7 +30,25 @@ export const mapFormItemSelect = (field, title, config = {}) => ({
|
|
|
titlePrefix: { content: title, icon: "vxe-icon-question-circle-fill" },
|
|
titlePrefix: { content: title, icon: "vxe-icon-question-circle-fill" },
|
|
|
itemRender: {
|
|
itemRender: {
|
|
|
name: "$form-select",
|
|
name: "$form-select",
|
|
|
- props: { popperClass: "vxe-table-slot--popper", filterable: true, clearable: true, placeholder: `请选择${title}`, ...XEUtils.pick(config, "props") },
|
|
|
|
|
|
|
+ props: { popperClass: "vxe-table-slot--popper", type: "select", filterable: true, clearable: true, placeholder: `请选择${title}`, ...XEUtils.get(config, "props", {}) },
|
|
|
|
|
+ ...XEUtils.omit(config, "props")
|
|
|
|
|
+ },
|
|
|
|
|
+ ...XEUtils.omit(config, "props")
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * 单选配置
|
|
|
|
|
+ * @param field 字段
|
|
|
|
|
+ * @param title 标题
|
|
|
|
|
+ * @param config 其他配置
|
|
|
|
|
+ */
|
|
|
|
|
+export const mapFormItemRadio = (field, title, config = {}) => ({
|
|
|
|
|
+ field,
|
|
|
|
|
+ title,
|
|
|
|
|
+ titlePrefix: { content: title, icon: "vxe-icon-question-circle-fill" },
|
|
|
|
|
+ itemRender: {
|
|
|
|
|
+ name: "$form-radio",
|
|
|
|
|
+ props: XEUtils.get(config, "props", {}), // disabled/readonly/strict(选中后取消)
|
|
|
...XEUtils.omit(config, "props")
|
|
...XEUtils.omit(config, "props")
|
|
|
},
|
|
},
|
|
|
...XEUtils.omit(config, "props")
|
|
...XEUtils.omit(config, "props")
|
|
@@ -53,7 +72,7 @@ export const mapFormItemDatePicker = (field, title, config = {}) => ({
|
|
|
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
|
placeholder: `请选择${title}`,
|
|
placeholder: `请选择${title}`,
|
|
|
defaultTime: XEUtils.get(config, "props.type")?.includes("range") ? [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)] : new Date(2000, 1, 1, 23, 59, 59),
|
|
defaultTime: XEUtils.get(config, "props.type")?.includes("range") ? [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)] : new Date(2000, 1, 1, 23, 59, 59),
|
|
|
- ...XEUtils.get(config, "props")
|
|
|
|
|
|
|
+ ...XEUtils.get(config, "props", {})
|
|
|
},
|
|
},
|
|
|
...XEUtils.omit(config, "props")
|
|
...XEUtils.omit(config, "props")
|
|
|
},
|
|
},
|