如何使用ssm实现基于VUE的新闻类网站+vue修改完的

server/2024/10/18 18:29:30/

@TOC

ssm272基于vue的新闻类网站vue修改完的">ssm272基于VUE的新闻类网站+vue修改完的

系统概述

进过系统的分析后,就开始记性系统的设计,系统设计包含总体设计和详细设计。总体设计只是一个大体的设计,经过了总体设计,我们能够划分出系统的一些东西,例如文件、文档、数据等。而且我们通过总体设计,大致可以划分出了程序的模块,以及功能。但是只是一个初步的分类,并没有真正的实现。

整体设计,只是一个初步设计,而且,对于一个项目,我们可以进行多个整体设计,通过对比,包括性能的对比、成本的对比、效益的对比,来最终确定一个最优的设计方案,选择优秀的整体设计可以降低开发成本,增加公司效益,从这一点来讲,整体设计还是非常重要的。

新闻类网站工作原理图如图4-1所示:

图4-1 系统工作原理图

4.2 系统结构设计

系统架构图属于系统设计阶段,系统架构图只是这个阶段一个产物,系统的总体架构决定了整个系统的模式,是系统的基础。新闻类网站的整体结构设计如图4-2所示。

图4-2 系统结构图

4.3数据库设计

数据库是计算机信息系统的基础。目前,电脑系统的关键与核心部分就是数据库。数据库开发的优劣对整个系统的质量和速度有着直接影响。

4.3.1 数据库设计原则

数据库的概念结构设计采用实体—联系(E-R)模型设计方法。E-R模型法的组成元素有:实体、属性、联系,E-R模型用E-R图表示,是提示用户工作环境中所涉及的事物,属性则是对实体特性的描述。在系统设计当中数据库起着决定性的因素。下面设计出这几个关键实体的实体—关系图。

4.3.2 数据库实体

数据模型中的实体(Entity),也称为实例,对应现实世界中可区别于其他对象的“事件”或“事物”。例如,公司中的每个员工,家里中的每个家具。

本系统的E-R图如下图所示:

1、新闻信息实体图如图4-3所示:

图4-3新闻信息实体图

2、用户信息实体图如图4-4所示:

图4-4用户信息实体图

3、用户分享信息实体图如图4-5所示:

图4-5用户分享信息实体图

4.3.3 数据库表设计

数据库的表信息属于设计的一部分,下面介绍数据库中的各个表的详细信息。

表4-1 allusers表

列名数据类型长度约束
idint11NOT NULL
usernamevarchar50default NULL
pwdvarchar50default NULL
cxvarchar50default NULL

表4-2 xinwenxinxi表

列名数据类型长度约束
idint11NOT NULL
addtimevarchar50default NULL
xinwenbiaotivarchar50default NULL
xinwenleibievarchar50default NULL
xinwendiquvarchar50default NULL
xinwentupianvarchar50default NULL
xinwenshipinvarchar50default NULL
xinwenxiangqingvarchar50default NULL
faburiqivarchar50default NULL

表4-3:yonghu表

列名数据类型长度约束
idint11NOT NULL
addtimevarchar50default NULL
yonghumingvarchar50default NULL
mimavarchar50default NULL
xingmingvarchar50default NULL
xingbievarchar50default NULL
touxiangvarchar50default NULL
shoujivarchar50default NULL
youxiangvarchar50default NULL
sfshvarchar50default NULL
shhfvarchar50default NULL

表4-4:yonghufenxiang表

列名数据类型长度约束
idint11NOT NULL
addtimevarchar50default NULL
fenxiangbiaotivarchar50default NULL
fenxiangleixingvarchar50default NULL
fenxiangtupianvarchar50default NULL
fenxiangshipinvarchar50default NULL
fenxiangriqivarchar50default NULL
fenxiangneirongvarchar50default NULL
yonghumingvarchar50default NULL
youxiangvarchar50default NULL
sfshvarchar50default NULL
shhfvarchar50default NULL

表4-5:xinwenleibie表

列名数据类型长度约束
idint11NOT NULL
addtimevarchar50default NULL
xinwenleibievarchar50default NULL

#########

5系统界面实现

5.1 管理员登录

