新增文件

master
Yangwl 2 years ago
parent b3671a6d77
commit bb1015b556

@ -27,6 +27,10 @@
<version>1.6.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies>
</project>

@ -7,12 +7,14 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@ -43,6 +45,14 @@ public class BaseTyreController extends BaseController
return getDataTable(list);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<BaseTyre> util = new ExcelUtil<BaseTyre>(BaseTyre.class);
util.importTemplateExcel(response, "轮胎数据");
}
/**
*
*/
@ -55,6 +65,16 @@ public class BaseTyreController extends BaseController
ExcelUtil<BaseTyre> util = new ExcelUtil<BaseTyre>(BaseTyre.class);
util.exportExcel(response, list, "轮胎基础数据");
}
@Log(title = "轮胎管理", businessType = BusinessType.IMPORT)
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
{
ExcelUtil<BaseTyre> util = new ExcelUtil<BaseTyre>(BaseTyre.class);
List<BaseTyre> baseTyreList = util.importExcel(file.getInputStream());
String operName = getUsername();
String message = baseTyreService.importTyre(baseTyreList, updateSupport, operName);
return success(message);
}
/**
*

@ -150,19 +150,19 @@ public class BaseTyre extends BaseEntity
private String produceFactory;
/** 车辆ID */
@Excel(name = "车辆ID")
private String carId;
/** 车牌号 */
@Excel(name = "车牌号")
private String carLicense;
/** 轮位拼四段式1-1-1-21第一轴左侧外总第21个胎 */
@Excel(name = "轮位", readConverterExp = "拼=四段式1-1-1-21")
// @Excel(name = "轮位", readConverterExp = "拼=四段式1-1-1-21")
private String tyrePosition;
/** 当前轮胎传感器ID */
@Excel(name = "当前轮胎传感器ID")
// @Excel(name = "当前轮胎传感器ID")
private String sensorId;
/** 当前花纹深度 */
@ -170,36 +170,36 @@ public class BaseTyre extends BaseEntity
private BigDecimal currentTextureDepth;
/** 状态 */
@Excel(name = "状态")
// @Excel(name = "状态")
private Long state;
/** 是否删除 */
@Excel(name = "是否删除")
// @Excel(name = "是否删除")
private Long isDelete;
/** 创建者ID */
@Excel(name = "创建者ID")
// @Excel(name = "创建者ID")
private String createId;
/** 创建者姓名 */
@Excel(name = "创建者姓名")
// @Excel(name = "创建者姓名")
private String createName;
/** 修改时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
// @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date modifyTime;
/** 修改者ID */
@Excel(name = "修改者ID")
// @Excel(name = "修改者ID")
private String modifyId;
/** 修改者账号 */
@Excel(name = "修改者账号")
// @Excel(name = "修改者账号")
private String modifyBy;
/** 编辑者姓名 */
@Excel(name = "编辑者姓名")
// @Excel(name = "编辑者姓名")
private String modifyName;
public void setId(String id)

