社区疫情返乡管控系统

springboot416社区疫情返乡管控系统–论文pf

第1章 绪论

1.1 课题背景

二十一世纪互联网的出现,改变了几千年以来人们的生活,不仅仅是生活物资的丰富,还有精神层次的丰富。在互联网诞生之前,地域位置往往是人们思想上不可跨域的鸿沟,信息的传播速度极慢,信息处理的速度和要求还是通过人们骑马或者是信鸽传递,这些信息传递都是不可控制的,中间很有可能丢失,信息的传递水平决定了人们生活的水平。如今大家都在使用互联网软件产品,从内部管理设置计算机管理,提高内部信息化的管理水准,从外部市场也可以用计算机获取相关数据进行处理,如今各行各业已经严重依赖于计算机了。

本课题研究和开发社区疫情返乡管控系统管理系统,让安装在计算机上的该系统变成管理人员的小帮手,提高社区疫情返乡管控系统信息处理速度,规范社区疫情返乡管控系统信息处理流程,让管理人员的产出效益更高。

1.2 课题意义

传统处理数据,必须是一张张纸,然后处理完毕又是统计在一张张纸上面,不断的重复处理,最终有个结果给最高层作为参考,这个模式在互联网没有出现之前,是一种常见的事情,信息管理的效率提不上去,人多不一定力量大,因为人多肯定更加消耗资源,并且因为人类需要休息,需要管理,思想会不统一,会偷懒,所以人们研究出专门帮助人们计算的机器,就是计算机的前身,到了互联网时代,人们发现完全可以让程序供应商提供解决方案,自己挑选自己合适的方案来提高自己的产出比。所以在日常工作和生活中会发现各种各样方便人们的工具。

本课题研发的社区疫情返乡管控系统管理系统,就是提供社区疫情返乡管控系统信息处理的解决方案,它可以短时间处理完信息,并且这些信息都有专门的存储设备,而且数据的备份和迁移都可以设定为无人值守,从人力角度和信息处理角度以及信息安全角度,社区疫情返乡管控系统管理系统是完胜传统纸质操作的。

1.3 研究内容

本文对社区疫情返乡管控系统管理系统的设计与实现分成六个章节来说明。

第1章:研究社区疫情返乡管控系统管理系统的背景,以及开发社区疫情返乡管控系统管理系统的意义。

第2章:对开发社区疫情返乡管控系统管理系统的环境还有技术进行说明。

第3章:分析社区疫情返乡管控系统管理系统的可行性,性能,流程以及功能。

第4章:设计社区疫情返乡管控系统管理系统的功能结构,设计数据库E-R图以及对数据表的存储结构进行设计。

第5章:实现社区疫情返乡管控系统管理系统的功能并进行功能界面展示。

第6章:对系统测试进行阐述,以及对本系统部分功能进行检测。

第2章 开发环境与技术

本章节对开发社区疫情返乡管控系统管理系统需要搭建的开发环境,还有社区疫情返乡管控系统管理系统开发中使用的编程技术等进行阐述。

2.1 MySQL数据库

MySQL是一种具有安全系数、安全系数、混合开发性、高效化等特征的轻量关联数据库智能管理系统。MySQL由C语言和C语言构成 由C语言和C语言撰写成的,由于C语言和C语言 这是混合开发的,因此MySQL源码是生命期的。MySQL提供多种多样数据种类,常见的数据种类包含[34]。伴随着数据库技术发展,MySQL逐步形成数据库管理方法的重要工具之一。它不仅能提供简单实用的操作作用,还能实现复杂多变的数据检索方法和查询记录导出方式。因为MySQL具有较好的兼容模式和扩展性,因而广泛应用于各行各业。

MySQL在WEB行业越来越受单位和个人开发者的亲睐。大部分大中小型网址都采用MySQL数据库,它不仅可以提供简单高效的数据浏览作用,还会对数据进行相应的剖析解决。因为Linux电脑操作系统和MySQL数据库全是开源系统免费体验,能够为公司节约许多费用,让很多企业使用Linux MySQL做为网址数据库,体型小,启动速度快,也不会影响网址性能,导致用户体验感极差。

