parent
f298959388
commit
659df35446
@ -0,0 +1,21 @@
|
|||||||
|
//通用的api接口
|
||||||
|
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//上传图片
|
||||||
|
export function uploadImg(data){
|
||||||
|
return request({
|
||||||
|
url: '/file/upload',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除图片
|
||||||
|
export function removeImg(url){
|
||||||
|
return request({
|
||||||
|
url: '/file/remove',
|
||||||
|
method: 'delete',
|
||||||
|
params: url
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取品牌分页数据
|
||||||
|
export function getBrandList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mall-product/product/brand/list',
|
||||||
|
method: 'get',
|
||||||
|
params:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增品牌信息
|
||||||
|
export function addBrand(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mall-product/product/brand/save',
|
||||||
|
method: 'post',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改品牌信息
|
||||||
|
export function editBrand(data) {
|
||||||
|
return request({
|
||||||
|
url: '/mall-product/product/brand/update',
|
||||||
|
method: 'put',
|
||||||
|
data:data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取品牌信息
|
||||||
|
export function getBrand(id) {
|
||||||
|
return request({
|
||||||
|
url: '/mall-product/product/brand/info/'+id,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除品牌信息
|
||||||
|
export function delBrand(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/mall-product/product/brand/delete',
|
||||||
|
method: 'delete',
|
||||||
|
data:ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,238 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||||
|
<el-form-item>
|
||||||
|
<el-input size="mini" v-model="dataForm.key" placeholder="参数名" clearable></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button-group>
|
||||||
|
<el-button size="mini" @click="getDataList()">查询</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="mini"
|
||||||
|
@click="addOrUpdateHandle()"
|
||||||
|
>新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
size="mini"
|
||||||
|
@click="deleteHandle()"
|
||||||
|
:disabled="dataListSelections.length <= 0"
|
||||||
|
>批量删除
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
border
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
@selection-change="selectionChangeHandle"
|
||||||
|
style="width: 100%;"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||||
|
<el-table-column prop="name" header-align="center" align="center" label="品牌名"></el-table-column>
|
||||||
|
<el-table-column prop="logo" header-align="center" align="center" label="品牌logo地址">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<img :src="scope.row.logo" style="width: 100px; height: 80px" alt=""/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="descript" header-align="center" align="center" label="介绍"></el-table-column>
|
||||||
|
<el-table-column prop="showStatus" header-align="center" align="center" label="显示状态">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.showStatus"
|
||||||
|
active-color="#13ce66"
|
||||||
|
inactive-color="#ff4949"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="0"
|
||||||
|
@change="updateBrandStatus(scope.row)"
|
||||||
|
></el-switch>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="firstLetter" header-align="center" align="center" label="检索首字母"></el-table-column>
|
||||||
|
<el-table-column prop="sort" header-align="center" align="center" label="排序"></el-table-column>
|
||||||
|
<el-table-column fixed="right" header-align="center" align="center" width="250" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="text" size="small" @click="updateCatelogHandle(scope.row.brandId)">关联分类</el-button>
|
||||||
|
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.brandId)">修改</el-button>
|
||||||
|
<el-button type="text" size="small" @click="deleteHandle(scope.row.brandId)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="totalPage>0"
|
||||||
|
:total="totalPage"
|
||||||
|
:page.sync="pageIndex"
|
||||||
|
:limit.sync="pageSize"
|
||||||
|
@pagination="getDataList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
|
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||||
|
|
||||||
|
<el-dialog title="关联分类" :visible.sync="cateRelationDialogVisible" width="30%">
|
||||||
|
<el-popover placement="right-end" v-model="popCatelogSelectVisible">
|
||||||
|
<category-cascader :catelogPath.sync="catelogPath"></category-cascader>
|
||||||
|
<div style="text-align: right; margin: 0">
|
||||||
|
<el-button size="mini" type="text" @click="popCatelogSelectVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="addCatelogSelect">确定</el-button>
|
||||||
|
</div>
|
||||||
|
<el-button slot="reference">新增关联</el-button>
|
||||||
|
</el-popover>
|
||||||
|
<el-table :data="cateRelationTableData" style="width: 100%">
|
||||||
|
<el-table-column prop="id" label="#"></el-table-column>
|
||||||
|
<el-table-column prop="brandName" label="品牌名"></el-table-column>
|
||||||
|
<el-table-column prop="catelogName" label="分类名"></el-table-column>
|
||||||
|
<el-table-column fixed="right" header-align="center" align="center" label="操作">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="deleteCateRelationHandle(scope.row.id,scope.row.brandId)"
|
||||||
|
>移除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cateRelationDialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="cateRelationDialogVisible = false">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from "./brand-add-or-update";
|
||||||
|
import {editBrand, getBrandList,delBrand} from "@/api/mall/product/brand";
|
||||||
|
// import CategoryCascader from "../common/category-cascader";
|
||||||
|
export default {
|
||||||
|
name: "Brand",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dataForm: {
|
||||||
|
key: ""
|
||||||
|
},
|
||||||
|
brandId: 0,
|
||||||
|
catelogPath: [],
|
||||||
|
dataList: [],
|
||||||
|
cateRelationTableData: [],
|
||||||
|
pageIndex: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalPage: 0,
|
||||||
|
dataListLoading: false,
|
||||||
|
dataListSelections: [],
|
||||||
|
addOrUpdateVisible: false,
|
||||||
|
cateRelationDialogVisible: false,
|
||||||
|
popCatelogSelectVisible: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
// CategoryCascader
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
addCatelogSelect() {
|
||||||
|
this.popCatelogSelectVisible = false;
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/product/categorybrandrelation/save"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData({
|
||||||
|
brandId: this.brandId,
|
||||||
|
catelogId: this.catelogPath[this.catelogPath.length - 1]
|
||||||
|
}, false)
|
||||||
|
}).then(({data}) => {
|
||||||
|
this.getCateRelation();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteCateRelationHandle(id, brandId) {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/product/categorybrandrelation/delete"),
|
||||||
|
method: "post",
|
||||||
|
data: this.$http.adornData([id], false)
|
||||||
|
}).then(({data}) => {
|
||||||
|
this.getCateRelation();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
updateCatelogHandle(brandId) {
|
||||||
|
this.cateRelationDialogVisible = true;
|
||||||
|
this.brandId = brandId;
|
||||||
|
this.getCateRelation();
|
||||||
|
},
|
||||||
|
getCateRelation() {
|
||||||
|
this.$http({
|
||||||
|
url: this.$http.adornUrl("/product/categorybrandrelation/catelog/list"),
|
||||||
|
method: "get",
|
||||||
|
params: this.$http.adornParams({
|
||||||
|
brandId: this.brandId
|
||||||
|
})
|
||||||
|
}).then(({data}) => {
|
||||||
|
this.cateRelationTableData = data.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
this.dataListLoading = true;
|
||||||
|
let params = {
|
||||||
|
page: this.pageIndex,
|
||||||
|
limit: this.pageSize,
|
||||||
|
key: this.dataForm.key
|
||||||
|
}
|
||||||
|
getBrandList(params).then(res => {
|
||||||
|
this.dataListLoading = false;
|
||||||
|
this.totalPage = res.page.totalCount;
|
||||||
|
this.dataList = res.page.list;
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
updateBrandStatus(data) {
|
||||||
|
//发送请求修改状态
|
||||||
|
editBrand(data).then(res => {
|
||||||
|
this.$modal.notifySuccess("修改成功");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 多选
|
||||||
|
selectionChangeHandle(val) {
|
||||||
|
this.dataListSelections = val;
|
||||||
|
},
|
||||||
|
// 新增 / 修改
|
||||||
|
addOrUpdateHandle(id) {
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init(id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 删除
|
||||||
|
deleteHandle(id) {
|
||||||
|
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||||
|
return item.brandId;
|
||||||
|
});
|
||||||
|
this.$confirm(
|
||||||
|
`确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning"
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.$modal.loading("请稍候...");
|
||||||
|
delBrand(ids).then(res => {
|
||||||
|
this.$modal.notifySuccess("删除成功");
|
||||||
|
this.getDataList();
|
||||||
|
this.$modal.closeLoading()
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>xjs-project-mall</artifactId>
|
||||||
|
<groupId>com.xjs</groupId>
|
||||||
|
<version>3.3.0</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<name>第三方服务</name>
|
||||||
|
|
||||||
|
<artifactId>mall-third-party</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>11</maven.compiler.source>
|
||||||
|
<maven.compiler.target>11</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!--阿里云存储-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alicloud-oss</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.xjs.mall.thirdparty;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceAutoConfiguration;
|
||||||
|
import com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration;
|
||||||
|
import com.ruoyi.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
|
import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import io.seata.spring.boot.autoconfigure.SeataAutoConfiguration;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商城Product启动器
|
||||||
|
* @author xiejs
|
||||||
|
* @since 2022-03-15
|
||||||
|
*/
|
||||||
|
@SpringBootApplication(exclude ={DataSourceAutoConfiguration.class,
|
||||||
|
SeataAutoConfiguration.class,
|
||||||
|
MybatisPlusAutoConfiguration.class,
|
||||||
|
DynamicDataSourceAutoConfiguration.class} )
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableRyFeignClients
|
||||||
|
public class MallThirdPartyApp {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(MallThirdPartyApp.class, args);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9986
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: xjs-mall-third-party
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
#配置组
|
||||||
|
group: xjs
|
||||||
|
#命名空间
|
||||||
|
namespace: xjs-666
|
@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/xjs-mall/third-party"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.xjs" level="info" />
|
||||||
|
<!--打印feign DEBUG日志-->
|
||||||
|
<logger name="com.xjs.common.client" level="debug"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn" />
|
||||||
|
|
||||||
|
<!-- 打开 Bean Searcher 的 SQL 日志 -->
|
||||||
|
<logger name="com.ejlchina.searcher.implement.DefaultSqlExecutor" level="DEBUG" additivity="false">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info" />
|
||||||
|
<appender-ref ref="file_error" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
|
||||||
|
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
|
||||||
|
-->
|
||||||
|
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
|
||||||
|
|
||||||
|
<id>mall-third-party</id>
|
||||||
|
|
||||||
|
<classpath>
|
||||||
|
<dir name="D:/Dev/IdeaPerject/GitHub/Cloud/xjs-business/xjs-project-mall/mall-third-party/target/classes">
|
||||||
|
</dir>
|
||||||
|
</classpath>
|
||||||
|
|
||||||
|
</application>
|
Loading…
Reference in new issue