!316 增加全局超长number序列化 vue3 pay模块重构
Merge pull request !316 from xingyu/feature/vue3
This commit is contained in:
commit
cb0daf3c23
|
@ -2,17 +2,20 @@ package cn.iocoder.yudao.ssodemo.framework.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
|
import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
|
||||||
import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
|
import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
@EnableWebSecurity
|
||||||
|
public class SecurityConfiguration{
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TokenAuthenticationFilter tokenAuthenticationFilter;
|
private TokenAuthenticationFilter tokenAuthenticationFilter;
|
||||||
|
@ -22,8 +25,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
@Resource
|
@Resource
|
||||||
private AuthenticationEntryPoint authenticationEntryPoint;
|
private AuthenticationEntryPoint authenticationEntryPoint;
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity httpSecurity) throws Exception {
|
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
||||||
// 设置 URL 安全权限
|
// 设置 URL 安全权限
|
||||||
httpSecurity.csrf().disable() // 禁用 CSRF 保护
|
httpSecurity.csrf().disable() // 禁用 CSRF 保护
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
|
@ -43,6 +46,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
// 添加 Token Filter
|
// 添加 Token Filter
|
||||||
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
|
return httpSecurity.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,20 @@ package cn.iocoder.yudao.ssodemo.framework.config;
|
||||||
|
|
||||||
import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
|
import cn.iocoder.yudao.ssodemo.framework.core.filter.TokenAuthenticationFilter;
|
||||||
import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
|
import cn.iocoder.yudao.ssodemo.framework.core.handler.AccessDeniedHandlerImpl;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@Configuration(proxyBeanMethods = false)
|
@Configuration(proxyBeanMethods = false)
|
||||||
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
@EnableWebSecurity
|
||||||
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TokenAuthenticationFilter tokenAuthenticationFilter;
|
private TokenAuthenticationFilter tokenAuthenticationFilter;
|
||||||
|
@ -22,8 +25,8 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
@Resource
|
@Resource
|
||||||
private AuthenticationEntryPoint authenticationEntryPoint;
|
private AuthenticationEntryPoint authenticationEntryPoint;
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity httpSecurity) throws Exception {
|
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
||||||
// 设置 URL 安全权限
|
// 设置 URL 安全权限
|
||||||
httpSecurity.csrf().disable() // 禁用 CSRF 保护
|
httpSecurity.csrf().disable() // 禁用 CSRF 保护
|
||||||
.authorizeRequests()
|
.authorizeRequests()
|
||||||
|
@ -43,6 +46,7 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
// 添加 Token Filter
|
// 添加 Token Filter
|
||||||
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
httpSecurity.addFilterBefore(tokenAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
|
return httpSecurity.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
public class SetUtils {
|
public class SetUtils {
|
||||||
|
|
||||||
|
@SafeVarargs
|
||||||
public static <T> Set<T> asSet(T... objs) {
|
public static <T> Set<T> asSet(T... objs) {
|
||||||
return new HashSet<>(Arrays.asList(objs));
|
return new HashSet<>(Arrays.asList(objs));
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ public class YudaoAuthRequestFactory extends AuthRequestFactory {
|
||||||
* @param source {@link AuthSource}
|
* @param source {@link AuthSource}
|
||||||
* @return {@link AuthRequest}
|
* @return {@link AuthRequest}
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public AuthRequest get(String source) {
|
public AuthRequest get(String source) {
|
||||||
// 先尝试获取自定义扩展的
|
// 先尝试获取自定义扩展的
|
||||||
AuthRequest authRequest = getExtendRequest(source);
|
AuthRequest authRequest = getExtendRequest(source);
|
||||||
|
|
|
@ -5,16 +5,16 @@ import cn.iocoder.yudao.framework.web.config.WebProperties;
|
||||||
import com.google.common.collect.HashMultimap;
|
import com.google.common.collect.HashMultimap;
|
||||||
import com.google.common.collect.Multimap;
|
import com.google.common.collect.Multimap;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.http.HttpMethod;
|
import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
|
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
import org.springframework.security.web.AuthenticationEntryPoint;
|
import org.springframework.security.web.AuthenticationEntryPoint;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.access.AccessDeniedHandler;
|
import org.springframework.security.web.access.AccessDeniedHandler;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
@ -34,7 +34,7 @@ import java.util.Set;
|
||||||
*/
|
*/
|
||||||
@AutoConfiguration
|
@AutoConfiguration
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
||||||
public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdapter {
|
public class YudaoWebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private WebProperties webProperties;
|
private WebProperties webProperties;
|
||||||
|
@ -72,11 +72,9 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap
|
||||||
* 由于 Spring Security 创建 AuthenticationManager 对象时,没声明 @Bean 注解,导致无法被注入
|
* 由于 Spring Security 创建 AuthenticationManager 对象时,没声明 @Bean 注解,导致无法被注入
|
||||||
* 通过覆写父类的该方法,添加 @Bean 注解,解决该问题
|
* 通过覆写父类的该方法,添加 @Bean 注解,解决该问题
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(AuthenticationManager.class)
|
public AuthenticationManager authenticationManagerBean(AuthenticationConfiguration authenticationConfiguration) throws Exception {
|
||||||
public AuthenticationManager authenticationManagerBean() throws Exception {
|
return authenticationConfiguration.getAuthenticationManager();
|
||||||
return super.authenticationManagerBean();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -96,8 +94,8 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap
|
||||||
* rememberMe | 允许通过remember-me登录的用户访问
|
* rememberMe | 允许通过remember-me登录的用户访问
|
||||||
* authenticated | 用户登录后可访问
|
* authenticated | 用户登录后可访问
|
||||||
*/
|
*/
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity httpSecurity) throws Exception {
|
protected SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception {
|
||||||
// 登出
|
// 登出
|
||||||
httpSecurity
|
httpSecurity
|
||||||
// 开启跨域
|
// 开启跨域
|
||||||
|
@ -141,6 +139,8 @@ public class YudaoWebSecurityConfigurerAdapter extends WebSecurityConfigurerAdap
|
||||||
|
|
||||||
// 添加 Token Filter
|
// 添加 Token Filter
|
||||||
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
|
httpSecurity.addFilterBefore(authenticationTokenFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
|
|
||||||
|
return httpSecurity.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String buildAppApi(String url) {
|
private String buildAppApi(String url) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package cn.iocoder.yudao.framework.jackson.config;
|
package cn.iocoder.yudao.framework.jackson.config;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.jackson.core.databind.NumberSerializer;
|
||||||
import cn.iocoder.yudao.framework.jackson.core.databind.LocalDateTimeDeserializer;
|
import cn.iocoder.yudao.framework.jackson.core.databind.LocalDateTimeDeserializer;
|
||||||
import cn.iocoder.yudao.framework.jackson.core.databind.LocalDateTimeSerializer;
|
import cn.iocoder.yudao.framework.jackson.core.databind.LocalDateTimeSerializer;
|
||||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
|
@ -32,8 +33,8 @@ public class YudaoJacksonAutoConfiguration {
|
||||||
* 2. 新增LocalDateTime序列化、反序列化规则
|
* 2. 新增LocalDateTime序列化、反序列化规则
|
||||||
*/
|
*/
|
||||||
simpleModule
|
simpleModule
|
||||||
// .addSerializer(Long.class, ToStringSerializer.instance)
|
.addSerializer(Long.class, NumberSerializer.INSTANCE)
|
||||||
// .addSerializer(Long.TYPE, ToStringSerializer.instance)
|
.addSerializer(Long.TYPE, NumberSerializer.INSTANCE)
|
||||||
.addSerializer(LocalDateTime.class, LocalDateTimeSerializer.INSTANCE)
|
.addSerializer(LocalDateTime.class, LocalDateTimeSerializer.INSTANCE)
|
||||||
.addDeserializer(LocalDateTime.class, LocalDateTimeDeserializer.INSTANCE);
|
.addDeserializer(LocalDateTime.class, LocalDateTimeDeserializer.INSTANCE);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package cn.iocoder.yudao.framework.jackson.core.databind;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JacksonStdImpl;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
/**
|
||||||
|
* Long序列化规则
|
||||||
|
* <p>
|
||||||
|
* 会将超长long值转换为string
|
||||||
|
*/
|
||||||
|
@JacksonStdImpl
|
||||||
|
public class NumberSerializer extends com.fasterxml.jackson.databind.ser.std.NumberSerializer {
|
||||||
|
private static final long MAX_SAFE_INTEGER = 9007199254740991L;
|
||||||
|
private static final long MIN_SAFE_INTEGER = -9007199254740991L;
|
||||||
|
|
||||||
|
public static final NumberSerializer INSTANCE = new NumberSerializer(Number.class);
|
||||||
|
public NumberSerializer(Class<? extends Number> rawType) {
|
||||||
|
super(rawType);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void serialize(Number value, JsonGenerator gen, SerializerProvider serializers) throws IOException {
|
||||||
|
// 超出范围 序列化位字符串
|
||||||
|
if (value.longValue() > MIN_SAFE_INTEGER && value.longValue() < MAX_SAFE_INTEGER) {
|
||||||
|
super.serialize(value, gen, serializers);
|
||||||
|
} else {
|
||||||
|
gen.writeString(value.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
|
@ -3,10 +3,10 @@ import request from '@/config/axios'
|
||||||
export interface ${simpleClassName}VO {
|
export interface ${simpleClassName}VO {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if ($column.createOperation || $column.updateOperation)
|
#if ($column.createOperation || $column.updateOperation)
|
||||||
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer")
|
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
|
||||||
${column.javaField}: number
|
${column.javaField}: number
|
||||||
#elseif(${column.javaType.toLowerCase()} == "date")
|
#elseif(${column.javaType.toLowerCase()} == "date")
|
||||||
${column.javaField}: string
|
${column.javaField}: Date
|
||||||
#else
|
#else
|
||||||
${column.javaField}: ${column.javaType.toLowerCase()}
|
${column.javaField}: ${column.javaType.toLowerCase()}
|
||||||
#end
|
#end
|
||||||
|
@ -17,10 +17,10 @@ export interface ${simpleClassName}VO {
|
||||||
export interface ${simpleClassName}PageReqVO extends PageParam {
|
export interface ${simpleClassName}PageReqVO extends PageParam {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.listOperation})##查询操作
|
#if (${column.listOperation})##查询操作
|
||||||
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer")
|
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
|
||||||
${column.javaField}?: number
|
${column.javaField}?: number
|
||||||
#elseif(${column.javaType.toLowerCase()} == "date")
|
#elseif(${column.javaType.toLowerCase()} == "date")
|
||||||
${column.javaField}?: string[]
|
${column.javaField}?: Date[]
|
||||||
#else
|
#else
|
||||||
${column.javaField}?: ${column.javaType.toLowerCase()}
|
${column.javaField}?: ${column.javaType.toLowerCase()}
|
||||||
#end
|
#end
|
||||||
|
@ -31,7 +31,7 @@ export interface ${simpleClassName}PageReqVO extends PageParam {
|
||||||
export interface ${simpleClassName}ExcelReqVO {
|
export interface ${simpleClassName}ExcelReqVO {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if (${column.listOperation})##查询操作
|
#if (${column.listOperation})##查询操作
|
||||||
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer")
|
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
|
||||||
${column.javaField}?: number
|
${column.javaField}?: number
|
||||||
#elseif(${column.javaType.toLowerCase()} == "date")
|
#elseif(${column.javaType.toLowerCase()} == "date")
|
||||||
${column.javaField}?: string[]
|
${column.javaField}?: string[]
|
||||||
|
|
|
@ -30,6 +30,7 @@ public class CaptchaController extends com.anji.captcha.controller.CaptchaContro
|
||||||
@ApiOperation("获得验证码")
|
@ApiOperation("获得验证码")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
@Override
|
||||||
public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
||||||
return super.get(data, request);
|
return super.get(data, request);
|
||||||
}
|
}
|
||||||
|
@ -38,6 +39,7 @@ public class CaptchaController extends com.anji.captcha.controller.CaptchaContro
|
||||||
@ApiOperation("校验验证码")
|
@ApiOperation("校验验证码")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
@Override
|
||||||
public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {
|
||||||
return super.check(data, request);
|
return super.check(data, request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@
|
||||||
"vite-plugin-svg-icons": "^2.0.1",
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
"vite-plugin-vue-setup-extend": "^0.4.0",
|
"vite-plugin-vue-setup-extend": "^0.4.0",
|
||||||
"vite-plugin-windicss": "^1.8.8",
|
"vite-plugin-windicss": "^1.8.8",
|
||||||
"vue-tsc": "^1.0.9",
|
"vue-tsc": "^1.0.10",
|
||||||
"windicss": "^3.5.6"
|
"windicss": "^3.5.6"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,14 +1,17 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
printWidth: 100,
|
printWidth: 100, // 每行代码长度(默认80)
|
||||||
tabWidth: 2,
|
tabWidth: 2, // 每个tab相当于多少个空格(默认2)ab进行缩进(默认false)
|
||||||
useTabs: false,
|
useTabs: false, // 是否使用tab
|
||||||
semi: false,
|
semi: false, // 声明结尾使用分号(默认true)
|
||||||
vueIndentScriptAndStyle: false,
|
vueIndentScriptAndStyle: false,
|
||||||
singleQuote: true,
|
singleQuote: true, // 使用单引号(默认false)
|
||||||
quoteProps: 'as-needed',
|
quoteProps: 'as-needed',
|
||||||
bracketSpacing: true,
|
bracketSpacing: true, // 对象字面量的大括号间使用空格(默认true)
|
||||||
trailingComma: 'none',
|
trailingComma: 'none', // 多行使用拖尾逗号(默认none)
|
||||||
jsxSingleQuote: false,
|
jsxSingleQuote: false,
|
||||||
|
// 箭头函数参数括号 默认avoid 可选 avoid| always
|
||||||
|
// avoid 能省略括号的时候就省略 例如x => x
|
||||||
|
// always 总是有括号
|
||||||
arrowParens: 'always',
|
arrowParens: 'always',
|
||||||
insertPragma: false,
|
insertPragma: false,
|
||||||
requirePragma: false,
|
requirePragma: false,
|
||||||
|
|
|
@ -1,8 +1,44 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import type { AppVO } from './types'
|
|
||||||
|
export interface AppVO {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
status: number
|
||||||
|
remark: string
|
||||||
|
payNotifyUrl: string
|
||||||
|
refundNotifyUrl: string
|
||||||
|
merchantId: number
|
||||||
|
merchantName: string
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppPageReqVO extends PageParam {
|
||||||
|
name?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
payNotifyUrl?: string
|
||||||
|
refundNotifyUrl?: string
|
||||||
|
merchantName?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppExportReqVO {
|
||||||
|
name?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
payNotifyUrl?: string
|
||||||
|
refundNotifyUrl?: string
|
||||||
|
merchantName?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AppUpdateStatusReqVO {
|
||||||
|
id: number
|
||||||
|
status: number
|
||||||
|
}
|
||||||
|
|
||||||
// 查询列表支付应用
|
// 查询列表支付应用
|
||||||
export const getAppPageApi = (params) => {
|
export const getAppPageApi = (params: AppPageReqVO) => {
|
||||||
return request.get({ url: '/pay/app/page', params })
|
return request.get({ url: '/pay/app/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +58,7 @@ export const updateAppApi = (data: AppVO) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 支付应用信息状态修改
|
// 支付应用信息状态修改
|
||||||
export const changeAppStatusApi = (id: number, status: number) => {
|
export const changeAppStatusApi = (data: AppUpdateStatusReqVO) => {
|
||||||
const data = {
|
|
||||||
id,
|
|
||||||
status
|
|
||||||
}
|
|
||||||
return request.put({ url: '/pay/app/update-status', data: data })
|
return request.put({ url: '/pay/app/update-status', data: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +68,7 @@ export const deleteAppApi = (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出支付应用
|
// 导出支付应用
|
||||||
export const exportAppApi = (params) => {
|
export const exportAppApi = (params: AppExportReqVO) => {
|
||||||
return request.download({ url: '/pay/app/export-excel', params })
|
return request.download({ url: '/pay/app/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
export type AppVO = {
|
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
status: number
|
|
||||||
remark: string
|
|
||||||
payNotifyUrl: string
|
|
||||||
refundNotifyUrl: string
|
|
||||||
merchantName: string
|
|
||||||
merchantId: number
|
|
||||||
createTime: string
|
|
||||||
}
|
|
|
@ -1,8 +1,41 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import type { ChannelVO } from './types'
|
|
||||||
|
export interface ChannelVO {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
config: string
|
||||||
|
status: number
|
||||||
|
remark: string
|
||||||
|
feeRate: number
|
||||||
|
merchantId: number
|
||||||
|
appId: number
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChannelPageReqVO extends PageParam {
|
||||||
|
code?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
feeRate?: number
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
config?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChannelExportReqVO {
|
||||||
|
code?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
feeRate?: number
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
config?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
// 查询列表支付渠道
|
// 查询列表支付渠道
|
||||||
export const getChannelPageApi = (params) => {
|
export const getChannelPageApi = (params: ChannelPageReqVO) => {
|
||||||
return request.get({ url: '/pay/channel/page', params })
|
return request.get({ url: '/pay/channel/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +65,6 @@ export const deleteChannelApi = (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出支付渠道
|
// 导出支付渠道
|
||||||
export const exportChannelApi = (params) => {
|
export const exportChannelApi = (params: ChannelExportReqVO) => {
|
||||||
return request.download({ url: '/pay/channel/export-excel', params })
|
return request.download({ url: '/pay/channel/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
export type ChannelVO = {
|
|
||||||
id: number
|
|
||||||
code: string
|
|
||||||
config: string
|
|
||||||
status: number
|
|
||||||
remark: string
|
|
||||||
feeRate: number
|
|
||||||
merchantId: number
|
|
||||||
appId: number
|
|
||||||
createTime: string
|
|
||||||
}
|
|
|
@ -1,8 +1,35 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import type { MerchantVO } from './types'
|
|
||||||
|
export interface MerchantVO {
|
||||||
|
id: number
|
||||||
|
no: string
|
||||||
|
name: string
|
||||||
|
shortName: string
|
||||||
|
status: number
|
||||||
|
remark: string
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MerchantPageReqVO extends PageParam {
|
||||||
|
no?: string
|
||||||
|
name?: string
|
||||||
|
shortName?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MerchantExportReqVO {
|
||||||
|
no?: string
|
||||||
|
name?: string
|
||||||
|
shortName?: string
|
||||||
|
status?: number
|
||||||
|
remark?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
// 查询列表支付商户
|
// 查询列表支付商户
|
||||||
export const getMerchantPageApi = (params) => {
|
export const getMerchantPageApi = (params: MerchantPageReqVO) => {
|
||||||
return request.get({ url: '/pay/merchant/page', params })
|
return request.get({ url: '/pay/merchant/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +64,7 @@ export const deleteMerchantApi = (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出支付商户
|
// 导出支付商户
|
||||||
export const exportMerchantApi = (params) => {
|
export const exportMerchantApi = (params: MerchantExportReqVO) => {
|
||||||
return request.download({ url: '/pay/merchant/export-excel', params })
|
return request.download({ url: '/pay/merchant/export-excel', params })
|
||||||
}
|
}
|
||||||
// 支付商户状态修改
|
// 支付商户状态修改
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
export type MerchantVO = {
|
|
||||||
id: number
|
|
||||||
no: string
|
|
||||||
name: string
|
|
||||||
shortName: string
|
|
||||||
status: number
|
|
||||||
remark: string
|
|
||||||
createTime: string
|
|
||||||
}
|
|
|
@ -1,8 +1,85 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import type { OrderVO } from './types'
|
|
||||||
|
export interface OrderVO {
|
||||||
|
id: number
|
||||||
|
merchantId: number
|
||||||
|
appId: number
|
||||||
|
channelId: number
|
||||||
|
channelCode: string
|
||||||
|
merchantOrderId: string
|
||||||
|
subject: string
|
||||||
|
body: string
|
||||||
|
notifyUrl: string
|
||||||
|
notifyStatus: number
|
||||||
|
amount: number
|
||||||
|
channelFeeRate: number
|
||||||
|
channelFeeAmount: number
|
||||||
|
status: number
|
||||||
|
userIp: string
|
||||||
|
expireTime: Date
|
||||||
|
successTime: Date
|
||||||
|
notifyTime: Date
|
||||||
|
successExtensionId: number
|
||||||
|
refundStatus: number
|
||||||
|
refundTimes: number
|
||||||
|
refundAmount: number
|
||||||
|
channelUserId: string
|
||||||
|
channelOrderNo: string
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderPageReqVO extends PageParam {
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
channelId?: number
|
||||||
|
channelCode?: string
|
||||||
|
merchantOrderId?: string
|
||||||
|
subject?: string
|
||||||
|
body?: string
|
||||||
|
notifyUrl?: string
|
||||||
|
notifyStatus?: number
|
||||||
|
amount?: number
|
||||||
|
channelFeeRate?: number
|
||||||
|
channelFeeAmount?: number
|
||||||
|
status?: number
|
||||||
|
expireTime?: Date[]
|
||||||
|
successTime?: Date[]
|
||||||
|
notifyTime?: Date[]
|
||||||
|
successExtensionId?: number
|
||||||
|
refundStatus?: number
|
||||||
|
refundTimes?: number
|
||||||
|
channelUserId?: string
|
||||||
|
channelOrderNo?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface OrderExportReqVO {
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
channelId?: number
|
||||||
|
channelCode?: string
|
||||||
|
merchantOrderId?: string
|
||||||
|
subject?: string
|
||||||
|
body?: string
|
||||||
|
notifyUrl?: string
|
||||||
|
notifyStatus?: number
|
||||||
|
amount?: number
|
||||||
|
channelFeeRate?: number
|
||||||
|
channelFeeAmount?: number
|
||||||
|
status?: number
|
||||||
|
expireTime?: Date[]
|
||||||
|
successTime?: Date[]
|
||||||
|
notifyTime?: Date[]
|
||||||
|
successExtensionId?: number
|
||||||
|
refundStatus?: number
|
||||||
|
refundTimes?: number
|
||||||
|
channelUserId?: string
|
||||||
|
channelOrderNo?: string
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
// 查询列表支付订单
|
// 查询列表支付订单
|
||||||
export const getOrderPageApi = async (params) => {
|
export const getOrderPageApi = async (params: OrderPageReqVO) => {
|
||||||
return await request.get({ url: '/pay/order/page', params })
|
return await request.get({ url: '/pay/order/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +104,6 @@ export const deleteOrderApi = async (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出支付订单
|
// 导出支付订单
|
||||||
export const exportOrderApi = async (params) => {
|
export const exportOrderApi = async (params: OrderExportReqVO) => {
|
||||||
return await request.download({ url: '/pay/order/export-excel', params })
|
return await request.download({ url: '/pay/order/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
export type OrderVO = {
|
|
||||||
id: number
|
|
||||||
merchantId: number
|
|
||||||
appId: number
|
|
||||||
channelId: number
|
|
||||||
channelCode: string
|
|
||||||
merchantOrderId: string
|
|
||||||
subject: string
|
|
||||||
body: string
|
|
||||||
notifyUrl: string
|
|
||||||
notifyStatus: number
|
|
||||||
amount: number
|
|
||||||
channelFeeRate: number
|
|
||||||
channelFeeAmount: number
|
|
||||||
status: number
|
|
||||||
userIp: string
|
|
||||||
expireTime: string
|
|
||||||
successTime: string
|
|
||||||
notifyTime: string
|
|
||||||
successExtensionId: number
|
|
||||||
refundStatus: number
|
|
||||||
refundTimes: number
|
|
||||||
refundAmount: number
|
|
||||||
channelUserId: string
|
|
||||||
channelOrderNo: string
|
|
||||||
}
|
|
|
@ -1,8 +1,92 @@
|
||||||
import request from '@/config/axios'
|
import request from '@/config/axios'
|
||||||
import type { RefundVO } from './types'
|
|
||||||
|
export interface RefundVO {
|
||||||
|
id: number
|
||||||
|
merchantId: number
|
||||||
|
appId: number
|
||||||
|
channelId: number
|
||||||
|
channelCode: string
|
||||||
|
orderId: string
|
||||||
|
tradeNo: string
|
||||||
|
merchantOrderId: string
|
||||||
|
merchantRefundNo: string
|
||||||
|
notifyUrl: string
|
||||||
|
notifyStatus: number
|
||||||
|
status: number
|
||||||
|
type: number
|
||||||
|
payAmount: number
|
||||||
|
refundAmount: number
|
||||||
|
reason: string
|
||||||
|
userIp: string
|
||||||
|
channelOrderNo: string
|
||||||
|
channelRefundNo: string
|
||||||
|
channelErrorCode: string
|
||||||
|
channelErrorMsg: string
|
||||||
|
channelExtras: string
|
||||||
|
expireTime: Date
|
||||||
|
successTime: Date
|
||||||
|
notifyTime: Date
|
||||||
|
createTime: Date
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RefundPageReqVO extends PageParam {
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
channelId?: number
|
||||||
|
channelCode?: string
|
||||||
|
orderId?: string
|
||||||
|
tradeNo?: string
|
||||||
|
merchantOrderId?: string
|
||||||
|
merchantRefundNo?: string
|
||||||
|
notifyUrl?: string
|
||||||
|
notifyStatus?: number
|
||||||
|
status?: number
|
||||||
|
type?: number
|
||||||
|
payAmount?: number
|
||||||
|
refundAmount?: number
|
||||||
|
reason?: string
|
||||||
|
userIp?: string
|
||||||
|
channelOrderNo?: string
|
||||||
|
channelRefundNo?: string
|
||||||
|
channelErrorCode?: string
|
||||||
|
channelErrorMsg?: string
|
||||||
|
channelExtras?: string
|
||||||
|
expireTime?: Date[]
|
||||||
|
successTime?: Date[]
|
||||||
|
notifyTime?: Date[]
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PayRefundExportReqVO {
|
||||||
|
merchantId?: number
|
||||||
|
appId?: number
|
||||||
|
channelId?: number
|
||||||
|
channelCode?: string
|
||||||
|
orderId?: string
|
||||||
|
tradeNo?: string
|
||||||
|
merchantOrderId?: string
|
||||||
|
merchantRefundNo?: string
|
||||||
|
notifyUrl?: string
|
||||||
|
notifyStatus?: number
|
||||||
|
status?: number
|
||||||
|
type?: number
|
||||||
|
payAmount?: number
|
||||||
|
refundAmount?: number
|
||||||
|
reason?: string
|
||||||
|
userIp?: string
|
||||||
|
channelOrderNo?: string
|
||||||
|
channelRefundNo?: string
|
||||||
|
channelErrorCode?: string
|
||||||
|
channelErrorMsg?: string
|
||||||
|
channelExtras?: string
|
||||||
|
expireTime?: Date[]
|
||||||
|
successTime?: Date[]
|
||||||
|
notifyTime?: Date[]
|
||||||
|
createTime?: Date[]
|
||||||
|
}
|
||||||
|
|
||||||
// 查询列表退款订单
|
// 查询列表退款订单
|
||||||
export const getRefundPageApi = (params) => {
|
export const getRefundPageApi = (params: RefundPageReqVO) => {
|
||||||
return request.get({ url: '/pay/refund/page', params })
|
return request.get({ url: '/pay/refund/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +111,6 @@ export const deleteRefundApi = (id: number) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出退款订单
|
// 导出退款订单
|
||||||
export const exportRefundApi = (params) => {
|
export const exportRefundApi = (params: PayRefundExportReqVO) => {
|
||||||
return request.download({ url: '/pay/refund/export-excel', params })
|
return request.download({ url: '/pay/refund/export-excel', params })
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
export type RefundVO = {
|
|
||||||
id: number
|
|
||||||
merchantId: number
|
|
||||||
appId: number
|
|
||||||
channelId: number
|
|
||||||
channelCode: string
|
|
||||||
merchantOrderId: string
|
|
||||||
subject: string
|
|
||||||
body: string
|
|
||||||
notifyUrl: string
|
|
||||||
notifyStatus: number
|
|
||||||
amount: number
|
|
||||||
channelFeeRate: number
|
|
||||||
channelFeeAmount: number
|
|
||||||
status: number
|
|
||||||
userIp: string
|
|
||||||
expireTime: string
|
|
||||||
successTime: string
|
|
||||||
notifyTime: string
|
|
||||||
successExtensionId: number
|
|
||||||
refundStatus: number
|
|
||||||
refundTimes: number
|
|
||||||
refundAmount: number
|
|
||||||
channelUserId: string
|
|
||||||
channelOrderNo: string
|
|
||||||
}
|
|
|
@ -17,7 +17,7 @@ import { DescriptionsSchema } from '@/types/descriptions'
|
||||||
export type VxeCrudSchema = {
|
export type VxeCrudSchema = {
|
||||||
primaryKey?: string // 主键ID
|
primaryKey?: string // 主键ID
|
||||||
primaryTitle?: string // 主键标题 默认为序号
|
primaryTitle?: string // 主键标题 默认为序号
|
||||||
primaryType?: VxeColumnPropTypes.Type // 不填写为数据库编号 null为不显示 还支持 "seq" | "radio" | "checkbox" | "expand" | "html" | null
|
primaryType?: VxeColumnPropTypes.Type | 'id' // 还支持 "id" | "seq" | "radio" | "checkbox" | "expand" | "html" | null
|
||||||
action?: boolean // 是否开启表格内右侧操作栏插槽
|
action?: boolean // 是否开启表格内右侧操作栏插槽
|
||||||
actionTitle?: string // 操作栏标题 默认为操作
|
actionTitle?: string // 操作栏标题 默认为操作
|
||||||
actionWidth?: string // 操作栏插槽宽度,一般2个字带图标 text 类型按钮 50-70
|
actionWidth?: string // 操作栏插槽宽度,一般2个字带图标 text 类型按钮 50-70
|
||||||
|
@ -121,18 +121,8 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => {
|
||||||
if (schemaItem?.isSearch || schemaItem.search?.show) {
|
if (schemaItem?.isSearch || schemaItem.search?.show) {
|
||||||
let itemRenderName = schemaItem?.search?.itemRender?.name || '$input'
|
let itemRenderName = schemaItem?.search?.itemRender?.name || '$input'
|
||||||
const options: any[] = []
|
const options: any[] = []
|
||||||
let itemRender: FormItemRenderOptions
|
let itemRender: FormItemRenderOptions = {}
|
||||||
if (schemaItem.search?.itemRender) {
|
|
||||||
itemRender = schemaItem.search.itemRender
|
|
||||||
} else {
|
|
||||||
itemRender = {
|
|
||||||
name: itemRenderName,
|
|
||||||
props:
|
|
||||||
itemRenderName == '$input'
|
|
||||||
? { placeholder: t('common.inputText') }
|
|
||||||
: { placeholder: t('common.selectText') }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (schemaItem.dictType) {
|
if (schemaItem.dictType) {
|
||||||
const allOptions = { label: '全部', value: '' }
|
const allOptions = { label: '全部', value: '' }
|
||||||
options.push(allOptions)
|
options.push(allOptions)
|
||||||
|
@ -146,8 +136,19 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => {
|
||||||
options: options,
|
options: options,
|
||||||
props: { placeholder: t('common.selectText') }
|
props: { placeholder: t('common.selectText') }
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (schemaItem.search?.itemRender) {
|
||||||
|
itemRender = schemaItem.search.itemRender
|
||||||
|
} else {
|
||||||
|
itemRender = {
|
||||||
|
name: itemRenderName,
|
||||||
|
props:
|
||||||
|
itemRenderName == '$input'
|
||||||
|
? { placeholder: t('common.inputText') }
|
||||||
|
: { placeholder: t('common.selectText') }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchSchemaItem = {
|
const searchSchemaItem = {
|
||||||
// 默认为 input
|
// 默认为 input
|
||||||
folding: searchSchema.length > spanLength - 1,
|
folding: searchSchema.length > spanLength - 1,
|
||||||
|
@ -156,7 +157,6 @@ const filterSearchSchema = (crudSchema: VxeCrudSchema): VxeFormItemProps[] => {
|
||||||
title: schemaItem.search?.title || schemaItem.title,
|
title: schemaItem.search?.title || schemaItem.title,
|
||||||
span: span
|
span: span
|
||||||
}
|
}
|
||||||
|
|
||||||
searchSchema.push(searchSchemaItem)
|
searchSchema.push(searchSchemaItem)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -187,12 +187,18 @@ const filterTableSchema = (crudSchema: VxeCrudSchema): VxeGridPropTypes.Columns
|
||||||
if (crudSchema.primaryKey && crudSchema.primaryType) {
|
if (crudSchema.primaryKey && crudSchema.primaryType) {
|
||||||
const primaryTitle = crudSchema.primaryTitle ? crudSchema.primaryTitle : t('common.index')
|
const primaryTitle = crudSchema.primaryTitle ? crudSchema.primaryTitle : t('common.index')
|
||||||
const primaryWidth = primaryTitle.length * 30 + 'px'
|
const primaryWidth = primaryTitle.length * 30 + 'px'
|
||||||
const tableSchemaItem = {
|
|
||||||
|
let tableSchemaItem: { [x: string]: any } = {
|
||||||
title: primaryTitle,
|
title: primaryTitle,
|
||||||
field: crudSchema.primaryKey,
|
field: crudSchema.primaryKey,
|
||||||
type: crudSchema.primaryType ? crudSchema.primaryType : null,
|
|
||||||
width: primaryWidth
|
width: primaryWidth
|
||||||
}
|
}
|
||||||
|
if (crudSchema.primaryType != 'id') {
|
||||||
|
tableSchemaItem = {
|
||||||
|
...tableSchemaItem,
|
||||||
|
type: crudSchema.primaryType
|
||||||
|
}
|
||||||
|
}
|
||||||
tableSchema.push(tableSchemaItem)
|
tableSchema.push(tableSchemaItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,6 @@ export default {
|
||||||
access: 'Project access',
|
access: 'Project access',
|
||||||
toDo: 'To do',
|
toDo: 'To do',
|
||||||
introduction: 'A serious introduction',
|
introduction: 'A serious introduction',
|
||||||
more: 'More',
|
|
||||||
shortcutOperation: 'Quick entry',
|
shortcutOperation: 'Quick entry',
|
||||||
operation: 'Operation',
|
operation: 'Operation',
|
||||||
index: 'Index',
|
index: 'Index',
|
||||||
|
@ -284,6 +283,7 @@ export default {
|
||||||
edit: 'Edit',
|
edit: 'Edit',
|
||||||
update: 'Update',
|
update: 'Update',
|
||||||
preview: 'Preview',
|
preview: 'Preview',
|
||||||
|
more: 'More',
|
||||||
sync: 'Sync',
|
sync: 'Sync',
|
||||||
save: 'Save',
|
save: 'Save',
|
||||||
detail: 'Detail',
|
detail: 'Detail',
|
||||||
|
|
|
@ -189,7 +189,6 @@ export default {
|
||||||
access: '项目访问',
|
access: '项目访问',
|
||||||
toDo: '待办',
|
toDo: '待办',
|
||||||
introduction: '一个正经的简介',
|
introduction: '一个正经的简介',
|
||||||
more: '更多',
|
|
||||||
shortcutOperation: '快捷入口',
|
shortcutOperation: '快捷入口',
|
||||||
operation: '操作',
|
operation: '操作',
|
||||||
index: '指数',
|
index: '指数',
|
||||||
|
@ -284,6 +283,7 @@ export default {
|
||||||
edit: '编辑',
|
edit: '编辑',
|
||||||
update: '编辑',
|
update: '编辑',
|
||||||
preview: '预览',
|
preview: '预览',
|
||||||
|
more: '更多',
|
||||||
sync: '同步',
|
sync: '同步',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
detail: '详情',
|
detail: '详情',
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between h-3">
|
<div class="flex justify-between h-3">
|
||||||
<span>{{ t('workplace.project') }}</span>
|
<span>{{ t('workplace.project') }}</span>
|
||||||
<el-link type="primary" :underline="false">{{ t('workplace.more') }}</el-link>
|
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-skeleton :loading="loading" animated>
|
<el-skeleton :loading="loading" animated>
|
||||||
|
@ -135,7 +135,7 @@
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between h-3">
|
<div class="flex justify-between h-3">
|
||||||
<span>{{ t('workplace.notice') }}</span>
|
<span>{{ t('workplace.notice') }}</span>
|
||||||
<el-link type="primary" :underline="false">{{ t('workplace.more') }}</el-link>
|
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<el-skeleton :loading="loading" animated>
|
<el-skeleton :loading="loading" animated>
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
@click="handleDelete(row.id)"
|
@click="handleDelete(row.id)"
|
||||||
/>
|
/>
|
||||||
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
|
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
|
||||||
<XTextButton title="更多" postIcon="ep:arrow-down" />
|
<XTextButton :title="t('action.more')" postIcon="ep:arrow-down" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -15,67 +15,61 @@ export const rules = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
primaryTitle: '编号',
|
||||||
type: 'index',
|
action: true,
|
||||||
form: {
|
columns: [
|
||||||
show: false
|
{
|
||||||
|
title: '应用名',
|
||||||
|
field: 'name',
|
||||||
|
isSearch: true
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '商户名称',
|
||||||
}
|
field: 'payMerchant',
|
||||||
},
|
isSearch: true
|
||||||
{
|
|
||||||
label: '应用名',
|
|
||||||
field: 'name',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商户名称',
|
|
||||||
field: 'payMerchant',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('common.status'),
|
|
||||||
field: 'status',
|
|
||||||
dictType: DICT_TYPE.COMMON_STATUS,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('common.createTime'),
|
|
||||||
field: 'createTime',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
search: {
|
{
|
||||||
show: true,
|
title: t('common.status'),
|
||||||
component: 'DatePicker',
|
field: 'status',
|
||||||
componentProps: {
|
dictType: DICT_TYPE.COMMON_STATUS,
|
||||||
type: 'datetimerange',
|
dictClass: 'number',
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
isSearch: true
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
},
|
||||||
|
{
|
||||||
|
title: '支付结果的回调地址',
|
||||||
|
field: 'payNotifyUrl',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款结果的回调地址',
|
||||||
|
field: 'refundNotifyUrl',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商户名称',
|
||||||
|
field: 'merchantName',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
field: 'remark',
|
||||||
|
isTable: false,
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('common.createTime'),
|
||||||
|
field: 'createTime',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
]
|
||||||
{
|
})
|
||||||
label: t('table.action'),
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
field: 'action',
|
|
||||||
width: '240px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
detail: {
|
|
||||||
show: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
|
||||||
|
|
|
@ -1,158 +1,49 @@
|
||||||
<script setup lang="ts" name="App">
|
|
||||||
import { ref, unref } from 'vue'
|
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { useTable } from '@/hooks/web/useTable'
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import { FormExpose } from '@/components/Form'
|
|
||||||
import type { AppVO } from '@/api/pay/app/types'
|
|
||||||
import { rules, allSchemas } from './app.data'
|
|
||||||
import * as AppApi from '@/api/pay/app'
|
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
|
|
||||||
// ========== 列表相关 ==========
|
|
||||||
const { register, tableObject, methods } = useTable<AppVO>({
|
|
||||||
getListApi: AppApi.getAppPageApi,
|
|
||||||
delListApi: AppApi.deleteAppApi,
|
|
||||||
exportListApi: AppApi.exportAppApi
|
|
||||||
})
|
|
||||||
const { getList, setSearchParams, delList, exportList } = methods
|
|
||||||
|
|
||||||
// ========== CRUD 相关 ==========
|
|
||||||
const actionLoading = ref(false) // 遮罩层
|
|
||||||
const actionType = ref('') // 操作按钮的类型
|
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
|
||||||
const dialogTitle = ref('edit') // 弹出层标题
|
|
||||||
const formRef = ref<FormExpose>() // 表单 Ref
|
|
||||||
|
|
||||||
// 设置标题
|
|
||||||
const setDialogTile = (type: string) => {
|
|
||||||
dialogTitle.value = t('action.' + type)
|
|
||||||
actionType.value = type
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增操作
|
|
||||||
const handleCreate = () => {
|
|
||||||
setDialogTile('create')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改操作
|
|
||||||
const handleUpdate = async (row: AppVO) => {
|
|
||||||
setDialogTile('update')
|
|
||||||
// 设置数据
|
|
||||||
const res = await AppApi.getAppApi(row.id)
|
|
||||||
unref(formRef)?.setValues(res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交按钮
|
|
||||||
const submitForm = async () => {
|
|
||||||
const elForm = unref(formRef)?.getElFormRef()
|
|
||||||
if (!elForm) return
|
|
||||||
elForm.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
actionLoading.value = true
|
|
||||||
// 提交请求
|
|
||||||
try {
|
|
||||||
const data = unref(formRef)?.formModel as AppVO
|
|
||||||
if (actionType.value === 'create') {
|
|
||||||
await AppApi.createAppApi(data)
|
|
||||||
ElMessage.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
await AppApi.updateAppApi(data)
|
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
// 操作成功,重新加载列表
|
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
|
||||||
const detailRef = ref() // 详情 Ref
|
|
||||||
|
|
||||||
// 详情操作
|
|
||||||
const handleDetail = async (row: AppVO) => {
|
|
||||||
// 设置数据
|
|
||||||
detailRef.value = row
|
|
||||||
setDialogTile('detail')
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
|
||||||
getList()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 搜索工作区 -->
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
||||||
</ContentWrap>
|
|
||||||
<ContentWrap>
|
|
||||||
<!-- 操作工具栏 -->
|
|
||||||
<div class="mb-10px">
|
|
||||||
<el-button type="primary" v-hasPermi="['system:post:create']" @click="handleCreate">
|
|
||||||
<Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
v-hasPermi="['system:post:export']"
|
|
||||||
:loading="tableObject.exportLoading"
|
|
||||||
@click="exportList('应用数据.xls')"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<Table
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||||
:columns="allSchemas.tableColumns"
|
<template #toolbar_buttons>
|
||||||
:selection="false"
|
<!-- 操作:新增 -->
|
||||||
:data="tableObject.tableList"
|
<XButton
|
||||||
:loading="tableObject.loading"
|
|
||||||
:pagination="{
|
|
||||||
total: tableObject.total
|
|
||||||
}"
|
|
||||||
v-model:pageSize="tableObject.pageSize"
|
|
||||||
v-model:currentPage="tableObject.currentPage"
|
|
||||||
@register="register"
|
|
||||||
>
|
|
||||||
<template #status="{ row }">
|
|
||||||
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
|
|
||||||
</template>
|
|
||||||
<template #createTime="{ row }">
|
|
||||||
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
|
||||||
</template>
|
|
||||||
<template #action="{ row }">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
type="primary"
|
||||||
v-hasPermi="['system:post:update']"
|
preIcon="ep:zoom-in"
|
||||||
@click="handleUpdate(row)"
|
:title="t('action.add')"
|
||||||
>
|
v-hasPermi="['pay:app:create']"
|
||||||
<Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
|
@click="handleCreate()"
|
||||||
</el-button>
|
/>
|
||||||
<el-button
|
<!-- 操作:导出 -->
|
||||||
link
|
<XButton
|
||||||
type="primary"
|
type="warning"
|
||||||
v-hasPermi="['system:post:update']"
|
preIcon="ep:download"
|
||||||
@click="handleDetail(row)"
|
:title="t('action.export')"
|
||||||
>
|
v-hasPermi="['pay:app:export']"
|
||||||
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
|
@click="handleExport()"
|
||||||
</el-button>
|
/>
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
v-hasPermi="['system:post:delete']"
|
|
||||||
@click="delList(row.id, false)"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
<template #actionbtns_default="{ row }">
|
||||||
|
<!-- 操作:修改 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:edit"
|
||||||
|
:title="t('action.edit')"
|
||||||
|
v-hasPermi="['pay:app:update']"
|
||||||
|
@click="handleUpdate(row.id)"
|
||||||
|
/>
|
||||||
|
<!-- 操作:详情 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:view"
|
||||||
|
:title="t('action.detail')"
|
||||||
|
v-hasPermi="['pay:app:query']"
|
||||||
|
@click="handleDetail(row.id)"
|
||||||
|
/>
|
||||||
|
<!-- 操作:删除 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:delete"
|
||||||
|
:title="t('action.del')"
|
||||||
|
v-hasPermi="['pay:app:delete']"
|
||||||
|
@click="handleDelete(row.id)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<XModal v-model="dialogVisible" :title="dialogTitle">
|
<XModal v-model="dialogVisible" :title="dialogTitle">
|
||||||
|
@ -167,7 +58,7 @@ getList()
|
||||||
<Descriptions
|
<Descriptions
|
||||||
v-if="actionType === 'detail'"
|
v-if="actionType === 'detail'"
|
||||||
:schema="allSchemas.detailSchema"
|
:schema="allSchemas.detailSchema"
|
||||||
:data="detailRef"
|
:data="detailData"
|
||||||
/>
|
/>
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -184,3 +75,97 @@ getList()
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</XModal>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup lang="ts" name="App">
|
||||||
|
import { ref, unref } from 'vue'
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
|
import { FormExpose } from '@/components/Form'
|
||||||
|
import { rules, allSchemas } from './app.data'
|
||||||
|
import * as AppApi from '@/api/pay/app'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
|
// 列表相关的变量
|
||||||
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
|
const { gridOptions, getList, deleteData, exportList } = useVxeGrid<AppApi.AppVO>({
|
||||||
|
allSchemas: allSchemas,
|
||||||
|
getListApi: AppApi.getAppPageApi,
|
||||||
|
deleteApi: AppApi.deleteAppApi,
|
||||||
|
exportListApi: AppApi.exportAppApi
|
||||||
|
})
|
||||||
|
|
||||||
|
// ========== CRUD 相关 ==========
|
||||||
|
const actionLoading = ref(false) // 遮罩层
|
||||||
|
const actionType = ref('') // 操作按钮的类型
|
||||||
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
|
const dialogTitle = ref('edit') // 弹出层标题
|
||||||
|
const formRef = ref<FormExpose>() // 表单 Ref
|
||||||
|
const detailData = ref() // 详情 Ref
|
||||||
|
|
||||||
|
// 设置标题
|
||||||
|
const setDialogTile = (type: string) => {
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
actionType.value = type
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增操作
|
||||||
|
const handleCreate = () => {
|
||||||
|
setDialogTile('create')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出操作
|
||||||
|
const handleExport = async () => {
|
||||||
|
await exportList(xGrid, '应用信息.xls')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改操作
|
||||||
|
const handleUpdate = async (rowId: number) => {
|
||||||
|
setDialogTile('update')
|
||||||
|
// 设置数据
|
||||||
|
const res = await AppApi.getAppApi(rowId)
|
||||||
|
unref(formRef)?.setValues(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情操作
|
||||||
|
const handleDetail = async (rowId: number) => {
|
||||||
|
setDialogTile('detail')
|
||||||
|
const res = await AppApi.getAppApi(rowId)
|
||||||
|
detailData.value = res
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除操作
|
||||||
|
const handleDelete = async (rowId: number) => {
|
||||||
|
await deleteData(xGrid, rowId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const submitForm = async () => {
|
||||||
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
|
if (!elForm) return
|
||||||
|
elForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
actionLoading.value = true
|
||||||
|
// 提交请求
|
||||||
|
try {
|
||||||
|
const data = unref(formRef)?.formModel as AppApi.AppVO
|
||||||
|
if (actionType.value === 'create') {
|
||||||
|
await AppApi.createAppApi(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await AppApi.updateAppApi(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
// 刷新列表
|
||||||
|
await getList(xGrid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,160 +1,50 @@
|
||||||
<script setup lang="ts" name="Merchant">
|
|
||||||
import { ref, unref } from 'vue'
|
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { useTable } from '@/hooks/web/useTable'
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import { FormExpose } from '@/components/Form'
|
|
||||||
import type { MerchantVO } from '@/api/pay/merchant/types'
|
|
||||||
import { rules, allSchemas } from './merchant.data'
|
|
||||||
import * as MerchantApi from '@/api/pay/merchant'
|
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
|
|
||||||
// ========== 列表相关 ==========
|
|
||||||
const { register, tableObject, methods } = useTable<MerchantVO>({
|
|
||||||
getListApi: MerchantApi.getMerchantPageApi,
|
|
||||||
delListApi: MerchantApi.deleteMerchantApi,
|
|
||||||
exportListApi: MerchantApi.exportMerchantApi
|
|
||||||
})
|
|
||||||
const { getList, setSearchParams, delList, exportList } = methods
|
|
||||||
|
|
||||||
// ========== CRUD 相关 ==========
|
|
||||||
const actionLoading = ref(false) // 遮罩层
|
|
||||||
const actionType = ref('') // 操作按钮的类型
|
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
|
||||||
const dialogTitle = ref('edit') // 弹出层标题
|
|
||||||
const formRef = ref<FormExpose>() // 表单 Ref
|
|
||||||
|
|
||||||
// 设置标题
|
|
||||||
const setDialogTile = (type: string) => {
|
|
||||||
dialogTitle.value = t('action.' + type)
|
|
||||||
actionType.value = type
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增操作
|
|
||||||
const handleCreate = () => {
|
|
||||||
setDialogTile('create')
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改操作
|
|
||||||
const handleUpdate = async (row: MerchantVO) => {
|
|
||||||
setDialogTile('update')
|
|
||||||
// 设置数据
|
|
||||||
const res = await MerchantApi.getMerchantApi(row.id)
|
|
||||||
unref(formRef)?.setValues(res)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交按钮
|
|
||||||
const submitForm = async () => {
|
|
||||||
const elForm = unref(formRef)?.getElFormRef()
|
|
||||||
if (!elForm) return
|
|
||||||
elForm.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
actionLoading.value = true
|
|
||||||
// 提交请求
|
|
||||||
try {
|
|
||||||
const data = unref(formRef)?.formModel as MerchantVO
|
|
||||||
if (actionType.value === 'create') {
|
|
||||||
await MerchantApi.createMerchantApi(data)
|
|
||||||
ElMessage.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
await MerchantApi.updateMerchantApi(data)
|
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
// 操作成功,重新加载列表
|
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
|
||||||
const detailRef = ref() // 详情 Ref
|
|
||||||
|
|
||||||
// 详情操作
|
|
||||||
const handleDetail = async (row: MerchantVO) => {
|
|
||||||
// 设置数据
|
|
||||||
detailRef.value = row
|
|
||||||
setDialogTile('detail')
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
|
||||||
getList()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 搜索工作区 -->
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
||||||
</ContentWrap>
|
|
||||||
<ContentWrap>
|
|
||||||
<!-- 操作工具栏 -->
|
|
||||||
<div class="mb-10px">
|
|
||||||
<el-button type="primary" v-hasPermi="['system:post:create']" @click="handleCreate">
|
|
||||||
<Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
v-hasPermi="['system:post:export']"
|
|
||||||
:loading="tableObject.exportLoading"
|
|
||||||
@click="exportList('商户数据.xls')"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<Table
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||||
:columns="allSchemas.tableColumns"
|
<template #toolbar_buttons>
|
||||||
:selection="false"
|
<!-- 操作:新增 -->
|
||||||
:data="tableObject.tableList"
|
<XButton
|
||||||
:loading="tableObject.loading"
|
|
||||||
:pagination="{
|
|
||||||
total: tableObject.total
|
|
||||||
}"
|
|
||||||
v-model:pageSize="tableObject.pageSize"
|
|
||||||
v-model:currentPage="tableObject.currentPage"
|
|
||||||
@register="register"
|
|
||||||
>
|
|
||||||
<template #status="{ row }">
|
|
||||||
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
|
|
||||||
</template>
|
|
||||||
<template #createTime="{ row }">
|
|
||||||
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
|
||||||
</template>
|
|
||||||
<template #action="{ row }">
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
type="primary"
|
||||||
v-hasPermi="['system:post:update']"
|
preIcon="ep:zoom-in"
|
||||||
@click="handleUpdate(row)"
|
:title="t('action.add')"
|
||||||
>
|
v-hasPermi="['pay:merchant:create']"
|
||||||
<Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
|
@click="handleCreate()"
|
||||||
</el-button>
|
/>
|
||||||
<el-button
|
<!-- 操作:导出 -->
|
||||||
link
|
<XButton
|
||||||
type="primary"
|
type="warning"
|
||||||
v-hasPermi="['system:post:update']"
|
preIcon="ep:download"
|
||||||
@click="handleDetail(row)"
|
:title="t('action.export')"
|
||||||
>
|
v-hasPermi="['pay:merchant:export']"
|
||||||
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
|
@click="handleExport()"
|
||||||
</el-button>
|
/>
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
v-hasPermi="['system:post:delete']"
|
|
||||||
@click="delList(row.id, false)"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
<template #actionbtns_default="{ row }">
|
||||||
|
<!-- 操作:修改 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:edit"
|
||||||
|
:title="t('action.edit')"
|
||||||
|
v-hasPermi="['pay:merchant:update']"
|
||||||
|
@click="handleUpdate(row.id)"
|
||||||
|
/>
|
||||||
|
<!-- 操作:详情 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:view"
|
||||||
|
:title="t('action.detail')"
|
||||||
|
v-hasPermi="['pay:merchant:query']"
|
||||||
|
@click="handleDetail(row.id)"
|
||||||
|
/>
|
||||||
|
<!-- 操作:删除 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:delete"
|
||||||
|
:title="t('action.del')"
|
||||||
|
v-hasPermi="['pay:merchant:delete']"
|
||||||
|
@click="handleDelete(row.id)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</vxe-grid>
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<XModal v-model="dialogVisible" :title="dialogTitle">
|
<XModal v-model="dialogVisible" :title="dialogTitle">
|
||||||
<!-- 对话框(添加 / 修改) -->
|
<!-- 对话框(添加 / 修改) -->
|
||||||
<Form
|
<Form
|
||||||
|
@ -167,7 +57,7 @@ getList()
|
||||||
<Descriptions
|
<Descriptions
|
||||||
v-if="actionType === 'detail'"
|
v-if="actionType === 'detail'"
|
||||||
:schema="allSchemas.detailSchema"
|
:schema="allSchemas.detailSchema"
|
||||||
:data="detailRef"
|
:data="detailData"
|
||||||
/>
|
/>
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -184,3 +74,96 @@ getList()
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</XModal>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup lang="ts" name="Merchant">
|
||||||
|
import { ref, unref } from 'vue'
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import { useMessage } from '@/hooks/web/useMessage'
|
||||||
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
|
import { FormExpose } from '@/components/Form'
|
||||||
|
import { rules, allSchemas } from './merchant.data'
|
||||||
|
import * as MerchantApi from '@/api/pay/merchant'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
// 列表相关的变量
|
||||||
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
|
const { gridOptions, getList, deleteData, exportList } = useVxeGrid<MerchantApi.MerchantVO>({
|
||||||
|
allSchemas: allSchemas,
|
||||||
|
getListApi: MerchantApi.getMerchantPageApi,
|
||||||
|
deleteApi: MerchantApi.deleteMerchantApi,
|
||||||
|
exportListApi: MerchantApi.exportMerchantApi
|
||||||
|
})
|
||||||
|
|
||||||
|
// ========== CRUD 相关 ==========
|
||||||
|
const actionLoading = ref(false) // 遮罩层
|
||||||
|
const actionType = ref('') // 操作按钮的类型
|
||||||
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
|
const dialogTitle = ref('edit') // 弹出层标题
|
||||||
|
const formRef = ref<FormExpose>() // 表单 Ref
|
||||||
|
const detailData = ref() // 详情 Ref
|
||||||
|
|
||||||
|
// 设置标题
|
||||||
|
const setDialogTile = (type: string) => {
|
||||||
|
dialogTitle.value = t('action.' + type)
|
||||||
|
actionType.value = type
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增操作
|
||||||
|
const handleCreate = () => {
|
||||||
|
setDialogTile('create')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出操作
|
||||||
|
const handleExport = async () => {
|
||||||
|
await exportList(xGrid, '商户列表.xls')
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改操作
|
||||||
|
const handleUpdate = async (rowId: number) => {
|
||||||
|
setDialogTile('update')
|
||||||
|
// 设置数据
|
||||||
|
const res = await MerchantApi.getMerchantApi(rowId)
|
||||||
|
unref(formRef)?.setValues(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情操作
|
||||||
|
const handleDetail = async (rowId: number) => {
|
||||||
|
setDialogTile('detail')
|
||||||
|
const res = await MerchantApi.getMerchantApi(rowId)
|
||||||
|
detailData.value = res
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除操作
|
||||||
|
const handleDelete = async (rowId: number) => {
|
||||||
|
await deleteData(xGrid, rowId)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交按钮
|
||||||
|
const submitForm = async () => {
|
||||||
|
const elForm = unref(formRef)?.getElFormRef()
|
||||||
|
if (!elForm) return
|
||||||
|
elForm.validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
actionLoading.value = true
|
||||||
|
// 提交请求
|
||||||
|
try {
|
||||||
|
const data = unref(formRef)?.formModel as MerchantApi.MerchantVO
|
||||||
|
if (actionType.value === 'create') {
|
||||||
|
await MerchantApi.createMerchantApi(data)
|
||||||
|
message.success(t('common.createSuccess'))
|
||||||
|
} else {
|
||||||
|
await MerchantApi.updateMerchantApi(data)
|
||||||
|
message.success(t('common.updateSuccess'))
|
||||||
|
}
|
||||||
|
dialogVisible.value = false
|
||||||
|
} finally {
|
||||||
|
actionLoading.value = false
|
||||||
|
// 刷新列表
|
||||||
|
await getList(xGrid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -14,91 +14,61 @@ export const rules = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
primaryTitle: '商户编号',
|
||||||
type: 'index',
|
action: true,
|
||||||
form: {
|
columns: [
|
||||||
show: false
|
{
|
||||||
|
title: '商户号',
|
||||||
|
field: 'no',
|
||||||
|
isSearch: true
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '商户全称',
|
||||||
}
|
field: 'code',
|
||||||
},
|
isSearch: true
|
||||||
{
|
},
|
||||||
label: '商户号',
|
{
|
||||||
field: 'no',
|
title: '商户简称',
|
||||||
search: {
|
field: 'shortName',
|
||||||
show: true
|
isSearch: true
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
title: t('common.status'),
|
||||||
label: '商户全称',
|
field: 'status',
|
||||||
field: 'code',
|
dictType: DICT_TYPE.COMMON_STATUS,
|
||||||
search: {
|
dictClass: 'number',
|
||||||
show: true
|
isSearch: true
|
||||||
}
|
},
|
||||||
},
|
{
|
||||||
{
|
title: t('form.remark'),
|
||||||
label: '商户简称',
|
field: 'remark',
|
||||||
field: 'shortName',
|
isTable: false,
|
||||||
search: {
|
form: {
|
||||||
show: true
|
component: 'Input',
|
||||||
}
|
componentProps: {
|
||||||
},
|
type: 'textarea',
|
||||||
{
|
rows: 4
|
||||||
label: t('common.status'),
|
},
|
||||||
field: 'status',
|
colProps: {
|
||||||
dictType: DICT_TYPE.COMMON_STATUS,
|
span: 24
|
||||||
dictClass: 'number',
|
}
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('form.remark'),
|
|
||||||
field: 'remark',
|
|
||||||
form: {
|
|
||||||
component: 'Input',
|
|
||||||
componentProps: {
|
|
||||||
type: 'textarea',
|
|
||||||
rows: 4
|
|
||||||
},
|
|
||||||
colProps: {
|
|
||||||
span: 24
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
table: {
|
{
|
||||||
show: false
|
title: t('common.createTime'),
|
||||||
}
|
field: 'createTime',
|
||||||
},
|
formatter: 'formatDate',
|
||||||
{
|
isForm: false,
|
||||||
label: t('common.createTime'),
|
search: {
|
||||||
field: 'createTime',
|
show: true,
|
||||||
form: {
|
itemRender: {
|
||||||
show: false
|
name: 'XDataTimePicker'
|
||||||
},
|
}
|
||||||
search: {
|
|
||||||
show: true,
|
|
||||||
component: 'DatePicker',
|
|
||||||
componentProps: {
|
|
||||||
type: 'datetimerange',
|
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
]
|
||||||
{
|
})
|
||||||
label: t('table.action'),
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
field: 'action',
|
|
||||||
width: '240px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
detail: {
|
|
||||||
show: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
|
||||||
|
|
|
@ -1,28 +1,68 @@
|
||||||
|
<template>
|
||||||
|
<ContentWrap>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||||
|
<template #toolbar_buttons>
|
||||||
|
<!-- 操作:新增 -->
|
||||||
|
<XButton
|
||||||
|
type="primary"
|
||||||
|
preIcon="ep:zoom-in"
|
||||||
|
:title="t('action.add')"
|
||||||
|
v-hasPermi="['pay:order:create']"
|
||||||
|
@click="handleCreate()"
|
||||||
|
/>
|
||||||
|
<!-- 操作:导出 -->
|
||||||
|
<XButton
|
||||||
|
type="warning"
|
||||||
|
preIcon="ep:download"
|
||||||
|
:title="t('action.export')"
|
||||||
|
v-hasPermi="['pay:order:export']"
|
||||||
|
@click="handleExport()"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<template #actionbtns_default="{ row }">
|
||||||
|
<!-- 操作:详情 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:view"
|
||||||
|
:title="t('action.detail')"
|
||||||
|
v-hasPermi="['pay:order:query']"
|
||||||
|
@click="handleDetail(row.id)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</vxe-grid>
|
||||||
|
</ContentWrap>
|
||||||
|
<XModal v-model="dialogVisible" :title="dialogTitle">
|
||||||
|
<!-- 对话框(详情) -->
|
||||||
|
<Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<template #footer>
|
||||||
|
<!-- 按钮:关闭 -->
|
||||||
|
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
||||||
|
</template>
|
||||||
|
</XModal>
|
||||||
|
</template>
|
||||||
<script setup lang="ts" name="Order">
|
<script setup lang="ts" name="Order">
|
||||||
import { ref, unref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { useTable } from '@/hooks/web/useTable'
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { FormExpose } from '@/components/Form'
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
import type { OrderVO } from '@/api/pay/order/types'
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
import { rules, allSchemas } from './order.data'
|
import { allSchemas } from './order.data'
|
||||||
import * as OrderApi from '@/api/pay/order'
|
import * as OrderApi from '@/api/pay/order'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
// ========== 列表相关 ==========
|
// 列表相关的变量
|
||||||
const { register, tableObject, methods } = useTable<OrderVO>({
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
|
const { gridOptions, exportList } = useVxeGrid<OrderApi.OrderVO>({
|
||||||
|
allSchemas: allSchemas,
|
||||||
getListApi: OrderApi.getOrderPageApi,
|
getListApi: OrderApi.getOrderPageApi,
|
||||||
delListApi: OrderApi.deleteOrderApi,
|
|
||||||
exportListApi: OrderApi.exportOrderApi
|
exportListApi: OrderApi.exportOrderApi
|
||||||
})
|
})
|
||||||
const { getList, setSearchParams, delList, exportList } = methods
|
|
||||||
// ========== CRUD 相关 ==========
|
// ========== CRUD 相关 ==========
|
||||||
const actionLoading = ref(false) // 遮罩层
|
const actionLoading = ref(false) // 遮罩层
|
||||||
const actionType = ref('') // 操作按钮的类型
|
const actionType = ref('') // 操作按钮的类型
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
const dialogTitle = ref('edit') // 弹出层标题
|
const dialogTitle = ref('edit') // 弹出层标题
|
||||||
const formRef = ref<FormExpose>() // 表单 Ref
|
const detailData = ref() // 详情 Ref
|
||||||
|
|
||||||
// 设置标题
|
// 设置标题
|
||||||
const setDialogTile = (type: string) => {
|
const setDialogTile = (type: string) => {
|
||||||
dialogTitle.value = t('action.' + type)
|
dialogTitle.value = t('action.' + type)
|
||||||
|
@ -34,137 +74,15 @@ const setDialogTile = (type: string) => {
|
||||||
const handleCreate = () => {
|
const handleCreate = () => {
|
||||||
setDialogTile('create')
|
setDialogTile('create')
|
||||||
}
|
}
|
||||||
|
// 导出操作
|
||||||
// 修改操作
|
const handleExport = async () => {
|
||||||
const handleUpdate = async (row: OrderVO) => {
|
await exportList(xGrid, '订单数据.xls')
|
||||||
setDialogTile('update')
|
|
||||||
// 设置数据
|
|
||||||
const res = await OrderApi.getOrderApi(row.id)
|
|
||||||
unref(formRef)?.setValues(res)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提交按钮
|
|
||||||
const submitForm = async () => {
|
|
||||||
const elForm = unref(formRef)?.getElFormRef()
|
|
||||||
if (!elForm) return
|
|
||||||
elForm.validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
actionLoading.value = true
|
|
||||||
// 提交请求
|
|
||||||
try {
|
|
||||||
const data = unref(formRef)?.formModel as OrderVO
|
|
||||||
if (actionType.value === 'create') {
|
|
||||||
await OrderApi.createOrderApi(data)
|
|
||||||
ElMessage.success(t('common.createSuccess'))
|
|
||||||
} else {
|
|
||||||
await OrderApi.updateOrderApi(data)
|
|
||||||
ElMessage.success(t('common.updateSuccess'))
|
|
||||||
}
|
|
||||||
// 操作成功,重新加载列表
|
|
||||||
dialogVisible.value = false
|
|
||||||
await getList()
|
|
||||||
} finally {
|
|
||||||
actionLoading.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
|
||||||
const detailRef = ref() // 详情 Ref
|
|
||||||
|
|
||||||
// 详情操作
|
// 详情操作
|
||||||
const handleDetail = async (row: OrderVO) => {
|
const handleDetail = async (rowId: number) => {
|
||||||
setDialogTile('detail')
|
setDialogTile('detail')
|
||||||
// 设置数据
|
const res = await OrderApi.getOrderApi(rowId)
|
||||||
const res = await OrderApi.getOrderApi(row.id as number)
|
detailData.value = res
|
||||||
detailRef.value = res
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
|
||||||
getList()
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
|
||||||
<!-- 搜索工作区 -->
|
|
||||||
<ContentWrap>
|
|
||||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
||||||
</ContentWrap>
|
|
||||||
<ContentWrap>
|
|
||||||
<!-- 操作工具栏 -->
|
|
||||||
<div class="mb-10px">
|
|
||||||
<el-button type="primary" v-hasPermi="['pay:order:create']" @click="handleCreate">
|
|
||||||
<Icon icon="ep:zoom-in" class="mr-5px" /> {{ t('action.add') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
v-hasPermi="['pay:order:export']"
|
|
||||||
:loading="tableObject.exportLoading"
|
|
||||||
@click="exportList('订单数据.xls')"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 列表 -->
|
|
||||||
<Table
|
|
||||||
:columns="allSchemas.tableColumns"
|
|
||||||
:selection="false"
|
|
||||||
:data="tableObject.tableList"
|
|
||||||
:loading="tableObject.loading"
|
|
||||||
:pagination="{
|
|
||||||
total: tableObject.total
|
|
||||||
}"
|
|
||||||
v-model:pageSize="tableObject.pageSize"
|
|
||||||
v-model:currentPage="tableObject.currentPage"
|
|
||||||
@register="register"
|
|
||||||
>
|
|
||||||
<template #status="{ row }">
|
|
||||||
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
|
|
||||||
</template>
|
|
||||||
<template #action="{ row }">
|
|
||||||
<el-button link type="primary" v-hasPermi="['pay:order:update']" @click="handleUpdate(row)">
|
|
||||||
<Icon icon="ep:edit" class="mr-1px" /> {{ t('action.edit') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button link type="primary" v-hasPermi="['pay:order:update']" @click="handleDetail(row)">
|
|
||||||
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
v-hasPermi="['pay:order:delete']"
|
|
||||||
@click="delList(row.id, false)"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
</ContentWrap>
|
|
||||||
|
|
||||||
<XModal v-model="dialogVisible" :title="dialogTitle">
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<Form
|
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
|
||||||
:schema="allSchemas.formSchema"
|
|
||||||
:rules="rules"
|
|
||||||
ref="formRef"
|
|
||||||
/>
|
|
||||||
<!-- 对话框(详情) -->
|
|
||||||
<Descriptions
|
|
||||||
v-if="actionType === 'detail'"
|
|
||||||
:schema="allSchemas.detailSchema"
|
|
||||||
:data="detailRef"
|
|
||||||
/>
|
|
||||||
<!-- 操作按钮 -->
|
|
||||||
<template #footer>
|
|
||||||
<!-- 按钮:保存 -->
|
|
||||||
<XButton
|
|
||||||
v-if="['create', 'update'].includes(actionType)"
|
|
||||||
type="primary"
|
|
||||||
:title="t('action.save')"
|
|
||||||
:loading="actionLoading"
|
|
||||||
@click="submitForm()"
|
|
||||||
/>
|
|
||||||
<!-- 按钮:关闭 -->
|
|
||||||
<XButton :loading="actionLoading" :title="t('dialog.close')" @click="dialogVisible = false" />
|
|
||||||
</template>
|
|
||||||
</XModal>
|
|
||||||
</template>
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
@ -23,166 +23,134 @@ export const rules = reactive({
|
||||||
refundAmount: [required]
|
refundAmount: [required]
|
||||||
})
|
})
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
primaryTitle: '岗位编号',
|
||||||
type: 'index',
|
action: true,
|
||||||
form: {
|
columns: [
|
||||||
show: false
|
{
|
||||||
|
title: '商户编号',
|
||||||
|
field: 'merchantId',
|
||||||
|
isSearch: true
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '应用编号',
|
||||||
}
|
field: 'appId',
|
||||||
},
|
isSearch: true
|
||||||
{
|
|
||||||
label: '商户编号',
|
|
||||||
field: 'merchantId',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '应用编号',
|
|
||||||
field: 'appId',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道编号',
|
|
||||||
field: 'channelId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道编码',
|
|
||||||
field: 'channelCode',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道订单号',
|
|
||||||
field: 'merchantOrderId',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商品标题',
|
|
||||||
field: 'subject'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商品描述',
|
|
||||||
field: 'body'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '异步通知地址',
|
|
||||||
field: 'notifyUrl'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '回调商户状态',
|
|
||||||
field: 'notifyStatus',
|
|
||||||
dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS,
|
|
||||||
dictClass: 'number'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '支付金额',
|
|
||||||
field: 'amount',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道手续费',
|
|
||||||
field: 'channelFeeRate',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道手续金额',
|
|
||||||
field: 'channelFeeAmount',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '支付状态',
|
|
||||||
field: 'status',
|
|
||||||
dictType: DICT_TYPE.PAY_ORDER_STATUS,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '用户 IP',
|
|
||||||
field: 'userIp'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '订单失效时间',
|
|
||||||
field: 'expireTime'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '订单支付成功时间',
|
|
||||||
field: 'successTime'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '订单支付通知时间',
|
|
||||||
field: 'notifyTime'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '支付成功的订单拓展单编号',
|
|
||||||
field: 'successExtensionId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '退款状态',
|
|
||||||
field: 'refundStatus',
|
|
||||||
dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '退款次数',
|
|
||||||
field: 'refundTimes'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '退款总金额',
|
|
||||||
field: 'refundAmount'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道用户编号',
|
|
||||||
field: 'channelUserId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道订单号',
|
|
||||||
field: 'channelOrderNo'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('common.createTime'),
|
|
||||||
field: 'createTime',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
search: {
|
{
|
||||||
show: true,
|
title: '渠道编号',
|
||||||
component: 'DatePicker',
|
field: 'channelId'
|
||||||
componentProps: {
|
},
|
||||||
type: 'datetimerange',
|
{
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
title: '渠道编码',
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
field: 'channelCode',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道订单号',
|
||||||
|
field: 'merchantOrderId',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商品标题',
|
||||||
|
field: 'subject'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商品描述',
|
||||||
|
field: 'body'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '异步通知地址',
|
||||||
|
field: 'notifyUrl'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回调状态',
|
||||||
|
field: 'notifyStatus',
|
||||||
|
dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS,
|
||||||
|
dictClass: 'number'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付金额',
|
||||||
|
field: 'amount',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道手续费',
|
||||||
|
field: 'channelFeeRate',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道手续金额',
|
||||||
|
field: 'channelFeeAmount',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付状态',
|
||||||
|
field: 'status',
|
||||||
|
dictType: DICT_TYPE.PAY_ORDER_STATUS,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户 IP',
|
||||||
|
field: 'userIp'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '订单失效时间',
|
||||||
|
field: 'expireTime',
|
||||||
|
formatter: 'formatDate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付时间',
|
||||||
|
field: 'successTime',
|
||||||
|
formatter: 'formatDate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付通知时间',
|
||||||
|
field: 'notifyTime',
|
||||||
|
formatter: 'formatDate'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '拓展编号',
|
||||||
|
field: 'successExtensionId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款状态',
|
||||||
|
field: 'refundStatus',
|
||||||
|
dictType: DICT_TYPE.PAY_ORDER_REFUND_STATUS,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款次数',
|
||||||
|
field: 'refundTimes'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款总金额',
|
||||||
|
field: 'refundAmount'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道用户编号',
|
||||||
|
field: 'channelUserId'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道订单号',
|
||||||
|
field: 'channelOrderNo'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('common.createTime'),
|
||||||
|
field: 'createTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
]
|
||||||
{
|
})
|
||||||
label: t('table.action'),
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
field: 'action',
|
|
||||||
width: '270px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
|
||||||
|
|
|
@ -1,104 +1,69 @@
|
||||||
<script setup lang="ts" name="Refund">
|
|
||||||
import { ref } from 'vue'
|
|
||||||
import dayjs from 'dayjs'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
|
||||||
import { useTable } from '@/hooks/web/useTable'
|
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
|
||||||
import type { RefundVO } from '@/api/pay/refund/types'
|
|
||||||
import { allSchemas } from './refund.data'
|
|
||||||
import * as RefundApi from '@/api/pay/refund'
|
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
|
|
||||||
// ========== 列表相关 ==========
|
|
||||||
const { register, tableObject, methods } = useTable<RefundVO>({
|
|
||||||
getListApi: RefundApi.getRefundPageApi,
|
|
||||||
delListApi: RefundApi.deleteRefundApi,
|
|
||||||
exportListApi: RefundApi.exportRefundApi
|
|
||||||
})
|
|
||||||
const { getList, setSearchParams, delList, exportList } = methods
|
|
||||||
|
|
||||||
// ========== CRUD 相关 ==========
|
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
|
||||||
const dialogTitle = ref('edit') // 弹出层标题
|
|
||||||
|
|
||||||
// ========== 详情相关 ==========
|
|
||||||
const detailRef = ref() // 详情 Ref
|
|
||||||
|
|
||||||
// 详情操作
|
|
||||||
const handleDetail = async (row: RefundVO) => {
|
|
||||||
// 设置数据
|
|
||||||
detailRef.value = RefundApi.getRefundApi(row.id)
|
|
||||||
dialogTitle.value = t('action.detail')
|
|
||||||
dialogVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// ========== 初始化 ==========
|
|
||||||
getList()
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<!-- 搜索工作区 -->
|
|
||||||
<ContentWrap>
|
<ContentWrap>
|
||||||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
|
|
||||||
</ContentWrap>
|
|
||||||
<ContentWrap>
|
|
||||||
<!-- 操作工具栏 -->
|
|
||||||
<div class="mb-10px">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
v-hasPermi="['system:post:export']"
|
|
||||||
:loading="tableObject.exportLoading"
|
|
||||||
@click="exportList('退款订单.xls')"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:download" class="mr-5px" /> {{ t('action.export') }}
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<!-- 列表 -->
|
<!-- 列表 -->
|
||||||
<Table
|
<vxe-grid ref="xGrid" v-bind="gridOptions" class="xtable-scrollbar">
|
||||||
:columns="allSchemas.tableColumns"
|
<template #toolbar_buttons>
|
||||||
:selection="false"
|
<!-- 操作:导出 -->
|
||||||
:data="tableObject.tableList"
|
<XButton
|
||||||
:loading="tableObject.loading"
|
type="warning"
|
||||||
:pagination="{
|
preIcon="ep:download"
|
||||||
total: tableObject.total
|
:title="t('action.export')"
|
||||||
}"
|
v-hasPermi="['pay:refund:export']"
|
||||||
v-model:pageSize="tableObject.pageSize"
|
@click="handleExport()"
|
||||||
v-model:currentPage="tableObject.currentPage"
|
/>
|
||||||
@register="register"
|
|
||||||
>
|
|
||||||
<template #status="{ row }">
|
|
||||||
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
|
|
||||||
</template>
|
</template>
|
||||||
<template #createTime="{ row }">
|
<template #actionbtns_default="{ row }">
|
||||||
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
|
<!-- 操作:详情 -->
|
||||||
|
<XTextButton
|
||||||
|
preIcon="ep:view"
|
||||||
|
:title="t('action.detail')"
|
||||||
|
v-hasPermi="['pay:refund:query']"
|
||||||
|
@click="handleDetail(row.id)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
</vxe-grid>
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
v-hasPermi="['system:post:update']"
|
|
||||||
@click="handleDetail(row)"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
type="primary"
|
|
||||||
v-hasPermi="['system:post:delete']"
|
|
||||||
@click="delList(row.id, false)"
|
|
||||||
>
|
|
||||||
<Icon icon="ep:delete" class="mr-1px" /> {{ t('action.del') }}
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
</ContentWrap>
|
</ContentWrap>
|
||||||
|
|
||||||
<XModal v-model="dialogVisible" :title="dialogTitle">
|
<XModal v-model="dialogVisible" :title="t('action.detail')">
|
||||||
<!-- 对话框(详情) -->
|
<!-- 对话框(详情) -->
|
||||||
<Descriptions :schema="allSchemas.detailSchema" :data="detailRef" />
|
<Descriptions :schema="allSchemas.detailSchema" :data="detailData" />
|
||||||
<!-- 操作按钮 -->
|
<!-- 操作按钮 -->
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
|
<el-button @click="dialogVisible = false">{{ t('dialog.close') }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</XModal>
|
</XModal>
|
||||||
</template>
|
</template>
|
||||||
|
<script setup lang="ts" name="Refund">
|
||||||
|
import { ref } from 'vue'
|
||||||
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
|
import { useVxeGrid } from '@/hooks/web/useVxeGrid'
|
||||||
|
import { VxeGridInstance } from 'vxe-table'
|
||||||
|
import { allSchemas } from './refund.data'
|
||||||
|
import * as RefundApi from '@/api/pay/refund'
|
||||||
|
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
// 列表相关的变量
|
||||||
|
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
|
||||||
|
const { gridOptions, exportList } = useVxeGrid<RefundApi.RefundVO>({
|
||||||
|
allSchemas: allSchemas,
|
||||||
|
getListApi: RefundApi.getRefundPageApi,
|
||||||
|
exportListApi: RefundApi.exportRefundApi
|
||||||
|
})
|
||||||
|
|
||||||
|
// 导出操作
|
||||||
|
const handleExport = async () => {
|
||||||
|
await exportList(xGrid, '退款订单.xls')
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== CRUD 相关 ==========
|
||||||
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
|
const detailData = ref() // 详情 Ref
|
||||||
|
|
||||||
|
// 详情操作
|
||||||
|
const handleDetail = async (rowId: number) => {
|
||||||
|
// 设置数据
|
||||||
|
detailData.value = RefundApi.getRefundApi(rowId)
|
||||||
|
dialogVisible.value = true
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
|
@ -1,112 +1,176 @@
|
||||||
import { reactive } from 'vue'
|
import { reactive } from 'vue'
|
||||||
import { useI18n } from '@/hooks/web/useI18n'
|
import { useI18n } from '@/hooks/web/useI18n'
|
||||||
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
|
|
||||||
import { DICT_TYPE } from '@/utils/dict'
|
import { DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<CrudSchema[]>([
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
{
|
primaryKey: 'id',
|
||||||
label: t('common.index'),
|
primaryType: 'seq',
|
||||||
field: 'id',
|
primaryTitle: '序号',
|
||||||
type: 'index',
|
action: true,
|
||||||
form: {
|
columns: [
|
||||||
show: false
|
{
|
||||||
|
title: '商户编号',
|
||||||
|
field: 'merchantId',
|
||||||
|
isSearch: true
|
||||||
},
|
},
|
||||||
detail: {
|
{
|
||||||
show: false
|
title: '应用编号',
|
||||||
}
|
field: 'appId',
|
||||||
},
|
isSearch: true
|
||||||
{
|
|
||||||
label: '应用编号',
|
|
||||||
field: 'appId',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商户名称',
|
|
||||||
field: 'merchantName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '应用名称',
|
|
||||||
field: 'appName'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商品名称',
|
|
||||||
field: 'subject'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商户退款单号',
|
|
||||||
field: 'merchantRefundNo'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '商户订单号',
|
|
||||||
field: 'merchantOrderId'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '交易订单号',
|
|
||||||
field: 'tradeNo'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '支付金额',
|
|
||||||
field: 'payAmount'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '退款金额',
|
|
||||||
field: 'refundAmount'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '渠道编码',
|
|
||||||
field: 'channelCode',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '退款类型',
|
|
||||||
field: 'type',
|
|
||||||
dictType: DICT_TYPE.PAY_REFUND_ORDER_TYPE,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('common.status'),
|
|
||||||
field: 'status',
|
|
||||||
dictType: DICT_TYPE.PAY_REFUND_ORDER_STATUS,
|
|
||||||
dictClass: 'number',
|
|
||||||
search: {
|
|
||||||
show: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: t('common.createTime'),
|
|
||||||
field: 'createTime',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
},
|
||||||
search: {
|
{
|
||||||
show: true,
|
title: '渠道编号',
|
||||||
component: 'DatePicker',
|
field: 'channelId',
|
||||||
componentProps: {
|
isSearch: true
|
||||||
type: 'datetimerange',
|
},
|
||||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
{
|
||||||
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]
|
title: '渠道编码',
|
||||||
|
field: 'channelCode',
|
||||||
|
dictType: DICT_TYPE.PAY_CHANNEL_CODE_TYPE,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付订单编号',
|
||||||
|
field: 'orderId',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '交易订单号',
|
||||||
|
field: 'tradeNo',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商户订单号',
|
||||||
|
field: 'merchantOrderId',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '商户退款单号',
|
||||||
|
field: 'merchantRefundNo',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回调地址',
|
||||||
|
field: 'notifyUrl',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '回调状态',
|
||||||
|
field: 'notifyStatus',
|
||||||
|
dictType: DICT_TYPE.PAY_ORDER_NOTIFY_STATUS,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款类型',
|
||||||
|
field: 'type',
|
||||||
|
dictType: DICT_TYPE.PAY_REFUND_ORDER_TYPE,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('common.status'),
|
||||||
|
field: 'status',
|
||||||
|
dictType: DICT_TYPE.PAY_REFUND_ORDER_STATUS,
|
||||||
|
dictClass: 'number',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付金额',
|
||||||
|
field: 'payAmount',
|
||||||
|
formatter: 'formatAmount',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款金额',
|
||||||
|
field: 'refundAmount',
|
||||||
|
formatter: 'formatAmount',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款原因',
|
||||||
|
field: 'reason',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '用户IP',
|
||||||
|
field: 'userIp',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道订单号',
|
||||||
|
field: 'channelOrderNo',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道退款单号',
|
||||||
|
field: 'channelRefundNo',
|
||||||
|
isSearch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道调用报错时',
|
||||||
|
field: 'channelErrorCode'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '渠道调用报错时',
|
||||||
|
field: 'channelErrorMsg'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '支付渠道的额外参数',
|
||||||
|
field: 'channelExtras'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款失效时间',
|
||||||
|
field: 'expireTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款成功时间',
|
||||||
|
field: 'successTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '退款通知时间',
|
||||||
|
field: 'notifyTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('common.createTime'),
|
||||||
|
field: 'createTime',
|
||||||
|
formatter: 'formatDate',
|
||||||
|
isForm: false,
|
||||||
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'XDataTimePicker'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
]
|
||||||
{
|
})
|
||||||
label: t('table.action'),
|
export const { allSchemas } = useVxeCrudSchemas(crudSchemas)
|
||||||
field: 'action',
|
|
||||||
width: '240px',
|
|
||||||
form: {
|
|
||||||
show: false
|
|
||||||
},
|
|
||||||
detail: {
|
|
||||||
show: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
])
|
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
@click="handleDetail(row.id)"
|
@click="handleDetail(row.id)"
|
||||||
/>
|
/>
|
||||||
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
|
<el-dropdown class="p-0.5" v-hasPermi="['infra:job:trigger', 'infra:job:query']">
|
||||||
<XTextButton title="更多" postIcon="ep:arrow-down" />
|
<XTextButton :title="t('action.more')" postIcon="ep:arrow-down" />
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
|
|
Loading…
Reference in New Issue