提交 999cdc0a 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-edu-phrase2.6-0418' into 'release'

教培2.6迭代 code reviewer: 张平

教培2.6迭代 code reviewer: 张平

See merge request !153
<template>
<div class="send-push-wrapper" id="screenSetSPId">
<div class="component-content">
<el-row :gutter="30" class="row" type="flex">
<el-form :model="formData" ref="formData" :rules="rules" label-width="120px" class="form-inline">
<el-form-item label="标题:" prop="noticeTitle" style="min-width: 1000px;">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入推送标题" maxlength=30></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/30</span>
</el-col>
</el-form-item>
<el-form-item label="内容:" prop="noticeContent">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入推送内容" type="textarea"
:autosize="{ minRows: 5}" maxlength=250></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/250</span>
</el-col>
</el-form-item>
<el-form-item label="发送时间:" prop="customPushTime">
<el-col :span="8">
<el-date-picker
v-model="formData.customPushTime"
size="small"
type="datetime"
placeholder="请选择发送时间"
value-format="yyyy-MM-dd HH:mm"
format="yyyy-MM-dd HH:mm"
style="width: 100%;"
:picker-options="pickerOptions0"
></el-date-picker>
</el-col>
</el-form-item>
<el-form-item label="发送方式:" prop="channel">
<el-col :span="20">
<el-checkbox-group v-model="formData.channel">
<el-checkbox size="small" :label="1">App系统消息推送</el-checkbox>
</el-checkbox-group>
</el-col>
</el-form-item>
<el-form-item label="发送对象:" prop="sendScopeType">
<el-col :span="20">
<el-radio-group v-model="formData.sendScopeType">
<el-radio :label=1>尚未参加的学员</el-radio>
<el-radio :label=2>未完成项目的学员</el-radio>
<el-radio :label=3>项目内区域/机构负责人</el-radio>
<!-- <el-radio :label=4>本机构及下级机构学员</el-radio> -->
<el-radio :label=5>所有人</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
</el-form>
</el-row>
<el-col :span="20" :offset="2">
<el-button
type="primary"
size="small"
@click="cancleEdit()"
>取消</el-button>
<el-button
type="primary"
size="small"
@click="beforeConfirm()"
>发布</el-button>
</el-col>
</div>
<el-dialog
class="prot-dialog"
:title="dialogTitle"
:visible.sync="isShowDialog"
width="30%"
center
:close-on-click-modal=false
:close-on-press-escape=false
:show-close=false>
<p v-show="isCancleBtn" class="prot-dialog-tips-1">取消后,将不保存本次操作内容</p>
<p v-show="!isCancleBtn" class="prot-dialog-tips-1">{{dialogContent}}</p>
<!-- <p class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p> -->
<!-- <p class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p> -->
<span v-show="isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="cancleConfirm"> 确定取消 </el-button>
<el-button size="small" type="primary" @click="isShowDialog = false"> 继续操作 </el-button>
</span>
<span v-show="!isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="openFlagCancle"> 取消 </el-button>
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils";
import * as operationData from "@/utils/operation";
let vm = null;
export default {
props: {
formData: {
type: Object,
}
},
data() {
// let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在
// callback(new Error('请勿输入字符“ \\ ”'));
// } else if (value.indexOf(".") != -1) {
// callback(new Error('请勿输入字符“ . ”'));
// } else {
// callback();
// }
// };
return {
curmbFirst: "教培项目",
curmbSecond: "推送管理",
projectId: "",
dialogTitle: "确认要发布吗?",
dialogContent: `点击发布后将在「${this.formData.customPushTime}」向项目人员推送,是否继续发布?`,
isShowDialog: false,
isCancleBtn: true,
rules: {
noticeTitle: [
{ required: true, message: "请输入推送标题", trigger: "blur" },
{
min: 2,
max: 30,
message: "输入长度为2-30的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
// { validator: checkNoticeTitleStr, trigger: 'blur' }
],
noticeContent: [
{ required: true, message: "请输入推送内容", trigger: "blur" },
{
min: 2,
max: 250,
message: "输入长度为2-250的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
],
channel: [
{ required: true, message: "请选择发送方式", trigger: "blur" },
],
customPushTime: [
{ required: true, message: "请选择发送时间", trigger: "blur" },
],
sendScopeType: [
{ required: true, message: "请选择发送对象", trigger: "blur" },
]
},
changeNum: 1,
pickerOptions0: {
disabledDate: time => {
if (this.formData.customPushTime) {
return (
time.getTime() < new Date().getTime() - 24 * 60 * 60 * 1000
);
}
}
},
};
},
watch: {
formData: {
handler(newVal) {
this.changeNum ++;
this.$emit('changeNum', this.changeNum);
},
deep: true
}
},
created() {
vm = this;
},
// 挂载到Dom完成时
mounted: function() {
// commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSPId');
},
methods: {
beforeConfirm() {
vm.dialogTitle = "确认要发布吗?";
let flag = false;
vm.$refs['formData'].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
if(!flag) return;
this.dialogContent = `点击发布后将在「${this.formData.customPushTime}」向项目人员推送,是否继续发布?`,
vm.isCancleBtn = false;
vm.isShowDialog = true;
},
//提交推送信息
confirmEdit(needJump) {
openLoading(vm);
// vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdateAppPush", vm.formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.$router.push('/item-manager');
vm.$message.success('发布成功');
} else {
vm.$message.error(res.message);
}
});
},
// 点击取消按钮
cancleEdit() {
vm.dialogTitle = "确定取消吗?";
vm.isCancleBtn = true;
vm.isShowDialog = true;
},
// 切换开启状态
changeOpenFlag(value) {
if(vm.formData.noticeId && value == 1) {
vm.isCancleBtn = false;
vm.isShowDialog = true;
}
},
// 确认取消
cancleConfirm() {
vm.isShowDialog = false;
vm.$router.push('/item-manager');
},
// 确认开启的取消
openFlagCancle() {
vm.isShowDialog = false;
// vm.formData.openFlag = 2;
// vm.$forceUpdate();
},
// 确认开启
openFlagConfirm() {
vm.isShowDialog = false;
vm.confirmEdit();
}
}
};
</script>
<style lang="scss" scoped>
.send-push-wrapper {
.el-radio {
display: block;
padding-bottom: 12px;
}
.component-content {
background: #fff;
padding: 20px 30px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.complete {
float: right;
}
.text-black {
color: #d51f35;
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.el-input {
width: 80%;
}
.el-textarea {
width: 80%;
}
.el-form-item__error {
left: 13px;
}
.prot-dialog-tips-1 {
text-align: center !important;
}
}
</style>
\ No newline at end of file
<template>
<div class="send-notice-wrapper" id="screenSetSNId">
<!-- <bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb> -->
<div class="component-content">
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formData"
ref="formData"
:rules="rules"
label-width="120px"
class="form-inline"
style="min-height: 300px;">
<el-form-item label="是否开启公告:" prop="projectIntro" style="min-width: 1000px;margin-bottom: 10px">
<el-col :span="20">
<el-radio-group size="small" v-model="formData.openFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<el-form-item v-show="formData.openFlag != 2" label="标题:" prop="noticeTitle">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-col>
</el-form-item>
<el-form-item v-show="formData.openFlag != 2" label="内容:" prop="noticeContent">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" type="textarea"
:autosize="{ minRows: 5}" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-col>
</el-form-item>
<!-- <el-form-item size="small" style="padding-top: 300px;">
</el-form-item> -->
</el-form>
</el-row>
<el-col :span="20" :offset="2">
<el-button
type="primary"
size="small"
@click="cancleEdit()"
>取消</el-button>
<el-button
type="primary"
size="small"
@click="beforeConfirm()"
>发布</el-button>
</el-col>
</div>
<el-dialog
class="prot-dialog"
:title="dialogTitle"
:visible.sync="isShowDialog"
width="30%"
center
:close-on-click-modal=false
:close-on-press-escape=false
:show-close=false>
<p v-show="isCancleBtn" class="prot-dialog-tips-1">取消后,将不保存本次操作内容</p>
<p v-show="!isCancleBtn" class="prot-dialog-tips-1">点击发布后将立即生效,是否继续发布?</p>
<!-- <p class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p> -->
<!-- <p class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p> -->
<span v-show="isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="cancleConfirm"> 确定取消 </el-button>
<el-button size="small" type="primary" @click="isShowDialog = false"> 继续操作 </el-button>
</span>
<span v-show="!isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="openFlagCancle"> 取消 </el-button>
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils";
import * as operationData from "@/utils/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
props: {
formData: {
type: Object,
},
},
data() {
// let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在
// callback(new Error('请勿输入字符“ \\ ”'));
// } else if (value.indexOf(".") != -1) {
// callback(new Error('请勿输入字符“ . ”'));
// } else {
// callback();
// }
// };
return {
curmbFirst: "教培项目",
curmbSecond: "公告管理",
projectId: "",
dialogTitle: "",
// formData: {
// noticeContent: "",
// noticeId: 0,
// noticeTitle: "",
// openFlag: 0,
// projectId: 0
// },
isShowDialog: false,
isCancleBtn: true,
changeNum: 1,
rules: {
noticeTitle: [
{ required: true, message: "请输入公告标题", trigger: "blur" },
{
min: 2,
max: 20,
message: "输入长度为2-20的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
// { validator: checkNoticeTitleStr, trigger: 'blur' }
],
noticeContent: [
{ required: true, message: "请输入公告内容", trigger: "blur" },
{
min: 2,
max: 150,
message: "输入长度为2-150的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
],
},
};
},
watch: {
formData: {
handler(newVal) {
this.changeNum ++;
this.$emit('changeNum', this.changeNum);
},
deep: true
}
},
created() {
vm = this;
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight(300, 500, 'slidebar-container', 'screenSetSNId');
},
methods: {
beforeConfirm() {
vm.dialogTitle = "确认要发布吗?";
if(this.formData.openFlag == 1) {
let flag = false;
vm.$refs['formData'].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
if(!flag) return;
}
vm.isCancleBtn = false;
vm.isShowDialog = true;
},
//提交公告信息
confirmEdit(needJump) {
openLoading(vm);
// vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
// if(needJump) {
vm.$router.push('/item-manager');
vm.$message.success('发布成功');
// }
}
});
},
// 点击取消按钮
cancleEdit() {
vm.dialogTitle = "确定取消吗?";
vm.isCancleBtn = true;
vm.isShowDialog = true;
},
// 切换开启状态
changeOpenFlag(value) {
if(vm.formData.noticeId && value == 1) {
vm.isCancleBtn = false;
vm.isShowDialog = true;
}
},
// 确认取消
cancleConfirm() {
vm.isShowDialog = false;
vm.$router.push('/item-manager');
},
// 确认开启的取消
openFlagCancle() {
vm.isShowDialog = false;
// vm.formData.openFlag = 2;
// vm.$forceUpdate();
},
// 确认开启
openFlagConfirm() {
vm.isShowDialog = false;
vm.confirmEdit();
}
}
};
</script>
<style lang="scss" scoped>
.send-notice-wrapper {
.component-content {
background: #fff;
padding: 20px 30px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.complete {
float: right;
}
.text-black {
color: #d51f35;
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.el-input {
width: 80%;
}
.el-textarea {
width: 80%;
}
.el-form-item__error {
left: 13px;
}
.prot-dialog-tips-1 {
text-align: center !important;
}
}
</style>
\ No newline at end of file
...@@ -44,6 +44,9 @@ const templateManager = r => require.ensure([], () => r(require('../views/educat ...@@ -44,6 +44,9 @@ const templateManager = r => require.ensure([], () => r(require('../views/educat
const templateEditor = r => require.ensure([], () => r(require('../views/education/template-editor.vue')), 'template-editor') const templateEditor = r => require.ensure([], () => r(require('../views/education/template-editor.vue')), 'template-editor')
const templateOpen = r => require.ensure([], () => r(require('../views/education/template-open.vue')), 'templateOpen') const templateOpen = r => require.ensure([], () => r(require('../views/education/template-open.vue')), 'templateOpen')
const eduRole = r => require.ensure([], () => r(require('../views/education/edu-role.vue')), 'edu-role') const eduRole = r => require.ensure([], () => r(require('../views/education/edu-role.vue')), 'edu-role')
const noticeEditor = r => require.ensure([], () => r(require('../views/education/notice-editor.vue')), 'notice-editor')
export default [{ export default [{
path: '/', path: '/',
component: App, component: App,
...@@ -179,6 +182,10 @@ export default [{ ...@@ -179,6 +182,10 @@ export default [{
{ {
path: '/edu-role', path: '/edu-role',
component: eduRole component: eduRole
},
{
path: '/notice-editor',
component: noticeEditor
}, },
// { // {
// path: '/followup', // path: '/followup',
......
...@@ -16,6 +16,7 @@ export const envConfig = { ...@@ -16,6 +16,7 @@ export const envConfig = {
// baseUrl: 'https://uat-sc.yunqueyi.com/', // baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/', apiUrl: 'https://dev-api.yunqueyi.com/',
qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1", qiniuFileUrl: "https://dev-sc.yunqueyi.com/contents/admin/qiniu/token1",
// qiniuFileUrl: "https://uat-sc.yunqueyi.com/contents/admin/qiniu/token1",
qiniuResourceUrl: "https://test1-videos.yunqueyi.com", qiniuResourceUrl: "https://test1-videos.yunqueyi.com",
qiniuImgUrl: "https://test1-file.yunqueyi.com", qiniuImgUrl: "https://test1-file.yunqueyi.com",
loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html', loginUrl: 'https://dev-saas.yunqueyi.com/pica-login/work_station.html',
......
...@@ -55,7 +55,7 @@ service.interceptors.request.use(config => { ...@@ -55,7 +55,7 @@ service.interceptors.request.use(config => {
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境 if( process.env.BUILD_ENV == "development" ){ // 本地开发环境
// console.log('环境变量>>>> ', process.env.BUILD_ENV); // console.log('环境变量>>>> ', process.env.BUILD_ENV);
// config.headers['token'] = '29D71EAAB92E4580AFB16A8011BE7206'; // config.headers['token'] = '29D71EAAB92E4580AFB16A8011BE7206';
config.headers['token'] = 'D00E793808E84967B98289A3E057F52A'; config.headers['token'] = '83C6DADDC9804239B226D5C86F156D58';
// config.headers['token'] = localStorage.getItem('storageToken') // config.headers['token'] = localStorage.getItem('storageToken')
}else{ }else{
config.headers['token'] = localStorage.getItem('storageToken') config.headers['token'] = localStorage.getItem('storageToken')
......
<template>
<div class="notice-item-shield">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond"></bread-crumb>
<div class="component-content screenSet" id="screenSet">
<div class="header-title" style="position:relative;">
公告
<el-button
type="primary"
style="position: absolute;right: 30px;bottom: 8px;"
size="small"
@click="beforeConfirm()"
>发布</el-button>
<el-button
type="primary"
style="position: absolute;right: 100px;bottom: 8px;"
size="small"
@click="cancleEdit()"
>取消</el-button>
</div>
<el-row :gutter="30" class="row" type="flex" style="margin-top: 10px;">
<el-form :model="formData" ref="formData" :rules="rules" label-width="120px" class="form-inline">
<el-form-item label="是否开启公告:" prop="projectIntro" style="min-width: 1000px;margin-bottom: 10px">
<el-col :span="20">
<el-radio-group size="small" v-model="formData.openFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
<!-- <el-col :span="22" style="min-width: 600px;">
<el-form-item label="是否开启公告:">
<el-radio-group size="small" v-model="formData.openFlag" @change="changeOpenFlag">
<el-radio :label="1">开启</el-radio>
<el-radio :label="2">关闭</el-radio>
</el-radio-group>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="标题:" prop="noticeTitle">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="标题:" prop="noticeTitle">
<el-input size="small" v-model="formData.noticeTitle" placeholder="请输入公告标题" maxlength=20></el-input>
<span class="word-num">{{(formData.noticeTitle).replace(/\s+/g,"").length}}/20</span>
</el-form-item>
</el-col> -->
<el-form-item v-show="formData.openFlag != 2" label="内容:" prop="noticeContent">
<el-col :span="20">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" type="textarea"
:autosize="{ minRows: 5}" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-col>
</el-form-item>
<!-- <el-col v-show="formData.openFlag != 2" :span="20">
<el-form-item label="内容:" prop="noticeContent">
<el-input size="small" v-model="formData.noticeContent" placeholder="请输入公告内容" maxlength=150></el-input>
<span class="word-num">{{(formData.noticeContent).replace(/\s+/g,"").length}}/150</span>
</el-form-item>
</el-col> -->
</el-form>
</el-row>
</div>
<el-dialog
class="prot-dialog"
title=""
:visible.sync="isShowDialog"
width="30%"
center
:close-on-click-modal=false
:close-on-press-escape=false
:show-close=false>
<p v-show="isCancleBtn" class="prot-dialog-tips-1">确定取消吗?取消后将不保存本次操作内容</p>
<p v-show="!isCancleBtn" class="prot-dialog-tips-1">点击发布后将立即生效,是否继续发布?</p>
<!-- <p class="prot-dialog-tips-2">若您选择暂不发送,您只能录入量表的非敏感信息</p> -->
<!-- <p class="prot-dialog-tips-3">为避免打扰居民,7天内只能发送1次,您已发送过短信,请尽快联系居民同意授权</p> -->
<span v-show="isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="cancleConfirm"> 确定取消 </el-button>
<el-button size="small" type="primary" @click="isShowDialog = false"> 继续操作 </el-button>
</span>
<span v-show="!isCancleBtn" slot="footer" class="dialog-footer">
<el-button size="small" @click="openFlagCancle"> 取消 </el-button>
<el-button size="small" type="primary" @click="openFlagConfirm"> 确定 </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import BreadCrumb from "../../components/breadcrumb.vue";
import { openLoading, closeLoading } from "../../utils/utils";
import * as commonUtil from "../../utils/utils";
import * as operationData from "../../utils/operation";
let vm = null;
export default {
components: {
BreadCrumb
},
data() {
// let checkNoticeTitleStr = (rule, value, callback) => {
// if(value.indexOf("\\") != -1) {//存在
// callback(new Error('请勿输入字符“ \\ ”'));
// } else if (value.indexOf(".") != -1) {
// callback(new Error('请勿输入字符“ . ”'));
// } else {
// callback();
// }
// };
return {
curmbFirst: "教培项目",
curmbSecond: "公告管理",
projectId: "",
formData: {
noticeContent: "",
noticeId: 0,
noticeTitle: "",
openFlag: 0,
projectId: 0
},
isShowDialog: false,
isCancleBtn: true,
rules: {
noticeTitle: [
{ required: true, message: "请输入公告标题", trigger: "blur" },
{
min: 2,
max: 20,
message: "输入长度为2-20的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
// { validator: checkNoticeTitleStr, trigger: 'blur' }
],
noticeContent: [
{ required: true, message: "请输入公告内容", trigger: "blur" },
{
min: 2,
max: 150,
message: "输入长度为2-150的内容,可包含中英文、数字及特殊符号",
trigger: "blur"
},
],
}
};
},
created() {
vm = this;
vm.projectId = vm.getUrlSearch(window.location.href, "projectId");
vm.formData.projectId = vm.projectId
vm.getNoticeInfo();
},
// 挂载到Dom完成时
mounted: function() {
commonUtil.resizeHeight();
},
methods: {
//获取公告信息
getNoticeInfo() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.formData = res.data;
}
});
},
beforeConfirm() {
let flag = false;
vm.$refs['formData'].validate(valid => {
if (valid) {
flag = true;
} else {
flag = false;
}
});
if(!flag) return;
vm.isCancleBtn = false;
// if(vm.formData.noticeId) {
vm.isShowDialog = true;
// }
},
//提交公告信息
confirmEdit(needJump) {
openLoading(vm);
vm.formData.projectId = vm.projectId
vm.POST("portal/noticeInfo/insertOrUpdate", vm.formData).then(res => {
closeLoading(vm);
if (res.code == "000000") {
// if(needJump) {
vm.$router.push('/item-manager');
vm.$message.success('发布成功');
// }
}
});
},
// 点击取消按钮
cancleEdit() {
vm.isCancleBtn = true;
vm.isShowDialog = true;
},
// 切换开启状态
changeOpenFlag(value) {
if(vm.formData.noticeId && value == 1) {
vm.isCancleBtn = false;
vm.isShowDialog = true;
}
},
// 确认取消
cancleConfirm() {
vm.isShowDialog = false;
vm.$router.push('/item-manager');
},
// 确认开启的取消
openFlagCancle() {
vm.isShowDialog = false;
// vm.formData.openFlag = 2;
// vm.$forceUpdate();
},
// 确认开启
openFlagConfirm() {
vm.isShowDialog = false;
vm.confirmEdit();
}
}
};
</script>
<style lang="scss">
.notice-item-shield {
.component-content {
background: #fff;
padding: 20px 30px;
.header-title {
padding: 10px 12px;
font-size: 12px;
color: #449284;
border-bottom: 1px solid #efefef;
}
.complete {
float: right;
}
.text-black {
color: #d51f35;
}
}
.word-num {
font-size: 12px;
color: #999;
padding-top: 5px;
}
.el-input {
width: 80%;
}
.el-textarea {
width: 80%;
}
.el-form-item__error {
left: 13px;
}
}
</style>
\ No newline at end of file
此差异已折叠。
...@@ -188,12 +188,13 @@ ...@@ -188,12 +188,13 @@
type="primary" type="primary"
size="small" size="small"
>屏蔽</el-button> >屏蔽</el-button>
<!-- v-if="scope.row.level != 'L1'" -->
<el-button <el-button
v-if="idType == 1"
@click="addOrModifyNotice(scope.row, 0)" @click="addOrModifyNotice(scope.row, 0)"
v-if="scope.row.level != 'L3'"
type="primary" type="primary"
size="small" size="small"
>公告</el-button> >发送通知</el-button>
<el-button <el-button
@click="reviewReport(scope.row)" @click="reviewReport(scope.row)"
type="primary" type="primary"
......
<template>
<div class="notice-editor-wrap" id="screenSet">
<bread-crumb :curmbFirst="curmbFirst" :curmbSecond="curmbSecond" :curmbThird="curmbThird" :jumPathThird="jumPathThird"></bread-crumb>
<div class="add-content screenSet" >
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="发送公告" name="first">
<SendNotice :formData="noticeInfo.noticeInfo"></SendNotice>
</el-tab-pane>
<el-tab-pane label="发送推送" name="second">
<PushNotice :formData="noticeInfo.pushInfo"></PushNotice>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import BreadCrumb from "@/components/breadcrumb.vue";
import SendNotice from "@/components/education/notice/sendNotice";
import PushNotice from "@/components/education/notice/pushNotice";
import { openLoading, closeLoading } from "@/utils/utils";
import * as commonUtil from "@/utils/utils";
let vm = null;
export default {
data() {
return {
curmbFirst: "教培项目",
curmbSecond: "项目管理",
jumPathThird: 'template-manager',
curmbThird: '发送通知',
activeName: 'first',
noticeInfo: {
noticeInfo: {
noticeContent: "",
noticeId: 0,
noticeTitle: "",
openFlag: 0,
projectId: 0
},
pushInfo: {
channel: null,
customPushTime: null,
noticeContent: "",
noticeId: 0,
noticeTitle: "",
projectId: 0,
sendScopeType: null
}
}
}
},
components: {
BreadCrumb,
SendNotice,
PushNotice
},
created() {
vm = this;
console.log('wwwwwwwww');
vm.projectId = vm.getUrlSearch(window.location.href, "projectId") || 1476;
// vm.formData.projectId = vm.projectId
vm.getNoticeInfo2();
},
mounted() {
commonUtil.resizeHeight();
},
methods: {
handleClick(tab) {
console.log(tab);
},
//获取推送信息
getNoticeInfo2() {
let req = {
projectId: vm.projectId
};
openLoading(vm);
vm.GET("portal/noticeInfo/getNoticeInfo", req).then(res => {
closeLoading(vm);
if (res.code == "000000") {
vm.noticeInfo = res.data;
}
});
},
},
}
</script>
<style lang="scss" scoped>
.notice-editor-wrap {
background: #fff;
}
</style>
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册