城阳pc工作端前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

239 lines
6.1 KiB

<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form" :inline="true" :rules="dataRule"
class="form">
<el-form-item label="标签名称" label-width="150px" style="display: block">
<div style="width: 500px">
<el-input v-model.trim="tagName" size="small" class="item_width_1" clearable placeholder="请输入">
</el-input>
</div>
</el-form-item>
<el-form-item label="首页显示" style="display: block" prop="peopleCount" label-width="150px">
<el-switch v-model="status" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle">取 消</el-button>
<!-- <el-button size="small" type="primary" :disabled="btnDisable" @click="handleComfirm">确
定</el-button> -->
<el-button size="small" type="primary" @click="handleComfirm">
</el-button>
</div>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // 引入Loading服务
import { requestPost } from '@/js/dai/request'
import Tinymce from '@c/tinymce2/index.vue'
import daiMap from "@/utils/dai-map";
// import UploadImage from './upload-image.vue'
import UploadImage from '@/views/modules/plugins/rent/upload-image.vue'
var map
var search
var markers
var infoWindowList
var geocoder // 新建一个正逆地址解析类
let loading // 加载动画
export default {
data () {
return {
tagName: '',
marde:'',
id:'',
status:0,
online:false
}
},
components: { Tinymce,UploadImage },
mounted () {
// this.initMap()
},
methods: {
async initForm(activityId){
console.log('activityIddetailShow',activityId)
if(activityId !== ''){
this.marde = 'edi'
this.id = activityId.id
this.tagName = activityId.tagName
if(activityId.status === 0){
this.online = false
this.status = activityId.status
}else {
this.online = true
this.status = activityId.status
}
}
},
async handleComfirm () {
// this.btnDisable = true
setTimeout(() => {
// this.btnDisable = false
}, 100)
if (this.tagName === '') {
this.$message.error('标签名称不能为空')
}else {
this.addActivity()
}
},
async addActivity () {
if (this.marde === 'edi') {
console.log(this.marde)
let url = '/actual/base/advertisingTag/update'
console.log(this.status)
let parmer = {
tagName:this.tagName,
status: this.status,
id: this.id
}
const { data, code, msg, internalMsg } = await requestPost(url, parmer)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
// this.btnDisable = false
} else if(internalMsg !== ''){
// this.btnDisable = false
this.$message.error(internalMsg)
}else{
this.$message.error(msg)
}
}else{
let url = '/actual/base/advertisingTag/save'
let parmer = {
tagName: this.tagName,
status:1
}
const { data, code, msg, internalMsg } = await requestPost(url, parmer)
if (code === 0) {
this.$message({
type: 'success',
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
// this.btnDisable = false
} else if(internalMsg !== ''){
// this.btnDisable = false
this.$message.error(internalMsg)
}else{
this.$message.error(msg)
}
}
},
handleCancle () {
this.resetData()
this.$emit('dialogCancle')
},
resetData () {
this.tagName =''
this.status = 0
this.marde = ''
this.online = false
},
// 开启加载动画
startLoading () {
loading = Loading.service({
lock: true, // 是否锁定
text: '正在加载……', // 加载中需要显示的文字
background: 'rgba(0,0,0,.7)' // 背景颜色
})
},
// 结束加载动画
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
dataRule () {
return {
small: [
{ required: true, message: '活动类型不能为空', trigger: 'blur' }
]
}
},
},
props: {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 560px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>