吉安感知网项目-前端
罗广辉
2026-01-14 94119cd2eed9a4ae33a599595bc6c9bf9d67c0aa
feat: 一些调整
8 files modified
2 files renamed
259 ■■■■ changed files
applications/drone-command/src/views/areaManage/sceneConfig/index.vue 81 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/basicManage/deviceStock/index.vue 98 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/detectionCountermeasure/countermeasureEvaluation/FormDiaLog.vue 10 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/detectionCountermeasure/countermeasureEvaluation/index.vue 25 ●●●● patch | view | raw | blame | history
applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue patch | view | raw | blame | history
applications/drone-command/src/views/detectionCountermeasure/detectionRange/index.vue 2 ●●● patch | view | raw | blame | history
applications/drone-command/src/views/detectionCountermeasure/taskSchedule/index.vue 16 ●●●●● patch | view | raw | blame | history
applications/drone-command/src/views/recordManage/alarmRecords/index.vue 17 ●●●● patch | view | raw | blame | history
packages/constants/fwDevice.js 8 ●●●●● patch | view | raw | blame | history
packages/utils/common/index.js 2 ●●● patch | view | raw | blame | history
applications/drone-command/src/views/areaManage/sceneConfig/index.vue
@@ -2,22 +2,48 @@
    <basic-container>
        <el-form ref="queryParamsRef" :model="searchParams" class="ztzf-page-history-search">
            <el-form-item label="场景名称" prop="sceneName">
                <el-input class="ztzf-data-cockpit-search-input" v-model="searchParams.sceneName" placeholder="请输入"
                    clearable @clear="handleSearch" />
                <el-input
                    class="ztzf-data-cockpit-search-input"
                    v-model="searchParams.sceneName"
                    placeholder="请输入"
                    clearable
                    @clear="handleSearch"
                />
            </el-form-item>
            <el-form-item label="场景类型" prop="sceneType">
                <el-select class="ztzf-data-cockpit-select" popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.sceneType" placeholder="请选择" clearable @change="handleSearch">
                    <el-option v-for="item in dictObj.sceneType" :key="item.dictKey" :label="item.dictValue"
                        :value="item.dictKey" />
                <el-select
                    class="ztzf-data-cockpit-select"
                    popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.sceneType"
                    placeholder="请选择"
                    clearable
                    @change="handleSearch"
                >
                    <el-option
                        v-for="item in dictObj.sceneType"
                        :key="item.dictKey"
                        :label="item.dictValue"
                        :value="item.dictKey"
                    />
                </el-select>
            </el-form-item>
            <el-form-item label="场景状态" prop="status">
                <el-select class="ztzf-data-cockpit-select" popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.status" placeholder="请选择" clearable @change="handleSearch">
                    <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value" />
                <el-select
                    class="ztzf-data-cockpit-select"
                    popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.status"
                    placeholder="请选择"
                    clearable
                    @change="handleSearch"
                >
                    <el-option
                        v-for="item in dictObj.sceneStatus"
                        :key="item.dictKey"
                        :label="item.dictValue"
                        :value="item.dictKey"
                    />
                </el-select>
            </el-form-item>
@@ -37,7 +63,7 @@
                <el-table class="ztzf-data-cockpit-table" :data="list" @selection-change="handleSelectionChange">
                    <el-table-column type="selection" width="46" />
                    <el-table-column type="index" show-overflow-tooltip width="64" label="序号" />
                    <el-table-column prop="sceneName" show-overflow-tooltip width="130" label="场景名称" />
                    <el-table-column prop="sceneType" show-overflow-tooltip width="120" label="场景类型">
                        <template v-slot="{ row }">
@@ -65,9 +91,14 @@
            </div>
            <div class="ztzf-table-pagination">
                <el-pagination popper-class="ztzf-data-cockpit-select-popper"
                    v-model:current-page="searchParams.current" v-model:page-size="searchParams.size"
                    layout="total, prev, pager, next, sizes" :total="total" @change="getList" />
                <el-pagination
                    popper-class="ztzf-data-cockpit-select-popper"
                    v-model:current-page="searchParams.current"
                    v-model:page-size="searchParams.size"
                    layout="total, prev, pager, next, sizes"
                    :total="total"
                    @change="getList"
                />
            </div>
        </div>
