@fmdevui/fm-dev 1.0.68 → 1.0.69
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/packages/core/ui/components/inputdropdown/index.vue2.mjs +14 -9
- package/index.js +169 -165
- package/index.min.js +25 -25
- package/index.min.mjs +25 -25
- package/index.mjs +170 -166
- package/lib/packages/core/ui/components/inputdropdown/index.vue2.js +13 -8
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle,
|
|
1
|
+
import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, mergeModels } from 'vue';
|
|
2
|
+
import { Brush } from '@element-plus/icons-vue';
|
|
2
3
|
import { useBaseApi } from '../../../api/base/index.mjs';
|
|
3
4
|
|
|
4
5
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -89,10 +90,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
89
90
|
onMounted(async () => {
|
|
90
91
|
state.optionData = props.optionData;
|
|
91
92
|
if (props.basecode && props.basecode != "") {
|
|
92
|
-
const res = useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
|
|
93
|
+
const res = await useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
|
|
93
94
|
state.optionData = res.data.result ?? [];
|
|
94
95
|
}
|
|
95
96
|
});
|
|
97
|
+
const handRestdata = async () => {
|
|
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 ?? [];
|
|
101
|
+
}
|
|
102
|
+
};
|
|
96
103
|
return (_ctx, _cache) => {
|
|
97
104
|
const _component_el_button = resolveComponent("el-button");
|
|
98
105
|
const _component_el_input = resolveComponent("el-input");
|
|
@@ -146,13 +153,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
146
153
|
style: normalizeStyle({ width: __props.inputWidth })
|
|
147
154
|
}, {
|
|
148
155
|
append: withCtx(() => [
|
|
149
|
-
createVNode(_component_el_button, {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
__: [1]
|
|
155
|
-
})
|
|
156
|
+
createVNode(_component_el_button, {
|
|
157
|
+
type: "success",
|
|
158
|
+
icon: unref(Brush),
|
|
159
|
+
onClick: handRestdata
|
|
160
|
+
}, null, 8, ["icon"])
|
|
156
161
|
]),
|
|
157
162
|
_: 1
|
|
158
163
|
/* STABLE */
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fm-dev v1.0.
|
|
1
|
+
/*! fm-dev v1.0.69 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('crypto'), require('url'), require('http'), require('https'), require('util'), require('stream'), require('assert'), require('zlib'), require('element-plus')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'crypto', 'url', 'http', 'https', 'util', 'stream', 'assert', 'zlib', 'element-plus'], factory) :
|
|
@@ -23860,170 +23860,6 @@
|
|
|
23860
23860
|
}
|
|
23861
23861
|
});
|
|
23862
23862
|
|
|
23863
|
-
var _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
23864
|
-
...{
|
|
23865
|
-
name: "Fminputdropdown"
|
|
23866
|
-
},
|
|
23867
|
-
__name: "index",
|
|
23868
|
-
props: /* @__PURE__ */ vue.mergeModels({
|
|
23869
|
-
//数据
|
|
23870
|
-
optionData: {
|
|
23871
|
-
type: Array,
|
|
23872
|
-
default: []
|
|
23873
|
-
},
|
|
23874
|
-
/**
|
|
23875
|
-
* 值的属性值
|
|
23876
|
-
*/
|
|
23877
|
-
bvalue: {
|
|
23878
|
-
type: String,
|
|
23879
|
-
default: "id"
|
|
23880
|
-
},
|
|
23881
|
-
/**
|
|
23882
|
-
* 值的属性标签
|
|
23883
|
-
*/
|
|
23884
|
-
blabel: {
|
|
23885
|
-
type: String,
|
|
23886
|
-
default: "name"
|
|
23887
|
-
},
|
|
23888
|
-
placeholder: {
|
|
23889
|
-
type: String,
|
|
23890
|
-
default: "\u8BF7\u9009\u62E9"
|
|
23891
|
-
},
|
|
23892
|
-
inputWidth: {
|
|
23893
|
-
type: String,
|
|
23894
|
-
default: "40%"
|
|
23895
|
-
},
|
|
23896
|
-
dropWidth: {
|
|
23897
|
-
type: String,
|
|
23898
|
-
default: "90px"
|
|
23899
|
-
},
|
|
23900
|
-
/**
|
|
23901
|
-
* api service name
|
|
23902
|
-
*/
|
|
23903
|
-
apiService: {
|
|
23904
|
-
type: String,
|
|
23905
|
-
default: "baseData"
|
|
23906
|
-
},
|
|
23907
|
-
/**
|
|
23908
|
-
* api service 下的方法
|
|
23909
|
-
*/
|
|
23910
|
-
apiAction: {
|
|
23911
|
-
type: String,
|
|
23912
|
-
default: "baseDataList"
|
|
23913
|
-
},
|
|
23914
|
-
/**
|
|
23915
|
-
* 基础编码 自动获取数据
|
|
23916
|
-
*/
|
|
23917
|
-
basecode: {
|
|
23918
|
-
type: String,
|
|
23919
|
-
default: ""
|
|
23920
|
-
}
|
|
23921
|
-
}, {
|
|
23922
|
-
"id": {
|
|
23923
|
-
type: Number,
|
|
23924
|
-
default: 0
|
|
23925
|
-
},
|
|
23926
|
-
"idModifiers": {},
|
|
23927
|
-
"name": {
|
|
23928
|
-
type: String,
|
|
23929
|
-
default: ""
|
|
23930
|
-
},
|
|
23931
|
-
"nameModifiers": {}
|
|
23932
|
-
}),
|
|
23933
|
-
emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:id", "update:name"]),
|
|
23934
|
-
setup(__props, { emit: __emit }) {
|
|
23935
|
-
const modeValueId = vue.useModel(__props, "id");
|
|
23936
|
-
const modeValueName = vue.useModel(__props, "name");
|
|
23937
|
-
const props = __props;
|
|
23938
|
-
const state = vue.reactive({
|
|
23939
|
-
optionData: props.optionData
|
|
23940
|
-
});
|
|
23941
|
-
const emit = __emit;
|
|
23942
|
-
const handCommand = (command) => {
|
|
23943
|
-
const fitem = props.optionData.find((item) => item[props.bvalue] === command);
|
|
23944
|
-
modeValueId.value = fitem != null ? [props.bvalue] : 0;
|
|
23945
|
-
modeValueName.value = fitem != null ? fitem[props.blabel] : "";
|
|
23946
|
-
emit("change", fitem);
|
|
23947
|
-
};
|
|
23948
|
-
vue.onMounted(async () => {
|
|
23949
|
-
state.optionData = props.optionData;
|
|
23950
|
-
if (props.basecode && props.basecode != "") {
|
|
23951
|
-
const res = useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
|
|
23952
|
-
state.optionData = res.data.result ?? [];
|
|
23953
|
-
}
|
|
23954
|
-
});
|
|
23955
|
-
return (_ctx, _cache) => {
|
|
23956
|
-
const _component_el_button = vue.resolveComponent("el-button");
|
|
23957
|
-
const _component_el_input = vue.resolveComponent("el-input");
|
|
23958
|
-
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
23959
|
-
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
23960
|
-
const _component_el_dropdown = vue.resolveComponent("el-dropdown");
|
|
23961
|
-
return vue.openBlock(), vue.createBlock(_component_el_dropdown, {
|
|
23962
|
-
placement: "bottom",
|
|
23963
|
-
trigger: "click",
|
|
23964
|
-
style: { "width": "100%" },
|
|
23965
|
-
onCommand: handCommand
|
|
23966
|
-
}, {
|
|
23967
|
-
dropdown: vue.withCtx(() => [
|
|
23968
|
-
vue.createVNode(_component_el_dropdown_menu, {
|
|
23969
|
-
style: vue.normalizeStyle({ width: __props.dropWidth })
|
|
23970
|
-
}, {
|
|
23971
|
-
default: vue.withCtx(() => [
|
|
23972
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
23973
|
-
vue.Fragment,
|
|
23974
|
-
null,
|
|
23975
|
-
vue.renderList(state.optionData, (item, index) => {
|
|
23976
|
-
return vue.openBlock(), vue.createBlock(_component_el_dropdown_item, {
|
|
23977
|
-
key: index,
|
|
23978
|
-
command: item[__props.bvalue],
|
|
23979
|
-
divided: ""
|
|
23980
|
-
}, {
|
|
23981
|
-
default: vue.withCtx(() => [
|
|
23982
|
-
vue.createTextVNode(
|
|
23983
|
-
vue.toDisplayString(item[__props.blabel]),
|
|
23984
|
-
1
|
|
23985
|
-
/* TEXT */
|
|
23986
|
-
)
|
|
23987
|
-
]),
|
|
23988
|
-
_: 2
|
|
23989
|
-
/* DYNAMIC */
|
|
23990
|
-
}, 1032, ["command"]);
|
|
23991
|
-
}),
|
|
23992
|
-
128
|
|
23993
|
-
/* KEYED_FRAGMENT */
|
|
23994
|
-
))
|
|
23995
|
-
]),
|
|
23996
|
-
_: 1
|
|
23997
|
-
/* STABLE */
|
|
23998
|
-
}, 8, ["style"])
|
|
23999
|
-
]),
|
|
24000
|
-
default: vue.withCtx(() => [
|
|
24001
|
-
vue.createVNode(_component_el_input, {
|
|
24002
|
-
modelValue: modeValueName.value,
|
|
24003
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValueName.value = $event),
|
|
24004
|
-
placeholder: props.placeholder,
|
|
24005
|
-
style: vue.normalizeStyle({ width: __props.inputWidth })
|
|
24006
|
-
}, {
|
|
24007
|
-
append: vue.withCtx(() => [
|
|
24008
|
-
vue.createVNode(_component_el_button, { text: "" }, {
|
|
24009
|
-
default: vue.withCtx(() => _cache[1] || (_cache[1] = [
|
|
24010
|
-
vue.createTextVNode("\u5237\u65B0")
|
|
24011
|
-
])),
|
|
24012
|
-
_: 1,
|
|
24013
|
-
__: [1]
|
|
24014
|
-
})
|
|
24015
|
-
]),
|
|
24016
|
-
_: 1
|
|
24017
|
-
/* STABLE */
|
|
24018
|
-
}, 8, ["modelValue", "placeholder", "style"])
|
|
24019
|
-
]),
|
|
24020
|
-
_: 1
|
|
24021
|
-
/* STABLE */
|
|
24022
|
-
});
|
|
24023
|
-
};
|
|
24024
|
-
}
|
|
24025
|
-
});
|
|
24026
|
-
|
|
24027
23863
|
/*! Element Plus Icons Vue v2.3.1 */
|
|
24028
23864
|
|
|
24029
23865
|
var add_location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -30082,6 +29918,174 @@
|
|
|
30082
29918
|
ZoomOut: zoom_out_default
|
|
30083
29919
|
});
|
|
30084
29920
|
|
|
29921
|
+
var _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
29922
|
+
...{
|
|
29923
|
+
name: "Fminputdropdown"
|
|
29924
|
+
},
|
|
29925
|
+
__name: "index",
|
|
29926
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
29927
|
+
//数据
|
|
29928
|
+
optionData: {
|
|
29929
|
+
type: Array,
|
|
29930
|
+
default: []
|
|
29931
|
+
},
|
|
29932
|
+
/**
|
|
29933
|
+
* 值的属性值
|
|
29934
|
+
*/
|
|
29935
|
+
bvalue: {
|
|
29936
|
+
type: String,
|
|
29937
|
+
default: "id"
|
|
29938
|
+
},
|
|
29939
|
+
/**
|
|
29940
|
+
* 值的属性标签
|
|
29941
|
+
*/
|
|
29942
|
+
blabel: {
|
|
29943
|
+
type: String,
|
|
29944
|
+
default: "name"
|
|
29945
|
+
},
|
|
29946
|
+
placeholder: {
|
|
29947
|
+
type: String,
|
|
29948
|
+
default: "\u8BF7\u9009\u62E9"
|
|
29949
|
+
},
|
|
29950
|
+
inputWidth: {
|
|
29951
|
+
type: String,
|
|
29952
|
+
default: "40%"
|
|
29953
|
+
},
|
|
29954
|
+
dropWidth: {
|
|
29955
|
+
type: String,
|
|
29956
|
+
default: "90px"
|
|
29957
|
+
},
|
|
29958
|
+
/**
|
|
29959
|
+
* api service name
|
|
29960
|
+
*/
|
|
29961
|
+
apiService: {
|
|
29962
|
+
type: String,
|
|
29963
|
+
default: "baseData"
|
|
29964
|
+
},
|
|
29965
|
+
/**
|
|
29966
|
+
* api service 下的方法
|
|
29967
|
+
*/
|
|
29968
|
+
apiAction: {
|
|
29969
|
+
type: String,
|
|
29970
|
+
default: "baseDataList"
|
|
29971
|
+
},
|
|
29972
|
+
/**
|
|
29973
|
+
* 基础编码 自动获取数据
|
|
29974
|
+
*/
|
|
29975
|
+
basecode: {
|
|
29976
|
+
type: String,
|
|
29977
|
+
default: ""
|
|
29978
|
+
}
|
|
29979
|
+
}, {
|
|
29980
|
+
"id": {
|
|
29981
|
+
type: Number,
|
|
29982
|
+
default: 0
|
|
29983
|
+
},
|
|
29984
|
+
"idModifiers": {},
|
|
29985
|
+
"name": {
|
|
29986
|
+
type: String,
|
|
29987
|
+
default: ""
|
|
29988
|
+
},
|
|
29989
|
+
"nameModifiers": {}
|
|
29990
|
+
}),
|
|
29991
|
+
emits: /* @__PURE__ */ vue.mergeModels(["change"], ["update:id", "update:name"]),
|
|
29992
|
+
setup(__props, { emit: __emit }) {
|
|
29993
|
+
const modeValueId = vue.useModel(__props, "id");
|
|
29994
|
+
const modeValueName = vue.useModel(__props, "name");
|
|
29995
|
+
const props = __props;
|
|
29996
|
+
const state = vue.reactive({
|
|
29997
|
+
optionData: props.optionData
|
|
29998
|
+
});
|
|
29999
|
+
const emit = __emit;
|
|
30000
|
+
const handCommand = (command) => {
|
|
30001
|
+
const fitem = props.optionData.find((item) => item[props.bvalue] === command);
|
|
30002
|
+
modeValueId.value = fitem != null ? [props.bvalue] : 0;
|
|
30003
|
+
modeValueName.value = fitem != null ? fitem[props.blabel] : "";
|
|
30004
|
+
emit("change", fitem);
|
|
30005
|
+
};
|
|
30006
|
+
vue.onMounted(async () => {
|
|
30007
|
+
state.optionData = props.optionData;
|
|
30008
|
+
if (props.basecode && props.basecode != "") {
|
|
30009
|
+
const res = await useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
|
|
30010
|
+
state.optionData = res.data.result ?? [];
|
|
30011
|
+
}
|
|
30012
|
+
});
|
|
30013
|
+
const handRestdata = async () => {
|
|
30014
|
+
if (props.basecode && props.basecode != "") {
|
|
30015
|
+
const res = await useBaseApi(props.apiService).get(null, props.apiAction + "/?codetype=" + props.basecode);
|
|
30016
|
+
state.optionData = res.data.result ?? [];
|
|
30017
|
+
}
|
|
30018
|
+
};
|
|
30019
|
+
return (_ctx, _cache) => {
|
|
30020
|
+
const _component_el_button = vue.resolveComponent("el-button");
|
|
30021
|
+
const _component_el_input = vue.resolveComponent("el-input");
|
|
30022
|
+
const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
|
|
30023
|
+
const _component_el_dropdown_menu = vue.resolveComponent("el-dropdown-menu");
|
|
30024
|
+
const _component_el_dropdown = vue.resolveComponent("el-dropdown");
|
|
30025
|
+
return vue.openBlock(), vue.createBlock(_component_el_dropdown, {
|
|
30026
|
+
placement: "bottom",
|
|
30027
|
+
trigger: "click",
|
|
30028
|
+
style: { "width": "100%" },
|
|
30029
|
+
onCommand: handCommand
|
|
30030
|
+
}, {
|
|
30031
|
+
dropdown: vue.withCtx(() => [
|
|
30032
|
+
vue.createVNode(_component_el_dropdown_menu, {
|
|
30033
|
+
style: vue.normalizeStyle({ width: __props.dropWidth })
|
|
30034
|
+
}, {
|
|
30035
|
+
default: vue.withCtx(() => [
|
|
30036
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
30037
|
+
vue.Fragment,
|
|
30038
|
+
null,
|
|
30039
|
+
vue.renderList(state.optionData, (item, index) => {
|
|
30040
|
+
return vue.openBlock(), vue.createBlock(_component_el_dropdown_item, {
|
|
30041
|
+
key: index,
|
|
30042
|
+
command: item[__props.bvalue],
|
|
30043
|
+
divided: ""
|
|
30044
|
+
}, {
|
|
30045
|
+
default: vue.withCtx(() => [
|
|
30046
|
+
vue.createTextVNode(
|
|
30047
|
+
vue.toDisplayString(item[__props.blabel]),
|
|
30048
|
+
1
|
|
30049
|
+
/* TEXT */
|
|
30050
|
+
)
|
|
30051
|
+
]),
|
|
30052
|
+
_: 2
|
|
30053
|
+
/* DYNAMIC */
|
|
30054
|
+
}, 1032, ["command"]);
|
|
30055
|
+
}),
|
|
30056
|
+
128
|
|
30057
|
+
/* KEYED_FRAGMENT */
|
|
30058
|
+
))
|
|
30059
|
+
]),
|
|
30060
|
+
_: 1
|
|
30061
|
+
/* STABLE */
|
|
30062
|
+
}, 8, ["style"])
|
|
30063
|
+
]),
|
|
30064
|
+
default: vue.withCtx(() => [
|
|
30065
|
+
vue.createVNode(_component_el_input, {
|
|
30066
|
+
modelValue: modeValueName.value,
|
|
30067
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValueName.value = $event),
|
|
30068
|
+
placeholder: props.placeholder,
|
|
30069
|
+
style: vue.normalizeStyle({ width: __props.inputWidth })
|
|
30070
|
+
}, {
|
|
30071
|
+
append: vue.withCtx(() => [
|
|
30072
|
+
vue.createVNode(_component_el_button, {
|
|
30073
|
+
type: "success",
|
|
30074
|
+
icon: vue.unref(brush_default),
|
|
30075
|
+
onClick: handRestdata
|
|
30076
|
+
}, null, 8, ["icon"])
|
|
30077
|
+
]),
|
|
30078
|
+
_: 1
|
|
30079
|
+
/* STABLE */
|
|
30080
|
+
}, 8, ["modelValue", "placeholder", "style"])
|
|
30081
|
+
]),
|
|
30082
|
+
_: 1
|
|
30083
|
+
/* STABLE */
|
|
30084
|
+
});
|
|
30085
|
+
};
|
|
30086
|
+
}
|
|
30087
|
+
});
|
|
30088
|
+
|
|
30085
30089
|
const _hoisted_1$1 = { style: { "padding": "5px" } };
|
|
30086
30090
|
const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "8px", "flex-wrap": "nowrap", "overflow": "hidden" } };
|
|
30087
30091
|
const _hoisted_3 = { style: { "flex": "1 1 200px", "min-width": "0", "overflow": "hidden" } };
|