Merge branch 'master' of http://dlindusit.com:53929/r/iailab-plat-ui-vue3
已添加7个文件
已重命名5个文件
已删除1个文件
已复制2个文件
已修改12个文件
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | export interface CameraVO { |
| | | id: undefined, |
| | | nvrId: string, |
| | | type: number, |
| | | code: undefined, |
| | | channel: undefined, |
| | | location: undefined, |
| | | remark: undefined |
| | | } |
| | | |
| | | // 查询列表 |
| | | export const getCameraPage = (params: PageParam) => { |
| | | return request.get({ url: '/data/video/camera/page', params }) |
| | | } |
| | | |
| | | // 获得 |
| | | export const getCamera = (id: number) => { |
| | | return request.get({ url: '/data/video/camera/get?id=' + id }) |
| | | } |
| | | |
| | | // 查询应用列表 |
| | | export const getCameraList = () => { |
| | | return request.get({ url: '/data/video/camera/list' }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const createCamera = (data: CameraVO) => { |
| | | return request.post({ url: '/data/video/camera/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const updateCamera = (data: CameraVO) => { |
| | | return request.put({ url: '/data/video/camera/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const deleteCamera = (id: number) => { |
| | | return request.delete({ url: '/data/video/camera/delete?id=' + id }) |
| | | } |
| | | |
| | | // 导出 |
| | | export const exportCamera = (params: CameraVO) => { |
| | | return request.download({ url: '/data/video/camera/export-excel', params }) |
| | | } |
文件名从 src/api/data/dev/nvr/index.ts 修改 |
| | |
| | | |
| | | // 查询列表 |
| | | export const getNvrPage = (params: PageParam) => { |
| | | return request.get({ url: '/data/dev/nvr/page', params }) |
| | | return request.get({ url: '/data/video/nvr/page', params }) |
| | | } |
| | | |
| | | // 获得 |
| | | export const getNvr = (id: number) => { |
| | | return request.get({ url: '/data/dev/nvr/get?id=' + id }) |
| | | return request.get({ url: '/data/video/nvr/get?id=' + id }) |
| | | } |
| | | |
| | | // 查询应用列表 |
| | | export const getNvrList = () => { |
| | | return request.get({ url: '/data/dev/nvr/list' }) |
| | | return request.get({ url: '/data/video/nvr/list' }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const createNvr = (data: NvrVO) => { |
| | | return request.post({ url: '/data/dev/nvr/create', data }) |
| | | return request.post({ url: '/data/video/nvr/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const updateNvr = (data: NvrVO) => { |
| | | return request.put({ url: '/data/dev/nvr/update', data }) |
| | | return request.put({ url: '/data/video/nvr/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const deleteNvr = (id: number) => { |
| | | return request.delete({ url: '/data/dev/nvr/delete?id=' + id }) |
| | | return request.delete({ url: '/data/video/nvr/delete?id=' + id }) |
| | | } |
| | | |
| | | // 导出 |
| | | export const exportNvr = (params: NvrVO) => { |
| | | return request.download({ url: '/data/dev/nvr/export-excel', params }) |
| | | return request.download({ url: '/data/video/nvr/export-excel', params }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | // 查询列表 |
| | | export const getPage = (params) => { |
| | | return request.get({ url: '/model/chart/page', params}) |
| | | } |
| | | |
| | | // 获得 |
| | | export const get = (id) => { |
| | | return request.get({ url: '/model/chart/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const create = (data) => { |
| | | return request.post({ url: '/model/chart/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const update = (data) => { |
| | | return request.put({ url: '/model/chart/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const del = (id) => { |
| | | return request.delete({ url: '/model/chart/delete?id=' + id }) |
| | | } |
对比新文件 |
| | |
| | | import request from '@/config/axios' |
| | | |
| | | // 查询列表 |
| | | export const getPage = (params) => { |
| | | return request.get({ url: '/model/chart/param/page', params}) |
| | | } |
| | | |
| | | // 获得 |
| | | export const get = (id) => { |
| | | return request.get({ url: '/model/chart/param/get?id=' + id }) |
| | | } |
| | | |
| | | // 新增 |
| | | export const create = (data) => { |
| | | return request.post({ url: '/model/chart/param/create', data }) |
| | | } |
| | | |
| | | // 修改 |
| | | export const update = (data) => { |
| | | return request.put({ url: '/model/chart/param/update', data }) |
| | | } |
| | | |
| | | // 删除 |
| | | export const del = (id) => { |
| | | return request.delete({ url: '/model/chart/param/delete?id=' + id }) |
| | | } |
| | |
| | | |
| | | /** TAG操作 */ |
| | | const tagRef = ref() |
| | | const openTagList = (id?: string, name?:string) => { |
| | | const openTagList = (id?: string,name?: string) => { |
| | | tagRef.value.open(id,name) |
| | | } |
| | | |
| | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px" /> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px" /> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | |
| | | @click="openForm('create')" |
| | | v-hasPermi="['data:channel-http:create']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | <Icon icon="ep:plus" class="mr-5px"/> |
| | | 新增 |
| | | </el-button> |
| | | <el-button |
| | |
| | | plain |
| | | @click="handleImport" |
| | | v-hasPermi="['data:channel-http-tag:import']"> |
| | | <Icon icon="ep:upload" /> 导入 |
| | | <Icon icon="ep:upload"/> |
| | | 导入 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | |
| | | @click="handleExport" |
| | | :loading="exportLoading" |
| | | v-hasPermi="['data:channel-http-tag:export']"> |
| | | <Icon icon="ep:download" />导出 |
| | | <Icon icon="ep:download"/> |
| | | 导出 |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="更新当前值" label-width="100px"> |
| | | <el-switch |
| | | v-model="queryParams.currentValue" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dataValue" |
| | | label="数据值" |
| | | header-align="center" |
| | | align="center" |
| | | :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}" |
| | | /> |
| | | <el-table-column |
| | | prop="quality" |
| | | label="数据质量" |
| | | header-align="center" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad |
| | | </el-tag> |
| | | <el-tag v-else size="small">good</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |
| | |
| | | /> |
| | | </ContentWrap> |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <TagForm ref="formRef" @success="getList" /> |
| | | <TagImportForm ref="importFormRef" @success="getList" /> |
| | | <TagForm ref="formRef" @success="getList"/> |
| | | <TagImportForm ref="importFormRef" @success="getList"/> |
| | | </el-drawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import type { DrawerProps } from 'element-plus' |
| | | import * as HttpTagApi from "@/api/data/channel/http/tag"; |
| | | import TagForm from './TagForm.vue' |
| | | import download from "@/utils/download"; |
| | | import {ref} from "vue"; |
| | | import TagImportForm from '../../../common/tag/TagImportForm.vue' |
| | | import type {DrawerProps} from 'element-plus' |
| | | import * as HttpTagApi from "@/api/data/channel/http/tag"; |
| | | import TagForm from './TagForm.vue' |
| | | import download from "@/utils/download"; |
| | | import {ref} from "vue"; |
| | | import {onBeforeUnmount, onMounted} from "vue"; |
| | | import TagImportForm from '../../../common/tag/TagImportForm.vue' |
| | | |
| | | defineOptions({name: 'HttpTag'}) |
| | | defineOptions({name: 'HttpTag'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const drawer = ref(false) |
| | | const direction = ref<DrawerProps['direction']>('rtl') |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 列表的数据 |
| | | const queryParams = reactive({ |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | apiId: undefined, |
| | | tagName: undefined, |
| | | httpName: undefined |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | | const drawer = ref(false) |
| | | const direction = ref<DrawerProps['direction']>('rtl') |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 列表的数据 |
| | | const queryParams = reactive({ |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | apiId: undefined, |
| | | tagName: undefined, |
| | | httpName: undefined, |
| | | currentValue:false, |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const page = await HttpTagApi.getHttpTagPage(queryParams) |
| | | list.value = page.list |
| | | total.value = page.total |
| | | } finally { |
| | | loading.value = false |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const page = await HttpTagApi.getHttpTagPage(queryParams) |
| | | list.value = page.list |
| | | total.value = page.total |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | queryParams.pageNo = 1 |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: number) => { |
| | | formRef.value.open(type, id, queryParams.apiId) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: number) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await HttpTagApi.deleteHttpTag(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (apiId?: string, name?:string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.apiId = apiId |
| | | queryParams.httpName = name |
| | | if (apiId) { |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | queryParams.pageNo = 1 |
| | | getList() |
| | | } |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.pageNo = 1 |
| | | queryParams.pageSize = 10 |
| | | queryParams.apiId = '' |
| | | queryParams.tagName = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |
| | | drawer.value = false |
| | | } |
| | | |
| | | /** tag导入 */ |
| | | const importFormRef = ref() |
| | | const handleImport = () => { |
| | | if(queryParams.apiId){ |
| | | importFormRef.value.open(queryParams.httpName, '/data/channel/http/tag/import',HttpTagApi.importHttpTagTemplate(), 'Http', queryParams.apiId) |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | } |
| | | |
| | | /** 导出按钮操作 */ |
| | | const handleExport = async () => { |
| | | try { |
| | | // 导出的二次确认 |
| | | await message.exportConfirm() |
| | | // 发起导出 |
| | | exportLoading.value = true |
| | | const data = await HttpTagApi.exportHttpTag(queryParams) |
| | | download.excel(data, 'Http_' + queryParams.httpName + '_Tag列表.xlsx') |
| | | } catch { |
| | | } finally { |
| | | exportLoading.value = false |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: number) => { |
| | | formRef.value.open(type, id, queryParams.apiId) |
| | | } |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: number) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await HttpTagApi.deleteHttpTag(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (apiId?: string, name?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.apiId = apiId |
| | | queryParams.httpName = name |
| | | if (apiId) { |
| | | getList() |
| | | } |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.pageNo = 1 |
| | | queryParams.pageSize = 10 |
| | | queryParams.apiId = '' |
| | | queryParams.tagName = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |
| | | drawer.value = false |
| | | } |
| | | |
| | | /** tag导入 */ |
| | | const importFormRef = ref() |
| | | const handleImport = () => { |
| | | if (queryParams.apiId) { |
| | | importFormRef.value.open(queryParams.httpName, '/data/channel/http/tag/import', HttpTagApi.importHttpTagTemplate(), 'Http', queryParams.apiId) |
| | | } |
| | | } |
| | | |
| | | /** 导出按钮操作 */ |
| | | const handleExport = async () => { |
| | | try { |
| | | // 导出的二次确认 |
| | | await message.exportConfirm() |
| | | // 发起导出 |
| | | exportLoading.value = true |
| | | const data = await HttpTagApi.exportHttpTag(queryParams) |
| | | download.excel(data, 'Http_' + queryParams.httpName + '_Tag列表.xlsx') |
| | | } catch { |
| | | } finally { |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | /** TAG操作 */ |
| | | const tagRef = ref() |
| | | const openTagList = (name?: string) => { |
| | | tagRef.value.open(name) |
| | | const openTagList = (id?: string,name?: string) => { |
| | | tagRef.value.open(id,name) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | |
| | | <Icon icon="ep:download" />导出 |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="更新当前值" label-width="100px"> |
| | | <el-switch |
| | | v-model="queryParams.currentValue" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | <!-- 列表 --> |
| | |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.enabled === 1" size="small">是</el-tag> |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dataValue" |
| | | label="数据值" |
| | | header-align="center" |
| | | align="center" |
| | | :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}" |
| | | /> |
| | | <el-table-column |
| | | prop="quality" |
| | | label="数据质量" |
| | | header-align="center" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad</el-tag> |
| | | <el-tag v-else size="small">good</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | |
| | | import * as KioTagApi from "@/api/data/channel/kio/tag"; |
| | | import TagForm from './TagForm.vue' |
| | | import download from "@/utils/download"; |
| | | import {ref} from "vue"; |
| | | import TagImportForm from '../../common/tag/TagImportForm.vue' |
| | | import {ref, onBeforeUnmount, onMounted} from "vue"; |
| | | import * as HttpTagApi from "@/api/data/channel/http/tag"; |
| | | |
| | | defineOptions({name: 'KioTag'}) |
| | | |
| | |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | device: undefined, |
| | | deviceId: undefined, |
| | | currentValue:false, |
| | | tagName: undefined |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (device?: string) => { |
| | | const open = async (deviceId?: string,device?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.device = device |
| | | queryParams.deviceId = deviceId |
| | | if (device) { |
| | | getList() |
| | | } |
| | |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | |
| | | let intervalId; |
| | | |
| | | onMounted(async () => { |
| | | // 创建定时器 |
| | | intervalId = setInterval(async () => { |
| | | if(queryParams.currentValue){ |
| | | const page = await KioTagApi.getKioTagPage(queryParams) |
| | | list.value = page.list |
| | | total.value = page.total |
| | | } |
| | | }, 10000); |
| | | }); |
| | | |
| | | // 在组件卸载时清除定时器 |
| | | onBeforeUnmount(() => { |
| | | if (intervalId) { |
| | | clearInterval(intervalId); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openTagList(scope.row.name)" |
| | | @click="openTagList(scope.row.id,scope.row.name)" |
| | | v-hasPermi="['data:channel-modbus:update']" |
| | | > |
| | | TAG |
| | |
| | | |
| | | /** TAG操作 */ |
| | | const tagRef = ref() |
| | | const openTagList = (name?: string) => { |
| | | tagRef.value.open(name) |
| | | const openTagList = (id?: string,name?: string) => { |
| | | tagRef.value.open(id,name) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px" /> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px" /> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['data:channel-modbus:create']"> |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | <Icon icon="ep:plus" class="mr-5px"/> |
| | | 新增 |
| | | </el-button> |
| | | <el-button |
| | |
| | | plain |
| | | @click="handleImport" |
| | | v-hasPermi="['data:channel-modbus-tag:import']"> |
| | | <Icon icon="ep:upload" /> 导入 |
| | | <Icon icon="ep:upload"/> |
| | | 导入 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | |
| | | @click="handleExport" |
| | | :loading="exportLoading" |
| | | v-hasPermi="['data:channel-modbus-tag:export']"> |
| | | <Icon icon="ep:download" />导出 |
| | | <Icon icon="ep:download"/> |
| | | 导出 |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="更新当前值" label-width="100px"> |
| | | <el-switch |
| | | v-model="queryParams.currentValue" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dataValue" |
| | | label="数据值" |
| | | header-align="center" |
| | | align="center" |
| | | :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}" |
| | | /> |
| | | <el-table-column |
| | | prop="quality" |
| | | label="数据质量" |
| | | header-align="center" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad</el-tag> |
| | | <el-tag v-else size="small">good</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |
| | |
| | | /> |
| | | </ContentWrap> |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <TagForm ref="formRef" @success="getList" /> |
| | | <TagImportForm ref="importFormRef" @success="getList" /> |
| | | <TagForm ref="formRef" @success="getList"/> |
| | | <TagImportForm ref="importFormRef" @success="getList"/> |
| | | </el-drawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import type { DrawerProps } from 'element-plus' |
| | | import type {DrawerProps} from 'element-plus' |
| | | import * as ModBusTagApi from "@/api/data/channel/modbus/tag"; |
| | | import TagForm from './TagForm.vue' |
| | | import download from "@/utils/download"; |
| | | import {ref} from "vue"; |
| | | import TagImportForm from '../../common/tag/TagImportForm.vue' |
| | | import {onBeforeUnmount, onMounted} from "vue"; |
| | | import * as HttpTagApi from "@/api/data/channel/http/tag"; |
| | | |
| | | defineOptions({name: 'ModBusTag'}) |
| | | |
| | |
| | | const queryParams = reactive({ |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | deviceId: undefined, |
| | | device: undefined, |
| | | tagName: undefined, |
| | | currentValue:false, |
| | | address: undefined |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (device?: string) => { |
| | | const open = async (deviceId?: string,device?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.device = device |
| | | queryParams.deviceId = deviceId |
| | | if (device) { |
| | | getList() |
| | | } |
| | |
| | | /** tag导入 */ |
| | | const importFormRef = ref() |
| | | const handleImport = () => { |
| | | if(queryParams.device){ |
| | | importFormRef.value.open(queryParams.device, '/data/channel/modbus/tag/import',ModBusTagApi.importModBusTagTemplate(), 'ModBus', queryParams.device) |
| | | if (queryParams.device) { |
| | | importFormRef.value.open(queryParams.device, '/data/channel/modbus/tag/import', ModBusTagApi.importModBusTagTemplate(), 'ModBus', queryParams.device) |
| | | } |
| | | } |
| | | |
| | |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | let intervalId; |
| | | |
| | | onMounted(async () => { |
| | | // 创建定时器 |
| | | intervalId = setInterval(async () => { |
| | | if(queryParams.currentValue){ |
| | | const page = await ModBusTagApi.getModBusTagPage(queryParams) |
| | | list.value = page.list |
| | | total.value = page.total |
| | | } |
| | | }, 10000); |
| | | }); |
| | | |
| | | // 在组件卸载时清除定时器 |
| | | onBeforeUnmount(() => { |
| | | if (intervalId) { |
| | | clearInterval(intervalId); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <Icon icon="ep:download" />导出 |
| | | </el-button> |
| | | </el-form-item> |
| | | <el-form-item label="更新当前值" label-width="100px"> |
| | | <el-switch |
| | | v-model="queryParams.currentValue" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | <!-- 列表 --> |
| | |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.enabled === 1" size="small">是</el-tag> |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dataValue" |
| | | label="数据值" |
| | | header-align="center" |
| | | align="center" |
| | | :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}" |
| | | /> |
| | | <el-table-column |
| | | prop="quality" |
| | | label="数据质量" |
| | | header-align="center" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad</el-tag> |
| | | <el-tag v-else size="small">good</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | |
| | | import download from "@/utils/download"; |
| | | import {ref,reactive} from "vue"; |
| | | import TagImportForm from '../../common/tag/TagImportForm.vue' |
| | | import {onBeforeUnmount, onMounted} from "vue"; |
| | | import * as OpcdaTagApi from "@/api/data/channel/opcda/tag"; |
| | | |
| | | defineOptions({name: 'ModBusTag'}) |
| | | |
| | |
| | | serverId: undefined, |
| | | tagName: undefined, |
| | | serverName: undefined |
| | | currentValue:false, |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | loading.value = true |
| | |
| | | exportLoading.value = false |
| | | } |
| | | } |
| | | let intervalId; |
| | | |
| | | onMounted(async () => { |
| | | // 创建定时器 |
| | | intervalId = setInterval(async () => { |
| | | if(queryParams.currentValue){ |
| | | const page = await OpcdaTagApi.getOpcdaTagPage(queryParams) |
| | | list.value = page.list |
| | | total.value = page.total |
| | | } |
| | | }, 10000); |
| | | }); |
| | | |
| | | // 在组件卸载时清除定时器 |
| | | onBeforeUnmount(() => { |
| | | if (intervalId) { |
| | | clearInterval(intervalId); |
| | | } |
| | | }); |
| | | </script> |
| | |
| | | <el-tag v-else size="small" type="danger">否</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="dataValue" |
| | | label="数据值" |
| | | header-align="center" |
| | | align="center" |
| | | :formatter="(row) => {if (row.dataValue === -2.0) {return '--';}return row.dataValue;}" |
| | | /> |
| | | <el-table-column |
| | | prop="quality" |
| | | label="数据质量" |
| | | header-align="center" |
| | | align="center" |
| | | > |
| | | <template #default="scope"> |
| | | <el-tag v-if="scope.row.dataValue === Number(-2.0)" type="danger" size="small">bad</el-tag> |
| | | <el-tag v-else size="small">good</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | | <template #default="scope"> |
| | | <el-button |
| | |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | device: undefined, |
| | | deviceId: undefined, |
| | | tagName: undefined, |
| | | address: undefined |
| | | }) |
| | |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (device?: string) => { |
| | | const open = async (deviceId?: string,device?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.device = device |
| | | queryParams.deviceId = deviceId |
| | | if (device) { |
| | | getList() |
| | | } |
| | |
| | | :model="dataForm" |
| | | @keydown.enter="getDataList()" |
| | | > |
| | | <el-form-item> |
| | | <el-form-item label="开始时间"> |
| | | <el-date-picker |
| | | size="mini" |
| | | v-model="dataForm.startTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="选择日期时间" |
| | | /> |
| | | :clearable="false" |
| | | placeholder="选择日期时间"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-form-item label="结束时间"> |
| | | <el-date-picker |
| | | size="mini" |
| | | v-model="dataForm.endTime" |
| | | type="datetime" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | placeholder="选择日期时间" |
| | | /> |
| | | :clearable="false" |
| | | placeholder="选择日期时间"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="getDataList()">查询</el-button> |
| | |
| | | import {ref} from 'vue'; |
| | | import * as echarts from 'echarts'; |
| | | import * as DaPoint from '@/api/data/da/point/daPointChart' |
| | | import {getYMDHMS} from "@/utils/dateUtil" |
| | | import download from "@/utils/download"; |
| | | const message = useMessage() // 消息弹窗 |
| | | const visible = ref(false); |
| | | const chartDom = ref(null); |
| | | let myChart = null; |
| | | const dataForm = ref({ |
| | | id: "", |
| | | pointNo: "", |
| | | pointName: "", |
| | | pointTypeName: "", |
| | | startTime: getYMDHMS(), |
| | | endTime: undefined, |
| | | }); |
| | | const queryParams = reactive({ |
| | | codes: [], |
| | | startDate: undefined, |
| | | endDate: undefined, |
| | | }) |
| | | function getYMDHMS() { |
| | | let timestamp = new Date().getTime(); |
| | | let time = new Date(timestamp - 1000 * 60 * 30); |
| | | let year = time.getFullYear(); |
| | | let month = (time.getMonth() + 1).toString(); |
| | | let date = time.getDate().toString(); |
| | | let hours = time.getHours().toString(); |
| | | let minute = time.getMinutes().toString(); |
| | | const chartParams = reactive({ |
| | | pointNos:[], |
| | | start : undefined, |
| | | end : undefined, |
| | | }) |
| | | const dataForm = ref({ |
| | | id: "", |
| | | pointNo: "", |
| | | pointName: "", |
| | | pointTypeName: "", |
| | | startTime: getYMDHMS(new Date() - 1000 * 60 * 60), |
| | | endTime: getYMDHMS(new Date()), |
| | | }); |
| | | |
| | | if (month < 10) { |
| | | month = "0" + month; |
| | | } |
| | | if (date < 10) { |
| | | date = "0" + date; |
| | | } |
| | | if (hours < 10) { |
| | | hours = "0" + hours; |
| | | } |
| | | if (minute < 10) { |
| | | minute = "0" + minute; |
| | | } |
| | | return ( |
| | | year + |
| | | "-" + |
| | | month + |
| | | "-" + |
| | | date + |
| | | " " + |
| | | hours + |
| | | ":" + |
| | | minute + |
| | | ":" + |
| | | "00" |
| | | ); |
| | | } |
| | | /** 打开弹窗 */ |
| | | const open = async (row: object) => { |
| | | visible.value = true |
| | | dataForm.value.id = row.id; |
| | | dataForm.value.pointNo = row.pointNo; |
| | | dataForm.value.pointName = row.pointName; |
| | | dataForm.value.startTime = getYMDHMS(); |
| | | dataForm.value.endTime = ""; |
| | | dataForm.value.startTime = getYMDHMS(new Date(this.dataForm.startTime) - 1000 * 60 * 60); |
| | | dataForm.value.endTime = getYMDHMS(new Date(this.dataForm.endTime) - 1000 * 60 * 60), |
| | | getDataList(); |
| | | } |
| | | |
| | |
| | | if (dataForm.value.id) { |
| | | try { |
| | | queryParams.codes=[dataForm.value.pointNo]; |
| | | queryParams.startDate = dataForm.value.startTime; |
| | | queryParams.endDate = dataForm.value.endTime; |
| | | queryParams.startDate = getYMDHMS(new Date(this.dataForm.startTime) - 1000 * 60 * 60); |
| | | queryParams.endDate = getYMDHMS(new Date(this.dataForm.endTime) - 1000 * 60 * 60); |
| | | const data = await DaPoint.getPointDaChart(queryParams) |
| | | let seriesData = [] |
| | | data.series.forEach(item => { |
| | |
| | | /** 导出按钮操作 */ |
| | | const exportLoading = ref(false) |
| | | const handleExport = async () => { |
| | | queryParams.pointNos=[dataForm.value.pointNo]; |
| | | queryParams.start = dataForm.value.startTime; |
| | | queryParams.end = dataForm.value.endTime; |
| | | chartParams.pointNos=[dataForm.value.pointNo]; |
| | | chartParams.start = dataForm.value.startTime; |
| | | chartParams.end = dataForm.value.endTime; |
| | | try { |
| | | // 导出的二次确认 |
| | | await message.exportConfirm() |
copy from src/views/data/dev/camera/CameraForm.vue
copy to src/views/data/video/camera/CameraForm.vue
文件从 src/views/data/dev/camera/CameraForm.vue 复制 |
| | |
| | | > |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="品牌"> |
| | | <el-select v-model="formData.brand" prop="brand" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.CAMERA_BRAND)" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="编码" prop="code"> |
| | | <el-input v-model="formData.code" placeholder="请输入编码" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="设备类型" prop="device"> |
| | | <el-input v-model="formData.device" placeholder="请输入设备类型" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="抓图方式"> |
| | | <el-select v-model="formData.captureType" placeholder="请选择"> |
| | | <el-select v-model="formData.captureType" prop="captureType" placeholder="请选择"> |
| | | <el-option |
| | | v-for="dict in getStrDictOptions(DICT_TYPE.CAPTURE_TYPE)" |
| | | :key="dict.value" |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="IP" prop="ip"> |
| | | <el-input v-model="formData.ip" placeholder="请输入IP" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="端口" prop="port"> |
| | | <el-input v-model="formData.port" placeholder="请输入端口" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="用户名" prop="username"> |
| | | <el-input v-model="formData.username" placeholder="请输入用户名" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="密码" prop="password"> |
| | | <el-input show-password v-model="formData.password" placeholder="请输入密码" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="通道" prop="channel"> |
| | | <el-input v-model="formData.channel" placeholder="请输入通道" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="监控区域" prop="location"> |
| | | <el-input v-model="formData.location" placeholder="请输入监控区域" /> |
| | | <el-form-item label="具体位置" prop="location"> |
| | | <el-input v-model="formData.location" placeholder="请输入具体位置" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as CameraApi from '@/api/data/dev/camera' |
| | | import * as CameraApi from '@/api/data/video/camera' |
| | | import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from "@/utils/dict"; |
| | | |
| | | defineOptions({ name: 'CameraForm' }) |
| | |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | nvrId: '', |
| | | brand: undefined, |
| | | type: 1, |
| | | code: undefined, |
| | | captureType: '', |
| | | ip: undefined, |
| | | port: undefined, |
| | | username: undefined, |
| | | password: undefined, |
| | | device: undefined, |
| | | channel: undefined, |
| | | location: undefined, |
| | | remark: undefined |
| | | }) |
| | | const formRules = reactive({ |
| | | code: [{ required: true, message: '编码不能为空', trigger: 'blur' }], |
| | | brand: [{ required: true, message: '品牌不能为空', trigger: 'blur' }], |
| | | code: [{ required: true, message: '设备类型不能为空', trigger: 'blur' }], |
| | | captureType: [{ required: true, message: '抓图方式不能为空', trigger: 'blur' }], |
| | | channel: [{ required: true, message: '通道不能为空', trigger: 'blur' }], |
| | | name: [{ required: true, message: '名称不能为空', trigger: 'blur' }], |
| | | ip: [{ required: true, message: 'IP不能为空', trigger: 'blur' }], |
| | | port: [{ required: true, message: '端口不能为空', trigger: 'blur' }], |
| | | location: [{ required: true, message: '监控区域不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | |
| | | const data = formData.value as unknown as CameraApi.CameraVO |
| | | if (formType.value === 'create') { |
| | | data.nvrId = nvrId.value |
| | | data.type = 1 |
| | | await CameraApi.createCamera(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
copy from src/views/data/dev/nvr/index.vue
copy to src/views/data/video/camera/index.vue
文件从 src/views/data/dev/nvr/index.vue 复制 |
| | |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | label-width="40px" |
| | | > |
| | | <el-form-item label="品牌" prop="status"> |
| | | <el-select |
| | | v-model="queryParams.brand" |
| | | placeholder="品牌" |
| | | clearable |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | > |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.CAMERA_BRAND)" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="编号" prop="code"> |
| | | <el-form-item label="设备类型" prop="device" label-width="68px"> |
| | | <el-input |
| | | v-model="queryParams.code" |
| | | placeholder="请输入编号" |
| | | v-model="queryParams.device" |
| | | placeholder="请输入设备类型" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="IP" prop="name"> |
| | | <el-form-item label="编码" prop="code"> |
| | | <el-input |
| | | v-model="queryParams.code" |
| | | placeholder="请输入编码" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="IP" prop="ip"> |
| | | <el-input |
| | | v-model="queryParams.ip" |
| | | placeholder="请输入IP" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-form-item label="位置" prop="location"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请输入名称" |
| | | v-model="queryParams.location" |
| | | placeholder="请输入位置" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['dev:nvr:save']" |
| | | v-hasPermi="['video:camera:save']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | |
| | | plain |
| | | @click="handleExport" |
| | | :loading="exportLoading" |
| | | v-hasPermi="['dev:nvr:export']" |
| | | v-hasPermi="['video:camera:export']" |
| | | > |
| | | <Icon icon="ep:download" class="mr-5px" /> |
| | | 导出 |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="设备类型" align="center" prop="device" width="200"/> |
| | | <el-table-column label="位置" align="center" prop="position" /> |
| | | <el-table-column label="编码" align="center" prop="code" width="100"/> |
| | | <el-table-column label="名称" align="center" prop="name"/> |
| | | <el-table-column label="编码" align="center" prop="code" width="200"/> |
| | | <el-table-column label="IP" align="center" prop="ip" /> |
| | | <el-table-column label="端口" align="center" prop="port" width="100"/> |
| | | <el-table-column label="用户名" align="center" prop="username" width="100"/> |
| | |
| | | <dict-tag :type="DICT_TYPE.NVR_ONLINE_STATUS" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="位置" align="center" prop="position" /> |
| | | <el-table-column label="位置" align="center" prop="location" /> |
| | | <el-table-column label="备注" align="center" prop="remark" width="150"/> |
| | | <el-table-column label="操作" align="center" min-width="110" fixed="right"> |
| | | <template #default="scope"> |
| | |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | v-hasPermi="['dev:nvr:update']" |
| | | v-hasPermi="['video:camera:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | |
| | | link |
| | | type="danger" |
| | | @click="handleDelete(scope.row.id)" |
| | | v-hasPermi="['dev:nvr:delete']" |
| | | v-hasPermi="['video:camera:delete']" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | <el-button v-if="scope.row.brand == 1" type="text" size="small" @click="cameraHandle(scope.row.id)">摄像头</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <NvrForm ref="formRef" @success="getList" /> |
| | | <CameraForm ref="formRef" @success="getList" /> |
| | | |
| | | <!-- 弹窗, 摄像头 --> |
| | | <Camera ref="devCameraRef"/> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {DICT_TYPE, getIntDictOptions} from '@/utils/dict' |
| | | import download from '@/utils/download' |
| | | import * as NvrApi from '@/api/data/dev/nvr' |
| | | import NvrForm from './NvrForm.vue' |
| | | import Camera from '../camera/camera.vue' |
| | | import * as CameraApi from '@/api/data/video/camera' |
| | | import CameraForm from './CameraForm.vue' |
| | | |
| | | defineOptions({name: 'Nvr'}) |
| | | defineOptions({name: 'Camera'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | |
| | | const queryParams = reactive({ |
| | | pageNo: 1, |
| | | pageSize: 10, |
| | | type: 1, |
| | | brand: undefined, |
| | | ip: undefined, |
| | | code: undefined, |
| | | name: undefined, |
| | | device: undefined, |
| | | location: undefined, |
| | | status: undefined |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | | |
| | | const devCameraRef = ref() |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await NvrApi.getNvrPage(queryParams) |
| | | const data = await CameraApi.getCameraPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | const cameraHandle = (id: string) => { |
| | | // devCameraVisible.value = true |
| | | devCameraRef.value.open(id) |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await NvrApi.deleteNvr(id) |
| | | await CameraApi.deleteCamera(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | |
| | | await message.exportConfirm() |
| | | // 发起导出 |
| | | exportLoading.value = true |
| | | const data = await NvrApi.exportNvr(queryParams) |
| | | const data = await CameraApi.exportCamera(queryParams) |
| | | download.excel(data, '录像机列表.xls') |
| | | } catch { |
| | | } finally { |
文件名从 src/views/data/dev/camera/camera.vue 修改 |
| | |
| | | </el-drawer> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <CameraForm ref="formRef" @success="getList" /> |
| | | <NvrCameraForm ref="formRef" @success="getList" /> |
| | | |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import download from '@/utils/download' |
| | | import * as CameraApi from '@/api/data/dev/camera' |
| | | import CameraForm from './CameraForm.vue' |
| | | import * as CameraApi from '@/api/data/video/camera' |
| | | import NvrCameraForm from './NvrCameraForm.vue' |
| | | import {DICT_TYPE} from "@/utils/dict"; |
| | | |
| | | defineOptions({name: 'Camera'}) |
| | | defineOptions({name: 'NvrCamera'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
文件名从 src/views/data/dev/camera/CameraForm.vue 修改 |
| | |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as CameraApi from '@/api/data/dev/camera' |
| | | import {DICT_TYPE, getIntDictOptions, getStrDictOptions} from "@/utils/dict"; |
| | | import * as CameraApi from '@/api/data/video/camera' |
| | | import {DICT_TYPE, getStrDictOptions} from "@/utils/dict"; |
| | | |
| | | defineOptions({ name: 'CameraForm' }) |
| | | defineOptions({ name: 'NvrCameraForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | |
| | | const formData = ref({ |
| | | id: undefined, |
| | | nvrId: '', |
| | | type: 2, |
| | | code: undefined, |
| | | captureType: '', |
| | | channel: undefined, |
| | |
| | | const data = formData.value as unknown as CameraApi.CameraVO |
| | | if (formType.value === 'create') { |
| | | data.nvrId = nvrId.value |
| | | data.type = 2 |
| | | await CameraApi.createCamera(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
文件名从 src/views/data/dev/nvr/NvrForm.vue 修改 |
| | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' |
| | | import * as NvrApi from '@/api/data/dev/nvr' |
| | | import * as NvrApi from '@/api/data/video/nvr' |
| | | |
| | | defineOptions({ name: 'NvrForm' }) |
| | | |
文件名从 src/views/data/dev/nvr/index.vue 修改 |
| | |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | label-width="40px" |
| | | > |
| | | <el-form-item label="品牌" prop="status"> |
| | | <el-select |
| | | v-model="queryParams.brand" |
| | | placeholder="品牌" |
| | | clearable |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | > |
| | | <el-option |
| | | v-for="dict in getIntDictOptions(DICT_TYPE.CAMERA_BRAND)" |
| | |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="编号" prop="code"> |
| | | <el-form-item label="编码" prop="code"> |
| | | <el-input |
| | | v-model="queryParams.code" |
| | | placeholder="请输入编号" |
| | | placeholder="请输入编码" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="IP" prop="name"> |
| | | <el-form-item label="IP" prop="ip"> |
| | | <el-input |
| | | v-model="queryParams.ip" |
| | | placeholder="请输入IP" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="名称" prop="name"> |
| | |
| | | placeholder="请输入名称" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | class="!w-120px" |
| | | class="!w-140px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['dev:nvr:save']" |
| | | v-hasPermi="['video:nvr:save']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | |
| | | plain |
| | | @click="handleExport" |
| | | :loading="exportLoading" |
| | | v-hasPermi="['dev:nvr:export']" |
| | | v-hasPermi="['video:nvr:export']" |
| | | > |
| | | <Icon icon="ep:download" class="mr-5px" /> |
| | | 导出 |
| | |
| | | <dict-tag :type="DICT_TYPE.CAMERA_BRAND" :value="scope.row.brand" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="设备类型" align="center" prop="device" width="200"/> |
| | | <el-table-column label="位置" align="center" prop="position" /> |
| | | <el-table-column label="编码" align="center" prop="code" width="100"/> |
| | | <el-table-column label="名称" align="center" prop="name"/> |
| | | <el-table-column label="IP" align="center" prop="ip" /> |
| | |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | v-hasPermi="['dev:nvr:update']" |
| | | v-hasPermi="['video:nvr:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | |
| | | link |
| | | type="danger" |
| | | @click="handleDelete(scope.row.id)" |
| | | v-hasPermi="['dev:nvr:delete']" |
| | | v-hasPermi="['video:nvr:delete']" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | <el-button v-if="scope.row.brand == 1" type="text" size="small" @click="cameraHandle(scope.row.id)">摄像头</el-button> |
| | | <el-button link type="success" size="small" @click="cameraHandle(scope.row.id)">摄像头</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <NvrForm ref="formRef" @success="getList" /> |
| | | |
| | | <!-- 弹窗, 摄像头 --> |
| | | <Camera ref="devCameraRef"/> |
| | | <NvrCamera ref="videoCameraRef"/> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {DICT_TYPE, getIntDictOptions} from '@/utils/dict' |
| | | import download from '@/utils/download' |
| | | import * as NvrApi from '@/api/data/dev/nvr' |
| | | import * as NvrApi from '@/api/data/video/nvr' |
| | | import NvrForm from './NvrForm.vue' |
| | | import Camera from '../camera/camera.vue' |
| | | import NvrCamera from './NvrCamera.vue' |
| | | |
| | | defineOptions({name: 'Nvr'}) |
| | | |
| | |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | const exportLoading = ref(false) // 导出的加载中 |
| | | |
| | | const devCameraRef = ref() |
| | | const videoCameraRef = ref() |
| | | |
| | | /** 查询列表 */ |
| | | const getList = async () => { |
| | |
| | | |
| | | const cameraHandle = (id: string) => { |
| | | // devCameraVisible.value = true |
| | | devCameraRef.value.open(id) |
| | | videoCameraRef.value.open(id) |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="图表名称" prop="chartName"> |
| | | <el-input v-model="formData.chartName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="图表编码" prop="chartCode"> |
| | | <el-input v-model="formData.chartCode" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </template> |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as ChartApi from '@/api/model/mpk/chart' |
| | | |
| | | defineOptions({ name: 'ChartForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | chartName: undefined, |
| | | chartCode: undefined, |
| | | }) |
| | | const formRules = reactive({ |
| | | chartName: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | chartCode: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: string) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await ChartApi.get(id) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | const data = formData.value |
| | | if (formType.value === 'create') { |
| | | await ChartApi.create(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await ChartApi.update(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | chartName: undefined, |
| | | chartCode: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: undefined, |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form |
| | | class="-mb-15px" |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="图表名称" prop="chartName"> |
| | | <el-input |
| | | v-model="queryParams.chartName" |
| | | placeholder="请输入图表名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="图表编码" prop="chartCode"> |
| | | <el-input |
| | | v-model="queryParams.chartCode" |
| | | placeholder="请输入图表编码" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | v-hasPermi="['model:chart:create']" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="list" |
| | | row-key="id" |
| | | > |
| | | <el-table-column prop="chartName" label="图表名称"/> |
| | | <el-table-column prop="chartCode" label="图表编码"/> |
| | | <el-table-column prop="createTime" :formatter="dateFormatter" label="创建时间"/> |
| | | <el-table-column label="操作" align="center" width="200px"> |
| | | <template #default="scope"> |
| | | <div class="flex items-center justify-center"> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | v-hasPermi="['model:chart:update']" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openChartParam(scope.row.id)" |
| | | v-hasPermi="['model:chart:update']" |
| | | > |
| | | 参数 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)" v-hasPermi="['model:chart:delete']"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.limit" |
| | | v-model:page="queryParams.page" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <ChartForm ref="formRef" @success="getList" /> |
| | | |
| | | <!-- 分组列表 --> |
| | | <ChartParam ref="ChartParamRef" /> |
| | | |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as ChartApi from '@/api/model/mpk/chart' |
| | | import ChartForm from './ChartForm.vue' |
| | | import ChartParam from './param/index.vue' |
| | | |
| | | |
| | | defineOptions({name: 'Chart'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | limit: 10, |
| | | chartName: '', |
| | | chartCode: '' |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await ChartApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await ChartApi.del(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** List操作 */ |
| | | const ChartParamRef = ref() |
| | | const openChartParam = (id?: string) => { |
| | | ChartParamRef.value.open(id) |
| | | } |
| | | |
| | | /** 初始化 **/ |
| | | onMounted(async () => { |
| | | await getList() |
| | | }) |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <Dialog v-model="dialogVisible" :title="dialogTitle"> |
| | | <el-form |
| | | ref="formRef" |
| | | v-loading="formLoading" |
| | | :model="formData" |
| | | :rules="formRules" |
| | | label-width="80px" |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-input v-model="formData.paramName" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="参数编码" prop="paramCode"> |
| | | <el-input v-model="formData.paramCode" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="参数值" prop="paramValue"> |
| | | <el-input v-model="formData.paramValue" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="formData.remark" type="textarea" :rows="2" placeholder=""/> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | </template> |
| | | </Dialog> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import * as ChartParamApi from '@/api/model/mpk/chartParam' |
| | | import {deleteIcon} from "@/api/model/mpk/icon"; |
| | | |
| | | defineOptions({ name: 'ChartParamForm' }) |
| | | |
| | | const { t } = useI18n() // 国际化 |
| | | const message = useMessage() // 消息弹窗 |
| | | |
| | | const dialogVisible = ref(false) // 弹窗的是否展示 |
| | | const dialogTitle = ref('') // 弹窗的标题 |
| | | const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
| | | const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
| | | const formData = ref({ |
| | | id: undefined, |
| | | chartId: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: undefined, |
| | | }) |
| | | const formRules = reactive({ |
| | | paramName: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | paramCode: [{ required: true, message: '不能为空', trigger: 'blur' }], |
| | | paramValue: [{ required: true, message: '不能为空', trigger: 'blur' }] |
| | | }) |
| | | const formRef = ref() // 表单 Ref |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (type: string, id?: string, chartId?: string) => { |
| | | dialogVisible.value = true |
| | | dialogTitle.value = t('action.' + type) |
| | | formType.value = type |
| | | resetForm() |
| | | if (chartId) { |
| | | formData.value.chartId = chartId |
| | | } |
| | | // 修改时,设置数据 |
| | | if (id) { |
| | | formLoading.value = true |
| | | try { |
| | | formData.value = await ChartParamApi.get(id) |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 提交表单 */ |
| | | const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
| | | const submitForm = async () => { |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | | if (!valid) return |
| | | // 提交请求 |
| | | formLoading.value = true |
| | | try { |
| | | const data = formData.value |
| | | if (formType.value === 'create') { |
| | | await ChartParamApi.create(data) |
| | | message.success(t('common.createSuccess')) |
| | | } else { |
| | | await ChartParamApi.update(data) |
| | | message.success(t('common.updateSuccess')) |
| | | } |
| | | dialogVisible.value = false |
| | | // 发送操作成功的事件 |
| | | emit('success') |
| | | } finally { |
| | | formLoading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | formData.value = { |
| | | id: undefined, |
| | | chartCode: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | paramValue: undefined, |
| | | remark: undefined, |
| | | } |
| | | formRef.value?.resetFields() |
| | | } |
| | | </script> |
对比新文件 |
| | |
| | | <template> |
| | | <el-drawer |
| | | v-model="drawer" |
| | | size="40%" |
| | | title="参数列表" |
| | | direction="rtl" |
| | | :before-close="handleClose" |
| | | > |
| | | <!-- 搜索工作栏 --> |
| | | <ContentWrap> |
| | | <el-form |
| | | class="-mb-15px" |
| | | :model="queryParams" |
| | | ref="queryFormRef" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="参数名称" prop="paramName"> |
| | | <el-input |
| | | v-model="queryParams.paramName" |
| | | placeholder="请输入参数名称" |
| | | clearable |
| | | class="!w-240px" |
| | | /> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="参数编码" prop="paramCode">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="queryParams.paramCode"--> |
| | | <!-- placeholder="请输入"--> |
| | | <!-- clearable--> |
| | | <!-- class="!w-240px"--> |
| | | <!-- />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item> |
| | | <el-button @click="handleQuery"> |
| | | <Icon icon="ep:search" class="mr-5px"/> |
| | | 搜索 |
| | | </el-button> |
| | | <el-button @click="resetQuery"> |
| | | <Icon icon="ep:refresh" class="mr-5px"/> |
| | | 重置 |
| | | </el-button> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | @click="openForm('create')" |
| | | > |
| | | <Icon icon="ep:plus" class="mr-5px" /> |
| | | 新增 |
| | | </el-button> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </ContentWrap> |
| | | |
| | | <!-- 列表 --> |
| | | <ContentWrap> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="list" |
| | | row-key="id" |
| | | > |
| | | <el-table-column prop="paramName" label="参数名称"/> |
| | | <el-table-column prop="paramCode" label="参数编码"/> |
| | | <el-table-column prop="paramValue" label="参数值"/> |
| | | <el-table-column label="操作" align="center" width="150px"> |
| | | <template #default="scope"> |
| | | <div class="flex items-center justify-center"> |
| | | <el-button |
| | | link |
| | | type="primary" |
| | | @click="openForm('update', scope.row.id)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | <el-button link type="danger" @click="handleDelete(scope.row.id)"> |
| | | 删除 |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 分页 --> |
| | | <Pagination |
| | | v-model:limit="queryParams.limit" |
| | | v-model:page="queryParams.page" |
| | | :total="total" |
| | | @pagination="getList" |
| | | /> |
| | | </ContentWrap> |
| | | |
| | | <!-- 表单弹窗:添加/修改 --> |
| | | <ChartParamForm ref="formRef" @success="getList" /> |
| | | </el-drawer> |
| | | </template> |
| | | <script lang="ts" setup> |
| | | import {dateFormatter} from '@/utils/formatTime' |
| | | import * as ChartParamApi from '@/api/model/mpk/chartParam' |
| | | import ChartParamForm from './ChartParamForm.vue' |
| | | |
| | | import type {DrawerProps} from "element-plus"; |
| | | |
| | | defineOptions({name: 'ChartParam'}) |
| | | |
| | | const message = useMessage() // 消息弹窗 |
| | | const {t} = useI18n() // 国际化 |
| | | |
| | | const drawer = ref(false) |
| | | const loading = ref(true) // 列表的加载中 |
| | | const total = ref(0) // 列表的总页数 |
| | | const list = ref([]) // 字典表格数据 |
| | | const queryParams = reactive({ |
| | | page: 1, |
| | | limit: 10, |
| | | chartId: undefined, |
| | | paramName: undefined, |
| | | paramCode: undefined, |
| | | }) |
| | | const queryFormRef = ref() // 搜索的表单 |
| | | |
| | | const getList = async () => { |
| | | loading.value = true |
| | | try { |
| | | const data = await ChartParamApi.getPage(queryParams) |
| | | list.value = data.list |
| | | total.value = data.total |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | | const handleQuery = () => { |
| | | getList() |
| | | } |
| | | |
| | | /** 重置按钮操作 */ |
| | | const resetQuery = () => { |
| | | queryFormRef.value.resetFields() |
| | | handleQuery() |
| | | } |
| | | |
| | | /** 添加/修改操作 */ |
| | | const formRef = ref() |
| | | const openForm = (type: string, id?: string) => { |
| | | formRef.value.open(type, id, queryParams.chartId) |
| | | } |
| | | |
| | | /** 删除按钮操作 */ |
| | | const handleDelete = async (id: string) => { |
| | | try { |
| | | // 删除的二次确认 |
| | | await message.delConfirm() |
| | | // 发起删除 |
| | | await ChartParamApi.del(id) |
| | | message.success(t('common.delSuccess')) |
| | | // 刷新列表 |
| | | await getList() |
| | | } catch { |
| | | } |
| | | } |
| | | |
| | | /** 打开弹窗 */ |
| | | const open = async (chartId?: string) => { |
| | | resetForm() |
| | | drawer.value = true |
| | | queryParams.chartId = chartId |
| | | if (chartId) { |
| | | getList() |
| | | } |
| | | } |
| | | defineExpose({open}) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | | queryParams.chartId = '' |
| | | queryParams.name = '' |
| | | } |
| | | |
| | | const handleClose = (done: () => void) => { |
| | | drawer.value = false |
| | | } |
| | | </script> |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | <div style="width: 100%;display: flex;flex-direction: row;justify-content: end;margin-top: 16px"> |
| | | <el-button @click="generatorCode()" type="primary">生成</el-button> |
| | | <el-button :loading="loading" @click="generatorCode()" type="primary">生成</el-button> |
| | | </div> |
| | | </Dialog> |
| | | </template> |
| | |
| | | } |
| | | defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
| | | |
| | | // 代码生成loading |
| | | const loading = ref(false) |
| | | /** 提交表单 */ |
| | | const generatorCode = async () => { |
| | | const data = await MpkApi.generatorCode(formData.value) |
| | | download.zip(data, formData.value.zipFileName) |
| | | dialogVisible.value = false |
| | | try { |
| | | loading.value = true |
| | | const data = await MpkApi.generatorCode(formData.value) |
| | | download.zip(data, formData.value.zipFileName) |
| | | dialogVisible.value = true |
| | | }finally { |
| | | dialogVisible.value = false |
| | | } |
| | | |
| | | } |
| | | /** 重置表单 */ |
| | | const resetForm = () => { |
| | |
| | | const formRef = ref() |
| | | // 运行 |
| | | const modelRun = async () => { |
| | | modelRunResult.value = '' |
| | | // 校验表单 |
| | | if (!formRef) return |
| | | const valid = await formRef.value.validate() |
| | |
| | | } |
| | | |
| | | modelRunResult.value = await MpkApi.modelRun(data) |
| | | modelRunloading.value = false |
| | | message.success('运行成功') |
| | | } finally { |
| | | modelRunloading.value = false |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item label="关联模型"> |
| | | <el-form-item label="关联项目"> |
| | | <el-select v-model="dataForm.mmPredictModel.mpkprojectid" placeholder="请选择"> |
| | | <el-option |
| | | v-for="item in mpkProjectList" |