MySQL数据库能够支持各种各样操作系统的运作,包含AIX、HP-UX、OS/2 Wrap、Solaris、Mac OS、Linux和Windows等。性能好,使用便捷。因而,MySQL数据库已成为当下数据库行业最流行产品之一。MySQL数据库系统使用面向对象设计方式,客户至上开展编程设计。是利用面向对象观念来达到各项功能。它不仅能管理方法大中型数据表或关系数据库,还可以把这种复杂且庞大信息系统集成到一个简单的中小型数据库系统内。现阶段,中国很多公司早已运用了这一尖端技术。但是由于该操作系统是根据远程服务器/服务器结构的(C/S),因而,存在一些缺陷:最先,系统软件不可以提供完备的数据访问接口,客户只能依靠浏览器浏览所需要的数据;次之,系统软件并没有统一的标准,不同类型的客户端难以实现数据分享;第三,系统软件没有很好的权限管理体制。

2.2 Java语言技术

Java语言已经存在了25年有余。通过这些年的发展趋势,it行业在市场占有率上仍然占据一半,仍然受到了很多程序员的工作钟爱。许多从业者都是在学习培训。近年来随着从业者的提高,Java语言的位置并没减少,算得上是常青藤。Java语言学习培训比较简单,自然,它是对于C前辈们的 而言的,C 语言非常强劲。Java取消了许多特点,如go这种阐述,也取消了主文件,让所有文件夹全是类,类是二维数组以及各种对象,也使Java处理一些对象的引入和回收利用,让开发者只需建立对象,应用对象,编写代码逻辑,不需要留意性能,让各种各样文件存储给Java自己解决,你能花很多时间科学研究应用软件相互关系,使研发更为集中化,如同跑车驾驶员一样,只要了解各种汽车的性能,实际操作,不需要科学研究如何生产车轮子,使软件开发更为详尽。

2.3 Spring Boot框架

Spring Boot是一个根据Spring框架的轻量快速开发框架,能够帮助开发人员迅速搭建靠谱高效率的应用程序。依据自动部署和协议书,改善了Spring的研究过程,使开发人员可以更加专注于领域模型。

Spring Boot有许多特性,当中最主要的是它提供了内置Tomcat、Jetty、Undertow等Web网络服务器能够轻松搭建Web应用程序。除此之外,它也提供自动部署、无需撰写XML文件等功能。这种功能使开发人员能够迅速建立和布署应用程序,而无需解决繁杂的环境变量和其它繁琐复杂每日任务。

开发系统时,Spring Boot能够帮助开发人员完成模块化设计和松耦合的代码结构,从而更好地日常维护拓展应用程序。除此之外,它也提供了很多常见的库和部件,如Spring Data、Spring Security等,能够轻松集成化这种部件,完成数据库操作、验证、受权等功能。

2.4 其他技术使用

spring-jdbc联接:

这是一个专业生产制造Connection对象工厂类,大部分全部用以建立数据库联接框架都是会完成这一插口,Springjdbc包就实现了这一插口,实现类是DriverManagerdasource、现阶段的项目是由DataSource的getconection方式获得配备MYSQL5.7数据库连接信息。

提交Fileupload文件:

项目中应用Fileupload完成文件提交,通常是Fileupload前面提交文件提交请求,请求形式为POST:<form action=“uploadServlet” method=“post” …=“”>请求编码方式:等候文件提交,启用Fileitem的isformField()方式,判断出表格域到底还是不是表格域,文件提交到后台管理,应用Fileupload接受文件信息,并把文件解决包存储在硬盘和库中。

Alibaba驱动:

比照各大网站Alibababababababababa.Druid是JAVA语言中比较好的数据库连接池。Druid可提供强有力的拓展和监控功能。该项目应用Alibababa.Druid开展数据库系统连接,Druid 0.1.18 以后,全部版本号都分享到maven中央仓库,在项目pome中.在xml里加入dependency就可以使用。

log4j日志:

社区疫情返乡管控系统,其全世界错误处理和日志信息纪录,应用log4j开展日志日常维护管理与查询,其核心优势是错误处理:在logback中,应用软件里的出现异常不被应用软件认知,特性提升,关键或没有废弃物体制,log4j在很多情况下,可采取设计的一套无废弃物体制,防止经常日志搜集所引起的jvm gc。操作方法很简单,在pom中.添加log4j有关jarxml就可以。。

第3章 系统分析

本文作者在确定了研究的课题之后,从各大数字图书馆下载文献来阅读,并了解同类型的网站具备的大致功能,然后具体事务具体分析,得出本系统要研究的具体功能与性能。虽然分析系统这一阶段性工作主要是确定功能,但它却影响着后面系统开发环节的进展,系统分析这个环节是不能少的。

3.1 可行性分析

从三个不同的角度来分析,确保开发成功的前提是有可行性分析,只有进行提前分析,符合程序开发流程才不至于开发过程的中断。

