Commit edea1047 by 前端

commit

1 parent e0085b28
......@@ -2,7 +2,7 @@
<div class="add-wrap">
<div class="container">
<div class="title">营销配置</div>
<div class="flex">
<div style="display:flex">
<div class="gl-form-page">
<el-form ref="configForm" label-width="154px" :model="addForm" :rules="addRules">
<el-form-item label="营销名称:" prop="imName">
......@@ -14,8 +14,8 @@
<el-col :span="11">
<el-date-picker type="date" :picker-options="pickerOptions" placeholder="选择日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="addForm.date1" style="width: 100%"></el-date-picker>
</el-col>
<el-col class="line" :span="1">-</el-col>
<el-col :span="11">
<!-- <el-col class="line" :span="1">-</el-col> -->
<el-col :span="11" style="margin-left:12px;">
<el-time-picker placeholder="选择时间" value-format="HH:mm" format="HH:mm" v-model="addForm.date2" style="width: 100%"></el-time-picker>
</el-col>
<div class="el-form-item__error" v-if="isTime">请选择营销时间</div>
......@@ -51,7 +51,7 @@
<div class="config-form-item el-form-item">
<label class="is-require">短信内容:</label>
<div style="position: relative">
<wTextarea ref="textContent" class="textarea" v-model="textValue" @updateText="updateText" :style="{ 'min-height': boxHeight + 'px' }"></wTextarea>
<wTextarea ref="textContent" class="textarea" v-model="addForm.messageContext" @updateText="updateText" :style="{ 'min-height': boxHeight + 'px' }"></wTextarea>
<div class="select-panel">
<div @click="handleSelectMessage" class="flex">
<img src="@/images/link.png" class="link" />
......@@ -81,7 +81,7 @@
<el-button type="primary" @click="handleSave">提交</el-button>
</GLFooter>
<GLDialog title="提示" @onOk="handleSure" @onCancel="dialogVisible = false" type="warning" content="当前有内容信息未保存,是否继续返回?" :visible.sync="dialogVisible" mode="small"></GLDialog>
<GLDialog title="导入数据失败" :hasFooter="true" mode="small" :visible.sync="importVisible">
<GLDialog title="操作结果" :hasFooter="true" mode="small" :visible.sync="importVisible">
<div class="dialog-body-panel">
<div class="import-result">
<div class="success">
......@@ -176,6 +176,7 @@ export default {
methods: {
updateText(html) {
this.addForm.messageContext = html
this.textValue = html
},
handleSelectMessage() {
if (this.$refs.textContent.currentText.indexOf('#短链#') != -1) {
......@@ -185,11 +186,12 @@ export default {
this.addForm.messageContext = this.$refs.textContent.currentText
},
clearFile() {
this.importName = null
this.exportUrl = null
this.importName = ''
this.addForm.exportUrl = ''
this.$refs.file.value = ''
},
handleSave() {
console.log(this.addForm.messageContext)
this.isUplaod = false
this.isTime = false
this.isLink = false
......@@ -207,7 +209,7 @@ export default {
this.isLink = true
return
} else {
let array = this.addForm.messageContext.match(/#短链#/g).length
let array = this.addForm.messageContext.match(/#短链#/g)&&this.addForm.messageContext.match(/#短链#/g).length
this.count = array ? array.length : 0
}
if (this.count > 1) {
......@@ -217,26 +219,26 @@ export default {
this.$message.error('导入客户有效数为0,请重新上传')
return
}
this.$refs.configForm.validate(valid => {
if (valid) {
let params = {
imName: this.addForm.imName,
messageContext: this.addForm.messageContext,
exportUrl: this.addForm.exportUrl,
sendTime: this.addForm.date1 + ' ' + this.addForm.date2,
exportName: this.importName
}
this.$apis.marketing.createMessageInfo(params).then(res => {
this.$message({
message: res.code == '0' ? '创建成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == 0) {
this.$router.go(-1)
}
})
}
})
// this.$refs.configForm.validate(valid => {
// if (valid) {
// let params = {
// imName: this.addForm.imName,
// messageContext: this.addForm.messageContext,
// exportUrl: this.addForm.exportUrl,
// sendTime: this.addForm.date1 + ' ' + this.addForm.date2,
// exportName: this.importName
// }
// this.$apis.marketing.createMessageInfo(params).then(res => {
// this.$message({
// message: res.code == '0' ? '创建成功' : res.message,
// type: res.code == '0' ? 'success' : 'error'
// })
// if (res.code == 0) {
// this.$router.go(-1)
// }
// })
// }
// })
},
handleSure() {
this.$router.push('/marketing/index')
......@@ -330,11 +332,24 @@ export default {
if (res.code == 0) {
this.importVisible = true
this.ImportResult = res.data
} else {
this.$message({
message: res.message,
type: 'error'
})
this.clearFile()
}
})
},
handleImport() {
util.openUrl(this.ImportResult.errorUrl.replace(/https?:/, ''))
if (this.ImportResult.errorUrl) {
util.openUrl(this.ImportResult.errorUrl.replace(/https?:/, ''))
} else {
this.$message({
message: '暂无错误数据',
type: 'error'
})
}
}
}
}
......@@ -343,6 +358,7 @@ export default {
.container {
background: #ffffff;
margin-bottom: 16px;
padding:0;
.title {
height: 56px;
line-height: 56px;
......@@ -360,39 +376,38 @@ export default {
/deep/.el-form-item__content {
width: 460px;
}
/deep/.el-input--prefix .el-input__inner {
line-height: 32px;
height: 32px;
}
/deep/.el-input--prefix .el-input__inner {
line-height: 32px;
height: 32px;
}
/deep/.el-input__prefix {
line-height: 32px;
.el-input__icon{
line-height:32px;
}
}
/deep/.el-input__prefix {
line-height: 32px;
.el-input__icon {
line-height: 32px;
}
label {
font-size: 14px;
text-align: right;
color: #666;
width: 154px;
// margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
margin-left: 5px;
}
&.is-require {
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
label {
font-size: 14px;
text-align: right;
color: #666;
width: 154px;
// margin-right: 12px;
height: 36px;
line-height: 36px;
img {
width: 14px;
height: 14px;
vertical-align: middle;
margin-left: 5px;
}
&.is-require {
&::before {
content: '*';
color: #f56c6c;
margin-right: 4px;
}
}
}
.line {
color: #fff;
......@@ -426,6 +441,7 @@ export default {
.upload-result {
display: flex;
align-items: center;
margin-top:6px;
&-input {
width: 320px;
height: 26px;
......@@ -471,7 +487,6 @@ export default {
}
.image-uploader {
display: inline-block;
margin-bottom: 6px;
width: 120px;
position: relative;
input {
......@@ -492,7 +507,7 @@ export default {
font-size: 12px;
color: #999999;
line-height: 20px;
margin-top: 5px;
margin-top:4px;
white-space: nowrap;
}
}
......@@ -517,6 +532,7 @@ export default {
border-radius: 4px;
word-wrap: break-word;
margin-bottom: 10px;
line-height: 15px;
}
}
img {
......@@ -528,7 +544,6 @@ export default {
.dialog-body-panel {
.import-result {
font-size: 14px;
font-weight: 600;
color: #333333;
line-height: 22px;
display: flex;
......@@ -539,6 +554,9 @@ export default {
border-right: 1px solid #e7e7e7;
.number {
color: #2cca74;
font-size: 26px;
font-weight: 600;
margin-bottom:4px;
}
}
.fail {
......@@ -546,6 +564,9 @@ export default {
flex: 1;
.number {
color: #eb4e4e;
font-size: 26px;
font-weight: 600;
margin-bottom:4px;
}
}
}
......
......@@ -9,7 +9,7 @@
<div class="flex-top line-text" :key="index">
<div class="type-text">{{ item.text }}</div>
<tempalte v-if="item.key == 'exportName'">
<a class="type-value" :href="detailData.exportUrl">{{ detailData[item.key] }}</a>
<a class="type-value exportName" :href="detailData.exportUrl">{{ detailData[item.key] }}</a>
</tempalte>
<div v-else class="type-value">{{ detailData[item.key] ? detailData[item.key] : '--' }}</div>
</div>
......@@ -104,6 +104,7 @@ export default {
.container {
background: #ffffff;
margin: 16px 0;
padding: 0;
.title {
height: 56px;
line-height: 56px;
......@@ -124,9 +125,15 @@ export default {
.type-text {
width: 70px;
text-align: right;
line-height: 20px;
}
.type-value {
max-width: 576px;
line-height: 20px;
}
.exportName {
text-decoration: underline;
color: #5850ff;
}
}
.form-image {
......
......@@ -70,7 +70,9 @@ export default {
tableColumns: [
{
label: '营销名称',
prop: 'imName'
prop: 'imName',
line:1,
width:350
},
{
label: '营销客户数',
......@@ -109,7 +111,7 @@ export default {
})
},
handleDelete(data) {
this.$confirm('删除后数据将无法恢复,是否确认删除??', '提示', {
this.$confirm('删除后数据将无法恢复,是否确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
......
......@@ -187,7 +187,15 @@ export default {
}
},
subText(htm) {
const cutImg = htm.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, '$1').replace(/<span>([\s\S]*?)<\/span>/g, '$1')
const cutImg = htm
.replace(/<wise.+?>(.+?)(?:<\/wise>)/g, '$1')
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
.replace(/&amp;/g, '&')
.replace(/(\n|\s|&nbsp;)/g, '')
.replace(/<br>/g, '\n')
.replace(/<span>([\s\S]*?)<\/span>/g, '$1')
.replace(/<div>([\s\S]*?)<\/div>/g, '$1')
this.currentText = cutImg
this.$emit('updateText', this.currentText)
},
......@@ -231,6 +239,7 @@ export default {
}
},
handleInput(target) {
console.log(target)
// 即时更新数据
this.updateData(target.innerHTML)
let htm = target.innerHTML
......@@ -283,6 +292,7 @@ export default {
value(val) {
// 非锁定状态下,实时更新innerHTML
if (!this.isLocked) {
console.log(222222)
this.$refs.wTextareaContent.innerHTML = val
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!