图书管理系统900pf

news2024/9/22 19:36:51

@TOC

springboot533图书管理系统900pf

第一章 课题背景及研究内容

1.1 课题背景

信息数据从传统到当代,是一直在变革当中,突如其来的互联网让传统的信息管理看到了革命性的曙光,因为传统信息管理从时效性,还是安全性,还是可操作性等各个方面来讲,遇到了互联网时代才发现能补上自古以来的短板,有效的提升管理的效率和业务水平。传统的管理模式,时间越久管理的内容越多,也需要更多的人来对数据进行整理,并且数据的汇总查询方面效率也是极其的低下,并且数据安全方面永远不会保证安全性能。结合数据内容管理的种种缺点,在互联网时代都可以得到有效的补充。结合先进的互联网技术,开发符合需求的软件,让数据内容管理不管是从录入的及时性,查看的及时性还是汇总分析的及时性,都能让正确率达到最高,管理更加的科学和便捷。本次开发的图书管理系统实现了字典管理、公告管理、留言板管理、图书管理、图书收藏管理、图书留言管理、图书借阅管理、用户管理、管理员管理等功能。系统用到了关系型数据库中王者MySql作为系统的数据库,有效的对数据进行安全的存储,有效的备份,对数据可靠性方面得到了保证。并且程序也具备程序需求的所有功能,使得操作性还是安全性都大大提高,让图书管理系统更能从理念走到现实,确确实实的让人们提升信息处理效率。

1.2 开发目的和意义

小康时代的到来,使得人们满意度上升,生活各个方面都产生了许多变化,比如办公都有相应软件,很多工作都要求员工会操作计算机,可以说现在的时代基本被软件覆盖得差不多了,软件行业的特征就是大家都在使用软件代替传统手工记载操作,软件的出现让我们的生活还有工作又向前翻了新篇章。图书管理系统是一个利用软件形式管理图书信息的平台。管理员管理租车信息也不再需要用纸张进行信息记录及查询管理操作,所有的操作都是利用电脑进行办公,用户需要使用密码还有用户名进行系统登录操作,按照系统主页界面的各个功能展示进行相关操作,无论添加或者是删除,拟或是修改查询等操作,时间上不需要太多,短短几分钟就会搞定。况且软件是不限制办公地点以及办公时间的,只要有操作需要,随时随地登录系统就可以完成任务。办公效率提高这个不再是难题。公告租赁店对于租车信息的管理操作早就应该进行变革了,利用软件管理租车信息,节约人力物力成本,这是一个新的租车信息管理的创举。

1.3 论文研究内容

本次开发的图书管理系统的论文从下面几个部分进行编写:

第一章:本章介绍了程序开发背景和目的意义,罗列出了论文写作内容信息,让我们知道论文编写是如何进展的。

第二章:本章主要讲解了系统开发用到的相关技术方面的知识,比如SSM技术,MySQL数据库知识等内容。帮助人们更好的理解系统技术上面的相关知识。

第三章:文章第3章主要介绍了系统开发的可行性问题,从经济,时间,操作等内容上面进行了大致介绍,确定系统开发确实可行,然后分析了系统的开发流程,确定系统需要具备的大概的功能,保障系统能够稳定使用和运行。

第四章:这个章节主要绘制出了系统功能架构,让我们更直观了解图书管理系统的功能,对后台数据库表进行了设计,还画出了对应的E-R图。

第五章:这个章节主要介绍系统各个部分功能具体实现的界面效果。让我们了解到各个部分的功能详细情况。

第六章:这个部分主要就是对图书管理系统进行整体测试,看看程序是否能够达到用户使用要求,程序能否进行验收上交操作。

第二章 相关技术

本次开发图书管理系统使用的是Vue进行程序开发,图书管理系统的数据信息选择MySQL数据库进行存放。

2.1 VUE介绍

Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层,不仅易于上手,还便于与第三方库或既有项目整合。另一方面,当与现代化的工具链以及各种支持类库结合使用时,Vue 也完全能够为复杂的单页应用提供驱动。

2.2 MySQL数据库

开发的程序面向用户的只是程序的功能界面,让用户操作程序界面的各个功能,那么很多人就会问,用户使用程序功能生成的数据信息放在哪里的?这个就需要涉及到数据库的知识了,一般来说,程序开发通常就会对常用数据存储工具的特点进行分析比对,比如Mysql数据库的特点与优势,Access数据库的特点与优势,Sqlserver数据库的特点与优势等,最终看哪个数据库与需要开发的程序比较匹配,也符合程序功能运行需要的数据存储要求,比如,需要开发商业级别的程序,存储的数据对数据库要求较高,可以选用Oracle,如果只是比较简单的程序,对数据存储没有过多要求,可以选用微软旗下的Access,当开发程序要求数据库占用空间小,并能满足程序数据存储要求时,就可以考虑Oracle公司从瑞典MySQL AB公司在很早之前就收购过一个关系型数据库,它是现在的Mysql数据库。所以图书管理系统后台数据库使用的是MySQL进行数据库方面的开发工作的,MySQL它是微软开发的一款平台软件,这个软件可以给用户提供高效率的智能数据,并且数据信息还是很可靠,使用它进行数据存储可以满足大众企业管理各种各样的数据信息的需求。MySQL在MySQL版本里面它是最全面的,也是最强大的开发平台, MySQL在许多关键之处都进行了改进的操作,它也增加了很多新特性,这些改进和更新让公司能够对关键应用程序进行高效运行,并且还可以让公司降低发送信息给用户的成本,以及降低数据信息管理的基础设施。因此MySQL在公司以及企业中它的地位是非常高的,ERP还有OA系统,以及公司财务的系统都离不开MySQL,在软件开发非常流行的今天,MySQL也被用来作为网站开发的网站后台数据库,可以说公司使用MySQL进行数据管理不仅节约成本,还可以让公司数据信息的管理效率大大提高,公司数据存放在MySQL平台上,数据信息的安全性也不用担心,因为MySQL他可以给数据库里面的日志还有数据文件以及整个数据库进行加密操作,另外MySQL还提供在线备份功能,这样可以节约存储空间,加快数据备份的速度。总之,选择MySQL进行在线系统的后台数据库开发是很有优势的。这是个不错的软件选择。

第三章 系统分析

3.1可行性分析

