tanshanming 8 mēneši atpakaļ
vecāks
revīzija
50d911e75e

+ 2 - 1
.env.development

@@ -5,7 +5,8 @@ NODE_ENV = development
 VITE_TITLE = Snowy
 
 # 接口地址
-VITE_API_BASEURL = http://localhost:9003
+VITE_API_BASEURL = http://192.168.31.80:9003
+# VITE_API_BASEURL = http://192.168.31.6:9003
 
 # 本地端口
 VITE_PORT = 9000

+ 30 - 1
src/config/reSource.js

@@ -1,4 +1,33 @@
 const config = {
-	baseContext: '/api/webapp'
+	/**
+	 * @description 域名
+	 *              区分生产环境和开发环境,用来存放session及一些用户配置信息(左侧菜单栏是否收缩等)
+	 *              冒号之前配置生产环境域名
+	 *              冒号之后配置开发环境域名,开发环境域名默认使用主机名
+	 */
+	domain:
+		process.env.NODE_ENV === 'production'
+			? location.host.indexOf('.qiwenshare.com') !== -1
+				? '.qiwenshare.com'
+				: ''
+			: location.hostname,
+	/**
+	 * 网站名称
+	 */
+	siteName:
+		process.env.NODE_ENV === 'production' && location.host.indexOf('.qiwenshare.com') !== -1 ? '奇文网盘' : '网盘名称',
+	/**
+	 * 请求后台接口 URL 代理时的上下文
+	 * @description 仅适用于本地开发环境代理时使用,
+	 * 生产环境需要在 nginx 配置中将 /api/ 代理到生产环境后台地址
+	 * 对应 vue.config.js 中配置的 devServer.proxy 中的代理之一
+	 * 若修改了此值,请同步修改 vue.config.js 中 devServer.proxy 对应的值
+	 */
+	baseContext: '/api/webapp',
+	/**
+	 * 存放 token 时的命名方式
+	 */
+	tokenKeyName: 'token'
 }
+
 export default config

+ 41 - 17
src/libs/globalFunction/file.js

@@ -1,10 +1,17 @@
 import * as Vue from 'vue'
+import { getCurrentInstance } from 'vue' // 添加这一行
 import router from '@/router'
 import config from '@/config/reSource'
 import { message } from 'ant-design-vue'
 import { fileImgMap, unknownImg, fileSuffixCodeModeMap, markdownFileType } from '@/libs/map.js'
 import { officeFileType } from '@/libs/map.js'
 
