Commit ccbfa264 by 匡雅琴

第二轮bug修复

1 parent 70a645d6
...@@ -588,3 +588,44 @@ html { ...@@ -588,3 +588,44 @@ html {
.myMessage { .myMessage {
z-index: 4000 !important; 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;
}
}
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option> <el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </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-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-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select> </el-select>
...@@ -242,6 +242,7 @@ export default { ...@@ -242,6 +242,7 @@ export default {
{ required: true, message: '请输入素材名称', trigger: 'change' }, { required: true, message: '请输入素材名称', trigger: 'change' },
{ max: 30, message: '素材名称长度不能超过30', trigger: 'blur' } { max: 30, message: '素材名称长度不能超过30', trigger: 'blur' }
], ],
selectMaterialGroupName: [{ required: false, message: '请选择素材组', trigger: 'change' }],
materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }], materialType: [{ required: true, message: '请选择素材类型', trigger: 'change' }],
businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }] businessType: [{ required: true, message: '请选择业务类型', trigger: 'change' }]
}, },
...@@ -497,6 +498,7 @@ export default { ...@@ -497,6 +498,7 @@ export default {
handleSubmit() { handleSubmit() {
this.$refs.materialAddForm.validate(valid => { this.$refs.materialAddForm.validate(valid => {
if (valid) { if (valid) {
console.log(valid)
var params = this.getParams() var params = this.getParams()
if (!params.materialUrl) { if (!params.materialUrl) {
this.$message({ this.$message({
...@@ -513,19 +515,19 @@ export default { ...@@ -513,19 +515,19 @@ export default {
} else { } else {
material = 'materialInsert' material = 'materialInsert'
} }
console.log(params, '====') // this.$apis.material[material](params).then(res => {
this.$apis.material[material](params).then(res => { // if (res) {
if (res) { // this.$message({
this.$message({ // message: '创建成功',
message: '创建成功', // type: 'success'
type: 'success' // })
}) // this.$router.push({
this.$router.push({ // path: '/material/index'
path: '/material/index' // })
}) // }
} // })
})
} else { } else {
console.log(2222)
return false return false
} }
}) })
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="group-name">{{ item.materialGroupName }}</div> <div class="group-name">{{ item.materialGroupName }}</div>
</div> </div>
<div> <div>
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="hover">
<div> <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="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</GLButton>
<GLButton class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</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 {
background: transparent;
position: relative;
}
.image-dialog {
position: absolute;
img {
width: 170px;
position: absolute;
top: 35%;
left: 40%;
}
}
</style>
...@@ -53,30 +53,25 @@ ...@@ -53,30 +53,25 @@
</div> </div>
</el-popover> </el-popover>
<!-- 视频 --> <!-- 视频 -->
<el-popover placement="right" trigger="click" @hide="videoHide(scope.scope)" @show="videoOpen(scope.scope)" v-if="scope.scope.urlType == 'video'"> <div class="urlContent" v-if="scope.scope.urlType == 'video'" @click="videoOpen(scope.scope)">
<div> <video preload loop muted width="36" height="36">
<video controls :id="'video' + scope.scope.id" width="300" height="300"> <source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" /> </video>
</video> <div class="videoMask">
</div> <img src="@/assets/material/videoIcon.png" style="width: 22px;height: 22px;" alt="" />
<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> </div>
</el-popover> </div>
<el-tooltip effect="dark" placement="top" :content="scope.scope.materialContentRpcResponse.materialName" :disabled="scope.scope.materialContentRpcResponse.materialName.length < 14"> <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> <span class="hide-content">{{ scope.scope.materialContentRpcResponse.materialName }}</span>
</el-tooltip> </el-tooltip>
</span> </span>
</div> </div>
<!-- 状态 --> <!-- 状态 -->
<div slot="status" slot-scope="scope"> <div slot="status" class="dot" slot-scope="scope">
<el-switch v-model="scope.scope.status" :active-value="0" :inactive-value="-1" @change="handleForbid(scope.scope)"></el-switch> <div :class="materialStatus[scope.scope.status]"></div>
{{ scope.scope.status == 0 ? '启用' : '停用' }} <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>
<!-- 类型 --> <!-- 类型 -->
<div slot="materialType" slot-scope="scope"> <div slot="materialType" slot-scope="scope">
...@@ -98,28 +93,36 @@ ...@@ -98,28 +93,36 @@
</div> </div>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia> <AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc> <FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
<VideoShowDia ref="VideoShowDia" :dialogVisible="dialogVisibleImg"></VideoShowDia>
</div> </div>
</template> </template>
<script> <script>
// const iconUrl = const materialStatus = {
// 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAFoTx1HAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADqADAAQAAAABAAAADgAAAAC98Dn6AAAB7klEQVQoFVVSQUhUURQ9981sVFyYRRHuFFq1CGlZC3etnBlMRhMXQwhtCqIQJBA3gSSi1EpkNqkjCjOjm1YWuGojBVO7Fi0K2qQLF6H453bO+/ODLvz37z333PvOu+8BtImCf0K56J8VYKLoC9HRMlnwRxaRgB0kOHDDz5gl/0hZBaaFwGl3H65j577nygV/ITCM71pinRo1GiF4zm8jqzkr5dEtluiTJZ9zx8fYTEBmbP5D/tSY3wnaRUwB0rbdsAH5SYK3sW2l4r1/jnFIsUMElmsNmxdB7JGsUnGUWvQz+XkHXtXqNsxx/KL/Zg+oS5xxi8A2T8SqNe0az3NANyfVJD4N5ripZDTDrc1da8kn/i1QxGya4eq4Kl8aui7hblRLUd/JXCSxxXarBJ9T8fuYFLsztiqTv4NjXUTh2rZteEhiP8OKiiIez3+CFoWubdXtpUDe1XAbmJEfQLxpRxFPRz7T1ccz6BFkl6okRzHFOJ5ccbnkr8l5LF8mrl5Pnv5gJksJjmlD/wclv9121ClxeqthH4TJQh5fLhIMaa7LOrRuIk2la89lfO29ghuU/69IHBatqIZfOhgWv2OXhUIOi/FCnDpoZuYqaCaYpYJ5gvf+m6pInUE9Y5NRhoPCdGl80fscyFK1aqfCZH8B0rPa9foo7e4AAAAASUVORK5CYII=' '0': 'normal',
'1': 'draft',
'-1': 'dot3'
}
import Vue from 'vue' import Vue from 'vue'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import iconUrl from '@/assets/icon-circle-question.png' import iconUrl from '@/assets/icon-circle-question.png'
import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia' import AddMaterialGroupDia from '@/views/material/components/addMaterialGroupDia'
import MaterialGroup from '@/views/material/components/materialGroup' import MaterialGroup from '@/views/material/components/materialGroup'
import FunctionIntroduc from '@/views/material/components/functionIntroduc' import FunctionIntroduc from '@/views/material/components/functionIntroduc'
import VideoShowDia from './components/videoDia.vue'
export default { export default {
name: 'materialList', name: 'materialList',
components: { components: {
AddMaterialGroupDia, AddMaterialGroupDia,
MaterialGroup, MaterialGroup,
FunctionIntroduc FunctionIntroduc,
VideoShowDia
}, },
data() { data() {
return { return {
dialogVisibleImg: false, // 视频弹框
url, url,
materialStatus: materialStatus,
eventBus: new Vue(), eventBus: new Vue(),
searchForm: { searchForm: {
groupId: '', // 素材组id groupId: '', // 素材组id
...@@ -209,7 +212,11 @@ export default { ...@@ -209,7 +212,11 @@ export default {
}, },
{ {
optionId: -1, optionId: -1,
optionLabel: '禁用' optionLabel: '停用'
},
{
optionId: 1,
optionLabel: '草稿'
} }
], ],
optionId: 'optionId', optionId: 'optionId',
...@@ -249,6 +256,19 @@ export default { ...@@ -249,6 +256,19 @@ export default {
}, },
{ {
type: 'GLButton', type: 'GLButton',
name: row => {
return row.status == 0 ? '禁用' : '启用'
},
attrs: {
type: 'text',
fn: '禁用'
},
listeners: {
click: this.handleForbid
}
},
{
type: 'GLButton',
name: '删除', name: '删除',
attrs: { attrs: {
type: 'text', type: 'text',
...@@ -413,22 +433,10 @@ export default { ...@@ -413,22 +433,10 @@ export default {
}, },
videoOpen(scope) { videoOpen(scope) {
var vedioId = 'video' + `${scope.id}`
console.log(vedioId)
var myVideo = document.getElementById(vedioId)
// myVideo.play()
},
//
videoHide(scope) {
console.log(scope) console.log(scope)
var vedioId = 'video' + `${scope.id}` this.dialogVisibleImg = true
console.log(vedioId) let dialogSrc = scope.materialContentRpcResponse.materialUrl
var myVideo = document.getElementById(vedioId) this.$refs.VideoShowDia.init(dialogSrc)
console.log(myVideo)
console.log(myVideo.paused)
myVideo.pause()
console.log(myVideo.paused)
}, },
// 重置 // 重置
...@@ -492,18 +500,15 @@ export default { ...@@ -492,18 +500,15 @@ export default {
}, },
// 素材禁用&启用 // 素材禁用&启用
handleForbid(scope) { handleForbid(scope) {
console.log(scope)
var params = {} var params = {}
params.id = scope.id params.id = scope.id
params.status = scope.status if (scope.status == 0) {
this.$apis.material.materialEdit(params).then(res => { params.status = -1
console.log(res) this.secondConfirm('提示', '禁用素材,确定禁用此素材?', 'material', 'materialEdit', params)
res.code == 0 ? this.getListApi() : '' } else {
this.$message({ params.status = 0
message: res.code == '0' ? '操作成功' : '操作失败', this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params)
type: res.code == '0' ? 'success' : 'error' }
})
})
}, },
// 素材删除 // 素材删除
handleDelete(scope) { handleDelete(scope) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!