master
lion 1 year ago
parent 64f6f335eb
commit be3eafe909

@ -36,18 +36,38 @@ export default {
vnodes.push(<i class={[_icon, 'sub-el-icon']} />)
}
if (title) {
vnodes.push(<span slot='title'>{(title)}</span>)
if (title) {
if(title.indexOf('-')>-1) {
vnodes.push(<span class='boxtitle'><span slot='title'>{(title.split('-')[0])}</span><span class='ftitle'>[{(title.split('-')[1])}]</span></span>)
}
else{
vnodes.push(<span slot='title'>{(title)}</span>)
}
}
return vnodes
}
}
</script>
<style scoped>
<style >
.sub-el-icon {
color: currentColor;
width: 1em;
height: 1em;
}.el-submenu__title{
display: flex;
align-items: center;
height: auto!important;
}
.boxtitle{
display: flex;
flex-direction: column;
line-height: 20px;
}
.el-menu-item{display: flex;height: auto;
align-items: center;}
.ftitle{color: #000;font-size: 13px;}
</style>

@ -1,6 +1,6 @@
<template>
<div>
<xy-dialog ref="dialog" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增资讯' : '编辑资讯'" :form="form"
<xy-dialog ref="dialog" :width="50" :is-show.sync="isShow" :type="'form'" :title="type === 'add' ? '新增资讯' : '编辑资讯'" :form="form"
:rules='rules' @submit="submit">
<template v-slot:title>
<div class="xy-table-item">
@ -27,21 +27,36 @@
<template v-slot:image_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>标题图片/视频
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>标题图片
</div>
<div class="xy-table-item-content">
<!-- <el-upload :action="action" :limit='1' class='upload-demo' list-type="picture-card" :file-list="pictureList"
ref="pictureUpload" style="width:600px" :auto-upload="true" :data="uploadOther"
<el-upload :action="action"
accept=".PNG,.jpg,.jpeg,.bmp,.svg"
class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:600px;display: flex;flex-wrap: wrap;margin-left:10px" :auto-upload="true" :data="uploadOther"
:on-success="handlesuccess" :on-remove="handleRemove">
<i class="el-icon-plus"></i>
</el-upload> -->
<el-upload :action="action" class='upload-demo' :file-list="pictureList" ref="pictureUpload"
style="width:600px;display: flex;flex-wrap: wrap;margin-left:10px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccess"
:on-remove="handleRemove">
<el-button style="width: 100%;text-align: left;" v-if="pictureList.length<1" size="small" type="primary"></el-button>
<el-button style="width: 100%;text-align: left;" v-if="pictureList.length<1" size="small"
type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:video_id>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>视频
</div>
<div class="xy-table-item-content">
<el-upload :action="action"
accept=".mp4,.avi,.wmv"
class='upload-demo' :file-list="videoList" ref="pictureUpload"
style="width:600px;display: flex;flex-wrap: wrap;margin-left:10px" :auto-upload="true" :data="uploadOther"
:on-success="handlesuccessVideo" :on-remove="handleRemoveVideo">
<el-button style="width: 100%;text-align: left;" v-if="videoList.length<1" size="small"
type="primary">点击上传</el-button>
</el-upload>
</div>
</div>
</template>
<template v-slot:file_ids>
<div class="xy-table-item">
@ -50,7 +65,7 @@
</div>
<div class="xy-table-item-content">
<el-upload :action="action" class='upload-demo' :file-list="fileList" ref="pictureUpload"
style="width:400px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccessFile"
style="width:600px; flex;flex-wrap: wrap;margin-left:10px" :auto-upload="true" :data="uploadOther" :on-success="handlesuccessFile"
:on-remove="handleRemoveFile">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
@ -65,7 +80,7 @@
</div>
<div class="xy-table-item-content">
<div style="width: 99.9%;">
<tinymce v-model="form.content" ref="tiny" :height="300" />
<tinymce style="width:100%" v-if="showTinymce" v-model="form.content" ref="tiny" :height="300" />
</div>
</div>
</div>
@ -97,16 +112,19 @@
return {
isShow: false,
type: 'add',
id: '',
id: '',
showTinymce:false,
action: `${process.env.VUE_APP_BASE_API}api/admin/upload-file`,
uploadOther: {
token: ""
},
fileList: [],
pictureList: [],
pictureList: [],
videoList:[],
form: {
title: '',
image_id: '',
image_id: '',
video_id:'',
file_ids: [],
content: '',
},
@ -128,6 +146,12 @@
},
handlesuccess(response, file, fileList) {
this.pictureList = fileList
},
handleRemoveVideo(file, fileList) {
this.videoList = fileList
},
handlesuccessVideo(response, file, fileList) {
this.videoList = fileList
},
handleRemoveFile(file, fileList) {
this.fileList = fileList
@ -142,7 +166,6 @@
if (this.type == 'add') {
this.form.id = ''
}
if (this.pictureList.length > 0) {
if (this.pictureList[0].response) {
this.form.image_id = this.pictureList[0].response.id
@ -156,6 +179,13 @@
})
this.form.image_id = ''
return
}
if (this.videoList.length > 0) {
if (this.videoList[0].response) {
this.form.video_id = this.videoList[0].response.id
} else {
this.form.video_id = this.videoList[0].id
}
}
let _files = []
@ -190,34 +220,41 @@
show({
id: this.id,
table_name: 'articles',
with_relations: ['image']
with_relations: ['image','video']
}).then(res => {
this.form = {
title: res?.title,
image_id: res?.image_id,
image_id: res?.image_id,
video_id:res?.video_id,
file_ids: res?.file_ids,
content: res?.content,
}
if (res.image) {
this.pictureList.push({
id: res.image.id,
name: res.image.original_name,
url: res.image.url
})
}
if(res.image){
this.pictureList.push({
id:res.image.id,
name:res.image.original_name,
url:res.image.url
})
}
let _files = []
if(res.files && res.files.length>0){
res.files.map(item=>{
_files.push({
id:item.id,
name:item.original_name,
url:item.url
})
if (res.video) {
this.videoList.push({
id: res.video.id,
name: res.video.original_name,
url: res.video.url
})
}
this.fileList = _files
}
let _files = []
if (res.files && res.files.length > 0) {
res.files.map(item => {
_files.push({
id: item.id,
name: item.original_name,
url: item.url
})
})
}
this.fileList = _files
this.showTinymce = true
})
}
},
@ -226,11 +263,14 @@
if (newVal) {
if (this.type === 'editor') {
this.getDetail()
}else{
this.showTinymce = true
}
} else {
this.id = ''
this.fileList = []
this.pictureList = []
this.id = ''
this.fileList = []
this.pictureList = []
this.videoList = []
this.$refs['dialog'].reset()
}
},
@ -240,5 +280,11 @@
</script>
<style scoped lang="scss">
::v-deep .title,
::v-deep .image_id,
::v-deep .file_ids,
::v-deep .content,
{
flex-basis: 100%;
}
</style>

@ -3,27 +3,31 @@
<xy-dialog ref="dialog" :width="80" :is-show.sync="isShow" type="form" :title="showform.title" :form="form">
<template v-slot:show>
<div class="article_title">{{showform.title}}</div>
<div style="text-align: center;" v-if="extension=='mp4'||extension=='avi'||extension=='wmv'">
<video controls :src="showform.image.url" style="max-width: 600px; max-height: 400px;"></video>
<div style="text-align: center;">
<video v-if="showform.video" controls :src="showform.video.url" style="max-width: 600px; max-height: 400px;"></video>
</div>
<div class="article_content">
<div v-html="showform.content"></div>
</div>
<div class="article_files">
<div class="article_files_name">附件</div>
<div v-for="item in showform.files">
<div>
<el-link target="_blank" style="margin-right: 10px;" @click="toshowFile(item.url,item.original_name)"
type="primary">
预览
</el-link>
<el-link target="_blank" @click="base.downLoadFileUrl(item.id)" type="primary">
下载
</el-link>
<a :href="item.url" target="_blank">{{item.original_name}}</a>
</div>
<div class="article_files_name">附件</div>
<div v-if="showform.files && showform.files.length>0">
<div v-for="item in showform.files">
<div>
<a :href="item.url" target="_blank">{{item.original_name}}</a>
<el-link target="_blank" style="margin:0 10px;" @click="toshowFile(item.url,item.original_name)"
type="primary">
预览
</el-link>
<el-link target="_blank" @click="base.downLoadFileUrl(item.id)" type="primary">
下载
</el-link>
</div>
</div>
</div>
</div>
@ -94,13 +98,12 @@
show({
table_name: 'articles',
id: this.id,
with_relations:['image']
with_relations:['image','video']
}).then(res => {
this.form = {
show: ''
}
this.showform = res
this.extension = res.image?res.image.extension:''
this.showform = res
}).catch(error => {});
}
}

