@kp-ui/lowcode 1.0.32 → 1.0.34
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/_virtual/virtual_svg-icons-register.js +2 -2
- package/package.json +27 -26
- package/render.js +44 -18
- package/src/api/useFilesystemApi/filesystem/index.js +1 -1
- package/src/components/CustomRender/components/AttachmentRender.vue.js +1 -1
- package/src/components/CustomRender/components/AttachmentRender.vue2.js +38 -55
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue.js +103 -234
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue2.js +236 -0
- package/src/components/form-designer/form-widget/container-widget/{grid-widget.vue2.js → grid-widget.vue.js} +1 -1
- package/src/components/form-designer/form-widget/container-widget/index.js +4 -4
- package/src/components/form-designer/form-widget/container-widget/{table-widget.vue2.js → table-widget.vue.js} +1 -1
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue.js +156 -126
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue2.js +128 -0
- package/src/components/form-designer/form-widget/field-widget/fieldMixin.js +8 -1
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue.js +1 -1
- package/src/components/form-designer/form-widget/field-widget/file-upload-widget.vue2.js +19 -29
- package/src/components/form-designer/form-widget/index.vue.js +4 -4
- package/src/components/form-designer/toolbar-panel/index.vue.js +3 -2
- package/src/components/form-designer/widget-panel/advanced/attachment-render.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/bpmn-editor.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/cascader.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/code-editor.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/diy-compontent.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/slot.js +1 -1
- package/src/components/form-designer/widget-panel/advanced/tree-select.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/button.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/checkbox.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/color.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/date.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/dateRange.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/divider.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/dropdown.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/htmlText.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/input.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/number.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/radio.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/rate.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/select.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/slider.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/staticText.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/switch.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/textarea.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/time.js +1 -1
- package/src/components/form-designer/widget-panel/basicFields/timeRange.js +1 -1
- package/src/components/form-designer/widget-panel/business/department-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/material-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/operation-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/post-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/project-group-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/project-select.js +1 -1
- package/src/components/form-designer/widget-panel/business/user-select.js +1 -1
- package/src/components/form-designer/widget-panel/containers/data-table.js +1 -1
- package/src/components/form-designer/widget-panel/containers/grid-col.js +1 -1
- package/src/components/form-designer/widget-panel/containers/grid-sub-form.js +1 -1
- package/src/components/form-designer/widget-panel/containers/grid.js +1 -1
- package/src/components/form-designer/widget-panel/containers/tab-pane.js +1 -1
- package/src/components/form-designer/widget-panel/containers/tab.js +1 -1
- package/src/components/form-designer/widget-panel/containers/vf-box.js +1 -1
- package/src/components/form-designer/widget-panel/containers/vf-collapse.js +1 -1
- package/src/components/form-designer/widget-panel/containers/vf-dialog.js +1 -1
- package/src/components/http-editor/index.vue.js +1 -1
- package/src/components/http-editor/index.vue2.js +1 -2
- package/src/hooks/useFilePreview.js +16 -6
- package/src/utils/request/fmtHttpParams.js +21 -7
- package/src/utils/sfc-generator.js +1 -0
- package/src/utils/util.js +1 -21
- package/styles/style.css +1 -1
- package/types/src/components/CustomRender/components/AttachmentRender.d.ts.map +1 -1
- package/types/src/components/form-render/index.d.ts.map +1 -1
- package/types/src/hooks/useFilePreview.d.ts +4 -0
- package/types/src/hooks/useFilePreview.d.ts.map +1 -1
- package/types/src/utils/request/http.d.ts +2 -3
- package/types/src/utils/request/http.d.ts.map +1 -1
- package/src/components/form-designer/form-widget/container-widget/data-table-widget.vue3.js +0 -105
- package/src/components/form-designer/form-widget/container-widget/vf-collapse-widget.vue4.js +0 -158
- package/src/utils/request/handleAxiosError.js +0 -31
- package/src/utils/request/http.js +0 -88
- package/src/utils/request/useGetUseInfo.js +0 -9
- package/types/src/utils/request/useGetUseInfo.d.ts +0 -23
- package/types/src/utils/request/useGetUseInfo.d.ts.map +0 -1
|
@@ -1,128 +1,158 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
1
|
+
import _sfc_main from "./vf-collapse-widget.vue2.js";
|
|
2
|
+
import { resolveComponent, createBlock, openBlock, withCtx, createElementBlock, withModifiers, normalizeClass, createElementVNode, createVNode, createCommentVNode, mergeProps, resolveDynamicComponent, Transition, withDirectives, normalizeStyle, vShow } from "vue";
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
import _export_sfc from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const _hoisted_1 = { class: "tpf-collapse" };
|
|
7
|
+
const _hoisted_2 = { class: "tpf-collapse-header" };
|
|
8
|
+
const _hoisted_3 = { class: "form-widget-list" };
|
|
9
|
+
const _hoisted_4 = { class: "form-widget-list" };
|
|
10
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
+
const _component_TpfCollapseTitle = resolveComponent("TpfCollapseTitle");
|
|
12
|
+
const _component_SvgIcon = resolveComponent("SvgIcon");
|
|
13
|
+
const _component_a_space = resolveComponent("a-space");
|
|
14
|
+
const _component_draggable = resolveComponent("draggable");
|
|
15
|
+
const _component_VFormRender = resolveComponent("VFormRender");
|
|
16
|
+
const _component_container_wrapper = resolveComponent("container-wrapper");
|
|
17
|
+
return openBlock(), createBlock(_component_container_wrapper, {
|
|
18
|
+
designer: $props.designer,
|
|
19
|
+
widget: $props.widget,
|
|
20
|
+
"parent-widget": $props.parentWidget,
|
|
21
|
+
"parent-list": $props.parentList,
|
|
22
|
+
"index-of-parent-list": $props.indexOfParentList
|
|
23
|
+
}, {
|
|
24
|
+
default: withCtx(() => [
|
|
25
|
+
(openBlock(), createElementBlock("div", {
|
|
26
|
+
key: $props.widget.id,
|
|
27
|
+
class: normalizeClass(["collapse-container data-table-container", { selected: $options.selected }]),
|
|
28
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
|
|
29
|
+
}, [
|
|
30
|
+
createElementVNode("div", _hoisted_1, [
|
|
31
|
+
createElementVNode("div", _hoisted_2, [
|
|
32
|
+
createVNode(_component_a_space, { size: 5 }, {
|
|
33
|
+
default: withCtx(() => [
|
|
34
|
+
createVNode(_component_TpfCollapseTitle, {
|
|
35
|
+
title: $props.widget.options.title
|
|
36
|
+
}, null, 8, ["title"]),
|
|
37
|
+
createVNode(_component_SvgIcon, {
|
|
38
|
+
"icon-class": $props.widget.options.isCollapse ? $props.widget.options.collapseIcon : $props.widget.options.unCollapseIcon,
|
|
39
|
+
size: "24px",
|
|
40
|
+
shadow: "",
|
|
41
|
+
cursor: "",
|
|
42
|
+
onClick: $options.toggleCollapse
|
|
43
|
+
}, null, 8, ["icon-class", "onClick"])
|
|
44
|
+
]),
|
|
45
|
+
_: 1
|
|
46
|
+
}),
|
|
47
|
+
$props.widget.options.isCollapse ? (openBlock(), createElementBlock("div", {
|
|
48
|
+
key: 0,
|
|
49
|
+
class: normalizeClass(["header-right", $options.rightSlotCss])
|
|
50
|
+
}, [
|
|
51
|
+
createVNode(_component_draggable, mergeProps({
|
|
52
|
+
list: $props.widget.headerRightSlotList,
|
|
53
|
+
"item-key": "id"
|
|
54
|
+
}, { group: "dragGroup", ghostClass: "ghost", animation: 200 }, {
|
|
55
|
+
handle: ".drag-handler",
|
|
56
|
+
tag: "transition-group",
|
|
57
|
+
"component-data": { name: "fade" },
|
|
58
|
+
onAdd: _cache[0] || (_cache[0] = (evt) => _ctx.onContainerDragAdd(evt, $props.widget.headerRightSlotList)),
|
|
59
|
+
onUpdate: _ctx.onContainerDragUpdate,
|
|
60
|
+
move: _ctx.checkContainerMove
|
|
61
|
+
}), {
|
|
62
|
+
item: withCtx(({ element: subWidget, index: swIdx }) => [
|
|
63
|
+
createElementVNode("div", _hoisted_3, [
|
|
64
|
+
"container" === subWidget.category ? (openBlock(), createBlock(resolveDynamicComponent(subWidget.type + "-widget"), {
|
|
65
|
+
widget: subWidget,
|
|
66
|
+
designer: $props.designer,
|
|
67
|
+
key: subWidget.id,
|
|
68
|
+
"parent-list": $props.widget.headerRightSlotList,
|
|
69
|
+
"index-of-parent-list": swIdx,
|
|
70
|
+
"parent-widget": $props.widget
|
|
71
|
+
}, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (openBlock(), createBlock(resolveDynamicComponent(subWidget.type + "-widget"), {
|
|
72
|
+
field: subWidget,
|
|
73
|
+
designer: $props.designer,
|
|
74
|
+
key: subWidget.id,
|
|
75
|
+
"parent-list": $props.widget.headerRightSlotList,
|
|
76
|
+
"index-of-parent-list": swIdx,
|
|
77
|
+
"parent-widget": $props.widget,
|
|
78
|
+
"design-state": true
|
|
79
|
+
}, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
|
|
80
|
+
])
|
|
81
|
+
]),
|
|
82
|
+
_: 1
|
|
83
|
+
}, 16, ["list", "onUpdate", "move"])
|
|
84
|
+
], 2)) : createCommentVNode("", true)
|
|
85
|
+
]),
|
|
86
|
+
createVNode(Transition, {
|
|
87
|
+
mode: "out-in",
|
|
88
|
+
appear: "",
|
|
89
|
+
"enter-active-class": "animate__animated animate__fadeIn animate__faster",
|
|
90
|
+
"leave-active-class": "animate__animated animate__fadeOut animate__faster"
|
|
91
|
+
}, {
|
|
92
|
+
default: withCtx(() => [
|
|
93
|
+
withDirectives(createElementVNode("div", {
|
|
94
|
+
class: normalizeClass(["tpf-collapse-content"]),
|
|
95
|
+
style: normalizeStyle({
|
|
96
|
+
height: $props.widget.options.height || "unset",
|
|
97
|
+
...JSON.parse($props.widget.options.bodyStyle || "{}")
|
|
98
|
+
})
|
|
99
|
+
}, [
|
|
100
|
+
$props.widget.options.formCode ? (openBlock(), createBlock(_component_VFormRender, {
|
|
101
|
+
key: 0,
|
|
102
|
+
ref: "dFormRef",
|
|
103
|
+
"form-json": $props.formJson,
|
|
104
|
+
"form-data": $props.formData,
|
|
105
|
+
"global-dsv": $props.globalDsv,
|
|
106
|
+
"parent-form": $props.parentFormRef,
|
|
107
|
+
"disabled-mode": $props.options.disabledMode,
|
|
108
|
+
"dynamic-creation": true
|
|
109
|
+
}, null, 8, ["form-json", "form-data", "global-dsv", "parent-form", "disabled-mode"])) : createCommentVNode("", true),
|
|
110
|
+
createVNode(_component_draggable, mergeProps({
|
|
111
|
+
list: $props.widget.defaultSlotsList,
|
|
112
|
+
"item-key": "id"
|
|
113
|
+
}, { group: "dragGroup", ghostClass: "ghost", animation: 200 }, {
|
|
114
|
+
handle: ".drag-handler",
|
|
115
|
+
tag: "transition-group",
|
|
116
|
+
"component-data": { name: "fade" },
|
|
117
|
+
onAdd: _cache[1] || (_cache[1] = (evt) => _ctx.onContainerDragAdd(evt, $props.widget.defaultSlotsList)),
|
|
118
|
+
onUpdate: _ctx.onContainerDragUpdate,
|
|
119
|
+
move: _ctx.checkContainerMove
|
|
120
|
+
}), {
|
|
121
|
+
item: withCtx(({ element: subWidget, index: swIdx }) => [
|
|
122
|
+
createElementVNode("div", _hoisted_4, [
|
|
123
|
+
"container" === subWidget.category ? (openBlock(), createBlock(resolveDynamicComponent(subWidget.type + "-widget"), {
|
|
124
|
+
widget: subWidget,
|
|
125
|
+
designer: $props.designer,
|
|
126
|
+
key: subWidget.id,
|
|
127
|
+
"parent-list": $props.widget.defaultSlotsList,
|
|
128
|
+
"index-of-parent-list": swIdx,
|
|
129
|
+
"parent-widget": $props.widget
|
|
130
|
+
}, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (openBlock(), createBlock(resolveDynamicComponent(subWidget.type + "-widget"), {
|
|
131
|
+
field: subWidget,
|
|
132
|
+
designer: $props.designer,
|
|
133
|
+
key: subWidget.id,
|
|
134
|
+
"parent-list": $props.widget.defaultSlotsList,
|
|
135
|
+
"index-of-parent-list": swIdx,
|
|
136
|
+
"parent-widget": $props.widget,
|
|
137
|
+
"design-state": true
|
|
138
|
+
}, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
|
|
139
|
+
])
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
}, 16, ["list", "onUpdate", "move"])
|
|
143
|
+
], 4), [
|
|
144
|
+
[vShow, $props.widget.options.isCollapse]
|
|
145
|
+
])
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
})
|
|
149
|
+
])
|
|
150
|
+
], 2))
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
}, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
|
|
154
|
+
}
|
|
155
|
+
const vfCollapseWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-4278dc9a"]]);
|
|
126
156
|
export {
|
|
127
|
-
|
|
157
|
+
vfCollapseWidget as default
|
|
128
158
|
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { defineAsyncComponent } from "vue";
|
|
2
|
+
import ContainerWrapper from "./container-wrapper.vue.js";
|
|
3
|
+
import emitter from "../../../../utils/emitter.js";
|
|
4
|
+
import i18n from "../../../../utils/i18n.js";
|
|
5
|
+
import comps from "../field-widget/index.js";
|
|
6
|
+
import containerMixin from "./containerMixin.js";
|
|
7
|
+
import refMixinDesign from "../../refMixinDesign.js";
|
|
8
|
+
import TpfCollapseTitle from "../../../TpfCollapse/TpfCollapseTitle.vue.js";
|
|
9
|
+
import SvgIcon from "../../../svg-icon/index.vue.js";
|
|
10
|
+
import gridWidget from "./grid-widget.vue.js";
|
|
11
|
+
import draggableComponent from "../../../../lib/vuedraggable/src/vuedraggable.js";
|
|
12
|
+
const _sfc_main = {
|
|
13
|
+
name: "VfCollapseWidget",
|
|
14
|
+
mixins: [i18n, containerMixin, refMixinDesign, emitter],
|
|
15
|
+
inject: ["refList"],
|
|
16
|
+
components: {
|
|
17
|
+
Draggable: draggableComponent,
|
|
18
|
+
ContainerWrapper,
|
|
19
|
+
TpfCollapseTitle,
|
|
20
|
+
SvgIcon,
|
|
21
|
+
gridWidget,
|
|
22
|
+
VFormRender: defineAsyncComponent(() => import("../../../../../render.js")),
|
|
23
|
+
...comps
|
|
24
|
+
},
|
|
25
|
+
data() {
|
|
26
|
+
return {};
|
|
27
|
+
},
|
|
28
|
+
props: {
|
|
29
|
+
widget: Object,
|
|
30
|
+
parentWidget: Object,
|
|
31
|
+
parentList: Array,
|
|
32
|
+
indexOfParentList: Number,
|
|
33
|
+
designer: Object,
|
|
34
|
+
subFormRowIndex: {
|
|
35
|
+
/* 子表单组件行索引,从0开始计数 */
|
|
36
|
+
type: Number,
|
|
37
|
+
default: -1
|
|
38
|
+
},
|
|
39
|
+
subFormColIndex: {
|
|
40
|
+
/* 子表单组件列索引,从0开始计数 */
|
|
41
|
+
type: Number,
|
|
42
|
+
default: -1
|
|
43
|
+
},
|
|
44
|
+
subFormRowId: {
|
|
45
|
+
/* 子表单组件行Id,唯一id且不可变 */
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
options: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => ({})
|
|
52
|
+
},
|
|
53
|
+
formJson: {
|
|
54
|
+
type: Object
|
|
55
|
+
},
|
|
56
|
+
formData: {
|
|
57
|
+
type: Object,
|
|
58
|
+
default: () => ({})
|
|
59
|
+
},
|
|
60
|
+
optionData: {
|
|
61
|
+
//prop传入的选项数据
|
|
62
|
+
type: Object,
|
|
63
|
+
default: () => ({})
|
|
64
|
+
},
|
|
65
|
+
globalDsv: {
|
|
66
|
+
// 全局数据源变量
|
|
67
|
+
type: Object,
|
|
68
|
+
default: () => ({})
|
|
69
|
+
},
|
|
70
|
+
parentFormRef: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default: null
|
|
73
|
+
},
|
|
74
|
+
extraData: {
|
|
75
|
+
type: Object,
|
|
76
|
+
default: () => ({})
|
|
77
|
+
},
|
|
78
|
+
wrapperId: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: null
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
created() {
|
|
84
|
+
this.initRefList();
|
|
85
|
+
},
|
|
86
|
+
mounted() {
|
|
87
|
+
this.loadFormCode(this.widget.options.formCode);
|
|
88
|
+
},
|
|
89
|
+
beforeUnmount() {
|
|
90
|
+
},
|
|
91
|
+
computed: {
|
|
92
|
+
rightSlotCss() {
|
|
93
|
+
return this.widget.options.rightSlotCss || "";
|
|
94
|
+
},
|
|
95
|
+
selected() {
|
|
96
|
+
return this.widget.id === this.designer.selectedId;
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
watch: {
|
|
100
|
+
"widget.options.formCode"(val) {
|
|
101
|
+
this.loadFormCode(val);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
selectWidget(widget) {
|
|
106
|
+
this.designer.setSelected(widget);
|
|
107
|
+
},
|
|
108
|
+
toggleCollapse() {
|
|
109
|
+
this.widget.options.isCollapse = !this.widget.options.isCollapse;
|
|
110
|
+
},
|
|
111
|
+
async loadFormCode(formCode) {
|
|
112
|
+
if (formCode) {
|
|
113
|
+
const res = await this.$http.get(`/api/tmgc2-query/dataQuery/detail/FormDefinitionManagement`, {
|
|
114
|
+
params: {
|
|
115
|
+
code: formCode
|
|
116
|
+
}
|
|
117
|
+
}).then((res2) => res2.data.object.frontendDefinition || "{}");
|
|
118
|
+
this.$refs.dFormRef.setFormJson(JSON.parse(res));
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
getFormRef() {
|
|
122
|
+
return this.$refs.dFormRef;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
export {
|
|
127
|
+
_sfc_main as default
|
|
128
|
+
};
|
|
@@ -142,7 +142,11 @@ const fieldMixin = {
|
|
|
142
142
|
if (this.field.type !== "picture-upload" && this.field.type !== "file-upload" || this.designState === true) {
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
|
-
|
|
145
|
+
console.log("fieldModel", this.fieldModel);
|
|
146
|
+
if (this.fieldModel) {
|
|
147
|
+
if (typeof this.fieldModel === "string") {
|
|
148
|
+
this.fieldModel = JSON.parse(this.fieldModel);
|
|
149
|
+
}
|
|
146
150
|
if (Array.isArray(this.fieldModel)) {
|
|
147
151
|
this.fileList = deepClone(this.fieldModel);
|
|
148
152
|
} else {
|
|
@@ -558,6 +562,9 @@ const fieldMixin = {
|
|
|
558
562
|
return this.$refs["fieldEditor"];
|
|
559
563
|
},
|
|
560
564
|
showFileList(list) {
|
|
565
|
+
if (typeof list === "string") {
|
|
566
|
+
list = JSON.parse(list);
|
|
567
|
+
}
|
|
561
568
|
if (!isArray(list)) return [];
|
|
562
569
|
const res = list.map((item, uid) => ({
|
|
563
570
|
...item,
|
|
@@ -92,7 +92,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
92
92
|
_: 1
|
|
93
93
|
}, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"])) : createCommentVNode("", true);
|
|
94
94
|
}
|
|
95
|
-
const fileUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
95
|
+
const fileUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-7804efd1"]]);
|
|
96
96
|
export {
|
|
97
97
|
fileUploadWidget as default
|
|
98
98
|
};
|
|
@@ -6,6 +6,7 @@ import fieldMixin from "./fieldMixin.js";
|
|
|
6
6
|
import SvgIcon from "../../../svg-icon/index.vue.js";
|
|
7
7
|
import { useFilesystemApi } from "../../../../api/useFilesystemApi/filesystem/index.js";
|
|
8
8
|
import { PaperClipOutlined } from "@ant-design/icons-vue";
|
|
9
|
+
import { getUserInfo } from "@kp-ui/tool";
|
|
9
10
|
const filesystemApi = useFilesystemApi();
|
|
10
11
|
const _sfc_main = {
|
|
11
12
|
name: "file-upload-widget",
|
|
@@ -97,19 +98,11 @@ const _sfc_main = {
|
|
|
97
98
|
this.unregisterFromRefList();
|
|
98
99
|
},
|
|
99
100
|
methods: {
|
|
100
|
-
initFieldModel() {
|
|
101
|
-
const {
|
|
102
|
-
fieldModel
|
|
103
|
-
} = this.field;
|
|
104
|
-
if (fieldModel) {
|
|
105
|
-
console.log(fieldModel);
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
101
|
iconRender({
|
|
109
|
-
file
|
|
102
|
+
file
|
|
110
103
|
}) {
|
|
111
104
|
try {
|
|
112
|
-
const fieldTypes =
|
|
105
|
+
const fieldTypes = file.fileName.slice(file.fileName.lastIndexOf("."));
|
|
113
106
|
if ([".xls", ".xlsx"].includes(fieldTypes.toLowerCase())) {
|
|
114
107
|
return createVNode(SvgIcon, {
|
|
115
108
|
"icon-class": "excel"
|
|
@@ -129,9 +122,6 @@ const _sfc_main = {
|
|
|
129
122
|
}
|
|
130
123
|
return createVNode(PaperClipOutlined, null, null);
|
|
131
124
|
},
|
|
132
|
-
// onPreview(file) {
|
|
133
|
-
// filesystemApi.downloadFileObject({ fileCode: file.fileCode });
|
|
134
|
-
// },
|
|
135
125
|
handleCancel() {
|
|
136
126
|
this.previewVisible = false;
|
|
137
127
|
},
|
|
@@ -140,39 +130,39 @@ const _sfc_main = {
|
|
|
140
130
|
return this.fileList[fileCode];
|
|
141
131
|
} else {
|
|
142
132
|
const fileUrlObj = await filesystemApi.getPreviewFileUrl({
|
|
143
|
-
fileCode
|
|
133
|
+
fileCode
|
|
144
134
|
});
|
|
145
|
-
fileUrlObj.data.value;
|
|
135
|
+
const url = fileUrlObj.data.value;
|
|
136
|
+
this.fileList[fileCode] = url;
|
|
137
|
+
return url;
|
|
146
138
|
}
|
|
147
139
|
},
|
|
148
|
-
async handlePreview(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const url = await this.getFileUrl(file2.fileCode);
|
|
140
|
+
async handlePreview(file) {
|
|
141
|
+
if ([".png", ".jpg", ".jpeg", ".gif"].includes(file.fileType)) {
|
|
142
|
+
const url = await this.getFileUrl(file.fileCode);
|
|
152
143
|
this.previewImage = url;
|
|
153
144
|
this.previewVisible = true;
|
|
154
|
-
this.previewTitle =
|
|
145
|
+
this.previewTitle = file.fileName;
|
|
155
146
|
} else {
|
|
156
|
-
const localUserInfo = getUserInfo();
|
|
157
|
-
const employeeId = (_a = localUserInfo == null ? void 0 : localUserInfo.loginInfo) == null ? void 0 : _a.employeeId;
|
|
158
147
|
const {
|
|
159
148
|
tokenId,
|
|
160
|
-
tenantId
|
|
161
|
-
|
|
149
|
+
tenantId,
|
|
150
|
+
employeeId
|
|
151
|
+
} = getUserInfo();
|
|
162
152
|
const doMain = getDoMain();
|
|
163
153
|
const obj = {
|
|
164
154
|
tenantId,
|
|
165
155
|
tokenId,
|
|
166
156
|
employeeId,
|
|
167
|
-
fileCode:
|
|
157
|
+
fileCode: file.fileCode
|
|
168
158
|
};
|
|
169
159
|
window.open(`${doMain}/view-file/preview?${queryString.stringify(obj)}`);
|
|
170
160
|
}
|
|
171
161
|
},
|
|
172
|
-
handleOnBeforeUpload(
|
|
162
|
+
handleOnBeforeUpload(file) {
|
|
173
163
|
if (!!this.field.options.onBeforeUpload) {
|
|
174
164
|
const bfFunc = new Function("file", this.field.options.onBeforeUpload);
|
|
175
|
-
const result = bfFunc.call(this,
|
|
165
|
+
const result = bfFunc.call(this, file);
|
|
176
166
|
if (typeof result === "boolean") {
|
|
177
167
|
return result;
|
|
178
168
|
} else {
|
|
@@ -181,8 +171,8 @@ const _sfc_main = {
|
|
|
181
171
|
}
|
|
182
172
|
return true;
|
|
183
173
|
},
|
|
184
|
-
removeFile(
|
|
185
|
-
const findInx = this.fileList.findIndex((item) => item.uid ===
|
|
174
|
+
removeFile(file) {
|
|
175
|
+
const findInx = this.fileList.findIndex((item) => item.uid === file.uid);
|
|
186
176
|
this.fileList.splice(findInx, 1);
|
|
187
177
|
this.handleChangeEvent(this.fileList);
|
|
188
178
|
},
|
|
@@ -3,18 +3,18 @@ import { resolveComponent, createBlock, openBlock, withCtx, createElementVNode,
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
/* empty css */
|
|
8
8
|
import "./container-widget/grid-col-widget.vue.js";
|
|
9
9
|
import "./container-widget/grid-sub-form-widget.vue.js";
|
|
10
|
-
/* empty css
|
|
10
|
+
/* empty css */
|
|
11
11
|
import "./container-widget/sub-form-widget.vue.js";
|
|
12
12
|
import "./container-widget/tab-widget.vue.js";
|
|
13
13
|
import "./container-widget/table-cell-widget.vue.js";
|
|
14
|
-
/* empty css
|
|
14
|
+
/* empty css */
|
|
15
15
|
import "./container-widget/vf-box-item.vue.js";
|
|
16
16
|
import "./container-widget/vf-box-widget.vue.js";
|
|
17
|
-
import "./container-widget/vf-collapse-widget.
|
|
17
|
+
import "./container-widget/vf-collapse-widget.vue2.js";
|
|
18
18
|
/* empty css */
|
|
19
19
|
/* empty css */
|
|
20
20
|
import "./container-widget/vf-dialog-widget.vue.js";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { defineAsyncComponent, resolveComponent, createElementBlock, openBlock, createElementVNode, createVNode, createBlock, createCommentVNode, withCtx, normalizeStyle, createTextVNode, toDisplayString, Fragment, renderList, renderSlot, normalizeClass } from "vue";
|
|
2
|
-
import { traverseAllWidgets, generateId, copyToClipboard, getQueryParam, addWindowResizeHandler
|
|
2
|
+
import { traverseAllWidgets, generateId, copyToClipboard, getQueryParam, addWindowResizeHandler } from "../../../utils/util.js";
|
|
3
3
|
import i18n from "../../../utils/i18n.js";
|
|
4
4
|
import { generateCode } from "../../../utils/code-generator.js";
|
|
5
5
|
import { saveAs } from "file-saver";
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
import SvgIcon from "../../svg-icon/index.vue.js";
|
|
8
8
|
import { fmtHttpParams } from "../../../utils/request/fmtHttpParams.js";
|
|
9
|
+
import { getLocat } from "@kp-ui/tool";
|
|
9
10
|
import { cloneDeep } from "lodash-es";
|
|
10
11
|
/* empty css */
|
|
11
12
|
import _export_sfc from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
@@ -1011,7 +1012,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1011
1012
|
}, 8, ["title", "visible"])) : createCommentVNode("", true)
|
|
1012
1013
|
]);
|
|
1013
1014
|
}
|
|
1014
|
-
const ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
1015
|
+
const ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a50ea2c8"]]);
|
|
1015
1016
|
export {
|
|
1016
1017
|
ToolbarPanel as default
|
|
1017
1018
|
};
|