3.1.1 技术可行性

在技术实现层次,分析了好几种技术实现方法,并且都有对应的成功案例,也有很多开源模块可以进行参考,所以从技术可行性分析来讲,实现社区疫情返乡管控系统管理系统是没有问题的。

3.1.2 经济可行性

对于身为学生的开发者而言,在经济资源上面可用者很少,为了开发社区疫情返乡管控系统管理系统,通过开发软件对硬件的要求,发现自己的电脑是完全能用来开发的,并且学校机房的配置也可以达到要求。最重要的是选择的技术都可以在网上找到不花钱的教程以及资料,因为不花钱,所以经济方面是具有可行性的。

3.1.3 操作可行性

社区疫情返乡管控系统管理系统的具体实现,本身参考人类的正常操作逻辑,把常用的操作习惯当做主要的导航实现,可以让使用者更快速的理解并且上手操作,实现符合逻辑的操作流程是操作可行性的具体体现。

以上就是从不同的角度来分析,确保了社区疫情返乡管控系统管理系统的正常开展。

3.2 系统流程

社区疫情返乡管控系统管理系统投入使用后,使用者如果能看到相应的流程操作图会提高程序的理解能力。

3.2.1 操作流程

使用者在操作社区疫情返乡管控系统管理系统中,应该按照本系统提供的操作流程(图3.1即为本系统的操作流程图)进行操作,可以减少操作失误,从而节省进入社区疫情返乡管控系统管理系统的时间。

图3.1 系统操作流程

3.2.2 登录流程

社区疫情返乡管控系统管理系统通过登录功能(图3.2即为其登录的流程)引导使用者进入指定的功能操作区,也避免非本系统的用户享受本系统提供的服务以及查看本系统提供的信息,进而保证用户安全。

图3.2 登录流程

3.2.3 删除信息流程

社区疫情返乡管控系统管理系统在经过长期使用后,会产生很多的数据信息。为了腾出存储空间存放更多的数据,本系统数据库中存储的数据,一些没有参考价值的数据需要进行删除(图3.3即为删除信息的流程),删除数据过程中,为避免误删,使用者要根据系统的提示来决定是否删除数据。

图3.3 删除信息流程

3.2.4 添加信息流程

社区疫情返乡管控系统管理系统提供可视化的功能操作区,非常方便使用者进行数据操作,当使用者往系统中录入数据时(图3.4即为添加信息的流程),本系统也会进行数据合法性的判断,符合要求的数据才能够在数据库指定表中进行登记。

图3.4 添加信息流程

3.3 性能需求

(1)完好性规定

此次研发的社区疫情返乡管控系统中记载的数据信息不可以维持为空,数据信息务必恰当查验。系统中数据联系不可以出差错,也无法弹冠相庆。数据分析表中同一数据信息在各个数据分析表里的表明具体内容应同样。

(2)技术性能

当用户操作社区疫情返乡管控系统的各部分时,弹出来界面的响应速度不可以过长,最好是保持在3秒,较大限定数值4秒,给用户一个良好的程序流程感受。该系统还应当可以另外带上多人合作浏览社区疫情返乡管控系统。

(3)界面要求

社区疫情返乡管控系统界面设计方案应注意用户的日常操作习惯性,如导航条设计方案不可以在右边,彻底违背用户应用页面的操作习惯性,作用导航栏字体样式和色彩应更为醒目,便捷用户非常容易寻找,防止用户消耗太多的时间开展作用操作。

(4)安全规定

确保社区疫情返乡管控系统的安全性,给用户一种靠谱、可信赖的觉得,系统在运行中,不可以一直出差错,与用户作用界面互动,及时沟通信息内容,系统设定登陆页面,使非系统用户无法打开系统作用界面。系统用户还填写用户名登陆密码方可进入系统主界面,充分保证系统数据信息处在运行状态。

(5)页面设计问题:功能符合要求之后,肯定是要丰富页面的。页面设计才是用户长时间面对的问题,首先考虑数据的整洁性,让页面看起来更加的清爽。颜色与数据方面,该不同颜色就不同颜色,降低用户长时间使用出现的视觉疲劳,让用户使用起来心情不至于太差。

