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.
- package/package.json +12 -92
- package/.env.build +0 -1
- package/README.md +0 -26
- package/babel.config.js +0 -5
- package/jsconfig.json +0 -22
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/rmMode.bat +0 -1
- package/src/App.vue +0 -199
- package/src/api/crud.js +0 -22
- package/src/api/dist.js +0 -6
- package/src/assets/iconfont/iconfont.css +0 -20
- package/src/assets/iconfont/iconfont.json +0 -16
- package/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/assets/iconfont/iconfont.woff +0 -0
- package/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/auto-height/index.vue +0 -75
- package/src/components/codemirror-tag.vue +0 -100
- package/src/components/lazy-load-select.vue +0 -107
- package/src/components/ol-dialog-excel.vue +0 -112
- package/src/components/ol-dialog-import.vue +0 -304
- package/src/components/ol-dialog-json.vue +0 -82
- package/src/components/ol-dialog-table.vue +0 -81
- package/src/components/ol-dialog-upload-file.vue +0 -208
- package/src/components/ol-dict-tag.vue +0 -271
- package/src/components/ol-select-dom.vue +0 -71
- package/src/components/ol-table-filter.vue +0 -28
- package/src/components/ol-table-render.vue +0 -44
- package/src/components/ol-table-select.vue +0 -150
- package/src/components/pinia-init.vue +0 -18
- package/src/components/table/model/ModelMixins.js +0 -43
- package/src/components/table/model/model-index.vue +0 -121
- package/src/components/table/model/ot-left-right.vue +0 -18
- package/src/components/table/model/ot-left-tree-right-table.scss +0 -14
- package/src/components/table/model/ot-left-tree-right-table.vue +0 -41
- package/src/components/table/model/ot-top-1-bottom-2.vue +0 -39
- package/src/components/table/model/ot-top-2-bottom-1.vue +0 -38
- package/src/components/table/model/ot-top-2-bottom-2.vue +0 -38
- package/src/components/table/model/ot-top-bottom.vue +0 -18
- package/src/components/table/model/splitpanesModel.css +0 -22
- package/src/components/table/model/splitpanesModel.vue +0 -54
- package/src/components/table/ol-form/index.vue +0 -537
- package/src/components/table/ol-form-v3/index.vue +0 -455
- package/src/components/table/ol-main-form-sub-table/index.vue +0 -601
- package/src/components/table/ol-pager/index.vue +0 -46
- package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +0 -233
- package/src/components/table/ol-table/components/ol-table-column-config/index.vue +0 -145
- package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +0 -88
- package/src/components/table/ol-table/index.vue +0 -232
- package/src/components/table/ol-table-operate/index.vue +0 -61
- package/src/components/table/ol-table-search/index.vue +0 -17
- package/src/components/table/ol-table-tool-btn/index.vue +0 -60
- package/src/components/tree/components/o-tree.vue +0 -289
- package/src/components/tree/index.vue +0 -46
- package/src/components/v-component/index.vue +0 -43
- package/src/config/dev-config.js +0 -5
- package/src/config/prod-config.js +0 -5
- package/src/config/shared-config.js +0 -20
- package/src/data.js +0 -9378
- package/src/directives/permission/hasPermi.js +0 -63
- package/src/directives/permission/hasRole.js +0 -30
- package/src/main.js +0 -55
- package/src/mixins/VTMixin/DefaultMethods.js +0 -749
- package/src/mixins/VTMixin/OTMixinBody.js +0 -105
- package/src/mixins/VTMixin/OTMixinBodyFooter.js +0 -93
- package/src/mixins/VTMixin/OTMixinBodyMethods.js +0 -420
- package/src/mixins/VTMixin/OTMixinColumnMethod.js +0 -450
- package/src/mixins/VTMixin/OTMixinInitMethod.js +0 -130
- package/src/mixins/VTMixin/OTMixinPager.js +0 -38
- package/src/mixins/VTMixin/OTMixinSortable.js +0 -43
- package/src/mixins/VTMixin/index.js +0 -18
- package/src/package/index.js +0 -20
- package/src/plugins/axios.js +0 -61
- package/src/store/dict.js +0 -76
- package/src/store/dictType.js +0 -52
- package/src/store/permi.js +0 -45
- package/src/styles/common.scss +0 -37
- package/src/styles/index.scss +0 -48
- package/src/styles/theme.scss +0 -32
- package/src/utils/AESCRUDUtils.js +0 -87
- package/src/utils/DateUtils.js +0 -35
- package/src/utils/ExcelUtil.js +0 -159
- package/src/utils/TableSortUtil.js +0 -91
- package/src/utils/columnProp.js +0 -3
- package/src/utils/groupCompute.js +0 -68
- package/src/utils/http/httpFactory.js +0 -92
- package/src/utils/http/httpFactory2.js +0 -79
- package/src/utils/http/httpUtil.js +0 -123
- package/src/utils/http/httpUtils.js +0 -38
- package/src/utils/loadStyle.js +0 -14
- package/src/utils/message.js +0 -56
- package/src/utils/object.js +0 -80
- package/src/utils/security/TokenUtil.js +0 -19
- package/src/utils/tree.js +0 -54
- package/src/utils/util.js +0 -127
- package/src/views/Test/index.vue +0 -77
- package/src/views/Test/index2.vue +0 -33
- package/src/views/components/btn-config/index.vue +0 -202
- package/src/views/components/option-config/index.vue +0 -192
- package/src/views/db/chineseToEnglish.vue +0 -127
- package/src/views/db/filed.vue +0 -395
- package/src/views/db/index.vue +0 -192
- package/src/views/db/preview/index.vue +0 -139
- package/src/views/db/preview/left.vue +0 -204
- package/src/views/db/preview/right.vue +0 -466
- package/src/views/groupTable/index.vue +0 -137
- package/src/views/groupTable/ol-table-column-config/columnIndex.vue +0 -194
- package/src/views/groupTable/ol-table-column-config/index.vue +0 -92
- package/src/views/table/add-or-edit/config/base-config/index.vue +0 -539
- package/src/views/table/add-or-edit/config/base-config/table-form.vue +0 -333
- package/src/views/table/add-or-edit/config/column-config/header-config.vue +0 -475
- package/src/views/table/add-or-edit/config/column-config/index.vue +0 -790
- package/src/views/table/add-or-edit/config/data/column.js +0 -218
- package/src/views/table/add-or-edit/config/data/crud.js +0 -122
- package/src/views/table/add-or-edit/config/data/events.js +0 -109
- package/src/views/table/add-or-edit/config/data/method.js +0 -127
- package/src/views/table/add-or-edit/config/data/option.js +0 -725
- package/src/views/table/add-or-edit/config/data/page.js +0 -79
- package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +0 -42
- package/src/views/table/add-or-edit/config/field-config/index.vue +0 -91
- package/src/views/table/add-or-edit/config/form-config/index.vue +0 -1179
- package/src/views/table/add-or-edit/config/index.vue +0 -376
- package/src/views/table/add-or-edit/config/initFormObject.js +0 -25
- package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +0 -71
- package/src/views/table/add-or-edit/config/script-config/index.vue +0 -70
- package/src/views/table/add-or-edit/config/table-config/btn-config.vue +0 -340
- package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +0 -132
- package/src/views/table/add-or-edit/config/table-config/index.vue +0 -446
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +0 -41
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +0 -74
- package/src/views/table/add-or-edit/configOld/dataTags/index.vue +0 -439
- package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +0 -79
- package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +0 -74
- package/src/views/table/add-or-edit/configOld/index.vue +0 -127
- package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +0 -5
- package/src/views/table/add-or-edit/configOld/tableTags/index.vue +0 -353
- package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +0 -75
- package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +0 -92
- package/src/views/table/add-or-edit/index.vue +0 -201
- package/src/views/table/add-or-edit/themeModel/index.vue +0 -53
- package/src/views/table/add-or-edit/themeModel/init-model-table.vue +0 -48
- package/src/views/table/add-or-edit/themeModel/init-model.vue +0 -81
- package/src/views/table/add-or-edit/themeModel/left-right.vue +0 -24
- package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +0 -75
- package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +0 -42
- package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +0 -49
- package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +0 -29
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +0 -32
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +0 -32
- package/src/views/table/add-or-edit/themeModel/top-bottom.vue +0 -14
- package/src/views/table/index.vue +0 -43
- package/src/views/table/index2.vue +0 -199
- package/src/views/table/preview/index.vue +0 -29
- package/src/views/tree/components/config-core-data.vue +0 -85
- package/src/views/tree/components/config-core-table.vue +0 -362
- package/src/views/tree/components/config-core-tree/data/events.js +0 -95
- package/src/views/tree/components/config-core-tree/data/option.js +0 -88
- package/src/views/tree/components/config-core-tree/data/prop.js +0 -28
- package/src/views/tree/components/config-core-tree/index.vue +0 -181
- package/src/views/tree/components/config-core.vue +0 -42
- package/src/views/tree/components/form-config/index.vue +0 -967
- package/src/views/tree/index.vue +0 -424
- package/vue.config.js +0 -44
- /package/{olp-table/demo.html → demo.html} +0 -0
- /package/{olp-table/fonts → fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
- /package/{olp-table/fonts → fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
- /package/{olp-table/olp-table.common.js → olp-table.common.js} +0 -0
- /package/{olp-table/olp-table.css → olp-table.css} +0 -0
- /package/{olp-table/olp-table.umd.js → olp-table.umd.js} +0 -0
- /package/{olp-table/olp-table.umd.min.js → olp-table.umd.min.js} +0 -0
|
@@ -1,446 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-divider content-position="left">常用属性</el-divider>
|
|
4
|
-
<!-- <avue-form v-if="configDataSource.show" v-model="configData.form" :option="options">-->
|
|
5
|
-
<!-- </avue-form>-->
|
|
6
|
-
<table-form v-if="configDataSource.show" :formData="configData.form"></table-form>
|
|
7
|
-
<el-divider content-position="left">详细配置</el-divider>
|
|
8
|
-
<el-tabs
|
|
9
|
-
v-model="activeName"
|
|
10
|
-
type="card"
|
|
11
|
-
>
|
|
12
|
-
<el-tab-pane lazy label="Option" name="Option">
|
|
13
|
-
<OptionConfig :data-source="Option" :default-data="configData.form.tableObj"></OptionConfig>
|
|
14
|
-
</el-tab-pane>
|
|
15
|
-
<el-tab-pane lazy v-if="configData.form.paging == 1" label="Page" name="page">
|
|
16
|
-
<OptionConfig :data-source="Page"
|
|
17
|
-
:default-data="configData.form.optionObj.pagination"></OptionConfig>
|
|
18
|
-
</el-tab-pane>
|
|
19
|
-
<el-tab-pane lazy label="Events" name="events">
|
|
20
|
-
<OptionConfig :data-source="Events" :default-data="configData.form.optionObj.events"></OptionConfig>
|
|
21
|
-
</el-tab-pane>
|
|
22
|
-
<el-tab-pane lazy label="左工具按钮" name="toolbarBtn">
|
|
23
|
-
<btn-config ref="toolButOptions" alignMode="left" type="toolButOptions"/>
|
|
24
|
-
</el-tab-pane>
|
|
25
|
-
<el-tab-pane lazy label="操作按钮" name="actionbarBtn">
|
|
26
|
-
<btn-config ref="operationButOptions" type="operationButOptions"/>
|
|
27
|
-
</el-tab-pane>
|
|
28
|
-
|
|
29
|
-
<el-tab-pane lazy label="右工具按钮" name="righttoolbarBtn">
|
|
30
|
-
<btn-config ref="toolButOptions" alignMode="right" type="toolButOptions"/>
|
|
31
|
-
</el-tab-pane>
|
|
32
|
-
</el-tabs>
|
|
33
|
-
</div>
|
|
34
|
-
</template>
|
|
35
|
-
<script>
|
|
36
|
-
export default {
|
|
37
|
-
name: 'TableConfig'
|
|
38
|
-
}
|
|
39
|
-
</script>
|
|
40
|
-
<script setup>
|
|
41
|
-
import events from "@/views/table/add-or-edit/config/data/events";
|
|
42
|
-
import page from "@/views/table/add-or-edit/config/data/page";
|
|
43
|
-
import option from "@/views/table/add-or-edit/config/data/option";
|
|
44
|
-
import OptionConfig from "@/views/components/option-config/index.vue";
|
|
45
|
-
import {inject, reactive, ref, defineExpose, defineEmits, nextTick, provide} from "vue";
|
|
46
|
-
import BtnConfig from "@/views/table/add-or-edit/config/table-config/btn-config.vue";
|
|
47
|
-
import tableForm from '@/views/table/add-or-edit/config/base-config/table-form.vue'
|
|
48
|
-
|
|
49
|
-
const configData = inject("configData")
|
|
50
|
-
provide('updateBtn', updateBtn)
|
|
51
|
-
const configDataSource = reactive({
|
|
52
|
-
toolButConfig: [],
|
|
53
|
-
operationButConfig: [],
|
|
54
|
-
show: false,
|
|
55
|
-
columns: [],
|
|
56
|
-
})
|
|
57
|
-
const options = reactive({
|
|
58
|
-
menuBtn: false,
|
|
59
|
-
gutter: 20,
|
|
60
|
-
labelWidth: 100,
|
|
61
|
-
labelPosition: 'right',
|
|
62
|
-
column: [
|
|
63
|
-
{
|
|
64
|
-
label: '分页',
|
|
65
|
-
type: 'switch',
|
|
66
|
-
prop: 'paging',
|
|
67
|
-
dicData: [{
|
|
68
|
-
value: '0'
|
|
69
|
-
}, {
|
|
70
|
-
value: '1'
|
|
71
|
-
}],
|
|
72
|
-
activeIcon: "el-icon-check",
|
|
73
|
-
inactiveIcon: "el-icon-close",
|
|
74
|
-
span: 3
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
label: '序号',
|
|
78
|
-
type: 'switch',
|
|
79
|
-
dicData: [{
|
|
80
|
-
value: '0'
|
|
81
|
-
}, {
|
|
82
|
-
value: '1'
|
|
83
|
-
}],
|
|
84
|
-
prop: 'seq',
|
|
85
|
-
activeIcon: "el-icon-check",
|
|
86
|
-
inactiveIcon: "el-icon-close",
|
|
87
|
-
value: true,
|
|
88
|
-
span: 3
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
label: '表格选择框',
|
|
92
|
-
type: 'radio',
|
|
93
|
-
prop: 'selectBox',
|
|
94
|
-
border: true,
|
|
95
|
-
span: 6,
|
|
96
|
-
dicData: [
|
|
97
|
-
{
|
|
98
|
-
label: '多选',
|
|
99
|
-
value: '2',
|
|
100
|
-
}, {
|
|
101
|
-
label: '单选',
|
|
102
|
-
value: '1'
|
|
103
|
-
}, {
|
|
104
|
-
label: '无',
|
|
105
|
-
value: '0'
|
|
106
|
-
}]
|
|
107
|
-
}, {
|
|
108
|
-
label: '工具栏按钮',
|
|
109
|
-
type: 'checkbox',
|
|
110
|
-
prop: 'toolBut',
|
|
111
|
-
border: true,
|
|
112
|
-
labelPosition: 'right',
|
|
113
|
-
span: 7,
|
|
114
|
-
props: {
|
|
115
|
-
label: 'name',
|
|
116
|
-
value: 'code',
|
|
117
|
-
},
|
|
118
|
-
onChange: () => {
|
|
119
|
-
nextTick(() => {
|
|
120
|
-
updateBtn('toolBut')
|
|
121
|
-
})
|
|
122
|
-
},
|
|
123
|
-
dicData: configDataSource.toolButConfig
|
|
124
|
-
}, {
|
|
125
|
-
label: '表格操作栏',
|
|
126
|
-
type: 'checkbox',
|
|
127
|
-
prop: 'operationBut',
|
|
128
|
-
border: true,
|
|
129
|
-
props: {
|
|
130
|
-
label: 'name',
|
|
131
|
-
value: 'code',
|
|
132
|
-
},
|
|
133
|
-
onChange: () => {
|
|
134
|
-
nextTick(() => {
|
|
135
|
-
updateBtn('operationBut')
|
|
136
|
-
})
|
|
137
|
-
},
|
|
138
|
-
span: 5,
|
|
139
|
-
dicData: configDataSource.operationButConfig
|
|
140
|
-
}, {
|
|
141
|
-
label: '首次自动查询',
|
|
142
|
-
type: 'switch',
|
|
143
|
-
prop: 'init',
|
|
144
|
-
dicData: [{
|
|
145
|
-
value: '0'
|
|
146
|
-
}, {
|
|
147
|
-
value: '1'
|
|
148
|
-
}],
|
|
149
|
-
span: 3,
|
|
150
|
-
activeIcon: "el-icon-check",
|
|
151
|
-
inactiveIcon: "el-icon-close"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
label: '树表',
|
|
155
|
-
type: 'switch',
|
|
156
|
-
prop: 'tree',
|
|
157
|
-
dicData: [{
|
|
158
|
-
value: '0'
|
|
159
|
-
}, {
|
|
160
|
-
value: '1'
|
|
161
|
-
}],
|
|
162
|
-
span: 3,
|
|
163
|
-
activeIcon: "el-icon-check",
|
|
164
|
-
inactiveIcon: "el-icon-close",
|
|
165
|
-
onChange: ({value}) => {
|
|
166
|
-
for (let column of options.column) {
|
|
167
|
-
if (['lazy', 'treeId', 'treeParentId', 'openColumn'].indexOf(column.prop) != -1) {
|
|
168
|
-
column.display = value == 1;
|
|
169
|
-
if (value == 1) {
|
|
170
|
-
initColumn()
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
/* {
|
|
177
|
-
label: 'lazy',
|
|
178
|
-
type: 'switch',
|
|
179
|
-
prop: 'lazy',
|
|
180
|
-
display: false,
|
|
181
|
-
activeIcon: "el-icon-check",
|
|
182
|
-
inactiveIcon: "el-icon-close",
|
|
183
|
-
inlinePrompt: true,
|
|
184
|
-
dicData: [{
|
|
185
|
-
value: '0'
|
|
186
|
-
}, {
|
|
187
|
-
value: '1'
|
|
188
|
-
}],
|
|
189
|
-
span: 3,
|
|
190
|
-
value: false,
|
|
191
|
-
onChange: ({value}) => {
|
|
192
|
-
for (let column of options.column) {
|
|
193
|
-
if (['lazyFunction'].indexOf(column.prop) != -1) {
|
|
194
|
-
column.display = value;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
},*/
|
|
199
|
-
{
|
|
200
|
-
label: '树ID',
|
|
201
|
-
prop: 'treeId',
|
|
202
|
-
type: 'select',
|
|
203
|
-
props: {
|
|
204
|
-
label: 'title',
|
|
205
|
-
value: 'field'
|
|
206
|
-
},
|
|
207
|
-
onFocus: initColumn,
|
|
208
|
-
display: false,
|
|
209
|
-
onChange: initColumn,
|
|
210
|
-
span: 5,
|
|
211
|
-
dicData: configDataSource.columns,
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
label: '树列父ID',
|
|
215
|
-
prop: 'treeParentId',
|
|
216
|
-
type: 'select',
|
|
217
|
-
props: {
|
|
218
|
-
label: 'title',
|
|
219
|
-
value: 'field'
|
|
220
|
-
},
|
|
221
|
-
display: false,
|
|
222
|
-
onFocus: initColumn,
|
|
223
|
-
dicData: configDataSource.columns,
|
|
224
|
-
span: 5,
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: '展开列',
|
|
228
|
-
prop: 'openColumn',
|
|
229
|
-
type: 'select',
|
|
230
|
-
display: false,
|
|
231
|
-
props: {
|
|
232
|
-
label: 'title',
|
|
233
|
-
value: 'field'
|
|
234
|
-
},
|
|
235
|
-
onFocus: initColumn,
|
|
236
|
-
dicData: configDataSource.columns,
|
|
237
|
-
span: 5,
|
|
238
|
-
},
|
|
239
|
-
/* {
|
|
240
|
-
label: 'lazy回调',
|
|
241
|
-
prop: 'lazyFunction',
|
|
242
|
-
type: 'input',
|
|
243
|
-
display: false,
|
|
244
|
-
span: 6,
|
|
245
|
-
},*/
|
|
246
|
-
]
|
|
247
|
-
})
|
|
248
|
-
|
|
249
|
-
const activeName = ref("Option");
|
|
250
|
-
const toolButOptions = ref();
|
|
251
|
-
const operationButOptions = ref();
|
|
252
|
-
const Page = reactive(JSON.parse(JSON.stringify(page)));
|
|
253
|
-
const Option = reactive(JSON.parse(JSON.stringify(option)));
|
|
254
|
-
const Events = reactive(JSON.parse(JSON.stringify(events)));
|
|
255
|
-
|
|
256
|
-
function initColumn(c) {
|
|
257
|
-
configDataSource.columns.length = 0
|
|
258
|
-
for (let column of JSON.parse(JSON.stringify(configData.tableColumn))) {
|
|
259
|
-
configDataSource.columns.push(column)
|
|
260
|
-
}
|
|
261
|
-
if (c && !configData.form['openColumn']) {
|
|
262
|
-
nextTick(() => {
|
|
263
|
-
configData.form['openColumn'] = configData.form['treeId']
|
|
264
|
-
})
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
function updateBtn(type) {
|
|
269
|
-
if (!configData.form[type + 'Options']) {
|
|
270
|
-
return
|
|
271
|
-
}
|
|
272
|
-
var formElement = configData.form[type + 'Options'];
|
|
273
|
-
//删除
|
|
274
|
-
for (let i = formElement.length - 1; i >= 0; i--) {
|
|
275
|
-
let o = formElement[i];
|
|
276
|
-
if (configData.form[type].indexOf(o.code) == -1) {
|
|
277
|
-
formElement.splice(i, 1)
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
let key = formElement.map(item => item.code);
|
|
281
|
-
|
|
282
|
-
//新增
|
|
283
|
-
for (const o of configData[type + 'Config']) {
|
|
284
|
-
if (key.indexOf(o.code) == -1 && configData.form[type].indexOf(o.code) != -1) {
|
|
285
|
-
configData.form[type + 'Options'].push(o);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
if (type == 'toolBut' && toolButOptions.value) {
|
|
289
|
-
toolButOptions.value.loadData();
|
|
290
|
-
} else if (operationButOptions.value) {
|
|
291
|
-
operationButOptions.value.loadData();
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
const emits = defineEmits(['tableConfigChange'])
|
|
296
|
-
//
|
|
297
|
-
const buildJson = (data, defaultOption) => {
|
|
298
|
-
if (defaultOption == null) {
|
|
299
|
-
defaultOption = {}
|
|
300
|
-
}
|
|
301
|
-
let buildOption = defaultOption
|
|
302
|
-
for (let op of data) {
|
|
303
|
-
if (op.value != undefined) {
|
|
304
|
-
let prop = op.t1
|
|
305
|
-
if (op.redirect != null) {
|
|
306
|
-
prop = op.redirect
|
|
307
|
-
}
|
|
308
|
-
let subs = prop.split(".");
|
|
309
|
-
let parent = buildOption;
|
|
310
|
-
for (let i = 0; i < subs.length; i++) {
|
|
311
|
-
if (i < subs.length - 1) {
|
|
312
|
-
if (parent[subs[i]] == null) parent[subs[i]] = {}
|
|
313
|
-
parent = parent[subs[i]]
|
|
314
|
-
} else if (i >= subs.length - 1) {
|
|
315
|
-
if (op.value && (op.t3 == "string[]" || op.t3 == "number[]") && !(op.value instanceof Array)) {
|
|
316
|
-
op.value = op.value.replaceAll("'", '"')
|
|
317
|
-
op.value = JSON.parse(op.value)
|
|
318
|
-
}
|
|
319
|
-
if (op.t3 == 'function') {
|
|
320
|
-
if (op.value && op.value.toString().trim() != 0) {
|
|
321
|
-
parent[subs[i]] = {
|
|
322
|
-
code: op.value,
|
|
323
|
-
flag: "flag##function#",
|
|
324
|
-
isFunction: true
|
|
325
|
-
}
|
|
326
|
-
} else {
|
|
327
|
-
delete parent[subs[i]]
|
|
328
|
-
}
|
|
329
|
-
} else {
|
|
330
|
-
parent[subs[i]] = op.value
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return buildOption
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const getOptions = () => {
|
|
341
|
-
let buildOption = {}
|
|
342
|
-
buildOption.table = buildJson(Option, configData.form.optionObj.tableObj)
|
|
343
|
-
buildOption.pagination = buildJson(Page, configData.form.optionObj.pagination)
|
|
344
|
-
if (buildOption.pagination.pageSizes) {
|
|
345
|
-
let pageSizes = JSON.parse(JSON.stringify(buildOption.pagination.pageSizes));
|
|
346
|
-
buildOption.pagination.pageSize = pageSizes[0]
|
|
347
|
-
}
|
|
348
|
-
buildOption.events = buildJson(Events, configData.form.optionObj.events)
|
|
349
|
-
return buildOption
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
const copyParams = (option, data) => {
|
|
354
|
-
for (let item in option) {
|
|
355
|
-
let obj = option[item];
|
|
356
|
-
let sub = data[item]
|
|
357
|
-
if (obj instanceof Object && obj.isFunction && obj.flag == "flag##function#") {
|
|
358
|
-
data[item] = (params) => {
|
|
359
|
-
let fun = null
|
|
360
|
-
eval("fun = (params) => {" + obj.code + "}")
|
|
361
|
-
return fun(params)
|
|
362
|
-
}
|
|
363
|
-
continue
|
|
364
|
-
}
|
|
365
|
-
if (sub == null || sub == undefined) {
|
|
366
|
-
data[item] = obj
|
|
367
|
-
continue
|
|
368
|
-
}
|
|
369
|
-
if (obj instanceof Object && sub instanceof Object) {
|
|
370
|
-
copyParams(obj, sub)
|
|
371
|
-
} else {
|
|
372
|
-
data[item] = obj
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
// 初始化数据
|
|
379
|
-
const initData = (data, defaultData) => {
|
|
380
|
-
if (!defaultData) {
|
|
381
|
-
defaultData = {}
|
|
382
|
-
}
|
|
383
|
-
let defMap = parseRedirectObj(defaultData)
|
|
384
|
-
for (let item of data) {
|
|
385
|
-
let obj = defMap[item.redirect ? item.redirect : item.t1];
|
|
386
|
-
if (obj instanceof Array) {
|
|
387
|
-
obj = JSON.stringify(obj)
|
|
388
|
-
}
|
|
389
|
-
if (obj != null && !(obj instanceof Object)) {
|
|
390
|
-
item.value = obj
|
|
391
|
-
} else if (item.t5 != "-" && item.t3 != 'function') {
|
|
392
|
-
item.value = item.t5
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
function setData() {
|
|
398
|
-
configDataSource.show = false;
|
|
399
|
-
configDataSource.toolButConfig.length = 0;
|
|
400
|
-
for (const o of configData.toolButConfig) {
|
|
401
|
-
configDataSource.toolButConfig.push(o);
|
|
402
|
-
}
|
|
403
|
-
configDataSource.operationButConfig.length = 0;
|
|
404
|
-
for (const o of configData.operationButConfig) {
|
|
405
|
-
configDataSource.operationButConfig.push(o);
|
|
406
|
-
}
|
|
407
|
-
nextTick(() => {
|
|
408
|
-
configDataSource.show = true;
|
|
409
|
-
initData(Option, configData.form.tableObj)
|
|
410
|
-
initData(Page, configData.form.optionObj.pagination)
|
|
411
|
-
initData(Events, configData.form.optionObj.events)
|
|
412
|
-
updateBtn('toolBut')
|
|
413
|
-
updateBtn('operationBut')
|
|
414
|
-
})
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
// 平铺对象
|
|
418
|
-
const parseRedirectObj = (data, map, parent) => {
|
|
419
|
-
if (!map) map = {}
|
|
420
|
-
if (!parent) parent = ""
|
|
421
|
-
for (let key in data) {
|
|
422
|
-
let path = parent
|
|
423
|
-
if (parent != "") {
|
|
424
|
-
path = parent + "." + key
|
|
425
|
-
} else {
|
|
426
|
-
path = key
|
|
427
|
-
}
|
|
428
|
-
let obj = data[key]
|
|
429
|
-
if (obj instanceof Object) {
|
|
430
|
-
if (obj.isFunction && obj.flag == "flag##function#") {
|
|
431
|
-
map[path] = obj.code
|
|
432
|
-
continue
|
|
433
|
-
}
|
|
434
|
-
parseRedirectObj(obj, map, path)
|
|
435
|
-
} else {
|
|
436
|
-
map[path] = obj
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
return map
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
defineExpose({
|
|
444
|
-
getOptions, setData
|
|
445
|
-
})
|
|
446
|
-
</script>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div style="padding: 15px;flex: 1">
|
|
3
|
-
<h4 style="text-align: center">{{obj.joinTable}}({{obj.index}}-{{obj.type}})</h4>
|
|
4
|
-
<vxe-table height="300px" border :data="state.tableData" :stripe="true" size="small">
|
|
5
|
-
<vxe-column type="seq" title="序号" width="60" align="center"/>
|
|
6
|
-
<vxe-column field="checked" title="查询" width="60" align="center">
|
|
7
|
-
<template #default="scope">
|
|
8
|
-
<vxe-checkbox v-model="scope.row.checked" checked-value="1" @change="updateChecked(scope.row)" unchecked-value="0"></vxe-checkbox>
|
|
9
|
-
</template>
|
|
10
|
-
</vxe-column>
|
|
11
|
-
<vxe-column field="column_name" title="字段" align="center" show-overflow/>
|
|
12
|
-
<vxe-column field="column_comment" title="描述" align="center" show-overflow/>
|
|
13
|
-
</vxe-table>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
<script>
|
|
17
|
-
import {reactive, ref} from "vue";
|
|
18
|
-
export default {
|
|
19
|
-
name:'filedConfigTableModel',
|
|
20
|
-
props:{
|
|
21
|
-
item:{}
|
|
22
|
-
},
|
|
23
|
-
setup(prop) {
|
|
24
|
-
const dialogVisible = ref(true);
|
|
25
|
-
const state = reactive({
|
|
26
|
-
tableData:prop.item.columnList,
|
|
27
|
-
})
|
|
28
|
-
const obj = prop.item;
|
|
29
|
-
function updateChecked(e){
|
|
30
|
-
if (e.checked == 1) {
|
|
31
|
-
e.visible = '1';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return {dialogVisible,state,obj,updateChecked}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
</script>
|
|
39
|
-
<style lang="less">
|
|
40
|
-
|
|
41
|
-
</style>
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog
|
|
3
|
-
v-model="dialogVisible"
|
|
4
|
-
:show-close="false"
|
|
5
|
-
title="字段配置"
|
|
6
|
-
width="800px"
|
|
7
|
-
resize
|
|
8
|
-
:overflow="true"
|
|
9
|
-
:before-hide-method="handleClose" showFooter>
|
|
10
|
-
<el-scrollbar>
|
|
11
|
-
<div style="display: flex;" v-if="dialogVisible">
|
|
12
|
-
<filed-config-table-model class="content-box" v-for="(item,index) in state.columnList" :ref="setItemRef" :item="item" style="min-width: 400px"/>
|
|
13
|
-
</div>
|
|
14
|
-
</el-scrollbar>
|
|
15
|
-
<template #footer>
|
|
16
|
-
<span>
|
|
17
|
-
<vxe-button @click="handleClose">取消</vxe-button>
|
|
18
|
-
<vxe-button status="primary" @click="handleClose(true)">保存</vxe-button>
|
|
19
|
-
</span>
|
|
20
|
-
</template>
|
|
21
|
-
</el-dialog>
|
|
22
|
-
</template>
|
|
23
|
-
<script>
|
|
24
|
-
import {onBeforeUpdate, reactive, ref, toRaw} from "vue";
|
|
25
|
-
import filedConfigTableModel from "./filed-config-table-model"
|
|
26
|
-
|
|
27
|
-
export default {
|
|
28
|
-
components: {filedConfigTableModel},
|
|
29
|
-
name: 'filedConfig',
|
|
30
|
-
setup(props, context) {
|
|
31
|
-
const dialogVisible = ref(false)
|
|
32
|
-
const state = reactive({
|
|
33
|
-
columnList: [],
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
function init(data) {
|
|
37
|
-
dialogVisible.value = true;
|
|
38
|
-
state.columnList = data;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const itemRefs = ref([]); // 储存获取的Dom元素或子组件实例
|
|
42
|
-
|
|
43
|
-
const setItemRef = (el) => {
|
|
44
|
-
if (el) {
|
|
45
|
-
itemRefs.value.push(el);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// 每次更新前把实例清空
|
|
50
|
-
onBeforeUpdate(() => {
|
|
51
|
-
itemRefs.value = [];
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
function handleClose(v) {
|
|
55
|
-
if (v === true) {
|
|
56
|
-
let data = {};
|
|
57
|
-
let itemRefsV = itemRefs.value;
|
|
58
|
-
for (let i = 0; i < itemRefsV.length; i++) {
|
|
59
|
-
let tableData = toRaw(itemRefsV[i].obj);
|
|
60
|
-
data[tableData.index] = tableData.columnList;
|
|
61
|
-
}
|
|
62
|
-
context.emit('close', data);
|
|
63
|
-
}
|
|
64
|
-
dialogVisible.value = false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return {dialogVisible, state, init, handleClose, setItemRef}
|
|
68
|
-
},
|
|
69
|
-
methods: {}
|
|
70
|
-
}
|
|
71
|
-
</script>
|
|
72
|
-
<style lang="less">
|
|
73
|
-
|
|
74
|
-
</style>
|