|
|
@ -3,63 +3,39 @@ |
|
|
|
<div class="tool"> |
|
|
|
<div class="tool"> |
|
|
|
<p class="page-name">站点列表</p> |
|
|
|
<p class="page-name">站点列表</p> |
|
|
|
<div class="search-wrap"> |
|
|
|
<div class="search-wrap"> |
|
|
|
<el-input placeholder="请输入站点名称" |
|
|
|
<el-input placeholder="请输入站点名称" v-model.trim="keyword" clearable @keyup.enter.native="getData"></el-input> |
|
|
|
v-model.trim="keyword" |
|
|
|
|
|
|
|
clearable |
|
|
|
|
|
|
|
@keyup.enter.native="getData"></el-input> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<el-table ref="table" |
|
|
|
<el-table ref="table" :data="list" class="table" header-align="center" row-key="id"> |
|
|
|
:data="list" |
|
|
|
<el-table-column type="index" width="60" label="序号" align="center"> |
|
|
|
class="table" |
|
|
|
|
|
|
|
header-align="center" |
|
|
|
|
|
|
|
row-key="id"> |
|
|
|
|
|
|
|
<el-table-column type="index" |
|
|
|
|
|
|
|
width="60" |
|
|
|
|
|
|
|
label="序号" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
{{ scope.$index + (page - 1) * pageSize + 1 }} |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="siteName" |
|
|
|
<el-table-column prop="siteName" label="站点名称" align="center"></el-table-column> |
|
|
|
label="站点名称" |
|
|
|
<el-table-column prop="domainName" label="域名" width="400" align="center"> |
|
|
|
align="center"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="domainName" |
|
|
|
|
|
|
|
label="域名" |
|
|
|
|
|
|
|
width="400" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model.trim="scope.row.domainName" |
|
|
|
<el-input v-model.trim="scope.row.domainName" placeholder="请输入域名" @change="update(scope.row)"></el-input> |
|
|
|
placeholder="请输入域名" |
|
|
|
|
|
|
|
@change="update(scope.row)"></el-input> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" |
|
|
|
<el-table-column label="操作" width="170" align="center"> |
|
|
|
width="170" |
|
|
|
|
|
|
|
align="center"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" |
|
|
|
<el-button type="text" @click="toIndex(scope.row)">前往网站首页</el-button> |
|
|
|
@click="toIndex(scope.row)">前往网站首页</el-button> |
|
|
|
<el-button type="text" @click="content(scope.row)">内容管理</el-button> |
|
|
|
<el-button type="text" |
|
|
|
|
|
|
|
@click="content(scope.row)">内容管理</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<div class="pagination"> |
|
|
|
<el-pagination background |
|
|
|
<el-pagination background layout="total, prev, pager, next" :total="total" @current-change="handleCurrentChange" |
|
|
|
layout="total, prev, pager, next" |
|
|
|
:current-page="page"></el-pagination> |
|
|
|
:total="total" |
|
|
|
|
|
|
|
@current-change="handleCurrentChange" |
|
|
|
|
|
|
|
:current-page="page"></el-pagination> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import { mapState, mapMutations } from 'vuex' |
|
|
|
import { mapState, mapMutations } from 'vuex' |
|
|
|
import util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data () { |
|
|
|
data () { |
|
|
@ -79,9 +55,7 @@ export default { |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
keyword: function (val) { |
|
|
|
keyword: function (val) { |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
this.searchTimer = setTimeout(this.initData, 500) |
|
|
|
this.initData() |
|
|
|
|
|
|
|
}, 500) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
@ -91,29 +65,18 @@ export default { |
|
|
|
name: '站点管理' |
|
|
|
name: '站点管理' |
|
|
|
} |
|
|
|
} |
|
|
|
]) |
|
|
|
]) |
|
|
|
// this.updateSite() |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
...mapMutations('content', [ |
|
|
|
...mapMutations('content', [ |
|
|
|
'setSite' |
|
|
|
'setSite' |
|
|
|
]), |
|
|
|
]), |
|
|
|
// 更改域名 |
|
|
|
|
|
|
|
async updateSite () { |
|
|
|
|
|
|
|
await this.$put(this.api.updateSite, { |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
siteName: '或然官网' |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
await this.$del(this.api.delSite, { |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getData () { |
|
|
|
getData () { |
|
|
|
this.$post(this.api.site, { |
|
|
|
this.$post(this.api.site, { |
|
|
|
page: this.page, |
|
|
|
page: this.page, |
|
|
|
limit: this.pageSize, |
|
|
|
limit: this.pageSize, |
|
|
|
siteName: this.keyword |
|
|
|
siteName: this.keyword |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
const list = util.getSite(data.records) |
|
|
|
const list = Util.getSite(data.records) |
|
|
|
this.list = data.records |
|
|
|
this.list = data.records |
|
|
|
this.total = data.records.length |
|
|
|
this.total = data.records.length |
|
|
|
}).catch(e => { }) |
|
|
|
}).catch(e => { }) |
|
|
@ -126,13 +89,11 @@ export default { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 更改域名 |
|
|
|
// 更改域名 |
|
|
|
update (row) { |
|
|
|
async update (row) { |
|
|
|
this.$put(this.api.updateSite, { |
|
|
|
await this.$put(this.api.updateSite, { |
|
|
|
id: row.id, |
|
|
|
id: row.id, |
|
|
|
domainName: row.domainName |
|
|
|
domainName: row.domainName |
|
|
|
}).then(res => { |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}).catch(e => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 前往网站首页 |
|
|
|
// 前往网站首页 |
|
|
|
toIndex (row) { |
|
|
|
toIndex (row) { |
|
|
@ -147,5 +108,4 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped> |
|
|
|
<style lang="scss" scoped></style> |
|
|
|
</style> |
|
|
|
|