tianheng-ui 0.1.12 → 0.1.15
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/lib/theme-chalk/js/axios.js +3 -2
- package/lib/theme-chalk/js/util.js +23 -0
- package/lib/theme-chalk/styles/feature.scss +15 -0
- package/lib/tianheng-ui.js +13 -13
- package/package.json +1 -1
- package/packages/FormMaking/GenerateFormItem.vue +2 -2
- package/packages/FormMaking/WidgetConfig.vue +4 -3
- package/packages/FormMaking/WidgetForm.vue +9 -10
- package/packages/FormMaking/WidgetFormItem.vue +2 -2
- package/packages/FormMaking/WidgetSelect.vue +0 -1
- package/packages/FormMaking/WidgetTools.vue +3 -2
- package/packages/FormMaking/custom/configs/button.vue +2 -1
- package/packages/FormMaking/custom/items/button.vue +1 -1
- package/packages/FormMaking/custom/items/date.vue +1 -0
- package/packages/FormMaking/custom/items/grid_dev.vue +3 -3
- package/packages/FormMaking/custom/items/tableH5_dev.vue +3 -3
- package/packages/FormMaking/custom/items/table_dev.vue +3 -3
- package/packages/FormMaking/custom/items/tabs_dev.vue +3 -3
- package/packages/FormMaking/index.vue +4 -3
- package/packages/FormMaking/styles/index.scss +1 -0
- package/packages/FormMaking/util/index.js +24 -0
- package/packages/TableMaking/WidgetTools.vue +246 -0
- package/packages/TableMaking/custom/config.js +108 -0
- package/packages/TableMaking/generateTable.vue +2 -2
- package/packages/TableMaking/index.vue +120 -156
- package/packages/TableMaking/util/index.js +54 -1
- package/packages/TableMaking/widgetConfig.vue +317 -187
- package/packages/TableMaking/widgetTable.vue +16 -46
- package/packages/index.js +5 -4
package/package.json
CHANGED
@@ -170,7 +170,7 @@
|
|
170
170
|
</template>
|
171
171
|
|
172
172
|
<script>
|
173
|
-
import { inputTypeDict } from "./util/index";
|
173
|
+
import { inputTypeDict, deepClone } from "./util/index";
|
174
174
|
import { VueEditor } from "vue2-editor";
|
175
175
|
import compsData from "./custom/register";
|
176
176
|
import FmUpload from "./Upload";
|
@@ -189,7 +189,7 @@ export default {
|
|
189
189
|
components: { FmUpload, VueEditor },
|
190
190
|
data() {
|
191
191
|
return {
|
192
|
-
compsData:
|
192
|
+
compsData: deepClone(compsData),
|
193
193
|
dataModel: this.models[this.widget.model],
|
194
194
|
dialogVisible: false,
|
195
195
|
dialogImageUrl: ""
|
@@ -142,6 +142,7 @@
|
|
142
142
|
</template>
|
143
143
|
|
144
144
|
<script>
|
145
|
+
import { deepClone } from "./util/index";
|
145
146
|
import compsData from "./custom/register";
|
146
147
|
export default {
|
147
148
|
props: {
|
@@ -160,7 +161,7 @@ export default {
|
|
160
161
|
},
|
161
162
|
data() {
|
162
163
|
return {
|
163
|
-
compsData:
|
164
|
+
compsData: deepClone(compsData),
|
164
165
|
validator: {
|
165
166
|
type: null,
|
166
167
|
required: null,
|
@@ -324,7 +325,7 @@ export default {
|
|
324
325
|
handleEventDialogShow() {
|
325
326
|
this.eventsDialog = {
|
326
327
|
visible: true,
|
327
|
-
eventScript:
|
328
|
+
eventScript: deepClone(this.config.eventScript),
|
328
329
|
active: null
|
329
330
|
};
|
330
331
|
},
|
@@ -372,7 +373,7 @@ export default {
|
|
372
373
|
}
|
373
374
|
},
|
374
375
|
handleTypeChange(val) {
|
375
|
-
const config =
|
376
|
+
const config = deepClone(this.compsData[val].config);
|
376
377
|
this.$emit("update", config);
|
377
378
|
}
|
378
379
|
}
|
@@ -44,6 +44,7 @@
|
|
44
44
|
</template>
|
45
45
|
|
46
46
|
<script>
|
47
|
+
import { deepClone } from "./util/index";
|
47
48
|
import Draggable from "vuedraggable";
|
48
49
|
import WidgetFormItem from "./WidgetFormItem.vue";
|
49
50
|
|
@@ -99,18 +100,16 @@ export default {
|
|
99
100
|
},
|
100
101
|
handleWidgetAdd(evt) {
|
101
102
|
const newIndex = evt.newIndex;
|
102
|
-
|
103
|
-
|
103
|
+
let newComponent = deepClone(this.data.list[newIndex]);
|
104
104
|
//为拖拽到容器的元素添加唯一 key
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
this.$set(this.data.list, newIndex, dic);
|
105
|
+
if (!newComponent.key) {
|
106
|
+
const key =
|
107
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
108
|
+
newComponent.key = key;
|
109
|
+
newComponent.model = newComponent.type + "_" + key;
|
110
|
+
}
|
113
111
|
|
112
|
+
this.$set(this.data.list, newIndex, newComponent);
|
114
113
|
this.selectWidget = this.data.list[newIndex];
|
115
114
|
}
|
116
115
|
}
|
@@ -50,6 +50,7 @@
|
|
50
50
|
</template>
|
51
51
|
|
52
52
|
<script>
|
53
|
+
import { deepClone } from "./util/index";
|
53
54
|
import compsData from "./custom/register";
|
54
55
|
import Draggable from "vuedraggable";
|
55
56
|
import FmUpload from "./Upload";
|
@@ -59,7 +60,7 @@ export default {
|
|
59
60
|
components: { Draggable, FmUpload },
|
60
61
|
data() {
|
61
62
|
return {
|
62
|
-
compsData:
|
63
|
+
compsData: deepClone(compsData),
|
63
64
|
selectWidget: this.select
|
64
65
|
};
|
65
66
|
},
|
@@ -130,7 +131,6 @@ export default {
|
|
130
131
|
)}`;
|
131
132
|
|
132
133
|
item.key = key;
|
133
|
-
item.options.remoteFunc = `func__${key}`;
|
134
134
|
item.model = `${item.type}_${key}`;
|
135
135
|
|
136
136
|
if (["table", "tableH5"].includes(item.type)) {
|
@@ -260,6 +260,7 @@
|
|
260
260
|
</template>
|
261
261
|
|
262
262
|
<script>
|
263
|
+
import { deepClone } from "./util/index";
|
263
264
|
import * as XLSX from "xlsx/xlsx.mjs";
|
264
265
|
import request from "./util/request";
|
265
266
|
import Clipboard from "clipboard";
|
@@ -436,13 +437,13 @@ export default {
|
|
436
437
|
let data = null;
|
437
438
|
for (const item of this.basicComponents) {
|
438
439
|
if (type === item.type) {
|
439
|
-
data =
|
440
|
+
data = deepClone(item);
|
440
441
|
return data;
|
441
442
|
}
|
442
443
|
}
|
443
444
|
for (const item of this.layoutComponents) {
|
444
445
|
if (type === item.type) {
|
445
|
-
data =
|
446
|
+
data = deepClone(item);
|
446
447
|
return data;
|
447
448
|
}
|
448
449
|
}
|
@@ -12,6 +12,7 @@
|
|
12
12
|
:editable="widget.options.editable"
|
13
13
|
:clearable="widget.options.clearable"
|
14
14
|
:value-format="widget.options.format"
|
15
|
+
:format="widget.options.format"
|
15
16
|
@change="handleEventAction(widget.events.onChange)"
|
16
17
|
@focus="handleEventAction(widget.events.onFocus)"
|
17
18
|
@blur="handleEventAction(widget.events.onBlur)"
|
@@ -83,9 +83,9 @@ export default {
|
|
83
83
|
return false;
|
84
84
|
}
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
if (!newComponent.key) {
|
87
|
+
const key =
|
88
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
89
89
|
newComponent.key = key;
|
90
90
|
newComponent.model = `${newComponent.type}_${key}`;
|
91
91
|
}
|
@@ -83,9 +83,9 @@ export default {
|
|
83
83
|
return false;
|
84
84
|
}
|
85
85
|
|
86
|
-
|
87
|
-
|
88
|
-
|
86
|
+
if (!newComponent.key) {
|
87
|
+
const key =
|
88
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
89
89
|
newComponent.key = key;
|
90
90
|
newComponent.model = `${newComponent.type}_${key}`;
|
91
91
|
}
|
@@ -70,9 +70,9 @@ export default {
|
|
70
70
|
return false;
|
71
71
|
}
|
72
72
|
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
if (!newComponent.key) {
|
74
|
+
const key =
|
75
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
76
76
|
newComponent.key = key;
|
77
77
|
newComponent.model = `${newComponent.type}_${key}`;
|
78
78
|
}
|
@@ -84,9 +84,9 @@ export default {
|
|
84
84
|
return false;
|
85
85
|
}
|
86
86
|
|
87
|
-
|
88
|
-
|
89
|
-
|
87
|
+
if (!newComponent.key) {
|
88
|
+
const key =
|
89
|
+
Date.parse(new Date()) + "_" + Math.ceil(Math.random() * 99999);
|
90
90
|
newComponent.key = key;
|
91
91
|
newComponent.model = `${newComponent.type}_${key}`;
|
92
92
|
}
|
@@ -100,7 +100,7 @@
|
|
100
100
|
<!-- 中间视图区 -->
|
101
101
|
<el-container class="center-container" direction="vertical">
|
102
102
|
<!-- 操作区 -->
|
103
|
-
<
|
103
|
+
<widget-tools
|
104
104
|
:baseConfig="baseConfig"
|
105
105
|
:permissions="permissions"
|
106
106
|
:client.sync="client"
|
@@ -113,7 +113,7 @@
|
|
113
113
|
@click="handleWidgetToolsChange"
|
114
114
|
>
|
115
115
|
<slot name="action"></slot>
|
116
|
-
</
|
116
|
+
</widget-tools>
|
117
117
|
|
118
118
|
<!-- 工作区 -->
|
119
119
|
<el-main>
|
@@ -181,6 +181,7 @@ import {
|
|
181
181
|
baseConfig
|
182
182
|
} from "./custom/config";
|
183
183
|
import generateCode from "./util/generateCode.js";
|
184
|
+
import { deepClone } from "./util/index";
|
184
185
|
|
185
186
|
export default {
|
186
187
|
name: "thFormMaking",
|
@@ -258,7 +259,7 @@ export default {
|
|
258
259
|
this.basicComponents = basicComponents;
|
259
260
|
this.advanceComponents = advanceComponents;
|
260
261
|
this.layoutComponents = layoutComponents;
|
261
|
-
this.baseConfig =
|
262
|
+
this.baseConfig = deepClone(baseConfig);
|
262
263
|
return {
|
263
264
|
widgetFormData: this.data,
|
264
265
|
widgetFormSelect: {},
|
@@ -41,3 +41,27 @@ export const inputTypeDict = val => {
|
|
41
41
|
};
|
42
42
|
return dict[val] || "text";
|
43
43
|
};
|
44
|
+
|
45
|
+
export const deepClone = (obj, clone) => {
|
46
|
+
//判断拷贝的要进行深拷贝的是数组还是对象,是数组的话进行数组拷贝,对象的话进行对象拷贝
|
47
|
+
const toString = Object.prototype.toString;
|
48
|
+
toString.call(obj) === "[object Array]"
|
49
|
+
? (clone = clone || [])
|
50
|
+
: (clone = clone || {});
|
51
|
+
for (const i in obj) {
|
52
|
+
if (typeof obj[i] === "object" && obj[i] !== null) {
|
53
|
+
// 要考虑深复制问题了
|
54
|
+
if (Array.isArray(obj[i])) {
|
55
|
+
// 这是数组
|
56
|
+
clone[i] = [];
|
57
|
+
} else {
|
58
|
+
// 这是对象
|
59
|
+
clone[i] = {};
|
60
|
+
}
|
61
|
+
deepClone(obj[i], clone[i]);
|
62
|
+
} else {
|
63
|
+
clone[i] = obj[i];
|
64
|
+
}
|
65
|
+
}
|
66
|
+
return clone;
|
67
|
+
};
|
@@ -0,0 +1,246 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="widgetTools">
|
3
|
+
<div class="left">
|
4
|
+
<el-button
|
5
|
+
:class="{ active: client === 'monitor' }"
|
6
|
+
type="text"
|
7
|
+
size="medium"
|
8
|
+
icon="el-icon-monitor"
|
9
|
+
@click="handleClick('monitor')"
|
10
|
+
>
|
11
|
+
</el-button>
|
12
|
+
<!-- <el-button
|
13
|
+
:class="{ active: client === 'mobile' }"
|
14
|
+
type="text"
|
15
|
+
size="medium"
|
16
|
+
icon="el-icon-mobile"
|
17
|
+
@click="client = 'mobile'"
|
18
|
+
>
|
19
|
+
</el-button> -->
|
20
|
+
</div>
|
21
|
+
<div class="right">
|
22
|
+
<slot> </slot>
|
23
|
+
<el-button
|
24
|
+
v-if="permissions.includes('clearable')"
|
25
|
+
style="margin-left:10px;"
|
26
|
+
type="text"
|
27
|
+
size="medium"
|
28
|
+
icon="el-icon-delete"
|
29
|
+
disabled
|
30
|
+
@click="handleClick('clear')"
|
31
|
+
>重置
|
32
|
+
</el-button>
|
33
|
+
<el-button
|
34
|
+
v-if="permissions.includes('preview')"
|
35
|
+
type="text"
|
36
|
+
size="medium"
|
37
|
+
icon="el-icon-view"
|
38
|
+
disabled
|
39
|
+
@click="handleDialogOpen('preview')"
|
40
|
+
>预览
|
41
|
+
</el-button>
|
42
|
+
<el-popover style="margin-left:10px;" placement="bottom" trigger="hover">
|
43
|
+
<el-button
|
44
|
+
v-if="permissions.includes('upload')"
|
45
|
+
type="text"
|
46
|
+
size="medium"
|
47
|
+
icon="el-icon-upload2"
|
48
|
+
slot="reference"
|
49
|
+
>导入</el-button
|
50
|
+
>
|
51
|
+
<div>
|
52
|
+
<div>
|
53
|
+
<el-button
|
54
|
+
type="text"
|
55
|
+
size="medium"
|
56
|
+
@click="handleDialogOpen('importJson')"
|
57
|
+
>导入JSON
|
58
|
+
</el-button>
|
59
|
+
</div>
|
60
|
+
<div>
|
61
|
+
<el-upload
|
62
|
+
action
|
63
|
+
accept=".xlsx, .xls"
|
64
|
+
:auto-upload="false"
|
65
|
+
:show-file-list="false"
|
66
|
+
disabled
|
67
|
+
:on-change="handleExcelFileChange"
|
68
|
+
>
|
69
|
+
<el-button type="text" size="medium" disabled
|
70
|
+
>导入EXCEL</el-button
|
71
|
+
>
|
72
|
+
</el-upload>
|
73
|
+
</div>
|
74
|
+
<div>
|
75
|
+
<el-button
|
76
|
+
type="text"
|
77
|
+
size="medium"
|
78
|
+
disabled
|
79
|
+
@click="handleDialogOpen('importTemplate')"
|
80
|
+
>导入模板
|
81
|
+
</el-button>
|
82
|
+
</div>
|
83
|
+
</div>
|
84
|
+
</el-popover>
|
85
|
+
<el-popover style="margin-left:10px;" placement="bottom" trigger="hover">
|
86
|
+
<el-button
|
87
|
+
v-if="
|
88
|
+
permissions.includes('generateJson') ||
|
89
|
+
permissions.includes('generateCode')
|
90
|
+
"
|
91
|
+
type="text"
|
92
|
+
size="medium"
|
93
|
+
icon="el-icon-document"
|
94
|
+
slot="reference"
|
95
|
+
>生成</el-button
|
96
|
+
>
|
97
|
+
<div>
|
98
|
+
<div>
|
99
|
+
<el-button
|
100
|
+
v-if="permissions.includes('generateJson')"
|
101
|
+
type="text"
|
102
|
+
size="medium"
|
103
|
+
@click="handleDialogOpen('generateJson')"
|
104
|
+
>
|
105
|
+
生成JSON
|
106
|
+
</el-button>
|
107
|
+
</div>
|
108
|
+
<div>
|
109
|
+
<el-button
|
110
|
+
v-if="permissions.includes('generateCode')"
|
111
|
+
type="text"
|
112
|
+
size="medium"
|
113
|
+
disabled
|
114
|
+
@click="handleDialogOpen('generateCode')"
|
115
|
+
>
|
116
|
+
生成代码
|
117
|
+
</el-button>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
</el-popover>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<th-dialog
|
124
|
+
v-model="dialog.show"
|
125
|
+
:title="dialogTitles[dialog.action]"
|
126
|
+
:modal-append-to-body="false"
|
127
|
+
:showFooter="['importJson', 'importTemplate'].includes(dialog.action)"
|
128
|
+
@on-fullscreen="handleDialogFullscreen"
|
129
|
+
@on-close="handleDialogClose"
|
130
|
+
@on-affirm="handleDialogAffirm"
|
131
|
+
>
|
132
|
+
<template v-if="dialog.action === 'preview'"></template>
|
133
|
+
<template v-else-if="dialog.action === 'importJson'">
|
134
|
+
<el-alert
|
135
|
+
type="info"
|
136
|
+
title="JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可"
|
137
|
+
></el-alert>
|
138
|
+
<th-code-editor
|
139
|
+
v-model="dialog.data.config"
|
140
|
+
ref="codeEditor"
|
141
|
+
></th-code-editor>
|
142
|
+
</template>
|
143
|
+
<template v-else-if="dialog.action === 'importTemplate'"></template>
|
144
|
+
<template v-else-if="dialog.action === 'generateJson'">
|
145
|
+
<th-code-editor
|
146
|
+
v-model="dialog.data.config"
|
147
|
+
ref="codeEditor"
|
148
|
+
></th-code-editor>
|
149
|
+
</template>
|
150
|
+
<template v-else-if="dialog.action === 'generateCode'"></template>
|
151
|
+
</th-dialog>
|
152
|
+
</div>
|
153
|
+
</template>
|
154
|
+
|
155
|
+
<script>
|
156
|
+
export default {
|
157
|
+
props: {
|
158
|
+
config: Object,
|
159
|
+
client: String,
|
160
|
+
permissions: Array
|
161
|
+
},
|
162
|
+
data() {
|
163
|
+
return {
|
164
|
+
dialog: {
|
165
|
+
show: false,
|
166
|
+
action: "",
|
167
|
+
data: {}
|
168
|
+
},
|
169
|
+
dialogTitles: {
|
170
|
+
preview: "预览",
|
171
|
+
importJson: "导入JSON",
|
172
|
+
importTemplate: "导入模板",
|
173
|
+
generateJson: "生成JSON",
|
174
|
+
generateCode: "生成代码"
|
175
|
+
}
|
176
|
+
};
|
177
|
+
},
|
178
|
+
created() {},
|
179
|
+
mounted() {},
|
180
|
+
methods: {
|
181
|
+
handleClick(val, data) {
|
182
|
+
this.$emit("click", val, data);
|
183
|
+
},
|
184
|
+
handleDialogOpen(action, data = {}) {
|
185
|
+
switch (action) {
|
186
|
+
case "generateJson":
|
187
|
+
const configText = JSON.stringify(this.config, null, 2);
|
188
|
+
data.config = configText;
|
189
|
+
break;
|
190
|
+
|
191
|
+
default:
|
192
|
+
break;
|
193
|
+
}
|
194
|
+
this.dialog = { show: true, action, data };
|
195
|
+
},
|
196
|
+
handleDialogFullscreen() {
|
197
|
+
this.$refs.codeEditor.resize();
|
198
|
+
},
|
199
|
+
handleDialogAffirm() {
|
200
|
+
const action = this.dialog.action;
|
201
|
+
switch (action) {
|
202
|
+
case "importJson":
|
203
|
+
this.handleClick("import-json", JSON.parse(this.dialog.data.config));
|
204
|
+
break;
|
205
|
+
|
206
|
+
default:
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
this.handleDialogClose();
|
210
|
+
},
|
211
|
+
handleDialogClose() {
|
212
|
+
this.dialog.show = false;
|
213
|
+
},
|
214
|
+
handleExcelFileChange() {},
|
215
|
+
handleGenerateJson() {},
|
216
|
+
handleGenerateCode() {}
|
217
|
+
}
|
218
|
+
};
|
219
|
+
</script>
|
220
|
+
|
221
|
+
<style lang="scss" scoped>
|
222
|
+
.widgetTools {
|
223
|
+
display: flex;
|
224
|
+
align-items: center;
|
225
|
+
width: 100%;
|
226
|
+
height: 45px;
|
227
|
+
padding: 0 15px;
|
228
|
+
border-bottom: solid 2px #e4e7ed;
|
229
|
+
|
230
|
+
.left {
|
231
|
+
min-width: 60px;
|
232
|
+
.el-button {
|
233
|
+
color: #333;
|
234
|
+
}
|
235
|
+
.active {
|
236
|
+
color: #409eff;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
.right {
|
240
|
+
flex: 1;
|
241
|
+
display: flex;
|
242
|
+
align-items: center;
|
243
|
+
justify-content: right;
|
244
|
+
}
|
245
|
+
}
|
246
|
+
</style>
|
@@ -0,0 +1,108 @@
|
|
1
|
+
// 查询配置
|
2
|
+
export const search = {
|
3
|
+
show: true,
|
4
|
+
options: []
|
5
|
+
};
|
6
|
+
|
7
|
+
// 列表配置
|
8
|
+
export const table = {
|
9
|
+
mounted: {
|
10
|
+
api: ""
|
11
|
+
},
|
12
|
+
options: [],
|
13
|
+
pageInfo: {
|
14
|
+
show: true,
|
15
|
+
options: {
|
16
|
+
pageCount: 0,
|
17
|
+
pageSize: 20,
|
18
|
+
currentPage: 1,
|
19
|
+
total: 0,
|
20
|
+
sizes: [10, 20, 30, 50, 100]
|
21
|
+
}
|
22
|
+
},
|
23
|
+
sort: {
|
24
|
+
type: "1",
|
25
|
+
key: ""
|
26
|
+
},
|
27
|
+
loading: {
|
28
|
+
show: false,
|
29
|
+
text: "加载中",
|
30
|
+
image: ""
|
31
|
+
},
|
32
|
+
empty: {
|
33
|
+
show: true,
|
34
|
+
text: "暂无数据",
|
35
|
+
image: ""
|
36
|
+
},
|
37
|
+
sequence: true
|
38
|
+
};
|
39
|
+
|
40
|
+
// 按钮配置
|
41
|
+
export const tools = {
|
42
|
+
add: {
|
43
|
+
show: true,
|
44
|
+
name: "新增",
|
45
|
+
text: "新增",
|
46
|
+
position: "header",
|
47
|
+
form: "",
|
48
|
+
api: ""
|
49
|
+
},
|
50
|
+
edit: {
|
51
|
+
show: true,
|
52
|
+
name: "编辑",
|
53
|
+
text: "编辑",
|
54
|
+
position: "row",
|
55
|
+
form: "",
|
56
|
+
api: ""
|
57
|
+
},
|
58
|
+
detail: {
|
59
|
+
show: false,
|
60
|
+
name: "查看",
|
61
|
+
text: "查看",
|
62
|
+
position: "row",
|
63
|
+
form: "",
|
64
|
+
api: ""
|
65
|
+
},
|
66
|
+
delete: {
|
67
|
+
show: true,
|
68
|
+
name: "删除",
|
69
|
+
text: "删除",
|
70
|
+
position: "row",
|
71
|
+
form: "",
|
72
|
+
api: ""
|
73
|
+
},
|
74
|
+
batchDelete: {
|
75
|
+
show: false,
|
76
|
+
name: "批量删除",
|
77
|
+
text: "批量删除",
|
78
|
+
position: "header",
|
79
|
+
form: "",
|
80
|
+
api: ""
|
81
|
+
},
|
82
|
+
export: {
|
83
|
+
show: false,
|
84
|
+
name: "导出",
|
85
|
+
text: "导出",
|
86
|
+
position: "header",
|
87
|
+
form: "",
|
88
|
+
api: ""
|
89
|
+
},
|
90
|
+
import: {
|
91
|
+
show: false,
|
92
|
+
name: "导入",
|
93
|
+
text: "导入",
|
94
|
+
position: "header",
|
95
|
+
form: "",
|
96
|
+
api: ""
|
97
|
+
}
|
98
|
+
};
|
99
|
+
|
100
|
+
// 接口配置
|
101
|
+
export const network = {};
|
102
|
+
|
103
|
+
export const tableConfig = {
|
104
|
+
search,
|
105
|
+
table,
|
106
|
+
tools,
|
107
|
+
network
|
108
|
+
};
|
@@ -248,10 +248,10 @@ export default {
|
|
248
248
|
}
|
249
249
|
const dic = toolsItemConfig(key, element);
|
250
250
|
dic.form = element.form;
|
251
|
-
if (element.position === 1) {
|
251
|
+
if (element.position === 1 || element.position === 'header') {
|
252
252
|
this.toolsConfig.show = true;
|
253
253
|
this.toolsConfig.options.push(dic);
|
254
|
-
} else if (element.position === 2) {
|
254
|
+
} else if (element.position === 2 || element.position === 'row') {
|
255
255
|
action.hide = false;
|
256
256
|
action.actions.push(dic);
|
257
257
|
}
|