可行性分析从时间,经济以及操作和技术上面进行调查和研究,确保合理利用信息资源,避免在进行程序设计过程中因为考虑不周到所带来的困扰,帮助我们更好的进行程序设计。

3.1.1时间可行性

本次进行系统开发,我预留了两个月时间来完成,从系统的需求分析,功能结构设计,功能详细设计以及系统测试等环节,两个月时间是可以完成程序开发操作的,我打算每天早中晚都进行程序的编写操作,这期间也包括查阅各种资料信息,加上同学以及老师的帮助和指点,相信程序开发的时间也会缩短不少。所以时间上是可行的。

3.1.2 经济可行性

图书管理系统的开发平台是IDEA,数据库选用MySQL数据库,使用的浏览器都是大众浏览器,这些软件是不需要收费就能进行下载安装操作的。在系统开发的硬件选择上面,我使用的是自己的笔记本进行开发操作。因此在进行系统开发时,经济上面无需额外支出。开发出来的程序可以提高办公效率,带来的经济效益比较高,系统开发的投入产出比很可观。

3.1.3 操作可行性

图书管理系统的界面设计比较简单,界面布局根据用户日常使用习惯进行设计,网站各个功能在导航栏里面清晰可见,网站的数据操作可视化,用户操作网站不需要培训就能上手,只需要跟着网站功能提示进行操作就行。

3.1.4 技术可行性

作为计算机专业学生,在学校期间就学习到许多关于编程方面的知识,像SSM技术,还有MySQL数据库等知识,我对IDEA开发平台以及MySQL数据库的操作也比较熟练,所以技术上面还是有一定把握。

3.1.5 法律可行性

自己本人开发的软件和用到的资料来源都是图书馆以及百度文库和百度网页等渠道,并不涉及违法。在个人毕业设计上面,无论源代码还是论文编写内容不存在抄袭行为。

从上面的经济,操作以及时间上面进行的分析,得出结论就是这次开发的图书管理系统在开发上面是能够进行的,系统开发出来能创造更大的经济效益,越早开发升值空间越大。

3.2系统流程分析

图书管理系统的开发也是有对应的流程,开发之前必须要进行用户功能需求的分析,最后根据功能需求进行网站设计还有数据库相关数据的设计工作,此次开发的图书管理系统开发流程如图3.1所示。

图3.1 程序操作流程图

系统开发完成之后会给用户提供登录入口,在这个界面用户输入的信息会得到验证,通过验证之后才能进去图书管理系统的访问主界面,系统登录执行流程如下:

图3.2 系统执行流程图

3.3系统功能需求分析

系统的开发离不开前期的需求分析,这个阶段就是让程序员知道自己该做什么事情,在进行需求分析的时候,着重点就是用户对系统的功能要求,这个阶段要是分析得很到位,系统开发出来投入使用时,用户就会发现系统的功能跟用户需求保持一致,程序稳定性也是达标的,可以说需求分析是决定系统开发成败的关键,它主要就是把现实世界进行抽象化,然后把抽象化的对象用来构建模型。

图书管理系统的受益群体主要是工作人员,该网站能够方便使用者进行数据信息的查找和管理工作,本次开发的网站我们设计的界面展示主要分为管理员界面以及用户界面,具体界面的功能分布如下。

图书管理系统管理员可以管理用户的基本信息,可以管理公告信息,可以管理公告信息等。

3.4 系统非功能需求分析

(1)完整性需求

本次开发的图书管理系统里面记录的数据信息不能保持为空,并且数据信息一定要核对正确才行,系统里面数据之间存在的联系不能出错,不能够张冠李戴,数据表里面同一数据在不同数据表里面的显示内容要一样。

(2)性能需求

用户在操作图书管理系统的各个部分内容时,弹出的页面响应时间不能太长,最好控制在三秒钟以内,最大限制值就是四秒,这个是给用户一个好的程序体验。并且系统还要能够承载多人同时在线进行图书管理系统的访问操作。

(3)界面需求

图书管理系统界面设计上面应该考虑到用户日常操作习惯,比如导航栏的设计不能在右边,这个完全违背了用户使用网站的操作习惯,同时功能导航的字体以及颜色应该比较显眼,方便用户容易找寻,避免用户在进行功能操作上面浪费太多时间。

(4)安全性需求

图书管理系统的安全性要有保证,给用户一种可靠,可以信赖的感觉,系统在运行过程中,不能总是出错,与用户进行功能界面交互时,要及时给出反馈信息,另外系统要设置登录窗口,让不是系统的用户不可以进行系统功能界面的访问操作。系统用户也要经过用户名密码的填写操作,才可以进入系统主界面,这样就可以保障系统数据信息处于一种安全状态。

第四章 系统设计

4.1 总体功能

图书管理系统是根据需求定制开发,开发软件选用IDEA平台配合MySQL数据库进行开发环境的搭建操作,网站采用WEB应用程序中最流行的小程序结构进行开发,用户访问系统数据仅仅需要在客户端安装谷歌浏览器或者是当下常用浏览器就可以访问网站内容。

4.2 系统模块设计

图书管理系统系统在进行系统中功能模块的划分时,采用层次图来进行表示。层次图具有树形结构,它能使用矩形框来描绘数据信息。顶层代表的数据结构很完整,顶层下面的矩形框表示的数据就是子集数据,当然处于最下面的矩形框就是不能再进行细分的数据元素了,使用层次方框图描述系统功能能让用户一目了然,能够明白系统的功能,以及对应功能板块下面的子功能都可以清楚领会。图书管理系统分为管理员和用户两部分操作角色,下面将对他们的功能进行阐述。

管理员可以管理用户的基本信息,可以管理等功能。管理员功能结构图如下:

结构设计图

图4.1 管理员功能结构图

4.3 数据库设计

4.3.1 数据库设计

数据库设计它是建立在数据库还有它对应的应用系统的一门技术,只要是信息系统开发还有系统建设,都会用到数据库设计,但是这个数据库设计并不是很简单就可以完成的,设计期间会遇到很多麻烦事,在设计期间需要考虑再考虑,逐步完善。主要内容也就是把数据库里面的对象还有对象之间的联系进行系统规划操作,还有把他们结构化的过程。

4.3.2 数据库E-R 图

