@fmdeui/fmui 1.0.113 → 1.0.115

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 (44) hide show
  1. package/es/component.mjs +3 -1
  2. package/es/components/fm-datepicker/index.d.ts +33 -0
  3. package/es/components/fm-datepicker/index.vue.d.ts +34 -0
  4. package/es/components/index.d.ts +1 -0
  5. package/es/hooks/useVxeTableOptionsHook.d.ts +4 -0
  6. package/es/index.mjs +1 -1
  7. package/es/packages/components/fm-autocomplete/index2.vue.mjs +46 -41
  8. package/es/packages/components/fm-datepicker/index.mjs +6 -0
  9. package/es/packages/components/fm-datepicker/index.vue.mjs +5 -0
  10. package/es/packages/components/fm-datepicker/index2.vue.mjs +56 -0
  11. package/es/packages/components/index.mjs +1 -0
  12. package/es/packages/hooks/useVxeTableOptionsHook.mjs +22 -4
  13. package/es/packages/utils/formatTime.mjs +12 -1
  14. package/es/packages/utils/index.mjs +1 -1
  15. package/es/utils/formatTime.d.ts +10 -0
  16. package/index.js +183 -93
  17. package/index.min.js +7 -7
  18. package/index.min.mjs +7 -7
  19. package/index.mjs +182 -94
  20. package/lib/component.js +3 -1
  21. package/lib/components/fm-datepicker/index.d.ts +33 -0
  22. package/lib/components/fm-datepicker/index.vue.d.ts +34 -0
  23. package/lib/components/index.d.ts +1 -0
  24. package/lib/hooks/useVxeTableOptionsHook.d.ts +4 -0
  25. package/lib/index.js +2 -0
  26. package/lib/packages/components/fm-autocomplete/index2.vue.js +45 -40
  27. package/lib/packages/components/fm-datepicker/index.js +8 -0
  28. package/lib/packages/components/fm-datepicker/index.vue.js +9 -0
  29. package/lib/packages/components/fm-datepicker/index2.vue.js +60 -0
  30. package/lib/packages/components/index.js +6 -4
  31. package/lib/packages/hooks/useVxeTableOptionsHook.js +22 -4
  32. package/lib/packages/utils/formatTime.js +13 -0
  33. package/lib/packages/utils/index.js +2 -0
  34. package/lib/utils/formatTime.d.ts +10 -0
  35. package/locale/en.js +1 -1
  36. package/locale/en.min.js +1 -1
  37. package/locale/en.min.mjs +1 -1
  38. package/locale/en.mjs +1 -1
  39. package/locale/zh-cn.js +1 -1
  40. package/locale/zh-cn.min.js +1 -1
  41. package/locale/zh-cn.min.mjs +1 -1
  42. package/locale/zh-cn.mjs +1 -1
  43. package/package.json +1 -1
  44. /package/es/{defaults.css → make-installer.css} +0 -0
package/es/component.mjs CHANGED
@@ -16,6 +16,7 @@ import { FmCascader } from './packages/components/fmcascader/index.mjs';
16
16
  import { FmInputNumber } from './packages/components/fm-inputnumber/index.mjs';
17
17
  import { FmAutocomplete } from './packages/components/fm-autocomplete/index.mjs';
18
18
  import { FmSelect } from './packages/components/fm-select/index.mjs';
19
+ import { Fmdatepicker } from './packages/components/fm-datepicker/index.mjs';
19
20
 