管理员输入个人的用户名、密码和角色登录系统,这时候系统的数据库就会在进行查找相关的信息,如果我们输入的用户名、密码和角色不正确,数据库就会提示出错误的信息提示,同时会提示管理员重新输入自己的用户名、密码、角色,直到用户名、密码输入成功后,会提登录成功的信息。网站管理员登录效果图如图5-1所示:


图5-1管理员登录界面

5.2 管理员功能模块

5.2.1 用户管理

管理员对用户管理进行查看用户名、姓名、性别、头像、手机、邮箱、审核回复、审核状态、审核并进行详情、删除、修改等操作。程序成效图如下图5-2所示:

图5-2用户管理界面图

5.2.2新闻类别管理

管理员对新闻类别管理进行查看新闻类别等信息并可以进行删除、修改操作。程序效果图如下图5-3所示:

图5-3新闻类别管理界面

5.2.3 新闻信息管理

管理员对新闻信息管理进行查看新闻标题、新闻类别、新闻地区、新闻图片、新闻视频、发布日期等信息并可以进行详情、删除、修改操作。程序效果图如下图5-4所示:

图5-4新闻信息管理界面

5.2.4 轮播图管理

轮播图;该页面为轮播图管理界面。管理员可以在此页面进行首页轮播图的管理,通过新建操作可在轮播图中加入新的图片,还可以对以上传的图片进行修改操作,以及图片的删除操作。程序效果图如下图5-5所示:

图5-5轮播图管理界面

5.2.5用户分享管理

管理员对用户分享管理进行查看分享标题、分享类型、分享图片、分享视频、分享日期、用户名、邮箱、审核回复、审核状态、审核等进行详情、删除、修改操作。程序效果图如下图5-6所示:

图5-6用户分享管理界面

5.2.6公告信息

管理员对公告信息进行查看标题、图片等信息并可以进行详情、删除、修改操作。程序效果图如下图5-7所示:

图5-7公告信息界面

5.3 前台首页功能模块

前台首页详情页面查看首页、新闻信息、用户分享、公告信息、个人中心、后台管理等功能操作。程序效果图如下图5-8所示:

图5-8前台首页功能界面

5.3.1用户注册、用户登录

用户在线填写用户名、密码、姓名、手机、邮箱等信息进行注册、登录操作。程序效果图如下图5-9所示:

图5-9用户注册、用户登录界面

5.3.2新闻信息

用户进入新闻信息可以查看新闻标题、新闻类别、新闻地区、新闻图片、新闻视频、发布日期、点击次数等信息,并可以进行点我收藏操作。程序效果图如下图5-10所示:

图5-10新闻信息界面

5.3.3个人中心

用户进入个人中心可以填写用户名、密码、姓名、性别、头像、手机、邮箱等信息进行更新信息、退出登录操作。程序效果图如下图5-11所示:

图5-11个人中心界面

5.4 用户功能模块

5.4.1个人信息

用户进入个人信息可以填写用户名、姓名、性别、头像、手机、邮箱等信息进行修改。程序效果图如下图5-12所示:

图5-12个人信息界面

5.4.2用户分享管理

用户进入用户分享管理可以查看分享标题、分享类型、分享图片、分享视频、分享日期、用户名、邮箱、审核回复、审核状态并可以进行详情、修改、删除等操作。程序效果图如下图5-13所示:

图5-13用户分享管理界面

