标记位置后刷新

This commit is contained in:
曹前明 2022-09-18 16:59:06 +08:00
parent 5f8cc08314
commit a6e3ef1fb4
7 changed files with 17 additions and 12 deletions

View File

@ -7,7 +7,7 @@ VUE_APP_TITLE = '曲阳金隅安全智能管控平台'
# 接口地址 # 接口地址
#VUE_APP_API_BASEURL = http://1.203.161.103:2800/api #VUE_APP_API_BASEURL = http://1.203.161.103:2800/api
#VUE_APP_WS_API = 'ws://localhost:8000' #VUE_APP_WS_API = 'ws://localhost:8000'
VUE_APP_API_BASEURL = http://10.99.5.79:20309/api VUE_APP_API_BASEURL = http://222.222.144.147:6013/api
#VUE_APP_API_BASEURL = http://127.0.0.1:8000/api #VUE_APP_API_BASEURL = http://127.0.0.1:8000/api
#VUE_APP_BASEURL = http://127.0.0.1:8000 #VUE_APP_BASEURL = http://127.0.0.1:8000

View File

@ -26,7 +26,7 @@
let urls = window.location.host; let urls = window.location.host;
window.IPConfig = { window.IPConfig = {
//此处的IP在打包不会被编译可修改 //此处的IP在打包不会被编译可修改
baseURL: urls+'/api' baseURL: 'http://' + urls+'/api'
} }
</script> </script>
<div id="app" class="aminui"> <div id="app" class="aminui">

View File

@ -13,7 +13,7 @@ const DEFAULT_CONFIG = {
//接口地址 //接口地址
// API_URL: process.env.NODE_ENV === 'development' && process.env.VUE_APP_PROXY === 'false' ? "/api" : process.env.VUE_APP_API_BASEURL, // API_URL: process.env.NODE_ENV === 'development' && process.env.VUE_APP_PROXY === 'false' ? "/api" : process.env.VUE_APP_API_BASEURL,
API_URL: window.IPConfig.baseURL.indexOf('localhost')>-1? "http://10.99.5.79:20309/api" : window.IPConfig.baseURL, API_URL: get_api_url(),
//请求超时 //请求超时
TIMEOUT: 200000, TIMEOUT: 200000,
@ -28,7 +28,7 @@ const DEFAULT_CONFIG = {
HEADERS: {}, HEADERS: {},
//视频地址 //视频地址
VUE_APP_VIDEOHOST : '10.99.5.24', VUE_APP_VIDEOHOST: '10.99.5.24',
//请求是否开启缓存 //请求是否开启缓存
REQUEST_CACHE: false, REQUEST_CACHE: false,
@ -70,10 +70,15 @@ const DEFAULT_CONFIG = {
] ]
} }
} }
function get_api_url(){
if(process.env.NODE_ENV === 'development' || (process.env.NODE_ENV === 'production' && window.location.host.indexOf('localhost') > -1)){
return process.env.VUE_APP_API_BASEURL
}
return 'http://' + window.location.host + '/api'
}
// 如果生产模式就合并动态的APP_CONFIG // 如果生产模式就合并动态的APP_CONFIG
// public/config.js // public/config.js
if(process.env.NODE_ENV === 'production'){ if (process.env.NODE_ENV === 'production') {
Object.assign(DEFAULT_CONFIG, APP_CONFIG) Object.assign(DEFAULT_CONFIG, APP_CONFIG)
} }

View File

@ -4,7 +4,7 @@ import sysConfig from "@/config";
import tool from '@/utils/tool'; import tool from '@/utils/tool';
import router from '@/router'; import router from '@/router';
axios.defaults.baseURL = window.IPConfig.baseURL; axios.defaults.baseURL = sysConfig.API_URL;
axios.defaults.timeout = sysConfig.TIMEOUT axios.defaults.timeout = sysConfig.TIMEOUT

View File

@ -33,7 +33,7 @@
</el-table-column> </el-table-column>
<el-table-column label="sn" prop="extra" min-width="90"> <el-table-column label="sn" prop="extra" min-width="90">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.extra">{{ scope.row.extra.config.sn }}</span> <span v-if="scope.row.extra.config">{{ scope.row.extra.config.sn }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="ip" prop="extra" min-width="90"> <el-table-column label="ip" prop="extra" min-width="90">
@ -62,7 +62,7 @@
</el-main> </el-main>
</el-container> </el-container>
<channel-view v-if="dialogSave" ref="saveDialog" :channelId="channelId" :channelName="channelName" :channelArea="channelArea" :channelAreas="channelAreas" <channel-view v-if="dialogSave" ref="saveDialog" :channelId="channelId" :channelName="channelName" :channelArea="channelArea" :channelAreas="channelAreas"
:channelLocation="channelLocation" @closed="dialogSave = false"></channel-view> :channelLocation="channelLocation" @closed="dialogSave = false" @success="handleQuery"></channel-view>
</template> </template>
<script> <script>
import channelView from "./vchannel_view"; import channelView from "./vchannel_view";

View File

@ -89,7 +89,7 @@
</template> </template>
</el-dialog> </el-dialog>
<channel-view v-if="dialogSave" ref="saveDialog" :channelId="channelId" :channelName="channelName" :channelArea="channelArea" :channelAreas="channelAreas" <channel-view v-if="dialogSave" ref="saveDialog" :channelId="channelId" :channelName="channelName" :channelArea="channelArea" :channelAreas="channelAreas"
:channelLocation="channelLocation" @closed="dialogSave = false"></channel-view> :channelLocation="channelLocation" @closed="dialogSave = false" @success="handleQuery"></channel-view>
</template> </template>
<script> <script>
import channelView from "./vchannel_view"; import channelView from "./vchannel_view";

View File

@ -1,5 +1,5 @@
<template> <template>
<el-drawer id="mapDrawer" :title="channelName" v-model="visible" destroy-on-close :size="'80%'" <el-drawer id="mapDrawer" :title="channelName" v-model="visible" :size="'80%'"
@closed="closeDrawer"> @closed="closeDrawer">
<el-form :model="form" label-width="80px" style="position:absolute;top:15px;left:300px;"> <el-form :model="form" label-width="80px" style="position:absolute;top:15px;left:300px;">
<el-row> <el-row>