| | |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="场景类型" prop="sceneType"> |
| | | <el-select |
| | | class="command-select" |
| | | popper-class="command-select-popper" |
| | | v-model="searchParams.sceneType" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="handleSearch" |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.CommandSceneType" |
| | | :key="item.dictKey" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item class="history-search-actions"> |
| | | <el-button :icon="RefreshRight" @click="resetForm"></el-button> |
| | | <el-button class="search-btn" :icon="Search" @click="handleSearch"></el-button> |
| | |
| | | <el-table-column type="index" show-overflow-tooltip width="64" label="序号" /> |
| | | |
| | | <el-table-column prop="sceneName" show-overflow-tooltip label="场景名称" /> |
| | | <el-table-column prop="sceneType" show-overflow-tooltip label="场景类型"> |
| | | <el-table-column show-overflow-tooltip label="指挥点经度纬度"> |
| | | <template v-slot="{ row }"> |
| | | {{ getDictLabel(row.sceneType, dictObj.CommandSceneType) }} |
| | | {{ formatLocation(row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="areaCount" show-overflow-tooltip label="区域数量" /> |
| | | <el-table-column prop="counterDeviceCount" show-overflow-tooltip label="反制设备数量" /> |
| | | <el-table-column prop="detectDeviceCount" show-overflow-tooltip label="探测设备数量" /> |
| | | <el-table-column prop="defenseLeader" show-overflow-tooltip label="防控负责人" /> |
| | | <el-table-column prop="leaderPhone" show-overflow-tooltip label="防控负责人电话" /> |
| | | <el-table-column show-overflow-tooltip label="有效时间"> |
| | | <template v-slot="{ row }"> |
| | | {{ formatEffectiveDate(row) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="defenseSceneId" show-overflow-tooltip label="关联场景配置ID" /> |
| | | <el-table-column label="操作" class-name="operation-btns"> |
| | | <template v-slot="{ row }"> |
| | | <el-link @click="openForm('view', row)">查看</el-link> |
| | |
| | | |
| | | <script setup> |
| | | import { Search, RefreshRight, Plus, Delete } from '@element-plus/icons-vue' |
| | | import { nextTick, onMounted, provide, ref } from 'vue' |
| | | import { nextTick, onMounted, ref } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { fwDefenseScenePageApi, fwDefenseSceneRemoveApi } from './sceneConfigApi' |
| | | import { fwDefenseSceneManagePageApi, fwDefenseSceneManageRemoveApi } from './sceneManageApi' |
| | | import FormDiaLog from './FormDiaLog.vue' |
| | | import { getDictionaryByCode } from '@/api/system/dictbiz' |
| | | import { getDictLabel } from '@ztzf/utils' |
| | | import { saveOperationLog } from '@ztzf/apis' |
| | | import { useRoute } from 'vue-router' |
| | | |
| | | // 初始化查询参数 |
| | | const initSearchParams = () => ({ |
| | | sceneName: '', // 场景名称 |
| | | sceneType: '', // 场景类型 |
| | | current: 1, // 当前页 |
| | | size: 10, // 每页大小 |
| | | }) |
| | |
| | | const dialogVisible = ref(false) |
| | | const route = useRoute() |
| | | |
| | | // 获取列表 |
| | | // 获取列表数据 |
| | | async function getList() { |
| | | loading.value = true |
| | | try { |
| | | const res = await fwDefenseScenePageApi(searchParams.value) |
| | | const res = await fwDefenseSceneManagePageApi(searchParams.value) |
| | | list.value = res?.data?.data?.records ?? [] |
| | | total.value = res?.data?.data?.total ?? 0 |
| | | } finally { |
| | |
| | | cancelButtonClass: 'command-message-box-cancel', |
| | | }) |
| | | const ids = row ? row.id : selectedIds.value.join(',') |
| | | await fwDefenseSceneRemoveApi({ ids }) |
| | | await fwDefenseSceneManageRemoveApi({ ids }) |
| | | saveOperationLog({ |
| | | requestUri: route.path, |
| | | title: `${route.name || '场景配置管理'}-删除`, |
| | | title: `${route.name || '场景管理'}-删除`, |
| | | type: 1, |
| | | }) |
| | | ElMessage.success('删除成功') |
| | |
| | | selectedIds.value = rows.map(item => item.id) |
| | | } |
| | | |
| | | // 格式化指挥点位置 |
| | | function formatLocation(row) { |
| | | if (row?.longitude == null || row?.latitude == null) return '' |
| | | return `${_.round(row.longitude, 6)}, ${_.round(row.latitude, 6)}` |
| | | } |
| | | |
| | | const dictObj = ref({ |
| | | sceneType: [], // 场景类型 |
| | | deviceMode: [], // 设备模式 |
| | | areaType: [], // 区域类型 |
| | | }) |
| | | provide('dictObj', dictObj) |
| | | |
| | | // 获取字典 |
| | | function getDictList() { |
| | | getDictionaryByCode('CommandSceneType,deviceMode,areaType').then(res => { |
| | | dictObj.value = res.data.data |
| | | }) |
| | | // 格式化有效时间 |
| | | function formatEffectiveDate(row) { |
| | | if (!row?.effectiveDateStart && !row?.effectiveDateEnd) return '' |
| | | return `${row.effectiveDateStart || '-'} ~ ${row.effectiveDateEnd || '-'}` |
| | | } |
| | | |
| | | // 新增/编辑/查看 弹框 |
| | |
| | | |
| | | onMounted(() => { |
| | | getList() |
| | | getDictList() |
| | | }) |
| | | </script> |
| | | <style scoped lang="scss"></style> |