@fmdevui/fm-dev 1.0.69 → 1.0.71
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.
- package/es/core/stores/ainputdropdow.d.ts +17 -0
- package/es/core/utils/comm/formatTime.d.ts +10 -0
- package/es/index.mjs +1 -1
- package/es/packages/core/index.mjs +1 -1
- package/es/packages/core/stores/ainputdropdow.mjs +24 -0
- package/es/packages/core/ui/components/inputdropdown/index.vue2.mjs +17 -10
- package/es/packages/core/utils/comm/formatTime.mjs +12 -1
- package/es/packages/core/utils/comm/index.mjs +1 -1
- package/es/packages/core/utils/index.mjs +1 -1
- package/es/{make-installer.css → version.css} +2 -1
- package/index.js +1450 -1411
- package/index.min.js +31 -31
- package/index.min.mjs +31 -31
- package/index.mjs +1450 -1413
- package/lib/core/stores/ainputdropdow.d.ts +17 -0
- package/lib/core/utils/comm/formatTime.d.ts +10 -0
- package/lib/index.js +2 -0
- package/lib/packages/core/index.js +2 -0
- package/lib/packages/core/stores/ainputdropdow.js +26 -0
- package/lib/packages/core/ui/components/inputdropdown/index.vue2.js +16 -9
- package/lib/packages/core/utils/comm/formatTime.js +13 -0
- package/lib/packages/core/utils/comm/index.js +2 -0
- package/lib/packages/core/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -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/lib/index.js
CHANGED
|
@@ -132,6 +132,8 @@ exports.verifyUrl = toolsValidate.verifyUrl;
|
|
|
132
132
|
exports.formatAxis = formatTime.formatAxis;
|
|
133
133
|
exports.formatDate = formatTime.formatDate;
|
|
134
134
|
exports.formatPast = formatTime.formatPast;
|
|
135
|
+
exports.getBdate = formatTime.getBdate;
|
|
136
|
+
exports.getEdate = formatTime.getEdate;
|
|
135
137
|
exports.getWeek = formatTime.getWeek;
|
|
136
138
|
exports.useChangeColor = theme.useChangeColor;
|
|
137
139
|
exports.downloadByBase64 = download.downloadByBase64;
|
|
@@ -132,6 +132,8 @@ exports.verifyUrl = toolsValidate.verifyUrl;
|
|
|
132
132
|
exports.formatAxis = formatTime.formatAxis;
|
|
133
133
|
exports.formatDate = formatTime.formatDate;
|
|
134
134
|
exports.formatPast = formatTime.formatPast;
|
|
135
|
+
exports.getBdate = formatTime.getBdate;
|
|
136
|
+
exports.getEdate = formatTime.getEdate;
|
|
135
137
|
exports.getWeek = formatTime.getWeek;
|
|
136
138
|
exports.useChangeColor = theme.useChangeColor;
|
|
137
139
|
exports.downloadByBase64 = download.downloadByBase64;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pinia = require('pinia');
|
|
4
|
+
var index = require('../api/base/index.js');
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
|
|
7
|
+
const usefminputdropdownstore = pinia.defineStore("fminputdropdownstore", () => {
|
|
8
|
+
const state = vue.reactive({
|
|
9
|
+
optionsData: {}
|
|
10
|
+
});
|
|
11
|
+
const getOptionsData = async (apiService, apiAction, basecode, reload = false) => {
|
|
12
|
+
if (!reload) {
|
|
13
|
+
if (state.optionsData[basecode] && state.optionsData[basecode].length > 0) {
|
|
14
|
+
return state.optionsData[basecode];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const res = await index.useBaseApi(apiService).get(null, apiAction + "/?codetype=" + basecode);
|
|
18
|
+
return state.optionsData[basecode] = res.data.result ?? [];
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
state,
|
|
22
|
+
getOptionsData
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
exports.usefminputdropdownstore = usefminputdropdownstore;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var svg = require('@element-plus/icons-vue');
|
|
7
|
-
var
|
|
7
|
+
var ainputdropdow = require('../../../stores/ainputdropdow.js');
|
|
8
8
|
|
|
9
9
|
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
10
|
...{
|
|
@@ -81,12 +81,13 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
81
81
|
const modeValueId = vue.useModel(__props, "id");
|
|
82
82
|
const modeValueName = vue.useModel(__props, "name");
|
|
83
83
|
const props = __props;
|
|
84
|
+
const useBaseApi = ainputdropdow.usefminputdropdownstore();
|
|
84
85
|
const state = vue.reactive({
|
|
85
86
|
optionData: props.optionData
|
|
86
87
|
});
|
|
87
88
|
const emit = __emit;
|
|
88
89
|
const handCommand = (command) => {
|
|
89
|
-
const fitem =
|
|
90
|
+
const fitem = state.optionData.find((item) => item[props.bvalue] === command);
|
|
90
91
|
modeValueId.value = fitem != null ? [props.bvalue] : 0;
|
|
91
92
|
modeValueName.value = fitem != null ? fitem[props.blabel] : "";
|
|
92
93
|
emit("change", fitem);
|
|
@@ -94,23 +95,24 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
94
95
|
vue.onMounted(async () => {
|
|
95
96
|
state.optionData = props.optionData;
|
|
96
97
|
if (props.basecode && props.basecode != "") {
|
|
97
|
-
const res = await
|
|
98
|
+
const res = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode);
|
|
98
99
|
state.optionData = res.data.result ?? [];
|
|
99
100
|
}
|
|
100
101
|
});
|
|
101
102
|
const handRestdata = async () => {
|
|
102
103
|
if (props.basecode && props.basecode != "") {
|
|
103
|
-
const res = await
|
|
104
|
+
const res = await useBaseApi.getOptionsData(props.apiService, props.apiAction, props.basecode, true);
|
|
104
105
|
state.optionData = res.data.result ?? [];
|
|
105
106
|
}
|
|
106
107
|
};
|
|
107
108
|
return (_ctx, _cache) => {
|
|
108
|
-
const
|
|
109
|
+
const _component_el_icon = vue.resolveComponent("el-icon");
|
|
109
110
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
110
111
|
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
111
112
|
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
112
113
|
const _component_el_dropdown = vue.resolveComponent("el-dropdown");
|
|
113
114
|
return vue.openBlock(), vue.createBlock(_component_el_dropdown, {
|
|
115
|
+
class: "fminputdropdown",
|
|
114
116
|
placement: "bottom",
|
|
115
117
|
trigger: "click",
|
|
116
118
|
style: { "width": "100%" },
|
|
@@ -157,11 +159,16 @@ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
157
159
|
style: vue.normalizeStyle({ width: __props.inputWidth })
|
|
158
160
|
}, {
|
|
159
161
|
append: vue.withCtx(() => [
|
|
160
|
-
vue.createVNode(
|
|
161
|
-
|
|
162
|
-
icon: vue.unref(svg.Brush),
|
|
162
|
+
vue.createVNode(_component_el_icon, {
|
|
163
|
+
color: "#13c2c2",
|
|
163
164
|
onClick: handRestdata
|
|
164
|
-
},
|
|
165
|
+
}, {
|
|
166
|
+
default: vue.withCtx(() => [
|
|
167
|
+
vue.createVNode(vue.unref(svg.RefreshLeft))
|
|
168
|
+
]),
|
|
169
|
+
_: 1
|
|
170
|
+
/* STABLE */
|
|
171
|
+
})
|
|
165
172
|
]),
|
|
166
173
|
_: 1
|
|
167
174
|
/* STABLE */
|
|
@@ -108,8 +108,21 @@ function formatAxis(param, t) {
|
|
|
108
108
|
else if (hour < 22) return getMessage("eveningGreeting");
|
|
109
109
|
else return getMessage("nightGreeting");
|
|
110
110
|
}
|
|
111
|
+
function getBdate(num = 1) {
|
|
112
|
+
const firstDay = /* @__PURE__ */ new Date();
|
|
113
|
+
firstDay.setDate(num);
|
|
114
|
+
return formatDate(firstDay, "YYYY-mm-dd");
|
|
115
|
+
}
|
|
116
|
+
function getEdate(num = 0) {
|
|
117
|
+
const lastDay = /* @__PURE__ */ new Date();
|
|
118
|
+
lastDay.setMonth(lastDay.getMonth() + 1, 0);
|
|
119
|
+
if (num > 0) lastDay.setDate(num);
|
|
120
|
+
return formatDate(lastDay, "YYYY-mm-dd");
|
|
121
|
+
}
|
|
111
122
|
|
|
112
123
|
exports.formatAxis = formatAxis;
|
|
113
124
|
exports.formatDate = formatDate;
|
|
114
125
|
exports.formatPast = formatPast;
|
|
126
|
+
exports.getBdate = getBdate;
|
|
127
|
+
exports.getEdate = getEdate;
|
|
115
128
|
exports.getWeek = getWeek;
|
|
@@ -37,6 +37,8 @@ exports.verifyUrl = toolsValidate.verifyUrl;
|
|
|
37
37
|
exports.formatAxis = formatTime.formatAxis;
|
|
38
38
|
exports.formatDate = formatTime.formatDate;
|
|
39
39
|
exports.formatPast = formatTime.formatPast;
|
|
40
|
+
exports.getBdate = formatTime.getBdate;
|
|
41
|
+
exports.getEdate = formatTime.getEdate;
|
|
40
42
|
exports.getWeek = formatTime.getWeek;
|
|
41
43
|
exports.useChangeColor = theme.useChangeColor;
|
|
42
44
|
exports.downloadByBase64 = download.downloadByBase64;
|
|
@@ -58,6 +58,8 @@ exports.verifyUrl = toolsValidate.verifyUrl;
|
|
|
58
58
|
exports.formatAxis = formatTime.formatAxis;
|
|
59
59
|
exports.formatDate = formatTime.formatDate;
|
|
60
60
|
exports.formatPast = formatTime.formatPast;
|
|
61
|
+
exports.getBdate = formatTime.getBdate;
|
|
62
|
+
exports.getEdate = formatTime.getEdate;
|
|
61
63
|
exports.getWeek = formatTime.getWeek;
|
|
62
64
|
exports.useChangeColor = theme.useChangeColor;
|
|
63
65
|
exports.downloadByBase64 = download.downloadByBase64;
|