From 5758791a82dcbece39f27e60aab163d723e0207e Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Wed, 16 Jul 2025 08:59:45 +0800
Subject: [PATCH] Merge branch 'test' of http://139.196.74.78:10010/r/drone/drone-web-manage into test
---
src/views/job/components/SearchBox.vue | 33 +--
src/views/job/components/TaskTop/TaskTotal.vue | 8
src/permission.js | 14
src/views/tickets/ticket.vue | 33 ++
package.json | 2
src/page/index/top/index.vue | 6
.env.test | 42 ++++
src/axios.js | 393 +++++++++++++++++++-------------------
src/buildConfig/buildConfig/config.jiangwu.js | 6
src/page/index/logo.vue | 11
10 files changed, 302 insertions(+), 246 deletions(-)
diff --git a/.env.test b/.env.test
new file mode 100644
index 0000000..ebb4ef9
--- /dev/null
+++ b/.env.test
@@ -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
+
diff --git a/package.json b/package.json
index 056da91..79ce0a8 100644
--- a/package.json
+++ b/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"
diff --git a/src/axios.js b/src/axios.js
index d9ad49d..3dc3094 100644
--- a/src/axios.js
+++ b/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;
@@ -42,193 +27,209 @@
// 超时时间设置为10分钟,部分接口上传比较慢,如固件上传
axios.defaults.timeout = 600000;
//返回其他状态码
-axios.defaults.validateStatus = function(status) {
- return status >= 200 && status <= 500; // 默认的
+axios.defaults.validateStatus = function (status) {
+ return status >= 200 && status <= 500; // 默认的
};
//跨域请求,允许保存cookie
axios.defaults.withCredentials = true;
// NProgress Configuration
NProgress.configure({
- showSpinner: false,
+ showSpinner: false,
});
//http request拦截
axios.interceptors.request.use(
- config => {
- // start progress bar
- NProgress.start();
- // 初始化错误提示状态
- isErrorShown = false;
- //地址为已经配置状态则不添加前缀
- if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
- config.url = baseUrl + config.url;
- }
- //安全请求header
- config.headers['areaCode'] = store?.state?.user?.userInfo?.detail?.areaCode
- config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
- //headers判断是否需要
- const authorization = config.authorization === false;
- if (!authorization) {
- config.headers['Authorization'] = `Basic ${Base64.encode(
+ config => {
+ // start progress bar
+ NProgress.start();
+ // 初始化错误提示状态
+ isErrorShown = false;
+ //地址为已经配置状态则不添加前缀
+ if (!isURL(config.url) && !config.url.startsWith(baseUrl)) {
+ config.url = baseUrl + config.url;
+ }
+ //安全请求header
+ config.headers['areaCode'] = store?.state?.user?.userInfo?.detail?.areaCode;
+ config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
+ //headers判断是否需要
+ const authorization = config.authorization === false;
+ if (!authorization) {
+ config.headers['Authorization'] = `Basic ${Base64.encode(
`${website.clientId}:${website.clientSecret}`
)}`;
- }
- //headers判断请求是否携带token
- const meta = config.meta || {};
- const isToken = meta.isToken === false;
- //headers传递token是否加密
- const cryptoToken = config.cryptoToken === true;
- //判断传递数据是否加密
- const cryptoData = config.cryptoData === true;
- const token = getToken();
- if (token && !isToken) {
- config.headers[website.tokenHeader] = cryptoToken ?
- 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey) :
- 'bearer ' + token;
- }
- // 开启报文加密
- // if (cryptoData) {
- // if (config.params) {
- // const data = crypto.encryptAES(JSON.stringify(config.params), crypto.aesKey);
- // config.params = { data };
- // }
- // if (config.data) {
- // config.text = true;
- // config.data = crypto.encryptAES(JSON.stringify(config.data), crypto.aesKey);
- // }
- // }
- //headers中配置text请求
- if (config.text === true) {
- config.headers['Content-Type'] = 'text/plain';
- }
- //headers中配置serialize为true开启序列化
- if (config.method === 'post' && meta.isSerialize === true) {
- config.data = serialize(config.data);
- }
- return config;
- },
- error => {
- return Promise.reject(error);
- }
+ }
+ //headers判断请求是否携带token
+ const meta = config.meta || {};
+ const isToken = meta.isToken === false;
+ //headers传递token是否加密
+ const cryptoToken = config.cryptoToken === true;
+ //判断传递数据是否加密
+ const cryptoData = config.cryptoData === true;
+ const token = getToken();
+ if (token && !isToken) {
+ config.headers[website.tokenHeader] = cryptoToken
+ ? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
+ : 'bearer ' + token;
+ }
+ // 开启报文加密
+ // if (cryptoData) {
+ // if (config.params) {
+ // const data = crypto.encryptAES(JSON.stringify(config.params), crypto.aesKey);
+ // config.params = { data };
+ // }
+ // if (config.data) {
+ // config.text = true;
+ // config.data = crypto.encryptAES(JSON.stringify(config.data), crypto.aesKey);
+ // }
+ // }
+ //headers中配置text请求
+ if (config.text === true) {
+ config.headers['Content-Type'] = 'text/plain';
+ }
+ //headers中配置serialize为true开启序列化
+ if (config.method === 'post' && meta.isSerialize === true) {
+ config.data = serialize(config.data);
+ }
+ return config;
+ },
+ error => {
+ return Promise.reject(error);
+ }
);
//http response拦截
axios.interceptors.response.use(
- res => {
- NProgress.done();
- const status = res.data.error_code || res.data.code || res.status;
- const statusWhiteList = website.statusWhiteList || [];
- const message = res.data.msg || res.data.error_description || res.data.message ||'系统错误';
- const config = res.config;
- const cryptoData = config.cryptoData === true;
- if (status === 511) {
- ElMessage({
- message: '请联系运维人员上传密钥证书!',
- type: 'error',
- });
- // 获取当前路由名称
- const currentRouteName = router.currentRoute.value.name;
- // 如果当前路由不是登录页,则跳转到登录页
- if (currentRouteName !== '登录页') {
- store.dispatch('FedLogOut').then(() => router.push({
- path: '/login'
- }));
- }
- return Promise.reject(new Error(message));
- }
- //如果在白名单里则自行catch逻辑处理
- if (statusWhiteList.includes(status)) return Promise.reject(res);
- // 如果是401并且没有重试过,尝试刷新token
- if (status === 401 && !_retry) {
- // 标记此请求已尝试刷新token
- _retry = true;
- // 调用RefreshToken action来刷新token
- return store
- .dispatch('RefreshToken')
- .then(() => {
- const meta = config.meta || {};
- const isToken = meta.isToken === false;
- const cryptoToken = config.cryptoToken === true;
- // 获取刷新后的token
- const token = getToken();
- if (token && !isToken) {
- config.headers[website.tokenHeader] = cryptoToken ?
- 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey) :
- 'bearer ' + token;
- }
- // 重新发送原来的请求
- return axios(config);
- })
- .catch(() => {
- // 首次报错时提示
- if (!isErrorShown) {
- isErrorShown = true;
- ElMessage({
- message: message,
- type: 'error',
- });
- }
- // 清除token信息
- removeToken();
- removeRefreshToken();
- // 重定向到登录页
- // store.dispatch('FedLogOut').then(() => router.push({
- // path: '/login'
- // }));
- store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
- return Promise.reject(new Error(message));
- });
- }
- // 如果是401并且已经重试过,直接跳转到登录页面
- if (status === 401 && _retry) {
- // 首次报错时提示
- if (!isErrorShown) {
- isErrorShown = true;
- ElMessage({
- message: '用户令牌过期,请重新登录',
- type: 'error',
- });
- }
- // 清除token信息
- removeToken();
- removeRefreshToken();
- // 重定向到登录页
- // store.dispatch('FedLogOut').then(() => router.push({
- // path: '/login'
- // }));
- store.dispatch('FedLogOut').then(() => window.location.replace(`${adminUrl}#/login`));
- return Promise.reject(new Error(message));
- }
- // 如果请求为oauth2错误码则首次报错时提示
- if (status > 2000 && !validatenull(res.data.error_description)) {
- // 首次报错时提示
- if (!isErrorShown) {
- isErrorShown = true;
- ElMessage({
- message: message,
- type: 'error',
- });
- }
- return Promise.reject(new Error(message));
- }
- // 如果请求为非200默认统一处理
- if (status !== 200 && status !== 0) {
- if (!isErrorShown) {
- ElMessage({
- message: message,
- type: 'error',
- });
- }
- return Promise.reject(new Error(message));
- }
- // 解析加密报文
- if (cryptoData) {
- res.data = JSON.parse(crypto.decryptAES(res.data, crypto.aesKey));
- }
- return res;
- },
- error => {
- NProgress.done();
- return Promise.reject(new Error(error));
- }
+ res => {
+ NProgress.done();
+ const status = res.data.error_code || res.data.code || res.status;
+ const statusWhiteList = website.statusWhiteList || [];
+ const message = res.data.msg || res.data.error_description || res.data.message || '系统错误';
+ const config = res.config;
+ const cryptoData = config.cryptoData === true;
+ if (status === 511) {
+ ElMessage({
+ message: '请联系运维人员上传密钥证书!',
+ type: 'error',
+ });
+ // 获取当前路由名称
+ const currentRouteName = router.currentRoute.value.name;
+ // 如果当前路由不是登录页,则跳转到登录页
+ if (currentRouteName !== '登录页') {
+ store.dispatch('FedLogOut').then(() =>
+ router.push({
+ path: '/login',
+ })
+ );
+ }
+ return Promise.reject(new Error(message));
+ }
+ //如果在白名单里则自行catch逻辑处理
+ if (statusWhiteList.includes(status)) return Promise.reject(res);
+ // 如果是401并且没有重试过,尝试刷新token
+ if (status === 401 && !_retry) {
+ // 标记此请求已尝试刷新token
+ _retry = true;
+ // 调用RefreshToken action来刷新token
+ return store
+ .dispatch('RefreshToken')
+ .then(() => {
+ const meta = config.meta || {};
+ const isToken = meta.isToken === false;
+ const cryptoToken = config.cryptoToken === true;
+ // 获取刷新后的token
+ const token = getToken();
+ if (token && !isToken) {
+ config.headers[website.tokenHeader] = cryptoToken
+ ? 'crypto ' + crypto.encryptAES(token, crypto.cryptoKey)
+ : 'bearer ' + token;
+ }
+ // 重新发送原来的请求
+ return axios(config);
+ })
+ .catch(() => {
+ // 首次报错时提示
+ if (!isErrorShown) {
+ isErrorShown = true;
+ ElMessage({
+ message: message,
+ type: 'error',
+ });
+ }
+ // 清除token信息
+ removeToken();
+ removeRefreshToken();
+ const env = import.meta.env.VITE_APP_ENV;
+ // 重定向到登录页
+ // store.dispatch('FedLogOut').then(() => router.push({
+ // path: '/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));
+ });
+ }
+ // 如果是401并且已经重试过,直接跳转到登录页面
+ if (status === 401 && _retry) {
+ // 首次报错时提示
+ if (!isErrorShown) {
+ isErrorShown = true;
+ ElMessage({
+ message: '用户令牌过期,请重新登录',
+ type: 'error',
+ });
+ }
+ // 清除token信息
+ removeToken();
+ removeRefreshToken();
+ // 重定向到登录页
+ // store.dispatch('FedLogOut').then(() => router.push({
+ // path: '/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错误码则首次报错时提示
+ if (status > 2000 && !validatenull(res.data.error_description)) {
+ // 首次报错时提示
+ if (!isErrorShown) {
+ isErrorShown = true;
+ ElMessage({
+ message: message,
+ type: 'error',
+ });
+ }
+ return Promise.reject(new Error(message));
+ }
+ // 如果请求为非200默认统一处理
+ if (status !== 200 && status !== 0) {
+ if (!isErrorShown) {
+ ElMessage({
+ message: message,
+ type: 'error',
+ });
+ }
+ return Promise.reject(new Error(message));
+ }
+ // 解析加密报文
+ if (cryptoData) {
+ res.data = JSON.parse(crypto.decryptAES(res.data, crypto.aesKey));
+ }
+ return res;
+ },
+ error => {
+ NProgress.done();
+ return Promise.reject(new Error(error));
+ }
);
export default axios;
diff --git a/src/buildConfig/buildConfig/config.jiangwu.js b/src/buildConfig/buildConfig/config.jiangwu.js
index f13287c..d3457b2 100644
--- a/src/buildConfig/buildConfig/config.jiangwu.js
+++ b/src/buildConfig/buildConfig/config.jiangwu.js
@@ -5,8 +5,6 @@
},
loginTitle: '大吉山钨业无人机安防监测平台',
-
-
-
+ hideMenuTopLogo: true, // 是否隐藏菜单顶部logo
}
-}
\ No newline at end of file
+}
diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue
index 456fa78..0d344ab 100644
--- a/src/page/index/logo.vue
+++ b/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: {
diff --git a/src/page/index/top/index.vue b/src/page/index/top/index.vue
index 9026c9a..d3c1d93 100644
--- a/src/page/index/top/index.vue
+++ b/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`)
+
})
})
},
diff --git a/src/permission.js b/src/permission.js
index 5272458..c91ba32 100644
--- a/src/permission.js
+++ b/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`)
}
}
})
diff --git a/src/views/job/components/SearchBox.vue b/src/views/job/components/SearchBox.vue
index 89ccc3c..9a53df5 100644
--- a/src/views/job/components/SearchBox.vue
+++ b/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
};
// 重置
@@ -302,7 +295,7 @@
// watch(
// () => store.state.task.jumpTask,
// newVal => {
-
+
// if (newVal && Object.keys(newVal).length) {
// // 兼容当日任务 计划任务 历史任务传参
// if (newVal.clickValue) {
@@ -343,7 +336,7 @@
const date = dayjs(calendarday.value).format(timeFormat);
const dateArray = [date, date];
-
+
dateRange.value = dateArray;
}
// 查询一次
diff --git a/src/views/job/components/TaskTop/TaskTotal.vue b/src/views/job/components/TaskTop/TaskTotal.vue
index 84de5a7..2d5ccaa 100644
--- a/src/views/job/components/TaskTop/TaskTotal.vue
+++ b/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">
@@ -136,7 +134,7 @@
height: 160px;
display: flex;
gap: 10px;
-
+
flex-wrap: wrap;
align-content: space-evenly;
.total {
diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 8f0b377..0a36838 100644
--- a/src/views/tickets/ticket.vue
+++ b/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 = []
@@ -1589,8 +1602,8 @@
})
}
this.currentDetail.status = row.status
-
-
+
+
} catch (error) {
if (this.activeTab === 'myTickets') {
const statusArr = this.workType === 1 ? ['3', '4'] : this.fixedStatuses
@@ -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
--
Gitblit v1.9.3