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`,
groupUpdate: `/iasf/sys/userGroup/update`,
site: `/iasf/sys/site/list`,
addSite: `/iasf/sys/site/add`,
updateSite: `/iasf/sys/site/update`,
delSite: `/iasf/sys/site/delete`,
listWithTree: `/iasf/sysColumn/listWithTree`,

@ -53,7 +53,7 @@
</div>
</template>
<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>
</div>
</el-form-item>

@ -100,7 +100,7 @@
<i v-if="!item.required" class="el-icon-delete del" @click="data.form[item.prop] = ''"></i>
</div>
<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>
</div>
<Editor v-if="item.type === 'editor'" api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda'

@ -6,7 +6,7 @@
</el-form-item>
<el-form-item label="图标">
<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">
<div style="text-align: left;">
<el-button size="small" type="primary">上传logo</el-button>
@ -43,7 +43,8 @@ export default {
title: '',
logoUrl: '',
siteId: this.$store.state.content.site.id,
}
},
fileList: [],
}
},
mounted () {
@ -54,10 +55,10 @@ export default {
const res = await this.$post(`${this.api.findLogo}?siteId=${this.siteId}`)
if (res.data) {
this.form = res.data
this.uploadList.push({
this.fileList = res.data.logoUrl ? [{
name: 'logo.jpg',
url: res.data.logoUrl
})
}] : []
}
},
handleExceed () { //
@ -85,11 +86,11 @@ export default {
return this.$confirm(`确定移除 ${file.name}`);
},
handleRemove () {
this.coverUrl = ''
this.form.logoUrl = ''
},
async save () {
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)
Util.successMsg('更新成功')
this.getData()

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