如何使用ssm实现服装品牌的推广及应用网站的设计与实现+vue

@TOC

ssm795服装品牌的推广及应用网站的设计与实现+vue

绪论

  1. 课题背景

身处网络时代,随着网络系统体系发展的不断成熟和完善,人们的生活也随之发生了很大的变化。目前,人们在追求较高物质生活的同时,也在想着如何使自身的精神内涵得到提升,而读书就是人们获得精神享受非常重要的途径[1]。纸质版的校园失物比较沉重,携带不方便,而由于手机、平板不仅能够储存大量的校园失物信息数据,而且重量轻,可随身携带,因此现在的人们更愿意通过手机、平板等来进行在线阅读[2]。由此,开发一款服装品牌的推广及应用网站非常符合人们阅读的需求。

过去人们看书需要到书店或者图书馆,而现在只要有网络,人们就可以通过手机、平板或电脑想什么时候看书就可以什么时候看,想看什么样的书就可以看什么样的书,非常的方便,并且人们把平时的闲碎时间全部利用起来进行阅读,使阅读效率大大提高,生活也变得丰富多彩起来。另外,通过服装品牌的推广及应用网站,想要阅读哪本书,搜索下就能够快速找到,并且还可以对校园失物进行归类、统计和规范管理。该服装品牌的推广及应用网站的界面非常清晰,使用简单,识字的人们都可以使用,并且它的功能齐全,能够满足各种各样的人的要求。

本文不仅从需求分析、设计分析、功能分析对该电子书在线系统进行了全面的分析,而且还从开发背景、开发环境、目标、流程、数据库、系统维护对该服装品牌的推广及应用网站进行了总体的规划和设计。该服装品牌的推广及应用网站利用vue技术和MYSQL数据库进行开发,具有很好的稳定性和可发展性。

  1. 研究现状

国外信息技术的发展步伐一直没有停止,源源不断的计算机应用软件被研发出来,并且软件技术也在不断迭代,目前世界各国的软件行业都已新兴了起来[3-5]。

与国外相比,我国信息技术的发展相对晚一些,不过后面,经过我们的不断追赶,我国的信息技术已经有了很大的进步,我国对现有的软件开发技术进行了细致的专研,目前我国已经能够独立的开发系统,并且也已经将这些软件系统应用于人们的生活中和各行各业中,目前,软件行业是我国非常受欢迎的行业[6-9]。

信息数字化使人们的各种信息能够快速传播,使人们的各种信息能够得到充分利用,同时,也大大宣传了信息数字化背后的软件系统[10-12]。软件开发团队的能力越来越强,开发技术功能越来越强大,软件系统大大提高了信息处理的效率,节省了处理者的处理时间。在阅读校园失物方面,人们阅读纸质版的校园失物,现在已经显得有些过时[13-14]。利用目前的软件开发技术开发出一款服装品牌的推广及应用网站能够大大的满足人们的阅读需求,人们通过该服装品牌的推广及应用网站能够快速查找、在线阅读自己喜欢的校园失物,并且也大大提高了人们阅读的效率。

  1. 研究内容

本论文主要阐述了该服装品牌的推广及应用网站的开发技术、系统需求分析、系统设计、系统功能实现和系统测试。为了开发该系统,我在下面花费了很多功夫和心思,例如,到图书馆阅读vue技术、MYSQL数据库等方面的编程校园失物,又在网上搜索了很多别人做的相类似的系统,将他们比较好的设计理念应用到自己的设计当中,最后才有了现在的成果。

本论文主要分为7部分,包括:

一、绪论:阐述了该系统的背景技术、研究现状和开发意义;

二、相关技术:介绍了开发该系统所用到的各种技术;

三、系统需求分析:阐述了开发该系统的可行性分析和功能需求分析;

四、系统设计:阐述了该系统的功能模块设计和数据库设计;

五、系统实现:展示了该系统的主要功能模块界面;

六、系统测试:对开发出的该系统进行测试;

七、系统总结:总结开发该系统的整个工作过程。

  1. 系统开发环境

    1. vue技术

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

Vue.js目前最火的的一个前端框架,三大主流前端框架之一。 Vue.js是一套构建用户界面的框架(一套完整的解决方案,对项目侵入性大,中途 需要跟换框架则需要重构整个项目),只关注视图层,易上手,有配套的第三方类库。提高开发效率,帮助减少不必要的dom操作;双向数据绑定,通过框架提供的指 令,前端只需要关注业务逻辑,不再关心dom如何渲染。

  1. JAVA技术

Java编程语言具有跨平台、分布式、可移植等多种特性,很多平台Java都能运行,世界各地都能够运行Java编写的程序。1995年,开发出了JAVA编程语言。JAVA编程语言具有多种特性,例如:简单、安全、可移植、鲁棒性(Robust)、编写能效高、线程多等。在互联网飞速发展的时代,Java编程语言应用也越来越普遍[19]。它的特点具有:

一、面向对象:JAVA适用于分布式环境,JAVA能够完全面向对象,包括对象的设计及联系;

二、分布式:JAVA工作的同时,带动其他计算节点工作,只要有网络,就可以访问其他对象;

三、健壮性:JAVA能够自动处理垃圾和异常,并且机制类型强;

四、安全性:当指针和内存被删除时,非法的内存就可以避免。

  1. MYSQL数据库

数据库在每个网站的开发中都是必不可少的,过去数据库只具有数据的保存和管理功能,但随着后来的不断更新和迭代,目前的数据库不仅能够进行数据的处理,而且还能够储存不计其数的数据[20]。