20
21
  const plugins = [
21
22
  FButton,
@@ -35,7 +36,8 @@ const plugins = [
35
36
  FmCascader,
36
37
  FmInputNumber,
37
38
  FmAutocomplete,
38
- FmSelect
39
+ FmSelect,
40
+ Fmdatepicker
39
41
  ];
40
42
 
41
43
  export { plugins as default };
@@ -0,0 +1,33 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ export declare const Fmdatepicker: DefineComponent<ExtractPropTypes<{
3
+ dateType: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ adddaynum: {
8
+ type: NumberConstructor;
9
+ default: number;
10
+ };
11
+ modelValue: {
12
+ type: PropType<any>;
13
+ };
14
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
+ "update:modelValue": (value: any) => any;
16
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
17
+ dateType: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ adddaynum: {
22
+ type: NumberConstructor;
23
+ default: number;
24
+ };
25
+ modelValue: {
26
+ type: PropType<any>;
27
+ };
28
+ }>> & Readonly<{
29
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
30
+ }>, {
31
+ dateType: string;
32
+ adddaynum: number;
33
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,34 @@
1
+ import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
+ declare const _default: DefineComponent<ExtractPropTypes<{
3
+ dateType: {
4
+ type: StringConstructor;
5
+ default: string;
6
+ };
7
+ adddaynum: {
8
+ type: NumberConstructor;
9
+ default: number;
10
+ };
11
+ modelValue: {
12
+ type: PropType<any>;
13
+ };
14
+ }>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
15
+ "update:modelValue": (value: any) => any;
16
+ }, string, PublicProps, Readonly< ExtractPropTypes<{
17
+ dateType: {
18
+ type: StringConstructor;
19
+ default: string;
20
+ };
21
+ adddaynum: {
22
+ type: NumberConstructor;
23
+ default: number;
24
+ };
25
+ modelValue: {
26
+ type: PropType<any>;
27
+ };
28
+ }>> & Readonly<{
29
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
30
+ }>, {
31
+ dateType: string;
32
+ adddaynum: number;
33
+ }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
34
+ export default _default;
@@ -15,3 +15,4 @@ export * from './fm-select';
15
15
  export * from './fm-inputdropdown';
16
16
  export * from './fm-inputnumber';
17
17
  export * from './fm-autocomplete';
18
+ export * from './fm-datepicker';
@@ -38,6 +38,10 @@ interface iVxeOption {
38
38
  footerData?: VxeTablePropTypes.FooterData;
39
39
  footerMethod?: VxeTablePropTypes.FooterMethod<any>;
40
40
  remoteCustom?: boolean;
41
+ spanRules?: Array<{
42
+ valueField: string;
43
+ targetFields: string[];
44
+ }>;
41
45
  }
42
46
  /**
43
47
  * Vxe表格参数化Hook
package/es/index.mjs CHANGED
@@ -27,7 +27,7 @@ export { default as en } from './packages/locale/lang/en.mjs';
27
27
  export { exportExcel } from './packages/utils/exportExcel.mjs';
28
28
  export { feature, useSysApi } from './packages/api/sys/index.mjs';
29
29
  export { flowLoading } from './packages/utils/flowLoading.mjs';
30
- export { formatAxis, formatDate, formatPast, getWeek } from './packages/utils/formatTime.mjs';
30
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './packages/utils/formatTime.mjs';
31
31
  export { gcj02ToBd09, wgs84ToBd09, wgs84ToGcj02 } from './packages/utils/gpsConvertor.mjs';
32
32
  export { getFileUrl, showFileUrl } from './packages/utils/uploadfileurl.mjs';
33
33
  export { getFormItemLabel, getFormItemProp, getRules, getShowColumn, getShowColumnWidth, getSubFormFields, getlimit, showTabelColumn } from './packages/hooks/limitsFunction.mjs';
@@ -1,4 +1,4 @@
1
- import { defineComponent, useModel, ref, resolveComponent, openBlock, createBlock, withCtx, createVNode, withModifiers, unref, createCommentVNode, createElementVNode, toDisplayString, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, ref, resolveComponent, openBlock, createBlock, createSlots, withCtx, createElementVNode, toDisplayString, createVNode, withModifiers, unref, createCommentVNode, mergeModels } from 'vue';
2
2
  import { Search } from '@element-plus/icons-vue';
3
3
  import '../../api/index.mjs';
4
4
  import './component/userSelectDialog.vue.mjs';
@@ -157,7 +157,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
157
157
  "trigger-on-focus": false,
158
158
  onSelect: handleSelect,
159
159
  style: { "margin-top": "-2px" }
160
- }, {
160
+ }, createSlots({
161
161
  default: withCtx(({ item }) => [
162
162
  createElementVNode(
163
163
  "div",
@@ -167,45 +167,50 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
167
167
  /* TEXT */
168
168
  )
