Browse Source

修改问题

tangning 3 years ago
parent
commit
16ce33cf90

+ 1 - 1
.env

@@ -1,2 +1,2 @@
-VUE_APP_DOMAIN=https://www.4dkankan.com
+VUE_APP_DOMAIN=https://test.4dkankan.com
 VUE_APP_PREFIX=

+ 2 - 0
src/request/config.js

@@ -179,6 +179,8 @@ export const uploadAttachImage = '/web/fireProject/uploadImage'
   export const checkHasDownload = '/web/scene/checkDownload/'
   // 下载获取进度条
   export const getDownloadProcess = '/web/scene/downloadProcess'
+  // 下载
+  export const downloadScene = '/web/scene/downloadScene/'
   
 
 // 不需要登录就能请求的接口

+ 1 - 1
src/state/tableRef.js

@@ -234,7 +234,7 @@ export default ({operAttr, searchAttr, pagAttr, isSelect = true, getUrl, updateU
     () => {
       referListData(ret, getUrl, pagAttr)
     },
-    100
+    500
   )
 
   // 刷新数据

+ 4 - 4
src/view/camera/index.vue

@@ -1,14 +1,14 @@
 <template>
   <com-head :options="headList" >
     <el-form label-width="98px" inline="true">
-      <el-form-item label="绑定管理员:">
-        <el-input v-model="search.state.searchKey" placeholder="请输入"></el-input>
+      <el-form-item label="所属架构:">
+        <com-select v-model="search.state.deptId" />
       </el-form-item>
       <el-form-item label="S/N码:">
         <el-input v-model="search.state.snCode" placeholder="请输入"></el-input>
       </el-form-item>
-      <el-form-item label="所属架构:">
-        <com-select v-model="search.state.deptId" />
+      <el-form-item label="绑定管理员:">
+        <el-input v-model="search.state.searchKey" placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item class="searh-btns" >
         <el-button type="primary" @click="search.submit">查询</el-button>

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

@@ -4,7 +4,7 @@
     <!-- <div class="home-content">
       <img src="@/assets/image/logo_big.png" alt="">
       <h1>广东省消防救援总队火场三维数据平台</h1>
-      <p>Three-dimensional data platform of fire scene of Guangdong Fire Resue</p>
+      <p>Three-dimensional data platform of fire scene of Guangdong Fire Rescue</p>
     </div> -->
     <div class="foot">
       <p> 广东省消防救援总队火场三维数据平台</p>

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

@@ -2,7 +2,7 @@
   <div class="top" :class="{system: isSystem}">
     <div class="title">
       <img src="@/assets/image/img_login_logo.png">
-      <h2>广东省消防救援总队火场三维数据平台<span>Three-dimensional data platform of fire scene of Guangdong Fire Resue</span></h2>
+      <h2>广东省消防救援总队火场三维数据平台<span>Three-dimensional data platform of fire scene of Guangdong Fire Rescue</span></h2>
     </div>
     <div class="oper-btns" v-if="!isSystem && info">
         <div class="user-menu">

+ 27 - 6
src/view/user/index.vue

@@ -1,15 +1,15 @@
 <template>
   <com-head :options="headList" >
     <el-form label-width="84px" inline="true">
+      <el-form-item label="所属架构:">
+        <com-company :checkStrictly="true" v-model="search.state.departmentId" />
+      </el-form-item>
       <el-form-item label="用户账户:">
         <el-input v-model="search.state.userName" placeholder="请输入手机号"></el-input>
       </el-form-item>
       <el-form-item label="用户姓名:">
         <el-input v-model="search.state.nickName" placeholder="请输入"></el-input>
       </el-form-item>
-      <el-form-item label="所属架构:">
-        <com-company v-model="search.state.departmentId" />
-      </el-form-item>
       <el-form-item label="状态:">
         <el-select v-model="search.state.status" placeholder="全部">
           <el-option label="全部" :value="''"></el-option>
@@ -53,7 +53,7 @@
           <span class="oper-span" @click="changeUserStatus(row)" v-if="auth.delete" style="color: var(--primaryColor)">
             {{ row.status ? '禁用' : '启用' }}
           </span>
-          <span class="oper-span" @click="detailInfo(row)" v-if="auth.update">删除</span>
+          <span class="oper-span" @click="detailInfo(row)" v-if="auth.update" style="color: var(--primaryColor)">删除</span>
         </template>
       </el-table-column>
     </el-table>
@@ -75,7 +75,7 @@
   >
     <el-form ref="form" :model="form" label-width="90px" class="user-from">
       <el-form-item label="用户姓名:" class="roleName">
-        <el-input v-model="oper.state.nickName" placeholder="请输入"></el-input>
+        <el-input ref="groupName" v-model="oper.state.nickName" :maxlength="usermaxlength" @input="changeValue"  placeholder="请输入"></el-input>
       </el-form-item>
       <el-form-item label="所属架构:" class="mandatory"  v-show="operRoleId">
         <com-company v-model="oper.state.departmentId" @update:data="({level}) => (oper.state.roleId = level)" style="width: 100%" hideAll />
@@ -135,6 +135,7 @@ export default {
     });
     const headList = ref([{ name: "用户管理", value: 2 }]);
     const operRoleId = ref('')