java">NewsController.java
package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.NewsEntity;
import com.entity.view.NewsView;import com.service.NewsService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 公告信息* 后端接口* @author * @email * @date 2021-04-21 18:11:26*/
@RestController
@RequestMapping("/news")
public class NewsController {@Autowiredprivate NewsService newsService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 前端列表*/@IgnoreAuth@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,NewsEntity news, HttpServletRequest request){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( NewsEntity news){EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); return R.ok().put("data", newsService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(NewsEntity news){EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();ew.allEq(MPUtil.allEQMapPre( news, "news")); NewsView newsView =  newsService.selectView(ew);return R.ok("查询公告信息成功").put("data", newsView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 前端详情*/@IgnoreAuth@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){NewsEntity news = newsService.selectById(id);return R.ok().put("data", news);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody NewsEntity news, HttpServletRequest request){news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(news);newsService.insert(news);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody NewsEntity news, HttpServletRequest request){//ValidatorUtils.validateEntity(news);newsService.updateById(news);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){newsService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}int count = newsService.selectCount(wrapper);return R.ok().put("count", count);}}
java">YonghufenxiangServiceImpl.java
package com.service.impl;import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.List;import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.utils.PageUtils;
import com.utils.Query;import com.dao.YonghufenxiangDao;
import com.entity.YonghufenxiangEntity;
import com.service.YonghufenxiangService;
import com.entity.vo.YonghufenxiangVO;
import com.entity.view.YonghufenxiangView;@Service("yonghufenxiangService")
public class YonghufenxiangServiceImpl extends ServiceImpl<YonghufenxiangDao, YonghufenxiangEntity> implements YonghufenxiangService {@Overridepublic PageUtils queryPage(Map<String, Object> params) {Page<YonghufenxiangEntity> page = this.selectPage(new Query<YonghufenxiangEntity>(params).getPage(),new EntityWrapper<YonghufenxiangEntity>());return new PageUtils(page);}@Overridepublic PageUtils queryPage(Map<String, Object> params, Wrapper<YonghufenxiangEntity> wrapper) {Page<YonghufenxiangView> page =new Query<YonghufenxiangView>(params).getPage();page.setRecords(baseMapper.selectListView(page,wrapper));PageUtils pageUtil = new PageUtils(page);return pageUtil;}@Overridepublic List<YonghufenxiangVO> selectListVO(Wrapper<YonghufenxiangEntity> wrapper) {return baseMapper.selectListVO(wrapper);}@Overridepublic YonghufenxiangVO selectVO(Wrapper<YonghufenxiangEntity> wrapper) {return baseMapper.selectVO(wrapper);}@Overridepublic List<YonghufenxiangView> selectListView(Wrapper<YonghufenxiangEntity> wrapper) {return baseMapper.selectListView(wrapper);}@Overridepublic YonghufenxiangView selectView(Wrapper<YonghufenxiangEntity> wrapper) {return baseMapper.selectView(wrapper);}}
java">StoreupController.java
package com.controller;import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;import com.entity.StoreupEntity;
import com.entity.view.StoreupView;import com.service.StoreupService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;/*** 收藏表* 后端接口* @author * @email * @date 2021-04-21 18:11:26*/
@RestController
@RequestMapping("/storeup")
public class StoreupController {@Autowiredprivate StoreupService storeupService;/*** 后端列表*/@RequestMapping("/page")public R page(@RequestParam Map<String, Object> params,StoreupEntity storeup, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {storeup.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));return R.ok().put("data", page);}/*** 前端列表*/@RequestMapping("/list")public R list(@RequestParam Map<String, Object> params,StoreupEntity storeup, HttpServletRequest request){if(!request.getSession().getAttribute("role").toString().equals("管理员")) {storeup.setUserid((Long)request.getSession().getAttribute("userId"));}EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();PageUtils page = storeupService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, storeup), params), params));return R.ok().put("data", page);}/*** 列表*/@RequestMapping("/lists")public R list( StoreupEntity storeup){EntityWrapper<StoreupEntity> ew = new EntityWrapper<StoreupEntity>();ew.allEq(MPUtil.allEQMapPre( storeup, "storeup")); return R.ok().put("data", storeupService.selectListView(ew));}/*** 查询*/@RequestMapping("/query")public R query(StoreupEntity storeup){EntityWrapper< StoreupEntity> ew = new EntityWrapper< StoreupEntity>();ew.allEq(MPUtil.allEQMapPre( storeup, "storeup")); StoreupView storeupView =  storeupService.selectView(ew);return R.ok("查询收藏表成功").put("data", storeupView);}/*** 后端详情*/@RequestMapping("/info/{id}")public R info(@PathVariable("id") Long id){StoreupEntity storeup = storeupService.selectById(id);return R.ok().put("data", storeup);}/*** 前端详情*/@RequestMapping("/detail/{id}")public R detail(@PathVariable("id") Long id){StoreupEntity storeup = storeupService.selectById(id);return R.ok().put("data", storeup);}/*** 后端保存*/@RequestMapping("/save")public R save(@RequestBody StoreupEntity storeup, HttpServletRequest request){storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(storeup);storeup.setUserid((Long)request.getSession().getAttribute("userId"));storeupService.insert(storeup);return R.ok();}/*** 前端保存*/@RequestMapping("/add")public R add(@RequestBody StoreupEntity storeup, HttpServletRequest request){storeup.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());//ValidatorUtils.validateEntity(storeup);storeup.setUserid((Long)request.getSession().getAttribute("userId"));storeupService.insert(storeup);return R.ok();}/*** 修改*/@RequestMapping("/update")public R update(@RequestBody StoreupEntity storeup, HttpServletRequest request){//ValidatorUtils.validateEntity(storeup);storeupService.updateById(storeup);//全部更新return R.ok();}/*** 删除*/@RequestMapping("/delete")public R delete(@RequestBody Long[] ids){storeupService.deleteBatchIds(Arrays.asList(ids));return R.ok();}/*** 提醒接口*/@RequestMapping("/remind/{columnName}/{type}")public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, @PathVariable("type") String type,@RequestParam Map<String, Object> map) {map.put("column", columnName);map.put("type", type);if(type.equals("2")) {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");Calendar c = Calendar.getInstance();Date remindStartDate = null;Date remindEndDate = null;if(map.get("remindstart")!=null) {Integer remindStart = Integer.parseInt(map.get("remindstart").toString());c.setTime(new Date()); c.add(Calendar.DAY_OF_MONTH,remindStart);remindStartDate = c.getTime();map.put("remindstart", sdf.format(remindStartDate));}if(map.get("remindend")!=null) {Integer remindEnd = Integer.parseInt(map.get("remindend").toString());c.setTime(new Date());c.add(Calendar.DAY_OF_MONTH,remindEnd);remindEndDate = c.getTime();map.put("remindend", sdf.format(remindEndDate));}}Wrapper<StoreupEntity> wrapper = new EntityWrapper<StoreupEntity>();if(map.get("remindstart")!=null) {wrapper.ge(columnName, map.get("remindstart"));}if(map.get("remindend")!=null) {wrapper.le(columnName, map.get("remindend"));}if(!request.getSession().getAttribute("role").toString().equals("管理员")) {wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));}int count = storeupService.selectCount(wrapper);return R.ok().put("count", count);}}
add-or-update.vue
<template><div class="addEdit-block"><el-formclass="detail-form-content"ref="ruleForm":model="ruleForm":rules="rules"label-width="80px":style="{backgroundColor:addEditForm.addEditBoxColor}"><el-row><el-col :span="12"><el-form-item class="input" v-if="type!='info'"  label="名称" prop="name"><el-input v-model="ruleForm.name" placeholder="名称" clearable  :readonly="ro.name"></el-input></el-form-item><div v-else><el-form-item class="input" label="名称" prop="name"><el-input v-model="ruleForm.name" placeholder="名称" readonly></el-input></el-form-item></div></el-col><el-col :span="24">  <el-form-item class="upload" v-if="type!='info' && !ro.value" label="值" prop="value"><file-uploadtip="点击上传值"action="file/upload":limit="3":multiple="true":fileUrls="ruleForm.value?ruleForm.value:''"@change="valueUploadChange"></file-upload></el-form-item><div v-else><el-form-item v-if="ruleForm.value" label="值" prop="value"><img style="margin-right:20px;" v-bind:key="index" v-for="(item,index) in ruleForm.value.split(',')" :src="item" width="100" height="100"></el-form-item></div></el-col></el-row><el-form-item class="btn"><el-button v-if="type!='info'" type="primary" class="btn-success" @click="onSubmit">提交</el-button><el-button v-if="type!='info'" class="btn-close" @click="back()">取消</el-button><el-button v-if="type=='info'" class="btn-close" @click="back()">返回</el-button></el-form-item></el-form></div>
</template>
<script>
// 数字,邮件,手机,url,身份证校验
import { isNumber,isIntNumer,isEmail,isPhone, isMobile,isURL,checkIdCard } from "@/utils/validate";
export default {data() {let self = thisvar validateIdCard = (rule, value, callback) => {if(!value){callback();} else if (!checkIdCard(value)) {callback(new Error("请输入正确的身份证号码"));} else {callback();}};var validateUrl = (rule, value, callback) => {if(!value){callback();} else if (!isURL(value)) {callback(new Error("请输入正确的URL地址"));} else {callback();}};var validateMobile = (rule, value, callback) => {if(!value){callback();} else if (!isMobile(value)) {callback(new Error("请输入正确的手机号码"));} else {callback();}};var validatePhone = (rule, value, callback) => {if(!value){callback();} else if (!isPhone(value)) {callback(new Error("请输入正确的电话号码"));} else {callback();}};var validateEmail = (rule, value, callback) => {if(!value){callback();} else if (!isEmail(value)) {callback(new Error("请输入正确的邮箱地址"));} else {callback();}};var validateNumber = (rule, value, callback) => {if(!value){callback();} else if (!isNumber(value)) {callback(new Error("请输入数字"));} else {callback();}};var validateIntNumber = (rule, value, callback) => {if(!value){callback();} else if (!isIntNumer(value)) {callback(new Error("请输入整数"));} else {callback();}};return {addEditForm: {"btnSaveFontColor":"rgba(37, 35, 35, 0.68)","selectFontSize":"14px","btnCancelBorderColor":"rgba(238, 237, 229, 0.33)","inputBorderRadius":"20px","inputFontSize":"14px","textareaBgColor":"#fff","btnSaveFontSize":"14px","textareaBorderRadius":"20px","uploadBgColor":"#fff","textareaBorderStyle":"solid","btnCancelWidth":"88px","textareaHeight":"120px","dateBgColor":"#fff","btnSaveBorderRadius":"20px","uploadLableFontSize":"14px","textareaBorderWidth":"1px","inputLableColor":"rgba(52, 51, 50, 0.88)","addEditBoxColor":"rgba(232, 212, 212, 0.24)","dateIconFontSize":"14px","btnSaveBgColor":"#409EFF","uploadIconFontColor":"#8c939d","textareaBorderColor":"#DCDFE6","btnCancelBgColor":"rgba(231, 242, 112, 0.92)","selectLableColor":"#606266","btnSaveBorderStyle":"solid","dateBorderWidth":"1px","dateLableFontSize":"14px","dateBorderRadius":"20px","btnCancelBorderStyle":"solid","selectLableFontSize":"14px","selectBorderStyle":"solid","selectIconFontColor":"#C0C4CC","btnCancelHeight":"44px","inputHeight":"40px","btnCancelFontColor":"#606266","dateBorderColor":"#DCDFE6","dateIconFontColor":"#C0C4CC","uploadBorderStyle":"solid","dateBorderStyle":"solid","dateLableColor":"#606266","dateFontSize":"14px","inputBorderWidth":"1px","uploadIconFontSize":"28px","selectHeight":"40px","inputFontColor":"#606266","uploadHeight":"148px","textareaLableColor":"#606266","textareaLableFontSize":"14px","btnCancelFontSize":"14px","inputBorderStyle":"solid","btnCancelBorderRadius":"20px","inputBgColor":"#fff","inputLableFontSize":"14px","uploadLableColor":"#606266","uploadBorderRadius":"20px","btnSaveHeight":"44px","selectBgColor":"#fff","btnSaveWidth":"88px","selectIconFontSize":"14px","dateHeight":"40px","selectBorderColor":"#DCDFE6","inputBorderColor":"#DCDFE6","uploadBorderColor":"#DCDFE6","textareaFontColor":"#606266","selectBorderWidth":"1px","dateFontColor":"rgba(159, 111, 85, 0.88)","btnCancelBorderWidth":"1px","uploadBorderWidth":"1px","textareaFontSize":"14px","selectBorderRadius":"20px","selectFontColor":"#606266","btnSaveBorderColor":"#409EFF","btnSaveBorderWidth":"1px"},id: '',type: '',ro:{name : false,value : false,},ruleForm: {name: '',value: '',},rules: {name: [{ required: true, message: '名称不能为空', trigger: 'blur' },],value: [],}};},props: ["parent"],computed: {},created() {this.addEditStyleChange()this.addEditUploadStyleChange()},methods: {// 下载download(file){window.open(`${file}`)},// 初始化init(id,type) {if (id) {this.id = id;this.type = type;}if(this.type=='info'||this.type=='else'){this.info(id);}else if(this.type=='cross'){var obj = this.$storage.getObj('crossObj');for (var o in obj){if(o=='name'){this.ruleForm.name = obj[o];this.ro.name = true;continue;}if(o=='value'){this.ruleForm.value = obj[o];this.ro.value = true;continue;}}}},// 多级联动参数info(id) {this.$http({url: `config/info/${id}`,method: "get"}).then(({ data }) => {if (data && data.code === 0) {this.ruleForm = data.data;//解决前台上传图片后台不显示的问题let reg=new RegExp('../../../upload','g')//g代表全部} else {this.$message.error(data.msg);}});},// 提交onSubmit() {// ${column.compare}// ${column.compare}this.$refs["ruleForm"].validate(valid => {if (valid) {this.$http({url: `config/${!this.ruleForm.id ? "save" : "update"}`,method: "post",data: this.ruleForm}).then(({ data }) => {if (data && data.code === 0) {this.$message({message: "操作成功",type: "success",duration: 1500,onClose: () => {this.parent.showFlag = true;this.parent.addOrUpdateFlag = false;this.parent.configCrossAddOrUpdateFlag = false;this.parent.search();this.parent.contentStyleChange();}});} else {this.$message.error(data.msg);}});}});},// 获取uuidgetUUID () {return new Date().getTime();},// 返回back() {this.parent.showFlag = true;this.parent.addOrUpdateFlag = false;this.parent.configCrossAddOrUpdateFlag = false;this.parent.contentStyleChange();},valueUploadChange(fileUrls) {this.ruleForm.value = fileUrls;this.addEditUploadStyleChange()},addEditStyleChange() {this.$nextTick(()=>{// inputdocument.querySelectorAll('.addEdit-block .input .el-input__inner').forEach(el=>{el.style.height = this.addEditForm.inputHeightel.style.color = this.addEditForm.inputFontColorel.style.fontSize = this.addEditForm.inputFontSizeel.style.borderWidth = this.addEditForm.inputBorderWidthel.style.borderStyle = this.addEditForm.inputBorderStyleel.style.borderColor = this.addEditForm.inputBorderColorel.style.borderRadius = this.addEditForm.inputBorderRadiusel.style.backgroundColor = this.addEditForm.inputBgColor})document.querySelectorAll('.addEdit-block .input .el-form-item__label').forEach(el=>{el.style.lineHeight = this.addEditForm.inputHeightel.style.color = this.addEditForm.inputLableColorel.style.fontSize = this.addEditForm.inputLableFontSize})// selectdocument.querySelectorAll('.addEdit-block .select .el-input__inner').forEach(el=>{el.style.height = this.addEditForm.selectHeightel.style.color = this.addEditForm.selectFontColorel.style.fontSize = this.addEditForm.selectFontSizeel.style.borderWidth = this.addEditForm.selectBorderWidthel.style.borderStyle = this.addEditForm.selectBorderStyleel.style.borderColor = this.addEditForm.selectBorderColorel.style.borderRadius = this.addEditForm.selectBorderRadiusel.style.backgroundColor = this.addEditForm.selectBgColor})document.querySelectorAll('.addEdit-block .select .el-form-item__label').forEach(el=>{el.style.lineHeight = this.addEditForm.selectHeightel.style.color = this.addEditForm.selectLableColorel.style.fontSize = this.addEditForm.selectLableFontSize})document.querySelectorAll('.addEdit-block .select .el-select__caret').forEach(el=>{el.style.color = this.addEditForm.selectIconFontColorel.style.fontSize = this.addEditForm.selectIconFontSize})// datedocument.querySelectorAll('.addEdit-block .date .el-input__inner').forEach(el=>{el.style.height = this.addEditForm.dateHeightel.style.color = this.addEditForm.dateFontColorel.style.fontSize = this.addEditForm.dateFontSizeel.style.borderWidth = this.addEditForm.dateBorderWidthel.style.borderStyle = this.addEditForm.dateBorderStyleel.style.borderColor = this.addEditForm.dateBorderColorel.style.borderRadius = this.addEditForm.dateBorderRadiusel.style.backgroundColor = this.addEditForm.dateBgColor})document.querySelectorAll('.addEdit-block .date .el-form-item__label').forEach(el=>{el.style.lineHeight = this.addEditForm.dateHeightel.style.color = this.addEditForm.dateLableColorel.style.fontSize = this.addEditForm.dateLableFontSize})document.querySelectorAll('.addEdit-block .date .el-input__icon').forEach(el=>{el.style.color = this.addEditForm.dateIconFontColorel.style.fontSize = this.addEditForm.dateIconFontSizeel.style.lineHeight = this.addEditForm.dateHeight})// uploadlet iconLineHeight = parseInt(this.addEditForm.uploadHeight) - parseInt(this.addEditForm.uploadBorderWidth) * 2 + 'px'document.querySelectorAll('.addEdit-block .upload .el-upload--picture-card').forEach(el=>{el.style.width = this.addEditForm.uploadHeightel.style.height = this.addEditForm.uploadHeightel.style.borderWidth = this.addEditForm.uploadBorderWidthel.style.borderStyle = this.addEditForm.uploadBorderStyleel.style.borderColor = this.addEditForm.uploadBorderColorel.style.borderRadius = this.addEditForm.uploadBorderRadiusel.style.backgroundColor = this.addEditForm.uploadBgColor})document.querySelectorAll('.addEdit-block .upload .el-form-item__label').forEach(el=>{el.style.lineHeight = this.addEditForm.uploadHeightel.style.color = this.addEditForm.uploadLableColorel.style.fontSize = this.addEditForm.uploadLableFontSize})document.querySelectorAll('.addEdit-block .upload .el-icon-plus').forEach(el=>{el.style.color = this.addEditForm.uploadIconFontColorel.style.fontSize = this.addEditForm.uploadIconFontSizeel.style.lineHeight = iconLineHeightel.style.display = 'block'})// 多文本输入框document.querySelectorAll('.addEdit-block .textarea .el-textarea__inner').forEach(el=>{el.style.height = this.addEditForm.textareaHeightel.style.color = this.addEditForm.textareaFontColorel.style.fontSize = this.addEditForm.textareaFontSizeel.style.borderWidth = this.addEditForm.textareaBorderWidthel.style.borderStyle = this.addEditForm.textareaBorderStyleel.style.borderColor = this.addEditForm.textareaBorderColorel.style.borderRadius = this.addEditForm.textareaBorderRadiusel.style.backgroundColor = this.addEditForm.textareaBgColor})document.querySelectorAll('.addEdit-block .textarea .el-form-item__label').forEach(el=>{// el.style.lineHeight = this.addEditForm.textareaHeightel.style.color = this.addEditForm.textareaLableColorel.style.fontSize = this.addEditForm.textareaLableFontSize})// 保存document.querySelectorAll('.addEdit-block .btn .btn-success').forEach(el=>{el.style.width = this.addEditForm.btnSaveWidthel.style.height = this.addEditForm.btnSaveHeightel.style.color = this.addEditForm.btnSaveFontColorel.style.fontSize = this.addEditForm.btnSaveFontSizeel.style.borderWidth = this.addEditForm.btnSaveBorderWidthel.style.borderStyle = this.addEditForm.btnSaveBorderStyleel.style.borderColor = this.addEditForm.btnSaveBorderColorel.style.borderRadius = this.addEditForm.btnSaveBorderRadiusel.style.backgroundColor = this.addEditForm.btnSaveBgColor})// 返回document.querySelectorAll('.addEdit-block .btn .btn-close').forEach(el=>{el.style.width = this.addEditForm.btnCancelWidthel.style.height = this.addEditForm.btnCancelHeightel.style.color = this.addEditForm.btnCancelFontColorel.style.fontSize = this.addEditForm.btnCancelFontSizeel.style.borderWidth = this.addEditForm.btnCancelBorderWidthel.style.borderStyle = this.addEditForm.btnCancelBorderStyleel.style.borderColor = this.addEditForm.btnCancelBorderColorel.style.borderRadius = this.addEditForm.btnCancelBorderRadiusel.style.backgroundColor = this.addEditForm.btnCancelBgColor})})},addEditUploadStyleChange() {this.$nextTick(()=>{document.querySelectorAll('.addEdit-block .upload .el-upload-list--picture-card .el-upload-list__item').forEach(el=>{el.style.width = this.addEditForm.uploadHeightel.style.height = this.addEditForm.uploadHeightel.style.borderWidth = this.addEditForm.uploadBorderWidthel.style.borderStyle = this.addEditForm.uploadBorderStyleel.style.borderColor = this.addEditForm.uploadBorderColorel.style.borderRadius = this.addEditForm.uploadBorderRadiusel.style.backgroundColor = this.addEditForm.uploadBgColor})})},}
};
</script>
<style lang="scss">
.editor{height: 500px;& /deep/ .ql-container {height: 310px;}
}
.amap-wrapper {width: 100%;height: 500px;
}
.search-box {position: absolute;
}
.addEdit-block {margin: -10px;
}
.detail-form-content {padding: 12px;
}
.btn .el-button {padding: 0;
}
</style>

声明

本博客适用于广泛的学术和教育用途,包括但不限于个人学习、开发设计,产品设计。仅供学习参考,旨在为读者提供深入理解和学术研究的材料。


http://www.ppmy.cn/server/107906.html

相关文章

如何在没有密码的情况下从 iPad 中删除 MDM?100% 工作

如果您遇到已使用远程管理锁恢复的 iPad 或 iPhone&#xff0c;您将需要远程管理器的登录信息。 从 iPad 中删除 MDM可能很困难&#xff0c;尤其是在您没有正确的权限的情况下。在寻求帮助时&#xff0c;许多客户访问 Apple 的官方论坛&#xff0c;却发现问题并不总是容易解决。…

裸金属机的算力共享支持怎么实现

目录 裸金属机的算力共享支持怎么实现 一、技术架构 二、资源调度 三、安全保障 四、应用场景适配 裸金属机通过ssh实现远程调度 1. SSH配置 2. 远程登录 3. 远程命令执行 4. 自动化脚本 5. 安全注意事项 裸金属机的算力共享支持怎么实现 裸金属机的算力共享支持实…

区块链(币圈)常用网址大全

交易所 中心化交易所 币安&#xff08;Binance&#xff09;&#xff1a;https://www.binance.com/ Coinbase Exchange&#xff1a;https://www.coinbase.com/ Bybit&#xff1a;https://www.bybit.com/ 欧意&#xff08;OKX&#xff09;&#xff1a;https://www.okx.com/ …

C语言中的int argc, char *argv[]是什么?

在C语言中&#xff0c;int argc, char *argv[]是程序启动时传递给main函数的参数。这两个参数使得程序能够接收来自命令行的输入&#xff0c;增加了程序的灵活性和通用性。本文将从argc和argv的定义、用法、示例和实际应用几个方面进行深入解析。 一、argc和argv的定义 在C语言…

干货分享|分享一款高效率截图工具 Snipaste

下载地址&#xff1a;Snipaste - 截图 贴图 使用方法&#xff1a;Snipaste 是一个简单但强大的截图工具&#xff0c;也可以让你将截图贴回到屏幕上&#xff01;下载并打开 Snipaste&#xff0c;按下 F1 来开始截图&#xff0c;再按 F3&#xff0c;截图就在桌面置顶显示了。就这…

mysql binlog日志生成及数据恢复

1.开启Binary Logging配置 一般默认开启,查看binlog是否打开: SHOW VARIABLES LIKE log_bin; -- 查看binlog是否打开 SHOW VARIABLES LIKE log_bin_basename;如果没有开启,需要配置文件里加入如下配置,修改完后,重启mysql服务器: [mysqld] log-bin=mysql-bin查看binlo…

时间序列模型(ARIMA) — — 预测未来(含 python 和 Matlab 的完整代码)

文章目录 前言一、python 代码实现statsmodels 中的 predict 和 forecastpredictforecast 实际运用滚动预测 向后预测的代码 二、Matlab 代码实现ADF检验确定 p、q 的值aicbic(logL, numParam, n) 函数 向后预测的代码 三、python 和 Matlab 的完整代码pythonMatlab 前言 【Ma…

Lua收集请求日志

Kafka搭建 单机版的kafka搭建非常简单&#xff0c;不过我们今天采用Docker搭建kafka。Kafka使用Zookeeper存储Consumer、Broker信息&#xff0c;安装kafak的时候&#xff0c;需要先安装Zookeeper。 Zookeeper安装&#xff1a; docker run -d --name zookeeper -p 3181:3181 …