门户网站配置和门户网站配置类型完善
master
xs 3 weeks ago
parent 0b0a8f5f90
commit e82d993dd7

@ -1,8 +1,11 @@
package com.ruoyi.portal.service.impl; package com.ruoyi.portal.service.impl;
import com.ruoyi.common.core.constant.UserConstants;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.DateUtils; import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.SpringUtils;
import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.portal.domain.HwPortalConfigType; import com.ruoyi.portal.domain.HwPortalConfigType;
import com.ruoyi.portal.domain.vo.TreeSelect; import com.ruoyi.portal.domain.vo.TreeSelect;
import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper; import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper;
@ -61,7 +64,17 @@ public class HwPortalConfigTypeServiceImpl implements IHwPortalConfigTypeService
@Override @Override
public int insertHwPortalConfigType(HwPortalConfigType hwPortalConfigType) public int insertHwPortalConfigType(HwPortalConfigType hwPortalConfigType)
{ {
if (hwPortalConfigType.getParentId() == null) {
hwPortalConfigType.setParentId(0L);
hwPortalConfigType.setAncestors("0");
} else {
HwPortalConfigType info = hwPortalConfigTypeMapper.selectHwPortalConfigTypeByConfigTypeId(hwPortalConfigType.getParentId());
hwPortalConfigType.setAncestors(info.getAncestors() + "," + hwPortalConfigType.getParentId());
}
hwPortalConfigType.setCreateTime(DateUtils.getNowDate()); hwPortalConfigType.setCreateTime(DateUtils.getNowDate());
hwPortalConfigType.setCreateBy(SecurityUtils.getUsername());
return hwPortalConfigTypeMapper.insertHwPortalConfigType(hwPortalConfigType); return hwPortalConfigTypeMapper.insertHwPortalConfigType(hwPortalConfigType);
} }

