@fmdevui/fm-dev 1.0.68 → 1.0.70

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.
@@ -1,4 +1,5 @@
1
- import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, createTextVNode, createElementBlock, Fragment, renderList, toDisplayString, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, unref, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, mergeModels } from 'vue';
2
+ import { RefreshLeft } from '@element-plus/icons-vue';
2
3
  import { useBaseApi } from '../../../api/base/index.mjs';
3
4
 
4
5
  var _sfc_main = /* @__PURE__ */ defineComponent({
@@ -81,7 +82,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
81
82
  });
82
83
  const emit = __emit;
83
84
  const handCommand = (command) => {
84
- const fitem = props.optionData.find((item) => item[props.bvalue] === command);
85
+ const fitem = state.optionData.find((item) => item[props.bvalue] === command);
85
86
  modeValueId.value = fitem != null ? [props.bvalue] : 0;
86
87
  modeValueName.value = fitem != null ? fitem[props.blabel] : "";
87
88
  emit("change", fitem);
@@ -89,17 +90,24 @@ 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
- const _component_el_button = resolveComponent("el-button");
104
+ const _component_el_icon = resolveComponent("el-icon");
98
105
  const _component_el_input = resolveComponent("el-input");
99
106
  const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
100
107
  const _component_el_dropdown_menu = resolveComponent("el-dropdown-menu");
101
108
  const _component_el_dropdown = resolveComponent("el-dropdown");
102
109
  return openBlock(), createBlock(_component_el_dropdown, {
110
+ class: "fminputdropdown",
103
111
  placement: "bottom",
104
112
  trigger: "click",
105
113
  style: { "width": "100%" },
@@ -146,12 +154,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
146
154
  style: normalizeStyle({ width: __props.inputWidth })
147
155
  }, {
148
156
  append: withCtx(() => [
149
- createVNode(_component_el_button, { text: "" }, {
150
- default: withCtx(() => _cache[1] || (_cache[1] = [
151
- createTextVNode("\u5237\u65B0")
152
- ])),
153
- _: 1,
154
- __: [1]
157
+ createVNode(_component_el_icon, {
158
+ color: "#13c2c2",
159
+ onClick: handRestdata
160
+ }, {
161
+ default: withCtx(() => [
162
+ createVNode(unref(RefreshLeft))
163
+ ]),
164
+ _: 1
165
+ /* STABLE */
155
166
  })
156
167
  ]),
157
168
  _: 1
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fm-dev v1.0.68 */
1
+ /*! fm-dev v1.0.70 */
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,180 @@
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 = state.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_icon = vue.resolveComponent("el-icon");
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
+ class: "fminputdropdown",
30027
+ placement: "bottom",
30028
+ trigger: "click",
30029
+ style: { "width": "100%" },
30030
+ onCommand: handCommand
30031
+ }, {
30032
+ dropdown: vue.withCtx(() => [
30033
+ vue.createVNode(_component_el_dropdown_menu, {
30034
+ style: vue.normalizeStyle({ width: __props.dropWidth })
30035
+ }, {
30036
+ default: vue.withCtx(() => [
30037
+ (vue.openBlock(true), vue.createElementBlock(
30038
+ vue.Fragment,
30039
+ null,
30040
+ vue.renderList(state.optionData, (item, index) => {
30041
+ return vue.openBlock(), vue.createBlock(_component_el_dropdown_item, {
30042
+ key: index,
30043
+ command: item[__props.bvalue],
30044
+ divided: ""
30045
+ }, {
30046
+ default: vue.withCtx(() => [
30047
+ vue.createTextVNode(
30048
+ vue.toDisplayString(item[__props.blabel]),
30049
+ 1
30050
+ /* TEXT */
30051
+ )
30052
+ ]),
30053
+ _: 2
30054
+ /* DYNAMIC */
30055
+ }, 1032, ["command"]);
30056
+ }),
30057
+ 128
30058
+ /* KEYED_FRAGMENT */
30059
+ ))
30060
+ ]),
30061
+ _: 1
30062
+ /* STABLE */
30063
+ }, 8, ["style"])
30064
+ ]),
30065
+ default: vue.withCtx(() => [
30066
+ vue.createVNode(_component_el_input, {
30067
+ modelValue: modeValueName.value,
30068
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modeValueName.value = $event),
30069
+ placeholder: props.placeholder,
30070
+ style: vue.normalizeStyle({ width: __props.inputWidth })
30071
+ }, {
30072
+ append: vue.withCtx(() => [
30073
+ vue.createVNode(_component_el_icon, {
30074
+ color: "#13c2c2",
30075
+ onClick: handRestdata
30076
+ }, {
30077
+ default: vue.withCtx(() => [
30078
+ vue.createVNode(vue.unref(refresh_left_default))
30079
+ ]),
30080
+ _: 1
30081
+ /* STABLE */
30082
+ })
30083
+ ]),
30084
+ _: 1
30085
+ /* STABLE */
30086
+ }, 8, ["modelValue", "placeholder", "style"])
30087
+ ]),
30088
+ _: 1
30089
+ /* STABLE */
30090
+ });
30091
+ };
30092
+ }
30093
+ });
30094
+
30085
30095
  const _hoisted_1$1 = { style: { "padding": "5px" } };
30086
30096
  const _hoisted_2 = { style: { "display": "flex", "align-items": "center", "gap": "8px", "flex-wrap": "nowrap", "overflow": "hidden" } };
30087
30097
  const _hoisted_3 = { style: { "flex": "1 1 200px", "min-width": "0", "overflow": "hidden" } };