Commit 4dd09ea3 by 前端

Merge branch 'v3.11.0' into 'master'

V3.11.0

See merge request !14
2 parents 581c47a2 8cef5167
This diff could not be displayed because it is too large.
import { http } from '@/main'
const defaultPath = 'scrm.api.busassistant.'
const url = 'rop-scrm-busassistant/router'
// 获取菜单名称
const getMenuListApi = params => {
params.method = `${defaultPath}discover.menu.list`
return http({
url,
data: params,
sign: true
})
}
// 新增菜单
const addMenuApi = params => {
params.method = `${defaultPath}discover.menu.insert`
return http({
url,
data: params,
sign: true
})
}
// 修改菜单
const updateMenuApi = params => {
params.method = `${defaultPath}discover.menu.update`
return http({
url,
data: params,
sign: true
})
}
const getListApi = params => {
if(!params.subMenuId) {
return new Promise((resolve, reject)=>{
reject()
})
};
params.method = `${defaultPath}discover.content.page`
return http({
url,
data: params,
sign: true
})
}
const getContentTypeListApi = params => {
params.method = `${defaultPath}discover.contentType.list`
return http({
url,
data: params,
sign: true
})
}
// 图片上传
const uploadImgApi = params => {
params.method = 'scrm.api.carlife.common.uploadImg'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
const updateStatusApi = params => {
params.method = `${defaultPath}discover.content.updateStatus`
return http({
url,
data: params,
sign: true
})
}
const updateContentTypeApi = params => {
params.method = `${defaultPath}discover.contentType.insertOrUpdate`
return http({
url,
data: params,
sign: true
})
}
const addContentApi = params => {
params.method = `${defaultPath}discover.content.insertOrUpdate`
return http({
url,
data: params,
sign: true
})
}
const getContentDetailApi = params => {
params.method = `${defaultPath}discover.content.detail`
return http({
url,
data: params,
sign: true
})
}
export default {
getMenuListApi,
addMenuApi,
updateMenuApi,
getListApi,
getContentTypeListApi,
updateStatusApi,
updateContentTypeApi,
addContentApi,
getContentDetailApi,
uploadImgApi
}
\ No newline at end of file
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.platform.'
const url = 'rop-scrm-shopmall/router'
// 分页查询仓库/销售中商品
const getListApi = params => {
params.method = `${defaultPath}goods.stockroom.page`
return http({
url,
data: params,
sign: true
})
}
export default {
getListApi,
}
......@@ -124,6 +124,7 @@ html {
// min-height: calc(100vh - 156px);
margin-bottom: 16px;
}
.content .approval-container {
margin-bottom: 10px;
}
......@@ -272,12 +273,15 @@ html {
.content .m-t-10 {
margin-top: 10px;
}
.content .m-t-20 {
margin-top: 20px;
}
.content .m-b-8 {
margin-bottom: 8px;
}
.content .m-b-10 {
margin-bottom: 10px;
}
......@@ -360,9 +364,11 @@ html {
.content .txt-grey {
color: #999999;
}
.content .text-e8 {
color: #eb4e4e !important;
}
.content .txt-center {
text-align: center;
}
......@@ -407,24 +413,29 @@ html {
display: flex;
flex-wrap: wrap;
}
.content .flex-align {
display: flex;
align-items: center;
}
.content .flex-top {
display: flex;
align-items: flex-start;
}
.content .flex-center {
display: flex;
justify-content: center;
align-items: center;
}
.content .flex-between {
display: flex;
justify-content: space-between;
align-items: center;
}
.content .flex-grow {
flex: 1;
}
......@@ -569,37 +580,48 @@ html {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
.content .text-10 {
font-size: 10px;
}
.content .text-14 {
font-size: 14px;
}
.content .text-16 {
font-size: 16px;
}
.content .color-3 {
color: #333333;
}
.content .line-20 {
line-height: 20px;
}
.content .weight-6 {
font-weight: 600;
}
.content .weight-5 {
font-weight: 500;
}
.content .weight-4 {
font-weight: 400;
}
.content .mt-10 {
margin-top: 10px;
}
.el-tooltip__popper.is-light {
background: #ffffff;
box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.08);
......@@ -607,12 +629,15 @@ html {
width: 177px;
box-sizing: border-box;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow {
border-top-color: #e4e7ed !important;
}
.el-tooltip__popper[x-placement^='top'] .popper__arrow:after {
border-top-color: #e4e7ed !important;
}
/* tab */
.myMessage {
z-index: 4000 !important;
......@@ -658,15 +683,18 @@ html {
background-color: #fdb757;
}
}
.loadingClass {
.el-icon-loading {
font-size: 22px;
}
.el-icon-loading,
.el-loading-text {
color: #5850ff !important;
}
}
.scrm-box-f {
background: #ffffff;
}
......@@ -720,3 +748,77 @@ html {
vertical-align: middle;
margin-right: 8px;
}
.operate-wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table-title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate-btn {
.el-button {
margin-left: 8px;
}
.export-btn {
margin-left: 8px;
}
}
}
.global-title-wrap {
background: #fff;
border-radius: 4px 4px 0 0;
.title {
display: inline-block;
box-sizing: border-box;
height: 40px;
line-height: 40px;
padding: 0 32px;
font-weight: 400;
font-size: 16px;
color: #666666;
border-radius: 4px 4px 0 0;
border-top: 1px;
border-left: 1px;
border-right: 1px;
border-style: solid;
border-color: #E5E5E5;
background: #FAFAFA;
text-align: center;
cursor: pointer;
}
.curTitleCla {
font-weight: 600;
color: #5850FF;
background-color: #fff;
border-bottom: 1px solid #fff;
}
}
.global-menu {
.module {
color: #666666;
}
.arrow-right {
font-weight: 600;
margin: 0 3px;
vertical-align: middle;
}
.active {
color: #5850FF;
}
}
\ No newline at end of file
<!-- 搜索 -->
<template>
<div :class="['glsx-combi-form', isEdit ? 'gl-form-page' : '']">
<el-form :ref="formRef" :inline="true" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<el-form :ref="formRef" :inline="isInline" :model="formObj" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<slot v-if="item.slotName && item.isHide" :name="item.slotName" :scope="item"></slot>
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :labelWidth="isEdit ? '154px' : labelWidth" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ 'margin-bottom': isEdit ? '24px' : '', 'margin-right': isEdit ? '0px' : '30px', ...item.style }" :label="item.label" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
......@@ -143,6 +144,10 @@ export default {
type: String,
default: '432px'
},
isInline: {
type: Boolean,
default: true
},
formRef: {
type: String,
default: 'formRef'
......
import { Message } from 'element-ui'
let util = {}
util.isImage = function(url) {
const suffix = url.split('.').pop()
const imageList = ['png','jpeg','jpg','webp','gif']
return imageList.includes(suffix)
}
util.cloneText = function(message) {
let input = document.createElement('input')
input.value = message
......
<template>
<GLDialog mode="mid" :close-on-click-modal="false" title="创建封面" :visible.sync="visible" :before-close="onCancel" @onOk="onOk" @onCancel="onCancel">
<glsx-combi-form class="glsx-combi-form" ref="detailRef" labelWidth="154px" defaultWidth="432px" :isInline="false" :formObj.sync="detailFormObj" :formData="detailFormData" :formRules="detailRules">
<div slot="coverSlot">
<Upload tip="建议尺寸:最大5M,176*120px" :formObj="detailFormObj" btnName="上传封面" attr="url"></Upload>
</div>
</glsx-combi-form>
</GLDialog>
</template>
<script>
import Upload from '@/components/Upload'
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'AddVideo',
components: {
glsxCombiForm,
Upload
},
props: {
visible: {
type: Boolean,
default: false
},
formObj: {
type: Object,
default: ()=>{
return {
title: '',
url: ''
}
}
}
},
data(){
return {
detailFormObj: {
title: '',
url: ''
},
detailFormData: [
{
label: '产品名称',
name: 'title',
type: 'input',
maxlength: 12,
showLimit: true
},
{
label: '产品封面',
name: 'url',
addHtml: 'coverSlot'
}
],
detailRules: {
title: [{ required: true, message: '请输入产品名称', trigger: 'change' }],
url: [{ required: true, message: '请上传产品封面', trigger: 'change' }]
},
}
},
created(){
const {title, url } = this.formObj
this.detailFormObj = { title, url }
},
methods: {
onCancel(){
this.$emit('closeDialog')
},
onOk() {
this.$refs.detailRef.$refs.formRef.validate(valid => {
if(valid){
const { title, url} = this.detailFormObj
this.$emit('confirmDialog',{ title, url })
}
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="menu-wrap">
<Menu ref="menuRef" class="menu"></Menu>
</div>
<div class="list">
<GLCombiForm class="search-wrap" ref="searchRef" labelWidth="154px" defaultWidth="432px" @handleOk="handleSearch" @handleRest="handleReset" :formObj="searchFormObj" :formData="searchFormData">
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">内容列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary">新增<i class="el-icon-arrow-down arrow-icon"></i></el-button>
<div class="dropdown-wrap">
<ul>
<li class="dropdown-item" @click="addContent(item)" v-for="item in contentTypeList" :key="item.id">{{ item.name }}</li>
</ul>
</div>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="coverImageSlot" slot-scope="scope">
<el-image
class="cover-img"
:src="scope.scope.prodImg"
:preview-src-list="[scope.scope.prodImg]">
</el-image>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
<AddImage v-if="contentObj.imageDialogVisible" :contentObj="contentObj" :visible="contentObj.imageDialogVisible"></AddImage>
<AddVideo v-if="contentObj.videoDialogVisible" :contentObj="contentObj" :visible="contentObj.videoDialogVisible"></AddVideo>
</div>
</template>
<script>
const CONTENT_LIST = [
{
id: '1',
name: '特色方案'
},
{
id: '2',
name: '案例视频'
},
{
id: '3',
name: '营销海报'
},
{
id: '4',
name: '操作指引'
},
{
id: '5',
name: 'banner'
}
]
import Menu from './components/Menu'
import AddVideo from './components/AddVideo'
import AddImage from './components/AddImage'
export default {
name: 'discover',
components: {
Menu,
AddVideo,
AddImage
},
data() {
return {
contentObj: {
imageDialogVisible: false,
videoDialogVisible: false,
type: ''
},
contentTypeList: CONTENT_LIST.slice(0, 4),
operateList:[
{
name: '新增子集'
},
{
name: '重命名'
}
],
getListApi: this.$apis.discover.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchFormObj: {
type: '',
status: '',
subMenuId: '4'
},
searchObj: {},
searchFormData: [
{
label: '所属内容专区',
name: 'type',
type: 'select',
optionList: [{id: '',name: '全部'}, ...CONTENT_LIST],
optionId: 'id',
optionLabel: 'name',
isClear: true
},
{
label: '状态',
name: 'status',
type: 'select',
optionList: [
{
id: '',
name: '全部'
},
{
id: '1',
name: '已上架'
},
{
id: '2',
name: '已下架'
}
],
optionId: 'id',
optionLabel: 'name',
isClear: true
},
],
buttonList: [
{
type: 'el-button',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.addContent(row.scope, 1)
}
},
{
type: 'el-button',
name: '上架',
attrs: {
type: 'text',
fn: '上架'
},
condition: row => {
return row.scope.type != 5 && row.scope.status != 1
},
listeners: {
click: row => this.updateStatus(row.scope.id, 1)
}
},
{
type: 'el-button',
name: '下架',
attrs: {
type: 'text',
fn: '下架'
},
condition: row => {
return row.scope.type != 5 && row.scope.status == 1
},
listeners: {
click: row => this.updateStatus(row.scope.id, 2)
}
}
],
tableParams: {
listName: 'list',
tableOption: {
width: 150
},
tableColumns: [
{
label: '所属内容专区',
formatter: (cell) => {
return CONTENT_LIST.find(item => item.id == cell.type).name
}
},
{
label: '封面图片',
prop: 'coverImage',
addHtml: 'coverImageSlot'
},
{
label: '内容封面标题',
prop: 'proName',
},
{
label: '状态',
prop: 'status',
formatter: (cell) => {
return (cell.status == 1 || cell.type == 5) ? '已上架' : '已下架'
}
},
]
},
}
},
created() {
},
mounted() {
},
methods:{
addContent(item, isEdit){
let type = isEdit ? item.type : item.id
if(type != 1){
this.contentObj = {
imageDialogVisible: type==3 || type==5,
videoDialogVisible: type==2 || type==4,
...this.$refs.menuRef.curModuleInfo,
type,
}
if(isEdit) this.contentObj.id = item.id
}else{
let params = {
...this.$refs.menuRef.curModuleInfo,
}
if(isEdit) params.id = item.id
const queryStr = encodeURIComponent(JSON.stringify(params))
this.$router.push({ path: `/discoverManager/addProd/`+queryStr,query: { $title: isEdit ? '编辑特色方案' : '新增特色方案' }})
}
},
updateStatus(id, status) {
if(status==2){
this.$confirm('请确认是否下架', '提示', {
confirmButtonText: '下架',
cancelButtonText: '否',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.toShelfProd(id, status)
}
}
})
}else{
this.toShelfProd(id, status)
}
},
toShelfProd(id, status){
this.$apis.discover.updateStatusApi({id, status}).then(res => {
if(res){
this.$message.success(`${status == 2 ? '下架成功' : '上架成功'}`)
this.handleSearch()
}
})
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
handleReset(){
this.searchFormObj = {
type: '',
status: '',
subMenuId: ''
},
this.handleSearch()
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchFormObj))
const { secondaryMenuId, thirdMenuId } = this.$refs.menuRef.curModuleInfo
params.subMenuId = thirdMenuId || secondaryMenuId
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.searchObj = this.getParams()
resolve()
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
position: relative;
.search-wrap{
/deep/ .el-form-item {
&, .search-item{
width: 312px;
}
}
}
.operate-btn{
position: relative;
&:hover{
.dropdown-wrap {
display: block;
}
}
.arrow-icon{
margin-left: 8px;
}
.dropdown-wrap{
display: none;
position: absolute;
background-color: #fff;
top: 100%;
width: 96px;
left: 0;
box-shadow: 0 3px 6px -4px #0000001f, 0 6px 16px 0 #00000014, 0 9px 28px 8px #0000000d;
z-index: 50;
.dropdown-item{
height: 36px;
line-height: 36px;
padding: 0 20px;
font-size: 14px;
color: #666666;
list-style: none;
cursor: default;
&:hover{
background: #F2F1FF;
color: #5850FF;
}
}
}
}
.cover-img{
height: 36px;
width: 36px;
}
.list{
background-color: #fff;
padding: 20px;
margin-left: 276px;
}
.menu-wrap{
overflow-y: auto;
position: absolute;
height: -webkit-fill-available;
background-color: #fff;
min-height: calc(100vh - 125px);
&::-webkit-scrollbar{
width: 4px;
}
}
}
</style>
\ No newline at end of file
......@@ -3,7 +3,7 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`]
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!