@fmdeui/fmui 1.0.62 → 1.0.64

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.
@@ -32,6 +32,23 @@ export declare const FmTree: DefineComponent<ExtractPropTypes<{
32
32
  type: StringConstructor;
33
33
  default: string;
34
34
  };
35
+ treeData: {
36
+ type: {
37
+ (arrayLength: number): any[];
38
+ (...items: any[]): any[];
39
+ new (arrayLength: number): any[];
40
+ new (...items: any[]): any[];
41
+ isArray(arg: any): arg is any[];
42
+ readonly prototype: any[];
43
+ from<T>(arrayLike: ArrayLike<T>): T[];
44
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
45
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
46
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
47
+ of<T>(...items: T[]): T[];
48
+ readonly [Symbol.species]: ArrayConstructor;
49
+ };
50
+ default: () => never[];
51
+ };
35
52
  modelValue: {
36
53
  type: PropType<any>;
37
54
  };
@@ -74,6 +91,23 @@ export declare const FmTree: DefineComponent<ExtractPropTypes<{
74
91
  type: StringConstructor;
75
92
  default: string;
76
93
  };
94
+ treeData: {
95
+ type: {
96
+ (arrayLength: number): any[];
97
+ (...items: any[]): any[];
98
+ new (arrayLength: number): any[];
99
+ new (...items: any[]): any[];
100
+ isArray(arg: any): arg is any[];
101
+ readonly prototype: any[];
102
+ from<T>(arrayLike: ArrayLike<T>): T[];
103
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
104
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
105
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
106
+ of<T>(...items: T[]): T[];
107
+ readonly [Symbol.species]: ArrayConstructor;
108
+ };
109
+ default: () => never[];
110
+ };
77
111
  modelValue: {
78
112
  type: PropType<any>;
79
113
  };
@@ -88,6 +122,7 @@ export declare const FmTree: DefineComponent<ExtractPropTypes<{
88
122
  paras: Record<string, any>;
89
123
  nodeKey: string;
90
124
  defaultProps: Record<string, any>;
125
+ treeData: any[];
91
126
  }, {}, {}, {}, string, ComponentProvideOptions, true, {
92
127
  treeRef: unknown;
93
128
  }, any>;
@@ -38,6 +38,23 @@ declare const _default: DefineComponent<ExtractPropTypes<{
38
38
  type: StringConstructor;
39
39
  default: string;
40
40
  };
41
+ treeData: {
42
+ type: {
43
+ (arrayLength: number): any[];
44
+ (...items: any[]): any[];
45
+ new (arrayLength: number): any[];
46
+ new (...items: any[]): any[];
47
+ isArray(arg: any): arg is any[];
48
+ readonly prototype: any[];
49
+ from<T>(arrayLike: ArrayLike<T>): T[];
50
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
51
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
52
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
53
+ of<T>(...items: T[]): T[];
54
+ readonly [Symbol.species]: ArrayConstructor;
55
+ };
56
+ default: () => never[];
57
+ };
41
58
  modelValue: {
42
59
  type: PropType<any>;
43
60
  };
@@ -86,6 +103,23 @@ declare const _default: DefineComponent<ExtractPropTypes<{
86
103
  type: StringConstructor;
87
104
  default: string;
88
105
  };
106
+ treeData: {
107
+ type: {
108
+ (arrayLength: number): any[];
109
+ (...items: any[]): any[];
110
+ new (arrayLength: number): any[];
111
+ new (...items: any[]): any[];
112
+ isArray(arg: any): arg is any[];
113
+ readonly prototype: any[];
114
+ from<T>(arrayLike: ArrayLike<T>): T[];
115
+ from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
116
+ from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
117
+ from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
118
+ of<T>(...items: T[]): T[];
119
+ readonly [Symbol.species]: ArrayConstructor;
120
+ };
121
+ default: () => never[];
122
+ };
89
123
  modelValue: {
90
124
  type: PropType<any>;
91
125
  };
