Merge pull request 'feature/v1.2灵机空间-内容上传审核_rxd' (#32) from feature/v1.2灵机空间-内容上传审核_rxd into main
Reviewed-on: ai-team/lingji-work-fe#32
This commit is contained in:
@ -264,17 +264,19 @@ export default {
|
||||
};
|
||||
|
||||
const getCommentName = (item) => {
|
||||
if (item.commenter_id === 0) {
|
||||
return '佚名';
|
||||
}
|
||||
// 姓名脱敏:保留首尾字符,中间拼接6个****
|
||||
const maskName = (name) => {
|
||||
if (!name || name.length <= 1) return name; // 单字符不脱敏
|
||||
return name[0] + '****' + name[name.length - 1];
|
||||
};
|
||||
|
||||
// 手机号脱敏:保留前3位和后4位,中间4位替换为****
|
||||
const maskMobile = (mobile) => mobile?.replace(/^(\d{3})\d{4}(\d{4})$/, '$1****$2');
|
||||
|
||||
if (item.commenter_id === 0) {
|
||||
return item.commenter?.name ? maskName(item.commenter?.name) : '佚名';
|
||||
}
|
||||
|
||||
const maskedName = maskName(item.commenter?.name);
|
||||
const maskedMobile = maskMobile(item.commenter?.mobile);
|
||||
return maskedName || maskedMobile;
|
||||
|
||||
@ -210,7 +210,7 @@ export default {
|
||||
|
||||
return () => {
|
||||
return (
|
||||
<div class="explore-page">
|
||||
<div class='explore-page'>
|
||||
<header class="page-header">
|
||||
<div class="content w-full px-24px flex items-center bg-#fff justify-between">
|
||||
<div class="h-full flex items-center">
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
.explore-page {
|
||||
position: relative;
|
||||
min-width: 1200px;
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
@ -9,12 +15,6 @@
|
||||
background: #fff;
|
||||
z-index: -1;
|
||||
}
|
||||
position: relative;
|
||||
min-width: 1200px;
|
||||
min-height: 100vh;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.fold-box {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@ -54,11 +54,14 @@
|
||||
}
|
||||
|
||||
.page-wrap {
|
||||
width: calc(100% - 456px);
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background: #fff;
|
||||
&.expand {
|
||||
width: calc(100% - 456px);
|
||||
}
|
||||
.explore-detail-wrap {
|
||||
min-height: 500px;
|
||||
width: 684px;
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'platform'" #cell="{ record }">
|
||||
<template v-if="!PLATFORMS.find((item) => item.value === record.platform)"> - </template>
|
||||
<img v-else width="24" height="24" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" />
|
||||
<img v-else width="24" height="24" class="rounded-4px" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" />
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'compliance_level'" #cell="{ record }">
|
||||
<span class="cts num !color-#6D4CFE">{{
|
||||
|
||||
@ -30,7 +30,7 @@ export const TABLE_COLUMNS1 = [
|
||||
},
|
||||
{
|
||||
title: '上传时间',
|
||||
dataIndex: 'updated_at',
|
||||
dataIndex: 'created_at',
|
||||
width: 180,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
||||
@ -35,7 +35,7 @@ export const TABLE_COLUMNS = [
|
||||
},
|
||||
{
|
||||
title: '上传时间',
|
||||
dataIndex: 'updated_at',
|
||||
dataIndex: 'created_at',
|
||||
width: 180,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
||||
@ -55,6 +55,8 @@ export default {
|
||||
const taskStatus = ref(TASK_STATUS.DEFAULT);
|
||||
const form = ref(cloneDeep(INITIAL_FORM));
|
||||
const works = ref([]);
|
||||
const uploadingFiles = ref([]); // 上传中
|
||||
const uploadSuccessFiles = ref([]); // 上传成功
|
||||
|
||||
// 生成自增 id(基于当前列表中最大的 id)
|
||||
const getNextWorkId = () => {
|
||||
@ -65,8 +67,6 @@ export default {
|
||||
return currentMax + 1;
|
||||
};
|
||||
|
||||
// 剪贴板功能
|
||||
|
||||
const isLink = computed(() => uploadType.value === UPLOAD_TYPE.LINK);
|
||||
const isLocal = computed(() => uploadType.value === UPLOAD_TYPE.LOCAL);
|
||||
const isDefault = computed(() => taskStatus.value === TASK_STATUS.DEFAULT);
|
||||
@ -90,6 +90,8 @@ export default {
|
||||
taskStatus.value = TASK_STATUS.DEFAULT;
|
||||
form.value = cloneDeep(INITIAL_FORM);
|
||||
works.value = [];
|
||||
uploadingFiles.value = [];
|
||||
uploadSuccessFiles.value = [];
|
||||
};
|
||||
|
||||
const open = () => {
|
||||
@ -137,6 +139,8 @@ export default {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
uploadingFiles.value.push(file);
|
||||
|
||||
const { code, data } = await postWorksByFileWriter(formData, {
|
||||
timeout: 0,
|
||||
headers: {
|
||||
@ -145,10 +149,15 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 200) {
|
||||
taskStatus.value = TASK_STATUS.SUCCESS;
|
||||
if (data) {
|
||||
const id = data.id ?? getNextWorkId();
|
||||
works.value.push({ ...data, id });
|
||||
const _data = { ...data, id };
|
||||
works.value.push(_data);
|
||||
uploadSuccessFiles.value.push(_data);
|
||||
}
|
||||
|
||||
if (uploadingFiles.value.length === uploadSuccessFiles.value.length) {
|
||||
taskStatus.value = TASK_STATUS.SUCCESS;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'platform'" #cell="{ record }">
|
||||
<template v-if="!PLATFORMS.find((item) => item.value === record.platform)"> - </template>
|
||||
<img v-else width="24" height="24" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" />
|
||||
<img v-else width="24" height="24" class="rounded-4px" :src="PLATFORMS.find((item) => item.value === record.platform)?.icon" />
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'compliance_level'" #cell="{ record }">
|
||||
<span class="cts num !color-#6D4CFE">{{
|
||||
|
||||
@ -30,7 +30,7 @@ export const TABLE_COLUMNS1 = [
|
||||
},
|
||||
{
|
||||
title: '上传时间',
|
||||
dataIndex: 'updated_at',
|
||||
dataIndex: 'created_at',
|
||||
width: 180,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
||||
@ -40,7 +40,7 @@ export const TABLE_COLUMNS = [
|
||||
},
|
||||
{
|
||||
title: '上传时间',
|
||||
dataIndex: 'updated_at',
|
||||
dataIndex: 'created_at',
|
||||
width: 180,
|
||||
sortable: {
|
||||
sortDirections: ['ascend', 'descend'],
|
||||
|
||||
@ -50,6 +50,8 @@ export default {
|
||||
const uploadType = ref(UPLOAD_TYPE.LINK);
|
||||
const taskStatus = ref(TASK_STATUS.DEFAULT);
|
||||
const form = ref(cloneDeep(INITIAL_FORM));
|
||||
const uploadingFiles = ref([]); // 上传中
|
||||
const uploadSuccessFiles = ref([]); // 上传成功
|
||||
const works = ref([]);
|
||||
|
||||
// 生成自增 id(基于当前列表中最大的 id)
|
||||
@ -87,6 +89,8 @@ export default {
|
||||
taskStatus.value = TASK_STATUS.DEFAULT;
|
||||
form.value = cloneDeep(INITIAL_FORM);
|
||||
works.value = [];
|
||||
uploadingFiles.value = [];
|
||||
uploadSuccessFiles.value = [];
|
||||
};
|
||||
|
||||
const getWriterLink = async () => {
|
||||
@ -160,6 +164,8 @@ export default {
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
uploadingFiles.value.push(file);
|
||||
|
||||
const { code, data } = await postWorksByFile(formData, {
|
||||
timeout: 0,
|
||||
headers: {
|
||||
@ -167,10 +173,15 @@ export default {
|
||||
},
|
||||
});
|
||||
if (code === 200) {
|
||||
taskStatus.value = TASK_STATUS.SUCCESS;
|
||||
if (data) {
|
||||
const id = data.id ?? getNextWorkId();
|
||||
works.value.push({ ...data, id });
|
||||
const _data = { ...data, id };
|
||||
works.value.push(_data);
|
||||
uploadSuccessFiles.value.push(_data);
|
||||
}
|
||||
|
||||
if (uploadingFiles.value.length === uploadSuccessFiles.value.length) {
|
||||
taskStatus.value = TASK_STATUS.SUCCESS;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user