该服装品牌的推广及应用网站所使用的就是MYSQL数据库,当初是微软公司开发出的MYSQL数据库。MYSQL数据库总共建立了十几个相对应的表,它们之间独立联系,数据库和程序是密不可分的[21]。

MYSQL数据库的特点包括:能够应用于多种操作系统中;查询SQL时优化了算法,搜索速度提高的不少;还可以进行数据库的管理、控制、优化等操作;一个数据库可以记录不计其数的数据。

  1. B/S结构

当前比较流行的网络化结构模式是B/S(浏览器/服务器)结构,它能够在服务器上面集中系统的所有核心功能,使系统开发人员的工作变得简单,并且开发出的系统也更容易使用和后期维护。用于比较熟悉的浏览器有360浏览器、谷歌浏览器、QQ浏览器等,用于比较熟悉的数据库有sqlserver、mysql数据库等,上边这些数据库和浏览器都可以安装在客户端上。B/S结构没有什么限制,并且还不需要专门的安装软件,只要笔记本、电脑有网络就能够访问系统。采用B/S结构开发的程序,比较好维护,只需要在客户端就可处理,不需要非得在服务器上处理,并且跟用户的交互性比较好,刷新浏览器就可进行数据信息的实时更新[22]。B/S架构如图2-1所示:

图2-1 B/S模式架构图

  1. SSM框架技术

该服装品牌的推广及应用网站是基于Spring、SpringMVC、Mybatis框架开发出来的。

2004年,Spring 框架才第一次亮相,后面也进行了很多次的更新。Spring框架包括SpringCore、Spring AOP、Spring ORM、Spring DAO、Spring Web Flow、Spring Context和Spring Web MVC等七个模块,企业应用程序就是通过这七个模块气筒不同的平台来进行开发的,Spring Web MVC中的各个元素之间形成了松散耦合[23-25]。

  1. 系统分析

    1. 可行性分析

开发者在进行开发系统之前,都需要进行可行性分析,保证该系统能够被成功开发出来。

  1. 技术可行性

开发该服装品牌的推广及应用网站所采用的技术是vue和MYSQL数据库。计算机专业的学生在学校期间已经比较系统的学习了很多编程方面的知识,同时也接触了很多编程软件,所以在技术开发方面还是比较有信心的。

  1. 操作可行性

该服装品牌的推广及应用网站的界面简洁清楚,操作简单,用户一看就会操作。操作界面上每一步都有提示,用户只要按照提示进行操作就可以了。该服装品牌的推广及应用网站具有操作可行性。

  1. 经济可行性

我现在还是一名学生,还没有一份稳定的经济收入,所以我会将开发程序的成本控制在自己所能接受的范围内。我所使用的开发软件、数据库还有设计界面用的photoshop软件都是在网上免费下载的,另外程序编写阶段所用到的源代码也是在网上免费得到的,现在在网上能下载很多有用的、免费的东西,所以开发该系统基本不花钱,具有经济可行性。

  1. 法律可行性

我是通过图书馆、百度文库、百度网页等获得的开发该服装品牌的推广及应用网站所需要用到的资料和软件,都是采用的合法渠道,另外源代码和论文内容都是我自己一字一字写出来的,没有抄袭别人的,具有法律可行性。

通过上述的技术可行性、操作可行性、经济可行性以及法律可行性分析,可以看出,该服装品牌的推广及应用网站完全可以进行顺利开发。

  1. 系统性能分析

  2. 存储性:该服装品牌的推广及应用网站的数据库功能比较强大,能够录入很多纷繁复杂的信息,且能够保证数据的实时性;

二、易学性:该服装品牌的推广及应用网站使用起来非常简单,用户一看就会,不需要进行专门的培训,非常好上手,使用个一两次就能够熟练操作;

三、数据要求:录入的数据准确可靠,能够及时进行更新,可以独立保存,删除一些不需要的数据;

四、稳定性:该服装品牌的推广及应用网站能够稳定的运行,界面清晰明了;

五、可靠性:该服装品牌的推广及应用网站安装有拦截器,可以对病毒等进行拦截,并且还对信息进行了保护措施,用户可以放心使用。

  1. 系统功能分析

    1. 角色需求

该服装品牌的推广及应用网站主要为管理员和用户两类用户角色提供需求,管理员在后台可以对系统进行全面管理,用户在前台可以进行查看系统信息,注册登录,查询校园失物,评论,下载校园失物等操作。

用户静态结构如图3-1所示。

图3-1 用户静态结构图

  1. 系统流程分析

    1. 注册流程

用户注册之后才可以登录系统,用户注册流程如图3-2所示:

图3-2 注册流程图

  1. 登录流程

用户需要登录系统之后,才可以进行校园失物评论、校园失物下载等操作。而管理员也只有登录系统之后,可以对系统各个方面的内容进行管理,不受任何限制。用户登录流程如图3-3所示。

图3-3 登录流程图

  1. 系统设计

    1. 系统概要设计

本文通过B/S结构(Browser/Server,浏览器/服务器结构)开发的该服装品牌的推广及应用网站,B/S结构的优点很多,例如:开发容易、强的共享性、便于维护等,只要有网络,用户可以随时随地进行使用。

系统工作原理如图4-1所示。

图4-1 系统工作原理图

  1. 系统结构设计

系统结构设计就像一个树状结构一样,一个树干有很多分支,大任务相当于树干,小任务相当于树枝,只有需求分析信息弄清楚之后,才能保证每个小任务都能实现目标,对初步设计好的系统再进行不断优化,最终得到一个具体现实的系统结构。