+// 获取全局属性的辅助函数
+function getGlobalProperties() {
+	const instance = getCurrentInstance()
+	return instance ? instance.appContext.config.globalProperties : null
+}
+
 // 全局函数 - 文件相关
 const fileFunction = {
 	/**
@@ -203,7 +210,7 @@ const fileFunction = {
 	handleImgPreview(currentIndex, imgInfo = {}, imgInfoList = []) {
 		// 图片分类下 - 传递整个页面的图片列表;非图片分类下 - 由单个图片构建图片列表
 		const imgList =
-			Number(router.currentRoute.query.fileType) === 1
+			Number(router.currentRoute.value.query.fileType.fileType) === 1
 				? imgInfoList.map((item) => {
 						return {
 							...item,
@@ -218,8 +225,11 @@ const fileFunction = {
 							downloadLink: this.getDownloadFilePath(imgInfo)
 						}
 				  ]
-		const defaultIndex = Number(router.currentRoute.query.fileType) === 1 ? currentIndex : 0
-		Vue.prototype.$openBox.imgPreview({ imgList, defaultIndex })
+		const defaultIndex = Number(router.currentRoute.value.query.fileType.fileType) === 1 ? currentIndex : 0
+		const globalProps = getGlobalProperties()
+		if (globalProps) {
+			globalProps.$openBox.imgPreview({ imgList, defaultIndex })
+		}
 	},
 	/**
 	 * 视频预览
@@ -230,7 +240,7 @@ const fileFunction = {
 	handleVideoPreview(currentIndex, videoInfo = {}, videoInfoList = []) {
 		// 视频分类下 - 传递整个页面的视频列表;非视频分类下 - 由单个视频构建视频列表
 		const videoList =
-			Number(router.currentRoute.query.fileType) === 3
+			Number(router.currentRoute.value.query.fileType.fileType) === 3
 				? videoInfoList.map((item) => {
 						return {
 							...item,
@@ -245,8 +255,11 @@ const fileFunction = {
 							downloadLink: this.getDownloadFilePath(videoInfo)
 						}
 				  ]
-		const defaultIndex = Number(router.currentRoute.query.fileType) === 3 ? currentIndex : 0
-		Vue.prototype.$openBox.videoPreview({ videoList, defaultIndex })
+		const defaultIndex = Number(router.currentRoute.value.query.fileType.fileType) === 3 ? currentIndex : 0
+		const globalProps = getGlobalProperties()
+		if (globalProps) {
+			globalProps.$openBox.videoPreview({ videoList, defaultIndex })
+		}
 	},
 	/**
 	 * 音频预览
@@ -257,7 +270,7 @@ const fileFunction = {
 	handleAudioPreview(currentIndex, audioInfo = {}, audioInfoList = []) {
 		// 音频分类下 - 传递整个页面的音频列表;非音频分类下 - 由单个音频构建音频列表
 		const audioList =
-			Number(router.currentRoute.query.fileType) === 4
+			Number(router.currentRoute.value.query.fileType.fileType) === 4
 				? audioInfoList.map((item) => {
 						return {
 							...item,
@@ -272,8 +285,11 @@ const fileFunction = {
 							downloadLink: this.getDownloadFilePath(audioInfo)
 						}
 				  ]
-		const defaultIndex = Number(router.currentRoute.query.fileType) === 4 ? currentIndex : 0
-		Vue.prototype.$openBox.audioPreview({ audioList, defaultIndex })
+		const defaultIndex = Number(router.currentRoute.value.query.fileType.fileType) === 4 ? currentIndex : 0
+		const globalProps = getGlobalProperties()
+		if (globalProps) {
+			globalProps.$openBox.audioPreview({ audioList, defaultIndex })
+		}
 	},
 	/**
 	 * 文件预览
@@ -283,20 +299,21 @@ const fileFunction = {
 	 * @param {array} fileList 文件列表
 	 */
 	handleFileNameClick(row, currentIndex, fileList = []) {
+		console.log('查看')
 		// 如果当前文件在回收站中,则不允许预览
 		if (row.deleteFlag !== undefined && row.deleteFlag !== 0) {
 			return false
 		}
 		// 若是文件夹则进入该文件夹
 		if (row.isDir) {
-			if (router.currentRoute.name === 'Share') {
+			if (router.currentRoute.value.name === 'Share') {
 				// 当前是查看他人分享列表的页面
 				router.push({
 					query: {
 						filePath: `${row.shareFilePath === '/' ? '' : row.shareFilePath}/${row.fileName}`
 					}
 				})
-			} else if (Number(router.currentRoute.query.fileType) === 8) {
+			} else if (Number(router.currentRoute.value.query.fileType) === 8) {
 				// 当前是我的已分享列表页面
 				router.push({
 					query: {
@@ -305,7 +322,7 @@ const fileFunction = {
 						shareBatchNum: row.shareBatchNum
 					}
 				})
-			} else if (Number(router.currentRoute.query.fileType) !== 6) {
+			} else if (Number(router.currentRoute.value.query.fileType) !== 6) {
 				// 回收站页面不允许打开文件夹
 				// 网盘页面
 				router.push({
@@ -340,15 +357,22 @@ const fileFunction = {
 			}
 			// 无格式文件也可以在线编辑
 			if (fileSuffixCodeModeMap.has(codeFileSuffix) || (row.isDir === 0 && row.extendName === '')) {
-				Vue.prototype.$openBox.codePreview({ fileInfo: row, isEdit: false })
+				const globalProps = getGlobalProperties()
+				if (globalProps) {
+					globalProps.$openBox.codePreview({ fileInfo: row, isEdit: false })
+				}
+
 				return false
 			}
 			//  若当前点击项是 markdown 文档
 			if (markdownFileType.includes(row.extendName.toLowerCase())) {
-				Vue.prototype.$openBox.markdownPreview({
-					fileInfo: row,
-					editable: false
-				})
+				const globalProps = getGlobalProperties()
+				if (globalProps) {
+					globalProps.$openBox.markdownPreview({
+						fileInfo: row,
+						editable: false
+					})
+				}
 				return false
 			}
 			//  若当前点击项是视频mp4格式

+ 58 - 59
src/libs/map.js

@@ -5,69 +5,68 @@
 /**
  * 未知文件类型图标
  */
-export const unknownImg = import('@/assets/images/myResource/file/file_unknown.png')
-console.log('unknownImg==', unknownImg.default)
+export const unknownImg = new URL('@/assets/images/myResource/file/file_unknown.png', import.meta.url).href
 /**
  * 文件类型图标 Map 映射
  */
 export const fileImgMap = new Map([
-	['avi', import('@/assets/images/myResource/file/file_avi.png')],
-	['bat', import('@/assets/images/myResource/file/file_powershell.png')],
-	// ['c', import('@/assets/images/myResource/file/file_c.png')],
-	// ['c++', import('@/assets/images/myResource/file/file_c++.png')],
-	// ['c#', import('@/assets/images/myResource/file/file_c#.png')],
-	['css', import('@/assets/images/myResource/file/file_css.png')],
-	['go', import('@/assets/images/myResource/file/file_go.png')],
-	['py', import('@/assets/images/myResource/file/file_python.png')],
-	['styl', import('@/assets/images/myResource/file/file_stylus.png')],
-	['less', import('@/assets/images/myResource/file/file_less.png')],
-	['conf', import('@/assets/images/myResource/file/file_nginx.png')],
-	['m', import('@/assets/images/myResource/file/file_objective_c.png')],
-	['scss', import('@/assets/images/myResource/file/file_scss.png')],
-	['sass', import('@/assets/images/myResource/file/file_sass.png')],
-	['csv', import('@/assets/images/myResource/file/file_csv.png')],
-	['dmg', import('@/assets/images/myResource/file/file_dmg.png')],
-	['dir', import('@/assets/images/myResource/file/dir.png')],
-	['doc', import('@/assets/images/myResource/file/file_word.svg')],
-	['docx', import('@/assets/images/myResource/file/file_word.svg')],
-	['exe', import('@/assets/images/myResource/file/file_exe.png')],
-	['html', import('@/assets/images/myResource/file/file_html.png')],
-	['jar', import('@/assets/images/myResource/file/file_jar.png')],
-	['java', import('@/assets/images/myResource/file/file_java.png')],
-	['js', import('@/assets/images/myResource/file/file_js.png')],
-	['json', import('@/assets/images/myResource/file/file_json.png')],
-	['jsp', import('@/assets/images/myResource/file/file_jsp.png')],
-	['kt', import('@/assets/images/myResource/file/file_kotlin.png')],
-	['mp3', import('@/assets/images/myResource/file/file_music.png')],
-	['flac', import('@/assets/images/myResource/file/file_flac.svg')],
-	['oa', import('@/assets/images/myResource/file/file_oa.png')],
-	['open', import('@/assets/images/myResource/file/file_open.png')],
-	['pdf', import('@/assets/images/myResource/file/file_pdf.png')],
-	['php', import('@/assets/images/myResource/file/file_php.png')],
-	['ppt', import('@/assets/images/myResource/file/file_ppt.svg')],
-	['pptx', import('@/assets/images/myResource/file/file_ppt.svg')],
-	['properties', import('@/assets/images/myResource/file/file_properties.png')],
-	['r', import('@/assets/images/myResource/file/file_r.png')],
-	['rar', import('@/assets/images/myResource/file/file_rar.png')],
-	['rs', import('@/assets/images/myResource/file/file_rust.png')],
-	['rtf', import('@/assets/images/myResource/file/file_rtf.png')],
-	['sh', import('@/assets/images/myResource/file/file_shell.png')],
-	['sql', import('@/assets/images/myResource/file/file_sql.png')],
-	['svg', import('@/assets/images/myResource/file/file_svg.png')],
-	['swift', import('@/assets/images/myResource/file/file_swift.png')],
-	['ts', import('@/assets/images/myResource/file/file_typescript.png')],
-	['txt', import('@/assets/images/myResource/file/file_txt.png')],
-	['vue', import('@/assets/images/myResource/file/file_vue.png')],
-	['xls', import('@/assets/images/myResource/file/file_excel.svg')],
-	['xlsx', import('@/assets/images/myResource/file/file_excel.svg')],
-	['xml', import('@/assets/images/myResource/file/file_xml.png')],
-	['zip', import('@/assets/images/myResource/file/file_zip.png')],
-	['7z', import('@/assets/images/myResource/file/file_7z.svg')],
-	['tar', import('@/assets/images/myResource/file/file_tar.svg')],
-	['md', import('@/assets/images/myResource/file/file_markdown.png')],
-	['markdown', import('@/assets/images/myResource/file/file_markdown.png')],
-	['yaml', import('@/assets/images/myResource/file/file_yaml.png')],
-	['yml', import('@/assets/images/myResource/file/file_yaml.png')]
+	['avi', new URL('@/assets/images/myResource/file/file_avi.png', import.meta.url).href],
+	['bat', new URL('@/assets/images/myResource/file/file_powershell.png', import.meta.url).href],
+	['c', new URL('@/assets/images/myResource/file/file_c.png', import.meta.url).href],
+	['c++', new URL('@/assets/images/myResource/file/file_c++.png', import.meta.url).href],
+	['c#', new URL('@/assets/images/myResource/file/file_c#.png', import.meta.url).href],
+	['css', new URL('@/assets/images/myResource/file/file_css.png', import.meta.url).href],
+	['go', new URL('@/assets/images/myResource/file/file_go.png', import.meta.url).href],
+	['py', new URL('@/assets/images/myResource/file/file_python.png', import.meta.url).href],
+	['styl', new URL('@/assets/images/myResource/file/file_stylus.png', import.meta.url).href],
+	['less', new URL('@/assets/images/myResource/file/file_less.png', import.meta.url).href],
+	['conf', new URL('@/assets/images/myResource/file/file_nginx.png', import.meta.url).href],
+	['m', new URL('@/assets/images/myResource/file/file_objective_c.png', import.meta.url).href],
+	['scss', new URL('@/assets/images/myResource/file/file_scss.png', import.meta.url).href],
+	['sass', new URL('@/assets/images/myResource/file/file_sass.png', import.meta.url).href],
+	['csv', new URL('@/assets/images/myResource/file/file_csv.png', import.meta.url).href],
+	['dmg', new URL('@/assets/images/myResource/file/file_dmg.png', import.meta.url).href],
+	['dir', new URL('@/assets/images/myResource/file/dir.png', import.meta.url).href],
+	['doc', new URL('@/assets/images/myResource/file/file_word.svg', import.meta.url).href],
+	['docx', new URL('@/assets/images/myResource/file/file_word.svg', import.meta.url).href],
+	['exe', new URL('@/assets/images/myResource/file/file_exe.png', import.meta.url).href],
+	['html', new URL('@/assets/images/myResource/file/file_html.png', import.meta.url).href],
+	['jar', new URL('@/assets/images/myResource/file/file_jar.png', import.meta.url).href],
+	['java', new URL('@/assets/images/myResource/file/file_java.png', import.meta.url).href],
+	['js', new URL('@/assets/images/myResource/file/file_js.png', import.meta.url).href],
+	['json', new URL('@/assets/images/myResource/file/file_json.png', import.meta.url).href],
+	['jsp', new URL('@/assets/images/myResource/file/file_jsp.png', import.meta.url).href],
+	['kt', new URL('@/assets/images/myResource/file/file_kotlin.png', import.meta.url).href],
+	['mp3', new URL('@/assets/images/myResource/file/file_music.png', import.meta.url).href],
+	['flac', new URL('@/assets/images/myResource/file/file_flac.svg', import.meta.url).href],
+	['oa', new URL('@/assets/images/myResource/file/file_oa.png', import.meta.url).href],
+	['open', new URL('@/assets/images/myResource/file/file_open.png', import.meta.url).href],
+	['pdf', new URL('@/assets/images/myResource/file/file_pdf.png', import.meta.url).href],
+	['php', new URL('@/assets/images/myResource/file/file_php.png', import.meta.url).href],
+	['ppt', new URL('@/assets/images/myResource/file/file_ppt.svg', import.meta.url).href],
+	['pptx', new URL('@/assets/images/myResource/file/file_ppt.svg', import.meta.url).href],
+	['properties', new URL('@/assets/images/myResource/file/file_properties.png', import.meta.url).href],
+	['r', new URL('@/assets/images/myResource/file/file_r.png', import.meta.url).href],
+	['rar', new URL('@/assets/images/myResource/file/file_rar.png', import.meta.url).href],
+	['rs', new URL('@/assets/images/myResource/file/file_rust.png', import.meta.url).href],
+	['rtf', new URL('@/assets/images/myResource/file/file_rtf.png', import.meta.url).href],
+	['sh', new URL('@/assets/images/myResource/file/file_shell.png', import.meta.url).href],
+	['sql', new URL('@/assets/images/myResource/file/file_sql.png', import.meta.url).href],
+	['svg', new URL('@/assets/images/myResource/file/file_svg.png', import.meta.url).href],
+	['swift', new URL('@/assets/images/myResource/file/file_swift.png', import.meta.url).href],
+	['ts', new URL('@/assets/images/myResource/file/file_typescript.png', import.meta.url).href],
+	['txt', new URL('@/assets/images/myResource/file/file_txt.png', import.meta.url).href],
+	['vue', new URL('@/assets/images/myResource/file/file_vue.png', import.meta.url).href],
+	['xls', new URL('@/assets/images/myResource/file/file_excel.svg', import.meta.url).href],
+	['xlsx', new URL('@/assets/images/myResource/file/file_excel.svg', import.meta.url).href],
+	['xml', new URL('@/assets/images/myResource/file/file_xml.png', import.meta.url).href],
+	['zip', new URL('@/assets/images/myResource/file/file_zip.png', import.meta.url).href],
+	['7z', new URL('@/assets/images/myResource/file/file_7z.svg', import.meta.url).href],
+	['tar', new URL('@/assets/images/myResource/file/file_tar.svg', import.meta.url).href],
+	['md', new URL('@/assets/images/myResource/file/file_markdown.png', import.meta.url).href],
+	['markdown', new URL('@/assets/images/myResource/file/file_markdown.png', import.meta.url).href],
+	['yaml', new URL('@/assets/images/myResource/file/file_yaml.png', import.meta.url).href],
+	['yml', new URL('@/assets/images/myResource/file/file_yaml.png', import.meta.url).href]
 ])
 
 /**

+ 0 - 1
src/main.js

@@ -17,6 +17,5 @@ app.use(Antd)
 app.use(i18n)
 app.use(snowy)
 app.use(uploader)
-
 // 挂载app
 app.mount('#app')

+ 2 - 0
src/snowy.js

@@ -10,6 +10,7 @@
  */
 import * as antdvIcons from '@ant-design/icons-vue'
 import config from './config'
+import reSourceConfig from './config/reSource'
 import tool from './utils/tool'
 import { hasPerm } from './utils/permission/index'
 import errorHandler from './utils/errorHandler'
@@ -29,6 +30,7 @@ export default {
 	install(app) {
 		// 挂载全局对象
 		app.config.globalProperties.$CONFIG = config
+		app.config.globalProperties.$RESOURCE_CONFIG = reSourceConfig
 		app.config.globalProperties.$TOOL = tool
 		app.config.globalProperties.hasPerm = hasPerm
 		console.log('globalFunction==', globalFunction)

+ 2 - 1
src/style/myResource/varibles.less

@@ -44,4 +44,5 @@
 @text-secondary-color: #909399;
 @Warning: #E6A23C;
 @scrollbar-thumb-color: #909399;
-@scrollbar-track-color: #EBEEF5;
+@scrollbar-track-color: #EBEEF5;
+@primary-hover: #ecf5ff;

+ 3 - 1
src/views/myResource/common/FileTable.vue

@@ -318,6 +318,7 @@
 	const customRow = (record, index) => {
 		return {
 			onContextmenu: (event) => {
+				console.log('邮件右键事件', record, index)
 				// 阻止右键事件冒泡
 				event.cancelBubble = true
 				// xs 以上的屏幕
@@ -328,7 +329,8 @@
 					proxy.$openBox
 						.contextMenu({
 							selectedFile: record,
-							domEvent: event
+							domEvent: event,
+							serviceEl: proxy
 						})
 						.then((res) => {
 							// multipleTableRef.value.setCurrentRow(); //  取消当前选中行

+ 298 - 330
src/views/myResource/file/box/contextMenu/Box.vue

@@ -1,6 +1,6 @@
 <template>
 	<!-- 右键列表 -->
-	<transition name="el-fade-in-linear">
+	<transition name="fade">
 		<!-- 在某个文件上右键 -->
 		<ul
 			class="right-menu-list"
@@ -9,83 +9,79 @@
 			v-if="selectedFile !== undefined"
 			:style="`top: ${rightMenu.top};right: ${rightMenu.right};bottom: ${rightMenu.bottom};left: ${rightMenu.left};`"
 		>
-			<li
-				class="right-menu-item"
-				@click="fileHelper.handleFileNameClick(selectedFile, 0, [selectedFile])"
-				v-if="seeBtnShow"
-			>
-				<i class="el-icon-view"></i> 查看
+			<li class="right-menu-item" @click="$file.handleFileNameClick(selectedFile, 0, [selectedFile])" v-if="seeBtnShow">
+				<eye-outlined /> 查看
 			</li>
 			<li class="right-menu-item" @click="handleDeleteFileBtnClick(selectedFile)" v-if="deleteBtnShow">
-				<i class="el-icon-delete"></i> 删除
+				<delete-outlined /> 删除
 			</li>
 			<li class="right-menu-item" @click="handleRestoreFileBtnClick(selectedFile)" v-if="restoreBtnShow">
-				<i class="el-icon-refresh-left"></i> 还原
+				<rollback-outlined /> 还原
 			</li>
 			<li class="right-menu-item" @click="handleCopyFileBtnClick(selectedFile)" v-if="copyBtnShow">
-				<i class="el-icon-copy-document"></i> 复制到
+				<copy-outlined /> 复制到
 			</li>
 			<li class="right-menu-item" @click="handleMoveFileBtnClick(selectedFile)" v-if="moveBtnShow">
-				<i class="el-icon-s-promotion"></i> 移动
+				<export-outlined /> 移动
 			</li>
-			<li class="right-menu-item" @click="handleAddMyFileList(selectedFile)" v-if="addMyFileListBtnShow">
-				<i class="el-icon-edit-outline"></i> 添加至我的云盘
-			</li>
-
-			<li class="right-menu-item" @click="handleEnterpriseDisk(selectedFile)" v-if="addEnterpriseDiskBtnShow">
-				<i class="el-icon-edit-outline"></i> 添加至企业云盘
-			</li>
-
 			<li class="right-menu-item" @click="handleRenameFileBtnClick(selectedFile)" v-if="renameBtnShow">
-				<i class="el-icon-edit-outline"></i> 重命名
+				<edit-outlined /> 重命名
 			</li>
 			<li class="right-menu-item" @click="handleShareFileBtnClick(selectedFile)" v-if="shareBtnShow">
-				<i class="el-icon-share"></i> 分享
+				<share-alt-outlined /> 分享
 			</li>
-			<li class="right-menu-item" @click="visible = false" v-if="downloadBtnShow">
+			<!-- <li class="right-menu-item" @click="visible = false" v-if="downloadBtnShow">
 				<a
-					@click="geta1(fileHelper.getDownloadFilePath(selectedFile))"
-					id="aaaa"
 					target="_blank"
 					style="display: block; color: inherit"
-					:href="fileHelper.getDownloadFilePath(selectedFile)"
+					:href="$file.getDownloadFilePath(selectedFile)"
 					:download="selectedFile.fileName + '.' + selectedFile.extendName"
 				>
-					<i class="el-icon-download"></i> 下载
+					<download-outlined /> 下载
 				</a>
-			</li>
+			</li> -->
 			<!-- 0-解压到当前文件夹, 1-自动创建该文件名目录,并解压到目录里, 3-手动选择解压目录 -->
 			<li class="right-menu-item unzip-menu-item" v-if="unzipBtnShow">
-				<i class="el-icon-files"></i> 解压缩
-				<i class="el-icon-arrow-right"></i>
+				<folder-outlined /> 解压缩
+				<right-outlined />
 				<ul
 					class="unzip-list"
 					:style="`top: ${unzipMenu.top};bottom: ${unzipMenu.bottom};left: ${unzipMenu.left};right: ${unzipMenu.right};`"
 				>
 					<li class="unzip-item" @click="handleUnzipFileBtnClick(selectedFile, 0)">
-						<i class="el-icon-files"></i> 解压到当前文件夹
+						<folder-outlined /> 解压到当前文件夹
 					</li>
 					<li
 						class="unzip-item"
 						@click="handleUnzipFileBtnClick(selectedFile, 1)"
 						:title="`解压到&quot;${selectedFile.fileName}&quot;`"
 					>
-						<i class="el-icon-files"></i> 解压到"{{ selectedFile.fileName }}"
+						<folder-outlined /> 解压到"{{ selectedFile.fileName }}"
 					</li>
 					<li class="unzip-item" @click="handleUnzipFileBtnClick(selectedFile, 2)">
-						<i class="el-icon-files"></i> 解压到目标文件夹
+						<folder-outlined /> 解压到目标文件夹
 					</li>
 				</ul>
 			</li>
-			<li
+			<!-- <li
 				class="right-menu-item"
-				@click="fileHelper.copyShareLink(selectedFile.shareBatchNum, selectedFile.extractionCode)"
-				v-if="copyLinkBtnShow"
+				@click="handleClickFolderEdit"
+				v-if="folderEditBtnShow"
 			>
-				<i class="el-icon-edit"></i> 复制链接
+				<edit-outlined /> 编辑文件夹
+			</li> -->
+			<li class="right-menu-item" @click="handleClickFileEdit(selectedFile)" v-if="onlineEditBtnShow">
+				<edit-outlined /> 在线编辑
 			</li>
+			<!-- <li
+				class="right-menu-item"
+				@click="$file.copyShareLink(selectedFile.shareBatchNum, selectedFile.extractionCode)"
+				v-if="copyLinkBtnShow"
+			>
+				<edit-outlined /> 复制链接
+			</li> -->
 			<li class="right-menu-item" @click="handleShowDetailInfo(selectedFile)" v-if="detailInfoBtnShow">
-				<i class="el-icon-document"></i> 文件详情
+				<file-outlined /> 文件详情
 			</li>
 		</ul>
 		<!-- 在空白处右键,右键列表展示新建文件夹、新建文件等操作按钮 -->
@@ -96,58 +92,68 @@
 			v-else
 			:style="`top: ${rightMenu.top};right: ${rightMenu.right};bottom: ${rightMenu.bottom};left: ${rightMenu.left};`"
 		>
-			<li class="right-menu-item" @click="callback('confirm')"><i class="el-icon-refresh"></i> 刷新</li>
+			<li class="right-menu-item" @click="callback('confirm')"><reload-outlined /> 刷新</li>
 			<template v-if="fileType === 0">
 				<a-divider />
-				<li class="right-menu-item" @click="handleClickAddFolderBtn"><i class="el-icon-folder-add"></i> 新建文件夹</li>
-				<!-- 图片路径需要修改 -->
+				<li class="right-menu-item" @click="handleClickAddFolderBtn"><folder-add-outlined /> 新建文件夹</li>
 				<li class="right-menu-item" @click="handleCreateFile('docx')"><img :src="wordImg" />新建 Word 文档</li>
 				<li class="right-menu-item" @click="handleCreateFile('xlsx')"><img :src="excelImg" />新建 Excel 工作表</li>
 				<li class="right-menu-item" @click="handleCreateFile('pptx')"><img :src="pptImg" />新建 PPT 演示文稿</li>
 				<a-divider />
-				<li class="right-menu-item" @click="handleUploadFileBtnClick(1)"><i class="el-icon-upload2"></i> 上传文件</li>
-				<li class="right-menu-item" @click="handleUploadFileBtnClick(2)">
-					<i class="el-icon-folder-opened"></i> 上传文件夹
-				</li>
-				<li class="right-menu-item" @click="handleUploadFileBtnClick(3)"><i class="el-icon-thumb"></i> 拖拽上传</li>
+				<li class="right-menu-item" @click="handleUploadFileBtnClick(1)"><upload-outlined /> 上传文件</li>
+				<li class="right-menu-item" @click="handleUploadFileBtnClick(2)"><folder-open-outlined /> 上传文件夹</li>
+				<li class="right-menu-item" @click="handleUploadFileBtnClick(3)"><drag-outlined /> 拖拽上传</li>
 			</template>
 		</ul>
 	</transition>
 </template>
 
 <script setup>
-	import { ref, computed, watch, onMounted, getCurrentInstance } from 'vue'
-	import { useRouter, useRoute } from 'vue-router'
-	import { message as antMessage } from 'ant-design-vue' // 重命名以避免与 window.message 冲突
+	import { ref, computed, watch, getCurrentInstance } from 'vue'
+	import { useRouter } from 'vue-router'
+	import { useMyResourceStore } from '@/store/myResource.js'
+	import {
+		EyeOutlined,
+		DeleteOutlined,
+		RollbackOutlined,
+		CopyOutlined,
+		ExportOutlined,
+		EditOutlined,
+		ShareAltOutlined,
+		DownloadOutlined,
+		FolderOutlined,
+		RightOutlined,
+		FileOutlined,
+		ReloadOutlined,
+		FolderAddOutlined,
+		UploadOutlined,
+		FolderOpenOutlined,
+		DragOutlined
+	} from '@ant-design/icons-vue'
 	import { officeFileType, fileSuffixCodeModeMap, markdownFileType } from '@/libs/map.js'
-	import { addMyFileListApi, addEnterpriseDiskApi } from '@/api/myResource/file'
-	import axios from 'axios' // 如果需要
-	import fileOperationPlugins from '@/libs/fileOperationPlugins.js'
-	import globalFunction from '@/libs/globalFunction/index.js'
-	import appConfig from '@/config/index.js'
+	// 导入图片资源
+	import dirImgSrc from '@/assets/images/myResource/file/dir.png'
+	import wordImgSrc from '@/assets/images/myResource/file/file_word.svg'
+	import excelImgSrc from '@/assets/images/myResource/file/file_excel.svg'
+	import pptImgSrc from '@/assets/images/myResource/file/file_ppt.svg'
 
-	// 从插件或模块中获取方法
-	const { openDialog } = fileOperationPlugins
-	const { openBox } = fileOperationPlugins
-	const fileHelper = globalFunction.file // $file
-
-	// $common 的处理: common.js 未找到,暂时保留 proxy.$common
-	// 如果 $common 是必须的,你需要找到它的定义并导入
-	const { proxy } = getCurrentInstance() // 保留 proxy 以便访问 $common (如果确实需要且未找到其来源)
+	const router = useRouter()
+	const myResourceStore = useMyResourceStore()
 
+	// 定义props
 	const props = defineProps({
 		selectedFile: Object,
 		domEvent: Object,
 		serviceEl: Object,
-		callType: String,
 		callback: Function
 	})
 
-	const router = useRouter()
-	const route = useRoute()
-
-	const visible = ref(false)
-
+	// 响应式数据
+	const visible = ref(false) // 右键菜单是否显示
+	const sortedFileList = ref([]) // 排序后的表格数据
+	const { proxy } = getCurrentInstance()
+	console.log('proxy file', proxy.$file)
+	// 右键菜单位置
 	const rightMenu = ref({
 		top: 0,
 		left: 0,
@@ -155,6 +161,7 @@
 		right: 'auto'
 	})
 
+	// 右键解压缩菜单位置
 	const unzipMenu = ref({
 		top: 0,
 		bottom: 'auto',
@@ -162,82 +169,84 @@
 		right: 'auto'
 	})
 
-	// 图片资源: 请将路径修改为实际项目中的正确路径
-	// 例如: import wordIcon from '@/assets/images/file_word.svg'; const wordImg = ref(wordIcon);
-	// 或者如果图片在 public 目录: const wordImg = ref('/images/file_word.svg');
-	const dirImg = ref('/img/file/dir.png') // 示例: 假设在 public/img/file/dir.png
-	const wordImg = ref('/img/file/file_word.svg') // 示例: 假设在 public/img/file/file_word.svg
-	const excelImg = ref('/img/file/file_excel.svg') // 示例: 假设在 public/img/file/file_excel.svg
-	const pptImg = ref('/img/file/file_ppt.svg') // 示例: 假设在 public/img/file/file_ppt.svg
-
-	const newname = ref('')
+	// 图片资源 - 使用导入的图片资源
+	const dirImg = ref(dirImgSrc)
+	const wordImg = ref(wordImgSrc)
+	const excelImg = ref(excelImgSrc)
+	const pptImg = ref(pptImgSrc)
 
 	// 计算属性
-	const routeName = computed(() => route.name)
-	const fileType = computed(() => (route.query.fileType ? Number(route.query.fileType) : 0))
-	const filePath = computed(() => route.query.filePath)
+	// 路由名称
+	const routeName = computed(() => {
+		return router.currentRoute.value.name
+	})
 
+	// 左侧菜单选中的文件类型
+	const fileType = computed(() => {
+		return router.currentRoute.value.query.fileType ? Number(router.currentRoute.value.query.fileType) : 0
+	})
+
+	// 当前路径
+	const filePath = computed(() => {
+		return router.currentRoute.value.query.filePath
+	})
+
+	// 查看按钮是否显示
 	const seeBtnShow = computed(() => {
-		const PIC = ['png', 'jpg', 'jpeg', 'gif', 'svg', 'webp']
-		return props.selectedFile && fileType.value !== 6 && PIC.includes(props.selectedFile.extendName?.toLowerCase())
+		return fileType.value !== 6
 	})
 
+	// 删除按钮是否显示
 	const deleteBtnShow = computed(() => {
 		return fileType.value !== 8 && !['Share'].includes(routeName.value)
 	})
 
+	// 还原按钮是否显示
 	const restoreBtnShow = computed(() => {
 		return fileType.value === 6 && !['Share'].includes(routeName.value)
 	})
 
+	// 复制按钮是否显示
 	const copyBtnShow = computed(() => {
-		return ![6, 8, 15].includes(fileType.value) && !['Share'].includes(routeName.value)
+		return ![6, 8].includes(fileType.value) && !['Share'].includes(routeName.value)
 	})
 
+	// 移动按钮是否显示
 	const moveBtnShow = computed(() => {
-		return ![6, 8, 15].includes(fileType.value) && !['Share'].includes(routeName.value)
-	})
-
-	const addMyFileListBtnShow = computed(() => {
-		return fileType.value == 15 && !['Share'].includes(routeName.value)
-	})
-
-	const addEnterpriseDiskBtnShow = computed(() => {
-		return ![6, 8, 15].includes(fileType.value) && !['Share'].includes(routeName.value)
+		return ![6, 8].includes(fileType.value) && !['Share'].includes(routeName.value)
 	})
 
+	// 重命名按钮是否显示
 	const renameBtnShow = computed(() => {
 		return ![6, 8].includes(fileType.value) && !['Share'].includes(routeName.value)
 	})
 
+	// 分享按钮是否显示
 	const shareBtnShow = computed(() => {
-		return ![6, 8, 15].includes(fileType.value) && !['Share'].includes(routeName.value)
+		return ![6, 8].includes(fileType.value) && !['Share'].includes(routeName.value)
 	})
 
+	// 下载按钮是否显示
 	const downloadBtnShow = computed(() => {
 		return ![6, 8].includes(fileType.value)
 	})
 
+	// 解压缩按钮是否显示
 	const unzipBtnShow = computed(() => {
 		return (
-			props.selectedFile &&
 			![6, 8].includes(fileType.value) &&
 			!['Share'].includes(routeName.value) &&
 			['zip', 'rar', '7z', 'tar', 'gz'].includes(props.selectedFile.extendName)
 		)
 	})
 
+	// 编辑文件夹按钮是否显示
 	const folderEditBtnShow = computed(() => {
-		return (
-			props.selectedFile &&
-			![6, 8].includes(fileType.value) &&
-			props.selectedFile.isDir === 1 &&
-			!['Share'].includes(routeName.value)
-		)
+		return ![6, 8].includes(fileType.value) && props.selectedFile.isDir === 1 && !['Share'].includes(routeName.value)
 	})
 
+	// 在线编辑按钮是否显示
 	const onlineEditBtnShow = computed(() => {
-		if (!props.selectedFile) return false
 		return (
 			![6, 8].includes(fileType.value) &&
 			(officeFileType.includes(props.selectedFile.extendName) ||
@@ -247,14 +256,17 @@
 		)
 	})
 
+	// 复制链接按钮是否显示
 	const copyLinkBtnShow = computed(() => {
 		return fileType.value === 8
 	})
 
+	// 文件详情按钮是否显示
 	const detailInfoBtnShow = computed(() => {
 		return true
 	})
 
+	// 上传文件组件参数
 	const uploadFileParams = computed(() => {
 		return {
 			filePath: filePath.value,
@@ -262,7 +274,7 @@
 		}
 	})
 
-	// Watcher
+	// 监听右键列表状态
 	watch(visible, (newValue) => {
 		if (newValue === true) {
 			document.body.addEventListener('click', closeRightMenu)
@@ -272,102 +284,17 @@
 		}
 	})
 
-	onMounted(() => {
-		// onMounted logic if any
-	})
-
-	// Methods
-	const geta1 = (src) => {
-		console.log('src', src)
-		// $common.getCookies 依赖 proxy.$common,如果 $common 无法解析,这里会报错
-		const cookies = proxy.$common?.getCookies(appConfig.TOKEN_NAME)
-		const aElement = document.getElementById('aaaa')
-		if (!aElement) return
-
-		const downloadNameParts = aElement.download.split('.')
-		const name1 = downloadNameParts[0]
-		const name2 = downloadNameParts[1]
-
-		if (name2) {
-			newname.value = name1 + '.' + name2
-		} else {
-			newname.value = name1 + '.' + 'zip'
-		}
-
-		console.log('appConfig.API_URL', appConfig.API_URL) // 使用导入的 appConfig
-		const newname1 = newname.value
-		// 确保 aElement.href 是完整的 URL 或者正确拼接
-		const apiUrlPart = aElement.href.includes('/api') ? aElement.href.split('/api')[1] : aElement.href
-		const url = `${
-			(appConfig.API_URL.startsWith('http') ? '' : 'http://' + window.location.host) +
-			appConfig.API_URL + // 使用导入的 appConfig
-			apiUrlPart +
-			'&' +
-			cookies
-		}`
-
-		let isios = navigator.userAgent.indexOf('iPhone') > -1
-		let isAndroid = navigator.userAgent.indexOf('Android') > -1
-		console.log('url', url)
-		console.log('cookies', cookies)
-		console.log('newname1', newname1)
-		if (isios) {
-			window.webkit.messageHandlers.Download.postMessage({
-				params: {
-					url,
-					cookies,
-					newname1
-				}
-			})
-		} else if (isAndroid) {
-			window.Download.downList(url, cookies, newname1)
-		}
-	}
-
-	const downloadPost = (src) => {
-		console.log(window.location.origin)
-		console.log(33333, src)
-		return new Promise((resolve, reject) => {
-			axios({
-				url: window.location.origin + src, // 确保 src 是正确的相对路径
-				method: 'get',
-				responseType: 'blob'
-			})
-				.then((res) => {
-					fileDownload(res, props.selectedFile?.fileName || 'download')
-					console.log(res)
-					resolve(res)
-				})
-				.catch((err) => {
-					reject(err)
-				})
-		})
-	}
-
-	const fileDownload = (res, filename) => {
-		let blob = new Blob([res.data])
-		if ('msSaveOrOpenBlob' in navigator) {
-			window.navigator.msSaveOrOpenBlob(blob, filename)
-		} else {
-			let objectUrl = (window.URL || window.webkitURL).createObjectURL(blob)
-			let downFile = document.createElement('a')
-			downFile.style.display = 'none'
-			downFile.href = objectUrl
-			downFile.download = filename
-			document.body.appendChild(downFile)
-			downFile.click()
-			document.body.removeChild(downFile)
-			window.URL.revokeObjectURL(objectUrl)
-		}
-	}
-
+	// 方法
+	/**
+	 * 打开右键菜单
+	 */
 	const handleOpenContextMenu = () => {
-		console.log('handleOpenContextMenu', props)
-		if (!props.domEvent) return
+		// 纵坐标设置
 		if (
 			document.body.clientHeight - props.domEvent.clientY <
 			document.querySelectorAll('#rightMenuList > .right-menu-item').length * 36 + 10
 		) {
+			// 如果到底部的距离小于元素总高度
 			rightMenu.value.top = 'auto'
 			rightMenu.value.bottom = `${document.body.clientHeight - props.domEvent.clientY}px`
 			unzipMenu.value.top = 'auto'
@@ -378,7 +305,9 @@
 			unzipMenu.value.top = '0px'
 			unzipMenu.value.bottom = 'auto'
 		}
+		// 横坐标设置
 		if (document.body.clientWidth - props.domEvent.clientX < 138) {
+			// 如果到右边的距离小于元素总宽度
 			rightMenu.value.left = 'auto'
 			rightMenu.value.right = `${document.body.clientWidth - props.domEvent.clientX}px`
 			unzipMenu.value.left = '-200px'
@@ -392,90 +321,139 @@
 		visible.value = true
 	}
 
+	/**
+	 * 关闭右键列表
+	 */
 	const closeRightMenu = (event) => {
-		if (!event.target.className.includes('operate-more-') && !event.target.className.includes('unzip-menu-item')) {
+		// 使用 classList.contains 方法替代 className.includes
+		const target = event.target
+		const hasOperateMoreClass =
+			target.classList.contains('operate-more-') ||
+			(typeof target.className === 'string' && target.className.includes('operate-more-'))
+		const hasUnzipMenuItemClass =
+			target.classList.contains('unzip-menu-item') ||
+			(typeof target.className === 'string' && target.className.includes('unzip-menu-item'))
+
+		if (!hasOperateMoreClass && !hasUnzipMenuItemClass) {
 			visible.value = false
 			if (props.selectedFile !== undefined) {
-				props.callback?.('cancel')
+				// 不是在空白处右键时
+				props.callback('cancel')
 			}
 		}
 	}
 
+	/**
+	 * 复制按钮点击事件
+	 * @description 向父组件传递当前操作的文件信息,并打开"复制文件对话框"
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleCopyFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.copyFile({
 				fileInfo
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 移动按钮点击事件
+	 * @description 向父组件传递当前操作的文件信息,并打开"移动文件对话框"
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleMoveFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.moveFile({
 				isBatchMove: false,
 				fileInfo
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 解压缩按钮点击事件
+	 * @description 调用解压缩文件接口,并展示新的文件列表
+	 * @param {object} fileInfo 文件信息
+	 * @param {number} unzipMode 解压模式 0-解压到当前文件夹, 1-自动创建该文件名目录,并解压到目录里, 2-手动选择解压目录
+	 */
 	const handleUnzipFileBtnClick = (fileInfo, unzipMode) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.unzipFile({
 				unzipMode: unzipMode,
 				userFileId: fileInfo.userFileId
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 删除按钮点击事件
+	 * @description 区分 删除到回收站中 | 在回收站中彻底删除,打开确认对话框
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleDeleteFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.deleteFile({
 				isBatchOperation: false,
 				fileInfo,
-				deleteMode: fileType.value === 6 ? 2 : 1
+				deleteMode: fileType.value === 6 ? 2 : 1 //  删除类型:1-删除到回收站 2-彻底删除
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 还原按钮点击事件
+	 * @description 调用接口,在回收站中还原文件
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleRestoreFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.restoreFile({
 				deleteBatchNum: fileInfo.deleteBatchNum,
 				filePath: fileInfo.filePath
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 文件重命名按钮点击事件
+	 * @description 打开确认对话框让用户输入新的文件名
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleRenameFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog
+		proxy.$openDialog
 			.renameFile({
 				oldFileName: fileInfo.fileName,
 				userFileId: fileInfo.userFileId
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
+	/**
+	 * 文件分享按钮点击事件
+	 * @description 打开对话框让用户选择过期时间和提取码
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleShareFileBtnClick = (fileInfo) => {
 		visible.value = false
-		openDialog.shareFile({
+		proxy.$openDialog.shareFile({
 			fileInfo: [
 				{
 					userFileId: fileInfo.userFileId
@@ -484,6 +462,9 @@
 		})
 	}
 
+	/**
+	 * 编辑文件夹按钮点击事件
+	 */
 	const handleClickFolderEdit = () => {
 		router.push({
 			name: 'WebIDE',
@@ -491,177 +472,164 @@
 		})
 	}
 
+	/**
+	 * 文件在线编辑按钮点击事件
+	 * @description 打开 代码预览对话框 或 office 编辑页面
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleClickFileEdit = (fileInfo) => {
 		if (officeFileType.includes(fileInfo.extendName)) {
-			fileHelper.getFileOnlineEditPathByOffice(fileInfo)
+			// office 编辑页面
+			// proxy.$file.getFileOnlineEditPathByOffice(fileInfo)
 		} else if (markdownFileType.includes(fileInfo.extendName)) {
-			openBox.markdownPreview({
+			// markdown 编辑浮层
+			proxy.$openBox.markdownPreview({
 				fileInfo: fileInfo,
 				editable: true
 			})
 		} else {
-			openBox.codePreview({ fileInfo: fileInfo, isEdit: true })
+			// 代码编辑对话框
+			proxy.$openBox.codePreview({ fileInfo: fileInfo, isEdit: true })
 		}
 	}
 
+	/**
+	 * 文件详情按钮点击事件
+	 * @description 打开对话框展示文件完整信息
+	 * @param {object} fileInfo 文件信息
+	 */
 	const handleShowDetailInfo = (fileInfo) => {
 		visible.value = false
-		openDialog.showFileDetail({ fileInfo })
+		proxy.$openDialog.showFileDetail({ fileInfo })
 	}
 
+	/**
+	 * 新建文件夹按钮点击事件
+	 * @description 调用新建文件夹服务,并在弹窗确认回调事件中刷新文件列表
+	 */
 	const handleClickAddFolderBtn = () => {
-		openDialog
+		proxy.$openDialog
 			.addFolder({
-				filePath: route.query.filePath || '/'
+				filePath: router.currentRoute.value.query.filePath || '/'
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
-	const handleCreateFile = (fileExt) => {
-		// Renamed parameter to avoid conflict
-		openDialog
-			.createFile({
-				fileType: fileExt, // Use the renamed parameter
-				filePath: route.query.filePath || '/'
+	/**
+	 * 新建 office 文件
+	 * @description 调用新建 office 文件服务,并在弹窗确认回调事件中刷新文件列表
+	 * @param {string} 文件扩展名 docx xlsx pptx
+	 */
+	const handleCreateFile = (extendName) => {
+		proxy.$openDialog
+			.addFile({
+				extendName: extendName
 			})
 			.then((res) => {
-				props.callback?.(res)
+				props.callback(res)
 			})
 	}
 
-	const handleUploadFileBtnClick = (uploadType) => {
-		if (uploadType === 1 || uploadType === 2) {
-			openDialog?.upload({ type: uploadType, filePath: filePath.value }).then((res) => {
-				props.callback?.(res)
-			})
-		} else if (uploadType === 3) {
-			antMessage.info('请拖拽文件或文件夹到此区域以上传')
-		}
-		visible.value = false
-	}
-
-	const handleAddMyFileList = (fileInfo) => {
-		addMyFileListApi({ userFileId: fileInfo.userFileId, filePath: '/' }).then((res) => {
-			if (res.success) {
-				antMessage.success('添加成功')
-			} else {
-				antMessage.error(res.message)
-			}
-		})
-	}
-
-	const handleEnterpriseDisk = (fileInfo) => {
-		addEnterpriseDiskApi({ userFileId: fileInfo.userFileId, filePath: '/' }).then((res) => {
-			if (res.success) {
-				antMessage.success('添加成功')
-			} else {
-				antMessage.error(res.message)
-			}
+	/**
+	 * 上传文件按钮点击事件
+	 * @description 通过Bus通信,开启全局上传文件流程
+	 * @param {boolean} uploadWay 上传方式 0-文件上传 1-文件夹上传 2-粘贴图片或拖拽上传
+	 */
+	const handleUploadFileBtnClick = (uploadWay) => {
+		proxy.$openBox.uploadFile({
+			params: uploadFileParams.value,
+			uploadWay,
+			serviceEl: props.serviceEl,
+			callType: true //  callType 调用此服务的方式:1 - 顶部栏,2 - 右键菜单
 		})
 	}
 
-	// Expose any properties/methods that need to be accessed by the parent component
+	// 暴露方法给父组件
 	defineExpose({
-		visible, // if parent needs to control visibility directly
-		handleOpenContextMenu // if parent needs to trigger opening context menu
+		visible,
+		handleOpenContextMenu
 	})
 </script>
 
 <style lang="less" scoped>
-	/* 保持原有样式 */
+	@import '@/style/myResource/varibles.less';
+	@import '@/style/myResource/mixins.less';
+
 	.right-menu-list {
 		position: fixed;
-		z-index: 9999; // 确保在最上层
-		width: auto;
-		min-width: 128px;
-		max-width: 200px;
-		padding: 4px 0;
-		border: 1px solid #e4e7ed;
+		display: flex;
+		flex-direction: column;
+		background: #fff;
+		border: 1px solid @border-color-light;
 		border-radius: 4px;
-		background-color: #fff;
 		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+		z-index: 2;
+		padding: 4px 0;
+		color: @regular-text;
+		list-style: none;
+
+		.right-menu-item,
+		.unzip-item {
+			padding: 0 16px;
+			height: 36px;
+			line-height: 36px;
+			cursor: pointer;
+			&:hover {
+				background: @primary-hover;
+				color: @Primary;
+			}
+			i {
+				margin-right: 8px;
+			}
+		}
 
 		&.add {
 			.right-menu-item {
-				padding: 0 8px;
+				display: flex;
+				align-items: center;
 				img {
-					width: 14px;
-					margin-right: 8px;
+					margin-right: 4px;
+					height: 20px;
+				}
+				i {
+					margin-right: 4px;
+					font-size: 18px;
 				}
 			}
 		}
-	}
-
-	.right-menu-item {
-		box-sizing: border-box;
-		position: relative;
-		display: flex;
-		align-items: center;
-		width: 100%;
-		height: 36px;
-		padding: 0 16px;
-		font-size: 14px;
-		line-height: 36px;
-		color: #606266;
-		cursor: pointer;
-		user-select: none;
-
-		&:hover {
-			background: #ecf5ff;
-			color: #409eff;
-		}
-
-		&.unzip-menu-item {
-			justify-content: space-between;
-		}
-
-		.el-icon-arrow-right {
-			position: absolute;
-			right: 8px;
-		}
-
-		.unzip-list {
-			position: absolute;
-			z-index: 1;
-			padding: 4px 0;
-			border: 1px solid #e4e7ed;
-			border-radius: 4px;
-			background-color: #fff;
-			box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
-			display: none;
-		}
-
-		&.unzip-menu-item:hover > .unzip-list {
-			display: block;
-		}
-
-		.unzip-item {
-			box-sizing: border-box;
-			display: flex;
-			align-items: center;
-			width: 100%;
-			min-width: max-content;
-			height: 36px;
-			padding: 0 16px;
-			font-size: 14px;
-			line-height: 36px;
-			color: #606266;
-			cursor: pointer;
 
+		.unzip-menu-item {
+			position: relative;
 			&:hover {
-				background: #ecf5ff;
-				color: #409eff;
+				.unzip-list {
+					display: block;
+				}
+			}
+			.unzip-list {
+				position: absolute;
+				display: none;
+				list-style: none;
+				.unzip-item {
+					width: 200px;
+					.setEllipsis(1);
+				}
 			}
-		}
-
-		i {
-			margin-right: 8px;
 		}
 	}
-
-	.el-divider--horizontal {
-		margin: 4px 0;
+	.right-menu-list,
+	.unzip-list {
+		background: #fff;
+		border: 1px solid @border-color-light;
+		border-radius: 6px;
+		box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+		z-index: 2;
+		padding: 8px 0;
+		color: @regular-text;
+		font-size: 14px;
+		.a-divider {
+			margin: 2px 0;
+		}
 	}
 </style>

+ 6 - 1
src/views/myResource/file/box/contextMenu/index.js

@@ -1,6 +1,7 @@
 import { createApp } from 'vue'
 import Antd from 'ant-design-vue'
 import router from '@/router' // 添加这行导入
+import snowy from '@/snowy' // 添加这行导入
 // 导入组件
 import ContextMenu from './Box.vue'
 
@@ -27,6 +28,7 @@ const initInstanceContextMenu = (selectedFile, domEvent, serviceEl, callType, ca
 	// 注册 Ant Design Vue 组件
 	contextMenuApp.use(Antd)
 	contextMenuApp.use(router) // 添加这行
+	contextMenuApp.use(snowy) // 添加这行,注册 snowy 插件
 	contextMenuInstance = contextMenuApp.mount(mountNode)
 	return mountNode
 }
@@ -50,7 +52,10 @@ const showContextMenuBox = (obj) => {
 			// 服务取消时卸载 DOM
 			if (res === 'cancel' && contextMenuInstance !== null) {
 				contextMenuApp.unmount()
-				document.body.removeChild(mountNode)
+				// 添加检查,确保节点存在于document.body中
+				if (document.body.contains(mountNode)) {
+					document.body.removeChild(mountNode)
+				}
 				contextMenuInstance = null
 				contextMenuApp = null
 			}

+ 137 - 168
src/views/myResource/resourceLibrary/file/AsideMenu.vue

@@ -1,62 +1,53 @@
 <template>
 	<div class="side-menu-wrapper">
 		<!-- 768px 下,以抽屉形式展示 -->
-		<a-drawer v-model:visible="isDrawer" :width="210" placement="left" :closable="false" v-if="screenWidth <= 768">
-			<a-menu v-model:selectedKeys="activeIndex" mode="inline" :inline-collapsed="isCollapse" class="side-menu">
+		<a-drawer v-model="isDrawer" :width="210" :closable="false" placement="left" v-if="screenWidth <= 768">
+			<!-- collapse 属性:控制菜单收缩展开 -->
+			<a-menu class="side-menu" v-model:selectedKeys="activeIndex" :mode="'inline'" :inline-collapsed="isCollapse">
 				<a-sub-menu key="myFile" class="my-file">
 					<template #title>
+						<!-- 使用 Ant Design Vue 的图标 -->
 						<folder-outlined />
 						<span>我的文件</span>
 					</template>
-					<a-menu-item key="0" @click="navigateTo(0, '/')">
+					<a-menu-item key="0" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 0, filePath: '/' } })">
 						<menu-outlined />
 						<span>全部</span>
 					</a-menu-item>
-					<a-menu-item key="1" @click="navigateTo(1)">
+					<a-menu-item key="1" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 1 } })">
 						<picture-outlined />
 						<span>图片</span>
 					</a-menu-item>
-					<a-menu-item key="2" @click="navigateTo(2)">
-						<file-outlined />
+					<a-menu-item key="2" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 2 } })">
+						<file-text-outlined />
 						<span>文档</span>
 					</a-menu-item>
-					<a-menu-item key="5" @click="navigateTo(5)">
+					<a-menu-item key="3" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 3 } })">
+						<video-camera-outlined />
+						<span>视频</span>
+					</a-menu-item>
+					<a-menu-item key="4" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 4 } })">
+						<sound-outlined />
+						<span>音乐</span>
+					</a-menu-item>
+					<a-menu-item key="5" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 5 } })">
 						<inbox-outlined />
 						<span>其他</span>
 					</a-menu-item>
 				</a-sub-menu>
-
-				<a-menu-item key="6" @click="navigateTo(6)" class="recovery">
+				<a-menu-item key="6" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 6 } })" class="recovery">
 					<delete-outlined />
 					<span>回收站</span>
 				</a-menu-item>
-
-				<a-menu-item key="8" @click="navigateTo(8, '/')" class="my-share">
+				<a-menu-item
+					key="8"
+					@click="navigateTo({ name: 'resourceLibrary', query: { fileType: 8, filePath: '/' } })"
+					class="my-share"
+				>
 					<share-alt-outlined />
 					<span>我的分享</span>
 				</a-menu-item>
-
-				<a-menu-item v-if="isAdmin == 1" key="12" @click="navigateTo(12, '/')" class="my-share">
-					<copy-outlined />
-					<span>敏感词</span>
-				</a-menu-item>
-
-				<a-menu-item v-if="isAdmin == 1" key="13" @click="navigateTo(13, '/')" class="my-share">
-					<medicine-box-outlined />
-					<span>敏感词过滤记录</span>
-				</a-menu-item>
-
-				<a-menu-item key="14" @click="navigateTo(14, '/')" class="my-share">
-					<environment-outlined />
-					<span>跨文件传输记录</span>
-				</a-menu-item>
-
-				<a-menu-item key="15" @click="navigateTo(15, '/')" class="my-share">
-					<cloud-outlined />
-					<span>企业云盘</span>
-				</a-menu-item>
 			</a-menu>
-
 			<!-- 存储信息显示 -->
 			<div class="storage-wrapper" :class="{ fold: isCollapse }">
 				<a-progress
@@ -64,79 +55,70 @@
 					:stroke-color="storageColor"
 					:show-info="false"
 					:type="isCollapse ? 'circle' : 'line'"
-					:size="isCollapse ? 'small' : 'default'"
+					:width="32"
 					:stroke-width="isCollapse ? 4 : 6"
-				/>
+					stroke-linecap="square"
+				></a-progress>
 				<div class="text" v-show="!isCollapse">
 					<span class="label">存储</span>
 					<span>
-						{{ calculateFileSize(storageValue) }} /
-						{{ calculateFileSize(totalStorageValue) }}
+						{{ $file.calculateFileSize(storageValue) }} /
+						{{ $file.calculateFileSize(totalStorageValue) }}
 					</span>
 				</div>
 				<div class="text" v-show="isCollapse">
-					<span>{{ calculateFileSize(storageValue) }}</span>
+					<span>{{ $file.calculateFileSize(storageValue) }}</span>
 				</div>
 			</div>
 		</a-drawer>
-
 		<!-- 768px 以上,平铺展示 -->
 		<template v-else>
-			<a-menu v-model:selectedKeys="activeIndex" mode="inline" :inline-collapsed="isCollapse" class="side-menu">
+			<!-- collapse 属性:控制菜单收缩展开 -->
+			<a-menu class="side-menu" v-model:selectedKeys="activeIndex" :mode="'inline'" :inline-collapsed="isCollapse">
 				<a-sub-menu key="myFile" class="my-file">
 					<template #title>
+						<!-- 使用 Ant Design Vue 的图标 -->
 						<folder-outlined />
 						<span>我的文件</span>
 					</template>
-					<a-menu-item key="0" @click="navigateTo(0, '/')">
+					<a-menu-item key="0" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 0, filePath: '/' } })">
 						<menu-outlined />
 						<span>全部</span>
 					</a-menu-item>
-					<a-menu-item key="1" @click="navigateTo(1)">
+					<a-menu-item key="1" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 1 } })">
 						<picture-outlined />
 						<span>图片</span>
 					</a-menu-item>
-					<a-menu-item key="2" @click="navigateTo(2)">
-						<file-outlined />
+					<a-menu-item key="2" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 2 } })">
+						<file-text-outlined />
 						<span>文档</span>
 					</a-menu-item>
-					<a-menu-item key="5" @click="navigateTo(5)">
+					<a-menu-item key="3" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 3 } })">
+						<video-camera-outlined />
+						<span>视频</span>
+					</a-menu-item>
+					<a-menu-item key="4" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 4 } })">
+						<sound-outlined />
+						<span>音乐</span>
+					</a-menu-item>
+					<a-menu-item key="5" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 5 } })">
 						<inbox-outlined />
 						<span>其他</span>
 					</a-menu-item>
 				</a-sub-menu>
