Files
2026-09-08 19:49:21 +08:00

1056 lines
44 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<!--
三八妇女活动管理
-->
<style>
input[type=file] {
display: none;
}
.w-e-text-container {
min-height: 200px !important;
max-height: 700px !important;
height: auto !important;
}
.w-e-text {
min-height: 200px !important;
max-height: 700px !important;
height: auto !important;
}
.ViewDialogClass .el-collapse-item__header {
font-size: 12px;
color: rgb(150, 150, 150);
/*font-weight: bold;*/
background-color: white;
}
.el-collapse-item__wrap {
border: none;
}
.el-collapse-item__header {
border: none;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.el-upload--picture-card {
width: 80px;
height: 80px;
line-height: 80px;
}
.el-upload-list--picture-card .el-upload-list__item {
width: 80px;
height: 80px;
line-height: 80px;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 80px;
height: 80px;
line-height: 80px;
text-align: center;
}
.avatar {
width: 80px;
height: 80px;
display: block;
}
.iphonex_box {
width: 366px;
height: 720px;
background: url("https://www.qmwtp.com/assets/www/ActivityPc2/img/iphoneX.png") no-repeat;
background-size: 100% 100%;
position: relative;
top: 0;
left: 0;
right: 0;
margin: 0 auto;
}
.box_title {
position: absolute;
width: 40%;
top: 68px;
color: white;
left: 0;
right: 0;
margin: 0 auto;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.new_frame {
position: absolute;
width: 321px;
height: 576px;
top: 94px;
left: 24px;
border-radius: 5px;
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
.clearfix:after {
content: '';
display: block;
clear: both;
}
.style_every {
width: 35px;
height: 35px;
border-radius: 4px;
position: relative;
float: left;
margin-right: 10px;
cursor: pointer;
margin-top: 5px;
}
li {
list-style: none;
}
.style_every input {
width: 100%;
height: 100%;
position: absolute;
opacity: 0;
top: 0px;
left: 0;
cursor: pointer;
}
.style_every img {
position: absolute;
top: 10px;
left: 7px;
display: none;
}
.ViewDialogClass .el-form-item {
margin-bottom: 20px;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<div class="btn-group tool-button">
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="按年度查询">
</el-date-picker>
</div>
<div class="btn-group tool-button">
<el-input placeholder="请输入内容" v-model="pageForm.hdname" clearable>
<template slot="prepend">活动主题</template>
</el-input>
</div>
<div class="btn-group tool-button">
<el-button icon="el-icon-search" @click="doSearch" type="primary"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<vi-title2 title="活动列表">
<template #func>
<el-button size="small" @click="openAdd" type="primary"><i
class="ti-plus"></i>
创建活动
</el-button>
</template>
</vi-title2>
<el-table
:data="tableData"
header-align="center"
style="width: 100%"
>
<el-table-column
label="序号"
type="index"
header-align="center"
align="center"
>
<template scope="scope">
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
prop="hdname"
label="主题"
header-align="center"
show-overflow-tooltip="true"
align="center">
</el-table-column>
<el-table-column
prop="cjr"
label="创建人"
header-align="center"
align="center">
</el-table-column>
<el-table-column
prop="hdcjsj"
label="创建时间"
header-align="center"
align="center">
</el-table-column>
<el-table-column
prop="time"
label="活动时间"
header-align="center"
width="300px"
align="center">
<template slot-scope="scope">
{{scope.row.hdkssj}} -- {{scope.row.hdjssj}}
</template>
</el-table-column>
<el-table-column
prop="hdflag"
label="状态"
header-align="center"
align="center">
<template slot-scope="scope">
<i v-if="!scope.row.hdflag"
class="fa fa-circle text-danger ml5"></i>
<i v-if="scope.row.hdflag"
class="fa fa-circle text-success ml5"></i>
</template>
</el-table-column>
<el-table-column
label="操作"
width="380"
header-align="center"
align="center">
<template slot-scope="scope">
<el-button v-if="scope.row.hdflag==false" type="success" size="mini"
@click="changeStatus(scope.row.hdid,true)">开启
</el-button>
<el-button v-else type="info" size="mini"
@click="changeStatus(scope.row.hdid,false)">关闭
</el-button>
<el-button @click="sendMsg(scope.row)" size="mini" type="primary">通知
</el-button>
<el-button size="mini" type="primary" @click="openCode(scope.row.hdid)">
二维码
</el-button>
<el-button type="primary" size="mini" @click="openEdit(scope.row.hdid)">
编辑
</el-button>
<el-button type="danger" size="mini" @click="doDelete(scope.row.hdid)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
<template #edit>
<el-row>
<el-col :span="9" style="position: relative;text-align: center">
<div class="iphonex_box">
<div class="box_title">{{formData.hdname}}</div>
<iframe class="new_frame" id="myIframe" scrolling="auto" frameborder="none;"
src="/platform/hd/wmhdMange/mobileBox">
</iframe>
</div>
<el-button type="info" style="margin-top: 10px" icon="el-icon-refresh"
@click="refreshBox"
round>刷新
</el-button>
</el-col>
<el-col :span="14" offset="1">
<el-form :model="formData" style="padding-top: 20px;padding-right: 10px"
ref="addForm"
label-position="left" :rules="formRules" size="medium"
label-width="90px">
<el-form-item prop="hdname" label="活动主题">
<el-input placeholder="请输入活动主题" v-model="formData.hdname"></el-input>
</el-form-item>
<el-row>
<el-col :span="24">
<el-form-item prop="time" label="活动时间">
<el-date-picker
style="width: 100%"
v-model="formData.time"
type="datetimerange"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00']">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="hdlb" label="活动类别">
<el-row v-for="lb,idx in formData.lbs" style="padding-bottom: 5px">
<el-col :span="20">
<el-input placeholder="请输入名称" v-model="lb.lname"></el-input>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="warning" icon="el-icon-plus" circle
@click="addZp(idx)"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="danger" :disabled="idx==0"
icon="el-icon-delete" circle
@click="formData.lbs.splice(idx,1)"></el-button>
</el-col>
<el-col style="padding: 5px 0">
<el-row v-for="zplb,idx2 in lb.zplbs"
style="padding-bottom: 5px">
<el-col :span="18">
<el-col :span="4"><span v-if="idx2==0"
class="el-form-item__label">作品类别</span><span
v-else>&nbsp;</span>
</el-col>
<el-col :span="20">
<el-input placeholder="请输入名称"
v-model="zplb.zname"></el-input>
</el-col>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="primary" icon="el-icon-s-tools" circle
@click="openSetting(zplb)"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="warning" icon="el-icon-plus" circle
@click="addZplb(lb, idx2)"></el-button>
</el-col>
<el-col :span="2" style="text-align: center">
<el-button type="danger" icon="el-icon-delete"
circle
@click="lb.zplbs.splice(idx2,1)"></el-button>
</el-col>
</el-row>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="面向对象" prop="joinCnd">
<div style="display: flex; justify-content: space-between">
<div style="width: 99%">
<el-select placeholder="请选择参加人员范围"
v-model="formData.activityGroupId" style="width: 99%"
clearable
filterable>
<el-option v-for="item in activityGroupList"
:label="item.groupName"
:value="item.groupId"></el-option>
</el-select>
</div>
<div>
<el-button @click="$refs.drawerUserScope.userScopeDialog = true"
type="primary">设置
</el-button>
</div>
</div>
</el-form-item>
<el-form-item prop="xlFlag" label="活动提醒">
<el-switch
v-model="formData.xlFlag"
active-color="#13ce66"
inactive-color="#ff4949">
</el-switch>
</el-form-item>
<el-form-item prop="hdjs" label="活动介绍">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="hdjsEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdcjry" label="参加人员">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="cjryEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdjlfs" label="奖励方式">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="jlfsEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdnr" label="活动内容">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="hdnrEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdlxr" label="联系人">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="lxrEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item prop="hdother" label="其他">
<el-collapse>
<el-collapse-item>
<template slot="title">
点击展开 <i class="header-icon el-icon-thumb"
style="margin-left: 5px"></i>
</template>
<div id="otherEditor"></div>
</el-collapse-item>
</el-collapse>
</el-form-item>
<el-form-item label="活动封面">
<file-upload :files.sync="formData.files"></file-upload>
</el-form-item>
<el-form-item label="配色">
<ul class="style_box old_stylebox clearfix"
style="display: block;padding-left: 0;">
<li class="style_every" v-for="color,idx in colorList"
@click="colorChange(color)"
:style="'background: '+color">
<img src="https://www.qmwtp.com/assets/www/ActivityPc2/img/duihao.png"
:style="'display: '+(formData.hdcolor==color?'block':'none')">
<input type="radio" name="sex" checked="checked" value="1">
</li>
</ul>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-row style="margin: 40px 0;text-align: right">
<el-button @click="addDialogVisible = false">取 消</el-button>
<!-- <el-button type="success" v-show="!formData.hdid" @click="doSubmit(false)">保 存
</el-button>-->
<el-button type="primary" @click="doSubmit">确 定</el-button>
</el-row>
</template>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</guava>
<drawer-user-scope
@group_change="getActivityGroup"
ref="drawerUserScope"
:group_id.sync="formData.activityGroupId"
></drawer-user-scope>
<send-msg ref="sendMsg" :url="sendMsgUrl"></send-msg>
<open-qr-code ref="openQRCode" :url="sendMsgUrl"></open-qr-code>
<el-dialog
title="更多设置"
:visible.sync="settingDialogVisible"
:close-on-click-modal="false"
width="40%" top="4%">
<el-form :model="currentZplb" label-width="160px" size="small">
<el-form-item label="作品介绍最多字数">
<el-input-number v-model="currentZplb.maxWordCount" :min="1" :max="10000"
style="width: 100%"></el-input-number>
</el-form-item>
<vi-title title="上传图片设置"></vi-title>
<el-form-item label="是否上传图片">
<el-radio v-model="currentZplb.isUploadPhoto" :label="true" border>上传</el-radio>
<el-radio v-model="currentZplb.isUploadPhoto" :label="false" border>不上传</el-radio>
</el-form-item>
<template v-if="currentZplb.isUploadPhoto === true">
<el-form-item label="上传图片数量">
<el-input-number v-model="currentZplb.photoNum" :min="1" :max="5"
style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item label="上传图片格式">
<el-checkbox-group v-model="currentZplb.photoType">
<el-checkbox label="jpg" key="jpg" border>jpg</el-checkbox>
<el-checkbox label="png" key="png" border>png</el-checkbox>
<el-checkbox label="jpeg" key="jpeg" border>jpeg</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="每张图片大小">
<el-input placeholder="请填写每张图片大小" v-model="currentZplb.photoSize" type="number">
<template slot="append">Mb</template>
</el-input>
</el-form-item>
</template>
<vi-title title="上传音/视频、文档设置"></vi-title>
<el-form-item label="是否上传音/视频、文档">
<el-radio v-model="currentZplb.isUploadOther" :label="true" border>上传</el-radio>
<el-radio v-model="currentZplb.isUploadOther" :label="false" border>不上传</el-radio>
</el-form-item>
<template v-if="currentZplb.isUploadOther === true">
<el-form-item label="文件上传数量">
<el-input-number v-model="currentZplb.otherFileNum" :min="1" :max="5"
style="width: 100%"></el-input-number>
</el-form-item>
<el-form-item label="上传文件格式">
<el-checkbox-group v-model="currentZplb.otherType">
<el-checkbox label="mp3" key="mp3">mp3</el-checkbox>
<el-checkbox label="mp4" key="mp4">mp4</el-checkbox>
<el-checkbox label="docx" key="docx">docx</el-checkbox>
<el-checkbox label="xlsx" key="xlsx">xlsx</el-checkbox>
<el-checkbox label="pdf" key="pdf">pdf</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="每个文件大小">
<el-input placeholder="请填写每个文件大小" v-model="currentZplb.otherSize" type="number">
<template slot="append">Mb</template>
</el-input>
</el-form-item>
</template>
</el-form>
<el-row class="mt20" justify="end" type="flex">
<el-button @click="settingDialogVisible=false">取消</el-button>
<el-button @click="doSetting" type="primary">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
const editor = {
hdjsEditor: null,
cjryEditor: null,
jlfsEditor: null,
hdnrEditor: null,
lxrEditor: null,
otherEditor: null,
}
var vue = new Vue({
el: '#app',
data: function () {
var self = this
var checkHdlb = function (rule, value, callback) {
if (self.formData.lbs.length == 0) {
callback(new Error("必填"))
}
self.formData.lbs.forEach(function (v) {
v.zplbs.forEach(function (v2) {
if (self.isNull(v2.zname)) {
callback(new Error("有类别未填写名称"))
}
})
if (self.isNull(v.lname)) {
callback(new Error("有类别未填写名称"))
}
})
callback()
};
return {
currentZplb: {},
settingDialogVisible: false,
codeDialogVisible: false,
selected: '',
colorList: ['#081776', '#31cab1', '#e54242', '#ff8939', '#ffb712', '#1dc47b', '#4495f7', '#ff5e8b', '#5d6e7f'],
fileList: [],
delFiles: [],
dialogImageUrl: '',
activeNames: '',
tableData: [],
pageForm: {
year: '',
hdtype: 1,
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
formData: {
hdtype: 1,
},
addDialogVisible: false,
editDialogVisible: false,
dialogVisible: false,
formRules: {
hdname: [{required: true, message: '必填', trigger: ['blur', 'change']}],
//hdjs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdcjry: [{required: true, message: '必填', trigger: ['blur', 'change']}],
//hdjlfs: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdnr: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdlxr: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// hdother: [{required: true, message: '必填', trigger: ['blur', 'change']}],
time: [{required: true, message: '必填', trigger: ['blur', 'change']}],
hdlb: [{required: true, validator: checkHdlb, trigger: ['blur', 'change']}],
},
isNull: function (val) {
if (val === null || val === undefined || val === '') {
return true
}
return false
},
id: '',
activityGroupList: [],
userScopeDialog: false,
sendMsgUrl: null
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
'drawer-user-scope': httpVueLoader('/components/plugins/DrawerUserScope.vue'),
'send-msg': httpVueLoader('/components/plugins/SendMsgByGroupId.vue'),
'open-qr-code': httpVueLoader('/components/plugins/OpenQRCode.vue'),
},
watch: {
'formData.activityGroupId': {
async handler(newVal, oldVal) {
this.activityGroupList = await getActivityGroup()
this.userScopeDialog = false
},
deep: true
},
},
methods: {
addZp(idx) {
let item = {}
this.initData(item)
this.formData.lbs.splice(idx+1, 0, {zplbs:[item]})
},
addZplb(lb, idx2) {
let item = {}
this.initData(item)
lb.zplbs.splice(idx2+1, 0, item)
},
doSetting() {
this.settingDialogVisible = false
},
openSetting(zplb) {
this.currentZplb = zplb
this.settingDialogVisible = true
},
sendMsg(row) {
const {hdname, hdid} = row
this.sendMsgUrl = `<a href="` + (APP_DOMAIN + "/platform/staffActivities?client=mobile&id=" + hdid) + `">点击参与</a>`
this.$refs.sendMsg.openDialog(row.activitygroupid)
},
openUserScope() {
this.userScopeDialog = true
},
changeActivity(val) {
if (val) {
const group = this.activityGroupList.find(v => v.groupId === val)
this.$set(this.formData, "activityGroupName", group.groupName)
} else {
this.$set(this.formData, "activityGroupName", "全部教职工")
}
},
share() {
const id = this.id
$.get("/platform/hd/wmhdMange/findOne", {hdid: id}, function (data) {
if (data.code == 0) {
window.open("http://connect.qq.com/widget/shareqq/index.html?url=" + HOST_URL + "/staffActivities?id=" + id + "&title=" + data.data.hdname + "&desc=" + data.data.hdname + "")
}
}
)
},
openCode(id) {
this.$refs.openQRCode.openCode("/platform/staffActivities?id=" + id)
},
doSubmit() {
if (!this.formData.hdid) {
this.doAdd()
} else if (this.formData.hdid) {
this.doEdit()
}
},
changeStatus(hdid, flag) {
$.post(base + "/platform/hd/wmhdMange/changeStatus", {
hdid: hdid,
flag: flag
}, function (data) {
if (data.code == 0) {
vue.$message({
message: data.msg,
type: 'success'
});
vue.pageData();
} else {
vue.$message({
message: data.msg,
type: 'error'
});
}
})
},
save() {
this.changeFormEditorData()
localStorage.setItem("wmhd_savedata", JSON.stringify(vue.formData))
this.$message({
message: '保存成功!',
type: 'success'
});
},
changeFormEditorDataTxt() {
this.$set(this.formData, 'hdjs', editor.hdjsEditor.txt.html())
this.$set(this.formData, 'hdcjry', editor.cjryEditor.txt.html())
this.$set(this.formData, 'hdjlfs', editor.jlfsEditor.txt.html())
this.$set(this.formData, 'hdnr', editor.hdnrEditor.txt.html())
this.$set(this.formData, 'hdlxr', editor.lxrEditor.txt.html())
this.$set(this.formData, 'hdother', editor.otherEditor.txt.html())
},
changeFormEditorData() {
this.$set(this.formData, 'hdjs', editor.hdjsEditor.txt.html())
this.$set(this.formData, 'hdcjry', editor.cjryEditor.txt.html())
this.$set(this.formData, 'hdjlfs', editor.jlfsEditor.txt.html())
this.$set(this.formData, 'hdnr', editor.hdnrEditor.txt.html())
this.$set(this.formData, 'hdlxr', editor.lxrEditor.txt.html())
this.$set(this.formData, 'hdother', editor.otherEditor.txt.html())
},
refreshBox() {
this.changeFormEditorData()
var fileList = []
vue.fileList.forEach(function (file) {
fileList.push(file.url)
})
vue.$set(vue.formData, 'fileList', fileList)
localStorage.setItem("wmhd_boxdata", JSON.stringify(vue.formData))
$('#myIframe').attr('src', $('#myIframe').attr('src'));
},
colorChange(color, idx) {
this.formData.hdcolor = color
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
doDelete(id) {
this.$confirm('确定要删除吗?这将会删除目前所有已提交的作品数据!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const data = await $.post(base + "/platform/hd/wmhdMange/delete", {hdid: id})
if (data.code == 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.pageData();
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}
}
});
},
async openEdit(id) {
this.formData = {}
this.fileList = []
this.delFiles = []
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
const data = await $.get("/platform/hd/wmhdMange/findOne", {hdid: id})
if (data.code == 0) {
data.data.time = [data.data.hdkssj, data.data.hdjssj]
this.formData = data.data
this.formData.lbs.forEach(item => {
item.zplbs.forEach(o => {
this.initData(o)
})
})
this.$refs.guava.edit()
this.$nextTick(() => {
E = window.wangEditor
for (key in editor) {
$('#' + key).html("")
editor[key] = new E('#' + key)
editor[key].create()
}
editor.hdjsEditor.txt.html(vue.formData.hdjs)
editor.cjryEditor.txt.html(vue.formData.hdcjry)
editor.jlfsEditor.txt.html(vue.formData.hdjlfs)
editor.hdnrEditor.txt.html(vue.formData.hdnr)
editor.lxrEditor.txt.html(vue.formData.hdlxr)
editor.otherEditor.txt.html(vue.formData.hdother)
this.refreshBox()
})
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
},
async doEdit() {
this.changeFormEditorDataTxt()
this.$refs["addForm"].validate(async valid => {
if (valid) {
this.changeFormEditorData()
this.formData.hdkssj = this.formData.time[0]
this.formData.hdjssj = this.formData.time[1]
let loading = this.$loading({
lock: true,
text: '数据正在提交中,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
const reps = await $.post("/platform/hd/wmhdMange/doEdit", {hdxx: JSON.stringify(this.formData)})
loading.close()
if (reps.code === 0) {
this.$message.success(reps.msg)
this.$refs.guava.index()
this.pageData()
} else {
this.$message.warning(reps.msg)
}
}
})
},
doAdd() {
this.changeFormEditorDataTxt()
this.$refs["addForm"].validate(async valid => {
if (valid) {
this.changeFormEditorData()
this.formData.hdkssj = this.formData.time[0]
this.formData.hdjssj = this.formData.time[1]
let loading = this.$loading({
lock: true,
text: '数据正在提交中,请稍后...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const reps = await $.post("/platform/hd/wmhdMange/doAdd", {hdxx: JSON.stringify(this.formData)})
loading.close()
if (reps.code === 0) {
this.$message.success(reps.msg)
this.$refs.guava.index()
localStorage.removeItem("wmhd_savedata")
this.pageData()
} else {
this.$message.warning(reps.msg)
}
}
})
localStorage.removeItem("wmhd_savedata");
},
async openAdd() {
if (localStorage.getItem("wmhd_savedata")) {
try {
this.formData = JSON.parse(localStorage.getItem("wmhd_savedata") || '{}')
} catch (e) {
localStorage.removeItem('wmhd_savedata')
this.formData = {
hdtype: 1,
hdcolor: this.colorList[0],
username: "${@shiro.getPrincipalProperty('username')}",
hdcjsj: moment().format('YYYY-MM-DD'),
lbs: [{zplbs: [{}]}],
}
this.initData(this.formData.lbs[0].zplbs[0])
}
} else {
this.formData = {
hdtype: 1,
hdcolor: this.colorList[0],
username: "${@shiro.getPrincipalProperty('username')}",
hdcjsj: moment().format('YYYY-MM-DD'),
lbs: [{zplbs: [{}]}],
}
this.initData(this.formData.lbs[0].zplbs[0])
}
this.$refs.guava.edit()
this.fileList = []
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
this.$nextTick(function () {
let E = window.wangEditor
for (key in editor) {
$('#' + key).html("")
editor[key] = new E('#' + key)
editor[key].create()
}
editor.hdjsEditor.txt.html(this.formData.hdjs)
editor.cjryEditor.txt.html(this.formData.hdcjry)
editor.jlfsEditor.txt.html(this.formData.hdjlfs)
editor.hdnrEditor.txt.html(this.formData.hdnr)
editor.lxrEditor.txt.html(this.formData.hdlxr)
editor.otherEditor.txt.html(this.formData.hdother)
if (localStorage.getItem("wmhd_savedata")) {
this.refreshBox()
} else {
$('#myIframe').attr('src', $('#myIframe').attr('src'));
}
})
},
initData(zplb) {
this.$set(zplb, 'maxWordCount', zplb.maxWordCount ? zplb.maxWordCount : 100)
this.$set(zplb, 'isUploadPhoto', zplb.isUploadPhoto ? zplb.isUploadPhoto : false)
this.$set(zplb, 'photoType', zplb.photoType ? zplb.photoType : ['jpg'])
this.$set(zplb, 'photoNum', zplb.photoNum ? zplb.photoNum : 1)
this.$set(zplb, 'photoSize', zplb.photoSize ? zplb.photoSize : 2)
this.$set(zplb, 'isUploadOther', zplb.isUploadOther ? zplb.isUploadOther : false)
this.$set(zplb, 'otherType', zplb.otherType ? zplb.otherType : ['mp4', 'docx'])
this.$set(zplb, 'otherFileNum', zplb.otherFileNum ? zplb.otherFileNum : 1)
this.$set(zplb, 'otherSize', zplb.otherSize ? zplb.otherSize : 2)
},
doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder: function (column) {//按字段排序
switch (column.order) {
case 'descending':
column.order = 'desc'
break
case "ascending":
column.order = 'asc'
break
}
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange: function (val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange: function (val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData: function () {//加载分页数据
var self = this;
sublime.showLoadingbar();//显示loading
$.post(base + "/platform/hd/wmhdMange/data", self.pageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.tableData = data.data.list;
self.pageForm.totalCount = data.data.totalCount;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
},
async created() {
this.activityGroupList = await getActivityGroup()
this.pageData();
},
mounted() {
}
})
</script>
<!--#
}
#-->