Merge remote-tracking branch 'origin/feature/0915_素材中心新增手动上传' into feature/0918_账号管理新增视图_rxd

# Conflicts:
#	src/layouts/components/navbar/components/right-side/index.vue
This commit is contained in:
rd
2025-09-19 15:23:54 +08:00
16 changed files with 78 additions and 44 deletions

View File

@ -8,18 +8,20 @@
<script setup> <script setup>
import { useUserStore } from '@/stores'; import { useUserStore } from '@/stores';
// import { useChatStore } from '@/stores/modules/chat'; // import { useChatStore } from '@/stores/modules/chat';
import { useRoute } from 'vue-router';
import { initApp } from '@/utils/user'; import { handleUserHome, initApp } from '@/utils/user';
import { useSidebarStore } from '@/stores/modules/side-bar'; import { useSidebarStore } from '@/stores/modules/side-bar';
import { useEnterpriseStore } from '@/stores/modules/enterprise';
import { ConfigProvider } from 'ant-design-vue'; import { ConfigProvider } from 'ant-design-vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN'; import zhCN from 'ant-design-vue/es/locale/zh_CN';
import 'dayjs/locale/zh-cn'; import 'dayjs/locale/zh-cn';
const userStore = useUserStore(); const userStore = useUserStore();
// const route = useRoute(); const route = useRoute();
const sidebarStore = useSidebarStore(); const sidebarStore = useSidebarStore();
// const chatStore = useChatStore(); // const chatStore = useChatStore();
const enterpriseStore = useEnterpriseStore();
const redTheme = { const redTheme = {
token: { token: {
@ -34,6 +36,10 @@ const init = async () => {
// 已开通 // 已开通
if (isLogin) { if (isLogin) {
await initApp(); await initApp();
if (enterpriseStore.isOpenEnterprise && route.name === 'Trial') {
handleUserHome();
}
} else { } else {
sidebarStore.stopUnreadInfoPolling(); sidebarStore.stopUnreadInfoPolling();
} }

View File

@ -28,7 +28,7 @@ export const fetchLogOut = (params = {}) => {
}; };
// 导出一个名为fetchProfileInfo的函数用于获取用户信息 // 导出一个名为fetchProfileInfo的函数用于获取用户信息
export const fetchProfileInfo = (params = {}) => { export const fetchUserInfo = (params = {}) => {
// 使用Http.put方法向/v1/me接口发送put请求并将params作为参数传递 // 使用Http.put方法向/v1/me接口发送put请求并将params作为参数传递
return Http.get('/v1/me', params); return Http.get('/v1/me', params);
}; };

View File

@ -25,12 +25,12 @@
> >
<div class="flex mr-4px overflow-hidden h-24px lh-24px items-center"> <div class="flex mr-4px overflow-hidden h-24px lh-24px items-center">
<div class="cursor-pointer mr-4px"> <div class="cursor-pointer mr-4px">
<Avatar v-if="userInfo.head_image" :size="24" :src="userInfo.head_image" /> <Avatar v-if="userData.head_image" :size="24" :src="userData.head_image" />
<div v-else class="w-24px h-24px rounded-50% bg-#6D4CFE flex items-center justify-center"> <div v-else class="w-24px h-24px rounded-50% bg-#6D4CFE flex items-center justify-center">
<span class="color-#FFF text-11px font-400 lh-20px">{{ userInfo.mobile?.slice(-3) }}</span> <span class="color-#FFF text-11px font-400 lh-20px">{{ userData.mobile?.slice(-3) }}</span>
</div> </div>
</div> </div>
<TextOverTips :context="userInfo.name || userInfo.mobile" /> <TextOverTips :context="userData.name || userData.mobile" />
</div> </div>
<icon-caret-down class="icon-caret color-#939499" size="14" /> <icon-caret-down class="icon-caret color-#939499" size="14" />
@ -75,13 +75,12 @@
<template v-else> <template v-else>
<template v-if="item.audit_status === 1"> <template v-if="item.audit_status === 1">
<div class="px-12px"> <div v-if="enterprises.length > 1" class="px-12px my-8px">
<div v-if="enterprises.length > 1" class="w-full h-1px bg-#E6E6E8 my-8px"></div> <div class="w-full h-1px bg-#E6E6E8"></div>
</div> </div>
<MenuItem class="rounded-8px hover:bg-#F2F3F5 h-36px !mb-0" @click="onCreate(item)"> <MenuItem class="rounded-8px hover:bg-#F2F3F5 h-36px !mb-0" @click="onCreate(item)">
<div class="flex items-center"> <div class="flex items-center">
<SvgIcon class="color-#737478 mr-8px" name="svg-organization" size="16.5" /> <SvgIcon size="16.5" name="svg-organization" class="color-#737478 mr-8px" />
<span class="color-#211F24 mr-4px">创建企业账号</span> <span class="color-#211F24 mr-4px">创建企业账号</span>
<div class="px-8px h-20px rounded-2px bg-#FFF7E5 flex items-center"> <div class="px-8px h-20px rounded-2px bg-#FFF7E5 flex items-center">
<span class="color-#FFAE00 !text-12px !lh-20px font-400">申请中</span> <span class="color-#FFAE00 !text-12px !lh-20px font-400">申请中</span>
@ -93,18 +92,18 @@
<MenuItem class="rounded-8px hover:bg-#F2F3F5" @click="handleSubAccountClick(item)"> <MenuItem class="rounded-8px hover:bg-#F2F3F5" @click="handleSubAccountClick(item)">
<div class="flex justify-between items-center overflow-hidden"> <div class="flex justify-between items-center overflow-hidden">
<div <div
:class="enterpriseInfo?.id === item.id ? '!color-#6D4CFE' : ''"
class="flex items-center w-100% flex-1 overflow-hidden" class="flex items-center w-100% flex-1 overflow-hidden"
:class="enterpriseInfo?.id === item.id ? '!color-#6D4CFE' : ''"
> >
<TextOverTips :context="item.name" /> <TextOverTips :context="item.name" />
<img :src="icon4" class="ml-4px" height="12" width="12" /> <img :src="icon4" width="12" height="12" class="ml-4px" />
</div> </div>
<div <div
v-if="[2, 3].includes(item.subscribe_status)"
:class="_map.get(item.subscribe_status)?.bg"
class="px-8px h-20px rounded-2px flex items-center flex-shrink-0 ml-4px" class="px-8px h-20px rounded-2px flex items-center flex-shrink-0 ml-4px"
:class="_map.get(item.subscribe_status)?.bg"
v-if="[2, 3].includes(item.subscribe_status)"
> >
<span :class="_map.get(item.subscribe_status)?.color" class="!text-12px !lh-20px font-400">{{ <span class="!text-12px !lh-20px font-400" :class="_map.get(item.subscribe_status)?.color">{{
_map.get(item.subscribe_status)?.label _map.get(item.subscribe_status)?.label
}}</span> }}</span>
</div> </div>
@ -187,7 +186,8 @@ const primary_enterprise = computed(() => userStore.userInfo?.primary_enterprise
const enterprises = computed(() => { const enterprises = computed(() => {
return userStore.userInfo?.enterprises ?? []; return userStore.userInfo?.enterprises ?? [];
}); });
const userInfo = computed(() => userStore.userInfo); const userData = computed(() => userStore.userInfo ?? {});
const enterpriseInfo = computed(() => { const enterpriseInfo = computed(() => {
return enterpriseStore?.enterpriseInfo ?? {}; return enterpriseStore?.enterpriseInfo ?? {};
}); });

View File

@ -39,6 +39,7 @@ export const useChatStore = defineStore('chat', {
clearAgentInfo() { clearAgentInfo() {
this.agentInfo = {}; this.agentInfo = {};
this.searchValue = ''; this.searchValue = '';
rlsWithCatch('agentInfo');
}, },
async onCreateSession() { async onCreateSession() {
const { code, data } = await createSession(); const { code, data } = await createSession();

View File

@ -1,5 +1,5 @@
import { fetchEnterpriseInfo } from '@/api/all/login'; import { fetchEnterpriseInfo } from '@/api/all/login';
import { glsWithCatch, slsWithCatch } from '@/utils/stroage'; import { glsWithCatch, slsWithCatch, rlsWithCatch } from '@/utils/stroage';
interface EnterpriseInfo { interface EnterpriseInfo {
id: number | string; id: number | string;
@ -34,7 +34,7 @@ export const useEnterpriseStore = defineStore('enterprise', {
}, },
clearUserEnterpriseInfo() { clearUserEnterpriseInfo() {
this.enterpriseInfo = null; this.enterpriseInfo = null;
localStorage.removeItem('enterpriseInfo'); rlsWithCatch('enterpriseInfo');
}, },
setEnterpriseName(name: string) { setEnterpriseName(name: string) {
if (this.enterpriseInfo) { if (this.enterpriseInfo) {

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { fetchProfileInfo } from '@/api/all/login'; import { fetchUserInfo } from '@/api/all/login';
// import { useSidebarStore } from '@/stores/modules/side-bar'; // import { useSidebarStore } from '@/stores/modules/side-bar';
import { glsWithCatch, rlsWithCatch, slsWithCatch } from '@/utils/stroage'; import { glsWithCatch, rlsWithCatch, slsWithCatch } from '@/utils/stroage';
import { useEnterpriseStore } from '@/stores/modules/enterprise'; import { useEnterpriseStore } from '@/stores/modules/enterprise';
@ -72,7 +72,7 @@ export const useUserStore = defineStore('user', {
async getUserInfo() { async getUserInfo() {
const enterpriseStore = useEnterpriseStore(); const enterpriseStore = useEnterpriseStore();
const { code, data } = await fetchProfileInfo(); const { code, data } = await fetchUserInfo();
if (code === 200) { if (code === 200) {
this.setUserInfo(data); this.setUserInfo(data);

View File

@ -42,9 +42,9 @@ export async function initApp() {
const enterpriseStore = useEnterpriseStore(); const enterpriseStore = useEnterpriseStore();
await userStore.getUserInfo(); // 初始化用户信息 await userStore.getUserInfo(); // 初始化用户信息
await getUserEnterpriseInfo(); // 初始化企业信息
if (enterpriseStore.isOpenEnterprise) { if (enterpriseStore.isOpenEnterprise) {
await getUserEnterpriseInfo(); // 初始化企业信息
chatStore.getAgentInfo(); // 初始化智能体信息 chatStore.getAgentInfo(); // 初始化智能体信息
sidebarStore.startUnreadInfoPolling(); // 初始化未读信息 sidebarStore.startUnreadInfoPolling(); // 初始化未读信息

View File

@ -522,12 +522,6 @@ function reset() {
const emit = defineEmits(['submit']); const emit = defineEmits(['submit']);
</script> </script>
<script>
export default {
name: 'PuzzleVerification',
};
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.vue-puzzle-vcode { .vue-puzzle-vcode {
position: fixed; position: fixed;

View File

@ -105,7 +105,7 @@
import { Button, Checkbox, Form, FormItem, Input, message, Tabs, Typography } from 'ant-design-vue'; import { Button, Checkbox, Form, FormItem, Input, message, Tabs, Typography } from 'ant-design-vue';
import PuzzleVerification from '../PuzzleVerification.vue'; import PuzzleVerification from '../PuzzleVerification.vue';
import SelectAccountModal from '../select-account-modal/index.vue'; import SelectAccountModal from '../select-account-modal/index.vue';
import { fetchAuthorizationsCaptcha, fetchLoginCaptCha, fetchProfileInfo, postLoginPassword } from '@/api/all/login'; import { fetchAuthorizationsCaptcha, fetchLoginCaptCha, fetchUserInfo, postLoginPassword } from '@/api/all/login';
import { postClearRateLimiter } from '@/api/all/common'; import { postClearRateLimiter } from '@/api/all/common';
import { joinEnterpriseByInviteCode } from '@/api/all'; import { joinEnterpriseByInviteCode } from '@/api/all';
import { computed, onUnmounted, reactive, ref } from 'vue'; import { computed, onUnmounted, reactive, ref } from 'vue';
@ -268,7 +268,7 @@ const onTabChange = () => {
// 获取用户信息 // 获取用户信息
const getProfileInfo = async () => { const getProfileInfo = async () => {
const { code, data } = await fetchProfileInfo(); const { code, data } = await fetchUserInfo();
if (code === 200) { if (code === 200) {
const enterprises = data['enterprises']; const enterprises = data['enterprises'];
mobileNumber.value = data['mobile']; mobileNumber.value = data['mobile'];
@ -283,6 +283,7 @@ const getProfileInfo = async () => {
selectAccountModalRef.value.open(); selectAccountModalRef.value.open();
} }
} else { } else {
userStore.setUserInfo(data);
router.push({ name: 'Trial' }); router.push({ name: 'Trial' });
} }
} }

View File

@ -92,7 +92,7 @@ import PuzzleVerification from '../PuzzleVerification.vue';
import SelectAccountModal from '../select-account-modal/index.vue'; import SelectAccountModal from '../select-account-modal/index.vue';
import { postClearRateLimiter } from '@/api/all/common'; import { postClearRateLimiter } from '@/api/all/common';
import { import {
fetchProfileInfo, fetchUserInfo,
postForgetPassword, postForgetPassword,
postForgetPasswordCaptcha, postForgetPasswordCaptcha,
postRegister, postRegister,
@ -295,8 +295,9 @@ const handleVerificationSubmit = async () => {
// 获取用户信息 // 获取用户信息
const getProfileInfo = async () => { const getProfileInfo = async () => {
const { code, data } = await fetchProfileInfo(); const { code, data } = await fetchUserInfo();
if (code === 200) { if (code === 200) {
const enterprises = data['enterprises']; const enterprises = data['enterprises'];
mobileNumber.value = data['mobile']; mobileNumber.value = data['mobile'];
accounts.value = enterprises; accounts.value = enterprises;
@ -311,6 +312,7 @@ const getProfileInfo = async () => {
selectAccountModalRef.value.open(); selectAccountModalRef.value.open();
} }
} else { } else {
userStore.setUserInfo(data);
router.push({ name: 'Trial' }); router.push({ name: 'Trial' });
} }
} }
@ -348,7 +350,7 @@ const handleSubmit = async () => {
}, 1500); }, 1500);
return; return;
} }
;
userStore.setToken(data.access_token); userStore.setToken(data.access_token);

View File

@ -36,11 +36,33 @@ export default defineComponent({
const uploadData = ref([]); const uploadData = ref([]);
const tagData = ref([]); const tagData = ref([]);
const modalRef = ref(null); const modalRef = ref(null);
const isDragOver = ref(false);
const uploadSuccessNum = computed(() => { const uploadSuccessNum = computed(() => {
return uploadData.value.filter((item) => item.uploadStatus === EnumUploadStatus.done).length; return uploadData.value.filter((item) => item.uploadStatus === EnumUploadStatus.done).length;
}); });
// 添加拖拽事件处理函数
const handleDragEnter = (e) => {
e.preventDefault();
isDragOver.value = true;
};
const handleDragOver = (e) => {
e.preventDefault();
isDragOver.value = true;
};
const handleDragLeave = (e) => {
e.preventDefault();
isDragOver.value = false;
};
const handleDrop = (e) => {
e.preventDefault();
isDragOver.value = false;
};
const getTagData = async () => { const getTagData = async () => {
const { code, data } = await getRawMaterialTagsList(); const { code, data } = await getRawMaterialTagsList();
if (code === 200) { if (code === 200) {
@ -137,6 +159,7 @@ export default defineComponent({
modalRef.value?.destroy(); modalRef.value?.destroy();
modalRef.value = null; modalRef.value = null;
submitLoading.value = false; submitLoading.value = false;
isDragOver.value = false;
}; };
const handleUpload = async (option) => { const handleUpload = async (option) => {
@ -246,7 +269,9 @@ export default defineComponent({
}); });
return; return;
} }
const { code, data } = await postBatchRawMaterial({ raw_materials: uploadData.value });
const raw_materials = uploadData.value.filter((item) => item.uploadStatus !== EnumUploadStatus.error);
const { code } = await postBatchRawMaterial({ raw_materials });
if (code === 200) { if (code === 200) {
message.success('上传成功'); message.success('上传成功');
emit('update'); emit('update');
@ -289,7 +314,7 @@ export default defineComponent({
return ( return (
<div> <div>
<p class="upload-text">上传失败</p> <p class="upload-text">上传失败</p>
<span class="upload-text color-#F64B31">{record.statusText}</span> <p class="upload-text !color-#F64B31">{record.statusText}</p>
</div> </div>
); );
} }
@ -460,6 +485,7 @@ export default defineComponent({
rootClassName="xt-add-raw-material-modal" rootClassName="xt-add-raw-material-modal"
v-model:open={visible.value} v-model:open={visible.value}
onClose={onClose} onClose={onClose}
maskClosable={false}
> >
<section class="content flex-1 pt-8px px-24px pb-24px overflow-hidden flex flex-col"> <section class="content flex-1 pt-8px px-24px pb-24px overflow-hidden flex flex-col">
<div class="rounded-16px bg-#F7F8FA p-16px flex flex-col items-center mb-24px"> <div class="rounded-16px bg-#F7F8FA p-16px flex flex-col items-center mb-24px">
@ -469,10 +495,17 @@ export default defineComponent({
multiple multiple
customRequest={handleUpload} customRequest={handleUpload}
class="w-full mb-16px" class="w-full mb-16px"
accept={[...imageExtensions, ...videoExtensions, ...documentExtensions].join(',')}
showUploadList={false} showUploadList={false}
> >
<div class="upload-box rounded-8px cursor-pointer h-100px w-full border border-dashed border-#D7D7D9 flex flex-col items-center justify-center w-full"> <div
class={`upload-box rounded-8px cursor-pointer h-100px w-full border border-dashed border-#D7D7D9 flex flex-col items-center justify-center w-full ${
isDragOver.value ? 'bg-#F0EDFF' : 'bg-#F7F8FA'
}`}
onDragenter={handleDragEnter}
onDragover={handleDragOver}
onDragleave={handleDragLeave}
onDrop={handleDrop}
>
<icon-plus size="14" class="mb-10px color-#55585F" /> <icon-plus size="14" class="mb-10px color-#55585F" />
<span class="cts">点击或拖拽文件到此处上传</span> <span class="cts">点击或拖拽文件到此处上传</span>
</div> </div>

View File

@ -17,7 +17,9 @@ import { Button, Modal, message } from 'ant-design-vue';
import { deleteRawMaterial, batchDeleteRawMaterials } from '@/api/all/generationWorkshop'; import { deleteRawMaterial, batchDeleteRawMaterials } from '@/api/all/generationWorkshop';
import icon1 from '@/assets/img/media-account/icon-warn-1.png'; import icon1 from '@/assets/img/media-account/icon-warn-1.png';
const update = inject('update'); // const update = inject('update');
const emits = defineEmits(['update', 'batchUpdate']);
const visible = ref(false); const visible = ref(false);
const fileId = ref(null); const fileId = ref(null);

View File

@ -94,7 +94,7 @@ import { ref, computed } from 'vue';
import { Button, Tooltip, Table, Tag } from 'ant-design-vue'; import { Button, Tooltip, Table, Tag } from 'ant-design-vue';
const { Column } = Table; const { Column } = Table;
import { formatTableField, exactFormatTime, formatFileSize, downloadByUrl } from '@/utils/tools'; import { formatTableField, exactFormatTime, formatFileSize, downloadByUrl } from '@/utils/tools';
import { slsWithCatch } from '@/utils/stroage.ts'; // import { slsWithCatch } from '@/utils/stroage.ts';
import { TABS_LIST, ORIGIN_LIST, RawMaterialType } from '../../constants'; import { TABS_LIST, ORIGIN_LIST, RawMaterialType } from '../../constants';
import TextOverTips from '@/components/text-over-tips'; import TextOverTips from '@/components/text-over-tips';

View File

@ -132,7 +132,6 @@ import ImgLazyLoad from '@/components/img-lazy-load';
import icon1 from '@/assets/img/media-account/icon-delete.png'; import icon1 from '@/assets/img/media-account/icon-delete.png';
import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png'; import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png';
import icon3 from '@/assets/img/creative-generation-workshop/icon-video.png'; import icon3 from '@/assets/img/creative-generation-workshop/icon-video.png';
import { ORIGIN_LIST } from '@/views/material-center/components/raw-material/constants';
// import icon4 from '@/assets/img/error-img.png'; // import icon4 from '@/assets/img/error-img.png';
const emits = defineEmits(['sorterChange', 'delete', 'select', 'selectAll']); const emits = defineEmits(['sorterChange', 'delete', 'select', 'selectAll']);

View File

@ -1,4 +1,3 @@
<script src="../../../../../../material-center/components/finished-products/manuscript/check-list/constants.ts"></script>
<script lang="jsx"> <script lang="jsx">
import axios from 'axios'; import axios from 'axios';
import { Button, Form, FormItem, Input, message, Upload } from 'ant-design-vue'; import { Button, Form, FormItem, Input, message, Upload } from 'ant-design-vue';
@ -12,8 +11,6 @@ import { formatFileSize, getVideoInfo, formatDuration, formatUploadSpeed } from
import { EnumManuscriptType } from '@/views/writer-material-center/components/finished-products/manuscript/list/constants.ts'; import { EnumManuscriptType } from '@/views/writer-material-center/components/finished-products/manuscript/list/constants.ts';
import { getVideoPreSignedUrlWriter, getImagePreSignedUrlWriter } from '@/api/all/generationWorkshop-writer'; import { getVideoPreSignedUrlWriter, getImagePreSignedUrlWriter } from '@/api/all/generationWorkshop-writer';
// import icon1 from '@/assets/img/creative-generation-workshop/icon-close.png';
// 表单验证规则 // 表单验证规则
const FORM_RULES = { const FORM_RULES = {
title: [{ required: true, message: '请输入标题' }], title: [{ required: true, message: '请输入标题' }],

View File

@ -104,7 +104,6 @@ import ImgLazyLoad from '@/components/img-lazy-load';
import icon1 from '@/assets/img/media-account/icon-delete.png'; import icon1 from '@/assets/img/media-account/icon-delete.png';
import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png'; import icon2 from '@/assets/img/creative-generation-workshop/icon-photo.png';
import icon3 from '@/assets/img/creative-generation-workshop/icon-video.png'; import icon3 from '@/assets/img/creative-generation-workshop/icon-video.png';
import { ORIGIN_LIST } from '@/views/material-center/components/raw-material/constants';
// import icon4 from '@/assets/img/error-img.png'; // import icon4 from '@/assets/img/error-img.png';
const emits = defineEmits(['edit', 'sorterChange', 'delete']); const emits = defineEmits(['edit', 'sorterChange', 'delete']);