|
@@ -4,26 +4,31 @@
|
|
|
<div style="font-size: 30px;margin-bottom: 10px;background: #1c84c6;padding: 10px;color: #ffffff">
|
|
|
顶部菜单栏配置
|
|
|
</div>
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(0)">添 加 项 目</el-button>
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(0,null)">添 加 项 目</el-button>
|
|
|
<div v-for="(menu,index) in loginMenuData" style="margin: 10px" :key="index">
|
|
|
<div style="font-size: 22px;margin-bottom: 10px">
|
|
|
{{ menu.name }}
|
|
|
</div>
|
|
|
- <div v-if="menu.parentId === 'aboutHZL'">
|
|
|
+ <div v-if="menu.parentId === 'aboutHZL' && aboutHZLData">
|
|
|
<editor v-model="aboutHZLData.pageContent" :min-height="480"></editor>
|
|
|
</div>
|
|
|
<div v-if="menu.parentId !== 'aboutHZL'">
|
|
|
<!-- 操作工具栏 -->
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(1,menu.parentId)">新增
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(1,menu.parentId,index)">
|
|
|
+ 新增
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
<!-- 列表 -->
|
|
|
<el-table v-loading="menu.loading" :data="menu.data">
|
|
|
- <el-table-column label="序号" align="center" prop="id"/>
|
|
|
+ <el-table-column label="序号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="名称" align="center" prop="name"/>
|
|
|
<!-- <el-table-column label="链接" align="center" prop="link"/>-->
|
|
|
<el-table-column label="排序" align="center" prop="sort"/>
|
|
@@ -48,7 +53,8 @@
|
|
|
<!-- <el-table-column label="模块摘要" align="center" prop="digest"/>-->
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template v-slot="scope">
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row,scope.row.type)"
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row,scope.row.type,index)"
|
|
|
v-hasPermi="['supplier:login-page-popularize-module-config:update']"
|
|
|
>编辑
|
|
|
</el-button>
|
|
@@ -83,7 +89,11 @@
|
|
|
</el-row>
|
|
|
<!-- 列表 -->
|
|
|
<el-table v-loading="modObj.loading" :data="modObj.data">
|
|
|
- <el-table-column label="序号" align="center" prop="id"/>
|
|
|
+ <el-table-column label="序号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.$index + 1 }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="模块名称" align="center" prop="name"/>
|
|
|
<el-table-column label="排序" align="center" prop="sort"/>
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
@@ -122,12 +132,12 @@
|
|
|
class="module-item"
|
|
|
:style="{height: vModuleHeight +'px'}"
|
|
|
>
|
|
|
- <div style="height: 12%;padding: 10px 10px 5px"
|
|
|
+ <div style="height: 10%;padding: 10px 10px 5px"
|
|
|
:style="{fontSize: vModuleFontSize1 +'px'}"
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
- <div style="height: 78%;padding:10px 10px 10px">
|
|
|
+ <div style="height: 80%;padding:10px 10px 10px">
|
|
|
<div style="height: 85%">
|
|
|
<img :src="item.imgUrls" width="100%" height="100%">
|
|
|
</div>
|
|
@@ -137,7 +147,7 @@
|
|
|
{{ item.digest }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div style="text-align: center;height: 11%;">
|
|
|
+ <div style="text-align: center;height: 10%;margin-top: 5px">
|
|
|
<el-popover placement="top" width="400" trigger="click">
|
|
|
<span v-for="(modItem,index2) in modObj.data" style="margin: 5px">
|
|
|
<el-button @click="selectMod(modItem,index1)" :key="index2"> {{ modItem.name }}</el-button>
|
|
@@ -152,11 +162,19 @@
|
|
|
<div style="font-size: 30px;margin-bottom: 10px;background: #1c84c6;padding: 10px;color: #ffffff">
|
|
|
底部服务配置
|
|
|
</div>
|
|
|
+ <div style="margin: 10px 0">
|
|
|
+ <el-button icon="el-icon-view" @click="preView(3,bottomModData.pageContent,null)"
|
|
|
+ >预览
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
<editor v-model="bottomModData.pageContent" :min-height="480"></editor>
|
|
|
</div>
|
|
|
<!-- 对话框(添加 / 修改) -->
|
|
|
<el-dialog :title="title" :visible.sync="open" width="700px" v-dialogDrag append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item v-if="editType === 0" label="项目名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入项目名称"/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item v-if="editType === 1" label="方案名称" prop="name">
|
|
|
<el-input v-model="form.name" placeholder="请输入方案名称"/>
|
|
|
</el-form-item>
|
|
@@ -181,11 +199,11 @@
|
|
|
<!--<el-form-item label="链接" prop="link">-->
|
|
|
<!-- <el-input v-model="form.link" type="textarea" placeholder="请输入内容"/>-->
|
|
|
<!--</el-form-item>-->
|
|
|
- <el-form-item label="排序" prop="sort">
|
|
|
- <el-input v-model="form.sort" placeholder="请输入排序"/>
|
|
|
+ <el-form-item v-if="editType !== 0" label="排序" prop="sort">
|
|
|
+ <el-input-number v-model="form.sort" :min="1" label="排序"></el-input-number>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="状态" prop="status">
|
|
|
+ <el-form-item v-if="editType !== 0" label="状态" prop="status">
|
|
|
<el-radio-group v-model="form.status+''">
|
|
|
<el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
|
|
:key="dict.value" :label="dict.value"
|
|
@@ -196,13 +214,17 @@
|
|
|
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
- <el-button icon="el-icon-view" style="background: #c79eff;color: #f3ecec">预 览</el-button>
|
|
|
+ <el-button v-if="editType === 0" type="primary" @click="submitProjectForm">确 定</el-button>
|
|
|
+ <el-button v-else type="primary" @click="submitForm">确 定</el-button>
|
|
|
+ <el-button icon="el-icon-view" style="background: #c79eff;color: #f3ecec"
|
|
|
+ @click="preView(form.type,form,preIndex)"
|
|
|
+ >预 览
|
|
|
+ </el-button>
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="预览" :visible.sync="preOpen" width="1700px">
|
|
|
+ <el-dialog @opened="openPre" title="预览" :visible.sync="preOpen" append-to-body width="99%">
|
|
|
<PreLogin ref="preLogin"></PreLogin>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -247,6 +269,8 @@ export default {
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
preOpen: false,
|
|
|
+ preLoading: false,
|
|
|
+ preParams: {},
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNo: 1,
|
|
@@ -276,7 +300,8 @@ export default {
|
|
|
vModuleHeight: window.innerHeight * 0.45,
|
|
|
vModuleFontSize1: window.innerHeight * 0.022,
|
|
|
vModuleFontSize2: window.innerHeight * 0.015,
|
|
|
- editType: 1
|
|
|
+ editType: 1,
|
|
|
+ preIndex: 0
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -326,14 +351,16 @@ export default {
|
|
|
created() {
|
|
|
//各个模块初始化数据
|
|
|
this.getList('', 2, this.modObj)
|
|
|
- this.getList('aboutHZL', 1, this.aboutHZLData)
|
|
|
+ this.getList('aboutHZL', 3, this.aboutHZLData)
|
|
|
this.getList('bottomMod', 3, this.bottomModData)
|
|
|
getConfigData('login_menu').then(res => {
|
|
|
if (res.data) {
|
|
|
this.configMenuData = res.data
|
|
|
this.loginMenuData = JSON.parse(res.data.value)
|
|
|
this.loginMenuData.forEach(item => {
|
|
|
- this.getList(item.parentId, 1, item)
|
|
|
+ if (typeof item.parentId === 'number') {
|
|
|
+ this.getList(item.parentId, 1, item)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -348,16 +375,21 @@ export default {
|
|
|
methods: {
|
|
|
preView(type, data, index) {
|
|
|
this.preOpen = true
|
|
|
- if (type === 1) {
|
|
|
- this.$nextTick(() => {
|
|
|
+ this.preParams = { type, data, index }
|
|
|
+ },
|
|
|
+ openPre() {
|
|
|
+ let type = this.preParams.type
|
|
|
+ let data = this.preParams.data
|
|
|
+ let index = this.preParams.index
|
|
|
+ this.$nextTick(() => {
|
|
|
+ if (type === 1) {
|
|
|
this.$refs.preLogin.menuPre(data, index)
|
|
|
- })
|
|
|
- }
|
|
|
- if (type === 2) {
|
|
|
- this.$nextTick(() => {
|
|
|
+ } else if (type === 2) {
|
|
|
this.$refs.preLogin.modulePre(data, index)
|
|
|
- })
|
|
|
- }
|
|
|
+ } else if (type === 3) {
|
|
|
+ this.$refs.preLogin.bottomPre(data)
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
/**
|
|
|
* 更新配置模块的数据。
|
|
@@ -396,8 +428,9 @@ export default {
|
|
|
getList(parentId, type, data) {
|
|
|
if (type) {
|
|
|
this.queryParams.type = type
|
|
|
- if (type === 1) {
|
|
|
+ if (typeof type === 'number') {
|
|
|
data.loading = true
|
|
|
+ data.data = []
|
|
|
}
|
|
|
}
|
|
|
if (parentId) {
|
|
@@ -409,6 +442,7 @@ export default {
|
|
|
switch (parentId) {
|
|
|
case 'aboutHZL':
|
|
|
this.aboutHZLData = response.data.list[0]
|
|
|
+ console.log(this.aboutHZLData)
|
|
|
break
|
|
|
case 'bottomMod':
|
|
|
this.bottomModData = response.data.list[0]
|
|
@@ -419,6 +453,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
data.loading = false
|
|
|
+ this.$forceUpdate()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -454,9 +489,14 @@ export default {
|
|
|
this.handleQuery()
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
- handleAdd(type, parentId) {
|
|
|
+ handleAdd(type, parentId, index) {
|
|
|
this.reset()
|
|
|
this.editType = type
|
|
|
+ this.preIndex = index
|
|
|
+ if (type === 0) {
|
|
|
+ this.form.parentId = (this.loginMenuData[this.loginMenuData.length - 1].parentId + 1)
|
|
|
+ this.title = '新增项目'
|
|
|
+ }
|
|
|
if (type === 1) {
|
|
|
this.form.type = 1
|
|
|
this.form.parentId = parentId
|
|
@@ -469,10 +509,11 @@ export default {
|
|
|
this.open = true
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
- handleUpdate(row, type) {
|
|
|
+ handleUpdate(row, type, index) {
|
|
|
this.reset()
|
|
|
const id = row.id
|
|
|
this.editType = type
|
|
|
+ this.preIndex = index
|
|
|
if (type === 1) {
|
|
|
this.title = '修改方案'
|
|
|
} else if (type === 2) {
|
|
@@ -484,6 +525,18 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
+ submitProjectForm() {
|
|
|
+ let pro = {
|
|
|
+ name: this.form.name,
|
|
|
+ parentId: this.form.parentId,
|
|
|
+ data: [],
|
|
|
+ loading: false
|
|
|
+ }
|
|
|
+ this.loginMenuData.unshift(pro)
|
|
|
+ this.configMenuData.value = JSON.stringify(this.loginMenuData)
|
|
|
+ updateConfig(this.configMenuData)
|
|
|
+ this.$modal.msgSuccess('新增成功')
|
|
|
+ },
|
|
|
submitForm() {
|
|
|
this.$refs['form'].validate(valid => {
|
|
|
if (!valid) {
|
|
@@ -512,15 +565,15 @@ export default {
|
|
|
createLoginPagePopularizeModuleConfig(this.form).then(response => {
|
|
|
this.$modal.msgSuccess('新增成功')
|
|
|
this.open = false
|
|
|
- if (this.from.type === 1) {
|
|
|
+ if (this.form.type === 1) {
|
|
|
for (let i = 0; i < this.loginMenuData.length; i++) {
|
|
|
- if (this.from.parentId === this.loginMenuData[i].parentId) {
|
|
|
- this.getList(this.from.parentId, 1, this.loginMenuData[i])
|
|
|
+ if (this.form.parentId === this.loginMenuData[i].parentId) {
|
|
|
+ this.getList(this.form.parentId, 1, this.loginMenuData[i])
|
|
|
break
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (this.from.type === 2) {
|
|
|
+ if (this.form.type === 2) {
|
|
|
this.getList('', 2, this.modObj)
|
|
|
}
|
|
|
})
|
|
@@ -529,7 +582,7 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const id = row.id
|
|
|
- this.$modal.confirm('是否确认删除登录页面推广模块配置编号为"' + id + '"的数据项?').then(function() {
|
|
|
+ this.$modal.confirm('是否确认删除编号为"' + id + '"的数据项?').then(function() {
|
|
|
return deleteLoginPagePopularizeModuleConfig(id)
|
|
|
}).then(() => {
|
|
|
this.getList()
|
|
@@ -543,11 +596,11 @@ export default {
|
|
|
let params = { ...this.queryParams }
|
|
|
params.pageNo = undefined
|
|
|
params.pageSize = undefined
|
|
|
- this.$modal.confirm('是否确认导出所有登录页面推广模块配置数据项?').then(() => {
|
|
|
+ this.$modal.confirm('是否确认登录页面配置数据项?').then(() => {
|
|
|
this.exportLoading = true
|
|
|
return exportLoginPagePopularizeModuleConfigExcel(params)
|
|
|
}).then(response => {
|
|
|
- this.$download.excel(response, '登录页面推广模块配置.xls')
|
|
|
+ this.$download.excel(response, '登录页面配置.xls')
|
|
|
this.exportLoading = false
|
|
|
}).catch(() => {
|
|
|
})
|