| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <template>
- <a-card>
- <a-table
- style="margin-top: 20px;"
- :columns="columns"
- :data-source="state.dataSource"
- :loading="state.loading"
- >
- <template #bodyCell="{column, record}">
- <template v-if="column.key === 'action'">
- <a-space>
- <a @click="goGB28181Records(record.id)">查看录像</a>
- <a @click="openModal(record.id)" >控制</a>
- </a-space>
- </template>
- </template>
- </a-table>
- </a-card>
- <a-modal
- title="控制设备"
- :open="state.controlVisible"
- ok-text="确定"
- cancel-text="取消"
- @cancel="closeModel"
- @ok="controlGB28181Device"
- >
- <a-form :label-col="{span: 4}" :wrapper-col="{span: 14}">
- <a-form-item label="通道" v-bind="controlParamsState.channel">
- <a-input v-model:value="controlParamsState.channel" />
- </a-form-item>
- <a-form-item label="命令" v-bind="controlParamsState.ptzcmd">
- <a-input v-model:value="controlParamsState.ptzcmd" />
- </a-form-item>
- </a-form>
- </a-modal>
- </template>
- <script lang="ts" setup >
- import { RtsController } from '@/controller/rts'
- import { onMounted, reactive } from 'vue'
- const columns = [
- {
- title: 'ID',
- dataIndex: 'ID'
- },
- {
- title: '名称',
- dataIndex: 'Name'
- },
- {
- title: '制造商',
- dataIndex: 'Manufacturer'
- },
- {
- title: '注册时间',
- dataIndex: 'RegisterTime'
- },
- {
- title: '状态',
- dataIndex: 'Status'
- },
- {
- title: '网络地址',
- dataIndex: 'NetAddr'
- },
- {
- title: 'Owner',
- dataIndex: 'Owner'
- },
- {
- title: 'gps时间',
- dataIndex: 'GpsTime'
- },
- {
- title: '经度',
- dataIndex: 'Longitude'
- },
- {
- title: '纬度',
- dataIndex: 'Latitude'
- },
- {
- title: '操作',
- dataIndex: 'action',
- key: 'action'
- }
- ]
- const controlParamsState = reactive({
- id: '',
- channel: '',
- ptzcmd: ''
- })
- const state = reactive<{
- dataSource: RTS.GB2881.Detail[]
- loading: boolean
- controlVisible: boolean
- detail: Partial<RTS.GB2881.Detail>
- }>({
- loading: false,
- controlVisible: false,
- detail: {},
- dataSource: []
- })
- const getGB28181List = async () => {
- const { data } = await RtsController.listGB28181()
- state.dataSource = data
- }
- const goGB28181Records = async (id :string) => {
- router.push({ path: '/gb28181/record', query: { id } })
- }
- const controlGB28181Device = async () => {
- const { data } = await RtsController.controlGB28181(controlParamsState)
- console.log(data)
- }
- onMounted(() => {
- getGB28181List()
- })
- const openModal = (id:string) => {
- state.controlVisible = true
- controlParamsState.id = id
- }
- const closeModel = () => {
- state.controlVisible = false
- }
- </script>
- <style lang="less" scoped >
- </style>
|