@ -48,6 +48,8 @@ public interface BaseTyreMapper
*/
public int updateBaseTyre(BaseTyre baseTyre);
public int updateBaseTyreByouterTireNumber(BaseTyre baseTyre);
/**
*
*

@ -47,6 +47,8 @@ public interface IBaseTyreService
*/
public int updateBaseTyre(BaseTyre baseTyre);
public int updateBaseTyreByouterTireNumber(BaseTyre baseTyre);
/**
*
*
@ -74,4 +76,6 @@ public interface IBaseTyreService
AjaxResult getTyreLife(String outerTireNumber);
String checkBaseTyreUnique(BaseTyre baseTyre);
String importTyre(List<BaseTyre> baseTyreList, boolean isUpdateSupport, String operName);
}

@ -17,10 +17,16 @@ import com.ruoyi.common.constant.UserConstants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.bean.BeanValidators;
import com.ruoyi.system.service.ISysConfigService;
import com.ruoyi.system.service.impl.SysUserServiceImpl;
import org.apache.ibatis.session.SqlSessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -29,6 +35,7 @@ import com.ruoyi.basetyre.domain.BaseTyre;
import com.ruoyi.basetyre.service.IBaseTyreService;
import javax.annotation.Resource;
import javax.validation.Validator;
/**
* Service
@ -39,6 +46,8 @@ import javax.annotation.Resource;
@Service
public class BaseTyreServiceImpl implements IBaseTyreService
{
private static final Logger log = LoggerFactory.getLogger(BaseTyreServiceImpl.class);
@Autowired
private BaseTyreMapper baseTyreMapper;
@Resource
@ -48,6 +57,12 @@ public class BaseTyreServiceImpl implements IBaseTyreService
@Autowired
private BaseDeviceMapper baseDeviceMapper;
@Autowired
private ISysConfigService configService;
@Autowired
protected Validator validator;
/**
*
*
@ -108,6 +123,15 @@ public class BaseTyreServiceImpl implements IBaseTyreService
return baseTyreMapper.updateBaseTyre(baseTyre);
}
@Override
public int updateBaseTyreByouterTireNumber(BaseTyre baseTyre) {
LoginUser loginUser=SecurityUtils.getLoginUser();
baseTyre.setModifyTime(DateUtils.getNowDate());
baseTyre.setModifyBy(loginUser.getUserId().toString());
baseTyre.setModifyName(loginUser.getUsername());
return baseTyreMapper.updateBaseTyreByouterTireNumber(baseTyre);
}
/**
*
*
@ -313,6 +337,66 @@ public class BaseTyreServiceImpl implements IBaseTyreService
}
return UserConstants.UNIQUE;
}
@Override
public String importTyre(List<BaseTyre> baseTyreList, boolean isUpdateSupport, String operName) {
if (StringUtils.isNull(baseTyreList) || baseTyreList.size() == 0)
{
throw new ServiceException("导入用户数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (BaseTyre baseTyre : baseTyreList)
{
try
{
// 验证是否存在这个轮胎
BaseTyre u = baseTyreMapper.getTyreInfoById(baseTyre.getOuterTireNumber());
if (StringUtils.isNull(u))
{
BeanValidators.validateWithException(validator, baseTyre);
this.insertBaseTyre(baseTyre);
successNum++;
successMsg.append("<br/>" + successNum + "、轮胎 " + baseTyre.getOuterTireNumber() + " 导入成功");
}
else if (isUpdateSupport)
{
BeanValidators.validateWithException(validator, baseTyre);
this.updateBaseTyre(baseTyre);
successNum++;
successMsg.append("<br/>" + successNum + "、轮胎 " + baseTyre.getOuterTireNumber() + " 更新成功");
}
else
{
failureNum++;
failureMsg.append("<br/>" + failureNum + "、轮胎 " + baseTyre.getOuterTireNumber() + " 已存在");
}
}
catch (Exception e)
{
failureNum++;
String msg = "<br/>" + failureNum + "、账号 " + baseTyre.getOuterTireNumber() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0)
{
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
}
else
{
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
@Override
public BaseTyre getTyreInfoById(String outerTireNumber) {
return baseTyreMapper.getTyreInfoById(outerTireNumber);

@ -119,7 +119,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getTyreInfoById" parameterType="String" resultMap="BaseTyreResult">
<include refid="selectBaseTyreVo"/>
where outer_tire_number = #{outerTireNumber}
where is_delete = '0'
and outer_tire_number = #{outerTireNumber}
</select>
<select id="getTyreLife" resultType="java.util.Map">
@ -355,6 +356,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
where id = #{id}
</update>
<update id="updateBaseTyreByouterTireNumber" parameterType="BaseTyre">
update base_tyre
<trim prefix="SET" suffixOverrides=",">
<if test="tyreFactory != null">tyre_factory = #{tyreFactory},</if>
<if test="outerTireNumber != null">outer_tire_number = #{outerTireNumber},</if>
<if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if>
<if test="qualityStatus != null">quality_status = #{qualityStatus},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="materialType != null">material_type = #{materialType},</if>
<if test="materialGroup != null">material_group = #{materialGroup},</if>
<if test="productGroup != null">product_group = #{productGroup},</if>
<if test="brand != null">brand = #{brand},</if>
<if test="category != null">category = #{category},</if>
<if test="size != null">size = #{size},</if>
<if test="pattern != null">pattern = #{pattern},</if>
<if test="consPattern != null">cons_pattern = #{consPattern},</if>
<if test="hierarchy != null">hierarchy = #{hierarchy},</if>
<if test="speedLevel != null">speed_level = #{speedLevel},</if>
<if test="loadIndex != null">load_index = #{loadIndex},</if>
<if test="rimSize != null">rim_size = #{rimSize},</if>
<if test="weight != null">weight = #{weight},</if>
<if test="sectionWidth != null">section_width = #{sectionWidth},</if>
<if test="outerDiameter != null">outer_diameter = #{outerDiameter},</if>
<if test="flattening != null">flattening = #{flattening},</if>
<if test="enhanced != null">enhanced = #{enhanced},</if>
<if test="innerTube != null">inner_tube = #{innerTube},</if>
<if test="patternDepth != null">pattern_depth = #{patternDepth},</if>
<if test="ctn != null">ctn = #{ctn},</if>
<if test="type != null">type = #{type},</if>
<if test="certInfo != null">cert_info = #{certInfo},</if>
<if test="customsSpe != null">customs_spe = #{customsSpe},</if>
<if test="feCode != null">fe_code = #{feCode},</if>
<if test="feDesc != null">fe_desc = #{feDesc},</if>
<if test="produceFactory != null">produce_factory = #{produceFactory},</if>
<if test="carId != null">car_id = #{carId},</if>
<if test="carLicense != null">car_license = #{carLicense},</if>
<if test="tyrePosition != null">tyre_position = #{tyrePosition},</if>
<if test="sensorId != null">sensor_id = #{sensorId},</if>
<if test="currentTextureDepth != null">current_texture_depth = #{currentTextureDepth},</if>
<if test="state != null">state = #{state},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createName != null">create_name = #{createName},</if>
<if test="modifyTime != null">modify_time = #{modifyTime},</if>
<if test="modifyId != null">modify_id = #{modifyId},</if>
<if test="modifyBy != null">modify_by = #{modifyBy},</if>
<if test="modifyName != null">modify__name = #{modifyName},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where outer_tire_number = #{outerTireNumber}
</update>
<update id="UnInstallTyre" parameterType="BaseTyre">
update base_tyre set car_license=null,car_id=null ,sensor_id=null ,tyre_position=null ,modify_time = #{modifyTime},modify_id = #{modifyId},modify_by = #{modifyBy},modify__name = #{modifyName},current_texture_depth = #{currentTextureDepth} where id = #{id}
</update>

@ -19,7 +19,7 @@
"@element-plus/icons-vue": "2.0.10",
"@vueuse/core": "9.5.0",
"axios": "0.27.2",
"echarts": "5.4.0",
"echarts": "^5.4.0",
"element-plus": "2.2.21",
"file-saver": "2.0.5",
"fuse.js": "6.6.2",
@ -29,6 +29,7 @@
"nprogress": "0.2.0",
"pinia": "2.0.22",
"vue": "3.2.45",
"vue-count-to": "1.0.13",
"vue-cropper": "1.0.3",
"vue-i18n": "^9.2.2",
"vue-router": "4.1.4"

@ -0,0 +1,103 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme
import echarts from 'echarts/theme/macarons'
import resize from './mixins/resize'
const animationDuration = 6000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { //
type: 'shadow' // 线'line' | 'shadow'
}
},
grid: {
top: 10,
left: '2%',
right: '2%',
bottom: '3%',
containLabel: true
},
xAxis: [{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}],
yAxis: [{
type: 'value',
axisTick: {
show: false
}
}],
series: [{
name: 'pageA',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [79, 52, 200, 334, 390, 330, 220],
animationDuration
}, {
name: 'pageB',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [80, 52, 200, 334, 390, 330, 220],
animationDuration
}, {
name: 'pageC',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [30, 52, 200, 334, 390, 330, 220],
animationDuration
}]
})
}
}
}
</script>

@ -0,0 +1,136 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme
import echarts from 'echarts/theme/macarons'
import resize from './mixins/resize'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
autoResize: {
type: Boolean,
default: true
},
chartData: {
type: Object,
required: true
}
},
data() {
return {
chart: null
}
},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val)
}
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData)
},
setOptions({ expectedData, actualData } = {}) {
this.chart.setOption({
xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
boundaryGap: false,
axisTick: {
show: false
}
},
grid: {
left: 10,
right: 10,
bottom: 20,
top: 30,
containLabel: true
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
},
padding: [5, 10]
},
yAxis: {
axisTick: {
show: false
}
},
legend: {
data: ['expected', 'actual']
},
series: [{
name: 'expected', itemStyle: {
normal: {
color: '#FF005A',
lineStyle: {
color: '#FF005A',
width: 2
}
}
},
smooth: true,
type: 'line',
data: expectedData,
animationDuration: 2800,
animationEasing: 'cubicInOut'
},
{
name: 'actual',
smooth: true,
type: 'line',
itemStyle: {
normal: {
color: '#3888fa',
lineStyle: {
color: '#3888fa',
width: 2
},
areaStyle: {
color: '#f3f8ff'
}
}
},
data: actualData,
animationDuration: 2800,
animationEasing: 'quadraticOut'
}]
})
}
}
}
</script>

@ -0,0 +1,181 @@
<template>
<el-row :gutter="40" class="panel-group">
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('newVisitis')">
<div class="card-panel-icon-wrapper icon-people">
<svg-icon icon-class="peoples" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
访客
</div>
<count-to :start-val="0" :end-val="102400" :duration="2600" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('messages')">
<div class="card-panel-icon-wrapper icon-message">
<svg-icon icon-class="message" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
消息
</div>
<count-to :start-val="0" :end-val="81212" :duration="3000" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('purchases')">
<div class="card-panel-icon-wrapper icon-money">
<svg-icon icon-class="money" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
金额
</div>
<count-to :start-val="0" :end-val="9280" :duration="3200" class="card-panel-num" />
</div>
</div>
</el-col>
<el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
<div class="card-panel" @click="handleSetLineChartData('shoppings')">
<div class="card-panel-icon-wrapper icon-shopping">
<svg-icon icon-class="shopping" class-name="card-panel-icon" />
</div>
<div class="card-panel-description">
<div class="card-panel-text">
订单
</div>
<count-to :start-val="0" :end-val="13600" :duration="3600" class="card-panel-num" />
</div>
</div>
</el-col>
</el-row>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
components: {
CountTo
},
methods: {
handleSetLineChartData(type) {
this.$emit('handleSetLineChartData', type)
}
}
}
</script>
<style lang="scss" scoped>
.panel-group {
margin-top: 18px;
.card-panel-col {
margin-bottom: 32px;
}
.card-panel {
height: 108px;
cursor: pointer;
font-size: 12px;
position: relative;
overflow: hidden;
color: #666;
background: #fff;
box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
border-color: rgba(0, 0, 0, .05);
&:hover {
.card-panel-icon-wrapper {
color: #fff;
}
.icon-people {
background: #40c9c6;
}
.icon-message {
background: #36a3f7;
}
.icon-money {
background: #f4516c;
}
.icon-shopping {
background: #34bfa3
}
}
.icon-people {
color: #40c9c6;
}
.icon-message {
color: #36a3f7;
}
.icon-money {
color: #f4516c;
}
.icon-shopping {
color: #34bfa3
}
.card-panel-icon-wrapper {
float: left;
margin: 14px 0 0 14px;
padding: 16px;
transition: all 0.38s ease-out;
border-radius: 6px;
}
.card-panel-icon {
float: left;
font-size: 48px;
}
.card-panel-description {
float: right;
font-weight: bold;
margin: 26px;
margin-left: 0px;
.card-panel-text {
line-height: 18px;
color: rgba(0, 0, 0, 0.45);
font-size: 16px;
margin-bottom: 12px;
}
.card-panel-num {
font-size: 20px;
}
}
}
}
@media (max-width:550px) {
.card-panel-description {
display: none;
}
.card-panel-icon-wrapper {
float: none !important;
width: 100%;
height: 100%;
margin: 0 !important;
.svg-icon {
display: block;
margin: 14px auto !important;
float: none !important;
}
}
}
</style>

@ -0,0 +1,80 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme
import echarts from 'echarts/theme/macarons'
import resize from './mixins/resize'
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
},
legend: {
left: 'center',
bottom: '10',
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
},
series: [
{
name: 'WEEKLY WRITE ARTICLES',
type: 'pie',
roseType: 'radius',
radius: [15, 95],
center: ['50%', '38%'],
data: [
{ value: 320, name: 'Industries' },
{ value: 240, name: 'Technology' },
{ value: 149, name: 'Forex' },
{ value: 100, name: 'Gold' },
{ value: 59, name: 'Forecasts' }
],
animationEasing: 'cubicInOut',
animationDuration: 2600
}
]
})
}
}
}
</script>

@ -0,0 +1,117 @@
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts';
// require('echarts/theme/macarons.js') // echarts theme
import echarts from 'echarts/theme/macarons'
import resize from './mixins/resize'
const animationDuration = 3000
export default {
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '300px'
}
},
data() {
return {
chart: null
}
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
},
beforeDestroy() {
if (!this.chart) {
return
}
this.chart.dispose()
this.chart = null
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: { //
type: 'shadow' // 线'line' | 'shadow'
}
},
radar: {
radius: '66%',
center: ['50%', '42%'],
splitNumber: 8,
splitArea: {
areaStyle: {
color: 'rgba(127,95,132,.3)',
opacity: 1,
shadowBlur: 45,
shadowColor: 'rgba(0,0,0,.5)',
shadowOffsetX: 0,
shadowOffsetY: 15
}
},
indicator: [
{ name: 'Sales', max: 10000 },
{ name: 'Administration', max: 20000 },
{ name: 'Information Techology', max: 20000 },
{ name: 'Customer Support', max: 20000 },
{ name: 'Development', max: 20000 },
{ name: 'Marketing', max: 20000 }
]
},
legend: {
left: 'center',
bottom: '10',
data: ['Allocated Budget', 'Expected Spending', 'Actual Spending']
},
series: [{
type: 'radar',
symbolSize: 0,
areaStyle: {
normal: {
shadowBlur: 13,
shadowColor: 'rgba(0,0,0,.2)',
shadowOffsetX: 0,
shadowOffsetY: 10,
opacity: 1
}
},
data: [
{
value: [5000, 7000, 12000, 11000, 15000, 14000],
name: 'Allocated Budget'
},
{
value: [4000, 9000, 15000, 15000, 13000, 11000],
name: 'Expected Spending'
},
{
value: [5500, 11000, 12000, 15000, 12000, 12000],
name: 'Actual Spending'
}
],
animationDuration: animationDuration
}]
})
}
}
}
</script>

@ -0,0 +1,56 @@
import { debounce } from '@/utils'
export default {
data() {
return {
$_sidebarElm: null,
$_resizeHandler: null
}
},
mounted() {
this.initListener()
},
activated() {
if (!this.$_resizeHandler) {
// avoid duplication init
this.initListener()
}
// when keep-alive chart activated, auto resize
this.resize()
},
beforeDestroy() {
this.destroyListener()
},
deactivated() {
this.destroyListener()
},
methods: {
// use $_ for mixins properties
// https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential
$_sidebarResizeHandler(e) {
if (e.propertyName === 'width') {
this.$_resizeHandler()
}
},
initListener() {
this.$_resizeHandler = debounce(() => {
this.resize()
}, 100)
window.addEventListener('resize', this.$_resizeHandler)
this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0]
this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler)
},
destroyListener() {
window.removeEventListener('resize', this.$_resizeHandler)
this.$_resizeHandler = null
this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler)
},
resize() {
const { chart } = this
chart && chart.resize()
}
}
}

@ -1,88 +1,98 @@
<template>
<div class="app-container home">
<el-row :gutter="20">
<el-col :sm="24" :lg="12" style="padding-left: 20px">
<h2>若依后台管理框架</h2>
<p>
一直想做一款后台管理系统看了很多优秀的开源项目但是发现没有合适自己的于是利用空闲休息时间开始自己写一套后台系统如此有了若依管理系统她可以用于所有的Web应用程序如网站管理后台网站会员中心CMSCRMOA等等当然您也可以对她进行深度定制以做出更强系统所有前端后台代码封装过后十分精简易上手出错概率低同时支持移动客户端访问系统会陆续更新一些实用功能
</p>
<p>
<b>当前版本:</b> <span>v{{ version }}</span>
</p>
<p>
<el-tag type="danger">&yen;免费开源</el-tag>
</p>
</el-col>
</el-row>
</div>
</template>
<div class="dashboard-editor-container">
<script setup name="Index">
const version = ref('3.8.4')
<panel-group @handleSetLineChartData="handleSetLineChartData" />
</script>
<el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
<line-chart :chart-data="lineChartData" />
</el-row>
<style scoped lang="scss">
.home {
blockquote {
padding: 10px 20px;
margin: 0 0 20px;
font-size: 17.5px;
border-left: 5px solid #eee;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee;
}
.col-item {
margin-bottom: 20px;
}
<el-row :gutter="32">
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<raddar-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<bar-chart />
</div>
</el-col>
</el-row>
ul {
padding: 0;
margin: 0;
}
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
color: #676a6c;
overflow-x: hidden;
</div>
</template>
ul {
list-style-type: none;
}
<script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
h4 {
margin-top: 0px;
const lineChartData = {
newVisitis: {
expectedData: [100, 120, 161, 134, 105, 160, 165],
actualData: [120, 82, 91, 154, 162, 140, 145]
},
messages: {
expectedData: [200, 192, 120, 144, 160, 130, 140],
actualData: [180, 160, 151, 106, 145, 150, 130]
},
purchases: {
expectedData: [80, 100, 121, 104, 105, 90, 100],
actualData: [120, 90, 100, 138, 142, 130, 130]
},
shoppings: {
expectedData: [130, 140, 141, 142, 145, 150, 160],
actualData: [120, 82, 91, 154, 162, 140, 130]
}
}
h2 {
margin-top: 10px;
font-size: 26px;
font-weight: 100;
export default {
name: 'Index',
components: {
PanelGroup,
LineChart,
RaddarChart,
PieChart,
BarChart
},
data() {
return {
lineChartData: lineChartData.newVisitis
}
},
methods: {
handleSetLineChartData(type) {
this.lineChartData = lineChartData[type]
}
}
}
</script>
p {
margin-top: 10px;
<style lang="scss" scoped>
.dashboard-editor-container {
padding: 32px;
background-color: rgb(240, 242, 245);
position: relative;
b {
font-weight: 700;
.chart-wrapper {
background: #fff;
padding: 16px 16px 0;
margin-bottom: 32px;
}
}
.update-log {
ol {
display: block;
list-style-type: decimal;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0;
margin-inline-end: 0;
padding-inline-start: 40px;
@media (max-width:1024px) {
.chart-wrapper {
padding: 8px;
}
}
}
</style>

@ -1,313 +1,47 @@
<template>
<div class="app-container">
<!-- 搜索栏-->
<el-form v-show="showSearch" ref="queryRef" :inline="true" :label-width=" locale ? '90px':'140px'"
:model="queryParams">
<el-form-item :label="t('test.test.internationalization1')" prop="internationalization1">
<el-input
v-model="queryParams.internationalization1"
:placeholder=" t('common.pleaseEnter') + t('test.test.internationalization1')"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form>
<!-- 顶部操作按钮-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:add']"
icon="Plus"
plain
type="primary"
@click="handleAdd"
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:edit']"
:disabled="single"
icon="Edit"
plain
type="success"
@click="handleUpdate"
>{{ t('option.edit') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:remove']"
:disabled="multiple"
icon="Delete"
plain
type="danger"
@click="handleDelete"
>{{ t('option.remove') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:export']"
icon="Download"
plain
type="warning"
@click="handleExport"
>{{ t('option.export') }}
</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</div>
<div id="app">
<el-container>
<el-header>Header</el-header>
<el-main>Main</el-main>
</el-container>
</div>
</template>
<script name="temp" setup>
<script name="Test" setup>
import {addTest, delTest, getTest, listTest, updateTest} from "@/api/test/test";
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
const {t} = useI18n();
const locale = (Cookies.get('language') || 'zhCn') === 'zhCn'
const {proxy} = getCurrentInstance();
//
const postList = ref([]);
//
const open = ref(false);
//
const loading = ref(true);
//
const showSearch = ref(true);
// id
const ids = ref([]);
//
const single = ref(true);
//
const multiple = ref(true);
//
const total = ref(0);
//
const title = ref("");
//
const queryParams = ref({
pageNum: 1,
pageSize: 10,
internationalization1: undefined,
internationalization2: undefined,
internationalization3: undefined,
internationalization4: undefined,
internationalization5: undefined,
internationalization6: undefined,
internationalization7: undefined,
internationalization8: undefined,
internationalization9: undefined,
internationalization10: undefined,
internationalization11: undefined,
internationalization12: undefined,
internationalization13: undefined,
internationalization14: undefined,
internationalization15: undefined,
internationalization16: undefined,
internationalization17: undefined,
internationalization18: undefined,
internationalization19: undefined,
internationalization20: undefined,
isDelete: undefined,
createTime: undefined,
createId: undefined,
createBy: undefined,
createName: undefined,
modifyTime: undefined,
modifyId: undefined,
modifyBy: undefined,
modifyName: undefined,
})
//
const rules = {
brand: [{required: true, message: "轮胎品牌不能为空", trigger: "blur"}],
type: [{required: true, message: "轮胎型号不能为空", trigger: "blur"}],
serialNumber: [{required: true, message: "轮胎编号不能为空", trigger: "blur"}],
depth: [{required: true, message: "花纹深度不能为空", trigger: "blur"}],
}
//
const form = ref({
id: null,
internationalization1: null,
internationalization2: null,
internationalization3: null,
internationalization4: null,
internationalization5: null,
internationalization6: null,
internationalization7: null,
internationalization8: null,
internationalization9: null,
internationalization10: null,
internationalization11: null,
internationalization12: null,
internationalization13: null,
internationalization14: null,
internationalization15: null,
internationalization16: null,
internationalization17: null,
internationalization18: null,
internationalization19: null,
internationalization20: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null,
});
/** 查询岗位列表 */
function getList() {
loading.value = true;
listTest(queryParams.value).then(response => {
postList.value = response.rows;
total.value = response.total;
}).finally(() => {
loading.value = false;
});
}
/** 取消按钮 */
function cancel() {
open.value = false;
reset();
}
/** 表单重置 */
function reset() {
form.value = {
id: null,
internationalization1: null,
internationalization2: null,
internationalization3: null,
internationalization4: null,
internationalization5: null,
internationalization6: null,
internationalization7: null,
internationalization8: null,
internationalization9: null,
internationalization10: null,
internationalization11: null,
internationalization12: null,
internationalization13: null,
internationalization14: null,
internationalization15: null,
internationalization16: null,
internationalization17: null,
internationalization18: null,
internationalization19: null,
internationalization20: null,
isDelete: null,
createTime: null,
createId: null,
createBy: null,
createName: null,
modifyTime: null,
modifyId: null,
modifyBy: null,
modifyName: null,
};
proxy.resetForm("postRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
proxy.resetForm("queryRef");
handleQuery();
}
/** 多选框选中数据 */
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length !== 1;
multiple.value = !selection.length;
</script>
<style lang="scss">
@import url("//unpkg.com/element-ui@2.15.13/lib/theme-chalk/index.css");
.el-header, .el-footer {
background-color: #B3C0D1;
color: #333;
text-align: center;
line-height: 60px;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = t('test.test.addTitle');
.el-aside {
background-color: #D3DCE6;
color: #333;
text-align: center;
line-height: 200px;
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const postId = row.id || ids.value;
getTest(postId).then(response => {
form.value = response.data;
open.value = true;
title.value = t('test.test.editTitle');
});
.el-main {
background-color: #E9EEF3;
color: #333;
text-align: center;
line-height: 160px;
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["postRef"].validate(valid => {
if (valid) {
if (form.value.id != undefined) {
updateTest(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.modificationSuccessful'));
open.value = false;
getList();
});
} else {
addTest(form.value).then(response => {
proxy.$modal.msgSuccess(t('option.addedSuccessfully'));
open.value = false;
getList();
});
}
}
});
body > .el-container {
margin-bottom: 40px;
}
/** 删除按钮操作 */
function handleDelete(row) {
const postIds = row.postId || ids.value;
proxy.$modal.confirm(t('option.confirmDeletion', {
key: t('test.test.internationalization1'),
value: postIds
})).then(function () {
return delTest(postIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess(t('option.successfullyDeleted'));
}).catch(() => {
});
.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
line-height: 260px;
}
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/post/export", {
...queryParams.value
}, `post_${new Date().getTime()}.xlsx`);
.el-container:nth-child(7) .el-aside {
line-height: 320px;
}
getList();
</script>
</style>

@ -313,7 +313,7 @@
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的轮胎数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>

@ -96,6 +96,15 @@
>{{ t('option.remove') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="Upload"
@click="handleImport"
v-hasPermi="['system:user:import']"
>导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
@ -211,6 +220,39 @@
</div>
</template>
</el-dialog>
<!-- 用户导入对话框 -->
<el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
<el-upload
ref="uploadRef"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<el-icon class="el-icon--upload"><upload-filled /></el-icon>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<template #tip>
<div class="el-upload__tip text-center">
<div class="el-upload__tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
</div>
<span>仅允许导入xlsxlsx格式文件</span>
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate"></el-link>
</div>
</template>
</el-upload>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
@ -219,6 +261,7 @@ import {addBasetyre, delBasetyre, getBasetyre, listBasetyre, updateBasetyre} fro
import {useI18n} from 'vue-i18n';
import Cookies from "js-cookie";
import { getToken } from "@/utils/auth";
const {t} = useI18n();
@ -246,7 +289,20 @@ const multiple = ref(true);
const total = ref(0);
//
const title = ref("");
const upload = reactive({
//
open: false,
//
title: "",
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
//
url: import.meta.env.VITE_APP_BASE_API + "/basetyre/tyre/importData"
});
//
const queryParams = ref({
pageNum: 1,
@ -405,10 +461,33 @@ function handleDelete(row) {
/** 导出按钮操作 */
function handleExport() {
proxy.download("system/post/export", {
proxy.download("basetyre/tyre/export", {
...queryParams.value
}, `post_${new Date().getTime()}.xlsx`);
}
/** 下载模板操作 */
function importTemplate() {
proxy.download("basetyre/tyre/importTemplate", {
}, `轮胎信息导入模板_${new Date().getTime()}.xlsx`);
};
/** 文件上传成功处理 */
const handleFileSuccess = (response, file, fileList) => {
upload.open = false;
upload.isUploading = false;
proxy.$refs["uploadRef"].handleRemove(file);
proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
getList();
};
/** 提交上传文件 */
function submitFileForm() {
proxy.$refs["uploadRef"].submit();
};
/** 导入按钮操作 */
function handleImport() {
upload.title = "轮胎信息导入";
upload.open = true;
};
getList();
</script>

@ -75,27 +75,27 @@
<!-- 顶部操作按钮-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="Plus"
@click="handleAdd"
v-hasPermi="['basetyre:basetyre:add']"
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['basetyre:basetyre:remove']"
>{{ t('option.remove') }}
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="Plus"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['basetyre:basetyre:add']"-->
<!-- >{{ t('option.add') }}-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="Delete"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['basetyre:basetyre:remove']"-->
<!-- >{{ t('option.remove') }}-->
<!-- </el-button>-->
<!-- </el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -138,18 +138,18 @@
<el-table-column label="胎胚编码" align="center" prop="feCode" width="150"/>
<el-table-column label="胎胚描述" align="center" prop="feDesc" width="150"/>
<el-table-column label="生产工厂" align="center" prop="produceFactory" width="150"/>
<el-table-column :label="t('option.option')" align="center" class-name="small-padding fixed-width" fixed="right"
width="160">
<template #default="scope">
<el-button
type="text"
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['basetyre:basetyre:edit']"
>{{ t('option.edit') }}
</el-button>
</template>
</el-table-column>
<!-- <el-table-column :label="t('option.option')" align="center" class-name="small-padding fixed-width" fixed="right"-->
<!-- width="160">-->
<!-- <template #default="scope">-->
<!-- <el-button-->
<!-- type="text"-->
<!-- icon="Edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['basetyre:basetyre:edit']"-->
<!-- >{{ t('option.edit') }}-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!-- 分页-->

Loading…
Cancel
Save