无人机管理后台前端(已迁走)
chenyao
2025-07-16 5758791a82dcbece39f27e60aab163d723e0207e
Merge branch 'test' of http://139.196.74.78:10010/r/drone/drone-web-manage into test
9 files modified
1 files added
210 ■■■■■ changed files
.env.test 42 ●●●●● patch | view | raw | blame | history
package.json 2 ●●● patch | view | raw | blame | history
src/axios.js 69 ●●●● patch | view | raw | blame | history
src/buildConfig/buildConfig/config.jiangwu.js 4 ●●● patch | view | raw | blame | history
src/page/index/logo.vue 11 ●●●●● patch | view | raw | blame | history
src/page/index/top/index.vue 6 ●●●●● patch | view | raw | blame | history
src/permission.js 14 ●●●● patch | view | raw | blame | history
src/views/job/components/SearchBox.vue 29 ●●●●● patch | view | raw | blame | history
src/views/job/components/TaskTop/TaskTotal.vue 6 ●●●●● patch | view | raw | blame | history
src/views/tickets/ticket.vue 27 ●●●● patch | view | raw | blame | history
.env.test
New file
@@ -0,0 +1,42 @@
NODE_ENV = 'test'
#开发环境配置
VITE_APP_ENV = 'test'
#接口地址
VITE_APP_API=/api
#页面基础路径
VITE_APP_BASE=/manage
# 服务地址
VITE_APP_URL = https://wrj.shuixiongit.com/api
#VITE_APP_URL= http://192.168.1.168 rjg
#VITE_APP_URL= http://192.168.1.33
#新大屏地址
VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
# 域名
VITE_APP_AREA_NAME = https://wrj.shuixiongit.com
# ws地址
VITE_APP_WS_API_URL = wss://wrj.shuixiongit.com
# 航线文件地址
VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
# 图片存放地址
VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket/ztzf_terrain/all_terrain
# 算法仓库图片地址
VITE_APP_PICTURE_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
# 是否在打包时开启压缩,支持 gzip 和 brotli
VITE_BUILD_COMPRESS = gzip
#页面基础路径
# VITE_APP_BASE_COMMAND = /drone-web-manage/
#天地图token 浏览器端口
VITE_APP_TDT_TOKEN = e110584a27d506da2740edca951683f4
VITE_APP_CESIUM_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYTZlNGNlYS01NTU1LTQ1MGEtYmNlZS0yNTE2NDk5YWM2MjEiLCJpZCI6MTc5Njk2LCJpYXQiOjE3MDA1NDcwMjV9.qcl4AH2731cfFd0-I1ZLUINPXqvglLkDFD-UGR2zU5M
package.json
@@ -5,7 +5,7 @@
        "dev": "vite --host",
        "base": "vite --host --mode localhost",
        "prod": "vite --mode production",
        "build:test": "vite build --mode development",
        "build:test": "vite build --mode test",
        "build:prod": "vite build --mode production",
        "build:jiangwu": "vite build --mode jiangwu",
        "serve": "vite preview --host"
src/axios.js
@@ -9,32 +9,17 @@
import axios from 'axios';
import store from '@/store/';
import router from '@/router/';
import {
    serialize
} from '@/utils/util';
import {
    getToken,
    removeToken,
    removeRefreshToken
} from '@/utils/auth';
import {
    isURL,
    validatenull
} from '@/utils/validate';
import {
    ElMessage
} from 'element-plus';
import { serialize } from '@/utils/util';
import { getToken, removeToken, removeRefreshToken } from '@/utils/auth';
import { isURL, validatenull } from '@/utils/validate';
import { ElMessage } from 'element-plus';
import website from '@/config/website';
import NProgress from 'nprogress'; // progress bar
import 'nprogress/nprogress.css'; // progress bar style
import {
    Base64
} from 'js-base64';
import {
    baseUrl
} from '@/config/env';
import { Base64 } from 'js-base64';
import { baseUrl } from '@/config/env';
import crypto from '@/utils/crypto';
const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL;
// 全局未授权错误提示状态,只提示一次
let isErrorShown = false;
@@ -63,7 +48,7 @@
            config.url = baseUrl + config.url;
        }
        //安全请求header
        config.headers['areaCode'] = store?.state?.user?.userInfo?.detail?.areaCode
    config.headers['areaCode'] = store?.state?.user?.userInfo?.detail?.areaCode;
        config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
        //headers判断是否需要
        const authorization = config.authorization === false;