(6)系统的稳定性:正常用户操作系统页面,必须是该提交提交,正常输入符合逻辑,不能随随便便的就出各种问题,导致用户操作疲惫,并且输入的数据和回显的数据符合用户的要求。如果正常操作都会出现问题,那设计就是不稳定的,这一点肯定不行。只要是与数据进行交互的系统,都必须稳定。系统稳定从开发部署角度上来分析,可以考虑数据的冗余备份功能,自动值守功能,机房数据同步,机房分开的功能,这些都可以让系统的稳定性得到提升。

系统的性能需求需要对业务很熟练的情况下判断然后分析,再从系统性能需求来逐条实现,可以让设计的系统有使用价值。

第4章 系统设计

用户对着浏览器操作,肯定会出现某些不可预料的问题,但是不代表着系统对于用户在浏览器上的操作不进行处理,所以说,要提前考虑可能会出现的问题。

4.1 系统设计思想

系统设计,肯定要把设计的思想进行统一,只有统一的思想才能指导程序的开发,并且可以让众多的程序开发人员更快速的进入状态,提高开发速度。根据当前系统的既定需求,下面将进行本系统设计思想的阐述。

(1)扩展性:开发任何一个系统的时候不可避免要考虑这个问题。软件版本的更迭是一种常识,任何一个软件都不会一次性开发就成永恒,软件是一个不断成长的东西。所以考虑问题的时候需要对当前问题进行数据上的扩大化,然后进行归纳整理,最终形成具有一定扩展性的程序。程序的可扩展性必然会影响开发进度,所以最终需要综合评估程序的可扩展程度,进而有的放矢,循序开发。

(2)实用性:程序设计是一个先高屋建瓴式的设想,然后再具体化,实用性就是具体化的第一个步骤,要充分考虑使用者是不懂程序设计的这一点,使用者只是懂得常规性的上网操作步骤,并不需要对程序进行理解,所以一定要让使用者感觉到便利,感觉到实用性的存在,如果使用者使用程序过程中没发现使用程序的好处,那么程序设计的实用性将大大降低。

(3)安全性:当使用者使用的过程中,会产生大量的相关数据,这些数据必须有安全性的保证,否则当使用者发现数据出现问题的原因是程序设计问题的时候,将会对程序开发者失去信任,甚至可能会产生大量的费用赔偿问题,这是一个不可避免的问题。所以安全性关系开发与使用者双方的经济利益,程序的安全性是一定要保证的。

(4)先进性:程序设计的先进性是开发者进行考虑的,必须要在满足系统功能的前提下,必须要选择好当下最合适的技术。最合适的技术要从开发成本,使用成本以及维护成本里面综合分析,经过综合分析后要让技术实现最优解,保持先进的技术生产力。

(5)维护性:程序开发之初就要考虑以后的维护问题。维护是在程序开发完毕,已经上线可以运作,进入生产试用过程和使用过程中才会发现需要维护的必要。要通过各方面降低维护成本,不是说维护的越少就代表程序开发的越完美,程序既然是人类进行设计制造的,肯定有很多不可避免的问题产生,那么如何维护好程序的正常运作也是一门很重要的学问。

4.2 功能结构设计

图4.1即为设计的管理员功能结构,管理员权限操作的功能包括管理公告,管理社区疫情返乡管控系统信息,包括物资捐赠管理,培训管理,商品管理,薪资管理等,可以管理公告。

结构设计图

图4.1 管理员功能结构

4.3 数据库设计

社区疫情返乡管控系统管理系统运行中产生的数据需要按照提前设置的存储规则进行保存,设计出一个符合项目的最优数据存储格式,因为它能减少用户的等待时间,还可以对系统的请求在最短时间内进行响应。所以,对数据库设计时,需要对功能需求进行详细的拆分,以及对业务状态的细分,然后设计具体的存储规则,保证数据库能正常运作,缩短数据处理时间,并在一定程度上降低数据冗余,节省存储空间。

4.3.1 数据库概念设计

实体-联系图还有一个名称即E-R图,是Entity Relationship Diagram各英文单词首字母的缩写,它这种概念模型通常用于对现实世界进行描述。同时它还是一种能够直观表达数据中实体,联系,属性的有效手段。绘制E-R图能够选择的工具也有很多,但是Office Visio 这款软件在E-R图的绘制上一般都是作为首选工具,因为它是基于可视化处理,使用它创建E-R图非常简单。使用基本的E-R图构成元素,比如椭圆,菱形,矩形,还有实线段来表达对应的信息,椭圆代表属性,即实体的特征,矩形代表实体,即数据库中的一个具体数据表,菱形代表实体中相互关系,实线段主要是完成椭圆,矩形,菱形的连接。

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