@@ -101,13 +132,8 @@
const dialogRef = ref(null) // 弹框实例
const dialogVisible = ref(false)
const statusOptions = ref([
    { label: '正常', value: 0 },
    { label: '停用', value: 1 },
])
// 获取列表
async function getList () {
async function getList() {
    loading.value = true
    try {
        const res = await fwDefenseScenePageApi(searchParams.value)
@@ -119,20 +145,20 @@
}
// 查询
function handleSearch () {
function handleSearch() {
    searchParams.value.current = 1
    getList()
}
// 重置查询
function resetForm () {
function resetForm() {
    queryParamsRef.value?.resetFields()
    searchParams.value.current = 1
    getList()
}
// 删除
async function handleDelete (row) {
async function handleDelete(row) {
    const tips = row ? '该条' : '选中的项'
    await ElMessageBox.confirm(`确认删除${tips}吗?`, '提示', { type: 'warning' })
    const ids = row ? row.id : selectedIds.value.join(',')
@@ -143,11 +169,11 @@
}
// 勾选值设置
function handleSelectionChange (rows) {
function handleSelectionChange(rows) {
    selectedIds.value = rows.map(item => item.id)
}
function formatLocation (row) {
function formatLocation(row) {
    if (row?.longitude == null || row?.latitude == null) return ''
    return `${_.round(row.longitude, 6)}, ${_.round(row.latitude, 6)}`
}
@@ -156,18 +182,19 @@
    sceneType: [], // 场景类型
    deviceMode: [], // 设备模式
    areaType: [], // 区域类型
    sceneStatus: [], // 场景状态
})
provide('dictObj', dictObj)
// 获取字典
function getDictList () {
    getDictionaryByCode('sceneType,deviceMode,areaType').then(res => {
function getDictList() {
    getDictionaryByCode('sceneType,deviceMode,areaType,sceneStatus').then(res => {
        dictObj.value = res.data.data
    })
}
// 新增/编辑/查看 弹框
function openForm (mode, row) {
function openForm(mode, row) {
    dialogVisible.value = true
    nextTick(() => {
        dialogRef.value?.open({ mode, row })
applications/drone-command/src/views/basicManage/deviceStock/index.vue
@@ -2,29 +2,59 @@
    <basic-container>
        <el-form ref="queryParamsRef" :model="searchParams" class="ztzf-page-history-search">
            <el-form-item label="名称" prop="deviceName">
                <el-input class="ztzf-data-cockpit-search-input" v-model="searchParams.deviceName" placeholder="请输入"
                    clearable @clear="handleSearch" />
                <el-input
                    class="ztzf-data-cockpit-search-input"
                    v-model="searchParams.deviceName"
                    placeholder="请输入"
                    clearable
                    @clear="handleSearch"
                />
            </el-form-item>
            <el-form-item label="类型" prop="deviceType">
                <el-select class="ztzf-data-cockpit-select" popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.deviceType" placeholder="请选择" clearable @change="handleSearch">
                    <el-option v-for="item in dictObj.deviceType" :key="item.dictKey" :label="item.dictValue"
                        :value="item.dictKey" />
                <el-select
                    class="ztzf-data-cockpit-select"
                    popper-class="ztzf-data-cockpit-select-popper"
                    v-model="searchParams.deviceType"
                    placeholder="请选择"
                    clearable
                    @change="handleSearch"
                >
                    <el-option
                        v-for="item in dictObj.deviceType"
                        :key="item.dictKey"
                        :label="item.dictValue"
                        :value="item.dictKey"
                    />
                </el-select>
            </el-form-item>
            <el-form-item label="部门" prop="belongDept">
                <el-tree-select class="ztzf-data-cockpit-select" popper-class="ztzf-data-cockpit-tree-select-popper"
                    v-model="searchParams.belongDept" :data="deptTree" :props="treeProps" node-key="id" check-strictly
                    clearable @change="handleSearch" />
                <el-tree-select
                    class="ztzf-data-cockpit-select"
                    popper-class="ztzf-data-cockpit-tree-select-popper"
                    v-model="searchParams.belongDept"
                    :data="deptTree"
                    :props="treeProps"
                    node-key="id"
                    check-strictly
                    clearable
                    @change="handleSearch"
                />
            </el-form-item>
            <el-form-item label="时间">
                <el-date-picker popper-class="ztzf-data-cockpit-date-picker-popper"
                    class="ztzf-data-cockpit-date-picker" v-model="dateRange" type="daterange" range-separator="至"
                    start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYY-MM-DD HH:mm:ss"
                    @change="handleSearch" />
                <el-date-picker
                    popper-class="ztzf-data-cockpit-date-picker-popper"
                    class="ztzf-data-cockpit-date-picker"
                    v-model="dateRange"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    value-format="YYYY-MM-DD HH:mm:ss"
                    @change="handleSearch"
                />
            </el-form-item>
            <el-form-item class="history-search-actions">
@@ -64,7 +94,7 @@
                    <el-table-column prop="charger" show-overflow-tooltip width="100" label="负责人" />
                    <el-table-column prop="yxzt" show-overflow-tooltip width="116" label="运行状态">
                        <template v-slot="{ row }">
                            {{ DEVICE_STATUS[row.status] || '-' }}
                            {{ getDictLabel(row.status, dictObj.deviceStatus) }}
                        </template>
                    </el-table-column>
                    <el-table-column label="操作" class-name="operation-btns">
@@ -80,9 +110,14 @@
            </div>
            <div class="ztzf-table-pagination">
                <el-pagination popper-class="ztzf-data-cockpit-select-popper"
                    v-model:current-page="searchParams.current" v-model:page-size="searchParams.size"
                    layout="total, prev, pager, next, sizes" :total="total" @change="getList" />
                <el-pagination
                    popper-class="ztzf-data-cockpit-select-popper"
                    v-model:current-page="searchParams.current"
                    v-model:page-size="searchParams.size"
                    layout="total, prev, pager, next, sizes"
                    :total="total"
                    @change="getList"
                />
            </div>
        </div>
@@ -101,7 +136,6 @@
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getDeptTree } from '@/api/system/dept'
import { blobDownload, dateRangeFormat, getDictLabel, formatDateToSlash } from '@ztzf/utils'
import { DEVICE_STATUS } from '@ztzf/constants'
import DeviceTrackDiaLog from '@/views/basicManage/deviceStock/DeviceTrackDiaLog.vue'
import DeviceScrapDiaLog from '@/views/basicManage/deviceStock/DeviceScrapDiaLog.vue'
@@ -136,7 +170,7 @@
provide('deptTree', deptTree)
// 获取列表
async function getList () {
async function getList() {
    const range = dateRangeFormat(dateRange.value)
    loading.value = true
    try {
@@ -150,13 +184,13 @@
}
// 查询
function handleSearch () {
function handleSearch() {
    searchParams.value.current = 1
    getList()
}
// 重置查询
function resetForm () {
function resetForm() {
    dateRange.value = []
    queryParamsRef.value?.resetFields()
    searchParams.value.current = 1
@@ -164,25 +198,25 @@
}
// 查看
function handleView (row) {
function handleView(row) {
    dialogRef.value?.open({ mode: 'view', row: { ...row } })
}
// 编辑
function handleEdit (row) {
function handleEdit(row) {
    dialogRef.value?.open({ mode: 'edit', row: { ...row } })
}
function outbound (row) {
function outbound(row) {
    outboundDialogRef.value?.open({ mode: 'edit', row: { ...row } })
}
function scrap (row) {
function scrap(row) {
    scrapDialogRef.value?.open({ mode: 'edit', row: { ...row } })
}
// 删除
async function handleDelete (row) {
async function handleDelete(row) {
    const tips = row ? '该条' : '选中的项'
    await ElMessageBox.confirm(`确认删除${tips}吗?`, '提示', { type: 'warning' })
    const ids = row ? row.id : selectedIds.value.join(',')
@@ -193,11 +227,11 @@
}
// 勾选值设置
function handleSelectionChange (rows) {
function handleSelectionChange(rows) {
    selectedIds.value = rows.map(item => item.id)
}
function exportFile () {
function exportFile() {
    exportLoading.value = true
    exportFwDeviceApi()
        .then(res => {
@@ -209,21 +243,21 @@
}
// 获取字典
function getDictList () {
    getDictionaryByCode('deviceType,deviceAtt').then(res => {
function getDictList() {
    getDictionaryByCode('deviceType,deviceAtt,deviceStatus').then(res => {
        dictObj.value = res.data.data
    })
}
// 获取部门树
function getDeptTreeFun () {
function getDeptTreeFun() {
    getDeptTree().then(res => {
        deptTree.value = res.data.data
    })
}
// 新增
function handleAdd () {
function handleAdd() {
    dialogRef.value?.open({ mode: 'add' })
}
applications/drone-command/src/views/detectionCountermeasure/countermeasureEvaluation/FormDiaLog.vue
@@ -15,7 +15,7 @@
                    <div>发现时间: {{ formData.findTime }}</div>
                </el-col>
                <el-col :span="12">
                    <div>反制效果: {{ getCounterEffectLabel(formData.counterEffect) }}</div>
                    <div>反制效果: {{ getDictLabel(formData.counterEffect, dictObj.counterEffect) }}</div>
                </el-col>
                <el-col :span="12">
                    <div>反制方式: {{ getCounterWayLabel(formData.counterWay) }}</div>
@@ -55,6 +55,7 @@
<script setup>
import { computed, ref, inject } from 'vue'
import { fwEffectEvalDetailApi } from './countermeasureEvaluationApi'
import { getDictLabel } from '../../../../../../packages/utils'
// 初始化表单数据
const initForm = () => ({
@@ -78,7 +79,6 @@
// 注入字典数据
const dictObj = inject('dictObj')
// 注入反制效果选项
const counterEffectOptions = inject('counterEffectOptions')
const formData = ref(initForm()) // 表单数据
const visible = defineModel() // 弹框显隐
@@ -89,12 +89,6 @@
// 关闭弹框
function handleCancel() {
    visible.value = false
}
// 获取反制效果标签
function getCounterEffectLabel(value) {
    const item = counterEffectOptions.find(opt => opt.value === value)
    return item ? item.label : value
}
// 获取反制方式标签
applications/drone-command/src/views/detectionCountermeasure/countermeasureEvaluation/index.vue
@@ -23,10 +23,10 @@
                    <el-form-item label="反制效果" prop="counterEffect">
                        <el-select v-model="searchParams.counterEffect" placeholder="请选择" clearable @change="handleSearch">
                            <el-option
                                v-for="item in counterEffectOptions"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value"
                                v-for="item in dictObj.counterEffect"
                                :key="item.dictKey"
                                :label="item.dictValue"
                                :value="item.dictKey"
                            />
                        </el-select>
                    </el-form-item>
@@ -47,7 +47,7 @@
            <el-table-column prop="findTime" label="发现时间" />
            <el-table-column prop="counterEffect" label="反制效果">
                <template v-slot="{ row }">
                    {{ getCounterEffectLabel(row.counterEffect) }}
                    {{ getDictLabel(row.counterEffect, dictObj.counterEffect) }}
                </template>
            </el-table-column>
            <el-table-column prop="deviceName" label="反制设备名称" />
@@ -119,17 +119,11 @@
const dialogVisible = ref(null) // 弹框显隐
const dictObj = ref({
    deviceType: [], // 设备类型
    counterEffect: [], // 反制效果
})
// 反制效果下拉选项
const counterEffectOptions = [
    { value: 'fail', label: '失败' },
    { value: 'success', label: '成功' },
]
// 注入字典和反制效果选项供FormDiaLog使用
provide('dictObj', dictObj)
provide('counterEffectOptions', counterEffectOptions)
// 获取列表
async function getList() {
@@ -157,11 +151,6 @@
    getList()
}
// 获取反制效果标签
function getCounterEffectLabel(value) {
    const item = counterEffectOptions.find(opt => opt.value === value)
    return item ? item.label : value
}
// 获取工作模式标签
function getWorkModeLabel(value) {
@@ -171,7 +160,7 @@
// 获取字典
function getDictList() {
    getDictionaryByCode('deviceType').then(res => {
    getDictionaryByCode('deviceType,counterEffect').then(res => {
        dictObj.value = res.data.data
    })
}
applications/drone-command/src/views/detectionCountermeasure/detectionRange/DetectionRangeDialog.vue
applications/drone-command/src/views/detectionCountermeasure/detectionRange/index.vue
File was renamed from applications/drone-command/src/views/detectionCountermeasure/detectionRange.vue
@@ -77,7 +77,7 @@
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { getDictLabel } from '@ztzf/utils'
import { detectionRangePageApi, detectionRangeSubmitApi } from '@/api/detectionCountermeasure/detectionRange'
import DetectionRangeDialog from './components/DetectionRangeDialog.vue'
import DetectionRangeDialog from './DetectionRangeDialog.vue'
const initSearchParams = () => ({
    deviceName: '', // 设备名称
applications/drone-command/src/views/detectionCountermeasure/taskSchedule/index.vue
@@ -60,7 +60,7 @@
                    <el-table-column prop="deviceCode" show-overflow-tooltip width="140" label="设备编码" />
                    <el-table-column prop="deviceStatus" show-overflow-tooltip width="100" label="设备状态">
                        <template v-slot="{ row }">
                            {{ getDeviceStatusLabel(row.deviceStatus) }}
                            {{ getDictLabel(row.deviceStatus, dictObj.deviceStatus) }}
                        </template>
                    </el-table-column>
                    <el-table-column prop="areaDivideName" show-overflow-tooltip width="120" label="区域" />
@@ -77,12 +77,12 @@
                    <el-table-column prop="dispatchContent" show-overflow-tooltip width="160" label="调度内容" />
                    <el-table-column prop="dispatchResult" show-overflow-tooltip width="160" label="调度结果" />
                    <el-table-column prop="disposeMeasure" show-overflow-tooltip width="160" label="处理措施" />
                    <el-table-column label="操作" class-name="operation-btns" fixed="right" width="120">
                    <!--                    <el-table-column label="操作" class-name="operation-btns" fixed="right" width="120">
                        <template v-slot="{ row }">
                            <el-link @click="openForm('edit', row)">编辑</el-link>
                            <el-link @click="handleDelete(row)">删除</el-link>
                        </template>
                    </el-table-column>
                    </el-table-column>-->
                </el-table>
            </div>
@@ -118,6 +118,7 @@
import { fwDeviceListApi } from '@/views/basicManage/deviceStock/fwDevice'
import { getDictionaryByCode } from '@/api/system/dictbiz'
import FormDiaLog from './FormDiaLog.vue'
import { getDictLabel } from '@ztzf/utils'
// 初始化查询参数
const initSearchParams = () => ({
@@ -137,18 +138,13 @@
const dialogVisible = ref(false)
const dictObj = ref({
    deviceType: [], // 设备类型
    deviceStatus: [], // 设备状态
})
const sceneList = ref([]) // 场景列表
const deviceList = ref([]) // 设备列表
// 注入字典到子组件
provide('dictObj', dictObj)
// 获取设备状态标签
function getDeviceStatusLabel(status) {
    const statusMap = { 0: '离线', 1: '在线' }
    return statusMap[status] || status
}
// 格式化调度日期
function formatDispatchDate(row) {
@@ -209,7 +205,7 @@
// 加载字典数据
function getDictList() {
    getDictionaryByCode('deviceType').then(res => {
    getDictionaryByCode('deviceType,deviceStatus').then(res => {
        dictObj.value = res.data.data
    })
}
applications/drone-command/src/views/recordManage/alarmRecords/index.vue
@@ -64,10 +64,10 @@
                    {{ getDeviceTypeName(row.droneType) }}
                </template>
            </el-table-column>
            <el-table-column prop="deviceCode" label="设备编码" />
            <el-table-column prop="deviceSn" label="设备编码" />
            <el-table-column label="设备状态">
                <template v-slot="{ row }">
                    {{ getDeviceStatus(row) }}
                    {{ getDictLabel(row.deviceStatus, dictObj.deviceStatus) }}
                </template>
            </el-table-column>
        </el-table>
@@ -90,7 +90,7 @@
import { getDictionaryByCode } from '@/api/system/dictbiz'
import { exportFwDroneAlarmRecordApi, fwDroneAlarmRecordPageApi } from './fwDroneAlarmRecord'
import FormDiaLog from './FormDiaLog.vue'
import { blobDownload, dateRangeFormat } from '@ztzf/utils'
import { blobDownload, dateRangeFormat, getDictLabel } from '@ztzf/utils'
const initSearchParams = () => ({
    droneName: '', // 无人机名称
@@ -145,11 +145,6 @@
    getList()
}
// 查看
function handleView(row) {
    dialogRef.value?.open({ mode: 'view', row: { ...row } })
}
function exportFile() {
    exportLoading.value = true
    exportFwDroneAlarmRecordApi()
@@ -161,17 +156,13 @@
        })
}
function getDeviceStatus(row) {
    return row.deviceStatus ?? row.status ?? '-'
}
function getDeviceTypeName(value) {
    return deviceTypeMap.value.get(value) || value || '-'
}
// 获取字典
function getDictList() {
    getDictionaryByCode('deviceType').then(res => {
    getDictionaryByCode('deviceType,deviceStatus').then(res => {
        dictObj.value = res.data.data
    })
}
packages/constants/fwDevice.js
@@ -1,9 +1 @@
// 设备状态
export const DEVICE_STATUS = {
    0: '在线',
    1: '离线',
    2: '故障',
    3: '报废',
}
export const DEVICE_STATUS_LIST = Object.keys(DEVICE_STATUS).map(key => ({ value: key, label: DEVICE_STATUS[key] }))
packages/utils/common/index.js
@@ -14,7 +14,7 @@
export function getDictLabel(value, dictList) {
    return dictList.find(item => item.dictKey === value)?.dictValue || value || '-'
    return dictList.find(item => item.dictKey === String(value))?.dictValue || value || ''
}
export function blobDownload(res) {