悬浮栏联调

master
yujialong 6 months ago
parent 50787383b2
commit d8ea4f0cf4
  1. 1
      src/api/index.js
  2. 6
      src/layouts/navbar/index.vue
  3. 2
      src/mixins/page/index.js
  4. 70
      src/pages/annex/list/index.vue
  5. 4
      src/pages/column/list/index.vue
  6. 522
      src/pages/column/page/aboutUs.vue
  7. 192
      src/pages/floatingFrame/index.vue
  8. 550
      src/pages/footer/index.vue
  9. 2
      src/router/modules/floatingFrame.js
  10. 16
      src/router/modules/footer.js

@ -41,6 +41,7 @@ export default {
deleteColumn: `/iasf/sysColumn/batchDeletion`, deleteColumn: `/iasf/sysColumn/batchDeletion`,
sameLevelJudgment: `/iasf/sysColumn/sameLevelJudgment`, sameLevelJudgment: `/iasf/sysColumn/sameLevelJudgment`,
sortByColumn: `/iasf/sysColumn/sortByColumn`, sortByColumn: `/iasf/sysColumn/sortByColumn`,
controlDisplayNavigationMenu: `/iasf/sysColumn/controlDisplayNavigationMenu`,
checkIfTheTitleIsRepeat: `/iasf/sysContent/checkIfTheTitleIsRepeat`, checkIfTheTitleIsRepeat: `/iasf/sysContent/checkIfTheTitleIsRepeat`,
deleteArticle: `/iasf/sysContent/batchDeletion`, deleteArticle: `/iasf/sysContent/batchDeletion`,
findArticle: `/iasf/sysContent/findById`, findArticle: `/iasf/sysContent/findById`,

@ -154,7 +154,11 @@ export default {
}, },
{ {
index: '/floatingFrame', index: '/floatingFrame',
title: '悬浮栏管理' title: '悬浮栏设置'
},
{
index: '/footer',
title: '页脚设置'
} }
] ]
} }