C:/Users/Administrator/Desktop/temp111\1\____img\物资留言.jpg
物资留言实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\用户.jpg
用户实体属性图

(3)下图是核酸检测实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\核酸检测.jpg
核酸检测实体属性图

(4)下图是物资捐赠实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资捐赠.jpg
物资捐赠实体属性图

(5)下图是出行信息实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\出行信息.jpg
出行信息实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\论坛.jpg
论坛实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\商品.jpg
商品实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\公告.jpg
公告实体属性图

(9)下图是物资实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资.jpg
物资实体属性图

(10)下图是物资收藏实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资收藏.jpg
物资收藏实体属性图

(11)下图是投诉实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\投诉.jpg
投诉实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\商品收藏.jpg
商品收藏实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\商品评价.jpg
商品评价实体属性图

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

C:/Users/Administrator/Desktop/temp111\1\____img\商品订单.jpg
商品订单实体属性图

(15)下图是物资捐赠实体和其具备的属性。

C:/Users/Administrator/Desktop/temp111\1\____img\物资申请.jpg
物资捐赠实体属性图

4.3.2 数据库物理设计

本小节主要任务即是根据上述内容进行数据存储结构的设计,实体的属性就用来表示字段名称,不同的字段表示的数据类型以及取值都不相同,以及该表各个字段是否能够保持空等进行说明,设计完成一张数据表的结构之后,在保存时同样要命名,尽量选择英文名称进行命名并保存,还不容易导致系统出错。接下来就对设计的表进行简单说明。

表4.1投诉表

