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,376 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog
|
|
3
|
+
v-model="show"
|
|
4
|
+
:title="'配置中心 - '+provides.form.theme"
|
|
5
|
+
width="90%"
|
|
6
|
+
:close-on-press-escape="false"
|
|
7
|
+
:close-on-click-modal="false"
|
|
8
|
+
destroy-on-close
|
|
9
|
+
:show-close="false"
|
|
10
|
+
style="height: 800px;"
|
|
11
|
+
align-center
|
|
12
|
+
>
|
|
13
|
+
<el-tabs v-model="activeName" @tab-change="updateShow" v-loading="loading"
|
|
14
|
+
:element-loading-text="provides.loadingText"
|
|
15
|
+
element-loading-background="rgba(122, 122, 122, 0.8)" :key="'config_el_tables_1'" style="height: 680px">
|
|
16
|
+
<el-tab-pane label="数据配置" name="baseConfig">
|
|
17
|
+
<BaseConfig :columns="columns" ref="baseConfig" @updateTable="updateTable" @loading="loading = $event"
|
|
18
|
+
@updateCurd="updateCurd"/>
|
|
19
|
+
</el-tab-pane>
|
|
20
|
+
<el-tab-pane label="table配置" name="tableConfig">
|
|
21
|
+
<TableConfig ref="tableConfig" @tableConfigChange="tableConfigChange"/>
|
|
22
|
+
</el-tab-pane>
|
|
23
|
+
<el-tab-pane label="列配置" name="columnConfig">
|
|
24
|
+
<ColumnConfig :addVisible="provides.form.toolBut.indexOf('add') != -1"
|
|
25
|
+
:editVisible="provides.form.operationBut.indexOf('edit') != -1" ref="columnConfig"
|
|
26
|
+
@checkBoxChange="columnCheckBoxChange"
|
|
27
|
+
@checkBoxAll="columnCheckBoxAll"/>
|
|
28
|
+
</el-tab-pane>
|
|
29
|
+
<el-tab-pane :label="item.name+'表单配置'" :name="item.code"
|
|
30
|
+
v-for="item in provides.form.toolButOptions.filter(option=>option.isForm == 1)">
|
|
31
|
+
<FormConfig :type="item.code" :ref="(el) => setRefMap(el, item.code)"/>
|
|
32
|
+
</el-tab-pane>
|
|
33
|
+
<!-- 编辑表单配置 -->
|
|
34
|
+
<el-tab-pane :label="item.name+'表单配置'" :name="item.code"
|
|
35
|
+
v-for="item in provides.form.operationButOptions.filter(option=>option.isForm == 1)">
|
|
36
|
+
<FormConfig :type="item.code" :ref="(el) => setRefMap(el, item.code)"/>
|
|
37
|
+
</el-tab-pane>
|
|
38
|
+
<!-- <el-tab-pane label="新增表单配置" name="add" v-if="provides.form.toolBut.indexOf('add') != -1">
|
|
39
|
+
<FormConfig type="add" :ref="(el) => setRefMap(el, 'add')"/>
|
|
40
|
+
</el-tab-pane>
|
|
41
|
+
<el-tab-pane label="编辑表单配置" name="edit" v-if="provides.form.operationBut.indexOf('edit') != -1">
|
|
42
|
+
<FormConfig type="edit" :ref="(el) => setRefMap(el, 'edit')"/>
|
|
43
|
+
</el-tab-pane>-->
|
|
44
|
+
<!-- <el-tab-pane label="脚本配置" name="scriptConfig">
|
|
45
|
+
<ScriptConfig ref="scriptConfig"/>
|
|
46
|
+
</el-tab-pane>-->
|
|
47
|
+
</el-tabs>
|
|
48
|
+
<template #footer>
|
|
49
|
+
<el-button @click="show = false;emits('configClose');" :loading="loading">取 消</el-button>
|
|
50
|
+
<el-button type="primary" @click="saveClick" :loading="loading">保 存</el-button>
|
|
51
|
+
</template>
|
|
52
|
+
</el-dialog>
|
|
53
|
+
</template>
|
|
54
|
+
<script setup>
|
|
55
|
+
import {nextTick, provide, reactive, ref, toRaw, defineExpose, defineEmits, inject} from "vue";
|
|
56
|
+
import BaseConfig from "@/views/table/add-or-edit/config/base-config/index.vue";
|
|
57
|
+
import ColumnConfig from "@/views/table/add-or-edit/config/column-config/index.vue";
|
|
58
|
+
import TableConfig from "@/views/table/add-or-edit/config/table-config/index.vue";
|
|
59
|
+
import FormConfig from "@/views/table/add-or-edit/config/form-config/index.vue";
|
|
60
|
+
import initFormObject from "@/views/table/add-or-edit/config/initFormObject.js";
|
|
61
|
+
import ScriptConfig from "@/views/table/add-or-edit/config/script-config/index.vue";
|
|
62
|
+
import {post, get} from "@/utils/http/httpUtils";
|
|
63
|
+
import {useMessage} from "@/utils/message";
|
|
64
|
+
|
|
65
|
+
const msg = useMessage() // 消息弹窗
|
|
66
|
+
const refMap = ref({});
|
|
67
|
+
|
|
68
|
+
const setRefMap = (el, item) => {
|
|
69
|
+
if (el) {
|
|
70
|
+
refMap.value[item] = el
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const http = inject("http")
|
|
74
|
+
const show = ref(false);
|
|
75
|
+
const loading = ref(true);
|
|
76
|
+
const baseConfig = ref(null);
|
|
77
|
+
const tableConfig = ref(null);
|
|
78
|
+
const columnConfig = ref(null);
|
|
79
|
+
const columns = ref([])
|
|
80
|
+
const provides = reactive({
|
|
81
|
+
loadingText: '正在获取数据...',
|
|
82
|
+
form: {
|
|
83
|
+
mainTable: '',
|
|
84
|
+
hump: '0',
|
|
85
|
+
definitionSql: '0',
|
|
86
|
+
executeSql: '',
|
|
87
|
+
executeWhere: '',
|
|
88
|
+
parameterDefault: '',
|
|
89
|
+
paging: '1',
|
|
90
|
+
selectBox: '2',
|
|
91
|
+
tips: '1',
|
|
92
|
+
tree: '0',
|
|
93
|
+
treeParentId: '',
|
|
94
|
+
openColumn: '',
|
|
95
|
+
operationBut: [],
|
|
96
|
+
tableDelete: {},
|
|
97
|
+
toolBut: [],
|
|
98
|
+
parentId: '',
|
|
99
|
+
theme: '',
|
|
100
|
+
toolButOptions: [],
|
|
101
|
+
operationButOptions: [],
|
|
102
|
+
},
|
|
103
|
+
updateIndex: 0,
|
|
104
|
+
tableColumn: [],
|
|
105
|
+
tableOption: '{}',
|
|
106
|
+
operationButConfig: [],
|
|
107
|
+
toolButConfig: [],
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
const activeName = ref('baseConfig')
|
|
111
|
+
|
|
112
|
+
//列配置多选框更新
|
|
113
|
+
const columnCheckBoxChange = ({row, column}) => {
|
|
114
|
+
nextTick(() => {
|
|
115
|
+
if (column.field == 'addDisplay' && refMap.value['add']) {
|
|
116
|
+
//新增多选点击
|
|
117
|
+
refMap.value['add'].updateData(row, column)
|
|
118
|
+
} else if (column.field == 'editDisplay' && refMap.value['edit']) {
|
|
119
|
+
refMap.value['edit'].updateData(row, column)
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function updateShow(v) {
|
|
125
|
+
if (v == 'columnConfig') {
|
|
126
|
+
columnConfig.value.setShow(true);
|
|
127
|
+
} else if (refMap.value[v]) {
|
|
128
|
+
refMap.value[v].setShow(true);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
//列配置全选框更新
|
|
133
|
+
const columnCheckBoxAll = ({checkBoxName, isAll, list}) => {
|
|
134
|
+
nextTick(() => {
|
|
135
|
+
//新增全选和全不选
|
|
136
|
+
if (refMap.value[checkBoxName]) {
|
|
137
|
+
refMap.value[checkBoxName].setAll({list, isAll})
|
|
138
|
+
}
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function setOtherProp(item) {
|
|
143
|
+
let filedToOtherProp = Object.keys(item).filter(item => item.indexOf("ToOtherProp") != -1);
|
|
144
|
+
if (filedToOtherProp.length != 0) {
|
|
145
|
+
let otherProp = {};
|
|
146
|
+
if (item.otherProp) {
|
|
147
|
+
try {
|
|
148
|
+
otherProp = JSON.parse(item.otherProp)
|
|
149
|
+
if(!otherProp){
|
|
150
|
+
otherProp = {};
|
|
151
|
+
}
|
|
152
|
+
}catch (e) {
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
for (let filed of filedToOtherProp) {
|
|
156
|
+
if(item[filed] != undefined){
|
|
157
|
+
otherProp[filed] = item[filed];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//将展开行的表单设置为json的形式传给其他属性
|
|
161
|
+
item.otherProp = JSON.stringify(otherProp)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//点击保存
|
|
166
|
+
const saveClick = () => {
|
|
167
|
+
let columnConfigData = columnConfig.value.gridOptions.data
|
|
168
|
+
baseConfig.value.parseData(provides.form);
|
|
169
|
+
if ((provides.form.toolBut.indexOf("batchDelete") != -1 || provides.form.operationBut.indexOf("delete") != -1) && !provides.form.deleteWhere) {
|
|
170
|
+
msg.error("您启用删除功能,请填写删除条件!")
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
let tableConfigData = tableConfig.value
|
|
174
|
+
//保存列配置
|
|
175
|
+
columnConfigData.forEach(item => {
|
|
176
|
+
setOtherProp(item);
|
|
177
|
+
//下拉值为空字符串时置为Null处理
|
|
178
|
+
item.selectType = item.selectType != '' ? item.selectType : null
|
|
179
|
+
item.tableField = item.tableField ? item.tableField : item.field
|
|
180
|
+
item.fixed = item.fixed != '' ? item.fixed : null
|
|
181
|
+
item.selectDom = item.selectDom != '' ? item.selectDom : null
|
|
182
|
+
})
|
|
183
|
+
provides.tableColumn = columnConfigData
|
|
184
|
+
provides.tableGroupHeader = columnConfig.value.getGroupColumnData()
|
|
185
|
+
provides.form.optionJson = JSON.stringify(tableConfigData.getOptions())
|
|
186
|
+
if (refMap.value['add'] && refMap.value['add'].getData()) {
|
|
187
|
+
try {
|
|
188
|
+
JSON.parse(refMap.value['add'].getData().codeForm)
|
|
189
|
+
} catch (e) {
|
|
190
|
+
console.error(e)
|
|
191
|
+
msg.error('解析编码设计json失败,请检查对象格式是否正确' + e)
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
setFormList();
|
|
196
|
+
if (provides.form.operationBut.includes('edit') && provides.formMainList) {
|
|
197
|
+
for (const item of provides.formMainList) {
|
|
198
|
+
// 基础表单 编辑时,更新条件或保存路径不能为空!
|
|
199
|
+
if (item.formMain.designer == '0'
|
|
200
|
+
&& item.formMain.formType == 'edit'
|
|
201
|
+
&& item.formMain.updateKey.trim() == '' && item.formMain.saveUrl.trim() == '') {
|
|
202
|
+
activeName.value = 'edit'
|
|
203
|
+
msg.error("基础表单 编辑时,更新条件或保存路径不能为空!")
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
saveData()
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function setFormList() {
|
|
212
|
+
//保存新增和编辑表单配置
|
|
213
|
+
provides.formMainList = [];
|
|
214
|
+
for (let key of Object.keys(refMap.value)) {
|
|
215
|
+
provides.formMainList.push(getFormMain(refMap.value[key]));
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
function getFormMain(formConfig) {
|
|
220
|
+
let form = formConfig.getForm();
|
|
221
|
+
let formConfigData = formConfig.getData();
|
|
222
|
+
let formMain = {
|
|
223
|
+
uuid: provides.form.uuid,
|
|
224
|
+
}
|
|
225
|
+
let formJson = {};
|
|
226
|
+
if (formConfigData) {
|
|
227
|
+
formMain.designer = "" + formConfigData.designer; //表单类型 (0)基础表单 (1)自定义表单
|
|
228
|
+
formMain.customForm = formConfigData.customForm;
|
|
229
|
+
formJson.optionJson = formConfigData.codeForm;
|
|
230
|
+
formJson.customJson = JSON.stringify(formConfigData.customJson);
|
|
231
|
+
}
|
|
232
|
+
for (let key of Object.keys(form)) {
|
|
233
|
+
formMain[key] = form[key];
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
formMain,
|
|
237
|
+
formJson
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function saveData() {
|
|
242
|
+
loading.value = true;
|
|
243
|
+
// baseConfig.value.setDeleteTable();
|
|
244
|
+
post(http, "/online/tableConfig/saveJson", toRaw(provides), undefined, false).then(({code}) => {
|
|
245
|
+
if (code == 200) {
|
|
246
|
+
show.value = false;
|
|
247
|
+
nextTick(() => {
|
|
248
|
+
emits('configClose', provides.form.theme);
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
}).finally(() => {
|
|
252
|
+
loading.value = false;
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
//数据配置更新数据表
|
|
258
|
+
function updateTable(data) {
|
|
259
|
+
columnConfig.value.updateData(data)
|
|
260
|
+
loading.value = false
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const updateCurd = () => {
|
|
264
|
+
columnConfig.value.setAddDisplay("1")
|
|
265
|
+
columnConfig.value.setEditDisplay("1")
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
//配置中心更新数据
|
|
269
|
+
function tableConfigChange(map) {
|
|
270
|
+
columnConfig.value.updateColumnConfig(map)
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const updateBtnData = (options, type) => {
|
|
274
|
+
let butType = type.substr(0, type.indexOf('Options'));
|
|
275
|
+
for (let i = options.length - 1; i >= 0; i--) {
|
|
276
|
+
let o = options[i];
|
|
277
|
+
if (provides.form[butType].indexOf(o.code) == -1) {
|
|
278
|
+
provides.form[butType].push(o.code)
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
provides.form[type] = options
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function initForm(res) {
|
|
285
|
+
res.form = JSON.parse(JSON.stringify(initFormObject));
|
|
286
|
+
res.tableColumn = [];
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
function parseOtherProp(res) {
|
|
290
|
+
if(!res.tableColumn){
|
|
291
|
+
return
|
|
292
|
+
}
|
|
293
|
+
for (let column of res.tableColumn) {
|
|
294
|
+
if (column.otherProp && column.otherProp != '') {
|
|
295
|
+
try {
|
|
296
|
+
let otherProp = JSON.parse(column.otherProp);
|
|
297
|
+
for (let key of Object.keys(otherProp)) {
|
|
298
|
+
column[key] = otherProp[key];
|
|
299
|
+
}
|
|
300
|
+
}catch (e){}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
function init({o, v}) {
|
|
306
|
+
show.value = true;
|
|
307
|
+
loading.value = true;
|
|
308
|
+
provides.loadingText = "正在加载数据...";
|
|
309
|
+
get(http, "/online/tableConfig/getJson", {uuid: v.uuid, theme: o}).then(res => {
|
|
310
|
+
parseOtherProp(res);
|
|
311
|
+
provides.toolButConfig = res.toolButConfig;
|
|
312
|
+
provides.operationButConfig = res.operationButConfig;
|
|
313
|
+
if (res.newConfig) {
|
|
314
|
+
initForm(res);
|
|
315
|
+
res.form.parentId = v.parentId;
|
|
316
|
+
res.form.uuid = v.uuid;
|
|
317
|
+
res.form.theme = o;
|
|
318
|
+
}
|
|
319
|
+
provides.form = res.form;
|
|
320
|
+
if (!res.form.optionJson) {
|
|
321
|
+
res.form.optionJson = "{}"
|
|
322
|
+
}
|
|
323
|
+
// 将json解析为对象
|
|
324
|
+
provides.form.optionObj = JSON.parse(res.form.optionJson)
|
|
325
|
+
if (provides.form.optionObj.table) {
|
|
326
|
+
provides.form.tableObj = provides.form.optionObj.table
|
|
327
|
+
} else {
|
|
328
|
+
provides.form.tableObj = {}
|
|
329
|
+
}
|
|
330
|
+
provides.tableColumn = res.tableColumn;
|
|
331
|
+
columnConfig.value.setData(res.tableColumn)
|
|
332
|
+
baseConfig.value.setData(res.form);
|
|
333
|
+
tableConfig.value.setData(res.form)
|
|
334
|
+
nextTick(() => {
|
|
335
|
+
if (res.formMainList) {
|
|
336
|
+
for (let obj of provides.form.toolButOptions) {
|
|
337
|
+
let data = res.formMainList[obj.code];
|
|
338
|
+
if (data && refMap.value[obj.code]) {
|
|
339
|
+
refMap.value[obj.code].setData(data)
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
for (let obj of provides.form.operationButOptions) {
|
|
343
|
+
let data = res.formMainList[obj.code];
|
|
344
|
+
if (data && refMap.value[obj.code]) {
|
|
345
|
+
refMap.value[obj.code].setData(data)
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
})
|
|
350
|
+
loading.value = false;
|
|
351
|
+
}).catch(() => {
|
|
352
|
+
loading.value = false;
|
|
353
|
+
})
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
provide('configData', provides);
|
|
358
|
+
provide('updateBtnData', updateBtnData)
|
|
359
|
+
const emits = (m, v) => {
|
|
360
|
+
if (m == "updateVisible") {
|
|
361
|
+
baseConfig.value.refreshColumn();
|
|
362
|
+
} else {
|
|
363
|
+
emit("emits", {m: m, v});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// 子组件调用父组件
|
|
368
|
+
const emit = defineEmits(["emits"]); //声明 emits
|
|
369
|
+
defineExpose({
|
|
370
|
+
init,
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
</script>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
"hump": "0",
|
|
3
|
+
"toolBut": [
|
|
4
|
+
"add",
|
|
5
|
+
"batchDelete",
|
|
6
|
+
"upload",
|
|
7
|
+
"download"
|
|
8
|
+
],
|
|
9
|
+
"tree": "0",
|
|
10
|
+
"paging": "1",
|
|
11
|
+
"seq": "1",
|
|
12
|
+
"executeSql": '',
|
|
13
|
+
"definitionSql": "0",
|
|
14
|
+
"requestType": "0",
|
|
15
|
+
"tips": "1",
|
|
16
|
+
"operationButOptions": [],
|
|
17
|
+
"toolButOptions": [],
|
|
18
|
+
"operationBut": [
|
|
19
|
+
"edit",
|
|
20
|
+
"delete"
|
|
21
|
+
],
|
|
22
|
+
"selectBox": "2",
|
|
23
|
+
"theme": "t1",
|
|
24
|
+
"init": "1"
|
|
25
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<p>
|
|
4
|
+
<vxe-button @click="expandAllEvent">展开</vxe-button>
|
|
5
|
+
<vxe-button @click="claseExpandEvent">关闭</vxe-button>
|
|
6
|
+
</p>
|
|
7
|
+
<!-- 树表格-->
|
|
8
|
+
<vxe-table
|
|
9
|
+
border="inner"
|
|
10
|
+
size="small"
|
|
11
|
+
ref="tableRef"
|
|
12
|
+
:column-config="{resizable: true}"
|
|
13
|
+
:tree-config="{transform: true, rowField: 'id', parentField: 'parentId'}"
|
|
14
|
+
:data="tableData"
|
|
15
|
+
@toggle-tree-expand="toggleExpandChangeEvent">
|
|
16
|
+
<vxe-column field="name" title="名称" tree-node></vxe-column>
|
|
17
|
+
<!-- <vxe-column field="size" title="类型"></vxe-column> -->
|
|
18
|
+
|
|
19
|
+
<vxe-column title="操作" width="140">
|
|
20
|
+
<template #default="{ row }">
|
|
21
|
+
<vxe-button mode="text" icon="vxe-icon-add"></vxe-button>
|
|
22
|
+
<vxe-button mode="text" icon="vxe-icon-edit"></vxe-button>
|
|
23
|
+
<vxe-button mode="text" icon="vxe-icon-delete" @click="removeRowEvent(row)"></vxe-button>
|
|
24
|
+
</template>
|
|
25
|
+
</vxe-column>
|
|
26
|
+
</vxe-table>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script setup>
|
|
31
|
+
import { ref } from 'vue'
|
|
32
|
+
import { VXETable, VxeTableInstance, VxeTableEvents } from 'vxe-table'
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const tableRef = ref()
|
|
37
|
+
|
|
38
|
+
const tableData = ref([
|
|
39
|
+
{ id: 1, parentId: null, name: '表格', type: '', size: 1024, date: '2020-08-01' },
|
|
40
|
+
{ id: 2, parentId: 1, name: '新增', type: '表格', size: 1024, date: '2020-08-01' },
|
|
41
|
+
{ id: 3, parentId: 1, name: '编辑', type: '表格', size: 1024, date: '2020-08-01' },
|
|
42
|
+
{ id: 4, parentId: 1, name: '删除', type: '表格', size: 1024, date: '2020-08-01' },
|
|
43
|
+
{ id: 5, parentId: null, name: '表单', type: '', size: 1024, date: '2020-08-01' },
|
|
44
|
+
{ id: 3, parentId: 5, name: '编辑', type: '表单', size: 1024, date: '2020-08-01' },
|
|
45
|
+
{ id: 4, parentId: 5, name: '删除', type: '表单', size: 1024, date: '2020-08-01' },
|
|
46
|
+
])
|
|
47
|
+
|
|
48
|
+
// 展开事件
|
|
49
|
+
const toggleExpandChangeEvent = (params) => {
|
|
50
|
+
const $table = tableRef.value
|
|
51
|
+
if ($table) {
|
|
52
|
+
const { row, expanded } = params
|
|
53
|
+
console.log('节点展开事件', expanded, '获取父节点:', $table.getParentRow(row))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//全部展开
|
|
58
|
+
const expandAllEvent = () => {
|
|
59
|
+
const $table = tableRef.value
|
|
60
|
+
if ($table) {
|
|
61
|
+
$table.setAllTreeExpand(true)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//全部关闭
|
|
65
|
+
const claseExpandEvent = () => {
|
|
66
|
+
const $table = tableRef.value
|
|
67
|
+
if ($table) {
|
|
68
|
+
$table.clearTreeExpand()
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-button type="primary">预览脚本</el-button>
|
|
3
|
+
|
|
4
|
+
<el-row>
|
|
5
|
+
<!-- 左边树状菜单 -->
|
|
6
|
+
<el-col :span="6" class="bordered-col">
|
|
7
|
+
<div class="height-col">
|
|
8
|
+
<LeftMeun></LeftMeun>
|
|
9
|
+
</div>
|
|
10
|
+
</el-col>
|
|
11
|
+
<!-- codemirror代码在线预览 -->
|
|
12
|
+
<el-col :span="18" class="bordered-col">
|
|
13
|
+
<div class="height-col colored-div">
|
|
14
|
+
<codemirror
|
|
15
|
+
v-model="values"
|
|
16
|
+
:autofocus="true"
|
|
17
|
+
:indent-with-tab="true"
|
|
18
|
+
:tabSize="2"
|
|
19
|
+
:extensions="state.extensions"/>
|
|
20
|
+
</div>
|
|
21
|
+
</el-col>
|
|
22
|
+
</el-row>
|
|
23
|
+
</template>
|
|
24
|
+
<script setup>
|
|
25
|
+
|
|
26
|
+
import {Codemirror} from "vue-codemirror";
|
|
27
|
+
import {computed, defineProps, reactive, ref} from "vue";
|
|
28
|
+
import {javascript} from "@codemirror/lang-javascript";
|
|
29
|
+
import {oneDark} from "@codemirror/theme-one-dark";
|
|
30
|
+
import LeftMeun from '@/views/table/add-or-edit/config/script-config/LeftMeun.vue'
|
|
31
|
+
|
|
32
|
+
const props = defineProps({
|
|
33
|
+
modelValue: {},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// const values = computed({
|
|
37
|
+
// get: () => props.modelValue,
|
|
38
|
+
// // eslint-disable-next-line no-undef
|
|
39
|
+
// set: (value) => emits("update:modelValue", value),
|
|
40
|
+
// });
|
|
41
|
+
const values = ref(`const values = computed({
|
|
42
|
+
get: () => props.modelValue,
|
|
43
|
+
// eslint-disable-next-line no-undef
|
|
44
|
+
set: (value) => emits("update:modelValue", value),
|
|
45
|
+
})`);
|
|
46
|
+
|
|
47
|
+
const state = reactive({
|
|
48
|
+
show: false,
|
|
49
|
+
extensions: [javascript(), oneDark],
|
|
50
|
+
values: ``,
|
|
51
|
+
err: false,
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
</script>
|
|
55
|
+
<style>
|
|
56
|
+
|
|
57
|
+
.bordered-col {
|
|
58
|
+
border: 1px solid #d3dce6; /* 边框颜色和宽度 */
|
|
59
|
+
border-radius: 4px; /* 可选:圆角 */
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.height-col {
|
|
63
|
+
height: 600px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.colored-div {
|
|
67
|
+
background-color: #2d2a2e; /* 背景 */
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
</style>
|