@@ -100,6 +134,7 @@ declare const _default: DefineComponent<ExtractPropTypes<{
100
134
  paras: Record<string, any>;
101
135
  nodeKey: string;
102
136
  defaultProps: Record<string, any>;
137
+ treeData: any[];
103
138
  }, {}, {}, {}, string, ComponentProvideOptions, true, {
104
139
  treeRef: unknown;
105
140
  }, any>;
@@ -20,14 +20,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  */
21
21
  apiService: {
22
22
  type: String,
23
- default: "planOrder"
23
+ default: ""
24
24
  },
25
25
  /**
26
26
  * api service 下的方法
27
27
  */
28
28
  apiAction: {
29
29
  type: String,
30
- default: "autoQuerySearch"
30
+ default: ""
31
31
  },
32
32
  paras: {
33
33
  type: Object,
@@ -44,6 +44,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
44
44
  placeholder: {
45
45
  type: String,
46
46
  default: "\u7C7B\u578B\u540D\u79F0"
47
+ },
48
+ treeData: {
49
+ type: Array,
50
+ default: () => []
47
51
  }
48
52
  }, {
49
53
  "modelValue": {},
@@ -62,11 +66,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
62
66
  strictly: false
63
67
  });
64
68
  onMounted(async () => {
65
- await fetchTreeData();
69
+ if (props.apiService != "" && props.apiAction != "") {
70
+ await fetchTreeData();
71
+ }
66
72
  });
67
73
  watch(filterText, (val) => {
68
74
  treeRef.value.filter(val);
69
75
  });
76
+ watch(() => props.treeData, (newVal) => {
77
+ state.folderData = newVal;
78
+ const rtreeData = newVal != null ? newVal : [];
79
+ modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "", code: "" };
80
+ });
70
81
  const fetchTreeData = async (showLoading = true) => {
71
82
  var _a, _b;
72
83
  if (showLoading) state.loading = true;
@@ -74,7 +85,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
74
85
  state.folderData = (_a = res.data.result) != null ? _a : [];
75
86
  if (showLoading) state.loading = false;
76
87
  const rtreeData = (_b = res.data.result) != null ? _b : [];
77
- modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "" };
88
+ modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "", code: "" };
78
89
  return rtreeData;
79
90
  };
80
91
  const getCheckedKeys = () => {
@@ -98,14 +109,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
98
109
  fetchTreeData();
99
110
  } else if ("rootNode" == command) {
100
111
  (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey();
101
- modeValue.value = { id: 0, name: "" };
102
- emit("node-click", { id: 0, name: "" });
112
+ modeValue.value = { id: 0, name: "", code: "" };
113
+ emit("node-click", { id: 0, name: "", code: "" });
103
114
  }
104
115
  };
105
116
  const emit = __emit;
106
- const nodeClick = (node) => {
107
- modeValue.value = { id: node.id, name: node.name };
108
- emit("node-click", { id: node.id, name: node.name });
117
+ const nodeClick = (node, data) => {
118
+ var _a, _b;
119
+ modeValue.value = { id: node.id, name: node.name, code: data ? (_a = data.code) != null ? _a : "" : "" };
120
+ emit("node-click", { id: node.id, name: node.name, code: data ? (_b = data.code) != null ? _b : "" : "" });
109
121
  };
110
122
  const setCurrentKey = (key, shouldAutoExpandParent) => {
111
123
  var _a;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! fmdeui-fmui v1.0.62 */
1
+ /*! fmdeui-fmui v1.0.64 */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vxe-table'), require('@vxe-ui/plugin-render-element'), require('@vxe-ui/plugin-export-xlsx'), require('vxe-pc-ui'), require('exceljs'), require('@element-plus/icons-vue'), require('vue'), require('element-plus'), require('lodash-es'), require('js-cookie'), require('pinia'), require('@vueuse/core'), require('crypto-js'), require('xlsx-js-style'), require('vue-i18n'), require('vue-router'), require('sortablejs'), require('screenfull'), require('push.js'), require('mitt'), require('@microsoft/signalr'), require('axios')) :
4
4
  typeof define === 'function' && define.amd ? define(['exports', 'vxe-table', '@vxe-ui/plugin-render-element', '@vxe-ui/plugin-export-xlsx', 'vxe-pc-ui', 'exceljs', '@element-plus/icons-vue', 'vue', 'element-plus', 'lodash-es', 'js-cookie', 'pinia', '@vueuse/core', 'crypto-js', 'xlsx-js-style', 'vue-i18n', 'vue-router', 'sortablejs', 'screenfull', 'push.js', 'mitt', '@microsoft/signalr', 'axios'], factory) :
@@ -26171,14 +26171,14 @@
26171
26171
  */
26172
26172
  apiService: {
26173
26173
  type: String,
26174
- default: "planOrder"
26174
+ default: ""
26175
26175
  },
26176
26176
  /**
26177
26177
  * api service 下的方法
26178
26178
  */
26179
26179
  apiAction: {
26180
26180
  type: String,
26181
- default: "autoQuerySearch"
26181
+ default: ""
26182
26182
  },
26183
26183
  paras: {
26184
26184
  type: Object,
@@ -26195,6 +26195,10 @@
26195
26195
  placeholder: {
26196
26196
  type: String,
26197
26197
  default: "\u7C7B\u578B\u540D\u79F0"
26198
+ },
26199
+ treeData: {
26200
+ type: Array,
26201
+ default: () => []
26198
26202
  }
26199
26203
  }, {
26200
26204
  "modelValue": {},
@@ -26213,11 +26217,18 @@
26213
26217
  strictly: false
26214
26218
  });
26215
26219
  vue.onMounted(async () => {
26216
- await fetchTreeData();
26220
+ if (props.apiService != "" && props.apiAction != "") {
26221
+ await fetchTreeData();
26222
+ }
26217
26223
  });
26218
26224
  vue.watch(filterText, (val) => {
26219
26225
  treeRef.value.filter(val);
26220
26226
  });
26227
+ vue.watch(() => props.treeData, (newVal) => {
26228
+ state.folderData = newVal;
26229
+ const rtreeData = newVal != null ? newVal : [];
26230
+ modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "", code: "" };
26231
+ });
26221
26232
  const fetchTreeData = async (showLoading = true) => {
26222
26233
  var _a, _b;
26223
26234
  if (showLoading) state.loading = true;
@@ -26225,7 +26236,7 @@
26225
26236
  state.folderData = (_a = res.data.result) != null ? _a : [];
26226
26237
  if (showLoading) state.loading = false;
26227
26238
  const rtreeData = (_b = res.data.result) != null ? _b : [];
26228
- modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "" };
26239
+ modeValue.value = rtreeData.length > 0 ? rtreeData[0] : { id: 0, name: "", code: "" };
26229
26240
  return rtreeData;
26230
26241
  };
26231
26242
  const getCheckedKeys = () => {
@@ -26249,14 +26260,15 @@
26249
26260
  fetchTreeData();
26250
26261
  } else if ("rootNode" == command) {
26251
26262
  (_a = treeRef.value) == null ? void 0 : _a.setCurrentKey();
26252
- modeValue.value = { id: 0, name: "" };
26253
- emit("node-click", { id: 0, name: "" });
26263
+ modeValue.value = { id: 0, name: "", code: "" };
26264
+ emit("node-click", { id: 0, name: "", code: "" });
26254
26265
  }
26255
26266
  };
26256
26267
  const emit = __emit;
26257
- const nodeClick = (node) => {
26258
- modeValue.value = { id: node.id, name: node.name };
26259
- emit("node-click", { id: node.id, name: node.name });
26268
+ const nodeClick = (node, data) => {
26269
+ var _a, _b;
26270
+ modeValue.value = { id: node.id, name: node.name, code: data ? (_a = data.code) != null ? _a : "" : "" };
26271
+ emit("node-click", { id: node.id, name: node.name, code: data ? (_b = data.code) != null ? _b : "" : "" });
26260
26272
  };
26261
26273
  const setCurrentKey = (key, shouldAutoExpandParent) => {
26262
26274
  var _a;