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,362 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="padding: 0px;flex: 1">
|
|
3
|
+
<vxe-table min-height="100px" border
|
|
4
|
+
max-height="170px"
|
|
5
|
+
:data="this.treeConfigAll.treeConfig.table"
|
|
6
|
+
:stripe="true"
|
|
7
|
+
align="center"
|
|
8
|
+
size="small"
|
|
9
|
+
ref="tableRef"
|
|
10
|
+
@mouseover="showAction()"
|
|
11
|
+
@mouseleave="hideAction()"
|
|
12
|
+
:row-config="{height: 50}">
|
|
13
|
+
<vxe-column type="seq" width="50">
|
|
14
|
+
<template #header>
|
|
15
|
+
<vxe-button status="primary" icon="vxe-icon-add" @click="insertEvent" circle/>
|
|
16
|
+
</template>
|
|
17
|
+
<template #default="{row, $rowIndex}">
|
|
18
|
+
<div>
|
|
19
|
+
<!-- 在这里添加你的按钮 -->
|
|
20
|
+
<vxe-button v-if="isHovering" status="danger" icon="vxe-icon-delete"
|
|
21
|
+
@click="removeEvent(row,$rowIndex)" circle/>
|
|
22
|
+
<span v-else>{{ $rowIndex +1 }}</span>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
</vxe-column>
|
|
26
|
+
<vxe-column field="index" title="序号" width="50"/>
|
|
27
|
+
<vxe-column field="type" title="类型" min-width="100">
|
|
28
|
+
<template #default="{ row,$rowIndex }">
|
|
29
|
+
<vxe-select v-model="row.type" transfer :disabled="$rowIndex == 0">
|
|
30
|
+
<vxe-option v-for="item in treeConfigAll.dicData.joinFiledDicData" :key="item.value" :value="item.value"
|
|
31
|
+
:label="item.label"/>
|
|
32
|
+
</vxe-select>
|
|
33
|
+
</template>
|
|
34
|
+
</vxe-column>
|
|
35
|
+
<vxe-column field="joinTable" title="数据表" min-width="120" show-overflow>
|
|
36
|
+
<template #default="{ row }">
|
|
37
|
+
<vxe-select v-model="row.joinTable" filterable transfer @change="setTable">
|
|
38
|
+
<vxe-option v-for="item in treeConfigAll.dicData.joinTableDicData" :key="item.value" :value="item.value"
|
|
39
|
+
:label="item.label"/>
|
|
40
|
+
</vxe-select>
|
|
41
|
+
</template>
|
|
42
|
+
</vxe-column>
|
|
43
|
+
<vxe-column field="joinFiled" title="on" min-width="110" show-overflow>
|
|
44
|
+
<template #default="{ row ,$rowIndex}">
|
|
45
|
+
<vxe-input v-model="row.joinFiled" @change="setSql('',row.index)" type="text" :disabled="$rowIndex == 0"/>
|
|
46
|
+
</template>
|
|
47
|
+
</vxe-column>
|
|
48
|
+
<vxe-column field="deleteWhere" title="删除条件" min-width="110">
|
|
49
|
+
<template #default="{ row }">
|
|
50
|
+
<vxe-input v-model="row.deleteWhere" type="text"/>
|
|
51
|
+
</template>
|
|
52
|
+
</vxe-column>
|
|
53
|
+
<vxe-column field="fields" title="操作" min-width="110" show-overflow>
|
|
54
|
+
<template #default="{ row }">
|
|
55
|
+
<vxe-button status="primary" @click="setFieldEvent(row)">字段配置</vxe-button>
|
|
56
|
+
</template>
|
|
57
|
+
</vxe-column>
|
|
58
|
+
</vxe-table>
|
|
59
|
+
</div>
|
|
60
|
+
<field-config ref="filedConfig" @close="filedConfigClose"/>
|
|
61
|
+
</template>
|
|
62
|
+
<script>
|
|
63
|
+
import {storeDict} from "@/store/dict";
|
|
64
|
+
import {get, postQs} from "@/utils/http/httpUtils";
|
|
65
|
+
import FieldConfig from "@/views/table/add-or-edit/config/field-config/index.vue";
|
|
66
|
+
import {useMessage} from "@/utils/message";
|
|
67
|
+
|
|
68
|
+
const msg = useMessage() // 消息弹窗
|
|
69
|
+
export default {
|
|
70
|
+
name: 'configCoreTable',
|
|
71
|
+
components: {FieldConfig},
|
|
72
|
+
props: {
|
|
73
|
+
item: {}
|
|
74
|
+
},
|
|
75
|
+
inject: ['treeConfigAll','syncFormConfig','http'],
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
data: [
|
|
79
|
+
{index: "t1", type: "主表", joinTable: "", joinFiled: "/", deleteWhere: 'id=${id}'}
|
|
80
|
+
],
|
|
81
|
+
isHovering: false,
|
|
82
|
+
dict: storeDict(),
|
|
83
|
+
dicData: {
|
|
84
|
+
joinFiledDicData: [],
|
|
85
|
+
joinTableDicData: []
|
|
86
|
+
},
|
|
87
|
+
url: {
|
|
88
|
+
joinTableUrl: '/online/getDBTableList/',
|
|
89
|
+
columnsListUrl: '/online/getDBTableColumnList/'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
created() {
|
|
94
|
+
this.init()
|
|
95
|
+
},
|
|
96
|
+
methods: {
|
|
97
|
+
init() {
|
|
98
|
+
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
formatType(value) {
|
|
102
|
+
if (value === '1') {
|
|
103
|
+
return '男'
|
|
104
|
+
}
|
|
105
|
+
if (value === '0') {
|
|
106
|
+
return '女'
|
|
107
|
+
}
|
|
108
|
+
return value
|
|
109
|
+
},
|
|
110
|
+
beforeEditMethod({rowIndex, columnIndex}) {
|
|
111
|
+
if (rowIndex === 0 && (columnIndex === 3 || columnIndex === 5)) {
|
|
112
|
+
return true
|
|
113
|
+
}
|
|
114
|
+
return false
|
|
115
|
+
},
|
|
116
|
+
cellMouseenter({row, column, $event, property, $index}) {
|
|
117
|
+
console.log('cellMouseenter', row, column, $event, property, $index)
|
|
118
|
+
this.isHovering = true
|
|
119
|
+
},
|
|
120
|
+
async insertEvent(row) {
|
|
121
|
+
const $table = this.$refs.tableRef
|
|
122
|
+
if ($table) {
|
|
123
|
+
let record = {
|
|
124
|
+
index: 't' + (this.data.length + 1),
|
|
125
|
+
type: 'join',
|
|
126
|
+
joinTable: '',
|
|
127
|
+
joinFiled: 't' + this.data.length + '.=t' + (this.data.length + 1) + '.'
|
|
128
|
+
}
|
|
129
|
+
row = -1
|
|
130
|
+
const {row: newRow} = await $table.insertAt(record, row)
|
|
131
|
+
this.data.push(record)
|
|
132
|
+
await $table.setEditCell(newRow, 'name')
|
|
133
|
+
$table.updateData()
|
|
134
|
+
console.log('this.data:',this.data)
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
removeEvent(row,index) {
|
|
138
|
+
if (index == 0) {
|
|
139
|
+
msg.error("主表不能删除!")
|
|
140
|
+
return
|
|
141
|
+
}
|
|
142
|
+
this.setSql(index)
|
|
143
|
+
},
|
|
144
|
+
showAction(row) {
|
|
145
|
+
this.isHovering = true;
|
|
146
|
+
},
|
|
147
|
+
hideAction() {
|
|
148
|
+
this.isHovering = false;
|
|
149
|
+
},
|
|
150
|
+
handleClick(row) {
|
|
151
|
+
// 处理按钮点击事件
|
|
152
|
+
console.log('row:', row)
|
|
153
|
+
},
|
|
154
|
+
setFieldEvent(row, column, rowIndex) {
|
|
155
|
+
console.log('setFieldEvent:',column, rowIndex)
|
|
156
|
+
postQs(this.http,'/online/getTableSetFiled/' + this.treeConfigAll.treeConfig.dbName, {
|
|
157
|
+
sql: this.treeConfigAll.treeConfig.executeSql,
|
|
158
|
+
where: this.treeConfigAll.treeConfig.where,
|
|
159
|
+
uuid: this.treeConfigAll.treeConfig.uuid
|
|
160
|
+
}, undefined, false).then((data) => {
|
|
161
|
+
row.columnList = Object.values(data.data[row.joinTable])
|
|
162
|
+
this.$refs.filedConfig.init(row)
|
|
163
|
+
})
|
|
164
|
+
},
|
|
165
|
+
filedConfigClose(data) {
|
|
166
|
+
if (!data) return;
|
|
167
|
+
for (let j = 0; j < this.treeConfigAll.treeConfig.table.length; j++) {
|
|
168
|
+
let obj = this.treeConfigAll.treeConfig.table[j];
|
|
169
|
+
if (Object.keys(data).includes(obj.index)) {
|
|
170
|
+
this.treeConfigAll.treeConfig.table[j].columnList = data[obj.index];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
this.setSql();
|
|
174
|
+
},
|
|
175
|
+
setTable() {
|
|
176
|
+
let promise = []
|
|
177
|
+
for (let i = 0; i < this.treeConfigAll.treeConfig.table.length; i++) {
|
|
178
|
+
promise.push(get(this.http,this.url.columnsListUrl + this.treeConfigAll.treeConfig.dbName, {tableName: this.treeConfigAll.treeConfig.table[i].joinTable}))
|
|
179
|
+
}
|
|
180
|
+
Promise.all(promise).then((result) => {
|
|
181
|
+
for (let i = 0; i < result.length; i++) {
|
|
182
|
+
this.treeConfigAll.treeConfig.table[i]['columnList'] = result[i]
|
|
183
|
+
}
|
|
184
|
+
this.setSql()
|
|
185
|
+
})
|
|
186
|
+
},
|
|
187
|
+
setSql(index, seq) {
|
|
188
|
+
if (seq != undefined && seq != 0) {
|
|
189
|
+
let arr = this.treeConfigAll.treeConfig.table.find(item => {
|
|
190
|
+
return (item.index == seq)
|
|
191
|
+
})
|
|
192
|
+
if (!arr || !arr.joinTable) {
|
|
193
|
+
return
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (index != undefined && index != 0) {
|
|
197
|
+
this.treeConfigAll.treeConfig.table.splice(index, 1)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
let sqlTableOn = this.treeConfigAll.treeConfig.table[0].joinTable + " t1 "
|
|
201
|
+
let sqlFiled = ""
|
|
202
|
+
let tableColumns = []
|
|
203
|
+
let sort = 0
|
|
204
|
+
for (let i = 0; i < this.treeConfigAll.treeConfig.table.length; i++) {
|
|
205
|
+
if (i === index) {
|
|
206
|
+
continue
|
|
207
|
+
}
|
|
208
|
+
let obj = this.treeConfigAll.treeConfig.table[i]
|
|
209
|
+
for (let j = 0; j < obj.columnList.length; j++) {
|
|
210
|
+
let column = obj.columnList[j]
|
|
211
|
+
if (column.checked == 0) {
|
|
212
|
+
continue
|
|
213
|
+
}
|
|
214
|
+
if (sqlFiled.length != 0) {
|
|
215
|
+
sqlFiled += ","
|
|
216
|
+
}
|
|
217
|
+
sort++
|
|
218
|
+
sqlFiled += obj.index + "." + column.column_name + " AS " + column.column_name
|
|
219
|
+
let column_name = column.column_name
|
|
220
|
+
let column_comment = column.column_comment ? column.column_comment : column_name
|
|
221
|
+
tableColumns.push({
|
|
222
|
+
sort: sort,
|
|
223
|
+
tableField: column_name,
|
|
224
|
+
field: column_name,
|
|
225
|
+
title: column_comment,
|
|
226
|
+
label: column_comment,
|
|
227
|
+
visible: column.visible,
|
|
228
|
+
display: 1,
|
|
229
|
+
asName: column_name
|
|
230
|
+
})
|
|
231
|
+
}
|
|
232
|
+
if (i != 0) {
|
|
233
|
+
sqlTableOn += " " + obj.type + " " + obj.joinTable + " " + obj.index + " on " + obj.joinFiled
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// 新增字段
|
|
237
|
+
this.addColumn(tableColumns)
|
|
238
|
+
// 删除字段
|
|
239
|
+
this.removeColumn(tableColumns)
|
|
240
|
+
this.treeConfigAll.treeConfig.executeSql = "select " + sqlFiled + " from " + sqlTableOn
|
|
241
|
+
this.syncFormConfig()
|
|
242
|
+
},
|
|
243
|
+
removeColumn(tableColumns) {
|
|
244
|
+
for (let i = 0; i < this.treeConfigAll.tableColumn.length; i++) {
|
|
245
|
+
let remove = true
|
|
246
|
+
for (let tableColumn of tableColumns) {
|
|
247
|
+
if (this.treeConfigAll.tableColumn[i].field == tableColumn.field) {
|
|
248
|
+
remove = false
|
|
249
|
+
break
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
if (remove) {
|
|
253
|
+
this.treeConfigAll.tableColumn.splice(i, 1)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
addColumn(tableColumns) {
|
|
258
|
+
for (let tableColumn of tableColumns) {
|
|
259
|
+
let add = true
|
|
260
|
+
for (let column of this.treeConfigAll.tableColumn) {
|
|
261
|
+
if (column.field == tableColumn.field) {
|
|
262
|
+
add = false
|
|
263
|
+
break
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (add) {
|
|
267
|
+
this.treeConfigAll.tableColumn.push(tableColumn)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
setFieldConfig(filedConf) {
|
|
272
|
+
postQs(this.http,'/online/getTableSetFiled/' + this.treeConfigAll.treeConfig.dbName, {
|
|
273
|
+
sql: this.treeConfigAll.treeConfig.executeSql,
|
|
274
|
+
where: this.treeConfigAll.treeConfig.where,
|
|
275
|
+
uuid: this.treeConfigAll.treeConfig.uuid
|
|
276
|
+
}, undefined, false).then((data) => {
|
|
277
|
+
this.setFormTable(data.data)
|
|
278
|
+
if (filedConf) {
|
|
279
|
+
this.$refs.filedConfig.init(this.treeConfigAll.treeConfig.table)
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
},
|
|
283
|
+
setFormTable(data) {
|
|
284
|
+
let tableNames = this.getTableNamesByFormSql()
|
|
285
|
+
let tables = []
|
|
286
|
+
for (const key of Object.keys(data)) {
|
|
287
|
+
let table = {
|
|
288
|
+
index: 't1',
|
|
289
|
+
type: '主表',
|
|
290
|
+
joinTable: key,
|
|
291
|
+
joinFiled: '/',
|
|
292
|
+
deleteWhere: '',
|
|
293
|
+
columnList: [],
|
|
294
|
+
tableComment: this.getTableComment(key)
|
|
295
|
+
}
|
|
296
|
+
table.columnList = Object.values(data[key])
|
|
297
|
+
tables.push(table)
|
|
298
|
+
}
|
|
299
|
+
this.treeConfigAll.treeConfig.table = []
|
|
300
|
+
for (let i = 0; i < tableNames.length; i++) {
|
|
301
|
+
const tableName = tableNames[i]
|
|
302
|
+
for (const table of tables) {
|
|
303
|
+
if (tableName.includes(table.joinTable)) {
|
|
304
|
+
if (i == 0) {
|
|
305
|
+
table.deleteWhere = 'id=${id}'
|
|
306
|
+
table.mainTable = table.joinTable
|
|
307
|
+
}
|
|
308
|
+
if (i != 0) {
|
|
309
|
+
table.index = 't' + (i + 1)
|
|
310
|
+
table.type = 'join'
|
|
311
|
+
let joinFiled = tableName.substring(tableName.indexOf('on') + 2).replace(/[\n\t\s]+/g, '')
|
|
312
|
+
if (tableNames[i - 1].includes('left')) {
|
|
313
|
+
table.type = 'left join'
|
|
314
|
+
joinFiled = joinFiled.replace('left', '')
|
|
315
|
+
}
|
|
316
|
+
if (tableNames[i - 1].includes('right')) {
|
|
317
|
+
table.type = 'right join'
|
|
318
|
+
joinFiled = joinFiled.replace('right', '')
|
|
319
|
+
}
|
|
320
|
+
table.joinFiled = joinFiled
|
|
321
|
+
}
|
|
322
|
+
this.treeConfigAll.treeConfig.table.push(table)
|
|
323
|
+
break
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
getTableNamesByFormSql() {
|
|
329
|
+
let formSql = this.treeConfigAll.treeConfig.executeSql.substring(this.treeConfigAll.treeConfig.executeSql.indexOf('from') + 4)
|
|
330
|
+
let tableNames = []
|
|
331
|
+
for (const join of formSql.split('join')) {
|
|
332
|
+
tableNames.push(join)
|
|
333
|
+
}
|
|
334
|
+
return tableNames
|
|
335
|
+
},
|
|
336
|
+
getTableComment(key) {
|
|
337
|
+
for (const item of this.treeConfigAll.dicData.joinTableDicData) {
|
|
338
|
+
if (item.value == key) return item.label
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
</script>
|
|
344
|
+
<style lang="less">
|
|
345
|
+
.hover-wrapper {
|
|
346
|
+
/* 定义悬停时的样式 */
|
|
347
|
+
position: relative;
|
|
348
|
+
/* 其他样式 */
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.action-buttons {
|
|
352
|
+
/* 隐藏按钮的默认样式 */
|
|
353
|
+
display: none;
|
|
354
|
+
position: absolute; /* 或者其他你需要的定位方式 */
|
|
355
|
+
/* 其他样式 */
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.hover-wrapper:hover .action-buttons {
|
|
359
|
+
/* 悬停时显示按钮 */
|
|
360
|
+
display: block;
|
|
361
|
+
}
|
|
362
|
+
</style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
"t1": "node-click",
|
|
4
|
+
"t2": "当节点被点击的时候触发,四个参数:对应于节点点击的节点对象,TreeNode 的 node 属性, TreeNode和事件对象",
|
|
5
|
+
"t3": "function",
|
|
6
|
+
$cellEdit: true,
|
|
7
|
+
"t5": ""
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"t1": "node-contextmenu",
|
|
11
|
+
"t2": "当某一节点被鼠标右键点击时会触发该事件,共四个参数,依次为:event、传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。",
|
|
12
|
+
"t3": "function",
|
|
13
|
+
$cellEdit: true,
|
|
14
|
+
"t5": ""
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"t1": "check-change",
|
|
18
|
+
"t2": "当复选框被点击的时候触发,共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点本身是否被选中、节点的子树中是否有被选中的节点",
|
|
19
|
+
"t3": "function",
|
|
20
|
+
$cellEdit: true,
|
|
21
|
+
"t5": ""
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"t1": "check",
|
|
25
|
+
"t2": "点击节点复选框之后触发,共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性",
|
|
26
|
+
"t3": "function",
|
|
27
|
+
$cellEdit: true,
|
|
28
|
+
"t5": ""
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"t1": "current-change",
|
|
32
|
+
"t2": "当前选中节点变化时触发的事件,共两个参数,依次为:当前节点的数据,当前节点的 Node 对象",
|
|
33
|
+
"t3": "function",
|
|
34
|
+
$cellEdit: true,
|
|
35
|
+
"t5": ""
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"t1": "node-expand",
|
|
39
|
+
"t2": "节点被展开时触发的事件,共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身",
|
|
40
|
+
"t3": "function",
|
|
41
|
+
$cellEdit: true,
|
|
42
|
+
"t5": ""
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"t1": "node-collapse",
|
|
46
|
+
"t2": "节点被关闭时触发的事件,共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身",
|
|
47
|
+
"t3": "function",
|
|
48
|
+
$cellEdit: true,
|
|
49
|
+
"t5": ""
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"t1": "node-drag-start",
|
|
53
|
+
"t2": "节点开始拖拽时触发的事件,共两个参数,依次为:被拖拽节点对应的 Node、event",
|
|
54
|
+
"t3": "function",
|
|
55
|
+
$cellEdit: true,
|
|
56
|
+
"t5": ""
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"t1": "node-drag-enter",
|
|
60
|
+
"t2": "拖拽进入其他节点时触发的事件,共三个参数,依次为:被拖拽节点对应的 Node、所进入节点对应的 Node、event",
|
|
61
|
+
"t3": "function",
|
|
62
|
+
$cellEdit: true,
|
|
63
|
+
"t5": ""
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"t1": "node-drag-leave",
|
|
67
|
+
"t2": "拖拽离开某个节点时触发的事件,共三个参数,依次为:被拖拽节点对应的 Node、所离开节点对应的 Node、event",
|
|
68
|
+
"t3": "function",
|
|
69
|
+
$cellEdit: true,
|
|
70
|
+
"t5": ""
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"t1": "node-drag-over",
|
|
74
|
+
"t2": "在拖拽节点时触发的事件(类似浏览器的 mouseover 事件),共三个参数,依次为:被拖拽节点对应的 Node、当前进入节点对应的 Node、event",
|
|
75
|
+
"t3": "function",
|
|
76
|
+
$cellEdit: true,
|
|
77
|
+
"t5": ""
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"t1": "node-drag-end",
|
|
81
|
+
"t2": "拖拽结束时(可能未成功)触发的事件,共四个参数,依次为:被拖拽节点对应的 Node、结束拖拽时最后进入的节点(可能为空)、被拖拽节点的放置位置(before、after、inner)、event",
|
|
82
|
+
"t3": "function",
|
|
83
|
+
$cellEdit: true,
|
|
84
|
+
"t5": ""
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"t1": "node-drop",
|
|
88
|
+
"t2": "拖拽成功完成时触发的事件,共四个参数,依次为:被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置(before、after、inner)、event",
|
|
89
|
+
"t3": "function",
|
|
90
|
+
$cellEdit: true,
|
|
91
|
+
"t5": ""
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
]
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
"t1": "empty-text",
|
|
4
|
+
"t2": "内容为空的时候展示的文本",
|
|
5
|
+
"t3": "string",
|
|
6
|
+
$cellEdit: true, "t5": "",
|
|
7
|
+
}, {
|
|
8
|
+
"t1": "node-key",
|
|
9
|
+
"t2": "每个树节点用来作为唯一标识的属性,整棵树应该是唯一的",
|
|
10
|
+
"t3": "string",
|
|
11
|
+
$cellEdit: true, "t5": "",
|
|
12
|
+
}, {
|
|
13
|
+
"t1": "render-after-expand",
|
|
14
|
+
"t2": "是否在第一次展开某个树节点后才渲染其子节点",
|
|
15
|
+
"t3": "boolean",
|
|
16
|
+
$cellEdit: true, "t5": true
|
|
17
|
+
}, {
|
|
18
|
+
"t1": "load",
|
|
19
|
+
"t2": "加载子树数据的方法,仅当 lazy 属性为true 时生效",
|
|
20
|
+
"t3": "function",
|
|
21
|
+
$cellEdit: true, "t5": "",
|
|
22
|
+
}, {
|
|
23
|
+
"t1": "render-content",
|
|
24
|
+
"t2": "树节点的内容区的渲染 Function",
|
|
25
|
+
"t3": "function",
|
|
26
|
+
$cellEdit: true, "t5": "",
|
|
27
|
+
}, {
|
|
28
|
+
"t1": "highlight-current",
|
|
29
|
+
"t2": "是否高亮当前选中节点,默认值是 false。",
|
|
30
|
+
"t3": "boolean",
|
|
31
|
+
$cellEdit: true, "t5": false
|
|
32
|
+
}, {
|
|
33
|
+
"t1": "expand-on-click-node",
|
|
34
|
+
"t2": "是否在点击节点的时候展开或者收缩节点, 默认值为 true,如果为 false,则只有点箭头图标的时候才会展开或者收缩节点。",
|
|
35
|
+
"t3": "boolean",
|
|
36
|
+
$cellEdit: true, "t5": true
|
|
37
|
+
}, {
|
|
38
|
+
"t1": "check-on-click-node",
|
|
39
|
+
"t2": "是否在点击节点的时候选中节点,默认值为 false,即只有在点击复选框时才会选中节点。",
|
|
40
|
+
"t3": "boolean",
|
|
41
|
+
$cellEdit: true, "t5": false
|
|
42
|
+
}, {
|
|
43
|
+
"t1": "auto-expand-parent",
|
|
44
|
+
"t2": "展开子节点的时候是否自动展开父节点",
|
|
45
|
+
"t3": "boolean",
|
|
46
|
+
$cellEdit: true, "t5": true
|
|
47
|
+
}, {
|
|
48
|
+
"t1": "default-expanded-keys",
|
|
49
|
+
"t2": "默认展开的节点的 key 的数组",
|
|
50
|
+
"t3": "array",
|
|
51
|
+
$cellEdit: true, "t5": "",
|
|
52
|
+
}, {
|
|
53
|
+
"t1": "check-strictly",
|
|
54
|
+
"t2": "在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认为 false",
|
|
55
|
+
"t3": "boolean",
|
|
56
|
+
$cellEdit: true, "t5": false
|
|
57
|
+
}, {
|
|
58
|
+
"t1": "default-checked-keys",
|
|
59
|
+
"t2": "默认勾选的节点的 key 的数组",
|
|
60
|
+
"t3": "array",
|
|
61
|
+
$cellEdit: true, "t5": "",
|
|
62
|
+
}, {"t1": "current-node-key", "t2": "当前选中的节点", "t3": "string,number", $cellEdit: true, "t5": "",}, {
|
|
63
|
+
"t1": "filter-node-method",
|
|
64
|
+
"t2": "对树节点进行筛选时执行的方法, 返回 false 则表示这个节点会被隐藏",
|
|
65
|
+
"t3": "function",
|
|
66
|
+
$cellEdit: true, "t5": "",
|
|
67
|
+
}, {"t1": "accordion", "t2": "是否每次只打开一个同级树节点展开", "t3": "boolean", $cellEdit: true, "t5": false}, {
|
|
68
|
+
"t1": "indent",
|
|
69
|
+
"t2": "相邻级节点间的水平缩进,单位为像素",
|
|
70
|
+
"t3": "number",
|
|
71
|
+
$cellEdit: true, "t5": 18
|
|
72
|
+
}, {"t1": "icon", "t2": "自定义树节点图标组件", "t3": "string | Component", $cellEdit: true, "t5": "",}, {
|
|
73
|
+
"t1": "lazy",
|
|
74
|
+
"t2": "是否懒加载子节点,需与 load 方法结合使用",
|
|
75
|
+
"t3": "boolean",
|
|
76
|
+
$cellEdit: true, "t5": false
|
|
77
|
+
}, {"t1": "draggable", "t2": "是否开启拖拽节点功能", "t3": "boolean", $cellEdit: true, "t5": false}, {
|
|
78
|
+
"t1": "allow-drag",
|
|
79
|
+
"t2": "判断节点能否被拖拽 如果返回 false ,节点不能被拖动",
|
|
80
|
+
"t3": "function",
|
|
81
|
+
$cellEdit: true, "t5": "",
|
|
82
|
+
}, {
|
|
83
|
+
"t1": "allow-drop",
|
|
84
|
+
"t2": "拖拽时判定目标节点能否成为拖动目标位置。 如果返回 false ,拖动节点不能被拖放到目标节点。 type 参数有三种情况:'prev'、'inner' 和 'next',分别表示放置在目标节点前、插入至目标节点和放置在目标节点后",
|
|
85
|
+
"t3": "Function(draggingNode, dropNode, type)",
|
|
86
|
+
$cellEdit: true, "t5": "",
|
|
87
|
+
},
|
|
88
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
/*{
|
|
3
|
+
"t1": "label",
|
|
4
|
+
"t2": "指定节点标签为节点对象的某个属性值",
|
|
5
|
+
"t3": "string, function(data, node)",
|
|
6
|
+
$cellEdit: true,
|
|
7
|
+
"t5": ""
|
|
8
|
+
},*/ {
|
|
9
|
+
"t1": "children", "t2": "指定子树为节点对象的某个属性值", "t3": "string", $cellEdit: true, "t5": "",
|
|
10
|
+
}, {
|
|
11
|
+
"t1": "disabled",
|
|
12
|
+
"t2": "指定节点选择框是否禁用为节点对象的某个属性值",
|
|
13
|
+
"t3": "string, function(data, node)",
|
|
14
|
+
$cellEdit: true,
|
|
15
|
+
"t5": "",
|
|
16
|
+
}, {
|
|
17
|
+
"t1": "isLeaf",
|
|
18
|
+
"t2": "指定节点是否为叶子节点,仅在指定了 lazy 属性的情况下生效",
|
|
19
|
+
"t3": "string, function(data, node)",
|
|
20
|
+
$cellEdit: true,
|
|
21
|
+
"t5": "",
|
|
22
|
+
}, {
|
|
23
|
+
"t1": "class",
|
|
24
|
+
"t2": "自定义节点类名",
|
|
25
|
+
"t3": "string, function(data, node)",
|
|
26
|
+
$cellEdit: true,
|
|
27
|
+
"t5": ''
|
|
28
|
+
}]
|