169
169
  ]),
170
- suffix: withCtx(() => [
171
- createVNode(_component_el_icon, {
172
- color: "#E6A23C",
173
- size: __props.searchsize,
174
- onClick: _cache[0] || (_cache[0] = withModifiers(() => visibleopenDialog.value = true, ["stop"]))
175
- }, {
176
- default: withCtx(() => [
177
- createVNode(unref(Search))
178
- ]),
179
- _: 1
180
- /* STABLE */
181
- }, 8, ["size"]),
182
- __props.openType == 0 ? (openBlock(), createBlock(_sfc_main$1, {
183
- key: 0,
184
- visible: visibleopenDialog.value,
185
- "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visibleopenDialog.value = $event),
186
- orgService: __props.orgService,
187
- orgAction: __props.orgAction,
188
- orgparas: __props.params,
189
- title: __props.title,
190
- userService: __props.userService,
191
- userAction: __props.userAction,
192
- userParams: __props.params,
193
- onChange: handleSelectDialogChange
194
- }, null, 8, ["visible", "orgService", "orgAction", "orgparas", "title", "userService", "userAction", "userParams"])) : createCommentVNode("v-if", true),
195
- __props.openType == 2 ? (openBlock(), createBlock(_sfc_main$2, {
196
- key: 1,
197
- visible: visibleopenDialog.value,
198
- "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => visibleopenDialog.value = $event),
199
- title: __props.title,
200
- userService: __props.userService,
201
- userAction: __props.userAction,
202
- userParams: __props.params,
203
- onChange: handleSelectDialogChange
204
- }, null, 8, ["visible", "title", "userService", "userAction", "userParams"])) : createCommentVNode("v-if", true)
205
- ]),
206
- _: 1
207
- /* STABLE */
208
- }, 8, ["modelValue", "placeholder"]);
170
+ _: 2
171
+ /* DYNAMIC */
172
+ }, [
173
+ __props.openType > -1 ? {
174
+ name: "suffix",
175
+ fn: withCtx(() => [
176
+ createVNode(_component_el_icon, {
177
+ color: "#E6A23C",
178
+ size: __props.searchsize,
179
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => visibleopenDialog.value = true, ["stop"]))
180
+ }, {
181
+ default: withCtx(() => [
182
+ createVNode(unref(Search))
183
+ ]),
184
+ _: 1
185
+ /* STABLE */
186
+ }, 8, ["size"]),
187
+ __props.openType == 0 ? (openBlock(), createBlock(_sfc_main$1, {
188
+ key: 0,
189
+ visible: visibleopenDialog.value,
190
+ "onUpdate:visible": _cache[1] || (_cache[1] = ($event) => visibleopenDialog.value = $event),
191
+ orgService: __props.orgService,
192
+ orgAction: __props.orgAction,
193
+ orgparas: __props.params,
194
+ title: __props.title,
195
+ userService: __props.userService,
196
+ userAction: __props.userAction,
197
+ userParams: __props.params,
198
+ onChange: handleSelectDialogChange
199
+ }, null, 8, ["visible", "orgService", "orgAction", "orgparas", "title", "userService", "userAction", "userParams"])) : createCommentVNode("v-if", true),
200
+ __props.openType == 2 ? (openBlock(), createBlock(_sfc_main$2, {
201
+ key: 1,
202
+ visible: visibleopenDialog.value,
203
+ "onUpdate:visible": _cache[2] || (_cache[2] = ($event) => visibleopenDialog.value = $event),
204
+ title: __props.title,
205
+ userService: __props.userService,
206
+ userAction: __props.userAction,
207
+ userParams: __props.params,
208
+ onChange: handleSelectDialogChange
209
+ }, null, 8, ["visible", "title", "userService", "userAction", "userParams"])) : createCommentVNode("v-if", true)
210
+ ]),
211
+ key: "0"
212
+ } : void 0
213
+ ]), 1032, ["modelValue", "placeholder"]);
209
214
  };
210
215
  }
211
216
  });
