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,362 +0,0 @@
|
|
|
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>
|
|
@@ -1,95 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,88 +0,0 @@
|
|
|
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
|
-
]
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
}]
|