@fecp/designer 5.4.27 → 5.4.30

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.
Files changed (27) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer.css +86 -7
  3. package/es/packages/vue/index.mjs +2 -0
  4. package/es/packages/vue/src/components/all.mjs +6 -0
  5. package/es/packages/vue/src/components/dialog/customDialog/CustomDialog.vue.mjs +172 -0
  6. package/es/packages/vue/src/components/dialog/customDialog/index.mjs +7 -0
  7. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +3 -4
  8. package/es/packages/vue/src/components/layout/Layout.vue.mjs +81 -0
  9. package/es/packages/vue/src/components/layout/index.mjs +9 -0
  10. package/es/packages/vue/src/components/layout/layoutCard/LayoutCard.vue.mjs +162 -0
  11. package/es/packages/vue/src/components/layout/layoutCard/index.mjs +7 -0
  12. package/es/packages/vue/src/directive/layout.mjs +28 -0
  13. package/es/packages/vue/src/utils/datasource.mjs +2 -2
  14. package/lib/designer/package.json.js +1 -1
  15. package/lib/designer.css +86 -7
  16. package/lib/packages/vue/index.js +7 -5
  17. package/lib/packages/vue/src/components/all.js +6 -0
  18. package/lib/packages/vue/src/components/dialog/customDialog/CustomDialog.vue.js +172 -0
  19. package/lib/packages/vue/src/components/dialog/customDialog/index.js +7 -0
  20. package/lib/packages/vue/src/components/forms/form/Form.vue.js +3 -4
  21. package/lib/packages/vue/src/components/layout/Layout.vue.js +81 -0
  22. package/lib/packages/vue/src/components/layout/index.js +9 -0
  23. package/lib/packages/vue/src/components/layout/layoutCard/LayoutCard.vue.js +162 -0
  24. package/lib/packages/vue/src/components/layout/layoutCard/index.js +7 -0
  25. package/lib/packages/vue/src/directive/layout.js +28 -0
  26. package/lib/packages/vue/src/utils/datasource.js +2 -2
  27. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ require("../../../../../../node_modules/element-plus/es/index.js");