@@ -0,0 +1,6 @@
1
+ import './index.vue.mjs';
2
+ import _sfc_main from './index2.vue.mjs';
3
+
4
+ const Fmdatepicker = _sfc_main;
5
+
6
+ export { Fmdatepicker };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from './index2.vue.mjs';
2
+
3
+
4
+
5
+ export { _sfc_main as default };
@@ -0,0 +1,56 @@
1
+ import { defineComponent, useModel, onMounted, nextTick, resolveComponent, openBlock, createBlock, mergeModels } from 'vue';
2
+ import '../../utils/index.mjs';
3
+ import { getBdate, getEdate, formatDate } from '../../utils/formatTime.mjs';
4
+
5
+ var _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{
7
+ name: "Fmdatepicker"
8
+ },
9
+ __name: "index",
10
+ props: /* @__PURE__ */ mergeModels({
11
+ dateType: {
12
+ type: String,
13
+ default: "bdate"
14
+ },
15
+ adddaynum: {
16
+ type: Number,
17
+ default: 0
18
+ }
19
+ }, {
20
+ "modelValue": {},
21
+ "modelModifiers": {}
22
+ }),
23
+ emits: ["update:modelValue"],
24
+ setup(__props) {
25
+ const modeValue = useModel(__props, "modelValue");
26
+ const props = __props;
27
+ onMounted(() => {
28
+ nextTick(() => {
29
+ initdate();
30
+ });
31
+ });
32
+ const initdate = () => {
33
+ if (props.dateType === "bdate" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
34
+ modeValue.value = getBdate(props.adddaynum);
35
+ } else if (props.dateType === "edate" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
36
+ modeValue.value = getEdate(props.adddaynum);
37
+ } else if (props.dateType === "curday" && (modeValue.value == null || modeValue.value == void 0 || modeValue.value == "")) {
38
+ modeValue.value = formatDate(/* @__PURE__ */ new Date(), "YYYY-mm-dd");
39
+ }
40
+ };
41
+ initdate();
42
+ return (_ctx, _cache) => {
43
+ const _component_el_date_picker = resolveComponent("el-date-picker");
44
+ return openBlock(), createBlock(_component_el_date_picker, {
45
+ class: "fmdatepicker",
46
+ modelValue: modeValue.value,
47
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValue.value = $event),
48
+ type: "date",
49
+ format: "YYYY-MM-DD",
50
+ "value-format": "YYYY-MM-DD"
51
+ }, null, 8, ["modelValue"]);
52
+ };
53
+ }
54
+ });
55
+
56
+ export { _sfc_main as default };
@@ -15,3 +15,4 @@ export { FmSelect } from './fm-select/index.mjs';
15
15
  export { Fminputdropdown } from './fm-inputdropdown/index.mjs';
16
16
  export { FmInputNumber } from './fm-inputnumber/index.mjs';
17
17
  export { FmAutocomplete } from './fm-autocomplete/index.mjs';
18
+ export { Fmdatepicker } from './fm-datepicker/index.mjs';
@@ -7,7 +7,7 @@ import '../api/index.mjs';
7
7
  import { useBaseApi } from '../api/base/index.mjs';
8
8
 
9
9
  const useVxeTable = (opt, extras) => {
10
- var _a, _b;
10
+ var _a, _b, _c;
11
11
  const vxeSize = useThemeConfig().themeConfig.globalComponentSize == "small" ? "mini" : useThemeConfig().themeConfig.globalComponentSize == "default" ? "small" : "medium";
12
12
  const userStore = useUserInfo();
13
13
  const processColumns = (columns) => {
@@ -58,7 +58,25 @@ const useVxeTable = (opt, extras) => {
58
58
  }
59
59
  }
60
60
  }