管理员功能模块和用户功能模块是该服装品牌的推广及应用网站的两大部分,系统结构如图4-2所示。

服装品牌的推广及应用网站

用户信息管理

公告信息管理

商品类型管理

商品订单管理

商品信息管理

用户信息修改

用户信息新增

商品信息添加

商品信息删除

商品信息修改

商品订单添加

商品订单修改

商品订单删除

公告信息添加

公告信息删改

公告信息删除

商品类型添加

商品类型修改

商品类型删除

论坛信息管理

论坛信息修改

论坛信息删除

论坛信息添加

图4-2 系统结构图

4.3 数据库设计

开发一个系统也需要提前设计数据库。这里的数据库是相关数据的集合,存储在一起的这些数据也是按照一定的组织方式进行的。目前,数据库能够服务于多种应用程序,则是源于它存储方式最佳,具备数据冗余率低的优势。虽然数据库为程序提供信息存储服务,但它与程序之间也可以保持较高的独立性。总而言之,数据库经历了很长一段时间的发展,从最初的不为人知,到现在的人尽皆知,其相关技术也越发成熟,同时也拥有着坚实的理论基础。

4.3.1 数据库概念设计

这部分内容需要借助数据库关系图来完成,也需要使用专门绘制数据库关系图的工具,比如Visio工具就可以设计E-R图(数据库关系图)。设计数据库,也需要按照设计的流程进行,首先还是要根据需求完成实体的确定,分析实体具有的特征,还有对实体间的关联关系进行确定。最后才是使用E-R模型的表示方法,绘制本系统的E-R图。不管是使用亿图软件,还是Visio工具,对于E-R模型的表示符号都一样,通常矩形代表实体,实体间存在的关系用菱形符号表示,实体的属性也就是实体的特征用符号椭圆表示。最后使用直线将矩形,菱形和椭圆等符号连接起来。接下来就开始对本系统的E-R图进行绘制。

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

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\用户.jpg 图4.1 用户实体属性图

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

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\公告信息.jpg 图4.2 公告信息实体属性图

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

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\购物车.jpg 图4.3 购物车实体属性图

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

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\论坛.jpg 图4.4 论坛实体属性图

(5)下图是商品实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\商品.jpg 图4.5 商品实体属性图

(6)下图是单页数据实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\单页数据.jpg 图4.6 单页数据实体属性图

(7)下图是商品收藏实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\商品收藏.jpg 图4.7 商品收藏实体属性图

(8)下图是商品评价实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\商品评价.jpg 图4.8 商品评价实体属性图

(9)下图是商品订单实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\商品订单.jpg 图4.9 商品订单实体属性图

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

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\用户表.jpg 图4.10 用户表实体属性图

(11)下图是收货地址实体和其具备的属性。

C:\Users\Administrator\Desktop\img\fuzhuangpinpaituiguangjiyingyong\收货地址.jpg 图4.11 收货地址实体属性图

  1. 数据库表设计

采用MYSQL数据库对该服装品牌的推广及应用网站的数据进行存储,数据库中所包括的各个数据库表的详细信息如下所示:

表4.1收货地址表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 yonghu_id Integer 创建用户
3 address_name String 收货人
4 address_phone String 电话
5 address_dizhi String 地址
6 isdefault_types Integer 是否默认地址
7 insert_time Date 添加时间
8 update_time Date 修改时间
9 create_time Date 创建时间

表4.2购物车表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 yonghu_id Integer 所属用户
3 meizhuang_id Integer 商品
4 buy_number Integer 购买数量
5 create_time Date 添加时间
6 update_time Date 更新时间
7 insert_time Date 创建时间

表4.3字典表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 dic_code String 字段
3 dic_name String 字段名
4 code_index Integer 编码
5 index_name String 编码名字
6 super_id Integer 父字段id
7 beizhu String 备注
8 create_time Date 创建时间

表4.4论坛表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 forum_name String 帖子标题
3 yonghu_id Integer 用户
4 shangjia_id Integer 商家
5 users_id Integer 管理员
6 forum_content String 发布内容
7 super_ids Integer 父id
8 forum_state_types Integer 帖子状态
9 insert_time Date 发帖时间
10 update_time Date 修改时间
11 create_time Date 创建时间

表4.5商品表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 meizhuang_uuid_number String 商品编号
3 meizhuang_name String 商品名称
4 meizhuang_photo String 商品照片
5 meizhuang_types Integer 商品类型
6 meizhuang_erji_types Integer 商品二级类型
7 meizhuang_status_types Integer 商品状态
8 meizhuang_price Integer 购买获得积分
9 meizhuang_kucun_number Integer 商品库存
10 meizhuang_old_money BigDecimal 商品原价
11 meizhuang_new_money BigDecimal 现价
12 meizhuang_clicknum Integer 点击次数
13 meizhuang_content String 商品介绍
14 shangxia_types Integer 是否上架
15 meizhuang_delete Integer 逻辑删除
16 create_time Date 创建时间

表4.6商品收藏表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 meizhuang_id Integer 商品
3 yonghu_id Integer 用户
4 meizhuang_collection_types Integer 类型
5 insert_time Date 收藏时间
6 create_time Date 创建时间

表4.7商品评价表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 meizhuang_id Integer 商品
3 yonghu_id Integer 用户
4 meizhuang_commentback_text String 评价内容
5 insert_time Date 评价时间
6 reply_text String 回复内容
7 update_time Date 回复时间
8 create_time Date 创建时间

