This commit is contained in:
kahu474
2021-07-13 18:45:05 +08:00
parent 0b560fdc61
commit 6014d686b5
5 changed files with 108 additions and 41 deletions

View File

@ -662,7 +662,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'

View File

@ -222,6 +222,7 @@ export default {
components: { editor, picUpload, mulpicUpload, Treeselect, MaterialList, UeditorWrap, singlePic,cgood },
data() {
return {
isAdd:false,// 是否是添加
spinShow: false,myTimes: [],
// 批量设置表格data
oneFormBatch: [
@ -410,6 +411,11 @@ export default {
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(){
@ -654,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'
@ -665,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

View File

@ -17,7 +17,7 @@
icon="el-icon-plus"
@click="toAddURL"
>
新增312
新增
</el-button>
</div>
</div>

View File

@ -54,7 +54,6 @@
<udOperation
:data="scope.row"
:permission="permission"
:disabled-dle="scope.row.id === 1"
msg="确定删除吗,如果存在下级节点则一并删除,此操作不能撤销!"
/>
</template>

View File

@ -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;
}