-
-				<a-menu-item key="6" @click="navigateTo(6)" class="recovery">
+				<a-menu-item key="6" @click="navigateTo({ name: 'resourceLibrary', query: { fileType: 6 } })" class="recovery">
 					<delete-outlined />
 					<span>回收站</span>
 				</a-menu-item>
-
-				<a-menu-item key="8" @click="navigateTo(8, '/')" class="my-share">
+				<a-menu-item
+					key="8"
+					@click="navigateTo({ name: 'resourceLibrary', query: { fileType: 8, filePath: '/' } })"
+					class="my-share"
+				>
 					<share-alt-outlined />
 					<span>我的分享</span>
 				</a-menu-item>
-
-				<a-menu-item v-if="isAdmin == 1" key="12" @click="navigateTo(12, '/')" class="my-share">
-					<copy-outlined />
-					<span>敏感词</span>
-				</a-menu-item>
-
-				<a-menu-item v-if="isAdmin == 1" key="13" @click="navigateTo(13, '/')" class="my-share">
-					<medicine-box-outlined />
-					<span>敏感词过滤记录</span>
-				</a-menu-item>
-
-				<a-menu-item key="14" @click="navigateTo(14, '/')" class="my-share">
-					<environment-outlined />
-					<span>跨文件传输记录</span>
-				</a-menu-item>
-
-				<a-menu-item key="15" @click="navigateTo(15, '/')" class="my-share">
-					<cloud-outlined />
-					<span>企业云盘</span>
-				</a-menu-item>
 			</a-menu>
