@fmdevui/fm-dev 1.0.70 → 1.0.72

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.
@@ -0,0 +1,17 @@
1
+ import { StoreDefinition } from 'pinia';
2
+ export declare const usefminputdropdownstore: StoreDefinition<"fminputdropdownstore", Pick<{
3
+ state: {
4
+ optionsData: any;
5
+ };
6
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
7
+ }, "state">, Pick<{
8
+ state: {
9
+ optionsData: any;
10
+ };
11
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
12
+ }, never>, Pick<{
13
+ state: {
14
+ optionsData: any;
15
+ };
16
+ getOptionsData: (apiService: string, apiAction: string, basecode: string, reload?: boolean) => Promise<any>;
17
+ }, "getOptionsData">>;
@@ -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;
package/es/index.mjs CHANGED
@@ -26,7 +26,7 @@ export { Watermark } from './packages/core/utils/watermark/index.mjs';
26
26
  export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './packages/core/utils/base64/index.mjs';
27
27
  export { Local, Session } from './packages/core/utils/storage/index.mjs';
28
28
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './packages/core/utils/comm/toolsValidate.mjs';
29
- export { formatAxis, formatDate, formatPast, getWeek } from './packages/core/utils/comm/formatTime.mjs';
29
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './packages/core/utils/comm/formatTime.mjs';
30
30
  export { useChangeColor } from './packages/core/utils/comm/theme.mjs';
31
31
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './packages/core/utils/comm/download.mjs';
32
32
  export { signatureByKSort } from './packages/core/utils/comm/data-signature.mjs';
@@ -27,7 +27,7 @@ export { Watermark } from './utils/watermark/index.mjs';
27
27
  export { base64ToFile, blobToFile, dataURLtoBlob, fileToBase64, urlToBase64 } from './utils/base64/index.mjs';
28
28
  export { Local, Session } from './utils/storage/index.mjs';
29
29
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './utils/comm/toolsValidate.mjs';
30
- export { formatAxis, formatDate, formatPast, getWeek } from './utils/comm/formatTime.mjs';
30
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './utils/comm/formatTime.mjs';
31
31
  export { useChangeColor } from './utils/comm/theme.mjs';
32
32
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './utils/comm/download.mjs';
33
33
  export { signatureByKSort } from './utils/comm/data-signature.mjs';
@@ -0,0 +1,24 @@
1
+ import { defineStore } from 'pinia';
2
+ import { useBaseApi } from '../api/base/index.mjs';
3
+ import { reactive } from 'vue';
4
+
5
+ const usefminputdropdownstore = defineStore("fminputdropdownstore", () => {
6
+ const state = reactive({
7
+ optionsData: {}
8
+ });
9
+ const getOptionsData = async (apiService, apiAction, basecode, reload = false) => {
10
+ if (!reload) {
11
+ if (state.optionsData[basecode] && state.optionsData[basecode].length > 0) {
12
+ return state.optionsData[basecode];
13
+ }
14
+ }
15
+ const res = await useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode);
16
+ return state.optionsData[basecode] = res.data.result ?? [];
17
+ };
18
+ return {
19
+ state,
20
+ getOptionsData
21
+ };
22
+ });
23
+
24
+ export { usefminputdropdownstore };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, mergeModels } from 'vue';
2
2
  import { RefreshLeft } from '@element-plus/icons-vue';
3
- import { useBaseApi } from '../../../api/base/index.mjs';
3
+ import { usefminputdropdownstore } from '../../../stores/ainputdropdow.mjs';
4
4
 
5
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
6
6
  ...{
@@ -77,6 +77,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
77
77
  const modeValueId = useModel(__props, "id");
78
78
  const modeValueName = useModel(__props, "name");
79
79
  const props = __props;
80
+ const useBaseApi = usefminputdropdownstore();
80
81
  const state = reactive({
81
82
  optionData: props.optionData
82
83
  });
@@ -90,14 +91,12 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
90
91
  onMounted(async () => {
91
92
  state.optionData = props.optionData;
92
93
  if (props.basecode && props.basecode != "") {
93
- const res = await useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
94
- state.optionData = res.data.result ?? [];
94
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode);
95
95
  }
96
96
  });
97
97
  const handRestdata = async () => {
98
98
  if (props.basecode && props.basecode != "") {
99
- const res = await useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
100
- state.optionData = res.data.result ?? [];
99
+ state.optionData = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true);
101
100
  }
102
101
  };
103
102
  return (_ctx, _cache) => {
@@ -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 };
@@ -1,5 +1,5 @@
1
1
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './toolsValidate.mjs';
2
- export { formatAxis, formatDate, formatPast, getWeek } from './formatTime.mjs';
2
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './formatTime.mjs';
3
3
  export { useChangeColor } from './theme.mjs';
4
4
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './download.mjs';
5
5
  export { signatureByKSort } from './data-signature.mjs';
@@ -6,7 +6,7 @@ export { Local, Session } from './storage/index.mjs';
6
6
  export { commonFunctionObj } from './comm/index.mjs';
7
7
  export { PUB } from './const/index.mjs';
8
8
  export { judgementIdCard, verifiyNumberInteger, verifyAccount, verifyAndSpace, verifyCarNum, verifyCnAndSpace, verifyEmail, verifyEnAndSpace, verifyFullName, verifyIPAddress, verifyIdCard, verifyNumberCnUppercase, verifyNumberComma, verifyNumberIntegerAndFloat, verifyNumberPercentage, verifyNumberPercentageFloat, verifyPassword, verifyPasswordPowerful, verifyPasswordStrength, verifyPhone, verifyPostalCode, verifyTelPhone, verifyTextColor, verifyUrl } from './comm/toolsValidate.mjs';
9
- export { formatAxis, formatDate, formatPast, getWeek } from './comm/formatTime.mjs';
9
+ export { formatAxis, formatDate, formatPast, getBdate, getEdate, getWeek } from './comm/formatTime.mjs';
10
10
  export { useChangeColor } from './comm/theme.mjs';
11
11
  export { downloadByBase64, downloadByData, downloadByOnlineUrl, downloadByUrl, downloadStreamFile, getFileName, openWindow } from './comm/download.mjs';
12
12
  export { signatureByKSort } from './comm/data-signature.mjs';