@ -84,9 +84,14 @@
<el-table-column label="标题" align="center" prop="portalConfigTitle" /> <el-table-column label="标题" align="center" prop="portalConfigTitle" />
<el-table-column label="顺序" align="center" prop="portalConfigOrder" /> <el-table-column label="顺序" align="center" prop="portalConfigOrder" />
<el-table-column label="内容" align="center" prop="portalConfigDesc" /> <el-table-column label="内容" align="center" prop="portalConfigDesc" />
<el-table-column label="按钮名称" align="center" prop="buttonName" /> <!-- <el-table-column label="按钮名称" align="center" prop="buttonName" />-->
<el-table-column label="按钮跳转地址" align="center" prop="routerAddress" /> <!-- <el-table-column label="按钮跳转地址" align="center" prop="routerAddress" />-->
<el-table-column label="主图地址" align="center" prop="portalConfigPic" /> <el-table-column label="主图" align="center" prop="portalConfigPic" >
<template slot-scope="scope" v-if="scope.row.portalConfigPic && scope.row.portalConfigPic!=null && scope.row.portalConfigPic!=undefined && scope.row.portalConfigPic!==''">
<img :src="scope.row.portalConfigPic" alt="主图" style="width: 200px;height:150px;">
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -117,7 +122,7 @@
<!-- 添加或修改门户网站配置对话框 --> <!-- 添加或修改门户网站配置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="143px">
<el-form-item label="标题" prop="portalConfigTitle"> <el-form-item label="标题" prop="portalConfigTitle">
<el-input v-model="form.portalConfigTitle" placeholder="请输入标题" /> <el-input v-model="form.portalConfigTitle" placeholder="请输入标题" />
</el-form-item> </el-form-item>
@ -126,35 +131,44 @@
<!-- <el-input v-model="form.portalConfigTypeId" placeholder="请输入配置类型ID" />--> <!-- <el-input v-model="form.portalConfigTypeId" placeholder="请输入配置类型ID" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="门户网站配置类型" prop="portalConfigTypeId"> <el-form-item label="类型" prop="portalConfigType">
<el-select v-model="form.portalConfigType" placeholder="请选择类型">
<el-option
v-for="dict in dict.type.hw_portal_config_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item prop="portalConfigTypeId" v-if="parseInt(form.portalConfigType)===parseInt(PORTAL_CONFIG_TYPE.PRODUCT_CENTER)">
<span slot="label">
<el-tooltip content="根据分类配置产品中心的大图" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
门户网站配置类型
</span>
<treeselect v-model="form.portalConfigTypeId" :options="editedPortalConfigTypes" :show-count="true" <treeselect v-model="form.portalConfigTypeId" :options="editedPortalConfigTypes" :show-count="true"
placeholder="请选择门户网站配置类型"/> placeholder="请选择门户网站配置类型"/>
</el-form-item> </el-form-item>
<el-form-item label="类型" prop="portalConfigType">
<el-select v-model="form.portalConfigType" placeholder="请选择类型">
<el-option
v-for="dict in dict.type.hw_portal_config_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="顺序" prop="portalConfigOrder"> <el-form-item label="顺序" prop="portalConfigOrder">
<el-input v-model="form.portalConfigOrder" placeholder="请输入顺序" /> <el-input v-model="form.portalConfigOrder" placeholder="请输入顺序" />
</el-form-item> </el-form-item>
<el-form-item label="内容" prop="portalConfigDesc"> <el-form-item label="内容" prop="portalConfigDesc">
<el-input v-model="form.portalConfigDesc" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.portalConfigDesc" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
<el-form-item label="按钮名称" prop="buttonName"> <!-- <el-form-item label="按钮名称" prop="buttonName">-->
<el-input v-model="form.buttonName" placeholder="请输入按钮名称" /> <!-- <el-input v-model="form.buttonName" placeholder="请输入按钮名称" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="按钮跳转地址" prop="routerAddress"> <!-- <el-form-item label="按钮跳转地址" prop="routerAddress">-->
<el-input v-model="form.routerAddress" placeholder="请输入按钮跳转地址" /> <!-- <el-input v-model="form.routerAddress" placeholder="请输入按钮跳转地址" />-->
</el-form-item> <!-- </el-form-item>-->
<el-form-item label="主图地址" prop="portalConfigPic"> <el-form-item label="主图地址" prop="portalConfigPic">
<el-upload <el-upload
@ -301,6 +315,11 @@ export default {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
fileList: [], fileList: [],
PORTAL_CONFIG_TYPE:{
HOME:"1", //
PRODUCT_CENTER:"2",//
}
}; };
}, },
created() { created() {

@ -1,13 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div>
<p>配置产品中心和案例的分类其中顶级类型需配置首页显示的名称类型备注和显示的图片子级分类用来配置产品中心和案例与客户中的分类信息</p>
</div>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="大类(1产品中心2案例)" prop="configTypeClassfication"> <el-form-item label="大类" prop="configTypeClassfication">
<el-input <el-select v-model="queryParams.configTypeClassfication" placeholder="请选择大类" clearable>
v-model="queryParams.configTypeClassfication" <el-option
placeholder="请输入大类(1产品中心2案例)" v-for="dict in dict.type.hw_portal_config_type_classfication"
clearable :key="dict.value"
@keyup.enter.native="handleQuery" :label="dict.label"
/> :value="dict.value"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="类型名称" prop="configTypeName"> <el-form-item label="类型名称" prop="configTypeName">
<el-input <el-input
@ -54,12 +59,22 @@
:default-expand-all="isExpandAll" :default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
> >
<el-table-column label="首页名称" align="center" prop="homeConfigTypeName" /> <el-table-column label="类型名称" align="left" prop="configTypeName" />
<el-table-column label="类型名称" align="center" prop="configTypeName" /> <el-table-column label="首页显示名称" align="center" prop="homeConfigTypeName" />
<el-table-column label="大类(1产品中心2案例)" prop="configTypeClassfication" />
<el-table-column label="大类" prop="configTypeClassfication" >
<template slot-scope="scope">
<dict-tag :options="dict.type.hw_portal_config_type_classfication" :value="scope.row.configTypeClassfication"/>
</template>
</el-table-column>
<el-table-column label="类型备注" align="center" prop="configTypeDesc" /> <el-table-column label="类型备注" align="center" prop="configTypeDesc" />
<el-table-column label="图片地址" align="center" prop="homeConfigTypePic" /> <el-table-column label="图片" align="center" prop="homeConfigTypePic" >
<el-table-column label="父级ID" align="center" prop="parentId" /> <template slot-scope="scope" v-if="scope.row.homeConfigTypePic && scope.row.homeConfigTypePic!=null && scope.row.homeConfigTypePic!=undefined && scope.row.homeConfigTypePic!==''">
<img :src="scope.row.homeConfigTypePic" alt="图片" style="width: 200px;height:150px;">
</template>
</el-table-column>
<el-table-column label="祖级列表" align="center" prop="ancestors" /> <el-table-column label="祖级列表" align="center" prop="ancestors" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -89,15 +104,22 @@
</el-table> </el-table>
<!-- 添加或修改门户网站配置类型对话框 --> <!-- 添加或修改门户网站配置类型对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="父级" prop="parentId"> <el-form-item label="父级" prop="parentId">
<treeselect v-model="form.parentId" :options="portalConfigTypeOptions" :normalizer="normalizer" placeholder="请选择父级ID" /> <treeselect v-model="form.parentId" :options="portalConfigTypeOptions" :normalizer="normalizer" placeholder="请选择父级ID" />
</el-form-item> </el-form-item>
<el-form-item label="大类(1产品中心2案例)" prop="configTypeClassfication"> <el-form-item label="大类" prop="configTypeClassfication" v-if="form.parentId==null || form.parentId===0">
<el-input v-model="form.configTypeClassfication" placeholder="请输入大类(1产品中心2案例)" /> <el-select v-model="form.configTypeClassfication" placeholder="请选择大类" clearable>
<el-option
v-for="dict in dict.type.hw_portal_config_type_classfication"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="首页显示名称" prop="homeConfigTypeName"> <el-form-item label="首页显示名称" prop="homeConfigTypeName" v-if="form.parentId==null || form.parentId===0">
<el-input v-model="form.homeConfigTypeName" placeholder="请输入类型名称" /> <el-input v-model="form.homeConfigTypeName" placeholder="请输入类型名称" />
</el-form-item> </el-form-item>
<el-form-item label="类型名称" prop="configTypeName"> <el-form-item label="类型名称" prop="configTypeName">
@ -108,7 +130,14 @@
</el-form-item> </el-form-item>
<el-form-item label="图标" prop="configTypeIcon"> <el-form-item prop="configTypeIcon">
<span slot="label">
<el-tooltip content="上方菜单显示的图标" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
图标
</span>
<el-upload <el-upload
single single
:action="iconUploadImgUrl" :action="iconUploadImgUrl"
@ -153,7 +182,14 @@
<el-form-item label="图片" prop="homeConfigTypePic"> <el-form-item prop="homeConfigTypePic">
<span slot="label">
<el-tooltip content="首页显示的图片" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
图片
</span>
<el-upload <el-upload
single single
:action="uploadImgUrl" :action="uploadImgUrl"
@ -213,6 +249,7 @@ import {getToken} from "@/utils/auth";
export default { export default {
name: "PortalConfigType", name: "PortalConfigType",
dicts: ['hw_portal_config_type_classfication'],
props: { props: {
value: [String, Object, Array], value: [String, Object, Array],
// //

Loading…
Cancel
Save