61
- } : opt.spanMethod ? opt.spanMethod : ({ row, rowIndex, column, visibleData }) => {
61
+ } : opt.spanMethod ? opt.spanMethod : opt.spanRules && ((_c = opt.spanRules) == null ? void 0 : _c.length) > 0 ? ({ row, rowIndex, column, visibleData }) => {
62
+ if (!opt.spanRules || opt.spanRules.length === 0) return void 0;
63
+ const rule = opt.spanRules.find((r) => r.targetFields.includes(column.field));
64
+ if (!rule) return;
65
+ const cellValue = row[rule.valueField];
66
+ if (!cellValue && cellValue !== 0) return;
67
+ const prevRow = visibleData[rowIndex - 1];
68
+ if (prevRow && prevRow[rule.valueField] === cellValue) {
69
+ return { rowspan: 0, colspan: 0 };
70
+ }
71
+ let rowspanCount = 1;
72
+ let nextIndex = rowIndex + 1;
73
+ while (nextIndex < visibleData.length && visibleData[nextIndex][rule.valueField] === cellValue) {
74
+ rowspanCount++;
75
+ nextIndex++;
76
+ }
77
+ if (rowspanCount > 1)
78
+ return { rowspan: rowspanCount, colspan: 1 };
79
+ } : ({ row, rowIndex, column, visibleData }) => {
62
80
  };
63
81
  const options = reactive({
64
82
  stripe: false,
@@ -159,11 +177,11 @@ const useVxeTable = (opt, extras) => {
159
177
  }
160
178
  if (opt.remoteCustom && options.customConfig != void 0) {
161
179
  options.customConfig.restoreStore = async ({ id, storeData }) => {
162
- var _a2, _b2, _c, _d;
180
+ var _a2, _b2, _c2, _d;
163
181
  const { data } = await useBaseApi("sysColumnCustom").get({ id }, "sysColumnCustomDetail");
164
182
  if ((_a2 = data.result) == null ? void 0 : _a2.fixedData) storeData.fixedData = data.result.fixedData;
165
183
  if ((_b2 = data.result) == null ? void 0 : _b2.resizableData) storeData.resizableData = data.result.resizableData;
166
- if ((_c = data.result) == null ? void 0 : _c.sortData) storeData.sortData = data.result.sortData;
184
+ if ((_c2 = data.result) == null ? void 0 : _c2.sortData) storeData.sortData = data.result.sortData;
167
185
  if ((_d = data.result) == null ? void 0 : _d.visibleData) storeData.visibleData = data.result.visibleData;
168
186
  return storeData;
169
187
  };
@@ -106,5 +106,16 @@ function formatAxis(param, t) {
106
106
  else if (hour < 22) return getMessage("eveningGreeting");
107
107
  else return getMessage("nightGreeting");
108
108
  }
109
+ function getBdate(num = 1) {
110
+ const firstDay = /* @__PURE__ */ new Date();
111
+ firstDay.setDate(num);
112
+ return formatDate(firstDay, "YYYY-mm-dd");
113
+ }
114
+ function getEdate(num = 0) {
115
+ const lastDay = /* @__PURE__ */ new Date();
116
+ lastDay.setMonth(lastDay.getMonth() + 1, 0);
117
+ if (num > 0) lastDay.setDate(num);
118
+ return formatDate(lastDay, "YYYY-mm-dd");
119
+ }
109
120
 
110
- export { formatAxis, formatDate, formatPast, getWeek };
121
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek };
@@ -5,7 +5,7 @@ export { signatureByKSort } from './data-signature.mjs';
5
5
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './download.mjs';
6
6
  export { exportExcel } from './exportExcel.mjs';
7
7
  export { flowLoading } from './flowLoading.mjs';
8
- export { formatAxis, formatDate, formatPast, getWeek } from './formatTime.mjs';
8
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './formatTime.mjs';
9
9
  export { useFormRulePresets } from './formRule.mjs';
10
10
  export { validateFormWithScroll, validateFormWithScrollCallback } from './formValidate.mjs';
11
11
  import './getStyleSheets.mjs';
@@ -35,3 +35,13 @@ export declare function formatPast(param: string | Date, format?: string): strin
35
35
  * @returns 返回拼接后的时间字符串
36
36
  */
37
37
  export declare function formatAxis(param: Date, t?: Function): string;
38
+ /**
39
+ *
40
+ * @returns 返回当前月的第一天
41
+ */
42
+ export declare function getBdate(num?: number): string;
43
+ /**
44
+ *
45
+ * @returns 返回当前月的最后一天
46
+ */
47
+ export declare function getEdate(num?: number): string;