Browse Source

档案-上传附件-排序修改

master
xuhuajiao 3 years ago
parent
commit
fa9d199199
  1. 15
      src/views/archivesManage/archivesList/module/uploadFile/index.vue

15
src/views/archivesManage/archivesList/module/uploadFile/index.vue

@ -7,7 +7,7 @@
<input id="upFile" type="file" name="upFile" @change="changeFile($event)">
</div>
<el-button icon="el-icon-delete" :disabled="selections.length === 0" @click="toDelete(selections)">删除</el-button>
<el-button icon="el-icon-sort" @click="sortVisible = true">排序</el-button>
<el-button icon="el-icon-sort" @click="showSort">排序</el-button>
</div>
<!--表格渲染-->
@ -62,7 +62,7 @@
<span class="dialog-left-bottom" />
<div class="setting-dialog">
<i class="drag-tip">提示请通过拖动鼠标来调整当前顺序</i>
<el-table :data="tableData" class="file-sort" style="width: 100%;max-height: 70vh;" row-key="id">
<el-table :data="sortTableData" class="file-sort" style="width: 100%;max-height: 70vh;" row-key="id">
<el-table-column type="index" label="序号" width="100" align="center" />
<el-table-column prop="file_name" label="文件名称" />
</el-table>
@ -126,6 +126,7 @@ export default {
tableData: [], // list
selections: [], // table -
showCoverVisible: false, // dialog
sortTableData: [], // data
sortVisible: false, // dialog
deleteVisible: false, // dialog
deleteData: [], // data
@ -283,13 +284,17 @@ export default {
},
//
opened() {
this.rowDrop('file-sort', 'tableData')
this.rowDrop('file-sort', 'sortTableData')
},
showSort() {
this.sortVisible = true
this.sortTableData = JSON.parse(JSON.stringify(this.tableData))
},
// -
handleSort() {
const ids = []
const sequences = []
this.tableData.map((value, index) => {
this.sortTableData.map((value, index) => {
ids.push(value.id)
sequences.push(index + 1)
})
@ -301,6 +306,8 @@ export default {
FetchFileSort(params).then((res) => {
this.sortVisible = false
this.$message.success('附件排序成功!')
this.crud.refresh()
this.getFileList()
})
},
// table

Loading…
Cancel
Save