@TOC
springboot350人事管理系统论文--论文pf
绪论
1.1 研究背景
现在大家正处于互联网加的时代,这个时代它就是一个信息内容无比丰富,信息处理与管理变得越加高效的网络化的时代,这个时代让大家的生活不仅变得更加地便利化,也让时间变得更加地宝贵化,因为每天的每分钟,每秒钟这些时间都能让人们处理大批量的日常事务,这些场景,是之前的手工模式无法与之相抗衡的。对于员工信息的管理来说,传统的通过纸质文档记录信息的方式已经落后了,依靠手工管理员工信息,不仅花费较长的工作时间,在对记录各种信息的文档进行信息查询以及信息核对操作时,也不能及时保证信息的准确性,基于这样的办公低效率环境下,对于员工信息的处理就要提出新的解决方案。因为这个时代的信息一直都在高速发展,要是不抱着发展的观念看待事情,极有可能被这个市场快速遗忘,甚至被无情地淘汰掉。所以尽早开发一款人事管理系统进行信息的快速处理,既跟上了时代的发展脚步,也能让自己的核心竞争力有所提升。
1.2目的和意义
互联网加的时代一方面是加快信息的发展,另一方面也是对传统行业进行筛选,能够继续发展的,肯定是那些能够充分运用互联网技术进行自身升级改革的行业。那些停步不前的行业只能就此结束,进而被大家所遗忘。这次设计出来的人事管理系统,它不仅能够让管理人员在信息增加,信息的编辑等事务处理上,节省很多的时间,也会砍掉一部分的人工成本,节省不必要开支的资金。另外,此系统的操作界面是可视化的界面,管理人员无需付费培训就能尽快上手。人事管理系统的开发意义如下:
1、管理人员再也不用在查询信息上花费大量宝贵的时间了,通过信息关键词字段就可以在几秒内获取需要的信息,在各种突发事件面前管理人员也不用慌张,可以从容淡定地处理各种相关信息。
2、该系统在每天的24小时期间都是不会停止服务的,只要有信息操作的需要,管理人员都能使用常用的360浏览器,或者百度浏览器,或者谷歌浏览器,2345浏览器等大众浏览器都能登录系统,然后操作对应的功能。
3、有了这款信息管理类操作软件,所有需要进行处理的数据不用在纸质版本的文档上进行记载,而是基于电脑进行信息录入。
4、员工方面的信息都是通过网站进行显示,其实质是这些信息都保存在网站对应的数据库里面。只要操作员不去恶意删除信息,那么这些信息将会永久保存。
1.3 论文结构安排
编写人事管理系统相对应的论文,其实就是对开发完成的程序进行再次解读的过程。本论文从七个方面的内容讲解了开发的程序,具体内容如下:
第一个部分:就是论文的绪论,这个部分就是介绍在什么样的背景下开发的程序,以及这个程序开发出来具有什么意义等内容。
第二个部分:就是介绍开发这个程序使用了什么技术,使用什么数据库保存程序的数据信息,程序开发的语言是使用的什么语言等内容。
第三个部分:就是介绍这个程序开发在现实生活的可行性问题,也讲述了程序开发需要设置什么功能等内容。
第四个部分:就是已经知晓程序的大致功能,需要对程序的功能进行更为严格的细分,也需要出具相应的功能结构图,同时,也要设计程序对应的数据库,包括数据库里面的数据表的设计等内容。
第五个部分:就是在系统的编码阶段,需要使用编程语言完成程序的功能,完成程序的界面设计,最终以界面实现的效果图展示设计成果等内容。
第六个部分:就是程序已经完成了开发的前提之下,需要检测程序的各个模块是否衔接正常,程序各个功能能否在网络等一切外部条件正常的情况下运行,这期间要是出现任何错误都需要及时记录并在后期进行修补完善。
第七个部分:就是论文最后的总结部分,描述遇到的问题,采用的解决思路等内容。
2 相关技术
2.1 VUE介绍
Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架。与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用。Vue 的核心库只关注视图层,不仅易于上手,还便于与第三方库或既有项目整合。另一方面,当与现代化的工具链以及各种支持类库结合使用时,Vue 也完全能够为复杂的单页应用提供驱动。
2.2 Mysql数据库介绍
有了程序功能的操作,也需要对程序操作的各个功能所产生的数据信息存放在一个固定的仓库里面,这个所谓的仓库就是大家最熟悉的程序开发需要使用的数据库了,数据库能够发展到至今的模样,其实也是经历了很多的变化历程的,在最开始由于数据信息处理的需要开始推出最低级的数据管理,这个阶段也是数据库早期的人工管理的阶段,后来也经历了文件管理的阶段,这个阶段的数据管理因为信息不能够进行共享,加上管理的数据对配套的程序产生了较强的依赖性,在数据信息管理上也存在很多数据的重复记载造成数据冗余等问题。所以为了解决上述一系列文件管理阶段所产生的数据管理的问题,对数据管理方式进行了全方位的升级改造,也就让数据管理进入了一个全新的阶段——数据库系统的阶段。这个阶段也是数据库管理数据的一个全新的相当高级的阶段。
说到数据库,也不得不说数据库的模型,数据库拥有的数据模型有网状,还有层次,以及关系型这三样数据库模型。网状的结构就是把记录的每条信息都比喻成一个点,点跟点之间也有联系,最终就形成了一个像网一样的结构,就是所谓的网状数据模型。也有对数据记录使用树状结构的方式进行数据保存,这个就是层次数据模型,关系数据库模型运用在现在市面上常见的数据库当中了,像本系统开发使用的MySQL数据库,还有安装过程比较复杂的Sqlserver数据库,也有一些比较小巧的关系型数据库,像Access数据库,FoxPro数据库等数据库。这样的关系型数据库将数据表里面的行还有列进行相互关联形成一个二维矩阵的方式来保存程序所产生的数据信息。
本次之所以选择MySQL数据库来当程序数据存放的仓库,则是因为此数据库安装不用费时,也不需要各种百度信息去解决安装过程中出现的任何问题,而且由于自己的电脑内存比较小,才4个G,为了更好的开发项目程序,针对低配置的电脑选择MySQL数据库也是情理之中。图2.3展示了数据列设计中需要使用的列类型。
图2.3数据列类型图
2.3 JAVA语言介绍
在1995年这一年的5月份,著名的Sun Microsystems公司在程序开发设计上面郑重推出一种面向对象开发的程序设计语言——Java,最开始的时候Java是由詹姆斯.高斯林这位伟大的JAVA之父来进行主导,但是在后来由于各种原因,让甲骨文公司这个针对商业程序创建了oracle大型数据库的公司收购了Java。Java的平台总共算下来有3个,分别为javaME和javaSE以及javaEE这3个java平台。下面将对其进行分别介绍。
1.在电脑桌面程序的开发上面需要选择JavaME,这个用得也比较多。
2.企业也会根据工作以及业务需要开发各种软件,那么就会选用JavcEE这个支持企业版软件的开发的Java平台,JavcEE主攻运用在企业领域上面的web应用,JavcEE也在javaSE的基础上获得了比如jsp技术 ,Servlet技术等程序开发技术的支持。
3.现在生活中手机的普及化,也使得手机端这样的移动设备的软件的兴起,JavaME这个迷你版java平台就能运用于移动端的软件开发操作。图2.4就是 Java技术原理图。
图2.4 Java技术原理图
3 系统分析
3.1系统可行性分析
需要使用大部分精力开发的人事管理系统为了充分降低开发风险,特意在开发之前进行可行性分析这个验证系统开发是否可行的步骤。本文就会从技术角度,经济角度,还有用户使用的程序的运行角度进行综合阐述。
3.1.1 技术可行性分析
开发程序选择的是面向对象的,功能强大的,简单易用的Java程序设计语言,数据库的开发工具使用到了Mysql数据库,由于自己之前接触过一些简单的程序开发方面的设计作品,所以对Myeclipse工具的使用比较熟练,对于数据库的操作技巧也有一定的积累。另外,程序开发需要在自己电脑上安装的软件并不多,在win7操作系统的大环境下,能够完全搭建好程序开发的操作环境,比如Myeclipse工具,Mysql数据库工具,游览器,以及处理程序图片的Photoshop工具等都能安装在自己的电脑上。总的说来,开发这个程序在技术上是可以实现的。
3.1.2 经济可行性分析
开发出来的程序并不是朝着商业程序的方向进行设计开发的,它只是作为一个毕业设计项目进行开发,主要用于检验学生在学校所学知识的一个检验,也锻炼学生运用网络,图书等工具进行自学的能力。所以开发这个程序软件并不会涉及到经济上面的开销,在开发软件的选择上也不会额外付费安装软件,在开发软件的官网上面就可以下载需要的软件,并根据提示的安装步骤安装软件到自己的电脑上面。总的说来,开发这个程序在经济上也不存在经费支出。
3.1.3 运行可行性分析
因为这个程序软件从开始开发到开发截止都是根据用户的需求进行定制,考虑到此程序软件是面向广大普通操作用户,鉴于他们的知识文化水平,特意开发出一个可操作性强的,能够很容易让使用用户上手的,具有可视化操作界面的一个程序软件。总的说来,这个程序站在用户运行程序的角度上分析,是不存在操作难的问题的。用户只要打开程序就可以免去专人培训进行程序功能操作。
经过上面从技术的角度,从经济的角度,从程序运行的角度这三个角度分析现打算开发的程序,可以得出该程序软件是可以进行开发操作的。
3.2系统性能分析
3.2.1 系统安全性
程序在使用中是不允许其他访问者随意窃取程序里面的隐秘信息,也不允许其他操作者越权操作其他管理用户操作的功能,要真正杜绝这些现象就必须在程序开发之前把程序的安全性给考虑进去。
比如现在很多程序都会把用户注册的功能给考虑进去,让用户在注册页面功能区填写自己的个人信息,这些数据信息涵盖了用户本人的姓名,用户对程序登录设置的密码,用户经常使用的邮箱,用户的常用联系方式还有用户的所住地址等信息,这些信息都是设计到用户本人的隐私,那么这些信息在传输给程序后台时,是需要进行管理并保存至对应的数据库文件里面。要是有人恶意窃取程序的数据信息,也就会让那些注册了此程序软件的用户的个人隐秘信息都会遭到泄露。这些信息落入其他不法分子手里,他们极有可能根据用户的隐私信息去骚扰用户,并把这些信息用于各种商业用途谋取其他非法的利益。所以数据安全性是一个系统能不能使用的首要标准。
3.2.2 数据完整性
数据完整性是确保数据信息是否具有可靠性,是否具有参考价值的一个重要因素,数据信息只描述一部分,或者必有的数据信息反而为空等现象都是代表着这个数据信息不完整,有数据缺陷,这是个很严肃的问题,因为这样的数据信息跟垃圾信息没什么两样。
说到数据完整性,不得不提最常用的程序表单功能。这些表单主要就是提取广大用户的数据信息的,需要广大用户根据表单上的要求,填写自己的姓名信息,以及自己的联系方式信息,有些也会有额外的信息填写要求,有必须要填的选项,也有不需要必填的选项。假如广大用户为了保护自己的隐私,或者不想受到其他人的骚扰,不填写必填项等信息,广大用户在最后提交此表单的时候,往往都是提交不了的。
数据完整性不仅仅限于登记的数据要完整,它也需要程序里面的所有数据信息之间存在关联,而且这种联系也是要求不能出差错的。
由于数据表之间也会存在一定的联系,所以同一个数据也会出现在另一个表格里面,那么这两个表格记录的同一个数据应该是一样的。不能够是同样的数据信息在不同表中不一样。
3.2.3系统可扩展性
一切事物都是一直在发展,程序员开发软件也需要带着发展的思维去进行软件开发操作,这样的话,开发出来的程序在应对管理所需时,也会相对应的进行程序升级与更新。不论是功能完善还是数据库升级都能在原来的基础上对原有程序进行迭代升级。让开发出来的程序能够走得越来越远。这也是广大用户对程序软件的使用要求。
3.3系统流程分析
管理员假如要操作系统提供的功能,那么管理员就要在系统的登录界面,填写管理员登录的账号信息,填写相应的密码信息,管理员需要保证这两者能够验证身份的账号以及密码信息的正确性,这样管理员就可以通过登录界面进入系统后台操作界面。图3.1就是开发的程序软件人事管理系统它的操作流程图。
图3.1 系统操作流程图
3.3.1系统登录流程
人事管理系统的登录流程,针对的角色就是操作员的操作角色。在登录界面需要的必填信息就是账号信息,配上登录的密码信息就能登录人事管理系统,需要注意的就是必填的账号信息和登录密码信息,都需要进行验证,系统会判断账号还有填写的密码信息的正确性,只有这两者信息都正确了,就能成功登录人事管理系统了。系统登录流程图如下图。
图3.2 系统登录流程图
3.3.2信息添加流程
用户在添加信息的界面填写的任何数据信息也是需要验证的,系统会判断用户填写信息的格式还有数据信息是不是合法信息,如果用户填写的信息是合法内容,系统就会在数据库对应的数据表里面添加信息。添加信息流程如下图。
图3.3 添加信息流程图
3.3.3信息删除流程
对于那些已经失效的信息,需要用户及时进行删除,这样有利于腾出空间存放其他信息。删除信息也是先从数据库对应数据表里面删除数据,接着就是更新数据表的信息。这样删除的数据,在用户操作界面就查看不到了。信息删除流程如下图所示。
图3.4 信息删除流程图
3.4系统功能分析
人事管理系统具有管理员角色,用户角色,这几个操作权限。
人事管理系统针对管理员设置的功能有:添加并管理各种类型信息,管理用户账户信息,管理员工信息,管理公告信息等内容。
人事管理系统针对用户设置的功能有:查看并修改个人信息,查看员工信息,查看公告信息等内容。
4 系统设计
4.1系统概要设计
人事管理系统并没有使用C/S结构,而是基于网络浏览器的方式去访问服务器,进而获取需要的数据信息,这种依靠浏览器进行数据访问的模式就是现在用得比较广泛的适用于广域网并且没有网速限制要求的小程序结构,图4.1就是开发出来的程序工作原理图。
图4.1 程序工作的原理图
4.2系统功能结构设计
人事管理系统针对管理员设置的功能有:添加并管理各种类型信息,管理用户账户信息,管理员工信息,管理公告信息等内容。
人事管理系统针对用户设置的功能有:查看并修改个人信息,查看员工信息,查看公告信息等内容。
4.3数据库设计
4.3.1数据库E-R图设计
程序设计是离不开对应数据库的设计操作的,这样的做法就是减少数据对程序的依赖性,所以数据库的设计也是需要花费大量的日常时间来进行设计的,在设计中对程序开发需要存储的数据信息进行实体划分,先确认实体,然后设计实体的属性等操作,这种设计就是数据库设计里面不能少的必须有的E-R模型设计。为了降低程序设计的对应的数据库设计难度,开发人员也可以使用相应的工具来进行E-R模型设计,现在市面上设计E-R模型的工具有PowerDesigner建模工具,Navicat制作工具,还有微软的Visio绘图工具。为了简便起见,本程序在设计E-R模型的时候,就选用了微软的Visio这款功能强大,操作便利的绘图工具。
(1)下图是绩效实体和其具备的属性。
绩效实体属性图
(2)下图是员工考勤详情实体和其具备的属性。
员工考勤详情实体属性图
(3)下图是招聘实体和其具备的属性。
招聘实体属性图
(4)下图是公告实体和其具备的属性。
公告实体属性图
(5)下图是员工请假实体和其具备的属性。
员工请假实体属性图
(6)下图是人事调动实体和其具备的属性。
人事调动实体属性图
(7)下图是员工实体和其具备的属性。
员工实体属性图
(8)下图是员工考勤实体和其具备的属性。
员工考勤实体属性图
(9)下图是薪资实体和其具备的属性。
薪资实体属性图
(10)下图是培训实体和其具备的属性。
培训实体属性图
4.3.2 数据库表结构设计
本次程序开发选用的数据库管理工具是Mysql数据管理工具,使用它存放数据也需要创建程序对应的数据库文件,并命名刚创建的数据库文件,有了数据库也需要创建各种数据表来充实数据库,在数据表的创建中,不仅需要对数据表命名,也需要对数据表的字段进行设计,包括每个数据表里面需要设置的字段名称,字段对应的数据类型信息,字段的主键设置这个也是不可缺少的,因为每个数据表里面的主键就是标记着这个数据表跟其他数据表相区分的唯一标志。就相当于生活中的每个人都有姓名,但是上网搜索自己的名字,会发现全国上下有很多人的名字跟自己的名字一模一样,包括姓氏以及名字,区分每个人的唯一信息就是每个人的身份证号信息,主键在数据表里面也是起着这样的重要作用。下面就介绍本次开发的程序人事管理系统的数据表结构信息。
表4.1字典表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
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.2公告表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | gonggao_name | String | 公告名称 | 是 |
3 | gonggao_types | Integer | 公告类型 | 是 |
4 | insert_time | Date | 公告发布时间 | 是 |
5 | gonggao_content | String | 公告详情 | 是 |
6 | create_time | Date | 创建时间 | 是 |
表4.3绩效表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | jixiao_uuid_number | String | 绩效编号 | 是 |
4 | jixiao_name | String | 绩效标题 | 是 |
5 | jixiao_file | String | 附件 | 是 |
6 | jixiao_types | Integer | 绩效类型 | 是 |
7 | jixiao_dafen | BigDecimal | 绩效打分 | 是 |
8 | pinggu_time | Date | 评估时间 | 是 |
9 | jixiao_content | String | 打分缘由 | 是 |
10 | insert_time | Date | 记录时间 | 是 |
11 | create_time | Date | 创建时间 | 是 |
表4.4培训表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | peixun_uuid_number | String | 培训编号 | 是 |
4 | peixun_name | String | 培训标题 | 是 |
5 | peixun_types | Integer | 培训类型 | 是 |
6 | kaishi_time | Date | 培训开始时间 | 是 |
7 | jieshu_time | Date | 培训结束时间 | 是 |
8 | peixun_content | String | 培训内容 | 是 |
9 | insert_time | Date | 录入时间 | 是 |
10 | create_time | Date | 创建时间 | 是 |
表4.5人事调动表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | renshidiaodong_uuid_number | String | 人事调动编号 | 是 |
4 | renshidiaodong_types | Integer | 人事调动类型 | 是 |
5 | diaodong_time | Date | 调动时间 | 是 |
6 | yuan_bumen | String | 原部门 | 是 |
7 | yuan_zhiwei | String | 原职位 | 是 |
8 | bumen_types | Integer | 部门 | 是 |
9 | zhiwei_types | Integer | 职位 | 是 |
10 | renshidiaodong_content | String | 调动缘由 | 是 |
11 | insert_time | Date | 录入时间 | 是 |
12 | create_time | Date | 创建时间 | 是 |
表4.6薪资表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | xinzi_uuid_number | String | 薪资编号 | 是 |
4 | xinzi_name | String | 标题 | 是 |
5 | xinzi_month | String | 月份 | 是 |
6 | jiben_jine | BigDecimal | 基本工资 | 是 |
7 | jiangjin_jine | BigDecimal | 奖金 | 是 |
8 | jixiao_jine | BigDecimal | 绩效 | 是 |
9 | butie_jine | BigDecimal | 补贴 | 是 |
10 | shifa_jine | BigDecimal | 实发 | 是 |
11 | xinzi_content | String | 备注 | 是 |
12 | insert_time | Date | 添加时间 | 是 |
13 | create_time | Date | 创建时间 | 是 |
表4.7员工表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_name | String | 员工姓名 | 是 |
3 | yuangong_phone | String | 员工手机号 | 是 |
4 | yuangong_id_number | String | 员工身份证号 | 是 |
5 | yuangong_photo | String | 员工头像 | 是 |
6 | bumen_types | Integer | 部门 | 是 |
7 | zhiwei_types | Integer | 职位 | 是 |
8 | yuangong_email | String | 员工邮箱 | 是 |
9 | xueli_types | Integer | 学历状态 | 是 |
10 | yuangong_jiaoyu_content | String | 教育经历 | 是 |
11 | yuangong_gongzuo_content | String | 工作经历 | 是 |
12 | shangpin_shixi_content | String | 实习经历 | 是 |
13 | shangpin_rongu_content | String | 所获荣誉 | 是 |
14 | jinyong_types | Integer | 账户状态 | 是 |
15 | create_time | Date | 创建时间 | 是 |
表4.8员工考勤表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_kaoqin_uuid_number | String | 考勤唯一编号 | 是 |
3 | yuangong_kaoqin_name | String | 考勤标题 | 是 |
4 | yuangong_kaoqin_types | Integer | 员工考勤类型 | 是 |
5 | bumen_types | Integer | 部门 | 是 |
6 | yuangong_kaoqin_content | String | 考勤详情 | 是 |
7 | insert_time | Date | 考勤发起时间 | 是 |
8 | jiezhi_time | Date | 考勤截止时间 | 是 |
9 | create_time | Date | 创建时间 | 是 |
表4.9员工考勤详情表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | yuangong_kaoqin_id | Integer | 考勤 | 是 |
4 | yuangong_kaoqin_list_types | Integer | 打卡状态 | 是 |
5 | insert_time | Date | 添加时间 | 是 |
6 | update_time | Date | 打卡时间 | 是 |
7 | create_time | Date | 创建时间 | 是 |
表4.10员工请假表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | yuangong_id | Integer | 员工 | 是 |
3 | yuangongqingjia_name | String | 请假标题 | 是 |
4 | yuangongqingjia_text | String | 请假缘由 | 是 |
5 | yuangongqingjia_types | Integer | 请假类型 | 是 |
6 | insert_time | Date | 申请时间 | 是 |
7 | yuangongqingjia_time | Date | 请假时间 | 是 |
8 | yuangongqingjia_number | Integer | 请假天数 | 是 |
9 | yuangongqingjia_yesno_types | Integer | 申请状态 | 是 |
10 | yuangongqingjia_yesno_text | String | 处理意见 | 是 |
11 | yuangongqingjia_shenhe_time | Date | 审核时间 | 是 |
12 | create_time | Date | 创建时间 | 是 |
表4.11招聘表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | zhaopin_uuid_number | String | 招聘编号 | 是 |
3 | zhaopin_name | String | 招聘标题 | 是 |
4 | zhaopin_address | String | 招聘地点 | 是 |
5 | zhaopin_file | String | 招聘附件 | 是 |
6 | zhaopin_types | Integer | 招聘类型 | 是 |
7 | zhaopin_number | Integer | 招聘人数 | 是 |
8 | zhaopin_time | Date | 招聘时间 | 是 |
9 | zhaopin_content | String | 招聘详情 | 是 |
10 | insert_time | Date | 录入时间 | 是 |
11 | create_time | Date | 创建时间 | 是 |
表4.12管理员表
序号 | 列名 | 数据类型 | 说明 | 允许空 |
---|---|---|---|---|
1 | Id | Int | id | 否 |
2 | username | String | 员工名 | 是 |
3 | password | String | 密码 | 是 |
4 | role | String | 角色 | 是 |
5 | addtime | Date | 新增时间 | 是 |
5 系统实现
5.1管理员功能介绍
5.1.1管理员登录
系统登录功能是程序必不可少的功能,在登录页面必填的数据有两项,一项就是账号,另一项数据就是密码,当管理员正确填写并提交这二者数据之后,管理员就可以进入系统后台功能操作区。下图就是管理员登录页面。
图5.1 管理员登录页面
5.1.2 员工管理
项目管理页面提供的功能操作有:查看员工,删除员工操作,新增员工操作,修改员工操作。下图就是员工管理页面。
图5.2 员工管理页面
5.1.3 公告信息管理
公告信息管理页面提供的功能操作有:新增公告,修改公告,删除公告操作。下图就是公告信息管理页面。
图5.3 公告信息管理页面
5.1.4公告类型管理
公告类型管理页面显示所有公告类型,在此页面既可以让管理员添加新的公告信息类型,也能对已有的公告类型信息执行编辑更新,失效的公告类型信息也能让管理员快速删除。下图就是公告类型管理页面。
图5.4 公告类型列表页面
5.1.5 培训管理
如图5.5显示的就是培训管理页面,此页面提供给管理员的功能有:新增培训,修改培训,删除培训。
图5.5培训管理页面
5.1.6 培训类型管理
如图5.6显示的就是培训类型管理页面,此页面提供给管理员的功能有:新增培训类型,修改培训类型,删除培训类型。
图5.6 培训类型管理页面
系统
InterceptorConfig.java
package com.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import com.interceptor.AuthorizationInterceptor;
@Configuration
public class InterceptorConfig extends WebMvcConfigurationSupport{
@Bean
public AuthorizationInterceptor getAuthorizationInterceptor() {
return new AuthorizationInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**");
super.addInterceptors(registry);
}
/**
* springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/resources/")
.addResourceLocations("classpath:/static/")
.addResourceLocations("classpath:/admin/")
.addResourceLocations("classpath:/img/")
.addResourceLocations("classpath:/front/")
.addResourceLocations("classpath:/public/");
super.addResourceHandlers(registry);
}
}
XinziController.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("/xinzi")
public class XinziController {
private static final Logger logger = LoggerFactory.getLogger(XinziController.class);
private static final String TABLE_NAME = "xinzi";
@Autowired
private XinziService xinziService;
@Autowired
private TokenService tokenService;
@Autowired
private DictionaryService dictionaryService;//字典
@Autowired
private GonggaoService gonggaoService;//公告
@Autowired
private JixiaoService jixiaoService;//绩效
@Autowired
private PeixunService peixunService;//培训
@Autowired
private RenshidiaodongService renshidiaodongService;//人事调动
@Autowired
private YuangongService yuangongService;//员工
@Autowired
private YuangongKaoqinService yuangongKaoqinService;//员工考勤
@Autowired
private YuangongKaoqinListService yuangongKaoqinListService;//员工考勤详情
@Autowired
private YuangongqingjiaService yuangongqingjiaService;//员工请假
@Autowired
private ZhaopinService zhaopinService;//招聘
@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("yuangongId",request.getSession().getAttribute("userId"));
CommonUtil.checkMap(params);
PageUtils page = xinziService.queryPage(params);
//字典表数据转换
List<XinziView> list =(List<XinziView>)page.getList();
for(XinziView 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);
XinziEntity xinzi = xinziService.selectById(id);
if(xinzi !=null){
//entity转view
XinziView view = new XinziView();
BeanUtils.copyProperties( xinzi , view );//把实体数据重构到view中
//级联表 员工
//级联表
YuangongEntity yuangong = yuangongService.selectById(xinzi.getYuangongId());
if(yuangong != null){
BeanUtils.copyProperties( yuangong , view ,new String[]{ "id", "createTime", "insertTime", "updateTime", "yuangongId"});//把级联的数据添加到view中,并排除id和创建时间字段,当前表的级联注册表
view.setYuangongId(yuangong.getId());
}
//修改对应字典表字段
dictionaryService.dictionaryConvert(view, request);
return R.ok().put("data", view);
}else {
return R.error(511,"查不到数据");
}
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody XinziEntity xinzi, HttpServletRequest request){
logger.debug("save方法:,,Controller:{},,xinzi:{}",this.getClass().getName(),xinzi.toString());
String role = String.valueOf(request.getSession().getAttribute("role"));
if(false)
return R.error(511,"永远不会进入");
else if("员工".equals(role))
xinzi.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
Wrapper<XinziEntity> queryWrapper = new EntityWrapper<XinziEntity>()
.eq("yuangong_id", xinzi.getYuangongId())
.eq("xinzi_month", xinzi.getXinziMonth())
;
logger.info("sql语句:"+queryWrapper.getSqlSegment());
XinziEntity xinziEntity = xinziService.selectOne(queryWrapper);
if(xinziEntity==null){
xinzi.setInsertTime(new Date());
xinzi.setCreateTime(new Date());
xinzi.setShifaJine(xinzi.getJixiaoJine()+xinzi.getJiangjinJine()+xinzi.getButieJine()+xinzi.getJibenJine());//薪资表特有,不需要可以手动删掉
xinziService.insert(xinzi);
return R.ok();
}else {
return R.error(511,"该员工该月份已有薪资记录");
}
}
/**
* 后端修改
*/
@RequestMapping("/update")
public R update(@RequestBody XinziEntity xinzi, HttpServletRequest request) throws NoSuchFieldException, ClassNotFoundException, IllegalAccessException, InstantiationException {
logger.debug("update方法:,,Controller:{},,xinzi:{}",this.getClass().getName(),xinzi.toString());
XinziEntity oldXinziEntity = xinziService.selectById(xinzi.getId());//查询原先数据
String role = String.valueOf(request.getSession().getAttribute("role"));
// if(false)
// return R.error(511,"永远不会进入");
// else if("员工".equals(role))
// xinzi.setYuangongId(Integer.valueOf(String.valueOf(request.getSession().getAttribute("userId"))));
xinziService.updateById(xinzi);//根据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<XinziEntity> oldXinziList =xinziService.selectBatchIds(Arrays.asList(ids));//要删除的数据
xinziService.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 yuangongId = 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<XinziEntity> xinziList = 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){
//循环
XinziEntity xinziEntity = new XinziEntity();
// xinziEntity.setYuangongId(Integer.valueOf(data.get(0))); //员工 要改的
// xinziEntity.setXinziUuidNumber(data.get(0)); //薪资编号 要改的
// xinziEntity.setXinziName(data.get(0)); //标题 要改的
// xinziEntity.setXinziMonth(data.get(0)); //月份 要改的
// xinziEntity.setJibenJine(data.get(0)); //基本工资 要改的
// xinziEntity.setJiangjinJine(data.get(0)); //奖金 要改的
// xinziEntity.setJixiaoJine(data.get(0)); //绩效 要改的
// xinziEntity.setButieJine(data.get(0)); //补贴 要改的
// xinziEntity.setShifaJine(data.get(0)); //实发 要改的
// xinziEntity.setXinziContent("");//详情和图片
// xinziEntity.setInsertTime(date);//时间
// xinziEntity.setCreateTime(date);//时间
xinziList.add(xinziEntity);
//把要查询是否重复的字段放入map中
//薪资编号
if(seachFields.containsKey("xinziUuidNumber")){
List<String> xinziUuidNumber = seachFields.get("xinziUuidNumber");
xinziUuidNumber.add(data.get(0));//要改的
}else{
List<String> xinziUuidNumber = new ArrayList<>();
xinziUuidNumber.add(data.get(0));//要改的
seachFields.put("xinziUuidNumber",xinziUuidNumber);
}
}
//查询是否重复
//薪资编号
List<XinziEntity> xinziEntities_xinziUuidNumber = xinziService.selectList(new EntityWrapper<XinziEntity>().in("xinzi_uuid_number", seachFields.get("xinziUuidNumber")));
if(xinziEntities_xinziUuidNumber.size() >0 ){
ArrayList<String> repeatFields = new ArrayList<>();
for(XinziEntity s:xinziEntities_xinziUuidNumber){
repeatFields.add(s.getXinziUuidNumber());
}
return R.error(511,"数据库的该表中的 [薪资编号] 字段已经存在 存在数据为:"+repeatFields.toString());
}
xinziService.insertBatch(xinziList);
return R.ok();
}
}
}
}catch (Exception e){
e.printStackTrace();
return R.error(511,"批量插入数据异常,请联系管理员");
}
}
}
YonghuServiceImpl.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.YonghuDao;
import com.entity.YonghuEntity;
import com.service.YonghuService;
import com.entity.view.YonghuView;
/**
* 用户 服务实现类
*/
@Service("yonghuService")
@Transactional
public class YonghuServiceImpl extends ServiceImpl<YonghuDao, YonghuEntity> implements YonghuService {
@Override
public PageUtils queryPage(Map<String,Object> params) {
Page<YonghuView> page =new Query<YonghuView>(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('dictionaryYuangongKaoqinList','新增')"
type="success"
icon="el-icon-plus"
@click="addOrUpdateHandler()"
>新增</el-button>
<el-button
v-if="isAuth('dictionaryYuangongKaoqinList','删除')"
: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('dictionaryYuangongKaoqinList','查看')"
: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('dictionaryYuangongKaoqinList','查看')" type="success" icon="el-icon-tickets" size="mini" @click="addOrUpdateHandler(scope.row.id,'info')">详情</el-button>
<el-button v-if="isAuth('dictionaryYuangongKaoqinList','修改')" type="primary" icon="el-icon-edit" size="mini" @click="addOrUpdateHandler(scope.row.id)">修改</el-button>
<el-button v-if="isAuth('dictionaryYuangongKaoqinList','删除')" 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'] = "yuangong_kaoqin_list_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: #FFFFFF;
font-size: 10px;
border-width: 1px;
border-style: solid;
border-color: var(--publicMainColor);
border-radius: 20px;
background-color: var(--publicSubColor);
}
& /deep/ .el-button--primary {
height: 40px;
color: #FFFFFF;
font-size: 10px;
border-width: 1px;
border-style: solid;
border-color: var(--publicMainColor);
border-radius: 20px;
background-color: var(--publicSubColor);
}
& /deep/ .el-button--danger {
height: 40px;
color: rgba(255, 255, 255, 1);
font-size: 10px;
border-width: 1px;
border-style: solid;
border-color: var(--publicMainColor);
border-radius: 20px;
background-color: var(--publicSubColor);
}
& /deep/ .el-button {
margin: 4px;
}
}
</style>
声明
本博客适用于广泛的学术和教育用途,包括但不限于个人学习、开发设计,产品设计。仅供学习参考,旨在为读者提供深入理解和学术研究的材料。