@@ -81,9 +66,9 @@
        const cryptoData = config.cryptoData === true;
        const token = getToken();
        if (token && !isToken) {
            config.headers[website.tokenHeader] = cryptoToken ?
                'crypto ' + crypto.encryptAES(token, crypto.cryptoKey) :
                'bearer ' + token;
      config.headers[website.tokenHeader] = cryptoToken
        ? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
        : 'bearer ' + token;
        }
        // 开启报文加密
        // if (cryptoData) {
@@ -128,9 +113,11 @@
            const currentRouteName = router.currentRoute.value.name;
            // 如果当前路由不是登录页,则跳转到登录页
            if (currentRouteName !== '登录页') {
                store.dispatch('FedLogOut').then(() => router.push({
                    path: '/login'
                }));
        store.dispatch('FedLogOut').then(() =>
          router.push({
            path: '/login',
          })
        );
            }
            return Promise.reject(new Error(message));
        }
@@ -150,9 +137,9 @@
                    // 获取刷新后的token
                    const token = getToken();
                    if (token && !isToken) {
                        config.headers[website.tokenHeader] = cryptoToken ?
                            'crypto ' + crypto.encryptAES(token, crypto.cryptoKey) :
                            'bearer ' + token;
            config.headers[website.tokenHeader] = cryptoToken
              ? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
              : 'bearer ' + token;
                    }
                    // 重新发送原来的请求
                    return axios(config);
@@ -169,11 +156,18 @@
                    // 清除token信息
                    removeToken();
                    removeRefreshToken();
          const env = import.meta.env.VITE_APP_ENV;
                    // 重定向到登录页
                    // store.dispatch('FedLogOut').then(() => router.push({
                    //     path: '/login'
                    // }));
                    store.dispatch('FedLogOut').then(() =>  window.location.replace(`${adminUrl}#/login`));
          env === 'development'
            ? store.dispatch('FedLogOut').then(() =>
                router.push({
                  path: '/login',
                })
              )
            : store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
                    return Promise.reject(new Error(message));
                });
        }
@@ -194,7 +188,14 @@
            // store.dispatch('FedLogOut').then(() => router.push({
            //     path: '/login'
            // }));
            store.dispatch('FedLogOut').then(() =>  window.location.replace(`${adminUrl}#/login`));
      const env = import.meta.env.VITE_APP_ENV;
      env === 'development'
        ? store.dispatch('FedLogOut').then(() =>
            router.push({
              path: '/login',
            })
          )
        : store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
            return Promise.reject(new Error(message));
        }
        // 如果请求为oauth2错误码则首次报错时提示
src/buildConfig/buildConfig/config.jiangwu.js
@@ -5,8 +5,6 @@
        },
        loginTitle: '大吉山钨业无人机安防监测平台',
      hideMenuTopLogo: true, // 是否隐藏菜单顶部logo
    }
}
src/page/index/logo.vue
@@ -3,13 +3,13 @@
    <transition name="fade">
      <span v-if="getScreen(isCollapse)" class="avue-logo_subtitle" key="0">
<!--        {{ website.logo }}-->
        <img class="logoImg" src="/img/bg/mainLogo.png" alt=""/>
        <img v-if="!hideMenuTopLogo" class="logoImg" src="/img/bg/mainLogo.png" alt=""/>
      </span>
    </transition>
    <transition-group name="fade">
      <template v-if="getScreen(!isCollapse)">
        <div class="fadeStyle">
          <img class="logoImg" src="/img/bg/mainLogo.png" alt=""/>
          <img v-if="!hideMenuTopLogo" class="logoImg" src="/img/bg/mainLogo.png" alt=""/>
          <div class="titleName">综合管理平台</div>
          <!-- <span style="font-size: 20px;"  key="1">
              {{ this.parentDeptInfo.sysName }}
