@fmdeui/fmui 1.0.71 → 1.0.73
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/components/fmtree/index.d.ts +8 -0
- package/es/components/fmtree/index.vue.d.ts +8 -0
- package/es/packages/components/fmtree/index.vue2.mjs +60 -2
- package/index.js +61 -3
- package/index.min.js +6 -6
- package/index.min.mjs +6 -6
- package/index.mjs +61 -3
- package/lib/components/fmtree/index.d.ts +8 -0
- package/lib/components/fmtree/index.vue.d.ts +8 -0
- package/lib/packages/components/fmtree/index.vue2.js +60 -2
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/package.json +1 -1
- /package/es/{index.css → component.css} +0 -0
- /package/lib/{defaults.css → component.css} +0 -0
|
@@ -55,6 +55,14 @@ export declare const FmTree: DefineComponent<ExtractPropTypes<{
|
|
|
55
55
|
}>, {
|
|
56
56
|
fetchTreeData: (showLoading?: boolean) => Promise<any>;
|
|
57
57
|
getCheckedKeys: () => TreeKey[];
|
|
58
|
+
getCheckedKeysByCmp: () => {
|
|
59
|
+
orgIdList: any;
|
|
60
|
+
cmpList: any;
|
|
61
|
+
depList: any;
|
|
62
|
+
groupList: any;
|
|
63
|
+
tenantList: any;
|
|
64
|
+
};
|
|
65
|
+
setCheckedKeys: (orgData: any) => void;
|
|
58
66
|
setCurrentKey: (key?: TreeKey | undefined, shouldAutoExpandParent?: boolean | undefined) => void;
|
|
59
67
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
60
68
|
refresh: (...args: any[]) => void;
|
|
@@ -61,6 +61,14 @@ declare const _default: DefineComponent<ExtractPropTypes<{
|
|
|
61
61
|
}>, {
|
|
62
62
|
fetchTreeData: (showLoading?: boolean) => Promise<any>;
|
|
63
63
|
getCheckedKeys: () => TreeKey[];
|
|
64
|
+
getCheckedKeysByCmp: () => {
|
|
65
|
+
orgIdList: any;
|
|
66
|
+
cmpList: any;
|
|
67
|
+
depList: any;
|
|
68
|
+
groupList: any;
|
|
69
|
+
tenantList: any;
|
|
70
|
+
};
|
|
71
|
+
setCheckedKeys: (orgData: any) => void;
|
|
64
72
|
setCurrentKey: (key?: TreeKey | undefined, shouldAutoExpandParent?: boolean | undefined) => void;
|
|
65
73
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
66
74
|
refresh: (...args: any[]) => void;
|
|
@@ -91,6 +91,45 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
91
91
|
const getCheckedKeys = () => {
|
|
92
92
|
return treeRef.value.getCheckedKeys();
|
|
93
93
|
};
|
|
94
|
+
const getCheckedKeysByCmp = () => {
|
|
95
|
+
const rel = { orgIdList: [], cmpList: [], depList: [], groupList: [], tenantList: [] };
|
|
96
|
+
rel.orgIdList = treeRef.value.getCheckedKeys();
|
|
97
|
+
if (rel.orgIdList && rel.orgIdList.length > 0) {
|
|
98
|
+
const nodes = treeRef.value.getCheckedNodes();
|
|
99
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
100
|
+
if (nodes[i].pid == 0) {
|
|
101
|
+
rel.cmpList.push(nodes[i].id);
|
|
102
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
103
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (nodes[i].pid > 0 && nodes[i].level == 2) {
|
|
107
|
+
rel.depList.push(nodes[i].id);
|
|
108
|
+
if (!rel.cmpList.includes(nodes[i].pid)) {
|
|
109
|
+
rel.cmpList.push(nodes[i].pid);
|
|
110
|
+
}
|
|
111
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
112
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (nodes[i].pid > 0 && nodes[i].level == 3) {
|
|
116
|
+
rel.groupList.push(nodes[i].id);
|
|
117
|
+
if (!rel.depList.includes(nodes[i].pid)) {
|
|
118
|
+
rel.depList.push(nodes[i].pid);
|
|
119
|
+
}
|
|
120
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
121
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
122
|
+
}
|
|
123
|
+
const fitem = findNode(nodes[i].pid);
|
|
124
|
+
if (fitem && fitem.pid > 0) {
|
|
125
|
+
if (!rel.cmpList.includes(fitem.pid))
|
|
126
|
+
rel.cmpList.push(fitem.pid);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return rel;
|
|
132
|
+
};
|
|
94
133
|
const filterNode = (value, data) => {
|
|
95
134
|
if (!value) return true;
|
|
96
135
|
return data.name.includes(value);
|
|
@@ -118,15 +157,34 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
118
157
|
};
|
|
119
158
|
const emit = __emit;
|
|
120
159
|
const nodeClick = (node) => {
|
|
121
|
-
const reldata =
|
|
160
|
+
const reldata = findNode(node.id);
|
|
122
161
|
modeValue.value = { id: node.id, name: node.name, code: reldata ? reldata.code : "" };
|
|
123
162
|
emit("node-click", { id: node.id, name: node.name, code: reldata ? reldata.code : "", data: reldata });
|
|
124
163
|
};
|
|
164
|
+
const findNode = (id) => {
|
|
165
|
+
const search = (nodes) => {
|
|
166
|
+
var _a;
|
|
167
|
+
for (const node of nodes) {
|
|
168
|
+
if (node.id === id) return node;
|
|
169
|
+
if ((_a = node.children) == null ? void 0 : _a.length) {
|
|
170
|
+
const found = search(node.children);
|
|
171
|
+
if (found) return found;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return null;
|
|
175
|
+
};
|
|
176
|
+
return search(state.folderData || []);
|
|
177
|
+
};
|
|
178
|
+
const setCheckedKeys = (orgData) => {
|
|
179
|
+
state.isShowCheckbox = true;
|
|
180
|
+
treeRef.value.setCheckedKeys(orgData);
|
|
181
|
+
state.folderData = orgData;
|
|
182
|
+
};
|
|
125
183
|
const setCurrentKey = (key, shouldAutoExpandParent) => {
|
|
126
184
|
var _a;
|
|
127
185
|
(_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(key, shouldAutoExpandParent);
|
|
128
186
|
};
|
|
129
|
-
__expose({ fetchTreeData, getCheckedKeys, setCurrentKey });
|
|
187
|
+
__expose({ fetchTreeData, getCheckedKeys, getCheckedKeysByCmp, setCheckedKeys, setCurrentKey });
|
|
130
188
|
return (_ctx, _cache) => {
|
|
131
189
|
const _component_el_input = resolveComponent("el-input");
|
|
132
190
|
const _component_el_checkbox = resolveComponent("el-checkbox");
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! fmdeui-fmui v1.0.
|
|
1
|
+
/*! fmdeui-fmui v1.0.73 */
|
|
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) :
|
|
@@ -26272,6 +26272,45 @@
|
|
|
26272
26272
|
const getCheckedKeys = () => {
|
|
26273
26273
|
return treeRef.value.getCheckedKeys();
|
|
26274
26274
|
};
|
|
26275
|
+
const getCheckedKeysByCmp = () => {
|
|
26276
|
+
const rel = { orgIdList: [], cmpList: [], depList: [], groupList: [], tenantList: [] };
|
|
26277
|
+
rel.orgIdList = treeRef.value.getCheckedKeys();
|
|
26278
|
+
if (rel.orgIdList && rel.orgIdList.length > 0) {
|
|
26279
|
+
const nodes = treeRef.value.getCheckedNodes();
|
|
26280
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
26281
|
+
if (nodes[i].pid == 0) {
|
|
26282
|
+
rel.cmpList.push(nodes[i].id);
|
|
26283
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
26284
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
26285
|
+
}
|
|
26286
|
+
}
|
|
26287
|
+
if (nodes[i].pid > 0 && nodes[i].level == 2) {
|
|
26288
|
+
rel.depList.push(nodes[i].id);
|
|
26289
|
+
if (!rel.cmpList.includes(nodes[i].pid)) {
|
|
26290
|
+
rel.cmpList.push(nodes[i].pid);
|
|
26291
|
+
}
|
|
26292
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
26293
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
26294
|
+
}
|
|
26295
|
+
}
|
|
26296
|
+
if (nodes[i].pid > 0 && nodes[i].level == 3) {
|
|
26297
|
+
rel.groupList.push(nodes[i].id);
|
|
26298
|
+
if (!rel.depList.includes(nodes[i].pid)) {
|
|
26299
|
+
rel.depList.push(nodes[i].pid);
|
|
26300
|
+
}
|
|
26301
|
+
if (!rel.tenantList.includes(nodes[i].tenantId)) {
|
|
26302
|
+
rel.tenantList.push(nodes[i].tenantId);
|
|
26303
|
+
}
|
|
26304
|
+
const fitem = findNode(nodes[i].pid);
|
|
26305
|
+
if (fitem && fitem.pid > 0) {
|
|
26306
|
+
if (!rel.cmpList.includes(fitem.pid))
|
|
26307
|
+
rel.cmpList.push(fitem.pid);
|
|
26308
|
+
}
|
|
26309
|
+
}
|
|
26310
|
+
}
|
|
26311
|
+
}
|
|
26312
|
+
return rel;
|
|
26313
|
+
};
|
|
26275
26314
|
const filterNode = (value, data) => {
|
|
26276
26315
|
if (!value) return true;
|
|
26277
26316
|
return data.name.includes(value);
|
|
@@ -26299,15 +26338,34 @@
|
|
|
26299
26338
|
};
|
|
26300
26339
|
const emit = __emit;
|
|
26301
26340
|
const nodeClick = (node) => {
|
|
26302
|
-
const reldata =
|
|
26341
|
+
const reldata = findNode(node.id);
|
|
26303
26342
|
modeValue.value = { id: node.id, name: node.name, code: reldata ? reldata.code : "" };
|
|
26304
26343
|
emit("node-click", { id: node.id, name: node.name, code: reldata ? reldata.code : "", data: reldata });
|
|
26305
26344
|
};
|
|
26345
|
+
const findNode = (id) => {
|
|
26346
|
+
const search = (nodes) => {
|
|
26347
|
+
var _a;
|
|
26348
|
+
for (const node of nodes) {
|
|
26349
|
+
if (node.id === id) return node;
|
|
26350
|
+
if ((_a = node.children) == null ? void 0 : _a.length) {
|
|
26351
|
+
const found = search(node.children);
|
|
26352
|
+
if (found) return found;
|
|
26353
|
+
}
|
|
26354
|
+
}
|
|
26355
|
+
return null;
|
|
26356
|
+
};
|
|
26357
|
+
return search(state.folderData || []);
|
|
26358
|
+
};
|
|
26359
|
+
const setCheckedKeys = (orgData) => {
|
|
26360
|
+
state.isShowCheckbox = true;
|
|
26361
|
+
treeRef.value.setCheckedKeys(orgData);
|
|
26362
|
+
state.folderData = orgData;
|
|
26363
|
+
};
|
|
26306
26364
|
const setCurrentKey = (key, shouldAutoExpandParent) => {
|
|
26307
26365
|
var _a;
|
|
26308
26366
|
(_a = treeRef.value) == null ? void 0 : _a.setCurrentKey(key, shouldAutoExpandParent);
|
|
26309
26367
|
};
|
|
26310
|
-
__expose({ fetchTreeData, getCheckedKeys, setCurrentKey });
|
|
26368
|
+
__expose({ fetchTreeData, getCheckedKeys, getCheckedKeysByCmp, setCheckedKeys, setCurrentKey });
|
|
26311
26369
|
return (_ctx, _cache) => {
|
|
26312
26370
|
const _component_el_input = vue.resolveComponent("el-input");
|
|
26313
26371
|
const _component_el_checkbox = vue.resolveComponent("el-checkbox");
|