表4.8商品订单表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 meizhuang_order_uuid_number String 订单号
3 address_id Integer 收货地址
4 meizhuang_id Integer 商品
5 yonghu_id Integer 用户
6 buy_number Integer 购买数量
7 meizhuang_order_true_price BigDecimal 实付价格
8 meizhuang_order_courier_name String 快递公司
9 meizhuang_order_courier_number String 订单快递单号
10 meizhuang_order_types Integer 订单类型
11 meizhuang_order_payment_types Integer 支付类型
12 insert_time Date 订单创建时间
13 create_time Date 创建时间

表4.9公告信息表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 news_name String 公告标题
3 news_types Integer 公告类型
4 news_photo String 公告图片
5 insert_time Date 添加时间
6 news_content String 公告详情
7 create_time Date 创建时间

表4.10单页数据表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 single_seach_name String 名字
3 single_seach_types Integer 数据类型
4 single_seach_content String 内容
5 create_time Date 创建时间

表4.11用户表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 yonghu_name String 用户姓名
3 yonghu_phone String 用户手机号
4 yonghu_id_number String 用户身份证号
5 yonghu_photo String 用户头像
6 yonghu_email String 电子邮箱
7 new_money BigDecimal 余额
8 yonghu_sum_jifen BigDecimal 总积分
9 yonghu_new_jifen BigDecimal 现积分
10 huiyuandengji_types Integer 会员等级
11 create_time Date 创建时间

表4.12用户表表

序号 列名 数据类型 说明 允许空
1 Id Int id
2 username String 用户名
3 password String 密码
4 role String 角色
5 addtime Date 新增时间
  1. 系统的实现

    1. 功能模块的实现

5.1用户信息管理

如图5.1显示的就是用户信息管理页面,此页面提供给管理员的功能有:用户信息的查询管理,可以删除用户信息、修改用户信息、新增用户信息,

还进行了对用户名称的模糊查询的条件

图5.1 用户信息管理页面

5.2 商品信息管理

如图5.2显示的就是商品信息管理页面,此页面提供给管理员的功能有:查看已发布的商品信息数据,修改商品信息,商品信息作废,即可删除,还进行了对商品信息名称的模糊查询 商品信息信息的类型查询等等一些条件。

图5.2 商品信息管理页面

5.3商品类型管理

如图5.3显示的就是商品类型管理页面,此页面提供给管理员的功能有:根据商品类型进行条件查询,还可以对商品类型进行新增、修改、查询操作等等。

图5.3 商品类型管理页面

5.1公告信息管理

如图5.4显示的就是公告信息管理页面,此页面提供给管理员的功能有:根据公告信息进行新增、修改、查询操作等等。

图5.4 公告信息管理页面

UsersServiceImpl.java

package com.service.impl;


import java.util.List;
import java.util.Map;

import com.service.UsersService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.dao.UsersDao;
import com.entity.UsersEntity;
import com.utils.PageUtils;
import com.utils.Query;


/**
 * 系统用户
 * @author
 */
@Service("userService")
public class UsersServiceImpl extends ServiceImpl<UsersDao, UsersEntity> implements UsersService {

	@Override
	public PageUtils queryPage(Map<String, Object> params) {
		Page<UsersEntity> page = this.selectPage(
                new Query<UsersEntity>(params).getPage(),
                new EntityWrapper<UsersEntity>()
        );
        return new PageUtils(page);
	}

	@Override
	public List<UsersEntity> selectListView(Wrapper<UsersEntity> wrapper) {
		return baseMapper.selectListView(wrapper);
	}

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

CommonServiceImpl.java

package com.service.impl;


import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dao.CommonDao;
import com.service.CommonService;


/**
 * 系统用户
 * @author
 * @date
 */
@Service("commonService")
public class CommonServiceImpl implements CommonService {
	
	@Autowired
	private CommonDao commonDao;

	@Override
	public List<String> getOption(Map<String, Object> params) {
		return commonDao.getOption(params);
	}
	
	@Override
	public Map<String, Object> getFollowByOption(Map<String, Object> params) {
		return commonDao.getFollowByOption(params);
	}


	/**
	 tableName 查询表
	 condition1 条件1
	 condition1Value 条件1值
	 average 计算平均评分
	 * */
	public Map<String, Object> queryScore(Map<String, Object> params){
		return commonDao.queryScore(params);
	}
	
	@Override
	public void sh(Map<String, Object> params) {
		commonDao.sh(params); 
	}

	@Override
	public int remindCount(Map<String, Object> params) {
		return commonDao.remindCount(params);
	}

	@Override
	public Map<String, Object> selectCal(Map<String, Object> params) {
		return commonDao.selectCal(params);
	}
	
	@Override
	public List<Map<String, Object>> selectGroup(Map<String, Object> params) {
		return commonDao.selectGroup(params);
	}
	
	@Override
	public List<Map<String, Object>> selectValue(Map<String, Object> params) {
		return commonDao.selectValue(params);
	}

	@Override
	public List<Map<String, Object>> chartBoth(Map<String, Object> params) {
		return commonDao.chartBoth(params);
	}

	@Override
	public List<Map<String, Object>> chartOne(Map<String, Object> params) {
		return commonDao.chartOne(params);
	}


	/**
	 * 新的级联字典表的  分组求和统计
	 * @param params
	 * @return
	 */
	@Override
	public List<Map<String, Object>> newSelectGroupSum(Map<String, Object> params) {
		return commonDao.newSelectGroupSum(params);
	}


