Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
415 changes: 165 additions & 250 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions src/api/channel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/channel/list',
method:'get',
params:params
})
}

export function getChannel(id) {
return request({
url:'/channel/'+id,
method:'get'
})
}

export function createChannel(data) {
return request({
url:'/channel',
method:'post',
data:data
})
}

export function updateChannel(id, data) {
return request({
url:'/channel/'+ id,
method:'put',
data:data
})
}

export function deleteChannel(id) {
return request({
url:'/channel/'+id,
method:'delete',
})
}
4 changes: 2 additions & 2 deletions src/components/Tinymce/components/editorImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
host: ''
},
useOss:false, //使用oss->true;使用MinIO->false
ossUploadUrl:'http://macro-oss.oss-cn-shenzhen.aliyuncs.com',
minioUploadUrl:'http://localhost:8080/minio/upload',
ossUploadUrl:'http://macro-oss.oss-cn-shenzhen.aliyuncs.com',
minioUploadUrl:'http://localhost:8080/rustfs/upload',
}
},
methods: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Upload/multiUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
dialogImageUrl:null,
useOss:false, //使用oss->true;使用MinIO->false
ossUploadUrl:'http://macro-oss.oss-cn-shenzhen.aliyuncs.com',
minioUploadUrl:'http://localhost:8080/minio/upload',
minioUploadUrl:'http://localhost:8080/rustfs/upload',
};
},
computed: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Upload/singleUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
dialogVisible: false,
useOss:false, //使用oss->true;使用MinIO->false
ossUploadUrl:'http://macro-oss.oss-cn-shenzhen.aliyuncs.com',
minioUploadUrl:'http://localhost:8080/minio/upload',
minioUploadUrl:'http://localhost:8080/rustfs/upload',
};
},
methods: {
Expand Down
25 changes: 25 additions & 0 deletions src/icons/svg/product-sale-channel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 32 additions & 11 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ export const constantRouterMap = [
children: [{
path: 'home',
name: 'home',
component: () => import('@/views/home/index'),
// component: () => import('@/views/home/index'),
component: () => import('@/views/pms/product/index'),
meta: {title: '仪表盘', icon: 'dashboard'}
},
{
name: 'document',
path: 'https://www.macrozheng.com',
meta: {title: '学习教程', icon: 'document'}
},
{
name: 'video',
path: 'https://www.macrozheng.com/mall/foreword/mall_video.html',
meta: {title: '视频教程', icon: 'video'}
},
// {
// name: 'document',
// path: 'https://www.macrozheng.com',
// meta: {title: '学习教程', icon: 'document'}
// },
// {
// name: 'video',
// path: 'https://www.macrozheng.com/mall/foreword/mall_video.html',
// meta: {title: '视频教程', icon: 'video'}
// },
]
}
]
Expand Down Expand Up @@ -138,6 +139,26 @@ export const asyncRouterMap = [
component: () => import('@/views/pms/brand/update'),
meta: {title: '编辑品牌'},
hidden: true
},
{
path: 'channel',
name: 'channel',
component: () => import('@/views/pms/channel/index'),
meta: {title: '渠道管理', icon: 'channel'}
},
{
path: 'addChannel',
name: 'addChannel',
component: () => import('@/views/pms/channel/add'),
meta: {title: '添加渠道'},
hidden: true
},
{
path: 'updateChannel',
name: 'updateChannel',
component: () => import('@/views/pms/channel/update'),
meta: {title: '修改渠道'},
hidden: true
}
]
},
Expand Down
11 changes: 11 additions & 0 deletions src/views/pms/channel/add.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<channel-detail :is-edit="false"></channel-detail>
</template>

<script>
import ChannelDetail from './components/ChannelDetail'
export default {
name: 'addChannel',
components: {ChannelDetail}
}
</script>
130 changes: 130 additions & 0 deletions src/views/pms/channel/components/ChannelDetail.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<template>
<el-card class="form-container" shadow="never">
<el-form :model="channel"
:rules="rules"
ref="channelForm"
label-width="150px">
<el-form-item label="渠道名称:" prop="name">
<el-input v-model="channel.name" class="input-width"></el-input>
</el-form-item>
<el-form-item label="渠道编码:" prop="code">
<el-input v-model="channel.code" class="input-width"></el-input>
</el-form-item>
<el-form-item label="状态:">
<el-radio-group v-model="channel.status">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">禁用</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="排序:">
<el-input v-model="channel.sort" class="input-width"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('channelForm')">提交</el-button>
<el-button v-if="!isEdit" @click="resetForm('channelForm')">重置</el-button>
<el-button @click="goBack()">返回</el-button>
</el-form-item>
</el-form>
</el-card>
</template>

<script>
import {createChannel, getChannel, updateChannel} from '@/api/channel'
const defaultChannel = {
id: null,
name: '',
code: '',
status: 1,
sort: 0
};

export default {
name: "ChannelDetail",
props: {
isEdit: {
type: Boolean,
default: false
}
},
data() {
return {
channel: Object.assign({}, defaultChannel),
rules: {
name: [
{required: true, message: '请输入渠道名称', trigger: 'blur'},
{min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur'}
],
code: [
{required: true, message: '请输入渠道编码', trigger: 'blur'},
{min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur'}
]
}
};
},
created() {
if (this.isEdit) {
getChannel(this.$route.query.id).then(response => {
this.channel = response.data;
});
}else{
this.channel = Object.assign({},defaultChannel);
}
},
methods: {
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm('是否提交数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.isEdit) {
updateChannel(this.$route.query.id, this.channel).then(response => {
this.$refs[formName].resetFields();
this.$message({
message: '修改成功',
type: 'success',
duration:1000
});
this.$router.back();
});
} else {
createChannel(this.channel).then(response => {
this.$refs[formName].resetFields();
this.channel = Object.assign({},defaultChannel);
this.$message({
message: '提交成功',
type: 'success',
duration:1000
});
this.$router.back();
});
}
});
} else {
this.$message({
message: '验证失败',
type: 'error',
duration: 1000
});
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.channel = Object.assign({}, defaultChannel);
},
goBack() {
this.$router.back();
}
}
}
</script>

<style scoped>
.input-width {
width: 400px;
}
</style>
Loading