序号列名数据类型说明允许空
1IdIntid
2yonghu_idInteger提问用户
3chat_issueString问题
4issue_timeDate问题时间
5chat_replyString回复
6reply_timeDate回复时间
7zhuangtai_typesInteger状态
8chat_typesInteger数据类型
9insert_timeDate创建时间
表4.2字典表
序号列名数据类型说明允许空
1IdIntid
2dic_codeString字段
3dic_nameString字段名
4code_indexInteger编码
5index_nameString编码名字
6super_idInteger父字段id
7beizhuString备注
8create_timeDate创建时间
表4.3论坛表
序号列名数据类型说明允许空
1IdIntid
2forum_nameString帖子标题
3yonghu_idInteger用户
4users_idInteger管理员
5forum_contentString发布内容
6super_idsInteger父id
7forum_state_typesInteger帖子状态
8insert_timeDate发帖时间
9update_timeDate修改时间
10create_timeDate创建时间
表4.4公告表
序号列名数据类型说明允许空
1IdIntid
2gonggao_nameString公告名称
3gonggao_photoString公告图片
4gonggao_typesInteger公告类型
5insert_timeDate发布时间
6gonggao_contentString公告详情
7create_timeDate创建时间
表4.5核酸检测表
序号列名数据类型说明允许空
1IdIntid
2yonghu_idInteger用户
3jiance_timeDate检测时间
4jiance_typesInteger检测结果
5hesuanjiance_contentString备注
6insert_timeDate添加时间
7create_timeDate创建时间
表4.6商品表
序号列名数据类型说明允许空
1IdIntid
2shangpin_nameString商品名称
3shangpin_uuid_numberString商品编号
4shangpin_photoString商品照片
5zan_numberInteger
6cai_numberInteger
7shangpin_typesInteger商品类型
8shangpin_kucun_numberInteger商品库存
9shangpin_new_moneyBigDecimal现价/积分
10shangpin_clicknumInteger商品热度
11shangpin_contentString商品介绍
12shangpin_deleteInteger逻辑删除
13insert_timeDate录入时间
14create_timeDate创建时间
表4.7商品收藏表
序号列名数据类型说明允许空
1IdIntid
2shangpin_idInteger商品
3yonghu_idInteger用户
4shangpin_collection_typesInteger类型
5insert_timeDate收藏时间
6create_timeDate创建时间
表4.8商品评价表
序号列名数据类型说明允许空
1IdIntid
2shangpin_idInteger商品
3yonghu_idInteger用户
4shangpin_commentback_textString评价内容
5insert_timeDate评价时间
6reply_textString回复内容
7update_timeDate回复时间
8create_timeDate创建时间
表4.9商品订单表
序号列名数据类型说明允许空
1IdIntid
2shangpin_order_uuid_numberString订单编号
3shangpin_idInteger商品
4yonghu_idInteger用户
5buy_numberInteger购买数量
6shangpin_order_true_priceBigDecimal实付价格
7shangpin_order_typesInteger订单类型
8insert_timeDate订单创建时间
9create_timeDate创建时间
表4.10出行信息表
序号列名数据类型说明允许空
1IdIntid
2yonghu_idInteger用户
3wangfan_yuyue_textString申请理由
4wangfan_yuyue_typesInteger交通工具
5wangfan_yuyue_mudidiString去哪里
6wangfan_yuyue_chufadiString地址
7wangfan_yuyue_shenti_typesInteger身体状态
8wangfan_yuyue_chufa_timeDate出发时间
9wangfan_yuyue_daoda_timeDate到达时间
10wangfan_yuyue_yesno_typesInteger申报状态
11wangfan_yuyue_yesno_textString审核回复
12wangfan_yuyue_shenhe_timeDate审核时间
13insert_timeDate活动报名时间
14create_timeDate创建时间
表4.11物资表
序号列名数据类型说明允许空
1IdIntid
2wuzi_nameString物资名称
3wuzi_uuid_numberString物资编号
4wuzi_photoString物资照片
5wuzi_addressString物资地点
6zan_numberInteger
7cai_numberInteger
8wuzi_typesInteger物资类型
9wuzi_kucun_numberInteger物资数量
10wuzi_clicknumInteger物资热度
11wuzi_contentString物资介绍
12wuzi_deleteInteger逻辑删除
13insert_timeDate录入时间
14create_timeDate创建时间
表4.12物资收藏表
序号列名数据类型说明允许空
1IdIntid
2wuzi_idInteger物资
3yonghu_idInteger用户
4wuzi_collection_typesInteger类型
5insert_timeDate收藏时间
6create_timeDate创建时间
表4.13物资留言表
序号列名数据类型说明允许空
1IdIntid
2wuzi_idInteger物资
3yonghu_idInteger用户
4wuzi_liuyan_textString留言内容
5insert_timeDate留言时间
6reply_textString回复内容
7update_timeDate回复时间
8create_timeDate创建时间
表4.14物资捐赠表
序号列名数据类型说明允许空
1IdIntid
2wuzi_order_uuid_numberString订单编号
3wuzi_idInteger物资
4yonghu_idInteger用户
5buy_numberInteger购买数量
6wuzi_order_typesInteger订单类型
7insert_timeDate订单创建时间
8create_timeDate创建时间
表4.15物资捐赠表
序号列名数据类型说明允许空
1IdIntid
2wuzi_yuyue_uuid_numberString捐赠编号
3wuzi_idInteger物资
4yonghu_idInteger用户
5wuzi_yuyue_textString理由
6insert_timeDate物资捐赠
7wuzi_shuliangInteger捐赠数量
8wuzi_yuyue_yesno_typesInteger捐赠状态
9wuzi_yuyue_yesno_textString审核回复
10wuzi_yuyue_shenhe_timeDate审核时间
11create_timeDate创建时间
表4.16用户表
序号列名数据类型说明允许空
1IdIntid
2yonghu_nameString用户姓名
3yonghu_phoneString用户手机号
4yonghu_id_numberString用户身份证号
5yonghu_photoString用户头像
6new_moneyBigDecimal余额
7yonghu_emailString电子邮箱
8create_timeDate创建时间
表4.17管理员表
序号列名数据类型说明允许空
1IdIntid
2usernameString儿童名
3passwordString密码
4roleString角色
5addtimeDate新增时间

第5章 系统实现

编程人员在搭建的开发环境中,会让各种编程技术一起呈现出最终效果。本节就展示关键部分的页面效果。

5.1 管理员功能实现

5.1.1 物资捐赠管理

图5.1 即为编码实现的物资捐赠管理界面,管理员在物资捐赠管理界面中可以对界面中显示,可以对物资捐赠信息的物资捐赠状态进行查看,可以添加新的物资捐赠信息等。

图5.1 物资捐赠管理界面

5.1.2 商品管理

图5.2 即为编码实现的商品管理界面,管理员在商品管理界面中查看商品种类信息,商品描述信息,新增商品信息等。

图5.2 商品管理界面

5.1.3 公告管理

图5.3 即为编码实现的公告管理界面,管理员在公告管理界面中新增公告,可以删除公告。

图5.3 公告管理界面

5.1.4 公告类型管理

图5.4 即为编码实现的公告类型管理界面,管理员在公告类型管理界面查看公告的工作状态,可以对公告的数据进行导出,可以添加新公告的信息,可以编辑公告信息,删除公告信息。

图5.4 公告类型管理界面

