@fecp/designer 5.5.63 → 5.5.65

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 (29) hide show
  1. package/es/designer/package.json.mjs +1 -1
  2. package/es/designer/src/packages/dialogGlobal/index.vue.mjs +1 -1
  3. package/es/designer.css +127 -56
  4. package/es/packages/mobile/index.mjs +2 -0
  5. package/es/packages/mobile/src/components/all.mjs +2 -0
  6. package/es/packages/mobile/src/components/base/card/Card.vue.mjs +2 -2
  7. package/es/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.mjs +18 -4
  8. package/es/packages/mobile/src/components/dataDisplay/table/Table.vue.mjs +21 -4
  9. package/es/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.mjs +249 -0
  10. package/es/packages/mobile/src/components/feedback/quickFilter/index.mjs +10 -0
  11. package/es/packages/mobile/src/components/form/search/Search.vue.mjs +159 -15
  12. package/es/packages/vue/src/components/details/footer/Footer.vue.mjs +3 -2
  13. package/es/packages/vue/src/components/forms/cascader/Cascader.vue.mjs +1 -1
  14. package/es/packages/vue/src/components/forms/form/Form.vue.mjs +1 -1
  15. package/lib/designer/package.json.js +1 -1
  16. package/lib/designer/src/packages/dialogGlobal/index.vue.js +1 -1
  17. package/lib/designer.css +127 -56
  18. package/lib/packages/mobile/index.js +74 -72
  19. package/lib/packages/mobile/src/components/all.js +74 -72
  20. package/lib/packages/mobile/src/components/base/card/Card.vue.js +2 -2
  21. package/lib/packages/mobile/src/components/dataDisplay/cardList/CardList.vue.js +17 -3
  22. package/lib/packages/mobile/src/components/dataDisplay/table/Table.vue.js +20 -3
  23. package/lib/packages/mobile/src/components/feedback/quickFilter/QuickFilter.vue.js +249 -0
  24. package/lib/packages/mobile/src/components/feedback/quickFilter/index.js +10 -0
  25. package/lib/packages/mobile/src/components/form/search/Search.vue.js +158 -14
  26. package/lib/packages/vue/src/components/details/footer/Footer.vue.js +3 -2
  27. package/lib/packages/vue/src/components/forms/cascader/Cascader.vue.js +1 -1
  28. package/lib/packages/vue/src/components/forms/form/Form.vue.js +1 -1
  29. package/package.json +1 -1
@@ -7,6 +7,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
7
7
  ;/* empty css */
8
8
  ;/* empty css */
9
9
  const Vue = require("vue");
10
+ const datasource = require("../../../utils/datasource.js");
11
+ const QuickFilter = require("../../feedback/quickFilter/QuickFilter.vue.js");
10
12
  const index = require("../../../../node_modules/vant/es/search/index.js");
