olp-table 5.3.7 → 5.5.1

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/{olp-table/olp-table.common.js → olp-table.common.js} +67 -67
  2. package/{olp-table/olp-table.umd.js → olp-table.umd.js} +67 -67
  3. package/{olp-table/olp-table.umd.min.js → olp-table.umd.min.js} +67 -67
  4. package/package.json +7 -87
  5. package/.env.build +0 -1
  6. package/.env.prod +0 -1
  7. package/README.md +0 -26
  8. package/babel.config.js +0 -5
  9. package/jsconfig.json +0 -22
  10. package/public/favicon.ico +0 -0
  11. package/public/index.html +0 -17
  12. package/rmMode.bat +0 -1
  13. package/src/App.vue +0 -199
  14. package/src/api/crud.js +0 -22
  15. package/src/api/dist.js +0 -6
  16. package/src/assets/iconfont/iconfont.css +0 -20
  17. package/src/assets/iconfont/iconfont.json +0 -16
  18. package/src/assets/iconfont/iconfont.ttf +0 -0
  19. package/src/assets/iconfont/iconfont.woff +0 -0
  20. package/src/assets/iconfont/iconfont.woff2 +0 -0
  21. package/src/assets/logo.png +0 -0
  22. package/src/components/auto-height/index.vue +0 -75
  23. package/src/components/codemirror-tag.vue +0 -100
  24. package/src/components/lazy-load-select.vue +0 -107
  25. package/src/components/ol-dialog-excel.vue +0 -112
  26. package/src/components/ol-dialog-import.vue +0 -304
  27. package/src/components/ol-dialog-json.vue +0 -83
  28. package/src/components/ol-dialog-table.vue +0 -81
  29. package/src/components/ol-dialog-upload-file.vue +0 -208
  30. package/src/components/ol-dict-tag.vue +0 -271
  31. package/src/components/ol-select-dom.vue +0 -71
  32. package/src/components/ol-table-filter.vue +0 -28
  33. package/src/components/ol-table-render.vue +0 -44
  34. package/src/components/ol-table-select.vue +0 -154
  35. package/src/components/pinia-init.vue +0 -18
  36. package/src/components/table/model/ModelMixins.js +0 -43
  37. package/src/components/table/model/model-index.vue +0 -124
  38. package/src/components/table/model/ot-left-right.vue +0 -18
  39. package/src/components/table/model/ot-left-tree-right-table.scss +0 -14
  40. package/src/components/table/model/ot-left-tree-right-table.vue +0 -41
  41. package/src/components/table/model/ot-top-1-bottom-2.vue +0 -39
  42. package/src/components/table/model/ot-top-2-bottom-1.vue +0 -38
  43. package/src/components/table/model/ot-top-2-bottom-2.vue +0 -38
  44. package/src/components/table/model/ot-top-bottom.vue +0 -18
  45. package/src/components/table/model/splitpanesModel.css +0 -22
  46. package/src/components/table/model/splitpanesModel.vue +0 -54
  47. package/src/components/table/ol-form/index.vue +0 -544
  48. package/src/components/table/ol-form-v3/index.vue +0 -455
  49. package/src/components/table/ol-main-form-sub-table/index.vue +0 -611
  50. package/src/components/table/ol-pager/index.vue +0 -46
  51. package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +0 -233
  52. package/src/components/table/ol-table/components/ol-table-column-config/index.vue +0 -145
  53. package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +0 -88
  54. package/src/components/table/ol-table/index.vue +0 -232
  55. package/src/components/table/ol-table-operate/index.vue +0 -61
  56. package/src/components/table/ol-table-search/index.vue +0 -17
  57. package/src/components/table/ol-table-tool-btn/index.vue +0 -60
  58. package/src/components/tree/components/o-tree.vue +0 -289
  59. package/src/components/tree/index.vue +0 -46
  60. package/src/components/v-component/index.vue +0 -43
  61. package/src/config/dev-config.js +0 -5
  62. package/src/config/prod-config.js +0 -5
  63. package/src/config/shared-config.js +0 -20
  64. package/src/data.js +0 -9378
  65. package/src/directives/permission/hasPermi.js +0 -63
  66. package/src/directives/permission/hasRole.js +0 -30
  67. package/src/main.js +0 -55
  68. package/src/mixins/VTMixin/DefaultMethods.js +0 -821
  69. package/src/mixins/VTMixin/OTMixinBody.js +0 -105
  70. package/src/mixins/VTMixin/OTMixinBodyFooter.js +0 -93
  71. package/src/mixins/VTMixin/OTMixinBodyMethods.js +0 -421
  72. package/src/mixins/VTMixin/OTMixinColumnMethod.js +0 -454
  73. package/src/mixins/VTMixin/OTMixinInitMethod.js +0 -130
  74. package/src/mixins/VTMixin/OTMixinPager.js +0 -38
  75. package/src/mixins/VTMixin/OTMixinSortable.js +0 -43
  76. package/src/mixins/VTMixin/index.js +0 -18
  77. package/src/package/index.js +0 -20
  78. package/src/plugins/axios.js +0 -61
  79. package/src/store/dict.js +0 -76
  80. package/src/store/dictType.js +0 -52
  81. package/src/store/permi.js +0 -45
  82. package/src/styles/common.scss +0 -37
  83. package/src/styles/index.scss +0 -48
  84. package/src/styles/theme.scss +0 -32
  85. package/src/utils/AESCRUDUtils.js +0 -87
  86. package/src/utils/DateUtils.js +0 -35
  87. package/src/utils/ExcelUtil.js +0 -159
  88. package/src/utils/TableSortUtil.js +0 -91
  89. package/src/utils/columnProp.js +0 -3
  90. package/src/utils/groupCompute.js +0 -68
  91. package/src/utils/http/httpFactory.js +0 -92
  92. package/src/utils/http/httpFactory2.js +0 -79
  93. package/src/utils/http/httpUtil.js +0 -123
  94. package/src/utils/http/httpUtils.js +0 -38
  95. package/src/utils/loadStyle.js +0 -14
  96. package/src/utils/message.js +0 -56
  97. package/src/utils/object.js +0 -80
  98. package/src/utils/security/TokenUtil.js +0 -19
  99. package/src/utils/tree.js +0 -54
  100. package/src/utils/util.js +0 -127
  101. package/src/views/Test/index.vue +0 -77
  102. package/src/views/Test/index2.vue +0 -33
  103. package/src/views/components/btn-config/index.vue +0 -202
  104. package/src/views/components/option-config/index.vue +0 -192
  105. package/src/views/db/chineseToEnglish.vue +0 -127
  106. package/src/views/db/filed.vue +0 -395
  107. package/src/views/db/index.vue +0 -192
  108. package/src/views/db/preview/index.vue +0 -139
  109. package/src/views/db/preview/left.vue +0 -204
  110. package/src/views/db/preview/right.vue +0 -466
  111. package/src/views/groupTable/index.vue +0 -137
  112. package/src/views/groupTable/ol-table-column-config/columnIndex.vue +0 -194
  113. package/src/views/groupTable/ol-table-column-config/index.vue +0 -92
  114. package/src/views/table/add-or-edit/config/base-config/index.vue +0 -539
  115. package/src/views/table/add-or-edit/config/base-config/table-form.vue +0 -333
  116. package/src/views/table/add-or-edit/config/column-config/header-config.vue +0 -475
  117. package/src/views/table/add-or-edit/config/column-config/index.vue +0 -790
  118. package/src/views/table/add-or-edit/config/data/column.js +0 -218
  119. package/src/views/table/add-or-edit/config/data/crud.js +0 -122
  120. package/src/views/table/add-or-edit/config/data/events.js +0 -109
  121. package/src/views/table/add-or-edit/config/data/method.js +0 -127
  122. package/src/views/table/add-or-edit/config/data/option.js +0 -725
  123. package/src/views/table/add-or-edit/config/data/page.js +0 -79
  124. package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +0 -42
  125. package/src/views/table/add-or-edit/config/field-config/index.vue +0 -91
  126. package/src/views/table/add-or-edit/config/form-config/index.vue +0 -1180
  127. package/src/views/table/add-or-edit/config/index.vue +0 -377
  128. package/src/views/table/add-or-edit/config/initFormObject.js +0 -25
  129. package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +0 -71
  130. package/src/views/table/add-or-edit/config/script-config/index.vue +0 -70
  131. package/src/views/table/add-or-edit/config/table-config/btn-config.vue +0 -340
  132. package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +0 -132
  133. package/src/views/table/add-or-edit/config/table-config/index.vue +0 -446
  134. package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +0 -41
  135. package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +0 -74
  136. package/src/views/table/add-or-edit/configOld/dataTags/index.vue +0 -439
  137. package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +0 -79
  138. package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +0 -74
  139. package/src/views/table/add-or-edit/configOld/index.vue +0 -127
  140. package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +0 -5
  141. package/src/views/table/add-or-edit/configOld/tableTags/index.vue +0 -353
  142. package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +0 -75
  143. package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +0 -92
  144. package/src/views/table/add-or-edit/index.vue +0 -201
  145. package/src/views/table/add-or-edit/themeModel/index.vue +0 -53
  146. package/src/views/table/add-or-edit/themeModel/init-model-table.vue +0 -48
  147. package/src/views/table/add-or-edit/themeModel/init-model.vue +0 -81
  148. package/src/views/table/add-or-edit/themeModel/left-right.vue +0 -24
  149. package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +0 -75
  150. package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +0 -42
  151. package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +0 -49
  152. package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +0 -29
  153. package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +0 -32
  154. package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +0 -32
  155. package/src/views/table/add-or-edit/themeModel/top-bottom.vue +0 -14
  156. package/src/views/table/index.vue +0 -43
  157. package/src/views/table/index2.vue +0 -199
  158. package/src/views/table/preview/index.vue +0 -29
  159. package/src/views/tree/components/config-core-data.vue +0 -85
  160. package/src/views/tree/components/config-core-table.vue +0 -362
  161. package/src/views/tree/components/config-core-tree/data/events.js +0 -95
  162. package/src/views/tree/components/config-core-tree/data/option.js +0 -88
  163. package/src/views/tree/components/config-core-tree/data/prop.js +0 -28
  164. package/src/views/tree/components/config-core-tree/index.vue +0 -181
  165. package/src/views/tree/components/config-core.vue +0 -42
  166. package/src/views/tree/components/form-config/index.vue +0 -967
  167. package/src/views/tree/index.vue +0 -424
  168. package/vue.config.js +0 -44
  169. /package/{olp-table/demo.html → demo.html} +0 -0
  170. /package/{olp-table/fonts → fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
  171. /package/{olp-table/fonts → fonts}/iconfont.1720006583309.947a27f0.ttf +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>