-
 			<!-- 存储信息显示 -->
 			<div class="storage-wrapper" :class="{ fold: isCollapse }">
 				<a-progress
@@ -144,57 +126,62 @@
 					:stroke-color="storageColor"
 					:show-info="false"
 					:type="isCollapse ? 'circle' : 'line'"
-					:size="isCollapse ? 'small' : 'default'"
+					:width="32"
 					:stroke-width="isCollapse ? 4 : 6"
-				/>
+					stroke-linecap="square"
+				></a-progress>
 				<div class="text" v-show="!isCollapse">
 					<span class="label">存储</span>
 					<span>
-						{{ calculateFileSize(storageValue) }} /
-						{{ calculateFileSize(totalStorageValue) }}
+						{{ $file.calculateFileSize(storageValue) }} /
+						{{ $file.calculateFileSize(totalStorageValue) }}
 					</span>
 				</div>
 				<div class="text" v-show="isCollapse">
-					<span>{{ calculateFileSize(storageValue) }}</span>
+					<span>{{ $file.calculateFileSize(storageValue) }}</span>
 				</div>
 			</div>
 		</template>
-
 		<!-- 展开 & 收缩分类栏 -->
-		<div class="aside-title" @click="toggleCollapse">
-			<left-outlined v-if="!isCollapse" class="icon" title="收起" />
-			<right-outlined v-else class="icon" title="展开" />
-		</div>
+		<a-tooltip :title="isCollapse ? '展开' : '收起'" placement="right">
+			<div class="aside-title" @click="isCollapse ? (isCollapse = false) : (isCollapse = true)">
+				<right-outlined v-if="isCollapse" class="icon" />
+				<left-outlined v-else class="icon" />
+			</div>
+		</a-tooltip>
 	</div>
 </template>
 
 <script setup>
