doway-coms 2.4.9 → 2.5.1
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 +1 -1
- package/packages/BaseFileGroup/src/index.vue +264 -258
package/package.json
CHANGED
|
@@ -2,45 +2,35 @@
|
|
|
2
2
|
<div style="height:300px">
|
|
3
3
|
<splitpanes class="default-theme">
|
|
4
4
|
<pane size="20">
|
|
5
|
-
<vxe-table
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</vxe-column>
|
|
35
|
-
<vxe-column width="80px">
|
|
36
|
-
<template #default="{ row }">
|
|
37
|
-
<span>
|
|
38
|
-
<span @click="handleAddSubFolder(row)" v-if="edit===true">添加</span>
|
|
39
|
-
<span @click="handleEditSubFolder(row)" v-if="edit===true && row.id!=='sys_top_folder'">编辑</span>
|
|
40
|
-
</span>
|
|
41
|
-
</template>
|
|
42
|
-
</vxe-column>
|
|
43
|
-
</vxe-table>
|
|
5
|
+
<vxe-table :size="'mini'" :height="'100%'" show-overflow highlight-current-row highlight-hover-row
|
|
6
|
+
ref="eisTreeView" row-id="id" row-key @current-change="eisCurrentChange" border="inner" :show-header="false"
|
|
7
|
+
:data="fileGroupData" :tree-config="{
|
|
8
|
+
transform: true,
|
|
9
|
+
line: true,
|
|
10
|
+
rowField: 'id',
|
|
11
|
+
parentField: 'parentId',
|
|
12
|
+
expandRowKeys: ['sys_top_folder']
|
|
13
|
+
}">
|
|
14
|
+
<vxe-column title="菜单权限" tree-node>
|
|
15
|
+
<template #default="{ row }">
|
|
16
|
+
<span>
|
|
17
|
+
<a-icon type="folder-open" v-if="$refs.eisTreeView.isTreeExpandByRow(row)" />
|
|
18
|
+
<a-icon v-else type="folder" />
|
|
19
|
+
<span>{{ row.name }}</span>
|
|
20
|
+
</span>
|
|
21
|
+
</template>
|
|
22
|
+
</vxe-column>
|
|
23
|
+
<vxe-column width="80px">
|
|
24
|
+
<template #default="{ row }">
|
|
25
|
+
<span>
|
|
26
|
+
<span class="button" @click="handleAddSubFolder(row)" v-if="edit === true"><a-icon type="file-add" /></span>
|
|
27
|
+
{{ ' ' }}
|
|
28
|
+
<span class="button1" @click="handleEditSubFolder(row)"
|
|
29
|
+
v-if="edit === true && row.id !== 'sys_top_folder'"><a-icon type="edit" /></span>
|
|
30
|
+
</span>
|
|
31
|
+
</template>
|
|
32
|
+
</vxe-column>
|
|
33
|
+
</vxe-table>
|
|
44
34
|
<!-- <a-tree :tree-data="fileGroupData" :selectedKeys="currentSelectKey" :replaceFields="{title:'name',key:'id'}" show-icon default-expand-all @select="handleFileGroupSelect">
|
|
45
35
|
<a-icon slot="fileGroup" type="folder" />
|
|
46
36
|
<template #title="{ name,id }">
|
|
@@ -54,88 +44,54 @@
|
|
|
54
44
|
</pane>
|
|
55
45
|
<pane>
|
|
56
46
|
<div class="card-view-items">
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
<div class="card-view-item" :style="{ width: itemWidth + 'px' }" v-for="loopFileData in currentFolderData"
|
|
48
|
+
@dblclick="panelFolderDblClick(loopFileData)" :key="loopFileData.id">
|
|
49
|
+
{{ loopFileData.name }}
|
|
50
|
+
<!-- <button style="position: absolute; padding: 1px 2px; right:2px;bottom:2px"> -->
|
|
51
|
+
<div style="position: absolute; padding: 1px 2px; right:2px;bottom:2px" @click="removeAttach(loopFileData)" v-if="edit === true"><a-icon type="delete" /></div>
|
|
52
|
+
<!-- </button> -->
|
|
53
|
+
<div @click="downloadAttach(loopFileData)" v-if="loopFileData.attachType === 'file' && allowDownload === true">下载
|
|
61
54
|
</div>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
:style="{ width: width, height: height, lineHeight: height }"
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
</a-upload>
|
|
86
|
-
</div>
|
|
87
|
-
<div
|
|
88
|
-
class="card-view-item card-view-item-ghost"
|
|
89
|
-
:style="{ width: itemWidth + 'px' }"
|
|
90
|
-
></div>
|
|
91
|
-
<div
|
|
92
|
-
class="card-view-item card-view-item-ghost"
|
|
93
|
-
:style="{ width: itemWidth + 'px' }"
|
|
94
|
-
></div>
|
|
95
|
-
<div
|
|
96
|
-
class="card-view-item card-view-item-ghost"
|
|
97
|
-
:style="{ width: itemWidth + 'px' }"
|
|
98
|
-
></div>
|
|
99
|
-
<div
|
|
100
|
-
class="card-view-item card-view-item-ghost"
|
|
101
|
-
:style="{ width: itemWidth + 'px' }"
|
|
102
|
-
></div>
|
|
103
|
-
<div
|
|
104
|
-
class="card-view-item card-view-item-ghost"
|
|
105
|
-
:style="{ width: itemWidth + 'px' }"
|
|
106
|
-
></div>
|
|
107
|
-
<div
|
|
108
|
-
class="card-view-item card-view-item-ghost"
|
|
109
|
-
:style="{ width: itemWidth + 'px' }"
|
|
110
|
-
></div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<div class="card-view-item" :style="{ width: itemWidth + 'px' }"
|
|
58
|
+
v-if="edit === true && currentSelectKey.length > 0">
|
|
59
|
+
<a-upload class="avatar-uploader" :headers="uploadHeaders" :action="uploadData.picAction" :multiple="true"
|
|
60
|
+
:data="uploadData" @change="handleAvatarSuccess" :showUploadList="false"
|
|
61
|
+
:before-upload="beforeAvatarUpload">
|
|
62
|
+
<div style="border: 1px solid #d9d9d9; border-radius: 6px"
|
|
63
|
+
:style="{ width: width, height: height, lineHeight: height }">
|
|
64
|
+
<a-icon type="plus" class="avatar-uploader-icon" style="text-align: center"
|
|
65
|
+
:style="{ width: width, height: height, lineHeight: height }" />
|
|
66
|
+
</div>
|
|
67
|
+
</a-upload>
|
|
68
|
+
</div>
|
|
69
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
70
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
71
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
72
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
73
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
74
|
+
<div class="card-view-item card-view-item-ghost" :style="{ width: itemWidth + 'px' }"></div>
|
|
111
75
|
</div>
|
|
112
76
|
</pane>
|
|
113
77
|
</splitpanes>
|
|
114
|
-
<VxeModal
|
|
115
|
-
v-model="showEditFolder"
|
|
116
|
-
transfer
|
|
117
|
-
:height="200"
|
|
118
|
-
:width="400"
|
|
119
|
-
destroy-on-close
|
|
120
|
-
:z-index="999"
|
|
121
|
-
show-footer
|
|
122
|
-
>
|
|
78
|
+
<VxeModal v-model="showEditFolder" transfer :height="200" :width="400" destroy-on-close :z-index="999" show-footer>
|
|
123
79
|
<template #title>
|
|
124
|
-
<span
|
|
80
|
+
<span>添加文件夹名称</span>
|
|
125
81
|
</template>
|
|
126
82
|
<template #default>
|
|
127
|
-
|
|
83
|
+
<a-input v-model="currentEditFolderValue"></a-input>
|
|
128
84
|
</template>
|
|
129
85
|
<template #footer>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
86
|
+
<vxe-button @click="showEditFolder = false">取消</vxe-button>
|
|
87
|
+
<vxe-button status="primary" @click="confirmEditFolder">确定</vxe-button>
|
|
88
|
+
</template>
|
|
133
89
|
</VxeModal>
|
|
134
90
|
</div>
|
|
135
91
|
</template>
|
|
136
92
|
|
|
137
93
|
<script>
|
|
138
|
-
import { notification, Upload,Tree,Icon,Popconfirm,Input } from "ant-design-vue";
|
|
94
|
+
import { notification, Upload, Tree, Icon, Popconfirm, Input } from "ant-design-vue";
|
|
139
95
|
import { Checkbox, Modal } from "vxe-table";
|
|
140
96
|
import { attachGetAttachUrlApi, attachSearchApi } from "../../utils/api";
|
|
141
97
|
import XEUtils from 'xe-utils'
|
|
@@ -149,20 +105,20 @@ export default {
|
|
|
149
105
|
"a-upload": Upload,
|
|
150
106
|
VxeModal: Modal,
|
|
151
107
|
Splitpanes, Pane,
|
|
152
|
-
'a-tree':Tree,
|
|
153
|
-
'a-icon':Icon,
|
|
154
|
-
'a-popconfirm':Popconfirm,
|
|
155
|
-
'a-input':Input
|
|
108
|
+
'a-tree': Tree,
|
|
109
|
+
'a-icon': Icon,
|
|
110
|
+
'a-popconfirm': Popconfirm,
|
|
111
|
+
'a-input': Input
|
|
156
112
|
},
|
|
157
113
|
data() {
|
|
158
114
|
return {
|
|
159
|
-
showEditFolder:false,
|
|
160
|
-
currentEditInfo:{},
|
|
161
|
-
currentEditFolderValue:'',
|
|
162
|
-
currentSelectKey:[],
|
|
163
|
-
fileGroupData:[],
|
|
115
|
+
showEditFolder: false,
|
|
116
|
+
currentEditInfo: {},
|
|
117
|
+
currentEditFolderValue: '',
|
|
118
|
+
currentSelectKey: [],
|
|
119
|
+
fileGroupData: [],
|
|
164
120
|
internalRows: [],
|
|
165
|
-
itemWidth:200,
|
|
121
|
+
itemWidth: 200,
|
|
166
122
|
uploadData: {
|
|
167
123
|
picType: "",
|
|
168
124
|
picAction: "",
|
|
@@ -173,13 +129,13 @@ export default {
|
|
|
173
129
|
},
|
|
174
130
|
};
|
|
175
131
|
},
|
|
176
|
-
computed:{
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
132
|
+
computed: {
|
|
133
|
+
currentFolderData() {
|
|
134
|
+
if (this.currentSelectKey.length === 0) {
|
|
135
|
+
return []
|
|
136
|
+
}
|
|
137
|
+
return this.internalRows.filter(p => p.parentId == this.currentSelectKey[0] && p.sysRowState !== 'delete')
|
|
138
|
+
}
|
|
183
139
|
},
|
|
184
140
|
props: {
|
|
185
141
|
isStyle: {
|
|
@@ -285,108 +241,108 @@ export default {
|
|
|
285
241
|
this.buildTreeData(this.rows);
|
|
286
242
|
},
|
|
287
243
|
methods: {
|
|
288
|
-
buildTreeData(tempRows){
|
|
289
|
-
this.internalRows =JSON.parse(JSON.stringify(tempRows))
|
|
244
|
+
buildTreeData(tempRows) {
|
|
245
|
+
this.internalRows = JSON.parse(JSON.stringify(tempRows))
|
|
290
246
|
let tempTopFolder = {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
247
|
+
sysRowState: 'view',
|
|
248
|
+
parentId: null,
|
|
249
|
+
sort: 0,
|
|
250
|
+
attachType: 'folder',
|
|
251
|
+
name: '文件',
|
|
252
|
+
id: 'sys_top_folder',
|
|
297
253
|
}
|
|
298
254
|
this.internalRows.push(tempTopFolder)
|
|
299
|
-
XEUtils.arrayEach(this.internalRows,p=>{
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
255
|
+
XEUtils.arrayEach(this.internalRows, p => {
|
|
256
|
+
if (p.parentId || p.id === 'sys_top_folder') {
|
|
257
|
+
return
|
|
258
|
+
}
|
|
259
|
+
p.parentId = 'sys_top_folder'
|
|
304
260
|
})
|
|
305
261
|
|
|
306
262
|
//
|
|
307
|
-
this.fileGroupData = XEUtils.orderBy(XEUtils.filter(this.internalRows,p=>p.attachType==='folder'),p=>p.sort)
|
|
308
|
-
console.debug('davistest',this.fileGroupData)
|
|
309
|
-
if(this.currentSelectKey.length===0){
|
|
310
|
-
|
|
311
|
-
|
|
263
|
+
this.fileGroupData = XEUtils.orderBy(XEUtils.filter(this.internalRows, p => p.attachType === 'folder'), p => p.sort)
|
|
264
|
+
console.debug('davistest', this.fileGroupData)
|
|
265
|
+
if (this.currentSelectKey.length === 0) {
|
|
266
|
+
this.$refs.eisTreeView.setCurrentRow(tempTopFolder)
|
|
267
|
+
this.currentSelectKey = [tempTopFolder.id]
|
|
312
268
|
}
|
|
313
269
|
// this.fileGroupData = XEUtils.toArrayTree(tempFoldRows,{strict:true,sortKey:'sort'})
|
|
314
|
-
|
|
270
|
+
|
|
315
271
|
// // this.internalRows.push(tempTopFolder)
|
|
316
272
|
// this.fileGroupData = [tempTopFolder]
|
|
317
273
|
// this.fileGroupData[0].children = XEUtils.toArrayTree(tempFoldRows,{strict:true,sortKey:'sort'})
|
|
318
274
|
//构造顶级虚拟父节点
|
|
319
|
-
|
|
275
|
+
|
|
320
276
|
// this.fileData = XEUtils.filter(tempRows,p=>p.attachType==='file')
|
|
321
277
|
},
|
|
322
|
-
handleAddSubFolder(rowInfo){
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
278
|
+
handleAddSubFolder(rowInfo) {
|
|
279
|
+
//添加子项文件夹
|
|
280
|
+
this.currentEditInfo = XEUtils.find(this.internalRows, p => p.id === rowInfo.id)
|
|
281
|
+
this.currentEditInfo['operation'] = 'add'
|
|
282
|
+
this.showEditFolder = true
|
|
327
283
|
},
|
|
328
|
-
handleEditSubFolder(rowInfo){
|
|
284
|
+
handleEditSubFolder(rowInfo) {
|
|
329
285
|
this.currentEditFolderValue = rowInfo.name
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
286
|
+
//添加子项文件夹
|
|
287
|
+
this.currentEditInfo = XEUtils.find(this.internalRows, p => p.id === rowInfo.id)
|
|
288
|
+
this.currentEditInfo['operation'] = 'edit'
|
|
289
|
+
this.showEditFolder = true
|
|
334
290
|
},
|
|
335
291
|
eisCurrentChange(scope) {
|
|
336
292
|
this.currentSelectKey = [scope.row.id]
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
confirmEditFolder(){
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
this.internalRows.push(tempAddRowInfo)
|
|
354
|
-
this.$refs.eisTreeView.insertAt(tempAddRowInfo,-1)
|
|
355
|
-
}else{
|
|
356
|
-
let tempInternalRowInfo = XEUtils.find(this.internalRows,p=>p.id===this.currentEditInfo.id)
|
|
357
|
-
if(tempInternalRowInfo.sysRowState!=='add'){
|
|
358
|
-
tempInternalRowInfo.sysRowState = 'update'
|
|
359
|
-
}
|
|
360
|
-
tempInternalRowInfo.name = this.currentEditFolderValue
|
|
361
|
-
//修改树节点名称
|
|
362
|
-
tempRowInfo.name = tempInternalRowInfo.name
|
|
293
|
+
|
|
294
|
+
},
|
|
295
|
+
confirmEditFolder() {
|
|
296
|
+
|
|
297
|
+
let tempRowInfo = this.$refs.eisTreeView.getRowById(this.currentEditInfo.id)
|
|
298
|
+
if (this.currentEditInfo.operation === 'add') {
|
|
299
|
+
//新增文件夹
|
|
300
|
+
let tempAddRowInfo = {
|
|
301
|
+
sysRowState: 'add',
|
|
302
|
+
parentId: this.currentEditInfo.id,
|
|
303
|
+
sort: tempRowInfo.children.length + 1,
|
|
304
|
+
attachType: 'folder',
|
|
305
|
+
children: [],
|
|
306
|
+
name: this.currentEditFolderValue,
|
|
307
|
+
id: this.$store.getters.newId() + "",
|
|
363
308
|
}
|
|
364
|
-
this.
|
|
365
|
-
this.
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if(
|
|
369
|
-
|
|
309
|
+
this.internalRows.push(tempAddRowInfo)
|
|
310
|
+
this.$refs.eisTreeView.insertAt(tempAddRowInfo, -1)
|
|
311
|
+
} else {
|
|
312
|
+
let tempInternalRowInfo = XEUtils.find(this.internalRows, p => p.id === this.currentEditInfo.id)
|
|
313
|
+
if (tempInternalRowInfo.sysRowState !== 'add') {
|
|
314
|
+
tempInternalRowInfo.sysRowState = 'update'
|
|
370
315
|
}
|
|
316
|
+
tempInternalRowInfo.name = this.currentEditFolderValue
|
|
317
|
+
//修改树节点名称
|
|
318
|
+
tempRowInfo.name = tempInternalRowInfo.name
|
|
319
|
+
}
|
|
320
|
+
this.showEditFolder = false
|
|
321
|
+
this.currentEditFolderValue = null
|
|
322
|
+
},
|
|
323
|
+
panelFolderDblClick(loopFileData) {
|
|
324
|
+
if (loopFileData.attachType === 'file') {
|
|
325
|
+
return
|
|
326
|
+
}
|
|
371
327
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
328
|
+
let tempParentRowInfo = this.$refs.eisTreeView.getRowById(loopFileData.parentId)
|
|
329
|
+
let tempExpandRows = []
|
|
330
|
+
if (tempParentRowInfo) {
|
|
331
|
+
tempExpandRows.push(tempParentRowInfo)
|
|
332
|
+
}
|
|
333
|
+
let tempRowInfo = this.$refs.eisTreeView.getRowById(loopFileData.id)
|
|
334
|
+
this.$refs.eisTreeView.setCurrentRow(tempRowInfo)
|
|
379
335
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
336
|
+
tempExpandRows.push(tempRowInfo)
|
|
337
|
+
this.$refs.eisTreeView.setTreeExpand(tempExpandRows, true)
|
|
338
|
+
this.currentSelectKey = [loopFileData.id]
|
|
383
339
|
},
|
|
384
|
-
handleFileGroupSelect(selectedKeys){
|
|
385
|
-
if(selectedKeys.length===0){
|
|
386
|
-
|
|
340
|
+
handleFileGroupSelect(selectedKeys) {
|
|
341
|
+
if (selectedKeys.length === 0) {
|
|
342
|
+
return
|
|
387
343
|
}
|
|
388
344
|
this.currentSelectKey = selectedKeys
|
|
389
|
-
},
|
|
345
|
+
},
|
|
390
346
|
getCurrentToken() {
|
|
391
347
|
return this.$store.getters.token;
|
|
392
348
|
},
|
|
@@ -440,52 +396,52 @@ export default {
|
|
|
440
396
|
}
|
|
441
397
|
vm.internalRows = newRows;
|
|
442
398
|
})
|
|
443
|
-
.catch(() => {});
|
|
399
|
+
.catch(() => { });
|
|
444
400
|
},
|
|
445
|
-
attachFileClick(attachFile) {},
|
|
401
|
+
attachFileClick(attachFile) { },
|
|
446
402
|
handleAvatarSuccess(info) {
|
|
447
403
|
if (info.file.status == "done") {
|
|
448
|
-
if(info.file.response.code!==200){
|
|
449
|
-
|
|
450
|
-
|
|
404
|
+
if (info.file.response.code !== 200) {
|
|
405
|
+
alert(info.file.response.msg)
|
|
406
|
+
return
|
|
451
407
|
}
|
|
452
408
|
//添加文件数据
|
|
453
409
|
let addRow = {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
410
|
+
attachId: info.file.response.content.id,
|
|
411
|
+
sysRowState: 'add',
|
|
412
|
+
parentId: this.currentSelectKey[0],
|
|
413
|
+
fileType: info.file.response.content.fileType,
|
|
414
|
+
sort: this.internalRows.length + 1,
|
|
415
|
+
attachType: 'file',
|
|
416
|
+
name: info.file.response.content.name,
|
|
417
|
+
id: this.$store.getters.newId() + "",
|
|
418
|
+
}
|
|
419
|
+
this.internalRows.push(addRow);
|
|
420
|
+
let tempField;
|
|
421
|
+
for (let i = 0; i < this.cols.length; i++) {
|
|
422
|
+
// 赋值关联字段数据
|
|
423
|
+
let tempValue = addRow;
|
|
424
|
+
tempField = this.cols[i].field;
|
|
425
|
+
if (this.cols[i].isAuto) {
|
|
426
|
+
tempValue[tempField] = this.$store.getters.newId() + "";
|
|
427
|
+
continue;
|
|
462
428
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
tempValue[tempField] = this.formRow[this.cols[i].linkValueField];
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
//通知父组件
|
|
483
|
-
this.$emit(
|
|
484
|
-
"add",
|
|
485
|
-
this.dataName,
|
|
486
|
-
info.file.response.content
|
|
487
|
-
);
|
|
488
|
-
console.debug(this.internalRows)
|
|
429
|
+
if (
|
|
430
|
+
this.cols[i].controlType === "text" &&
|
|
431
|
+
this.cols[i].linkValueField !== null &&
|
|
432
|
+
this.cols[i].linkValueField !== "" &&
|
|
433
|
+
this.cols[i].linkValueField !== undefined
|
|
434
|
+
) {
|
|
435
|
+
tempValue[tempField] = this.formRow[this.cols[i].linkValueField];
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
//通知父组件
|
|
439
|
+
this.$emit(
|
|
440
|
+
"add",
|
|
441
|
+
this.dataName,
|
|
442
|
+
info.file.response.content
|
|
443
|
+
);
|
|
444
|
+
console.debug(this.internalRows)
|
|
489
445
|
}
|
|
490
446
|
},
|
|
491
447
|
beforeAvatarUpload(file) {
|
|
@@ -523,13 +479,13 @@ export default {
|
|
|
523
479
|
},
|
|
524
480
|
removeAttach(attachFile) {
|
|
525
481
|
//检查是否存在子项文件夹或者文件需要删除
|
|
526
|
-
let tempChild =
|
|
527
|
-
if(tempChild){
|
|
482
|
+
let tempChild = XEUtils.find(this.internalRows, p => p.parentId == attachFile.id && p.sysRowState !== 'delete')
|
|
483
|
+
if (tempChild) {
|
|
528
484
|
notification.error({
|
|
529
485
|
message: "错误",
|
|
530
486
|
description: "存在子项文件夹或者文件,请先删除子项文件夹或者文件!",
|
|
531
487
|
});
|
|
532
|
-
|
|
488
|
+
return
|
|
533
489
|
}
|
|
534
490
|
// console.debug(attachFile)
|
|
535
491
|
for (let i = 0; i < this.internalRows.length; i++) {
|
|
@@ -547,23 +503,23 @@ export default {
|
|
|
547
503
|
downloadAttach(attachFile) {
|
|
548
504
|
window.open(
|
|
549
505
|
this.internalServiceUrl +
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
506
|
+
"/DownAttachFile/" +
|
|
507
|
+
attachFile.attachId +
|
|
508
|
+
`?accessToken=${this.$store.getters.token}`
|
|
553
509
|
);
|
|
554
510
|
},
|
|
555
|
-
getUpdateRows(){
|
|
511
|
+
getUpdateRows() {
|
|
556
512
|
//先获取删除数据,因为前台删除一个明细后又添加相同的明细后台会
|
|
557
513
|
//报唯一索引错误,因为后台也是先添加然后再是删除的会照成问题
|
|
558
514
|
//所有就要把删除的放在数组的第一个传递过去,这样后台就先删除然后再新增了
|
|
559
|
-
let tempRemoveRows =XEUtils.filter(this.internalRows,p=>p.sysRowState==='delete' && p.id!=='sys_top_folder')
|
|
560
|
-
let tempAddRows =XEUtils.filter(this.internalRows,p=>p.sysRowState==='add' && p.id!=='sys_top_folder')
|
|
561
|
-
let tempUpdateRows =XEUtils.filter(this.internalRows,p=>p.sysRowState==='update' && p.id!=='sys_top_folder')
|
|
562
|
-
let tempRows = XEUtils.union(tempRemoveRows,tempAddRows,tempUpdateRows)
|
|
563
|
-
XEUtils.arrayEach(tempRows,p=>{
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
515
|
+
let tempRemoveRows = XEUtils.filter(this.internalRows, p => p.sysRowState === 'delete' && p.id !== 'sys_top_folder')
|
|
516
|
+
let tempAddRows = XEUtils.filter(this.internalRows, p => p.sysRowState === 'add' && p.id !== 'sys_top_folder')
|
|
517
|
+
let tempUpdateRows = XEUtils.filter(this.internalRows, p => p.sysRowState === 'update' && p.id !== 'sys_top_folder')
|
|
518
|
+
let tempRows = XEUtils.union(tempRemoveRows, tempAddRows, tempUpdateRows)
|
|
519
|
+
XEUtils.arrayEach(tempRows, p => {
|
|
520
|
+
if (p.parentId === 'sys_top_folder') {
|
|
521
|
+
p.parentId = null
|
|
522
|
+
}
|
|
567
523
|
})
|
|
568
524
|
return tempRows
|
|
569
525
|
},
|
|
@@ -590,6 +546,47 @@ export default {
|
|
|
590
546
|
</script>
|
|
591
547
|
|
|
592
548
|
<style lang="scss" scoped>
|
|
549
|
+
|
|
550
|
+
.button {
|
|
551
|
+
display: inline-block;
|
|
552
|
+
padding: 1px 6px;
|
|
553
|
+
background-color: #4CAF50;
|
|
554
|
+
color: white;
|
|
555
|
+
border: none;
|
|
556
|
+
border-radius: 4px;
|
|
557
|
+
cursor: pointer;
|
|
558
|
+
transition: background-color 0.3s ease;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.button:hover {
|
|
562
|
+
background-color: #45a049;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.button:active {
|
|
566
|
+
background-color: #408E43;
|
|
567
|
+
transform: translateY(2px);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.button1 {
|
|
571
|
+
display: inline-block;
|
|
572
|
+
padding: 1px 6px;
|
|
573
|
+
background-color: #3a61b6;
|
|
574
|
+
color: white;
|
|
575
|
+
border: none;
|
|
576
|
+
border-radius: 4px;
|
|
577
|
+
cursor: pointer;
|
|
578
|
+
transition: background-color 0.3s ease;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.button1:hover {
|
|
582
|
+
background-color: #3a61b6;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.button1:active {
|
|
586
|
+
background-color: #3a61b6;
|
|
587
|
+
transform: translateY(2px);
|
|
588
|
+
}
|
|
589
|
+
|
|
593
590
|
.file-card {
|
|
594
591
|
display: flex;
|
|
595
592
|
flex-flow: row wrap;
|
|
@@ -660,23 +657,24 @@ export default {
|
|
|
660
657
|
}
|
|
661
658
|
}
|
|
662
659
|
|
|
663
|
-
.attach:hover
|
|
660
|
+
.attach:hover>.attach-delete {
|
|
664
661
|
opacity: 0.8;
|
|
665
662
|
}
|
|
666
663
|
|
|
667
|
-
.attach:hover
|
|
664
|
+
.attach:hover>.attach-download {
|
|
668
665
|
opacity: 0.7;
|
|
669
666
|
}
|
|
670
667
|
|
|
671
|
-
.attach:hover
|
|
668
|
+
.attach:hover>.attach-view {
|
|
672
669
|
opacity: 0.7;
|
|
673
670
|
}
|
|
674
671
|
|
|
675
|
-
.attach:hover
|
|
672
|
+
.attach:hover>.attach-circle {
|
|
676
673
|
opacity: 0.9;
|
|
677
674
|
}
|
|
678
675
|
}
|
|
679
676
|
}
|
|
677
|
+
|
|
680
678
|
.tree-node-icon {
|
|
681
679
|
width: 16px;
|
|
682
680
|
text-align: center;
|
|
@@ -713,10 +711,12 @@ export default {
|
|
|
713
711
|
.el-upload-list__item is-success {
|
|
714
712
|
float: left;
|
|
715
713
|
}
|
|
714
|
+
|
|
716
715
|
.currentHeight {
|
|
717
716
|
display: flex;
|
|
718
717
|
align-items: center;
|
|
719
718
|
}
|
|
719
|
+
|
|
720
720
|
.card-view-items {
|
|
721
721
|
// margin-top: 100px;
|
|
722
722
|
// margin-left: 100px;
|
|
@@ -726,6 +726,7 @@ export default {
|
|
|
726
726
|
justify-content: flex-start;
|
|
727
727
|
padding: 8px 8px 8px 8px;
|
|
728
728
|
overflow-y: auto;
|
|
729
|
+
|
|
729
730
|
.card-view-item-ghost {
|
|
730
731
|
visibility: hidden;
|
|
731
732
|
height: 0px !important;
|
|
@@ -734,6 +735,7 @@ export default {
|
|
|
734
735
|
margin-bottom: 0px;
|
|
735
736
|
padding: 0px 0px 0px 0px;
|
|
736
737
|
}
|
|
738
|
+
|
|
737
739
|
.card-view-item {
|
|
738
740
|
cursor: pointer;
|
|
739
741
|
// height: 100px;
|
|
@@ -753,15 +755,19 @@ export default {
|
|
|
753
755
|
//border-color: #9ad4dc;
|
|
754
756
|
min-width: 150px;
|
|
755
757
|
border-radius: 6px;
|
|
758
|
+
position: relative;
|
|
759
|
+
|
|
756
760
|
.card-view-icon {
|
|
757
761
|
float: left;
|
|
758
762
|
width: 64px;
|
|
759
763
|
height: 64px;
|
|
760
764
|
}
|
|
765
|
+
|
|
761
766
|
// .card-view-desc {
|
|
762
767
|
// padding-left: 85px;
|
|
763
768
|
// }
|
|
764
769
|
}
|
|
770
|
+
|
|
765
771
|
.card-view-item:hover {
|
|
766
772
|
border: 1px solid #1269db;
|
|
767
773
|
}
|