super-page-designer 2.1.34 → 2.1.41

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 (102) hide show
  1. package/dist/es/components/design/utils/assemblys-config.js +72 -2
  2. package/dist/es/components/design/utils/container-design-util.js +4 -0
  3. package/dist/es/components/design/utils/form-design-util.d.ts +1 -1
  4. package/dist/es/components/design/utils/form-design-util.js +10 -1
  5. package/dist/es/components/design/utils/page-event-util.js +10 -6
  6. package/dist/es/components/design/utils/page-table-util.js +26 -4
  7. package/dist/es/components/design/views/assemblys/chart/common/common-attr-data.vue.js +2 -2
  8. package/dist/es/components/design/views/assemblys/chart/gauge/gauge-attr-data.vue.js +2 -2
  9. package/dist/es/components/design/views/assemblys/chart/radar/radar-attr-data.vue.js +2 -2
  10. package/dist/es/components/design/views/assemblys/chart/scatter/scatter-attr-data.vue.js +2 -2
  11. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/data-origin.vue.js +7 -0
  12. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/data-origin.vue2.js +542 -0
  13. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/data-origin.vue3.js +1 -0
  14. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/font-style-dialog.vue.js +230 -0
  15. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/font-style-dialog.vue2.js +4 -0
  16. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/link-table.vue.js +205 -0
  17. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/link-table.vue2.js +4 -0
  18. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/style-table.vue.js +198 -0
  19. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/style-table.vue2.js +4 -0
  20. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/table-showcondition.vue.js +507 -0
  21. package/dist/es/components/design/views/assemblys/chart/statistical-table/component/table-showcondition.vue2.js +4 -0
  22. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-advanced.vue.js +285 -0
  23. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-advanced.vue2.js +4 -0
  24. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-base.vue.js +1177 -0
  25. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-base.vue2.js +4 -0
  26. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-style.vue.js +97 -0
  27. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr-style.vue2.js +4 -0
  28. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr.vue.js +5 -0
  29. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr.vue2.js +62 -0
  30. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-attr.vue3.js +1 -0
  31. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-design.vue.js +8 -0
  32. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-design.vue2.js +358 -0
  33. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-design.vue3.js +1 -0
  34. package/dist/es/components/design/views/assemblys/chart/statistical-table/statisticalTable-design.vue4.js +1 -0
  35. package/dist/es/components/design/views/assemblys/common/common-function-code.vue.js +2 -2
  36. package/dist/es/components/design/views/assemblys/common/common-i18n-key-input.vue.js +3 -1
  37. package/dist/es/components/design/views/assemblys/common/common-select-page.vue.js +8 -18
  38. package/dist/es/components/design/views/assemblys/common/common-style-background.vue.js +3 -2
  39. package/dist/es/components/design/views/assemblys/common/common-variable-bind-option.js +1 -2
  40. package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue.js +3 -3
  41. package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue2.js +738 -1
  42. package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue3.js +1 -733
  43. package/dist/es/components/design/views/assemblys/data/component/data-origin-tree.vue.js +1 -1
  44. package/dist/es/components/design/views/assemblys/data/component/data-origin-tree.vue2.js +4 -4
  45. package/dist/es/components/design/views/assemblys/data/component/data-origin.vue2.js +1 -1
  46. package/dist/es/components/design/views/assemblys/data/component/table-children-column.vue.js +12 -10
  47. package/dist/es/components/design/views/assemblys/data/table/table-attr-base.vue.js +2 -1
  48. package/dist/es/components/design/views/assemblys/data/table/table-design.vue.js +1 -1
  49. package/dist/es/components/design/views/assemblys/data/table/table-design.vue2.js +2 -0
  50. package/dist/es/components/design/views/assemblys/data/table/tablecolumn-attr-base.vue.js +1 -1
  51. package/dist/es/components/design/views/assemblys/data/table/tablecolumn-attr-base.vue2.js +5 -5
  52. package/dist/es/components/design/views/assemblys/data/table/tablecolumn-dynamic-column.vue.js +4 -4
  53. package/dist/es/components/design/views/assemblys/form/checkbox/checkbox-attr-base.vue.js +42 -4
  54. package/dist/es/components/design/views/assemblys/form/checkbox/checkbox-design.vue2.js +4 -2
  55. package/dist/es/components/design/views/assemblys/form/common/data-format.vue.js +6 -5
  56. package/dist/es/components/design/views/assemblys/form/common/data-origin.vue.js +1 -1
  57. package/dist/es/components/design/views/assemblys/form/common/data-origin.vue2.js +4 -4
  58. package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue.js +152 -1
  59. package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue2.js +1 -152
  60. package/dist/es/components/design/views/assemblys/form/common/icon-set-dialog.vue.js +1 -1
  61. package/dist/es/components/design/views/assemblys/form/common/icon-set-dialog.vue2.js +2 -1
  62. package/dist/es/components/design/views/assemblys/form/common/pre-suffix.vue.js +11 -8
  63. package/dist/es/components/design/views/assemblys/form/common/suffixmodule.vue.js +5 -1
  64. package/dist/es/components/design/views/assemblys/form/common/uploading.vue.js +32 -0
  65. package/dist/es/components/design/views/assemblys/form/date-picker/datepicker-attr-base.vue.js +54 -16
  66. package/dist/es/components/design/views/assemblys/form/date-picker/datepicker-design.vue2.js +4 -2
  67. package/dist/es/components/design/views/assemblys/form/dept-tree/depttree-attr-base.vue.js +46 -8
  68. package/dist/es/components/design/views/assemblys/form/dept-tree/depttree-design.vue2.js +4 -3
  69. package/dist/es/components/design/views/assemblys/form/file-upload/fileupload-attr-base.vue.js +42 -4
  70. package/dist/es/components/design/views/assemblys/form/file-upload/fileupload-design.vue2.js +15 -2
  71. package/dist/es/components/design/views/assemblys/form/input-number/input-number-attr-base.vue.js +48 -10
  72. package/dist/es/components/design/views/assemblys/form/input-number/input-number-design.vue2.js +4 -3
  73. package/dist/es/components/design/views/assemblys/form/input-text/inputtext-attr-base.vue.js +46 -8
  74. package/dist/es/components/design/views/assemblys/form/input-text/inputtext-design.vue2.js +4 -2
  75. package/dist/es/components/design/views/assemblys/form/label/label-attr-base.vue.js +71 -3
  76. package/dist/es/components/design/views/assemblys/form/label/label-design.vue2.js +8 -2
  77. package/dist/es/components/design/views/assemblys/form/radio/radio-attr-base.vue.js +42 -4
  78. package/dist/es/components/design/views/assemblys/form/radio/radio-design.vue2.js +4 -2
  79. package/dist/es/components/design/views/assemblys/form/rich-text/richtext-attr-base.vue.js +42 -4
  80. package/dist/es/components/design/views/assemblys/form/rich-text/richtext-design.vue2.js +4 -2
  81. package/dist/es/components/design/views/assemblys/form/select/select-attr-base.vue.js +48 -10
  82. package/dist/es/components/design/views/assemblys/form/select/select-design.vue2.js +4 -2
  83. package/dist/es/components/design/views/assemblys/form/switch/switch-attr-base.vue.js +49 -11
  84. package/dist/es/components/design/views/assemblys/form/switch/switch-design.vue2.js +4 -2
  85. package/dist/es/components/design/views/assemblys/form/tag/tag-attr-base.vue.js +42 -4
  86. package/dist/es/components/design/views/assemblys/form/tag/tag-design.vue2.js +4 -2
  87. package/dist/es/components/design/views/assemblys/form/textarea/textarea-attr-base.vue.js +52 -14
  88. package/dist/es/components/design/views/assemblys/form/textarea/textarea-design.vue2.js +4 -2
  89. package/dist/es/components/design/views/assemblys/object-design.vue.js +2 -2
  90. package/dist/es/components/design/views/assemblys/page/component/weight-field-input.vue.js +2 -2
  91. package/dist/es/components/design/views/assemblys/page/page-attr-advanced.vue.js +21 -2
  92. package/dist/es/components/design/views/assemblys/page/page-attr-base.vue.js +14 -7
  93. package/dist/es/components/design/views/assemblys/workflow/component/combination.vue.js +1 -3
  94. package/dist/es/components/design/views/design/view/components/quick-add-dialog.vue.js +2 -0
  95. package/dist/es/components/design/views/design/view/page-switch.vue.js +1 -1
  96. package/dist/es/components/design/views/design/view/page-switch.vue2.js +10 -0
  97. package/dist/es/stores/page-store.d.ts +1 -1
  98. package/dist/es/stores/page-store.js +1 -1
  99. package/dist/es/stores/statistics-table-store.d.ts +10 -0
  100. package/dist/es/stores/statistics-table-store.js +20 -0
  101. package/dist/es/style.css +791 -118
  102. package/package.json +6 -5