-	import { ref, computed, watch, onMounted } from 'vue'
+	import { ref, computed, watch, onMounted, getCurrentInstance } from 'vue'
 	import { useRouter, useRoute } from 'vue-router'
 	import { useMyResourceStore } from '@/store/myResource'
 	import {
 		FolderOutlined,
 		MenuOutlined,
 		PictureOutlined,
-		FileOutlined,
+		FileTextOutlined,
+		VideoCameraOutlined,
+		SoundOutlined,
 		InboxOutlined,
 		DeleteOutlined,
 		ShareAltOutlined,
-		CopyOutlined,
-		MedicineBoxOutlined,
-		EnvironmentOutlined,
-		CloudOutlined,
 		LeftOutlined,
 		RightOutlined
 	} from '@ant-design/icons-vue'
 
+	// 获取当前实例,用于访问全局属性
+	const { proxy } = getCurrentInstance()
 	const router = useRouter()
 	const route = useRoute()
 	const myResourceStore = useMyResourceStore()
 
-	const isDrawer = ref(false)
-	const isCollapse = ref(localStorage.getItem('qiwen_is_collapse') === 'true')
-	const isAdmin = ref(localStorage.getItem('isAdmin'))
+	// 数据
+	const isDrawer = ref(false) // 控制移动端菜单抽屉是否显示
+	const isCollapse = ref(false) // 控制菜单收缩展开
+
+	// 将计算属性改为响应式变量
+	const activeIndex = ref([String(route.query.fileType || '0')])
 
 	// 菜单 index 和名称 Map
 	const myFileMenuMap = {
@@ -205,58 +192,48 @@
 		4: '音乐',
 		5: '其他',
 		6: '回收站',
-		8: '我的分享',
-		12: '敏感词',
-		13: '敏感词过滤记录',
-		15: '企业云盘'
+		8: '我的分享'
 	}
 
