Commit 6ca8b63e by 前端

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

Kuangyq dev v2.6.0

See merge request !235
2 parents 89b19da1 70a645d6

358 Bytes | W: | H:

554 Bytes | W: | H:

src/assets/material/file.png
src/assets/material/file.png
src/assets/material/file.png
src/assets/material/file.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -286,9 +286,26 @@ export default {
if (this.materialAddForm.isNotifySender) {
params.isNotifySender = 0
}
if (params.materialType == 1) {
if (this.materialAddForm.materialType == 1) {
params.materialUrl = this.pdfUrl
} else if (params.materialType == 3) {
} else if (this.materialAddForm.materialType == 3) {
let html = this.textBoxContent
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
if (imgHtml) {
for (let i = 0; i < imgHtml.length; i++) {
html = html.replace(imgHtml[i], '')
}
}
if (videoHtml) {
for (let i = 0; i < videoHtml.length; i++) {
html = html.replace(videoHtml[i], '')
}
}
html = html.replace(/<[^>]+>/g, '')
if (videoHtml && videoHtml.length && !imgHtml && !html.length) params.materialType = 4
if (!imgHtml && !videoHtml) params.materialType = 5
if (imgHtml && imgHtml.length && !videoHtml && !html.length) params.materialType = 6
this.textBoxContent = encodeURIComponent(this.textBoxContent)
params.materialUrl = this.textBoxContent
}
......@@ -303,19 +320,20 @@ export default {
}
this.$apis.material.materialDetail(params).then(res => {
this.materialAddForm = res
if (this.materialAddForm.businessType) {
if (res.businessType) {
const businessTypeArr = this.materialAddForm.businessType.split(',')
this.materialAddForm.businessType = businessTypeArr.map(item => parseInt(item))
} else {
this.materialAddForm.businessType = []
}
if (this.materialAddForm.materialType == 3) {
if (res.materialType == 3 || res.materialType == 4 || res.materialType == 5 || res.materialType == 6) {
this.materialAddForm.materialType = 3
this.materialAddForm.materialUrl = decodeURIComponent(this.materialAddForm.materialUrl)
this.$refs.textBox.setEdit(this.materialAddForm.materialUrl)
} else if (this.materialAddForm.materialType == 1) {
} else if (res.materialType == 1) {
this.pdfUrl = this.materialAddForm.materialUrl
}
if (this.materialAddForm.tagJson) {
if (res.tagJson) {
const tagging = eval(this.materialAddForm.tagJson)
// let arr = []
this.tagging = tagging.map(item => {
......@@ -479,20 +497,6 @@ export default {
handleSubmit() {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
// let tagging = this.tagging.map(item => {
// let tagIds = item.labelList.map(tag => {
// return tag.id
// })
// let name = item.labelList.map(tag => {
// return tag.name
// })
// return {
// groupId: item.labelGroup.id,
// tagIds: tagIds.join(','),
// name: name.join(','),
// labelType: item.labelGroup.name
// }
// })
var params = this.getParams()
if (!params.materialUrl) {
this.$message({
......@@ -503,23 +507,13 @@ export default {
}
// status 状态 0 启用 -1 禁用 1 存草稿
params.status = 0
// params.isNotifySender = -1
// params.tagJson = JSON.stringify(tagging)
// if (this.materialAddForm.isNotifySender) {
// params.isNotifySender = 0
// }
// if (params.materialType == 1) {
// params.materialUrl = this.pdfUrl
// } else if (params.materialType == 3) {
// this.textBoxContent = encodeURIComponent(this.textBoxContent)
// params.materialUrl = this.textBoxContent
// }
let material
if (params.id) {
material = 'materialEdit'
} else {
material = 'materialInsert'
}
console.log(params, '====')
this.$apis.material[material](params).then(res => {
if (res) {
this.$message({
......
......@@ -12,17 +12,26 @@
</div>
</div>
<ul v-show="groupVisible" :style="{ height: groupHeight - 110 + 'px' }">
<li v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle" />
<div class="group-name">{{ item.materialGroupName }}</div>
<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>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton>
</div>
<i slot="reference" class="el-icon-more"></i>
</el-popover>
<li class="group-list" v-for="(item, index) in groupCounter" :class="index === currentIndex ? 'active' : ''" :key="index" @click="handleGroup(item, index)">
<div>
<img src="@/assets/material/file.png" alt="" style="vertical-align: middle;height:24px;width:24px" />
<div class="group-name">{{ item.materialGroupName }}</div>
</div>
<div>
<el-popover placement="right" trigger="click">
<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>
<GLButton class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</GLButton>
<!-- <el-button class="group-btn" :size="size" type="text" fn="置顶" @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</el-button>
<el-button class="group-btn" :size="size" type="text" fn="修改" @click="handleAddGroup(2, item)">修改</el-button>
<el-button class="group-btn" :size="size" type="text" fn="删除" v-if="item.isDefault == -1" @click="handleDeleteGroup(item.id)">删除</el-button> -->
</div>
<div slot="reference">
<img class="more-icon" src="@/assets/material/more.png" alt="" />
</div>
</el-popover>
</div>
</li>
</ul>
</div>
......@@ -169,6 +178,9 @@ export default {
</script>
<style lang="scss" scoped>
.status-words {
margin-left: 5px;
}
.el-popover {
min-width: 50px;
max-width: 150px;
......@@ -196,19 +208,18 @@ export default {
}
ul {
overflow: auto;
li {
.group-list {
cursor: pointer;
text-align: left;
padding: 8px 16px 8px 18px;
padding: 8px 8px 8px 18px;
display: flex;
justify-content: space-between;
&.active {
background-color: #ebeaff;
}
i {
font-size: 16px;
padding-top: 6px;
position: absolute;
right: 0px;
transform: rotate(90deg);
.more-icon {
vertical-align: middle;
padding-top: 3px;
}
}
}
......
......@@ -9,11 +9,11 @@
</div>
<span @click="showIntroductionDialog" class="introduc-word">
功能介绍
<i class="el-icon-arrow-right"></i>
<!-- <i class="el-icon-arrow-right"></i> -->
</span>
<div class="container">
<div class="search-form">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="2" :formObj="searchForm" :formData="materialFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="tabelList">
<el-row>
......@@ -38,7 +38,7 @@
<!-- 素材为自定义链接 -->
<span v-if="scope.scope.materialType == 2"></span>
<!-- 素材为图文 -->
<span v-if="scope.scope.materialType == 3" class="material-content">
<span v-if="scope.scope.materialType == 3 || scope.scope.materialType == 4 || scope.scope.materialType == 5 || scope.scope.materialType == 6" class="material-content">
<!-- 图片 -->
<el-popover placement="top" trigger="hover" v-if="scope.scope.urlType == 'img'">
<div>
......@@ -53,9 +53,9 @@
</div>
</el-popover>
<!-- 视频 -->
<el-popover placement="right" trigger="hover" v-if="scope.scope.urlType == 'video'">
<el-popover placement="right" trigger="click" @hide="videoHide(scope.scope)" @show="videoOpen(scope.scope)" v-if="scope.scope.urlType == 'video'">
<div>
<video controls autoplay width="300" height="300">
<video controls :id="'video' + scope.scope.id" width="300" height="300">
<source :src="scope.scope.materialContentRpcResponse.materialUrl" type="video/mp4" />
</video>
</div>
......@@ -75,18 +75,17 @@
</div>
<!-- 状态 -->
<div slot="status" slot-scope="scope">
<GLButton style="display:inline-block" mode="el-switch" v-model="scope.scope.status" :active-value="0" :inactive-value="-1 || 1" fn="禁用" width="32" size="mini" @change="e => handleForbid(e, scope.scope)"></GLButton>
<span style="margin-left: 5px;" v-if="scope.scope.status == 0">启用</span>
<span style="margin-left: 5px;" v-else>停用</span>
<!-- <span v-if="scope.scope.status == 1">存草稿</span> -->
<el-switch v-model="scope.scope.status" :active-value="0" :inactive-value="-1" @change="handleForbid(scope.scope)"></el-switch>
{{ scope.scope.status == 0 ? '启用' : '停用' }}
</div>
<!-- 类型 -->
<div slot="materialType" slot-scope="scope">
<span v-if="scope.scope.materialType == 1">pdf文件</span>
<span v-if="scope.scope.materialType == 2">自定义链接</span>
<span v-if="scope.scope.urlType == 'video'">视频</span>
<span v-if="scope.scope.urlType == 'img'">图文</span>
<span v-if="!scope.scope.urlType && scope.scope.materialType == 3">纯文字</span>
<span v-if="scope.scope.materialType == 3">图文</span>
<span v-if="scope.scope.materialType == 4">视频</span>
<span v-if="scope.scope.materialType == 5">纯文字</span>
<span v-if="scope.scope.materialType == 6">纯图片</span>
</div>
<span slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
......@@ -103,10 +102,11 @@
</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 iconUrl =
// 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAFoTx1HAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADqADAAQAAAABAAAADgAAAAC98Dn6AAAB7klEQVQoFVVSQUhUURQ9981sVFyYRRHuFFq1CGlZC3etnBlMRhMXQwhtCqIQJBA3gSSi1EpkNqkjCjOjm1YWuGojBVO7Fi0K2qQLF6H453bO+/ODLvz37z333PvOu+8BtImCf0K56J8VYKLoC9HRMlnwRxaRgB0kOHDDz5gl/0hZBaaFwGl3H65j577nygV/ITCM71pinRo1GiF4zm8jqzkr5dEtluiTJZ9zx8fYTEBmbP5D/tSY3wnaRUwB0rbdsAH5SYK3sW2l4r1/jnFIsUMElmsNmxdB7JGsUnGUWvQz+XkHXtXqNsxx/KL/Zg+oS5xxi8A2T8SqNe0az3NANyfVJD4N5ripZDTDrc1da8kn/i1QxGya4eq4Kl8aui7hblRLUd/JXCSxxXarBJ9T8fuYFLsztiqTv4NjXUTh2rZteEhiP8OKiiIez3+CFoWubdXtpUDe1XAbmJEfQLxpRxFPRz7T1ccz6BFkl6okRzHFOJ5ccbnkr8l5LF8mrl5Pnv5gJksJjmlD/wclv9121ClxeqthH4TJQh5fLhIMaa7LOrRuIk2la89lfO29ghuU/69IHBatqIZfOhgWv2OXhUIOi/FCnDpoZuYqaCaYpYJ5gvf+m6pInUE9Y5NRhoPCdGl80fscyFK1aqfCZH8B0rPa9foo7e4AAAAASUVORK5CYII='
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'
......@@ -175,6 +175,18 @@ export default {
{
optionId: 3,
optionLabel: '图文'
},
{
optionId: 4,
optionLabel: '视频'
},
{
optionId: 5,
optionLabel: '纯文字'
},
{
optionId: 6,
optionLabel: '纯图片'
}
],
optionId: 'optionId',
......@@ -198,10 +210,6 @@ export default {
{
optionId: -1,
optionLabel: '禁用'
},
{
optionId: 1,
optionLabel: '草稿'
}
],
optionId: 'optionId',
......@@ -306,9 +314,8 @@ export default {
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px',
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
......@@ -355,9 +362,8 @@ export default {
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px',
width: '17px',
height: '17px',
'vertical-align': 'middle'
},
attrs: {
......@@ -406,6 +412,25 @@ 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)
},
// 重置
handleReset() {
this.searchForm = {
......@@ -466,10 +491,11 @@ export default {
})
},
// 素材禁用&启用
handleForbid(e, scope) {
handleForbid(scope) {
console.log(scope)
var params = {}
params.id = scope.id
params.status = e == 0 ? 0 : 1
params.status = scope.status
this.$apis.material.materialEdit(params).then(res => {
console.log(res)
res.code == 0 ? this.getListApi() : ''
......@@ -478,17 +504,10 @@ export default {
type: res.code == '0' ? 'success' : 'error'
})
})
// if (e == 0) {
// params.status = -1
// this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', params)
// } else {
// params.status = 0
// this.secondConfirm('提示', '启用素材,确定启用此素材?', 'material', 'materialEdit', params)
// }
},
// 素材删除
handleDelete(scope) {
this.secondConfirm('提示', '删除素材,所有已经发送给客户的素材链接均会失效,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
this.secondConfirm('提示', '删除素材以后,该素材将不能再使用,是否继续删除?', 'material', 'materialDelete', { id: scope.id })
},
// 1-新增素材,2-编辑素材
addMaterial(addOrEdit, scope) {
......@@ -513,11 +532,8 @@ export default {
let data = res
let tableData = []
data.forEach(item => {
// 根据素材类型是图文还是pdf处理数据
if (item.materialType != 3) {
item.materialContentRpcResponse.materialUrl = ''
}
if (item.materialType == 3) {
// 根据素材类型是图文处理数据
if (item.materialType == 3 || item.materialType == 4 || item.materialType == 5 || item.materialType == 6) {
let html = decodeURIComponent(item.materialContentRpcResponse.materialUrl)
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
let videoHtml = html.match(/<video.*?(?:>|\/>)/g)
......@@ -698,6 +714,7 @@ ul {
height: 200px;
}
.introduc-word {
font-size: 14px;
margin-left: 16px;
color: #5850ff;
}
......
......@@ -216,12 +216,13 @@ export default {
params.flag = 0
this.$apis.material.materialDetail(params).then(res => {
this.detailInfo = res
if (this.detailInfo.tagJson) {
if (res.tagJson) {
this.detailInfo.tagJson = eval(this.detailInfo.tagJson)
} else {
this.detailInfo.tagJson = []
}
if (this.detailInfo.materialType == 3) {
if (res.materialType == 3 || res.materialType == 4 || res.materialType == 5 || res.materialType == 6) {
this.detailInfo.materialType = 3
this.detailInfo.materialUrl = decodeURIComponent(this.detailInfo.materialUrl)
let html = this.detailInfo.materialUrl
let imgHtml = html.match(/<img.*?(?:>|\/>)/g)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!