t20-common-lib 0.11.4 → 0.12.0

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/src/api/common.js CHANGED
@@ -18,4 +18,16 @@ export function getCurrency(data, headers = {}) {
18
18
  // loading: false,
19
19
  // headers
20
20
  // })
21
+ }
22
+
23
+
24
+ //查询財资工参全局配置
25
+ export function getCommonConfig(params = {}) {
26
+ return request({
27
+ url: `/api/nstc-gtcp/1.0/commonConfig`,
28
+ method: 'get',
29
+ loading: false,
30
+ cache:true,
31
+ params
32
+ })
21
33
  }
@@ -0,0 +1,180 @@
1
+ <template>
2
+ <div
3
+ class="el-select"
4
+ :class="[selectSize ? 'el-select--' + selectSize : '']"
5
+ @click.stop="toggleMenu"
6
+ v-clickoutside="handleClose"
7
+ >
8
+ <div
9
+ class="el-select__tags"
10
+ v-if="multiple"
11
+ ref="tags"
12
+ :style="{ 'max-width': inputWidth - 32 + 'px', width: '100%' }"
13
+ >
14
+ <span v-if="collapseTags && selected.length">
15
+ <el-tag
16
+ :closable="!selectDisabled"
17
+ :size="collapseTagSize"
18
+ :hit="selected[0].hitState"
19
+ type="info"
20
+ @close="deleteTag($event, selected[0])"
21
+ disable-transitions
22
+ >
23
+ <span class="el-select__tags-text">{{
24
+ selected[0].currentLabel
25
+ }}</span>
26
+ </el-tag>
27
+ <el-tag
28
+ v-if="selected.length > 1"
29
+ :closable="false"
30
+ :size="collapseTagSize"
31
+ type="info"
32
+ disable-transitions
33
+ >
34
+ <span class="el-select__tags-text">+ {{ selected.length - 1 }}</span>
35
+ </el-tag>
36
+ </span>
37
+ <transition-group @after-leave="resetInputHeight" v-if="!collapseTags">
38
+ <el-tag
39
+ v-for="item in selected"
40
+ :key="getValueKey(item)"
41
+ :closable="!selectDisabled"
42
+ :size="collapseTagSize"
43
+ :hit="item.hitState"
44
+ type="info"
45
+ @close="deleteTag($event, item)"
46
+ disable-transitions
47
+ >
48
+ <span class="el-select__tags-text">{{ item.currentLabel }}</span>
49
+ </el-tag>
50
+ </transition-group>
51
+ <input
52
+ type="text"
53
+ class="el-select__input"
54
+ :class="[selectSize ? `is-${selectSize}` : '']"
55
+ :disabled="selectDisabled"
56
+ :autocomplete="autoComplete || autocomplete"
57
+ @focus="handleFocus"
58
+ @blur="softFocus = false"
59
+ @keyup="managePlaceholder"
60
+ @keydown="resetInputState"
61
+ @keydown.down.prevent="handleNavigate('next')"
62
+ @keydown.up.prevent="handleNavigate('prev')"
63
+ @keydown.enter.prevent="selectOption"
64
+ @keydown.esc.stop.prevent="visible = false"
65
+ @keydown.delete="deletePrevTag"
66
+ @keydown.tab="visible = false"
67
+ @compositionstart="handleComposition"
68
+ @compositionupdate="handleComposition"
69
+ @compositionend="handleComposition"
70
+ v-model="query"
71
+ @input="debouncedQueryChange"
72
+ v-if="filterable"
73
+ :style="{
74
+ 'flex-grow': '1',
75
+ width: inputLength / (inputWidth - 32) + '%',
76
+ 'max-width': inputWidth - 42 + 'px',
77
+ }"
78
+ ref="input"
79
+ />
80
+ </div>
81
+ <el-input
82
+ ref="reference"
83
+ v-model="selectedLabel"
84
+ type="text"
85
+ :placeholder="currentPlaceholder"
86
+ :name="name"
87
+ :id="id"
88
+ :autocomplete="autoComplete || autocomplete"
89
+ :size="selectSize"
90
+ :disabled="selectDisabled"
91
+ :readonly="readonly"
92
+ :validate-event="false"
93
+ :class="{ 'is-focus': visible }"
94
+ :tabindex="multiple && filterable ? '-1' : null"
95
+ @focus="handleFocus"
96
+ @blur="handleBlur"
97
+ @input="debouncedOnInputChange"
98
+ @keydown.native.down.stop.prevent="handleNavigate('next')"
99
+ @keydown.native.up.stop.prevent="handleNavigate('prev')"
100
+ @keydown.native.enter.prevent="selectOption"
101
+ @keydown.native.esc.stop.prevent="visible = false"
102
+ @keydown.native.tab="visible = false"
103
+ @compositionstart="handleComposition"
104
+ @compositionupdate="handleComposition"
105
+ @compositionend="handleComposition"
106
+ @mouseenter.native="inputHovering = true"
107
+ @mouseleave.native="inputHovering = false"
108
+ >
109
+ <template slot="prefix" v-if="$slots.prefix">
110
+ <slot name="prefix"></slot>
111
+ </template>
112
+ <template slot="suffix">
113
+ <i
114
+ v-show="!showClose"
115
+ :class="[
116
+ 'el-select__caret',
117
+ 'el-input__icon',
118
+ 'el-icon-' + iconClass,
119
+ ]"
120
+ ></i>
121
+ <i
122
+ v-if="showClose"
123
+ class="el-select__caret el-input__icon el-icon-circle-close"
124
+ @click="handleClearClick"
125
+ ></i>
126
+ </template>
127
+ </el-input>
128
+ <transition
129
+ name="el-zoom-in-top"
130
+ @before-enter="handleMenuEnter"
131
+ @after-leave="doDestroy"
132
+ >
133
+ <el-select-menu
134
+ ref="popper"
135
+ :append-to-body="popperAppendToBody"
136
+ v-show="visible && emptyText !== false"
137
+ >
138
+ <el-scrollbar
139
+ tag="ul"
140
+ wrap-class="el-select-dropdown__wrap"
141
+ view-class="el-select-dropdown__list"
142
+ ref="scrollbar"
143
+ :class="{
144
+ 'is-empty': !allowCreate && query && filteredOptionsCount === 0,
145
+ }"
146
+ v-show="options.length > 0 && !loading"
147
+ >
148
+ <el-option :value="query" created v-if="showNewOption"> </el-option>
149
+ <slot></slot>
150
+ </el-scrollbar>
151
+ <template
152
+ v-if="
153
+ emptyText &&
154
+ (!allowCreate || loading || (allowCreate && options.length === 0))
155
+ "
156
+ >
157
+ <slot name="empty" v-if="$slots.empty"></slot>
158
+ <p class="el-select-dropdown__empty" v-else>
159
+ {{ emptyText }}
160
+ </p>
161
+ </template>
162
+ </el-select-menu>
163
+ </transition>
164
+ </div>
165
+ </template>
166
+ <script>
167
+ import Select from "element-ui/packages/select/src/select.vue";
168
+
169
+ export default {
170
+ name: "ElSelect",
171
+ extends: Select,
172
+ methods: {
173
+ handleClose(flag = true) {
174
+ this.visible = !flag;
175
+ this.$emit("outClick");
176
+ },
177
+ },
178
+ };
179
+ </script>
180
+
@@ -0,0 +1,30 @@
1
+ export const DEFAULT_FILTER_ITEMS = [
2
+ {
3
+ type: 'select',
4
+ label: '区域',
5
+ prop: 'bussRegionCode',
6
+ labelKey: 'name',
7
+ valueKey: 'code',
8
+ multiple: false,
9
+ multipleProp: 'bussRegionCodes',
10
+ options: [],
11
+ api: {
12
+ apiUrl: '/api/nstc-mdm/1.0/mdmDataDoc',
13
+ requestMethod: 'get',
14
+ headers: null,
15
+ reqKeys: {
16
+ isEnable: 1,
17
+ typeCode: 'aims.area'
18
+ }
19
+ }
20
+ }
21
+ ]
22
+
23
+ export function cloneDefaultFilterItems() {
24
+ return DEFAULT_FILTER_ITEMS.map(item => ({
25
+ ...item,
26
+ options: Array.isArray(item.options) ? [...item.options] : item.options,
27
+ api: item.api ? { ...item.api, reqKeys: { ...(item.api.reqKeys || {}) } } : item.api
28
+ }))
29
+ }
30
+
@@ -0,0 +1,169 @@
1
+ <template>
2
+ <el-form v-if="componentVisible" ref="formRef" inline :model="searchForm">
3
+ <el-form-item v-for="(item, index) in searchList" :prop="item.prop" :key="item.prop + '_' + index">
4
+ <template v-if="item.type === 'select'">
5
+ <el-select
6
+ :popper-append-to-body="false"
7
+ clearable
8
+ filterable
9
+ :multiple="item.multiple"
10
+ v-model="searchForm[item.prop]"
11
+ :validate-event="false"
12
+ :placeholder="$t('common_t_0054') + item.label"
13
+ @change="(val) => handleSearch(val, item)"
14
+ >
15
+ <el-option
16
+ v-for="(opt, idx) in item.options"
17
+ :value="opt[item.valueKey]"
18
+ :label="opt[item.labelKey]"
19
+ :key="opt[item.valueKey] + '_' + idx"
20
+ />
21
+ </el-select>
22
+ </template>
23
+ </el-form-item>
24
+ </el-form>
25
+ </template>
26
+
27
+ <script>
28
+ import request from "@/utils/request"
29
+ import getJsonc from "@/utils/getJsonc"
30
+ import { cloneDefaultFilterItems } from "./defaultFilterItems"
31
+
32
+ export default {
33
+ name: 'FILTERS',
34
+ props: {
35
+ /**
36
+ * 前端控制筛选项读取位置(默认读取组件内配置)
37
+ * - true:从业务模块 jsonc 读取筛选配置(通过 bizFilterConfigJsoncPath 指定路径)
38
+ */
39
+ readFilterConfigFromBiz: {
40
+ type: Boolean,
41
+ default: false
42
+ },
43
+ /**
44
+ * 业务模块 jsonc 路径(例如:/config/selectTree/filters.jsonc)
45
+ * 仅在 readFilterConfigFromBiz=true 时生效
46
+ */
47
+ bizFilterConfigJsoncPath: {
48
+ type: String,
49
+ default: ''
50
+ },
51
+ useCommonConfigControl: {
52
+ type: Boolean,
53
+ default: true
54
+ },
55
+ /**
56
+ * 是否启用财资公参配置控制
57
+ * - true:启用财资公参配置控制
58
+ * - false:未启用财资公参配置控制
59
+ */
60
+ isEnableCommonConfigControl: {
61
+ type: Boolean,
62
+ default: true
63
+ }
64
+ },
65
+ watch: {
66
+ isEnableCommonConfigControl: {
67
+ async handler(newVal) {
68
+ if (newVal) {
69
+ if (this.useCommonConfigControl) {
70
+ this.componentVisible = true
71
+ await this.loadBizFilterConfigIfNeeded()
72
+ this.init()
73
+ }
74
+ } else {
75
+ if (!this.useCommonConfigControl) {
76
+ this.componentVisible = true
77
+ await this.loadBizFilterConfigIfNeeded()
78
+ this.init()
79
+ }
80
+ }
81
+ },
82
+ immediate: true
83
+ }
84
+ },
85
+ data() {
86
+ return {
87
+ visible: false,
88
+ componentVisible: false,
89
+ searchForm: {},
90
+ builtInFilterItems: cloneDefaultFilterItems(),
91
+ bizFilterConfig: null,
92
+ commonConfig: null
93
+ }
94
+ },
95
+ computed: {
96
+ effectiveFilterConfig() {
97
+ // 两种来源:
98
+ // - 组件内置配置:builtInFilterItems
99
+ // - 业务 jsonc 配置:bizFilterConfig(若启用且读取成功)
100
+ if (this.readFilterConfigFromBiz && this.bizFilterConfig) {
101
+ return {
102
+ filterList: Array.isArray(this.bizFilterConfig.filterList) ? this.bizFilterConfig.filterList : cloneDefaultFilterItems()
103
+ }
104
+ }
105
+
106
+ return {
107
+ filterList: this.builtInFilterItems || []
108
+ }
109
+ },
110
+ searchList() {
111
+ const { filterList = [] } = this.effectiveFilterConfig || {}
112
+ return (filterList || []).filter(config => config?.prop)
113
+ }
114
+ },
115
+ methods: {
116
+ async loadBizFilterConfigIfNeeded() {
117
+ if (!this.readFilterConfigFromBiz) return
118
+ const p = (this.bizFilterConfigJsoncPath || '').trim()
119
+ if (!p) return
120
+ try {
121
+ this.bizFilterConfig = await getJsonc(p, false)
122
+ } catch (e) {
123
+ this.bizFilterConfig = null
124
+ }
125
+ },
126
+
127
+ init() {
128
+ const cfg = this.effectiveFilterConfig || {}
129
+ if (!Array.isArray(cfg.filterList) || !cfg.filterList.length) return
130
+ const flatSearchItems = this.searchList || []
131
+ flatSearchItems.map(async item => {
132
+ if (!item || !item.api) return
133
+ if (Array.isArray(item.options) && item.options.length) return
134
+ let res = null
135
+ if (["GET", "get"].includes(item.api?.requestMethod)){
136
+ res = await this.getDataForGet(item.api?.apiUrl, (item.api?.reqKeys || {}), item.api?.headers ?? item.headers)
137
+ }
138
+ if (["POST", "post"].includes(item?.api?.requestMethod)) {
139
+ res = await this.getDataForPost(item.api?.apiUrl, (item.api?.reqKeys || {}), item.api?.headers ?? item.headers)
140
+ }
141
+ const optionsData = Array.isArray(res) ? res : (res?.data || res?.list || [])
142
+ if (Array.isArray(optionsData)) {
143
+ this.$set(item, 'options', optionsData)
144
+ }
145
+ })
146
+ },
147
+ handleSearch(val, item) {
148
+ this.$emit('filterChange', val, item.searchKey)
149
+ },
150
+
151
+ getDataForGet(url, data, headers) {
152
+ return request({
153
+ url: url,
154
+ method:'GET',
155
+ params: data,
156
+ headers
157
+ })
158
+ },
159
+ getDataForPost(url, data, headers) {
160
+ return request({
161
+ url: url,
162
+ method:'POST',
163
+ data,
164
+ headers
165
+ })
166
+ }
167
+ }
168
+ }
169
+ </script>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>页面</title>
4
+ <g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="20" height="20"></rect>
6
+ <path d="M16.6914062,5.63867188 C16.8085938,5.75585938 16.875,5.9140625 16.875,6.08007812 L16.875,18.125 C16.875,18.4707031 16.5957031,18.75 16.25,18.75 L3.75,18.75 C3.40429688,18.75 3.125,18.4707031 3.125,18.125 L3.125,1.875 C3.125,1.52929688 3.40429688,1.25 3.75,1.25 L12.0449219,1.25 C12.2109375,1.25 12.3710938,1.31640625 12.4882813,1.43359375 L16.6914062,5.63867188 Z M15.4335938,6.3671875 L11.7578125,2.69140625 L11.7578125,6.3671875 L15.4335938,6.3671875 Z M6.25,9.4140625 C6.16370551,9.4140625 6.09375,9.48401801 6.09375,9.5703125 L6.09375,10.5078125 C6.09375,10.594107 6.16370551,10.6640625 6.25,10.6640625 L13.75,10.6640625 C13.8362945,10.6640625 13.90625,10.594107 13.90625,10.5078125 L13.90625,9.5703125 C13.90625,9.48401801 13.8362945,9.4140625 13.75,9.4140625 L6.25,9.4140625 Z M6.25,12.0703125 C6.16370551,12.0703125 6.09375,12.140268 6.09375,12.2265625 L6.09375,13.1640625 C6.09375,13.250357 6.16370551,13.3203125 6.25,13.3203125 L9.84375,13.3203125 C9.93004449,13.3203125 10,13.250357 10,13.1640625 L10,12.2265625 C10,12.140268 9.93004449,12.0703125 9.84375,12.0703125 L6.25,12.0703125 Z" id="形状" fill="#1677FF" fill-rule="nonzero"></path>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>文件</title>
4
+ <g id="文件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="20" height="20"></rect>
6
+ <rect id="矩形" fill="#FFBF00" opacity="0.300000012" x="3" y="4" width="14" height="11"></rect>
7
+ <path d="M17.1875,5.828125 L10.1757812,5.828125 L7.88476562,3.63671875 C7.85546875,3.609375 7.81640625,3.59375 7.77734375,3.59375 L2.8125,3.59375 C2.46679688,3.59375 2.1875,3.87304688 2.1875,4.21875 L2.1875,15.78125 C2.1875,16.1269531 2.46679688,16.40625 2.8125,16.40625 L17.1875,16.40625 C17.5332031,16.40625 17.8125,16.1269531 17.8125,15.78125 L17.8125,6.453125 C17.8125,6.10742188 17.5332031,5.828125 17.1875,5.828125 Z" id="路径" fill="#FFBF00" fill-rule="nonzero"></path>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,198 @@
1
+ <template>
2
+ <el-tree
3
+ ref="tree"
4
+ class="cl-tree cl-tree-nstc"
5
+ :node-key="nodeKey"
6
+ :expand-on-click-node="showCheckbox?true:false"
7
+ :data="data"
8
+ check-strictly
9
+ :default-expanded-keys="defaultExpandedKeys"
10
+ :show-checkbox="showCheckbox && !single"
11
+ :props="props"
12
+ v-bind="$attrs"
13
+ v-on="$listeners"
14
+ >
15
+ <div
16
+ slot-scope="{ node, data }"
17
+ class="flex-box flex-lr flex-v w-100p cl-tree-item"
18
+ @mouseenter="mouseenterTree(node, data)"
19
+ @mouseleave="checkFlag = false"
20
+ >
21
+ <span class="flex-box flex-v">
22
+ <!-- <img :src="node.level == 1 ? folder : desc" class="m-r-ss" alt="" /> -->
23
+ {{
24
+ (data[props.value] ? "(" + data[props.value] + ") " : "") +
25
+ data[props.label]
26
+ }}
27
+ </span>
28
+ <div class="row-point" v-if="showAllCheck && !single && !isList">
29
+ <el-dropdown @click.stop="() => null">
30
+ <span class="el-dropdown-link"> ... </span>
31
+ <el-dropdown-menu slot="dropdown" class="nstc-unit-tree-drop">
32
+ <el-dropdown-item
33
+ @click.native.stop="handleCheckedBro(node, data)"
34
+ >{{ $t("common_a_0006") }}</el-dropdown-item
35
+ >
36
+ <el-dropdown-item
37
+ @click.native.stop="handleCheckedChild(node, data, 'direct')"
38
+ >
39
+ {{ $t("common_a_0008") }}</el-dropdown-item
40
+ >
41
+ <el-dropdown-item
42
+ @click.native.stop="handleCheckedChild(node, data, 'all')"
43
+ >{{ $t("common_a_0007") }}</el-dropdown-item
44
+ >
45
+ <el-dropdown-item
46
+ @click.native.stop="handleCheckedChild(node, data, 'cancel')"
47
+ >{{ $t("common_a_0007_1") }}</el-dropdown-item
48
+ >
49
+ </el-dropdown-menu>
50
+ </el-dropdown>
51
+ </div>
52
+ </div>
53
+ </el-tree>
54
+ </template>
55
+ <script>
56
+ export default {
57
+ name: "Tree",
58
+ props: {
59
+ isList: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ showAllCheck: {
64
+ type: Boolean,
65
+ default: true,
66
+ },
67
+ single: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ defaultExpandedKeys: {
72
+ type: Array,
73
+ default: () => [],
74
+ },
75
+ data: {
76
+ type: Array,
77
+ default: () => [],
78
+ },
79
+ props: {
80
+ type: Object,
81
+ default: () => ({}),
82
+ },
83
+ showCheckbox: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
87
+ checkStrictly: {
88
+ type: Boolean,
89
+ default: false,
90
+ },
91
+ nodeKey: {
92
+ type: String,
93
+ default: "",
94
+ },
95
+ },
96
+ data() {
97
+ return {
98
+ folder: require("./folder.svg"),
99
+ desc: require("./document.svg"),
100
+ checkFlag: {},
101
+ showDropMenu: null,
102
+ list: [],
103
+ };
104
+ },
105
+ computed: {
106
+ checkStrictlyC: {
107
+ get() {
108
+ return this.checkStrictly;
109
+ },
110
+ set(v) {
111
+ // console.log(v, 123)
112
+ return this.$emit("update:checkStrictly", v);
113
+ },
114
+ },
115
+ },
116
+ mounted() {
117
+ this.setRefData();
118
+ },
119
+ methods: {
120
+ setRefData() {
121
+ const {
122
+ store,
123
+ filter,
124
+ updateKeyChildren,
125
+ getCheckedNodes,
126
+ setCheckedNodes,
127
+ getCheckedKeys,
128
+ setCheckedKeys,
129
+ setChecked,
130
+ getHalfCheckedNodes,
131
+ getHalfCheckedKeys,
132
+ getCurrentKey,
133
+ getCurrentNode,
134
+ setCurrentKey,
135
+ setCurrentNode,
136
+ getNode,
137
+ remove,
138
+ append,
139
+ insertBefore,
140
+ insertAfter,
141
+ } = this.$refs["tree"];
142
+
143
+ this.filter = filter;
144
+ this.updateKeyChildren = updateKeyChildren;
145
+ this.getCheckedNodes = getCheckedNodes;
146
+ this.setCheckedNodes = setCheckedNodes;
147
+ this.getCheckedKeys = getCheckedKeys;
148
+ this.setCheckedKeys = setCheckedKeys;
149
+ this.setChecked = setChecked;
150
+ this.getHalfCheckedNodes = getHalfCheckedNodes;
151
+ this.getHalfCheckedKeys = getHalfCheckedKeys;
152
+ this.getCurrentKey = getCurrentKey;
153
+ this.getCurrentNode = getCurrentNode;
154
+ this.setCurrentKey = setCurrentKey;
155
+ this.setCurrentNode = setCurrentNode;
156
+ this.getNode = getNode;
157
+ this.remove = remove;
158
+ this.append = append;
159
+ this.insertBefore = insertBefore;
160
+ this.insertAfter = insertAfter;
161
+ this.store = store;
162
+ },
163
+ handleChecked(node, data) {
164
+ // this.store.checkStrictly = true
165
+ this.setChecked(node.data, true);
166
+ this.$emit("check", data, {
167
+ checkedKeys: this.getCheckedKeys(),
168
+ checkedNodes: this.getCheckedNodes(),
169
+ halfCheckedNodes: this.getHalfCheckedNodes(),
170
+ halfCheckedKeys: this.getHalfCheckedKeys(),
171
+ });
172
+ // this.store.checkStrictly = false
173
+ },
174
+ handleCheckedBro(node, data) {
175
+ //勾选平级单位
176
+ this.$emit("checkedBro", data);
177
+ },
178
+ handleCheckedChild(node, data, type) {
179
+ //勾选平级单位
180
+ this.$emit("checkedChild", { node, data, type: type });
181
+ },
182
+ mouseenterTree(node, data) {
183
+ this.checkFlag = node;
184
+ },
185
+ handleClose(node, data) {
186
+ // this.store.checkStrictly = true
187
+ this.setChecked(node.data, false);
188
+ this.$emit("check", data, {
189
+ checkedKeys: this.getCheckedKeys(),
190
+ checkedNodes: this.getCheckedNodes(),
191
+ halfCheckedNodes: this.getHalfCheckedNodes(),
192
+ halfCheckedKeys: this.getHalfCheckedKeys(),
193
+ });
194
+ // this.store.checkStrictly = false
195
+ },
196
+ },
197
+ };
198
+ </script>
@@ -0,0 +1,16 @@
1
+ function forEachs(arr, callback, branch = 'children', arrp = {}) {
2
+ if (typeof callback === 'function') {
3
+ _forEachs(arr, callback, branch, arrp)
4
+ }
5
+ }
6
+
7
+ function _forEachs(arr, callback, branch, arrp) {
8
+ arr.forEach(function (item, _i, _arr) {
9
+ callback(item, _i, _arr, arrp)
10
+ if (item[branch] && Array.isArray(item[branch])) {
11
+ _forEachs(item[branch], callback, branch, item)
12
+ }
13
+ })
14
+ }
15
+
16
+ export default forEachs
package/src/index.js CHANGED
@@ -17,6 +17,8 @@ import TabPage from '../packages/tab-page/index.js'
17
17
  import InputNumber from '../packages/input-number/index.js'
18
18
  import DatePickerPor from '../packages/date-picker-por/index.js'
19
19
  import DynamicDescriptions from '../packages/dynamic-descriptions/index.js'
20
+ import SelectTreeUnit from '../packages/select-tree-unit/index.js'
21
+ import SelectTreeUnitForm from '../packages/select-tree-unit-form/index.js'
20
22
 
21
23
  // 存储组件列表
22
24
  const components = [
@@ -32,7 +34,9 @@ const components = [
32
34
  TabPage,
33
35
  InputNumber,
34
36
  DatePickerPor,
35
- DynamicDescriptions
37
+ DynamicDescriptions,
38
+ SelectTreeUnit,
39
+ SelectTreeUnitForm
36
40
  ]
37
41
 
38
42
  // 定义 install 方法,接收 Vue 作为参数
@@ -74,6 +78,8 @@ export {
74
78
  InputNumber,
75
79
  DatePickerPor,
76
80
  DynamicDescriptions,
81
+ SelectTreeUnit,
82
+ SelectTreeUnitForm,
77
83
  // 工具方法
78
84
  repairEl,
79
85
  getColumnWidth,