bm-admin-ui 1.0.34-alpha → 1.0.35-alpha
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/es/components/feedback/index.js +25 -1306
- package/es/components/float-table/index.js +36 -27
- package/es/components/form-create/index.js +2901 -0
- package/es/components/form-designer/index.js +4203 -9
- package/es/components/index.js +1 -0
- package/es/components/input-tags-display/index.js +19 -1137
- package/es/components/over-tooltips/index.js +27 -20
- package/es/components/search-filter/index.js +24 -1179
- package/es/components/shops-filter/index.js +24 -1182
- package/es/components/staffs-selector/index.js +124 -1234
- package/es/components/timeline/index.js +7 -7
- package/es/components/upload/index.js +122 -1249
- package/es/utils/bm-admin-ui-resolver.js +4 -2
- package/es/utils/uniqueId.js +5 -0
- package/es/utils/vxe-table.js +4 -2
- package/es/utils/with-install.js +0 -1
- package/index.esm.js +116090 -27969
- package/index.js +116286 -28164
- package/lib/components/feedback/index.js +23 -1304
- package/lib/components/float-table/index.js +36 -27
- package/lib/components/form-create/index.js +2913 -0
- package/lib/components/form-designer/index.js +4208 -8
- package/lib/components/index.js +7 -0
- package/lib/components/input-tags-display/index.js +18 -1136
- package/lib/components/over-tooltips/index.js +27 -20
- package/lib/components/search-filter/index.js +23 -1178
- package/lib/components/shops-filter/index.js +23 -1181
- package/lib/components/staffs-selector/index.js +123 -1233
- package/lib/components/timeline/index.js +7 -7
- package/lib/components/upload/index.js +121 -1248
- package/lib/utils/bm-admin-ui-resolver.js +4 -2
- package/lib/utils/uniqueId.js +8 -0
- package/lib/utils/vxe-table.js +3 -1
- package/lib/utils/with-install.js +0 -1
- package/package.json +9 -4
- package/theme-chalk/button.css +1 -1
- package/theme-chalk/feedback.css +1 -1
- package/theme-chalk/float-table.css +1 -1
- package/theme-chalk/floating-vue.css +1 -1
- package/theme-chalk/flow-designer.css +1 -1
- package/theme-chalk/form-create.css +1 -0
- package/theme-chalk/form-designer.css +1 -0
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/modal.css +1 -1
- package/theme-chalk/over-tooltips.css +1 -1
- package/theme-chalk/search-filter.css +1 -1
- package/theme-chalk/staffs-selector.css +1 -1
- package/theme-chalk/timeline.css +1 -1
- package/theme-chalk/upload.css +1 -1
- package/es/components/button/index.d.ts +0 -307
- package/es/components/button/src/button.d.ts +0 -12
- package/es/components/button/src/button.vue.d.ts +0 -308
- package/es/components/feedback/index.d.ts +0 -1037
- package/es/components/feedback/src/bmAlert.vue.d.ts +0 -193
- package/es/components/feedback/src/bmModal.vue.d.ts +0 -839
- package/es/components/float-table/index.d.ts +0 -70
- package/es/components/float-table/src/float-table.vue.d.ts +0 -69
- package/es/components/flow-designer/index.d.ts +0 -7
- package/es/components/flow-designer/src/bm-nodes/AddCondition.d.ts +0 -26
- package/es/components/flow-designer/src/bm-nodes/AddFlowNode.d.ts +0 -29
- package/es/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +0 -249
- package/es/components/flow-designer/src/bm-nodes/BmFlowHtmlNode.d.ts +0 -19
- package/es/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +0 -15
- package/es/components/flow-designer/src/bm-nodes/BmPolyLine.d.ts +0 -21
- package/es/components/flow-designer/src/bm-nodes/EndCircle.d.ts +0 -19
- package/es/components/flow-designer/src/config.d.ts +0 -24
- package/es/components/flow-designer/src/flow-designer-test.d.ts +0 -20
- package/es/components/flow-designer/src/flow-designer.d.ts +0 -11
- package/es/components/flow-designer/src/flow-designer.vue.d.ts +0 -6
- package/es/components/flow-designer/src/utils.d.ts +0 -29
- package/es/components/form-designer/index.d.ts +0 -9
- package/es/components/form-designer/src/form-designer.vue.d.ts +0 -8
- package/es/components/index.d.ts +0 -12
- package/es/components/input-tags-display/index.d.ts +0 -131
- package/es/components/input-tags-display/src/input-tags-display.vue.d.ts +0 -128
- package/es/components/over-tooltips/index.d.ts +0 -35
- package/es/components/over-tooltips/src/over-tooltips.vue.d.ts +0 -34
- package/es/components/search-filter/index.d.ts +0 -223
- package/es/components/search-filter/src/search-filter.d.ts +0 -81
- package/es/components/search-filter/src/search-filter.vue.d.ts +0 -222
- package/es/components/search-filter/src/search-reset-btn.vue.d.ts +0 -106
- package/es/components/shops-filter/index.d.ts +0 -99
- package/es/components/shops-filter/src/shops-filter.d.ts +0 -25
- package/es/components/shops-filter/src/shops-filter.vue.d.ts +0 -98
- package/es/components/staffs-selector/index.d.ts +0 -109
- package/es/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -97
- package/es/components/staffs-selector/src/radioCmp.vue.d.ts +0 -31
- package/es/components/staffs-selector/src/staffs-selector.vue.d.ts +0 -108
- package/es/components/staffs-selector/src/variedCmp.vue.d.ts +0 -62
- package/es/components/timeline/index.d.ts +0 -118
- package/es/components/timeline/src/props.d.ts +0 -27
- package/es/components/timeline/src/timeline-item.vue.d.ts +0 -66
- package/es/components/timeline/src/timeline.vue.d.ts +0 -52
- package/es/components/upload/index.d.ts +0 -138
- package/es/components/upload/src/icons.d.ts +0 -13
- package/es/components/upload/src/upload.vue.d.ts +0 -137
- package/es/components/upload/utils/index.d.ts +0 -7
- package/es/index.d.ts +0 -6
- package/es/utils/bm-admin-ui-resolver.d.ts +0 -9
- package/es/utils/vxe-table.d.ts +0 -6
- package/es/utils/with-install.d.ts +0 -3
- package/lib/components/button/index.d.ts +0 -307
- package/lib/components/button/src/button.d.ts +0 -12
- package/lib/components/button/src/button.vue.d.ts +0 -308
- package/lib/components/feedback/index.d.ts +0 -1037
- package/lib/components/feedback/src/bmAlert.vue.d.ts +0 -193
- package/lib/components/feedback/src/bmModal.vue.d.ts +0 -839
- package/lib/components/float-table/index.d.ts +0 -70
- package/lib/components/float-table/src/float-table.vue.d.ts +0 -69
- package/lib/components/flow-designer/index.d.ts +0 -7
- package/lib/components/flow-designer/src/bm-nodes/AddCondition.d.ts +0 -26
- package/lib/components/flow-designer/src/bm-nodes/AddFlowNode.d.ts +0 -29
- package/lib/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +0 -249
- package/lib/components/flow-designer/src/bm-nodes/BmFlowHtmlNode.d.ts +0 -19
- package/lib/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +0 -15
- package/lib/components/flow-designer/src/bm-nodes/BmPolyLine.d.ts +0 -21
- package/lib/components/flow-designer/src/bm-nodes/EndCircle.d.ts +0 -19
- package/lib/components/flow-designer/src/config.d.ts +0 -24
- package/lib/components/flow-designer/src/flow-designer-test.d.ts +0 -20
- package/lib/components/flow-designer/src/flow-designer.d.ts +0 -11
- package/lib/components/flow-designer/src/flow-designer.vue.d.ts +0 -6
- package/lib/components/flow-designer/src/utils.d.ts +0 -29
- package/lib/components/form-designer/index.d.ts +0 -9
- package/lib/components/form-designer/src/form-designer.vue.d.ts +0 -8
- package/lib/components/index.d.ts +0 -12
- package/lib/components/input-tags-display/index.d.ts +0 -131
- package/lib/components/input-tags-display/src/input-tags-display.vue.d.ts +0 -128
- package/lib/components/over-tooltips/index.d.ts +0 -35
- package/lib/components/over-tooltips/src/over-tooltips.vue.d.ts +0 -34
- package/lib/components/search-filter/index.d.ts +0 -223
- package/lib/components/search-filter/src/search-filter.d.ts +0 -81
- package/lib/components/search-filter/src/search-filter.vue.d.ts +0 -222
- package/lib/components/search-filter/src/search-reset-btn.vue.d.ts +0 -106
- package/lib/components/shops-filter/index.d.ts +0 -99
- package/lib/components/shops-filter/src/shops-filter.d.ts +0 -25
- package/lib/components/shops-filter/src/shops-filter.vue.d.ts +0 -98
- package/lib/components/staffs-selector/index.d.ts +0 -109
- package/lib/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -97
- package/lib/components/staffs-selector/src/radioCmp.vue.d.ts +0 -31
- package/lib/components/staffs-selector/src/staffs-selector.vue.d.ts +0 -108
- package/lib/components/staffs-selector/src/variedCmp.vue.d.ts +0 -62
- package/lib/components/timeline/index.d.ts +0 -118
- package/lib/components/timeline/src/props.d.ts +0 -27
- package/lib/components/timeline/src/timeline-item.vue.d.ts +0 -66
- package/lib/components/timeline/src/timeline.vue.d.ts +0 -52
- package/lib/components/upload/index.d.ts +0 -138
- package/lib/components/upload/src/icons.d.ts +0 -13
- package/lib/components/upload/src/upload.vue.d.ts +0 -137
- package/lib/components/upload/utils/index.d.ts +0 -7
- package/lib/index.d.ts +0 -6
- package/lib/utils/bm-admin-ui-resolver.d.ts +0 -9
- package/lib/utils/vxe-table.d.ts +0 -6
- package/lib/utils/with-install.d.ts +0 -3
- package/types/components/button/index.d.ts +0 -307
- package/types/components/button/src/button.d.ts +0 -12
- package/types/components/button/src/button.vue.d.ts +0 -308
- package/types/components/feedback/index.d.ts +0 -1037
- package/types/components/feedback/src/bmAlert.vue.d.ts +0 -193
- package/types/components/feedback/src/bmModal.vue.d.ts +0 -839
- package/types/components/float-table/index.d.ts +0 -70
- package/types/components/float-table/src/float-table.vue.d.ts +0 -69
- package/types/components/flow-designer/index.d.ts +0 -7
- package/types/components/flow-designer/src/bm-nodes/AddCondition.d.ts +0 -26
- package/types/components/flow-designer/src/bm-nodes/AddFlowNode.d.ts +0 -29
- package/types/components/flow-designer/src/bm-nodes/BmConditionNode.vue.d.ts +0 -249
- package/types/components/flow-designer/src/bm-nodes/BmFlowHtmlNode.d.ts +0 -19
- package/types/components/flow-designer/src/bm-nodes/BmHtmlNode.vue.d.ts +0 -15
- package/types/components/flow-designer/src/bm-nodes/BmPolyLine.d.ts +0 -21
- package/types/components/flow-designer/src/bm-nodes/EndCircle.d.ts +0 -19
- package/types/components/flow-designer/src/config.d.ts +0 -24
- package/types/components/flow-designer/src/flow-designer-test.d.ts +0 -20
- package/types/components/flow-designer/src/flow-designer.d.ts +0 -11
- package/types/components/flow-designer/src/flow-designer.vue.d.ts +0 -6
- package/types/components/flow-designer/src/utils.d.ts +0 -29
- package/types/components/form-designer/index.d.ts +0 -9
- package/types/components/form-designer/src/form-designer.vue.d.ts +0 -8
- package/types/components/index.d.ts +0 -12
- package/types/components/input-tags-display/index.d.ts +0 -131
- package/types/components/input-tags-display/src/input-tags-display.vue.d.ts +0 -128
- package/types/components/over-tooltips/index.d.ts +0 -35
- package/types/components/over-tooltips/src/over-tooltips.vue.d.ts +0 -34
- package/types/components/search-filter/index.d.ts +0 -223
- package/types/components/search-filter/src/search-filter.d.ts +0 -81
- package/types/components/search-filter/src/search-filter.vue.d.ts +0 -222
- package/types/components/search-filter/src/search-reset-btn.vue.d.ts +0 -106
- package/types/components/shops-filter/index.d.ts +0 -99
- package/types/components/shops-filter/src/shops-filter.d.ts +0 -25
- package/types/components/shops-filter/src/shops-filter.vue.d.ts +0 -98
- package/types/components/staffs-selector/index.d.ts +0 -109
- package/types/components/staffs-selector/src/multipleCmp.vue.d.ts +0 -97
- package/types/components/staffs-selector/src/radioCmp.vue.d.ts +0 -31
- package/types/components/staffs-selector/src/staffs-selector.vue.d.ts +0 -108
- package/types/components/staffs-selector/src/variedCmp.vue.d.ts +0 -62
- package/types/components/timeline/index.d.ts +0 -118
- package/types/components/timeline/src/props.d.ts +0 -27
- package/types/components/timeline/src/timeline-item.vue.d.ts +0 -66
- package/types/components/timeline/src/timeline.vue.d.ts +0 -52
- package/types/components/upload/index.d.ts +0 -138
- package/types/components/upload/src/icons.d.ts +0 -13
- package/types/components/upload/src/upload.vue.d.ts +0 -137
- package/types/components/upload/utils/index.d.ts +0 -7
- package/types/index.d.ts +0 -6
- package/types/utils/bm-admin-ui-resolver.d.ts +0 -9
- package/types/utils/vxe-table.d.ts +0 -6
- package/types/utils/with-install.d.ts +0 -3
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
import { withInstall } from 'bm-admin-ui/es/utils/with-install';
|
|
2
|
-
import { defineComponent, resolveComponent,
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, normalizeStyle, toDisplayString, computed, resolveComponent, normalizeClass, unref, createBlock, createCommentVNode, withCtx, createVNode, withModifiers, createTextVNode, ref, watch, createElementVNode, Fragment, isRef, renderList, renderSlot, nextTick, createStaticVNode, reactive, onBeforeUnmount, resolveDynamicComponent } from 'vue';
|
|
3
|
+
import uniqueId from 'bm-admin-ui/es/utils/uniqueId';
|
|
4
|
+
import Draggable from 'vuedraggable';
|
|
5
|
+
import { Tooltip, FormItemRest, Input, Button, RadioGroup, Radio, DatePicker, Checkbox, Tabs, TabPane, Row, Col, Dropdown, Menu, CheckboxGroup, MenuItem, Divider, Switch, Select, Layout, LayoutSider, LayoutContent, message } from 'ant-design-vue';
|
|
6
|
+
import { HolderOutlined, EditOutlined, PlusOutlined, QuestionCircleOutlined, InfoCircleFilled, ExclamationCircleFilled } from '@ant-design/icons-vue';
|
|
7
|
+
import { BmUpload } from 'bm-admin-ui/es/components';
|
|
8
|
+
import { cloneDeep, merge } from 'lodash-es';
|
|
9
|
+
import FC from '@form-create/ant-design-vue';
|
|
10
|
+
|
|
11
|
+
var WidgetType;
|
|
12
|
+
(function (WidgetType) {
|
|
13
|
+
WidgetType["RowWidget"] = "RowWidget";
|
|
14
|
+
WidgetType["TableWidget"] = "TableWidget";
|
|
15
|
+
WidgetType["UploadFile"] = "UploadFile";
|
|
16
|
+
})(WidgetType || (WidgetType = {}));
|
|
17
|
+
function getFieldRatioRule(rule, parentRule) {
|
|
18
|
+
let defaultValue = rule.config.fieldRatio;
|
|
19
|
+
const propRule = {
|
|
20
|
+
type: 'radio',
|
|
21
|
+
title: '字段占比',
|
|
22
|
+
options: [],
|
|
23
|
+
props: {
|
|
24
|
+
optionType: 'button',
|
|
25
|
+
buttonStyle: 'solid',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
switch (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) {
|
|
29
|
+
case WidgetType.RowWidget:
|
|
30
|
+
defaultValue = defaultValue || 12;
|
|
31
|
+
propRule.options = [
|
|
32
|
+
{ value: 6, label: '25%' },
|
|
33
|
+
{ value: 12, label: '50%' },
|
|
34
|
+
{ value: 18, label: '75%' },
|
|
35
|
+
{ value: 24, label: '100%' },
|
|
36
|
+
];
|
|
37
|
+
propRule.value = defaultValue;
|
|
38
|
+
break;
|
|
39
|
+
case WidgetType.TableWidget:
|
|
40
|
+
defaultValue = defaultValue || '140px';
|
|
41
|
+
propRule.title = '子字段宽度';
|
|
42
|
+
propRule.options = [
|
|
43
|
+
{ value: '140px', label: '小' },
|
|
44
|
+
{ value: '212px', label: '中' },
|
|
45
|
+
{ value: '392px', label: '大' },
|
|
46
|
+
{ value: '572px', label: '超大 ' },
|
|
47
|
+
];
|
|
48
|
+
propRule.value = defaultValue;
|
|
49
|
+
break;
|
|
50
|
+
default:
|
|
51
|
+
defaultValue = defaultValue || '100%';
|
|
52
|
+
propRule.options = [
|
|
53
|
+
{ value: '25%', label: '25%' },
|
|
54
|
+
{ value: '50%', label: '50%' },
|
|
55
|
+
{ value: '75%', label: '75%' },
|
|
56
|
+
{ value: '100%', label: '100%' },
|
|
57
|
+
];
|
|
58
|
+
propRule.value = defaultValue;
|
|
59
|
+
}
|
|
60
|
+
return propRule;
|
|
61
|
+
}
|
|
3
62
|
|
|
4
63
|
var _export_sfc = (sfc, props) => {
|
|
5
64
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -9,22 +68,4157 @@ var _export_sfc = (sfc, props) => {
|
|
|
9
68
|
return target;
|
|
10
69
|
};
|
|
11
70
|
|
|
71
|
+
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
72
|
+
__name: "widget-instruction",
|
|
73
|
+
props: ["rule"],
|
|
74
|
+
setup(__props) {
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return openBlock(), createElementBlock("div", {
|
|
77
|
+
style: normalizeStyle({ minHeight: "22px", color: __props.rule.style.color })
|
|
78
|
+
}, toDisplayString(__props.rule.value), 5);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
var WidgetInstruction = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "widget-instruction.vue"]]);
|
|
83
|
+
|
|
84
|
+
const _hoisted_1$g = {
|
|
85
|
+
key: 2,
|
|
86
|
+
class: "bm-drag-tool-mask"
|
|
87
|
+
};
|
|
88
|
+
const _hoisted_2$d = /* @__PURE__ */ createTextVNode("\u590D\u5236");
|
|
89
|
+
const _hoisted_3$b = /* @__PURE__ */ createTextVNode("\u5220\u9664");
|
|
90
|
+
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
91
|
+
__name: "drag-tool",
|
|
92
|
+
props: ["rule", "activeRule", "parentRule"],
|
|
93
|
+
emits: [
|
|
94
|
+
"copy",
|
|
95
|
+
"delete",
|
|
96
|
+
"mouseenter",
|
|
97
|
+
"mouseleave",
|
|
98
|
+
"setActiveRule",
|
|
99
|
+
"widgetAdd"
|
|
100
|
+
],
|
|
101
|
+
setup(__props, { emit: emits }) {
|
|
102
|
+
const props = __props;
|
|
103
|
+
const isActive = computed(() => props.rule.field === props.activeRule?.field);
|
|
104
|
+
const option = computed(() => ({
|
|
105
|
+
form: {
|
|
106
|
+
layout: "vertical"
|
|
107
|
+
},
|
|
108
|
+
submitBtn: {
|
|
109
|
+
show: false
|
|
110
|
+
},
|
|
111
|
+
parentType: props.parentRule?.type,
|
|
112
|
+
childRules: props.parentRule?.config?.childRules
|
|
113
|
+
}));
|
|
114
|
+
function emitCopyEvt(rule, parentRule = void 0) {
|
|
115
|
+
emits("copy", rule, parentRule);
|
|
116
|
+
}
|
|
117
|
+
function emitDeleteEvt(rule, parentRule = void 0) {
|
|
118
|
+
emits("delete", rule, parentRule);
|
|
119
|
+
}
|
|
120
|
+
function handleCopy() {
|
|
121
|
+
emitCopyEvt(props.rule);
|
|
122
|
+
}
|
|
123
|
+
function handleDelete() {
|
|
124
|
+
emitDeleteEvt(props.rule);
|
|
125
|
+
}
|
|
126
|
+
function handleMouseenter() {
|
|
127
|
+
props.rule.config.isHover = true;
|
|
128
|
+
emits("mouseenter");
|
|
129
|
+
}
|
|
130
|
+
function handleMouseleave() {
|
|
131
|
+
props.rule.config.isHover = false;
|
|
132
|
+
emits("mouseleave");
|
|
133
|
+
}
|
|
134
|
+
function handleRowWidgetMouseenter() {
|
|
135
|
+
props.rule.config.isHover = false;
|
|
136
|
+
}
|
|
137
|
+
function handleRowWidgetMouseleave() {
|
|
138
|
+
props.rule.config.isHover = true;
|
|
139
|
+
}
|
|
140
|
+
function handleRowWidgetSetActiveRule(element) {
|
|
141
|
+
emits("setActiveRule", element, props.rule);
|
|
142
|
+
}
|
|
143
|
+
function handleRowWidgetCopy(rule) {
|
|
144
|
+
emitCopyEvt(rule, props.rule);
|
|
145
|
+
}
|
|
146
|
+
function handleRowWidgetDelete(rule) {
|
|
147
|
+
emitDeleteEvt(rule, props.rule);
|
|
148
|
+
}
|
|
149
|
+
function handleRowWidgetAdd(rule) {
|
|
150
|
+
emits("widgetAdd", rule, props.rule);
|
|
151
|
+
}
|
|
152
|
+
return (_ctx, _cache) => {
|
|
153
|
+
const _component_FormCreate = resolveComponent("FormCreate");
|
|
154
|
+
const _component_Copy = resolveComponent("Copy");
|
|
155
|
+
const _component_ACol = resolveComponent("ACol");
|
|
156
|
+
const _component_Delete = resolveComponent("Delete");
|
|
157
|
+
const _component_ARow = resolveComponent("ARow");
|
|
158
|
+
return openBlock(), createElementBlock("div", {
|
|
159
|
+
class: normalizeClass([
|
|
160
|
+
"bm-drag-tool",
|
|
161
|
+
__props.rule.type === unref(WidgetType).RowWidget ? "is-row" : "",
|
|
162
|
+
unref(isActive) ? "is-active" : "",
|
|
163
|
+
__props.rule?.config?.putDisabled ? "is-put-disabled" : ""
|
|
164
|
+
]),
|
|
165
|
+
onMouseenter: handleMouseenter,
|
|
166
|
+
onMouseleave: handleMouseleave
|
|
167
|
+
}, [
|
|
168
|
+
__props.rule.type ? (openBlock(), createBlock(_component_FormCreate, {
|
|
169
|
+
key: 0,
|
|
170
|
+
option: unref(option),
|
|
171
|
+
rule: [__props.rule],
|
|
172
|
+
onNestMouseenter: handleRowWidgetMouseenter,
|
|
173
|
+
onNestMouseleave: handleRowWidgetMouseleave,
|
|
174
|
+
onNestSetActiveRule: handleRowWidgetSetActiveRule,
|
|
175
|
+
onNestCopy: handleRowWidgetCopy,
|
|
176
|
+
onNestDelete: handleRowWidgetDelete,
|
|
177
|
+
onNestAdd: handleRowWidgetAdd
|
|
178
|
+
}, null, 8, ["option", "rule"])) : (openBlock(), createBlock(WidgetInstruction, {
|
|
179
|
+
key: 1,
|
|
180
|
+
rule: __props.rule
|
|
181
|
+
}, null, 8, ["rule"])),
|
|
182
|
+
__props.rule.type !== unref(WidgetType).RowWidget && __props.rule.type !== unref(WidgetType).TableWidget ? (openBlock(), createElementBlock("div", _hoisted_1$g)) : createCommentVNode("v-if", true),
|
|
183
|
+
__props.rule.config.isHover || unref(isActive) ? (openBlock(), createBlock(_component_ARow, {
|
|
184
|
+
key: 3,
|
|
185
|
+
class: "bm-drag-tool-btn",
|
|
186
|
+
gutter: [16, 0]
|
|
187
|
+
}, {
|
|
188
|
+
default: withCtx(() => [
|
|
189
|
+
createVNode(_component_ACol, { class: "bm-drag-tool-btn-col" }, {
|
|
190
|
+
default: withCtx(() => [
|
|
191
|
+
createVNode(unref(Tooltip), { placement: "top" }, {
|
|
192
|
+
title: withCtx(() => [
|
|
193
|
+
_hoisted_2$d
|
|
194
|
+
]),
|
|
195
|
+
default: withCtx(() => [
|
|
196
|
+
createVNode(_component_Copy, {
|
|
197
|
+
class: "bm-drag-tool-btn-icon is-copy",
|
|
198
|
+
onClick: withModifiers(handleCopy, ["stop"])
|
|
199
|
+
}, null, 8, ["onClick"])
|
|
200
|
+
]),
|
|
201
|
+
_: 1
|
|
202
|
+
})
|
|
203
|
+
]),
|
|
204
|
+
_: 1
|
|
205
|
+
}),
|
|
206
|
+
createVNode(_component_ACol, { class: "bm-drag-tool-btn-col" }, {
|
|
207
|
+
default: withCtx(() => [
|
|
208
|
+
createVNode(unref(Tooltip), { placement: "top" }, {
|
|
209
|
+
title: withCtx(() => [
|
|
210
|
+
_hoisted_3$b
|
|
211
|
+
]),
|
|
212
|
+
default: withCtx(() => [
|
|
213
|
+
createVNode(_component_Delete, {
|
|
214
|
+
class: "bm-drag-tool-btn-icon is-delete",
|
|
215
|
+
onClick: withModifiers(handleDelete, ["stop"])
|
|
216
|
+
}, null, 8, ["onClick"])
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
})
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
})
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
})) : createCommentVNode("v-if", true)
|
|
226
|
+
], 34);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
var DragTool = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "drag-tool.vue"]]);
|
|
231
|
+
|
|
232
|
+
const _hoisted_1$f = { class: "bm-drag-placeholder" };
|
|
233
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
234
|
+
__name: "drag-placeholder",
|
|
235
|
+
props: {},
|
|
236
|
+
setup(__props) {
|
|
237
|
+
return (_ctx, _cache) => {
|
|
238
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f);
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
var DragPlaceholder = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "drag-placeholder.vue"]]);
|
|
243
|
+
|
|
244
|
+
const _hoisted_1$e = { class: "bm-widget-row-wrap" };
|
|
245
|
+
const _hoisted_2$c = {
|
|
246
|
+
key: 0,
|
|
247
|
+
class: "bm-widget-row-tip"
|
|
248
|
+
};
|
|
249
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
250
|
+
__name: "widget-row",
|
|
251
|
+
props: ["activeRule", "formCreateInject"],
|
|
252
|
+
emits: [
|
|
253
|
+
"mouseenter",
|
|
254
|
+
"mouseleave",
|
|
255
|
+
"set-active-rule",
|
|
256
|
+
"copy",
|
|
257
|
+
"delete",
|
|
258
|
+
"add"
|
|
259
|
+
],
|
|
260
|
+
setup(__props, { emit: emits }) {
|
|
261
|
+
const props = __props;
|
|
262
|
+
const childRules = computed(() => props.formCreateInject.rule.config.childRules);
|
|
263
|
+
function handleMouseenter() {
|
|
264
|
+
emits("mouseenter");
|
|
265
|
+
}
|
|
266
|
+
function handleMouseleave() {
|
|
267
|
+
emits("mouseleave");
|
|
268
|
+
}
|
|
269
|
+
function emitSetActiveRuleEvt(rule) {
|
|
270
|
+
emits("set-active-rule", rule);
|
|
271
|
+
}
|
|
272
|
+
function handleClick(element) {
|
|
273
|
+
emitSetActiveRuleEvt(element);
|
|
274
|
+
}
|
|
275
|
+
function handleRowWidgetAdd({ newIndex }) {
|
|
276
|
+
emits("add", childRules.value[newIndex]);
|
|
277
|
+
}
|
|
278
|
+
function handleRowWidgetUpdate({ newIndex }) {
|
|
279
|
+
const rule = childRules.value[newIndex];
|
|
280
|
+
if (rule)
|
|
281
|
+
emitSetActiveRuleEvt(rule);
|
|
282
|
+
}
|
|
283
|
+
function handleCopy(rule) {
|
|
284
|
+
emits("copy", rule);
|
|
285
|
+
}
|
|
286
|
+
function handleDelete(rule) {
|
|
287
|
+
emits("delete", rule);
|
|
288
|
+
}
|
|
289
|
+
return (_ctx, _cache) => {
|
|
290
|
+
const _component_ACol = resolveComponent("ACol");
|
|
291
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
292
|
+
!unref(childRules).length ? (openBlock(), createElementBlock("div", _hoisted_2$c, " \u53EF\u62D6\u5165\u591A\u4E2A\u63A7\u4EF6 ")) : createCommentVNode("v-if", true),
|
|
293
|
+
createVNode(unref(Draggable), {
|
|
294
|
+
"component-data": {
|
|
295
|
+
field: __props.formCreateInject.rule.field,
|
|
296
|
+
type: unref(WidgetType).RowWidget
|
|
297
|
+
},
|
|
298
|
+
class: "bm-widget-row",
|
|
299
|
+
tag: "ARow",
|
|
300
|
+
group: {
|
|
301
|
+
name: "rowWidget",
|
|
302
|
+
pull: true,
|
|
303
|
+
put: ["widget", "rowWidget", "formWidget"]
|
|
304
|
+
},
|
|
305
|
+
"ghost-class": unref(childRules).length ? "row-drag-ghost" : "row-drag-ghost__is-empty",
|
|
306
|
+
list: unref(childRules),
|
|
307
|
+
"force-fallback": true,
|
|
308
|
+
delay: 50,
|
|
309
|
+
"item-key": "field",
|
|
310
|
+
direction: "vertical",
|
|
311
|
+
onAdd: handleRowWidgetAdd,
|
|
312
|
+
onUpdate: handleRowWidgetUpdate
|
|
313
|
+
}, {
|
|
314
|
+
item: withCtx(({ element }) => [
|
|
315
|
+
createVNode(_component_ACol, {
|
|
316
|
+
span: element.config.fieldRatio
|
|
317
|
+
}, {
|
|
318
|
+
default: withCtx(() => [
|
|
319
|
+
createVNode(DragTool, {
|
|
320
|
+
rule: element,
|
|
321
|
+
"active-rule": __props.activeRule,
|
|
322
|
+
"parent-rule": __props.formCreateInject.rule,
|
|
323
|
+
onMouseenter: handleMouseenter,
|
|
324
|
+
onMouseleave: handleMouseleave,
|
|
325
|
+
onClick: withModifiers(($event) => handleClick(element), ["stop"]),
|
|
326
|
+
onCopy: handleCopy,
|
|
327
|
+
onDelete: handleDelete
|
|
328
|
+
}, null, 8, ["rule", "active-rule", "parent-rule", "onClick"]),
|
|
329
|
+
createVNode(DragPlaceholder)
|
|
330
|
+
]),
|
|
331
|
+
_: 2
|
|
332
|
+
}, 1032, ["span"])
|
|
333
|
+
]),
|
|
334
|
+
_: 1
|
|
335
|
+
}, 8, ["component-data", "ghost-class", "list"])
|
|
336
|
+
]);
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
});
|
|
340
|
+
var WidgetRow = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "widget-row.vue"]]);
|
|
341
|
+
|
|
342
|
+
const label$h = '分栏';
|
|
343
|
+
const fieldsMap$h = {
|
|
344
|
+
'title.title': 'title.title',
|
|
345
|
+
'config.title': 'config.title',
|
|
346
|
+
'config.showTitle': 'config.showTitle',
|
|
347
|
+
};
|
|
348
|
+
function handleTitle(title) {
|
|
349
|
+
return title + '(该标题不会显示在表单)';
|
|
350
|
+
}
|
|
351
|
+
const name$h = 'row';
|
|
352
|
+
var row = {
|
|
353
|
+
icon: 'RowIcon',
|
|
354
|
+
name: name$h,
|
|
355
|
+
label: label$h,
|
|
356
|
+
rule() {
|
|
357
|
+
return {
|
|
358
|
+
type: WidgetType.RowWidget,
|
|
359
|
+
component: WidgetRow,
|
|
360
|
+
title: {
|
|
361
|
+
title: label$h,
|
|
362
|
+
},
|
|
363
|
+
field: uniqueId(),
|
|
364
|
+
props: {
|
|
365
|
+
field: '',
|
|
366
|
+
list: [],
|
|
367
|
+
activeRule: {},
|
|
368
|
+
},
|
|
369
|
+
emit: [
|
|
370
|
+
'mouseenter',
|
|
371
|
+
'mouseleave',
|
|
372
|
+
'set-active-rule',
|
|
373
|
+
'copy',
|
|
374
|
+
'delete',
|
|
375
|
+
'add',
|
|
376
|
+
],
|
|
377
|
+
emitPrefix: 'nest',
|
|
378
|
+
config: {
|
|
379
|
+
title: label$h,
|
|
380
|
+
showTitle: true,
|
|
381
|
+
childRules: [],
|
|
382
|
+
propsFields: Object.values(fieldsMap$h),
|
|
383
|
+
},
|
|
384
|
+
};
|
|
385
|
+
},
|
|
386
|
+
props(rule) {
|
|
387
|
+
return [
|
|
388
|
+
{
|
|
389
|
+
type: 'input',
|
|
390
|
+
title: '标题',
|
|
391
|
+
field: fieldsMap$h['config.title'],
|
|
392
|
+
value: rule.config.title,
|
|
393
|
+
effect: {
|
|
394
|
+
required: '请输入标题',
|
|
395
|
+
},
|
|
396
|
+
props: {
|
|
397
|
+
placeholder: '请输入',
|
|
398
|
+
maxlength: 10,
|
|
399
|
+
},
|
|
400
|
+
inject: true,
|
|
401
|
+
on: {
|
|
402
|
+
change({ api, self }, $event) {
|
|
403
|
+
const showTitle = rule.config.showTitle;
|
|
404
|
+
let title = $event.target.value;
|
|
405
|
+
if (!showTitle) {
|
|
406
|
+
title = handleTitle(title);
|
|
407
|
+
}
|
|
408
|
+
api.emit('change', 'title.title', title, self, api, true);
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
type: 'switch',
|
|
414
|
+
title: '是否显示标题',
|
|
415
|
+
field: fieldsMap$h['config.showTitle'],
|
|
416
|
+
value: rule.config.showTitle,
|
|
417
|
+
inject: true,
|
|
418
|
+
on: {
|
|
419
|
+
change({ api, self }, value) {
|
|
420
|
+
let title = rule.config.title;
|
|
421
|
+
if (!value) {
|
|
422
|
+
title = handleTitle(title);
|
|
423
|
+
}
|
|
424
|
+
api.emit('change', 'title.title', title, self, api, true);
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
},
|
|
428
|
+
];
|
|
429
|
+
},
|
|
430
|
+
parse(rule) {
|
|
431
|
+
return {
|
|
432
|
+
name: name$h,
|
|
433
|
+
field: rule.field,
|
|
434
|
+
title: {
|
|
435
|
+
title: rule.title.title,
|
|
436
|
+
},
|
|
437
|
+
config: {
|
|
438
|
+
title: rule.config.title,
|
|
439
|
+
showTitle: rule.config.showTitle,
|
|
440
|
+
},
|
|
441
|
+
};
|
|
442
|
+
},
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
const label$g = '单行输入框';
|
|
446
|
+
const fieldsMap$g = {
|
|
447
|
+
'title.title': 'title.title',
|
|
448
|
+
'props.placeholder': 'props.placeholder',
|
|
449
|
+
value: 'value',
|
|
450
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
451
|
+
'effect.required': 'effect.required',
|
|
452
|
+
};
|
|
453
|
+
const name$g = 'input';
|
|
454
|
+
var input = {
|
|
455
|
+
icon: 'InputIcon',
|
|
456
|
+
name: name$g,
|
|
457
|
+
label: label$g,
|
|
458
|
+
rule() {
|
|
459
|
+
return {
|
|
460
|
+
type: 'input',
|
|
461
|
+
field: uniqueId(),
|
|
462
|
+
title: {
|
|
463
|
+
title: label$g,
|
|
464
|
+
style: {
|
|
465
|
+
overflow: 'hidden',
|
|
466
|
+
textOverflow: 'ellipsis',
|
|
467
|
+
whiteSpace: 'nowrap',
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
effect: {
|
|
471
|
+
required: true,
|
|
472
|
+
formRule: 'formRule',
|
|
473
|
+
},
|
|
474
|
+
props: {
|
|
475
|
+
maxlength: 200,
|
|
476
|
+
placeholder: '请输入',
|
|
477
|
+
},
|
|
478
|
+
config: {
|
|
479
|
+
propsFields: Object.values(fieldsMap$g),
|
|
480
|
+
},
|
|
481
|
+
};
|
|
482
|
+
},
|
|
483
|
+
props(rule, parentRule) {
|
|
484
|
+
return [
|
|
485
|
+
{
|
|
486
|
+
type: 'input',
|
|
487
|
+
title: '标题',
|
|
488
|
+
field: fieldsMap$g['title.title'],
|
|
489
|
+
value: rule.title.title,
|
|
490
|
+
effect: {
|
|
491
|
+
required: '请输入标题',
|
|
492
|
+
},
|
|
493
|
+
props: {
|
|
494
|
+
placeholder: '请输入',
|
|
495
|
+
maxlength: 10,
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
type: 'input',
|
|
500
|
+
title: '提示文字',
|
|
501
|
+
field: fieldsMap$g['props.placeholder'],
|
|
502
|
+
props: {
|
|
503
|
+
placeholder: '请输入',
|
|
504
|
+
},
|
|
505
|
+
value: rule.props.placeholder,
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
type: 'input',
|
|
509
|
+
title: '默认值',
|
|
510
|
+
field: fieldsMap$g['value'],
|
|
511
|
+
props: {
|
|
512
|
+
placeholder: '请输入',
|
|
513
|
+
},
|
|
514
|
+
value: rule.value,
|
|
515
|
+
},
|
|
516
|
+
Object.assign({ field: fieldsMap$g['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
517
|
+
{
|
|
518
|
+
type: 'switch',
|
|
519
|
+
title: '是否必填',
|
|
520
|
+
field: fieldsMap$g['effect.required'],
|
|
521
|
+
value: rule.effect.required,
|
|
522
|
+
},
|
|
523
|
+
];
|
|
524
|
+
},
|
|
525
|
+
parse(rule) {
|
|
526
|
+
return {
|
|
527
|
+
name: name$g,
|
|
528
|
+
field: rule.field,
|
|
529
|
+
title: {
|
|
530
|
+
title: rule.title.title,
|
|
531
|
+
},
|
|
532
|
+
props: {
|
|
533
|
+
placeholder: rule.props.placeholder,
|
|
534
|
+
},
|
|
535
|
+
value: rule.value,
|
|
536
|
+
config: {
|
|
537
|
+
fieldRatio: rule.config.fieldRatio,
|
|
538
|
+
},
|
|
539
|
+
effect: {
|
|
540
|
+
required: rule.effect.required,
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
},
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const label$f = '多行输入框';
|
|
547
|
+
const fieldsMap$f = {
|
|
548
|
+
'title.title': 'title.title',
|
|
549
|
+
'props.placeholder': 'props.placeholder',
|
|
550
|
+
value: 'value',
|
|
551
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
552
|
+
'effect.required': 'effect.required',
|
|
553
|
+
};
|
|
554
|
+
const name$f = 'textarea';
|
|
555
|
+
var textarea = {
|
|
556
|
+
icon: 'TextareaIcon',
|
|
557
|
+
name: name$f,
|
|
558
|
+
label: label$f,
|
|
559
|
+
rule() {
|
|
560
|
+
return {
|
|
561
|
+
type: 'input',
|
|
562
|
+
field: uniqueId(),
|
|
563
|
+
title: {
|
|
564
|
+
title: label$f,
|
|
565
|
+
style: {
|
|
566
|
+
overflow: 'hidden',
|
|
567
|
+
textOverflow: 'ellipsis',
|
|
568
|
+
whiteSpace: 'nowrap',
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
effect: {
|
|
572
|
+
required: true,
|
|
573
|
+
formRule: 'formRule',
|
|
574
|
+
},
|
|
575
|
+
props: {
|
|
576
|
+
type: 'textarea',
|
|
577
|
+
placeholder: '请输入',
|
|
578
|
+
maxlength: 5000,
|
|
579
|
+
},
|
|
580
|
+
config: {
|
|
581
|
+
propsFields: Object.values(fieldsMap$f),
|
|
582
|
+
},
|
|
583
|
+
};
|
|
584
|
+
},
|
|
585
|
+
props(rule, parentRule) {
|
|
586
|
+
return [
|
|
587
|
+
{
|
|
588
|
+
type: 'input',
|
|
589
|
+
title: '标题',
|
|
590
|
+
field: fieldsMap$f['title.title'],
|
|
591
|
+
value: rule.title.title,
|
|
592
|
+
effect: {
|
|
593
|
+
required: '请输入标题',
|
|
594
|
+
},
|
|
595
|
+
props: {
|
|
596
|
+
placeholder: '请输入',
|
|
597
|
+
maxlength: 10,
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
type: 'input',
|
|
602
|
+
title: '提示文字',
|
|
603
|
+
field: fieldsMap$f['props.placeholder'],
|
|
604
|
+
props: {
|
|
605
|
+
placeholder: '请输入',
|
|
606
|
+
},
|
|
607
|
+
value: rule.props.placeholder,
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
type: 'input',
|
|
611
|
+
title: '默认值',
|
|
612
|
+
field: fieldsMap$f['value'],
|
|
613
|
+
props: {
|
|
614
|
+
placeholder: '请输入',
|
|
615
|
+
},
|
|
616
|
+
value: rule.value,
|
|
617
|
+
},
|
|
618
|
+
Object.assign({ field: fieldsMap$f['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
619
|
+
{
|
|
620
|
+
type: 'switch',
|
|
621
|
+
title: '是否必填',
|
|
622
|
+
field: fieldsMap$f['effect.required'],
|
|
623
|
+
value: rule.effect.required,
|
|
624
|
+
},
|
|
625
|
+
];
|
|
626
|
+
},
|
|
627
|
+
parse(rule) {
|
|
628
|
+
return {
|
|
629
|
+
name: name$f,
|
|
630
|
+
field: rule.field,
|
|
631
|
+
title: {
|
|
632
|
+
title: rule.title.title,
|
|
633
|
+
},
|
|
634
|
+
props: {
|
|
635
|
+
placeholder: rule.props.placeholder,
|
|
636
|
+
},
|
|
637
|
+
value: rule.value,
|
|
638
|
+
config: {
|
|
639
|
+
fieldRatio: rule.config.fieldRatio,
|
|
640
|
+
},
|
|
641
|
+
effect: {
|
|
642
|
+
required: rule.effect.required,
|
|
643
|
+
},
|
|
644
|
+
};
|
|
645
|
+
},
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const label$e = '数字输入框';
|
|
649
|
+
const fieldsMap$e = {
|
|
650
|
+
'title.title': 'title.title',
|
|
651
|
+
'props.placeholder': 'props.placeholder',
|
|
652
|
+
value: 'value',
|
|
653
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
654
|
+
'config.count': 'config.count',
|
|
655
|
+
'effect.required': 'effect.required',
|
|
656
|
+
};
|
|
657
|
+
const name$e = 'numInput';
|
|
658
|
+
var numInput = {
|
|
659
|
+
icon: 'NumInput',
|
|
660
|
+
name: name$e,
|
|
661
|
+
label: label$e,
|
|
662
|
+
rule() {
|
|
663
|
+
return {
|
|
664
|
+
type: 'inputNumber',
|
|
665
|
+
field: uniqueId(),
|
|
666
|
+
title: {
|
|
667
|
+
title: label$e,
|
|
668
|
+
style: {
|
|
669
|
+
overflow: 'hidden',
|
|
670
|
+
textOverflow: 'ellipsis',
|
|
671
|
+
whiteSpace: 'nowrap',
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
effect: {
|
|
675
|
+
required: true,
|
|
676
|
+
formRule: 'formRule',
|
|
677
|
+
},
|
|
678
|
+
props: {
|
|
679
|
+
placeholder: '请输入',
|
|
680
|
+
},
|
|
681
|
+
config: {
|
|
682
|
+
propsFields: Object.values(fieldsMap$e),
|
|
683
|
+
},
|
|
684
|
+
style: {
|
|
685
|
+
width: '100%',
|
|
686
|
+
},
|
|
687
|
+
};
|
|
688
|
+
},
|
|
689
|
+
props(rule, parentRule) {
|
|
690
|
+
return [
|
|
691
|
+
{
|
|
692
|
+
type: 'input',
|
|
693
|
+
title: '标题',
|
|
694
|
+
field: fieldsMap$e['title.title'],
|
|
695
|
+
value: rule.title.title,
|
|
696
|
+
effect: {
|
|
697
|
+
required: '请输入标题',
|
|
698
|
+
},
|
|
699
|
+
props: {
|
|
700
|
+
placeholder: '请输入',
|
|
701
|
+
maxlength: 10,
|
|
702
|
+
},
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
type: 'input',
|
|
706
|
+
title: '提示文字',
|
|
707
|
+
field: fieldsMap$e['props.placeholder'],
|
|
708
|
+
props: {
|
|
709
|
+
placeholder: '请输入',
|
|
710
|
+
},
|
|
711
|
+
value: rule.props.placeholder,
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
type: 'inputNumber',
|
|
715
|
+
title: '默认值',
|
|
716
|
+
field: fieldsMap$e['value'],
|
|
717
|
+
props: {
|
|
718
|
+
placeholder: '请输入',
|
|
719
|
+
type: 'number',
|
|
720
|
+
},
|
|
721
|
+
value: rule.value,
|
|
722
|
+
style: {
|
|
723
|
+
width: '100%',
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
Object.assign({ field: fieldsMap$e['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
727
|
+
{
|
|
728
|
+
type: 'switch',
|
|
729
|
+
title: '统计总数',
|
|
730
|
+
info: '仅当该控件结合“表格”控件使用时应用',
|
|
731
|
+
field: fieldsMap$e['config.count'],
|
|
732
|
+
value: rule.config.count,
|
|
733
|
+
props: {
|
|
734
|
+
disabled: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) !== WidgetType.TableWidget,
|
|
735
|
+
},
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
type: 'switch',
|
|
739
|
+
title: '是否必填',
|
|
740
|
+
field: fieldsMap$e['effect.required'],
|
|
741
|
+
value: rule.effect.required,
|
|
742
|
+
info: '勾选后可作为流程条件',
|
|
743
|
+
},
|
|
744
|
+
];
|
|
745
|
+
},
|
|
746
|
+
parse(rule) {
|
|
747
|
+
return {
|
|
748
|
+
name: name$e,
|
|
749
|
+
field: rule.field,
|
|
750
|
+
title: {
|
|
751
|
+
title: rule.title.title,
|
|
752
|
+
},
|
|
753
|
+
props: {
|
|
754
|
+
placeholder: rule.props.placeholder,
|
|
755
|
+
},
|
|
756
|
+
value: rule.value,
|
|
757
|
+
config: {
|
|
758
|
+
count: rule.config.count,
|
|
759
|
+
fieldRatio: rule.config.fieldRatio,
|
|
760
|
+
},
|
|
761
|
+
effect: {
|
|
762
|
+
required: rule.effect.required,
|
|
763
|
+
},
|
|
764
|
+
};
|
|
765
|
+
},
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
const _hoisted_1$d = { class: "bm-handle-options" };
|
|
769
|
+
const _hoisted_2$b = {
|
|
770
|
+
key: 0,
|
|
771
|
+
class: "bm-handle-options__error-tip"
|
|
772
|
+
};
|
|
773
|
+
const _hoisted_3$a = /* @__PURE__ */ createTextVNode(" \u6279\u91CF\u7F16\u8F91 ");
|
|
774
|
+
const _hoisted_4$7 = /* @__PURE__ */ createTextVNode(" \u6DFB\u52A0\u9009\u9879 ");
|
|
775
|
+
const _hoisted_5$4 = /* @__PURE__ */ createTextVNode(" \u6BCF\u884C\u5BF9\u5E94\u4E00\u4E2A\u9009\u9879 ");
|
|
776
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
777
|
+
__name: "handle-options",
|
|
778
|
+
props: ["options"],
|
|
779
|
+
emits: ["setValue"],
|
|
780
|
+
setup(__props, { emit: emits }) {
|
|
781
|
+
const props = __props;
|
|
782
|
+
const handleClass = "bm-handle-options__drag-icon";
|
|
783
|
+
const visible = ref(false);
|
|
784
|
+
const text = ref("");
|
|
785
|
+
const repeatOption = ref([]);
|
|
786
|
+
function edit() {
|
|
787
|
+
visible.value = true;
|
|
788
|
+
text.value = makeText(props.options);
|
|
789
|
+
}
|
|
790
|
+
function add() {
|
|
791
|
+
const index = props.options.length;
|
|
792
|
+
const value = `\u9009\u9879${index + 1}`;
|
|
793
|
+
props.options.push({ value, label: value });
|
|
794
|
+
}
|
|
795
|
+
function makeText(options) {
|
|
796
|
+
return options.reduce((pre, cur) => {
|
|
797
|
+
if (!pre) {
|
|
798
|
+
return cur.label;
|
|
799
|
+
} else {
|
|
800
|
+
return pre + "\n" + cur.label;
|
|
801
|
+
}
|
|
802
|
+
}, "");
|
|
803
|
+
}
|
|
804
|
+
function handleOk() {
|
|
805
|
+
const options = text.value.split("\n").reduce((pre, cur) => {
|
|
806
|
+
if (cur) {
|
|
807
|
+
pre.push({ value: cur, label: cur });
|
|
808
|
+
}
|
|
809
|
+
return pre;
|
|
810
|
+
}, []);
|
|
811
|
+
props.options.splice(0, props.options.length);
|
|
812
|
+
props.options.push(...options);
|
|
813
|
+
visible.value = false;
|
|
814
|
+
}
|
|
815
|
+
function handleBlur(element) {
|
|
816
|
+
element.value = element.label;
|
|
817
|
+
}
|
|
818
|
+
function handleRepeatOption(val) {
|
|
819
|
+
repeatOption.value = [];
|
|
820
|
+
const cache = {};
|
|
821
|
+
val.forEach(({ value }) => {
|
|
822
|
+
if (!cache[value]) {
|
|
823
|
+
cache[value] = 1;
|
|
824
|
+
} else {
|
|
825
|
+
cache[value]++;
|
|
826
|
+
if (cache[value] === 2) {
|
|
827
|
+
repeatOption.value.push(value);
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
function emitSetValue(val) {
|
|
833
|
+
emits("setValue", val);
|
|
834
|
+
}
|
|
835
|
+
watch(
|
|
836
|
+
props.options,
|
|
837
|
+
(val) => {
|
|
838
|
+
handleRepeatOption(val);
|
|
839
|
+
emitSetValue(val);
|
|
840
|
+
},
|
|
841
|
+
{ deep: true }
|
|
842
|
+
);
|
|
843
|
+
return (_ctx, _cache) => {
|
|
844
|
+
const _component_Delete = resolveComponent("Delete");
|
|
845
|
+
const _component_ARow = resolveComponent("ARow");
|
|
846
|
+
const _component_a_textarea = resolveComponent("a-textarea");
|
|
847
|
+
const _component_a_modal = resolveComponent("a-modal");
|
|
848
|
+
return openBlock(), createElementBlock("div", null, [
|
|
849
|
+
createVNode(unref(Draggable), {
|
|
850
|
+
tag: "transition-group",
|
|
851
|
+
"component-data": {
|
|
852
|
+
name: "flip-list"
|
|
853
|
+
},
|
|
854
|
+
animation: 200,
|
|
855
|
+
list: __props.options,
|
|
856
|
+
handle: `.${handleClass}`,
|
|
857
|
+
"force-fallback": true
|
|
858
|
+
}, {
|
|
859
|
+
item: withCtx(({ element, index }) => [
|
|
860
|
+
createElementVNode("div", _hoisted_1$d, [
|
|
861
|
+
createVNode(_component_ARow, { align: "middle" }, {
|
|
862
|
+
default: withCtx(() => [
|
|
863
|
+
createVNode(unref(HolderOutlined), {
|
|
864
|
+
class: normalizeClass([handleClass])
|
|
865
|
+
}, null, 8, ["class"]),
|
|
866
|
+
createVNode(unref(FormItemRest), null, {
|
|
867
|
+
default: withCtx(() => [
|
|
868
|
+
createVNode(unref(Input), {
|
|
869
|
+
value: element.label,
|
|
870
|
+
"onUpdate:value": ($event) => element.label = $event,
|
|
871
|
+
class: normalizeClass([
|
|
872
|
+
"bm-handle-options__input",
|
|
873
|
+
repeatOption.value.length && repeatOption.value.includes(element.value) ? "is-error" : ""
|
|
874
|
+
]),
|
|
875
|
+
onBlur: ($event) => handleBlur(element)
|
|
876
|
+
}, null, 8, ["value", "onUpdate:value", "class", "onBlur"])
|
|
877
|
+
]),
|
|
878
|
+
_: 2
|
|
879
|
+
}, 1024),
|
|
880
|
+
createVNode(_component_Delete, {
|
|
881
|
+
class: "bm-handle-options__del-icon",
|
|
882
|
+
onClick: ($event) => __props.options.splice(index, 1)
|
|
883
|
+
}, null, 8, ["onClick"])
|
|
884
|
+
]),
|
|
885
|
+
_: 2
|
|
886
|
+
}, 1024),
|
|
887
|
+
repeatOption.value.length && repeatOption.value.includes(element.value) ? (openBlock(), createElementBlock("div", _hoisted_2$b, " \u8BF7\u66F4\u6539\u91CD\u590D\u9009\u9879 ")) : createCommentVNode("v-if", true)
|
|
888
|
+
])
|
|
889
|
+
]),
|
|
890
|
+
_: 1
|
|
891
|
+
}, 8, ["list", "handle"]),
|
|
892
|
+
createVNode(unref(Button), {
|
|
893
|
+
style: { "margin-left": "24px", "margin-top": "8px" },
|
|
894
|
+
onClick: edit
|
|
895
|
+
}, {
|
|
896
|
+
icon: withCtx(() => [
|
|
897
|
+
createVNode(unref(EditOutlined))
|
|
898
|
+
]),
|
|
899
|
+
default: withCtx(() => [
|
|
900
|
+
_hoisted_3$a
|
|
901
|
+
]),
|
|
902
|
+
_: 1
|
|
903
|
+
}),
|
|
904
|
+
createVNode(unref(Button), {
|
|
905
|
+
style: { "margin-left": "8px", "margin-top": "8px" },
|
|
906
|
+
onClick: add
|
|
907
|
+
}, {
|
|
908
|
+
icon: withCtx(() => [
|
|
909
|
+
createVNode(unref(PlusOutlined))
|
|
910
|
+
]),
|
|
911
|
+
default: withCtx(() => [
|
|
912
|
+
_hoisted_4$7
|
|
913
|
+
]),
|
|
914
|
+
_: 1
|
|
915
|
+
}),
|
|
916
|
+
createVNode(_component_a_modal, {
|
|
917
|
+
visible: visible.value,
|
|
918
|
+
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visible.value = $event),
|
|
919
|
+
title: "\u9009\u9879\u6279\u91CF\u7F16\u8F91",
|
|
920
|
+
onOk: handleOk
|
|
921
|
+
}, {
|
|
922
|
+
default: withCtx(() => [
|
|
923
|
+
_hoisted_5$4,
|
|
924
|
+
createVNode(_component_a_textarea, {
|
|
925
|
+
value: text.value,
|
|
926
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => text.value = $event),
|
|
927
|
+
style: { "margin-top": "8px" },
|
|
928
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
929
|
+
"auto-size": { minRows: 8 }
|
|
930
|
+
}, null, 8, ["value"])
|
|
931
|
+
]),
|
|
932
|
+
_: 1
|
|
933
|
+
}, 8, ["visible"])
|
|
934
|
+
]);
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
var HandleOptionsCom = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "handle-options.vue"]]);
|
|
939
|
+
|
|
940
|
+
const label$d = '单选框';
|
|
941
|
+
const ruleType$1 = {
|
|
942
|
+
checkedValue: 'radio',
|
|
943
|
+
unCheckedValue: 'select',
|
|
944
|
+
};
|
|
945
|
+
const fieldsMap$d = {
|
|
946
|
+
'title.title': 'title.title',
|
|
947
|
+
'props.placeholder': 'props.placeholder',
|
|
948
|
+
options: 'options',
|
|
949
|
+
type: 'type',
|
|
950
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
951
|
+
'effect.required': 'effect.required',
|
|
952
|
+
};
|
|
953
|
+
const name$d = 'radio';
|
|
954
|
+
var radio = {
|
|
955
|
+
icon: 'RadioIcon',
|
|
956
|
+
name: name$d,
|
|
957
|
+
label: label$d,
|
|
958
|
+
rule() {
|
|
959
|
+
return {
|
|
960
|
+
type: ruleType$1.unCheckedValue,
|
|
961
|
+
field: uniqueId(),
|
|
962
|
+
title: {
|
|
963
|
+
title: label$d,
|
|
964
|
+
style: {
|
|
965
|
+
overflow: 'hidden',
|
|
966
|
+
textOverflow: 'ellipsis',
|
|
967
|
+
whiteSpace: 'nowrap',
|
|
968
|
+
},
|
|
969
|
+
},
|
|
970
|
+
effect: {
|
|
971
|
+
required: true,
|
|
972
|
+
formRule: 'formRule',
|
|
973
|
+
},
|
|
974
|
+
options: [
|
|
975
|
+
{
|
|
976
|
+
value: '选项1',
|
|
977
|
+
label: '选项1',
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
value: '选项2',
|
|
981
|
+
label: '选项2',
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
value: '选项3',
|
|
985
|
+
label: '选项3',
|
|
986
|
+
},
|
|
987
|
+
],
|
|
988
|
+
props: {
|
|
989
|
+
placeholder: '请选择',
|
|
990
|
+
},
|
|
991
|
+
config: {
|
|
992
|
+
propsFields: Object.values(fieldsMap$d),
|
|
993
|
+
},
|
|
994
|
+
};
|
|
995
|
+
},
|
|
996
|
+
props(rule, parentRule) {
|
|
997
|
+
return [
|
|
998
|
+
{
|
|
999
|
+
type: 'input',
|
|
1000
|
+
title: '标题',
|
|
1001
|
+
field: fieldsMap$d['title.title'],
|
|
1002
|
+
value: rule.title.title,
|
|
1003
|
+
effect: {
|
|
1004
|
+
required: '请输入标题',
|
|
1005
|
+
},
|
|
1006
|
+
props: {
|
|
1007
|
+
placeholder: '请输入',
|
|
1008
|
+
maxlength: 10,
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
{
|
|
1012
|
+
type: 'input',
|
|
1013
|
+
title: '提示文字',
|
|
1014
|
+
field: fieldsMap$d['props.placeholder'],
|
|
1015
|
+
props: {
|
|
1016
|
+
placeholder: '请输入',
|
|
1017
|
+
},
|
|
1018
|
+
value: rule.props.placeholder,
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
type: 'HandleOptions',
|
|
1022
|
+
component: HandleOptionsCom,
|
|
1023
|
+
title: '选项',
|
|
1024
|
+
field: fieldsMap$d['options'],
|
|
1025
|
+
props: {
|
|
1026
|
+
options: rule.options,
|
|
1027
|
+
},
|
|
1028
|
+
value: rule.options,
|
|
1029
|
+
inject: true,
|
|
1030
|
+
on: {
|
|
1031
|
+
setValue(inject, options) {
|
|
1032
|
+
const rule = inject.self;
|
|
1033
|
+
const api = inject.api;
|
|
1034
|
+
api.changeValue(rule.field, options);
|
|
1035
|
+
api.emit('change', rule.field, rule.value, rule, api, true);
|
|
1036
|
+
},
|
|
1037
|
+
},
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
hidden: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) === WidgetType.TableWidget,
|
|
1041
|
+
type: 'switch',
|
|
1042
|
+
title: '选项平铺',
|
|
1043
|
+
field: fieldsMap$d['type'],
|
|
1044
|
+
value: rule.type,
|
|
1045
|
+
props: Object.assign({}, ruleType$1),
|
|
1046
|
+
},
|
|
1047
|
+
Object.assign({ field: fieldsMap$d['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
1048
|
+
{
|
|
1049
|
+
type: 'switch',
|
|
1050
|
+
title: '是否必填',
|
|
1051
|
+
field: fieldsMap$d['effect.required'],
|
|
1052
|
+
value: rule.effect.required,
|
|
1053
|
+
},
|
|
1054
|
+
];
|
|
1055
|
+
},
|
|
1056
|
+
parse(rule) {
|
|
1057
|
+
return {
|
|
1058
|
+
name: name$d,
|
|
1059
|
+
field: rule.field,
|
|
1060
|
+
type: rule.type,
|
|
1061
|
+
title: {
|
|
1062
|
+
title: rule.title.title,
|
|
1063
|
+
},
|
|
1064
|
+
props: {
|
|
1065
|
+
placeholder: rule.props.placeholder,
|
|
1066
|
+
},
|
|
1067
|
+
options: rule.options,
|
|
1068
|
+
config: {
|
|
1069
|
+
fieldRatio: rule.config.fieldRatio,
|
|
1070
|
+
},
|
|
1071
|
+
effect: {
|
|
1072
|
+
required: rule.effect.required,
|
|
1073
|
+
},
|
|
1074
|
+
};
|
|
1075
|
+
},
|
|
1076
|
+
};
|
|
1077
|
+
|
|
1078
|
+
const label$c = '多选框';
|
|
1079
|
+
const ruleType = {
|
|
1080
|
+
checkedValue: 'checkbox',
|
|
1081
|
+
unCheckedValue: 'select',
|
|
1082
|
+
};
|
|
1083
|
+
const fieldsMap$c = {
|
|
1084
|
+
'title.title': 'title.title',
|
|
1085
|
+
'props.placeholder': 'props.placeholder',
|
|
1086
|
+
options: 'options',
|
|
1087
|
+
type: 'type',
|
|
1088
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
1089
|
+
'effect.required': 'effect.required',
|
|
1090
|
+
};
|
|
1091
|
+
const name$c = 'checkbox';
|
|
1092
|
+
var checkbox = {
|
|
1093
|
+
icon: 'CheckboxIcon',
|
|
1094
|
+
name: name$c,
|
|
1095
|
+
label: label$c,
|
|
1096
|
+
rule() {
|
|
1097
|
+
return {
|
|
1098
|
+
type: ruleType.unCheckedValue,
|
|
1099
|
+
field: uniqueId(),
|
|
1100
|
+
title: {
|
|
1101
|
+
title: label$c,
|
|
1102
|
+
style: {
|
|
1103
|
+
overflow: 'hidden',
|
|
1104
|
+
textOverflow: 'ellipsis',
|
|
1105
|
+
whiteSpace: 'nowrap',
|
|
1106
|
+
},
|
|
1107
|
+
},
|
|
1108
|
+
effect: {
|
|
1109
|
+
required: true,
|
|
1110
|
+
formRule: 'formRule',
|
|
1111
|
+
},
|
|
1112
|
+
options: [
|
|
1113
|
+
{
|
|
1114
|
+
value: '选项1',
|
|
1115
|
+
label: '选项1',
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
value: '选项2',
|
|
1119
|
+
label: '选项2',
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
value: '选项3',
|
|
1123
|
+
label: '选项3',
|
|
1124
|
+
},
|
|
1125
|
+
],
|
|
1126
|
+
props: {
|
|
1127
|
+
placeholder: '请选择',
|
|
1128
|
+
},
|
|
1129
|
+
config: {
|
|
1130
|
+
propsFields: Object.values(fieldsMap$c),
|
|
1131
|
+
},
|
|
1132
|
+
};
|
|
1133
|
+
},
|
|
1134
|
+
props(rule, parentRule) {
|
|
1135
|
+
return [
|
|
1136
|
+
{
|
|
1137
|
+
type: 'input',
|
|
1138
|
+
title: '标题',
|
|
1139
|
+
field: fieldsMap$c['title.title'],
|
|
1140
|
+
value: rule.title.title,
|
|
1141
|
+
effect: {
|
|
1142
|
+
required: '请输入标题',
|
|
1143
|
+
},
|
|
1144
|
+
props: {
|
|
1145
|
+
placeholder: '请输入',
|
|
1146
|
+
maxlength: 10,
|
|
1147
|
+
},
|
|
1148
|
+
},
|
|
1149
|
+
{
|
|
1150
|
+
type: 'input',
|
|
1151
|
+
title: '提示文字',
|
|
1152
|
+
field: fieldsMap$c['props.placeholder'],
|
|
1153
|
+
props: {
|
|
1154
|
+
placeholder: '请输入',
|
|
1155
|
+
},
|
|
1156
|
+
value: rule.props.placeholder,
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
type: 'HandleOptions',
|
|
1160
|
+
component: HandleOptionsCom,
|
|
1161
|
+
title: '选项',
|
|
1162
|
+
field: fieldsMap$c['options'],
|
|
1163
|
+
props: {
|
|
1164
|
+
options: rule.options,
|
|
1165
|
+
},
|
|
1166
|
+
value: rule.options,
|
|
1167
|
+
inject: true,
|
|
1168
|
+
on: {
|
|
1169
|
+
setValue(inject, options) {
|
|
1170
|
+
const rule = inject.self;
|
|
1171
|
+
const api = inject.api;
|
|
1172
|
+
api.changeValue(rule.field, options);
|
|
1173
|
+
api.emit('change', rule.field, rule.value, rule, api, true);
|
|
1174
|
+
},
|
|
1175
|
+
},
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
hidden: (parentRule === null || parentRule === void 0 ? void 0 : parentRule.type) === WidgetType.TableWidget,
|
|
1179
|
+
type: 'switch',
|
|
1180
|
+
title: '选项平铺',
|
|
1181
|
+
field: fieldsMap$c['type'],
|
|
1182
|
+
value: rule.type,
|
|
1183
|
+
props: Object.assign({}, ruleType),
|
|
1184
|
+
},
|
|
1185
|
+
Object.assign({ field: fieldsMap$c['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
1186
|
+
{
|
|
1187
|
+
type: 'switch',
|
|
1188
|
+
title: '是否必填',
|
|
1189
|
+
field: fieldsMap$c['effect.required'],
|
|
1190
|
+
value: rule.effect.required,
|
|
1191
|
+
},
|
|
1192
|
+
];
|
|
1193
|
+
},
|
|
1194
|
+
parse(rule) {
|
|
1195
|
+
return {
|
|
1196
|
+
name: name$c,
|
|
1197
|
+
field: rule.field,
|
|
1198
|
+
type: rule.type,
|
|
1199
|
+
title: {
|
|
1200
|
+
title: rule.title.title,
|
|
1201
|
+
},
|
|
1202
|
+
props: {
|
|
1203
|
+
placeholder: rule.props.placeholder,
|
|
1204
|
+
},
|
|
1205
|
+
options: rule.options,
|
|
1206
|
+
config: {
|
|
1207
|
+
fieldRatio: rule.config.fieldRatio,
|
|
1208
|
+
},
|
|
1209
|
+
effect: {
|
|
1210
|
+
required: rule.effect.required,
|
|
1211
|
+
},
|
|
1212
|
+
};
|
|
1213
|
+
},
|
|
1214
|
+
};
|
|
1215
|
+
|
|
1216
|
+
const _hoisted_1$c = { class: "bm-default-date" };
|
|
1217
|
+
const _hoisted_2$a = /* @__PURE__ */ createTextVNode(" \u5F53\u524D\u65F6\u95F4(\u5E74/\u6708/\u65E5) ");
|
|
1218
|
+
const _hoisted_3$9 = /* @__PURE__ */ createTextVNode(" \u83B7\u53D6\u7528\u6237\u5B9E\u9645\u586B\u5199\u65F6\u7684\u65F6\u95F4 ");
|
|
1219
|
+
const _hoisted_4$6 = /* @__PURE__ */ createTextVNode("\u81EA\u5B9A\u4E49");
|
|
1220
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1221
|
+
__name: "default-date",
|
|
1222
|
+
props: ["defaultRadioValue", "defalueDateValue"],
|
|
1223
|
+
emits: ["change"],
|
|
1224
|
+
setup(__props, { emit: emits }) {
|
|
1225
|
+
const props = __props;
|
|
1226
|
+
const radioValue = ref(props.defaultRadioValue);
|
|
1227
|
+
const dateValue = ref(props.defalueDateValue);
|
|
1228
|
+
function emitChange(dateValue2) {
|
|
1229
|
+
emits("change", radioValue.value, dateValue2);
|
|
1230
|
+
}
|
|
1231
|
+
function handleRadioChange(evt) {
|
|
1232
|
+
radioValue.value = evt.target.value;
|
|
1233
|
+
dateValue.value = "";
|
|
1234
|
+
emitChange("");
|
|
1235
|
+
}
|
|
1236
|
+
function handleDateChange(date) {
|
|
1237
|
+
dateValue.value = date;
|
|
1238
|
+
emitChange(date);
|
|
1239
|
+
}
|
|
1240
|
+
return (_ctx, _cache) => {
|
|
1241
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1242
|
+
createVNode(unref(FormItemRest), null, {
|
|
1243
|
+
default: withCtx(() => [
|
|
1244
|
+
createVNode(unref(RadioGroup), {
|
|
1245
|
+
value: radioValue.value,
|
|
1246
|
+
onChange: handleRadioChange
|
|
1247
|
+
}, {
|
|
1248
|
+
default: withCtx(() => [
|
|
1249
|
+
createVNode(unref(Radio), { value: 0 }, {
|
|
1250
|
+
default: withCtx(() => [
|
|
1251
|
+
_hoisted_2$a,
|
|
1252
|
+
createVNode(unref(Tooltip), null, {
|
|
1253
|
+
title: withCtx(() => [
|
|
1254
|
+
_hoisted_3$9
|
|
1255
|
+
]),
|
|
1256
|
+
default: withCtx(() => [
|
|
1257
|
+
createVNode(unref(QuestionCircleOutlined), { style: { "color": "#babac1" } })
|
|
1258
|
+
]),
|
|
1259
|
+
_: 1
|
|
1260
|
+
})
|
|
1261
|
+
]),
|
|
1262
|
+
_: 1
|
|
1263
|
+
}),
|
|
1264
|
+
createVNode(unref(Radio), { value: 1 }, {
|
|
1265
|
+
default: withCtx(() => [
|
|
1266
|
+
_hoisted_4$6
|
|
1267
|
+
]),
|
|
1268
|
+
_: 1
|
|
1269
|
+
})
|
|
1270
|
+
]),
|
|
1271
|
+
_: 1
|
|
1272
|
+
}, 8, ["value"]),
|
|
1273
|
+
radioValue.value === 1 ? (openBlock(), createBlock(unref(DatePicker), {
|
|
1274
|
+
key: 0,
|
|
1275
|
+
style: { width: "100%", marginTop: "8px" },
|
|
1276
|
+
value: dateValue.value,
|
|
1277
|
+
format: "YYYY-MM-DD",
|
|
1278
|
+
"value-format": "YYYY-MM-DD",
|
|
1279
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
1280
|
+
onChange: handleDateChange
|
|
1281
|
+
}, null, 8, ["value"])) : createCommentVNode("v-if", true)
|
|
1282
|
+
]),
|
|
1283
|
+
_: 1
|
|
1284
|
+
})
|
|
1285
|
+
]);
|
|
1286
|
+
};
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
var DefaultDate = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "default-date.vue"]]);
|
|
1290
|
+
|
|
1291
|
+
const label$b = '日期';
|
|
1292
|
+
const fieldsMap$b = {
|
|
1293
|
+
'title.title': 'title.title',
|
|
1294
|
+
'props.format': 'props.format',
|
|
1295
|
+
'props.placeholder': 'props.placeholder',
|
|
1296
|
+
value: 'value',
|
|
1297
|
+
'config.defaultValue': 'config.defaultValue',
|
|
1298
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
1299
|
+
'effect.required': 'effect.required',
|
|
1300
|
+
};
|
|
1301
|
+
const name$b = 'date';
|
|
1302
|
+
var date = {
|
|
1303
|
+
icon: 'Date',
|
|
1304
|
+
name: name$b,
|
|
1305
|
+
label: label$b,
|
|
1306
|
+
rule() {
|
|
1307
|
+
return {
|
|
1308
|
+
type: 'datePicker',
|
|
1309
|
+
field: uniqueId(),
|
|
1310
|
+
title: {
|
|
1311
|
+
title: label$b,
|
|
1312
|
+
style: {
|
|
1313
|
+
overflow: 'hidden',
|
|
1314
|
+
textOverflow: 'ellipsis',
|
|
1315
|
+
whiteSpace: 'nowrap',
|
|
1316
|
+
},
|
|
1317
|
+
},
|
|
1318
|
+
effect: {
|
|
1319
|
+
required: true,
|
|
1320
|
+
formRule: 'formRule',
|
|
1321
|
+
},
|
|
1322
|
+
props: {
|
|
1323
|
+
placeholder: '请选择',
|
|
1324
|
+
format: 'YYYY-MM',
|
|
1325
|
+
},
|
|
1326
|
+
config: {
|
|
1327
|
+
propsFields: Object.values(fieldsMap$b),
|
|
1328
|
+
defaultValue: 1,
|
|
1329
|
+
},
|
|
1330
|
+
style: {
|
|
1331
|
+
width: '100%',
|
|
1332
|
+
},
|
|
1333
|
+
};
|
|
1334
|
+
},
|
|
1335
|
+
props(rule, parentRule) {
|
|
1336
|
+
return [
|
|
1337
|
+
{
|
|
1338
|
+
type: 'input',
|
|
1339
|
+
title: '标题',
|
|
1340
|
+
field: fieldsMap$b['title.title'],
|
|
1341
|
+
value: rule.title.title,
|
|
1342
|
+
effect: {
|
|
1343
|
+
required: '请输入标题',
|
|
1344
|
+
},
|
|
1345
|
+
props: {
|
|
1346
|
+
placeholder: '请输入',
|
|
1347
|
+
maxlength: 10,
|
|
1348
|
+
},
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
type: 'select',
|
|
1352
|
+
title: '日期类型',
|
|
1353
|
+
field: fieldsMap$b['props.format'],
|
|
1354
|
+
effect: {
|
|
1355
|
+
required: '请选择日期类型',
|
|
1356
|
+
},
|
|
1357
|
+
props: {
|
|
1358
|
+
placeholder: '请选择',
|
|
1359
|
+
},
|
|
1360
|
+
options: [
|
|
1361
|
+
{
|
|
1362
|
+
value: 'YYYY-MM',
|
|
1363
|
+
label: '年-月',
|
|
1364
|
+
},
|
|
1365
|
+
{
|
|
1366
|
+
value: 'YYYY-MM-DD',
|
|
1367
|
+
label: '年-月-日',
|
|
1368
|
+
},
|
|
1369
|
+
{
|
|
1370
|
+
value: 'YYYY-MM-DD HH:mm',
|
|
1371
|
+
label: '年-月-日 时:分',
|
|
1372
|
+
},
|
|
1373
|
+
],
|
|
1374
|
+
value: rule.props.format,
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
type: 'input',
|
|
1378
|
+
title: '提示文字',
|
|
1379
|
+
field: fieldsMap$b['props.placeholder'],
|
|
1380
|
+
props: {
|
|
1381
|
+
placeholder: '请输入',
|
|
1382
|
+
},
|
|
1383
|
+
value: rule.props.placeholder,
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
type: 'DefaultDate',
|
|
1387
|
+
component: DefaultDate,
|
|
1388
|
+
title: '默认值',
|
|
1389
|
+
field: fieldsMap$b['config.defaultValue'],
|
|
1390
|
+
props: {
|
|
1391
|
+
defaultRadioValue: rule.config.defaultValue,
|
|
1392
|
+
defalueDateValue: rule.value,
|
|
1393
|
+
},
|
|
1394
|
+
inject: true,
|
|
1395
|
+
on: {
|
|
1396
|
+
change({ api, self }, radioValue, dateValue) {
|
|
1397
|
+
self.props.defaultRadioValue = radioValue;
|
|
1398
|
+
self.props.defalueDateValue = dateValue;
|
|
1399
|
+
api.emit('change', 'config.defaultValue', radioValue, self, api, true);
|
|
1400
|
+
api.emit('change', 'value', dateValue, self, api, true);
|
|
1401
|
+
},
|
|
1402
|
+
},
|
|
1403
|
+
},
|
|
1404
|
+
Object.assign({ field: fieldsMap$b['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
1405
|
+
{
|
|
1406
|
+
type: 'switch',
|
|
1407
|
+
title: '是否必填',
|
|
1408
|
+
field: fieldsMap$b['effect.required'],
|
|
1409
|
+
value: rule.effect.required,
|
|
1410
|
+
},
|
|
1411
|
+
];
|
|
1412
|
+
},
|
|
1413
|
+
parse(rule) {
|
|
1414
|
+
return {
|
|
1415
|
+
name: name$b,
|
|
1416
|
+
field: rule.field,
|
|
1417
|
+
title: {
|
|
1418
|
+
title: rule.title.title,
|
|
1419
|
+
},
|
|
1420
|
+
props: {
|
|
1421
|
+
format: rule.props.format,
|
|
1422
|
+
placeholder: rule.props.placeholder,
|
|
1423
|
+
},
|
|
1424
|
+
value: rule.value,
|
|
1425
|
+
config: {
|
|
1426
|
+
defaultValue: rule.config.defaultValue,
|
|
1427
|
+
fieldRatio: rule.config.fieldRatio,
|
|
1428
|
+
},
|
|
1429
|
+
effect: {
|
|
1430
|
+
required: rule.effect.required,
|
|
1431
|
+
},
|
|
1432
|
+
};
|
|
1433
|
+
},
|
|
1434
|
+
};
|
|
1435
|
+
|
|
1436
|
+
const label$a = '日期区间';
|
|
1437
|
+
const fieldsMap$a = {
|
|
1438
|
+
'title.title': 'title.title',
|
|
1439
|
+
'props.format': 'props.format',
|
|
1440
|
+
'props.placeholder.0': 'props.placeholder.0',
|
|
1441
|
+
'props.placeholder.1': 'props.placeholder.1',
|
|
1442
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
1443
|
+
'effect.required': 'effect.required',
|
|
1444
|
+
};
|
|
1445
|
+
const name$a = 'dateRange';
|
|
1446
|
+
var dateRange = {
|
|
1447
|
+
icon: 'DateRange',
|
|
1448
|
+
name: name$a,
|
|
1449
|
+
label: label$a,
|
|
1450
|
+
rule() {
|
|
1451
|
+
return {
|
|
1452
|
+
type: 'datePicker',
|
|
1453
|
+
field: uniqueId(),
|
|
1454
|
+
title: {
|
|
1455
|
+
title: label$a,
|
|
1456
|
+
style: {
|
|
1457
|
+
overflow: 'hidden',
|
|
1458
|
+
textOverflow: 'ellipsis',
|
|
1459
|
+
whiteSpace: 'nowrap',
|
|
1460
|
+
},
|
|
1461
|
+
},
|
|
1462
|
+
effect: {
|
|
1463
|
+
required: true,
|
|
1464
|
+
formRule: 'formRule',
|
|
1465
|
+
},
|
|
1466
|
+
props: {
|
|
1467
|
+
range: true,
|
|
1468
|
+
placeholder: ['开始日期', '结束日期'],
|
|
1469
|
+
format: 'YYYY-MM',
|
|
1470
|
+
separator: '~',
|
|
1471
|
+
},
|
|
1472
|
+
config: {
|
|
1473
|
+
propsFields: Object.values(fieldsMap$a),
|
|
1474
|
+
defaultValue: 1,
|
|
1475
|
+
},
|
|
1476
|
+
style: {
|
|
1477
|
+
width: '100%',
|
|
1478
|
+
},
|
|
1479
|
+
};
|
|
1480
|
+
},
|
|
1481
|
+
props(rule, parentRule) {
|
|
1482
|
+
return [
|
|
1483
|
+
{
|
|
1484
|
+
type: 'input',
|
|
1485
|
+
title: '标题',
|
|
1486
|
+
field: fieldsMap$a['title.title'],
|
|
1487
|
+
value: rule.title.title,
|
|
1488
|
+
effect: {
|
|
1489
|
+
required: '请输入标题',
|
|
1490
|
+
},
|
|
1491
|
+
props: {
|
|
1492
|
+
placeholder: '请输入',
|
|
1493
|
+
maxlength: 10,
|
|
1494
|
+
},
|
|
1495
|
+
},
|
|
1496
|
+
{
|
|
1497
|
+
type: 'select',
|
|
1498
|
+
title: '日期类型',
|
|
1499
|
+
field: fieldsMap$a['props.format'],
|
|
1500
|
+
effect: {
|
|
1501
|
+
required: '请选择日期类型',
|
|
1502
|
+
},
|
|
1503
|
+
props: {
|
|
1504
|
+
placeholder: '请选择',
|
|
1505
|
+
},
|
|
1506
|
+
options: [
|
|
1507
|
+
{
|
|
1508
|
+
value: 'YYYY-MM',
|
|
1509
|
+
label: '年-月',
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
value: 'YYYY-MM-DD',
|
|
1513
|
+
label: '年-月-日',
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
value: 'YYYY-MM-DD HH:mm',
|
|
1517
|
+
label: '年-月-日 时:分',
|
|
1518
|
+
},
|
|
1519
|
+
],
|
|
1520
|
+
value: rule.props.format,
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
type: 'input',
|
|
1524
|
+
title: '提示文字1',
|
|
1525
|
+
field: fieldsMap$a['props.placeholder.0'],
|
|
1526
|
+
props: {
|
|
1527
|
+
placeholder: '请输入',
|
|
1528
|
+
},
|
|
1529
|
+
value: rule.props.placeholder[0],
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
type: 'input',
|
|
1533
|
+
title: '提示文字2',
|
|
1534
|
+
field: fieldsMap$a['props.placeholder.1'],
|
|
1535
|
+
props: {
|
|
1536
|
+
placeholder: '请输入',
|
|
1537
|
+
},
|
|
1538
|
+
value: rule.props.placeholder[1],
|
|
1539
|
+
},
|
|
1540
|
+
Object.assign({ field: fieldsMap$a['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
1541
|
+
{
|
|
1542
|
+
type: 'switch',
|
|
1543
|
+
title: '是否必填',
|
|
1544
|
+
field: fieldsMap$a['effect.required'],
|
|
1545
|
+
value: rule.effect.required,
|
|
1546
|
+
},
|
|
1547
|
+
];
|
|
1548
|
+
},
|
|
1549
|
+
parse(rule) {
|
|
1550
|
+
return {
|
|
1551
|
+
name: name$a,
|
|
1552
|
+
field: rule.field,
|
|
1553
|
+
title: {
|
|
1554
|
+
title: rule.title.title,
|
|
1555
|
+
},
|
|
1556
|
+
props: {
|
|
1557
|
+
format: rule.props.format,
|
|
1558
|
+
placeholder: rule.props.placeholder,
|
|
1559
|
+
},
|
|
1560
|
+
config: {
|
|
1561
|
+
fieldRatio: rule.config.fieldRatio,
|
|
1562
|
+
},
|
|
1563
|
+
effect: {
|
|
1564
|
+
required: rule.effect.required,
|
|
1565
|
+
},
|
|
1566
|
+
};
|
|
1567
|
+
},
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
const label$9 = '说明文字';
|
|
1571
|
+
const fieldsMap$9 = {
|
|
1572
|
+
value: 'value',
|
|
1573
|
+
'style.color': 'style.color',
|
|
1574
|
+
};
|
|
1575
|
+
const name$9 = 'instruction';
|
|
1576
|
+
var Colors;
|
|
1577
|
+
(function (Colors) {
|
|
1578
|
+
Colors["Black"] = "#242633";
|
|
1579
|
+
Colors["Blue"] = "#2F4EED";
|
|
1580
|
+
})(Colors || (Colors = {}));
|
|
1581
|
+
var instruction = {
|
|
1582
|
+
icon: 'Instruction',
|
|
1583
|
+
name: name$9,
|
|
1584
|
+
label: label$9,
|
|
1585
|
+
rule() {
|
|
1586
|
+
return {
|
|
1587
|
+
field: uniqueId(),
|
|
1588
|
+
config: {
|
|
1589
|
+
propsFields: Object.values(fieldsMap$9),
|
|
1590
|
+
},
|
|
1591
|
+
style: {
|
|
1592
|
+
color: Colors.Black,
|
|
1593
|
+
},
|
|
1594
|
+
value: '请输入说明文字',
|
|
1595
|
+
};
|
|
1596
|
+
},
|
|
1597
|
+
props(rule, parentRule) {
|
|
1598
|
+
return [
|
|
1599
|
+
{
|
|
1600
|
+
type: 'input',
|
|
1601
|
+
props: {
|
|
1602
|
+
type: 'textarea',
|
|
1603
|
+
autoSize: {
|
|
1604
|
+
minRows: 5,
|
|
1605
|
+
},
|
|
1606
|
+
},
|
|
1607
|
+
title: label$9,
|
|
1608
|
+
field: fieldsMap$9.value,
|
|
1609
|
+
value: rule.value,
|
|
1610
|
+
prefix: {
|
|
1611
|
+
type: 'TextColor',
|
|
1612
|
+
props: {
|
|
1613
|
+
rule,
|
|
1614
|
+
},
|
|
1615
|
+
},
|
|
1616
|
+
},
|
|
1617
|
+
];
|
|
1618
|
+
},
|
|
1619
|
+
parse(rule) {
|
|
1620
|
+
return {
|
|
1621
|
+
name: name$9,
|
|
1622
|
+
field: rule.field,
|
|
1623
|
+
value: rule.value,
|
|
1624
|
+
style: {
|
|
1625
|
+
color: rule.style.color,
|
|
1626
|
+
},
|
|
1627
|
+
};
|
|
1628
|
+
},
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1631
|
+
const label$8 = '图片';
|
|
1632
|
+
const fieldsMap$8 = {
|
|
1633
|
+
'title.title': 'title.title',
|
|
1634
|
+
'props.extraProps.maxCount': 'props.extraProps.maxCount',
|
|
1635
|
+
'effect.required': 'effect.required',
|
|
1636
|
+
};
|
|
1637
|
+
const name$8 = 'picture';
|
|
1638
|
+
var picture = {
|
|
1639
|
+
icon: 'Picture',
|
|
1640
|
+
name: name$8,
|
|
1641
|
+
label: label$8,
|
|
1642
|
+
rule() {
|
|
1643
|
+
return {
|
|
1644
|
+
type: 'UploadPicture',
|
|
1645
|
+
component: BmUpload,
|
|
1646
|
+
field: uniqueId(),
|
|
1647
|
+
title: {
|
|
1648
|
+
title: label$8,
|
|
1649
|
+
style: {
|
|
1650
|
+
overflow: 'hidden',
|
|
1651
|
+
textOverflow: 'ellipsis',
|
|
1652
|
+
whiteSpace: 'nowrap',
|
|
1653
|
+
},
|
|
1654
|
+
},
|
|
1655
|
+
effect: {
|
|
1656
|
+
required: true,
|
|
1657
|
+
formRule: 'formRule',
|
|
1658
|
+
},
|
|
1659
|
+
props: {
|
|
1660
|
+
uploadProps: {
|
|
1661
|
+
listType: 'picture-card',
|
|
1662
|
+
text: '请选择',
|
|
1663
|
+
},
|
|
1664
|
+
extraProps: {
|
|
1665
|
+
maxCount: 9,
|
|
1666
|
+
},
|
|
1667
|
+
},
|
|
1668
|
+
config: {
|
|
1669
|
+
propsFields: Object.values(fieldsMap$8),
|
|
1670
|
+
},
|
|
1671
|
+
};
|
|
1672
|
+
},
|
|
1673
|
+
props(rule, parentRule) {
|
|
1674
|
+
return [
|
|
1675
|
+
{
|
|
1676
|
+
type: 'input',
|
|
1677
|
+
title: '标题',
|
|
1678
|
+
field: fieldsMap$8['title.title'],
|
|
1679
|
+
value: rule.title.title,
|
|
1680
|
+
effect: {
|
|
1681
|
+
required: '请输入标题',
|
|
1682
|
+
},
|
|
1683
|
+
props: {
|
|
1684
|
+
placeholder: '请输入',
|
|
1685
|
+
maxlength: 10,
|
|
1686
|
+
},
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
type: 'radio',
|
|
1690
|
+
field: 'props.extraProps.maxCount',
|
|
1691
|
+
title: '图片上传限制',
|
|
1692
|
+
info: '单张图片的大小需在10M以内',
|
|
1693
|
+
options: [
|
|
1694
|
+
{
|
|
1695
|
+
label: '最多可上传9张',
|
|
1696
|
+
value: 9,
|
|
1697
|
+
},
|
|
1698
|
+
{
|
|
1699
|
+
label: '仅允许上传1张图片',
|
|
1700
|
+
value: 1,
|
|
1701
|
+
},
|
|
1702
|
+
],
|
|
1703
|
+
value: rule.props.extraProps.maxCount,
|
|
1704
|
+
className: 'form-designer-props-radio-label',
|
|
1705
|
+
inject: true,
|
|
1706
|
+
on: {
|
|
1707
|
+
change({ api, self }, { target }) {
|
|
1708
|
+
const value = target.value;
|
|
1709
|
+
self.value = value;
|
|
1710
|
+
api.emit('change', self.field, value, self, api, true);
|
|
1711
|
+
},
|
|
1712
|
+
},
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
type: 'switch',
|
|
1716
|
+
title: '是否必填',
|
|
1717
|
+
field: fieldsMap$8['effect.required'],
|
|
1718
|
+
value: rule.effect.required,
|
|
1719
|
+
},
|
|
1720
|
+
];
|
|
1721
|
+
},
|
|
1722
|
+
parse(rule) {
|
|
1723
|
+
return {
|
|
1724
|
+
name: name$8,
|
|
1725
|
+
field: rule.field,
|
|
1726
|
+
title: {
|
|
1727
|
+
title: rule.title.title,
|
|
1728
|
+
},
|
|
1729
|
+
props: {
|
|
1730
|
+
extraProps: {
|
|
1731
|
+
maxCount: rule.props.extraProps.maxCount,
|
|
1732
|
+
},
|
|
1733
|
+
},
|
|
1734
|
+
effect: {
|
|
1735
|
+
required: rule.effect.required,
|
|
1736
|
+
},
|
|
1737
|
+
};
|
|
1738
|
+
},
|
|
1739
|
+
};
|
|
1740
|
+
|
|
1741
|
+
const _hoisted_1$b = { class: "bm-widget-table-wrap" };
|
|
1742
|
+
const _hoisted_2$9 = { class: "bm-widget-table-top-bar" };
|
|
1743
|
+
const _hoisted_3$8 = /* @__PURE__ */ createTextVNode(" \u65B0\u589E ");
|
|
1744
|
+
const _hoisted_4$5 = /* @__PURE__ */ createTextVNode(" \u6279\u91CF\u5220\u9664 ");
|
|
1745
|
+
const _hoisted_5$3 = /* @__PURE__ */ createTextVNode(" \u6279\u91CF\u5BFC\u5165 ");
|
|
1746
|
+
const _hoisted_6$3 = /* @__PURE__ */ createTextVNode(" \u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F ");
|
|
1747
|
+
const _hoisted_7$2 = { class: "bm-widget-table-outer" };
|
|
1748
|
+
const _hoisted_8$2 = { class: "bm-widget-table" };
|
|
1749
|
+
const _hoisted_9$1 = {
|
|
1750
|
+
key: 0,
|
|
1751
|
+
class: "bm-widget-table__virtual"
|
|
1752
|
+
};
|
|
1753
|
+
const _hoisted_10 = /* @__PURE__ */ createElementVNode("div", { class: "bm-widget-table__virtual__head" }, null, -1);
|
|
1754
|
+
const _hoisted_11 = /* @__PURE__ */ createElementVNode("div", { class: "bm-widget-table__virtual__content" }, null, -1);
|
|
1755
|
+
const _hoisted_12 = [
|
|
1756
|
+
_hoisted_10,
|
|
1757
|
+
_hoisted_11
|
|
1758
|
+
];
|
|
1759
|
+
const _hoisted_13 = {
|
|
1760
|
+
key: 1,
|
|
1761
|
+
class: "bm-widget-table__tip"
|
|
1762
|
+
};
|
|
1763
|
+
const _hoisted_14 = {
|
|
1764
|
+
key: 0,
|
|
1765
|
+
class: "bm-widget-table__checkbox"
|
|
1766
|
+
};
|
|
1767
|
+
const _hoisted_15 = { class: "bm-widget-table__checkbox__head" };
|
|
1768
|
+
const _hoisted_16 = { class: "bm-widget-table__checkbox__content" };
|
|
1769
|
+
const _hoisted_17 = { class: "bm-widget-table__operateColumn" };
|
|
1770
|
+
const _hoisted_18 = /* @__PURE__ */ createElementVNode("div", { class: "bm-widget-table__operateColumn__head" }, "\u64CD\u4F5C", -1);
|
|
1771
|
+
const _hoisted_19 = { class: "bm-widget-table__operateColumn__content" };
|
|
1772
|
+
const _hoisted_20 = /* @__PURE__ */ createElementVNode("a", null, "\u590D\u5236", -1);
|
|
1773
|
+
const _hoisted_21 = /* @__PURE__ */ createElementVNode("span", null, null, -1);
|
|
1774
|
+
const _hoisted_22 = /* @__PURE__ */ createElementVNode("a", null, "\u5220\u9664", -1);
|
|
1775
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1776
|
+
__name: "widget-table",
|
|
1777
|
+
props: ["formCreateInject", "activeRule"],
|
|
1778
|
+
emits: [
|
|
1779
|
+
"add",
|
|
1780
|
+
"mouseenter",
|
|
1781
|
+
"mouseleave",
|
|
1782
|
+
"set-active-rule",
|
|
1783
|
+
"copy",
|
|
1784
|
+
"delete"
|
|
1785
|
+
],
|
|
1786
|
+
setup(__props, { emit: emits }) {
|
|
1787
|
+
const props = __props;
|
|
1788
|
+
const rule = computed(() => props.formCreateInject.rule);
|
|
1789
|
+
const childRules = computed(() => rule.value.config.childRules);
|
|
1790
|
+
const showDelete = computed(() => showFeature("delete"));
|
|
1791
|
+
const showImport = computed(() => showFeature("import"));
|
|
1792
|
+
const showCopy = computed(() => showFeature("copy"));
|
|
1793
|
+
function showFeature(featureId) {
|
|
1794
|
+
return rule.value.config.tableAdvancedFeatures.includes(featureId);
|
|
1795
|
+
}
|
|
1796
|
+
function handleAdd({ newIndex }) {
|
|
1797
|
+
emits("add", childRules.value[newIndex]);
|
|
1798
|
+
}
|
|
1799
|
+
function handleMouseenter() {
|
|
1800
|
+
emits("mouseenter");
|
|
1801
|
+
}
|
|
1802
|
+
function handleMouseleave() {
|
|
1803
|
+
emits("mouseleave");
|
|
1804
|
+
}
|
|
1805
|
+
function emitSetActiveRuleEvt(rule2) {
|
|
1806
|
+
emits("set-active-rule", rule2);
|
|
1807
|
+
}
|
|
1808
|
+
function handleClick(element) {
|
|
1809
|
+
emitSetActiveRuleEvt(element);
|
|
1810
|
+
}
|
|
1811
|
+
function handleUpdate({ newIndex }) {
|
|
1812
|
+
emitSetActiveRuleEvt(childRules.value[newIndex]);
|
|
1813
|
+
}
|
|
1814
|
+
function handleCopy(rule2) {
|
|
1815
|
+
emits("copy", rule2);
|
|
1816
|
+
}
|
|
1817
|
+
function handleDelete(rule2) {
|
|
1818
|
+
emits("delete", rule2);
|
|
1819
|
+
}
|
|
1820
|
+
return (_ctx, _cache) => {
|
|
1821
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1822
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
1823
|
+
createVNode(unref(Button), { type: "primary" }, {
|
|
1824
|
+
icon: withCtx(() => [
|
|
1825
|
+
createVNode(unref(PlusOutlined))
|
|
1826
|
+
]),
|
|
1827
|
+
default: withCtx(() => [
|
|
1828
|
+
_hoisted_3$8
|
|
1829
|
+
]),
|
|
1830
|
+
_: 1
|
|
1831
|
+
}),
|
|
1832
|
+
unref(showDelete) ? (openBlock(), createBlock(unref(Button), { key: 0 }, {
|
|
1833
|
+
default: withCtx(() => [
|
|
1834
|
+
_hoisted_4$5
|
|
1835
|
+
]),
|
|
1836
|
+
_: 1
|
|
1837
|
+
})) : createCommentVNode("v-if", true),
|
|
1838
|
+
unref(showImport) ? (openBlock(), createBlock(unref(Button), { key: 1 }, {
|
|
1839
|
+
default: withCtx(() => [
|
|
1840
|
+
_hoisted_5$3
|
|
1841
|
+
]),
|
|
1842
|
+
_: 1
|
|
1843
|
+
})) : createCommentVNode("v-if", true),
|
|
1844
|
+
unref(showImport) ? (openBlock(), createBlock(unref(Button), { key: 2 }, {
|
|
1845
|
+
default: withCtx(() => [
|
|
1846
|
+
_hoisted_6$3
|
|
1847
|
+
]),
|
|
1848
|
+
_: 1
|
|
1849
|
+
})) : createCommentVNode("v-if", true)
|
|
1850
|
+
]),
|
|
1851
|
+
createElementVNode("div", _hoisted_7$2, [
|
|
1852
|
+
createElementVNode("div", {
|
|
1853
|
+
class: "bm-widget-table-inner",
|
|
1854
|
+
style: normalizeStyle({
|
|
1855
|
+
paddingLeft: unref(showDelete) ? "32px" : 0,
|
|
1856
|
+
paddingRight: unref(showCopy) ? "81px" : "60px"
|
|
1857
|
+
})
|
|
1858
|
+
}, [
|
|
1859
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
1860
|
+
unref(childRules).length ? (openBlock(), createElementBlock("div", _hoisted_9$1, _hoisted_12)) : (openBlock(), createElementBlock("div", _hoisted_13, "\u53EF\u62D6\u5165\u591A\u4E2A\u63A7\u4EF6")),
|
|
1861
|
+
createVNode(unref(Draggable), {
|
|
1862
|
+
"component-data": {
|
|
1863
|
+
field: unref(rule).field,
|
|
1864
|
+
type: unref(WidgetType).TableWidget
|
|
1865
|
+
},
|
|
1866
|
+
class: "bm-widget-table__drag-content",
|
|
1867
|
+
group: {
|
|
1868
|
+
name: "tableWidget",
|
|
1869
|
+
pull: true,
|
|
1870
|
+
put: ["widget", "tableWidget"]
|
|
1871
|
+
},
|
|
1872
|
+
list: unref(childRules),
|
|
1873
|
+
"ghost-class": unref(childRules).length ? "table-drag-ghost" : "table-drag-ghost__is-empty",
|
|
1874
|
+
"item-key": "field",
|
|
1875
|
+
direction: "vertical",
|
|
1876
|
+
"force-fallback": true,
|
|
1877
|
+
"scroll-sensitivity": 100,
|
|
1878
|
+
delay: 50,
|
|
1879
|
+
onAdd: handleAdd,
|
|
1880
|
+
onUpdate: handleUpdate
|
|
1881
|
+
}, {
|
|
1882
|
+
item: withCtx(({ element }) => [
|
|
1883
|
+
createElementVNode("div", {
|
|
1884
|
+
class: "bm-widget-table__drag-item",
|
|
1885
|
+
style: normalizeStyle({ width: element.config.fieldRatio })
|
|
1886
|
+
}, [
|
|
1887
|
+
createVNode(DragTool, {
|
|
1888
|
+
rule: element,
|
|
1889
|
+
"active-rule": __props.activeRule,
|
|
1890
|
+
"parent-rule": __props.formCreateInject.rule,
|
|
1891
|
+
onMouseenter: handleMouseenter,
|
|
1892
|
+
onMouseleave: handleMouseleave,
|
|
1893
|
+
onClick: withModifiers(($event) => handleClick(element), ["stop"]),
|
|
1894
|
+
onCopy: handleCopy,
|
|
1895
|
+
onDelete: handleDelete
|
|
1896
|
+
}, null, 8, ["rule", "active-rule", "parent-rule", "onClick"]),
|
|
1897
|
+
createVNode(DragPlaceholder)
|
|
1898
|
+
], 4)
|
|
1899
|
+
]),
|
|
1900
|
+
_: 1
|
|
1901
|
+
}, 8, ["component-data", "list", "ghost-class"])
|
|
1902
|
+
])
|
|
1903
|
+
], 4),
|
|
1904
|
+
unref(showDelete) ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
1905
|
+
createElementVNode("div", _hoisted_15, [
|
|
1906
|
+
createVNode(unref(FormItemRest), null, {
|
|
1907
|
+
default: withCtx(() => [
|
|
1908
|
+
createVNode(unref(Checkbox))
|
|
1909
|
+
]),
|
|
1910
|
+
_: 1
|
|
1911
|
+
})
|
|
1912
|
+
]),
|
|
1913
|
+
createElementVNode("div", _hoisted_16, [
|
|
1914
|
+
createVNode(unref(FormItemRest), null, {
|
|
1915
|
+
default: withCtx(() => [
|
|
1916
|
+
createVNode(unref(Checkbox))
|
|
1917
|
+
]),
|
|
1918
|
+
_: 1
|
|
1919
|
+
})
|
|
1920
|
+
])
|
|
1921
|
+
])) : createCommentVNode("v-if", true),
|
|
1922
|
+
createElementVNode("div", _hoisted_17, [
|
|
1923
|
+
_hoisted_18,
|
|
1924
|
+
createElementVNode("div", _hoisted_19, [
|
|
1925
|
+
unref(showCopy) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1926
|
+
_hoisted_20,
|
|
1927
|
+
_hoisted_21
|
|
1928
|
+
], 64)) : createCommentVNode("v-if", true),
|
|
1929
|
+
_hoisted_22
|
|
1930
|
+
])
|
|
1931
|
+
])
|
|
1932
|
+
])
|
|
1933
|
+
]);
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
});
|
|
1937
|
+
var WidgetTable = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "widget-table.vue"]]);
|
|
1938
|
+
|
|
1939
|
+
const label$7 = '表格';
|
|
1940
|
+
const fieldsMap$7 = {
|
|
1941
|
+
'title.title': 'title.title',
|
|
1942
|
+
'config.childRules': 'config.childRules',
|
|
1943
|
+
'config.tableAdvancedFeatures': 'config.tableAdvancedFeatures',
|
|
1944
|
+
};
|
|
1945
|
+
const name$7 = 'table';
|
|
1946
|
+
var table = {
|
|
1947
|
+
icon: 'Table',
|
|
1948
|
+
name: name$7,
|
|
1949
|
+
label: label$7,
|
|
1950
|
+
rule() {
|
|
1951
|
+
const childRules = [];
|
|
1952
|
+
return {
|
|
1953
|
+
type: WidgetType.TableWidget,
|
|
1954
|
+
component: WidgetTable,
|
|
1955
|
+
field: uniqueId(),
|
|
1956
|
+
title: {
|
|
1957
|
+
type: 'TableHeadCount',
|
|
1958
|
+
title: label$7,
|
|
1959
|
+
props: {
|
|
1960
|
+
childRules,
|
|
1961
|
+
},
|
|
1962
|
+
style: {
|
|
1963
|
+
overflow: 'hidden',
|
|
1964
|
+
textOverflow: 'ellipsis',
|
|
1965
|
+
whiteSpace: 'nowrap',
|
|
1966
|
+
},
|
|
1967
|
+
},
|
|
1968
|
+
effect: {
|
|
1969
|
+
formRule: 'formRule',
|
|
1970
|
+
},
|
|
1971
|
+
config: {
|
|
1972
|
+
childRules,
|
|
1973
|
+
tableAdvancedFeatures: ['copy', 'delete', 'import'],
|
|
1974
|
+
propsFields: Object.values(fieldsMap$7),
|
|
1975
|
+
},
|
|
1976
|
+
emit: [
|
|
1977
|
+
'mouseenter',
|
|
1978
|
+
'mouseleave',
|
|
1979
|
+
'set-active-rule',
|
|
1980
|
+
'copy',
|
|
1981
|
+
'delete',
|
|
1982
|
+
'add',
|
|
1983
|
+
],
|
|
1984
|
+
emitPrefix: 'nest',
|
|
1985
|
+
};
|
|
1986
|
+
},
|
|
1987
|
+
props(rule) {
|
|
1988
|
+
return [
|
|
1989
|
+
{
|
|
1990
|
+
type: 'input',
|
|
1991
|
+
title: '标题',
|
|
1992
|
+
field: fieldsMap$7['title.title'],
|
|
1993
|
+
value: rule.title.title,
|
|
1994
|
+
effect: {
|
|
1995
|
+
required: '请输入标题',
|
|
1996
|
+
},
|
|
1997
|
+
props: {
|
|
1998
|
+
placeholder: '请输入',
|
|
1999
|
+
maxlength: 10,
|
|
2000
|
+
},
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
type: 'TableColumn',
|
|
2004
|
+
title: '子字段设置',
|
|
2005
|
+
field: fieldsMap$7['config.childRules'],
|
|
2006
|
+
effect: {
|
|
2007
|
+
required: true,
|
|
2008
|
+
},
|
|
2009
|
+
value: rule.config.childRules,
|
|
2010
|
+
},
|
|
2011
|
+
{
|
|
2012
|
+
type: 'checkbox',
|
|
2013
|
+
title: '表格的高级操作',
|
|
2014
|
+
field: fieldsMap$7['config.tableAdvancedFeatures'],
|
|
2015
|
+
value: rule.config.tableAdvancedFeatures,
|
|
2016
|
+
options: [
|
|
2017
|
+
{
|
|
2018
|
+
value: 'copy',
|
|
2019
|
+
label: '复制行',
|
|
2020
|
+
},
|
|
2021
|
+
{
|
|
2022
|
+
value: 'delete',
|
|
2023
|
+
label: '批量删除',
|
|
2024
|
+
},
|
|
2025
|
+
{
|
|
2026
|
+
value: 'import',
|
|
2027
|
+
label: '批量导入',
|
|
2028
|
+
},
|
|
2029
|
+
],
|
|
2030
|
+
className: 'bfd-sider-right__form__table-checkbox',
|
|
2031
|
+
},
|
|
2032
|
+
];
|
|
2033
|
+
},
|
|
2034
|
+
parse(rule) {
|
|
2035
|
+
return {
|
|
2036
|
+
name: name$7,
|
|
2037
|
+
field: rule.field,
|
|
2038
|
+
title: {
|
|
2039
|
+
title: rule.title.title,
|
|
2040
|
+
},
|
|
2041
|
+
config: {
|
|
2042
|
+
tableAdvancedFeatures: rule.config.tableAdvancedFeatures,
|
|
2043
|
+
},
|
|
2044
|
+
};
|
|
2045
|
+
},
|
|
2046
|
+
};
|
|
2047
|
+
|
|
2048
|
+
const label$6 = '附件';
|
|
2049
|
+
const fieldsMap$6 = {
|
|
2050
|
+
'title.title': 'title.title',
|
|
2051
|
+
'effect.required': 'effect.required',
|
|
2052
|
+
};
|
|
2053
|
+
const name$6 = 'file';
|
|
2054
|
+
var file = {
|
|
2055
|
+
icon: 'File',
|
|
2056
|
+
name: name$6,
|
|
2057
|
+
label: label$6,
|
|
2058
|
+
rule() {
|
|
2059
|
+
return {
|
|
2060
|
+
type: WidgetType.UploadFile,
|
|
2061
|
+
component: BmUpload,
|
|
2062
|
+
field: uniqueId(),
|
|
2063
|
+
title: {
|
|
2064
|
+
title: label$6,
|
|
2065
|
+
style: {
|
|
2066
|
+
overflow: 'hidden',
|
|
2067
|
+
textOverflow: 'ellipsis',
|
|
2068
|
+
whiteSpace: 'nowrap',
|
|
2069
|
+
},
|
|
2070
|
+
},
|
|
2071
|
+
effect: {
|
|
2072
|
+
required: true,
|
|
2073
|
+
formRule: 'formRule',
|
|
2074
|
+
},
|
|
2075
|
+
config: {
|
|
2076
|
+
propsFields: Object.values(fieldsMap$6),
|
|
2077
|
+
},
|
|
2078
|
+
};
|
|
2079
|
+
},
|
|
2080
|
+
props(rule, parentRule) {
|
|
2081
|
+
return [
|
|
2082
|
+
{
|
|
2083
|
+
type: 'input',
|
|
2084
|
+
title: '标题',
|
|
2085
|
+
field: fieldsMap$6['title.title'],
|
|
2086
|
+
value: rule.title.title,
|
|
2087
|
+
effect: {
|
|
2088
|
+
required: '请输入标题',
|
|
2089
|
+
},
|
|
2090
|
+
props: {
|
|
2091
|
+
placeholder: '请输入',
|
|
2092
|
+
maxlength: 10,
|
|
2093
|
+
},
|
|
2094
|
+
},
|
|
2095
|
+
{
|
|
2096
|
+
type: 'switch',
|
|
2097
|
+
title: '是否必填',
|
|
2098
|
+
field: fieldsMap$6['effect.required'],
|
|
2099
|
+
value: rule.effect.required,
|
|
2100
|
+
},
|
|
2101
|
+
];
|
|
2102
|
+
},
|
|
2103
|
+
parse(rule) {
|
|
2104
|
+
return {
|
|
2105
|
+
name: name$6,
|
|
2106
|
+
field: rule.field,
|
|
2107
|
+
title: {
|
|
2108
|
+
title: rule.title.title,
|
|
2109
|
+
},
|
|
2110
|
+
effect: {
|
|
2111
|
+
required: rule.effect.required,
|
|
2112
|
+
},
|
|
2113
|
+
};
|
|
2114
|
+
},
|
|
2115
|
+
};
|
|
2116
|
+
|
|
2117
|
+
const label$5 = '员工';
|
|
2118
|
+
const fieldsMap$5 = {
|
|
2119
|
+
'title.title': 'title.title',
|
|
2120
|
+
'props.placeholder': 'props.placeholder',
|
|
2121
|
+
'props.limit': 'props.limit',
|
|
2122
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
2123
|
+
'effect.required': 'effect.required',
|
|
2124
|
+
};
|
|
2125
|
+
const name$5 = 'people';
|
|
2126
|
+
var people = {
|
|
2127
|
+
icon: 'People',
|
|
2128
|
+
name: name$5,
|
|
2129
|
+
label: label$5,
|
|
2130
|
+
rule() {
|
|
2131
|
+
return {
|
|
2132
|
+
type: 'select',
|
|
2133
|
+
field: uniqueId(),
|
|
2134
|
+
title: {
|
|
2135
|
+
title: label$5,
|
|
2136
|
+
style: {
|
|
2137
|
+
overflow: 'hidden',
|
|
2138
|
+
textOverflow: 'ellipsis',
|
|
2139
|
+
whiteSpace: 'nowrap',
|
|
2140
|
+
},
|
|
2141
|
+
},
|
|
2142
|
+
effect: {
|
|
2143
|
+
required: true,
|
|
2144
|
+
formRule: 'formRule',
|
|
2145
|
+
},
|
|
2146
|
+
props: {
|
|
2147
|
+
limit: 0,
|
|
2148
|
+
placeholder: '请选择',
|
|
2149
|
+
},
|
|
2150
|
+
config: {
|
|
2151
|
+
propsFields: Object.values(fieldsMap$5),
|
|
2152
|
+
},
|
|
2153
|
+
};
|
|
2154
|
+
},
|
|
2155
|
+
props(rule, parentRule) {
|
|
2156
|
+
return [
|
|
2157
|
+
{
|
|
2158
|
+
type: 'input',
|
|
2159
|
+
title: '标题',
|
|
2160
|
+
field: fieldsMap$5['title.title'],
|
|
2161
|
+
value: rule.title.title,
|
|
2162
|
+
effect: {
|
|
2163
|
+
required: '请输入标题',
|
|
2164
|
+
},
|
|
2165
|
+
props: {
|
|
2166
|
+
placeholder: '请输入',
|
|
2167
|
+
maxlength: 10,
|
|
2168
|
+
},
|
|
2169
|
+
},
|
|
2170
|
+
{
|
|
2171
|
+
type: 'input',
|
|
2172
|
+
title: '提示文字',
|
|
2173
|
+
field: fieldsMap$5['props.placeholder'],
|
|
2174
|
+
props: {
|
|
2175
|
+
placeholder: '请输入',
|
|
2176
|
+
},
|
|
2177
|
+
value: rule.props.placeholder,
|
|
2178
|
+
},
|
|
2179
|
+
{
|
|
2180
|
+
type: 'radio',
|
|
2181
|
+
title: '选项',
|
|
2182
|
+
field: fieldsMap$5['props.limit'],
|
|
2183
|
+
options: [
|
|
2184
|
+
{
|
|
2185
|
+
value: 1,
|
|
2186
|
+
label: '只能选择一人',
|
|
2187
|
+
},
|
|
2188
|
+
{
|
|
2189
|
+
value: 0,
|
|
2190
|
+
label: '可同时选择多人',
|
|
2191
|
+
},
|
|
2192
|
+
],
|
|
2193
|
+
value: rule.props.limit,
|
|
2194
|
+
effect: {
|
|
2195
|
+
required: true,
|
|
2196
|
+
},
|
|
2197
|
+
inject: true,
|
|
2198
|
+
on: {
|
|
2199
|
+
change({ api, self }, { target }) {
|
|
2200
|
+
const value = target.value;
|
|
2201
|
+
self.value = value;
|
|
2202
|
+
api.emit('change', self.field, value, self, api, true);
|
|
2203
|
+
},
|
|
2204
|
+
},
|
|
2205
|
+
className: 'form-designer-props-radio-label',
|
|
2206
|
+
},
|
|
2207
|
+
Object.assign({ field: fieldsMap$5['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
2208
|
+
{
|
|
2209
|
+
type: 'switch',
|
|
2210
|
+
title: '是否必填',
|
|
2211
|
+
info: '勾选后可作为流程条件',
|
|
2212
|
+
field: fieldsMap$5['effect.required'],
|
|
2213
|
+
value: rule.effect.required,
|
|
2214
|
+
},
|
|
2215
|
+
];
|
|
2216
|
+
},
|
|
2217
|
+
parse(rule) {
|
|
2218
|
+
return {
|
|
2219
|
+
name: name$5,
|
|
2220
|
+
field: rule.field,
|
|
2221
|
+
title: {
|
|
2222
|
+
title: rule.title.title,
|
|
2223
|
+
},
|
|
2224
|
+
props: {
|
|
2225
|
+
placeholder: rule.props.placeholder,
|
|
2226
|
+
limit: rule.props.limit,
|
|
2227
|
+
},
|
|
2228
|
+
config: {
|
|
2229
|
+
fieldRatio: rule.config.fieldRatio,
|
|
2230
|
+
},
|
|
2231
|
+
effect: {
|
|
2232
|
+
required: rule.effect.required,
|
|
2233
|
+
},
|
|
2234
|
+
};
|
|
2235
|
+
},
|
|
2236
|
+
};
|
|
2237
|
+
|
|
2238
|
+
const label$4 = '部门';
|
|
2239
|
+
const fieldsMap$4 = {
|
|
2240
|
+
'title.title': 'title.title',
|
|
2241
|
+
'props.placeholder': 'props.placeholder',
|
|
2242
|
+
'props.limit': 'props.limit',
|
|
2243
|
+
'config.fieldRatio': 'config.fieldRatio',
|
|
2244
|
+
'effect.required': 'effect.required',
|
|
2245
|
+
};
|
|
2246
|
+
const name$4 = 'department';
|
|
2247
|
+
var department = {
|
|
2248
|
+
icon: 'Department',
|
|
2249
|
+
name: name$4,
|
|
2250
|
+
label: label$4,
|
|
2251
|
+
rule() {
|
|
2252
|
+
return {
|
|
2253
|
+
type: 'select',
|
|
2254
|
+
field: uniqueId(),
|
|
2255
|
+
title: {
|
|
2256
|
+
title: label$4,
|
|
2257
|
+
style: {
|
|
2258
|
+
overflow: 'hidden',
|
|
2259
|
+
textOverflow: 'ellipsis',
|
|
2260
|
+
whiteSpace: 'nowrap',
|
|
2261
|
+
},
|
|
2262
|
+
},
|
|
2263
|
+
effect: {
|
|
2264
|
+
required: true,
|
|
2265
|
+
formRule: 'formRule',
|
|
2266
|
+
},
|
|
2267
|
+
props: {
|
|
2268
|
+
limit: 0,
|
|
2269
|
+
placeholder: '请选择',
|
|
2270
|
+
},
|
|
2271
|
+
config: {
|
|
2272
|
+
propsFields: Object.values(fieldsMap$4),
|
|
2273
|
+
},
|
|
2274
|
+
};
|
|
2275
|
+
},
|
|
2276
|
+
props(rule, parentRule) {
|
|
2277
|
+
return [
|
|
2278
|
+
{
|
|
2279
|
+
type: 'input',
|
|
2280
|
+
title: '标题',
|
|
2281
|
+
field: fieldsMap$4['title.title'],
|
|
2282
|
+
value: rule.title.title,
|
|
2283
|
+
effect: {
|
|
2284
|
+
required: '请输入标题',
|
|
2285
|
+
},
|
|
2286
|
+
props: {
|
|
2287
|
+
placeholder: '请输入',
|
|
2288
|
+
maxlength: 10,
|
|
2289
|
+
},
|
|
2290
|
+
},
|
|
2291
|
+
{
|
|
2292
|
+
type: 'input',
|
|
2293
|
+
title: '提示文字',
|
|
2294
|
+
field: fieldsMap$4['props.placeholder'],
|
|
2295
|
+
props: {
|
|
2296
|
+
placeholder: '请输入',
|
|
2297
|
+
},
|
|
2298
|
+
value: rule.props.placeholder,
|
|
2299
|
+
},
|
|
2300
|
+
{
|
|
2301
|
+
type: 'radio',
|
|
2302
|
+
title: '选项',
|
|
2303
|
+
field: fieldsMap$4['props.limit'],
|
|
2304
|
+
options: [
|
|
2305
|
+
{
|
|
2306
|
+
value: 1,
|
|
2307
|
+
label: '只能选择一部门',
|
|
2308
|
+
},
|
|
2309
|
+
{
|
|
2310
|
+
value: 0,
|
|
2311
|
+
label: '可同时选择多个部门',
|
|
2312
|
+
},
|
|
2313
|
+
],
|
|
2314
|
+
value: rule.props.limit,
|
|
2315
|
+
effect: {
|
|
2316
|
+
required: true,
|
|
2317
|
+
},
|
|
2318
|
+
inject: true,
|
|
2319
|
+
on: {
|
|
2320
|
+
change({ api, self }, { target }) {
|
|
2321
|
+
const value = target.value;
|
|
2322
|
+
self.value = value;
|
|
2323
|
+
api.emit('change', self.field, value, self, api, true);
|
|
2324
|
+
},
|
|
2325
|
+
},
|
|
2326
|
+
className: 'form-designer-props-radio-label',
|
|
2327
|
+
},
|
|
2328
|
+
Object.assign({ field: fieldsMap$4['config.fieldRatio'] }, getFieldRatioRule(rule, parentRule)),
|
|
2329
|
+
{
|
|
2330
|
+
type: 'switch',
|
|
2331
|
+
title: '是否必填',
|
|
2332
|
+
info: '勾选后可作为流程条件',
|
|
2333
|
+
field: fieldsMap$4['effect.required'],
|
|
2334
|
+
value: rule.effect.required,
|
|
2335
|
+
},
|
|
2336
|
+
];
|
|
2337
|
+
},
|
|
2338
|
+
parse(rule) {
|
|
2339
|
+
return {
|
|
2340
|
+
name: name$4,
|
|
2341
|
+
field: rule.field,
|
|
2342
|
+
title: {
|
|
2343
|
+
title: rule.title.title,
|
|
2344
|
+
},
|
|
2345
|
+
props: {
|
|
2346
|
+
placeholder: rule.props.placeholder,
|
|
2347
|
+
limit: rule.props.limit,
|
|
2348
|
+
},
|
|
2349
|
+
config: {
|
|
2350
|
+
fieldRatio: rule.config.fieldRatio,
|
|
2351
|
+
},
|
|
2352
|
+
effect: {
|
|
2353
|
+
required: rule.effect.required,
|
|
2354
|
+
},
|
|
2355
|
+
};
|
|
2356
|
+
},
|
|
2357
|
+
};
|
|
2358
|
+
|
|
2359
|
+
const _hoisted_1$a = { style: { "margin-top": "16px", "line-height": "32px" } };
|
|
2360
|
+
const _hoisted_2$8 = /* @__PURE__ */ createTextVNode(" \u660E\u7EC6\u5217\u8868 ");
|
|
2361
|
+
const _hoisted_3$7 = { style: { "float": "right" } };
|
|
2362
|
+
const _hoisted_4$4 = /* @__PURE__ */ createTextVNode(" \u4E0B\u8F7D\u5BFC\u5165\u6A21\u677F ");
|
|
2363
|
+
const _hoisted_5$2 = /* @__PURE__ */ createTextVNode(" \u5BFC\u5165\u660E\u7EC6 ");
|
|
2364
|
+
const _hoisted_6$2 = /* @__PURE__ */ createTextVNode(" \u6279\u91CF\u5220\u9664 ");
|
|
2365
|
+
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode(" \u65B0\u589E ");
|
|
2366
|
+
const _hoisted_8$1 = /* @__PURE__ */ createElementVNode("div", { class: "bm-material-temp__table-tip" }, "\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6\u8868\u683C\u5B57\u6BB5", -1);
|
|
2367
|
+
const _hoisted_9 = { class: "bm-material-temp__add" };
|
|
2368
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2369
|
+
__name: "widget-material-temp",
|
|
2370
|
+
props: ["formCreateInject"],
|
|
2371
|
+
setup(__props) {
|
|
2372
|
+
const props = __props;
|
|
2373
|
+
const panes = [
|
|
2374
|
+
{
|
|
2375
|
+
key: "\u7D20\u67501",
|
|
2376
|
+
title: "\u7D20\u67501"
|
|
2377
|
+
}
|
|
2378
|
+
];
|
|
2379
|
+
let activeKey = "\u7D20\u67501";
|
|
2380
|
+
const option = {
|
|
2381
|
+
form: {
|
|
2382
|
+
layout: "vertical"
|
|
2383
|
+
},
|
|
2384
|
+
submitBtn: {
|
|
2385
|
+
show: false
|
|
2386
|
+
},
|
|
2387
|
+
row: {
|
|
2388
|
+
gutter: [24, 24]
|
|
2389
|
+
},
|
|
2390
|
+
col: {
|
|
2391
|
+
span: 12
|
|
2392
|
+
}
|
|
2393
|
+
};
|
|
2394
|
+
const uploadPicField = "uploadPicture";
|
|
2395
|
+
const rules = ref([
|
|
2396
|
+
{
|
|
2397
|
+
type: "button",
|
|
2398
|
+
field: "materialTemp",
|
|
2399
|
+
title: "\u7D20\u6750\u6A21\u677F",
|
|
2400
|
+
effect: {
|
|
2401
|
+
required: true
|
|
2402
|
+
},
|
|
2403
|
+
children: [
|
|
2404
|
+
{
|
|
2405
|
+
type: "PlusOutlined",
|
|
2406
|
+
component: PlusOutlined
|
|
2407
|
+
},
|
|
2408
|
+
"\u9009\u62E9\u6A21\u677F"
|
|
2409
|
+
]
|
|
2410
|
+
},
|
|
2411
|
+
{
|
|
2412
|
+
type: "span",
|
|
2413
|
+
field: "materialType",
|
|
2414
|
+
title: "\u7D20\u6750\u7C7B\u578B",
|
|
2415
|
+
children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
|
|
2416
|
+
style: {
|
|
2417
|
+
color: "#9393A3"
|
|
2418
|
+
}
|
|
2419
|
+
},
|
|
2420
|
+
{
|
|
2421
|
+
type: "span",
|
|
2422
|
+
field: "size",
|
|
2423
|
+
title: "\u5C3A\u5BF8",
|
|
2424
|
+
children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
|
|
2425
|
+
style: {
|
|
2426
|
+
color: "#9393A3"
|
|
2427
|
+
}
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
type: "span",
|
|
2431
|
+
field: "coverPicture",
|
|
2432
|
+
title: "\u5C01\u9762\u56FE",
|
|
2433
|
+
children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
|
|
2434
|
+
style: {
|
|
2435
|
+
color: "#9393A3"
|
|
2436
|
+
}
|
|
2437
|
+
},
|
|
2438
|
+
{
|
|
2439
|
+
type: "span",
|
|
2440
|
+
field: "templateStructureDiagram",
|
|
2441
|
+
title: "\u6A21\u677F\u7ED3\u6784\u56FE",
|
|
2442
|
+
children: ["\u7CFB\u7EDF\u81EA\u52A8\u83B7\u53D6"],
|
|
2443
|
+
style: {
|
|
2444
|
+
color: "#9393A3"
|
|
2445
|
+
}
|
|
2446
|
+
},
|
|
2447
|
+
{
|
|
2448
|
+
hidden: false,
|
|
2449
|
+
type: "UploadPicture",
|
|
2450
|
+
component: BmUpload,
|
|
2451
|
+
field: uploadPicField,
|
|
2452
|
+
title: "\u4E0A\u4F20\u53C2\u8003\u56FE",
|
|
2453
|
+
effect: {
|
|
2454
|
+
required: false
|
|
2455
|
+
},
|
|
2456
|
+
props: {
|
|
2457
|
+
uploadProps: {
|
|
2458
|
+
listType: "picture-card",
|
|
2459
|
+
text: "\u4E0A\u4F20\u7167\u7247"
|
|
2460
|
+
},
|
|
2461
|
+
extraProps: {
|
|
2462
|
+
maxSize: 9
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
]);
|
|
2467
|
+
function getUploadPicRule() {
|
|
2468
|
+
return rules.value.find((rule) => rule.field === uploadPicField);
|
|
2469
|
+
}
|
|
2470
|
+
function handleUploadPicRule(uploadPictureRule) {
|
|
2471
|
+
const uploadPicRule = getUploadPicRule();
|
|
2472
|
+
uploadPicRule.effect.required = uploadPictureRule.required;
|
|
2473
|
+
uploadPicRule.hidden = uploadPictureRule.hidden;
|
|
2474
|
+
rules.value = [...rules.value];
|
|
2475
|
+
}
|
|
2476
|
+
watch(
|
|
2477
|
+
() => props.formCreateInject.rule.config.uploadPictureRule,
|
|
2478
|
+
handleUploadPicRule,
|
|
2479
|
+
{
|
|
2480
|
+
deep: true,
|
|
2481
|
+
immediate: true
|
|
2482
|
+
}
|
|
2483
|
+
);
|
|
2484
|
+
return (_ctx, _cache) => {
|
|
2485
|
+
const _component_FormCreate = resolveComponent("FormCreate");
|
|
2486
|
+
return openBlock(), createBlock(unref(Tabs), {
|
|
2487
|
+
activeKey: unref(activeKey),
|
|
2488
|
+
"onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => isRef(activeKey) ? activeKey.value = $event : activeKey = $event),
|
|
2489
|
+
class: "bm-material-temp",
|
|
2490
|
+
type: "editable-card",
|
|
2491
|
+
"hide-add": "",
|
|
2492
|
+
size: "small"
|
|
2493
|
+
}, {
|
|
2494
|
+
rightExtra: withCtx(() => [
|
|
2495
|
+
createElementVNode("span", _hoisted_9, [
|
|
2496
|
+
createVNode(unref(PlusOutlined))
|
|
2497
|
+
])
|
|
2498
|
+
]),
|
|
2499
|
+
default: withCtx(() => [
|
|
2500
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(panes, (pane) => {
|
|
2501
|
+
return createVNode(unref(TabPane), {
|
|
2502
|
+
key: pane.key,
|
|
2503
|
+
tab: pane.title
|
|
2504
|
+
}, {
|
|
2505
|
+
default: withCtx(() => [
|
|
2506
|
+
createVNode(_component_FormCreate, {
|
|
2507
|
+
option,
|
|
2508
|
+
rule: rules.value
|
|
2509
|
+
}, null, 8, ["rule"]),
|
|
2510
|
+
createElementVNode("div", _hoisted_1$a, [
|
|
2511
|
+
_hoisted_2$8,
|
|
2512
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
2513
|
+
createVNode(unref(Button), null, {
|
|
2514
|
+
default: withCtx(() => [
|
|
2515
|
+
_hoisted_4$4
|
|
2516
|
+
]),
|
|
2517
|
+
_: 1
|
|
2518
|
+
}),
|
|
2519
|
+
createVNode(unref(Button), null, {
|
|
2520
|
+
default: withCtx(() => [
|
|
2521
|
+
_hoisted_5$2
|
|
2522
|
+
]),
|
|
2523
|
+
_: 1
|
|
2524
|
+
}),
|
|
2525
|
+
createVNode(unref(Button), null, {
|
|
2526
|
+
default: withCtx(() => [
|
|
2527
|
+
_hoisted_6$2
|
|
2528
|
+
]),
|
|
2529
|
+
_: 1
|
|
2530
|
+
}),
|
|
2531
|
+
createVNode(unref(Button), { type: "primary" }, {
|
|
2532
|
+
default: withCtx(() => [
|
|
2533
|
+
createVNode(unref(PlusOutlined)),
|
|
2534
|
+
_hoisted_7$1
|
|
2535
|
+
]),
|
|
2536
|
+
_: 1
|
|
2537
|
+
})
|
|
2538
|
+
])
|
|
2539
|
+
]),
|
|
2540
|
+
_hoisted_8$1
|
|
2541
|
+
]),
|
|
2542
|
+
_: 2
|
|
2543
|
+
}, 1032, ["tab"]);
|
|
2544
|
+
}), 64))
|
|
2545
|
+
]),
|
|
2546
|
+
_: 1
|
|
2547
|
+
}, 8, ["activeKey"]);
|
|
2548
|
+
};
|
|
2549
|
+
}
|
|
2550
|
+
});
|
|
2551
|
+
var WidgetMaterialTemp = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "widget-material-temp.vue"]]);
|
|
2552
|
+
|
|
2553
|
+
const _hoisted_1$9 = { class: "bm-use-instruction" };
|
|
2554
|
+
const _hoisted_2$7 = { class: "bm-use-instruction__title" };
|
|
2555
|
+
const _hoisted_3$6 = /* @__PURE__ */ createTextVNode(" \u4F7F\u7528\u8BF4\u660E ");
|
|
2556
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2557
|
+
__name: "use-instruction",
|
|
2558
|
+
setup(__props) {
|
|
2559
|
+
return (_ctx, _cache) => {
|
|
2560
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2561
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
2562
|
+
createVNode(unref(InfoCircleFilled), { class: "bm-use-instruction__title__icon" }),
|
|
2563
|
+
_hoisted_3$6
|
|
2564
|
+
]),
|
|
2565
|
+
renderSlot(_ctx.$slots, "default")
|
|
2566
|
+
]);
|
|
2567
|
+
};
|
|
2568
|
+
}
|
|
2569
|
+
});
|
|
2570
|
+
var UseInstruction = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "use-instruction.vue"]]);
|
|
2571
|
+
|
|
2572
|
+
const label$3 = '素材模板';
|
|
2573
|
+
const fieldsMap$3 = {
|
|
2574
|
+
'config.uploadPictureRule.required': 'config.uploadPictureRule.required',
|
|
2575
|
+
'config.uploadPictureRule.hidden': 'config.uploadPictureRule.hidden',
|
|
2576
|
+
};
|
|
2577
|
+
const name$3 = 'materialTemp';
|
|
2578
|
+
var materialTemp = {
|
|
2579
|
+
icon: 'MaterialTemp',
|
|
2580
|
+
name: name$3,
|
|
2581
|
+
label: label$3,
|
|
2582
|
+
rule() {
|
|
2583
|
+
return {
|
|
2584
|
+
type: 'WidgetMaterialTemp',
|
|
2585
|
+
component: WidgetMaterialTemp,
|
|
2586
|
+
title: {
|
|
2587
|
+
title: label$3,
|
|
2588
|
+
},
|
|
2589
|
+
field: uniqueId(),
|
|
2590
|
+
config: {
|
|
2591
|
+
propsFields: Object.values(fieldsMap$3),
|
|
2592
|
+
uploadPictureRule: {
|
|
2593
|
+
required: false,
|
|
2594
|
+
hidden: false,
|
|
2595
|
+
},
|
|
2596
|
+
},
|
|
2597
|
+
};
|
|
2598
|
+
},
|
|
2599
|
+
props(rule) {
|
|
2600
|
+
return [
|
|
2601
|
+
{
|
|
2602
|
+
type: 'UseInstruction',
|
|
2603
|
+
component: UseInstruction,
|
|
2604
|
+
children: [
|
|
2605
|
+
{
|
|
2606
|
+
type: 'span',
|
|
2607
|
+
children: [
|
|
2608
|
+
'·该套件打通店铺与素材模板的数据关联,可根据店铺获取该店铺可用的素材模板。',
|
|
2609
|
+
],
|
|
2610
|
+
},
|
|
2611
|
+
{
|
|
2612
|
+
type: 'span',
|
|
2613
|
+
children: [
|
|
2614
|
+
'·满足一个素材申请单可使用多个素材类型对应的素材模板申请素材。',
|
|
2615
|
+
],
|
|
2616
|
+
style: {
|
|
2617
|
+
display: 'inline-block',
|
|
2618
|
+
marginTop: '8px',
|
|
2619
|
+
},
|
|
2620
|
+
},
|
|
2621
|
+
],
|
|
2622
|
+
style: {
|
|
2623
|
+
marginBottom: '24px',
|
|
2624
|
+
},
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
type: 'span',
|
|
2628
|
+
title: '素材模板',
|
|
2629
|
+
field: 'materialTemp',
|
|
2630
|
+
children: [
|
|
2631
|
+
'用于选择对应可用的素材模板信息(编号、名称、尺寸、封面图、结构图)。此项必填并获取所选择的模板的编号及名称显示。',
|
|
2632
|
+
],
|
|
2633
|
+
style: {
|
|
2634
|
+
color: '#505259',
|
|
2635
|
+
},
|
|
2636
|
+
},
|
|
2637
|
+
{
|
|
2638
|
+
type: 'span',
|
|
2639
|
+
title: '素材类型/尺寸/封面图/结构图',
|
|
2640
|
+
field: 'systemGeneration',
|
|
2641
|
+
children: ['通过所选模板,系统自动获取此模板对应的相关内容。'],
|
|
2642
|
+
style: {
|
|
2643
|
+
color: '#505259',
|
|
2644
|
+
},
|
|
2645
|
+
},
|
|
2646
|
+
{
|
|
2647
|
+
type: 'span',
|
|
2648
|
+
title: '上传参考图',
|
|
2649
|
+
field: 'uploadPicture',
|
|
2650
|
+
prefix: {
|
|
2651
|
+
type: 'CheckboxSwitch',
|
|
2652
|
+
props: {
|
|
2653
|
+
rule,
|
|
2654
|
+
},
|
|
2655
|
+
},
|
|
2656
|
+
children: ['用于上传当次申请的素材参考的图片。可最多上传9张图。'],
|
|
2657
|
+
style: {
|
|
2658
|
+
color: '#505259',
|
|
2659
|
+
},
|
|
2660
|
+
},
|
|
2661
|
+
{
|
|
2662
|
+
type: 'span',
|
|
2663
|
+
title: '明细列表',
|
|
2664
|
+
field: 'detailList',
|
|
2665
|
+
children: [
|
|
2666
|
+
'根据所选的素材模板,系统自动获取该模板需填写的内容字段列表以及批量导入的模板。列表允许操作:下载所选素材模板的导入模板、批量导入明细、新增、编辑、删除。',
|
|
2667
|
+
],
|
|
2668
|
+
style: {
|
|
2669
|
+
color: '#505259',
|
|
2670
|
+
},
|
|
2671
|
+
},
|
|
2672
|
+
];
|
|
2673
|
+
},
|
|
2674
|
+
parse(rule) {
|
|
2675
|
+
return {
|
|
2676
|
+
name: name$3,
|
|
2677
|
+
field: rule.field,
|
|
2678
|
+
config: {
|
|
2679
|
+
uploadPictureRule: {
|
|
2680
|
+
hidden: rule.config.uploadPictureRule.hidden,
|
|
2681
|
+
required: rule.config.uploadPictureRule.required,
|
|
2682
|
+
},
|
|
2683
|
+
},
|
|
2684
|
+
};
|
|
2685
|
+
},
|
|
2686
|
+
};
|
|
2687
|
+
|
|
2688
|
+
const _hoisted_1$8 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__title" }, "\u5546\u54C1\u7F16\u53F7", -1);
|
|
2689
|
+
const _hoisted_2$6 = { class: "bm-product-info-item__content" };
|
|
2690
|
+
const _hoisted_3$5 = { class: "bm-product-info-item__title" };
|
|
2691
|
+
const _hoisted_4$3 = /* @__PURE__ */ createElementVNode("div", { class: "bm-product-info-item__content" }, "\u7CFB\u7EDF\u81EA\u52A8\u5E26\u51FA", -1);
|
|
2692
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2693
|
+
__name: "product-info",
|
|
2694
|
+
props: ["formCreateInject"],
|
|
2695
|
+
setup(__props) {
|
|
2696
|
+
return (_ctx, _cache) => {
|
|
2697
|
+
return openBlock(), createBlock(unref(Row), null, {
|
|
2698
|
+
default: withCtx(() => [
|
|
2699
|
+
createVNode(unref(Col), {
|
|
2700
|
+
class: "bm-product-info-item",
|
|
2701
|
+
span: 12
|
|
2702
|
+
}, {
|
|
2703
|
+
default: withCtx(() => [
|
|
2704
|
+
_hoisted_1$8,
|
|
2705
|
+
createElementVNode("div", _hoisted_2$6, [
|
|
2706
|
+
createVNode(unref(Input), { placeholder: "\u8BF7\u8F93\u5165\u5546\u54C1\u7F16\u53F7" })
|
|
2707
|
+
])
|
|
2708
|
+
]),
|
|
2709
|
+
_: 1
|
|
2710
|
+
}),
|
|
2711
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.formCreateInject.rule.config.associatedFields, (item) => {
|
|
2712
|
+
return openBlock(), createBlock(unref(Col), {
|
|
2713
|
+
key: item.value,
|
|
2714
|
+
class: "bm-product-info-item",
|
|
2715
|
+
span: 12
|
|
2716
|
+
}, {
|
|
2717
|
+
default: withCtx(() => [
|
|
2718
|
+
createElementVNode("div", _hoisted_3$5, toDisplayString(item.label), 1),
|
|
2719
|
+
_hoisted_4$3
|
|
2720
|
+
]),
|
|
2721
|
+
_: 2
|
|
2722
|
+
}, 1024);
|
|
2723
|
+
}), 128))
|
|
2724
|
+
]),
|
|
2725
|
+
_: 1
|
|
2726
|
+
});
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2729
|
+
});
|
|
2730
|
+
var ProductInfo = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "product-info.vue"]]);
|
|
2731
|
+
|
|
2732
|
+
const _hoisted_1$7 = /* @__PURE__ */ createElementVNode("div", { class: "bm-associated-fields-item" }, [
|
|
2733
|
+
/* @__PURE__ */ createElementVNode("span", { class: "bm-associated-fields-item__content" }, "\u5546\u54C1\u7F16\u53F7")
|
|
2734
|
+
], -1);
|
|
2735
|
+
const _hoisted_2$5 = { class: "bm-associated-fields-item__content" };
|
|
2736
|
+
const _hoisted_3$4 = /* @__PURE__ */ createTextVNode(" \u6DFB\u52A0\u5B50\u5B57\u6BB5 ");
|
|
2737
|
+
const _hoisted_4$2 = { style: { "text-align": "right", "margin": "6px 0 4px", "padding-right": "8px" } };
|
|
2738
|
+
const _hoisted_5$1 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
2739
|
+
const _hoisted_6$1 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
2740
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2741
|
+
__name: "associated-fields",
|
|
2742
|
+
props: ["associatedFields"],
|
|
2743
|
+
emits: ["change"],
|
|
2744
|
+
setup(__props, { emit: emits }) {
|
|
2745
|
+
const props = __props;
|
|
2746
|
+
const visible = ref(false);
|
|
2747
|
+
const checkList = ref([]);
|
|
2748
|
+
const options = [
|
|
2749
|
+
{
|
|
2750
|
+
value: "\u5546\u54C1\u540D\u79F0",
|
|
2751
|
+
label: "\u5546\u54C1\u540D\u79F0"
|
|
2752
|
+
},
|
|
2753
|
+
{
|
|
2754
|
+
value: "\u5546\u54C1\u7B80\u79F0",
|
|
2755
|
+
label: "\u5546\u54C1\u7B80\u79F0"
|
|
2756
|
+
},
|
|
2757
|
+
{
|
|
2758
|
+
value: "\u5546\u54C1\u56FE\u7247",
|
|
2759
|
+
label: "\u5546\u54C1\u56FE\u7247"
|
|
2760
|
+
},
|
|
2761
|
+
{
|
|
2762
|
+
value: "\u5EFA\u8BAE\u96F6\u552E\u4EF7",
|
|
2763
|
+
label: "\u5EFA\u8BAE\u96F6\u552E\u4EF7"
|
|
2764
|
+
},
|
|
2765
|
+
{
|
|
2766
|
+
value: "\u5546\u54C1\u7BB1\u89C4",
|
|
2767
|
+
label: "\u5546\u54C1\u7BB1\u89C4"
|
|
2768
|
+
},
|
|
2769
|
+
{
|
|
2770
|
+
value: "\u5546\u54C1\u5355\u4F4D",
|
|
2771
|
+
label: "\u5546\u54C1\u5355\u4F4D"
|
|
2772
|
+
}
|
|
2773
|
+
];
|
|
2774
|
+
function emitChangeEvt() {
|
|
2775
|
+
emits(
|
|
2776
|
+
"change",
|
|
2777
|
+
options.filter((op) => checkList.value.includes(op.value))
|
|
2778
|
+
);
|
|
2779
|
+
}
|
|
2780
|
+
function handOk() {
|
|
2781
|
+
visible.value = false;
|
|
2782
|
+
emitChangeEvt();
|
|
2783
|
+
}
|
|
2784
|
+
function init() {
|
|
2785
|
+
checkList.value = props.associatedFields.map((item) => item.value);
|
|
2786
|
+
}
|
|
2787
|
+
function visibleChange(visible2) {
|
|
2788
|
+
if (visible2) {
|
|
2789
|
+
init();
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
function handleDel(value) {
|
|
2793
|
+
checkList.value = checkList.value.filter((cl) => cl !== value);
|
|
2794
|
+
emitChangeEvt();
|
|
2795
|
+
}
|
|
2796
|
+
init();
|
|
2797
|
+
watch(visible, (val) => {
|
|
2798
|
+
visibleChange(val);
|
|
2799
|
+
});
|
|
2800
|
+
return (_ctx, _cache) => {
|
|
2801
|
+
const _component_Delete = resolveComponent("Delete");
|
|
2802
|
+
return openBlock(), createElementBlock("div", null, [
|
|
2803
|
+
_hoisted_1$7,
|
|
2804
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.associatedFields, (item) => {
|
|
2805
|
+
return openBlock(), createElementBlock("div", {
|
|
2806
|
+
key: item.value,
|
|
2807
|
+
class: "bm-associated-fields-item"
|
|
2808
|
+
}, [
|
|
2809
|
+
createElementVNode("span", _hoisted_2$5, toDisplayString(item.label), 1),
|
|
2810
|
+
createVNode(_component_Delete, {
|
|
2811
|
+
class: "bm-associated-fields-item__icon",
|
|
2812
|
+
onClick: ($event) => handleDel(item.value)
|
|
2813
|
+
}, null, 8, ["onClick"])
|
|
2814
|
+
]);
|
|
2815
|
+
}), 128)),
|
|
2816
|
+
createVNode(unref(Dropdown), {
|
|
2817
|
+
visible: visible.value,
|
|
2818
|
+
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => visible.value = $event),
|
|
2819
|
+
trigger: ["click"]
|
|
2820
|
+
}, {
|
|
2821
|
+
overlay: withCtx(() => [
|
|
2822
|
+
createVNode(unref(Menu), null, {
|
|
2823
|
+
default: withCtx(() => [
|
|
2824
|
+
createVNode(unref(FormItemRest), null, {
|
|
2825
|
+
default: withCtx(() => [
|
|
2826
|
+
createVNode(unref(CheckboxGroup), {
|
|
2827
|
+
value: checkList.value,
|
|
2828
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => checkList.value = $event),
|
|
2829
|
+
style: { "width": "100%" }
|
|
2830
|
+
}, {
|
|
2831
|
+
default: withCtx(() => [
|
|
2832
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(options, (item) => {
|
|
2833
|
+
return createVNode(unref(MenuItem), {
|
|
2834
|
+
key: item.value
|
|
2835
|
+
}, {
|
|
2836
|
+
default: withCtx(() => [
|
|
2837
|
+
createVNode(unref(Checkbox), {
|
|
2838
|
+
value: item.value,
|
|
2839
|
+
style: { "width": "100%" }
|
|
2840
|
+
}, {
|
|
2841
|
+
default: withCtx(() => [
|
|
2842
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
2843
|
+
]),
|
|
2844
|
+
_: 2
|
|
2845
|
+
}, 1032, ["value"])
|
|
2846
|
+
]),
|
|
2847
|
+
_: 2
|
|
2848
|
+
}, 1024);
|
|
2849
|
+
}), 64))
|
|
2850
|
+
]),
|
|
2851
|
+
_: 1
|
|
2852
|
+
}, 8, ["value"])
|
|
2853
|
+
]),
|
|
2854
|
+
_: 1
|
|
2855
|
+
}),
|
|
2856
|
+
createVNode(unref(Divider), { style: { "margin": "0" } }),
|
|
2857
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
2858
|
+
createVNode(unref(Button), {
|
|
2859
|
+
onClick: _cache[1] || (_cache[1] = ($event) => visible.value = false)
|
|
2860
|
+
}, {
|
|
2861
|
+
default: withCtx(() => [
|
|
2862
|
+
_hoisted_5$1
|
|
2863
|
+
]),
|
|
2864
|
+
_: 1
|
|
2865
|
+
}),
|
|
2866
|
+
createVNode(unref(Button), {
|
|
2867
|
+
type: "primary",
|
|
2868
|
+
style: { "margin-left": "8px" },
|
|
2869
|
+
onClick: handOk
|
|
2870
|
+
}, {
|
|
2871
|
+
default: withCtx(() => [
|
|
2872
|
+
_hoisted_6$1
|
|
2873
|
+
]),
|
|
2874
|
+
_: 1
|
|
2875
|
+
})
|
|
2876
|
+
])
|
|
2877
|
+
]),
|
|
2878
|
+
_: 1
|
|
2879
|
+
})
|
|
2880
|
+
]),
|
|
2881
|
+
default: withCtx(() => [
|
|
2882
|
+
createVNode(unref(Button), {
|
|
2883
|
+
style: { "margin-top": "8px" },
|
|
2884
|
+
block: ""
|
|
2885
|
+
}, {
|
|
2886
|
+
default: withCtx(() => [
|
|
2887
|
+
createVNode(unref(PlusOutlined)),
|
|
2888
|
+
_hoisted_3$4
|
|
2889
|
+
]),
|
|
2890
|
+
_: 1
|
|
2891
|
+
})
|
|
2892
|
+
]),
|
|
2893
|
+
_: 1
|
|
2894
|
+
}, 8, ["visible"])
|
|
2895
|
+
]);
|
|
2896
|
+
};
|
|
2897
|
+
}
|
|
2898
|
+
});
|
|
2899
|
+
var AssociatedFields = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "associated-fields.vue"]]);
|
|
2900
|
+
|
|
2901
|
+
const _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { style: { "margin": "18px 0 6px" } }, "\u4EC5\u83B7\u53D6", -1);
|
|
2902
|
+
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { style: { "margin-top": "7px" } }, "\u4E2D\u53EF\u5206\u9500\u7684\u5546\u54C1\u6570\u636E", -1);
|
|
2903
|
+
const _hoisted_3$3 = /* @__PURE__ */ createTextVNode("\u8BF7\u5148\u6DFB\u52A0\u5173\u8054\u8868\u5355\u4E2D\u7684\u5E97\u94FA\u7EC4\u4EF6");
|
|
2904
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2905
|
+
__name: "shop-data-filter",
|
|
2906
|
+
props: ["widgetFormRules", "defaultSelectValue"],
|
|
2907
|
+
emits: ["change"],
|
|
2908
|
+
setup(__props, { emit: emits }) {
|
|
2909
|
+
const props = __props;
|
|
2910
|
+
const checkedValue = ref(!!props.defaultSelectValue);
|
|
2911
|
+
const selectValue = ref(props.defaultSelectValue);
|
|
2912
|
+
const shopRules = computed(
|
|
2913
|
+
() => props.widgetFormRules.reduce((pre, cur) => {
|
|
2914
|
+
const name = cur.config.config.name;
|
|
2915
|
+
if (name === "row" || name === "table") {
|
|
2916
|
+
cur.config.childRules.forEach((rule) => {
|
|
2917
|
+
getShop(rule, pre);
|
|
2918
|
+
});
|
|
2919
|
+
} else {
|
|
2920
|
+
getShop(cur, pre);
|
|
2921
|
+
}
|
|
2922
|
+
return pre;
|
|
2923
|
+
}, [])
|
|
2924
|
+
);
|
|
2925
|
+
const shops = computed(() => {
|
|
2926
|
+
return shopRules.value.map((shopRule) => ({
|
|
2927
|
+
value: shopRule.field,
|
|
2928
|
+
label: shopRule.title.title
|
|
2929
|
+
}));
|
|
2930
|
+
});
|
|
2931
|
+
function getShop(rule, target) {
|
|
2932
|
+
if (rule.config.config.name === "shop")
|
|
2933
|
+
target.push(rule);
|
|
2934
|
+
}
|
|
2935
|
+
function checkedValueChange(val) {
|
|
2936
|
+
if (val) {
|
|
2937
|
+
if (shops.value.length === 1) {
|
|
2938
|
+
selectValue.value = shops.value[0].value;
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2941
|
+
if (!val)
|
|
2942
|
+
selectValue.value = void 0;
|
|
2943
|
+
}
|
|
2944
|
+
function selectValueChange(val) {
|
|
2945
|
+
if (val) {
|
|
2946
|
+
checkedValue.value = true;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
function handleChange(val) {
|
|
2950
|
+
emits("change", val);
|
|
2951
|
+
}
|
|
2952
|
+
function shopLinkProduct(newField, oldField) {
|
|
2953
|
+
shopRules.value.forEach((shop) => {
|
|
2954
|
+
if (shop.field === oldField) {
|
|
2955
|
+
shop.config.linkProductCount--;
|
|
2956
|
+
}
|
|
2957
|
+
if (shop.field === newField) {
|
|
2958
|
+
if (!shop.config.linkProductCount) {
|
|
2959
|
+
shop.config.linkProductCount = 0;
|
|
2960
|
+
}
|
|
2961
|
+
shop.config.linkProductCount++;
|
|
2962
|
+
}
|
|
2963
|
+
});
|
|
2964
|
+
}
|
|
2965
|
+
watch(checkedValue, (checkedValue2) => {
|
|
2966
|
+
checkedValueChange(checkedValue2);
|
|
2967
|
+
});
|
|
2968
|
+
watch(selectValue, (selectValue2, oldSelectValue) => {
|
|
2969
|
+
selectValueChange(selectValue2);
|
|
2970
|
+
shopLinkProduct(selectValue2, oldSelectValue);
|
|
2971
|
+
handleChange(selectValue2);
|
|
2972
|
+
});
|
|
2973
|
+
return (_ctx, _cache) => {
|
|
2974
|
+
const _component_a_tooltip = resolveComponent("a-tooltip");
|
|
2975
|
+
return openBlock(), createBlock(unref(FormItemRest), null, {
|
|
2976
|
+
default: withCtx(() => [
|
|
2977
|
+
unref(shops).length ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2978
|
+
createVNode(unref(Switch), {
|
|
2979
|
+
checked: checkedValue.value,
|
|
2980
|
+
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => checkedValue.value = $event)
|
|
2981
|
+
}, null, 8, ["checked"]),
|
|
2982
|
+
checkedValue.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2983
|
+
_hoisted_1$6,
|
|
2984
|
+
createVNode(unref(Select), {
|
|
2985
|
+
value: selectValue.value,
|
|
2986
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => selectValue.value = $event),
|
|
2987
|
+
options: unref(shops),
|
|
2988
|
+
disabled: unref(shops).length === 1,
|
|
2989
|
+
"show-arrow": unref(shops).length > 1,
|
|
2990
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
2991
|
+
}, null, 8, ["value", "options", "disabled", "show-arrow"]),
|
|
2992
|
+
_hoisted_2$4
|
|
2993
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
2994
|
+
], 64)) : (openBlock(), createBlock(_component_a_tooltip, {
|
|
2995
|
+
key: 1,
|
|
2996
|
+
placement: "bottomLeft"
|
|
2997
|
+
}, {
|
|
2998
|
+
title: withCtx(() => [
|
|
2999
|
+
_hoisted_3$3
|
|
3000
|
+
]),
|
|
3001
|
+
default: withCtx(() => [
|
|
3002
|
+
createVNode(unref(Switch), { disabled: "" })
|
|
3003
|
+
]),
|
|
3004
|
+
_: 1
|
|
3005
|
+
}))
|
|
3006
|
+
]),
|
|
3007
|
+
_: 1
|
|
3008
|
+
});
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
});
|
|
3012
|
+
var ShopDataFilter = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "shop-data-filter.vue"]]);
|
|
3013
|
+
|
|
3014
|
+
const label$2 = '商品';
|
|
3015
|
+
const fieldsMap$2 = {
|
|
3016
|
+
'effect.required': 'effect.required',
|
|
3017
|
+
'config.associatedFields': 'config.associatedFields',
|
|
3018
|
+
'config.dataFiltering': 'config.dataFiltering',
|
|
3019
|
+
};
|
|
3020
|
+
const name$2 = 'product';
|
|
3021
|
+
var product = {
|
|
3022
|
+
icon: 'Product',
|
|
3023
|
+
name: name$2,
|
|
3024
|
+
label: label$2,
|
|
3025
|
+
rule() {
|
|
3026
|
+
return {
|
|
3027
|
+
type: 'ProductInfo',
|
|
3028
|
+
component: ProductInfo,
|
|
3029
|
+
field: uniqueId(),
|
|
3030
|
+
title: {
|
|
3031
|
+
title: label$2,
|
|
3032
|
+
style: {
|
|
3033
|
+
overflow: 'hidden',
|
|
3034
|
+
textOverflow: 'ellipsis',
|
|
3035
|
+
whiteSpace: 'nowrap',
|
|
3036
|
+
},
|
|
3037
|
+
},
|
|
3038
|
+
effect: {
|
|
3039
|
+
required: true,
|
|
3040
|
+
formRule: 'formRule',
|
|
3041
|
+
},
|
|
3042
|
+
config: {
|
|
3043
|
+
propsFields: Object.values(fieldsMap$2),
|
|
3044
|
+
associatedFields: [],
|
|
3045
|
+
},
|
|
3046
|
+
};
|
|
3047
|
+
},
|
|
3048
|
+
props(rule, parentRule, widgetFormRules) {
|
|
3049
|
+
return [
|
|
3050
|
+
{
|
|
3051
|
+
type: 'AssociatedFields',
|
|
3052
|
+
component: AssociatedFields,
|
|
3053
|
+
title: '关联字段',
|
|
3054
|
+
field: fieldsMap$2['config.associatedFields'],
|
|
3055
|
+
props: {
|
|
3056
|
+
associatedFields: rule.config.associatedFields,
|
|
3057
|
+
},
|
|
3058
|
+
effect: {
|
|
3059
|
+
required: true,
|
|
3060
|
+
},
|
|
3061
|
+
inject: true,
|
|
3062
|
+
on: {
|
|
3063
|
+
change({ api, self }, list) {
|
|
3064
|
+
api.emit('change', self.field, list, self, api, true);
|
|
3065
|
+
self.props.associatedFields = list;
|
|
3066
|
+
nextTick(() => {
|
|
3067
|
+
api.refresh();
|
|
3068
|
+
});
|
|
3069
|
+
},
|
|
3070
|
+
},
|
|
3071
|
+
},
|
|
3072
|
+
{
|
|
3073
|
+
type: 'ShopDataFilter',
|
|
3074
|
+
component: ShopDataFilter,
|
|
3075
|
+
title: '数据过滤',
|
|
3076
|
+
field: fieldsMap$2['config.dataFiltering'],
|
|
3077
|
+
info: '1.开启后,可以与当前表单的“店铺”控件关联进行商品数据过滤,在填写表单时满足仅可选择所选店铺下的可分销商品。' +
|
|
3078
|
+
'2.若不启用数据过滤,则不进行店铺限制,用户填写表单时可选择所有未冻结的商品数据。' +
|
|
3079
|
+
'3.开启前,请确认当前表单中已存在“店铺”控件。',
|
|
3080
|
+
props: {
|
|
3081
|
+
widgetFormRules,
|
|
3082
|
+
defaultSelectValue: rule.config.dataFiltering,
|
|
3083
|
+
},
|
|
3084
|
+
inject: true,
|
|
3085
|
+
on: {
|
|
3086
|
+
change({ api, self }, value) {
|
|
3087
|
+
api.emit('change', self.field, value, self, api, true);
|
|
3088
|
+
self.props.defaultSelectValue = value;
|
|
3089
|
+
nextTick(() => {
|
|
3090
|
+
api.refresh();
|
|
3091
|
+
});
|
|
3092
|
+
},
|
|
3093
|
+
},
|
|
3094
|
+
},
|
|
3095
|
+
{
|
|
3096
|
+
type: 'switch',
|
|
3097
|
+
title: '是否必填',
|
|
3098
|
+
field: fieldsMap$2['effect.required'],
|
|
3099
|
+
value: rule.effect.required,
|
|
3100
|
+
},
|
|
3101
|
+
];
|
|
3102
|
+
},
|
|
3103
|
+
parse(rule) {
|
|
3104
|
+
return {
|
|
3105
|
+
name: name$2,
|
|
3106
|
+
field: rule.field,
|
|
3107
|
+
effect: {
|
|
3108
|
+
required: rule.effect.required,
|
|
3109
|
+
},
|
|
3110
|
+
config: {
|
|
3111
|
+
associatedFields: rule.config.associatedFields,
|
|
3112
|
+
dataFiltering: rule.config.dataFiltering,
|
|
3113
|
+
},
|
|
3114
|
+
};
|
|
3115
|
+
},
|
|
3116
|
+
};
|
|
3117
|
+
|
|
3118
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
3119
|
+
__name: "shop-associated-fields",
|
|
3120
|
+
setup(__props) {
|
|
3121
|
+
const associatedFields = [
|
|
3122
|
+
{
|
|
3123
|
+
value: "\u5E97\u94FA\u7F16\u53F7",
|
|
3124
|
+
label: "\u5E97\u94FA\u7F16\u53F7"
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
value: "\u5E97\u94FA\u540D\u79F0",
|
|
3128
|
+
label: "\u5E97\u94FA\u540D\u79F0"
|
|
3129
|
+
}
|
|
3130
|
+
];
|
|
3131
|
+
return (_ctx, _cache) => {
|
|
3132
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3133
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(associatedFields, (item) => {
|
|
3134
|
+
return createElementVNode("span", {
|
|
3135
|
+
key: item.value,
|
|
3136
|
+
class: "bm-shop-associated-fields-item"
|
|
3137
|
+
}, toDisplayString(item.label), 1);
|
|
3138
|
+
}), 64))
|
|
3139
|
+
]);
|
|
3140
|
+
};
|
|
3141
|
+
}
|
|
3142
|
+
});
|
|
3143
|
+
var ShopAssociatedFields = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "shop-associated-fields.vue"]]);
|
|
3144
|
+
|
|
3145
|
+
let i = 0;
|
|
3146
|
+
const label$1 = '店铺';
|
|
3147
|
+
const fieldsMap$1 = {
|
|
3148
|
+
'effect.required': 'effect.required',
|
|
3149
|
+
'config.dataFiltering': 'config.dataFiltering',
|
|
3150
|
+
'config.isMain': 'config.isMain',
|
|
3151
|
+
};
|
|
3152
|
+
const name$1 = 'shop';
|
|
3153
|
+
var shop = {
|
|
3154
|
+
icon: 'Shop',
|
|
3155
|
+
name: name$1,
|
|
3156
|
+
label: label$1,
|
|
3157
|
+
rule() {
|
|
3158
|
+
return {
|
|
3159
|
+
type: 'Select',
|
|
3160
|
+
field: uniqueId(),
|
|
3161
|
+
title: {
|
|
3162
|
+
title: label$1 + ++i,
|
|
3163
|
+
style: {
|
|
3164
|
+
overflow: 'hidden',
|
|
3165
|
+
textOverflow: 'ellipsis',
|
|
3166
|
+
whiteSpace: 'nowrap',
|
|
3167
|
+
},
|
|
3168
|
+
},
|
|
3169
|
+
effect: {
|
|
3170
|
+
required: true,
|
|
3171
|
+
formRule: 'formRule',
|
|
3172
|
+
},
|
|
3173
|
+
props: {
|
|
3174
|
+
placeholder: '请选择',
|
|
3175
|
+
},
|
|
3176
|
+
config: {
|
|
3177
|
+
propsFields: Object.values(fieldsMap$1),
|
|
3178
|
+
},
|
|
3179
|
+
};
|
|
3180
|
+
},
|
|
3181
|
+
props(rule, parentRule) {
|
|
3182
|
+
return [
|
|
3183
|
+
{
|
|
3184
|
+
type: 'ShopAssociatedFields',
|
|
3185
|
+
component: ShopAssociatedFields,
|
|
3186
|
+
title: '关联字段',
|
|
3187
|
+
field: 'config.associatedFields',
|
|
3188
|
+
effect: {
|
|
3189
|
+
required: true,
|
|
3190
|
+
},
|
|
3191
|
+
},
|
|
3192
|
+
{
|
|
3193
|
+
type: 'checkbox',
|
|
3194
|
+
title: '数据过滤',
|
|
3195
|
+
field: fieldsMap$1['config.dataFiltering'],
|
|
3196
|
+
options: [
|
|
3197
|
+
{
|
|
3198
|
+
value: true,
|
|
3199
|
+
label: '当前节点操作人所负责的店铺',
|
|
3200
|
+
},
|
|
3201
|
+
],
|
|
3202
|
+
value: [rule.config.dataFiltering],
|
|
3203
|
+
inject: true,
|
|
3204
|
+
on: {
|
|
3205
|
+
change({ api, self }, value) {
|
|
3206
|
+
api.emit('change', self.field, value[0], self, api, true);
|
|
3207
|
+
},
|
|
3208
|
+
},
|
|
3209
|
+
},
|
|
3210
|
+
{
|
|
3211
|
+
type: 'switch',
|
|
3212
|
+
title: '设为主控件',
|
|
3213
|
+
info: '店铺控件在流程流转过程中涉及数据权限的控制,当表单中设置了多个店铺控件时,需设置其中1个店铺控件作为主控件。被设为主控件的店铺控件,流程流转过程中将以此店铺控件输入的数据作为数据权限判断依据。',
|
|
3214
|
+
field: fieldsMap$1['config.isMain'],
|
|
3215
|
+
value: rule.config.isMain,
|
|
3216
|
+
hidden: !!parentRule,
|
|
3217
|
+
},
|
|
3218
|
+
{
|
|
3219
|
+
type: 'switch',
|
|
3220
|
+
title: '是否必填',
|
|
3221
|
+
field: fieldsMap$1['effect.required'],
|
|
3222
|
+
value: rule.effect.required,
|
|
3223
|
+
},
|
|
3224
|
+
];
|
|
3225
|
+
},
|
|
3226
|
+
parse(rule) {
|
|
3227
|
+
return {
|
|
3228
|
+
name: name$1,
|
|
3229
|
+
field: rule.field,
|
|
3230
|
+
title: {
|
|
3231
|
+
title: rule.title.title,
|
|
3232
|
+
},
|
|
3233
|
+
effect: {
|
|
3234
|
+
required: rule.effect.required,
|
|
3235
|
+
},
|
|
3236
|
+
config: {
|
|
3237
|
+
dataFiltering: rule.config.dataFiltering,
|
|
3238
|
+
isMain: rule.config.isMain,
|
|
3239
|
+
},
|
|
3240
|
+
};
|
|
3241
|
+
},
|
|
3242
|
+
};
|
|
3243
|
+
function resetIndex() {
|
|
3244
|
+
i = 0;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
const label = '素材类型';
|
|
3248
|
+
const fieldsMap = {
|
|
3249
|
+
'effect.required': 'effect.required',
|
|
3250
|
+
'config.format': 'config.format',
|
|
3251
|
+
'props.multiple': 'props.multiple',
|
|
3252
|
+
};
|
|
3253
|
+
const name = 'materialType';
|
|
3254
|
+
var materialType = {
|
|
3255
|
+
icon: 'MaterialType',
|
|
3256
|
+
name,
|
|
3257
|
+
label,
|
|
3258
|
+
rule() {
|
|
3259
|
+
return {
|
|
3260
|
+
type: 'Select',
|
|
3261
|
+
field: uniqueId(),
|
|
3262
|
+
title: {
|
|
3263
|
+
title: label,
|
|
3264
|
+
style: {
|
|
3265
|
+
overflow: 'hidden',
|
|
3266
|
+
textOverflow: 'ellipsis',
|
|
3267
|
+
whiteSpace: 'nowrap',
|
|
3268
|
+
},
|
|
3269
|
+
},
|
|
3270
|
+
effect: {
|
|
3271
|
+
required: true,
|
|
3272
|
+
formRule: 'formRule',
|
|
3273
|
+
},
|
|
3274
|
+
props: {
|
|
3275
|
+
placeholder: '请选择',
|
|
3276
|
+
multiple: false,
|
|
3277
|
+
},
|
|
3278
|
+
config: {
|
|
3279
|
+
propsFields: Object.values(fieldsMap),
|
|
3280
|
+
format: 1,
|
|
3281
|
+
},
|
|
3282
|
+
};
|
|
3283
|
+
},
|
|
3284
|
+
props(rule, parentRule) {
|
|
3285
|
+
return [
|
|
3286
|
+
{
|
|
3287
|
+
type: 'radio',
|
|
3288
|
+
title: '格式',
|
|
3289
|
+
field: fieldsMap['config.format'],
|
|
3290
|
+
effect: {
|
|
3291
|
+
required: true,
|
|
3292
|
+
},
|
|
3293
|
+
options: [
|
|
3294
|
+
{
|
|
3295
|
+
value: 1,
|
|
3296
|
+
label: '一级分类',
|
|
3297
|
+
},
|
|
3298
|
+
{
|
|
3299
|
+
value: 2,
|
|
3300
|
+
label: '一级分类-二级分类',
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
value: 3,
|
|
3304
|
+
label: '一级分类-二级分类-三级分类',
|
|
3305
|
+
},
|
|
3306
|
+
],
|
|
3307
|
+
value: rule.config.format,
|
|
3308
|
+
className: 'form-designer-props-radio-label',
|
|
3309
|
+
},
|
|
3310
|
+
{
|
|
3311
|
+
type: 'radio',
|
|
3312
|
+
title: '选项',
|
|
3313
|
+
field: fieldsMap['props.multiple'],
|
|
3314
|
+
effect: {
|
|
3315
|
+
required: true,
|
|
3316
|
+
},
|
|
3317
|
+
options: [
|
|
3318
|
+
{
|
|
3319
|
+
value: false,
|
|
3320
|
+
label: '只能选择一种类型',
|
|
3321
|
+
},
|
|
3322
|
+
{
|
|
3323
|
+
value: true,
|
|
3324
|
+
label: '可同时选择多种类型',
|
|
3325
|
+
},
|
|
3326
|
+
],
|
|
3327
|
+
value: rule.props.multiple,
|
|
3328
|
+
className: 'form-designer-props-radio-label',
|
|
3329
|
+
},
|
|
3330
|
+
{
|
|
3331
|
+
type: 'switch',
|
|
3332
|
+
title: '是否必填',
|
|
3333
|
+
info: '勾选后可作为流程条件',
|
|
3334
|
+
field: fieldsMap['effect.required'],
|
|
3335
|
+
value: rule.effect.required,
|
|
3336
|
+
},
|
|
3337
|
+
];
|
|
3338
|
+
},
|
|
3339
|
+
parse(rule) {
|
|
3340
|
+
return {
|
|
3341
|
+
name,
|
|
3342
|
+
field: rule.field,
|
|
3343
|
+
props: {
|
|
3344
|
+
multiple: rule.props.multiple,
|
|
3345
|
+
},
|
|
3346
|
+
config: {
|
|
3347
|
+
format: rule.config.format,
|
|
3348
|
+
},
|
|
3349
|
+
effect: {
|
|
3350
|
+
required: rule.effect.required,
|
|
3351
|
+
},
|
|
3352
|
+
};
|
|
3353
|
+
},
|
|
3354
|
+
};
|
|
3355
|
+
|
|
3356
|
+
function createTab() {
|
|
3357
|
+
return [
|
|
3358
|
+
{
|
|
3359
|
+
key: 'controlLibrary',
|
|
3360
|
+
tab: '控件库',
|
|
3361
|
+
menuList: [
|
|
3362
|
+
{
|
|
3363
|
+
name: 'layout',
|
|
3364
|
+
title: '布局控件',
|
|
3365
|
+
list: [row],
|
|
3366
|
+
},
|
|
3367
|
+
{
|
|
3368
|
+
name: 'basic',
|
|
3369
|
+
title: '基础控件',
|
|
3370
|
+
list: [
|
|
3371
|
+
input,
|
|
3372
|
+
textarea,
|
|
3373
|
+
numInput,
|
|
3374
|
+
radio,
|
|
3375
|
+
checkbox,
|
|
3376
|
+
date,
|
|
3377
|
+
dateRange,
|
|
3378
|
+
instruction,
|
|
3379
|
+
],
|
|
3380
|
+
},
|
|
3381
|
+
{
|
|
3382
|
+
name: 'enhance',
|
|
3383
|
+
title: '增强控件',
|
|
3384
|
+
list: [picture, table, file, people, department],
|
|
3385
|
+
},
|
|
3386
|
+
],
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
key: 'kit',
|
|
3390
|
+
tab: '套件',
|
|
3391
|
+
menuList: [
|
|
3392
|
+
{
|
|
3393
|
+
name: 'materialKit',
|
|
3394
|
+
title: '素材套件',
|
|
3395
|
+
list: [materialTemp],
|
|
3396
|
+
},
|
|
3397
|
+
],
|
|
3398
|
+
},
|
|
3399
|
+
{
|
|
3400
|
+
key: 'associatedForm',
|
|
3401
|
+
tab: '关联表单',
|
|
3402
|
+
menuList: [
|
|
3403
|
+
{
|
|
3404
|
+
name: 'dataForm',
|
|
3405
|
+
title: '数据表单',
|
|
3406
|
+
list: [product, shop, materialType],
|
|
3407
|
+
},
|
|
3408
|
+
],
|
|
3409
|
+
},
|
|
3410
|
+
];
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
const _hoisted_1$5 = {
|
|
3414
|
+
style: { "vertical-align": "middle" },
|
|
3415
|
+
width: "199px",
|
|
3416
|
+
height: "107px",
|
|
3417
|
+
viewBox: "0 0 199 107",
|
|
3418
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3419
|
+
};
|
|
3420
|
+
const _hoisted_2$3 = /* @__PURE__ */ createStaticVNode('<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-826.000000, -249.000000)"><g transform="translate(667.000000, 71.000000)"><g transform="translate(159.000000, 178.000000)"><path d="M2,0 L197,0 C198.104569,-6.46995335e-16 199,0.8954305 199,2 L199,105 C199,106.104569 198.104569,107 197,107 L2,107 C0.8954305,107 1.3527075e-16,106.104569 0,105 L0,2 C-1.3527075e-16,0.8954305 0.8954305,2.02906125e-16 2,0 Z" fill="#F9FBFF"></path><path d="M41,6 C41.5522847,6 42,6.44771525 42,7 L42,100 C42,100.552285 41.5522847,101 41,101 L7,101 C6.44771525,101 6,100.552285 6,100 L6,7 C6,6.44771525 6.44771525,6 7,6 L41,6 Z M192,6 C192.552285,6 193,6.44771525 193,7 L193,100 C193,100.552285 192.552285,101 192,101 L159,101 C158.447715,101 158,100.552285 158,100 L158,7 C158,6.44771525 158.447715,6 159,6 L192,6 Z M151,35 C151.552285,35 152,35.4477153 152,36 L152,100 C152,100.552285 151.552285,101 151,101 L49,101 C48.4477153,101 48,100.552285 48,100 L48,36 C48,35.4477153 48.4477153,35 49,35 L151,35 Z M151,6 C151.552285,6 152,6.44771525 152,7 L152,30 C152,30.5522847 151.552285,31 151,31 L49,31 C48.4477153,31 48,30.5522847 48,30 L48,7 C48,6.44771525 48.4477153,6 49,6 L151,6 Z" fill="#EFF3FF"></path><rect stroke="#8FAAFF" fill="#D0DCFF" x="12.5" y="17.5" width="23" height="13" rx="0.5"></rect><rect fill="#E4E8F7" x="12" y="47" width="24" height="14" rx="0.5"></rect><rect fill="#E4E8F7" x="12" y="75" width="24" height="14" rx="0.5"></rect><use stroke="#AEC2FF" mask="url(#mask-2)" stroke-width="2" fill-opacity="0.26" fill="#AFC3FF" stroke-dasharray="2" xlink:href="#path-1"></use><path d="M33.5,20 C35.9852814,20 38,22.0147186 38,24.5 C38,26.9852814 35.9852814,29 33.5,29 C31.0147186,29 29,26.9852814 29,24.5 C29,22.0147186 31.0147186,20 33.5,20 Z M33.5,22 C32.1192881,22 31,23.1192881 31,24.5 C31,25.8807119 32.1192881,27 33.5,27 C34.8807119,27 36,25.8807119 36,24.5 C36,23.1192881 34.8807119,22 33.5,22 Z" fill="#2F4EED"></path><circle fill="#F9FBFF" cx="33.5" cy="24.5" r="2.5"></circle><path d="M42.5,22 C65.8354499,22 85.7454723,36.6659986 93.5155164,57.2834451 L93.7801465,55.3991118 C93.8570096,54.8522019 94.3626777,54.4711537 94.9095876,54.5480169 C95.4564976,54.6248801 95.8375458,55.1305481 95.7606826,55.677458 L94.925644,61.6190665 C94.8487808,62.1659764 94.3431128,62.5470246 93.7962028,62.4701614 L93.7673315,62.4658857 C93.5875459,62.4468789 93.4107192,62.3789077 93.2577621,62.2594045 L88.5296976,58.5654356 C88.0944913,58.2254152 88.0173279,57.5969697 88.3573483,57.1617634 C88.6973688,56.7265571 89.3258142,56.6493937 89.7610205,56.9894141 L91.887337,58.6494477 C84.582156,38.4419045 65.2276218,24 42.5,24 C40.4254117,24 38.3789284,24.1203318 36.367149,24.3543965 L36.022518,22.3809268 C38.1466458,22.1293826 40.3082134,22 42.5,22 Z" fill="#2F4EED"></path></g></g></g></g>', 1);
|
|
3421
|
+
const _hoisted_3$2 = [
|
|
3422
|
+
_hoisted_2$3
|
|
3423
|
+
];
|
|
3424
|
+
const _hoisted_4$1 = /* @__PURE__ */ createElementVNode("div", { style: { "line-height": "20px", "margin-top": "12px", "color": "#505259" } }, " \u8BF7\u62D6\u62FD\u6216\u70B9\u51FB\u5DE6\u4FA7\u5B57\u6BB5\u521B\u5EFA\u8868\u5355 ", -1);
|
|
3425
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
3426
|
+
__name: "no-data-tip",
|
|
3427
|
+
props: {},
|
|
3428
|
+
setup(__props) {
|
|
3429
|
+
return (_ctx, _cache) => {
|
|
3430
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3431
|
+
(openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$2)),
|
|
3432
|
+
_hoisted_4$1
|
|
3433
|
+
]);
|
|
3434
|
+
};
|
|
3435
|
+
}
|
|
3436
|
+
});
|
|
3437
|
+
var NoDataTip = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "no-data-tip.vue"]]);
|
|
3438
|
+
|
|
3439
|
+
const formDesignerProps = {
|
|
3440
|
+
formRules: {
|
|
3441
|
+
type: Array,
|
|
3442
|
+
default() {
|
|
3443
|
+
return [];
|
|
3444
|
+
},
|
|
3445
|
+
},
|
|
3446
|
+
presetRules: {
|
|
3447
|
+
type: Array,
|
|
3448
|
+
default() {
|
|
3449
|
+
return [];
|
|
3450
|
+
},
|
|
3451
|
+
},
|
|
3452
|
+
flowCondition: {
|
|
3453
|
+
type: Object,
|
|
3454
|
+
default() {
|
|
3455
|
+
return {};
|
|
3456
|
+
},
|
|
3457
|
+
},
|
|
3458
|
+
};
|
|
3459
|
+
|
|
3460
|
+
const _hoisted_1$4 = {
|
|
3461
|
+
key: 0,
|
|
3462
|
+
style: { "font-weight": "normal" }
|
|
3463
|
+
};
|
|
3464
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3465
|
+
__name: "table-head-count",
|
|
3466
|
+
props: ["childRules"],
|
|
3467
|
+
setup(__props) {
|
|
3468
|
+
const props = __props;
|
|
3469
|
+
const text = computed(
|
|
3470
|
+
() => props.childRules.filter((rule) => rule.type === "inputNumber" && rule.config.count).reduce((pre, item, index) => {
|
|
3471
|
+
if (index > 0)
|
|
3472
|
+
pre += "\u3001";
|
|
3473
|
+
return pre + `${item.title.title}: 0`;
|
|
3474
|
+
}, "")
|
|
3475
|
+
);
|
|
3476
|
+
return (_ctx, _cache) => {
|
|
3477
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3478
|
+
renderSlot(_ctx.$slots, "default"),
|
|
3479
|
+
unref(text) ? (openBlock(), createElementBlock("span", _hoisted_1$4, "\uFF08" + toDisplayString(unref(text)) + "\uFF09", 1)) : createCommentVNode("v-if", true)
|
|
3480
|
+
]);
|
|
3481
|
+
};
|
|
3482
|
+
}
|
|
3483
|
+
});
|
|
3484
|
+
var TableHeadCount = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "table-head-count.vue"]]);
|
|
3485
|
+
|
|
3486
|
+
const _hoisted_1$3 = { style: { "position": "absolute", "right": "0", "top": "-30px", "display": "flex", "align-items": "center" } };
|
|
3487
|
+
const _hoisted_2$2 = /* @__PURE__ */ createTextVNode("\u5FC5\u586B");
|
|
3488
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3489
|
+
__name: "checkbox-switch",
|
|
3490
|
+
props: ["rule"],
|
|
3491
|
+
setup(__props) {
|
|
3492
|
+
return (_ctx, _cache) => {
|
|
3493
|
+
return openBlock(), createElementBlock("span", _hoisted_1$3, [
|
|
3494
|
+
createVNode(unref(FormItemRest), null, {
|
|
3495
|
+
default: withCtx(() => [
|
|
3496
|
+
createVNode(unref(Checkbox), {
|
|
3497
|
+
checked: __props.rule.config.uploadPictureRule.required,
|
|
3498
|
+
"onUpdate:checked": _cache[0] || (_cache[0] = ($event) => __props.rule.config.uploadPictureRule.required = $event)
|
|
3499
|
+
}, {
|
|
3500
|
+
default: withCtx(() => [
|
|
3501
|
+
_hoisted_2$2
|
|
3502
|
+
]),
|
|
3503
|
+
_: 1
|
|
3504
|
+
}, 8, ["checked"]),
|
|
3505
|
+
createVNode(unref(Switch), {
|
|
3506
|
+
checked: __props.rule.config.uploadPictureRule.hidden,
|
|
3507
|
+
"onUpdate:checked": _cache[1] || (_cache[1] = ($event) => __props.rule.config.uploadPictureRule.hidden = $event),
|
|
3508
|
+
style: { "margin-left": "8px" },
|
|
3509
|
+
"checked-children": "\u5F00",
|
|
3510
|
+
"un-checked-children": "\u5173",
|
|
3511
|
+
"checked-value": false,
|
|
3512
|
+
"un-checked-value": true
|
|
3513
|
+
}, null, 8, ["checked"])
|
|
3514
|
+
]),
|
|
3515
|
+
_: 1
|
|
3516
|
+
})
|
|
3517
|
+
]);
|
|
3518
|
+
};
|
|
3519
|
+
}
|
|
3520
|
+
});
|
|
3521
|
+
var CheckboxSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "checkbox-switch.vue"]]);
|
|
3522
|
+
|
|
3523
|
+
const widgetsTableAccept = {
|
|
3524
|
+
[input.name]: input,
|
|
3525
|
+
[textarea.name]: textarea,
|
|
3526
|
+
[numInput.name]: numInput,
|
|
3527
|
+
[radio.name]: radio,
|
|
3528
|
+
[checkbox.name]: checkbox,
|
|
3529
|
+
[date.name]: date,
|
|
3530
|
+
[dateRange.name]: dateRange,
|
|
3531
|
+
[people.name]: people,
|
|
3532
|
+
[department.name]: department,
|
|
3533
|
+
[product.name]: product,
|
|
3534
|
+
[shop.name]: shop,
|
|
3535
|
+
[materialType.name]: materialType,
|
|
3536
|
+
};
|
|
3537
|
+
const widgetNamesRowAccept = [
|
|
3538
|
+
input.name,
|
|
3539
|
+
textarea.name,
|
|
3540
|
+
numInput.name,
|
|
3541
|
+
radio.name,
|
|
3542
|
+
checkbox.name,
|
|
3543
|
+
date.name,
|
|
3544
|
+
dateRange.name,
|
|
3545
|
+
picture.name,
|
|
3546
|
+
table.name,
|
|
3547
|
+
file.name,
|
|
3548
|
+
people.name,
|
|
3549
|
+
department.name,
|
|
3550
|
+
product.name,
|
|
3551
|
+
shop.name,
|
|
3552
|
+
materialType.name,
|
|
3553
|
+
];
|
|
3554
|
+
var ruleList = {
|
|
3555
|
+
[row.name]: row,
|
|
3556
|
+
[input.name]: input,
|
|
3557
|
+
[textarea.name]: textarea,
|
|
3558
|
+
[numInput.name]: numInput,
|
|
3559
|
+
[radio.name]: radio,
|
|
3560
|
+
[checkbox.name]: checkbox,
|
|
3561
|
+
[date.name]: date,
|
|
3562
|
+
[dateRange.name]: dateRange,
|
|
3563
|
+
[instruction.name]: instruction,
|
|
3564
|
+
[picture.name]: picture,
|
|
3565
|
+
[table.name]: table,
|
|
3566
|
+
[file.name]: file,
|
|
3567
|
+
[people.name]: people,
|
|
3568
|
+
[department.name]: department,
|
|
3569
|
+
[materialTemp.name]: materialTemp,
|
|
3570
|
+
[product.name]: product,
|
|
3571
|
+
[shop.name]: shop,
|
|
3572
|
+
[materialType.name]: materialType,
|
|
3573
|
+
};
|
|
3574
|
+
|
|
3575
|
+
const _hoisted_1$2 = { class: "bm-table-column__main" };
|
|
3576
|
+
const _hoisted_2$1 = { class: "bm-table-column-btn-wrap" };
|
|
3577
|
+
const _hoisted_3$1 = /* @__PURE__ */ createTextVNode(" \u6DFB\u52A0\u5B50\u5B57\u6BB5 ");
|
|
3578
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3579
|
+
__name: "table-column",
|
|
3580
|
+
props: ["formCreateInject"],
|
|
3581
|
+
setup(__props) {
|
|
3582
|
+
const props = __props;
|
|
3583
|
+
const handleClass = "bm-table-column__drag-icon";
|
|
3584
|
+
const btnCom = ref();
|
|
3585
|
+
const open = ref(false);
|
|
3586
|
+
const childRules = computed(() => props.formCreateInject.rule.value);
|
|
3587
|
+
const api = computed(() => props.formCreateInject.api);
|
|
3588
|
+
const options = computed(() => Object.values(widgetsTableAccept));
|
|
3589
|
+
function handleEdit(rule) {
|
|
3590
|
+
api.value.emit("setActive", rule);
|
|
3591
|
+
}
|
|
3592
|
+
function show() {
|
|
3593
|
+
open.value = true;
|
|
3594
|
+
}
|
|
3595
|
+
function hide() {
|
|
3596
|
+
open.value = false;
|
|
3597
|
+
}
|
|
3598
|
+
function handleSelect(value, config) {
|
|
3599
|
+
api.value.emit("addChildRule", config);
|
|
3600
|
+
open.value = false;
|
|
3601
|
+
btnCom.value.$el.blur();
|
|
3602
|
+
}
|
|
3603
|
+
function getPopupContainer() {
|
|
3604
|
+
return document.body;
|
|
3605
|
+
}
|
|
3606
|
+
return (_ctx, _cache) => {
|
|
3607
|
+
const _component_Delete = resolveComponent("Delete");
|
|
3608
|
+
const _component_ARow = resolveComponent("ARow");
|
|
3609
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3610
|
+
createVNode(unref(Draggable), {
|
|
3611
|
+
tag: "transition-group",
|
|
3612
|
+
"component-data": {
|
|
3613
|
+
name: "flip-list",
|
|
3614
|
+
tag: "div"
|
|
3615
|
+
},
|
|
3616
|
+
animation: 200,
|
|
3617
|
+
list: unref(childRules),
|
|
3618
|
+
handle: `.${handleClass}`,
|
|
3619
|
+
"force-fallback": true
|
|
3620
|
+
}, {
|
|
3621
|
+
item: withCtx(({ element, index }) => [
|
|
3622
|
+
createVNode(_component_ARow, {
|
|
3623
|
+
class: "bm-table-column",
|
|
3624
|
+
align: "middle"
|
|
3625
|
+
}, {
|
|
3626
|
+
default: withCtx(() => [
|
|
3627
|
+
createVNode(unref(HolderOutlined), {
|
|
3628
|
+
class: normalizeClass([handleClass])
|
|
3629
|
+
}, null, 8, ["class"]),
|
|
3630
|
+
createElementVNode("div", _hoisted_1$2, toDisplayString(element.title.title), 1),
|
|
3631
|
+
createVNode(unref(EditOutlined), {
|
|
3632
|
+
class: "bm-table-column__icon is-edit",
|
|
3633
|
+
onClick: ($event) => handleEdit(element)
|
|
3634
|
+
}, null, 8, ["onClick"]),
|
|
3635
|
+
createVNode(_component_Delete, {
|
|
3636
|
+
class: "bm-table-column__icon is-del",
|
|
3637
|
+
onClick: ($event) => unref(childRules).splice(index, 1)
|
|
3638
|
+
}, null, 8, ["onClick"])
|
|
3639
|
+
]),
|
|
3640
|
+
_: 2
|
|
3641
|
+
}, 1024)
|
|
3642
|
+
]),
|
|
3643
|
+
_: 1
|
|
3644
|
+
}, 8, ["list", "handle"]),
|
|
3645
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
3646
|
+
createVNode(unref(FormItemRest), null, {
|
|
3647
|
+
default: withCtx(() => [
|
|
3648
|
+
createVNode(unref(Select), {
|
|
3649
|
+
value: "",
|
|
3650
|
+
class: "bm-table-column__select",
|
|
3651
|
+
options: unref(options),
|
|
3652
|
+
"field-names": { value: "name" },
|
|
3653
|
+
open: open.value,
|
|
3654
|
+
"get-popup-container": getPopupContainer,
|
|
3655
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
3656
|
+
onSelect: handleSelect
|
|
3657
|
+
}, null, 8, ["options", "open"])
|
|
3658
|
+
]),
|
|
3659
|
+
_: 1
|
|
3660
|
+
}),
|
|
3661
|
+
createVNode(unref(Button), {
|
|
3662
|
+
ref_key: "btnCom",
|
|
3663
|
+
ref: btnCom,
|
|
3664
|
+
class: "bm-table-column__btn",
|
|
3665
|
+
block: "",
|
|
3666
|
+
onFocus: show,
|
|
3667
|
+
onBlur: hide
|
|
3668
|
+
}, {
|
|
3669
|
+
icon: withCtx(() => [
|
|
3670
|
+
createVNode(unref(PlusOutlined))
|
|
3671
|
+
]),
|
|
3672
|
+
default: withCtx(() => [
|
|
3673
|
+
_hoisted_3$1
|
|
3674
|
+
]),
|
|
3675
|
+
_: 1
|
|
3676
|
+
}, 512)
|
|
3677
|
+
])
|
|
3678
|
+
]);
|
|
3679
|
+
};
|
|
3680
|
+
}
|
|
3681
|
+
});
|
|
3682
|
+
var TableColumn = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "table-column.vue"]]);
|
|
3683
|
+
|
|
3684
|
+
const _hoisted_1$1 = /* @__PURE__ */ createTextVNode("change");
|
|
3685
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3686
|
+
__name: "text-color",
|
|
3687
|
+
props: ["rule"],
|
|
3688
|
+
setup(__props) {
|
|
3689
|
+
const props = __props;
|
|
3690
|
+
function handleClick() {
|
|
3691
|
+
const rule = props.rule;
|
|
3692
|
+
rule.style.color = rule.style.color === Colors.Black ? Colors.Blue : Colors.Black;
|
|
3693
|
+
}
|
|
3694
|
+
return (_ctx, _cache) => {
|
|
3695
|
+
const _component_ColorPanel = resolveComponent("ColorPanel");
|
|
3696
|
+
return openBlock(), createBlock(_component_ColorPanel, {
|
|
3697
|
+
style: normalizeStyle({
|
|
3698
|
+
position: "absolute",
|
|
3699
|
+
top: "-29px",
|
|
3700
|
+
right: 0,
|
|
3701
|
+
width: "1em",
|
|
3702
|
+
height: "1em",
|
|
3703
|
+
fontSize: "20px",
|
|
3704
|
+
color: __props.rule.style.color,
|
|
3705
|
+
cursor: "pointer"
|
|
3706
|
+
}),
|
|
3707
|
+
onClick: withModifiers(handleClick, ["prevent", "stop"])
|
|
3708
|
+
}, {
|
|
3709
|
+
default: withCtx(() => [
|
|
3710
|
+
_hoisted_1$1
|
|
3711
|
+
]),
|
|
3712
|
+
_: 1
|
|
3713
|
+
}, 8, ["style", "onClick"]);
|
|
3714
|
+
};
|
|
3715
|
+
}
|
|
3716
|
+
});
|
|
3717
|
+
var TextColor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "text-color.vue"]]);
|
|
3718
|
+
|
|
3719
|
+
const _hoisted_1 = { class: "bm-menu-title" };
|
|
3720
|
+
const _hoisted_2 = ["onClick"];
|
|
3721
|
+
const _hoisted_3 = { class: "bfd-main__warp" };
|
|
3722
|
+
const _hoisted_4 = { class: "bm-widget-form-item" };
|
|
3723
|
+
const _hoisted_5 = {
|
|
3724
|
+
key: 0,
|
|
3725
|
+
class: "bfd-sider-right__title"
|
|
3726
|
+
};
|
|
3727
|
+
const _hoisted_6 = /* @__PURE__ */ createTextVNode(" \u5355\u4E2A\u6587\u4EF6\u5927\u5C0F\u9700\u572820M\u4EE5\u5185 ");
|
|
3728
|
+
const _hoisted_7 = { class: "bfd-sider-right__form" };
|
|
3729
|
+
const _hoisted_8 = {
|
|
3730
|
+
key: 0,
|
|
3731
|
+
class: "bfd-sider-right__form__flow-releated"
|
|
3732
|
+
};
|
|
12
3733
|
const __default__ = {
|
|
13
3734
|
name: "BmFormDesigner"
|
|
14
3735
|
};
|
|
15
3736
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
3737
|
...__default__,
|
|
17
|
-
|
|
18
|
-
|
|
3738
|
+
props: formDesignerProps,
|
|
3739
|
+
setup(__props, { expose }) {
|
|
3740
|
+
const props = __props;
|
|
3741
|
+
FC.component("TableHeadCount", TableHeadCount);
|
|
3742
|
+
FC.component("TableColumn", TableColumn);
|
|
3743
|
+
FC.component("TextColor", TextColor);
|
|
3744
|
+
FC.component("CheckboxSwitch", CheckboxSwitch);
|
|
3745
|
+
FC.register({
|
|
3746
|
+
name: "formRule",
|
|
3747
|
+
init(effect, rule, api) {
|
|
3748
|
+
const config = api.config;
|
|
3749
|
+
const parentType = config.parentType;
|
|
3750
|
+
if (!rule.config.fieldRatio) {
|
|
3751
|
+
resetFieldRatio(rule, parentType);
|
|
3752
|
+
}
|
|
3753
|
+
if (rule?.props?.type === "textarea" && parentType === WidgetType.TableWidget) {
|
|
3754
|
+
rule.props.autoSize = true;
|
|
3755
|
+
}
|
|
3756
|
+
if (rule.config.config.name === "product" && parentType === WidgetType.TableWidget) {
|
|
3757
|
+
rule.type = "input";
|
|
3758
|
+
delete rule.component;
|
|
3759
|
+
rule.title.title = "\u5546\u54C1\u7F16\u53F7";
|
|
3760
|
+
rule.props = {};
|
|
3761
|
+
rule.props.placeholder = "\u8BF7\u8F93\u5165";
|
|
3762
|
+
}
|
|
3763
|
+
}
|
|
3764
|
+
});
|
|
3765
|
+
const showDragTip = ref(true);
|
|
3766
|
+
const tabData = createTab();
|
|
3767
|
+
const activeKey = ref("controlLibrary");
|
|
3768
|
+
const widgetFormRules = reactive([]);
|
|
3769
|
+
const activeRule = ref({});
|
|
3770
|
+
const cacheProps = reactive({});
|
|
3771
|
+
const fApi = ref();
|
|
3772
|
+
const activeParentRule = ref();
|
|
3773
|
+
const menuList = computed(
|
|
3774
|
+
() => tabData.find((tab) => tab.key === activeKey.value).menuList
|
|
3775
|
+
);
|
|
3776
|
+
const activeProps = computed(() => cacheProps[activeRule.value.field]);
|
|
3777
|
+
const activeRuleInList = computed(
|
|
3778
|
+
() => activeParentRule.value?.config?.childRules || widgetFormRules
|
|
3779
|
+
);
|
|
3780
|
+
function hideShowDragTip() {
|
|
3781
|
+
showDragTip.value = false;
|
|
3782
|
+
}
|
|
3783
|
+
function handleTabChange(key) {
|
|
3784
|
+
activeKey.value = key;
|
|
3785
|
+
}
|
|
3786
|
+
function cloneMenuItem(original) {
|
|
3787
|
+
return makeRule(original);
|
|
3788
|
+
}
|
|
3789
|
+
function checkDragMove(evt) {
|
|
3790
|
+
const draggedData = evt.dragged._underlying_vm_ || {};
|
|
3791
|
+
const toComponentData = evt.to.__draggable_component__.componentData || {};
|
|
3792
|
+
const widgetNameDragged = draggedData?.config?.config?.name;
|
|
3793
|
+
if (toComponentData.type === WidgetType.RowWidget && !widgetNamesRowAccept.includes(widgetNameDragged) || toComponentData.type === WidgetType.TableWidget && !Object.keys(widgetsTableAccept).includes(widgetNameDragged)) {
|
|
3794
|
+
widgetFormRules.forEach((rule) => {
|
|
3795
|
+
rule.config.putDisabled = rule.field === toComponentData.field;
|
|
3796
|
+
});
|
|
3797
|
+
return false;
|
|
3798
|
+
} else {
|
|
3799
|
+
widgetFormRules.forEach((rule) => {
|
|
3800
|
+
rule.config.putDisabled = false;
|
|
3801
|
+
});
|
|
3802
|
+
}
|
|
3803
|
+
}
|
|
3804
|
+
function moveMenuItem(evt) {
|
|
3805
|
+
return checkDragMove(evt);
|
|
3806
|
+
}
|
|
3807
|
+
function moveFormItem(evt) {
|
|
3808
|
+
return checkDragMove(evt);
|
|
3809
|
+
}
|
|
3810
|
+
function handleMenuItemDragStart(evt) {
|
|
3811
|
+
const item = evt.item.children[0];
|
|
3812
|
+
const cloneItem = evt.clone.children[0];
|
|
3813
|
+
item.style.opacity = 0.3;
|
|
3814
|
+
cloneItem.style.opacity = 0.3;
|
|
3815
|
+
item.style.color = "#2F4EED";
|
|
3816
|
+
cloneItem.style.color = "#2F4EED";
|
|
3817
|
+
}
|
|
3818
|
+
function resetPutDisabled() {
|
|
3819
|
+
widgetFormRules.forEach((rule) => {
|
|
3820
|
+
rule.config.putDisabled = false;
|
|
3821
|
+
});
|
|
3822
|
+
}
|
|
3823
|
+
function handleMenuItemDragEnd(evt) {
|
|
3824
|
+
evt.item.children[0].style.opacity = "";
|
|
3825
|
+
evt.item.children[0].style.color = "";
|
|
3826
|
+
resetPutDisabled();
|
|
3827
|
+
}
|
|
3828
|
+
function handleMenuItemClick(config) {
|
|
3829
|
+
const rule = makeRule(config);
|
|
3830
|
+
const activeParentRuleName = activeParentRule.value?.config?.config?.name;
|
|
3831
|
+
if (!widgetNamesRowAccept.includes(config.name) && activeParentRuleName === "row" || !Object.keys(widgetsTableAccept).includes(config.name) && activeParentRuleName === "table") {
|
|
3832
|
+
disabledTip(activeParentRule.value.config.config.name);
|
|
3833
|
+
} else {
|
|
3834
|
+
const index = activeRuleInList.value.findIndex(
|
|
3835
|
+
(item) => item.field === activeRule.value.field
|
|
3836
|
+
);
|
|
3837
|
+
activeRuleInList.value.splice(index + 1, 0, rule);
|
|
3838
|
+
setActiveRule(rule, activeParentRule.value);
|
|
3839
|
+
hideShowDragTip();
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
function makeRule(config) {
|
|
3843
|
+
const rule = config.rule();
|
|
3844
|
+
rule.config.config = config;
|
|
3845
|
+
return rule;
|
|
3846
|
+
}
|
|
3847
|
+
function disabledTip(name) {
|
|
3848
|
+
message.warning({
|
|
3849
|
+
content: name === "table" ? "\u8BE5\u63A7\u4EF6\u6682\u4E0D\u652F\u6301\u62D6\u5165\u8868\u683C\u4E2D" : "\u8BE5\u63A7\u4EF6\u6682\u4E0D\u652F\u6301\u5206\u680F",
|
|
3850
|
+
class: "bm-form-designer__message-warning"
|
|
3851
|
+
});
|
|
3852
|
+
}
|
|
3853
|
+
function putDisabledTip() {
|
|
3854
|
+
const targetRule = widgetFormRules.find((rule) => rule.config.putDisabled);
|
|
3855
|
+
if (targetRule) {
|
|
3856
|
+
disabledTip(targetRule.config.config.name);
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
function dragAdd(rule, parentRule = void 0) {
|
|
3860
|
+
resetFieldRatio(rule, parentRule?.type);
|
|
3861
|
+
if (cacheProps[rule.field])
|
|
3862
|
+
delete cacheProps[rule.field];
|
|
3863
|
+
setActiveRule(rule, parentRule);
|
|
3864
|
+
putDisabledTip();
|
|
3865
|
+
}
|
|
3866
|
+
function handleFormItemAdd({ newIndex }) {
|
|
3867
|
+
const rule = widgetFormRules[newIndex];
|
|
3868
|
+
dragAdd(rule);
|
|
3869
|
+
hideShowDragTip();
|
|
3870
|
+
}
|
|
3871
|
+
function handleFormItemUpdate({ newIndex }) {
|
|
3872
|
+
const rule = widgetFormRules[newIndex];
|
|
3873
|
+
if (rule)
|
|
3874
|
+
setActiveRule(widgetFormRules[newIndex]);
|
|
3875
|
+
}
|
|
3876
|
+
function handleFormItemDragEnd() {
|
|
3877
|
+
putDisabledTip();
|
|
3878
|
+
resetPutDisabled();
|
|
3879
|
+
}
|
|
3880
|
+
function handleFormItemClick(rule) {
|
|
3881
|
+
setActiveRule(rule);
|
|
3882
|
+
}
|
|
3883
|
+
function makeChildRules(ruleList2) {
|
|
3884
|
+
return ruleList2.map((rule) => makeRule(rule.config.config));
|
|
3885
|
+
}
|
|
3886
|
+
function handleFormItemCopy(rule, parentRule) {
|
|
3887
|
+
const newRule = makeRule(rule.config.config);
|
|
3888
|
+
const list = parentRule?.config?.childRules || widgetFormRules;
|
|
3889
|
+
const index = list.findIndex((ruleItem) => ruleItem.field === rule.field);
|
|
3890
|
+
if (rule.config.childRules?.length) {
|
|
3891
|
+
newRule.config.childRules.push(...makeChildRules(rule.config.childRules));
|
|
3892
|
+
}
|
|
3893
|
+
list.splice(index + 1, 0, newRule);
|
|
3894
|
+
copyPropValue(rule, newRule);
|
|
3895
|
+
setActiveRule(newRule, parentRule);
|
|
3896
|
+
}
|
|
3897
|
+
function handleFormItemDelete(targetRule, parentRule) {
|
|
3898
|
+
if (targetRule.config.linkProductCount > 0) {
|
|
3899
|
+
message.error("\u8BE5\u63A7\u4EF6\u5DF2\u88AB\u8BBE\u4E3A\u6570\u636E\u8FC7\u6EE4\u6761\u4EF6\uFF0C\u4E0D\u53EF\u5220\u9664\u3002");
|
|
3900
|
+
return;
|
|
3901
|
+
}
|
|
3902
|
+
const parentList = parentRule?.config?.childRules || widgetFormRules;
|
|
3903
|
+
const index = parentList.findIndex((rule) => rule.field === targetRule.field);
|
|
3904
|
+
parentList.splice(index, 1);
|
|
3905
|
+
delete cacheProps[targetRule.field];
|
|
3906
|
+
if (targetRule.field === activeRule.value.field) {
|
|
3907
|
+
const newIndex = Math.min(parentList.length - 1, index);
|
|
3908
|
+
if (newIndex >= 0) {
|
|
3909
|
+
setActiveRule(parentList[newIndex]);
|
|
3910
|
+
} else if (parentRule) {
|
|
3911
|
+
setActiveRule(parentRule);
|
|
3912
|
+
} else {
|
|
3913
|
+
activeRule.value = {};
|
|
3914
|
+
}
|
|
3915
|
+
} else if (targetRule?.config?.childRules?.some(
|
|
3916
|
+
(rule) => rule.field === activeRule.value.field
|
|
3917
|
+
)) {
|
|
3918
|
+
const newIndex = Math.min(parentList.length - 1, index);
|
|
3919
|
+
if (newIndex >= 0) {
|
|
3920
|
+
setActiveRule(parentList[newIndex]);
|
|
3921
|
+
} else {
|
|
3922
|
+
activeRule.value = {};
|
|
3923
|
+
activeParentRule.value = widgetFormRules;
|
|
3924
|
+
}
|
|
3925
|
+
}
|
|
3926
|
+
}
|
|
3927
|
+
function makePropRule(rule, parentRule) {
|
|
3928
|
+
return rule.config.config.props(rule, parentRule, widgetFormRules);
|
|
3929
|
+
}
|
|
3930
|
+
function setActiveRule(rule, parentRule = void 0) {
|
|
3931
|
+
activeRule.value = rule;
|
|
3932
|
+
activeParentRule.value = parentRule;
|
|
3933
|
+
widgetFormRules.forEach((item) => {
|
|
3934
|
+
if (item.type === WidgetType.RowWidget || item.type === WidgetType.TableWidget) {
|
|
3935
|
+
nextTick(() => {
|
|
3936
|
+
item.props.activeRule = rule;
|
|
3937
|
+
});
|
|
3938
|
+
}
|
|
3939
|
+
});
|
|
3940
|
+
if (!cacheProps[rule.field]) {
|
|
3941
|
+
cacheProps[rule.field] = makePropRule(rule, parentRule);
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
function propChange(field, value) {
|
|
3945
|
+
setRulePropValue(field, value, activeRule.value);
|
|
3946
|
+
}
|
|
3947
|
+
function setRulePropValue(field, value, rule) {
|
|
3948
|
+
field.split(".").reduce((pre, cur, index, arr) => {
|
|
3949
|
+
if (index === arr.length - 1) {
|
|
3950
|
+
pre[cur] = value;
|
|
3951
|
+
} else {
|
|
3952
|
+
if (!pre[cur]) {
|
|
3953
|
+
pre[cur] = {};
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
return pre[cur];
|
|
3957
|
+
}, rule);
|
|
3958
|
+
}
|
|
3959
|
+
function copyPropValue(oldRule, newRule) {
|
|
3960
|
+
newRule.config.propsFields.forEach((field) => {
|
|
3961
|
+
if (field !== "config.childRules")
|
|
3962
|
+
setRulePropValue(field, cloneDeep(getValue(field, oldRule)), newRule);
|
|
3963
|
+
});
|
|
3964
|
+
if (newRule.config.childRules?.length) {
|
|
3965
|
+
newRule.config.childRules.forEach((rule, index) => {
|
|
3966
|
+
copyPropValue(oldRule.config.childRules[index], rule);
|
|
3967
|
+
});
|
|
3968
|
+
}
|
|
3969
|
+
}
|
|
3970
|
+
function handleWidgetAdd(rule, parentRule) {
|
|
3971
|
+
dragAdd(rule, parentRule);
|
|
3972
|
+
}
|
|
3973
|
+
function handlePropsSetActive(rule) {
|
|
3974
|
+
setActiveRule(rule, activeRule.value);
|
|
3975
|
+
}
|
|
3976
|
+
function handleAddChildRule(config) {
|
|
3977
|
+
const rule = makeRule(config);
|
|
3978
|
+
activeRule.value.config.childRules.push(rule);
|
|
3979
|
+
}
|
|
3980
|
+
function getValue(field, oldRule) {
|
|
3981
|
+
return field.split(".").reduce((pre, cur) => {
|
|
3982
|
+
return pre[cur];
|
|
3983
|
+
}, oldRule);
|
|
3984
|
+
}
|
|
3985
|
+
function resetFieldRatio(rule, parentRuleType) {
|
|
3986
|
+
if (!parentRuleType) {
|
|
3987
|
+
rule.config.fieldRatio = "100%";
|
|
3988
|
+
} else if (parentRuleType === WidgetType.RowWidget) {
|
|
3989
|
+
const ruleName = rule.config.config.name;
|
|
3990
|
+
rule.config.fieldRatio = ruleName === "table" || ruleName === "product" ? 24 : 12;
|
|
3991
|
+
} else if (parentRuleType === WidgetType.TableWidget) {
|
|
3992
|
+
rule.config.fieldRatio = "140px";
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
function getFormRule() {
|
|
3996
|
+
return widgetFormRules.map((rule) => {
|
|
3997
|
+
const ruleParsed = parseRule(rule);
|
|
3998
|
+
const childRules = rule?.config?.childRules;
|
|
3999
|
+
if (childRules?.length) {
|
|
4000
|
+
const childRulesParsed = ruleParsed.config.childRules = [];
|
|
4001
|
+
childRules.forEach((ruleItem) => {
|
|
4002
|
+
childRulesParsed.push(parseRule(ruleItem));
|
|
4003
|
+
});
|
|
4004
|
+
}
|
|
4005
|
+
return ruleParsed;
|
|
4006
|
+
});
|
|
4007
|
+
}
|
|
4008
|
+
function parseRule(rule) {
|
|
4009
|
+
return rule.config.config.parse(rule);
|
|
4010
|
+
}
|
|
4011
|
+
function edit(formRules) {
|
|
4012
|
+
formRules.forEach((item) => {
|
|
4013
|
+
const rule = makeRule(ruleList[item.name]);
|
|
4014
|
+
delete item.name;
|
|
4015
|
+
if (item?.config?.childRules?.length) {
|
|
4016
|
+
rule.config.childRules = item.config.childRules.map((childItem) => {
|
|
4017
|
+
const childRule = makeRule(ruleList[childItem.name]);
|
|
4018
|
+
delete childItem.name;
|
|
4019
|
+
return childRule;
|
|
4020
|
+
});
|
|
4021
|
+
}
|
|
4022
|
+
merge(rule, item);
|
|
4023
|
+
widgetFormRules.push(rule);
|
|
4024
|
+
});
|
|
4025
|
+
}
|
|
4026
|
+
function getRule(name) {
|
|
4027
|
+
return makeRule(ruleList[name]);
|
|
4028
|
+
}
|
|
4029
|
+
watch(
|
|
4030
|
+
() => props.presetRules,
|
|
4031
|
+
(presetRules) => {
|
|
4032
|
+
widgetFormRules.push(...presetRules);
|
|
4033
|
+
},
|
|
19
4034
|
{
|
|
20
|
-
|
|
21
|
-
title: "\u5546\u54C1\u540D\u79F0",
|
|
22
|
-
field: "goods_name"
|
|
4035
|
+
immediate: true
|
|
23
4036
|
}
|
|
24
|
-
|
|
4037
|
+
);
|
|
4038
|
+
watch(
|
|
4039
|
+
() => props.formRules,
|
|
4040
|
+
(formRules) => {
|
|
4041
|
+
edit(formRules);
|
|
4042
|
+
},
|
|
4043
|
+
{
|
|
4044
|
+
immediate: true
|
|
4045
|
+
}
|
|
4046
|
+
);
|
|
4047
|
+
onBeforeUnmount(() => {
|
|
4048
|
+
resetIndex();
|
|
4049
|
+
});
|
|
4050
|
+
expose({
|
|
4051
|
+
getFormRule,
|
|
4052
|
+
getRule
|
|
4053
|
+
});
|
|
25
4054
|
return (_ctx, _cache) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
4055
|
+
const _component_ACol = resolveComponent("ACol");
|
|
4056
|
+
const _component_ARow = resolveComponent("ARow");
|
|
4057
|
+
const _component_FormCreate = resolveComponent("FormCreate");
|
|
4058
|
+
return openBlock(), createBlock(unref(Layout), { class: "bm-form-designer" }, {
|
|
4059
|
+
default: withCtx(() => [
|
|
4060
|
+
createVNode(unref(LayoutSider), {
|
|
4061
|
+
class: "bfd-sider-left",
|
|
4062
|
+
width: "260"
|
|
4063
|
+
}, {
|
|
4064
|
+
default: withCtx(() => [
|
|
4065
|
+
createVNode(_component_ARow, { class: "bm-tabs" }, {
|
|
4066
|
+
default: withCtx(() => [
|
|
4067
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabData), (item) => {
|
|
4068
|
+
return openBlock(), createBlock(_component_ACol, {
|
|
4069
|
+
key: item.key,
|
|
4070
|
+
class: normalizeClass(["bm-tabs-item", activeKey.value === item.key ? "active" : ""]),
|
|
4071
|
+
onClick: ($event) => handleTabChange(item.key)
|
|
4072
|
+
}, {
|
|
4073
|
+
default: withCtx(() => [
|
|
4074
|
+
createTextVNode(toDisplayString(item.tab), 1)
|
|
4075
|
+
]),
|
|
4076
|
+
_: 2
|
|
4077
|
+
}, 1032, ["class", "onClick"]);
|
|
4078
|
+
}), 128))
|
|
4079
|
+
]),
|
|
4080
|
+
_: 1
|
|
4081
|
+
}),
|
|
4082
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(menuList), (item, index) => {
|
|
4083
|
+
return openBlock(), createElementBlock("div", { key: index }, [
|
|
4084
|
+
createElementVNode("div", _hoisted_1, toDisplayString(item.title), 1),
|
|
4085
|
+
createVNode(unref(Draggable), {
|
|
4086
|
+
class: "bm-menu-wrap",
|
|
4087
|
+
list: item.list,
|
|
4088
|
+
group: { name: "widget", pull: "clone", put: false },
|
|
4089
|
+
"item-key": "name",
|
|
4090
|
+
sort: false,
|
|
4091
|
+
clone: cloneMenuItem,
|
|
4092
|
+
move: moveMenuItem,
|
|
4093
|
+
"force-fallback": true,
|
|
4094
|
+
"scroll-sensitivity": 100,
|
|
4095
|
+
delay: 50,
|
|
4096
|
+
onStart: handleMenuItemDragStart,
|
|
4097
|
+
onEnd: handleMenuItemDragEnd
|
|
4098
|
+
}, {
|
|
4099
|
+
item: withCtx(({ element }) => [
|
|
4100
|
+
createElementVNode("div", {
|
|
4101
|
+
style: normalizeStyle({ flexBasis: item.name === "dataForm" ? "100%" : "50%" }),
|
|
4102
|
+
class: "bm-menu-item-wrap"
|
|
4103
|
+
}, [
|
|
4104
|
+
createElementVNode("div", {
|
|
4105
|
+
class: "bm-menu-item",
|
|
4106
|
+
onClick: ($event) => handleMenuItemClick(element)
|
|
4107
|
+
}, [
|
|
4108
|
+
(openBlock(), createBlock(resolveDynamicComponent(element.icon), { class: "bm-menu-icon" })),
|
|
4109
|
+
createTextVNode(" " + toDisplayString(element.label), 1)
|
|
4110
|
+
], 8, _hoisted_2),
|
|
4111
|
+
createVNode(DragPlaceholder)
|
|
4112
|
+
], 4)
|
|
4113
|
+
]),
|
|
4114
|
+
_: 2
|
|
4115
|
+
}, 1032, ["list"])
|
|
4116
|
+
]);
|
|
4117
|
+
}), 128))
|
|
4118
|
+
]),
|
|
4119
|
+
_: 1
|
|
4120
|
+
}),
|
|
4121
|
+
createVNode(unref(LayoutContent), { class: "bfd-main" }, {
|
|
4122
|
+
default: withCtx(() => [
|
|
4123
|
+
createElementVNode("div", _hoisted_3, [
|
|
4124
|
+
createVNode(unref(Draggable), {
|
|
4125
|
+
list: widgetFormRules,
|
|
4126
|
+
class: "bm-widget-form",
|
|
4127
|
+
group: {
|
|
4128
|
+
name: "formWidget",
|
|
4129
|
+
pull: true,
|
|
4130
|
+
put: ["widget", "formWidget", "rowWidget"]
|
|
4131
|
+
},
|
|
4132
|
+
"item-key": "field",
|
|
4133
|
+
"ghost-class": "form-item-drag-ghost",
|
|
4134
|
+
move: moveFormItem,
|
|
4135
|
+
"force-fallback": true,
|
|
4136
|
+
delay: 50,
|
|
4137
|
+
onAdd: handleFormItemAdd,
|
|
4138
|
+
onUpdate: handleFormItemUpdate,
|
|
4139
|
+
onEnd: handleFormItemDragEnd
|
|
4140
|
+
}, {
|
|
4141
|
+
item: withCtx(({ element }) => [
|
|
4142
|
+
createElementVNode("div", _hoisted_4, [
|
|
4143
|
+
createVNode(DragTool, {
|
|
4144
|
+
rule: element,
|
|
4145
|
+
"active-rule": activeRule.value,
|
|
4146
|
+
style: normalizeStyle({
|
|
4147
|
+
width: element.config.fieldRatio
|
|
4148
|
+
}),
|
|
4149
|
+
onCopy: handleFormItemCopy,
|
|
4150
|
+
onDelete: handleFormItemDelete,
|
|
4151
|
+
onClick: ($event) => handleFormItemClick(element),
|
|
4152
|
+
onSetActiveRule: setActiveRule,
|
|
4153
|
+
onWidgetAdd: handleWidgetAdd
|
|
4154
|
+
}, null, 8, ["rule", "active-rule", "style", "onClick"]),
|
|
4155
|
+
createVNode(DragPlaceholder)
|
|
4156
|
+
])
|
|
4157
|
+
]),
|
|
4158
|
+
_: 1
|
|
4159
|
+
}, 8, ["list"]),
|
|
4160
|
+
showDragTip.value && !_ctx.formRules.length ? (openBlock(), createBlock(NoDataTip, {
|
|
4161
|
+
key: 0,
|
|
4162
|
+
class: "bm-no-data-tip"
|
|
4163
|
+
})) : createCommentVNode("v-if", true)
|
|
4164
|
+
])
|
|
4165
|
+
]),
|
|
4166
|
+
_: 1
|
|
4167
|
+
}),
|
|
4168
|
+
createVNode(unref(LayoutSider), {
|
|
4169
|
+
class: "bfd-sider-right",
|
|
4170
|
+
width: "288"
|
|
4171
|
+
}, {
|
|
4172
|
+
default: withCtx(() => [
|
|
4173
|
+
activeRule.value.field ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
4174
|
+
(openBlock(), createBlock(resolveDynamicComponent(activeRule.value.config?.config.icon))),
|
|
4175
|
+
createTextVNode(" " + toDisplayString(activeRule.value.config?.config.label) + " ", 1),
|
|
4176
|
+
activeRule.value.type === unref(WidgetType).UploadFile ? (openBlock(), createBlock(unref(Tooltip), { key: 0 }, {
|
|
4177
|
+
title: withCtx(() => [
|
|
4178
|
+
_hoisted_6
|
|
4179
|
+
]),
|
|
4180
|
+
default: withCtx(() => [
|
|
4181
|
+
createVNode(unref(QuestionCircleOutlined), { style: { "color": "#babac1", "font-size": "14px", "margin-left": "5px" } })
|
|
4182
|
+
]),
|
|
4183
|
+
_: 1
|
|
4184
|
+
})) : createCommentVNode("v-if", true)
|
|
4185
|
+
])) : createCommentVNode("v-if", true),
|
|
4186
|
+
createElementVNode("div", _hoisted_7, [
|
|
4187
|
+
_ctx.flowCondition[activeRule.value.field] ? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
4188
|
+
createVNode(unref(ExclamationCircleFilled), { style: { "color": "#2f4eed" } }),
|
|
4189
|
+
createTextVNode(" \u8BE5\u7EC4\u4EF6\u5728\u201C" + toDisplayString(_ctx.flowCondition[activeRule.value.field]) + "\u201D\u5DF2\u88AB\u8BBE\u4E3A\u5BA1\u6279\u6761\u4EF6\uFF0C\u9664\u201C\u5FC5\u586B\u3001\u9009\u9879\u201D\u8BBE\u7F6E\u4E0D\u53EF\u4FEE\u6539\uFF0C\u5176\u4ED6\u4FE1\u606F\u53EF\u4FEE\u6539 ", 1)
|
|
4190
|
+
])) : createCommentVNode("v-if", true),
|
|
4191
|
+
createVNode(_component_FormCreate, {
|
|
4192
|
+
api: fApi.value,
|
|
4193
|
+
"onUpdate:api": _cache[0] || (_cache[0] = ($event) => fApi.value = $event),
|
|
4194
|
+
option: {
|
|
4195
|
+
form: {
|
|
4196
|
+
layout: "vertical"
|
|
4197
|
+
},
|
|
4198
|
+
submitBtn: {
|
|
4199
|
+
show: false
|
|
4200
|
+
},
|
|
4201
|
+
info: {
|
|
4202
|
+
type: "tooltip",
|
|
4203
|
+
align: "left",
|
|
4204
|
+
arrowPointAtCenter: true,
|
|
4205
|
+
overlayStyle: {
|
|
4206
|
+
width: "184px"
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
},
|
|
4210
|
+
rule: unref(activeProps),
|
|
4211
|
+
onChange: propChange,
|
|
4212
|
+
onSetActive: handlePropsSetActive,
|
|
4213
|
+
onAddChildRule: handleAddChildRule
|
|
4214
|
+
}, null, 8, ["api", "rule"])
|
|
4215
|
+
])
|
|
4216
|
+
]),
|
|
4217
|
+
_: 1
|
|
4218
|
+
})
|
|
4219
|
+
]),
|
|
4220
|
+
_: 1
|
|
4221
|
+
});
|
|
28
4222
|
};
|
|
29
4223
|
}
|
|
30
4224
|
});
|