|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="product normal-form" style="padding: 6px">
|
|
<div class="product normal-form" style="padding: 6px">
|
|
|
- <el-card style="margin: 20px;border:0; margin-top: 10px;" shadow="never">
|
|
|
|
|
|
|
+ <el-card style="margin: 20px; border: 0; margin-top: 10px" shadow="never">
|
|
|
<el-form
|
|
<el-form
|
|
|
- class="search-form"
|
|
|
|
|
|
|
+ class="search-form"
|
|
|
ref="queryFormRef"
|
|
ref="queryFormRef"
|
|
|
:inline="true"
|
|
:inline="true"
|
|
|
:model="queryParams"
|
|
:model="queryParams"
|
|
@@ -33,7 +33,7 @@
|
|
|
:placeholder="t('product.index091251-5')"
|
|
:placeholder="t('product.index091251-5')"
|
|
|
clearable
|
|
clearable
|
|
|
size="default"
|
|
size="default"
|
|
|
- style="width: 150px;"
|
|
|
|
|
|
|
+ style="width: 150px"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="dict in iot_product_status"
|
|
v-for="dict in iot_product_status"
|
|
@@ -50,18 +50,12 @@
|
|
|
<el-button :icon="Refresh" size="default" @click="resetQuery">{{
|
|
<el-button :icon="Refresh" size="default" @click="resetQuery">{{
|
|
|
t('product.index091251-7')
|
|
t('product.index091251-7')
|
|
|
}}</el-button>
|
|
}}</el-button>
|
|
|
-
|
|
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
- <el-card class="main-card" shadow="never" style="margin: 20px;border:0">
|
|
|
|
|
|
|
+ <el-card class="main-card" shadow="never" style="margin: 20px; border: 0">
|
|
|
<div class="card-toolbar mb8">
|
|
<div class="card-toolbar mb8">
|
|
|
- <el-button
|
|
|
|
|
-
|
|
|
|
|
- type="primary"
|
|
|
|
|
- size="small"
|
|
|
|
|
- :icon="Plus"
|
|
|
|
|
- @click="handleEditProduct(0)"
|
|
|
|
|
|
|
+ <el-button type="primary" size="small" :icon="Plus" @click="handleEditProduct(0)"
|
|
|
>新增</el-button
|
|
>新增</el-button
|
|
|
>
|
|
>
|
|
|
<el-radio-group v-model="showType" class="float-right ml-10" plain size="small">
|
|
<el-radio-group v-model="showType" class="float-right ml-10" plain size="small">
|
|
@@ -91,11 +85,15 @@
|
|
|
:xl="6"
|
|
:xl="6"
|
|
|
style="margin-bottom: 30px; text-align: center"
|
|
style="margin-bottom: 30px; text-align: center"
|
|
|
>
|
|
>
|
|
|
- <el-card :body-style="{ padding: '20px' }" shadow="hover" class="card-item" style="border: 0;">
|
|
|
|
|
|
|
+ <el-card
|
|
|
|
|
+ :body-style="{ padding: '20px' }"
|
|
|
|
|
+ shadow="hover"
|
|
|
|
|
+ class="card-item"
|
|
|
|
|
+ style="border: 0"
|
|
|
|
|
+ >
|
|
|
<el-row type="flex" :gutter="10" justify="space-between">
|
|
<el-row type="flex" :gutter="10" justify="space-between">
|
|
|
<el-col :span="16" style="text-align: left">
|
|
<el-col :span="16" style="text-align: left">
|
|
|
<el-link
|
|
<el-link
|
|
|
-
|
|
|
|
|
:underline="false"
|
|
:underline="false"
|
|
|
style="font-weight: bold; font-size: 16px; line-height: 32px"
|
|
style="font-weight: bold; font-size: 16px; line-height: 32px"
|
|
|
@click="handleDeviceDetail(item)"
|
|
@click="handleDeviceDetail(item)"
|
|
@@ -196,16 +194,11 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
<div class="card-item__footer">
|
|
<div class="card-item__footer">
|
|
|
- <el-button
|
|
|
|
|
-
|
|
|
|
|
- size="small"
|
|
|
|
|
- class="detail-btn"
|
|
|
|
|
- @click="handleEditProduct(item)"
|
|
|
|
|
|
|
+ <el-button size="small" class="detail-btn" @click="handleEditProduct(item)"
|
|
|
>查看详情</el-button
|
|
>查看详情</el-button
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="item.status == 1 && item.isOwner != 0"
|
|
v-if="item.status == 1 && item.isOwner != 0"
|
|
|
-
|
|
|
|
|
size="small"
|
|
size="small"
|
|
|
class="delete-btn"
|
|
class="delete-btn"
|
|
|
@click="handleDelete(item)"
|
|
@click="handleDelete(item)"
|
|
@@ -213,7 +206,6 @@
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="item.status == 2 && item.isOwner != 0"
|
|
v-if="item.status == 2 && item.isOwner != 0"
|
|
|
-
|
|
|
|
|
size="small"
|
|
size="small"
|
|
|
class="success-btn"
|
|
class="success-btn"
|
|
|
:disabled="item.isAuthorize != 1"
|
|
:disabled="item.isAuthorize != 1"
|
|
@@ -221,11 +213,7 @@
|
|
|
>
|
|
>
|
|
|
设备授权
|
|
设备授权
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <el-button
|
|
|
|
|
-
|
|
|
|
|
- size="small"
|
|
|
|
|
- type="warning"
|
|
|
|
|
- @click="handleViewDevice(item.productId)"
|
|
|
|
|
|
|
+ <el-button size="small" type="warning" @click="handleViewDevice(item.productId)"
|
|
|
>查看设备</el-button
|
|
>查看设备</el-button
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
@@ -312,16 +300,10 @@
|
|
|
width="300"
|
|
width="300"
|
|
|
>
|
|
>
|
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
|
- <el-button
|
|
|
|
|
-
|
|
|
|
|
- type="primary"
|
|
|
|
|
- plain
|
|
|
|
|
- style="padding: 5px"
|
|
|
|
|
- @click="handleEditProduct(row)"
|
|
|
|
|
|
|
+ <el-button type="primary" plain style="padding: 5px" @click="handleEditProduct(row)"
|
|
|
>查看详情</el-button
|
|
>查看详情</el-button
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
-
|
|
|
|
|
type="primary"
|
|
type="primary"
|
|
|
plain
|
|
plain
|
|
|
style="padding: 5px"
|
|
style="padding: 5px"
|
|
@@ -330,7 +312,6 @@
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="row.status == 2 && row.isOwner != 0"
|
|
v-if="row.status == 2 && row.isOwner != 0"
|
|
|
-
|
|
|
|
|
type="success"
|
|
type="success"
|
|
|
plain
|
|
plain
|
|
|
style="padding: 5px"
|
|
style="padding: 5px"
|
|
@@ -339,7 +320,6 @@
|
|
|
>
|
|
>
|
|
|
<el-button
|
|
<el-button
|
|
|
v-if="row.status == 1 && row.isOwner != 0"
|
|
v-if="row.status == 1 && row.isOwner != 0"
|
|
|
-
|
|
|
|
|
type="danger"
|
|
type="danger"
|
|
|
plain
|
|
plain
|
|
|
style="padding: 5px"
|
|
style="padding: 5px"
|
|
@@ -351,20 +331,18 @@
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</template>
|
|
</template>
|
|
|
<el-empty v-else description="暂无数据,请添加产品" />
|
|
<el-empty v-else description="暂无数据,请添加产品" />
|
|
|
- <div class="mt-5 flex justify-right">
|
|
|
|
|
- <el-pagination
|
|
|
|
|
- v-show="total > 0"
|
|
|
|
|
- :total="total"
|
|
|
|
|
- v-model:current-page="queryParams.pageNum"
|
|
|
|
|
- v-model:page-size="queryParams.pageSize"
|
|
|
|
|
- :page-sizes="[12, 24, 36, 60]"
|
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
- @update:current-page="getList"
|
|
|
|
|
- @update:page-size="getList"
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <div class="mt-5 flex justify-right">
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-show="total > 0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ v-model:current-page="queryParams.pageNo"
|
|
|
|
|
+ v-model:page-size="queryParams.pageSize"
|
|
|
|
|
+ :page-sizes="[12, 24, 36, 60]"
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ @update:current-page="getList"
|
|
|
|
|
+ @update:page-size="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -385,7 +363,6 @@ import gatewaySvg from '@/assets/imgs/gateway.svg'
|
|
|
import { getDicts } from '@/api/pms/video/dicts'
|
|
import { getDicts } from '@/api/pms/video/dicts'
|
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
// 定义组件名称
|
|
// 定义组件名称
|
|
@@ -418,7 +395,7 @@ const uniqueId = ref(0)
|
|
|
const baseUrl = ref(import.meta.VITE_BASE_URL)
|
|
const baseUrl = ref(import.meta.VITE_BASE_URL)
|
|
|
|
|
|
|
|
const queryParams = reactive({
|
|
const queryParams = reactive({
|
|
|
- pageNum: 1,
|
|
|
|
|
|
|
+ pageNo: 1,
|
|
|
pageSize: 12,
|
|
pageSize: 12,
|
|
|
showSenior: true,
|
|
showSenior: true,
|
|
|
productName: null,
|
|
productName: null,
|
|
@@ -447,18 +424,15 @@ function importTemplate() {
|
|
|
download('iot/product/temp-json', {}, `产品模板${new Date().getTime()}.xlsx`)
|
|
download('iot/product/temp-json', {}, `产品模板${new Date().getTime()}.xlsx`)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 文件上传中处理
|
|
// 文件上传中处理
|
|
|
function handleFileUploadProgress(event, file, fileList) {
|
|
function handleFileUploadProgress(event, file, fileList) {
|
|
|
upload.isUploading = true
|
|
upload.isUploading = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 查询产品列表
|
|
// 查询产品列表
|
|
|
function getList() {
|
|
function getList() {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
listProduct(queryParams).then((response) => {
|
|
listProduct(queryParams).then((response) => {
|
|
|
-
|
|
|
|
|
productList.value = response.list
|
|
productList.value = response.list
|
|
|
total.value = response.total
|
|
total.value = response.total
|
|
|
loading.value = false
|
|
loading.value = false
|
|
@@ -502,10 +476,10 @@ async function handleChangeProductStatus(productId, status, deviceType) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ElMessageBox.confirm(message, t('product.index091251-34'), {
|
|
ElMessageBox.confirm(message, t('product.index091251-34'), {
|
|
|
- confirmButtonText: t('product.index091251-35'),
|
|
|
|
|
- cancelButtonText: t('product.index091251-36'),
|
|
|
|
|
- type: 'warning'
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ confirmButtonText: t('product.index091251-35'),
|
|
|
|
|
+ cancelButtonText: t('product.index091251-36'),
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ })
|
|
|
.then(() => {
|
|
.then(() => {
|
|
|
let data = {
|
|
let data = {
|
|
|
productId,
|
|
productId,
|
|
@@ -538,7 +512,6 @@ function handleViewDevice(productId) {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
function cancel() {
|
|
function cancel() {
|
|
|
open.value = false
|
|
open.value = false
|
|
@@ -547,7 +520,7 @@ function cancel() {
|
|
|
|
|
|
|
|
// 搜索按钮操作
|
|
// 搜索按钮操作
|
|
|
function handleQuery() {
|
|
function handleQuery() {
|
|
|
- queryParams.pageNum = 1
|
|
|
|
|
|
|
+ queryParams.pageNo = 1
|
|
|
getList()
|
|
getList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -557,28 +530,23 @@ function resetQuery() {
|
|
|
handleQuery()
|
|
handleQuery()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// 删除按钮操作
|
|
// 删除按钮操作
|
|
|
function handleDelete(row) {
|
|
function handleDelete(row) {
|
|
|
const productIds = row.productId || 0
|
|
const productIds = row.productId || 0
|
|
|
let msg = ''
|
|
let msg = ''
|
|
|
- ElMessageBox
|
|
|
|
|
- .confirm(t('product.index091251-39', [productIds]))
|
|
|
|
|
|
|
+ ElMessageBox.confirm(t('product.index091251-39', [productIds]))
|
|
|
.then(function () {
|
|
.then(function () {
|
|
|
// 删除SIP配置
|
|
// 删除SIP配置
|
|
|
delSipconfigByProductId(productIds).then((response) => {})
|
|
delSipconfigByProductId(productIds).then((response) => {})
|
|
|
delProduct(productIds).then((response) => {
|
|
delProduct(productIds).then((response) => {
|
|
|
-
|
|
|
|
|
msg = response.msg
|
|
msg = response.msg
|
|
|
getList()
|
|
getList()
|
|
|
})
|
|
})
|
|
|
- }).then(() => {
|
|
|
|
|
-
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
ElMessage.success('删除成功')
|
|
ElMessage.success('删除成功')
|
|
|
- }).catch(() => { })
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 修改按钮操作
|
|
// 修改按钮操作
|
|
@@ -591,7 +559,7 @@ function handleEditProduct(row) {
|
|
|
name: 'VideoCenterProductEdit',
|
|
name: 'VideoCenterProductEdit',
|
|
|
query: {
|
|
query: {
|
|
|
productId: productId,
|
|
productId: productId,
|
|
|
- pageNum: queryParams.pageNum
|
|
|
|
|
|
|
+ pageNo: queryParams.pageNo
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -616,7 +584,6 @@ onMounted(() => {
|
|
|
getList()
|
|
getList()
|
|
|
|
|
|
|
|
getDicts('iot_product_status').then((response) => {
|
|
getDicts('iot_product_status').then((response) => {
|
|
|
-
|
|
|
|
|
iot_product_status.value = response
|
|
iot_product_status.value = response
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
@@ -626,7 +593,7 @@ if (route.query.t) {
|
|
|
const time = route.query.t
|
|
const time = route.query.t
|
|
|
if (time != null && time != uniqueId.value) {
|
|
if (time != null && time != uniqueId.value) {
|
|
|
uniqueId.value = time
|
|
uniqueId.value = time
|
|
|
- queryParams.pageNum = Number(route.query.pageNum)
|
|
|
|
|
|
|
+ queryParams.pageNo = Number(route.query.pageNo)
|
|
|
getList()
|
|
getList()
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|