修改接口

main
夜笙歌 4 months ago
parent 2ac3b0b925
commit 39e38ecd53

@ -27,13 +27,13 @@ export function setParasSignalpro(data) {
export function getShildList(data) {
return request({
url: '/api/Fod/ShildList', method: 'get', params: data
url: '/api/Fod/ShildList', method: 'post', data: data
});
}
export function addShildData(data) {
return request({
url: '/api/Fod/ShildList', method: 'post', data: data
url: '/api/Fod/AddShild', method: 'post', data: data
});
}
@ -47,4 +47,28 @@ export function delShildData(data) {
return request({
url: '/api/Fod/DeleteShild', method: 'post', data: data
});
}
export function StartWork(data) {
return request({
url: '/api/Fod/StartWork', method: 'post', data: data
});
}
export function StopWork(data) {
return request({
url: '/api/Fod/StopWork', method: 'post', data: data
});
}
export function RestartWork(data) {
return request({
url: '/api/Fod/RestartWork', method: 'post', data: data
});
}
export function ShutDownWork(data) {
return request({
url: '/api/Fod/ShutDownWork', method: 'post', data: data
});
}

@ -54,6 +54,12 @@
</el-form-item>
</el-form>
</el-card>
<el-card shadow="always" style="margin-top: 12px;">
<el-button type="primary" @click="StartWorkBtn"></el-button>
<el-button type="danger" @click="StopWorkBtn"></el-button>
<el-button type="warning" @click="RestartWorkBtn"></el-button>
<el-button type="info" @click="ShutDownWorkBtn"></el-button>
</el-card>
<el-card shadow="always" style="margin-top: 12px;">
<div
style="width:calc( 50% - 50px);position: relative;border-radius: 5px;background-color: #01CE69;height: 44px;display: inline-block;padding:0 20px;margin-right: 20px;">
@ -122,7 +128,7 @@
show-overflow-tooltip>
<template #default="scope">
<el-button type="primary" link>已处理</el-button>
<el-button type="primary" link>不处理</el-button>
<el-button type="primary" link @click="addShildItem"></el-button>
<el-button type="primary" link>未发现</el-button>
</template>
</el-table-column>
@ -131,24 +137,35 @@
<el-card shadow="always" style="margin-top: 12px;">
<el-table :data="tableData2" style="width: 100%">
<el-table-column label="序号" type="index" width="60"/>
<el-table-column property="coordinate" label="目标坐标" width="120"/>
<el-table-column label="告警等级" width="160">
<template #default="scope">
<el-rate v-model="scope.row.rate" disabled/>
</template>
</el-table-column>
<el-table-column property="name" label="目标名称" width="120"/>
<el-table-column property="lon" label="目标经度" width="120"/>
<el-table-column property="lat" label="目标纬度" width="120"/>
<el-table-column property="deviation" label="deviation" width="120"/>
<el-table-column property="shielding" label="shielding" width="120"/>
<!-- <el-table-column label="告警等级" width="160">-->
<!-- <template #default="scope">-->
<!-- <el-rate v-model="scope.row.rate" disabled/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- label="处理状态"-->
<!-- show-overflow-tooltip>-->
<!-- <template #default="scope">-->
<!-- <span v-if="scope.row.type === 1"></span>-->
<!-- <span v-if="scope.row.type === 2"></span>-->
<!-- <span v-if="scope.row.type === 3"></span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label="其他操作" width="160">-->
<!-- <template #default="scope">-->
<!-- <el-input v-model="scope.row.notes" placeholder="详细信息填写"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
label="处理状态"
label="操作"
show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.type === 1"></span>
<span v-if="scope.row.type === 2"></span>
<span v-if="scope.row.type === 3"></span>
</template>
</el-table-column>
<el-table-column label="其他操作" width="160">
<template #default="scope">
<el-input v-model="scope.row.notes" placeholder="详细信息填写"/>
<el-button type="primary" link @click="delShildItem(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
@ -250,7 +267,7 @@
</el-form-item>
<el-form-item style="width:100%; ">
<div style="text-align:center; width:100%">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="saveParasSignalproForm"></el-button>
</div>
</el-form-item>
</el-form>
@ -258,36 +275,36 @@
<el-form :model="parasPosForm" label-width="auto" label-position="top" :inline="true">
<el-form-item style="width: calc(33% - 32px)" label="路线数量">
<el-input-number v-model="(parasPosForm.runwaynum ||{}).startpos_num" :precision="0" :step="1"
:min="0"></el-input-number>
:min="0" @change="updateRunwayNum"></el-input-number>
</el-form-item>
<div style="width: 100%"></div>
<template v-for="(i,k) in (parasPosForm.runwaynum || {}).startpos_num || 0">
<div style="width: 100%">路线{{ k + 1 }}设置</div>
<el-form-item style="width: calc(33% - 32px)" label="startpos_lon_a">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_lon_a"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_lon_a"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_lat_a">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_lat_a"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_lat_a"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_alt_a">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_alt_a"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_alt_a"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_lon_b">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_lon_b"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_lon_b"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_lat_b">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_lat_b"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_lat_b"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_alt_b">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_alt_b"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_alt_b"/>
</el-form-item>
<el-form-item style="width: calc(33% - 32px)" label="startpos_ori">
<el-input v-model="(parasPosForm[`runwayedge${k}`]||{}).startpos_ori"/>
<el-input v-model="((parasPosForm.runwayedges||[])[k]||{}).startpos_ori"/>
</el-form-item>
</template>
<el-form-item style="width:100%; ">
<div style="text-align:center; width:100%">
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="saveParasPosForm"></el-button>
</div>
</el-form-item>
</el-form>
@ -388,7 +405,15 @@
<script setup>
import Ruler from "@/components/ruler.vue";
import {onMounted, ref} from "vue";
import {getParasPos} from "@/api/api";
import {
getParasPos,
getParasSignalpro,
setParasPos,
setParasSignalpro,
getShildList,
addShildData,
delShildData, StartWork
} from "@/api/api";
const socketData = [
{
@ -516,10 +541,21 @@ const tableData1 = ref([
])
const tableData2 = ref([
{
coordinate: '528,11',
rate: 2,
type: 1
"id": 2,
"name": "测试",
"lon": 12.2299995,
"lat": 323.329987,
"deviation": 12,
"shielding": 20
},
{
"id": 1,
"name": "测试",
"lon": 12.2299995,
"lat": 323.329987,
"deviation": 12,
"shielding": 20
}
])
const date1 = ref([])
const setItemsId = (e) => {
@ -556,16 +592,98 @@ const parasSignalproForm = ref({
const parasPosForm = ref({
runwaynum: {
startpos_num: 1
}
},
runwayedges: [
{
startpos_lon_a: '',
startpos_lat_a: '',
startpos_alt_a: '',
startpos_lon_b: '',
startpos_lat_b: '',
startpos_alt_b: '',
startpos_ori: ''
}
]
})
getParasPos().then((e) => {
console.log(e)
})
onMounted(() => {
ad()
getOption()
getShildTableList()
})
const getOption = () => {
getParasPos().then((e) => {
parasPosForm.value = {
runwaynum: e.runwaynum,
runwayedges: e.runwayedges,
}
})
getParasSignalpro().then((e) => {
parasSignalproForm.value = {
imaging: e.imaging,
dectection: e.dectection,
}
})
}
const saveParasSignalproForm = () => {
setParasSignalpro(parasSignalproForm.value).then(e => {
console.log(e)
})
}
const saveParasPosForm = () => {
setParasPos(parasPosForm.value).then(e => {
console.log(e)
})
}
const updateRunwayNum = (e) => {
let arr = new Array(e).fill(0)
.map((item, index) => {
if (index <= parasPosForm.value.runwayedges.length - 1) {
return JSON.parse(JSON.stringify(parasPosForm.value.runwayedges[index]))
} else {
return {
startpos_lon_a: '',
startpos_lat_a: '',
startpos_alt_a: '',
startpos_lon_b: '',
startpos_lat_b: '',
startpos_alt_b: '',
startpos_ori: ''
}
}
})
console.log(arr)
parasPosForm.value.runwayedges = JSON.parse(JSON.stringify(arr))
}
const addShildItem = () => {
addShildData({
name: 'string',
lon: 123,
lat: 12,
deviation: 12,
shielding: 23
}).then(e => {
getShildTableList()
})
}
const delShildItem = (e) => {
delShildData(e).then(e => {
getShildTableList()
})
}
const getShildTableList = () => {
getShildList({
pageIndex: 1,
pageSize: 10,
name: 'string'
}).then((e) => {
tableData2.value = e.data
})
}
const ad = () => {
// 1. WebSocket ws:// wss://
@ -592,6 +710,19 @@ const ad = () => {
});
}
const StartWorkBtn = () => {
StartWork()
}
const StopWorkBtn = () => {
StopWork()
}
const RestartWorkBtn = () => {
RestartWork()
}
const ShutDownWorkBtn = () => {
ShutDownWork()
}
</script>
<style>
.app-container {

@ -7,7 +7,7 @@ export default defineConfig({
base: './', server: {
host: '0.0.0.0', port: 5173, open: true, proxy: {
'/dev-api': {
target: 'http://192.168.0.103:5000',
target: 'http://192.168.0.14:5000',
changeOrigin: true,
ws: true,
secure: false,

Loading…
Cancel
Save