|
@@ -23,6 +23,7 @@
|
|
<el-option
|
|
<el-option
|
|
v-for="(item, index) in [
|
|
v-for="(item, index) in [
|
|
$t('mediaLibrary.fileType.0'),
|
|
$t('mediaLibrary.fileType.0'),
|
|
|
|
+ $t('mediaLibrary.fileType.1'),
|
|
$t('mediaLibrary.fileType.2'),
|
|
$t('mediaLibrary.fileType.2'),
|
|
$t('mediaLibrary.fileType.3'),
|
|
$t('mediaLibrary.fileType.3'),
|
|
$t('mediaLibrary.fileType.4'),
|
|
$t('mediaLibrary.fileType.4'),
|
|
@@ -50,8 +51,8 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item style="float: right; margin-right: 0">
|
|
<el-form-item style="float: right; margin-right: 0">
|
|
- <el-button @click="windowOpen({type: 'photography'})">{{$t('mediaLibrary.photography')}}</el-button>
|
|
|
|
- <el-button @click="windowOpen({type: 'modeling'})">{{$t('mediaLibrary.Modeling')}}</el-button>
|
|
|
|
|
|
+ <el-button @click="windowOpen({type: 'photography', library: true})">{{$t('mediaLibrary.photography')}}</el-button>
|
|
|
|
+ <el-button @click="windowOpen({type: 'modeling', library: true})">{{$t('mediaLibrary.Modeling')}}</el-button>
|
|
<el-button type="primary" @click="handleAddfz">{{$t('mediaLibrary.grouping')}}</el-button>
|
|
<el-button type="primary" @click="handleAddfz">{{$t('mediaLibrary.grouping')}}</el-button>
|
|
<el-button type="primary" @click="handleAdd">{{$t('mediaLibrary.upload')}}</el-button>
|
|
<el-button type="primary" @click="handleAdd">{{$t('mediaLibrary.upload')}}</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -68,7 +69,7 @@
|
|
<el-table-column prop="name" :label="$t('program.case.title')" min-width="300px">
|
|
<el-table-column prop="name" :label="$t('program.case.title')" min-width="300px">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<a
|
|
<a
|
|
- style="color: var(--primaryColor)"
|
|
|
|
|
|
+ style="color: var(--primaryColor);cursor: pointer;"
|
|
v-if="scope.row.fileUrl"
|
|
v-if="scope.row.fileUrl"
|
|
target="_blank"
|
|
target="_blank"
|
|
:title="scope.row.name"
|
|
:title="scope.row.name"
|
|
@@ -210,13 +211,29 @@
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <!-- //查看资源下载 -->
|
|
|
|
+ <el-dialog v-model="dialogDowm.show" title="资源查看" :width="dialogDowm.type == 4?800:600">
|
|
|
|
+ <div class="showContent">
|
|
|
|
+ <img style="width: 100%;object-fit: cover;" :src="dialogDowm.url" alt="" v-if="dialogDowm.type == 0"/>
|
|
|
|
+ <video controls style="width: 100%;object-fit: cover;" :style="{height:dialogDowm.type == 2?'50px':'auto'}":src="dialogDowm.url" alt="" v-else-if="dialogDowm.type == 1 || dialogDowm.type == 2"/>
|
|
|
|
+ <iframe style="width: 100%; height: 400px" v-else :src="dialogDowm.url" frameborder="0"></iframe>
|
|
|
|
+ </div>
|
|
|
|
+ <template #footer>
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogDowm.show = false">{{$t('sys.cancel')}}</el-button>
|
|
|
|
+ <el-button v-if="dialogDowm.type == 0" type="primary" @click="hanleDown">
|
|
|
|
+ 下载
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import { Search } from "@element-plus/icons-vue";
|
|
import { Search } from "@element-plus/icons-vue";
|
|
import { ref, watch, onMounted } from "vue";
|
|
import { ref, watch, onMounted } from "vue";
|
|
-import { getByKeyList, getfzdel, getdictFiledel, getaddOrUpdate, setFileaddOrUpdate, uploadFile } from "@/store/case";
|
|
|
|
|
|
+import { getByKeyList, getfzdel, getdictFiledel, getaddOrUpdate, setFileaddOrUpdate, uploadFile, getUrlSrc } from "@/store/case";
|
|
import dayjs from "dayjs";
|
|
import dayjs from "dayjs";
|
|
import obj from "@/assets/images/obj.jpg";
|
|
import obj from "@/assets/images/obj.jpg";
|
|
import osgb from "@/assets/images/osgb.jpg";
|
|
import osgb from "@/assets/images/osgb.jpg";
|
|
@@ -251,6 +268,12 @@ const addForm = ref({
|
|
dictId: "",
|
|
dictId: "",
|
|
name: "",
|
|
name: "",
|
|
});
|
|
});
|
|
|
|
+const dialogDowm = ref({
|
|
|
|
+ show: false,
|
|
|
|
+ url: '',
|
|
|
|
+ type: '',
|
|
|
|
+ data: {},
|
|
|
|
+});
|
|
const dialogData = ref({
|
|
const dialogData = ref({
|
|
show: false,
|
|
show: false,
|
|
title: ui18n.t('sys.upload'),
|
|
title: ui18n.t('sys.upload'),
|
|
@@ -422,11 +445,16 @@ const initData = async () => {
|
|
total.value = totalCount;
|
|
total.value = totalCount;
|
|
};
|
|
};
|
|
const floadileUrl = (record) => {
|
|
const floadileUrl = (record) => {
|
|
|
|
+ dialogDowm.value.show = true;
|
|
|
|
+ dialogDowm.value.type = record.fileType;
|
|
|
|
+ dialogDowm.value.data = record;
|
|
if (record.fileType == 3) {
|
|
if (record.fileType == 3) {
|
|
- let url = `/code/index.html?title=${record.fileName}&type=${record.fileFormat}&fileUrl=${record.fileUrl}#/sign-model`;
|
|
|
|
- return windowOpen(url);
|
|
|
|
|
|
+ // let url = `/code/index.html?title=${record.fileName}&type=${record.fileFormat}&fileUrl=${record.fileUrl}#/sign-model`;
|
|
|
|
+ dialogDowm.value.url = getUrlSrc({...record, type: 101});
|
|
|
|
+ return windowOpen({url, library: true});
|
|
} else {
|
|
} else {
|
|
- return windowOpen(record.fileUrl);
|
|
|
|
|
|
+ dialogDowm.value.url = getUrlSrc({type: 102}) +'/'+ record.fileUrl;
|
|
|
|
+ // return windowOpen({url: record.fileUrl, library: true});
|
|
}
|
|
}
|
|
};
|
|
};
|
|
const beforeUpload = (file) => {
|
|
const beforeUpload = (file) => {
|
|
@@ -466,7 +494,15 @@ const handleCurrentChange = (newPage) => {
|
|
currentPage.value = newPage;
|
|
currentPage.value = newPage;
|
|
initData();
|
|
initData();
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+// 下载资源
|
|
|
|
+const hanleDown = () => {
|
|
|
|
+ const item = dialogDowm.value.data;
|
|
|
|
+ const a = document.createElement('a');
|
|
|
|
+ a.href = dialogDowm.value.url;
|
|
|
|
+ a.download = `${item.name}.${item.fileFormat}`; // 下载后的文件名
|
|
|
|
+ a.click();
|
|
|
|
+ a.remove();
|
|
|
|
+}
|
|
// 处理搜索按钮点击
|
|
// 处理搜索按钮点击
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
currentPage.value = 1;
|
|
currentPage.value = 1;
|
|
@@ -600,4 +636,11 @@ initData();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+.showContent{
|
|
|
|
+ iframe{
|
|
|
|
+ body:-webkit-full-page-media {
|
|
|
|
+ background-color: none;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
</style>
|
|
</style>
|