|
@ -90,7 +90,7 @@ |
|
|
<!-- <el-input type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.sumUp"> |
|
|
<!-- <el-input type="textarea" autosize placeholder="请输入内容" v-model.trim="formData.sumUp"> |
|
|
</el-input> --> |
|
|
</el-input> --> |
|
|
<Tinymce class="tinymce_view " v-model.trim="formData.sumUp" :height="250" |
|
|
<Tinymce class="tinymce_view " v-model.trim="formData.sumUp" :height="250" |
|
|
placeholder="请输入活动总结" /> |
|
|
placeholder="请输入活动总结" @input="validateContent"/> |
|
|
</div> |
|
|
</div> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
|
|
@ -153,8 +153,8 @@ |
|
|
<div class="div_btn"> |
|
|
<div class="div_btn"> |
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
<el-button size="small" @click="handleCancle">取 消</el-button> |
|
|
<el-button size="small" v-if="formType != 'detail'" type="primary" :disabled="btnDisable" |
|
|
<el-button size="small" v-if="formType != 'detail'" type="primary" :disabled="btnDisable" |
|
|
@click="handleComfirm">确 |
|
|
@click="handleComfirm">确 定</el-button> |
|
|
定</el-button> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
@ -233,7 +233,9 @@ export default { |
|
|
customerId: localStorage.getItem('customerId'), |
|
|
customerId: localStorage.getItem('customerId'), |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
components: { Tinymce, UploadImage }, |
|
|
components: { Tinymce, UploadImage }, |
|
|
mounted() { |
|
|
mounted() { |
|
|
this.activityType() |
|
|
this.activityType() |
|
@ -241,6 +243,20 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
validateContent() { |
|
|
|
|
|
console.log("dfs g"); |
|
|
|
|
|
// 使用正则表达式去除HTML标签后检查内容 |
|
|
|
|
|
const textContent = this.stripHtml(this.formData.sumUp); |
|
|
|
|
|
if (textContent.trim() === '') { |
|
|
|
|
|
this.formData.sumUp = null; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
stripHtml(html) { |
|
|
|
|
|
const div = document.createElement('div'); |
|
|
|
|
|
div.innerHTML = html; |
|
|
|
|
|
return div.textContent || div.innerText || ''; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 上传成功 |
|
|
// 上传成功 |
|
|
handleImgSuccess(res, file, fileList) { |
|
|
handleImgSuccess(res, file, fileList) { |
|
|
if (res.code === 0 && res.msg === 'success') { |
|
|
if (res.code === 0 && res.msg === 'success') { |
|
@ -335,6 +351,16 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg) |
|
|
this.$message.error(msg) |
|
|
} |
|
|
} |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (!map) { |
|
|
|
|
|
this.initMap(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
console.log("map", map,this.formData.latitude, this.formData.longitude) |
|
|
|
|
|
} else { |
|
|
|
|
|
map.setCenter(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
map.setMarker(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
console.log("mapmapmap", map) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleOnlineRegistration(value) { |
|
|
handleOnlineRegistration(value) { |
|
@ -414,8 +440,8 @@ export default { |
|
|
console.log(startTimeArray); |
|
|
console.log(startTimeArray); |
|
|
const endTimeArray = util.dateFormatter(time[1], 'time').split('-') |
|
|
const endTimeArray = util.dateFormatter(time[1], 'time').split('-') |
|
|
console.log(endTimeArray); |
|
|
console.log(endTimeArray); |
|
|
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] + ' 00:00:00' |
|
|
this.formData.startTime = startTimeArray[0] + '-' + startTimeArray[1] + '-' + startTimeArray[2] |
|
|
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] + ' 23:59:59' |
|
|
this.formData.endTime = endTimeArray[0] + '-' + endTimeArray[1] + '-' + endTimeArray[2] |
|
|
// this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日' |
|
|
// this.startTimeShow = startTimeArray[0] + '年' + startTimeArray[1] + '月' + startTimeArray[2] + '日' |
|
|
// this.endTimeShow = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日' |
|
|
// this.endTimeShow = endTimeArray[0] + '年' + endTimeArray[1] + '月' + endTimeArray[2] + '日' |
|
|
} else { |
|
|
} else { |
|
@ -427,16 +453,7 @@ export default { |
|
|
async initForm(type, activityId) { |
|
|
async initForm(type, activityId) { |
|
|
this.startLoading() |
|
|
this.startLoading() |
|
|
console.log("啊实打实的", type, activityId) |
|
|
console.log("啊实打实的", type, activityId) |
|
|
this.$nextTick(() => { |
|
|
console.log(map); |
|
|
if (!map) { |
|
|
|
|
|
this.initMap(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
console.log("map", map) |
|
|
|
|
|
} else { |
|
|
|
|
|
map.setCenter(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
map.setMarker(this.formData.latitude, this.formData.longitude); |
|
|
|
|
|
console.log("mapmapmap", map) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
this.formType = type |
|
|
this.formType = type |
|
|
if (type === 'edit') { |
|
|
if (type === 'edit') { |
|
|
if (activityId.activityImgs || activityId.sumUp) { |
|
|
if (activityId.activityImgs || activityId.sumUp) { |
|
@ -479,6 +496,7 @@ export default { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
return this.$message.error(res.msg); |
|
|
return this.$message.error(res.msg); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
console.log(res.data); |
|
|
this.demandOptions = this.getFlagData( |
|
|
this.demandOptions = this.getFlagData( |
|
|
this.getTreeData(res.data), |
|
|
this.getTreeData(res.data), |
|
|
"usableFlag" |
|
|
"usableFlag" |
|
@ -566,8 +584,9 @@ export default { |
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
this.$refs['ref_form'].validate((valid, messageObj) => { |
|
|
this.formData.sendMessage = this.formData.sendMessage ? 1 : 0; |
|
|
this.formData.sendMessage = this.formData.sendMessage ? 1 : 0; |
|
|
console.log(this.formData, "2234323424") |
|
|
console.log(this.formData, "2234323424") |
|
|
const dateObj = this.formData.startTime.split(' '); |
|
|
const dateObj = this.formData.startTime; |
|
|
const formattedDate = dateObj[0]; // 获取日期部分,即 '2424-10-22' |
|
|
console.log(dateObj); |
|
|
|
|
|
const formattedDate = dateObj; // 获取日期部分,即 '2424-10-22' |
|
|
if (this.formData.cutOffTime != '' && formattedDate <= this.formData.cutOffTime) { |
|
|
if (this.formData.cutOffTime != '' && formattedDate <= this.formData.cutOffTime) { |
|
|
this.$message.error('报名截止时间要小于活动开始时间') |
|
|
this.$message.error('报名截止时间要小于活动开始时间') |
|
|
} else if (!valid) { |
|
|
} else if (!valid) { |
|
@ -623,7 +642,7 @@ export default { |
|
|
|
|
|
|
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
// 地图初始化函数,本例取名为init,开发者可根据实际情况定义 |
|
|
initMap(latitude, longitude) { |
|
|
initMap(latitude, longitude) { |
|
|
|
|
|
console.log(latitude, longitude,"564564568"); |
|
|
map = new daiMap( |
|
|
map = new daiMap( |
|
|
document.getElementById("app_activity"), |
|
|
document.getElementById("app_activity"), |
|
|
{ latitude, longitude }, |
|
|
{ latitude, longitude }, |
|
@ -742,6 +761,8 @@ export default { |
|
|
// longitude: null, //经度 |
|
|
// longitude: null, //经度 |
|
|
// latitude: null//纬度 |
|
|
// latitude: null//纬度 |
|
|
} |
|
|
} |
|
|
|
|
|
map="" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
// 开启加载动画 |
|
|
// 开启加载动画 |
|
|