olp-table 5.3.1 → 5.3.4
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/.env.build +1 -0
- package/README.md +26 -0
- package/babel.config.js +5 -0
- package/jsconfig.json +22 -0
- package/{olp-table.common.js → olp-table/olp-table.common.js} +5 -5
- package/{olp-table.umd.js → olp-table/olp-table.umd.js} +5 -5
- package/{olp-table.umd.min.js → olp-table/olp-table.umd.min.js} +3 -3
- package/package.json +92 -12
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/rmMode.bat +1 -0
- package/src/App.vue +199 -0
- package/src/api/crud.js +22 -0
- package/src/api/dist.js +6 -0
- package/src/assets/iconfont/iconfont.css +20 -0
- package/src/assets/iconfont/iconfont.json +16 -0
- 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 +75 -0
- package/src/components/codemirror-tag.vue +100 -0
- package/src/components/lazy-load-select.vue +107 -0
- package/src/components/ol-dialog-excel.vue +112 -0
- package/src/components/ol-dialog-import.vue +304 -0
- package/src/components/ol-dialog-json.vue +82 -0
- package/src/components/ol-dialog-table.vue +81 -0
- package/src/components/ol-dialog-upload-file.vue +208 -0
- package/src/components/ol-dict-tag.vue +271 -0
- package/src/components/ol-select-dom.vue +71 -0
- package/src/components/ol-table-filter.vue +28 -0
- package/src/components/ol-table-render.vue +44 -0
- package/src/components/ol-table-select.vue +150 -0
- package/src/components/pinia-init.vue +18 -0
- package/src/components/table/model/ModelMixins.js +43 -0
- package/src/components/table/model/model-index.vue +121 -0
- package/src/components/table/model/ot-left-right.vue +18 -0
- package/src/components/table/model/ot-left-tree-right-table.scss +14 -0
- package/src/components/table/model/ot-left-tree-right-table.vue +41 -0
- package/src/components/table/model/ot-top-1-bottom-2.vue +39 -0
- package/src/components/table/model/ot-top-2-bottom-1.vue +38 -0
- package/src/components/table/model/ot-top-2-bottom-2.vue +38 -0
- package/src/components/table/model/ot-top-bottom.vue +18 -0
- package/src/components/table/model/splitpanesModel.css +22 -0
- package/src/components/table/model/splitpanesModel.vue +54 -0
- package/src/components/table/ol-form/index.vue +537 -0
- package/src/components/table/ol-form-v3/index.vue +455 -0
- package/src/components/table/ol-main-form-sub-table/index.vue +601 -0
- package/src/components/table/ol-pager/index.vue +46 -0
- package/src/components/table/ol-table/components/ol-table-column-config/columnIndex.vue +233 -0
- package/src/components/table/ol-table/components/ol-table-column-config/index.vue +145 -0
- package/src/components/table/ol-table/components/ol-table-column-dict-color/index.vue +88 -0
- package/src/components/table/ol-table/index.vue +232 -0
- package/src/components/table/ol-table-operate/index.vue +61 -0
- package/src/components/table/ol-table-search/index.vue +17 -0
- package/src/components/table/ol-table-tool-btn/index.vue +60 -0
- package/src/components/tree/components/o-tree.vue +289 -0
- package/src/components/tree/index.vue +46 -0
- package/src/components/v-component/index.vue +43 -0
- package/src/config/dev-config.js +5 -0
- package/src/config/prod-config.js +5 -0
- package/src/config/shared-config.js +20 -0
- package/src/data.js +9378 -0
- package/src/directives/permission/hasPermi.js +63 -0
- package/src/directives/permission/hasRole.js +30 -0
- package/src/main.js +55 -0
- package/src/mixins/VTMixin/DefaultMethods.js +749 -0
- package/src/mixins/VTMixin/OTMixinBody.js +105 -0
- package/src/mixins/VTMixin/OTMixinBodyFooter.js +93 -0
- package/src/mixins/VTMixin/OTMixinBodyMethods.js +420 -0
- package/src/mixins/VTMixin/OTMixinColumnMethod.js +450 -0
- package/src/mixins/VTMixin/OTMixinInitMethod.js +130 -0
- package/src/mixins/VTMixin/OTMixinPager.js +38 -0
- package/src/mixins/VTMixin/OTMixinSortable.js +43 -0
- package/src/mixins/VTMixin/index.js +18 -0
- package/src/package/index.js +20 -0
- package/src/plugins/axios.js +61 -0
- package/src/store/dict.js +76 -0
- package/src/store/dictType.js +52 -0
- package/src/store/permi.js +45 -0
- package/src/styles/common.scss +37 -0
- package/src/styles/index.scss +48 -0
- package/src/styles/theme.scss +32 -0
- package/src/utils/AESCRUDUtils.js +87 -0
- package/src/utils/DateUtils.js +35 -0
- package/src/utils/ExcelUtil.js +159 -0
- package/src/utils/TableSortUtil.js +91 -0
- package/src/utils/columnProp.js +3 -0
- package/src/utils/groupCompute.js +68 -0
- package/src/utils/http/httpFactory.js +92 -0
- package/src/utils/http/httpFactory2.js +79 -0
- package/src/utils/http/httpUtil.js +123 -0
- package/src/utils/http/httpUtils.js +38 -0
- package/src/utils/loadStyle.js +14 -0
- package/src/utils/message.js +56 -0
- package/src/utils/object.js +80 -0
- package/src/utils/security/TokenUtil.js +19 -0
- package/src/utils/tree.js +54 -0
- package/src/utils/util.js +127 -0
- package/src/views/Test/index.vue +77 -0
- package/src/views/Test/index2.vue +33 -0
- package/src/views/components/btn-config/index.vue +202 -0
- package/src/views/components/option-config/index.vue +192 -0
- package/src/views/db/chineseToEnglish.vue +127 -0
- package/src/views/db/filed.vue +395 -0
- package/src/views/db/index.vue +192 -0
- package/src/views/db/preview/index.vue +139 -0
- package/src/views/db/preview/left.vue +204 -0
- package/src/views/db/preview/right.vue +466 -0
- package/src/views/groupTable/index.vue +137 -0
- package/src/views/groupTable/ol-table-column-config/columnIndex.vue +194 -0
- package/src/views/groupTable/ol-table-column-config/index.vue +92 -0
- package/src/views/table/add-or-edit/config/base-config/index.vue +539 -0
- package/src/views/table/add-or-edit/config/base-config/table-form.vue +333 -0
- package/src/views/table/add-or-edit/config/column-config/header-config.vue +475 -0
- package/src/views/table/add-or-edit/config/column-config/index.vue +790 -0
- package/src/views/table/add-or-edit/config/data/column.js +218 -0
- package/src/views/table/add-or-edit/config/data/crud.js +122 -0
- package/src/views/table/add-or-edit/config/data/events.js +109 -0
- package/src/views/table/add-or-edit/config/data/method.js +127 -0
- package/src/views/table/add-or-edit/config/data/option.js +725 -0
- package/src/views/table/add-or-edit/config/data/page.js +79 -0
- package/src/views/table/add-or-edit/config/field-config/filed-config-table.vue +42 -0
- package/src/views/table/add-or-edit/config/field-config/index.vue +91 -0
- package/src/views/table/add-or-edit/config/form-config/index.vue +1179 -0
- package/src/views/table/add-or-edit/config/index.vue +376 -0
- package/src/views/table/add-or-edit/config/initFormObject.js +25 -0
- package/src/views/table/add-or-edit/config/script-config/LeftMeun.vue +71 -0
- package/src/views/table/add-or-edit/config/script-config/index.vue +70 -0
- package/src/views/table/add-or-edit/config/table-config/btn-config.vue +340 -0
- package/src/views/table/add-or-edit/config/table-config/btn-sort.vue +132 -0
- package/src/views/table/add-or-edit/config/table-config/index.vue +446 -0
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config-table-model.vue +41 -0
- package/src/views/table/add-or-edit/configOld/dataTags/filed-config.vue +74 -0
- package/src/views/table/add-or-edit/configOld/dataTags/index.vue +439 -0
- package/src/views/table/add-or-edit/configOld/dataTags/set-table-sql.vue +79 -0
- package/src/views/table/add-or-edit/configOld/dataTags/table-on-config.vue +74 -0
- package/src/views/table/add-or-edit/configOld/index.vue +127 -0
- package/src/views/table/add-or-edit/configOld/tableTags/columnConfig.js +5 -0
- package/src/views/table/add-or-edit/configOld/tableTags/index.vue +353 -0
- package/src/views/table/add-or-edit/configOld/tableTags/operation-but-config.vue +75 -0
- package/src/views/table/add-or-edit/configOld/tableTags/tool-but-config.vue +92 -0
- package/src/views/table/add-or-edit/index.vue +201 -0
- package/src/views/table/add-or-edit/themeModel/index.vue +53 -0
- package/src/views/table/add-or-edit/themeModel/init-model-table.vue +48 -0
- package/src/views/table/add-or-edit/themeModel/init-model.vue +81 -0
- package/src/views/table/add-or-edit/themeModel/left-right.vue +24 -0
- package/src/views/table/add-or-edit/themeModel/left-tree-right-table.vue +75 -0
- package/src/views/table/add-or-edit/themeModel/olTableSearchModelMixins.js +42 -0
- package/src/views/table/add-or-edit/themeModel/splitpanesThemeModel.vue +49 -0
- package/src/views/table/add-or-edit/themeModel/top-1-bottom-2.vue +29 -0
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-1.vue +32 -0
- package/src/views/table/add-or-edit/themeModel/top-2-bottom-2.vue +32 -0
- package/src/views/table/add-or-edit/themeModel/top-bottom.vue +14 -0
- package/src/views/table/index.vue +43 -0
- package/src/views/table/index2.vue +199 -0
- package/src/views/table/preview/index.vue +29 -0
- package/src/views/tree/components/config-core-data.vue +85 -0
- package/src/views/tree/components/config-core-table.vue +362 -0
- package/src/views/tree/components/config-core-tree/data/events.js +95 -0
- package/src/views/tree/components/config-core-tree/data/option.js +88 -0
- package/src/views/tree/components/config-core-tree/data/prop.js +28 -0
- package/src/views/tree/components/config-core-tree/index.vue +181 -0
- package/src/views/tree/components/config-core.vue +42 -0
- package/src/views/tree/components/form-config/index.vue +967 -0
- package/src/views/tree/index.vue +424 -0
- package/vue.config.js +44 -0
- /package/{demo.html → olp-table/demo.html} +0 -0
- /package/{fonts → olp-table/fonts}/iconfont.1720006583309.7e4906d9.woff +0 -0
- /package/{fonts → olp-table/fonts}/iconfont.1720006583309.947a27f0.ttf +0 -0
- /package/{olp-table.css → olp-table/olp-table.css} +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<vxe-grid v-bind="gridOptions" ref="vexGridRef" @edit-closed="doUpdate(undefined)">
|
|
3
|
+
<!-- 通用多选框 -->
|
|
4
|
+
<template #checkedBox_header="{ column }">
|
|
5
|
+
<div style="display: flex;align-items: center;">
|
|
6
|
+
<el-checkbox v-model="column.params.all" @change="headerClick(column)"></el-checkbox>
|
|
7
|
+
<span style="margin-left: 5px;">{{ column.title }} </span>
|
|
8
|
+
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<template #seq="{ rowIndex}">
|
|
12
|
+
<vxe-button size="mini" style="padding:0" type="text">
|
|
13
|
+
<span class="vxe-icon-sort"/>{{ rowIndex + 1 }}
|
|
14
|
+
</vxe-button>
|
|
15
|
+
</template>
|
|
16
|
+
<template #checkedBox_default="{ column, row }">
|
|
17
|
+
<el-checkbox v-model="row[column.field]" v-if="column.field == 'visible'" @change="checkBoxClick(column,row)"
|
|
18
|
+
true-value="1"
|
|
19
|
+
false-value="0">{{ row.title }}
|
|
20
|
+
</el-checkbox>
|
|
21
|
+
|
|
22
|
+
<el-checkbox v-model="row[column.field]" v-else @change="checkBoxClick(column,row)"
|
|
23
|
+
true-value="1"
|
|
24
|
+
false-value="0"></el-checkbox>
|
|
25
|
+
</template>
|
|
26
|
+
<!-- 通用下拉框 -->
|
|
27
|
+
<template #select_default="{ column, row }">
|
|
28
|
+
<ol-dict-tag :code="column.params.dictCode" size="small" clearable @change="doUpdate(row)"
|
|
29
|
+
v-model="row[column.field]">
|
|
30
|
+
</ol-dict-tag>
|
|
31
|
+
</template>
|
|
32
|
+
</vxe-grid>
|
|
33
|
+
</template>
|
|
34
|
+
<script>
|
|
35
|
+
import {updateSort} from "@/utils/TableSortUtil";
|
|
36
|
+
import OlDictTag from "@/components/ol-dict-tag.vue";
|
|
37
|
+
import {inject} from "vue";
|
|
38
|
+
|
|
39
|
+
import {storeDict} from "@/store/dict";
|
|
40
|
+
import {storeDictType} from "@/store/dictType";
|
|
41
|
+
|
|
42
|
+
const http = inject('http')
|
|
43
|
+
|
|
44
|
+
const dict = storeDict();
|
|
45
|
+
const dictType = storeDictType();
|
|
46
|
+
dict.init(http)
|
|
47
|
+
dictType.init(http)
|
|
48
|
+
export default {
|
|
49
|
+
name: 'columnIndex',
|
|
50
|
+
components: {OlDictTag},
|
|
51
|
+
inject: ['http'],
|
|
52
|
+
data() {
|
|
53
|
+
return {
|
|
54
|
+
gridOptions: {
|
|
55
|
+
border: true,
|
|
56
|
+
keepSource: true,
|
|
57
|
+
showOverflow: true,
|
|
58
|
+
loading: false,
|
|
59
|
+
height: 'auto',
|
|
60
|
+
size: 'mini',
|
|
61
|
+
rowConfig: {isHover: true, isCurrent: true},
|
|
62
|
+
editConfig: {
|
|
63
|
+
trigger: 'click',
|
|
64
|
+
showStatus: true,
|
|
65
|
+
mode: 'row'
|
|
66
|
+
},
|
|
67
|
+
align: 'center',
|
|
68
|
+
scrollX: {enabled: true, gt: 15},
|
|
69
|
+
scrollY: {enabled: true, gt: 0},
|
|
70
|
+
columnConfig: {
|
|
71
|
+
resizable: true
|
|
72
|
+
},
|
|
73
|
+
expandConfig: {
|
|
74
|
+
labelField: 'seq'
|
|
75
|
+
},
|
|
76
|
+
checkboxConfig: {
|
|
77
|
+
showHeader: false
|
|
78
|
+
},
|
|
79
|
+
columns: [],
|
|
80
|
+
columnSource: [
|
|
81
|
+
{
|
|
82
|
+
field: 'sort',
|
|
83
|
+
width: 60,
|
|
84
|
+
className: 'move',
|
|
85
|
+
title: "序号",
|
|
86
|
+
slots: {
|
|
87
|
+
default: 'seq'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
field: 'visible',
|
|
92
|
+
align: 'left',
|
|
93
|
+
fixed:'left',
|
|
94
|
+
params: {
|
|
95
|
+
all: 0
|
|
96
|
+
},
|
|
97
|
+
slots: {
|
|
98
|
+
header: 'checkedBox_header',
|
|
99
|
+
default: 'checkedBox_default'
|
|
100
|
+
},
|
|
101
|
+
minWidth: 120,
|
|
102
|
+
title: '标题'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
field: 'sortable',
|
|
106
|
+
params: {
|
|
107
|
+
all: 0,
|
|
108
|
+
dictCode: 'order_by_type'
|
|
109
|
+
},
|
|
110
|
+
editRender: {
|
|
111
|
+
props: {clearable: true, filterable: true},
|
|
112
|
+
events: {change: this.doUpdate},
|
|
113
|
+
name: '$select',
|
|
114
|
+
options: dict.val('order_by_type')
|
|
115
|
+
},
|
|
116
|
+
width: 80,
|
|
117
|
+
title: '排序'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
field: 'fixed',
|
|
121
|
+
params: {
|
|
122
|
+
dictCode: 'table_fixed'
|
|
123
|
+
},
|
|
124
|
+
editRender: {
|
|
125
|
+
props: {clearable: true, filterable: true},
|
|
126
|
+
events: {change: this.doUpdate}, name: '$select', options: dict.val('table_fixed')
|
|
127
|
+
},
|
|
128
|
+
width: 80,
|
|
129
|
+
title: '固定'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
title: '合计',
|
|
133
|
+
field: 'totalToOtherProp',
|
|
134
|
+
params: {
|
|
135
|
+
dictCode: 'online_calculation_type'
|
|
136
|
+
},
|
|
137
|
+
editRender: {
|
|
138
|
+
props: {clearable: true, filterable: true},
|
|
139
|
+
events: {change: this.doUpdate},
|
|
140
|
+
name: '$select',
|
|
141
|
+
options: dict.val('online_calculation_type')
|
|
142
|
+
},
|
|
143
|
+
width: 80,
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
toolbarConfig: {},
|
|
147
|
+
data: [],
|
|
148
|
+
updateSortMethod: this.doUpdate
|
|
149
|
+
},
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
methods: {
|
|
153
|
+
doUpdate(rows) {
|
|
154
|
+
setTimeout(() => {
|
|
155
|
+
if (rows == undefined) {
|
|
156
|
+
rows = this.gridOptions.data;
|
|
157
|
+
}
|
|
158
|
+
rows = rows instanceof Array ? JSON.parse(JSON.stringify(rows)) : [rows]
|
|
159
|
+
let updates = [];
|
|
160
|
+
for (let row of rows) {
|
|
161
|
+
let obj = {id:row.id,field:row.field};
|
|
162
|
+
for (let column of this.gridOptions.columns) {
|
|
163
|
+
obj[column.field] = row[column.field];
|
|
164
|
+
}
|
|
165
|
+
if(obj.field){
|
|
166
|
+
updates.push(obj);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
this.$emit('update', updates)
|
|
170
|
+
}, 300)
|
|
171
|
+
},
|
|
172
|
+
headerClick(column) {
|
|
173
|
+
let updateSource = [];
|
|
174
|
+
this.gridOptions.data.forEach(row => {
|
|
175
|
+
row[column.field] = column.params.all ? '1' : '0'
|
|
176
|
+
updateSource.push(row)
|
|
177
|
+
})
|
|
178
|
+
this.doUpdate(updateSource)
|
|
179
|
+
},
|
|
180
|
+
checkBoxClick(column, row) {
|
|
181
|
+
let f = true
|
|
182
|
+
this.gridOptions.data.forEach(item => {
|
|
183
|
+
if (item[column.field] != '1') {
|
|
184
|
+
f = false
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
column.params.all = f
|
|
188
|
+
if (row != undefined) {
|
|
189
|
+
this.doUpdate(row)
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
init({paging}, columns) {
|
|
193
|
+
columns = columns.filter(o => o.columnAuth == 1);
|
|
194
|
+
let columnSource = JSON.parse(JSON.stringify(this.gridOptions.columnSource));
|
|
195
|
+
if (paging == 2) {
|
|
196
|
+
columnSource.push({
|
|
197
|
+
title: '分组',
|
|
198
|
+
field: 'groupToOtherProp',
|
|
199
|
+
width: 60,
|
|
200
|
+
params: {
|
|
201
|
+
all: null
|
|
202
|
+
},
|
|
203
|
+
slots: {
|
|
204
|
+
default: 'checkedBox_default'
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
columnSource.push({
|
|
208
|
+
title: '分组合计',
|
|
209
|
+
field: 'groupTotalToOtherProp',
|
|
210
|
+
params: {
|
|
211
|
+
dictCode: 'online_calculation_type'
|
|
212
|
+
},
|
|
213
|
+
width: 100,
|
|
214
|
+
editRender: {
|
|
215
|
+
props: {clearable: true, filterable: true},
|
|
216
|
+
name: '$select',
|
|
217
|
+
options: dict.val('online_calculation_type')
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
this.gridOptions.columns = columnSource;
|
|
222
|
+
this.gridOptions.data = columns
|
|
223
|
+
this.checkBoxClick(this.gridOptions.columns[2])
|
|
224
|
+
updateSort(this.$refs.vexGridRef, this.gridOptions)
|
|
225
|
+
},
|
|
226
|
+
getData() {
|
|
227
|
+
return this.gridOptions.data
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
</script>
|
|
232
|
+
<style scoped>
|
|
233
|
+
</style>
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-drawer v-model="show"
|
|
3
|
+
destroy-on-close
|
|
4
|
+
:show-close="false"
|
|
5
|
+
:close-on-click-modal="false"
|
|
6
|
+
:title="'列配置 -'+uuid " direction="rtl" size="25%">
|
|
7
|
+
<div style="height: calc(100% - 50px);">
|
|
8
|
+
<ColumnIndex ref="columnIndex" @update="$emit('update',$event)"/>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="button-container">
|
|
11
|
+
<el-button @click="cancelClick" :loading="loading">返回页面</el-button>
|
|
12
|
+
<el-popconfirm
|
|
13
|
+
@confirm="confirmClick"
|
|
14
|
+
title="保存当前设置?"
|
|
15
|
+
>
|
|
16
|
+
<template #reference>
|
|
17
|
+
<el-button type="primary" :loading="loading">保存</el-button>
|
|
18
|
+
</template>
|
|
19
|
+
</el-popconfirm>
|
|
20
|
+
</div>
|
|
21
|
+
</el-drawer>
|
|
22
|
+
</template>
|
|
23
|
+
<style scoped>
|
|
24
|
+
.button-container {
|
|
25
|
+
height: 50px;
|
|
26
|
+
display: grid;
|
|
27
|
+
grid-template-columns: auto auto; /* 两列布局 */
|
|
28
|
+
justify-content: end; /* 靠右对齐 */
|
|
29
|
+
align-items: center; /* 垂直居中 */
|
|
30
|
+
grid-column-gap: 10px; /* 列之间的间距 */
|
|
31
|
+
padding-right: 10px; /* 右侧内边距,可根据需要调整 */
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
34
|
+
<script>
|
|
35
|
+
import {put} from "@/utils/http/httpUtils";
|
|
36
|
+
import ColumnIndex from "@/components/table/ol-table/components/ol-table-column-config/columnIndex.vue";
|
|
37
|
+
|
|
38
|
+
export default {
|
|
39
|
+
name: 'olTableColumnConfig',
|
|
40
|
+
inject: ['http'],
|
|
41
|
+
components: {
|
|
42
|
+
ColumnIndex,
|
|
43
|
+
},
|
|
44
|
+
data() {
|
|
45
|
+
return {
|
|
46
|
+
uuid: '',
|
|
47
|
+
show: false,
|
|
48
|
+
loading: true,
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
cancelClick() {
|
|
53
|
+
this.show = false;
|
|
54
|
+
},
|
|
55
|
+
confirmClick() {
|
|
56
|
+
let gridOptions = this.$refs.columnIndex.gridOptions
|
|
57
|
+
let datas = [];
|
|
58
|
+
for (let data of gridOptions.data) {
|
|
59
|
+
let o = {id: data.id,visible:data.visible == 1 ? 1 : 0};
|
|
60
|
+
for (let j = 2; j < gridOptions.columns.length; j++) {
|
|
61
|
+
let column = gridOptions.columns[j];
|
|
62
|
+
o[column.field] = data[column.field];
|
|
63
|
+
if (column.field.indexOf("ToOtherProp") != -1) {
|
|
64
|
+
data.otherProp[column.field] = data[column.field];
|
|
65
|
+
o.otherProp = data.otherProp;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
delete o.groupTotalToOtherProp;
|
|
69
|
+
if (o.fixed == 'left') {
|
|
70
|
+
o.fixed = 1;
|
|
71
|
+
} else if (o.fixed == 'right') {
|
|
72
|
+
o.fixed = 2;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
datas.push(o)
|
|
76
|
+
}
|
|
77
|
+
let i = 1;
|
|
78
|
+
for (let data1 of datas) {
|
|
79
|
+
i++;
|
|
80
|
+
data1.sort = i;
|
|
81
|
+
if (data1.otherProp) {
|
|
82
|
+
data1.otherProp = JSON.stringify(data1.otherProp);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
datas[0].uuid = gridOptions.data[0].uuid;
|
|
86
|
+
datas[0].thmem = gridOptions.data[0].thmem;
|
|
87
|
+
this.loading = true;
|
|
88
|
+
put(this.http, '/online/tableConfigColumn/editBatch', datas).then(res => {
|
|
89
|
+
if (res) {
|
|
90
|
+
this.$emit('ok');
|
|
91
|
+
this.show = false;
|
|
92
|
+
}
|
|
93
|
+
}).finally(() => {
|
|
94
|
+
this.loading = false;
|
|
95
|
+
})
|
|
96
|
+
},
|
|
97
|
+
copyTextToClipboard(text) {
|
|
98
|
+
navigator.clipboard.writeText(text).then(() => {
|
|
99
|
+
console.log('Text copied to clipboard');
|
|
100
|
+
}).catch(err => {
|
|
101
|
+
console.error('Failed to copy text: ', err);
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
open(tableConfig, id, columns) {
|
|
105
|
+
this.show = true;
|
|
106
|
+
this.loading = true;
|
|
107
|
+
this.uuid = id;
|
|
108
|
+
this.$nextTick(() => {
|
|
109
|
+
this.$refs.columnIndex.init(tableConfig, JSON.parse(JSON.stringify(columns)))
|
|
110
|
+
this.loading = false;
|
|
111
|
+
})
|
|
112
|
+
},
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
</script>
|
|
116
|
+
<style lang="less" scoped>
|
|
117
|
+
.page-left {
|
|
118
|
+
position: absolute;
|
|
119
|
+
left: 10px;
|
|
120
|
+
top: 50%;
|
|
121
|
+
transform: translateY(-50%);
|
|
122
|
+
z-index: 10;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.vxe-pager {
|
|
126
|
+
height: 35px;
|
|
127
|
+
top: 5px;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.container :deep(.el-drawer__header) {
|
|
131
|
+
padding: 0px 20px;
|
|
132
|
+
margin-bottom: 0px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.el-tag:hover {
|
|
136
|
+
background-color: #f56c6c; /* 红色背景 */
|
|
137
|
+
color: #fff; /* 白色文字 */
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
:deep(.move) {
|
|
142
|
+
cursor: move;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="OTableColumnDictColor_container" v-if="title">
|
|
3
|
+
<div class="box">{{ title }}:</div>
|
|
4
|
+
<div v-for="item in cssClass" class="box">
|
|
5
|
+
<div class="color" :style="item.style"></div>
|
|
6
|
+
<span class="dictLabel">{{ item.dictLabel }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'olTableColumnDictColor',
|
|
13
|
+
props: {
|
|
14
|
+
columns: {default: []}
|
|
15
|
+
},
|
|
16
|
+
data() {
|
|
17
|
+
return {
|
|
18
|
+
cssClass: [],
|
|
19
|
+
title: undefined,
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
created() {
|
|
23
|
+
for (let column of this.columns) {
|
|
24
|
+
if (column.params && column.params.cssClass) {
|
|
25
|
+
let cssClass = [];
|
|
26
|
+
for (let obj of Object.keys(column.params.cssClass)) {
|
|
27
|
+
let st = column.params.cssClass[obj];
|
|
28
|
+
this.title = column.title;
|
|
29
|
+
let style = 'background-color:' + st['backgroundColor'] + ";color:" + st['color'];
|
|
30
|
+
cssClass.push({
|
|
31
|
+
dictValue: obj,
|
|
32
|
+
dictLabel: column.params.dictValueLabel[obj],
|
|
33
|
+
style: style
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
this.cssClass = cssClass
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style lang="less" scoped>
|
|
45
|
+
.OTableColumnDictColor_container {
|
|
46
|
+
float: left;
|
|
47
|
+
font-size: 11px;
|
|
48
|
+
color: #000000;
|
|
49
|
+
|
|
50
|
+
.box {
|
|
51
|
+
float: left;
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center; /* 水平居中,如需 */
|
|
54
|
+
align-items: center; /* 垂直居中 */
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.text-with-line {
|
|
59
|
+
text-align: center; /* 文字居中 */
|
|
60
|
+
position: relative; /* 相对定位 */
|
|
61
|
+
padding-top: 10px; /* 文字与横线之间的间隔 */
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.text-with-line::after {
|
|
65
|
+
content: ""; /* 伪元素内容为空 */
|
|
66
|
+
position: absolute; /* 绝对定位 */
|
|
67
|
+
left: 0; /* 横线左边界与div左边界对齐 */
|
|
68
|
+
right: 0; /* 横线右边界与div右边界对齐 */
|
|
69
|
+
top: 0; /* 横线顶部与div内部内容顶部对齐 */
|
|
70
|
+
height: 1px; /* 横线高度 */
|
|
71
|
+
background: black; /* 横线颜色 */
|
|
72
|
+
transform: scaleY(0.5); /* 将线性缩小一半,看起来更细 */
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dictLabel {
|
|
76
|
+
margin-right: 5px;
|
|
77
|
+
float: left;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.color {
|
|
81
|
+
float: left;
|
|
82
|
+
margin-right: 5px;
|
|
83
|
+
text-align: center;
|
|
84
|
+
width: 12px;
|
|
85
|
+
height: 12px;
|
|
86
|
+
border-radius: 10px;
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot :name="getSlotName('search')" v-if="table.formConfig.show"></slot>
|
|
3
|
+
<vxe-grid v-bind="table" class="ol-table" :footer-method="footerMethod" @checkboxChange="selectRowChange"
|
|
4
|
+
@radioChange="selectRowChange"
|
|
5
|
+
v-on="events"
|
|
6
|
+
@checkboxAll="selectRowChange">
|
|
7
|
+
<template v-for='item in table.formConfig.items.filter(item =>item.slotsName != undefined)' v-slot:[item.slotsName]>
|
|
8
|
+
<olSelectDom :item="item" v-model="table.formConfig.data[item.key]"></olSelectDom>
|
|
9
|
+
</template>
|
|
10
|
+
<template #img_default="{row,column}">
|
|
11
|
+
<el-image
|
|
12
|
+
style="height: 40px"
|
|
13
|
+
:src="row[getFiledName(column)]"
|
|
14
|
+
:preview-src-list="[row[column[getFiledName(column)]]]"
|
|
15
|
+
:zoom-rate="1.2"
|
|
16
|
+
:max-scale="7"
|
|
17
|
+
:min-scale="0.2"
|
|
18
|
+
:initial-index="4"
|
|
19
|
+
fit="scale-down"
|
|
20
|
+
/>
|
|
21
|
+
</template>
|
|
22
|
+
<template #icon_default="{row,column}">
|
|
23
|
+
<i :class="row[getFiledName(column)]"></i>{{ row[column[getFiledName(column)]] }}
|
|
24
|
+
</template>
|
|
25
|
+
<template #header_left>
|
|
26
|
+
<span class="title" v-if="table['table-title']">{{ table['table-title'] }}
|
|
27
|
+
</span>
|
|
28
|
+
<span style="margin: 0px 15px -30px 0px" v-else></span>
|
|
29
|
+
<slot :name="getSlotName('headerLeftLeft')"></slot>
|
|
30
|
+
<ol-table-tool-btn :loading="loading" :value="toolBtn.filter(o=>o.alignMode == 'left')" :currentPermi="uuid+':'+theme+':'"
|
|
31
|
+
@toolbarBtnClick="toolbarBtnClick($event)"/>
|
|
32
|
+
<slot :name="getSlotName('headerLeftRight')"></slot>
|
|
33
|
+
</template>
|
|
34
|
+
<template #header_right>
|
|
35
|
+
<slot :name="getSlotName('headerRightLeft')"></slot>
|
|
36
|
+
<ol-table-tool-btn :loading="loading" :value="toolBtn.filter(o=>o.alignMode == 'right' && ['olp_fullscreen','olp_refresh','olp_setting','olp_search'].indexOf(o.code) == -1)" :currentPermi="uuid+':'+theme+':'"
|
|
37
|
+
@toolbarBtnClick="toolbarBtnClick($event)">
|
|
38
|
+
<template #right>
|
|
39
|
+
<vxe-button @click="zoomEvent" v-if="showToolName('olp_fullscreen')" circle>
|
|
40
|
+
<i class="vxe-icon-fullscreen" v-if="!isMaximized" title="全屏"/>
|
|
41
|
+
<i class=" vxe-icon-minimize" title="取消全屏" v-else/>
|
|
42
|
+
</vxe-button>
|
|
43
|
+
<vxe-button icon="vxe-icon-refresh" v-if="showToolName('olp_refresh')" @click="query" title="刷新" circle></vxe-button>
|
|
44
|
+
<vxe-button icon="vxe-icon-setting-fill" v-if="showToolName('olp_setting')" title="设置"
|
|
45
|
+
@click="$refs.olTableColumnConfig.open(tableConfig, tableConfig.uuid,table.columns)"
|
|
46
|
+
circle></vxe-button>
|
|
47
|
+
<vxe-button icon="vxe-icon-search" title="搜索" v-if="showToolName('olp_search')" @click="toggleFormDisplay" circle></vxe-button>
|
|
48
|
+
</template>
|
|
49
|
+
</ol-table-tool-btn>
|
|
50
|
+
<slot :name="getSlotName('headerRightRight')"></slot>
|
|
51
|
+
</template>
|
|
52
|
+
<!--操作-->
|
|
53
|
+
<template #operate="{ row }">
|
|
54
|
+
<slot :name="getSlotName('operateLeft')"></slot>
|
|
55
|
+
<olTableOperate :row="row" :value="operationBtn"
|
|
56
|
+
@handleOperationClick="handleOperationClick($event)"></olTableOperate>
|
|
57
|
+
<slot :name="getSlotName('operateRight')"></slot>
|
|
58
|
+
</template>
|
|
59
|
+
<!--分页-->
|
|
60
|
+
<template #pager v-if="pagination.enabled && table.columns.length !=0">
|
|
61
|
+
<olPager v-bind="pagination" @page-change="handlePageChange"
|
|
62
|
+
@clearSelected="clearSelected">
|
|
63
|
+
<template #left>
|
|
64
|
+
<ol-table-column-dict-color :columns="table.columns"/>
|
|
65
|
+
<slot :name="getSlotName('pageLeft')"></slot>
|
|
66
|
+
</template>
|
|
67
|
+
<template #right>
|
|
68
|
+
<slot :name="getSlotName('pageRight')"></slot>
|
|
69
|
+
</template>
|
|
70
|
+
</olPager>
|
|
71
|
+
</template>
|
|
72
|
+
</vxe-grid>
|
|
73
|
+
<component ref="components" v-if="customUrl != undefined" :is="customUrl" @emits="emits"/>
|
|
74
|
+
<ol-table-column-config ref="olTableColumnConfig" @update="updateColumn" @ok="init(true)"/>
|
|
75
|
+
<olForm ref="form" @query="query"></olForm>
|
|
76
|
+
<OlMainFormSubTable ref="subForm" @query="query"/>
|
|
77
|
+
</template>
|
|
78
|
+
|
|
79
|
+
<script>
|
|
80
|
+
import {OTMixin} from "@/mixins/VTMixin";
|
|
81
|
+
import olTableOperate from "@/components/table/ol-table-operate"
|
|
82
|
+
import olPager from "@/components/table/ol-pager"
|
|
83
|
+
import olForm from "@/components/table/ol-form"
|
|
84
|
+
import OlTableColumnConfig from "@/components/table/ol-table/components/ol-table-column-config/index.vue";
|
|
85
|
+
import OlTableToolBtn from "@/components/table/ol-table-tool-btn/index.vue";
|
|
86
|
+
import {Delete} from "@element-plus/icons-vue";
|
|
87
|
+
import OlTableColumnDictColor from "@/components/table/ol-table/components/ol-table-column-dict-color/index.vue";
|
|
88
|
+
import {storeDict} from "@/store/dict";
|
|
89
|
+
import {storeDictType} from "@/store/dictType";
|
|
90
|
+
import getFiledName from "@/utils/columnProp";
|
|
91
|
+
import OlMainFormSubTable from "@/components/table/ol-main-form-sub-table/index.vue";
|
|
92
|
+
import {storePermi} from "@/store/permi";
|
|
93
|
+
|
|
94
|
+
const dict = storeDict();
|
|
95
|
+
const dictType = storeDictType();
|
|
96
|
+
const permi = storePermi();
|
|
97
|
+
export default {
|
|
98
|
+
name: 'olTable',
|
|
99
|
+
props: {
|
|
100
|
+
theme: {
|
|
101
|
+
type: String
|
|
102
|
+
},
|
|
103
|
+
initDataSource: {
|
|
104
|
+
default: true
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
mixins: [OTMixin],
|
|
108
|
+
components: {
|
|
109
|
+
OlMainFormSubTable,
|
|
110
|
+
OlTableColumnDictColor, Delete, OlTableToolBtn, OlTableColumnConfig, olTableOperate, olPager, olForm},
|
|
111
|
+
data() {
|
|
112
|
+
return {
|
|
113
|
+
uuid: this.$attrs.uuid
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
showToolName(code){
|
|
118
|
+
for (let toolBtn of this.toolBtn) {
|
|
119
|
+
if(toolBtn.code == code){
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
},
|
|
125
|
+
getFiledName,
|
|
126
|
+
handleClose() {
|
|
127
|
+
this.selectRowChange()
|
|
128
|
+
}, getSlotName(name) {
|
|
129
|
+
return name + "_" + this.theme
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
mounted() {
|
|
133
|
+
setTimeout(() => {
|
|
134
|
+
this.updateSort()
|
|
135
|
+
}, 500)
|
|
136
|
+
},
|
|
137
|
+
created() {
|
|
138
|
+
dict.init();
|
|
139
|
+
dictType.init();
|
|
140
|
+
permi.init();
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<style>
|
|
146
|
+
@import "@/styles/theme.scss";
|
|
147
|
+
</style>
|
|
148
|
+
<style lang="less" scoped>
|
|
149
|
+
|
|
150
|
+
.codemirror-el-dialog {
|
|
151
|
+
|
|
152
|
+
> .el-dialog__header {
|
|
153
|
+
display: block;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.cursor-pointer {
|
|
158
|
+
cursor: pointer;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.table-right-operation-but {
|
|
162
|
+
margin: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
/deep/ .vxe-table--body-wrapper {
|
|
167
|
+
min-height: 110px;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.tableCard {
|
|
171
|
+
height: 100%;
|
|
172
|
+
|
|
173
|
+
:deep(.el-card__body) {
|
|
174
|
+
padding: 8px 16px;
|
|
175
|
+
height: 100%;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/*
|
|
180
|
+
/deep/ .vxe-grid--form-wrapper .vxe-form .vxe-form--wrapper{
|
|
181
|
+
border: 1px solid #e8eaec;
|
|
182
|
+
border-radius: 2px;
|
|
183
|
+
padding: 15px 0;
|
|
184
|
+
}
|
|
185
|
+
*/
|
|
186
|
+
|
|
187
|
+
.page-left {
|
|
188
|
+
position: absolute;
|
|
189
|
+
left: 10px;
|
|
190
|
+
top: 50%;
|
|
191
|
+
transform: translateY(-50%);
|
|
192
|
+
z-index: 10;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.vxe-pager {
|
|
196
|
+
height: 34px;
|
|
197
|
+
top: 3px;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.t-bottom {
|
|
201
|
+
float: left;
|
|
202
|
+
position: relative;
|
|
203
|
+
font-size: 13px;
|
|
204
|
+
width: 100%;
|
|
205
|
+
top: 4px;
|
|
206
|
+
border-top: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.title {
|
|
210
|
+
z-index: 15;
|
|
211
|
+
margin: 0px 15px -23px 0px;
|
|
212
|
+
background-color: #fff;
|
|
213
|
+
border-radius: 2px;
|
|
214
|
+
border: 1px solid rgb(232, 234, 236);
|
|
215
|
+
border-bottom: 0;
|
|
216
|
+
padding: 0px 9px;
|
|
217
|
+
line-height: 25px;
|
|
218
|
+
color: #49494b;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/deep/ .size--mini {
|
|
222
|
+
.title {
|
|
223
|
+
margin: 0px 15px -20px 0px !important;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/deep/ .size--medium {
|
|
228
|
+
.title {
|
|
229
|
+
margin: 0px 15px -29px 0px !important;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
</style>
|