11
13
  const _sfc_main = {
12
14
  __name: "Search",
@@ -14,29 +16,171 @@ const _sfc_main = {
14
16
  placeholder: {
15
17
  type: String,
16
18
  default: ""
19
+ },
20
+ filterMode: {
21
+ type: String,
22
+ default: "input"
23
+ },
24
+ dataSources: {
25
+ type: Array,
26
+ default: () => []
27
+ },
28
+ filterConfig: {
29
+ type: Array,
30
+ default: () => []
17
31
  }
18
32
  },
19
- setup(__props) {
20
- const showAction = Vue.ref(false);
33
+ emits: ["filterChange"],
34
+ setup(__props, { emit: __emit }) {
35
+ const props = __props;
36
+ const emit = __emit;
37
+ const currentInstance = Vue.getCurrentInstance();
38
+ const ctx = currentInstance.proxy;
39
+ const searchData = Vue.ref("");
21
40
  function onClickFilter() {
22
- showAction.value = true;
41
+ }
42
+ function onClickButton() {
43
+ onSearch(searchData.value);
23
44
  }
24
45
  function onSearch(val) {
25
46
  }
26
- function onCancel() {
27
- showAction.value = false;
47
+ function onQuickFilterChange(result) {
48
+ console.log("筛选数据:", result);
49
+ emit("filterChange", result);
28
50
  }
51
+ const filterData = Vue.ref([]);
52
+ const loadFieldDataSources = async () => {
53
+ var _a, _b;
54
+ const optionsDatas = [];
55
+ const fields = props.filterConfig;
56
+ const fieldDataSources = /* @__PURE__ */ new Set();
57
+ const dictionaryKeys = /* @__PURE__ */ new Set();
58
+ const dataSourceOptions = Vue.ref({});
59
+ const dictionaryOptions = Vue.ref({});
60
+ for (const component of fields) {
61
+ const { optionSource, dataSourceValue, dictionaryValue } = component.optionConfig;
62
+ if (optionSource === "dataSource" && dataSourceValue) {
63
+ fieldDataSources.add(dataSourceValue);
64
+ } else if (optionSource === "dictionary" && dictionaryValue) {
65
+ dictionaryKeys.add(dictionaryValue);
66
+ }
67
+ }
68
+ for (const dataSourceId of fieldDataSources) {
69
+ if (dataSourceOptions.value[dataSourceId]) continue;
70
+ try {
71
+ const dsManager = datasource.createDataSource({
72
+ http: ctx.$http,
73
+ dataSources: props.dataSources,
74
+ currentDataSourceId: dataSourceId
75
+ });
76
+ const data = await dsManager.fetch();
77
+ let options = [];
78
+ if (Array.isArray(data)) {
79
+ options = data;
80
+ } else if (typeof data === "object") {
81
+ options = Array.isArray(data.data) ? data.data : ((_a = data.data) == null ? void 0 : _a.records) || ((_b = data.data) == null ? void 0 : _b.list) || [];
82
+ }
83
+ dataSourceOptions.value[dataSourceId] = options;
84
+ dsManager.destroy();
85
+ } catch (error) {
86
+ console.error(`Failed to load data source ${dataSourceId}:`, error);
87
+ }
88
+ }
89
+ if (dictionaryKeys.size > 0) {
90
+ try {
91
+ const keyName = Array.from(dictionaryKeys).join(",");
92
+ const response = await ctx.$http.postForm(
93
+ "/base-server/parm/sysParmDic/getDicListByKey",
94
+ {
95
+ keyName
96
+ }
97
+ );
98
+ const dictionaryData = response;
99
+ if (typeof dictionaryData === "object") {
100
+ Object.keys(dictionaryData).forEach((dictKey) => {
101
+ if (dictionaryKeys.has(dictKey)) {
102
+ const dictItems = dictionaryData[dictKey];
103
+ if (Array.isArray(dictItems)) {
104
+ dictionaryOptions.value[dictKey] = dictItems;
105
+ }
106
+ }
107
+ });
108
+ }
109
+ } catch (error) {
110
+ console.error("Failed to load dictionary data:", error);
111
+ }
112
+ }
113
+ fields.forEach((component) => {
114
+ if (!component.optionConfig) return;
115
+ let options = [];
116
+ const {
117
+ optionSource,
118
+ dataSourceValue,
119
+ dictionaryValue,
120
+ displayField,
121
+ valueField,
122
+ idField,
123
+ pidField
124
+ } = component.optionConfig;
125
+ if (optionSource === "dataSource" && dataSourceOptions.value[dataSourceValue]) {
126
+ const rawOptions = dataSourceOptions.value[dataSourceValue];
127
+ const labelField = displayField || "label";
128
+ const keyField = valueField || "value";
129
+ options = rawOptions.map((item) => ({
130
+ label: item[labelField],
131
+ value: item[keyField],
132
+ ...item
133
+ }));
134
+ optionsDatas.push({ ...component, options });
135
+ } else if (optionSource === "dictionary" && dictionaryOptions.value[dictionaryValue]) {
136
+ const rawOptions = dictionaryOptions.value[dictionaryValue];
137
+ const labelField = "optName";
138
+ const keyField = "optCode";
139
+ options = rawOptions.map((item) => ({
140
+ label: item[labelField],
141
+ value: item[keyField]
142
+ }));
143
+ optionsDatas.push({ ...component, options });
144
+ } else if (optionSource === "custom") {
145
+ optionsDatas.push({
146
+ ...component,
147
+ options: component.optionConfig.options || []
148
+ });
149
+ }
150
+ });
151
+ filterData.value = [...optionsDatas];
152
+ };
153
+ Vue.watch(
154
+ () => props.filterConfig.map((item) => ({
155
+ label: item.label
156
+ })),
157
+ () => {
158
+ loadFieldDataSources();
159
+ },
160
+ { deep: true, immediate: true }
161
+ );
29
162
  return (_ctx, _cache) => {
30
163
  const _component_van_search = index.Search;
31
- return Vue.openBlock(), Vue.createBlock(_component_van_search, {
32
- shape: "round",
33
- placeholder: __props.placeholder,
34
- "show-action": Vue.unref(showAction),
35
- clearable: "",
36
- onSearch,
37
- onCancel,
38
- onClickInput: onClickFilter
39
- }, null, 8, ["placeholder", "show-action"]);
164
+ return Vue.openBlock(), Vue.createElementBlock(Vue.Fragment, null, [
165
+ Vue.createVNode(_component_van_search, {
166
+ modelValue: Vue.unref(searchData),
167
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => Vue.isRef(searchData) ? searchData.value = $event : null),
168
+ shape: "round",
169
+ placeholder: __props.placeholder,
170
+ "show-action": __props.filterMode == "input",
171
+ clearable: "",
172
+ onClickInput: _cache[1] || (_cache[1] = Vue.withModifiers(($event) => __props.filterMode == "router" && onClickFilter, ["stop"]))
173
+ }, {
174
+ action: Vue.withCtx(() => [
175
+ Vue.createElementVNode("div", { onClick: onClickButton }, "搜索")
176
+ ]),
177
+ _: 1
178
+ }, 8, ["modelValue", "placeholder", "show-action"]),
179
+ Vue.createVNode(QuickFilter.default, {
180
+ "filter-data": Vue.unref(filterData),
181
+ onChange: onQuickFilterChange
182
+ }, null, 8, ["filter-data"])
183
+ ], 64);
40
184
  };
41
185
  }
42
186
  };
@@ -34,7 +34,8 @@ const _sfc_main = {
34
34
  };
35
35
  const showFooter = Vue.ref(true);
36
36
  Vue.onMounted(() => {
37
- const layoutDom = formDetailsFooterRef.value.$el.closest(".fec-layout-row");
37
+ var _a;
38
+ const layoutDom = (_a = formDetailsFooterRef.value) == null ? void 0 : _a.$el.closest(".fec-layout-row");
38
39
  if (layoutDom && props.formMode == "query") {
39
40
  showFooter.value = false;
40
41
  }
@@ -75,5 +76,5 @@ const _sfc_main = {
75
76
  };
76
77
  }
77
78
  };
78
- const component = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-69e1a97b"]]);
79
+ const component = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-deabd2d2"]]);
79
80
  exports.default = component;
@@ -109,7 +109,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
109
109
  textArr.push(label);
110
110
  }
111
111
  });
112
- return textArr.join("|");
112
+ return textArr.join(" / ");
113
113
  };
114
114
  const options = Vue.computed(() => {
115
115
  if (!props.optionConfig) return [];
@@ -1215,5 +1215,5 @@ const _sfc_main = /* @__PURE__ */ Object.assign({
1215
1215
  };
1216
1216
  }
1217
1217
  });
1218
- const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-5127d7fd"]]);
1218
+ const _Form = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-0976aa9f"]]);
1219
1219
  exports.default = _Form;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fecp/designer",
3
- "version": "5.5.63",
3
+ "version": "5.5.65",
4
4
  "main": "lib/designer/index.js",
5
5
  "module": "es/designer/index.mjs",
6
6
  "files": [