绪论:讲解课题的背景与意义,展示论文构造。
程序开拓技能:讲解程序利用到的工具与技能知识。
系统剖析:讲解程序的功能需求与开拓可行性问题。

系统设计:讲解程序的功能与数据库的设计。
系统实现:讲解程序功能与界面实现。
系统测试:讲解程序的功能测试。 # 第2章 程序开拓技能 ## 2.1 Mysql数据库 为了更随意马虎理解Mysql数据库,接下来就对其具备的紧张特色进行描述。
(1)首选Mysql数据库也是为了节省开拓资金,由于网络上对Mysql的源码都已进行了公开展示,开拓者根据程序开拓须要可以进行下载,并做一些改动就可以利用在程序中,可以推动开拓者开拓此程序的开拓进度。
(2)SQL数听说话在Mysql里面也同样适用
(3)Mysql不仅可以支持多种编程措辞,比如在校期间学到的C措辞,Java措辞,以及课后打仗的PHP措辞,C++措辞等编程措辞,它都能很好的支持,而且Mysql的安装与利用还不挑剔利用平台。
(4)Mysql可以支持具有千万条数据记录的数据库,电脑操作系统在进行首次安装或者是重装时,可以根据须要选择安装32位或64位操作系统,这两种操作系统对表文件的支持力度不一样,32位的操作系统最多可以存放4GB的表文件,64位操作系统最多可以存放8TB的表文件。
(5)Mysql数据库可以通过GPL协议进行个性化定制,须要开拓者自己对数据库的源代码进行修正,以此开拓出属于自己的Mysql。 ## 2.2 Java措辞 程序开拓措辞有很多,但是截至目前,Java措辞在IT领域内,仍旧是最被认可,以及被广泛利用的编写措辞之一,因此在选择此程序的编写措辞上,果断选择这门编程措辞进行程序开拓。可以说经由了这么多年的发展,Java措辞不仅在Web开拓领域有了突出性贡献,而且在大数据开拓领域以及Android开拓领域都得到了广泛利用。由于Java措辞拥有较强的扩展性能,并且表现出的稳定性能,让其成为大型后端系统开拓措辞首选,现如今,Java措辞也成为了一种常用的互联网平台的办理方案。
作为一种源码在网络上开源的面向工具的程序开拓Java措辞,由它开拓完成的程序是不可能直接运行在各大平台的,Java程序的运行,须要在操作平台上配置其运行的环境,包括数据库软件与Java程序开拓软件等工具的安装与配置。在Win7,Win10或其它操作平台上配置Java程序运行环境,只要环境配置成功,Java程序都可以运行起来。
第3章 系统剖析在进行系统剖析之前,须要从网络上或者是图书馆的开拓类书本中网络大量的资料,由于这个环节也是帮助即将开拓的程序软件制订一套最优的方案,一旦确定了程序软件须要具备的功能,就意味着接下来的事情和任务都是环绕着这个方案实行的,以是系统剖析须要对程序功能反复进行思考和研究。 ## 3.1可行性剖析 开拓一款系统软件之前,用户都会思考这个软件程序值不值得去开拓,把开拓软件过程中可能涉及到的问题罗列出来,并一个个剖析办理,以此来确定开拓这款程序软件是否有必要,这样的剖析方法也能帮助用户降落丢失,不至于开拓者开拓进度进行到一半之后,溘然碰着问题就放弃对软件的开拓,到那时,资金丢失,人力投入等方面就损耗太大了。 ### 3.1.1技能可行性剖析 这次开拓程序利用到的开拓工具有:Eclipse,Mysql等工具,利用的开拓措辞是Java,选择的开拓工具和开拓措辞都是在大学教室打仗并学习过,后期由于自己也比较感兴趣,以是也通过网络渠道,或借助图书馆的开拓类书本进行过软件开拓知识的系统学习,让自己有了一定的知识积累,加上自己在校期间也独立开拓过一些软件作品,也积累了一定的开拓履历,以是这次毕设作品的制作在技能上无须担忧过多。 ### 3.1.2经济可行性剖析 目前的信息时期,对信息的管理趋于高效化,便捷化,这也是打算机大力遍及所带来的便利,此程序软件在设备选用上,依赖的是比较大众的电脑设备,对电脑的配置没有过多哀求,一样平常学校的打算机机房的电脑都可以知足程序开拓需求,其余,开拓出此款程序,让信息处理变得高效率,其所带来的高效益是远超程序开拓的低本钱的,因此程序开拓的资金投入是可以忽略不计的。 ### 3.1.3操作可行性剖析 程序软件的操作界面是符合大众审美的需求,功能模块的布局也是类似于社会上同种类型的软件,因此利用者操作该软件可以无需培训就上手。加上现在打算机入驻各家各户,大部分人的打算机操作水平都比较高,这样的局势也表明开拓出来的程序在操作性问题上也是不用担心的。
综合上面的可行性论证,基本可以确定程序开拓完备可行。 ## 3.2系统运行环境 程序经由编码可以实现对程序设计的功能。但是编码实现时须要一定的配置环境,包括了电脑上的硬件环境,也包括在电脑操作系统上安装的软件环境。
硬件环境:一台可以正常利用并能够上网的条记本或者是电脑,电脑内存最低哀求4个G,电脑的中心处理器可以配置i5CPU。
软件环境:利用的微软操作系统是比较稳定的win7旗舰版系统,采取比较闇练360安全浏览器,并在此系统上通过浏览器下载安装好Eclipse软件,下载安装好MYSQL软件等。 ## 3.3系统流程剖析 剖析程序的流程,涉及到程序的整体操作流程,通过剖析与设计,绘制的程序操作流程图见下图。此程序为了确保安全,会让利用者通过登录模块验证信息,符合哀求的利用者才有权限操作程序。
图3-1 程序操作流程图
程序处理数据会涉及到数据的录入环节,绘制的添加流程见下图。程序录入数据过程中,始终与数据库保持同步。
图3-2 信息添加流程图
程序里面的数据也会涌现缺点,因此就有相应的修正数据的功能,绘制的程序修正流程见下图。此过程也是跟后台数据库进行数据同步显示。
图3-3信息修正流程图
程序数据存放于数据仓库,有时也会涉及到数据删除,此过程对应的流程图见下图。数据信息被删除之后,数据库里面也就没有了该数据信息了。
图3-4 信息删除流程图
第4章 系统设计4.1 系统设计的原则在系统设计过程中,也须要遵照相应的设计原则,这些设计原则可以帮助设计者在短韶光内设计出符合设计规范的设计方案。设计原则紧张有可靠性,安全性,可定制化,可扩展性,可掩护性,可升级性以及客户体验等原则。下面就对这些原则进行简要阐述。
可靠性:一个软件是否可靠决定了其是否被用户利用,设计不可靠的软件,用户很随意马虎就摈弃;
安全性:程序软件承担了信息的保存与管理等事务,安全性不敷的软件会导致利用者承担巨大的丢失;以是系统安全也是须要考虑进入的;
可定制化:市场环境从来都不是一贯固定不变,面对客户群体的改变,以及利用环境的改变,市场需求的改变等成分,程序软件也要易于调度以适应各种变革;
可扩展性:程序软件在运行利用期间,也须要及时引进当下的新技能来进行系统优化,紧张便是在系统功能层面,系统性能层面上进行相应的扩展,只有这样才能让系统在实际生活中连续霸占市场;
可掩护性:程序软件的掩护须要一定量的资金,不管是打消现有程序缺点,还是变更软件的现有需求,都须要在软件技能上投入一定资金,以是易于掩护的软件程序就可以降落技能层面的资金花费;
可升级性:程序软件的投入利用,会面临用户数量增多的情形,用户对软件的利用率也会提升,以是系统面临这种情形,仍旧须要通过升级保持性能的合理,这样才能够适应市场;
客户体验:设计出来的程序软件在界面上不能够太繁芜,要遵照界面设计的事理设计出大略,方便操作的功能操作界面,让用户易于接管软件,并乐于利用软件供应的功能。 ## 4.2 系统构造设计 在系统构造设计上,经综合考虑还是选择比C/S更省资金的B/S构造模式,现如今浏览器已经实现了遍及,并在技能上逐渐完善和成熟,它在节约软件开拓本钱的根本上,还能实现原来用专业软件操作才能实现的强大功能。总之,B/S构造是当下全新的,认可度高的系统布局技能。系统构造设计图通过绘制,效果展示如下:
图4-1 系统构造设计图 ## 4.3功能构造设计 在管理员功能模块确定下来的根本上,对管理员各个功能进行设计,确定管理员功能的详细模块。绘制的管理员功能构造见下图。
阅微文学网站
系个人信息管理
管章节管理
管作者管理
管书架管理
大用户管理
修个人信息修正
密
修正密码
新用户新增
是用户修正
删用户删除
删书架删除
申
书架新增
申
书架修正
删章节删除
新章节新增
修章节修正
用作者新增
用作者修正
用作者删除
管文学信息管理
新文学信息新增
吸文学信息修正
删文学信息删除
图4.3 管理员功能构造图
4.4 数据库设计
开拓一个别系也须要提前设计数据库。这里的数据库是干系数据的凑集,存储在一起的这些数据也是按照一定的组织办法进行的。目前,数据库能够做事于多种运用程序,则是源于它存储办法最佳,具备数据冗余率低的上风。虽然数据库为程序供应信息存储做事,但它与程序之间也可以保持较高的独立性。总而言之,数据库经历了很长一段韶光的发展,从最初的不为人知,到现在的人尽皆知,其干系技能也加倍成熟,同时也拥有着坚实的理论根本。
4.4.1 数据库观点设计
这部分内容须要借助数据库关系图来完成,也须要利用专门绘制数据库关系图的工具,比如Visio工具就可以设计E-R图(数据库关系图)。设计数据库,也须要按照设计的流程进行,首先还是要根据需求完成实体的确定,剖析实体具有的特色,还有对实体间的关联关系进行确定。末了才是利用E-R模型的表示方法,绘制本系统的E-R图。不管是利用亿图软件,还是Visio工具,对付E-R模型的表示符号都一样,常日矩形代表实体,实体间存在的关系用菱形符号表示,实体的属性也便是实体的特色用符号椭圆表示。末了利用直线将矩形,菱形和椭圆等符号连接起来。接下来就开始对本系统的E-R图进行绘制。
(1)下图是用户实体和其具备的属性。
图4.1 用户实体属性图
(2)下图是作者实体和其具备的属性。
图4.2 作者实体属性图
(3)下图是文学留言实体和其具备的属性。
图4.3 文学留言实体属性图
(4)下图是文学购买实体和其具备的属性。
图4.4 文学购买实体属性图
(5)下图是章节实体和其具备的属性。
图4.5 章节实体属性图
(6)下图是论坛实体和其具备的属性。
图4.6 论坛实体属性图
(7)下图是文学实体和其具备的属性。
图4.7 文学实体属性图
(8)下图是书架实体和其具备的属性。
图4.8 书架实体属性图
(9)下图是阅读记录管理实体和其具备的属性。
图4.9 阅读记录管理实体属性图
4.4.2 数据库表构造在进行这部分设计之前,须要明白和节制数据类型以及各个数据类型的长度范围等知识,由于在一张详细的数据表中,为了方便理解,这里就举个大略的例子。比如用户信息表,这个表格的字段便是用户这个实体具备的属性,这时就须要对字段进行数据类型,以及字段长度的设置,也要设置一个主键来作为用户信息表的唯一标识。这些都是数据库表构造设计须要完成的内容。根据阅微文学网站的功能设计以及数据库设计哀求,展示该系统的数据表构造。
表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
forum_name
String
帖子标题
是
3
yonghu_id
Integer
用户
是
4
zuozhe_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.3文学表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
zuozhe_id
Integer
作者
是
3
xiaoshuo_name
String
文学名称
是
4
xiaoshuo_photo
String
文学照片
是
5
xiaoshuo_types
Integer
文学类型
是
6
xiaoshuo_old_money
BigDecimal
文学原价
是
7
xiaoshuo_new_money
BigDecimal
现价/积分
是
8
xiaoshuo_clicknum
Integer
点击次数
是
9
zan_number
Integer
赞数量
是
10
cai_number
Integer
踩数量
是
11
xiaoshuo_content
String
文学先容
是
12
shangxia_types
Integer
是否上架
是
13
xiaoshuo_delete
Integer
逻辑删除
是
14
create_time
Date
创建韶光
是
表4.4书架表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
xiaoshuo_id
Integer
文学
是
3
yonghu_id
Integer
用户
是
4
xiaoshuo_collection_types
Integer
类型
是
5
insert_time
Date
加入韶光
是
6
create_time
Date
创建韶光
是
表4.5文学留言表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
xiaoshuo_id
Integer
文学
是
3
yonghu_id
Integer
用户
是
4
xiaoshuo_liuyan_text
String
留言内容
是
5
insert_time
Date
留言韶光
是
6
reply_text
String
回答内容
是
7
update_time
Date
回答韶光
是
8
create_time
Date
创建韶光
是
表4.6文学购买表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
xiaoshuo_order_uuid_number
String
流水号
是
3
xiaoshuo_id
Integer
文学
是
4
yonghu_id
Integer
用户
是
5
insert_time
Date
购买韶光
是
6
create_time
Date
创建韶光
是
表4.7用户表
序号
列名
数据类型
解释
许可空
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
create_time
Date
创建韶光
是
表4.8阅读记录管理表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
xiaoshuo_id
Integer
文学
是
3
yonghu_id
Integer
用户
是
4
yuedujilu_content
String
详情
是
5
insert_time
Date
阅读韶光
是
6
create_time
Date
创建韶光
是
表4.9章节表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
xiaoshuo_id
Integer
文学
是
3
zhangjie_name
String
章节名称
是
4
zhangjie_content
String
章节内容
是
5
zhangjie_delete
Integer
逻辑删除
是
6
create_time
Date
创建韶光
是
表4.10作者表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
zuozhe_name
String
作者姓名
是
3
zuozhe_phone
String
作者手机号
是
4
zuozhe_photo
String
作者头像
是
5
zuozhe_email
String
电子邮箱
是
6
create_time
Date
创建韶光
是
表4.11管理员表
序号
列名
数据类型
解释
许可空
1
Id
Int
id
否
2
username
String
用户名
是
3
password
String
密码
是
4
role
String
角色
是
5
addtime
Date
新增韶光
是
系统实现系统实现这个章节的内容紧张还是展示系统的功能界面设计效果,在实现系统基本功能,比如修正,比如添加,比如删除等管理功能的同时,也显示出系统各个功能的界面实现效果,该部分内容一方面与前面提到的系统剖析,系统设计的内容相呼应,另一方面也是一个实际成果的展示。 ## 5.1管理员功能实现 ### 5.1.1 文学信息管理 此页面让管理员管理文学信息的数据,文学信息管理页面见下图。此页面紧张实现文学信息的增加、修正、删除、查看的功能。图5-1 文学信息管理页面 ### 5.1.2 书架信息管理 书架信息管理页面供应的功能操作有:新增书架,修正书架,删除书架操作。下图便是书架信息管理页面。
图5.3 书架信息管理页面 ### 5.1.3文学信息类型管理 文学信息类型管理页面显示所有文学信息类型,在此页面既可以让管理员添加新的文学信息信息类型,也能对已有的文学信息类型信息实行编辑更新,失落效的文学信息类型信息也能让管理员快速删除。下图便是文学信息类型管理页面。
图5.4 文学信息类型列表页面
第6章 系统测试
程序软件的开拓阶段也包括了系统测试,这个部分便是程序质量评定的一个主要环节,如果说程序通过编码实现功能之后,不通过测试检讨程序中涌现的缺点,那么程序一旦投入生活中运行利用时,就会产生许多大大小小的缺点,这个时候去办理问题已经晚了,以是一个程序在被交付给利用者利用之前,开拓者就须要利用多种测试方法反复进行测试,也是对程序的一个卖力表现。程序进入系统测试阶段,在讲究策略进行测试时,也须要对时效性进行把控。当开拓者测试完程序,并办理完测试期间程序产生的各种缺点时,就须要程序的验收方来对程序进行验收测试,这也是程序测试的末了一个操作步骤。验收测试也是对程序的质量以及可交付性方面起到关键的浸染。
ZhangjieCollectionServiceImpl.javapackage com.service.impl;import com.utils.StringUtil;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 com.dao.ZhangjieCollectionDao;import com.entity.ZhangjieCollectionEntity;import com.service.ZhangjieCollectionService;import com.entity.view.ZhangjieCollectionView;/ 章节收藏 做事实现类 /@Service("zhangjieCollectionService")@Transactionalpublic class ZhangjieCollectionServiceImpl extends ServiceImpl<ZhangjieCollectionDao, ZhangjieCollectionEntity> implements ZhangjieCollectionService { @Override public PageUtils queryPage(Map<String,Object> params) { if(params != null && (params.get("limit") == null || params.get("page") == null)){ params.put("page","1"); params.put("limit","10"); } Page<ZhangjieCollectionView> page =new Query<ZhangjieCollectionView>(params).getPage(); page.setRecords(baseMapper.selectListView(page,params)); return new PageUtils(page); }}
XiaoshuoServiceImpl.java
package com.service.impl;import com.utils.StringUtil;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 com.dao.XiaoshuoDao;import com.entity.XiaoshuoEntity;import com.service.XiaoshuoService;import com.entity.view.XiaoshuoView;/ 文学信息 做事实现类 /@Service("xiaoshuoService")@Transactionalpublic class XiaoshuoServiceImpl extends ServiceImpl<XiaoshuoDao, XiaoshuoEntity> implements XiaoshuoService { @Override public PageUtils queryPage(Map<String,Object> params) { if(params != null && (params.get("limit") == null || params.get("page") == null)){ params.put("page","1"); params.put("limit","10"); } Page<XiaoshuoView> page =new Query<XiaoshuoView>(params).getPage(); page.setRecords(baseMapper.selectListView(page,params)); return new PageUtils(page); }}
ZhangjieServiceImpl.java
package com.service.impl;import com.utils.StringUtil;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 com.dao.ZhangjieDao;import com.entity.ZhangjieEntity;import com.service.ZhangjieService;import com.entity.view.ZhangjieView;/ 章节 做事实现类 /@Service("zhangjieService")@Transactionalpublic class ZhangjieServiceImpl extends ServiceImpl<ZhangjieDao, ZhangjieEntity> implements ZhangjieService { @Override public PageUtils queryPage(Map<String,Object> params) { if(params != null && (params.get("limit") == null || params.get("page") == null)){ params.put("page","1"); params.put("limit","10"); } Page<ZhangjieView> page =new Query<ZhangjieView>(params).getPage(); page.setRecords(baseMapper.selectListView(page,params)); return new PageUtils(page); }}
add-or-update.vue
<template> <div class="addEdit-block"> <el-form class="detail-form-content" ref="ruleForm" :model="ruleForm" :rules="rules" label-width="80px" :style="{backgroundColor:addEditForm.addEditBoxColor}" > <el-row> <el-col :span="12"> <el-form-item class="input" v-if="type!='info'" label="收藏表类型编码" prop="codeIndex"> <el-input v-model="ruleForm.codeIndex" placeholder="收藏表类型编码" clearable :readonly="ro.codeIndex"></el-input> </el-form-item> <div v-else> <el-form-item class="input" label="收藏表类型编码" prop="codeIndex"> <el-input v-model="ruleForm.codeIndex" placeholder="收藏表类型编码" readonly></el-input> </el-form-item> </div> </el-col> <el-col :span="12"> <el-form-item class="input" v-if="type!='info'" label="收藏表类型" prop="indexName"> <el-input v-model="ruleForm.indexName" placeholder="收藏表类型" clearable :readonly="ro.indexName"></el-input> </el-form-item> <div v-else> <el-form-item class="input" label="收藏表类型" prop="indexName"> <el-input v-model="ruleForm.indexName" placeholder="收藏表类型" readonly></el-input> </el-form-item> </div> </el-col> <!--<el-col :span="12"> <el-form-item class="input" v-if="type!='info'" label="备注" prop="beizhu"> <el-input v-model="ruleForm.beizhu" placeholder="备注" clearable :readonly="ro.beizhu"></el-input> </el-form-item> <div v-else> <el-form-item class="input" label="备注" prop="beizhu"> <el-input v-model="ruleForm.beizhu" placeholder="备注" readonly></el-input> </el-form-item> </div> </el-col>--> </el-row> <el-form-item class="btn"> <el-button v-if="type!='info'" type="primary" class="btn-success" @click="onSubmit">提交</el-button> <el-button v-if="type!='info'" class="btn-close" @click="back()">取消</el-button> <el-button v-if="type=='info'" class="btn-close" @click="back()">返回</el-button> </el-form-item> </el-form> </div></template><script> import styleJs from "../../../utils/style.js"; // 数字,邮件,手机,url,身份证校验 import { isNumber,isIntNumer,isEmail,isPhone, isMobile,isURL,checkIdCard } from "@/utils/validate"; export default { data() { let self = this return { addEditForm:null, id: '', type: '', ro:{ codeIndex : true, indexName : false, superId : false, beizhu : false, }, ruleForm: { codeIndex: '', indexName: '', superId : '', beizhu : '', }, rules: { /beizhu: [ { required: true, message: '备注不能为空', trigger: 'blur' }, { pattern: /^[1-9]\d$/, message: '备注只能为正整数', trigger: 'blur' } ],/ } }; }, props: ["parent"], computed: { }, created() { this.addEditForm = styleJs.addStyle(); this.addEditStyleChange() this.addEditUploadStyleChange() }, methods: { // 初始化 init(id,type) { if (id) { this.id = id; this.type = type; } if(this.type=='info'||this.type=='else'){ this.info(id); }else{ //查询最大值 start this.$http({ url: `dictionary/maxCodeIndex`, method: "post", data: {"dicCode":"xiaoshuo_collection_types"} }).then(({ data }) => { if (data && data.code === 0) { this.ruleForm.codeIndex = data.maxCodeIndex; } else { this.$message.error(data.msg); } }); //查询最大值 end } }, // 多级联动参数 info(id) { this.$http({ url: `dictionary/info/${id}`, method: "get" }).then(({ data }) => { if (data && data.code === 0) { this.ruleForm = data.data; //办理前台上传图片后台不显示的问题 let reg=new RegExp('../../../upload','g')//g代表全部 } else { this.$message.error(data.msg); } }); }, // 提交 onSubmit() { if((!this.ruleForm.indexName)){ this.$message.error('收藏表类型不能为空'); return } this.$refs["ruleForm"].validate(valid => { if (valid) { let ruleForm = this.ruleForm; ruleForm["dicCode"]="xiaoshuo_collection_types"; ruleForm["dicName"]="收藏表类型"; this.$http({ url: `dictionary/${!this.ruleForm.id ? "save" : "update"}`, method: "post", data: ruleForm }).then(({ data }) => { if (data && data.code === 0) { this.$message({ message: "操作成功", type: "success", duration: 1500, onClose: () => { this.parent.showFlag = true; this.parent.addOrUpdateFlag = false; this.parent.dictionaryCrossAddOrUpdateFlag = false; this.parent.search(); this.parent.contentStyleChange(); } }); } else { this.$message.error(data.msg); } }); } }); }, // 返回 back() { this.parent.showFlag = true; this.parent.addOrUpdateFlag = false; this.parent.dictionaryCrossAddOrUpdateFlag = false; this.parent.contentStyleChange(); }, addEditStyleChange() { this.$nextTick(()=>{ // input document.querySelectorAll('.addEdit-block .input .el-input__inner').forEach(el=>{ el.style.height = this.addEditForm.inputHeight el.style.color = this.addEditForm.inputFontColor el.style.fontSize = this.addEditForm.inputFontSize el.style.borderWidth = this.addEditForm.inputBorderWidth el.style.borderStyle = this.addEditForm.inputBorderStyle el.style.borderColor = this.addEditForm.inputBorderColor el.style.borderRadius = this.addEditForm.inputBorderRadius el.style.backgroundColor = this.addEditForm.inputBgColor }) document.querySelectorAll('.addEdit-block .input .el-form-item__label').forEach(el=>{ el.style.lineHeight = this.addEditForm.inputHeight el.style.color = this.addEditForm.inputLableColor el.style.fontSize = this.addEditForm.inputLableFontSize }) // select document.querySelectorAll('.addEdit-block .select .el-input__inner').forEach(el=>{ el.style.height = this.addEditForm.selectHeight el.style.color = this.addEditForm.selectFontColor el.style.fontSize = this.addEditForm.selectFontSize el.style.borderWidth = this.addEditForm.selectBorderWidth el.style.borderStyle = this.addEditForm.selectBorderStyle el.style.borderColor = this.addEditForm.selectBorderColor el.style.borderRadius = this.addEditForm.selectBorderRadius el.style.backgroundColor = this.addEditForm.selectBgColor }) document.querySelectorAll('.addEdit-block .select .el-form-item__label').forEach(el=>{ el.style.lineHeight = this.addEditForm.selectHeight el.style.color = this.addEditForm.selectLableColor el.style.fontSize = this.addEditForm.selectLableFontSize }) document.querySelectorAll('.addEdit-block .select .el-select__caret').forEach(el=>{ el.style.color = this.addEditForm.selectIconFontColor el.style.fontSize = this.addEditForm.selectIconFontSize }) // date document.querySelectorAll('.addEdit-block .date .el-input__inner').forEach(el=>{ el.style.height = this.addEditForm.dateHeight el.style.color = this.addEditForm.dateFontColor el.style.fontSize = this.addEditForm.dateFontSize el.style.borderWidth = this.addEditForm.dateBorderWidth el.style.borderStyle = this.addEditForm.dateBorderStyle el.style.borderColor = this.addEditForm.dateBorderColor el.style.borderRadius = this.addEditForm.dateBorderRadius el.style.backgroundColor = this.addEditForm.dateBgColor }) document.querySelectorAll('.addEdit-block .date .el-form-item__label').forEach(el=>{ el.style.lineHeight = this.addEditForm.dateHeight el.style.color = this.addEditForm.dateLableColor el.style.fontSize = this.addEditForm.dateLableFontSize }) document.querySelectorAll('.addEdit-block .date .el-input__icon').forEach(el=>{ el.style.color = this.addEditForm.dateIconFontColor el.style.fontSize = this.addEditForm.dateIconFontSize el.style.lineHeight = this.addEditForm.dateHeight }) // upload let iconLineHeight = parseInt(this.addEditForm.uploadHeight) - parseInt(this.addEditForm.uploadBorderWidth) 2 + 'px' document.querySelectorAll('.addEdit-block .upload .el-upload--picture-card').forEach(el=>{ el.style.width = this.addEditForm.uploadHeight el.style.height = this.addEditForm.uploadHeight el.style.borderWidth = this.addEditForm.uploadBorderWidth el.style.borderStyle = this.addEditForm.uploadBorderStyle el.style.borderColor = this.addEditForm.uploadBorderColor el.style.borderRadius = this.addEditForm.uploadBorderRadius el.style.backgroundColor = this.addEditForm.uploadBgColor }) document.querySelectorAll('.addEdit-block .upload .el-form-item__label').forEach(el=>{ el.style.lineHeight = this.addEditForm.uploadHeight el.style.color = this.addEditForm.uploadLableColor el.style.fontSize = this.addEditForm.uploadLableFontSize }) document.querySelectorAll('.addEdit-block .upload .el-icon-plus').forEach(el=>{ el.style.color = this.addEditForm.uploadIconFontColor el.style.fontSize = this.addEditForm.uploadIconFontSize el.style.lineHeight = iconLineHeight el.style.display = 'block' }) // 多文本输入框 document.querySelectorAll('.addEdit-block .textarea .el-textarea__inner').forEach(el=>{ el.style.height = this.addEditForm.textareaHeight el.style.color = this.addEditForm.textareaFontColor el.style.fontSize = this.addEditForm.textareaFontSize el.style.borderWidth = this.addEditForm.textareaBorderWidth el.style.borderStyle = this.addEditForm.textareaBorderStyle el.style.borderColor = this.addEditForm.textareaBorderColor el.style.borderRadius = this.addEditForm.textareaBorderRadius el.style.backgroundColor = this.addEditForm.textareaBgColor }) document.querySelectorAll('.addEdit-block .textarea .el-form-item__label').forEach(el=>{ // el.style.lineHeight = this.addEditForm.textareaHeight el.style.color = this.addEditForm.textareaLableColor el.style.fontSize = this.addEditForm.textareaLableFontSize }) // 保存 document.querySelectorAll('.addEdit-block .btn .btn-success').forEach(el=>{ el.style.width = this.addEditForm.btnSaveWidth el.style.height = this.addEditForm.btnSaveHeight el.style.color = this.addEditForm.btnSaveFontColor el.style.fontSize = this.addEditForm.btnSaveFontSize el.style.borderWidth = this.addEditForm.btnSaveBorderWidth el.style.borderStyle = this.addEditForm.btnSaveBorderStyle el.style.borderColor = this.addEditForm.btnSaveBorderColor el.style.borderRadius = this.addEditForm.btnSaveBorderRadius el.style.backgroundColor = this.addEditForm.btnSaveBgColor }) // 返回 document.querySelectorAll('.addEdit-block .btn .btn-close').forEach(el=>{ el.style.width = this.addEditForm.btnCancelWidth el.style.height = this.addEditForm.btnCancelHeight el.style.color = this.addEditForm.btnCancelFontColor el.style.fontSize = this.addEditForm.btnCancelFontSize el.style.borderWidth = this.addEditForm.btnCancelBorderWidth el.style.borderStyle = this.addEditForm.btnCancelBorderStyle el.style.borderColor = this.addEditForm.btnCancelBorderColor el.style.borderRadius = this.addEditForm.btnCancelBorderRadius el.style.backgroundColor = this.addEditForm.btnCancelBgColor }) }) }, addEditUploadStyleChange() { this.$nextTick(()=>{ document.querySelectorAll('.addEdit-block .upload .el-upload-list--picture-card .el-upload-list__item').forEach(el=>{ el.style.width = this.addEditForm.uploadHeight el.style.height = this.addEditForm.uploadHeight el.style.borderWidth = this.addEditForm.uploadBorderWidth el.style.borderStyle = this.addEditForm.uploadBorderStyle el.style.borderColor = this.addEditForm.uploadBorderColor el.style.borderRadius = this.addEditForm.uploadBorderRadius el.style.backgroundColor = this.addEditForm.uploadBgColor }) }) }, } };</script><style lang="scss">.editor{ height: 500px; & /deep/ .ql-container { height: 310px; } } .amap-wrapper { width: 100%; height: 500px; } .search-box { position: absolute; } .addEdit-block { margin: -10px; } .detail-form-content { padding: 12px; } .btn .el-button { padding: 0; }</style>
声明
本博客适用于广泛的学术和教诲用场,包括但不限于个人学习、开拓设计,产品设计。仅供学习参考,旨在为读者供应深入理解和学术研究的材料。
java系统设计,毕设辅导