4
+ ;/* empty css */
5
+ ;/* empty css */
6
+ const vue = require("vue");
7
+ const index$2 = require("../../../../../../node_modules/@element-plus/icons-vue/dist/index.js");
8
+ const index$3 = require("../../dialog/customDialog/index.js");
9
+ const index$4 = require("../../../api/index.js");
10
+ const getInstance = require("../../../utils/getInstance.js");
11
+ const index$5 = require("../../forms/form/index.js");
12
+ const index$6 = require("../../table/index.js");
13
+ ;/* empty css */
14
+ const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.js");
15
+ const index = require("../../../../../../node_modules/element-plus/es/components/button/index.js");
16
+ const index$1 = require("../../../../../../node_modules/element-plus/es/components/icon/index.js");
17
+ const _hoisted_1 = { class: "fec-layout-card" };
18
+ const _hoisted_2 = { class: "header" };
19
+ const _hoisted_3 = { class: "title" };
20
+ const _hoisted_4 = { class: "content" };
21
+ const _sfc_main = {
22
+ __name: "LayoutCard",
23
+ props: {
24
+ //标题
25
+ title: {
26
+ type: String,
27
+ default: ""
28
+ },
29
+ //图标
30
+ icon: {
31
+ type: String,
32
+ default: "icon-authorization"
33
+ },
34
+ //图标背景色
35
+ iconColor: {
36
+ type: String,
37
+ default: "#4fbdc1"
38
+ },
39
+ morePageRoute: {
40
+ type: String,
41
+ default: ""
42
+ },
43
+ morePageTemplateKey: {
44
+ type: String,
45
+ default: ""
46
+ },
47
+ morePageParams: {
48
+ type: Object,
49
+ default: {}
50
+ }
51
+ },
52
+ setup(__props) {
53
+ const props = __props;
54
+ const ctx = getInstance.getCurrentVueInstance();
55
+ const isMoreBtn = vue.computed(() => {
56
+ return props.morePageRoute || props.morePageTemplateKey;
57
+ });
58
+ const dialogVisible = vue.ref(false);
59
+ const currentComponent = vue.ref(null);
60
+ const currentParams = vue.ref(props.morePageParams);
61
+ const flag = vue.ref(true);
62
+ vue.watch(currentParams, () => {
63
+ if (props.morePageRoute && Object.keys(currentParams).length > 0) {
64
+ flag.value = false;
65
+ vue.nextTick(() => {
66
+ flag.value = true;
67
+ });
68
+ }
69
+ });
70
+ function moreClick() {
71
+ if (props.morePageRoute) {
72
+ loadComponentByPath(props.morePageRoute);
73
+ dialogVisible.value = true;
74
+ } else if (props.morePageTemplateKey) {
75
+ index$4.default.findByTemplateKey(ctx.$http, {
76
+ templateKey: props.morePageTemplateKey,
77
+ timestamp: Date.now(),
78
+ templateVersion: "v5"
79
+ }).then((res) => {
80
+ const data = JSON.parse(res);
81
+ if (data.formMode) {
82
+ currentComponent.value = index$5.Form;
83
+ } else {
84
+ currentComponent.value = index$6.Table;
85
+ }
86
+ currentParams.value.initOption = data;
87
+ currentParams.value.isDialog = true;
88
+ dialogVisible.value = true;
89
+ });
90
+ }
91
+ }
92
+ function loadComponentByPath(path) {
93
+ const route = ctx.$router.getRoutes().find((item) => item.path === path);
94
+ if (!route) return;
95
+ const comp = route.components.default;
96
+ if (!comp) return;
97
+ if (typeof comp === "function") {
98
+ comp().then((module2) => {
99
+ currentComponent.value = module2.default;
100
+ });
101
+ } else {
102
+ currentComponent.value = comp;
103
+ }
104
+ }
105
+ return (_ctx, _cache) => {
106
+ const _component_el_icon = index$1.ElIcon;
107
+ const _component_el_button = index.ElButton;
108
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
109
+ vue.createElementVNode("div", _hoisted_1, [
110
+ vue.createElementVNode("div", _hoisted_2, [
111
+ vue.createElementVNode("div", _hoisted_3, [
112
+ __props.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
113
+ vue.createElementVNode("i", {
114
+ class: vue.normalizeClass("icon iconfont " + __props.icon),
115
+ style: vue.normalizeStyle("background-color:" + __props.iconColor)
116
+ }, null, 6),
117
+ vue.createElementVNode("span", null, vue.toDisplayString(__props.title), 1)
118
+ ], 64)) : vue.createCommentVNode("", true)
119
+ ]),
120
+ vue.unref(isMoreBtn) ? (vue.openBlock(), vue.createBlock(_component_el_button, {
121
+ key: 0,
122
+ class: "moreBtn",
123
+ type: "primary",
124
+ link: "",
125
+ onClick: moreClick
126
+ }, {
127
+ default: vue.withCtx(() => [
128
+ _cache[1] || (_cache[1] = vue.createTextVNode("更多信息")),
129
+ vue.createVNode(_component_el_icon, null, {
130
+ default: vue.withCtx(() => [
131
+ vue.createVNode(vue.unref(index$2.ArrowRight))
132
+ ]),
133
+ _: 1
134
+ })
135
+ ]),
136
+ _: 1
137
+ })) : vue.createCommentVNode("", true)
138
+ ]),
139
+ vue.createElementVNode("div", _hoisted_4, [
140
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
141
+ ])
142
+ ]),
143
+ vue.createVNode(vue.unref(index$3.customDialog), {
144
+ modelValue: vue.unref(dialogVisible),
145
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(dialogVisible) ? dialogVisible.value = $event : null),
146
+ width: "80%",
147
+ height: "100%",
148
+ query: "",
149
+ "append-to-body": "",
150
+ title: __props.title
151
+ }, {
152
+ default: vue.withCtx(() => [
153
+ vue.unref(flag) && vue.unref(currentComponent) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(currentComponent)), vue.normalizeProps(vue.mergeProps({ key: 0 }, vue.unref(currentParams))), null, 16)) : vue.createCommentVNode("", true)
154
+ ]),
155
+ _: 1
156
+ }, 8, ["modelValue", "title"])
157
+ ], 64);
158
+ };
159
+ }
160
+ };
161
+ const _LayoutCard = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-3ce25014"]]);
162
+ exports.default = _LayoutCard;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const LayoutCard$1 = require("./LayoutCard.vue.js");
4
+ const install = require("../../../utils/install.js");
5
+ const LayoutCard = install.default.withInstall("LayoutCard", LayoutCard$1.default);
6
+ exports.LayoutCard = LayoutCard;
7
+ exports.default = LayoutCard;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const layout = {
4
+ mounted(el, binding, vnode, prevVnode) {
5
+ if (el.parentElement.className.indexOf("h-main") != -1) {
6
+ document.querySelector(".h-main").setAttribute(
7
+ "style",
8
+ "background-color:transparent;padding:0px;border:0px;"
9
+ );
10
+ }
11
+ if (el.parentElement.className.indexOf("root-main") != -1) {
12
+ document.querySelector(".root-main").setAttribute(
13
+ "style",
14
+ "background-color:transparent;padding:0px;border:0px;"
15
+ );
16
+ }
17
+ if (el.parentElement.parentElement.className.indexOf("el-dialog__body") != -1) {
18
+ el.parentElement.parentElement.setAttribute(
19
+ "style",
20
+ "background-color:#F7F7F7;"
21
+ );
22
+ }
23
+ }
24
+ };
25
+ layout.install = function(Vue) {
26
+ Vue.directive("fec-layout", layout);
27
+ };
28
+ exports.default = layout;
@@ -184,7 +184,7 @@ class DataSourceManager {
184
184
  const responseMessage = response.message;
185
185
  if (this.pagination) {
186
186
  this.data.list = (responseData == null ? void 0 : responseData.records) || responseData;
187
- this.data.total = (responseData == null ? void 0 : responseData.total) || responseData.length;
187
+ this.data.total = (responseData == null ? void 0 : responseData.total) || (responseData == null ? void 0 : responseData.length);
188
188
  } else {
189
189
  this.data = responseData;
190
190
  }
@@ -202,7 +202,7 @@ class DataSourceManager {
202
202
  const responseData = response;
203
203
  if (this.pagination) {
204
204
  this.data.list = (responseData == null ? void 0 : responseData.records) || responseData;
205
- this.data.total = (responseData == null ? void 0 : responseData.total) || responseData.length;
205
+ this.data.total = (responseData == null ? void 0 : responseData.total) || (responseData == null ? void 0 : responseData.length);
206
206
  } else {
207
207
  this.data = responseData;
208
208
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.4.27",
3
+ "version": "5.4.30",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [