iv-npm 1.0.14 → 1.0.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iv-npm",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "公共通用包",
5
5
  "author": "Mr.Cong",
6
6
  "license": "ISC",
@@ -82,6 +82,30 @@ var script$1 = /*#__PURE__*/vue.defineComponent({
82
82
 
83
83
  script$1.__file = "src/function-ui/component/IVMrpModal.vue";
84
84
 
85
+ // utils/arr/tree.ts
86
+
87
+ function _loadChildren(obj, list) {
88
+ var arr = list.filter(function (x) {
89
+ return x.parentId == obj.id;
90
+ });
91
+ if (!arr.length) return;
92
+ obj.children = arr;
93
+ obj.children.forEach(function (x) {
94
+ _loadChildren(x, list);
95
+ });
96
+ return obj;
97
+ }
98
+
99
+ function tranListToTreeData(list) {
100
+ var results = list.filter(function (x) {
101
+ return x.parentId == null;
102
+ });
103
+ results.forEach(function (x) {
104
+ return _loadChildren(x, list);
105
+ });
106
+ return results;
107
+ }
108
+
85
109
  var _hoisted_1 = /*#__PURE__*/vue.createElementVNode("div", {
86
110
  "class": "text-[#0000006D] text-[14px]"
87
111
  }, "所属组织", -1
@@ -91,7 +115,7 @@ var script = /*#__PURE__*/vue.defineComponent({
91
115
  __name: 'IVMrpOrgDropdown',
92
116
  props: {
93
117
  data: {
94
- type: Object,
118
+ type: Array,
95
119
  required: true
96
120
  },
97
121
  value: {
@@ -114,8 +138,9 @@ var script = /*#__PURE__*/vue.defineComponent({
114
138
  label: "displayName",
115
139
  key: "id",
116
140
  value: "id"
117
- }); // const dataV = tranListToTreeData(props.data:types);
118
-
141
+ });
142
+ var dataV = tranListToTreeData(props.data);
143
+ console.log(dataV, "npm-------------------------------dataV");
119
144
  var inputV = vue.computed({
120
145
  get: function get() {
121
146
  return props.value;
@@ -145,7 +170,7 @@ var script = /*#__PURE__*/vue.defineComponent({
145
170
  "onUpdate:value": _cache[0] || (_cache[0] = function ($event) {
146
171
  return vue.isRef(inputV) ? inputV.value = $event : null;
147
172
  }),
148
- "tree-data": __props.data,
173
+ "tree-data": vue.unref(dataV),
149
174
  getPopupContainer: function getPopupContainer(triggerNode) {
150
175
  return triggerNode.parentNode;
151
176
  },
@@ -78,6 +78,30 @@ var script$1 = /*#__PURE__*/defineComponent({
78
78
 
79
79
  script$1.__file = "src/function-ui/component/IVMrpModal.vue";
80
80
 
81
+ // utils/arr/tree.ts
82
+
83
+ function _loadChildren(obj, list) {
84
+ var arr = list.filter(function (x) {
85
+ return x.parentId == obj.id;
86
+ });
87
+ if (!arr.length) return;
88
+ obj.children = arr;
89
+ obj.children.forEach(function (x) {
90
+ _loadChildren(x, list);
91
+ });
92
+ return obj;
93
+ }
94
+
95
+ function tranListToTreeData(list) {
96
+ var results = list.filter(function (x) {
97
+ return x.parentId == null;
98
+ });
99
+ results.forEach(function (x) {
100
+ return _loadChildren(x, list);
101
+ });
102
+ return results;
103
+ }
104
+
81
105
  var _hoisted_1 = /*#__PURE__*/createElementVNode("div", {
82
106
  "class": "text-[#0000006D] text-[14px]"
83
107
  }, "所属组织", -1
@@ -87,7 +111,7 @@ var script = /*#__PURE__*/defineComponent({
87
111
  __name: 'IVMrpOrgDropdown',
88
112
  props: {
89
113
  data: {
90
- type: Object,
114
+ type: Array,
91
115
  required: true
92
116
  },
93
117
  value: {
@@ -110,8 +134,9 @@ var script = /*#__PURE__*/defineComponent({
110
134
  label: "displayName",
111
135
  key: "id",
112
136
  value: "id"
113
- }); // const dataV = tranListToTreeData(props.data:types);
114
-
137
+ });
138
+ var dataV = tranListToTreeData(props.data);
139
+ console.log(dataV, "npm-------------------------------dataV");
115
140
  var inputV = computed({
116
141
  get: function get() {
117
142
  return props.value;
@@ -141,7 +166,7 @@ var script = /*#__PURE__*/defineComponent({
141
166
  "onUpdate:value": _cache[0] || (_cache[0] = function ($event) {
142
167
  return isRef(inputV) ? inputV.value = $event : null;
143
168
  }),
144
- "tree-data": __props.data,
169
+ "tree-data": unref(dataV),
145
170
  getPopupContainer: function getPopupContainer(triggerNode) {
146
171
  return triggerNode.parentNode;
147
172
  },