Commit edea1047 by 前端

commit

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