Commit 1f29c043 by ext.wangyuman1

朋友圈模块

1 parent bbeb6fe6
......@@ -20,6 +20,11 @@ export default {
type: [Array, String],
default: '',
},
// 朋友圈
isFriends: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -168,6 +173,10 @@ export default {
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
// 如果是朋友圈模块使用isFirends为true
if (this.isFriends) {
this.query.scene = 1
}
getList(this.query)
.then(({ rows, total }) => {
this.list = rows.sort((a, b) => +new Date(b.updateTime) - +new Date(a.updateTime))
......@@ -187,7 +196,11 @@ export default {
<div class="page">
<div style="margin-top: 16px">
<el-row type="flex" justify="space-between">
<el-col :span="5" class="left pad20" style="border-radius: 4px; background: var(--bg-white)">
<el-col
:span="5"
class="left pad20"
style="border-radius: 4px; background: var(--bg-white)"
>
<div class="title">
<div class="title-name">{{ typeTitle[type] }}分组</div>
</div>
......@@ -197,7 +210,8 @@ export default {
:class="{ active: groupIndex == key }"
v-for="(group, key) in groupList"
:key="group.id"
@click="switchGroup(key, group)">
@click="switchGroup(key, group)"
>
<div class="name">{{ group.name + ' (' + group.number + ')' }}</div>
</div>
</div>
......@@ -211,7 +225,8 @@ export default {
clearable
prefix-icon="el-icon-search"
style="width: 300px"
@keyup.enter="search()" />
@keyup.enter="search()"
/>
<el-button class="ml10" @click="getList(1)" type="primary">查询</el-button>
<!-- v-hasPermi="['wecom:material:list']" -->
<el-button @click="resetQuery">重置</el-button>
......@@ -225,7 +240,8 @@ export default {
:total="total"
v-model:page="query.pageNum"
v-model:limit="query.pageSize"
@pagination="getList()" />
@pagination="getList()"
/>
</div>
</el-col>
</el-row>
......
......@@ -18,7 +18,7 @@
:label="item.label + '(' + item.list.length + ')'"
:name="item.name"
>
<MaPage ref="page" :type="item.type" v-slot="{ list }" @listChange="listChange">
<MaPage ref="page" :type="item.type" :isFriends ='isFriends' v-slot="{ list }" @listChange="listChange">
<div v-if="item.type === '0'">
<div v-if="list && list.length">
<el-checkbox-group v-model="paneList[picindex].list" class="imgStyle">
......
......@@ -7,7 +7,8 @@
width="60%"
append-to-body
:close-on-click-modal="false"
@close="dialogClose">
@close="dialogClose"
>
<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 prop="name" align="center" label="素材" width="260">
......@@ -22,17 +23,32 @@
</div>
</template>
</el-table-column>
<el-table-column label="发送总次数" align="center" prop="sendTotalNum" :show-overflow-tooltip="true">
<el-table-column
label="发送总次数"
align="center"
prop="sendTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope">
{{ scope.row.sendTotalNum || '-' }}
</template>
</el-table-column>
<el-table-column label="查看总次数" align="center" prop="viewTotalNum" :show-overflow-tooltip="true">
<el-table-column
label="查看总次数"
align="center"
prop="viewTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope">
{{ scope.row.viewTotalNum || '-' }}
</template>
</el-table-column>
<el-table-column label="查看总人数" align="center" prop="viewByTotalNum" :show-overflow-tooltip="true">
<el-table-column
label="查看总人数"
align="center"
prop="viewByTotalNum"
:show-overflow-tooltip="true"
>
<template #default="scope">
{{ scope.row.viewByTotalNum || '-' }}
</template>
......@@ -131,15 +147,16 @@ export default {
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
}),
})
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
// let routeData = this.$router.resolve({
// path: '/preview',
// query: { obj: encodeURIComponent(JSON.stringify(row)) },
// })
// window.open(routeData.href, '_blank')
window.open(window.lwConfig.PRIVIEW_PATH + row.id + '&otherModle=' + true, '_blank')
},
deltype(type) {
switch (type) {
......
......@@ -217,11 +217,12 @@ export default {
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
// let routeData = this.$router.resolve({
// path: '/preview',
// query: { obj: encodeURIComponent(JSON.stringify(row)) },
// })
// window.open(routeData.href, '_blank')
window.open(window.lwConfig.PRIVIEW_PATH + row.id + '&otherModle=' + true, '_blank')
},
// 处理文件类型
filType(file) {
......
......@@ -29,6 +29,7 @@ const common = {
DEFAULT_H5_WORDE: env.DOMAIN + '/static/WORD.png',
DEFAULT_H5_PPT: env.DOMAIN + '/static/PPT.png',
PRIVIEW_URL: env.VIEW_URL,
PRIVIEW_PATH: env.DOMAIN + '/mobile/#/metrialDetail?materiaId=',
BAIDU_MAP_KEY: 'GeDsF2XGs01U0bUSpFIUCmvyNoYuGC3P', // 百度地图key
MICRO_APPS: {
......
<template>
<div>
<!-- 表格拖拽组件 -->
<el-table :data="tableData" ref="singleTable" highlight-current-row row-key="id" class="load_table">
<el-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 label="" width="50" align="left" v-if="dargAble">
<svg-icon icon="dragIcon" />
......@@ -12,13 +18,16 @@
<el-tooltip
:content="row.materialName"
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>
</el-tooltip>
<!-- 文本 -->
<div v-if="row.mediaType === '4'">
<el-tooltip placement="top" :disabled="row.content ? row.content.length < 50 : true">
<template #content><p style="white-space: pre-line" v-html="row.content"></p></template>
<template #content
><p style="white-space: pre-line" v-html="row.content"></p
></template>
<span class="twosplice">{{ coverContent(row.content, 50) }}</span>
</el-tooltip>
</div>
......@@ -28,11 +37,20 @@
</div>
<!-- 图文 -->
<div v-if="row.mediaType === '9'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
<el-image
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else>
<svg-icon class="icon-style" icon="imgText"></svg-icon>
</div>
<el-tooltip :content="row.content" placement="top" :disabled="row.content ? row.content.length < 50 : true">
<el-tooltip
:content="row.content"
placement="top"
:disabled="row.content ? row.content.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.content, 50) }}</span>
</el-tooltip>
</div>
......@@ -42,18 +60,31 @@
</div>
<!-- 文章 -->
<div v-if="row.mediaType === '12'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize" v-if="row.coverUrl"></el-image>
<el-image
:src="row.coverUrl"
fit="contain"
class="imgsize"
v-if="row.coverUrl"
></el-image>
<div class="icon-style" v-else>
<svg-icon class="icon-style" icon="article"></svg-icon>
</div>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
<!-- 视频 -->
<div v-if="row.mediaType === '2'" style="display: flex">
<el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
......@@ -61,16 +92,27 @@
<div v-if="row.mediaType === '3'" style="display: flex">
<!-- <el-image :src="row.coverUrl" fit="contain" class="imgsize"></el-image> -->
<div class="icon-style" v-if="row.materialUrl">
<svg-icon class="icon-style" :icon="row.materialUrl ? filType(row.materialUrl) : ''"></svg-icon>
<svg-icon
class="icon-style"
:icon="row.materialUrl ? filType(row.materialUrl) : ''"
></svg-icon>
</div>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
<!-- 海报 -->
<div v-if="row.mediaType === '5'" style="display: flex">
<el-image :src="row.materialUrl" fit="contain" class="imgsize"></el-image>
<el-tooltip :content="row.digest" placement="top" :disabled="row.digest ? row.digest.length < 50 : true">
<el-tooltip
:content="row.digest"
placement="top"
:disabled="row.digest ? row.digest.length < 50 : true"
>
<span class="twosplice distStyle">{{ coverContent(row.digest, 50) }}</span>
</el-tooltip>
</div>
......@@ -167,15 +209,16 @@ export default {
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
}),
})
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
// let routeData = this.$router.resolve({
// path: '/preview',
// query: { obj: encodeURIComponent(JSON.stringify(row)) },
// })
// window.open(routeData.href, '_blank')
window.open(window.lwConfig.PRIVIEW_PATH + row.id + '&otherModle=' + true, '_blank')
},
// 处理文件类型
filType(file) {
......@@ -246,7 +289,9 @@ export default {
},
//表格拖动排序
dragSort() {
const el = this.$refs.singleTable.$el.querySelectorAll('.el-table__body-wrapper table > tbody')[0]
const el = this.$refs.singleTable.$el.querySelectorAll(
'.el-table__body-wrapper table > tbody'
)[0]
this.sortable = Sortable.create(el, {
ghostClass: 'sortable-ghost',
......
......@@ -125,11 +125,12 @@ export default {
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
// let routeData = this.$router.resolve({
// path: '/preview',
// query: { obj: encodeURIComponent(JSON.stringify(row)) },
// })
// window.open(routeData.href, '_blank')
window.open(window.lwConfig.PRIVIEW_PATH + row.id + '&otherModle=' + true, '_blank')
},
// 超过num个。。。展示
coverContent(str, num) {
......
......@@ -4,7 +4,12 @@
<div class="title">{{ weMaterialVo.materialName }}</div>
<!-- 文章 -->
<div class="centerStyle" v-if="weMaterialVo.mediaType == 12">
<el-image class="img-style" fit="contain" :src="weMaterialVo.coverUrl" v-if="weMaterialVo.coverUrl" />
<el-image
class="img-style"
fit="contain"
:src="weMaterialVo.coverUrl"
v-if="weMaterialVo.coverUrl"
/>
<svg-icon class="icon-style" icon="article" v-else></svg-icon>
<div class="contentStyle">{{ weMaterialVo.digest }}</div>
</div>
......@@ -15,7 +20,12 @@
</div>
<!-- 海报 -->
<div class="centerStyle" v-if="weMaterialVo.mediaType == 5">
<el-image class="img-style" fit="contain" :src="weMaterialVo.materialUrl" v-if="weMaterialVo.materialUrl" />
<el-image
class="img-style"
fit="contain"
:src="weMaterialVo.materialUrl"
v-if="weMaterialVo.materialUrl"
/>
<svg-icon class="icon-style" icon="pic" v-else></svg-icon>
<div class="contentStyle">{{ weMaterialVo.digest }}</div>
</div>
......@@ -24,7 +34,8 @@
<svg-icon
class="icon-style"
:icon="weMaterialVo.materialUrl ? filType(weMaterialVo.materialUrl) : ''"
v-if="weMaterialVo.materialUrl"></svg-icon>
v-if="weMaterialVo.materialUrl"
></svg-icon>
<span class="contentStyle">{{ weMaterialVo.digest }}</span>
</div>
</div>
......@@ -34,12 +45,15 @@
<a :href="weMaterialVo.materialUrl" target="_blank">预览</a>
</div>
<div v-if="weMaterialVo.mediaType === '12'" class="preview" @click="preview(weMaterialVo)">预览</div>
<div v-if="weMaterialVo.mediaType === '12'" class="preview" @click="preview(weMaterialVo)">
预览
</div>
<a
target="_blank"
:href="dealUrl(weMaterialVo.materialUrl)"
class="preview"
v-if="weMaterialVo.mediaType == '3'">
v-if="weMaterialVo.mediaType == '3'"
>
预览
</a>
</div>
......@@ -73,15 +87,16 @@ export default {
return btoa(
encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {
return String.fromCharCode('0x' + p1)
}),
})
)
},
preview(row) {
let routeData = this.$router.resolve({
path: '/preview',
query: { obj: encodeURIComponent(JSON.stringify(row)) },
})
window.open(routeData.href, '_blank')
// let routeData = this.$router.resolve({
// path: '/preview',
// query: { obj: encodeURIComponent(JSON.stringify(row)) },
// })
// window.open(routeData.href, '_blank')
window.open(window.lwConfig.PRIVIEW_PATH + row.id + '&otherModle=' + true, '_blank')
},
// 处理文件类型
filType(file) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!