yujialong 4 months ago
parent 71527981c9
commit cf965e2cd6
  1. 1
      src/api/index.js
  2. 2
      src/components/modules/content.vue
  3. 2
      src/components/modules/module.vue
  4. 13
      src/pages/logo/index.vue
  5. 76
      src/pages/site/list/index.vue

@ -35,6 +35,7 @@ export default {
groupList: `/iasf/sys/userGroup/list`, groupList: `/iasf/sys/userGroup/list`,
groupUpdate: `/iasf/sys/userGroup/update`, groupUpdate: `/iasf/sys/userGroup/update`,
site: `/iasf/sys/site/list`, site: `/iasf/sys/site/list`,
addSite: `/iasf/sys/site/add`,
updateSite: `/iasf/sys/site/update`, updateSite: `/iasf/sys/site/update`,
delSite: `/iasf/sys/site/delete`, delSite: `/iasf/sys/site/delete`,
listWithTree: `/iasf/sysColumn/listWithTree`, listWithTree: `/iasf/sysColumn/listWithTree`,

@ -53,7 +53,7 @@
</div> </div>
</template> </template>
<div v-if="item.type === 'link'" class="flex"> <div v-if="item.type === 'link'" class="flex">
<el-input class="m-r-10" v-model="data.form.link.linkName"></el-input> <el-input class="m-r-10" v-model="data.form.link.linkName" disabled></el-input>
<el-button @click="toLink(data.form)">设置链接</el-button> <el-button @click="toLink(data.form)">设置链接</el-button>
</div> </div>
</el-form-item> </el-form-item>

@ -100,7 +100,7 @@
<i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i> <i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
</div> </div>
<div v-if="item.type === 'link'" class="flex"> <div v-if="item.type === 'link'" class="flex">
<el-input class="m-r-10" v-model="data.form.link.linkName"></el-input> <el-input class="m-r-10" v-model="data.form.link.linkName" disabled></el-input>
<el-button @click="toLink(data.form)">设置链接</el-button> <el-button @click="toLink(data.form)">设置链接</el-button>
</div> </div>
<Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' <Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'

@ -6,7 +6,7 @@
</el-form-item> </el-form-item>
<el-form-item label="图标"> <el-form-item label="图标">
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove" <el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :show-file-list="false" :on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList"
:on-success="uploadSuccess"> :on-success="uploadSuccess">
<div style="text-align: left;"> <div style="text-align: left;">
<el-button size="small" type="primary">上传logo</el-button> <el-button size="small" type="primary">上传logo</el-button>
@ -43,7 +43,8 @@ export default {
title: '', title: '',
logoUrl: '', logoUrl: '',
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
} },
fileList: [],
} }
}, },
mounted () { mounted () {
@ -54,10 +55,10 @@ export default {
const res = await this.$post(`${this.api.findLogo}?siteId=${this.siteId}`) const res = await this.$post(`${this.api.findLogo}?siteId=${this.siteId}`)
if (res.data) { if (res.data) {
this.form = res.data this.form = res.data
this.uploadList.push({ this.fileList = res.data.logoUrl ? [{
name: 'logo.jpg', name: 'logo.jpg',
url: res.data.logoUrl url: res.data.logoUrl
}) }] : []
} }
}, },
handleExceed () { // handleExceed () { //
@ -85,11 +86,11 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove () { handleRemove () {
this.coverUrl = '' this.form.logoUrl = ''
}, },
async save () { async save () {
const { form } = this const { form } = this
if (!form.logoUrl) return Util.errorMsg('请上传logo!') // if (!form.logoUrl) return Util.errorMsg('logo')
await this.$post(this.api.saveLogo, this.form) await this.$post(this.api.saveLogo, this.form)
Util.successMsg('更新成功') Util.successMsg('更新成功')
this.getData() this.getData()

@ -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>
Loading…
Cancel
Save