@@ -1,733 +1 @@
1
- import { defineComponent, ref, onMounted, onUnmounted, computed, watch, resolveComponent, openBlock, createElementBlock, toDisplayString, createBlock, withCtx, createVNode, withDirectives, withModifiers, unref, vShow, createElementVNode, createTextVNode, normalizeStyle, createCommentVNode, nextTick, pushScopeId, popScopeId } from "vue";
2
- import { CircleClose, Plus, InfoFilled, Search } from "@element-plus/icons-vue";
3
- import http from "agilebuilder-ui/src/utils/request";
4
- import { deepCopy, getUuidv4 } from "../../../utils/common-util.js";
5
- import { getTypeOptions, taskVarOptions, contextVarOptions } from "./common-variable-bind-option.js";
6
- import { usePageContextStore } from "../../../../../stores/page-store.js";
7
- import { tableField } from "../../../../../stores/table-store.js";
8
- const _withScopeId = (n) => (pushScopeId("data-v-7d59803a"), n = n(), popScopeId(), n);
9
- const _hoisted_1 = { key: 0 };
10
- const _hoisted_2 = { style: { "margin-top": "10px", "font-size": "10px", "display": "flex", "align-items": "center", "justify-self": "center" } };
11
- const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { style: { "margin-left": "5px" } }, "输入变量名后点击加号按钮添加", -1));
12
- const _hoisted_4 = { style: { "font-size": "10px", "line-height": "40px" } };
13
- const _hoisted_5 = { style: { "margin-top": "4px", "margin-bottom": "8px", "font-size": "10px", "display": "flex", "align-items": "center", "justify-self": "center" } };
14
- const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { style: { "margin-left": "5px" } }, "输入变量名后点击加号按钮添加", -1));
15
- const _hoisted_7 = {
16
- key: 0,
17
- style: { "display": "flex" }
18
- };
19
- const _hoisted_8 = ["title"];
20
- const _hoisted_9 = ["title"];
21
- const _hoisted_10 = { class: "totalStyle" };
22
- const _sfc_main = /* @__PURE__ */ defineComponent({
23
- ...{
24
- name: "ValueSetInput",
25
- inheritAttrs: false
26
- },
27
- __name: "common-variable-bind",
28
- props: {
29
- modelValue: {
30
- type: [String],
31
- default: null
32
- },
33
- paramTypes: {
34
- type: Array,
35
- default: () => []
36
- },
37
- size: {
38
- type: String,
39
- default: "small"
40
- },
41
- showLabel: {
42
- type: Boolean,
43
- default: false
44
- },
45
- // 是否需要方法参数
46
- needParams: {
47
- type: Boolean,
48
- default: false
49
- },
50
- isRange: {
51
- type: Boolean,
52
- default: false
53
- },
54
- isTable: {
55
- type: Boolean,
56
- default: false
57
- },
58
- dataModelOptions: {
59
- type: Array,
60
- default: null
61
- },
62
- objModelOptions: {
63
- type: Array,
64
- default: null
65
- },
66
- // 是否需要data
67
- needData: {
68
- type: Boolean,
69
- default: false
70
- }
71
- },
72
- emits: ["update:modelValue"],
73
- setup(__props, { emit: __emit }) {
74
- const pageContextUtil = usePageContextStore();
75
- const emits = __emit;
76
- const props = __props;
77
- const popoverVisible = ref(false);
78
- const defalutValue = ref("");
79
- const inputRef = ref(null);
80
- const contentRef = ref(null);
81
- const typeOptions = ref([]);
82
- const showInput = ref(false);
83
- const labelValue = ref("");
84
- const paramType = ref("");
85
- const paramValue = ref("");
86
- const valueOptions = ref([]);
87
- const selectOptions = ref({});
88
- const searchValue = ref("");
89
- const popoverRef = ref(null);
90
- const selectInputType = ["context", "system", "task", "data", "page", "obj"];
91
- const tableFieldStore = tableField();
92
- onMounted(() => {
93
- window.addEventListener("click", handleClickOutside);
94
- const pageContext = pageContextUtil.pageContext;
95
- let hasTask = false;
96
- let hasData = props.needData;
97
- if (!hasData) {
98
- if (props.isTable || pageContext && (!pageContext.pageType || pageContext.pageType == "form") && pageContext.tableName) {
99
- hasData = true;
100
- }
101
- }
102
- if (pageContext && pageContext.workflowCode && hasData) {
103
- hasTask = true;
104
- }
105
- let newOptions = getTypeOptions(props.paramTypes, props.needParams);
106
- if (!hasData) {
107
- newOptions = newOptions.filter((item) => item.value != "data");
108
- }
109
- if (!hasTask) {
110
- newOptions = newOptions.filter((item) => item.value != "task");
111
- }
112
- typeOptions.value = newOptions;
113
- setSelectOptions();
114
- if (props.modelValue) {
115
- const [type, val] = props.modelValue.slice(0, props.modelValue.length - 1).slice(2).split(".");
116
- paramType.value = type;
117
- paramValue.value = val;
118
- if (selectInputType.includes(type)) {
119
- showInput.value = false;
120
- }
121
- setValueOptions(paramType.value);
122
- labelValue.value = formatter();
123
- defalutValue.value = props.modelValue;
124
- }
125
- if (!paramType.value) {
126
- paramType.value = newOptions.length > 0 ? newOptions[0].value : "";
127
- setValueOptions(paramType.value);
128
- }
129
- console.log("popoverRef", popoverRef.value);
130
- });
131
- onUnmounted(() => {
132
- window.removeEventListener("click", handleClickOutside);
133
- });
134
- let lastTarget = null;
135
- function handleClickOutside(event) {
136
- if (!popoverVisible.value) {
137
- return;
138
- }
139
- if (paramTypeCheck) {
140
- paramTypeCheck = false;
141
- return;
142
- }
143
- let popoverDom = null;
144
- if (contentRef.value) {
145
- popoverDom = contentRef.value.$el.parentNode;
146
- }
147
- if (!event.target || !popoverDom) {
148
- return;
149
- }
150
- if (event.target === lastTarget) {
151
- console.log("与最后的点击一致");
152
- return;
153
- }
154
- const inputDom = inputRef.value ? inputRef.value.input : null;
155
- if (inputDom && (event.target === inputDom || inputDom.contains(event.target))) {
156
- console.log("click contains input");
157
- return;
158
- }
159
- if (event.target === popoverDom || popoverDom.contains(event.target)) {
160
- console.log("click contains");
161
- lastTarget = event.target;
162
- } else {
163
- if (contentRef.value.$el) {
164
- console.log("contentRef.value.$el.contains", contentRef.value.$el.contains(event.target));
165
- }
166
- console.log("click contains--------not");
167
- if (popoverVisible.value) {
168
- closePopover(true);
169
- }
170
- }
171
- }
172
- const symbolUnits = ref([
173
- {
174
- label: "天",
175
- value: "d"
176
- },
177
- {
178
- label: "周",
179
- value: "w"
180
- },
181
- {
182
- label: "月",
183
- value: "m"
184
- },
185
- {
186
- label: "年",
187
- value: "y"
188
- }
189
- ]);
190
- const symbolUnitFormatter = (unit) => {
191
- const items = symbolUnits.value.filter((item) => {
192
- return item.value == unit;
193
- });
194
- if (items.length > 0) {
195
- return items[0].label;
196
- } else {
197
- return "";
198
- }
199
- };
200
- let popoverTimeout = null;
201
- function closePopover(immediate) {
202
- clearTimeout(popoverTimeout);
203
- if (immediate) {
204
- popoverVisible.value = false;
205
- } else {
206
- popoverTimeout = setTimeout(() => {
207
- popoverVisible.value = false;
208
- }, 2e3);
209
- }
210
- }
211
- function openPopover() {
212
- clearTimeout(popoverTimeout);
213
- popoverVisible.value = true;
214
- }
215
- const filterTableData = computed(
216
- () => (
217
- //等于System时为全部
218
- valueOptions.value.filter(
219
- (data) => !searchValue.value || paramType.value == "system" || data.label.toLowerCase().includes(searchValue.value.toLowerCase()) || data.value.toLowerCase().includes(searchValue.value.toLowerCase())
220
- )
221
- )
222
- );
223
- watch(searchValue, () => {
224
- if (paramType.value == "system") {
225
- querySystemParams();
226
- }
227
- });
228
- let lastSystemQuery = null;
229
- function querySystemParams() {
230
- if (lastSystemQuery == searchValue.value) {
231
- return;
232
- }
233
- const param = {
234
- query: searchValue.value
235
- };
236
- lastSystemQuery = searchValue.value;
237
- http.post(window["$vueApp"].config.globalProperties.baseAPI + "/component/system-params/query", param).then((results) => {
238
- const tempOptions = [];
239
- for (let result of results) {
240
- tempOptions.push({
241
- value: result.propKey,
242
- label: result.propKey + " (" + result.propValue + ")"
243
- });
244
- }
245
- selectOptions.value.systemVarOptions = tempOptions;
246
- if (paramType.value == "system") {
247
- setValueOptions(paramType.value);
248
- }
249
- });
250
- }
251
- const tableHeight = computed(() => {
252
- let height = 185;
253
- if (paramType.value == "page") {
254
- height = 170;
255
- }
256
- return height;
257
- });
258
- const searchWidthStyle = computed(() => {
259
- const style = {};
260
- if (paramType.value == "page") {
261
- style.width = "210px";
262
- }
263
- return style;
264
- });
265
- function setSelectOptions() {
266
- if (props.dataModelOptions && props.dataModelOptions.length > 0) {
267
- selectOptions.value.dataModelOptions = props.dataModelOptions;
268
- } else if (props.isTable) {
269
- selectOptions.value.dataModelOptions = tableFieldStore.fieldList;
270
- } else {
271
- selectOptions.value.dataModelOptions = pageContextUtil.pageContextVarOptions.dataOptions;
272
- }
273
- if (props.objModelOptions && props.objModelOptions.length > 0) {
274
- selectOptions.value.objModelOptions = props.objModelOptions;
275
- }
276
- selectOptions.value.pageVarOptions = pageContextUtil.pageContextVarOptions.pageVarOptions;
277
- }
278
- function formatter() {
279
- if (props.modelValue) {
280
- return paramType.value + "." + getValueLabel(paramType.value, paramValue.value);
281
- }
282
- return props.modelValue;
283
- }
284
- let paramTypeCheck = false;
285
- function paramTypeChange(selParamType) {
286
- if (selParamType) {
287
- if (Array.isArray(selParamType)) {
288
- if (selParamType.length > 0) {
289
- selParamType = selParamType[0];
290
- }
291
- }
292
- }
293
- paramType.value = selParamType;
294
- paramValue.value = "";
295
- if (selectInputType.includes(selParamType)) {
296
- showInput.value = false;
297
- setValueOptions(selParamType);
298
- } else {
299
- showInput.value = true;
300
- }
301
- if (paramType.value == "system") {
302
- querySystemParams();
303
- }
304
- paramTypeCheck = true;
305
- }
306
- function setValueOptions(value) {
307
- if (value === "context") {
308
- let options = contextVarOptions;
309
- if (props.isRange) {
310
- options = deepCopy(options);
311
- for (let i = 0; i < options.length; i++) {
312
- let o = options[i];
313
- if (o.value == "currentDate") {
314
- options.splice(i + 1, 0, {
315
- value: "currentDate",
316
- symbolUnit: "d",
317
- symbol: "-",
318
- type: "range"
319
- });
320
- break;
321
- }
322
- }
323
- }
324
- valueOptions.value = options;
325
- } else if (value === "system") {
326
- valueOptions.value = selectOptions.value.systemVarOptions || [];
327
- } else if (value === "task") {
328
- valueOptions.value = taskVarOptions;
329
- } else if (value === "data") {
330
- valueOptions.value = selectOptions.value.dataModelOptions || [];
331
- } else if (value === "obj") {
332
- valueOptions.value = selectOptions.value.objModelOptions && selectOptions.value.objModelOptions.length > 0 ? selectOptions.value.objModelOptions : selectOptions.value.dataModelOptions || [];
333
- console.log("%c描述-172007", "color:#2E3435;background:#F8BB07;padding:3px;border-radius:2px", valueOptions.value);
334
- } else if (value === "params") {
335
- valueOptions.value = selectOptions.value.paramsVarOptions || [];
336
- } else if (value === "page") {
337
- valueOptions.value = selectOptions.value.pageVarOptions || [];
338
- }
339
- }
340
- function clearSelect() {
341
- defalutValue.value = "";
342
- emits("update:modelValue", defalutValue.value);
343
- popoverRef.value.hide();
344
- }
345
- function selectRow(row) {
346
- if (row.type == "range") {
347
- if (row.symbolNum === "") {
348
- ElMessage.warning("周期不能为空!");
349
- return;
350
- }
351
- if (isNaN(row.symbolNum)) {
352
- ElMessage.warning("周期为无效的数字!");
353
- return;
354
- }
355
- if (row.symbolNum != "0") {
356
- paramValue.value = row.value + row.symbol + row.symbolNum + row.symbolUnit;
357
- } else {
358
- paramValue.value = row.value;
359
- }
360
- } else {
361
- paramValue.value = row.value;
362
- }
363
- defalutValue.value = "${" + paramType.value + "." + paramValue.value + "}";
364
- emits("update:modelValue", defalutValue.value, row.alias);
365
- closePopover(true);
366
- }
367
- function addRequestParam(paramName) {
368
- paramValue.value = paramName;
369
- addInputParams();
370
- }
371
- function addInputParams() {
372
- if (!paramValue.value) {
373
- ElMessage.warning("请输入参数名");
374
- return;
375
- }
376
- defalutValue.value = "${" + paramType.value + "." + paramValue.value + "}";
377
- emits("update:modelValue", defalutValue.value);
378
- closePopover(true);
379
- }
380
- function addPageParams() {
381
- searchValue.value = searchValue.value.trim();
382
- if (!searchValue.value) {
383
- ElMessage.warning("请输入参数名");
384
- return;
385
- }
386
- const tempValues = selectOptions.value.pageVarOptions || [];
387
- for (let t of tempValues) {
388
- if (t.value === searchValue.value) {
389
- ElMessage.warning("该变量已存在!");
390
- return;
391
- }
392
- }
393
- const variable = {
394
- code: getUuidv4(),
395
- name: searchValue.value,
396
- alias: searchValue.value,
397
- type: "string",
398
- defaultValue: ""
399
- };
400
- if (!pageContextUtil.pageContext.variables) {
401
- pageContextUtil.pageContext.variables = [];
402
- }
403
- pageContextUtil.pageContext.variables.push(variable);
404
- pageContextUtil.setPageContext(pageContextUtil.pageContext);
405
- selectOptions.value.pageVarOptions = pageContextUtil.pageContextVarOptions.pageVarOptions;
406
- valueOptions.value = selectOptions.value.pageVarOptions || [];
407
- paramValue.value = searchValue.value;
408
- defalutValue.value = "${" + paramType.value + "." + searchValue.value + "}";
409
- searchValue.value = "";
410
- emits("update:modelValue", defalutValue.value);
411
- closePopover(true);
412
- }
413
- function getValueLabel(valueType, value) {
414
- if (selectInputType.includes(valueType)) {
415
- if (valueType === "context" && value && value.startsWith("currentDate") && value.length > 11) {
416
- const str = value.substring(11);
417
- const symbol = str.substring(0, 1);
418
- const num = str.substring(1, str.length - 1);
419
- const unit = str.substring(str.length - 1);
420
- return num + symbolUnitFormatter(unit) + ("+" === symbol ? "后" : "前");
421
- }
422
- const option = valueOptions.value.find((item) => item.value === value);
423
- if (option) {
424
- return option.label;
425
- }
426
- }
427
- return value;
428
- }
429
- const tableRef = ref();
430
- function handSelectRow() {
431
- if (!props.showLabel && !showInput.value) {
432
- const index = filterTableData.value.findIndex((item) => item.value === paramValue.value);
433
- if (index > -1) {
434
- tableRef.value.setCurrentRow(filterTableData.value[index]);
435
- }
436
- }
437
- }
438
- function showPopover() {
439
- openPopover();
440
- nextTick(() => {
441
- setSelectOptions();
442
- if (paramType.value) {
443
- if (selectInputType.includes(paramType.value)) {
444
- showInput.value = false;
445
- setValueOptions(paramType.value);
446
- } else {
447
- showInput.value = true;
448
- }
449
- if (paramType.value == "system") {
450
- querySystemParams();
451
- }
452
- }
453
- handSelectRow();
454
- });
455
- }
456
- return (_ctx, _cache) => {
457
- const _component_el_icon = resolveComponent("el-icon");
458
- const _component_el_input = resolveComponent("el-input");
459
- const _component_el_cascader_panel = resolveComponent("el-cascader-panel");
460
- const _component_el_col = resolveComponent("el-col");
461
- const _component_el_empty = resolveComponent("el-empty");
462
- const _component_el_button = resolveComponent("el-button");
463
- const _component_el_table_column = resolveComponent("el-table-column");
464
- const _component_el_option = resolveComponent("el-option");
465
- const _component_el_select = resolveComponent("el-select");
466
- const _component_el_table = resolveComponent("el-table");
467
- const _component_el_row = resolveComponent("el-row");
468
- const _component_el_popover = resolveComponent("el-popover");
469
- return __props.showLabel ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(defalutValue.value), 1)) : (openBlock(), createBlock(_component_el_popover, {
470
- key: 1,
471
- ref_key: "popoverRef",
472
- ref: popoverRef,
473
- visible: popoverVisible.value,
474
- width: 400
475
- }, {
476
- reference: withCtx(() => [
477
- createVNode(_component_el_input, {
478
- readonly: "",
479
- size: __props.size,
480
- title: defalutValue.value,
481
- ref_key: "inputRef",
482
- ref: inputRef,
483
- onClick: showPopover,
484
- formatter,
485
- modelValue: defalutValue.value,
486
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => defalutValue.value = $event),
487
- placeholder: "请选择"
488
- }, {
489
- suffix: withCtx(() => [
490
- withDirectives(createVNode(_component_el_icon, {
491
- style: { "cursor": "pointer" },
492
- onClick: withModifiers(clearSelect, ["stop"])
493
- }, {
494
- default: withCtx(() => [
495
- createVNode(unref(CircleClose))
496
- ]),
497
- _: 1
498
- }, 512), [
499
- [vShow, defalutValue.value]
500
- ])
501
- ]),
502
- _: 1
503
- }, 8, ["size", "title", "modelValue"])
504
- ]),
505
- default: withCtx(() => [
506
- createVNode(_component_el_row, {
507
- ref_key: "contentRef",
508
- ref: contentRef
509
- }, {
510
- default: withCtx(() => [
511
- createVNode(_component_el_col, { span: 8 }, {
512
- default: withCtx(() => [
513
- createVNode(_component_el_cascader_panel, {
514
- modelValue: paramType.value,
515
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => paramType.value = $event),
516
- onChange: paramTypeChange,
517
- props: { emitPath: true },
518
- size: "small",
519
- options: typeOptions.value,
520
- style: { "height": "240px", "width": "100%" }
521
- }, null, 8, ["modelValue", "options"])
522
- ]),
523
- _: 1
524
- }),
525
- !paramType.value ? (openBlock(), createBlock(_component_el_col, {
526
- key: 0,
527
- span: 16
528
- }, {
529
- default: withCtx(() => [
530
- createVNode(_component_el_empty, {
531
- description: "请选择类型",
532
- "image-size": 40
533
- })
534
- ]),
535
- _: 1
536
- })) : showInput.value ? (openBlock(), createBlock(_component_el_col, {
537
- key: 1,
538
- span: 16,
539
- style: { "padding-left": "10px" }
540
- }, {
541
- default: withCtx(() => [
542
- createVNode(_component_el_input, {
543
- style: { "width": "210px" },
544
- size: "small",
545
- modelValue: paramValue.value,
546
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => paramValue.value = $event),
547
- placeholder: "请手动输入"
548
- }, null, 8, ["modelValue"]),
549
- createVNode(_component_el_button, {
550
- style: { "float": "right" },
551
- onClick: addInputParams,
552
- size: "small",
553
- type: "primary",
554
- icon: unref(Plus),
555
- circle: ""
556
- }, null, 8, ["icon"]),
557
- createElementVNode("div", _hoisted_2, [
558
- createVNode(_component_el_icon, null, {
559
- default: withCtx(() => [
560
- createVNode(unref(InfoFilled))
561
- ]),
562
- _: 1
563
- }),
564
- _hoisted_3
565
- ]),
566
- withDirectives(createElementVNode("div", _hoisted_4, [
567
- createTextVNode(" 常用参数: "),
568
- createVNode(_component_el_button, {
569
- type: "primary",
570
- size: "small",
571
- onClick: _cache[3] || (_cache[3] = ($event) => addRequestParam("query"))
572
- }, {
573
- default: withCtx(() => [
574
- createTextVNode("query")
575
- ]),
576
- _: 1
577
- })
578
- ], 512), [
579
- [vShow, paramType.value == "request"]
580
- ])
581
- ]),
582
- _: 1
583
- })) : (openBlock(), createBlock(_component_el_col, {
584
- key: 2,
585
- span: 16,
586
- style: { "padding-left": "10px" }
587
- }, {
588
- default: withCtx(() => [
589
- createVNode(_component_el_input, {
590
- size: "small",
591
- modelValue: searchValue.value,
592
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => searchValue.value = $event),
593
- placeholder: "搜索",
594
- "suffix-icon": unref(Search),
595
- style: normalizeStyle([{ "margin-bottom": "5px", "height": "25px" }, searchWidthStyle.value])
596
- }, null, 8, ["modelValue", "suffix-icon", "style"]),
597
- withDirectives(createVNode(_component_el_button, {
598
- style: { "float": "right" },
599
- onClick: addPageParams,
600
- size: "small",
601
- type: "primary",
602
- icon: unref(Plus),
603
- circle: ""
604
- }, null, 8, ["icon"]), [
605
- [vShow, paramType.value == "page"]
606
- ]),
607
- withDirectives(createElementVNode("div", _hoisted_5, [
608
- createVNode(_component_el_icon, null, {
609
- default: withCtx(() => [
610
- createVNode(unref(InfoFilled))
611
- ]),
612
- _: 1
613
- }),
614
- _hoisted_6
615
- ], 512), [
616
- [vShow, paramType.value == "page"]
617
- ]),
618
- createVNode(_component_el_table, {
619
- ref_key: "tableRef",
620
- ref: tableRef,
621
- height: tableHeight.value,
622
- "show-header": false,
623
- size: "small",
624
- "current-row-key": "code",
625
- "row-key": "code",
626
- "tree-props": { children: "items" },
627
- "highlight-current-row": true,
628
- data: filterTableData.value
629
- }, {
630
- default: withCtx(() => [
631
- createVNode(_component_el_table_column, { width: "65" }, {
632
- default: withCtx((scope) => [
633
- createVNode(_component_el_button, {
634
- size: "small",
635
- onClick: ($event) => selectRow(scope.row)
636
- }, {
637
- default: withCtx(() => [
638
- createTextVNode(" 选择 ")
639
- ]),
640
- _: 2
641
- }, 1032, ["onClick"])
642
- ]),
643
- _: 1
644
- }),
645
- createVNode(_component_el_table_column, {
646
- label: "Date",
647
- prop: "label"
648
- }, {
649
- default: withCtx((scope) => [
650
- paramType.value == "context" && scope.row.type == "range" ? (openBlock(), createElementBlock("div", _hoisted_7, [
651
- createVNode(_component_el_input, {
652
- size: "small",
653
- modelValue: scope.row.symbolNum,
654
- "onUpdate:modelValue": ($event) => scope.row.symbolNum = $event,
655
- placeholder: "",
656
- style: { "width": "35px", "margin-left": "4px" }
657
- }, null, 8, ["modelValue", "onUpdate:modelValue"]),
658
- createVNode(_component_el_select, {
659
- size: "small",
660
- style: { "margin-left": "4px", "width": "50px" },
661
- modelValue: scope.row.symbolUnit,
662
- "onUpdate:modelValue": ($event) => scope.row.symbolUnit = $event,
663
- placeholder: ""
664
- }, {
665
- default: withCtx(() => [
666
- createVNode(_component_el_option, {
667
- label: "天",
668
- value: "d"
669
- }),
670
- createVNode(_component_el_option, {
671
- label: "周",
672
- value: "w"
673
- }),
674
- createVNode(_component_el_option, {
675
- label: "月",
676
- value: "m"
677
- }),
678
- createVNode(_component_el_option, {
679
- label: "年",
680
- value: "y"
681
- })
682
- ]),
683
- _: 2
684
- }, 1032, ["modelValue", "onUpdate:modelValue"]),
685
- createVNode(_component_el_select, {
686
- size: "small",
687
- style: { "margin-left": "4px", "width": "50px" },
688
- modelValue: scope.row.symbol,
689
- "onUpdate:modelValue": ($event) => scope.row.symbol = $event,
690
- placeholder: ""
691
- }, {
692
- default: withCtx(() => [
693
- createVNode(_component_el_option, {
694
- label: "前",
695
- value: "-"
696
- }),
697
- createVNode(_component_el_option, {
698
- label: "后",
699
- value: "+"
700
- })
701
- ]),
702
- _: 2
703
- }, 1032, ["modelValue", "onUpdate:modelValue"])
704
- ])) : createCommentVNode("", true),
705
- paramType.value == "data" || paramType.value == "obj" ? (openBlock(), createElementBlock("span", {
706
- key: 1,
707
- title: scope.row.label + " " + scope.row.value
708
- }, toDisplayString(scope.row.label + " " + scope.row.value), 9, _hoisted_8)) : (openBlock(), createElementBlock("span", {
709
- key: 2,
710
- title: scope.row.label
711
- }, toDisplayString(scope.row.label), 9, _hoisted_9))
712
- ]),
713
- _: 1
714
- })
715
- ]),
716
- _: 1
717
- }, 8, ["height", "data"]),
718
- createElementVNode("div", _hoisted_10, "总计:" + toDisplayString(filterTableData.value.length), 1)
719
- ]),
720
- _: 1
721
- }))
722
- ]),
723
- _: 1
724
- }, 512)
725
- ]),
726
- _: 1
727
- }, 8, ["visible"]));
728
- };
729
- }
730
- });
731
- export {
732
- _sfc_main as default
733
- };
1
+