olp-table 5.3.4 → 5.3.5

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.
Files changed (171) hide show
  1. package/package.json +12 -92
  2. package/.env.build +0 -1
  3. package/README.md +0 -26
  4. package/babel.config.js +0 -5
  5. package/jsconfig.json +0 -22
  6. package/public/favicon.ico +0 -0
  7. package/public/index.html +0 -17
  8. package/rmMode.bat +0 -1
  9. package/src/App.vue +0 -199
  10. package/src/api/crud.js +0 -22
  11. package/src/api/dist.js +0 -6
  12. package/src/assets/iconfont/iconfont.css +0 -20
  13. package/src/assets/iconfont/iconfont.json +0 -16
  14. package/src/assets/iconfont/iconfont.ttf +0 -0
  15. package/src/assets/iconfont/iconfont.woff +0 -0
  16. package/src/assets/iconfont/iconfont.woff2 +0 -0
  17. package/src/assets/logo.png +0 -0
  18. package/src/components/auto-height/index.vue +0 -75
  19. package/src/components/codemirror-tag.vue +0 -100
  20. package/src/components/lazy-load-select.vue +0 -107
  21. package/src/components/ol-dialog-excel.vue +0 -112
  22. package/src/components/ol-dialog-import.vue +0 -304
  23. package/src/components/ol-dialog-json.vue +0 -82
  24. package/src/components/ol-dialog-table.vue +0 -81
  25. package/src/components/ol-dialog-upload-file.vue +0 -208
  26. package/src/components/ol-dict-tag.vue +0 -271
  27. package/src/components/ol-select-dom.vue +0 -71
  28. package/src/components/ol-table-filter.vue +0 -28
  29. package/src/components/ol-table-render.vue +0 -44
  30. package/src/components/ol-table-select.vue +0 -150
  31. package/src/components/pinia-init.vue +0 -18
  32. package/src/components/table/model/ModelMixins.js +0 -43
  33. package/src/components/table/model/model-index.vue +0 -121
  34. package/src/components/table/model/ot-left-right.vue +0 -18
  35. package/src/components/table/model/ot-left-tree-right-table.scss +0 -14
  36. package/src/components/table/model/ot-left-tree-right-table.vue +0 -41
  37. package/src/components/table/model/ot-top-1-bottom-2.vue +0 -39
  38. package/src/components/table/model/ot-top-2-bottom-1.vue +0 -38
  39. package/src/components/table/model/ot-top-2-bottom-2.vue +0 -38
  40. package/src/components/table/model/ot-top-bottom.vue +0 -18
  41. package/src/components/table/model/splitpanesModel.css +0 -22
  42. package/src/components/table/model/splitpanesModel.vue +0 -54
  43. package/src/components/table/ol-form/index.vue +0 -537
  44. package/src/components/table/ol-form-v3/index.vue +0 -455
  45. package/src/components/table/ol-main-form-sub-table/index.vue +0 -601
  46. package/src/components/table/ol-pager/index.vue +0 -46
  47. package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +0 -233
  48. package/src/components/table/ol-table/components/ol-table-column-config/index.vue +0 -145
  49. package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +0 -88
  50. package/src/components/table/ol-table/index.vue +0 -232
  51. package/src/components/table/ol-table-operate/index.vue +0 -61
  52. package/src/components/table/ol-table-search/index.vue +0 -17
  53. package/src/components/table/ol-table-tool-btn/index.vue +0 -60
  54. package/src/components/tree/components/o-tree.vue +0 -289
  55. package/src/components/tree/index.vue +0 -46
  56. package/src/components/v-component/index.vue +0 -43
  57. package/src/config/dev-config.js +0 -5
  58. package/src/config/prod-config.js +0 -5
  59. package/src/config/shared-config.js +0 -20
  60. package/src/data.js +0 -9378
  61. package/src/directives/permission/hasPermi.js +0 -63
  62. package/src/directives/permission/hasRole.js +0 -30
  63. package/src/main.js +0 -55
  64. package/src/mixins/VTMixin/DefaultMethods.js +0 -749
  65. package/src/mixins/VTMixin/OTMixinBody.js +0 -105
  66. package/src/mixins/VTMixin/OTMixinBodyFooter.js +0 -93
  67. package/src/mixins/VTMixin/OTMixinBodyMethods.js +0 -420
  68. package/src/mixins/VTMixin/OTMixinColumnMethod.js +0 -450
  69. package/src/mixins/VTMixin/OTMixinInitMethod.js +0 -130
  70. package/src/mixins/VTMixin/OTMixinPager.js +0 -38
  71. package/src/mixins/VTMixin/OTMixinSortable.js +0 -43
  72. package/src/mixins/VTMixin/index.js +0 -18
  73. package/src/package/index.js +0 -20
  74. package/src/plugins/axios.js +0 -61
  75. package/src/store/dict.js +0 -76
  76. package/src/store/dictType.js +0 -52
  77. package/src/store/permi.js +0 -45
  78. package/src/styles/common.scss +0 -37
  79. package/src/styles/index.scss +0 -48
  80. package/src/styles/theme.scss +0 -32
  81. package/src/utils/AESCRUDUtils.js +0 -87
  82. package/src/utils/DateUtils.js +0 -35
  83. package/src/utils/ExcelUtil.js +0 -159
  84. package/src/utils/TableSortUtil.js +0 -91
  85. package/src/utils/columnProp.js +0 -3
  86. package/src/utils/groupCompute.js +0 -68
  87. package/src/utils/http/httpFactory.js +0 -92
  88. package/src/utils/http/httpFactory2.js +0 -79
  89. package/src/utils/http/httpUtil.js +0 -123
  90. package/src/utils/http/httpUtils.js +0 -38
  91. package/src/utils/loadStyle.js +0 -14
  92. package/src/utils/message.js +0 -56
  93. package/src/utils/object.js +0 -80
  94. package/src/utils/security/TokenUtil.js +0 -19
  95. package/src/utils/tree.js +0 -54
  96. package/src/utils/util.js +0 -127
  97. package/src/views/Test/index.vue +0 -77
  98. package/src/views/Test/index2.vue +0 -33
  99. package/src/views/components/btn-config/index.vue +0 -202
  100. package/src/views/components/option-config/index.vue +0 -192
  101. package/src/views/db/chineseToEnglish.vue +0 -127
  102. package/src/views/db/filed.vue +0 -395
  103. package/src/views/db/index.vue +0 -192
  104. package/src/views/db/preview/index.vue +0 -139
  105. package/src/views/db/preview/left.vue +0 -204
  106. package/src/views/db/preview/right.vue +0 -466
  107. package/src/views/groupTable/index.vue +0 -137
  108. package/src/views/groupTable/ol-table-column-config/columnIndex.vue +0 -194
  109. package/src/views/groupTable/ol-table-column-config/index.vue +0 -92
  110. package/src/views/table/add-or-edit/config/base-config/index.vue +0 -539
  111. package/src/views/table/add-or-edit/config/base-config/table-form.vue +0 -333
  112. package/src/views/table/add-or-edit/config/column-config/header-config.vue +0 -475
  113. package/src/views/table/add-or-edit/config/column-config/index.vue +0 -790
  114. package/src/views/table/add-or-edit/config/data/column.js +0 -218
  115. package/src/views/table/add-or-edit/config/data/crud.js +0 -122
  116. package/src/views/table/add-or-edit/config/data/events.js +0 -109
  117. package/src/views/table/add-or-edit/config/data/method.js +0 -127
  118. package/src/views/table/add-or-edit/config/data/option.js +0 -725
  119. package/src/views/table/add-or-edit/config/data/page.js +0 -79
  120. package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +0 -42
  121. package/src/views/table/add-or-edit/config/field-config/index.vue +0 -91
  122. package/src/views/table/add-or-edit/config/form-config/index.vue +0 -1179
  123. package/src/views/table/add-or-edit/config/index.vue +0 -376
  124. package/src/views/table/add-or-edit/config/initFormObject.js +0 -25
  125. package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +0 -71
  126. package/src/views/table/add-or-edit/config/script-config/index.vue +0 -70
  127. package/src/views/table/add-or-edit/config/table-config/btn-config.vue +0 -340
  128. package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +0 -132
  129. package/src/views/table/add-or-edit/config/table-config/index.vue +0 -446
  130. package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +0 -41
  131. package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +0 -74
  132. package/src/views/table/add-or-edit/configOld/dataTags/index.vue +0 -439
  133. package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +0 -79
  134. package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +0 -74
  135. package/src/views/table/add-or-edit/configOld/index.vue +0 -127
  136. package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +0 -5
  137. package/src/views/table/add-or-edit/configOld/tableTags/index.vue +0 -353
  138. package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +0 -75
  139. package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +0 -92
  140. package/src/views/table/add-or-edit/index.vue +0 -201
  141. package/src/views/table/add-or-edit/themeModel/index.vue +0 -53
  142. package/src/views/table/add-or-edit/themeModel/init-model-table.vue +0 -48
  143. package/src/views/table/add-or-edit/themeModel/init-model.vue +0 -81
  144. package/src/views/table/add-or-edit/themeModel/left-right.vue +0 -24
  145. package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +0 -75
  146. package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +0 -42
  147. package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +0 -49
  148. package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +0 -29
  149. package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +0 -32
  150. package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +0 -32
  151. package/src/views/table/add-or-edit/themeModel/top-bottom.vue +0 -14
  152. package/src/views/table/index.vue +0 -43
  153. package/src/views/table/index2.vue +0 -199
  154. package/src/views/table/preview/index.vue +0 -29
  155. package/src/views/tree/components/config-core-data.vue +0 -85
  156. package/src/views/tree/components/config-core-table.vue +0 -362
  157. package/src/views/tree/components/config-core-tree/data/events.js +0 -95
  158. package/src/views/tree/components/config-core-tree/data/option.js +0 -88
  159. package/src/views/tree/components/config-core-tree/data/prop.js +0 -28
  160. package/src/views/tree/components/config-core-tree/index.vue +0 -181
  161. package/src/views/tree/components/config-core.vue +0 -42
  162. package/src/views/tree/components/form-config/index.vue +0 -967
  163. package/src/views/tree/index.vue +0 -424
  164. package/vue.config.js +0 -44
  165. /package/{olp-table/demo.html → demo.html} +0 -0
  166. /package/{olp-table/fonts → fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
  167. /package/{olp-table/fonts → fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
  168. /package/{olp-table/olp-table.common.js → olp-table.common.js} +0 -0
  169. /package/{olp-table/olp-table.css → olp-table.css} +0 -0
  170. /package/{olp-table/olp-table.umd.js → olp-table.umd.js} +0 -0
  171. /package/{olp-table/olp-table.umd.min.js → olp-table.umd.min.js} +0 -0
@@ -1,475 +0,0 @@
1
- <template>
2
- <el-dialog
3
- v-model="show"
4
- title="配置中心"
5
- width="90%"
6
- style="height: 600px;"
7
- align-center
8
- >
9
- <vxe-grid v-bind="gridOptions" ref="vexGridRef">
10
- <template #toolbar_buttons>
11
- <vxe-button status="success" @click="saveEvent">保存表头</vxe-button>
12
- <vxe-button status="success" @click="delEvent">取消上级表头</vxe-button>
13
- </template>
14
- <!-- 通用多选框 -->
15
- <template #checkedBox_header="{ column }">
16
- <div style="display: flex;align-items: center;">
17
- <el-checkbox v-model="column.params.all" @change="checkBoxClick(column,)"
18
- :disabled="column.params.all == true && column.params.disabled == 'sss'"><span
19
- style="margin-left: 5px;">{{ column.title }} </span></el-checkbox>
20
- <i v-if="column.children" class="vxe-icon-edit"
21
- @click="menuClickEvent({menu:'edit',column: column})"/>
22
- <i v-if="column.children" class="vxe-icon-add"
23
- @click="menuClickEvent({menu:'add',column: column})"/>
24
- <i v-if="column.children" class="vxe-icon-delete"
25
- @click="menuClickEvent({menu:'del',column: column})"/>
26
- <i v-else-if="column.params.parentField" class="vxe-icon-delete"
27
- @click="menuClickEvent({menu:'oneDel',column: column})"/>
28
- </div>
29
- </template>
30
- </vxe-grid>
31
- <div v-if="gridOptions.selectedColumns.length >= 1">
32
- <span>表头信息</span>
33
- <el-form style="margin-top: 20px" :model="gridOptions.form" label-width="80px">
34
- <el-form-item label="表头名称" prop="title" :span="24">
35
- <el-input v-model="gridOptions.form.title"/>
36
- </el-form-item>
37
- </el-form>
38
- </div>
39
- <template #footer>
40
- <span>
41
- <vxe-button @click="close">取消</vxe-button>
42
- <vxe-button status="primary" @click="save(true)">保存</vxe-button>
43
- </span>
44
- </template>
45
-
46
- <el-dialog v-model="showPopup" title="表头信息" :width="600" :height="300" show-zoom>
47
- <el-form style="margin-top: 20px" :model="gridOptions.form" label-width="80px">
48
- <el-form-item label="表头名称" prop="title" :span="24">
49
- <el-input v-model="gridOptions.form.title"/>
50
- </el-form-item>
51
- </el-form>
52
- <template #footer>
53
- <span>
54
- <vxe-button @click="editClose">取消</vxe-button>
55
- <vxe-button status="primary" @click="editSave(true)">保存</vxe-button>
56
- </span>
57
- </template>
58
- </el-dialog>
59
-
60
- </el-dialog>
61
- </template>
62
- <script setup>
63
- import {ref, reactive, defineExpose, nextTick, onMounted} from "vue"
64
- import {storeDict} from "@/store/dict";
65
- import {useMessage} from "@/utils/message";
66
-
67
- const show = ref(false)
68
- const formShow = ref(false)
69
- const showPopup = ref(false)
70
- const vexGridRef = ref()
71
- const dict = storeDict();
72
- // 子组件调用父组件
73
- const emits = defineEmits(['headerCommit']) //声明 emits
74
- const close = () => {
75
- show.value = false
76
- }
77
- const save = () => {
78
- let columns = gridOptions.columns;
79
- let rows = getColumns(columns)
80
- console.log('rows:', JSON.stringify(rows))
81
- emits('ok', {
82
- groupColumns: rows
83
- })
84
- close()
85
- }
86
- const getColumns = (columns) => {
87
- let rows = []
88
- for (const column of columns) {
89
- let row = {
90
- id: column.id,
91
- field: column.field,
92
- title: column.title
93
- }
94
- if (column.children) {
95
- row.children = getColumns(column.children)
96
- }
97
- rows.push(row)
98
- }
99
- return rows;
100
- }
101
- const editClose = () => {
102
- showPopup.value = false
103
- }
104
- const editSave = () => {
105
- let columns = gridOptions.columns;
106
- setColumnTitle(columns)
107
- showPopup.value = false
108
- vexGridRef.value.loadColumn(gridOptions.columns)
109
- }
110
- const setColumnTitle = (columns) => {
111
- for (let col of columns) {
112
- if (col.field == gridOptions.form.field) {
113
- col.title = gridOptions.form.title
114
- gridOptions.form.title = ''
115
- } else if (col.children) {
116
- setColumnTitle(col.children)
117
- }
118
- }
119
- }
120
- const clearCheckAll = (columns) => {
121
- gridOptions.selectedColumns = []
122
- for (const column of columns) {
123
- if (column.params.all == true) {
124
- column.params.all = false
125
- }
126
- if (column.children) {
127
- clearCheckAll(column.children)
128
- }
129
- }
130
- vexGridRef.value.loadColumn(gridOptions.columns)
131
- }
132
- const menuClickEvent = ({menu, column}) => {
133
- // eslint-disable-next-line no-case-declarations
134
- let columns = gridOptions.columns;
135
- switch (menu) {
136
- case 'edit':
137
- if (!column.children) {
138
- useMessage().error("当前表头不可以编辑!")
139
- return
140
- }
141
- gridOptions.form = column
142
- showPopup.value = true
143
- break
144
- case 'del':
145
- let rows = del(column, columns)
146
- if (rows && rows.length >= 1) {
147
- columns.push(...rows)
148
- }
149
- break
150
- case 'add' :
151
- // eslint-disable-next-line no-case-declarations
152
- let addColumns = []
153
- addDel(column, columns, addColumns)
154
- if (addColumns && addColumns.length >= 1) {
155
- addChildren(column, columns, addColumns)
156
- }
157
- delTableFieldNull(columns)
158
- break
159
- case 'oneDel' :
160
- // eslint-disable-next-line no-case-declarations
161
- let addColumns1 = []
162
- oneDel(column, columns, addColumns1)
163
- if (addColumns1 && addColumns1.length >= 1) {
164
- columns.push(...addColumns1)
165
- }
166
- delTableFieldNull(columns)
167
- gridOptions.columns.sort((a, b) => a.sort - b.sort);
168
- break
169
- }
170
- clearCheckAll(gridOptions.columns)
171
- }
172
- const oneDel = (column, columns, addColumns) => {
173
- for (let i = 0; i < columns.length; i++) {
174
- let row = columns[i]
175
- if (column.field == row.field) {
176
- row.params.parentField = undefined
177
- addColumns.push(row)
178
- columns.splice(i, 1)
179
- return
180
- }
181
- if (row.children) {
182
- oneDel(column, row.children, addColumns)
183
- }
184
- }
185
- }
186
- // 往分组表头加入标题
187
- const addDel = (column, columns, addColumns) => {
188
- for (let i = 0; i < columns.length; i++) {
189
- let row = columns[i]
190
- if (!row.children && row.params.all == true) {
191
- row.params.parentField = undefined
192
- addColumns.push(row)
193
- columns.splice(i, 1)
194
- --i
195
- continue
196
- }
197
- if (row.children) {
198
- addDel(column, row.children, addColumns)
199
- }
200
- }
201
- }
202
- const delTableFieldNull = (columns) => {
203
- for (let i = 0; i < columns.length; i++) {
204
- let row = columns[i]
205
- if (!row.tableField && (!row.children || row.children.length == 0)) {
206
- columns.splice(i, 1)
207
- --i
208
- continue
209
- }
210
- if (row.children) {
211
- delTableFieldNull(row.children)
212
- }
213
- }
214
- }
215
- const addChildren = (column, columns, addColumns) => {
216
- for (let i = 0; i < columns.length; i++) {
217
- let row = columns[i]
218
- // 当前加入表头
219
- if (row.field == column.field) {
220
- row.children.push(...addColumns)
221
- return
222
- }
223
- if (row.children) {
224
- addChildren(column, row.children, addColumns)
225
- }
226
- }
227
-
228
- }
229
- // 当前 模板
230
- const del = (column, columns) => {
231
- for (let i = 0; i < columns.length; i++) {
232
- let row = columns[i]
233
- if (row.field == column.field) {
234
- columns.splice(i, 1)
235
- return row.children;
236
- }
237
- if (row.children) {
238
- let rows = del(column, row.children);
239
- if (rows && rows.length >= 1) {
240
- row.children.push(...rows)
241
- }
242
- }
243
- }
244
- }
245
- const del1 = (column) => {
246
- // eslint-disable-next-line no-case-declarations
247
- let columns = column.children;
248
- // eslint-disable-next-line no-case-declarations
249
- let addColumns = []
250
- for (let i = 0; i < columns.length; i++) {
251
- let row = columns[i]
252
- if (row.params.all != true) {
253
- addColumns.push(row)
254
- columns.splice(i, 1)
255
- --i;
256
- }
257
- }
258
- let rows = gridOptions.columns;
259
- for (let i = 0; i < rows.length; i++) {
260
- let row = rows[i]
261
- if (row.field == column.field) {
262
- row.children = columns
263
- rows.splice(i + 1, 0, ...addColumns)
264
- break
265
- }
266
- }
267
- }
268
-
269
- const delChildren = (columns, column) => {
270
- for (let i = 0; i < columns.length; i++) {
271
- let col = columns[i];
272
- if (column.field == col.field) {
273
- columns.splice(i, 1)
274
- break
275
- }
276
- if (col.children) {
277
- delChildren(col.children, column)
278
- }
279
- }
280
- }
281
- const delEvent = () => {
282
- let columns = gridOptions.columns;
283
- let addColumns = []
284
- let column = {}
285
- addDel(column, columns, addColumns)
286
- columns.push(...addColumns)
287
- delTableFieldNull(columns)
288
- clearCheckAll(gridOptions.columns)
289
- gridOptions.columns.sort((a, b) => a.sort - b.sort);
290
- }
291
- const saveEvent = () => {
292
- let column = getColumn();
293
- column.title = gridOptions.form.title
294
- gridOptions.form.title = ''
295
- const uuid = require('uuid');
296
- const uniqueId = uuid.v4();
297
- column.field = uniqueId
298
- let rows = []
299
- let columns = JSON.parse(JSON.stringify(gridOptions.columns));
300
-
301
- let start = -1;
302
- // for (let i = 0; i < columns.length; i++) {
303
- // let row = columns[i];
304
- // if (row.params.all == true) {
305
- // row.params.disabled = true
306
- // row.params.parentField = column.field
307
- // rows.push(row)
308
- // columns.splice(i, 1)
309
- // if (start < i) {
310
- // start = i;
311
- // }
312
- // i = i - 1
313
- // }
314
- // }
315
- column.children = []
316
- gridOptions.hasAdd = true
317
- getSelectedColumn(columns, column);
318
- // column.children = rows
319
- // columns.splice(start, 0, column)
320
- gridOptions.columns = columns
321
- vexGridRef.value.loadColumn(columns)
322
- formShow.value = false
323
- showPopup.value = false
324
- clearCheckAll(gridOptions.columns)
325
- }
326
-
327
- function getSelectedColumn(columns, column) {
328
- for (let i = 0; i < columns.length; i++) {
329
- let row = columns[i];
330
- // 把子表头赋值给父表头
331
- if (row.params.all == true) {
332
- row.params.disabled = true
333
- row.params.all = false
334
- row.params.parentField = column.field
335
- column.children.push(row)
336
- // 删除表头信息
337
- columns.splice(i, 1)
338
- if (gridOptions.hasAdd) {
339
- gridOptions.hasAdd = false
340
- // 添加表头信息
341
- columns.splice(i, 0, column)
342
- }
343
- --i;
344
- }
345
- if (row.children) {
346
- getSelectedColumn(row.children, column)
347
- }
348
- }
349
- }
350
-
351
- function setColumn(columns) {
352
- if (!columns) {
353
- return
354
- }
355
- gridOptions.selectedColumns = []
356
- nextTick(() => {
357
- show.value = true;
358
- showPopup.value = false
359
- columns = JSON.parse(JSON.stringify(columns));
360
- // table_fixed
361
- columns = addColumnSlots(columns)
362
- gridOptions.columns = columns
363
- // arr = addColumnSlots(arr)
364
- // gridOptions.columns = arr
365
- //vexGridRef.value.loadColumn(gridOptions.columns)
366
- })
367
- }
368
-
369
- const addColumnSlots = (rows) => {
370
- let columns = []
371
- for (let row of rows) {
372
- if (row.visible == '0') {
373
- continue
374
- }
375
- if (row.fixed) {
376
- row.fixed = getDictLabelByValue('table_fixed', row.fixed)
377
- }
378
- row = Object.assign({}, getColumn(), row)
379
- row.minWidth = row.width
380
- columns.push(row)
381
- if (row.children) {
382
- row.tableField = undefined
383
- row.children = addColumnSlots(row.children)
384
- continue
385
- }
386
- }
387
- return columns
388
- }
389
- const getColumn = () => {
390
- return {
391
- params: {
392
- all: '0',
393
- disabled: false
394
- },
395
- slots: {
396
- header: 'checkedBox_header'
397
- }
398
- }
399
- }
400
- const checkBoxClick = (column) => {
401
- formShow.value = column.params.all
402
- gridOptions.selectedColumns = []
403
- setSelectedColumns(gridOptions.columns)
404
- }
405
- const setSelectedColumns = (columns) => {
406
- for (const row of columns) {
407
- if (row.params.all == true) {
408
- gridOptions.selectedColumns.push(row)
409
- }
410
- if (row.children) {
411
- setSelectedColumns(row.children)
412
- }
413
- }
414
- }
415
- const getDisabled = (val) => {
416
- if (val.params.all == true) {
417
- return true
418
- }
419
- return false;
420
- }
421
-
422
- const getDictLabelByValue = (dictCode, val) => {
423
- for (const option of dict.val(dictCode)) {
424
- if (option.value == val) {
425
- return option.label
426
- }
427
- }
428
- return val
429
- }
430
- //表格配置项
431
- const gridOptions = reactive({
432
- border: true,
433
- showHeaderOverflow: false,
434
- height: 0,
435
- align: "center",
436
- columnConfig: {
437
- resizable: true
438
- },
439
- toolbarConfig: {
440
- slots: {
441
- buttons: 'toolbar_buttons'
442
- }
443
- },
444
- selectedColumns: [],
445
- columns: [],
446
- data: [],
447
- form: {
448
- title: ''
449
- },
450
- curColumnIndex: 0,
451
- // 判断是否添加表头信息
452
- hasAdd: true,
453
- })
454
- onMounted(() => {
455
- setColumn()
456
- })
457
- // 对外暴露
458
- defineExpose({
459
- setColumn
460
- })
461
- </script>
462
- <style>
463
- .expand-wrapper {
464
- padding: 20px;
465
- }
466
-
467
- .test {
468
- padding: 80px;
469
- }
470
-
471
- .vxe-icon-edit, .vxe-icon-add, .vxe-icon-delete {
472
- margin: 5px;
473
- cursor: pointer
474
- }
475
- </style>