@ -16,13 +16,10 @@
<el-carousel height="330px">
<el-carousel-item v-for="item in articleSwiper" :key="item.id">
<div @click="showDashboardArticle(item.id)" v-if="item.image.extension=='mp4'||item.image.extension=='avi'||item.image.extension=='wmv'">
<video :src="item.image.url" style="width: 100%; height: 100%"></video>
</div>
<div v-else>
<div>
<el-image
@click="showDashboardArticle(item.id)"
style="width: 100%; height: 100%"
style="width: 100%; height: 100%;cursor: pointer;"
:src="item.image.url"></el-image>
</div>
<h3 style="position: absolute;bottom: 0;width: 100%;padding: 10px;color: #fff;background: rgba(0, 0, 0, 0.4);" class="small">{{ item.title }}</h3>
@ -37,7 +34,7 @@
<div style="padding-bottom: 15px;background-color: #fff;display: flex;align-items: center;"
class="form-sub-title">
<el-link icon="el-icon-s-opportunity" type="primary" style="font-size:18px;margin-right:5px"
href="#">动态信息</el-link>
href="#">工作动态</el-link>
</div>
<div>
<div>
@ -96,7 +93,7 @@
<template slot-scope="scope">
<div>
<Button style='margin-right:5px;margin-bottom:5px;' type="primary" size="small"
@click="goMyunit">去办理</Button>
@click="goMyunit(scope.row.id)">去办理</Button>
</div>
</template>
</el-table-column>
@ -914,8 +911,8 @@ export default {
},
methods: {
goMyunit(){
this.$router.push('/task/list/unit_5')
goMyunit(id){
this.$router.push('/task/list/unit_5?dashboardId='+id)
},
showActiveInfo(item){
console.log(item)

@ -164,7 +164,8 @@
this.selsectMenu = arr
this.form.menu_id = arr[1]
if (e.mission_distribute && e.mission_distribute.length > 0) {
let _arr = []
let _arr = []
let arr = []
e.mission_distribute.map(item => {
if (item.files.length > 0) {
item.files.map(file => {
@ -173,12 +174,20 @@
name: file.original_name,
url: file.url,
upload_name:item.accept_admin.name
})
})
if(item.accept_admin_id===e.main_admin_id){
arr.push({
id: file.id,
name: file.original_name,
url: file.url,
})
}
})
}
})
this.otherList = _arr
this.otherList = _arr
this.pictureList = arr
}
},
async getMenus() {

@ -8,7 +8,7 @@
<span style="color: red;font-weight: bold;padding-right: 4px;">*</span>提醒内容
</div>
<div class="xy-table-item-content">
<el-input v-model="form.title" type="text"placeholder="请输入提醒内容" clearable
<el-input v-model="form.title" type="textarea" placeholder="请输入提醒内容" clearable
style="width: 400px;"></el-input>
</div>
</div>
@ -84,6 +84,7 @@
if (e) {
let arr = []
let Arr = []
this.form.title = `"${e.name}"任务请及时处理(安全生产管理平台)`
this.form.mission_id = e.id
e.mission_distribute.map(item=>{
// if(item.admin_type>1){

@ -461,12 +461,29 @@
this.getUnitTypeList()
this.getUnDoTotal()
this.getList()
console.log("this.$route.query123",this.$route.query)
console.log("this.$route.query123",this.$route.query)
//
let that = this
if (this.$route.query.token && this.$route.query.tp){
if(this.$route.query.notice_id){
this.sendIsRead(this.$route.query.notice_id)
}
}
setTimeout(()=>{
that.checkUnits(that.$route.query.missionId,'show')
},5000)
}
//
if (this.$route.query.dashboardId){
setTimeout(()=>{
that.checkUnits(that.$route.query.dashboardId,'show')
},5000)
}
},
watch: {},
methods: {

Loading…
Cancel
Save