Commit 1d41a084 authored by 黄奎's avatar 黄奎
parents 6904ec5d 83d0f6e4
<style>
.editOrderDrawerTop {
width: 100%;
height: 50px;
display: flex;
justify-content: space-between;
background-color: #f0f5fb;
padding: 5px 10px;
align-items: center;
}
.disableStatus {
opacity: 0.3 !important;
cursor: auto;
}
.imgstyle {
width: 100%;
height: 126px;
border-radius: 4px;
}
/* .avatar-uploader .el-upload {
border-radius: 6px;
cursor: pointer;
width: 100%;
height: 100%;
color: #8c939d;
position: relative;
overflow: hidden;
} */
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 40px;
border: 1px dashed #d9d9d9;
line-height: 118px;
}
.up-box {
width: 90px;
height: 90px;
border: 1px dashed #ccc;
text-align: center;
line-height: 80px;
font-size: 50px;
cursor: pointer;
}
.addscfile .icon-excel,
.addscfile .icon-pdf,
.addscfile .icon-txt,
.addscfile .icon-wenjian,
.addscfile .icon-yasuobao,
.addscfile .icon-shipin,
.addscfile .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style>
<template>
<div>
<q-dialog v-model="IsShow" persistent>
<q-card style="width: 800px; max-width: 80vw;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">文件素材</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none">
<el-form ref="addMsg" :model="addMsg" label-width="120px">
<el-form-item label="添加方式:">
<q-radio v-model="Addtype" val="1" label="新建" />
<q-radio v-model="Addtype" val="2" label="导入" />
</el-form-item>
<div v-if="Addtype ==1 " class="addscfile">
<el-form-item label="素材分组:">
<q-select filled stack-label option-value="Id" option-label="Name" style="width: 80%;"
v-model="addMsg.MediaGroupId" ref="Id" :options="classifyList" label="分组" :dense="false" emit-value map-options />
</el-form-item>
<el-form-item label="文件上传:">
<div class="iconfontfile " v-if="addMsg.FileModel && addMsg.FileModel.FilePath!=''"
@click="showUpLoadFile(addMsg.FileModel)">
<i v-if="addMsg.FileModel.FilePath.substring(addMsg.FileModel.FilePath.lastIndexOf('.')+1,addMsg.FileModel.FilePath.length).toUpperCase()=='PDF'" class="iconfont icon-pdf"></i>
<i v-else-if="addMsg.FileModel.FilePath.substring(addMsg.FileModel.FilePath.lastIndexOf('.')+1,addMsg.FileModel.FilePath.length).toUpperCase()=='TXT'" class="iconfont icon-txt"></i>
<i v-else-if="addMsg.FileModel.FilePath.substring(addMsg.FileModel.FilePath.lastIndexOf('.')+1,addMsg.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
addMsg.FileModel.FilePath.substring(addMsg.FileModel.FilePath.lastIndexOf('.')+1,addMsg.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
<div>{{addMsg.FileModel.FileName}}</div>
<div style="margin-top: 15px;">
<el-upload class="avatar-uploader " action="" :before-upload="uploadFile"
:show-file-list="false">
<q-btn color="accent" size="sm" class="q-mr-md" icon="cloud_upload" label="上传">
</q-btn>
</el-upload>
<div style="margin-top: 20px;">
(上传文件大小不超过20MB,支持DOC、DOCX、XLS、XLSX、CSV、PPT、PPTX、TXT、PDF及Xmind格式。)
</div>
</div>
</el-form-item>
</div>
<div v-if="Addtype ==2 ">
<el-form-item label="文件素材:" required>
<q-btn color="accent" class="q-mr-md" label="选择文件" @click="selectimg(7)" />
</el-form-item>
</div>
</el-form>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="closeEditOrder" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="saveOrderInfo()" />
</q-card-actions>
</q-card>
</q-dialog>
<selectMaterial v-if="isshowselectMaterial" :materialType="materialType" :saveobj='Selectobj' :classifyList='classifyList'
@close="getclose()" @success='getsuccess'>
</selectMaterial>
</div>
</template>
<script>
import {
wechatUploadSelfFile
} from "../../api/common/common"; //上传图片
import {
UploadSelfFile
} from "../../api/common/common"; //上传图片
import {
setWeChatMediumInfo,//新增素材
} from '../../api/system/wechat';
import selectMaterial from "./selectMaterial"
export default {
props: {
saveobj: {
type: Object,
default: null,
},
classifyList: {
type: Array,
default: [],
},
},
components: {
selectMaterial,
},
data() {
return {
IsShow: true,
Addtype: "1",//添加方式 1为新建
addMsg: {
Id: 0,
Type: 7,
Is_Sync: 1,
MediaGroupId: '',
FileModel : {
FileName: '',
FilePath: '',
}
},
materialType: 2,
Selectobj: {},
isshowselectMaterial: false,
}
},
created() {
},
mounted() {
},
watch: {
},
methods: {
//关闭弹窗
closeEditOrder() {
this.$emit('close')
},
selectimg(type) {//素材选择 图片模式
this.materialType = type;
this.isshowselectMaterial = true;
},
getclose() {//素材关闭
this.isshowselectMaterial = false
},
getsuccess(data) {//选择数据回来
if(this.materialType==2){
this.addMsg.AppletModel.ImageName = data.ImageModel.ImageName
this.addMsg.AppletModel.ImagePath = data.ImageModel.ImagePath
}else{
this.$emit('success', data)
}
this.addMsg.CoverImage = data.img
this.isshowselectMaterial = false
},
setWeChat(){
setWeChatMediumInfo(this.addMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.Selectobj = JSON.parse(JSON.stringify(this.addMsg))
this.Selectobj.Id = res.Data
this.$emit('success', this.Selectobj)
})
},
uploadFile(files) {//文件上传
const isLt20M = files.size / 1024 / 1024 < 20;
let ft = files.name.substring(files.name.lastIndexOf('.') + 1, files.name.length).toUpperCase();
let stringArr = 'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF'
if (stringArr.indexOf(ft) == '-1') {
this.$q.notify({
type: 'negative',
message: `请上传正确的文件格式!`,
position: 'top'
})
return false;
}
if (!isLt20M) {
this.$q.notify({
type: 'negative',
message: `文件大小不能超过20MB哦!`,
position: 'top'
})
return false;
}
wechatUploadSelfFile('wechatcatalogue', files, res => {
if (res.Code == 1) {
this.addMsg.FileModel.FileName = res.FileName;
this.addMsg.FileModel.FilePath = res.FileUrl;
this.$forceUpdate();
}
})
},
saveOrderInfo() {//文件
if (this.addMsg.MediaGroupId == '') {
this.$q.notify({
type: 'negative',
message: `请选择分组选择`,
position: 'top'
})
return
}
if (this.addMsg.FileModel.FilePath == '') {
this.$q.notify({
type: 'negative',
message: `请上传文件`,
position: 'top'
})
return
}
this.setWeChat()
},
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
}
}
</script>
\ No newline at end of file
......@@ -4,6 +4,11 @@
height: 126px;
border-radius: 4px;
}
.selectMaterial .imgstyle2 {
width: 100%;
height: 180px;
border-radius: 4px;
}
.selectMaterial .avatar-uploader .el-upload {
border-radius: 6px;
......@@ -30,6 +35,17 @@
text-overflow: ellipsis;
width: 100%;
}
.selceimg .icon-excel,
.selceimg .icon-pdf,
.selceimg .icon-txt,
.selceimg .icon-wenjian,
.selceimg .icon-yasuobao,
.selceimg .icon-shipin,
.selceimg .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style>
<!--订单操作-->
......@@ -63,23 +79,26 @@
</div>
</div>
<div class="q-pa-md">
<div class="q-col-gutter-md row items-start" v-if="data.length>0">
<div class="q-col-gutter-md row items-start" v-if="data.length>0 && msg.Type!=5 && msg.Type!=7">
<div class="col-2 selceimg" v-for="(x,y) in data" @click="Selectobj = x">
<q-img v-if="x.Type==2" :src="x.ImageModel.ImagePath" class="imgstyle"
<q-img v-if="x.Type==2" :src="x.ImageModel.ImagePath" class="imgstyle"
:style="{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div class="absolute-bottom text-subtitle1 text-center onetext"
style="padding: 0;padding: 0 5px;font-size: 12px;">
{{x.ImageModel.ImageName}}
</div>
</q-img>
<q-img v-if="x.Type==3 && x.ImgTextModel" :src="x.ImgTextModel.ImgPath" class="imgstyle"
<q-img v-if="x.Type==3 && x.ImgTextModel" :src="x.ImgTextModel.ImgPath" class="imgstyle"
:style="{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div class="absolute-bottom text-subtitle1 text-center onetext"
style="padding: 0;padding: 0 5px;font-size: 12px;">
{{x.ImgTextModel.Title}}
</div>
</q-img>
<q-img v-if="x.Type==6 && x.AppletModel" :src="x.AppletModel.ImagePath" class="imgstyle"
<q-img v-if="x.Type==6 && x.AppletModel" :src="x.AppletModel.ImagePath" class="imgstyle"
:style="{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<div class="absolute-bottom text-subtitle1 text-center onetext"
style="padding: 0;padding: 0 5px;font-size: 12px;">
......@@ -87,9 +106,43 @@
</div>
</q-img>
</div>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
</div>
<div class="q-col-gutter-md row items-start" v-if="data.length>0 && (msg.Type==5 || msg.Type==7)">
<div class="col-3 selceimg" v-for="(x,y) in data" @click="Selectobj = x">
<q-card class="imgstyle2" v-if="x.Type==5 && x.VideoModel"
:style="{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<q-card-section>
<video width="155" height="120" controls="controls" v-if="x.VideoModel && x.VideoModel.VideoPath">
<source :src="x.VideoModel.VideoPath" type="video/ogg" />
<source :src="x.VideoModel.VideoPath" type="video/mp4" />
<source :src="x.VideoModel.VideoPath" type="video/webm" />
</video>
<div class="onetext" style="margin-top: 5px;">{{x.VideoModel && x.VideoModel.VideoName
?x.VideoModel.VideoName:''}}</div>
</q-card-section>
</q-card>
<q-card class="imgstyle2" v-if="x.Type==7 && x.FileModel"
:style="{border:x.Id == Selectobj.Id?'3px solid #91d5ff':'3px solid #FFF'}">
<q-card-section>
<div class="iconfontfile " v-if="x.FileModel && x.FileModel.FilePath!=''"
@click.stop="showUpLoadFile(x.FileModel)">
<i v-if="x.FileModel.FilePath.substring(x.FileModel.FilePath.lastIndexOf('.')+1,x.FileModel.FilePath.length).toUpperCase()=='PDF'"
class="iconfont icon-pdf"></i>
<i v-else-if="x.FileModel.FilePath.substring(x.FileModel.FilePath.lastIndexOf('.')+1,x.FileModel.FilePath.length).toUpperCase()=='TXT'"
class="iconfont icon-txt"></i>
<i v-else-if="x.FileModel.FilePath.substring(x.FileModel.FilePath.lastIndexOf('.')+1,x.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
x.FileModel.FilePath.substring(x.FileModel.FilePath.lastIndexOf('.')+1,x.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
<div class="onetext" style="margin-top: 5px;">{{x.FileModel && x.FileModel.FileName ? x.FileModel.FileName:''}}</div>
</q-card-section>
</q-card>
</div>
</div>
<q-pagination class="full-width justify-end" v-model="msg.pageIndex" color="primary" :max="pageCount"
:input="true" @input="changePage" />
<div v-if="data.length==0"
style="width: 100%;height: 50px;display: flex;align-items: center;justify-content: center;">暂无数据</div>
</div>
......@@ -126,7 +179,8 @@
<el-upload class="avatar-uploader addDutyMain" action="" :before-upload="uploadFile"
:show-file-list="false">
<i class="el-icon-plus avatar-uploader-icon" v-if="localMsg.ImageModel.ImagePath==''"></i>
<q-img v-else :src="localMsg.ImageModel.ImagePath" style="width: 100%;height: 100%;border-radius: 6px;display: flex;">
<q-img v-else :src="localMsg.ImageModel.ImagePath"
style="width: 100%;height: 100%;border-radius: 6px;display: flex;">
</q-img>
</el-upload>
<div>(图片大小不超过2M,支持JPG、JPEG及PNG格式)</div>
......@@ -287,73 +341,93 @@
savelocal() {//本地上传操作
//这里做上传操作 刷新列表
setWeChatMediumInfo(this.localMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.Selectobj = JSON.parse(JSON.stringify(this.localMsg))
this.Selectobj.Id = res.Data
this.$emit('success', this.Selectobj)
this.gettype()
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.Selectobj = JSON.parse(JSON.stringify(this.localMsg))
this.Selectobj.Id = res.Data
this.$emit('success', this.Selectobj)
this.gettype()
})
},
uploadFile(files) {//图片上传
if (this.materialType == 2 || this.materialType == 3 || this.materialType == 6) {//图文和图片、小程序的时候处理
let types = ['image/jpeg', 'image/jpg', 'image/png'];
const isImage = types.includes(files.type);
if (this.materialType == 2 || this.materialType == 3) {
const isLtSize = files.size / 1024 / 1024 < 2;
if (!isLtSize) {
this.$q.notify({
type: 'negative',
message: `上传图片大小不能超过 2MB!`,
position: 'top'
})
return false;
}
} else {
const isLtSize = files.size / 1024 / 1024 < 1;
if (!isLtSize) {
this.$q.notify({
type: 'negative',
message: `上传图片大小不能超过 1MB!`,
position: 'top'
})
return false;
}
}
if (!isImage) {
this.$q.notify({
type: 'negative',
message: `上传图片只能是 JPG、JPEG、PNG 格式!`,
position: 'top'
})
} else {
wechatUploadSelfFile('wechatcatalogue', files, res => {
if (res.Code == 1) {
if (this.materialType == 2) {
this.localMsg.ImageModel.ImageName = res.FileName;
this.localMsg.ImageModel.ImagePath = res.FileUrl;
} else if (this.materialType == 3) {
this.localMsg.ImgTextModel.ImgName = res.FileName;
this.localMsg.ImgTextModel.ImgPath = res.FileUrl;
} else {
this.localMsg.AppletModel.ImageName = res.FileName;
this.localMsg.AppletModel.ImagePath = res.FileUrl;
}
this.$forceUpdate();
}
})
}
if (this.materialType == 2 || this.materialType == 3 || this.materialType == 6) {//图文和图片、小程序的时候处理
let types = ['image/jpeg', 'image/jpg', 'image/png'];
const isImage = types.includes(files.type);
if (this.materialType == 2 || this.materialType == 3) {
const isLtSize = files.size / 1024 / 1024 < 2;
if (!isLtSize) {
this.$q.notify({
type: 'negative',
message: `上传图片大小不能超过 2MB!`,
position: 'top'
})
return false;
}
} else {
const isLtSize = files.size / 1024 / 1024 < 1;
if (!isLtSize) {
this.$q.notify({
type: 'negative',
message: `上传图片大小不能超过 1MB!`,
position: 'top'
})
return false;
}
}
if (!isImage) {
this.$q.notify({
type: 'negative',
message: `上传图片只能是 JPG、JPEG、PNG 格式!`,
position: 'top'
})
} else {
wechatUploadSelfFile('wechatcatalogue', files, res => {
if (res.Code == 1) {
if (this.materialType == 2) {
this.localMsg.ImageModel.ImageName = res.FileName;
this.localMsg.ImageModel.ImagePath = res.FileUrl;
} else if (this.materialType == 3) {
this.localMsg.ImgTextModel.ImgName = res.FileName;
this.localMsg.ImgTextModel.ImgPath = res.FileUrl;
} else {
this.localMsg.AppletModel.ImageName = res.FileName;
this.localMsg.AppletModel.ImagePath = res.FileUrl;
}
},
this.$forceUpdate();
}
})
}
}
},
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
}
......
<style>
.editOrderDrawerTop {
width: 100%;
height: 50px;
display: flex;
justify-content: space-between;
background-color: #f0f5fb;
padding: 5px 10px;
align-items: center;
}
.disableStatus {
opacity: 0.3 !important;
cursor: auto;
}
.imgstyle {
width: 100%;
height: 126px;
border-radius: 4px;
}
/* .avatar-uploader .el-upload {
border-radius: 6px;
cursor: pointer;
width: 100%;
height: 100%;
color: #8c939d;
position: relative;
overflow: hidden;
} */
.addDutyMain {
display: inline-block;
width: 118px;
height: 118px;
font-size: 40px;
border: 1px dashed #d9d9d9;
line-height: 118px;
}
.up-box {
width: 90px;
height: 90px;
border: 1px dashed #ccc;
text-align: center;
line-height: 80px;
font-size: 50px;
cursor: pointer;
}
</style>
<template>
<div>
<q-dialog v-model="IsShow" persistent>
<q-card style="width: 800px; max-width: 80vw;">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">视频</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none">
<el-form ref="addMsg" :model="addMsg" label-width="120px">
<el-form-item label="添加方式:">
<q-radio v-model="Addtype" val="1" label="新建" />
<q-radio v-model="Addtype" val="2" label="导入" />
</el-form-item>
<div v-if="Addtype ==1 ">
<el-form-item label="素材分组:">
<q-select filled stack-label option-value="Id" option-label="Name" style="width: 80%;"
v-model="addMsg.MediaGroupId" ref="Id" :options="classifyList" label="分组" :dense="false" emit-value map-options />
</el-form-item>
<el-form-item label="视频上传:">
<video width="320" height="240" controls="controls" v-if="addMsg.VideoModel.VideoPath!=''">
<source :src="addMsg.VideoModel.VideoPath" type="video/mp4" />
</video>
<div style="margin-top: 15px;">
<el-upload class="avatar-uploader " action="" :before-upload="uploadFile"
:show-file-list="false">
<q-btn color="accent" size="sm" class="q-mr-md" icon="cloud_upload" label="上传">
</q-btn>
</el-upload>
<div style="margin-top: 20px;">
(视频上传大小不超过10M,支持MP4格式)
</div>
</div>
</el-form-item>
</div>
<div v-if="Addtype ==2 ">
<el-form-item label="视频:" required>
<q-btn color="accent" class="q-mr-md" label="选择视频" @click="selectimg(5)" />
</el-form-item>
</div>
</el-form>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="closeEditOrder" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="saveOrderInfo()" />
</q-card-actions>
</q-card>
</q-dialog>
<!-- 图片 -->
<selectMaterial v-if="isshowselectMaterial" :materialType="materialType" :saveobj='Selectobj' :classifyList='classifyList'
@close="getclose()" @success='getsuccess'>
</selectMaterial>
</div>
</template>
<script>
import {
wechatUploadSelfFile
} from "../../api/common/common"; //上传图片
import {
UploadSelfFile
} from "../../api/common/common"; //上传图片
import {
setWeChatMediumInfo,//新增素材
} from '../../api/system/wechat';
import selectMaterial from "./selectMaterial"
export default {
props: {
saveobj: {
type: Object,
default: null,
},
classifyList: {
type: Array,
default: [],
},
},
components: {
selectMaterial,
},
data() {
return {
IsShow: true,
Addtype: "1",//添加方式 1为新建
addMsg: {
Id: 0,
Type: 5,
Is_Sync: 1,
MediaGroupId: '',
VideoModel:{
VideoName: '',
VideoPath: '',
}
},
materialType: 2,
Selectobj: {},
isshowselectMaterial: false,
}
},
created() {
},
mounted() {
},
watch: {
},
methods: {
//关闭弹窗
closeEditOrder() {
this.$emit('close')
},
selectimg(type) {//素材选择 图片模式
this.materialType = type;
this.isshowselectMaterial = true;
},
getclose() {//素材关闭
this.isshowselectMaterial = false
},
getsuccess(data) {//选择数据回来
if(this.materialType==2){
this.addMsg.AppletModel.ImageName = data.ImageModel.ImageName
this.addMsg.AppletModel.ImagePath = data.ImageModel.ImagePath
}else{
this.$emit('success', data)
}
this.addMsg.CoverImage = data.img
this.isshowselectMaterial = false
},
setWeChat(){
setWeChatMediumInfo(this.addMsg).then(res => {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功',
position: 'top'
})
this.Selectobj = JSON.parse(JSON.stringify(this.addMsg))
this.Selectobj.Id = res.Data
this.$emit('success', this.Selectobj)
})
},
uploadFile(files) {//图片上传
// 文件类型进行判断
const isLt10M = files.size / 1024 / 1024 < 10;
if (['video/mp4'].indexOf(files.type) == -1) {
this.$q.notify({
type: 'negative',
message: `请上传正确的视频格式!`,
position: 'top'
})
return false;
}
if (!isLt10M) {
this.$q.notify({
type: 'negative',
message: `上传视频大小不能超过10MB哦!`,
position: 'top'
})
return false;
}
wechatUploadSelfFile('wechatcatalogue', files, res => {
if (res.Code == 1) {
this.addMsg.VideoModel.VideoName = res.FileName;
this.addMsg.VideoModel.VideoPath = res.FileUrl;
this.$forceUpdate();
}
})
},
saveOrderInfo() {
if (this.addMsg.MediaGroupId == '') {
this.$q.notify({
type: 'negative',
message: `请选择分组选择`,
position: 'top'
})
return
}
if(this.addMsg.VideoModel.VideoPath==''){
this.$q.notify({
type: 'negative',
message: `请上传视频`,
position: 'top'
})
return
}
this.setWeChat()
},
}
}
</script>
\ No newline at end of file
......@@ -40,6 +40,17 @@
background: #FFF !important;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.addwelcome .icon-excel,
.addwelcome .icon-pdf,
.addwelcome .icon-txt,
.addwelcome .icon-wenjian,
.addwelcome .icon-yasuobao,
.addwelcome .icon-shipin,
.addwelcome .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style>
<template>
......@@ -76,6 +87,15 @@
</div>
</div>
<div v-if="item.Type==5" style="width: 1px; flex:1">
<video width="300" height="200" controls="controls" v-if="item.VideoModel && item.VideoModel.VideoPath">
<source :src="item.VideoModel.VideoPath" type="video/ogg" />
<source :src="item.VideoModel.VideoPath" type="video/mp4" />
<source :src="item.VideoModel.VideoPath" type="video/webm" />
</video>
</div>
<div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div>{{item.AppletModel.Title}}</div>
......@@ -84,6 +104,23 @@
</q-img>
</div>
<div v-if="item.Type==7" style="width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div style="display: flex;align-items: flex-start;justify-content: space-between;" @click="showUpLoadFile(item.FileModel)">
<div style="width: 1px;flex:1">
{{item.FileModel.FileName}}
</div>
<div style="width: 50px;text-align: right;margin-left: 10px;">
<i v-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='PDF'" class="iconfont icon-pdf"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='TXT'" class="iconfont icon-txt"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</div>
</div>
</div>
......@@ -107,13 +144,15 @@
</div>
</div>
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md'>
<q-btn color="white" v-if='addMsg.MediumModel && addMsg.MediumModel.length<9' text-color="black" label="+添加图片/图文/小程序/视频/文件" size='md'>
<q-popup-proxy ref='popupproxy'>
<q-banner>
<q-btn-group push>
<q-btn label="图片" icon="images" @click="selectimg()" />
<q-btn label="图文" icon="visibility" @click="selecttextimg()" />
<q-btn label="小程序" icon="update" @click="selectxcx()" />
<q-btn label="视频" icon="update" @click="selectvideo()" />
<q-btn label="文件" icon="update" @click="selectfiled()" />
</q-btn-group>
</q-banner>
</q-popup-proxy>
......@@ -135,6 +174,10 @@
<!-- 小程序 -->
<appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'>
</appletform>
<!-- 视频 -->
<videofrom v-if="issvideofrom" @close="getxcxclose()" @success='getvideosuccess' :classifyList='classifyList'> </videofrom>
<!-- 文件 -->
<filefrom v-if="isfilefrom" @close="getxcxclose()" @success='getfilesuccess' :classifyList='classifyList'> </filefrom>
</div>
</template>
......@@ -147,6 +190,8 @@
import selectMaterial from "./selectMaterial"
import imagetextform from "./imagetext-form"
import appletform from "./applet-form"
import videofrom from "./video-from"
import filefrom from "./file-from"
import {
queryEmployee
......@@ -157,6 +202,8 @@
selectMaterial,
imagetextform,//图文
appletform,//小程序
videofrom,
filefrom,
},
props: {
welcomeindex: {
......@@ -203,6 +250,8 @@
isshowimagetext: false,
isshowapplet: false,
classifyList: [],
issvideofrom:false,
isfilefrom:false
}
},
created() {
......@@ -342,14 +391,35 @@
this.$refs.popupproxy.hide()
}
},
selectvideo(){//视频打开
this.issvideofrom = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
selectfiled(){//文件
this.isfilefrom = true
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getxcxclose() {//小程序 关闭
this.isshowapplet = false;
this.issvideofrom = false;
this.isfilefrom = false
},
getxcxsuccess(data) {//小程序 关闭
this.ISidentical(data)
this.isshowapplet = false
},
getvideosuccess(data){
this.ISidentical(data)
this.issvideofrom = false;
},
getfilesuccess(data){
this.ISidentical(data)
this.isfilefrom = false;
},
getType(row, name) {
let title = ''
......@@ -363,6 +433,13 @@
} else if (row.Type == 6) {
title = row.AppletModel.Title
content = row.AppletModel.ImagePath
} else if (row.Type == 5) {
title = row.VideoModel.VideoName
content = row.VideoModel.VideoPath
}
else if (row.Type == 7) {
title = row.FileModel.FileName
content = row.FileModel.FilePath
}
if (name == 'title') {
return title
......@@ -376,7 +453,28 @@
gettrigger(){//文本触发时
this.$emit('success', this.addMsg, this.welcomeindex,this.childrenindex,this.welcomename)
}
},
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
......
......@@ -40,6 +40,17 @@
background: #FFF !important;
box-shadow: 0px 5px 25px 0px rgba(218, 220, 230, 0.85);
}
.addwelcome .icon-excel,
.addwelcome .icon-pdf,
.addwelcome .icon-txt,
.addwelcome .icon-wenjian,
.addwelcome .icon-yasuobao,
.addwelcome .icon-shipin,
.addwelcome .icon-word {
font-size: 38px;
color: green;
line-height: 75px;
}
</style>
<template>
......@@ -76,6 +87,15 @@
</div>
</div>
<div v-if="item.Type==5" style="width: 1px; flex:1">
<video width="300" height="200" controls="controls" v-if="item.VideoModel && item.VideoModel.VideoPath">
<source :src="item.VideoModel.VideoPath" type="video/ogg" />
<source :src="item.VideoModel.VideoPath" type="video/mp4" />
<source :src="item.VideoModel.VideoPath" type="video/webm" />
</video>
</div>
<div v-if="item.Type==6" style="width: 70%;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div>{{item.AppletModel.Title}}</div>
......@@ -84,6 +104,23 @@
</q-img>
</div>
<div v-if="item.Type==7" style="width: 1px; flex:1;padding: 10px 15px; border: 1px solid #eee; border-radius: 4px; background: #fff;">
<div style="display: flex;align-items: flex-start;justify-content: space-between;" @click="showUpLoadFile(item.FileModel)">
<div style="width: 1px;flex:1">
{{item.FileModel.FileName}}
</div>
<div style="width: 50px;text-align: right;margin-left: 10px;">
<i v-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='PDF'" class="iconfont icon-pdf"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='TXT'" class="iconfont icon-txt"></i>
<i v-else-if="item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOCX' ||
item.FileModel.FilePath.substring(item.FileModel.FilePath.lastIndexOf('.')+1,item.FileModel.FilePath.length).toUpperCase()=='DOC'
" class="iconfont icon-word"></i>
<i v-else class="iconfont icon-excel"></i>
</div>
</div>
</div>
</div>
......@@ -124,13 +161,15 @@
</div>
</div>
<q-btn color="white" text-color="black" label="+添加图片/图文/小程序" size='md'>
<q-btn color="white" v-if='MediumModel.length<9' text-color="black" label="+添加图片/图文/小程序/视频/文件" size='md'>
<q-popup-proxy ref='popupproxy'>
<q-banner>
<q-btn-group push>
<q-btn label="图片" icon="images" @click="selectimg()" />
<q-btn label="图文" icon="visibility" @click="selecttextimg()" />
<q-btn label="小程序" icon="update" @click="selectxcx()" />
<q-btn label="视频" icon="update" @click="selectvideo()" />
<q-btn label="文件" icon="update" @click="selectfiled()" />
</q-btn-group>
</q-banner>
</q-popup-proxy>
......@@ -178,8 +217,12 @@
<!-- 图文 -->
<imagetextform v-if="isshowimagetext" @close="gettwclose()" @success='gettwsuccess' :classifyList='classifyList'></imagetextform>
<!-- 小程序 -->
<appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'>
</appletform>
<appletform v-if="isshowapplet" @close="getxcxclose()" @success='getxcxsuccess' :classifyList='classifyList'> </appletform>
<!-- 视频 -->
<videofrom v-if="issvideofrom" @close="getxcxclose()" @success='getvideosuccess' :classifyList='classifyList'> </videofrom>
<!-- 文件 -->
<filefrom v-if="isfilefrom" @close="getxcxclose()" @success='getfilesuccess' :classifyList='classifyList'> </filefrom>
</div>
</template>
......@@ -192,7 +235,9 @@
import selectMaterial from "../../components/enterprise/selectMaterial"
import imagetextform from "../../components/enterprise/imagetext-form"
import appletform from "../../components/enterprise/applet-form"
import videofrom from "../../components/enterprise/video-from"
import filefrom from "../../components/enterprise/file-from"
import {
queryEmployee
} from '../../api/users/user'
......@@ -204,6 +249,8 @@
selectMaterial,
imagetextform,//图文
appletform,//小程序
videofrom,//视频
filefrom,//文件
},
name: "welcomeList",
data() {
......@@ -233,6 +280,10 @@
isshowapplet: false,
MediumModel: [],//已选的添加内容
classifyList: [],
issvideofrom:false,
isfilefrom:false
}
},
created() {
......@@ -416,13 +467,35 @@
this.$refs.popupproxy.hide()
}
},
selectvideo(){//视频打开
this.issvideofrom = true;
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
selectfiled(){//文件
this.isfilefrom = true
if (this.$refs.popupproxy) {
this.$refs.popupproxy.hide()
}
},
getxcxclose() {//小程序 关闭
this.isshowapplet = false;
this.issvideofrom = false;
this.isfilefrom = false
},
getxcxsuccess(data) {//小程序 关闭
this.ISidentical(data)
this.isshowapplet = false
},
getvideosuccess(data){
this.ISidentical(data)
this.issvideofrom = false;
},
getfilesuccess(data){
this.ISidentical(data)
this.isfilefrom = false;
},
savemove() {//保存
if (this.membertype == 1) {
this.addMsg.UserIdList = ["-1"];
......@@ -494,6 +567,13 @@
} else if (row.Type == 6) {
title = row.AppletModel.Title
content = row.AppletModel.ImagePath
} else if (row.Type == 5) {
title = row.VideoModel.VideoName
content = row.VideoModel.VideoPath
}
else if (row.Type == 7) {
title = row.FileModel.FileName
content = row.FileModel.FilePath
}
if (name == 'title') {
return title
......@@ -503,7 +583,27 @@
},
deleteModel(index){
this.MediumModel.splice(index,1)
}
},
showUpLoadFile(i) {
// 文件类型进行判断
if (
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "PDF" ||
i.FileName.substring(
i.FileName.lastIndexOf(".") + 1,
i.FileName.length
).toUpperCase() == "TXT"
) {
this.previewPDF(i.Url);
} else {
window.open(
"https://view.officeapps.live.com/op/view.aspx?src=" + i.FilePath
);
}
},
......
<style>
.examConfig .Period-rules {
display: flex;
margin-bottom: 24px;
padding-left: 20px;
}
.examConfig .Period-rules {
display: flex;
margin-bottom: 24px;
padding-left: 20px;
}
.examConfig .Period_Spreate {
flex: 1;
width: 50%;
min-width: 400px;
margin-right: 32px;
}
.examConfig .Period_Spreate {
flex: 1;
width: 50%;
min-width: 400px;
margin-right: 32px;
}
.examConfig .Period-rule-title {
color: #646a73;
margin-bottom: 4px;
white-space: nowrap;
display: flex;
align-items: baseline;
}
.examConfig .Period-rule-title {
color: #646a73;
margin-bottom: 4px;
white-space: nowrap;
}
.examConfig .Period-info-icon {
margin-left: 8px;
color: #8f959e;
line-height: 1;
vertical-align: top;
}
.examConfig .Period-info-icon {
margin-left: 8px;
color: #8f959e;
line-height: 1;
vertical-align: top;
}
.process_Btn_List {
display: flex;
justify-content: flex-end;
padding: 20px;
}
.process_Btn_List {
display: flex;
justify-content: flex-end;
padding: 20px;
}
.processBtn_Cancel {
width: 90px;
height: 35px;
border: 1px solid #a1aab2;
color: #000000;
background-color: #fff;
text-align: center;
line-height: 35px;
border-radius: 5px;
cursor: pointer;
margin-right: 20px;
}
.processBtn_Cancel {
width: 90px;
height: 35px;
border: 1px solid #a1aab2;
color: #000000;
background-color: #fff;
text-align: center;
line-height: 35px;
border-radius: 5px;
cursor: pointer;
margin-right: 20px;
}
.processBtn_Save {
width: 90px;
height: 35px;
background-color: #2961fe;
color: #fff;
text-align: center;
line-height: 35px;
border-radius: 5px;
cursor: pointer;
}
.processBtn_Save {
width: 90px;
height: 35px;
background-color: #2961fe;
color: #fff;
text-align: center;
line-height: 35px;
border-radius: 5px;
cursor: pointer;
}
.baseSetForm_Dialog {
margin: 20px;
}
.baseSetForm_Dialog {
margin: 20px;
}
.examConfig_title {
font-size: 14px;
color: #1f2329;
margin-bottom: 20px;
}
.examConfig_title {
font-size: 14px;
color: #1f2329;
margin-bottom: 20px;
}
.Period-alert {
padding: 9px 16px;
border-radius: 4px;
background-color: #f0f4ff;
line-height: 22px;
color: #1f2329;
display: flex;
align-items: center;
margin-top: 20px;
margin-bottom: 12px;
font-size: 13px;
}
.Period-alert {
padding: 9px 16px;
border-radius: 4px;
background-color: #f0f4ff;
line-height: 22px;
color: #1f2329;
display: flex;
align-items: center;
margin-top: 20px;
margin-bottom: 12px;
font-size: 13px;
}
.Okr_Length {
font-weight: 500;
color: #1f2329;
}
.Okr_Length {
font-weight: 500;
color: #1f2329;
}
.FormItem-asterisk {
position: relative;
top: 3px;
margin-left: 3px;
color: #f54a45;
line-height: 1;
}
.FormItem-asterisk {
position: relative;
top: 3px;
margin-left: 3px;
color: #f54a45;
line-height: 1;
}
.baseSetForm_Dialog .el-radio {
display: block;
margin-bottom: 15px;
}
.exam-tip {
white-space: nowrap;
font-size: 10px;
color: #A8A8B3;
margin-top:5px;
}
.baseSetForm_Dialog .el-radio {
display: block;
margin-bottom: 15px;
}
.exam-tip {
white-space: nowrap;
font-size: 10px;
color: red;
}
</style>
<template>
<template>
<div class="page-body">
<div class="examConfig">
<div style="text-align: right">
<q-btn
color="accent"
size="sm"
class="q-mr-md"
@click="geteject"
label="修改基础配置"
/>
<q-btn color="accent" size="sm" class="q-mr-md" @click="geteject" label="修改基础配置" />
</div>
<div class="Period-rules">
<div class="Period_Spreate">
<div class="Period-rule-title">
是否开启组卷审批
<span class="exam-tip"
>(开启后教师组卷不能直接生成使用,需要等待主管审核)</span
>
<div>是否开启组卷审批</div>
<div class="exam-tip">开启后教师组卷不能直接生成使用,需要等待主管审核</div>
</div>
<div>
<span v-if="baseObj.IsOpenZuJuan === 1"></span>
......@@ -130,10 +123,8 @@
</div>
<div class="Period_Spreate col-6">
<div class="Period-rule-title">
是否开启自动阅卷
<span class="exam-tip"
>(考试不能直接发起,需要等待主管审核通过后自动化发布)</span
>
<div>是否开启自动阅卷</div>
<div class="exam-tip">考试不能直接发起,需要等待主管审核通过后自动化发布</div>
</div>
<div>
<span v-if="baseObj.IsOpenAutoMarking === 1"></span>
......@@ -144,10 +135,8 @@
<div class="Period-rules">
<div class="Period_Spreate">
<div class="Period-rule-title">
是否开启考试申请
<span class="exam-tip"
>(注意:开启后系统将对所有试卷内的客观题进行自动阅卷)</span
>
<div>是否开启考试申请</div>
<div class="exam-tip">注意:开启后系统将对所有试卷内的客观题进行自动阅卷</div>
</div>
<div>
<span v-if="baseObj.IsOpenExamApply === 1"></span>
......@@ -168,47 +157,18 @@
</div>
</div>
</div>
<q-dialog
v-model="isShowBaseSet"
maximized
full-height
seamless
position="right"
@hide="closeProcess"
>
<q-card
style="margin-top: 61px; width: 500px"
class="no-border-radius classinfo_Dialog"
>
<q-dialog v-model="isShowBaseSet" maximized full-height seamless position="right" @hide="closeProcess">
<q-card style="margin-top: 61px; width: 500px" class="no-border-radius classinfo_Dialog">
<div class="baseSetForm_Dialog">
<div class="examConfig_title">
<div class="cycle_Title">考试配置</div>
<div class="examConfig_title" style="margin-top:10px;">
是否开启组卷审批
<el-switch
style="margin-left: 10px"
v-model="addMsg.IsOpenZuJuan"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
<el-switch style="margin-left: 10px" v-model="addMsg.IsOpenZuJuan" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div v-if="baseObj.IsOpenZuJuan === 1">
<q-select
filled
stack-label
:dense="false"
v-model="addMsg.ZuJuanReviewer"
:options="EmployeeListOption"
option-value="Id"
option-label="EmployeeName"
emit-value
map-options
label="组卷审核人"
use-input
:rules="[(val) => !!val || '请选择组卷审核人']"
@filter="filterFn"
ref="ZuJuanReviewer"
>
<q-select filled stack-label :dense="false" v-model="addMsg.ZuJuanReviewer" :options="EmployeeListOption"
option-value="Id" option-label="EmployeeName" emit-value map-options label="组卷审核人" clearable use-input
:rules="[(val) => !!val || '请选择组卷审核人']" @filter="filterFn" ref="ZuJuanReviewer">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -218,46 +178,14 @@
</template>
</q-select>
</div>
<div class="examConfig_title">
是否开启自动阅卷
<el-switch
style="margin-left: 10px"
v-model="addMsg.IsOpenAutoMarking"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
</div>
<div class="examConfig_title">
是否开启考试申请
<el-switch
style="margin-left: 10px"
v-model="addMsg.IsOpenExamApply"
:active-value="1"
:inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
<el-switch style="margin-left: 10px" v-model="addMsg.IsOpenExamApply" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div v-if="baseObj.IsOpenExamApply === 1">
<q-select
filled
stack-label
:dense="false"
v-model="addMsg.ExamApplyReviewer"
:options="EmployeeListOption"
option-value="Id"
option-label="EmployeeName"
emit-value
map-options
label="考试申请审核人"
use-input
:rules="[(val) => !!val || '请选择考试申请审核人']"
@filter="filterFn"
ref="ExamApplyReviewer"
>
<q-select filled stack-label :dense="false" v-model="addMsg.ExamApplyReviewer" :options="EmployeeListOption"
option-value="Id" option-label="EmployeeName" emit-value map-options label="考试申请审核人" clearable use-input
:rules="[(val) => !!val || '请选择考试申请审核人']" @filter="filterFn" ref="ExamApplyReviewer">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
......@@ -267,145 +195,211 @@
</template>
</q-select>
</div>
<div class="examConfig_title">
是否开启自动阅卷
<el-switch style="margin-left: 10px" v-model="addMsg.IsOpenAutoMarking" :active-value="1"
:inactive-value="0"></el-switch>
</div>
</div>
<div class="process_Btn_List">
<div class="processBtn_Cancel" @click="closeProcess">关闭</div>
<div class="processBtn_Save" @click="setBaseInfo">确定</div>
</div>
</q-card>
<div
class="dialog-out-close"
@click="closeProcess"
style="
<div class="dialog-out-close" @click="closeProcess" style="
height: 40px !important;
border-top-left-radius: 4px !important;
border-bottom-left-radius: 4px !important;
"
>
">
<q-icon name="iconfont icon-jujue1" size="26px" />
</div>
</q-dialog>
</div>
</template>
<script>
import {
setExaminationConfigure,
getExaminationConfigureModel,
} from "../../api/system/exam";
import { queryEmployee } from "../../api/users/user"; //获取业务员
export default {
meta: {
title: "考试设置",
},
data() {
return {
isShowBaseSet: false,
baseObj: {},
addMsg: {},
// ZuJuanReviewerName: "", //组卷审核人姓名
// ExamApplyReviewerName: "", //考试申请审核人姓名
EmployeeListOption: [],
allEmployeeListOption: [],
};
},
mounted() {
this.getEmployee();
},
methods: {
//获取考试配置信息
getData() {
getExaminationConfigureModel({}).then((res) => {
if (res.Code == 1) {
this.baseObj = res.Data;
this.baseObj.ZuJuanReviewerName = this.getName(
res.Data.ZuJuanReviewer
);
this.baseObj.ExamApplyReviewerName = this.getName(
res.Data.ExamApplyReviewer
);
this.addMsg = res.Data;
}
});
<script>
import {
setExaminationConfigure,
getExaminationConfigureModel,
} from "../../api/system/exam";
import {
queryEmployee
} from "../../api/users/user"; //获取业务员
export default {
meta: {
title: "考试设置",
},
//关闭流程设置
closeProcess() {
this.isShowBaseSet = false;
data() {
return {
isShowBaseSet: false,
baseObj: {},
addMsg: {},
// ZuJuanReviewerName: "", //组卷审核人姓名
// ExamApplyReviewerName: "", //考试申请审核人姓名
EmployeeListOption: [],
allEmployeeListOption: [],
};
},
geteject() {
this.isShowBaseSet = true;
mounted() {
this.getEmployee();
},
//设置考试信息
setBaseInfo() {
this.$refs.ZuJuanReviewer.validate();
this.$refs.ExamApplyReviewer.validate();
if (
!this.$refs.ZuJuanReviewer.hasError &&
!this.$refs.ExamApplyReviewer.hasError
) {
this.addMsg.ZuJuanReviewerName = this.getName(
this.addMsg.ZuJuanReviewer
);
this.addMsg.ExamApplyReviewerName = this.getName(
this.addMsg.ExamApplyReviewer
);
setExaminationConfigure(this.addMsg).then((res) => {
methods: {
//获取考试配置信息
getData() {
getExaminationConfigureModel({}).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.getData();
this.isShowBaseSet = false;
this.baseObj = res.Data;
this.baseObj.ZuJuanReviewerName = this.getName(
res.Data.ZuJuanReviewer
);
this.baseObj.ExamApplyReviewerName = this.getName(
res.Data.ExamApplyReviewer
);
this.addMsg = res.Data;
}
});
}
},
//获取业务员
getEmployee(id) {
var qMsg = {
Dept_Id: 0,
};
qMsg.Dept_Id = id;
queryEmployee(qMsg)
.then((res) => {
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
this.getData();
}
})
.catch(() => {});
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeListOption = JSON.parse(
JSON.stringify(this.allEmployeeListOption)
},
//关闭流程设置
closeProcess() {
this.isShowBaseSet = false;
},
geteject() {
this.isShowBaseSet = true;
},
//设置考试信息
setBaseInfo() {
//都选否 直接保存
if(this.addMsg.IsOpenZuJuan==0&&this.addMsg.IsOpenExamApply==0){
setExaminationConfigure(this.addMsg).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.getData();
this.isShowBaseSet = false;
}
});
}
//只选择了开启组卷审批
if(this.addMsg.IsOpenZuJuan==1&&this.addMsg.IsOpenExamApply==0){
this.$refs.ZuJuanReviewer.validate();
this.addMsg.ZuJuanReviewerName = this.getName(
this.addMsg.ZuJuanReviewer
);
} else {
const needle = val.toLowerCase();
this.EmployeeListOption = this.allEmployeeListOption.filter(
(v) => v.EmployeeName.toLowerCase().indexOf(needle) > -1
if(!this.$refs.ZuJuanReviewer.hasError){
setExaminationConfigure(this.addMsg).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.getData();
this.isShowBaseSet = false;
}
});
}
}
//组卷审批关闭 开起考试
if(this.addMsg.IsOpenZuJuan==0&&this.addMsg.IsOpenExamApply==1){
this.$refs.ExamApplyReviewer.validate();
this.addMsg.ExamApplyReviewerName = this.getName(
this.addMsg.ExamApplyReviewer
);
if(!this.$refs.ExamApplyReviewer.hasError){
setExaminationConfigure(this.addMsg).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.getData();
this.isShowBaseSet = false;
}
});
}
}
});
},
//根据Id取名字
getName(id) {
let name = "";
this.allEmployeeListOption.map((item) => {
if (id == item.Id) {
name = item.EmployeeName;
//组卷审批 开启考试同时打开
if(this.addMsg.IsOpenZuJuan==1&&this.addMsg.IsOpenExamApply==1){
this.$refs.ZuJuanReviewer.validate();
this.$refs.ExamApplyReviewer.validate();
if (
!this.$refs.ZuJuanReviewer.hasError &&
!this.$refs.ExamApplyReviewer.hasError
) {
this.addMsg.ZuJuanReviewerName = this.getName(
this.addMsg.ZuJuanReviewer
);
this.addMsg.ExamApplyReviewerName = this.getName(
this.addMsg.ExamApplyReviewer
);
setExaminationConfigure(this.addMsg).then((res) => {
if (res.Code == 1) {
this.$q.notify({
icon: "iconfont icon-chenggong",
color: "accent",
timeout: 2000,
message: "数据保存成功!",
position: "top",
});
this.getData();
this.isShowBaseSet = false;
}
});
}
}
});
return name;
},
//获取业务员
getEmployee(id) {
var qMsg = {
Dept_Id: 0,
};
qMsg.Dept_Id = id;
queryEmployee(qMsg)
.then((res) => {
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
this.getData();
}
})
.catch(() => {});
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === "") {
this.EmployeeListOption = JSON.parse(
JSON.stringify(this.allEmployeeListOption)
);
} else {
const needle = val.toLowerCase();
this.EmployeeListOption = this.allEmployeeListOption.filter(
(v) => v.EmployeeName.toLowerCase().indexOf(needle) > -1
);
}
});
},
//根据Id取名字
getName(id) {
let name = "";
this.allEmployeeListOption.map((item) => {
if (id == item.Id) {
name = item.EmployeeName;
}
});
return name;
},
},
},
};
};
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment