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

Loading…
Cancel
Save