@fmdevui/fm-dev 1.0.66 → 1.0.67

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.
@@ -624,6 +624,18 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
624
624
  type: StringConstructor;
625
625
  default: string;
626
626
  };
627
+ apiService: {
628
+ type: StringConstructor;
629
+ default: string;
630
+ };
631
+ apiAction: {
632
+ type: StringConstructor;
633
+ default: string;
634
+ };
635
+ basecode: {
636
+ type: StringConstructor;
637
+ default: string;
638
+ };
627
639
  id: {
628
640
  type: PropType<any>;
629
641
  };
@@ -672,6 +684,18 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
672
684
  type: StringConstructor;
673
685
  default: string;
674
686
  };
687
+ apiService: {
688
+ type: StringConstructor;
689
+ default: string;
690
+ };
691
+ apiAction: {
692
+ type: StringConstructor;
693
+ default: string;
694
+ };
695
+ basecode: {
696
+ type: StringConstructor;
697
+ default: string;
698
+ };
675
699
  id: {
676
700
  type: PropType<any>;
677
701
  };
@@ -687,8 +711,11 @@ declare const Fminputdropdown: DefineComponent<ExtractPropTypes<{
687
711
  optionData: any[];
688
712
  bvalue: string;
689
713
  blabel: string;
714
+ apiService: string;
715
+ apiAction: string;
690
716
  inputWidth: string;
691
717
  dropWidth: string;
718
+ basecode: string;
692
719
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
693
720
  declare const FmTree: DefineComponent<ExtractPropTypes<{
694
721
  checkStrictly: {
@@ -43,6 +43,27 @@ declare const _default: DefineComponent<ExtractPropTypes<{
43
43
  type: StringConstructor;
44
44
  default: string;
45
45
  };
46
+ /**
47
+ * api service name
48
+ */
49
+ apiService: {
50
+ type: StringConstructor;
51
+ default: string;
52
+ };
53
+ /**
54
+ * api service 下的方法
55
+ */
56
+ apiAction: {
57
+ type: StringConstructor;
58
+ default: string;
59
+ };
60
+ /**
61
+ * 基础编码 自动获取数据
62
+ */
63
+ basecode: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
46
67
  id: {
47
68
  type: PropType<any>;
48
69
  };
@@ -97,6 +118,27 @@ declare const _default: DefineComponent<ExtractPropTypes<{
97
118
  type: StringConstructor;
98
119
  default: string;
99
120
  };
121
+ /**
122
+ * api service name
123
+ */
124
+ apiService: {
125
+ type: StringConstructor;
126
+ default: string;
127
+ };
128
+ /**
129
+ * api service 下的方法
130
+ */
131
+ apiAction: {
132
+ type: StringConstructor;
133
+ default: string;
134
+ };
135
+ /**
136
+ * 基础编码 自动获取数据
137
+ */
138
+ basecode: {
139
+ type: StringConstructor;
140
+ default: string;
141
+ };
100
142
  id: {
101
143
  type: PropType<any>;
102
144
  };
@@ -112,7 +154,10 @@ declare const _default: DefineComponent<ExtractPropTypes<{
112
154
  optionData: any[];
113
155
  bvalue: string;
114
156
  blabel: string;
157
+ apiService: string;
158
+ apiAction: string;
115
159
  inputWidth: string;
116
160
  dropWidth: string;
161
+ basecode: string;
117
162
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
118
163
  export default _default;
@@ -1,4 +1,5 @@
1
- import { defineComponent, useModel, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, mergeModels } from 'vue';
1
+ import { defineComponent, useModel, reactive, onMounted, resolveComponent, createBlock, openBlock, withCtx, createVNode, normalizeStyle, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, mergeModels } from 'vue';
2
+ import { useBaseApi } from '../../../api/base/index.mjs';
2
3
 
3
4
  var _sfc_main = /* @__PURE__ */ defineComponent({
4
5
  ...{
@@ -36,6 +37,27 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
36
37
  dropWidth: {
37
38
  type: String,
38
39
  default: "90px"
40
+ },
41
+ /**
42
+ * api service name
43
+ */
44
+ apiService: {
45
+ type: String,
46
+ default: "baseData"
47
+ },
48
+ /**
49
+ * api service 下的方法
50
+ */
51
+ apiAction: {
52
+ type: String,
53
+ default: "baseDataList"
54
+ },
55
+ /**
56
+ * 基础编码 自动获取数据
57
+ */
58
+ basecode: {
59
+ type: String,
60
+ default: ""
39
61
  }
40
62
  }, {
41
63
  "id": {
@@ -54,6 +76,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
54
76
  const modeValueId = useModel(__props, "id");
55
77
  const modeValueName = useModel(__props, "name");
56
78
  const props = __props;
79
+ const state = reactive({
80
+ optionData: props.optionData
81
+ });
57
82
  const emit = __emit;
58
83
  const handCommand = (command) => {
59
84
  const fitem = props.optionData.find((item) => item[props.bvalue] === command);
@@ -61,6 +86,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
61
86
  modeValueName.value = fitem != null ? fitem[props.blabel] : "";
62
87
  emit("change", fitem);
63
88
  };
89
+ onMounted(async () => {
90
+ state.optionData = props.optionData;
91
+ if (props.basecode && props.basecode != "") {
92
+ const res = useBaseApi(props.apiService).get(null, props.apiAction + "/" + props.basecode);
93
+ state.optionData = res.data.result ?? [];
94
+ }
95
+ });
64
96
  return (_ctx, _cache) => {
65
97
  const _component_el_input = resolveComponent("el-input");
66
98
  const _component_el_dropdown_item = resolveComponent("el-dropdown-item");
@@ -80,7 +112,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
80
112
  (openBlock(true), createElementBlock(
81
113
  Fragment,
82
114
  null,
83
- renderList(__props.optionData, (item, index) => {
115
+ renderList(state.optionData, (item, index) => {
84
116
  return openBlock(), createBlock(_component_el_dropdown_item, {
85
117
  key: index,
86
118
  command: item[__props.bvalue],
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fm-dev v1.0.66 */
1
+ /*! fm-dev v1.0.67 */
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) :
@@ -23896,6 +23896,27 @@
23896
23896
  dropWidth: {
23897
23897
  type: String,
23898
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: ""
23899
23920
  }
23900
23921
  }, {
23901
23922
  "id": {
@@ -23914,6 +23935,9 @@
23914
23935
  const modeValueId = vue.useModel(__props, "id");
23915
23936
  const modeValueName = vue.useModel(__props, "name");
23916
23937
  const props = __props;
23938
+ const state = vue.reactive({
23939
+ optionData: props.optionData
23940
+ });
23917
23941
  const emit = __emit;
23918
23942
  const handCommand = (command) => {
23919
23943
  const fitem = props.optionData.find((item) => item[props.bvalue] === command);
@@ -23921,6 +23945,13 @@
23921
23945
  modeValueName.value = fitem != null ? fitem[props.blabel] : "";
23922
23946
  emit("change", fitem);
23923
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 + "/" + props.basecode);
23952
+ state.optionData = res.data.result ?? [];
23953
+ }
23954
+ });
23924
23955
  return (_ctx, _cache) => {
23925
23956
  const _component_el_input = vue.resolveComponent("el-input");
23926
23957
  const _component_el_dropdown_item = vue.resolveComponent("el-dropdown-item");
@@ -23940,7 +23971,7 @@
23940
23971
  (vue.openBlock(true), vue.createElementBlock(
23941
23972
  vue.Fragment,
23942
23973
  null,
23943
- vue.renderList(__props.optionData, (item, index) => {
23974
+ vue.renderList(state.optionData, (item, index) => {
23944
23975
  return vue.openBlock(), vue.createBlock(_component_el_dropdown_item, {
23945
23976
  key: index,
23946
23977
  command: item[__props.bvalue],