FileUtil.java
package com.utils;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
* @author yangliyuan
* @version 创建时间:2020年2月7日 下午8:01:14
* 类说明 : 
*/

public class FileUtil {
	public static byte[] FileToByte(File file) throws IOException {
		// 将数据转为流
		@SuppressWarnings("resource")
		InputStream content = new FileInputStream(file);
		ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
		byte[] buff = new byte[100];
		int rc = 0;
		while ((rc = content.read(buff, 0, 100)) > 0) {
			swapStream.write(buff, 0, rc);
		}
		// 获得二进制数组
		return swapStream.toByteArray();
	}
}

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

    private static final String TABLE_NAME = "wuziCollection";

    @Autowired
    private WuziCollectionService wuziCollectionService;


    @Autowired
    private TokenService tokenService;

    @Autowired
    private ChatService chatService;//投诉
    @Autowired
    private DictionaryService dictionaryService;//字典
    @Autowired
    private ForumService forumService;//论坛
    @Autowired
    private GonggaoService gonggaoService;//公告
    @Autowired
    private HesuanjianceService hesuanjianceService;//核酸检测
    @Autowired
    private ShangpinService shangpinService;//商品
    @Autowired
    private ShangpinCollectionService shangpinCollectionService;//商品收藏
    @Autowired
    private ShangpinCommentbackService shangpinCommentbackService;//商品评价
    @Autowired
    private ShangpinOrderService shangpinOrderService;//商品订单
    @Autowired
    private WangfanYuyueService wangfanYuyueService;//出行信息
    @Autowired
    private WuziService wuziService;//物资
    @Autowired
    private WuziLiuyanService wuziLiuyanService;//物资留言
    @Autowired
    private WuziOrderService wuziOrderService;//物资申请
    @Autowired
    private WuziYuyueService wuziYuyueService;//物资捐赠
    @Autowired
    private YonghuService yonghuService;//用户
    @Autowired
    private UsersService usersService;//管理员


    /**
    * 后端列表
    */
    @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 = wuziCollectionService.queryPage(params);

        //字典表数据转换
        List<WuziCollectionView> list =(List<WuziCollectionView>)page.getList();
        for(WuziCollectionView 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);
        WuziCollectionEntity wuziCollection = wuziCollectionService.selectById(id);
        if(wuziCollection !=null){
            //entity转view
            WuziCollectionView view = new WuziCollectionView();
            BeanUtils.copyProperties( wuziCollection , view );//把实体数据重构到view中
            //级联表 物资
            //级联表
            WuziEntity wuzi = wuziService.selectById(wuziCollection.getWuziId());
            if(wuzi != null){
            BeanUtils.copyProperties( wuzi , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yonghuId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
            view.setWuziId(wuzi.getId());
            }
            //级联表 用户
            //级联表
            YonghuEntity yonghu = yonghuService.selectById(wuziCollection.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 WuziCollectionEntity wuziCollection, HttpServletRequest request){
        logger.debug("save方法:,,Controller:{},,wuziCollection:{}",this.getClass().getName(),wuziCollection.toString());

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

        Wrapper<WuziCollectionEntity> queryWrapper = new EntityWrapper<WuziCollectionEntity>()
            .eq("wuzi_id", wuziCollection.getWuziId())
            .eq("yonghu_id", wuziCollection.getYonghuId())
            .eq("wuzi_collection_types", wuziCollection.getWuziCollectionTypes())
            ;

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

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

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

            wuziCollectionService.updateById(wuziCollection);//根据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<WuziCollectionEntity> oldWuziCollectionList =wuziCollectionService.selectBatchIds(Arrays.asList(ids));//要删除的数据
        wuziCollectionService.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");
        //.eq("time", new SimpleDateFormat("yyyy-MM-dd").format(new Date()))
        try {
            List<WuziCollectionEntity> wuziCollectionList = 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){
                            //循环
                            WuziCollectionEntity wuziCollectionEntity = new WuziCollectionEntity();
//                            wuziCollectionEntity.setWuziId(Integer.valueOf(data.get(0)));   //物资 要改的
//                            wuziCollectionEntity.setYonghuId(Integer.valueOf(data.get(0)));   //用户 要改的
//                            wuziCollectionEntity.setWuziCollectionTypes(Integer.valueOf(data.get(0)));   //类型 要改的
//                            wuziCollectionEntity.setInsertTime(date);//时间
//                            wuziCollectionEntity.setCreateTime(date);//时间
                            wuziCollectionList.add(wuziCollectionEntity);


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

                        //查询是否重复
                        wuziCollectionService.insertBatch(wuziCollectionList);
                        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 = wuziCollectionService.queryPage(params);

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

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

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


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

                //级联表
                    WuziEntity wuzi = wuziService.selectById(wuziCollection.getWuziId());
                if(wuzi != null){
                    BeanUtils.copyProperties( wuzi , view ,new String[]{ "id", "createDate"});//把级联的数据添加到view中,并排除id和创建时间字段
                    view.setWuziId(wuzi.getId());
                }
                //级联表
                    YonghuEntity yonghu = yonghuService.selectById(wuziCollection.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 WuziCollectionEntity wuziCollection, HttpServletRequest request){
        logger.debug("add方法:,,Controller:{},,wuziCollection:{}",this.getClass().getName(),wuziCollection.toString());
        Wrapper<WuziCollectionEntity> queryWrapper = new EntityWrapper<WuziCollectionEntity>()
            .eq("wuzi_id", wuziCollection.getWuziId())
            .eq("yonghu_id", wuziCollection.getYonghuId())
            .eq("wuzi_collection_types", wuziCollection.getWuziCollectionTypes())
//            .notIn("wuzi_collection_types", new Integer[]{102})
            ;
        logger.info("sql语句:"+queryWrapper.getSqlSegment());
        WuziCollectionEntity wuziCollectionEntity = wuziCollectionService.selectOne(queryWrapper);
        if(wuziCollectionEntity==null){
            wuziCollection.setInsertTime(new Date());
            wuziCollection.setCreateTime(new Date());
        wuziCollectionService.insert(wuziCollection);

            return R.ok();
        }else {
            return R.error(511,"您已经收藏过了");
        }
    }

}


ForumServiceImpl.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.ForumDao;
import com.entity.ForumEntity;
import com.service.ForumService;
import com.entity.view.ForumView;

/**
 * 论坛 服务实现类
 */
@Service("forumService")
@Transactional
public class ForumServiceImpl extends ServiceImpl<ForumDao, ForumEntity> implements ForumService {

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


}

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('dictionaryWuziYuyueYesno','新增')"
                                type="success"
                                icon="el-icon-plus"
                                @click="addOrUpdateHandler()"
                        >新增</el-button>
                        <el-button
                                v-if="isAuth('dictionaryWuziYuyueYesno','删除')"
                                :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('dictionaryWuziYuyueYesno','查看')"
                          :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('dictionaryWuziYuyueYesno','查看')" type="success" icon="el-icon-tickets" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">详情</el-button>
                            <el-button v-if="isAuth('dictionaryWuziYuyueYesno','修改')" type="primary" icon="el-icon-edit" size="mini" @click="addOrUpdateHandler(scope.row.id)">修改</el-button>
                            <el-button v-if="isAuth('dictionaryWuziYuyueYesno','删除')" 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'] = "wuzi_yuyue_yesno_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: #fff;
		font-size: 14px;
		border-width: 1px 5px 1px 0;
		border-style: solid;
		border-color:  var(--publicMainColor);
		border-radius: 50%;
		background-color: var(--publicSubColor);
	}

	& /deep/ .el-button--primary {
		height: 40px;
		color: #fff;
		font-size: 14px;
		border-width: 1px 5px 1px 0;
		border-style: solid;
		border-color:  var(--publicMainColor);
		border-radius: 50%;
		background-color: var(--publicSubColor);
	}

	& /deep/ .el-button--danger {
		height: 40px;
		color:#fff;
		font-size: 14px;
		border-width: 1px 5px 1px 0;
		border-style: solid;
		border-color:  var(--publicMainColor);
		border-radius: 50%;
		background-color: var(--publicSubColor);
	}

    & /deep/ .el-button {
      margin: 4px;
    }
  }
	.form-content {
		background: transparent;
	}
	.table-content {
		background: transparent;
	}

	.tables /deep/ .el-table__body tr {
				background-color: rgba(255, 255, 255, 1) !important;
				color: rgba(0, 0, 0, 1) !important;
	 }
	.tables /deep/ .el-table__body tr.el-table__row--striped td {
	    background: transparent;
	}
	.tables /deep/ .el-table__body tr.el-table__row--striped {
		background-color: #F5F7FA !important;
		color: #606266 !important;
	}

	 .tables /deep/ .el-table__body tr:hover>td {
	   	   background-color: var(--publicSubColor) !important;
	   	   	   color: rgba(0, 0, 0, 1) !important;
	   	 }</style>



声明

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值