@ -65,6 +65,7 @@ export default {
}) })
const { modules } = this const { modules } = this
// 查询页面详情 // 查询页面详情
if (this.columnId) {
this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => { this.$post(`${this.api.findPage}?columnId=${this.columnId}`).then(({ data }) => {
if (data.length) { if (data.length) {
const json = data[0] const json = data[0]
@ -83,6 +84,7 @@ export default {
console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules) console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules)
} }
}).catch(err => { }) }).catch(err => { })
}
}, },
// 展开模块设置 // 展开模块设置
toSet (i, listIndex) { toSet (i, listIndex) {

@ -6,22 +6,14 @@
<label>站点选择</label> <label>站点选择</label>
<el-select v-model="form.site" @change="initData"> <el-select v-model="form.site" @change="initData">
<el-option label="不限" value=""></el-option> <el-option label="不限" value=""></el-option>
<el-option <el-option v-for="item in sites" :key="item.id" :label="item.siteName" :value="item.siteName">
v-for="item in sites"
:key="item.id"
:label="item.siteName"
:value="item.siteName">
</el-option> </el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
<label>文件类型</label> <label>文件类型</label>
<el-select v-model="form.type" @change="initData"> <el-select v-model="form.type" @change="initData">
<el-option <el-option v-for="item in types" :key="item.name" :label="item.name" :value="item.name">
v-for="item in types"
:key="item.name"
:label="item.name"
:value="item.name">
</el-option> </el-option>
</el-select> </el-select>
</li> </li>
@ -30,22 +22,21 @@
<div class="tool"> <div class="tool">
<div class="search-wrap"> <div class="search-wrap">
<el-select v-model="field" @change="initData"> <el-select v-model="field" @change="initData">
<el-option <el-option v-for="(item, i) in keywords" :key="i" :label="item.name" :value="item.id">
v-for="(item, i) in keywords"
:key="i"
:label="item.name"
:value="item.id">
</el-option> </el-option>
</el-select> </el-select>
<el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword" clearable></el-input> <el-input class="keyword" :placeholder="'请输入' + keywords.find(e => e.id === field).name" v-model.trim="keyword"
clearable></el-input>
</div> </div>
<div class="actions"> <div class="actions">
<el-button v-auth @click="batchDel">删除</el-button> <el-button v-auth @click="batchDel">删除</el-button>
</div> </div>
</div> </div>
<el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange" row-key="id"> <el-table ref="table" :data="list" class="table" header-align="center" @selection-change="handleSelectionChange"
<el-table-column type="selection" width="50" align="center" :reserve-selection="true" :selectable="row => !row.quote"></el-table-column> row-key="id">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"
:selectable="row => !row.quote"></el-table-column>
<el-table-column type="index" width="60" label="ID"></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="site" label="站点" min-width="180"></el-table-column>
<el-table-column prop="quote" label="文章名称" min-width="180" show-overflow-tooltip> <el-table-column prop="quote" label="文章名称" min-width="180" show-overflow-tooltip>
@ -77,7 +68,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div class="pagination"> <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>
</div> </div>
</template> </template>
@ -86,7 +78,7 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import util from '@/libs/util' import util from '@/libs/util'
export default { export default {
data() { data () {
return { return {
sites: [], sites: [],
types: [ types: [
@ -136,14 +128,14 @@ export default {
]) ])
}, },
watch: { watch: {
keyword: function(val) { keyword: function (val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.initData() this.initData()
}, 500) }, 500)
} }
}, },
mounted() { mounted () {
this.$store.commit('user/setCrumbs', [ this.$store.commit('user/setCrumbs', [
{ {
name: '附件管理' name: '附件管理'
@ -153,7 +145,7 @@ export default {
this.getSite() this.getSite()
}, },
methods: { methods: {
getData() { getData () {
const { form } = this const { form } = this
this.$post(this.api.listByPage, { this.$post(this.api.listByPage, {
page: this.page, page: this.page,
@ -166,45 +158,45 @@ export default {
}).then(({ data }) => { }).then(({ data }) => {
this.list = data.records this.list = data.records
this.total = +data.total this.total = +data.total
}).catch(err => {}) }).catch(err => { })
}, },
// //
getSite() { getSite () {
this.$post(this.api.site, { this.$post(this.api.site, {
page: 1, page: 1,
limit: 1000, limit: 1000,
siteName: '' siteName: ''
}).then(({ data }) => { }).then(({ data }) => {
this.sites = util.getSite(data.records) this.sites = util.getSite(data.records)
}).catch(e => {}) }).catch(e => { })
}, },
initData() { initData () {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.page = 1 this.page = 1
this.getData() this.getData()
}, },
// //
show(row) { show (row) {
const format = row.format const format = row.format
window.open((util.isDoc(format) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + row.url) window.open((util.isDoc(format) ? 'https://view.officeapps.live.com/op/view.aspx?src=' : '') + row.url)
}, },
// //
download(row) { download (row) {
util.downloadFile(row.fileName, row.url) util.downloadFile(row.fileName, row.url)
}, },
// //
del(row) { del (row) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$del(`${this.api.delFile}`, [row.id]).then(res => { this.$del(`${this.api.delFile}`, [row.id]).then(res => {
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
}, },
// //
batchDel() { batchDel () {
const list = this.multipleSelection const list = this.multipleSelection
if (list.length) { if (list.length) {
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
@ -214,16 +206,16 @@ export default {
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
util.successMsg('删除成功') util.successMsg('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => { })
}).catch(() => {}) }).catch(() => { })
} else { } else {
util.errorMsg('请先选择数据 !') util.errorMsg('请先选择数据 !')
} }
}, },
handleSelectionChange(val) { handleSelectionChange (val) {
this.multipleSelection = val this.multipleSelection = val
}, },
handleCurrentChange(val) { handleCurrentChange (val) {
this.page = val this.page = val
this.$router.push(`list?page=${val}`) this.$router.push(`list?page=${val}`)
this.getData() this.getData()
@ -232,6 +224,4 @@ export default {
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

@ -276,8 +276,8 @@ export default {
}).catch(() => { }) }).catch(() => { })
}, },
// //
switchOff (val, row) { async switchOff (val, row) {
this.$post(this.api.updateColumn, row).then(res => { }).catch((res) => { }) await this.$post(`${this.api.controlDisplayNavigationMenu}?id=${row.id}&menuVisible=${val}`)
}, },
// //
preview (row) { preview (row) {

File diff suppressed because it is too large Load Diff

@ -14,15 +14,15 @@
@selection-change="handleSelectionChange" row-key="id"> @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="schemeName" show-overflow-tooltip label="悬浮栏名称" min-width="140"></el-table-column> <el-table-column prop="schemeName" show-overflow-tooltip label="悬浮栏名称" min-width="140"></el-table-column>
<el-table-column prop="scopeOfApplication" label="应用范围" min-width="100"></el-table-column> <el-table-column prop="scopeOfApplication" label="应用范围" min-width="140"></el-table-column>
<el-table-column prop="numberOfContentModules" label="内容模块" min-width="100"></el-table-column> <el-table-column prop="numberOfContentModules" label="内容模块" width="100" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="100"></el-table-column> <el-table-column prop="createTime" label="创建时间" width="160"></el-table-column>
<el-table-column prop="updateTime" label="最近编辑" min-width="100"></el-table-column> <el-table-column prop="updateTime" label="最近编辑" width="160"></el-table-column>
<el-table-column prop="editorSName" label="编辑人" min-width="100"></el-table-column> <el-table-column prop="editorSName" label="编辑人" width="120"></el-table-column>
<el-table-column label="状态" min-width="100"> <el-table-column label="状态" width="100">
<template slot-scope="scope">{{ scope.row.isDisable ? '禁用' : '启用' }}</template> <template slot-scope="scope">{{ scope.row.isDisable ? '禁用' : '启用' }}</template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="180"> <el-table-column label="操作" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text" <el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text"
@click="edit(scope.row)">编辑</el-button> @click="edit(scope.row)">编辑</el-button>
@ -81,13 +81,13 @@
</div> </div>
<el-form-item label="应用范围"> <el-form-item label="应用范围">
<div class="flex"> <div class="flex">
<el-radio-group class="m-t-10" v-model="range"> <el-radio-group class="m-t-10" v-model="form.isGlobal">
<el-radio :label="0">网站全局</el-radio> <el-radio :label="1">网站全局</el-radio>
<el-radio :label="1">选择栏目</el-radio> <el-radio :label="0">选择栏目</el-radio>
</el-radio-group> </el-radio-group>
<el-cascader v-if="range" class="m-l-30" v-model="selectColumn" :options="columns" :props="columnProps" <el-cascader v-if="!form.isGlobal" class="m-l-30" v-model="selectColumn" :options="columns"
clearable></el-cascader> :props="columnProps" clearable></el-cascader>
</div> </div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -100,12 +100,15 @@
<el-dialog title="新增内容" :visible.sync="contentVisible" width="900px" :close-on-click-modal="false"> <el-dialog title="新增内容" :visible.sync="contentVisible" width="900px" :close-on-click-modal="false">
<el-form ref="contentForm" :model="curRow" :rules="contentRules" label-width="100px" label-suffix=""> <el-form ref="contentForm" :model="curRow" :rules="contentRules" label-width="100px" label-suffix="">
<el-form-item prop="pictureAddress" label="图片"> <el-form-item prop="pictureAddress" label="图片">
<el-upload class="avatar-uploader" accept=".jpg,.png,.jpeg,.gif" :on-change="file => changeFile(file)" <el-upload class="uploader" accept=".jpg,.png,.jpeg" :on-success="uploadSuccess" :show-file-list="false"
:show-file-list="false" :action="this.api.upload" :auto-upload="false"> :headers="headers" :action="api.upload">
<img v-if="curRow.pictureAddress" :src="curRow.pictureAddress" class="avatar"> <img v-if="curRow.pictureAddress" :src="curRow.pictureAddress" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
<img class="plus" src="@/assets/images/plus.png" alt=""> <i class="el-icon-plus"></i>
<p>点击上传</p> <p>上传图标</p>
</div>
<div slot="tip" class="el-upload__tip">
<p>只支持.jpg,.png格式请上传30*30左右规格的图标</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -123,12 +126,6 @@
<el-button type="primary" @click="contentSubmit">确定</el-button> <el-button type="primary" @click="contentSubmit">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
<Cropper ref="cropper" :img-file.sync="file" :is-upload="isUpload" :fixed="true" :fixedNumber.sync="fixedNumber"
@upload="customUpload" />
</el-dialog>
</div> </div>
</template> </template>
@ -136,13 +133,15 @@
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import Axios from 'axios' import Axios from 'axios'
import Cropper from '@/components/img-upload/Cropper'
import Editor from '@tinymce/tinymce-vue' import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor' import editorConfig from '@/components/editor'
import _ from 'lodash' import _ from 'lodash'
export default { export default {
data () { data () {
return { return {
headers: {
token: Util.local.get(Setting.tokenKey)
},
editorConfig, editorConfig,
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
siteName: this.$store.state.content.site.siteName, siteName: this.$store.state.content.site.siteName,
@ -154,7 +153,6 @@ export default {
total: 0, total: 0,
multipleSelection: [], multipleSelection: [],
listLoading: false, listLoading: false,
range: 0,
selectColumn: [], selectColumn: [],
columns: [], columns: [],
columnProps: { columnProps: {
@ -209,6 +207,7 @@ export default {
` `
} }
], ],
isGlobal: 1,
floatingColumnSchemeScopeOfApplications: [], floatingColumnSchemeScopeOfApplications: [],
}, },
originModules: { originModules: {
@ -239,16 +238,10 @@ export default {
{ required: true, message: '请输入内容', trigger: 'blur' } { required: true, message: '请输入内容', trigger: 'blur' }
], ],
}, },
cropperModel: false,
isUpload: false,
fixedNumber: [1, 1],
file: {}, //
}; };
}, },
components: { components: {
Editor, Editor,
Cropper,
}, },
watch: { watch: {
keyword: function (val) { keyword: function (val) {
@ -308,7 +301,6 @@ export default {
this.columns = data this.columns = data
}, },
add () { add () {
this.range = 0
this.selectColumn = [] this.selectColumn = []
this.form = _.cloneDeep(this.originForm) this.form = _.cloneDeep(this.originForm)
this.moduleVisible = true this.moduleVisible = true
@ -337,8 +329,6 @@ export default {
this.moduleVisible = true this.moduleVisible = true
const { data } = await this.$post(`${this.api.findFloating}?id=${row.floatingBarSchemeId}`) const { data } = await this.$post(`${this.api.findFloating}?id=${row.floatingBarSchemeId}`)
const range = data.floatingColumnSchemeScopeOfApplications const range = data.floatingColumnSchemeScopeOfApplications
// applicationScopeId0
this.range = row.isGlobal ? 0 : 1
if (!row.isGlobal) { if (!row.isGlobal) {
const column = [] const column = []
// //
@ -359,12 +349,12 @@ export default {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
if (!form.floatingColumnSchemeModules.length) return Util.warningMsg('请添加内容模块') if (!form.floatingColumnSchemeModules.length) return Util.warningMsg('请添加内容模块')
const column = this.selectColumn const column = this.selectColumn
if (this.range && !column.length) return Util.warningMsg('请选择栏目') if (!form.isGlobal && !column.length) return Util.warningMsg('请选择栏目')
this.submiting = true this.submiting = true
if (this.range) { //
if (!form.isGlobal) {
const scope = [] const scope = []
// debugger
column.map(e => { column.map(e => {
scope.push({ scope.push({
applicationScopeId: typeof e === 'number' ? e : e.join(',') applicationScopeId: typeof e === 'number' ? e : e.join(',')
@ -376,8 +366,8 @@ export default {
applicationScopeId: 0 applicationScopeId: 0
}] }]
} }
if (!form.floatingBarSchemeId) form.founderId = form.editorId form.isDisable = 1
// debugger if (!form.floatingBarSchemeId) form.founderId = form.editorId //
try { try {
await this.$post(this.api.saveFloating, form) await this.$post(this.api.saveFloating, form)
Util.successMsg('新增成功!') Util.successMsg('新增成功!')
@ -398,9 +388,11 @@ export default {
if (valid) { if (valid) {
this.contentVisible = false this.contentVisible = false
const row = this.curRow const row = this.curRow
//
if (this.curModule === -1) { if (this.curModule === -1) {
this.form.floatingColumnSchemeModules.push(_.cloneDeep(row)) this.form.floatingColumnSchemeModules.push(_.cloneDeep(row))
} else { } else {
//
const list = this.form.floatingColumnSchemeModules[this.curModule] const list = this.form.floatingColumnSchemeModules[this.curModule]
for (const i in row) { for (const i in row) {
this.$set(list, i, row[i]) this.$set(list, i, row[i])
@ -409,57 +401,10 @@ export default {
} }
}) })
}, },
//
customUpload (data) { //
const formData = new FormData() uploadSuccess (res) {
formData.append('file', data, this.file.name) this.curRow.pictureAddress = res.url
this.imgUpload(formData)
},
//
imgUpload (formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.upload,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey)
},
}).then(({ data }) => {
if (data.code === 401) {
Util.errorMsg("登录过期,请重新登录");
setTimeout(() => {
this.$store.dispatch('user/logout')
}, 1000);
return false
}
this.$set(this.curRow, 'pictureAddress', data.url)
}).catch(res => { })
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
},
//
changeFile (file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
if (size / 1024 / 1024 > 100) {
this.$message.error('请上传100M以内的图片!')
return false
}
this.file = file
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
url: window.URL.createObjectURL(file.raw),
size: file.size
})
})
}, },
del (row) { del (row) {
@ -476,20 +421,23 @@ export default {
async switchOff (row) { async switchOff (row) {
try { try {
const { code, msg } = await this.$post(`${this.api.checkEnableOrDisable}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`) const { code, msg } = await this.$post(`${this.api.checkEnableOrDisable}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
// debugger
if (code === 300) { if (code === 300) {
// 300 // 300
this.$confirm(msg, '提示', { this.$confirm(msg, '提示', {
type: "warning" type: "warning"
}).then(async () => { }).then(async () => {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`) await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
this.getData()
}).catch(() => { }).catch(() => {
row.isDisable = row.isDisable ? 0 : 1 row.isDisable = row.isDisable ? 0 : 1
}) })
} else { } else {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`) await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
this.getData()
}
} catch (e) {
row.isDisable = row.isDisable ? 0 : 1
} }
} catch (e) { }
}, },
// //
batchDel () { batchDel () {
@ -516,7 +464,6 @@ export default {
}, },
handleCurrentChange (val) { handleCurrentChange (val) {
this.page = val this.page = val
this.$router.push(`list?page=${val}`)
this.getData() this.getData()
}, },
} }
@ -609,4 +556,65 @@ $upload-lg-height: 102px;
max-width: 100px; max-width: 100px;
margin: 10px 0; margin: 10px 0;
} }
$avatar-width: 140px;
$avatar-height: 80px;
/deep/.uploader {
.el-upload {
position: relative;
width: $avatar-width;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
&:hover {
border-color: #409EFF;
}
.uploader-default {
display: flex;
flex-direction: column;
justify-content: center;
width: $avatar-width !important;
height: $avatar-height;
text-align: center;
background: rgba(0, 0, 0, 0.04);
i {
font-size: 20px;
font-weight: bold;
color: #8c939d;
}
p {
margin-top: 10px;
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 1;
}
}
.avatar {
display: block;
width: $avatar-width;
height: $avatar-height;
}
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 14px;
color: rgba(0, 0, 0, 0.45);
line-height: 1;
&:first-child {
margin-bottom: 5px;
}
}
}
}
</style> </style>

@ -0,0 +1,550 @@
<template>
<div class="page">
<div class="tool">
<div class="search-wrap">
<el-input placeholder="请输入页脚名称" v-model.trim="keyword" clearable></el-input>
</div>
<div class="actions">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:新增'" type="primary" @click="add">新增</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" @click="batchDel">删除</el-button>
</div>
</div>
<el-table v-loading="listLoading" ref="table" :data="list" default-expand-all class="table" header-align="center"
@selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="50" align="center" :reserve-selection="true"></el-table-column>
<el-table-column prop="schemeName" show-overflow-tooltip label="页脚名称" min-width="140"></el-table-column>
<el-table-column prop="scopeOfApplication" label="应用范围" min-width="100"></el-table-column>
<el-table-column prop="numberOfContentModules" label="模块名称" min-width="100"></el-table-column>
<el-table-column prop="createTime" label="创建时间" min-width="100"></el-table-column>
<el-table-column prop="updateTime" label="最近编辑" min-width="100"></el-table-column>
<el-table-column prop="editorSName" label="编辑人" min-width="100"></el-table-column>
<el-table-column label="状态" min-width="100">
<template slot-scope="scope">{{ scope.row.isDisable ? '禁用' : '启用' }}</template>
</el-table-column>
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:编辑'" type="text"
@click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'/site/list:' + siteName + ':内容管理:栏目管理:删除'" type="text"
@click="del(scope.row)">删除</el-button>
<el-switch class="m-l-10" v-model="scope.row.isDisable" :active-value="0" :inactive-value="1"
@change="switchOff(scope.row)">
</el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page"
layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
<el-dialog title="模块管理" :visible.sync="moduleVisible" width="1000px" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-suffix="">
<div class="flex">
<el-form-item prop="schemeName" label="页脚名称" label-width="100px">
<el-input style="width: 200px" placeholder="请输入页脚名称" v-model="form.schemeName" clearable
maxlength="10"></el-input>
</el-form-item>
<el-form-item prop="style" label="页脚样式" label-width="110px">
<el-select v-model="form.floatingBarStyle" clearable>
<el-option v-for="item in styles" :key="item.id" :label="item.name" :value="item.id">
</el-option>
</el-select>
</el-form-item>
</div>
<!-- <div class="contact">
<div class="inner">
<div class="title c-wrap">
<h6>{{ modules[10].form.title }}</h6>
<p class="text">{{ modules[10].form.des }}</p>
<div class="cover" @click="toSet(10)">点击更改标题与描述</div>
</div>
<div class="region">
<img class="dot" src="https://huorantech.com/images/about/dot.png" alt="">
<p class="name">深圳</p>
</div>
<div class="info">
<img class="logo" :src="modules[11].form.pic" alt="">
<div class="texts c-wrap">
<div class="item">
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/site.png" alt="">
{{ modules[11].form.siteName }}
</div>
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/address.png" alt="">
{{ modules[11].form.address }}
</div>
</div>
<div class="item">
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/phone.png" alt="">
{{ modules[11].form.phone }}
</div>
<div class="line">
<img class="icon" src="https://huorantech.com/images/about/mail.png" alt="">
{{ modules[11].form.mail }}
</div>
</div>
<div class="cover" style="width: 800px" @click="toSet(11)">点击更改信息</div>
<div class="qrcode c-wrap">
<img width="103" :src="modules[12].form.pic" alt="">
<p class="text">{{ modules[12].form.title }}</p>
<div class="cover" @click="toSet(12)">点击更改信息</div>
</div>
<div class="qrcode c-wrap m-l-30">
<img width="103" :src="modules[13].form.pic" alt="">
<p class="text">{{ modules[13].form.title }}</p>
<div class="cover" @click="toSet(13)">点击更改信息</div>
</div>
</div>
</div>
</div>
</div> -->
<el-form-item label="应用范围">
<div class="flex">
<el-radio-group class="m-t-10" v-model="range">
<el-radio :label="0">网站全局</el-radio>
<el-radio :label="1">选择栏目</el-radio>
</el-radio-group>
<el-cascader v-if="range" class="m-l-30" v-model="selectColumn" :options="columns" :props="columnProps"
clearable></el-cascader>
</div>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="moduleVisible = false">取消</el-button>
<el-button type="primary" @click="moduleSubmit">确定</el-button>
</span>
</el-dialog>
<Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
</div>
</template>
<script>
import Setting from '@/setting'
import Util from '@/libs/util'
import Axios from 'axios'
import Editor from '@tinymce/tinymce-vue'
import editorConfig from '@/components/editor'
import _ from 'lodash'
export default {
data () {
return {
editorConfig,
siteId: this.$store.state.content.site.id,
siteName: this.$store.state.content.site.siteName,
keyword: '',
searchTimer: null,
list: [],
page: 1,
pageSize: 10,
total: 0,
multipleSelection: [],
listLoading: false,
range: 0,
selectColumn: [],
styles: [],
columns: [],
columnProps: {
multiple: true,
value: 'id',
label: 'columnName'
},
originForm: {},
form: {
editorId: this.$store.state.user.userId,
schemeName: '',
floatingBarStyle: '1',
siteId: this.$store.state.content.site.id,
floatingColumnSchemeModules: [
{
pictureAddress: 'https://huorantech.com/images/index/wechat.png',
schemeTitle: '微信扫码添加职站售前咨询',
isDisable: 0,
schemeContentJson: `
<div style="width: 168px;text-align: center;line-height: normal;">
<p style="margin: 5px 0 15px;font-size: 12px;color: #333;">提供付费咨询及解决方案</p>
<img width="150" src="https://huorantech.com/images/index/customer.png" alt="">
</div>
`
},
{
pictureAddress: 'https://huorantech.com/images/index/tel.png',
schemeTitle: '',
isDisable: 0,
schemeContentJson: `
<div style="width: 190px;line-height: normal;">
<div style="display: flex;margin-bottom: 20px;">
<div>
<img src="https://huorantech.com/images/index/tel-2.png" alt="">
</div>
<div style="margin-left: 15px;">
<p style="font-size: 14px;cursor: pointer;">售前咨询</p>
<p style="margin: 5px 0;font-size: 12px;color: #006eff;">金老师</p>
<p style="font-size: 12px;color: #006eff;">15218726836</p>
</div>
</div>
<div style="display: flex;">
<div>
<img src="https://huorantech.com/images/index/sug.png" alt="">
</div>
<div style="margin-left: 15px;">
<a style="font-size: 14px;color: #333;text-decoration: none;cursor: pointer;" target="_blank" href="https://www.wjx.cn/vm/wB0RcMm.aspx">咨询建议与反馈</a>
<p style="margin-top: 5px;font-size: 12px;color: #686868;">您的每一条建议声音我们都认真对待</p>
</div>
</div>
</div>
`
}
],
floatingColumnSchemeScopeOfApplications: [],
},
originModules: {
pictureAddress: '',
schemeContentJson: '',
schemeTitle: '',
isDisable: 0,
},
rules: {
schemeName: [
{ required: true, message: '请输入悬浮栏目名称', trigger: 'blur' }
],
},
moduleVisible: false,
modules: [],
curRow: {},
curModule: 0,
contentVisible: false,
contentRules: {
pictureAddress: [
{ required: true, message: '请上传图片', trigger: 'change' }
],
// schemeTitle: [
// { required: true, message: '', trigger: 'blur' }
// ],
schemeContentJson: [
{ required: true, message: '请输入内容', trigger: 'blur' }
],
},
cropperModel: false,
isUpload: false,
fixedNumber: [1, 1],
file: {}, //
};
},
components: {
Editor,
},
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => {
this.initData()
}, 500)
}
},
mounted () {
this.$store.commit('user/setCrumbs', [
{
name: '站点管理',
route: '/site'
},
{
name: '内容管理'
},
{
name: '页脚设置'
}
])
// this.originForm = _.cloneDeep(this.form)
// this.getData()
// this.getColumn()
},
methods: {
getData () {
this.$post(this.api.listFloating, {
siteId: this.siteId,
search: this.keyword,
pageNum: this.page,
pageSize: this.pageSize,
}).then(({ data }) => {
this.list = data.records
this.total = +data.total
this.listLoading = false
}).catch(err => {
this.listLoading = false
})
},
//
initData () {
this.$refs.table.clearSelection()
this.page = 1
this.getData()
},
//
async getColumn () {
const { data } = await this.$post(this.api.listWithTree, {
siteId: this.siteId,
columnName: '',
templateId: '',
typeId: '',
isSort: 1
})
this.columns = data
},
add () {
this.range = 0
this.selectColumn = []
this.form = _.cloneDeep(this.originForm)
this.moduleVisible = true
},
//
addRow () {
this.curRow = _.cloneDeep(this.originModules)
this.curModule = -1
this.contentVisible = true
},
//
editRow (row, i = 0) {
this.curRow = _.cloneDeep(row)
this.curModule = i
this.contentVisible = true
},
//
delRow (i) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
this.form.floatingColumnSchemeModules.splice(i, 1)
}).catch(() => { })
},
async edit (row) {
this.moduleVisible = true
const { data } = await this.$post(`${this.api.findFloating}?id=${row.floatingBarSchemeId}`)
const range = data.floatingColumnSchemeScopeOfApplications
// applicationScopeId0
this.range = row.isGlobal ? 0 : 1
if (!row.isGlobal) {
const column = []
//
range.map(e => {
column.push(e.applicationScopeId.split(',').map(n => +n))
})
this.selectColumn = column
console.log("🚀 ~ edit ~ this.selectColumn:", this.selectColumn)
}
this.form = data
},
//
moduleSubmit () {
this.$refs.form.validate(async (valid) => {
if (valid) {
if (this.submiting) return false
const form = JSON.parse(JSON.stringify(this.form))
if (!form.floatingColumnSchemeModules.length) return Util.warningMsg('请添加内容模块')
const column = this.selectColumn
if (this.range && !column.length) return Util.warningMsg('请选择栏目')
this.submiting = true
if (this.range) {
const scope = []
// debugger
column.map(e => {
scope.push({
applicationScopeId: typeof e === 'number' ? e : e.join(',')
})
})
form.floatingColumnSchemeScopeOfApplications = scope
} else {
form.floatingColumnSchemeScopeOfApplications = [{
applicationScopeId: 0
}]
}
if (!form.floatingBarSchemeId) form.founderId = form.editorId
// debugger
try {
await this.$post(this.api.saveFloating, form)
Util.successMsg('新增成功!')
this.moduleVisible = false
this.getData()
setTimeout(() => {
this.submiting = false
}, 2000)
} catch (e) {
this.submiting = false
}
}
})
},
//
contentSubmit () {
this.$refs.contentForm.validate(async (valid) => {
if (valid) {
this.contentVisible = false
const row = this.curRow
if (this.curModule === -1) {
this.form.floatingColumnSchemeModules.push(_.cloneDeep(row))
} else {
const list = this.form.floatingColumnSchemeModules[this.curModule]
for (const i in row) {
this.$set(list, i, row[i])
}
}
}
})
},
del (row) {
this.$confirm('确定要删除吗?', "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.batchDeletionFloating}?id=${row.floatingBarSchemeId}`).then(res => {
Util.successMsg("删除成功")
this.getData()
}).catch(res => { })
}).catch(() => { })
},
//
async switchOff (row) {
try {
const { code, msg } = await this.$post(`${this.api.checkEnableOrDisable}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
// debugger
if (code === 300) {
// 300
this.$confirm(msg, '提示', {
type: "warning"
}).then(async () => {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}).catch(() => {
row.isDisable = row.isDisable ? 0 : 1
})
} else {
await this.$post(`${this.api.enableOrDisableScheme}?id=${row.floatingBarSchemeId}&isDisable=${row.isDisable}`)
}
} catch (e) { }
},
//
batchDel () {
const list = this.multipleSelection
if (list.length) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
const ids = list.map(e => {
return 'id=' + e.floatingBarSchemeId
})
this.$post(`${this.api.batchDeletionFloating}?${ids.join('&')}`).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.getData()
},
}
};
</script>
<style lang="scss" scoped>
.plus {
margin-top: 10px;
font-size: 20px;
text-align: center;
color: $main-color;
cursor: pointer;
}
.del {
margin-left: 8px;
font-size: 18px;
color: #333;
cursor: pointer;
}
$upload-width: 220px;
$upload-height: 102px;
$upload-lg-height: 102px;
/deep/ .avatar-uploader {
.el-upload {
position: relative;
width: $upload-width;
height: $upload-height;
border: 1px solid #dcdee0;
border-radius: 2px;
cursor: pointer;
overflow: hidden;
.uploader-default {
display: flex;
height: $upload-height;
flex-direction: column;
justify-content: center;
align-items: center;
text-align: center;
background: #fafafa;
p {
margin-top: 10px;
font-size: 14px;
color: #333;
line-height: 20px;
}
}
}
&.avatar-uploader-lg {
.el-upload {
width: 100%;
max-width: 820px;
height: $upload-lg-height;
.uploader-default {
height: $upload-lg-height;
}
}
}
.avatar {
display: block;
width: $upload-width;
height: $upload-height;
}
.avatar-lg {
display: block;
width: 100%;
height: $upload-lg-height;
}
.el-upload__tip {
margin-top: 0;
p {
font-size: 12px;
color: #333;
}
}
}
.pic {
max-width: 100px;
margin: 10px 0;
}
</style>

@ -2,8 +2,6 @@ import BasicLayout from '@/layouts/home'
const meta = {} const meta = {}
const pre = 'article-'
export default { export default {
path: '/floatingFrame', path: '/floatingFrame',
meta, meta,

@ -0,0 +1,16 @@
import BasicLayout from '@/layouts/home'
const meta = {}
export default {
path: '/footer',
meta,
component: BasicLayout,
children: [
{
path: `/footer`,
component: () => import('@/pages/footer'),
meta: { title: '页脚设置' }
},
]
}
Loading…
Cancel
Save