Commit 95ef5f02 by 前端

Merge branch 'kuangyq_dev_v2.6.0' into 'v2.6.0'

Kuangyq dev v2.6.0

See merge request !241
2 parents d8a80121 9c96f46f
......@@ -602,6 +602,46 @@ html {
z-index: 4000 !important;
}
.dot {
display: inline-flex;
align-items: center;
div {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
margin-right: 8px;
}
.normal {
background-color: #2cca74;
}
.draft {
background-color: #fdb757;
}
.dot1 {
background-color: #fdb757;
}
.dot2 {
background-color: #2cca74;
}
.dot3 {
background-color: #999999;
}
.dot4 {
background-color: #eb4e4e;
}
.dot5 {
background-color: #fdb757;
}
}
.loadingClass {
.el-icon-loading {
font-size: 22px;
......
......@@ -10,7 +10,7 @@
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item v-else label="选择素材组:">
<el-form-item v-else label="选择素材组:" prop="selectMaterialGroupName">
<el-select v-model="materialAddForm.groupName" placeholder="全部" :size="size" disabled>
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select>
......@@ -242,6 +242,7 @@ export default {
{ required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 30, message: '素材名称长度不能超过30', trigger: 'blur' }
],
selectMaterialGroupName: [{ required: false, message: '请选择素材组', trigger: 'change' }],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }],
businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }]
},
......@@ -497,6 +498,7 @@ export default {
handleSubmit() {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
console.log(valid)
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
......@@ -513,7 +515,6 @@ export default {
} else {
material = 'materialInsert'
}
console.log(params, '====')
this.$apis.material[material](params).then(res => {
if (res) {
this.$message({
......
......@@ -18,7 +18,7 @@
<div class="group-name">{{ item.materialGroupName }}</div>
</div>
<div>
<el-popover placement="right" trigger="click">
<el-popover placement="right" trigger="hover">
<div>
<GLButton class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</GLButton>
......
<template>
<div>
<el-dialog :visible.sync="dialogVisibleImg" width="50%" :before-close="videoClose">
<div class="image-dialog">
<video width="100%" controls :src="dialogSrc" id="video1" @click="playVideo"></video>
<img @click="playVideoImg" v-show="paused" src="@/assets/material/video1.png" alt="" />
<img @click="playVideoImg" v-show="!paused" src="@/assets/material/video2.png" alt="" />
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'videoShowDia',
data() {
return {
dialogVisibleImg: false,
dialogSrc: '',
paused: false,
myVideo: ''
}
},
methods: {
init(src) {
this.dialogVisibleImg = true
this.dialogSrc = src
setTimeout(() => {
this.myVideo = document.getElementById('video1')
this.paused = this.myVideo.paused ? true : false
})
},
videoClose() {
this.myVideo.pause()
this.myVideo.muted = false
this.dialogVisibleImg = false
},
playVideo() {
var myVideo = document.getElementById('video1')
this.paused = !myVideo.paused
this.paused ? myVideo.play() : myVideo.pause()
},
playVideoImg() {
this.paused = !this.paused
console.log(this.paused)
this.paused ? this.myVideo.pause() : this.myVideo.play()
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-dialog__header {
background-color: black;
}
/deep/ .el-dialog__body {
padding: 0;
}
/deep/ .el-dialog {
position: relative;
}
.image-dialog {
position: absolute;
img {
width: 170px;
position: absolute;
top: 35%;
left: 40%;
}
}
</style>
......@@ -24,7 +24,7 @@
</el-col>
<el-col :span="19">
<div class="right" :style="{ height: boxHeight + 'px' }">
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<div class="groupTitle">{{ materialGroupName }}(共{{ tableTotal }}条数据)</div>
<GLTable ref="materialRef" :hasPage="false" :noDataImg="url" @refreshTable="getListApi" :layout="layout" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
<!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope" style="text-align: center">
......@@ -53,30 +53,25 @@
</div>
</el-popover>
<!-- 视频 -->
<el-popover placement="right" trigger="click" @hide="videoHide(scope.scope)" @show="videoOpen(scope.scope)" v-if="scope.scope.urlType == 'video'">
<div>
<video controls :id="'video' + scope.scope.id" width="300" height="300">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
</div>
<div slot="reference" class="urlContent">
<video width="36" height="36">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
<div class="videoMask">
<img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />
</div>
<div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">
<video preload loop muted width="36" height="36">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
<div class="videoMask">
<img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />
</div>
</el-popover>
</div>
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14">
<span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</el-tooltip>
</span>
</div>
<!-- 状态 -->
<div slot="status" slot-scope="scope">
<el-switch v-model="scope.scope.status" :active-value="0" :inactive-value="-1" @change="handleForbid(scope.scope)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }}
<div slot="status" class="dot" slot-scope="scope">
<div :class="materialStatus[scope.scope.status]"></div>
<span v-if="scope.scope.status == 0">启用</span>
<span v-if="scope.scope.status == -1">停用</span>
<span v-if="scope.scope.status == 1">草稿</span>
</div>
<!-- 类型 -->
<div slot="materialType" slot-scope="scope">
......@@ -98,28 +93,36 @@
</div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div>
</template>
<script>
// const iconUrl =
// 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAFoTx1HAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADqADAAQAAAABAAAADgAAAAC98Dn6AAAB7klEQVQoFVVSQUhUURQ9981sVFyYRRHuFFq1CGlZC3etnBlMRhMXQwhtCqIQJBA3gSSi1EpkNqkjCjOjm1YWuGojBVO7Fi0K2qQLF6H453bO+/ODLvz37z333PvOu+8BtImCf0K56J8VYKLoC9HRMlnwRxaRgB0kOHDDz5gl/0hZBaaFwGl3H65j577nygV/ITCM71pinRo1GiF4zm8jqzkr5dEtluiTJZ9zx8fYTEBmbP5D/tSY3wnaRUwB0rbdsAH5SYK3sW2l4r1/jnFIsUMElmsNmxdB7JGsUnGUWvQz+XkHXtXqNsxx/KL/Zg+oS5xxi8A2T8SqNe0az3NANyfVJD4N5ripZDTDrc1da8kn/i1QxGya4eq4Kl8aui7hblRLUd/JXCSxxXarBJ9T8fuYFLsztiqTv4NjXUTh2rZteEhiP8OKiiIez3+CFoWubdXtpUDe1XAbmJEfQLxpRxFPRz7T1ccz6BFkl6okRzHFOJ5ccbnkr8l5LF8mrl5Pnv5gJksJjmlD/wclv9121ClxeqthH4TJQh5fLhIMaa7LOrRuIk2la89lfO29ghuU/69IHBatqIZfOhgWv2OXhUIOi/FCnDpoZuYqaCaYpYJ5gvf+m6pInUE9Y5NRhoPCdGl80fscyFK1aqfCZH8B0rPa9foo7e4AAAAASUVORK5CYII='
const materialStatus = {
'0': 'normal',
'1': 'draft',
'-1': 'dot3'
}
import Vue from 'vue'
import url from '@/assets/empty.png'
import iconUrl from '@/assets/icon-circle-question.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue'
export default {
name: 'materialList',
components: {
AddMaterialGroupDia,
MaterialGroup,
FunctionIntroduc
FunctionIntroduc,
VideoShowDia
},
data() {
return {
dialogVisibleImg: false, // 视频弹框
url,
materialStatus: materialStatus,
eventBus: new Vue(),
searchForm: {
groupId: '', // 素材组id
......@@ -209,7 +212,11 @@ export default {
},
{
optionId: -1,
optionLabel: '禁用'
optionLabel: '停用'
},
{
optionId: 1,
optionLabel: '草稿'
}
],
optionId: 'optionId',
......@@ -249,6 +256,19 @@ export default {
},
{
type: 'GLButton',
name: row => {
return row.status == 0 ? '禁用' : '启用'
},
attrs: {
type: 'text',
fn: '禁用'
},
listeners: {
click: this.handleForbid
}
},
{
type: 'GLButton',
name: '删除',
attrs: {
type: 'text',
......@@ -413,22 +433,10 @@ export default {
},
videoOpen(scope) {
var vedioId = 'video' + `${scope.id}`
console.log(vedioId)
var myVideo = document.getElementById(vedioId)
// myVideo.play()
},
//
videoHide(scope) {
console.log(scope)
var vedioId = 'video' + `${scope.id}`
console.log(vedioId)
var myVideo = document.getElementById(vedioId)
console.log(myVideo)
console.log(myVideo.paused)
myVideo.pause()
console.log(myVideo.paused)
this.dialogVisibleImg = true
let dialogSrc = scope.materialContentRpcResponse.materialUrl
this.$refs.VideoShowDia.init(dialogSrc)
},
// 重置
......@@ -492,18 +500,15 @@ export default {
},
// 素材禁用&启用
handleForbid(scope) {
console.log(scope)
var params = {}
params.id = scope.id
params.status = scope.status
this.$apis.material.materialEdit(params).then(res => {
console.log(res)
res.code == 0 ? this.getListApi() : ''
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
})
if (scope.status == 0) {
params.status = -1
this.secondConfirm('提示', '禁用素材,确定禁用此素材?', 'material', 'materialEdit', params)
} else {
params.status = 0
this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params)
}
},
// 素材删除
handleDelete(scope) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!