E-R 图分成三部分内容,分别是实体,实体的属性以及实体之间的关系这三个部分的内容,通常长方形表示的就是实体,椭圆形表示的就是属性,菱形表示的就是关系了。在E-R 图里面,实体就是对象,比如学生,人,音乐等都能代表实体,实体都具备自己的成员,比如张三就是学生实体里面的成员。一个学生会具有自己的姓名,年龄,出生日期等信息,这些信息就是学生这个实体的属性,因此E-R 图属性代表的就是数据对象具备的属性,E-R 图的关系就是实体跟实体之间的关系了,比如学生跟课程会存在一定的关系,这种关系使用菱形进行表示。

(1)下图是留言板实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\留言板.jpg

留言板实体属性图

(2)下图是用户实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\用户.jpg

用户实体属性图

(3)下图是图书实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\图书.jpg

图书实体属性图

(4)下图是公告实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\公告.jpg

公告实体属性图

(5)下图是图书借阅实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\图书借阅.jpg

图书借阅实体属性图

(6)下图是图书收藏实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\图书收藏.jpg

图书收藏实体属性图

(7)下图是图书留言实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\5.1\img\图书留言.jpg

图书留言实体属性图

4.3.3 数据库表设计

数据库里面的数据表存放的就是各种数据记录,我们在进行系统增删改查操作时,其实也是在对应数据表里面进行的增删改查操作,一个好的数据库能够缩短信息处理时间,所以说数据库的设计工作不容小觑,数据库里面设置哪些表,表里面的字段设计以及字段类型和字段长度等信息都要考虑周到才行,比如时间这个字段,它的数据类型就不能是int型,不然在系统操作中就会弹出输入数据格式不符合要求的报错提示。下面简单介绍图书管理系统的一些数据表。

表4.1字典表

序号列名数据类型说明允许空
1IdIntid
2dic_codeString字段
3dic_nameString字段名
4code_indexInteger编码
5index_nameString编码名字
6super_idInteger父字段id
7beizhuString备注
8create_timeDate创建时间

表4.2公告表

序号列名数据类型说明允许空
1IdIntid
2gonggao_nameString公告名称
3gonggao_photoString公告图片
4gonggao_typesInteger公告类型
5insert_timeDate公告发布时间
6gonggao_contentString公告详情
7create_timeDate创建时间

表4.3留言板表

序号列名数据类型说明允许空
1IdIntid
2yonghu_idInteger用户
3liuyan_nameString留言标题
4liuyan_textString留言内容
5insert_timeDate留言时间
6reply_textString回复内容
7update_timeDate回复时间
8create_timeDate创建时间

表4.4图书表

序号列名数据类型说明允许空
1IdIntid
2tushu_nameString图书名称
3tushu_uuid_numberString图书编号
4tushu_photoString图书照片
5tushu_addressString图书位置
6tushu_typesInteger图书类型
7tushu_kucun_numberInteger图书数量
8tushu_clicknumInteger图书热度
9tushu_contentString内容介绍
10shangxia_typesInteger是否上架
11tushu_deleteInteger逻辑删除
12insert_timeDate录入时间
13create_timeDate创建时间

表4.5图书收藏表

序号列名数据类型说明允许空
1IdIntid
2tushu_idInteger图书
3yonghu_idInteger用户
4tushu_collection_typesInteger类型
5insert_timeDate收藏时间
6create_timeDate创建时间

表4.6图书留言表

序号列名数据类型说明允许空
1IdIntid
2tushu_idInteger图书
3yonghu_idInteger用户
4tushu_liuyan_textString留言内容
5insert_timeDate留言时间
6reply_textString回复内容
7update_timeDate回复时间
8create_timeDate创建时间

表4.7图书借阅表

序号列名数据类型说明允许空
1IdIntid
2tushu_order_uuid_numberString借阅编号
3tushu_idInteger图书
4yonghu_idInteger用户
5buy_numberInteger借阅数量
6tushu_order_timeDate还书时间
7tushu_order_typesInteger订单类型
8insert_timeDate订单创建时间
9create_timeDate创建时间

表4.8用户表

序号列名数据类型说明允许空
1IdIntid
2yonghu_nameString用户姓名
3yonghu_phoneString用户手机号
4yonghu_id_numberString用户身份证号
5yonghu_photoString用户头像
6yonghu_emailString电子邮箱
7yonghu_typesInteger账户状态
8create_timeDate创建时间

表4.9管理员表

序号列名数据类型说明允许空
1IdIntid
2usernameString学生名
3passwordString密码
4roleString角色
5addtimeDate新增时间

第五章 系统实现

5.1 管理员功能模块的实现

5.1.1 图书列表

如图5.1显示的就是图书列表页面,此页面提供给管理员的功能有:查看图书、新增图书、修改图书、删除图书等。

图5.1 图书列表页面

5.1.2 公告信息管理

管理员可以对公告信息进行管理,可以新增公告信息,修改公告信息,删除无效的公告信息。公告信息管理界面如图5.2所示。

图5.2 公告信息管理页面

5.1.3 公告类型管理

公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。公告类型管理界面如图5.3所示。

图5.3公告类型管理界面

LiuyanServiceImpl.java
package com.service.impl;

import com.utils.StringUtil;
import com.service.DictionaryService;
import com.utils.ClazzDiff;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.lang.reflect.Field;
import java.util.*;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import com.utils.PageUtils;
import com.utils.Query;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import com.dao.LiuyanDao;
import com.entity.LiuyanEntity;
import com.service.LiuyanService;
import com.entity.view.LiuyanView;

/**
 * 留言板 服务实现类
 */
@Service("liuyanService")
@Transactional
public class LiuyanServiceImpl extends ServiceImpl<LiuyanDao, LiuyanEntity> implements LiuyanService {

    @Override
    public PageUtils queryPage(Map<String,Object> params) {
        Page<LiuyanView> page =new Query<LiuyanView>(params).getPage();
        page.setRecords(baseMapper.selectListView(page,params));
        return new PageUtils(page);
    }


}

LiuyanController.java

package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 留言板
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/liuyan")
public class LiuyanController {
    private static final Logger logger = LoggerFactory.getLogger(LiuyanController.class);

    private static final String TABLE_NAME = "liuyan";

