1
0
tangning 5 kuukautta sitten
vanhempi
commit
3648f84991

+ 8 - 5
src/assets/style/custom-element.scss

@@ -12,8 +12,8 @@ html.dark {
   --el-button-border-color: #00C8AF;
   --el-font-size-large: 16px;
   --bgColor: #1B1B1C;
-  .title1{
-    color: #fff;
+  .title1, .title0{
+    color: #fff !important;
   }
   .layer .content .view .main{
     background-color: var(--bgColor);
@@ -21,6 +21,9 @@ html.dark {
   .slide, .el-menu-item{
     background-color: var(--bgColor);
   }
+  .photo .left {
+    background-color: var(--bgColor);
+  }
 }
 
 .el-pagination.is-background .btn-next.is-active,
@@ -54,12 +57,12 @@ html.dark {
   text-align: center;
   justify-content: center;
   .el-button{
-    width: 100px;
+    min-width: 100px;
   }
 }
 .el-form-item__content{
   .el-button{
-    width: 100px;
+    min-width: 100px;
   }
 }
 .el-message-box{
@@ -78,6 +81,6 @@ html.dark {
 
 .el-form-item__content {
   .el-button{
-    width: 60px !important;
+    min-width: 60px !important;
   }
 }

+ 2 - 1
src/store/case.ts

@@ -358,7 +358,8 @@ export const getUrlSrc = (item, caseId) => {
     7: params.swkkUrl,//`/spg.html?m=${item.num}`,
     99: param.fuse + '#/show/summary',//多元融合查看页面`/code/index.html?caseId=${caseId}&single#/show`,
     100: param.fuse + '#/fuseEdit/merge',//多元融合编辑页面`/code/index.html?caseId=${caseId}&single#/show`,
-    101: param.fuse + '#/sign-model',//多元融合模型查看页面`/code/index.html?caseId=${caseId}&single#/show`,
+    101: param.fuse +`title=${item.fileName}&type=${item.fileFormat}&fileUrl=${item.fileUrl}`+ '#/sign-model',//多元融合模型查看页面`/code/index.html?caseId=${caseId}&single#/show`,
+    102: param.root,//资源访问链接,
   };
   return SceneType[item.type];
 }

+ 3 - 3
src/store/user.ts

@@ -70,13 +70,13 @@ export const user = ref({
 });
 
 export const urlData = ref<urlData>({
-  ga: "0",
+  ga: false,
   lang: "zh",
   photography: '0',
   modeling: '0',
   appServer: localStorage.getItem('appServer')||'http://192.168.0.62:8808',
-  ip: 'http://localhost',
-  laserServicePort: '9095',
+  ip: 'http://192.168.0.62',
+  laserServicePort: '9008',
   servicePort: '9250',
   swssUrl: '',
   fuse: decodeURIComponent('file%3A%2F%2F%2FD%3A%2F4DMega%2Fbin%2Fresources%2Fstatic%2Flib%2Ffuse%2Findex.html'),

+ 3 - 4
src/util/index.ts

@@ -374,15 +374,14 @@ export const getDomMatrix = (dom: HTMLElement) => {
 export const windowOpen = (param) => {
   if(param.url) {
     // iframe发送消息到 父页面
-    let data = JSON.stringify({type:"link", data:param.url});
+    let data = JSON.stringify({type:"link", data:param.url, library: param.library});
       window.parent.postMessage(data, '*');
   } else if(param.type) {//按钮事件
     // iframe发送消息到 父页面
-    let data = JSON.stringify({type: param.type, data: ''});
-    console.log('windowOpen', data)
+    let data = JSON.stringify({type: param.type, data: data.data||'', library: param.library});
     window.parent.postMessage(data, '*');
   }else {
-    let data = JSON.stringify({type:"link", data:param.url || param});
+    let data = JSON.stringify({type:"link", data:param.url || param, library: param.library});
     window.parent.postMessage(data, '*');
   }
 };

+ 1 - 1
src/view/layout/index.vue

@@ -70,7 +70,7 @@ const getAllParams = () => {
 };
 let querys = getAllParams() || {};
 setUrlData(querys)
-if(querys.ga == '1'){
+if(querys.ga == 'true'){
   router.replace('/home/'+caseId.value as number)
 }
 if(querys.path){

+ 2 - 2
src/view/layout/top/index.vue

@@ -69,11 +69,11 @@ const loginoutRaw = async () => {
   router.replace({ name: RouteName.login });
 };
 const handlemtk = () => {
-  windowOpen("file:///D:/4DMega/bin/resources/static/lib/criminal/index.html#/mediaLibrary");
+  windowOpen({type: 'tab', data: 'media'});
 };
 const handleSee = () => {
   let url = getUrlSrc({type: 99}, caseId.value)
-  windowOpen(url);
+  windowOpen({url,title: '预览案件'});
 };
 const logout = async () => {
   if (await confirm("确定要退出登录吗?")) {

+ 51 - 8
src/view/mediaLibrary/TableComponent.vue

@@ -23,6 +23,7 @@
           <el-option
             v-for="(item, index) in [
               $t('mediaLibrary.fileType.0'),
+              $t('mediaLibrary.fileType.1'),
               $t('mediaLibrary.fileType.2'),
               $t('mediaLibrary.fileType.3'),
               $t('mediaLibrary.fileType.4'),
@@ -50,8 +51,8 @@
         </el-select>
       </el-form-item>
       <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="handleAdd">{{$t('mediaLibrary.upload')}}</el-button>
       </el-form-item>
@@ -68,7 +69,7 @@
       <el-table-column prop="name" :label="$t('program.case.title')" min-width="300px">
         <template #default="scope">
           <a
-            style="color: var(--primaryColor)"
+            style="color: var(--primaryColor);cursor: pointer;"
             v-if="scope.row.fileUrl"
             target="_blank"
             :title="scope.row.name"
@@ -210,13 +211,29 @@
       </div>
     </template>
   </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>
 </template>
 
 <script setup>
 import { Search } from "@element-plus/icons-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 obj from "@/assets/images/obj.jpg";
 import osgb from "@/assets/images/osgb.jpg";
@@ -251,6 +268,12 @@ const addForm = ref({
   dictId: "",
   name: "",
 });
+const dialogDowm = ref({
+  show: false,
+  url: '',
+  type: '',
+  data: {},
+});
 const dialogData = ref({
   show: false,
   title: ui18n.t('sys.upload'),
@@ -422,11 +445,16 @@ const initData = async () => {
   total.value = totalCount;
 };
 const floadileUrl = (record) => {
+  dialogDowm.value.show = true;
+  dialogDowm.value.type = record.fileType;
+  dialogDowm.value.data = record;
   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 {
-    return windowOpen(record.fileUrl);
+    dialogDowm.value.url = getUrlSrc({type: 102}) +'/'+ record.fileUrl;
+    // return windowOpen({url: record.fileUrl, library: true});
   }
 };
 const beforeUpload = (file) => {
@@ -466,7 +494,15 @@ const handleCurrentChange = (newPage) => {
   currentPage.value = newPage;
   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 = () => {
   currentPage.value = 1;
@@ -600,4 +636,11 @@ initData();
     }
   }
 }
+.showContent{
+  iframe{
+    body:-webkit-full-page-media {
+      background-color: none;
+    }
+  }
+}
 </style>

+ 3 - 2
src/view/vrmodel/index.vue

@@ -90,11 +90,11 @@ const getAllParams = () => {
 };
 let querys = getAllParams()
 console.log("getAllParams", route.name, querys.ga);
-if(querys.ga === '1' && route.name != 'scene'){
+if(querys.ga === 'true' && route.name != 'scene'){
   router.replace('/home/'+caseId.value as number)
 
 }
-if(querys.ga === '0' && route.name != 'homes'){
+if(querys.ga === 'false' && route.name != 'homes'){
   router.replace('/homes/'+caseId.value as number)
 }
 // setUrlData
@@ -104,6 +104,7 @@ async function geiList() {
 }
 function handlegotoEdit(record) {
   let url = getUrlSrc(record, caseId.value)
+  console.log("handlegotoEdit", url, record);
     // record.type == 2 || record.type == 5
     //   ? `/mega/index.html?m=${record.num}`
     //   : `/epg.html?m=${record.num}`;