1、前端积分列表以及添加积分实现
2、暂时删除国际化配置文件
3、坑:spring扫描多个宝需要:@ComponentScans( {@ComponentScan("com.ruoyi"),@ComponentScan("com.xjs")} )
4、META-INF/spring.factories作用自动注入bean然后springboot自动扫描到
This commit is contained in:
parent
dbf7396c1b
commit
fb346dde65
|
|
@ -4,6 +4,7 @@ import com.ruoyi.common.security.config.ApplicationConfig;
|
|||
import com.ruoyi.common.security.feign.FeignAutoConfiguration;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.ComponentScans;
|
||||
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
|
@ -24,7 +25,7 @@ import java.lang.annotation.*;
|
|||
// 自动加载类
|
||||
@Import({ ApplicationConfig.class, FeignAutoConfiguration.class })
|
||||
//自定义bean扫描,添加xjs路径下的bean
|
||||
@ComponentScan(basePackages = {"com.ruoyi","com.xjs"})
|
||||
@ComponentScans( {@ComponentScan("com.ruoyi"),@ComponentScan("com.xjs")} )
|
||||
@EnableTransactionManagement
|
||||
public @interface EnableCustomConfig
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 获取积分列表
|
||||
export function getList() {
|
||||
return request({
|
||||
url: '/srb_core//admin/core/integralGrade/list',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
// 删除积分列表
|
||||
export function removeById(id) {
|
||||
return request({
|
||||
url: '/srb_core//admin/core/integralGrade/remove/'+id,
|
||||
method: 'delete',
|
||||
})
|
||||
}
|
||||
|
||||
// 新增积分列表
|
||||
export function save(integral) {
|
||||
return request({
|
||||
url: '/srb_core//admin/core/integralGrade/save',
|
||||
method: 'post',
|
||||
data:integral
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 修改积分列表
|
||||
export function update(integral) {
|
||||
return request({
|
||||
url: '/srb_core//admin/core/integralGrade/update',
|
||||
method: 'put',
|
||||
data:integral
|
||||
})
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
<template>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "IntegralAdd"
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
|
||||
<el-form-item label-width="120px" label="借款额度" prop="borrowAmount">
|
||||
<el-input-number v-model="formData.borrowAmount" placeholder="借款额度" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="积分区间开始" prop="integralStart">
|
||||
<el-input-number v-model="formData.integralStart" placeholder="积分区间开始" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="120px" label="积分区间结束" prop="integralEnd">
|
||||
<el-input-number v-model="formData.integralEnd" placeholder="积分区间结束" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">提交</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import {save,update} from "@/api/srb/core/integral";
|
||||
|
||||
export default {
|
||||
name: 'IntegralForm',
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
borrowAmount: undefined,
|
||||
integralStart: undefined,
|
||||
integralEnd: undefined,
|
||||
},
|
||||
rules: {
|
||||
borrowAmount: [{
|
||||
required: true,
|
||||
message: '借款额度',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
integralStart: [{
|
||||
required: true,
|
||||
message: '积分区间开始',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
integralEnd: [{
|
||||
required: true,
|
||||
message: '积分区间结束',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs['elForm'].validate(valid => {
|
||||
if (!valid) return
|
||||
|
||||
this.saveData()
|
||||
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
//新增
|
||||
saveData() {
|
||||
save(this.formData).then(res=>{
|
||||
this.$modal.notifySuccess("保存成功");
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,10 +1,85 @@
|
|||
<template>
|
||||
|
||||
<div class="app-container">
|
||||
<el-table :data="list" border stripe>
|
||||
|
||||
<el-table-column label="借款额度(¥)" align="center" prop="borrowAmount" :show-overflow-tooltip="true">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.borrowAmount }}¥</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="积分区间开始" align="center" prop="integralStart" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="积分区间结束" align="center" prop="integralEnd" :show-overflow-tooltip="true"/>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
||||
<el-popconfirm
|
||||
confirm-button-text='好的'
|
||||
cancel-button-text='不用了'
|
||||
icon="el-icon-info"
|
||||
icon-color="red"
|
||||
title="确定删除吗?"
|
||||
@confirm="removeById(scope.row.id)"
|
||||
>
|
||||
<el-button
|
||||
type="info"
|
||||
size="small"
|
||||
slot="reference"
|
||||
icon="el-icon-delete"
|
||||
v-hasPermi="['srb:integralGrade:remove']"
|
||||
>
|
||||
</el-button>
|
||||
</el-popconfirm>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {getList, removeById} from "@/api/srb/core/integral";
|
||||
|
||||
export default {
|
||||
name: "IntegralIndex"
|
||||
name: "IntegralIndex",
|
||||
|
||||
data() {
|
||||
return {
|
||||
|
||||
list: [],
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.fetchData()
|
||||
},
|
||||
|
||||
methods: {
|
||||
//获取数据
|
||||
fetchData() {
|
||||
getList().then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
|
||||
//删除
|
||||
removeById(id) {
|
||||
removeById(id).then(() => {
|
||||
this.$modal.notifySuccess("删除成功");
|
||||
this.fetchData()
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
package com.xjs.config;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.LocaleResolver;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 自定义国际化解析器
|
||||
* todo 暂时未配置国际化
|
||||
* @author xiejs
|
||||
* @since 2022-02-09
|
||||
*/
|
||||
@Configuration
|
||||
public class LocaleResolverConfig implements LocaleResolver {
|
||||
@Override
|
||||
public Locale resolveLocale(HttpServletRequest httpServletRequest) {
|
||||
// 获取页面手动切换传递的语言参数l
|
||||
String l = httpServletRequest.getParameter("l");
|
||||
// 获取请求头自动传递的语言参数Accept-Language
|
||||
String header = httpServletRequest.getHeader("Accept-Language");
|
||||
Locale locale = null;
|
||||
// 如果手动切换参数不为空,就根据手动参数进行语言切换,否则默认根据请求头信息切换
|
||||
if (!StringUtils.isEmpty(l)) {
|
||||
String[] split = l.split("_");
|
||||
locale = new Locale(split[0], split[1]);
|
||||
} else {
|
||||
// Accept-Language: en-US,en;q=0.9
|
||||
String[] splits = header.split(",");
|
||||
String[] split = splits[0].split("-");
|
||||
locale = new Locale(split[0], split[1]);
|
||||
}
|
||||
return locale;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) {
|
||||
|
||||
}
|
||||
|
||||
@Bean
|
||||
public LocaleResolver localeResolver(){
|
||||
return new LocaleResolverConfig();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||
com.xjs.config.FeignConfig,\
|
||||
com.xjs.config.JsonConfig,\
|
||||
com.xjs.config.MybatisPlusConfig,\
|
||||
com.xjs.config.WebMvcConfig
|
||||
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ public class IntegralGradeController extends MyBaseController<IntegralGrade> {
|
|||
@ApiOperation("保存积分等级")
|
||||
@RequiresPermissions("srb:integralGrade:save")
|
||||
@Log(title = "融-积分管理", businessType = BusinessType.INSERT)
|
||||
public AjaxResult save(IntegralGrade integralGrade) {
|
||||
public AjaxResult save(@RequestBody IntegralGrade integralGrade) {
|
||||
return toAjax(integralGradeService.save(integralGrade));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue