提交 1ad9f891 编写于 作者: guangjun.yang's avatar guangjun.yang

Merge branch 'dev-saas-phrase2.1-0522' into 'release'

自定义项目 code reviewer:张平

自定义项目 code reviewer:张平

See merge request !156
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"vue-infinite-scroll": "^2.0.2", "vue-infinite-scroll": "^2.0.2",
"vue-router": "^2.1.1", "vue-router": "^2.1.1",
"vue-ueditor-wrap": "^2.4.1", "vue-ueditor-wrap": "^2.4.1",
"vuedraggable": "^2.23.2",
"vuex": "^2.0.0" "vuex": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
<template>
<div class="dialog">
<el-dialog
:title="dialogObj.title"
:show-close=false
:visible.sync="dialogObj.visible"
:close-on-click-modal="false"
width="600px"
center>
<p style="text-align: center;">{{dialogObj.message}}</p>
<p class="tip" v-if="dialogObj.tip">{{dialogObj.tip}}</p>
<span slot="footer" class="dialog-footer">
<el-button @click="confirm" v-if="dialogObj.confirmMsg">{{dialogObj.confirmMsg}}</el-button>
<el-button type="primary" @click="hide" v-if="dialogObj.hideMsg">{{dialogObj.hideMsg}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
props: {
dialogObj: {
type: Object,
default: () => {
return null;
}
}
},
data() {
return {
}
},
created() {},
methods: {
confirm() {
this.$emit('confirm');
},
hide() {
// this.$emit('hide');
this.dialogObj.visible = false;
}
}
}
</script>
<style lang="scss" scoped>
.tip {
margin-top: 20px;
text-align: center;
color: #C0C0C0;
}
</style>
<template>
<div class="select-course-wrapper">
<div class="top-line"></div>
<CourseSelect></CourseSelect>
<div class="top-line" style="margin-top: 20px;"></div>
<CourseList></CourseList>
</div>
</template>
<script>
import CourseSelect from '@/components/education/custom/course-select'
import CourseList from '@/components/education/custom/course-list'
export default {
data() {
return {
}
},
components: {
CourseSelect,
CourseList,
}
}
</script>
<style lang="less" scoped>
.select-course-wrapper {
min-width: 1200px;
.top-line {
// width: 120%;
height: 10px;
background: rgb(240, 242, 245);
}
}
</style>
\ No newline at end of file
<template>
<div class="cart-list-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<img @click="close" src="../../../assets/custom/icon/close.png" alt />
</div>
<ul v-if="cartList.length" class="cart-list">
<li class="cart-course" v-for="item in cartList" :key="item.courseId">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<span class="cost">免费</span>
</div>
<div class="delete" @click="deleteCart(item)">
<img src="../../../assets/custom/icon/icon-delete.png" alt />
</div>
</li>
</ul>
<div v-else class="no-list">
<img src="../../../assets/custom/icon/img-no-content.png" alt />
<span class="tips">您还未选择课程,快去选择课程组建项目吧!</span>
</div>
</div>
</template>
<script>
import { mapGetters } from "vuex";
export default {
data() {
return {};
},
computed: {
...mapGetters(["cartList", "courseList"])
},
methods: {
close() {
this.$emit("close");
},
deleteCart(item) {
// 先删除够物车中的课程
let delItemIndex = this.cartList.findIndex(course => {
return course.courseId == item.courseId;
});
this.cartList.splice(delItemIndex, 1);
// 再查找当前课程列表中是否有,如果有,则将其置为不选中状态
let courseIndex = this.courseList.list.findIndex(course => {
return course.courseId == item.courseId;
});
if (courseIndex >= 0) {
this.courseList.list[courseIndex].checked = false;
}
}
}
};
</script>
<style lang="less" scoped>
.cart-list-wrapper {
font-family: PingFang SC !important;
width: 440px;
height: 550px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.cart-header {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 50px;
line-height: 50px;
padding: 0 15px;
font-size: 18px;
font-weight: 700;
color: #000000;
background: #f9f9f9;
img {
width: 15px;
height: 15px;
}
}
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 490px;
overflow: auto;
.cart-course {
user-select: none;
position: relative;
display: flex;
flex-direction: row;
width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 410px;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120px;
height: 68px;
margin-right: 15px;
img {
width: 120px;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -7px;
left: 0;
font-size: 16px;
font-weight: 600;
color: #373839;
}
.cost {
position: absolute;
bottom: -7px;
left: 0;
font-size: 18px;
font-weight: 600;
margin-right: 4px;
color: #d82b2b;
}
}
.delete {
width: 35px;
img {
cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
.no-list {
position: relative;
top: 0;
left: 0;
z-index: 1;
display: flex;
flex-direction: column;
margin-top: 30px;
text-align: center;
margin-bottom: 100px;
align-items: center;
img {
width: 200px;
height: 200px;
}
.tips {
position: relative;
top: -10px;
left: 10px;
z-index: 2;
color: #999999;
}
}
}
</style>
\ No newline at end of file
<template>
<div class="sorted-cart-wrapper">
<div class="cart-header">
<span class="title">已选项目课程(共{{this.cartList.length}}节)</span>
<span class="sub">可上下拖拽课程行,调整课程在列表页的展示顺序</span>
</div>
<div v-if="projectId && (isPreview == 1 || projectStatus != 1)" class="cart-list">
<div class="cart-course is-preview" v-for="(item, index) in cartList" :key="index">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName | shortName(5)}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="true" class="exam-num">{{item.testCount}}场考试</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</div>
<draggable v-else class="cart-list" v-model="cartList">
<div class="cart-course" v-for="(item, index) in cartList" :key="index">
<div class="img">
<img :src="item.courseImageUrl" alt />
<span class="level">{{item.typeStr}}</span>
</div>
<div class="detail">
<span class="title">{{item.courseName | shortName}}</span>
<div class="chapter">
<span>{{item.docName}}</span>
<span class="section-num">{{item.chapterSum}}{{item.lectureNum}}{{item.totalTime}}</span><span v-if="item.testCount" class="exam-num">{{item.testCount}}场考试</span>
</div>
</div>
<div class="handler">
<img src="../../../assets/custom/icon/icon-handle.png" alt />
</div>
</div>
</draggable>
</div>
</template>
<script>
import draggable from "vuedraggable";
export default {
data() {
return {};
},
props: {
isPreview: String | Number,
projectStatus: String | Number,
projectId: String | Number,
},
computed: {
cartList: {
get() {
return this.$store.state.customStore.cartList;
},
set(value) {
this.$store.dispatch("setCartList", value);
}
}
},
components: {
draggable
},
methods: {}
};
</script>
<style lang="less" scoped>
.sorted-cart-wrapper {
position: relative;
top: 0;
left: 0;
z-index: 1;
font-family: PingFang SC !important;
width: 480px;
height: 790px;
background: #fff;
box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.15);
border-radius: 4px;
.mask {
position: absolute;
top: 0;
left: 0;
z-index: 2;
width: 440px;
height: 790px;
// background: ;
}
.cart-header {
display: flex;
flex-direction: column;
height: 70px;
padding: 0 15px;
background: #f9f9f9;
.title {
padding: 15px 0 28px 0;
height: 18px;
line-height: 18px;
font-size: 18px;
font-weight: 700;
color: #000000;
}
.sub {
height: 14px;
line-height: 14px;
font-size: 14px;
font-weight: 400;
color: #999999;
}
}
.cart-list {
display: flex;
flex-direction: column;
justify-content: flex-start;
height: 710px;
overflow: auto;
.cart-course {
cursor: pointer;
user-select: none;
position: relative;
display: flex;
flex-direction: row;
// width: 410px;
margin: 15px;
align-items: center;
border-radius: 4px;
&.is-preview {
cursor: default;
}
&::after {
position: absolute;
left: 0;
bottom: -15px;
z-index: 1;
content: "";
width: 100%;
height: 1px;
background: #e4e7ed;
}
.img {
position: relative;
top: 0;
left: 0;
width: 120px;
height: 68px;
margin-right: 15px;
img {
width: 120px;
height: 68px;
border-radius: 4px;
}
.level {
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 22px;
line-height: 22px;
text-align: center;
font-size: 14px;
font-weight: 500;
color: #fff;
background: rgba(0, 0, 0, 0.5);
border-radius: 4px 0px 4px 0px;
}
}
.detail {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
height: 60px;
.title {
position: relative;
top: -5px;
left: 0;
font-size: 16px;
line-height: 20px;
font-weight: 600;
color: #373839;
}
.chapter {
position: absolute;
bottom: -15px;
left: 0;
font-size: 14px;
font-weight: 400;
color: #999999;
.section-num::before,
.exam-num::before {
content: "";
position: relative;
top: 2.5px;
left: 0;
display: inline-block;
height: 14px;
line-height: 14px;
margin: 0 10px;
width: 1px;
background: #999999;
}
}
}
.handler {
width: 35px;
img {
// cursor: pointer;
width: 20px;
height: 20px;
float: right;
}
}
}
}
}
</style>
\ No newline at end of file
...@@ -44,6 +44,7 @@ const templateManager = r => require.ensure([], () => r(require('../views/educat ...@@ -44,6 +44,7 @@ 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 editCustom = r => require.ensure([], () => r(require('../views/education/edit-custom.vue')), 'templateOpen')
const noticeEditor = r => require.ensure([], () => r(require('../views/education/notice-editor.vue')), 'notice-editor') const noticeEditor = r => require.ensure([], () => r(require('../views/education/notice-editor.vue')), 'notice-editor')
...@@ -179,6 +180,10 @@ export default [{ ...@@ -179,6 +180,10 @@ export default [{
path: '/template-open', path: '/template-open',
component: templateOpen component: templateOpen
}, },
{
path: '/edit-custom',
component: editCustom
},
{ {
path: '/edu-role', path: '/edu-role',
component: eduRole component: eduRole
......
const customStore = {
// namespaced: true,
state: {
searchParam: {
orderBy: 2,
dir: 1,
grade: 0,
pageNo: 1,
pageSize: 10,
labelIdList: []
},
cartList: [],
courseList: [],
allLabelList: [],
subLabelList: [],
courseLimitCount: -1 // -1: 不限制; 其它值: 限制的个数
},
mutations: {
SET_SEARCH_PARAM: (state, searchParam) => {
state.searchParam = searchParam;
},
SET_CART_LIST: (state, cartList) => {
state.cartList = cartList;
},
SET_COURSE_LIST: (state, courseList) => {
state.courseList = courseList;
},
SET_ALL_LABEL_LIST: (state, allLabelList) => {
state.allLabelList = allLabelList;
},
SET_SUB_LABEL_LIST: (state, subLabelList) => {
state.subLabelList = subLabelList;
},
SET_COURSE_LIMIT_COUNT: (state, courseLimitCount) => {
state.courseLimitCount = courseLimitCount;
},
},
actions: {
setSearchParam({ commit }, searchParam) {
commit('SET_SEARCH_PARAM', searchParam);
},
setCartList({ commit }, cartList) {
commit('SET_CART_LIST', cartList);
},
setCourseList({ commit }, courseList) {
commit('SET_COURSE_LIST', courseList);
},
setAllLabelList({ commit }, allLabelList) {
commit('SET_ALL_LABEL_LIST', allLabelList);
},
setSubLabelList({ commit }, subLabelList) {
commit('SET_SUB_LABEL_LIST', subLabelList);
},
setCourseLimitCount({ commit }, courseLimitCount) {
commit('SET_COURSE_LIMIT_COUNT', courseLimitCount);
},
}
}
export default customStore;
\ No newline at end of file
const getters = {
searchParam: state => state.customStore.searchParam,
cartList: state => state.customStore.cartList,
courseList: state => state.customStore.courseList,
allLabelList: state => state.customStore.allLabelList,
subLabelList: state => state.customStore.subLabelList,
courseLimitCount: state => state.customStore.courseLimitCount,
}
export default getters
import education from './education/getters' import education from './education/getters'
import custom from './custom/getters'
import { containObject } from '../utils/utils' // import { containObject } from '../utils/utils'
// let getters = containObject(education)
const getters = containObject(education)
const getters = Object.assign(education, custom)
export default getters export default getters
\ No newline at end of file
...@@ -9,7 +9,8 @@ import patientsDiagnose from './patientsManage/patientsDiagnose'; ...@@ -9,7 +9,8 @@ import patientsDiagnose from './patientsManage/patientsDiagnose';
// cme // cme
import cmeStore from './cme/cmeStore'; import cmeStore from './cme/cmeStore';
// custom
import customStore from './custom/customStore';
Vue.use(Vuex) Vue.use(Vuex)
...@@ -19,6 +20,7 @@ export default new Vuex.Store({ ...@@ -19,6 +20,7 @@ export default new Vuex.Store({
...followModules, ...followModules,
patientsDiagnose, patientsDiagnose,
cmeStore, cmeStore,
customStore
}, },
getters getters
}) })
......
...@@ -120,3 +120,45 @@ ...@@ -120,3 +120,45 @@
border-color: #ecedf1; border-color: #ecedf1;
border-radius: 2px; border-radius: 2px;
} }
.custom-select-wrapper {
.el-checkbox__label {
padding-left: 5px !important;
font-size: 14px !important;
color: #333;
}
.el-checkbox__input.is-checked+.el-checkbox__label {
color: #449284;
}
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner {
color: #449284;
}
.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner {
background-color: #449284;
border-color: #449284;
}
}
.custom-select-wrapper {
// .el-button:focus, .el-button:hover {
// color: #449284;
// border-color: #449284;
// // background-color: #449284;
// }
.el-button.is-plain, .el-button.is-plain {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button.is-plain:focus, .el-button.is-plain:hover {
background: #fff !important;
border-color: #449284 !important;
color: #449284 !important;
}
.el-button--mini, .el-button--small {
font-size: 14px;
border-radius: 3px;
}
}
...@@ -54,8 +54,7 @@ service.interceptors.request.use(config => { ...@@ -54,8 +54,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'] = '69A24843079C458DBAC7E7C954923718';
config.headers['token'] = '4606AE29F7E547388A9339ACC2EC2B0D';
// 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')
......
...@@ -437,6 +437,14 @@ const vueFilter = { ...@@ -437,6 +437,14 @@ const vueFilter = {
} else { } else {
return value return value
} }
},
// 将字符串截短至指定长度,并用在最后追加特定字符串(例如:...)
shortName: (value, length = 24, append = '...') => {
if (value && value.length > length) {
return value.substring(0, length) + append
} else {
return value
} }
},
} }
export default vueFilter export default vueFilter
\ No newline at end of file
...@@ -236,13 +236,15 @@ export function convertTime(time, isToSlash = true) { ...@@ -236,13 +236,15 @@ export function convertTime(time, isToSlash = true) {
} else { } else {
if(isToSlash) { if(isToSlash) {
if(typeof(time) == 'object') { if(typeof(time) == 'object') {
return time.format("yyyy/MM/dd hh:mm:ss"); // return time.format("yyyy/MM/dd hh:mm:ss");
return new Date(time.getTime()).format("yyyy/MM/dd hh:mm:ss");
} else { } else {
return time.replace(/-/g, '/') return time.replace(/-/g, '/')
} }
} else { } else {
if(typeof(time) == 'object') { if(typeof(time) == 'object') {
return time.format("yyyy-MM-dd hh:mm:ss"); // return time.format("yyyy-MM-dd hh:mm:ss");
return new Date(time.getTime()).format("yyyy-MM-dd hh:mm:ss");
} else { } else {
return time.replace(/\//g, '-') return time.replace(/\//g, '-')
} }
......
import axios from 'axios'; import axios from 'axios';
// 对象的合并 // 对象的合并
export const containObject = function(...obj1) { // export const containObject = function(...obj1) {
let obj = Object.assign(...obj1) // let obj = Object.assign(...obj1)
return obj // return obj
} // }
// 获取页面自适应高度 // 获取页面自适应高度
export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container', export function resizeHeight(cMinusHeight = 152, iMinuxHeight = 210, refHeightId = 'slidebar-container',
containerHeightId = 'screenSet'){ containerHeightId = 'screenSet'){
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
<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
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册