+	// 自定义进度条颜色,不同占比,进度条颜色不同
 	const storageColor = {
-		'0,50': '#a093c3',
-		'50,80': '#E6A23C',
-		'80,100': '#F56C6C'
+		'0%': '#67C23A',
+		'50%': '#67C23A',
+		'80%': '#E6A23C',
+		'100%': '#F56C6C'
 	}
-	console.log('route.query.fileType', route.query.fileType)
-	// 计算属性
-	const activeIndex = ref([String(route.query.fileType)])
 
-	const storageValue = computed(() => myResourceStore.storageValue)
-	const totalStorageValue = computed(() => myResourceStore.totalStorageValue)
+	// 存储容量
+	const storageValue = computed(() => {
+		return myResourceStore.storageValue
+	})
+
+	const totalStorageValue = computed(() => {
+		return myResourceStore.totalStorageValue
+	})
 
+	// 存储百分比
 	const storagePercentage = computed(() => {
 		return totalStorageValue.value ? (storageValue.value / totalStorageValue.value) * 100 : 0
 	})
 
-	const screenWidth = computed(() => myResourceStore.screenWidth)
-
-	// 方法
-	const navigateTo = (fileType, filePath = '') => {
-		router.push({
-			name: 'resourceLibrary',
-			query: { fileType, ...(filePath ? { filePath } : {}) }
-		})
-		activeIndex.value = [String(fileType)]
-	}
-
-	const toggleCollapse = () => {
-		isCollapse.value = !isCollapse.value
-	}
-
-	const calculateFileSize = (size) => {
-		// 实现文件大小计算的方法
-		return size ? size.toString() : '0'
-	}
+	// 屏幕宽度
+	const screenWidth = computed(() => {
+		return myResourceStore.screenWidth
+	})
 
