After Width: | Height: | Size: 456 B |
After Width: | Height: | Size: 390 B |
After Width: | Height: | Size: 735 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 464 B |
After Width: | Height: | Size: 287 B |
After Width: | Height: | Size: 709 B |
After Width: | Height: | Size: 877 B |
@ -0,0 +1,137 @@ |
||||
<template> |
||||
<div class="page"> |
||||
<div class="tool"> |
||||
<div class="search-wrap"> |
||||
<el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="initData"></el-input> |
||||
<el-button type="primary" @click="initData">查询</el-button> |
||||
</div> |
||||
<div class="actions"> |
||||
<el-button @click="batchDel">删除</el-button> |
||||
</div> |
||||
</div> |
||||
|
||||
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id"> |
||||
<el-table-column type="selection" width="50" :reserve-selection="true"></el-table-column> |
||||
<el-table-column type="index" width="60" label="ID"></el-table-column> |
||||
<el-table-column prop="site" label="站点名称" min-width="180"></el-table-column> |
||||
<el-table-column prop="type" label="文件类型" min-width="100"></el-table-column> |
||||
<el-table-column prop="format" label="格式" min-width="100"></el-table-column> |
||||
<el-table-column prop="fileSize" label="大小" min-width="100"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.fileSize }}kb |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column prop="createDate" label="上传时间" min-width="150"></el-table-column> |
||||
<el-table-column prop="uploader" label="上传人" min-width="100"></el-table-column> |
||||
<el-table-column prop="quote" label="文章名称" min-width="180"></el-table-column> |
||||
<el-table-column prop="deleted" label="是否使用" min-width="100"> |
||||
<template slot-scope="scope"> |
||||
{{ scope.row.deleted ? '否' : '是' }} |
||||
</template> |
||||
</el-table-column> |
||||
<el-table-column label="操作" width="170"> |
||||
<template slot-scope="scope"> |
||||
<el-button type="text" @click="del(scope.row)">删除</el-button> |
||||
<el-button type="text" @click="edit(scope.row, 'edit')">下级</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<div class="pagination"> |
||||
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" :current-page="page"></el-pagination> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import util from "@/libs/util"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
keyword: '', |
||||
page: +this.$route.query.page || 1, |
||||
pageSize: 10, |
||||
total: 0, |
||||
list: [], |
||||
multipleSelection: [], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.getData() |
||||
}, |
||||
methods: { |
||||
getData() { |
||||
this.$post(this.api.listByPage, { |
||||
page: this.page, |
||||
limit: this.pageSize, |
||||
}).then(({ data }) => { |
||||
this.list = data.records |
||||
this.total = +data.total |
||||
}).catch(err => {}) |
||||
}, |
||||
initData() { |
||||
this.$refs.table.clearSelection() |
||||
this.page = 1 |
||||
this.getData() |
||||
}, |
||||
add() { |
||||
this.$router.push('add') |
||||
}, |
||||
edit(row, type) { |
||||
this.$router.push(`add?id=${row.id}&level=${row.level + 1}&type=${type}`) |
||||
}, |
||||
del(row) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$del(`${this.api.delFile}`, [row.id]).then(res => { |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
}, |
||||
batchDel() { |
||||
const list = this.multipleSelection |
||||
if (list.length) { |
||||
this.$confirm('确定要删除吗?', '提示', { |
||||
type: 'warning' |
||||
}).then(() => { |
||||
this.$del(`${this.api.delFile}`, list.map(e => e.id)).then(res => { |
||||
this.$refs.table.clearSelection() |
||||
util.successMsg('删除成功') |
||||
this.getData() |
||||
}).catch(res => {}) |
||||
}).catch(() => {}) |
||||
} else { |
||||
util.errorMsg('请先选择数据 !') |
||||
} |
||||
}, |
||||
handleSelectionChange(val) { |
||||
this.multipleSelection = val |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.page = val |
||||
this.$router.push(`list?page=${val}`) |
||||
this.getData() |
||||
}, |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.styles { |
||||
display: inline-flex; |
||||
li { |
||||
margin-right: 20px; |
||||
text-align: center; |
||||
&:hover .review { |
||||
border-color: #2962FF; |
||||
} |
||||
} |
||||
.review { |
||||
padding: 18px; |
||||
margin-bottom: 10px; |
||||
border: 1px solid #DCDEE0; |
||||
border-radius: 2px; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,23 @@ |
||||
import BasicLayout from '@/layouts/home' |
||||
|
||||
const meta = {} |
||||
|
||||
const pre = 'annex-' |
||||
|
||||
export default { |
||||
path: '/annex', |
||||
name: 'annex', |
||||
redirect: { |
||||
name: `${pre}list` |
||||
}, |
||||
meta, |
||||
component: BasicLayout, |
||||
children: [ |
||||
{ |
||||
name: `${pre}list`, |
||||
path: `list`, |
||||
component: () => import('@/pages/annex/list'), |
||||
meta: { title: '栏目管理' } |
||||
} |
||||
] |
||||
} |
@ -0,0 +1,17 @@ |
||||
/** |
||||
* 内容管理 |
||||
* */ |
||||
export default { |
||||
namespaced: true, |
||||
state: { |
||||
siteId: '' |
||||
}, |
||||
mutations: { |
||||
setSiteId: (state, siteId) => { |
||||
state.siteId = siteId |
||||
} |
||||
}, |
||||
actions: { |
||||
|
||||
} |
||||
}; |