    @Autowired
    private LiuyanService liuyanService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表非注册的service
    //注册表service
    @Autowired
    private YonghuService yonghuService;


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("用户".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = liuyanService.queryPage(params);

        //字典表数据转换
        List<LiuyanView> list =(List<LiuyanView>)page.getList();
        for(LiuyanView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        LiuyanEntity liuyan = liuyanService.selectById(id);
        if(liuyan !=null){
            //entity转view
            LiuyanView view = new LiuyanView();
            BeanUtils.copyProperties( liuyan , view );//把实体数据重构到view中
            //级联表 用户
            //级联表
            YonghuEntity yonghu = yonghuService.selectById(liuyan.getYonghuId());
            if(yonghu != null){
            BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setYonghuId(yonghu.getId());
            }
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody LiuyanEntity liuyan, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");
        else if("用户".equals(role))
            liuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));

        Wrapper<LiuyanEntity> queryWrapper = new EntityWrapper<LiuyanEntity>()
            .eq("yonghu_id", liuyan.getYonghuId())
            .eq("liuyan_name", liuyan.getLiuyanName())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        LiuyanEntity liuyanEntity = liuyanService.selectOne(queryWrapper);
        if(liuyanEntity==null){
            liuyan.setInsertTime(new Date());
            liuyan.setCreateTime(new Date());
            liuyanService.insert(liuyan);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody LiuyanEntity liuyan, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());
        LiuyanEntity oldLiuyanEntity = liuyanService.selectById(liuyan.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
//        else if("用户".equals(role))
//            liuyan.setYonghuId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
        liuyan.setUpdateTime(new Date());

            liuyanService.updateById(liuyan);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<LiuyanEntity> oldLiuyanList =liuyanService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        liuyanService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<LiuyanEntity> liuyanList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            LiuyanEntity liuyanEntity = new LiuyanEntity();
//                            liuyanEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            liuyanEntity.setLiuyanName(data.get(0));                    //留言标题 要改的
//                            liuyanEntity.setLiuyanText(data.get(0));                    //留言内容 要改的
//                            liuyanEntity.setInsertTime(date);//时间
//                            liuyanEntity.setReplyText(data.get(0));                    //回复内容 要改的
//                            liuyanEntity.setUpdateTime(sdf.parse(data.get(0)));          //回复时间 要改的
//                            liuyanEntity.setCreateTime(date);//时间
                            liuyanList.add(liuyanEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        liuyanService.insertBatch(liuyanList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }




    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        CommonUtil.checkMap(params);
        PageUtils page = liuyanService.queryPage(params);

        //字典表数据转换
        List<LiuyanView> list =(List<LiuyanView>)page.getList();
        for(LiuyanView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        LiuyanEntity liuyan = liuyanService.selectById(id);
            if(liuyan !=null){


                //entity转view
                LiuyanView view = new LiuyanView();
                BeanUtils.copyProperties( liuyan , view );//把实体数据重构到view中

                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(liuyan.getYonghuId());
                if(yonghu != null){
                    BeanUtils.copyProperties( yonghu , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setYonghuId(yonghu.getId());
                }
                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody LiuyanEntity liuyan, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,liuyan:{}",this.getClass().getName(),liuyan.toString());
        Wrapper<LiuyanEntity> queryWrapper = new EntityWrapper<LiuyanEntity>()
            .eq("yonghu_id", liuyan.getYonghuId())
            .eq("liuyan_name", liuyan.getLiuyanName())
            .eq("liuyan_text", liuyan.getLiuyanText())
            .eq("reply_text", liuyan.getReplyText())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        LiuyanEntity liuyanEntity = liuyanService.selectOne(queryWrapper);
        if(liuyanEntity==null){
            liuyan.setInsertTime(new Date());
            liuyan.setCreateTime(new Date());
        liuyanService.insert(liuyan);

            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

}

GonggaoController.java

package com.controller;

import java.io.File;
import java.math.BigDecimal;
import java.net.URL;
import java.text.SimpleDateFormat;
import com.alibaba.fastjson.JSONObject;
import java.util.*;
import org.springframework.beans.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.context.ContextLoader;
import javax.servlet.ServletContext;
import com.service.TokenService;
import com.utils.*;
import java.lang.reflect.InvocationTargetException;

import com.service.DictionaryService;
import org.apache.commons.lang3.StringUtils;
import com.annotation.IgnoreAuth;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.entity.*;
import com.entity.view.*;
import com.service.*;
import com.utils.PageUtils;
import com.utils.R;
import com.alibaba.fastjson.*;

/**
 * 公告
 * 后端接口
 * @author
 * @email
*/
@RestController
@Controller
@RequestMapping("/gonggao")
public class GonggaoController {
    private static final Logger logger = LoggerFactory.getLogger(GonggaoController.class);

    private static final String TABLE_NAME = "gonggao";

    @Autowired
    private GonggaoService gonggaoService;


    @Autowired
    private TokenService tokenService;
    @Autowired
    private DictionaryService dictionaryService;

    //级联表非注册的service
    //注册表service
    @Autowired
    private YonghuService yonghuService;


    /**
    * 后端列表
    */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("page方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));
        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永不会进入");
        else if("用户".equals(role))
            params.put("yonghuId",request.getSession().getAttribute("userId"));
        CommonUtil.checkMap(params);
        PageUtils page = gonggaoService.queryPage(params);

        //字典表数据转换
        List<GonggaoView> list =(List<GonggaoView>)page.getList();
        for(GonggaoView c:list){
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(c, request);
        }
        return R.ok().put("data", page);
    }

    /**
    * 后端详情
    */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("info方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        GonggaoEntity gonggao = gonggaoService.selectById(id);
        if(gonggao !=null){
            //entity转view
            GonggaoView view = new GonggaoView();
            BeanUtils.copyProperties( gonggao , view );//把实体数据重构到view中
            //修改对应字典表字段
            dictionaryService.dictionaryConvert(view, request);
            return R.ok().put("data", view);
        }else {
            return R.error(511,"查不到数据");
        }

    }

    /**
    * 后端保存
    */
    @RequestMapping("/save")
    public R save(@RequestBody GonggaoEntity gonggao, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,gonggao:{}",this.getClass().getName(),gonggao.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
        if(false)
            return R.error(511,"永远不会进入");

        Wrapper<GonggaoEntity> queryWrapper = new EntityWrapper<GonggaoEntity>()
            .eq("gonggao_name", gonggao.getGonggaoName())
            .eq("gonggao_types", gonggao.getGonggaoTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        GonggaoEntity gonggaoEntity = gonggaoService.selectOne(queryWrapper);
        if(gonggaoEntity==null){
            gonggao.setInsertTime(new Date());
            gonggao.setCreateTime(new Date());
            gonggaoService.insert(gonggao);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody GonggaoEntity gonggao, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
        logger.debug("update方法:,,Controller:{},,gonggao:{}",this.getClass().getName(),gonggao.toString());
        GonggaoEntity oldGonggaoEntity = gonggaoService.selectById(gonggao.getId());//查询原先数据

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        if("".equals(gonggao.getGonggaoPhoto()) || "null".equals(gonggao.getGonggaoPhoto())){
                gonggao.setGonggaoPhoto(null);
        }

            gonggaoService.updateById(gonggao);//根据id更新
            return R.ok();
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids, HttpServletRequest request){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        List<GonggaoEntity> oldGonggaoList =gonggaoService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        gonggaoService.deleteBatchIds(Arrays.asList(ids));

        return R.ok();
    }


    /**
     * 批量上传
     */
    @RequestMapping("/batchInsert")
    public R save( String fileName, HttpServletRequest request){
        logger.debug("batchInsert方法:,,Controller:{},,fileName:{}",this.getClass().getName(),fileName);
        Integer yonghuId = Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId")));
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            List<GonggaoEntity> gonggaoList = new ArrayList<>();//上传的东西
            Map<String, List<String>> seachFields= new HashMap<>();//要查询的字段
            Date date = new Date();
            int lastIndexOf = fileName.lastIndexOf(".");
            if(lastIndexOf == -1){
                return R.error(511,"该文件没有后缀");
            }else{
                String suffix = fileName.substring(lastIndexOf);
                if(!".xls".equals(suffix)){
                    return R.error(511,"只支持后缀为xls的excel文件");
                }else{
                    URL resource = this.getClass().getClassLoader().getResource("static/upload/" + fileName);//获取文件路径
                    File file = new File(resource.getFile());
                    if(!file.exists()){
                        return R.error(511,"找不到上传文件,请联系管理员");
                    }else{
                        List<List<String>> dataList = PoiUtil.poiImport(file.getPath());//读取xls文件
                        dataList.remove(0);//删除第一行,因为第一行是提示
                        for(List<String> data:dataList){
                            //循环
                            GonggaoEntity gonggaoEntity = new GonggaoEntity();
//                            gonggaoEntity.setGonggaoName(data.get(0));                    //公告名称 要改的
//                            gonggaoEntity.setGonggaoPhoto("");//详情和图片
//                            gonggaoEntity.setGonggaoTypes(Integer.valueOf(data.get(0)));   //公告类型 要改的
//                            gonggaoEntity.setInsertTime(date);//时间
//                            gonggaoEntity.setGonggaoContent("");//详情和图片
//                            gonggaoEntity.setCreateTime(date);//时间
                            gonggaoList.add(gonggaoEntity);


                            //把要查询是否重复的字段放入map中
                        }

                        //查询是否重复
                        gonggaoService.insertBatch(gonggaoList);
                        return R.ok();
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            return R.error(511,"批量插入数据异常,请联系管理员");
        }
    }




    /**
    * 前端列表
    */
    @IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params, HttpServletRequest request){
        logger.debug("list方法:,,Controller:{},,params:{}",this.getClass().getName(),JSONObject.toJSONString(params));

        CommonUtil.checkMap(params);
        PageUtils page = gonggaoService.queryPage(params);

        //字典表数据转换
        List<GonggaoView> list =(List<GonggaoView>)page.getList();
        for(GonggaoView c:list)
            dictionaryService.dictionaryConvert(c, request); //修改对应字典表字段

        return R.ok().put("data", page);
    }

    /**
    * 前端详情
    */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id, HttpServletRequest request){
        logger.debug("detail方法:,,Controller:{},,id:{}",this.getClass().getName(),id);
        GonggaoEntity gonggao = gonggaoService.selectById(id);
            if(gonggao !=null){


                //entity转view
                GonggaoView view = new GonggaoView();
                BeanUtils.copyProperties( gonggao , view );//把实体数据重构到view中

                //修改对应字典表字段
                dictionaryService.dictionaryConvert(view, request);
                return R.ok().put("data", view);
            }else {
                return R.error(511,"查不到数据");
            }
    }


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody GonggaoEntity gonggao, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,gonggao:{}",this.getClass().getName(),gonggao.toString());
        Wrapper<GonggaoEntity> queryWrapper = new EntityWrapper<GonggaoEntity>()
            .eq("gonggao_name", gonggao.getGonggaoName())
            .eq("gonggao_types", gonggao.getGonggaoTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        GonggaoEntity gonggaoEntity = gonggaoService.selectOne(queryWrapper);
        if(gonggaoEntity==null){
            gonggao.setInsertTime(new Date());
            gonggao.setCreateTime(new Date());
        gonggaoService.insert(gonggao);

            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }

}

add-or-update.vue
<template>
    <div class="addEdit-block">
        <el-form
                class="detail-form-content"
                ref="ruleForm"
                :model="ruleForm"
                :rules="rules"
                label-width="auto"
        >
            <el-row>
                <el-col :span="12">
                    <el-form-item class="input" v-if="type!='info'"  label="收藏表类型编码" prop="codeIndex">
                        <el-input v-model="ruleForm.codeIndex"
                                  placeholder="收藏表类型编码" clearable  :readonly="ro.codeIndex"></el-input>
                    </el-form-item>
                    <div v-else>
                        <el-form-item class="input" label="收藏表类型编码" prop="codeIndex">
                            <el-input v-model="ruleForm.codeIndex"
                                      placeholder="收藏表类型编码" readonly></el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="12">
                    <el-form-item class="input" v-if="type!='info'"  label="收藏表类型" prop="indexName">
                        <el-input v-model="ruleForm.indexName"
                                  placeholder="收藏表类型" clearable  :readonly="ro.indexName"></el-input>
                    </el-form-item>
                    <div v-else>
                        <el-form-item class="input" label="收藏表类型" prop="indexName">
                            <el-input v-model="ruleForm.indexName"
                                      placeholder="收藏表类型" readonly></el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <!--<el-col :span="12">
                    <el-form-item class="input" v-if="type!='info'"  label="备注" prop="beizhu">
                        <el-input v-model="ruleForm.beizhu"
                                  placeholder="备注" clearable  :readonly="ro.beizhu"></el-input>
                    </el-form-item>
                    <div v-else>
                        <el-form-item class="input" label="备注" prop="beizhu">
                            <el-input v-model="ruleForm.beizhu"
                                      placeholder="备注" readonly></el-input>
                        </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>
    import styleJs from "../../../utils/style.js";
    // 数字,邮件,手机,url,身份证校验
    import { isNumber,isIntNumer,isEmail,isPhone, isMobile,isURL,checkIdCard } from "@/utils/validate";
    export default {
        data() {
            let self = this
            return {
                addEditForm:null,
                id: '',
                type: '',
                ro:{
                    codeIndex : true,
                    indexName : false,
                    superId : false,
                    beizhu : false,
                },
                ruleForm: {
                    codeIndex: '',
                    indexName: '',
                    superId : '',
                    beizhu : '',
                },
                rules: {
                    /*beizhu: [
                        { required: true, message: '备注不能为空', trigger: 'blur' },
                        {  pattern: /^[1-9]\d*$/,
                            message: '备注只能为正整数',
                            trigger: 'blur'
                        }
                    ],*/
                }
            };
        },
        props: ["parent"],
        computed: {
        },
        created() {
            this.addEditForm = styleJs.addStyle();
            this.addEditStyleChange()
            this.addEditUploadStyleChange()
        },
        methods: {
            // 初始化
            init(id,type) {
                if (id) {
                    this.id = id;
                    this.type = type;
                }
                if(this.type=='info'||this.type=='else'){
                    this.info(id);
                }else{
                    //查询最大值 start
                    this.$http({
                        url: `dictionary/maxCodeIndex`,
                        method: "post",
                        data: {"dicCode":"tushu_collection_types"}
                    }).then(({ data }) => {
                        if (data && data.code === 0) {
                            this.ruleForm.codeIndex = data.maxCodeIndex;
                        } else {
                            this.$message.error(data.msg);
                        }
                    });
                    //查询最大值 end
                }
            },
            // 多级联动参数
            info(id) {
                this.$http({
                    url: `dictionary/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() {
                if((!this.ruleForm.indexName)){
                    this.$message.error('收藏表类型不能为空');
                    return
                }
                this.$refs["ruleForm"].validate(valid => {
                    if (valid) {
                        let ruleForm = this.ruleForm;
                        ruleForm["dicCode"]="tushu_collection_types";
                        ruleForm["dicName"]="收藏表类型";
                        this.$http({
                            url: `dictionary/${!this.ruleForm.id ? "save" : "update"}`,
                            method: "post",
                            data: 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.dictionaryCrossAddOrUpdateFlag = false;
                                        this.parent.search();
                                        this.parent.contentStyleChange();

                                    }
                                });
                            } else {
                                this.$message.error(data.msg);
                            }
                        });
                    }
                });
            },
            // 返回
            back() {
                this.parent.showFlag = true;
                this.parent.addOrUpdateFlag = false;
                this.parent.dictionaryCrossAddOrUpdateFlag = false;
                this.parent.contentStyleChange();
            },
            addEditStyleChange() {
                this.$nextTick(()=>{
                    // input
                    document.querySelectorAll('.addEdit-block .input .el-input__inner').forEach(el=>{
                    el.style.height = this.addEditForm.inputHeight
                el.style.color = this.addEditForm.inputFontColor
                el.style.fontSize = this.addEditForm.inputFontSize
                el.style.borderWidth = this.addEditForm.inputBorderWidth
                el.style.borderStyle = this.addEditForm.inputBorderStyle
                el.style.borderColor = this.addEditForm.inputBorderColor
                el.style.borderRadius = this.addEditForm.inputBorderRadius
                el.style.backgroundColor = this.addEditForm.inputBgColor
            })
                document.querySelectorAll('.addEdit-block .input .el-form-item__label').forEach(el=>{
                    el.style.lineHeight = this.addEditForm.inputHeight
                el.style.color = this.addEditForm.inputLableColor
                el.style.fontSize = this.addEditForm.inputLableFontSize
            })
                // select
                document.querySelectorAll('.addEdit-block .select .el-input__inner').forEach(el=>{
                    el.style.height = this.addEditForm.selectHeight
                el.style.color = this.addEditForm.selectFontColor
                el.style.fontSize = this.addEditForm.selectFontSize
                el.style.borderWidth = this.addEditForm.selectBorderWidth
                el.style.borderStyle = this.addEditForm.selectBorderStyle
                el.style.borderColor = this.addEditForm.selectBorderColor
                el.style.borderRadius = this.addEditForm.selectBorderRadius
                el.style.backgroundColor = this.addEditForm.selectBgColor
            })
                document.querySelectorAll('.addEdit-block .select .el-form-item__label').forEach(el=>{
                    el.style.lineHeight = this.addEditForm.selectHeight
                el.style.color = this.addEditForm.selectLableColor
                el.style.fontSize = this.addEditForm.selectLableFontSize
            })
                document.querySelectorAll('.addEdit-block .select .el-select__caret').forEach(el=>{
                    el.style.color = this.addEditForm.selectIconFontColor
                el.style.fontSize = this.addEditForm.selectIconFontSize
            })
                // date
                document.querySelectorAll('.addEdit-block .date .el-input__inner').forEach(el=>{
                    el.style.height = this.addEditForm.dateHeight
                el.style.color = this.addEditForm.dateFontColor
                el.style.fontSize = this.addEditForm.dateFontSize
                el.style.borderWidth = this.addEditForm.dateBorderWidth
                el.style.borderStyle = this.addEditForm.dateBorderStyle
                el.style.borderColor = this.addEditForm.dateBorderColor
                el.style.borderRadius = this.addEditForm.dateBorderRadius
                el.style.backgroundColor = this.addEditForm.dateBgColor
            })
                document.querySelectorAll('.addEdit-block .date .el-form-item__label').forEach(el=>{
                    el.style.lineHeight = this.addEditForm.dateHeight
                el.style.color = this.addEditForm.dateLableColor
                el.style.fontSize = this.addEditForm.dateLableFontSize
            })
                document.querySelectorAll('.addEdit-block .date .el-input__icon').forEach(el=>{
                    el.style.color = this.addEditForm.dateIconFontColor
                el.style.fontSize = this.addEditForm.dateIconFontSize
                el.style.lineHeight = this.addEditForm.dateHeight
            })
                // upload
                let 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.uploadHeight
                el.style.height = this.addEditForm.uploadHeight
                el.style.borderWidth = this.addEditForm.uploadBorderWidth
                el.style.borderStyle = this.addEditForm.uploadBorderStyle
                el.style.borderColor = this.addEditForm.uploadBorderColor
                el.style.borderRadius = this.addEditForm.uploadBorderRadius
                el.style.backgroundColor = this.addEditForm.uploadBgColor
            })
                document.querySelectorAll('.addEdit-block .upload .el-form-item__label').forEach(el=>{
                    el.style.lineHeight = this.addEditForm.uploadHeight
                el.style.color = this.addEditForm.uploadLableColor
                el.style.fontSize = this.addEditForm.uploadLableFontSize
            })
                document.querySelectorAll('.addEdit-block .upload .el-icon-plus').forEach(el=>{
                    el.style.color = this.addEditForm.uploadIconFontColor
                el.style.fontSize = this.addEditForm.uploadIconFontSize
                el.style.lineHeight = iconLineHeight
                el.style.display = 'block'
            })
                // 多文本输入框
                document.querySelectorAll('.addEdit-block .textarea .el-textarea__inner').forEach(el=>{
                    el.style.height = this.addEditForm.textareaHeight
                el.style.color = this.addEditForm.textareaFontColor
                el.style.fontSize = this.addEditForm.textareaFontSize
                el.style.borderWidth = this.addEditForm.textareaBorderWidth
                el.style.borderStyle = this.addEditForm.textareaBorderStyle
                el.style.borderColor = this.addEditForm.textareaBorderColor
                el.style.borderRadius = this.addEditForm.textareaBorderRadius
                el.style.backgroundColor = this.addEditForm.textareaBgColor
            })
                document.querySelectorAll('.addEdit-block .textarea .el-form-item__label').forEach(el=>{
                    // el.style.lineHeight = this.addEditForm.textareaHeight
                    el.style.color = this.addEditForm.textareaLableColor
                el.style.fontSize = this.addEditForm.textareaLableFontSize
            })
                // 保存
                document.querySelectorAll('.addEdit-block .btn .btn-success').forEach(el=>{
                    el.style.width = this.addEditForm.btnSaveWidth
                el.style.height = this.addEditForm.btnSaveHeight
                el.style.color = this.addEditForm.btnSaveFontColor
                el.style.fontSize = this.addEditForm.btnSaveFontSize
                el.style.borderWidth = this.addEditForm.btnSaveBorderWidth
                el.style.borderStyle = this.addEditForm.btnSaveBorderStyle
                el.style.borderColor = this.addEditForm.btnSaveBorderColor
                el.style.borderRadius = this.addEditForm.btnSaveBorderRadius
                el.style.backgroundColor = this.addEditForm.btnSaveBgColor
            })
                // 返回
                document.querySelectorAll('.addEdit-block .btn .btn-close').forEach(el=>{
                    el.style.width = this.addEditForm.btnCancelWidth
                el.style.height = this.addEditForm.btnCancelHeight
                el.style.color = this.addEditForm.btnCancelFontColor
                el.style.fontSize = this.addEditForm.btnCancelFontSize
                el.style.borderWidth = this.addEditForm.btnCancelBorderWidth
                el.style.borderStyle = this.addEditForm.btnCancelBorderStyle
                el.style.borderColor = this.addEditForm.btnCancelBorderColor
                el.style.borderRadius = this.addEditForm.btnCancelBorderRadius
                el.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.uploadHeight
                el.style.height = this.addEditForm.uploadHeight
                el.style.borderWidth = this.addEditForm.uploadBorderWidth
                el.style.borderStyle = this.addEditForm.uploadBorderStyle
                el.style.borderColor = this.addEditForm.uploadBorderColor
                el.style.borderRadius = this.addEditForm.uploadBorderRadius
                el.style.backgroundColor = this.addEditForm.uploadBgColor
            })
            })
            },
        }
    };
</script>
<style lang="scss">
.editor{
	  height: 500px;

	  & /deep/ .ql-container {
		  height: 310px;
	  }
	}
	.amap-wrapper {
	  width: 100%;.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;
		background-color: transparent;
	}
	.btn .el-button {
	  padding: 0;
	}
}</style>

声明

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2055387.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

(十四)SpringCloudAlibaba-Nacos集群

前言 Nacos集群官方部署说明集群部署说明https://nacos.io/docs/latest/guide/admin/cluster-mode-quick-start/ 1.官方Nacos集群图 2.集群计划 因为本次的重点在于搭建Nacos集群&#xff0c;为了方便本次数据库我们使用单节点; 3.资源规划 节点IPPortnacos_8845127.0.0.18…

Java语聊大厅个人厅陪玩厅陪玩系统小程序源码

&#x1f389;【探索语聊新纪元】&#x1f389; —— 语聊大厅&#xff1a;你的专属社交乐园 &#x1f31f;【初识语聊大厅&#xff0c;开启无限可能】&#x1f31f; 嘿宝贝们&#xff0c;今天我要带你们走进一个超燃的社交新天地——语聊大厅&#xff01;这可不是普通的聊天…

链表OJ题——删除链表中等于给定值 val 的所有节点

文章目录 一、题目链接二、解题思路三、解题代码 一、题目链接 删除链表中等于给定值 val 的所有节点 二、解题思路 三、解题代码

基于JavaWeb的本科生交流培养管理平台的设计与实现--论文pf

TOC springboot529基于JavaWeb的本科生交流培养管理平台的设计与实现--论文pf 第1章 绪论 1.1选题动因 当前的网络技术&#xff0c;软件技术等都具备成熟的理论基础&#xff0c;市场上也出现各种技术开发的软件&#xff0c;这些软件都被用于各个领域&#xff0c;包括生活和…

Linux搭建环境:从零开始掌握基础操作(二)

​ ​ 您好&#xff0c;我是程序员小羊&#xff01; 前言 软件测试第一步就是搭建测试环境&#xff0c;如何搭建好测试环境&#xff0c;需要具备两项的基础知识&#xff1a; 1、Linux 命令: 软件测试第一个任务, 一般都需要进行环境搭建, 一部分&#xff0c;环境搭建内容是在服…

力扣:加一

文章目录 需求分析结尾 需求 给定一个由 整数 组成的 非空 数组所表示的非负整数&#xff0c;在该数的基础上加一。 最高位数字存放在数组的首位&#xff0c; 数组中每个元素只存储单个数字。 你可以假设除了整数 0 之外&#xff0c;这个整数不会以零开头。 示例 1&#xff1a…

C盘空间满了有什么招吗?

最好的答案就是Dism 第一步&#xff1a;下载软件 第二步&#xff1a;打开&#xff0c;如下&#xff1a; 第三步&#xff1a; 如何选择&#xff1f;如果不懂&#xff0c;就选默认就行了。 但是临时文件&#xff0c;就比较简单了&#xff0c;直接删除。

【前端】VUE动态引入组件 通过字符串动态渲染模板 动态生成组件

【前端】VUE动态引入组件 通过字符串动态渲染模板 应用场景&#xff1a; js增强 动态代码 扩展一类的 可以配合低代码平台等 灵活配置在线表单 在线列表等 适合灵活性 扩展性比较强的组件 VUE2 <template><div><textarea v-model"templateString"…

深度学习--时间序列预测方法总结

时间序列预测是分析和预测一系列时间顺序数据的方法。不同的时间序列预测方法在应用中根据数据特征和目标有不同的适用性。以下是时间序列预测方法的详细总结&#xff0c;包括概念、原理和Python实现代码。 1. 简单平均法 (Simple Average Method) 概念与原理&#xff1a; 简…

QT网络编程: 实现UDP通讯设置

目录 一.widget.ui界面设计 二.创建UDP通信 1.pro文件添加network模块。 2.添加对应头文件 3.定义槽函数&#xff0c;即与 UI 中的按钮点击事件相关联的函数 4.定义类的私有成员 5.关闭按钮 6.信息处理 7.绑定端口 8.发送信息 9.效果图 三.代码演示 1.widget.h 2.…

鸿蒙公共事件和通知

创建一个鸿蒙应用项目&#xff0c;在Index页面中创建一个按钮&#xff0c;点击该按钮&#xff0c;可以创建一个公共事件订阅者&#xff0c;可以订阅自定义公共事件&#xff08;事件名称为&#xff1a;“ncwu.harmonytest.event1”&#xff09;&#xff1b;创建一个Toggle组件&a…

解决 kill -9 PID 无法杀死 python 进程的问题:杀死 defunct 进程

文章目录 1. 一定要用 Ctrl C 结束程序2. 如何杀死后台僵尸 (defunct) 进程2.1 查看 defunct 进程2.2 杀死 defunct 进程的父进程 1. 一定要用 Ctrl C 结束程序 CtrlZ 和 CtrlC 都可以中断程序&#xff0c;但他们却有很大的差异&#xff0c;主要体现在&#xff1a; CtrlC: …

FSR超分笔记

最近因为工作原因&#xff0c;接触到了超分以及AMD家出的FSR算法&#xff0c;特意记录了解一下~ 前言 超分辨率是通过硬件或软件方法提高原有图像分辨率的方法&#xff0c;通过一幅或者多幅低分辨率的图像来得到一幅高分辨率的图像。 FSR是AMD提出的一种超分辨率方法&#x…

力扣面试经典算法150题:轮转数组

轮转数组 今天的题目是力扣面试经典150题中的数组的基础难度题&#xff1a;轮转数组。 题目链接&#xff1a;https://leetcode.cn/problems/rotate-array/description/?envTypestudy-plan-v2&envIdtop-interview-150 问题描述 给定一个整型数组 nums 和一个整数 k&…

微服务实战系列之玩转Docker(十一)

前言 在云原生的世界&#xff0c;经过十多年的进化&#xff0c;Docker已经形成了较完备的“后勤”保障服务和建立了荣辱与共的“密友圈”。用一句话可以概括&#xff1a;“Docker走遍天下&#xff0c;Swarm功不可没”。 因此&#xff0c;我们需尽可能做到对Swarm有充分的认识…

Java面试篇(多线程相关专题)

文章目录 0. 前言1. 线程基础1.1 线程和进程1.1.1 进程1.1.2 线程1.1.3 进程和线程的区别 1.2 并行和并发1.2.1 单核 CPU 的情况1.2.2 多核 CPU 的情况1.2.3 并行和并发的区别 1.3 线程创建的方式1.3.1 继承 Thread 类&#xff0c;重写 run 方法1.3.2 实现 Runnable 接口&#…

工业一体机在工业自动化控制领域的关键性作用

随着工业自动化技术的不断发展和应用范围的不断扩大&#xff0c;工业一体机作为一种集成了多种功能的自动化控制设备&#xff0c;在工业自动化控制领域扮演着越来越重要的角色。 一、 集成性强&#xff0c;简化系统架构 传统工业自动化控制系统通常由多个独立的设备组成&…

php7.1编译安装

1.安装必要的工具&#xff1a; 首先确保您已经安装了 Xcode 和 Command Line Tools&#xff1a;xcode-select --install2.下载 PHP 7.1 源代码&#xff1a; 访问 PHP 官方网站下载 PHP 7.1 的源代码&#xff1a; wget https://www.php.net/distributions/php-7.1.33.tar.gz t…

基于Java企业项目管理系统--论文pf

TOC springboot527基于Java企业项目管理系统--论文pf 第1章 绪论 1.1 课题背景 二十一世纪互联网的出现&#xff0c;改变了几千年以来人们的生活&#xff0c;不仅仅是生活物资的丰富&#xff0c;还有精神层次的丰富。在互联网诞生之前&#xff0c;地域位置往往是人们思想上…

指针详解(五)

目录 1. 回调函数 2. qsort使用举例 1&#xff09;排序整型数据 2&#xff09;排序结构数据 3. qsort函数的模拟实现&#xff08;冒泡&#xff09; 1. 回调函数 回调函数就是一个通过函数指针调用的函数 函数的指针&#xff08;地址&#xff09;作为参数传递给另一个函数…