库存限制修改
This commit is contained in:
@ -2,7 +2,7 @@ ENV = 'development'
|
||||
|
||||
# 接口地址
|
||||
# VUE_APP_BASE_API = 'http://8.129.208.109:8001'
|
||||
VUE_APP_BASE_API = 'http://www.itxzz.top'
|
||||
VUE_APP_BASE_API = 'http://itxzz.51vip.biz'
|
||||
# VUE_APP_BASE_API = 'https://app2.yixiang.co'
|
||||
VUE_APP_WS_API = 'ws://8.129.208.109:8001'
|
||||
|
||||
|
||||
@ -8,6 +8,10 @@
|
||||
<template v-if="device!=='mobile'">
|
||||
<search id="header-search" class="right-menu-item" />
|
||||
|
||||
<el-tooltip content="源码地址" effect="dark" placement="bottom">
|
||||
<Github class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
<el-tooltip content="全屏缩放" effect="dark" placement="bottom">
|
||||
<screenfull id="screenfull" class="right-menu-item hover-effect" />
|
||||
</el-tooltip>
|
||||
|
||||
@ -25,7 +25,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '乐享美酒-后台管理',
|
||||
title: 'YSHOP-后台管理',
|
||||
logo: Logo
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ export default {
|
||||
beforeInit() {
|
||||
return true
|
||||
},
|
||||
getQueryParame: function() {
|
||||
getQueryParame() {
|
||||
return {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
|
||||
@ -2,7 +2,7 @@ module.exports = {
|
||||
/**
|
||||
* @description 网站标题
|
||||
*/
|
||||
title: '乐享美酒',
|
||||
title: 'YSHOP-3.2',
|
||||
/**
|
||||
* @description 是否显示 tagsView
|
||||
*/
|
||||
@ -42,9 +42,9 @@ module.exports = {
|
||||
/**
|
||||
* 底部文字,支持html语法
|
||||
*/
|
||||
footerTxt: '',
|
||||
footerTxt: '© 2019-2021 YSHOP <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">All Rights Reserved</a>',
|
||||
/**
|
||||
* 备案号
|
||||
*/
|
||||
caseNumber: ''
|
||||
caseNumber: '豫ICP备17049587-2号'
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<MaterialList v-model="form.sliderImageArr" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存">
|
||||
<el-input-number v-model="form.stock" />
|
||||
<el-input-number v-model="form.stock" maxlength="7"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="销量">
|
||||
<el-input-number v-model="form.sales" />
|
||||
|
||||
@ -24,6 +24,12 @@
|
||||
<el-input v-model="formValidate.unitName" @input="onInput()" style="width: 500px;" placeholder="请输入单位"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品原价">
|
||||
<!-- oneFormValidate[0].cost-->
|
||||
<el-input type="text" style="width: 500px;" disabled v-model="formValidate.productPrice" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="拼团开始时间" prop="startTime">
|
||||
<template>
|
||||
@ -54,12 +60,14 @@
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品主图片" prop="image">
|
||||
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150" :height="150" />
|
||||
<single-pic v-model="formValidate.image" style="width: 500px" type="image" :num="1" :width="150"
|
||||
:height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="产品轮播图" prop="slider_image">
|
||||
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150" :height="150" />
|
||||
<MaterialList v-model="formValidate.slider_image" style="width: 500px" type="image" :num="4" :width="150"
|
||||
:height="150"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
@ -82,15 +90,18 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 多规格设置-->
|
||||
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
|
||||
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"
|
||||
v-if="manyFormValidate.length && formValidate.header.length!==0 && attrs.length!==0">
|
||||
<!-- 多规格表格-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品属性:" class="labeltop">
|
||||
<el-table :data="manyFormValidate" size="small" style="width: 90%;">
|
||||
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index" :label="item.title" :property="item.slot" align="center">
|
||||
<el-table-column type="myindex" v-for="(item,index) in formValidate.header" :key="index"
|
||||
:label="item.title" :property="item.slot" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.column.property == 'pic'">
|
||||
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60" :height="60" align="center"/>
|
||||
<single-pic v-model="scope.row[scope.column.property]" type="image" :num="1" :width="60"
|
||||
:height="60" align="center"/>
|
||||
</div>
|
||||
<div v-else-if="scope.column.property.indexOf('value') != -1">
|
||||
{{ scope.row[scope.column.property] }}
|
||||
@ -141,7 +152,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="text" v-model="scope.row.stock" :disabled="true"/>
|
||||
<el-input type="text" v-model="scope.row.stock" maxlength="7" :disabled="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -152,7 +163,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="拼团库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="text" v-model="scope.row.pink_stock" />
|
||||
<el-input type="text" v-model="scope.row.pink_stock" maxlength="7"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="weight" label="重量(KG)" align="center ">
|
||||
@ -187,7 +198,8 @@
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="商品详情:">
|
||||
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog" style="width: 90%;"></ueditor-wrap>
|
||||
<ueditor-wrap v-model="formValidate.description" :config="myConfig" @beforeInit="addCustomDialog"
|
||||
style="width: 90%;"></ueditor-wrap>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -211,6 +223,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import MaterialList from '@/components/material'
|
||||
import singlePic from '@/components/singlematerial'
|
||||
import UeditorWrap from 'vue-ueditor-wrap';
|
||||
|
||||
export default {
|
||||
components: {editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic, cgood},
|
||||
data() {
|
||||
@ -267,6 +280,7 @@ export default {
|
||||
images: '',
|
||||
imageArr: [],
|
||||
sliderImageArr: [],
|
||||
productPrice:0,
|
||||
title: '',
|
||||
attr: '',
|
||||
people: 1,
|
||||
@ -541,6 +555,7 @@ export default {
|
||||
// that.formValidate.people = 0
|
||||
// that.formValidate.effectiveTime = 0
|
||||
that.oneFormValidate = [data.attr];
|
||||
that.formValidate.productPrice = that.oneFormValidate[0].cost
|
||||
that.formValidate.header = [];
|
||||
that.generate(null);
|
||||
that.manyFormValidate = data.attrs;
|
||||
@ -590,6 +605,7 @@ export default {
|
||||
that.formValidate = data;
|
||||
that.formValidate.cate_id = cate_id;
|
||||
that.oneFormValidate = [data.attr];
|
||||
that.formValidate.productPrice = that.oneFormValidate[0].cost
|
||||
that.formValidate.header = [];
|
||||
that.generate(data.productId);
|
||||
that.manyFormValidate = data.attrs;
|
||||
@ -644,7 +660,7 @@ export default {
|
||||
if (this.formValidate.spec_type === 1 && this.manyFormValidate.length === 0) {
|
||||
return this.$message.warning('请点击生成规格!');
|
||||
}
|
||||
edit(this.formValidate).then(async res => {
|
||||
add(this.formValidate).then(async res => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
@ -707,9 +723,11 @@ export default {
|
||||
<style scoped lang="stylus">
|
||||
.submission
|
||||
margin-left 10px;
|
||||
|
||||
.color-list .tip {
|
||||
color: #c9c9c9;
|
||||
}
|
||||
|
||||
.color-list .color-item {
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
@ -717,22 +735,29 @@ export default {
|
||||
color: #fff;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.color-list .color-item.blue {
|
||||
background-color: #1E9FFF;
|
||||
}
|
||||
|
||||
.color-list .color-item.yellow {
|
||||
background-color: rgb(254, 185, 0);
|
||||
}
|
||||
|
||||
.color-list .color-item.green {
|
||||
background-color: #009688;
|
||||
}
|
||||
|
||||
.columnsBox
|
||||
margin-right 10px
|
||||
|
||||
.priceBox
|
||||
width 100%
|
||||
|
||||
.rulesBox
|
||||
display flex
|
||||
flex-wrap: wrap;
|
||||
|
||||
.curs
|
||||
cursor pointer
|
||||
</style>
|
||||
|
||||
@ -147,7 +147,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="text" v-model="scope.row.stock" :disabled="true"/>
|
||||
<el-input type="text" v-model="scope.row.stock" maxlength="7" :disabled="true"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -158,7 +158,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="秒杀库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="text" v-model="scope.row.seckill_stock" />
|
||||
<el-input type="text" v-model="scope.row.seckill_stock" maxlength="7"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="weight" label="重量(KG)" align="center ">
|
||||
@ -222,6 +222,7 @@ export default {
|
||||
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic,cgood },
|
||||
data() {
|
||||
return {
|
||||
isAdd:false,// 是否是添加
|
||||
spinShow: false,myTimes: [],
|
||||
// 批量设置表格data
|
||||
oneFormBatch: [
|
||||
@ -407,9 +408,14 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.getInfo(),
|
||||
initData('api/yxSystemGroupData',{ groupName: 'yshop_seckill_time' }).then(res => {
|
||||
initData('api/yxSystemGroupData',{ groupName: 'yshop_seckill_time',status:1 }).then(res => {
|
||||
this.myTimes = res.content
|
||||
})
|
||||
if(this.$route.params.id){
|
||||
this.isAdd = false
|
||||
} else {
|
||||
this.isAdd = true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onInput(){
|
||||
@ -604,6 +610,7 @@ export default {
|
||||
that.form1.good.image = data.image
|
||||
that.generate(data.productId);
|
||||
that.manyFormValidate = data.attrs;
|
||||
console.log(data)
|
||||
if(data.spec_type === 0){
|
||||
that.manyFormValidate = [];
|
||||
}else {
|
||||
@ -653,7 +660,12 @@ export default {
|
||||
if(this.formValidate.spec_type === 1 && this.manyFormValidate.length===0){
|
||||
return this.$message.warning('请点击生成规格!');
|
||||
}
|
||||
edit(this.formValidate).then(async res => {
|
||||
|
||||
|
||||
// 判断是否是添加
|
||||
if(this.isAdd){
|
||||
console.log(this.formValidate)
|
||||
add(this.formValidate).then(res=>{
|
||||
this.$message({
|
||||
message:'操作成功',
|
||||
type: 'success'
|
||||
@ -664,6 +676,19 @@ export default {
|
||||
}).catch(res => {
|
||||
this.$message.error(res.msg);
|
||||
})
|
||||
}else{
|
||||
add(this.formValidate).then(async res => {
|
||||
this.$message({
|
||||
message:'操作成功',
|
||||
type: 'success'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$router.push({ path: '/activity/seckill' });
|
||||
}, 500);
|
||||
}).catch(res => {
|
||||
this.$message.error(res.msg);
|
||||
})
|
||||
}
|
||||
} else {
|
||||
if(!this.formValidate.store_name || !this.formValidate.cate_id || !this.formValidate.keyword
|
||||
|| !this.formValidate.unit_name || !this.formValidate.store_info
|
||||
|
||||
@ -2,11 +2,24 @@
|
||||
<div class="login">
|
||||
<div style="display:flex;justify-content:space-between;align-items: center;">
|
||||
<div style="padding: 0 60px 0 0">
|
||||
|
||||
<h3 style="color: #ffffff;font-size: 24px;padding: 0;margin-bottom: 10px">
|
||||
YSHOP单商户B2C电商系统
|
||||
</h3>
|
||||
<ul style="margin: 0;color: #ffffff;font-size: 15px;line-height: 25px;padding-left: 20px">
|
||||
<li>Springboot2</li>
|
||||
<li>MybatisPlus</li>
|
||||
<li>SpringSecurity</li>
|
||||
<li>Jwt</li>
|
||||
<li>Redis</li>
|
||||
<li>Vue</li>
|
||||
</ul>
|
||||
<h3 style="color: #ffffff;">
|
||||
官网:https://www.yixiang.co
|
||||
</h3>
|
||||
</div>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
|
||||
<h3 class="title">
|
||||
乐享美酒管理后台
|
||||
YSHOP后台管理系统-3.2
|
||||
</h3>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-input v-model="query.filter" clearable size="small" placeholder="全表模糊搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<el-input v-model="query.filter" clearable size="small" placeholder="全表模糊搜索" style="width: 200px;"
|
||||
class="filter-item" @keyup.enter.native="crud.toQuery"/>
|
||||
<rrOperation :crud="crud"/>
|
||||
</div>
|
||||
<crudOperation>
|
||||
@ -21,7 +22,8 @@
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column v-if="columns.visible('userName')" prop="userName" label="用户名"/>
|
||||
<el-table-column v-if="columns.visible('nickName')" prop="nickName" label="用户昵称"/>
|
||||
@ -44,7 +46,9 @@
|
||||
<p>确定强制退出该用户吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.$index].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.key, scope.$index)">确定</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row, scope.$index)">
|
||||
确定
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" size="mini" type="text">强退</el-button>
|
||||
</el-popover>
|
||||
@ -97,16 +101,19 @@ export default {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.delMethod(datas)
|
||||
}).catch(() => {})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 踢出用户
|
||||
delMethod(key, index) {
|
||||
delMethod(data, index) {
|
||||
const ids = []
|
||||
if (key instanceof Array) {
|
||||
key.forEach(val => {
|
||||
ids.push(val.key)
|
||||
if (data instanceof Array) {
|
||||
data.forEach(val => {
|
||||
ids.push(data.nickName + ":" + data.key)
|
||||
})
|
||||
} else ids.push(key)
|
||||
} else {
|
||||
ids.push(data.nickName + ":" + data.key)
|
||||
}
|
||||
this.delLoading = true
|
||||
delT(ids).then(() => {
|
||||
this.delLoading = false
|
||||
|
||||
@ -54,7 +54,6 @@
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-dle="scope.row.id === 1"
|
||||
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@ -67,7 +67,7 @@
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span :class="attr.check ? 'check':''">库存:</span>
|
||||
<el-input v-model="attr.sales" placeholder="库存" style="width: 60%" :number="true" />
|
||||
<el-input v-model="attr.sales" placeholder="库存" style="width: 60%" :number="true" maxlength="7"/>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<span :class="attr.check ? 'check':''">成本价:</span>
|
||||
|
||||
@ -164,7 +164,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="库存" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input type="text" v-model="scope.row.stock"/>
|
||||
<el-input type="text" v-model="scope.row.stock" maxlength="7"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="bar_code" label="商品编号" align="center">
|
||||
|
||||
@ -21,6 +21,12 @@
|
||||
<el-table-column prop="id" label="ID" />
|
||||
<el-table-column prop="map.time" label="开启时间(整数小时)" />
|
||||
<el-table-column prop="map.continued" label="持续时间(整数小时)" />
|
||||
<el-table-column prop="map.status" label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-show="scope.row.status == 1" type="success">开启</el-tag>
|
||||
<el-tag v-show="scope.row.status == 2" type="danger">关闭</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="checkPermission(['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT','YXSYSTEMGROUPDATA_DELETE'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-permission="['admin','YXSYSTEMGROUPDATA_ALL','YXSYSTEMGROUPDATA_EDIT']" size="mini" type="primary" icon="el-icon-edit" @click="edit(scope.row)" />
|
||||
@ -107,7 +113,8 @@ export default {
|
||||
id: data.id,
|
||||
groupName: data.groupName,
|
||||
time: data.map.time,
|
||||
continued: data.map.continued
|
||||
continued: data.map.continued,
|
||||
status:data.map.status
|
||||
}
|
||||
_this.dialog = true
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog"
|
||||
:title="isAdd ? '新增' : '编辑'" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item label="开启时间(整数小时)">
|
||||
<el-input v-model="form.time" style="width: 270px;"/>
|
||||
@ -7,6 +8,12 @@
|
||||
<el-form-item label="持续时间(整数小时)">
|
||||
<el-input v-model="form.continued" style="width: 270px;"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否开启">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio :label="1">开启</el-radio>
|
||||
<el-radio :label="2">关闭</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<!--<el-input v-model="form.groupName" />-->
|
||||
@ -19,6 +26,7 @@
|
||||
<script>
|
||||
import {add, edit} from '@/api/yxSystemGroupData'
|
||||
import picUpload from '@/components/pic-upload'
|
||||
|
||||
export default {
|
||||
components: {picUpload},
|
||||
props: {
|
||||
@ -34,10 +42,10 @@ export default {
|
||||
id: '',
|
||||
groupName: 'yshop_seckill_time',
|
||||
time: 5,
|
||||
status:2, //默认关闭
|
||||
continued: 2
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -45,6 +53,9 @@ export default {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
if (parseInt(this.form.continued) + parseInt(this.form.time) > 24) {
|
||||
return this.$message.error("开启+持续时间不能超过24小时")
|
||||
}
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
@ -87,7 +98,8 @@ export default {
|
||||
id: '',
|
||||
groupName: 'yshop_seckill_time',
|
||||
time: 5,
|
||||
continued: 2
|
||||
continued: 2,
|
||||
status:2 //默认关闭
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,14 @@
|
||||
<el-button icon="el-icon-plus" @click="addDomain"/>
|
||||
<el-button style="margin-left:0;" icon="el-icon-minus" @click.prevent="removeDomain(domain)"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="邮件内容">
|
||||
<ueditor-wrap v-model="form.content" :config="myConfig" @beforeInit="addCustomDialog"
|
||||
style="width: 90%;"></ueditor-wrap>
|
||||
</el-form-item>
|
||||
|
||||
<div ref="editor" class="editor"/>
|
||||
<el-button :loading="loading" style="margin-left:1.6%;" size="medium" type="primary" @click="doSubmit">发送邮件</el-button>
|
||||
<el-button :loading="loading" style="margin-left:1.6%;" size="medium" type="primary" @click="doSubmit">发送邮件
|
||||
</el-button>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
@ -24,11 +30,19 @@ import { send } from '@/api/tools/email'
|
||||
import {upload} from '@/utils/upload'
|
||||
import {validEmail} from '@/utils/validate'
|
||||
import {mapGetters} from 'vuex'
|
||||
import E from 'wangeditor'
|
||||
import UeditorWrap from 'vue-ueditor-wrap';
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
data() {
|
||||
return {
|
||||
myConfig: {
|
||||
autoHeightEnabled: false, // 编辑器不自动被内容撑高
|
||||
initialFrameHeight: 500, // 初始容器高度
|
||||
initialFrameWidth: '100%', // 初始容器宽度
|
||||
UEDITOR_HOME_URL: '/UEditor/',
|
||||
serverUrl: ''
|
||||
},
|
||||
loading: false, form: {subject: '', tos: [], content: ''},
|
||||
tos: [{
|
||||
value: ''
|
||||
@ -40,6 +54,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
UeditorWrap
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'imagesUploadApi'
|
||||
@ -68,6 +85,30 @@ export default {
|
||||
editor.create()
|
||||
},
|
||||
methods: {
|
||||
addCustomDialog () {
|
||||
window.UE.registerUI('yshop', function (editor, uiName) {
|
||||
let dialog = new window.UE.ui.Dialog({
|
||||
iframeUrl: '/yshop/materia/index',
|
||||
editor: editor,
|
||||
name: uiName,
|
||||
title: '上传图片',
|
||||
cssRules: 'width:1200px;height:500px;padding:20px;'
|
||||
});
|
||||
this.dialog = dialog;
|
||||
|
||||
var btn = new window.UE.ui.Button({
|
||||
name: 'dialog-button',
|
||||
title: '上传图片',
|
||||
cssRules: `background-image: url(../../../assets/images/icons.png);background-position: -726px -77px;`,
|
||||
onclick: function () {
|
||||
dialog.render();
|
||||
dialog.open();
|
||||
}
|
||||
});
|
||||
|
||||
return btn;
|
||||
}, 37);
|
||||
},
|
||||
removeDomain(item) {
|
||||
var index = this.tos.indexOf(item)
|
||||
if (index !== -1 && this.tos.length !== 1) {
|
||||
@ -108,7 +149,9 @@ export default {
|
||||
sub = true
|
||||
}
|
||||
})
|
||||
if (sub) { return false }
|
||||
if (sub) {
|
||||
return false
|
||||
}
|
||||
this.loading = true
|
||||
send(this.form).then(res => {
|
||||
this.$notify({
|
||||
@ -136,6 +179,7 @@ export default {
|
||||
margin: 20px;
|
||||
width: 730px;
|
||||
}
|
||||
|
||||
::v-deep .w-e-text-container {
|
||||
height: 360px !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user