+    const usermaxlength = ref(30)
     const updateInfo = (row) => {
 
       if (!row.status) {
@@ -145,9 +146,29 @@ export default {
     }
     
     console.log(user)
-    return { ...state, headList, updateInfo, auth, user, operRoleId, ADMIN_USER_ID };
+    return { ...state, headList, updateInfo, auth, user, operRoleId, ADMIN_USER_ID,usermaxlength };
   },
   methods: {
+    changeValue () {
+        let leng = this.validateTextLength(this.oper.state.nickName)
+        if (leng >= 15) {
+          this.usermaxlength = leng
+        } else {
+          this.usermaxlength = 30
+        }
+      },
+    validateTextLength (value) {
+        // 中文、中文标点、全角字符按1长度,英文、英文符号、数字按0.5长度计算
+        let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/g
+        let mat = value.match(cnReg)
+        let length
+        if (mat) {
+          length = (mat.length + (value.length - mat.length) * 0.5)
+          return length
+        } else {
+          return value.length * 0.5
+        }
+    },
     async operItem() {
       const updatePhone = this.oper.state.__oldData ? this.oper.state.__oldData.userName !== this.oper.state.userName : true
       

+ 31 - 15
src/view/vrmodel/index.vue

@@ -166,12 +166,12 @@
             style="display:flex;justify-content: space-between;margin-top:15px"
           >
             <span>{{ cameraDownload.data.name }}</span>
-            <span>{{ cameraDownload.data.value }}</span>
+            <span>{{ cameraDownload.data.percent }}%</span>
           </div>
           <div>
             <el-slider
               :disabled="true"
-              v-model="cameraDownload.data.value"
+              v-model="cameraDownload.data.percent"
               :show-tooltip="false"
             >
             </el-slider>
@@ -209,6 +209,7 @@ import {
   getCameraOptions,
   checkHasDownload,
   getDownloadProcess,
+  downloadScene,
 } from "@/request/config";
 import axios from "axios";
 
@@ -278,22 +279,33 @@ export default {
   methods: {
     download(item) {
       //查询下载进度   0未创建  1打包中  2等待下载
+      let statelist = {
+        0:0,
+        1:1,
+        2:0,
+        3:2,
+      }
       axios
         .get(checkHasDownload + item.num, { sceneNum: item.num, isTiles: true })
         .then((res) => {
           console.log("type---> res :", res.data);
           this.cameraDownload.data = {
-            type: res.data.downloadUrl ? 2 : 0,
+            type: statelist[res.data.downloadStatus],
+            downloadStatus:res.data.downloadStatus,
             sceneNum: item.num,
             value: res.data.count,
             name: item.sceneName + ".zip",
             url: res.data.downloadUrl,
+            percent:0,
           };
-          if(res.data.count == 0){
+          if(res.data.count == 0 && (res.data.downloadStatus == 0 || res.data.downloadStatus == 2)){
             return this.$message.error("暂无剩余下载次数!", "提示");
           }else{
           this.cameraDownload.show = true;
           }
+          if(res.data.downloadStatus == 1){//下载中
+            this.downloadItemCompany()
+          }
         });
     },
     editModel(item) {
@@ -316,7 +328,7 @@ export default {
       //查询下载进度   0未创建  1打包中  2等待下载
       //查询进度
       let that = this
-      const { type, sceneNum, url } = this.cameraDownload.data;
+      const { sceneNum, url,downloadStatus } = this.cameraDownload.data;
       let download = (downloadUrl) =>{
         let iframe = document.createElement('iframe')
         iframe.style.display = 'none'
@@ -324,17 +336,25 @@ export default {
         document.body.appendChild(iframe);
         that.cameraDownload.show = false;
       }
-      if(type == 2){
+      console.log('downloadStatus',downloadStatus)
+      if(downloadStatus == 3){
         return download(url)
+      }else if(downloadStatus == 0 || downloadStatus == 2 ){
+        axios.get(downloadScene+sceneNum).then((resdata) => {
+          if(resdata.data.downloadStatus !== 1){
+            clearTimeout(this.timer)
+            that.cameraDownload.show = false;
+            return this.$message.error("暂无剩余下载次数!", "提示");
+          }
+        });
       }
-      let cameraDownloaddata = this.cameraDownload.data;
       let fn = () => {
         that.timer = setTimeout(() => {
-          callback(cameraDownloaddata);
+          callback();
         }, 1000);
         // downIngs[this.scene.num] = this.timer;
       };
-      let callback = (item) => {
+      let callback = () => {
       axios.get(getDownloadProcess, {
         params:{
           sceneNum: sceneNum,
@@ -342,17 +362,13 @@ export default {
         }
         }).then((res) => {
           const { percent,url } = res.data
-          that.cameraDownload.data = {
-            ...cameraDownloaddata,
-            type:1,
-            value:percent
-          }
+          that.cameraDownload.data.type  = 1
+          that.cameraDownload.data.percent  = parseInt(percent)
           if(!url){
             fn()
           }else{ //拿到下载链接
             url&&download(url)
           }
-          console.log("type---> res :",item, res.data);
         });
       }
       fn()