Commit e966364e by xinla

--no commit message

1 parent 5c5e4a08
...@@ -18,26 +18,15 @@ ...@@ -18,26 +18,15 @@
:label="item.label + '(' + item.list.length + ')'" :label="item.label + '(' + item.list.length + ')'"
:name="item.name" :name="item.name"
> >
<MaPage <MaPage ref="page" :type="item.type" :isFriends="isFriends" v-slot="{ list }" @listChange="listChange">
ref="page"
:type="item.type"
:isFriends="isFriends"
v-slot="{ list }"
@listChange="listChange"
>
<div v-if="item.type === '0'"> <div v-if="item.type === '0'">
<div v-if="list && list.length"> <div v-if="list && list.length">
<el-checkbox-group v-model="paneList[picindex].list" class="imgStyle"> <el-checkbox-group v-model="paneList[picindex].list" class="imgStyle">
<div <div class="imgItem" v-for="(item, index) in list" :key="index" @click="changeBox($event, item)">
class="imgItem"
v-for="(item, index) in list"
:key="index"
@click="changeBox($event, item)"
>
<div class="checkboxStyle"> <div class="checkboxStyle">
<el-checkbox <el-checkbox
:label="item" :label="item"
style="width: 20px; height: 20px" style="width: 20px; height: 20px;"
:checked="item.isCheck" :checked="item.isCheck"
></el-checkbox> ></el-checkbox>
<el-tooltip <el-tooltip
...@@ -50,10 +39,7 @@ ...@@ -50,10 +39,7 @@
</div> </div>
</el-tooltip> </el-tooltip>
</div> </div>
<div <div class="img" :style="{ 'background-image': 'url(' + item.materialUrl + ')' }"></div>
class="img"
:style="{ 'background-image': 'url(' + item.materialUrl + ')' }"
></div>
</div> </div>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
...@@ -61,13 +47,7 @@ ...@@ -61,13 +47,7 @@
<span>暂无数据</span> <span>暂无数据</span>
</div> </div>
</div> </div>
<el-table <el-table :data="list" ref="multipleTable" @select="handleSelect" @select-all="selectAll" v-else>
:data="list"
ref="multipleTable"
@select="handleSelect"
@select-all="selectAll"
v-else
>
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="素材" align="left"> <el-table-column label="素材" align="left">
<template #default="{ row }"> <template #default="{ row }">
...@@ -96,57 +76,59 @@ ...@@ -96,57 +76,59 @@
</template> </template>
<script> <script>
import MaPage from './MaPage' import MaPage from './MaPage'
import PicTitContent from '@/views/contentCenter/components/PicTitContent' import PicTitContent from '@/views/contentCenter/components/PicTitContent'
export default { export default {
name: '', name: '',
props: { props: {
// 控制弹框显隐 // 控制弹框显隐
choseDialog: { choseDialog: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
talkListLength: { talkListLength: {
type: Number, type: Number,
default: 0, default: 0
}, },
moduleType: { moduleType: {
type: Number, type: Number,
default: null, default: null
}, },
// 最多选择几个素材 // 最多选择几个素材
maxlength: { maxlength: {
type: Number, type: Number,
default: 9, default: 9
}, },
// 没有小程序 // 没有小程序
noApplets: { noApplets: {
type: Boolean, type: Boolean,
default: false, default: false
}, },
// 朋友圈 // 朋友圈
isFriends: { isFriends: {
type: Boolean, type: Boolean,
default: false, default: false
}, }
}, },
watch: { watch: {
choseDialog: { choseDialog: {
handler(val) { handler(val) {
this.dialogVisibel = val this.dialogVisibel = val
}, }
}, },
maxlength: { maxlength: {
handler(val) { handler(val) {
console.log(123)
console.log(val)
this.maxlength2 = val this.maxlength2 = val
}, }
}, }
}, },
computed: {}, computed: {},
components: { components: {
MaPage, MaPage,
PicTitContent, PicTitContent
}, },
created() { created() {
this.dealList() this.dealList()
...@@ -163,7 +145,7 @@ export default { ...@@ -163,7 +145,7 @@ export default {
ids: [], // 选中数组 ids: [], // 选中数组
itemArry: [], // 选中数组 itemArry: [], // 选中数组
inx: 0, inx: 0,
maxlength2: 9, // 最大确认数 maxlength2: 9 // 最大确认数
} }
}, },
methods: { methods: {
...@@ -197,7 +179,7 @@ export default { ...@@ -197,7 +179,7 @@ export default {
{ list: [], label: '视频', name: 'video', type: '2' }, { list: [], label: '视频', name: 'video', type: '2' },
{ list: [], label: '文件', name: 'file', type: '3' }, { list: [], label: '文件', name: 'file', type: '3' },
{ list: [], label: '海报', name: 'poster', type: '5' }, { list: [], label: '海报', name: 'poster', type: '5' },
{ list: [], label: '外链', name: 'outChain', type: '19' }, { list: [], label: '外链', name: 'outChain', type: '19' }
] ]
this.picindex = 1 this.picindex = 1
this.activeName = 'text' this.activeName = 'text'
...@@ -247,9 +229,7 @@ export default { ...@@ -247,9 +229,7 @@ export default {
this.ids.length + this.talkListLength === this.maxlength2) && this.ids.length + this.talkListLength === this.maxlength2) &&
!obj.isCheck !obj.isCheck
) { ) {
this.$message.error( this.$message.error('最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材')
'最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
)
return return
} }
obj.isCheck = !obj.isCheck obj.isCheck = !obj.isCheck
...@@ -358,9 +338,7 @@ export default { ...@@ -358,9 +338,7 @@ export default {
if (this.index) this.$refs.multipleTable[this.inx].toggleRowSelection(row, false) if (this.index) this.$refs.multipleTable[this.inx].toggleRowSelection(row, false)
}) })
if (!this.isFriends) { if (!this.isFriends) {
this.$message.error( this.$message.error('最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材')
'最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
)
} }
this.paneList[this.index].list = this.paneList[this.index].list.filter((item) => { this.paneList[this.index].list = this.paneList[this.index].list.filter((item) => {
...@@ -393,9 +371,7 @@ export default { ...@@ -393,9 +371,7 @@ export default {
this.$refs.multipleTable[this.inx].toggleAllSelection(item, false) this.$refs.multipleTable[this.inx].toggleAllSelection(item, false)
}) })
if (!this.isFriends) { if (!this.isFriends) {
this.$message.error( this.$message.error('最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材')
'最多新建或选择' + this.maxlength2 + '个素材,已新建' + this.talkListLength + '个素材'
)
} }
this.paneList[this.index].list = [] this.paneList[this.index].list = []
...@@ -435,12 +411,12 @@ export default { ...@@ -435,12 +411,12 @@ export default {
} else { } else {
this.inx = index this.inx = index
} }
}, }
}, }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.emptyStyle { .emptyStyle {
width: 100%; width: 100%;
// height: 60px; // height: 60px;
text-align: center; text-align: center;
...@@ -449,18 +425,18 @@ export default { ...@@ -449,18 +425,18 @@ export default {
font-size: 13px; font-size: 13px;
padding: 40px; padding: 40px;
padding-left: 0px; padding-left: 0px;
} }
.footer { .footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
.footerColor { .footerColor {
font-weight: 500; font-weight: 500;
font-size: 18px; font-size: 18px;
color: var(--color); color: var(--color);
margin: 0 4px; margin: 0 4px;
} }
.twosplice { .twosplice {
width: 90%; //宽度 width: 90%; //宽度
overflow: hidden; //超出文本隐藏 overflow: hidden; //超出文本隐藏
...@@ -474,8 +450,8 @@ export default { ...@@ -474,8 +450,8 @@ export default {
-webkit-line-clamp: 2; //自定义行数 -webkit-line-clamp: 2; //自定义行数
font-size: 14px; font-size: 14px;
display: block; display: block;
} }
.title { .title {
width: 80%; width: 80%;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -483,24 +459,24 @@ export default { ...@@ -483,24 +459,24 @@ export default {
font-weight: bold; font-weight: bold;
color: var(--font-black-7); color: var(--font-black-7);
font-size: 12px; font-size: 12px;
} }
.imgsize { .imgsize {
width: 60px; width: 60px;
height: 60px; height: 60px;
margin-right: 10px; margin-right: 10px;
} }
.el-checkbox { .el-checkbox {
width: 20px; width: 20px;
overflow: hidden; overflow: hidden;
} }
.checkboxStyle { .checkboxStyle {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 30px; height: 30px;
padding: 10px; padding: 10px;
padding-bottom: 0; padding-bottom: 0;
} }
.imgStyle { .imgStyle {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.imgItem { .imgItem {
...@@ -518,5 +494,5 @@ export default { ...@@ -518,5 +494,5 @@ export default {
cursor: pointer; cursor: pointer;
} }
} }
} }
</style> </style>
...@@ -7,8 +7,7 @@ ...@@ -7,8 +7,7 @@
width="60%" width="60%"
append-to-body append-to-body
:close-on-click-modal="false" :close-on-click-modal="false"
@close="dialogClose" @close="dialogClose">
>
<el-table :data="tableData" ref="singleTable" v-loading="loading"> <el-table :data="tableData" ref="singleTable" v-loading="loading">
<!-- <el-table-column type="index" width="50" label="序号" align="center"></el-table-column> --> <!-- <el-table-column type="index" width="50" label="序号" align="center"></el-table-column> -->
<el-table-column prop="name" align="center" label="素材" width="260"> <el-table-column prop="name" align="center" label="素材" width="260">
...@@ -23,32 +22,17 @@ ...@@ -23,32 +22,17 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="发送总次数" align="center" prop="sendTotalNum" :show-overflow-tooltip="true">
label="发送总次数"
align="center"
prop="sendTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope"> <template #default="scope">
{{ scope.row.sendTotalNum || '-' }} {{ scope.row.sendTotalNum || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="查看总次数" align="center" prop="viewTotalNum" :show-overflow-tooltip="true">
label="查看总次数"
align="center"
prop="viewTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope"> <template #default="scope">
{{ scope.row.viewTotalNum || '-' }} {{ scope.row.viewTotalNum || '-' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="查看总人数" align="center" prop="viewByTotalNum" :show-overflow-tooltip="true">
label="查看总人数"
align="center"
prop="viewByTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope"> <template #default="scope">
{{ scope.row.viewByTotalNum || '-' }} {{ scope.row.viewByTotalNum || '-' }}
</template> </template>
...@@ -62,7 +46,7 @@ ...@@ -62,7 +46,7 @@
</el-button> </el-button>
<!-- 文件 --> <!-- 文件 -->
<el-button text v-if="scope.row.mediaType == '3'"> <el-button text v-if="scope.row.mediaType == '3'">
<a :href="dealUrl(scope.row.materialUrl)" target="_blank">预览</a> <a :href="$previewFile(scope.row.materialUrl)" target="_blank">预览</a>
</el-button> </el-button>
<!-- 文章 --> <!-- 文章 -->
<el-button text v-if="scope.row.mediaType == '12'" @click="preview(scope.row)"> <el-button text v-if="scope.row.mediaType == '12'" @click="preview(scope.row)">
...@@ -137,19 +121,6 @@ export default { ...@@ -137,19 +121,6 @@ export default {
// return '' // return ''
// } // }
// }, // },
dealUrl(url) {
return window.lwConfig.PRIVIEW_URL + encodeURIComponent(this.base64Encode(url))
},
base64Encode(str) {
if (str === undefined || str === '' || str === null) {
return str
}
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
})
)
},
preview(row) { preview(row) {
// let routeData = this.$router.resolve({ // let routeData = this.$router.resolve({
// path: '/preview', // path: '/preview',
......
<template> <template>
<div> <div>
<!-- 表格拖拽组件 --> <!-- 表格拖拽组件 -->
<el-table <el-table :data="tableData" ref="singleTable" highlight-current-row row-key="id" class="load_table">
:data="tableData"
ref="singleTable"
highlight-current-row
row-key="id"
class="load_table"
>
<!-- <el-table-column type="index" width="50" label="序号" align="center"></el-table-column> --> <!-- <el-table-column type="index" width="50" label="序号" align="center"></el-table-column> -->
<el-table-column label="" width="50" align="left" v-if="dargAble"> <el-table-column label="" width="50" align="left" v-if="dargAble">
<svg-icon icon="dragIcon" /> <svg-icon icon="dragIcon" />
...@@ -18,16 +12,13 @@ ...@@ -18,16 +12,13 @@
<el-tooltip <el-tooltip
:content="row.materialName" :content="row.materialName"
placement="top" placement="top"
:disabled="row.materialName ? row.materialName.length < 12 : true" :disabled="row.materialName ? row.materialName.length < 12 : true">
>
<span class="title">{{ coverContent(row.materialName, 12) }}</span> <span class="title">{{ coverContent(row.materialName, 12) }}</span>
</el-tooltip> </el-tooltip>
<!-- 文本 --> <!-- 文本 -->
<div v-if="row.mediaType === '4'"> <div v-if="row.mediaType === '4'">
<el-tooltip placement="top" :disabled="row.content ? row.content.length < 50 : true"> <el-tooltip placement="top" :disabled="row.content ? row.content.length < 50 : true">
<template #content <template #content><p style="white-space: pre-line" v-html="row.content"></p></template>
><p style="white-space: pre-line" v-html="row.content"></p
></template>
<span class="twosplice">{{ coverContent(row.content, 50) }}</span> <span class="twosplice">{{ coverContent(row.content, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -37,20 +28,11 @@ ...@@ -37,20 +28,11 @@
</div> </div>
<!-- 图文 --> <!-- 图文 -->
<div v-if="row.mediaType === '9'" style="display: flex"> <div v-if="row.mediaType === '9'" style="display: flex">
<el-image <el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else> <div class="icon-style" v-else>
<svg-icon class="icon-style" icon="imgText"></svg-icon> <svg-icon class="icon-style" icon="imgText"></svg-icon>
</div> </div>
<el-tooltip <el-tooltip :content="row.content" placement="top" :disabled="row.content ? row.content.length < 50 : true">
:content="row.content"
placement="top"
:disabled="row.content ? row.content.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.content, 50) }}</span> <span class="twosplice distStyle">{{ coverContent(row.content, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -60,31 +42,18 @@ ...@@ -60,31 +42,18 @@
</div> </div>
<!-- 文章 --> <!-- 文章 -->
<div v-if="row.mediaType === '12'" style="display: flex"> <div v-if="row.mediaType === '12'" style="display: flex">
<el-image <el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else> <div class="icon-style" v-else>
<svg-icon class="icon-style" icon="article"></svg-icon> <svg-icon class="icon-style" icon="article"></svg-icon>
</div> </div>
<el-tooltip <el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span> <span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<!-- 视频 --> <!-- 视频 -->
<div v-if="row.mediaType === '2'" style="display: flex"> <div v-if="row.mediaType === '2'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip <el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span> <span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -92,27 +61,16 @@ ...@@ -92,27 +61,16 @@
<div v-if="row.mediaType === '3'" style="display: flex"> <div v-if="row.mediaType === '3'" style="display: flex">
<!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> --> <!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> -->
<div class="icon-style" v-if="row.materialUrl"> <div class="icon-style" v-if="row.materialUrl">
<svg-icon <svg-icon class="icon-style" :icon="row.materialUrl ? filType(row.materialUrl) : ''"></svg-icon>
class="icon-style"
:icon="row.materialUrl ? filType(row.materialUrl) : ''"
></svg-icon>
</div> </div>
<el-tooltip <el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span> <span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<!-- 海报 --> <!-- 海报 -->
<div v-if="row.mediaType === '5'" style="display: flex"> <div v-if="row.mediaType === '5'" style="display: flex">
<el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image> <el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip <el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span> <span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -129,20 +87,18 @@ ...@@ -129,20 +87,18 @@
<el-table-column prop="height" label="操作" align="center"> <el-table-column prop="height" label="操作" align="center">
<template #default="scope"> <template #default="scope">
<el-button text>
<el-button text v-if="['2', '5', '9'].includes(scope.row.mediaType)"> <el-button text v-if="['2', '5', '9'].includes(scope.row.mediaType)">
<!-- 视频,海报,图文 --> <!-- 视频,海报,图文 -->
<a :href="scope.row.materialUrl" target="_blank">预览</a> <a :href="scope.row.materialUrl" target="_blank">预览</a>
</el-button> </el-button>
<!-- 文件 --> <!-- 文件 -->
<el-button text v-if="scope.row.mediaType == '3'"> <el-button text v-if="scope.row.mediaType == '3'">
<a :href="dealUrl(scope.row.materialUrl)" target="_blank">预览</a> <a :href="$previewFile(scope.row.materialUrl)" target="_blank">预览</a>
</el-button> </el-button>
<!-- 文章 --> <!-- 文章 -->
<el-button text v-if="scope.row.mediaType == '12'" @click="preview(scope.row)"> <el-button text v-if="scope.row.mediaType == '12'" @click="preview(scope.row)">
<span>预览</span> <span>预览</span>
</el-button> </el-button>
</el-button>
<!-- <el-button <!-- <el-button
text text
@click="edit(scope.row)" @click="edit(scope.row)"
...@@ -203,19 +159,6 @@ export default { ...@@ -203,19 +159,6 @@ export default {
}, },
methods: { methods: {
dealUrl(url) {
return window.lwConfig.PRIVIEW_URL + encodeURIComponent(this.base64Encode(url))
},
base64Encode(str) {
if (str === undefined || str === '' || str === null) {
return str
}
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
})
)
},
preview(row) { preview(row) {
// let routeData = this.$router.resolve({ // let routeData = this.$router.resolve({
// path: '/preview', // path: '/preview',
...@@ -296,9 +239,7 @@ export default { ...@@ -296,9 +239,7 @@ export default {
}, },
//表格拖动排序 //表格拖动排序
dragSort() { dragSort() {
const el = this.$refs.singleTable.$el.querySelectorAll( const el = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper table > tbody')[0]
'.el-table__body-wrapper table > tbody'
)[0]
this.sortable = Sortable.create(el, { this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost', ghostClass: 'sortable-ghost',
......
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
}, },
limit: { limit: {
type: Number, type: Number,
default: 20, default: 10,
}, },
pageSizes: { pageSizes: {
type: Array, type: Array,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!