	/**
	 * 新的级联字典表的  分组条数统计
	 * @param params
	 * @return
	 */
	@Override
	public List<Map<String, Object>> newSelectGroupCount(Map<String, Object> params) {
		return commonDao.newSelectGroupCount(params);
	}

	/**
	 * 当前表的日期分组求和
	 * @param params
	 * @return
	 */
	@Override
	public List<Map<String, Object>> newSelectDateGroupSum(Map<String, Object> params) {
		return commonDao.newSelectDateGroupSum(params);
	}


	/**
	 * 查询字典表的分组统计总条数
	 * @param params
	 * @return
	 */
	@Override
	public List<Map<String, Object>> newSelectDateGroupCount(Map<String, Object> params) {
		return commonDao.newSelectDateGroupCount(params);
	}

	@Override
	public int plusCloumNumber(Map<String, Object> params) {
		return commonDao.plusCloumNumber(params);
	}
	@Override
	public int reduceCloumNumber(Map<String, Object> params) {
		return commonDao.reduceCloumNumber(params);
	}
	@Override
	public int updateCloumValue(Map<String, Object> params) {
		return commonDao.updateCloumValue(params);
	}

/**
 * 饼状图
 * -- 饼状图  查询当前表
 -- 				查询字典表【月】
 -- 				 统计   -- 查询某个月的每个类型的订单销售数量
 -- 				 求和   -- 查询某个月的每个类型的订单销售额
 -- 				查询某个字符串【月】
 -- 				 统计   -- 查询某个月的每个员工的订单销售数量
 -- 				 求和   -- 查询某个月的每个员工的订单销售额
 -- 				查询时间【年】
 -- 				 统计 	-- 查询每个月的订单销售数量
 -- 				 求和 	-- 查询每个月的订单销售额
 -- 饼状图  查询级联表
 -- 				查询字典表
 -- 				 统计  	-- 查询某个月的每个类型的订单销售数量
 -- 				 求和   -- 查询某个月的每个类型的订单销售额
 -- 				查询某个字符串
 -- 				 统计   -- 查询某个月的每个员工的订单销售数量
 -- 				 求和   -- 查询某个月的每个员工的订单销售额
 -- 				查询时间
 -- 				 统计 	-- 统计每个月的订单销售数量
 -- 				 求和 	-- 查询每个月的订单销售额
 */


/**
 * 柱状图
 -- 柱状图  查询当前表
 --             某个【年,月】
 -- 			 当前表 2 级联表 1
 -- 						统计
 --   						【日期,字符串,下拉框】
 -- 						求和
 --   						【日期,字符串,下拉框】
 -- 柱状图  查询级联表
 -- 					某个【年,月】
 -- 						统计
 --   						【日期,字符串,下拉框】
 -- 						求和
 --   						【日期,字符串,下拉框】
 */
	/**
	 * 柱状图求和
	 * @param params
	 * @return
	 */
	public List<Map<String, Object>> barSum(Map<String, Object> params){
		return commonDao.barSum(params);
	}

	/**
	 * 柱状图统计
	 * @param params
	 * @return
	 */
	public List<Map<String, Object>> barCount(Map<String, Object> params){
		return commonDao.barCount(params);
	}

}

NewsController.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("/news")
public class NewsController {
    private static final Logger logger = LoggerFactory.getLogger(NewsController.class);

    @Autowired
    private NewsService newsService;


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

    //级联表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"));
        if(params.get("orderBy")==null || params.get("orderBy")==""){
            params.put("orderBy","id");
        }
        PageUtils page = newsService.queryPage(params);

        //字典表数据转换
        List<NewsView> list =(List<NewsView>)page.getList();
        for(NewsView 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);
        NewsEntity news = newsService.selectById(id);
        if(news !=null){
            //entity转view
            NewsView view = new NewsView();
            BeanUtils.copyProperties( news , view );//把实体数据重构到view中

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

    }

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

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

        Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
            .eq("news_name", news.getNewsName())
            .eq("news_types", news.getNewsTypes())
            ;

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

