提交代码
This commit is contained in:
parent
d68213f110
commit
6d44803d0a
|
@ -276,4 +276,12 @@ export function delPerson(id: string | number | Array<string | number>) {
|
|||
url: '/oss/person/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getVolume = (query?: any): AxiosPromise<any[]> => {
|
||||
return request({
|
||||
url: '/resource/oss/volume',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
|
@ -217,3 +217,10 @@ aside {
|
|||
.w100 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.text-ellipsis {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
word-break: break-all;
|
||||
white-space: nowrap
|
||||
}
|
|
@ -2,12 +2,14 @@
|
|||
<div class="upload-file">
|
||||
<el-upload ref="fileUploadRef" drag multiple :action="uploadFileUrl" :before-upload="handleBeforeUpload"
|
||||
:file-list="fileList" :limit="limit" :on-error="handleUploadError" :on-exceed="handleExceed"
|
||||
:on-success="handleUploadSuccess" :show-file-list="false" :headers="headers" class="upload-file-uploader">
|
||||
:on-progress="uploadVideoProcess" :on-success="handleUploadSuccess" :show-file-list="false" :headers="headers"
|
||||
class="upload-file-uploader">
|
||||
<el-icon class="el-icon--upload"><upload-filled color="#FF4D4F" /></el-icon>
|
||||
<div class="el-upload__text">
|
||||
请将文件拖拽到此处上传 <em>点击上传</em>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-progress v-if="progressFlag" :percentage="loadProgress"></el-progress>
|
||||
<!-- 上传提示 -->
|
||||
<div v-if="showTip" class="el-upload__tip">
|
||||
支持上传
|
||||
|
@ -66,6 +68,20 @@ const showTip = computed(() => props.isShowTip && (props.fileType || props.fileS
|
|||
|
||||
const fileUploadRef = ref<ElUploadInstance>();
|
||||
|
||||
const loadProgress = ref(0) // 动态显示进度条
|
||||
const progressFlag = ref(false) // 关闭进度条
|
||||
|
||||
const uploadVideoProcess = (event, file, fileList) => {
|
||||
progressFlag.value = true
|
||||
loadProgress.value = parseInt(event.percent) // 动态获取文件上传进度
|
||||
if (loadProgress.value >= 100) {
|
||||
loadProgress.value = 100
|
||||
// setTimeout(() => {
|
||||
// progressFlag.value = false
|
||||
// }, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modelValue,
|
||||
async (val: any) => {
|
||||
|
@ -187,6 +203,7 @@ const handleExceed = () => {
|
|||
// 上传失败
|
||||
const handleUploadError = () => {
|
||||
proxy?.$modal.msgError('上传文件失败');
|
||||
progressFlag.value = false
|
||||
};
|
||||
|
||||
// 上传成功回调
|
||||
|
@ -205,6 +222,7 @@ const handleUploadSuccess = (res: any, file: UploadFile) => {
|
|||
fileUploadRef.value?.handleRemove(file);
|
||||
uploadedSuccessfully();
|
||||
}
|
||||
progressFlag.value = false
|
||||
};
|
||||
|
||||
// 删除文件
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
import { ref, onMounted } from 'vue'
|
||||
import { getVolume } from '@/api/system/oss'
|
||||
|
||||
export function useVolume(type: number) {
|
||||
const volume = ref<any>()
|
||||
|
||||
const getVolumeData = async () => {
|
||||
const res = await getVolume({ type })
|
||||
volume.value = res.data
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getVolumeData()
|
||||
})
|
||||
|
||||
return {
|
||||
volume
|
||||
}
|
||||
}
|
|
@ -79,6 +79,8 @@ const openSearchMenu = () => {
|
|||
const dynamicTenantEvent = async (tenantId: string) => {
|
||||
if (companyName.value != null && companyName.value !== '') {
|
||||
await dynamicTenant(tenantId);
|
||||
userStore.setenantId(tenantId)
|
||||
|
||||
dynamic.value = true;
|
||||
proxy?.$tab.closeAllPage();
|
||||
proxy?.$router.push('/');
|
||||
|
@ -116,7 +118,7 @@ const logout = async () => {
|
|||
type: 'warning'
|
||||
});
|
||||
await userStore.logout();
|
||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + '/index';
|
||||
};
|
||||
|
||||
const emits = defineEmits(['setLayout']);
|
||||
|
|
|
@ -71,7 +71,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||
path: '/index',
|
||||
component: () => import('@/views/index.vue'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true}
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true, noCache: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@ export const useUserStore = defineStore('user', () => {
|
|||
const name = ref('');
|
||||
const nickname = ref('');
|
||||
const userId = ref<string | number>('');
|
||||
const tenantId = ref('');
|
||||
const avatar = ref('');
|
||||
const roles = ref<Array<string>>([]); // 用户角色编码集合 → 判断路由权限
|
||||
const permissions = ref<Array<string>>([]); // 用户权限编码集合 → 判断按钮权限
|
||||
|
@ -67,7 +68,13 @@ export const useUserStore = defineStore('user', () => {
|
|||
avatar.value = value;
|
||||
};
|
||||
|
||||
const setenantId = (value: any) => {
|
||||
tenantId.value = value
|
||||
}
|
||||
|
||||
return {
|
||||
tenantId,
|
||||
setenantId,
|
||||
userId,
|
||||
token,
|
||||
nickname,
|
||||
|
|
|
@ -176,6 +176,8 @@
|
|||
</template>
|
||||
|
||||
<script setup name="Index" lang="ts">
|
||||
import { watch } from 'vue'
|
||||
import useUserStore from '@/store/modules/user';
|
||||
import * as echarts from 'echarts';
|
||||
import { use } from 'echarts/core'
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
|
@ -186,6 +188,7 @@ import VChart from 'vue-echarts'
|
|||
import { getGradeNum, getClassNum, getTeacherNum, getOssNum, getOssUseRank, getOssType } from '@/api/index'
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const userStore = useUserStore()
|
||||
|
||||
use([
|
||||
CanvasRenderer,
|
||||
|
@ -276,6 +279,12 @@ onMounted(() => {
|
|||
getOssTypeData()
|
||||
})
|
||||
|
||||
watch(() => userStore.tenantId, (newVal, oldVal) => {
|
||||
initNum()
|
||||
getOssUseRankData()
|
||||
getOssTypeData()
|
||||
})
|
||||
|
||||
const pieOption = ref({
|
||||
title: {
|
||||
text: '资源总数',
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col v-if="isUpload" :span="1.5">
|
||||
<el-button v-hasPermi="['system:oss:upload']" type="primary" plain icon="Upload"
|
||||
@click="handleFile">上传课件</el-button>
|
||||
<el-button type="primary" plain icon="Upload"
|
||||
@click="handleFile">上传文件</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['system:oss:remove']" type="danger" plain icon="Delete" :disabled="multiple"
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple"
|
||||
@click="handleDelete()">
|
||||
删除
|
||||
</el-button>
|
||||
|
@ -57,7 +57,7 @@
|
|||
<el-tooltip content="预览" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-hasPermi="['system:oss:download']" content="下载" placement="top">
|
||||
<el-tooltip content="下载" placement="top">
|
||||
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)">下载</el-button>
|
||||
</el-tooltip>
|
||||
|
||||
|
@ -68,7 +68,7 @@
|
|||
<el-button link type="primary" icon="DocumentCopy" @click="handleCopy(scope.row)">复制</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button v-hasPermi="['system:oss:remove']" link type="primary" icon="Delete"
|
||||
<el-button link type="primary" icon="Delete"
|
||||
@click="handleDelete(scope.row)">删除</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
|
@ -115,7 +115,7 @@
|
|||
v-if="imgSuffix.includes(currentFile.fileSuffix)" :src="imgUrl" />
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="treeMoveDialog.visible" :title="treeMoveDialog.title" width="500px" append-to-body>
|
||||
<el-dialog v-model="treeMoveDialog.visible" :title="treeMoveDialog.title" width="500px" append-to-body @closed="handlePreviewClose">
|
||||
<el-form ref="treeMoveFormRef" :model="treeMoveForm" :rules="treeMoveRules">
|
||||
<el-form-item label="移动至" prop="catalogId">
|
||||
<el-tree-select v-model="treeMoveForm.catalogId" :data="treeData"
|
||||
|
@ -417,13 +417,15 @@ const options = ref({
|
|||
transformData: (workbookData) => { return workbookData }, //将获取到的excel数据进行处理之后且渲染到页面之前,可通过transformData对即将渲染的数据及样式进行修改,此时每个单元格的text值就是即将渲染到页面上的内容
|
||||
})
|
||||
|
||||
const fileLoading = ref(false)
|
||||
const currentFile = ref()
|
||||
const file = ref('')
|
||||
const fileLoading = ref(false)
|
||||
const txt = ref('')
|
||||
const imgUrl = ref('')
|
||||
const handlePreview = async (row: any) => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
fileLoading.value = true
|
||||
previewDialog.visible = true
|
||||
currentFile.value = row
|
||||
|
@ -447,6 +449,7 @@ const handlePreview = async (row: any) => {
|
|||
const handlePreviewClose = () => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
}
|
||||
|
||||
const getlistCatalogPerson = async () => {
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()"
|
||||
v-hasPermi="['resource:catalogPerson:add']">新增</el-button>
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||
|
@ -27,28 +26,34 @@
|
|||
<el-table ref="catalogPersonTableRef" @row-click="handleRowClick" v-loading="loading"
|
||||
:data="catalogPersonList" row-key="catalogId" :default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column label="分类名称" align="left" prop="catalogName" />
|
||||
<el-table-column label="分类名称" align="left" prop="catalogName">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top-start" title="分类名称" :width="200" trigger="hover"
|
||||
:content="scope.row.catalogName">
|
||||
<template #reference>
|
||||
<span class="text-ellipsis">{{ scope.row.catalogName }}</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['resource:catalogPerson:edit']" />
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="新增" placement="top">
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)"
|
||||
v-hasPermi="['resource:catalogPerson:add']" />
|
||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" />
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['resource:catalogPerson:remove']" />
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" />
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>资源空间:639.7MB / 1TB</span>
|
||||
<div class="bottom" v-if="volume">
|
||||
<span>资源空间:{{ volume.useVolume }}MB / {{ volume.totalVolume }}TB</span>
|
||||
<el-progress :percentage="55" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -85,7 +90,7 @@
|
|||
import { listCatalogPerson, getCatalogPerson, delCatalogPerson, addCatalogPerson, updateCatalogPerson } from "@/api/resource/catalogPerson";
|
||||
import { CatalogPersonVO, CatalogPersonQuery, CatalogPersonForm } from '@/api/resource/catalogPerson/types';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
|
||||
import { useVolume } from "@/composables/useVolume";
|
||||
import FileList from "./components/FileList.vue";
|
||||
|
||||
type CatalogPersonOption = {
|
||||
|
@ -96,6 +101,8 @@ type CatalogPersonOption = {
|
|||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const { volume } = useVolume(2);
|
||||
|
||||
const userStore = useUserStore();
|
||||
const catalogPersonList = ref<CatalogPersonVO[]>([]);
|
||||
const catalogPersonOptions = ref<CatalogPersonOption[]>([]);
|
||||
|
@ -268,6 +275,7 @@ const handleDelete = async (row: CatalogPersonVO) => {
|
|||
proxy?.$modal.msgSuccess("删除成功");
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
|
|
@ -35,7 +35,16 @@
|
|||
<el-table ref="catalogResourceTableRef" @row-click="handleNodeClick" v-loading="loading"
|
||||
:data="catalogResourceList" row-key="catalogId" :default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column label="专题名称" align="left" prop="catalogName" />
|
||||
<el-table-column label="专题名称" align="left" prop="catalogName">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top-start" title="专题名称" :width="200" trigger="hover"
|
||||
:content="scope.row.catalogName">
|
||||
<template #reference>
|
||||
<span class="text-ellipsis">{{ scope.row.catalogName }}</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
|
|
|
@ -35,7 +35,16 @@
|
|||
<el-table ref="catalogTextbookTableRef" @row-click="handleNodeClick" v-loading="loading"
|
||||
:data="catalogTextbookList" row-key="catalogId" :default-expand-all="isExpandAll"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column label="教材名称" align="left" prop="catalogName" />
|
||||
<el-table-column label="教材名称" align="left" prop="catalogName">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top-start" title="教材名称" :width="200" trigger="hover"
|
||||
:content="scope.row.catalogName">
|
||||
<template #reference>
|
||||
<span class="text-ellipsis">{{ scope.row.catalogName }}</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="目录类型" align="center" prop="type" width="100">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.type === 1" type="success">主目录</el-tag>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<el-tree ref="treeRef" v-loading="treeLoading" :data="treeData" :props="defaultProps" default-expand-all
|
||||
@node-click="handleNode" />
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>资源空间:639.7MB / 1TB</span>
|
||||
<div class="bottom" v-if="volume">
|
||||
<span>资源空间:{{ volume.useVolume }}MB / {{ volume.totalVolume }}TB</span>
|
||||
<el-progress :percentage="55" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<el-row :gutter="10" class="mb8">
|
||||
<el-col v-if="isUpload" :span="1.5">
|
||||
<el-button v-hasPermi="['file:resource:add']" type="primary" plain icon="Upload"
|
||||
@click="handleFile">上传课件</el-button>
|
||||
@click="handleFile">上传文件</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['file:resource:remove']" type="danger" plain icon="Delete" :disabled="multiple"
|
||||
|
@ -75,14 +75,16 @@
|
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="350">
|
||||
<template #default="scope">
|
||||
|
||||
<el-tooltip v-hasPermi="['file:resource:review']" v-if="isAudit" content="审核通过" placement="top">
|
||||
<el-button link type="primary" icon="CopyDocument"
|
||||
@click="handleAuditBtn(scope.row, 1)">审核通过</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-hasPermi="['file:resource:review']" v-if="isAudit" content="审核不通过" placement="top">
|
||||
<el-button link type="primary" icon="DocumentCopy"
|
||||
@click="handleAuditBtn(scope.row, 0)">审核不通过</el-button>
|
||||
</el-tooltip>
|
||||
<span v-hasPermi="['file:resource:review']">
|
||||
<el-tooltip v-if="isAudit" content="审核通过" placement="top">
|
||||
<el-button link type="primary" icon="CopyDocument"
|
||||
@click="handleAuditBtn(scope.row, 1)">审核通过</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="isAudit" content="审核不通过" placement="top">
|
||||
<el-button link type="primary" icon="DocumentCopy"
|
||||
@click="handleAuditBtn(scope.row, 0)">审核不通过</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
||||
<el-tooltip v-hasPermi="['file:resource:preview']" content="预览" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||
|
@ -125,7 +127,8 @@
|
|||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="previewDialog.visible" :title="previewDialog.title" width="900px" append-to-body @closed="handlePreviewClose">
|
||||
<el-dialog v-model="previewDialog.visible" :title="previewDialog.title" width="900px" append-to-body
|
||||
@closed="handlePreviewClose">
|
||||
<vue-office-docx v-loading="fileLoading" element-loading-text="加载中..."
|
||||
v-if="currentFile.fileSuffix == '.doc' || currentFile.fileSuffix == '.docx'" :src="file" />
|
||||
|
||||
|
@ -189,6 +192,8 @@ import { OssForm, OssQuery, OssVO } from '@/api/system/oss/types';
|
|||
import { listCatalogResource } from "@/api/resource/catalogResource";
|
||||
import { CatalogTextbookVO } from '@/api/resource/catalogTextbook/types';
|
||||
|
||||
import { useVolume } from "@/composables/useVolume";
|
||||
|
||||
//引入VueOfficeDocx组件
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
//引入相关样式
|
||||
|
@ -202,6 +207,8 @@ import VueOfficePdf from '@vue-office/pdf'
|
|||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const { volume } = useVolume(1);
|
||||
|
||||
const fileSuffix = ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf']
|
||||
const imgSuffix = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
|
||||
|
||||
|
@ -529,13 +536,15 @@ const options = ref({
|
|||
transformData: (workbookData) => { return workbookData }, //将获取到的excel数据进行处理之后且渲染到页面之前,可通过transformData对即将渲染的数据及样式进行修改,此时每个单元格的text值就是即将渲染到页面上的内容
|
||||
})
|
||||
|
||||
const fileLoading = ref(false)
|
||||
const currentFile = ref()
|
||||
const file = ref('')
|
||||
const fileLoading = ref(false)
|
||||
const txt = ref('')
|
||||
const imgUrl = ref('')
|
||||
const handlePreview = async (row: any) => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
fileLoading.value = true
|
||||
previewDialog.visible = true
|
||||
currentFile.value = row
|
||||
|
@ -559,6 +568,7 @@ const handlePreview = async (row: any) => {
|
|||
const handlePreviewClose = () => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
}
|
||||
|
||||
const treeLoading = ref(false)
|
||||
|
|
|
@ -10,15 +10,15 @@
|
|||
<el-radio-button label="试卷" :value="4" />
|
||||
</el-radio-group>
|
||||
<div class="line"></div>
|
||||
<el-button type="" text="plain">全部课件</el-button>
|
||||
<el-button type="" text="plain">全部文件</el-button>
|
||||
<br>
|
||||
<el-button v-hasPermi="['file:textbook:awaitList']" :class="['btn-audit', isAudit && 'active']" type=""
|
||||
text="plain" @click="handleAudit">待审核</el-button>
|
||||
<el-tree ref="treeRef" v-loading="treeLoading" :data="treeData" :props="defaultProps" default-expand-all
|
||||
@node-click="handleNode" />
|
||||
</div>
|
||||
<div class="bottom">
|
||||
<span>资源空间:639.7MB / 1TB</span>
|
||||
<div class="bottom" v-if="volume">
|
||||
<span>资源空间:{{ volume.useVolume }}MB / {{ volume.totalVolume }}TB</span>
|
||||
<el-progress :percentage="55" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -55,7 +55,7 @@
|
|||
<el-row :gutter="10" class="mb8">
|
||||
<el-col v-if="isUpload" :span="1.5">
|
||||
<el-button v-hasPermi="['file:textbook:add']" type="primary" plain icon="Upload"
|
||||
@click="handleFile">上传课件</el-button>
|
||||
@click="handleFile">上传文件</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button v-hasPermi="['file:textbook:remove']" type="danger" plain icon="Delete" :disabled="multiple"
|
||||
|
@ -82,14 +82,16 @@
|
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="350">
|
||||
<template #default="scope">
|
||||
|
||||
<el-tooltip v-if="isAudit" v-hasPermi="['file:textbook:review']" content="审核通过" placement="top">
|
||||
<el-button link type="primary" icon="CopyDocument"
|
||||
@click="handleAuditBtn(scope.row, 1)">审核通过</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="isAudit" v-hasPermi="['file:textbook:review']" content="审核不通过" placement="top">
|
||||
<el-button link type="primary" icon="DocumentCopy"
|
||||
@click="handleAuditBtn(scope.row, 0)">审核不通过</el-button>
|
||||
</el-tooltip>
|
||||
<span v-hasPermi="['file:textbook:review']">
|
||||
<el-tooltip v-if="isAudit" content="审核通过" placement="top">
|
||||
<el-button link type="primary" icon="CopyDocument"
|
||||
@click="handleAuditBtn(scope.row, 1)">审核通过</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip v-if="isAudit" content="审核不通过" placement="top">
|
||||
<el-button link type="primary" icon="DocumentCopy"
|
||||
@click="handleAuditBtn(scope.row, 0)">审核不通过</el-button>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
||||
<el-tooltip v-hasPermi="['file:textbook:preview']" content="预览" placement="top">
|
||||
<el-button link type="primary" icon="View" @click="handlePreview(scope.row)">预览</el-button>
|
||||
|
@ -132,7 +134,8 @@
|
|||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="previewDialog.visible" :title="previewDialog.title" width="900px" append-to-body @closed="handlePreviewClose">
|
||||
<el-dialog v-model="previewDialog.visible" :title="previewDialog.title" width="900px" append-to-body
|
||||
@closed="handlePreviewClose">
|
||||
<vue-office-docx v-loading="fileLoading" element-loading-text="加载中..."
|
||||
v-if="currentFile.fileSuffix == '.doc' || currentFile.fileSuffix == '.docx'" :src="file" />
|
||||
|
||||
|
@ -196,6 +199,8 @@ import { OssForm, OssQuery, OssVO } from '@/api/system/oss/types';
|
|||
import { listCatalogTextbook } from "@/api/resource/catalogTextbook";
|
||||
import { CatalogTextbookVO } from '@/api/resource/catalogTextbook/types';
|
||||
|
||||
import { useVolume } from "@/composables/useVolume";
|
||||
|
||||
//引入VueOfficeDocx组件
|
||||
import VueOfficeDocx from '@vue-office/docx'
|
||||
//引入相关样式
|
||||
|
@ -208,6 +213,7 @@ import '@vue-office/excel/lib/index.css'
|
|||
import VueOfficePdf from '@vue-office/pdf'
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { volume } = useVolume(1);
|
||||
|
||||
const fileSuffix = ['.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf']
|
||||
const imgSuffix = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
|
||||
|
@ -507,13 +513,15 @@ const options = ref({
|
|||
transformData: (workbookData) => { return workbookData }, //将获取到的excel数据进行处理之后且渲染到页面之前,可通过transformData对即将渲染的数据及样式进行修改,此时每个单元格的text值就是即将渲染到页面上的内容
|
||||
})
|
||||
|
||||
const fileLoading = ref(false)
|
||||
const currentFile = ref()
|
||||
const file = ref('')
|
||||
const fileLoading = ref(false)
|
||||
const txt = ref('')
|
||||
const imgUrl = ref('')
|
||||
const handlePreview = async (row: any) => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
fileLoading.value = true
|
||||
previewDialog.visible = true
|
||||
currentFile.value = row
|
||||
|
@ -537,6 +545,7 @@ const handlePreview = async (row: any) => {
|
|||
const handlePreviewClose = () => {
|
||||
file.value = ''
|
||||
txt.value = ''
|
||||
imgUrl.value = ''
|
||||
}
|
||||
|
||||
const treeLoading = ref(false)
|
||||
|
|
Loading…
Reference in New Issue