|
@@ -1,124 +1,77 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <detail-template
|
|
|
|
|
- :headData="mainAreaData"
|
|
|
|
|
- :title="mainData.title"
|
|
|
|
|
|
|
+ <detail-template :headData="mainAreaData" :title="mainData.title"
|
|
|
:tabs="[`${mainData.type == 1 ? '图片管理' : mainData.type == 2 ? '视频管理' : mainData.type == 3 ? '富文本内容' : '文档管理'}`, '详细信息']"
|
|
:tabs="[`${mainData.type == 1 ? '图片管理' : mainData.type == 2 ? '视频管理' : mainData.type == 3 ? '富文本内容' : '文档管理'}`, '详细信息']"
|
|
|
- ownertable="sat_sharematerial"
|
|
|
|
|
- :disable="utils.isDisabled(mainData.status, ['发布'])"
|
|
|
|
|
- :delParam="{
|
|
|
|
|
|
|
+ ownertable="sat_sharematerial" :disable="utils.isDisabled(mainData.status, ['发布'])" :delParam="{
|
|
|
id: 20240319104002,
|
|
id: 20240319104002,
|
|
|
content: { sat_sharematerialids: [router.currentRoute.value.query.id] },
|
|
content: { sat_sharematerialids: [router.currentRoute.value.query.id] },
|
|
|
- }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ }">
|
|
|
<template #operation>
|
|
<template #operation>
|
|
|
- <Edit
|
|
|
|
|
- @back="mianData()"
|
|
|
|
|
- v-if="utils.hasPermission('update') && mainData.status != '发布'"
|
|
|
|
|
- :rowData="mainData"
|
|
|
|
|
- ></Edit>
|
|
|
|
|
- <customBtn
|
|
|
|
|
- btnName="发布"
|
|
|
|
|
- idName="20240329131702"
|
|
|
|
|
- keyName="sat_sharematerialids"
|
|
|
|
|
- :paramData="[{ key: 'status', value: 1 }]"
|
|
|
|
|
- :id="[router.currentRoute.value.query.id]"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- message="确定发布当前资源吗?"
|
|
|
|
|
- @onSuccess="mianData()"
|
|
|
|
|
- v-if="mainData.status == '新建' && utils.hasPermission('open')"
|
|
|
|
|
- size="middle"
|
|
|
|
|
- />
|
|
|
|
|
- <customBtn
|
|
|
|
|
- btnName="取消发布"
|
|
|
|
|
- idName="20240329131702"
|
|
|
|
|
- keyName="sat_sharematerialids"
|
|
|
|
|
- :paramData="[{ key: 'status', value: 0 }]"
|
|
|
|
|
- :id="[router.currentRoute.value.query.id]"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- message="确定取消发布当前资源吗?"
|
|
|
|
|
- @onSuccess="mianData()"
|
|
|
|
|
- size="middle"
|
|
|
|
|
- v-else-if="utils.hasPermission('noopen') && mainData.status == '发布'"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <Edit @back="mianData()" v-if="utils.hasPermission('update') && mainData.status != '发布'" :rowData="mainData">
|
|
|
|
|
+ </Edit>
|
|
|
|
|
+ <customBtn btnName="发布" idName="20240329131702" keyName="sat_sharematerialids"
|
|
|
|
|
+ :paramData="[{ key: 'status', value: 1 }]" :id="[router.currentRoute.value.query.id]" type="primary"
|
|
|
|
|
+ message="确定发布当前资源吗?" @onSuccess="mianData()" v-if="mainData.status == '新建' && utils.hasPermission('open')"
|
|
|
|
|
+ size="middle" />
|
|
|
|
|
+ <customBtn btnName="取消发布" idName="20240329131702" keyName="sat_sharematerialids"
|
|
|
|
|
+ :paramData="[{ key: 'status', value: 0 }]" :id="[router.currentRoute.value.query.id]" type="primary"
|
|
|
|
|
+ message="确定取消发布当前资源吗?" @onSuccess="mianData()" size="middle"
|
|
|
|
|
+ v-else-if="utils.hasPermission('noopen') && mainData.status == '发布'" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #customContent>
|
|
<template #customContent>
|
|
|
- <a-descriptions
|
|
|
|
|
- :column="6"
|
|
|
|
|
- :colon="false"
|
|
|
|
|
- :labelStyle="{
|
|
|
|
|
- display: 'block',
|
|
|
|
|
- lineHeight: '25px',
|
|
|
|
|
- color: '#666',
|
|
|
|
|
- width: '80px',
|
|
|
|
|
- textAlignLast: 'justify',
|
|
|
|
|
- }"
|
|
|
|
|
- size="small"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <a-descriptions :column="6" :colon="false" :labelStyle="{
|
|
|
|
|
+ display: 'block',
|
|
|
|
|
+ lineHeight: '25px',
|
|
|
|
|
+ color: '#666',
|
|
|
|
|
+ width: '80px',
|
|
|
|
|
+ textAlignLast: 'justify',
|
|
|
|
|
+ }" size="small">
|
|
|
<a-descriptions-item :span="2">
|
|
<a-descriptions-item :span="2">
|
|
|
<template #label>
|
|
<template #label>
|
|
|
<div style="display: flex">
|
|
<div style="display: flex">
|
|
|
- <span
|
|
|
|
|
- style="
|
|
|
|
|
|
|
+ <span style="
|
|
|
display: block;
|
|
display: block;
|
|
|
text-align-last: justify;
|
|
text-align-last: justify;
|
|
|
width: 70px;
|
|
width: 70px;
|
|
|
transform: translateY(50%);
|
|
transform: translateY(50%);
|
|
|
- "
|
|
|
|
|
- >封面</span
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ ">封面</span>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <a-image
|
|
|
|
|
- v-if="
|
|
|
|
|
- mainData.attinfos &&
|
|
|
|
|
- mainData.attinfos.filter((item) => item.usetype == 'avatar')
|
|
|
|
|
- .length
|
|
|
|
|
- "
|
|
|
|
|
- :src="
|
|
|
|
|
- mainData.attinfos.filter((item) => item.usetype == 'avatar')[0]
|
|
|
|
|
- .url
|
|
|
|
|
- "
|
|
|
|
|
- style="width: 100px; height: 100px"
|
|
|
|
|
- ></a-image>
|
|
|
|
|
|
|
+ <a-image v-if="
|
|
|
|
|
+ mainData.attinfos &&
|
|
|
|
|
+ mainData.attinfos.filter((item) => item.usetype == 'avatar')
|
|
|
|
|
+ .length
|
|
|
|
|
+ " :src="mainData.attinfos.filter((item) => item.usetype == 'avatar')[0]
|
|
|
|
|
+ .url
|
|
|
|
|
+ " style="width: 100px; height: 100px"></a-image>
|
|
|
</a-descriptions-item>
|
|
</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
|
</template>
|
|
</template>
|
|
|
<template #tab0>
|
|
<template #tab0>
|
|
|
<!-- 富文本类型显示内容,其他类型显示文件管理 -->
|
|
<!-- 富文本类型显示内容,其他类型显示文件管理 -->
|
|
|
<div v-if="mainData.type == 3" id="rich-text-content"></div>
|
|
<div v-if="mainData.type == 3" id="rich-text-content"></div>
|
|
|
- <photoWall
|
|
|
|
|
- v-else
|
|
|
|
|
- :attinfos="mainData.attinfos_pic"
|
|
|
|
|
- :fileType="mainData.type"
|
|
|
|
|
- :disabled="mainData.status == '发布'"
|
|
|
|
|
- pic
|
|
|
|
|
- ownertable="sat_sharematerial"
|
|
|
|
|
- :ownerid="mainData.sat_sharematerialid"
|
|
|
|
|
- @allUploadSuccess="mianData()"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <photoWall v-else :attinfos="mainData.attinfos_pic" :fileType="mainData.type"
|
|
|
|
|
+ :disabled="mainData.status == '发布'" pic ownertable="sat_sharematerial" :ownerid="mainData.sat_sharematerialid"
|
|
|
|
|
+ @allUploadSuccess="mianData()" />
|
|
|
</template>
|
|
</template>
|
|
|
<template #tab1>
|
|
<template #tab1>
|
|
|
<span class="normal-title" style="margin-bottom: 10px">基本信息</span>
|
|
<span class="normal-title" style="margin-bottom: 10px">基本信息</span>
|
|
|
<defaultInfo :data="baseInfo">
|
|
<defaultInfo :data="baseInfo">
|
|
|
<template #封面图>
|
|
<template #封面图>
|
|
|
- <a-image
|
|
|
|
|
- :src="
|
|
|
|
|
- mainData.attinfos.filter((item) => item.usetype == 'avatar')
|
|
|
|
|
- .length
|
|
|
|
|
- ? mainData.attinfos.filter(
|
|
|
|
|
- (item) => item.usetype == 'avatar'
|
|
|
|
|
- )[0].url
|
|
|
|
|
- : ''
|
|
|
|
|
- "
|
|
|
|
|
- style="width: 100px; height: 100px"
|
|
|
|
|
- ></a-image>
|
|
|
|
|
|
|
+ <a-image :src="mainData.attinfos.filter((item) => item.usetype == 'avatar')
|
|
|
|
|
+ .length
|
|
|
|
|
+ ? mainData.attinfos.filter(
|
|
|
|
|
+ (item) => item.usetype == 'avatar'
|
|
|
|
|
+ )[0].url
|
|
|
|
|
+ : ''
|
|
|
|
|
+ " style="width: 100px; height: 100px"></a-image>
|
|
|
</template>
|
|
</template>
|
|
|
</defaultInfo>
|
|
</defaultInfo>
|
|
|
<span class="normal-title" style="margin: 10px 0">系统信息</span>
|
|
<span class="normal-title" style="margin: 10px 0">系统信息</span>
|
|
|
<defaultInfo :data="systemInfo"></defaultInfo>
|
|
<defaultInfo :data="systemInfo"></defaultInfo>
|
|
|
<div style="height: 20px;"></div>
|
|
<div style="height: 20px;"></div>
|
|
|
- <view-range :satSharematerialId="mainData.sat_sharematerialid" :authType="mainData.dataauth?.[0]?.authtype ?? mainData.authtype ?? 1" />
|
|
|
|
|
|
|
+ <view-range :satSharematerialId="mainData.sat_sharematerialid"
|
|
|
|
|
+ :authType="mainData.dataauth?.[0]?.authtype ?? mainData.authtype ?? 1" />
|
|
|
</template>
|
|
</template>
|
|
|
</detail-template>
|
|
</detail-template>
|
|
|
</div>
|
|
</div>
|
|
@@ -157,17 +110,55 @@ const mianData = async () => {
|
|
|
sat_sharematerialid: router.currentRoute.value.query.id,
|
|
sat_sharematerialid: router.currentRoute.value.query.id,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
res.data.attinfos = utils.fileList(res.data.attinfos);
|
|
res.data.attinfos = utils.fileList(res.data.attinfos);
|
|
|
|
|
+
|
|
|
|
|
+ // 记录创建时间早于主数据的附件信息
|
|
|
|
|
+ const mainCreatedate = res.data.createdate;
|
|
|
|
|
+ const excludedAttachments = [];
|
|
|
|
|
+
|
|
|
|
|
+ // 过滤附件:排除创建时间早于主数据的附件
|
|
|
|
|
+ res.data.attinfos = res.data.attinfos.filter(attachment => {
|
|
|
|
|
+ if (attachment.createdate && mainCreatedate) {
|
|
|
|
|
+ const attachmentDate = new Date(attachment.createdate);
|
|
|
|
|
+ const mainDate = new Date(mainCreatedate);
|
|
|
|
|
+ if (attachmentDate < mainDate) {
|
|
|
|
|
+ excludedAttachments.push({
|
|
|
|
|
+ linksid: attachment.linksid,
|
|
|
|
|
+ attachmentid: attachment.attachmentid
|
|
|
|
|
+ });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (excludedAttachments.length > 0) Api.requested({
|
|
|
|
|
+ classname: "system.attachment.Attachment",
|
|
|
|
|
+ method: "deleteFileLink",
|
|
|
|
|
+ id: 10020601,
|
|
|
|
|
+ content: {
|
|
|
|
|
+ linksids: excludedAttachments.map(item => item.linksid)
|
|
|
|
|
+ }
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ console.log('Unlinked attachments:', excludedAttachments.map(item => item.linksid));
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
// 根据 type 筛选对应的文件类型
|
|
// 根据 type 筛选对应的文件类型
|
|
|
- if (res.data.type == 1) {
|
|
|
|
|
- res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType === 'image');
|
|
|
|
|
- } else if (res.data.type == 2) {
|
|
|
|
|
- res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType === 'video');
|
|
|
|
|
- } else if (res.data.type == 3) {
|
|
|
|
|
- // 富文本类型,不显示文件
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (res.data.type == 1) {
|
|
|
|
|
+ res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType === 'image');
|
|
|
|
|
+ } else if (res.data.type == 2) {
|
|
|
|
|
+ res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType === 'video');
|
|
|
|
|
+ } else if (res.data.type == 3) {
|
|
|
|
|
+ // 富文本类型,不显示文件
|
|
|
|
|
+ res.data.attinfos_pic = [];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType !== 'image' && v.fileType !== 'video');
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('Error processing attinfos_pic:', error);
|
|
|
res.data.attinfos_pic = [];
|
|
res.data.attinfos_pic = [];
|
|
|
- } else {
|
|
|
|
|
- res.data.attinfos_pic = res.data.attinfos.filter(v => v.fileType !== 'image' && v.fileType !== 'video');
|
|
|
|
|
}
|
|
}
|
|
|
mainData.value = res.data;
|
|
mainData.value = res.data;
|
|
|
console.log("mainData", mainData.value);
|
|
console.log("mainData", mainData.value);
|
|
@@ -191,9 +182,8 @@ const mianData = async () => {
|
|
|
// { label: "扫码地址", value: mainData.value.qrcodecontent },
|
|
// { label: "扫码地址", value: mainData.value.qrcodecontent },
|
|
|
{
|
|
{
|
|
|
label: "推荐",
|
|
label: "推荐",
|
|
|
- value: `${mainData.value.canshared_c ? "支持对外、" : ""}${
|
|
|
|
|
- mainData.value.candownload_c ? "支持下载" : ""
|
|
|
|
|
- }`,
|
|
|
|
|
|
|
+ value: `${mainData.value.canshared_c ? "支持对外、" : ""}${mainData.value.candownload_c ? "支持下载" : ""
|
|
|
|
|
+ }`,
|
|
|
},
|
|
},
|
|
|
{ label: "状态", value: mainData.value.status },
|
|
{ label: "状态", value: mainData.value.status },
|
|
|
{ label: "封面图", value: "custom" },
|
|
{ label: "封面图", value: "custom" },
|
|
@@ -229,5 +219,4 @@ onMounted(() => {
|
|
|
getClassList();
|
|
getClassList();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
-<style>
|
|
|
|
|
-</style>
|
|
|
|
|
|
|
+<style></style>
|