-	// 监听
+	// 监听路由变化,更新activeIndex
 	watch(
 		() => route.query.fileType,
-		(newFileType) => {
-			activeIndex.value = [String(newFileType)]
-			document.title = `${myFileMenuMap[Number(newFileType)]} - ${myResourceStore.siteName}`
+		(newValue) => {
+			activeIndex.value = [String(newValue || '0')]
+			console.log('activeIndex', activeIndex.value)
+			document.title = `${myFileMenuMap[Number(newValue || 0)]} - ${proxy.$RESOURCE_CONFIG.siteName}`
 			isDrawer.value = false
 		}
 	)
 
+	// 监听收缩状态变化,存储在 localStorage 中,保证页面刷新时仍然保存设置的状态
 	watch(isCollapse, (newValue) => {
 		localStorage.setItem('qiwen_is_collapse', newValue)
 		if (screenWidth.value <= 768 && newValue) {
@@ -265,52 +242,50 @@
 		}
 	})
 
+	// 导航到指定路由
+	const navigateTo = (route) => {
+		console.log('route==', route)
+		router.push(route)
+	}
+
 	// 生命周期钩子
 	onMounted(() => {
-		if (document.title === undefined) {
-			document.title = '网盘-'
-		}
-		document.title = `${myFileMenuMap[Number(activeIndex.value[0])]} - ${myResourceStore.siteName}`
+		isCollapse.value = localStorage.getItem('qiwen_is_collapse') === 'true' // 读取保存的状态
+		document.title = `${myFileMenuMap[Number(activeIndex.value[0] || 0)]} - ${proxy.$RESOURCE_CONFIG.siteName}`
 	})
 </script>
 
 <style lang="less" scoped>
-	// 保持原有样式,只需要修改一些类名对应关系
 	@import '@/style/myResource/varibles.less';
 	@import '@/style/myResource/mixins.less';
+
 	.side-menu-wrapper {
 		position: relative;
 		height: calc(100vh - 61px);
 		padding-right: 11px;
-
 		.side-menu {
+			// 高度设置为屏幕高度减去顶部导航栏的高度
 			height: calc(100vh - 127px);
 			overflow: auto;
+			// 调整滚动条样式
 			.setScrollbar(6px, transparent, #C0C4CC);
-
 			:deep(.ant-menu-item-selected) {
-				background: #a093c3;
-				color: black;
-			}
-
-			.my-file .anticon {
-				color: black;
+				background: #ecf5ff;
 			}
-
-			:deep(.ant-menu-submenu-title),
-			:deep(.ant-menu-item) {
-				color: black;
-
-				.anticon {
-					color: black;
-				}
-
-				&:hover {
-					background-color: #a093c3;
-				}
+			.my-file,
+			.recovery {
+				box-shadow: 0 4px 12px 0 @BorderExtralight;
 			}
 		}
-
+		:deep(.ant-menu) {
+			background: transparent;
+			color: #fff;
+		}
+		// 对展开状态下的菜单设置宽度
+		.side-menu:not(.ant-menu-inline-collapsed) {
+			width: 210px;
+		}
+		// 存储空间展示区
 		.storage-wrapper {
 			position: absolute;
 			bottom: 0;
@@ -323,22 +298,6 @@
 			padding: 16px;
 			z-index: 2;
 			color: @PrimaryText;
-
-			&.fold {
-				padding: 0;
-
-				:deep(.ant-progress-circle) {
-					margin: 0 auto;
-					width: 32px;
-					display: block;
-				}
-
-				.text {
-					font-size: 12px;
-					justify-content: center;
-				}
-			}
-
 			.text {
 				margin-top: 8px;
 				display: flex;
@@ -348,7 +307,19 @@
 				flex-wrap: wrap;
 			}
 		}
-
+		.storage-wrapper.fold {
+			padding: 0;
+			:deep(.ant-progress-circle) {
+				margin: 0 auto;
+				width: 32px;
+				display: block;
+			}
+			.text {
+				font-size: 12px;
+				justify-content: center;
+			}
+		}
+		// 折叠图标调整样式
 		.aside-title {
 			position: absolute;
 			top: calc(50% - 50px);
@@ -361,11 +332,9 @@
 			line-height: 100px;
 			cursor: pointer;
 			border-radius: 0 16px 16px 0;
-
 			&:hover {
 				opacity: 0.7;
 			}
-
 			.icon {
 				font-size: 12px;
 			}

+ 109 - 226
src/views/myResource/resourceLibrary/file/FileList.vue

@@ -1,15 +1,14 @@
 <template>
 	<div class="file-list-wrapper">
 		<!-- 操作按钮 -->
-		<a-layout-header>
+		<div class="header">
 			<OperationMenu
-				v-if="fileType != 12 && fileType != 13 && fileType != 14 && fileType != 15"
 				:fileType="fileType"
 				:filePath="filePath"
 				@getSearchFileList="getSearchFileList"
 				@getTableDataByType="getTableDataByType"
 			></OperationMenu>
-		</a-layout-header>
+		</div>
 		<div class="middle-wrapper">
 			<!-- 面包屑导航栏 -->
 			<BreadCrumb
@@ -24,8 +23,8 @@
 			:fileType="fileType"
 			:filePath="filePath"
 			:fileList="fileList"
-			v-model:loading="loading"
-			v-if="fileModel === 0 && fileType !== 12 && fileType !== 13 && fileType !== 14 && fileType !== 15"
+			:loading="loading"
+			v-if="fileModel === 0"
 			@getTableDataByType="getTableDataByType"
 			@contextmenu="handleClickRight"
 		></FileTable>
@@ -35,7 +34,7 @@
 			:filePath="filePath"
 			:fileList="fileList"
 			:loading="loading"
-			v-if="fileModel === 1 && fileType !== 12 && fileType !== 13 && fileType !== 14 && fileType !== 15"
+			v-if="fileModel === 1"
 			@getTableDataByType="getTableDataByType"
 			@contextmenu="handleClickRight"
 		></FileGrid>
@@ -43,48 +42,25 @@
 		<FileTimeLine
 			class="image-model"
 			:fileList="fileList"
-			v-model:loading="loading"
+			:loading="loading"
 			v-if="fileModel === 2 && fileType === 1"
 			@getTableDataByType="getTableDataByType"
 			@contextmenu="handleClickRight"
 		></FileTimeLine>
-		<!-- 敏感词管理 -->
-		<SensitiveList :tableData="sensitiveListData" v-if="fileType === 12" @addSensitiveSuccess="addSensitiveSuccess" />
-		<!-- 敏感词管理记录 -->
-		<SensitiveListManage :tableData="sensitiveRecordsData" v-if="fileType === 13" @delRecords="delRecords" />
-		<!-- 跨网传输 -->
-		<TransferList :tableData="transferData" v-if="fileType === 14" @delTransferList="delTransferList" />
-		<!-- 企业云盘 -->
-		<EnterpriseDisk
-			:fileType="fileType"
-			:filePath="filePath"
-			:fileList="fileList"
-			v-model:loading="loading"
-			:tableData="fileList"
-			v-if="fileType === 15"
-			@enterpriseDiskList="enterpriseDiskList"
-			@contextmenu="handleClickRight"
-		/>
 		<div class="pagination-wrapper">
-			<div class="current-page-count" v-if="fileType == 12">当前页{{ sensitiveListData.length }}条</div>
-			<div class="current-page-count" v-else-if="fileType == 13">当前页{{ sensitiveRecordsData.length }}条</div>
-			<div class="current-page-count" v-else-if="fileType == 14">当前页{{ transferData.length }}条</div>
-			<!-- <div class="current-page-count" v-else-if="fileType == 15">
-				当前页{{ enterpriseDiskData.length }}条
-			</div> -->
-			<div class="current-page-count" v-else>当前页{{ fileList.length }}条</div>
+			<div class="current-page-count">当前页{{ fileList.length }}条</div>
 			<!-- 回收站不展示分页组件 -->
 			<a-pagination
-				:current="pageData.currentPage"
-				:page-size="pageData.pageCount"
+				v-model:current="pageData.currentPage"
+				v-model:pageSize="pageData.pageCount"
 				:total="pageData.total"
-				:page-size-options="['10', '50', '100', '200']"
-				:show-total="(total) => `总共 ${total} 条`"
-				:show-size-changer="screenWidth > 768"
-				:show-quick-jumper="screenWidth <= 768"
+				:pageSizeOptions="[10, 50, 100, 200]"
+				showSizeChanger
+				:showTotal="(total) => `共 ${total} 条`"
+				showQuickJumper
+				v-if="fileType !== 6"
 				@change="handleCurrentChange"
 				@showSizeChange="handleSizeChange"
-				v-if="fileType !== 6"
 			>
 			</a-pagination>
 		</div>
@@ -92,116 +68,102 @@
 </template>
 
 <script setup>
-	import { ref, reactive, computed, watch, onMounted, getCurrentInstance } from 'vue'
-	import { useRoute } from 'vue-router'
-	import { useMyResourceStore } from '@/store/myResource'
+	import { ref, computed, watch, onMounted } from 'vue'
+	import { useRouter, useRoute } from 'vue-router'
 	import { message } from 'ant-design-vue'
+	import OperationMenu from '@/views/myResource/components/OperationMenu.vue'
+	import BreadCrumb from '@/views/myResource/common/BreadCrumb.vue'
+	import FileTable from '@/views/myResource/common/FileTable.vue'
+	import FileGrid from '@/views/myResource/components/FileGrid.vue'
+	import FileTimeLine from '@/views/myResource/components/FileTimeLine.vue'
+	import { useMyResourceStore } from '@/store/myResource'
 
-	import OperationMenu from '../../components/OperationMenu.vue'
-	import BreadCrumb from '../../common/BreadCrumb.vue'
-	import FileTable from '../../common/FileTable.vue'
-	import FileGrid from '../../components/FileGrid.vue'
-	import FileTimeLine from '../../components/FileTimeLine.vue'
-
-	import SensitiveList from '../../components/SensitiveList.vue'
-	import SensitiveListManage from '../../components/SensitiveListManage.vue'
-	import TransferList from '../../components/TransferList.vue'
-	import EnterpriseDisk from '../../components/EnterpriseDisk.vue'
 	import {
 		getFileListByPath,
 		getFileListByType,
 		getRecoveryFile,
 		getMyShareFileList,
-		getSensitiveList,
-		searchByFileName,
-		getSensitiveRecord,
-		getTransferRecord,
-		getEnterpriseDiskList
-	} from '@/api/myResource/file.js'
-
+		searchFile
+	} from '@/api/myResource/file'
+	const { proxy } = getCurrentInstance()
 	const route = useRoute()
+	const router = useRouter()
 	const myResourceStore = useMyResourceStore()
-	const { proxy } = getCurrentInstance()
-	console.log('proxy.$openBox---', proxy.$openBox)
+
 	const fileNameSearch = ref('')
-	const loading = ref(true) //  表格数据-loading
-	const fileList = ref([]) //  表格数据-文件列表
+	const loading = ref(true) // 表格数据-loading
+	const fileList = ref([]) // 表格数据-文件列表
+
 	// 分页数据
-	const pageData = reactive({
+	const pageData = ref({
 		currentPage: 1,
 		pageCount: 50,
 		total: 0
 	})
-	const sensitiveListData = ref([])
-	const sensitiveRecordsData = ref([])
-	const transferData = ref([])
-	const enterpriseDiskData = ref([])
 
 	// 左侧菜单选中的文件类型
 	const fileType = computed(() => {
 		return route.query.fileType ? Number(route.query.fileType) : 0
 	})
+
 	// 当前所在路径
 	const filePath = computed(() => {
 		return route.query.filePath ? route.query.filePath : '/'
 	})
+
 	// 文件查看模式 0列表模式 1网格模式 2 时间线模式
 	const fileModel = computed(() => {
-		return myResourceStore.fileModel
+		return myResourceStore.getFileModel
 	})
-	console.log('fileModel---', fileModel.value)
+
 	// 屏幕宽度
 	const screenWidth = computed(() => {
 		return myResourceStore.screenWidth
 	})
 
-	watch(filePath, () => {
-		// 当左侧菜单选择“全部”或“我的分享”,文件路径发生变化时,再重新获取文件列表
-		if (route.name === 'File' && [0, 8].includes(fileType.value)) {
-			setPageCount()
-			getTableDataByType()
+	// 监听路径变化
+	watch(
+		() => filePath.value,
+		() => {
+			// 当左侧菜单选择"全部"或"我的分享",文件路径发生变化时,再重新获取文件列表
+			if (route.name === 'resourceLibrary' && [0, 8].includes(fileType.value)) {
+				setPageCount()
+				getTableDataByType()
+			}
 		}
-	})
+	)
 
-	watch(fileType, () => {
-		if (route.name === 'File') {
-			setPageCount()
-			getTableDataByType()
+	// 监听文件类型变化
+	watch(
+		() => fileType.value,
+		() => {
+			if (route.name === 'resourceLibrary') {
+				setPageCount()
+				getTableDataByType()
+			}
 		}
-	})
+	)
 
 	// 监听文件查看模式
-	watch(fileModel, () => {
-		setPageCount()
-	})
+	watch(
+		() => fileModel.value,
+		() => {
+			setPageCount()
+		}
+	)
 
 	onMounted(() => {
 		setPageCount()
 		getTableDataByType()
 	})
 
-	const delRecords = () => {
-		getSensitiveRecordData()
-	}
-	const delTransferList = () => {
-		getTransferListData()
-	}
-	const addSensitiveSuccess = () => {
-		getSensitiveListData()
-	}
-	// 企业云盘
-	const enterpriseDiskList = () => {
-		getEnterpriseDisk()
-	}
 	/**
 	 * 文件展示区域的空白处右键事件
 	 * @param {Document} event 右键事件对象
 	 */
 	const handleClickRight = (event) => {
-		console.log('右键事件', proxy.$openBox)
 		event.preventDefault()
-		console.log('fileType.value---', fileType.value)
-
+		console.log('proxy', proxy)
 		// 只有在全部页面才可以进行以下操作
 		if (![6, 8].includes(fileType.value)) {
 			proxy.$openBox
@@ -212,57 +174,46 @@
 				})
 				.then((res) => {
 					if (res === 'confirm') {
-						getTableDataByType() //  刷新文件列表
-						myResourceStore.showStorage() //  刷新存储容量
+						getTableDataByType() // 刷新文件列表
+						myResourceStore.showStorage() // 刷新存储容量
 					}
 				})
 		}
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 调整分页大小
 	 */
 	const setPageCount = () => {
-		pageData.currentPage = 1
-		if (myResourceStore.fileModel === 0) {
-			pageData.pageCount = 50
-		}
-		if (myResourceStore.fileModel === 1) {
-			pageData.pageCount = 100
+		pageData.value.currentPage = 1
+		if (fileModel.value === 0) {
+			pageData.value.pageCount = 50
 		}
-		if (fileType.value == 12 || fileType.value == 13) {
-			pageData.pageCount = 10
+		if (fileModel.value === 1) {
+			pageData.value.pageCount = 100
 		}
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 获取文件列表数据
 	 */
 	const getTableDataByType = () => {
-		console.log('事件执行。。。', fileType.value)
 		loading.value = true
 		// 分类型
 		if (Number(fileType.value)) {
 			switch (Number(fileType.value)) {
-				case 6:
-					showFileRecovery() //  回收站
-					break
-				case 8:
-					showMyShareFile() //  我的分享
+				case 6: {
+					showFileRecovery() // 回收站
 					break
-				case 12: //敏感词
-					getSensitiveListData()
+				}
+				case 8: {
+					showMyShareFile() // 我的分享
 					break
-				case 13: //敏感词记录过滤
-					getSensitiveRecordData()
-					break
-				case 14: //跨网传输
-					getTransferListData()
-					break
-				case 15: //企业云盘
-					getEnterpriseDisk()
-					break
-				default:
+				}
+				default: {
 					showFileList()
 					break
+				}
 			}
 		} else {
 			// 全部文件
@@ -270,6 +221,7 @@
 		}
 		myResourceStore.showStorage()
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 获取当前路径下的文件列表
 	 */
@@ -277,34 +229,36 @@
 		let data = {
 			fileType: fileType.value,
 			filePath: filePath.value,
-			currentPage: pageData.currentPage,
-			pageCount: pageData.pageCount
+			currentPage: pageData.value.currentPage,
+			pageCount: pageData.value.pageCount
 		}
 		getFileListByPath(data).then((res) => {
-			console.log('res---', res)
 			if (res.success) {
 				fileList.value = res.dataList
-				pageData.total = Number(res.total)
+				pageData.value.total = Number(res.total)
 				loading.value = false
 			} else {
 				message.error(res.message)
 			}
 		})
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 分页组件 | 当前页码改变
 	 */
 	const handleCurrentChange = (currentPage) => {
-		pageData.currentPage = currentPage
+		pageData.value.currentPage = currentPage
 		getTableDataByType()
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 分页组件 | 页大小改变时
 	 */
-	const handleSizeChange = (current, pageSize) => {
-		pageData.pageCount = pageSize
+	const handleSizeChange = (pageSize) => {
+		pageData.value.pageCount = pageSize
 		getTableDataByType()
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 获取回收站文件列表
 	 */
@@ -318,6 +272,7 @@
 			}
 		})
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 获取我的分享列表
 	 */
@@ -325,33 +280,34 @@
 		let data = {
 			shareFilePath: filePath.value,
 			shareBatchNum: route.query.shareBatchNum,
-			currentPage: pageData.currentPage,
-			pageCount: pageData.pageCount
+			currentPage: pageData.value.currentPage,
+			pageCount: pageData.value.pageCount
 		}
 		getMyShareFileList(data).then((res) => {
 			if (res.success) {
 				fileList.value = res.dataList
-				pageData.total = Number(res.total)
+				pageData.value.total = Number(res.total)
 				loading.value = false
 			} else {
 				message.error(res.message)
 			}
 		})
 	}
+
 	/**
 	 * 表格数据获取相关事件 | 根据文件类型展示文件列表
 	 */
 	const showFileListByType = () => {
-		//  分类型
+		// 分类型
 		let data = {
 			fileType: fileType.value,
-			currentPage: pageData.currentPage,
-			pageCount: pageData.pageCount
+			currentPage: pageData.value.currentPage,
+			pageCount: pageData.value.pageCount
 		}
 		getFileListByType(data).then((res) => {
 			if (res.success) {
 				fileList.value = res.dataList
-				pageData.total = Number(res.total)
+				pageData.value.total = Number(res.total)
 				loading.value = false
 			} else {
 				message.error(res.message)
@@ -365,88 +321,20 @@
 	 */
 	const getSearchFileList = (fileName) => {
 		loading.value = true
-		searchByFileName({
-			currentPage: pageData.currentPage,
-			pageCount: pageData.pageCount,
+		searchFile({
+			currentPage: pageData.value.currentPage,
+			pageCount: pageData.value.pageCount,
 			fileName: fileName
 		}).then((res) => {
 			loading.value = false
 			if (res.success) {
 				fileList.value = res.dataList.map((item) => {
 					return {
-						...item
-						// highlightFields: item.highLight.fileName[0]
+						...item,
+						highlightFields: item.highLight.fileName[0]
 					}
 				})
-				// pageData.total = res.data.totalHits
-				pageData.total = res.total
-			} else {
-				message.error(res.message)
-			}
-		})
-	}
-	//获取敏感词刘表
-	const getSensitiveListData = () => {
-		getSensitiveList({
-			page: pageData.currentPage,
-			pageSize: pageData.pageCount
-		}).then((res) => {
-			console.log(res)
-
-			sensitiveListData.value = res.dataList
-
-			pageData.total = res.total
-		})
-	}
-	const getSensitiveRecordData = () => {
-		getSensitiveRecord({
-			page: pageData.currentPage,
-			pageSize: pageData.pageCount
-		}).then((res) => {
-			for (let item of res.dataList) {
-				let date = new Date(item.createTime)
-				console.log(date.getMonth())
-				item.createTime =
-					date.getFullYear() +
-					'-' +
-					(date.getMonth() + 1).toString().padStart(2, 0) +
-					'-' +
-					date.getDay().toString().padStart(2, 0) +
-					' ' +
-					date.getHours().toString().padStart(2, 0) +
-					':' +
-					date.getMinutes().toString().padStart(2, 0) +
-					':' +
-					date.getSeconds().toString().padStart(2, 0)
-			}
-			sensitiveRecordsData.value = res.dataList
-
-			pageData.total = res.total
-		})
-	}
-	const getTransferListData = () => {
-		getTransferRecord({
-			page: pageData.currentPage,
-			pageSize: pageData.pageCount
-		}).then((res) => {
-			transferData.value = res.dataList
-			pageData.total = res.total
-		})
-	}
-	// 企业云盘的列表
-	const getEnterpriseDisk = () => {
-		fileList.value = []
-		let data = {
-			fileType: 0,
-			filePath: filePath.value,
-			currentPage: pageData.currentPage,
-			pageCount: pageData.pageCount
-		}
-		getEnterpriseDiskList(data).then((res) => {
-			if (res.success) {
-				fileList.value = res.dataList
-				pageData.total = Number(res.total)
-				loading.value = false
+				pageData.value.total = res.data.totalHits
 			} else {
 				message.error(res.message)
 			}
@@ -458,34 +346,29 @@
 	@import '@/style/myResource/varibles.less';
 
 	.file-list-wrapper {
-		:deep(.ant-layout-header) {
+		.header {
 			padding: 0;
 		}
+
 		.middle-wrapper {
 			margin-bottom: 8px;
-			margin-top: 10px;
 		}
+
 		.pagination-wrapper {
 			position: relative;
-			border-top: 1px solid @border-base;
+			border-top: 1px solid @BorderBase;
 			height: 44px;
 			line-height: 44px;
 			text-align: center;
+
 			.current-page-count {
 				position: absolute;
 				left: 16px;
 				height: 32px;
 				line-height: 32px;
 				font-size: 13px;
-				color: @regular-text;
+				color: @RegularText;
 			}
 		}
 	}
-	:deep(.ant-pagination-item-active) {
-		color: #29175b;
-		cursor: default;
-	}
-	:deep(.ant-pagination-item:hover) {
-		color: #29175b;
-	}
 </style>

+ 3 - 3
vite.config.js

@@ -53,10 +53,10 @@ export default defineConfig(({ command, mode }) => {
 			port: envConfig.VITE_PORT,
 			proxy: {
 				'/api': {
-					target: envConfig.VITE_API_BASEURL,
+					target: 'http://192.168.31.80:9003',
 					ws: false,
-					changeOrigin: true,
-					rewrite: (path) => path.replace(/^\/api/, '')
+					changeOrigin: true
+					// rewrite: (path) => path.replace(/^\/api/, '')
 				}
 			}
 		},