This commit is contained in:
parent
365794ab8b
commit
189ca09a15
|
|
@ -29,3 +29,38 @@ export const delVideoDevice = (id) => {
|
|||
export const getVideoDeviceDetail = (id) => {
|
||||
return request.get(`/smart-site/video_equipment/${id}`);
|
||||
};
|
||||
|
||||
// 下载二维码
|
||||
export const qrCodeDownZip = (params) => {
|
||||
return request.get('/smart-site/video_equipment/downZip', { params, responseType: 'blob' });
|
||||
};
|
||||
|
||||
// 获取流媒体平台配置列表
|
||||
export const getPlatformConfigurationList = (params) => {
|
||||
return request.get('/smart-site/platform_configuration/list', { params });
|
||||
};
|
||||
|
||||
// 获取流媒体平台配置详情
|
||||
export const getPlatformConfigurationDetail = (id) => {
|
||||
return request.get(`/smart-site/platform_configuration/${id}`);
|
||||
};
|
||||
|
||||
// 新增流媒体平台配置
|
||||
export const addPlatformConfiguration = (data) => {
|
||||
return request.post('/smart-site/platform_configuration/add', data);
|
||||
};
|
||||
|
||||
// 编辑流媒体平台配置
|
||||
export const editPlatformConfiguration = (data) => {
|
||||
return request.post('/smart-site/platform_configuration/edit', data);
|
||||
};
|
||||
|
||||
// 删除流媒体平台配置
|
||||
export const delPlatformConfiguration = (id) => {
|
||||
return request.post(`/smart-site/platform_configuration/del/${id}`);
|
||||
};
|
||||
|
||||
// 修改流媒体平台配置状态
|
||||
export const changeStatus = (data) => {
|
||||
return request.post('/smart-site/platform_configuration/changeStatus', data);
|
||||
};
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-radio-group v-model="tabType" @input="changeTabType">
|
||||
<el-radio-group v-model="platformType" @input="changeTabType">
|
||||
<el-radio-button label="1">自建平台</el-radio-button>
|
||||
<el-radio-button label="2">统一视频平台</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
|
||||
<!-- 多选 -->
|
||||
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
|
||||
<!-- <el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" /> -->
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="55"
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
||||
/>
|
||||
<el-table-column
|
||||
v-for="(column, index) in tabType == '1' ? tableColumns : tableColumns2"
|
||||
v-for="(column, index) in platformType == '1' ? tableColumns : tableColumns2"
|
||||
show-overflow-tooltip
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
|
|
@ -54,7 +54,7 @@
|
|||
<!-- 插槽 -->
|
||||
<template v-slot="scope" v-if="column.prop == 'status'">
|
||||
<span>
|
||||
<el-switch v-model="scope.row.status" @change="changeSwitch(scope.row)"></el-switch>
|
||||
<el-switch v-model="scope.row.switchStatus" @change="changeSwitch(scope.row)"></el-switch>
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -87,52 +87,60 @@
|
|||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="40%">
|
||||
<el-form ref="dialogForm" :model="dialogForm" label-width="155px" :rules="dialogRules" :disabled="isDetail">
|
||||
<el-form-item label="类型" prop="type">
|
||||
<el-radio-group v-model="dialogForm.type" @change="changeType" :disabled="!isAdd">
|
||||
<el-radio-group v-model="dialogForm.plType" @change="changeType" :disabled="!isAdd">
|
||||
<el-radio-button label="1">自建平台</el-radio-button>
|
||||
<el-radio-button label="2">统一视频平台</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="厂家" prop="ballheadCameraManufacturer" v-if="dialogForm.type == '1'">
|
||||
<el-radio-group v-model="dialogForm.ballheadCameraManufacturer">
|
||||
<el-form-item label="厂家" prop="ballType" v-if="dialogForm.plType == '1'">
|
||||
<el-radio-group v-model="dialogForm.ballType">
|
||||
<el-radio-button label="1">清新</el-radio-button>
|
||||
<el-radio-button label="2">创世</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="IP" prop="ip" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.ip" placeholder="请输入IP" clearable />
|
||||
<el-form-item label="IP" prop="videoIp" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.videoIp" placeholder="请输入IP" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="端口" prop="port" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.port" placeholder="请输入端口" clearable />
|
||||
<el-form-item label="端口" prop="videoPort" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.videoPort" placeholder="请输入端口" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="IP端口" prop="ipPort" v-if="dialogForm.type == '2'">
|
||||
<el-input v-model="dialogForm.ipPort" placeholder="请输入IP端口" clearable />
|
||||
<el-form-item label="IP端口" prop="videoUrl" v-if="dialogForm.plType == '2'">
|
||||
<el-input v-model="dialogForm.videoUrl" placeholder="请输入IP端口" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="dialogForm.type == '1' ? '用户' : '用户(ak)'" prop="userName">
|
||||
<el-input v-model="dialogForm.userName" placeholder="请输入用户" clearable />
|
||||
<el-form-item :label="dialogForm.plType == '1' ? '用户' : '用户(ak)'" prop="videoUser">
|
||||
<el-input v-model="dialogForm.videoUser" placeholder="请输入用户" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="dialogForm.type == '1' ? '口令' : '口令(sk)'" prop="command">
|
||||
<el-input v-model="dialogForm.command" placeholder="请输入口令" clearable />
|
||||
<el-form-item :label="dialogForm.plType == '1' ? '口令' : '口令(sk)'" prop="videoPwd">
|
||||
<el-input v-model="dialogForm.videoPwd" placeholder="请输入口令" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置编码" prop="configCode" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.configCode" placeholder="请输入配置编码" clearable />
|
||||
<el-form-item label="配置编码" prop="configCode" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.configCode" placeholder="请输入配置编码" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="后端请求路径" prop="backendRequestPath" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.backendRequestPath" placeholder="请输入后端请求路径" clearable />
|
||||
<el-form-item label="后端请求路径" prop="videoUrl" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.videoUrl" placeholder="请输入后端请求路径" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="web端请求路径-公网" prop="webRequestPathPublic" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.webRequestPathPublic" placeholder="请输入web端请求路径-公网" clearable />
|
||||
<el-form-item label="web端请求路径-公网" prop="videoPath" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.videoPath" placeholder="请输入web端请求路径-公网" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="视频连接地址-公网" prop="videoConnectAddressPublic" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.videoConnectAddressPublic" placeholder="请输入视频连接地址-公网" clearable />
|
||||
<el-form-item label="视频连接地址-公网" prop="wsUrl" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.wsUrl" placeholder="请输入视频连接地址-公网" clearable maxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="epid" prop="epid" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.epid" placeholder="请输入epid" clearable />
|
||||
<el-form-item label="epid" prop="epid" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.epid" placeholder="请输入epid" clearable maxlength="20" />
|
||||
</el-form-item>
|
||||
<el-form-item label="bifx" prop="bifx" v-if="dialogForm.type == '1'">
|
||||
<el-input v-model="dialogForm.bifx" placeholder="请输入bifx" clearable />
|
||||
<el-form-item label="bfix" prop="bfix" v-if="dialogForm.plType == '1'">
|
||||
<el-input v-model="dialogForm.bfix" placeholder="请输入bifx" clearablemaxlength="64" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dialogForm.remark" placeholder="请输入备注" clearable />
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="dialogForm.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
:autosize="{ minRows: 3 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
|
|
@ -144,10 +152,19 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getPlatformConfigurationList,
|
||||
getPlatformConfigurationDetail,
|
||||
addPlatformConfiguration,
|
||||
editPlatformConfiguration,
|
||||
delPlatformConfiguration,
|
||||
changeStatus,
|
||||
} from '@/api/deviceManagement'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tabType: '1',
|
||||
platformType: '1',
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
|
|
@ -161,73 +178,61 @@ export default {
|
|||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '厂家', prop: 'manufacturer' },
|
||||
{ label: 'IP', prop: 'ip' },
|
||||
{ label: '端口', prop: 'port' },
|
||||
{ label: '用户', prop: 'userName' },
|
||||
{ label: '厂家', prop: 'type' },
|
||||
{ label: 'IP', prop: 'videoIp' },
|
||||
{ label: '端口', prop: 'videoPort' },
|
||||
{ label: '用户', prop: 'videoUser' },
|
||||
{ label: '配置编码', prop: 'configCode' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
{ label: '后端请求路径', prop: 'backendRequestPath' },
|
||||
{ label: 'Web端请求路径-公网', prop: 'webRequestPathPublic' },
|
||||
{ label: '后端请求路径', prop: 'videoUrl' },
|
||||
{ label: 'Web端请求路径-公网', prop: 'videoPath' },
|
||||
{ label: '备注', prop: 'remark' },
|
||||
],
|
||||
tableColumns2: [
|
||||
{ label: 'IP端口(地址URL)', prop: 'ipPort' },
|
||||
{ label: '用户', prop: 'userName' },
|
||||
{ label: '口令(sk)', prop: 'command' },
|
||||
{ label: 'IP端口(地址URL)', prop: 'videoUrl' },
|
||||
{ label: '用户', prop: 'videoUser' },
|
||||
{ label: '口令(sk)', prop: 'videoPwd' },
|
||||
{ label: '状态', prop: 'status' },
|
||||
{ label: '备注', prop: 'remark' },
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [
|
||||
{
|
||||
manufacturer: '海康',
|
||||
ip: '101.138.219.3',
|
||||
ipPort: '101.138.219.3:8080',
|
||||
port: '8000',
|
||||
userName: 'admin',
|
||||
configCode: 'device_1',
|
||||
status: '1',
|
||||
backendRequestPath: '/api/v1/device',
|
||||
webRequestPathPublic: '/api/v1/device',
|
||||
remark: '备注附件打开司法鉴定',
|
||||
command: 'sk_1',
|
||||
},
|
||||
],
|
||||
tableList: [],
|
||||
// 弹框
|
||||
isAdd: true,
|
||||
isDetail: false,
|
||||
dialogTitle: '新增',
|
||||
dialogVisible: false,
|
||||
dialogForm: {
|
||||
type: '1', // 类型
|
||||
ballheadCameraManufacturer: '1', // 球机厂家
|
||||
ip: '', // IP
|
||||
port: '', // 端口
|
||||
userName: '', // 用户
|
||||
command: '', // 口令
|
||||
plType: '1', // 类型
|
||||
ballType: '1', // 球机厂家
|
||||
videoIp: '', // IP
|
||||
videoPort: '', // 端口
|
||||
videoUser: '', // 用户
|
||||
videoPwd: '', // 口令
|
||||
configCode: '', // 配置编码
|
||||
backendRequestPath: '', // 后端请求路径
|
||||
webRequestPathPublic: '', // Web端请求路径-公网
|
||||
videoConnectAddressPublic: '', // 视频连接地址-公网
|
||||
videoUrl: '', // 后端请求路径 / IP端口
|
||||
videoPath: '', // Web端请求路径-公网
|
||||
wsUrl: '', // 视频连接地址-公网
|
||||
epid: '', // epid
|
||||
bifx: '', // bifx
|
||||
bfix: '', // bfix
|
||||
remark: '', // 备注
|
||||
},
|
||||
dialogRules: {
|
||||
type: [{ required: true, message: '请选择类型', trigger: 'change' }],
|
||||
ballheadCameraManufacturer: [{ required: true, message: '请选择厂家', trigger: 'change' }],
|
||||
ip: [{ required: true, message: '请输入IP', trigger: 'blur' }],
|
||||
port: [{ required: true, message: '请输入端口', trigger: 'blur' }],
|
||||
userName: [{ required: true, message: '请输入用户', trigger: 'blur' }],
|
||||
command: [{ required: true, message: '请输入口令', trigger: 'blur' }],
|
||||
plType: [{ required: true, message: '请选择类型', trigger: 'change' }],
|
||||
ballType: [{ required: true, message: '请选择厂家', trigger: 'change' }],
|
||||
videoIp: [{ required: true, message: '请输入IP', trigger: 'blur' }],
|
||||
videoPort: [{ required: true, message: '请输入端口', trigger: 'blur' }],
|
||||
videoUser: [{ required: true, message: '请输入用户', trigger: 'blur' }],
|
||||
videoPwd: [{ required: true, message: '请输入口令', trigger: 'blur' }],
|
||||
configCode: [{ required: true, message: '请输入配置编码', trigger: 'blur' }],
|
||||
backendRequestPath: [{ required: true, message: '请输入后端请求路径', trigger: 'blur' }],
|
||||
webRequestPathPublic: [{ required: true, message: '请输入Web端请求路径-公网', trigger: 'blur' }],
|
||||
videoConnectAddressPublic: [{ required: true, message: '请输入视频连接地址-公网', trigger: 'blur' }],
|
||||
epid: [{ required: true, message: '请输入epid', trigger: 'blur' }],
|
||||
bifx: [{ required: true, message: '请输入bifx', trigger: 'blur' }],
|
||||
ipPort: [{ required: true, message: '请输入IP端口', trigger: 'blur' }],
|
||||
videoUrl: [{ required: true, message: '请输入后端请求路径', trigger: 'blur' }],
|
||||
videoPath: [{ required: true, message: '请输入Web端请求路径-公网', trigger: 'blur' }],
|
||||
wsUrl: [{ required: true, message: '请输入视频连接地址-公网', trigger: 'blur' }],
|
||||
epid: [
|
||||
{ required: true, message: '请输入epid', trigger: 'blur' },
|
||||
{ pattern: /^[0-9]*$/, message: '只能输入正整数', trigger: 'blur' },
|
||||
],
|
||||
bfix: [{ required: true, message: '请输入bfix', trigger: 'blur' }],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
|
@ -247,16 +252,25 @@ export default {
|
|||
this.getList()
|
||||
},
|
||||
changeTabType() {
|
||||
console.log('changeTabType', this.tabType)
|
||||
console.log('changeTabType', this.platformType)
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
async getList() {
|
||||
console.log('列表-查询', this.queryParams)
|
||||
this.tableList = []
|
||||
try {
|
||||
// const params = { ...this.queryParams }
|
||||
// const res = await
|
||||
// this.tableList = res.rows
|
||||
// this.total = res.total
|
||||
const params = { ...this.queryParams, platformType: this.platformType }
|
||||
const res = await getPlatformConfigurationList(params)
|
||||
this.tableList = res.rows
|
||||
if (this.tableList.length > 0) {
|
||||
this.tableList.forEach((item) => {
|
||||
item.switchStatus = item.status == 1
|
||||
})
|
||||
}
|
||||
this.total = res.total
|
||||
} catch (error) {
|
||||
this.tableList = []
|
||||
this.total = 0
|
||||
|
|
@ -266,6 +280,26 @@ export default {
|
|||
selectionChange(val) {
|
||||
console.log('selectionChange', val)
|
||||
},
|
||||
// 获取详情
|
||||
async getDetail(row) {
|
||||
console.log('详情', row)
|
||||
try {
|
||||
const res = await getPlatformConfigurationDetail(row.id)
|
||||
console.log('🚀 ~ 详情 ~ res:', res)
|
||||
this.dialogForm = res.data
|
||||
if (this.dialogForm.type == '1') {
|
||||
this.dialogForm.plType = this.$set(this.dialogForm, 'plType', '1')
|
||||
this.dialogForm.ballType = this.$set(this.dialogForm, 'ballType', this.dialogForm.type)
|
||||
} else if (this.dialogForm.type == '2') {
|
||||
this.dialogForm.plType = this.$set(this.dialogForm, 'plType', '1')
|
||||
this.dialogForm.ballType = this.$set(this.dialogForm, 'ballType', this.dialogForm.type)
|
||||
} else {
|
||||
this.dialogForm.plType = this.$set(this.dialogForm, 'plType', '2')
|
||||
}
|
||||
} catch (error) {
|
||||
this.dialogForm = {}
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
console.log('新增')
|
||||
this.isAdd = true
|
||||
|
|
@ -285,6 +319,7 @@ export default {
|
|||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogForm.resetFields()
|
||||
this.getDetail(row)
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
|
|
@ -296,6 +331,7 @@ export default {
|
|||
this.dialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogForm.resetFields()
|
||||
this.getDetail(row)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
|
|
@ -306,17 +342,30 @@ export default {
|
|||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
// const params = { }
|
||||
// const res = await
|
||||
const res = await delPlatformConfiguration(row.id)
|
||||
console.log('删除成功', res)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!',
|
||||
})
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
// 开关
|
||||
changeSwitch(row) {
|
||||
async changeSwitch(row) {
|
||||
console.log('开关', row)
|
||||
try {
|
||||
const params = { id: row.id, status: row.switchStatus ? 1 : 0 }
|
||||
const res = await changeStatus(params)
|
||||
console.log('开关成功', res)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功',
|
||||
})
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('开关失败', error)
|
||||
}
|
||||
},
|
||||
// 导出数据
|
||||
handleExport() {
|
||||
|
|
@ -331,7 +380,7 @@ export default {
|
|||
},
|
||||
// 切换类型
|
||||
changeType(e) {
|
||||
console.log('changeType', this.dialogForm.type, e)
|
||||
console.log('changeType', this.dialogForm.plType, e)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dialogForm.clearValidate()
|
||||
})
|
||||
|
|
@ -339,13 +388,38 @@ export default {
|
|||
// 弹框确认
|
||||
dialogConfirm() {
|
||||
console.log('dialogConfirm')
|
||||
this.$refs.dialogForm.validate((valid) => {
|
||||
this.$refs.dialogForm.validate(async (valid) => {
|
||||
if (valid) {
|
||||
this.dialogVisible = false
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
})
|
||||
try {
|
||||
let type = ''
|
||||
if (this.dialogForm.plType == '2') {
|
||||
type = '3'
|
||||
} else {
|
||||
if (this.dialogForm.ballType == '1') {
|
||||
type = '1'
|
||||
} else {
|
||||
type = '2'
|
||||
}
|
||||
}
|
||||
const params = { ...this.dialogForm, type }
|
||||
let res = null
|
||||
if (this.isAdd) {
|
||||
// 新增
|
||||
res = await addPlatformConfiguration(params)
|
||||
} else {
|
||||
// 编辑
|
||||
res = await editPlatformConfiguration(params)
|
||||
}
|
||||
console.log('操作成功', res)
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功',
|
||||
})
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
} catch (error) {
|
||||
console.log('操作失败', error)
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
|
||||
<el-button icon="el-icon-download" @click="handleExport">导出</el-button>
|
||||
<el-button icon="el-icon-menu" @click="">下载二维码</el-button>
|
||||
<el-button icon="el-icon-menu" @click="handleQrCode">下载二维码</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
<el-button icon="el-icon-download" @click="">导入数据</el-button>
|
||||
</el-form-item>
|
||||
|
|
@ -64,9 +64,9 @@
|
|||
</template>
|
||||
<template v-slot="scope" v-else-if="column.prop == 'onLine'">
|
||||
<div style="display: flex; align-items: center; justify-content: center">
|
||||
<div class="dot" v-if="scope.row.onLine == 1"></div>
|
||||
<div class="dot" v-if="scope.row.onLine == '在线'"></div>
|
||||
<div class="dot-red" v-else></div>
|
||||
<div>{{ scope.row.onLine == 1 ? '在用' : '闲置' }}</div>
|
||||
<div>{{ scope.row.onLine }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -161,7 +161,15 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark" v-if="showItem">
|
||||
<el-input type="textarea" v-model="dialogForm.remark" placeholder="请输入备注" clearable maxlength="100" />
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="dialogForm.remark"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
:autosize="{ minRows: 3 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
|
|
@ -188,6 +196,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import VueQr from 'vue-qr'
|
||||
import MonitoringAndDebug from '@/views/deviceManagement/videoDeviceMgmt/monitoringAndDebug.vue'
|
||||
import {
|
||||
|
|
@ -197,6 +206,7 @@ import {
|
|||
editVideoDevice,
|
||||
delVideoDevice,
|
||||
getVideoDeviceDetail,
|
||||
qrCodeDownZip,
|
||||
} from '@/api/deviceManagement'
|
||||
|
||||
export default {
|
||||
|
|
@ -214,7 +224,7 @@ export default {
|
|||
onLine: '', // 设备状态
|
||||
},
|
||||
deviceStatusOptions: [
|
||||
{ label: '在用', value: '1' },
|
||||
{ label: '在线', value: '1' },
|
||||
{ label: '闲置', value: '0' },
|
||||
], // 设备状态
|
||||
total: 0, // 总条数
|
||||
|
|
@ -257,10 +267,7 @@ export default {
|
|||
tDevCode: '', // 统一设备协议编码
|
||||
remark: '', // 备注
|
||||
},
|
||||
deviceTypeOpts: [
|
||||
{ label: '设备类型1', value: '1' },
|
||||
{ label: '设备类型2', value: '2' },
|
||||
],
|
||||
deviceTypeOpts: [],
|
||||
dialogRules: {
|
||||
devType: [{ required: true, message: '请选择设备类型', trigger: 'change' }],
|
||||
devName: [{ required: true, message: '请输入设备名称', trigger: 'blur' }],
|
||||
|
|
@ -304,6 +311,7 @@ export default {
|
|||
console.log('列表-查询', this.queryParams)
|
||||
try {
|
||||
this.tableList = []
|
||||
// this.queryParams.onLine = Number(this.queryParams.onLine)
|
||||
const params = { ...this.queryParams }
|
||||
const res = await getList(params)
|
||||
console.log('🚀 ~ 获取列表 ~ res:', res)
|
||||
|
|
@ -327,6 +335,49 @@ export default {
|
|||
this.deviceTypeOpts = []
|
||||
}
|
||||
},
|
||||
// 下载二维码
|
||||
async handleQrCode() {
|
||||
console.log('下载二维码')
|
||||
const params = { ...this.queryParams }
|
||||
// const url = '/smart-site/video_equipment/downZip?pageNum'
|
||||
// const url = 'http://192.168.0.58:38080/smart-site/video_equipment/downZip?pageNum' + this.queryParams.pageNum + '&pageSize=' + this.queryParams.pageSize
|
||||
// const fileName = `二维码_${new Date().getTime()}.zip`
|
||||
// this.downLoadFile(url, fileName, null)
|
||||
// const res = await qrCodeDownZip(params)
|
||||
// console.log('🚀 ~ 下载二维码 ~ res:', res)
|
||||
try {
|
||||
const response = await qrCodeDownZip(params)
|
||||
console.log('🚀 ~ handleQrCode ~ response:', response)
|
||||
// const blob = new Blob([response], { type: 'application/octet-stream' })
|
||||
// const url = window.URL.createObjectURL(blob)
|
||||
// const link = document.createElement('a')
|
||||
// link.href = url
|
||||
// link.setAttribute('download', `二维码_${new Date().getTime()}.zip`)
|
||||
// document.body.appendChild(link)
|
||||
// link.click()
|
||||
// link.remove()
|
||||
// window.URL.revokeObjectURL(url)
|
||||
// 检查响应类型,确保是 Blob 或 ArrayBuffer
|
||||
const blob = new Blob([response.data], { type: 'application/octet-stream' })
|
||||
console.log('🚀 ~ handleQrCode ~ blob:', blob)
|
||||
// 创建下载链接
|
||||
const url = window.URL.createObjectURL(blob)
|
||||
// 创建一个隐藏的 <a> 标签进行下载
|
||||
const a = document.createElement('a')
|
||||
a.href = url
|
||||
a.download = `二维码_${new Date().getTime()}.zip` // 设置下载的文件名
|
||||
document.body.appendChild(a)
|
||||
|
||||
// 触发点击事件下载文件
|
||||
a.click()
|
||||
|
||||
// 释放 URL 对象,防止内存泄漏
|
||||
window.URL.revokeObjectURL(url)
|
||||
document.body.removeChild(a)
|
||||
} catch (error) {
|
||||
console.error('下载二维码失败:', error)
|
||||
}
|
||||
},
|
||||
// 多选
|
||||
selectionChange(val) {
|
||||
console.log('selectionChange', val)
|
||||
|
|
@ -426,7 +477,7 @@ export default {
|
|||
// 导出数据
|
||||
handleExport() {
|
||||
try {
|
||||
let fileName = `数据_${new Date().getTime()}.xLsx`
|
||||
let fileName = `视频设备管理_${new Date().getTime()}.xlsx`
|
||||
let url = '/smart-site/video_equipment/export'
|
||||
const params = { ...this.queryParams }
|
||||
console.log('🚀 ~ 导出 ~ params:', params)
|
||||
|
|
|
|||
Loading…
Reference in New Issue