    /**
    * 后端修改
    */
    @RequestMapping("/update")
    public R update(@RequestBody NewsEntity news, HttpServletRequest request){
        logger.debug("update方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());

        String role = String.valueOf(request.getSession().getAttribute("role"));
//        if(false)
//            return R.error(511,"永远不会进入");
        //根据字段查询是否有相同数据
        Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
            .notIn("id",news.getId())
            .andNew()
            .eq("news_name", news.getNewsName())
            .eq("news_types", news.getNewsTypes())
            ;

        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        NewsEntity newsEntity = newsService.selectOne(queryWrapper);
        if("".equals(news.getNewsPhoto()) || "null".equals(news.getNewsPhoto())){
                news.setNewsPhoto(null);
        }
        if(newsEntity==null){
            newsService.updateById(news);//根据id更新
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }



    /**
    * 删除
    */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
        logger.debug("delete:,,Controller:{},,ids:{}",this.getClass().getName(),ids.toString());
        newsService.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<NewsEntity> newsList = 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("../../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){
                            //循环
                            NewsEntity newsEntity = new NewsEntity();
//                            newsEntity.setNewsName(data.get(0));                    //公告标题 要改的
//                            newsEntity.setNewsTypes(Integer.valueOf(data.get(0)));   //公告类型 要改的
//                            newsEntity.setNewsPhoto("");//详情和图片
//                            newsEntity.setInsertTime(date);//时间
//                            newsEntity.setNewsContent("");//详情和图片
//                            newsEntity.setCreateTime(date);//时间
                            newsList.add(newsEntity);


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

                        //查询是否重复
                        newsService.insertBatch(newsList);
                        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));

        // 没有指定排序字段就默认id倒序
        if(StringUtil.isEmpty(String.valueOf(params.get("orderBy")))){
            params.put("orderBy","id");
        }
        PageUtils page = newsService.queryPage(params);

        //字典表数据转换
        List<NewsView> list =(List<NewsView>)page.getList();
        for(NewsView 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);
        NewsEntity news = newsService.selectById(id);
            if(news !=null){


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

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


    /**
    * 前端保存
    */
    @RequestMapping("/add")
    public R add(@RequestBody NewsEntity news, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,news:{}",this.getClass().getName(),news.toString());
        Wrapper<NewsEntity> queryWrapper = new EntityWrapper<NewsEntity>()
            .eq("news_name", news.getNewsName())
            .eq("news_types", news.getNewsTypes())
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        NewsEntity newsEntity = newsService.selectOne(queryWrapper);
        if(newsEntity==null){
            news.setInsertTime(new Date());
            news.setCreateTime(new Date());
        newsService.insert(news);
            return R.ok();
        }else {
            return R.error(511,"表中有相同数据");
        }
    }


}

list.vue
<template>
    <div class="main-content">
        <!-- 列表页 -->
        <div v-if="showFlag">
            <el-form :inline="true" :model="searchForm" class="form-content">
                <el-row :gutter="20" class="slt" :style="{justifyContent:contents.searchBoxPosition=='1'?'flex-start':contents.searchBoxPosition=='2'?'center':'flex-end'}">
                    <el-form-item label="帖子状态">
                        <el-input prefix-icon="el-icon-search" v-model="searchForm.indexNameSearch" placeholder="帖子状态" clearable></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button icon="el-icon-search" type="success" @click="search()">查询</el-button>
                    </el-form-item>
                </el-row>
                <el-row class="ad" :style="{justifyContent:contents.btnAdAllBoxPosition=='1'?'flex-start':contents.btnAdAllBoxPosition=='2'?'center':'flex-end'}">
                    <el-form-item>
                        <el-button
                                v-if="isAuth('dictionaryForumState','新增')"
                                type="success"
                                icon="el-icon-plus"
                                @click="addOrUpdateHandler()"
                        >新增</el-button>
                        <el-button
                                v-if="isAuth('dictionaryForumState','删除')"
                                :disabled="dataListSelections.length <= 0"
                                type="danger"
                                icon="el-icon-delete"
                                @click="deleteHandler()"
                        >删除</el-button>
                    </el-form-item>
                </el-row>
            </el-form>
            <div class="table-content">
                <el-table class="tables" :size="contents.tableSize" :show-header="contents.tableShowHeader"
                          :header-row-style="headerRowStyle" :header-cell-style="headerCellStyle"
                          :border="contents.tableBorder"
                          :fit="contents.tableFit"
                          :stripe="contents.tableStripe"
                          :row-style="rowStyle"
                          :cell-style="cellStyle"
                          :style="{width: '100%',fontSize:contents.tableContentFontSize,color:contents.tableContentFontColor}"
                          v-if="isAuth('dictionaryForumState','查看')"
                          :data="dataList"
                          v-loading="dataListLoading"
                          @selection-change="selectionChangeHandler">
                    <el-table-column  v-if="contents.tableSelection"
                                      type="selection"
                                      header-align="center"
                                      align="center"
                                      width="50">
                    </el-table-column>
                    <el-table-column label="索引" v-if="contents.tableIndex" type="index" width="50" />
                    <el-table-column  :sortable="contents.tableSortable" :align="contents.tableAlign"
                                      prop="codeIndex"
                                      header-align="center"
                                      label="帖子状态编码">
                        <template slot-scope="scope">
                            {
   
   {scope.row.codeIndex}}
                        </template>
                    </el-table-column>
                    <el-table-column  :sortable="contents.tableSortable" :align="contents.tableAlign"
                                      prop="indexName"
                                      header-align="center"
                                      label="帖子状态名称">
                        <template slot-scope="scope">
                            {
   
   {scope.row.indexName}}
                        </template>
                    </el-table-column>
                    <!--<el-table-column  :sortable="contents.tableSortable" :align="contents.tableAlign"
                                      prop="beizhu"
                                      header-align="center"
                                      label="备注">
                        <template slot-scope="scope">
                            {
   
   {scope.row.beizhu}}
                        </template>
                    </el-table-column>-->
                    <el-table-column width="300" :align="contents.tableAlign"
                                     header-align="center"
                                     label="操作">
                        <template slot-scope="scope">
                            <el-button v-if="isAuth('dictionaryForumState','查看')" type="success" icon="el-icon-tickets" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">详情</el-button>
                            <el-button v-if="isAuth('dictionaryForumState','修改')" type="primary" icon="el-icon-edit" size="mini" @click="addOrUpdateHandler(scope.row.id)">修改</el-button>
                            <el-button v-if="isAuth('dictionaryForumState','删除')" type="danger" icon="el-icon-delete" size="mini" @click="deleteHandler(scope.row.id)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination
                        clsss="pages"
                        :layout="layouts"
                        @size-change="sizeChangeHandle"
                        @current-change="currentChangeHandle"
                        :current-page="pageIndex"
                        :page-sizes="[10, 20, 50, 100]"
                        :page-size="Number(contents.pageEachNum)"
                        :total="totalPage"
                        :small="contents.pageStyle"
                        class="pagination-content"
                        :background="contents.pageBtnBG"
                        :style="{textAlign:contents.pagePosition==1?'left':contents.pagePosition==2?'center':'right'}"
                ></el-pagination>
            </div>
        </div>
        <!-- 添加/修改页面  将父组件的search方法传递给子组件-->
        <add-or-update v-if="addOrUpdateFlag" :parent="this" ref="addOrUpdate"></add-or-update>



    </div>
</template>
<script>
    import AddOrUpdate from "./add-or-update";
    import styleJs from "../../../utils/style.js";
    export default {
        data() {
            return {
                searchForm: {
                    key: ""
                },
                form:{},
                dataList: [],
                pageIndex: 1,
                pageSize: 10,
                totalPage: 0,
                dataListLoading: false,
                dataListSelections: [],
                showFlag: true,
                sfshVisiable: false,
                shForm: {},
                chartVisiable: false,
                addOrUpdateFlag:false,
                contents:null,
                layouts: '',



            };
        },
        created() {
            this.contents = styleJs.listStyle();
            this.init();
            this.getDataList();
            this.contentStyleChange()
        },
        mounted() {

        },
        filters: {
            htmlfilter: function (val) {
                return val.replace(/<[^>]*>/g).replace(/undefined/g,'');
            }
        },
        components: {
            AddOrUpdate,
        },
        methods: {
            contentStyleChange() {
                this.contentSearchStyleChange()
                this.contentBtnAdAllStyleChange()
                this.contentSearchBtnStyleChange()
                this.contentTableBtnStyleChange()
                this.contentPageStyleChange()
            },
            contentSearchStyleChange() {
                this.$nextTick(()=>{
                    document.querySelectorAll('.form-content .slt .el-input__inner').forEach(el=>{
                    let textAlign = 'left'
                    if(this.contents.inputFontPosition == 2) textAlign = 'center'
                if(this.contents.inputFontPosition == 3) textAlign = 'right'
                el.style.textAlign = textAlign
                el.style.height = this.contents.inputHeight
                el.style.lineHeight = this.contents.inputHeight
                el.style.color = this.contents.inputFontColor
                el.style.fontSize = this.contents.inputFontSize
                el.style.borderWidth = this.contents.inputBorderWidth
                el.style.borderStyle = this.contents.inputBorderStyle
                el.style.borderColor = this.contents.inputBorderColor
                el.style.borderRadius = this.contents.inputBorderRadius
                el.style.backgroundColor = this.contents.inputBgColor
            })
                if(this.contents.inputTitle) {
                    document.querySelectorAll('.form-content .slt .el-form-item__label').forEach(el=>{
                        el.style.color = this.contents.inputTitleColor
                    el.style.fontSize = this.contents.inputTitleSize
                    el.style.lineHeight = this.contents.inputHeight
                })
                }
                setTimeout(()=>{
                    document.querySelectorAll('.form-content .slt .el-input__prefix').forEach(el=>{
                    el.style.color = this.contents.inputIconColor
                el.style.lineHeight = this.contents.inputHeight
            })
                document.querySelectorAll('.form-content .slt .el-input__suffix').forEach(el=>{
                    el.style.color = this.contents.inputIconColor
                el.style.lineHeight = this.contents.inputHeight
            })
                document.querySelectorAll('.form-content .slt .el-input__icon').forEach(el=>{
                    el.style.lineHeight = this.contents.inputHeight
            })
            },10)

            })
            },
            // 搜索按钮
            contentSearchBtnStyleChange() {
                this.$nextTick(()=>{
                    document.querySelectorAll('.form-content .slt .el-button--success').forEach(el=>{
                    el.style.height = this.contents.searchBtnHeight
                el.style.color = this.contents.searchBtnFontColor
                el.style.fontSize = this.contents.searchBtnFontSize
                el.style.borderWidth = this.contents.searchBtnBorderWidth
                el.style.borderStyle = this.contents.searchBtnBorderStyle
                el.style.borderColor = this.contents.searchBtnBorderColor
                el.style.borderRadius = this.contents.searchBtnBorderRadius
                el.style.backgroundColor = this.contents.searchBtnBgColor
            })
            })
            },
            // 新增、批量删除
            contentBtnAdAllStyleChange() {
                this.$nextTick(()=>{
                    document.querySelectorAll('.form-content .ad .el-button--success').forEach(el=>{
                    el.style.height = this.contents.btnAdAllHeight
                el.style.color = this.contents.btnAdAllAddFontColor
                el.style.fontSize = this.contents.btnAdAllFontSize
                el.style.borderWidth = this.contents.btnAdAllBorderWidth
                el.style.borderStyle = this.contents.btnAdAllBorderStyle
                el.style.borderColor = this.contents.btnAdAllBorderColor
                el.style.borderRadius = this.contents.btnAdAllBorderRadius
                el.style.backgroundColor = this.contents.btnAdAllAddBgColor
            })
                document.querySelectorAll('.form-content .ad .el-button--danger').forEach(el=>{
                    el.style.height = this.contents.btnAdAllHeight
                el.style.color = this.contents.btnAdAllDelFontColor
                el.style.fontSize = this.contents.btnAdAllFontSize
                el.style.borderWidth = this.contents.btnAdAllBorderWidth
                el.style.borderStyle = this.contents.btnAdAllBorderStyle
                el.style.borderColor = this.contents.btnAdAllBorderColor
                el.style.borderRadius = this.contents.btnAdAllBorderRadius
                el.style.backgroundColor = this.contents.btnAdAllDelBgColor
            })
                document.querySelectorAll('.form-content .ad .el-button--warning').forEach(el=>{
                    el.style.height = this.contents.btnAdAllHeight
                el.style.color = this.contents.btnAdAllWarnFontColor
                el.style.fontSize = this.contents.btnAdAllFontSize
                el.style.borderWidth = this.contents.btnAdAllBorderWidth
                el.style.borderStyle = this.contents.btnAdAllBorderStyle
                el.style.borderColor = this.contents.btnAdAllBorderColor
                el.style.borderRadius = this.contents.btnAdAllBorderRadius
                el.style.backgroundColor = this.contents.btnAdAllWarnBgColor
            })
            })
            },
            // 表格
            rowStyle({ row, rowIndex}) {
                if (rowIndex % 2 == 1) {
                    if(this.contents.tableStripe) {
                        return {color:this.contents.tableStripeFontColor}
                    }
                } else {
                    return ''
                }
            },
            cellStyle({ row, rowIndex}){
                if (rowIndex % 2 == 1) {
                    if(this.contents.tableStripe) {
                        return {backgroundColor:this.contents.tableStripeBgColor}
                    }
                } else {
                    return ''
                }
            },
            headerRowStyle({ row, rowIndex}){
                return {color: this.contents.tableHeaderFontColor}
            },
            headerCellStyle({ row, rowIndex}){
                return {backgroundColor: this.contents.tableHeaderBgColor}
            },
            // 表格按钮
            contentTableBtnStyleChange(){
            },
            // 分页
            contentPageStyleChange(){
                let arr = []
                if(this.contents.pageTotal) arr.push('total')
                if(this.contents.pageSizes) arr.push('sizes')
                if(this.contents.pagePrevNext){
                    arr.push('prev')
                    if(this.contents.pagePager) arr.push('pager')
                    arr.push('next')
                }
                if(this.contents.pageJumper) arr.push('jumper')
                this.layouts = arr.join()
                this.contents.pageEachNum = 10
            },

            init () {
            },
            search() {
                this.pageIndex = 1;
                this.getDataList();
            },
            // 获取数据列表
            getDataList() {
                this.dataListLoading = true;
                let params = {
                    page: this.pageIndex,
                    limit: this.pageSize,
                    sort: 'id',
                }
                if(this.searchForm.indexNameSearch!='' && this.searchForm.indexNameSearch!=undefined){
                    params['indexName'] = this.searchForm.indexNameSearch
                }
                //本表的
                params['dicCode'] = "forum_state_types"//编码名字
                params['dicName'] = "帖子状态",//汉字名字
                this.$http({
                    url: "dictionary/page",
                    method: "get",
                    params: params
                }).then(({ data }) => {
                    if (data && data.code === 0) {
                    this.dataList = data.data.list;
                    this.totalPage = data.data.total;
                } else {
                    this.dataList = [];
                    this.totalPage = 0;
                }
                this.dataListLoading = false;
            });
            },
            // 每页数
            sizeChangeHandle(val) {
                this.pageSize = val;
                this.pageIndex = 1;
                this.getDataList();
            },
            // 当前页
            currentChangeHandle(val) {
                this.pageIndex = val;
                this.getDataList();
            },
            // 多选
            selectionChangeHandler(val) {
                this.dataListSelections = val;
            },
            // 添加/修改
            addOrUpdateHandler(id,type) {
                this.showFlag = false;
                this.addOrUpdateFlag = true;
                this.crossAddOrUpdateFlag = false;
                if(type!='info'){
                    type = 'else';
                }
                this.$nextTick(() => {
                    this.$refs.addOrUpdate.init(id,type);
            });
            },
            // 删除
            deleteHandler(id) {
                var ids = id
                        ? [Number(id)]
                        : this.dataListSelections.map(item => {
                    return Number(item.id);
            });
                this.$confirm(`确定进行[${id ? "删除" : "批量删除"}]操作?`, "提示", {
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    type: "warning"
                }).then(() => {
                    this.$http({
                    url: "dictionary/delete",
                    method: "post",
                    data: ids
                }).then(({ data }) => {
                    if (data && data.code === 0) {
                    this.$message({
                        message: "操作成功",
                        type: "success",
                        duration: 1500,
                        onClose: () => {
                        this.search();
                }
                });
                } else {
                    this.$message.error(data.msg);
                }
            });
            });
            },


        }

    };
</script>
<style lang="scss" scoped>
.slt {
    margin: 0 !important;
    display: flex;
  }

  .ad {
    margin: 0 !important;
    display: flex;
  }

  .pages {
    & /deep/ el-pagination__sizes{
      & /deep/ el-input__inner {
        height: 22px;
        line-height: 22px;
      }
    }
  }
  

  .el-button+.el-button {
    margin:0;
  } 

  .tables {
	& /deep/ .el-button--success {
		height: 40px;
		color: rgba(254, 190, 0, 1);
		font-size: 14px;
		border-width: 1px;
		border-style: solid;
		border-color: #DCDFE6;
		border-radius: 4px;
		background-color: rgba(10, 53, 245, 0.01);
	}
	
	& /deep/ .el-button--primary {
		height: 40px;
		color: rgba(254, 190, 0, 1);
		font-size: 14px;
		border-width: 1px;
		border-style: solid;
		border-color: #DCDFE6;
		border-radius: 4px;
		background-color: #fff;
	}
	
	& /deep/ .el-button--danger {
		height: 40px;
		color: rgba(254, 190, 0, 1);
		font-size: 14px;
		border-width: 1px;
		border-style: solid;
		border-color: #DCDFE6;
		border-radius: 4px;
		background-color: rgba(254, 252, 252, 1);
	}

    & /deep/ .el-button {
      margin: 4px;
    }
  }</style>



声明

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