|
@@ -5,57 +5,65 @@
|
|
|
顶部菜单栏配置
|
|
|
</div>
|
|
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(0)">添 加 项 目</el-button>
|
|
|
- <div v-for="menu in loginMenuData" style="margin: 10px">
|
|
|
+ <div v-for="(menu,index) in loginMenuData" style="margin: 10px" :key="index">
|
|
|
<div style="font-size: 22px;margin-bottom: 10px">
|
|
|
{{ menu.name }}
|
|
|
</div>
|
|
|
- <!-- 操作工具栏 -->
|
|
|
- <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)">新增</el-button>
|
|
|
- </el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
- </el-row>
|
|
|
- <!-- 列表 -->
|
|
|
- <el-table v-loading="loading" :data="menu.data">
|
|
|
- <el-table-column label="序号" align="center" prop="id"/>
|
|
|
- <el-table-column label="名称" align="center" prop="name"/>
|
|
|
- <!-- <el-table-column label="链接" align="center" prop="link"/>-->
|
|
|
- <el-table-column label="排序" align="center" prop="sort"/>
|
|
|
- <el-table-column label="状态" align="center" prop="status">
|
|
|
- <template v-slot="scope">
|
|
|
- <!-- <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/>-->
|
|
|
- <el-switch
|
|
|
- v-model="scope.row.status===1"
|
|
|
- >
|
|
|
- </el-switch>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="父级ID" align="center" prop="parentId"/>-->
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime">
|
|
|
- <template v-slot="scope">
|
|
|
- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column label="类型" align="center" prop="type"/>-->
|
|
|
- <!-- <el-table-column label="图片" align="center" prop="imgUrls"/>-->
|
|
|
- <!-- <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)"
|
|
|
- v-hasPermi="['supplier:login-page-popularize-module-config:update']"
|
|
|
- >编辑
|
|
|
- </el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-view"
|
|
|
- >预览
|
|
|
- </el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['supplier:login-page-popularize-module-config:delete']"
|
|
|
- >删除
|
|
|
+ <div v-if="menu.parentId === 'aboutHZL'">
|
|
|
+ <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>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ </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" prop="name"/>
|
|
|
+ <!-- <el-table-column label="链接" align="center" prop="link"/>-->
|
|
|
+ <el-table-column label="排序" align="center" prop="sort"/>
|
|
|
+ <el-table-column label="状态" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ v-model="scope.row.status"
|
|
|
+ @change="updateStatus(scope.row)"
|
|
|
+ >
|
|
|
+ </el-switch>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="父级ID" align="center" prop="parentId"/>-->
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="类型" align="center" prop="type"/>-->
|
|
|
+ <!-- <el-table-column label="图片" align="center" prop="imgUrls"/>-->
|
|
|
+ <!-- <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)"
|
|
|
+ v-hasPermi="['supplier:login-page-popularize-module-config:update']"
|
|
|
+ >编辑
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="preView(scope.row.type,scope.row,index)"
|
|
|
+ >预览
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['supplier:login-page-popularize-module-config:delete']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<!-- 分页组件 -->
|
|
@@ -65,24 +73,26 @@
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
- <div style="font-size: 30px;margin-bottom: 10px;background: #1c84c6;padding: 10px;color: #ffffff">
|
|
|
- 中部模块配置
|
|
|
- </div>
|
|
|
+
|
|
|
<!-- 操作工具栏 -->
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(3)">新增模块</el-button>
|
|
|
+ <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd(2)">新增模块</el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
<!-- 列表 -->
|
|
|
- <el-table v-loading="loading" :data="moduleList">
|
|
|
+ <el-table v-loading="modObj.loading" :data="modObj.data">
|
|
|
<el-table-column label="序号" align="center" prop="id"/>
|
|
|
<el-table-column label="模块名称" align="center" prop="name"/>
|
|
|
<el-table-column label="排序" align="center" prop="sort"/>
|
|
|
<el-table-column label="状态" align="center" prop="status">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-switch v-model="scope.row.status===1">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-switch :active-value="1"
|
|
|
+ :inactive-value="0"
|
|
|
+ v-model="scope.row.status"
|
|
|
+ @change="updateStatus(scope.row)"
|
|
|
+ >
|
|
|
</el-switch>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -97,7 +107,7 @@
|
|
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row,scope.row.type)"
|
|
|
>编辑
|
|
|
</el-button>
|
|
|
- <el-button size="mini" type="text" icon="el-icon-edit"
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="preView(2,scope.row,0)"
|
|
|
>预览
|
|
|
</el-button>
|
|
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
@@ -106,55 +116,95 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- <div style="padding: 0 15%" ref="sortableContainer">
|
|
|
- <div shadow="hover" v-for="item in vModules" :key="item"
|
|
|
+ <div style="padding: 0 12%" ref="sortableContainer">
|
|
|
+ <!-- <div shadow="hover" v-for="(item,index) in [1,2,3,4,5,6]" :key="index"-->
|
|
|
+ <div shadow="hover" v-for="(item,index1) in loginModuleDataDisplayCopy" :key="index1"
|
|
|
class="module-item"
|
|
|
:style="{height: vModuleHeight +'px'}"
|
|
|
>
|
|
|
- {{ item }}
|
|
|
- <div style="position: relative;text-align: center;z-index: 99999"
|
|
|
- :style="{top: vModuleHeight - 80 +'px'}"
|
|
|
+ <div style="height: 12%;padding: 10px 10px 5px"
|
|
|
+ :style="{fontSize: vModuleFontSize1 +'px'}"
|
|
|
>
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ <div style="height: 78%;padding:10px 10px 10px">
|
|
|
+ <div style="height: 85%">
|
|
|
+ <img :src="item.imgUrls" width="100%" height="100%">
|
|
|
+ </div>
|
|
|
+ <div style="height: 15%;text-align: center;margin: 10px 0"
|
|
|
+ :style="{fontSize: vModuleFontSize2 +'px'}"
|
|
|
+ >
|
|
|
+ {{ item.digest }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;height: 11%;">
|
|
|
<el-popover placement="top" width="400" trigger="click">
|
|
|
- <el-button v-for="item in moduleList">{{ item.name }}</el-button>
|
|
|
- <el-button slot="reference" type="primary">选择模板</el-button>
|
|
|
+ <span v-for="(modItem,index2) in modObj.data" style="margin: 5px">
|
|
|
+ <el-button @click="selectMod(modItem,index1)" :key="index2"> {{ modItem.name }}</el-button>
|
|
|
+ </span>
|
|
|
+ <el-button size="mini" slot="reference" type="primary">选择模板</el-button>
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div>
|
|
|
+ <div style="font-size: 30px;margin-bottom: 10px;background: #1c84c6;padding: 10px;color: #ffffff">
|
|
|
+ 底部服务配置
|
|
|
+ </div>
|
|
|
+ <editor v-model="bottomModData.pageContent" :min-height="480"></editor>
|
|
|
+ </div>
|
|
|
<!-- 对话框(添加 / 修改) -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
|
|
|
+ <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 label="模块名称" prop="name">
|
|
|
+ <el-form-item v-if="editType === 1" label="方案名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入方案名称"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="editType === 2" label="模块名称" prop="name">
|
|
|
<el-input v-model="form.name" placeholder="请输入模块名称"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="链接" prop="link">
|
|
|
- <el-input v-model="form.link" type="textarea" placeholder="请输入内容"/>
|
|
|
+
|
|
|
+ <el-form-item v-if="editType === 1" label="方案内容" prop="pageContent">
|
|
|
+ <editor v-model="form.pageContent" :min-height="380"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="editType === 2" label="模块简介" prop="digest">
|
|
|
+ <el-input type="textarea" :autosize="{ minRows: 4 }" v-model="form.digest" :maxlength="50"/>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item v-if="editType === 2" label="主图" prop="imgUrls">
|
|
|
+ <imageUpload v-model="form.imgUrls"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-if="editType === 2" label="模块详情" prop="pageContent">
|
|
|
+ <editor v-model="form.pageContent" :min-height="380"/>
|
|
|
</el-form-item>
|
|
|
+ <!--<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>
|
|
|
+
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
- <el-radio-group v-model="form.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"
|
|
|
>{{ dict.label }}
|
|
|
</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="图片" prop="imgUrls">
|
|
|
- <el-input v-model="form.imgUrls" placeholder="请输入图片"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="模块摘要" prop="digest">
|
|
|
- <el-input v-model="form.digest" placeholder="请输入模块摘要"/>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
</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 @click="cancel">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog title="预览" :visible.sync="preOpen" width="1700px">
|
|
|
+ <PreLogin ref="preLogin"></PreLogin>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -167,12 +217,15 @@ import {
|
|
|
getLoginPagePopularizeModuleConfigPage,
|
|
|
exportLoginPagePopularizeModuleConfigExcel
|
|
|
} from '@/api/supplier/loginPagePopularizeModuleConfig'
|
|
|
-import { getConfigKey } from '@/api/infra/config'
|
|
|
+import { getConfigData, updateConfig } from '@/api/infra/config'
|
|
|
import Sortable from 'sortablejs'
|
|
|
+import Editor from '@/components/Editor'
|
|
|
+import ImageUpload from '@/components/ImageUpload'
|
|
|
+import PreLogin from './preview/login'
|
|
|
|
|
|
export default {
|
|
|
name: 'LoginPagePopularizeModuleConfig',
|
|
|
- components: {},
|
|
|
+ components: { Editor, ImageUpload, PreLogin },
|
|
|
data() {
|
|
|
return {
|
|
|
// 遮罩层
|
|
@@ -185,11 +238,15 @@ export default {
|
|
|
total: 0,
|
|
|
// 登录页面推广模块配置列表
|
|
|
list: [],
|
|
|
- moduleList: [],
|
|
|
+ modObj: {
|
|
|
+ data: [],
|
|
|
+ loading: false
|
|
|
+ },
|
|
|
// 弹出层标题
|
|
|
title: '',
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
+ preOpen: false,
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNo: 1,
|
|
@@ -208,13 +265,42 @@ export default {
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
rules: {},
|
|
|
+ aboutHZLData: {},
|
|
|
+ bottomModData: {},
|
|
|
loginMenuData: [],
|
|
|
+ configMenuData: {},
|
|
|
+ loginModuleDataDisplayCopy: [],
|
|
|
+ loginModuleData: [],
|
|
|
+ configModuleData: {},
|
|
|
sortableInstance: null,
|
|
|
- vModules: [1, 2, 3, 4, 5, 6],
|
|
|
- vModuleHeight: window.innerHeight * 0.35
|
|
|
+ vModuleHeight: window.innerHeight * 0.45,
|
|
|
+ vModuleFontSize1: window.innerHeight * 0.022,
|
|
|
+ vModuleFontSize2: window.innerHeight * 0.015,
|
|
|
+ editType: 1
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ 'aboutHZLData': {
|
|
|
+ handler: function(newValue) {
|
|
|
+ if (!newValue) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ updateLoginPagePopularizeModuleConfig(newValue)
|
|
|
+ // this.$modal.msgSuccess('更新成功')
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ 'bottomModData': {
|
|
|
+ handler: function(newValue) {
|
|
|
+ if (!newValue) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ updateLoginPagePopularizeModuleConfig(newValue)
|
|
|
+ // this.$modal.msgSuccess('更新成功')
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
}
|
|
|
},
|
|
|
- watch: {},
|
|
|
mounted() {
|
|
|
//监听窗口大小变化
|
|
|
window.addEventListener('resize', this.adVModuleHeightHeight)
|
|
@@ -238,39 +324,102 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- this.getList(5, 2, this.moduleList)
|
|
|
- getConfigKey('login_menu').then(res => {
|
|
|
- this.loginMenuData = JSON.parse(res.data)
|
|
|
- this.loginMenuData.forEach(item => {
|
|
|
- item.data = []
|
|
|
- this.getList(item.parentId, 1, item.data)
|
|
|
- })
|
|
|
+ //各个模块初始化数据
|
|
|
+ this.getList('', 2, this.modObj)
|
|
|
+ this.getList('aboutHZL', 1, 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)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getConfigData('login_module').then(res => {
|
|
|
+ if (res.data) {
|
|
|
+ this.configModuleData = res.data
|
|
|
+ this.loginModuleData = JSON.parse(res.data.value)
|
|
|
+ this.loginModuleDataDisplayCopy = JSON.parse(res.data.value)
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
+ preView(type, data, index) {
|
|
|
+ this.preOpen = true
|
|
|
+ if (type === 1) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.preLogin.menuPre(data, index)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (type === 2) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.preLogin.modulePre(data, index)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 更新配置模块的数据。
|
|
|
+ */
|
|
|
+ updateConfigModData() {
|
|
|
+ this.configModuleData.value = JSON.stringify(this.loginModuleData)
|
|
|
+ updateConfig(this.configModuleData)
|
|
|
+ this.$modal.msgSuccess('更新成功')
|
|
|
+ },
|
|
|
+ selectMod(item, index) {
|
|
|
+
|
|
|
+ this.loginModuleData.splice(index, 1)// 移除旧位置的项
|
|
|
+ this.loginModuleData.splice(index, 0, item) // 在新位置插入项
|
|
|
+
|
|
|
+ this.loginModuleDataDisplayCopy.splice(index, 1)// 移除旧位置的项
|
|
|
+ this.loginModuleDataDisplayCopy.splice(index, 0, item) // 在新位置插入项
|
|
|
+
|
|
|
+ this.updateConfigModData()
|
|
|
+ },
|
|
|
+ updateStatus(row) {
|
|
|
+ updateLoginPagePopularizeModuleConfig(row)
|
|
|
+ this.$modal.msgSuccess('更新成功')
|
|
|
+ },
|
|
|
adVModuleHeightHeight() {
|
|
|
- this.vModuleHeight = window.innerHeight * 0.35
|
|
|
+ this.vModuleHeight = window.innerHeight * 0.40
|
|
|
},
|
|
|
// 回调函数示例
|
|
|
handleSort(event) {
|
|
|
const oldIndex = event.oldIndex
|
|
|
const newIndex = event.newIndex
|
|
|
- const movedItem = this.vModules.splice(oldIndex, 1)[0] // 移除旧位置的项
|
|
|
- this.vModules.splice(newIndex, 0, movedItem) // 在新位置插入项
|
|
|
- this.$forceUpdate()
|
|
|
- console.log(this.vModules)
|
|
|
+ const movedItem = this.loginModuleData.splice(oldIndex, 1)[0] // 移除旧位置的项
|
|
|
+ this.loginModuleData.splice(newIndex, 0, movedItem) // 在新位置插入项
|
|
|
+ this.updateConfigModData()
|
|
|
},
|
|
|
/** 查询列表 */
|
|
|
getList(parentId, type, data) {
|
|
|
- this.queryParams.parentId = parentId
|
|
|
- this.queryParams.type = type
|
|
|
- this.loading = true
|
|
|
+ if (type) {
|
|
|
+ this.queryParams.type = type
|
|
|
+ if (type === 1) {
|
|
|
+ data.loading = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (parentId) {
|
|
|
+ this.queryParams.parentId = parentId
|
|
|
+ }
|
|
|
// 执行查询
|
|
|
getLoginPagePopularizeModuleConfigPage(this.queryParams).then(response => {
|
|
|
- response.data.list.forEach(item => {
|
|
|
- data.push(item)
|
|
|
- })
|
|
|
- this.loading = false
|
|
|
+ if (response.data) {
|
|
|
+ switch (parentId) {
|
|
|
+ case 'aboutHZL':
|
|
|
+ this.aboutHZLData = response.data.list[0]
|
|
|
+ break
|
|
|
+ case 'bottomMod':
|
|
|
+ this.bottomModData = response.data.list[0]
|
|
|
+ break
|
|
|
+ default:
|
|
|
+ response.data.list.forEach(item => {
|
|
|
+ data.data.push(item)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ data.loading = false
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
/** 取消按钮 */
|
|
@@ -287,9 +436,10 @@ export default {
|
|
|
sort: undefined,
|
|
|
parentId: undefined,
|
|
|
type: undefined,
|
|
|
- status: undefined,
|
|
|
+ status: 0,
|
|
|
imgUrls: undefined,
|
|
|
- digest: undefined
|
|
|
+ digest: undefined,
|
|
|
+ pageContent: undefined
|
|
|
}
|
|
|
this.resetForm('form')
|
|
|
},
|
|
@@ -304,19 +454,33 @@ export default {
|
|
|
this.handleQuery()
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
- handleAdd(type) {
|
|
|
+ handleAdd(type, parentId) {
|
|
|
this.reset()
|
|
|
+ this.editType = type
|
|
|
+ if (type === 1) {
|
|
|
+ this.form.type = 1
|
|
|
+ this.form.parentId = parentId
|
|
|
+ this.title = '新增方案'
|
|
|
+ }
|
|
|
+ if (type === 2) {
|
|
|
+ this.form.type = 2
|
|
|
+ this.title = '新增模块'
|
|
|
+ }
|
|
|
this.open = true
|
|
|
- this.title = '添加登录页面推广模块配置'
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row, type) {
|
|
|
this.reset()
|
|
|
const id = row.id
|
|
|
+ this.editType = type
|
|
|
+ if (type === 1) {
|
|
|
+ this.title = '修改方案'
|
|
|
+ } else if (type === 2) {
|
|
|
+ this.title = '修改模块'
|
|
|
+ }
|
|
|
getLoginPagePopularizeModuleConfig(id).then(response => {
|
|
|
this.form = response.data
|
|
|
this.open = true
|
|
|
- this.title = '修改登录页面推广模块配置'
|
|
|
})
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
@@ -330,7 +494,17 @@ export default {
|
|
|
updateLoginPagePopularizeModuleConfig(this.form).then(response => {
|
|
|
this.$modal.msgSuccess('修改成功')
|
|
|
this.open = false
|
|
|
- this.getList()
|
|
|
+ if (this.from.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])
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.from.type === 2) {
|
|
|
+ this.getList('', 2, this.modObj)
|
|
|
+ }
|
|
|
})
|
|
|
return
|
|
|
}
|
|
@@ -338,7 +512,17 @@ export default {
|
|
|
createLoginPagePopularizeModuleConfig(this.form).then(response => {
|
|
|
this.$modal.msgSuccess('新增成功')
|
|
|
this.open = false
|
|
|
- this.getList()
|
|
|
+ if (this.from.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])
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (this.from.type === 2) {
|
|
|
+ this.getList('', 2, this.modObj)
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
},
|
|
@@ -388,13 +572,16 @@ export default {
|
|
|
.module-item {
|
|
|
display: inline-block;
|
|
|
width: 30%;
|
|
|
- border: 1px solid #e3e3e3;
|
|
|
border-radius: 10px;
|
|
|
- margin: 10px 1.5%
|
|
|
+ margin: 1.2%;
|
|
|
+ box-shadow: 0 0 15px #c0cfe2;
|
|
|
+ /*transition: transform 0.1s ease;*/
|
|
|
}
|
|
|
|
|
|
.module-item:hover {
|
|
|
- box-shadow: 0 0 5px #b6aeae;
|
|
|
+ box-shadow: 0 0 15px #c0cfe2;
|
|
|
+ transition: transform 0.4s ease;
|
|
|
+ transform: scale(1.035);
|
|
|
}
|
|
|
|
|
|
</style>
|