@@ -22,11 +22,14 @@
<script>
import { mapGetters } from 'vuex';
import getBaseConfig from '@/buildConfig/config';
const { hideMenuTopLogo } = getBaseConfig()
export default {
  name: 'logo',
  data() {
    return {};
    return {
      hideMenuTopLogo
    };
  },
  created() {},
  computed: {
src/page/index/top/index.vue
@@ -102,9 +102,11 @@
        type: 'warning',
      }).then(() => {
        this.$store.dispatch('LogOut').then(() => {
          // this.$router.push({ path: '/login' })
        const env = import.meta.env.VITE_APP_ENV
          console.log(env);
          const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
          window.location.replace(`${adminUrl}#/login`)
           env === 'development' ? this.$router.push({ path: '/login' }):window.location.replace(`${adminUrl}#/login`)
        })
      })
    },
src/permission.js
@@ -19,6 +19,8 @@
const lockPage = '/lock' //锁屏页
const urlParams = getUrlParams(window.location.href)
const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
const env = import.meta.env.VITE_APP_ENV
function findRouteByPath (routes, targetPath) {
  // 遍历数组中的每个路由对象
  for (const route of routes) {
@@ -39,7 +41,6 @@
  // 遍历完所有路由都没找到,返回null
  return null
}
router.beforeEach((to, from, next) => {
  const meta = to.meta || {}
  const isMenu = meta.menu === undefined ? to.query.menu : meta.menu
@@ -93,10 +94,10 @@
    } else {
      const systemToken = store.getters.token || urlParams?.token
      if (systemToken === 0) {
        // store.dispatch('FedLogOut').then(() => {
        //   next({ path: '/login' })
        // })
        store.dispatch('FedLogOut').then(() =>  window.location.replace(`${adminUrl}#/login`));
        store.dispatch('FedLogOut').then(() => {
          next({ path: '/login' })
        })
        // store.dispatch('FedLogOut').then(() =>  window.location.replace(`${adminUrl}#/login`));
      } else {
        const meta = to.meta || {}
        const query = to.query || {}
@@ -121,8 +122,7 @@
    if (meta.isAuth === false) {
      next()
    } else {
      // next('/login')
      window.location.replace(`${adminUrl}#/login`)
      env === 'development' ? next('/login') : window.location.replace(`${adminUrl}#/login`)
    }
  }
})
src/views/job/components/SearchBox.vue
@@ -234,12 +234,15 @@
let checked = ref('today');
let timeClick = (item, index) => {
  checked.value = item;
  // dateRange.value = dateRanges[item];
  dateRange.value = [];
  // emit('change', dateRanges[item],timeListEnum[index]);
  searchForm.date_enum = timeListEnum[index];
  handleSearch();
  if (checked.value === item){
    checked.value = null
    searchForm.date_enum = undefined
  }else{
    checked.value = item
    searchForm.date_enum = timeListEnum[index]
  }
  dateRange.value = []
  handleSearch()
};
// 搜索
const handleSearch = () => {
@@ -265,18 +268,8 @@
  emit('search', params);
};
const handleDateChange = val => {
  if (val && val.length === 2) {
    const start = dayjs(val[0]);
    const end = dayjs(val[1]);
    const diff = end.diff(start, 'day');
    if (diff > 31) {
      ElMessage.warning('日期范围不能超过31天');
      dateRange.value = [];
      return;
    }
  }
  handleSearch();
  checked.value = null
  searchForm.date_enum = undefined
};
// 重置
src/views/job/components/TaskTop/TaskTotal.vue
@@ -51,13 +51,14 @@
    totalJobNum().then(res => {
        if (res.data.code !== 0) returen
        total.value = res.data.data.job_total_num
        numTotal.value = res.data.data.deal_job_num
    })
}
// 获取其他任务统计
const getJobStatistics = value => {
    jobStatistics(value).then(res => {
        if (res.data.code !== 0) returen
    const {executed = 0,failed_executions = 0,go_home_executions = 0} = res.data?.data || {}
    numTotal.value = executed + failed_executions + go_home_executions
        list.value[0].value = res.data.data.planned_executions || 0
        list.value[1].value = res.data.data.executed || 0
        list.value[2].value = res.data.data.running_num || 0
@@ -79,9 +80,6 @@
    { immediate: true,deep: true }
)
onMounted(() => {
    getTotalJobNum()
})
</script>
<style scoped lang="scss">
src/views/tickets/ticket.vue
@@ -148,9 +148,9 @@
            </el-col>
            <el-col :span="12">
              <el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
                <el-upload ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                <el-upload v-if="createoredit === 1" ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                  :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
                  :file-list="popupShowImage(form.photos)" :limit="1" accept="image/*" class="create-upload">
                  :file-list="form.photos" :limit="1" accept="image/*" class="create-upload">
                  <template v-if="form.photos.length < 1">
                    <!-- <i class="el-icon-plus">+</i> -->
                      <div class="el-icon-plus">
@@ -158,7 +158,16 @@
                    </div>
                  </template>
                </el-upload>
                  <el-upload v-else ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                  :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
                  :file-list="popupShowImage(form.photos)" :limit="1" accept="image/*" class="create-upload">
                  <template v-if="form.photos.length < 1">
               
                      <div class="el-icon-plus">
                      <span>+</span>
                    </div>
                  </template>
                </el-upload>
                <div class="upload-tip">需上传含有地址信息的照片(jpg、jpeg、png),且不超过5M</div>
              </el-form-item>
            </el-col>
@@ -512,6 +521,7 @@
import { ElMessageBox, ElLoading } from 'element-plus'
import { calculateDefaultRange } from '@/utils/util'
import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation'
import _ from 'lodash'
import {
  getList,
  createTicket,
@@ -543,6 +553,7 @@
      dispatchLoading: false,
      completeLoading: false,
      finalizeLoading: false,
      createoredit:'',
      activeTab: 'all',
      // tabs 只保留静态结构,不做权限判断
      tabs: [
@@ -900,7 +911,7 @@
        { label: '关联任务', value: this.currentDetail.job_name || '/' },
        { label: '任务发起人', value: this.currentDetail.creator },
        { label: '当前状态', value: this.mapStatus(this.currentDetail.status) },
        { label: '事件地址', value: this.currentDetail.address }, // 包含经纬度信息
        { label: '事件地址', value: this.currentDetail.address || this.currentDetail.latAndLon }, // 包含经纬度信息
        { label: '关联算法', value: this.currentDetail.aiType },
        { label: '发起单位', value: this.currentDetail.department },
        { label: '发起任务时间', value: this.currentDetail.startTime },
@@ -1508,6 +1519,8 @@
    },
    handleAdd () {
    this.createoredit =1
      this.dialogVisible = true
      this.mapParams.center = null
      this.form.location = []
@@ -1603,8 +1616,13 @@
          this.stepInfos = []
        }
      }
      console.log(detailData,'detailDatadetailDatadetailData');
      this.currentDetail = {
        ...detailData,
        address:null,
        latAndLon: _.round(detailData.location[0],6) + ',' + _.round(detailData.location[1],6)
      }
      this.currentDetail = detailData
       console.log('this.currentDetail',this.currentDetail);
      this.detailVisible = true
      this.$nextTick(() => {
@@ -2019,6 +2037,7 @@
    // 添加编辑方法
    handleEdit (row) {
    this.createoredit = 2
      console.log('编辑原始数据:', row)
      // 尝试从row.dept_id或通过部门名称查找对应的部门ID