|
@@ -1,164 +1,278 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div>
|
|
|
|
|
- <el-card class="main-card">
|
|
|
|
|
- <el-form :model="queryParams" ref="queryFormRef" :inline="true" style="margin-bottom: -20px">
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-0')" prop="deviceSipId">
|
|
|
|
|
- <el-input v-model="queryParams.deviceSipId" :placeholder="t('sip.index998533-1')" clearable size="small" @keyup.enter="handleQuery" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-2')" prop="channelSipId">
|
|
|
|
|
- <el-input v-model="queryParams.channelSipId" :placeholder="t('sip.index998533-3')" clearable size="small" @keyup.enter="handleQuery" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-4')" prop="status">
|
|
|
|
|
- <el-select v-model="queryParams.status" :placeholder="t('sip.index998533-5')" clearable size="small" style="width: 150px;">
|
|
|
|
|
- <el-option v-for="dict in my_dict.type.iot_device_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-button type="primary" :icon="Search" size="small" @click="handleQuery">{{ t('search') }}</el-button>
|
|
|
|
|
- <el-button :icon="Refresh" size="small" @click="resetQuery">{{ t('reset') }}</el-button>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- </el-card>
|
|
|
|
|
- <el-card class="main-card mt-5">
|
|
|
|
|
- <div class="mb20">
|
|
|
|
|
- <el-button type="primary" plain :icon="Plus" size="small" @click="handleAdd">
|
|
|
|
|
- 添加
|
|
|
|
|
- </el-button>
|
|
|
|
|
- <el-button type="danger" plain :icon="Delete" size="small" :disabled="multiple || isGeneralUser" @click="handleDelete">
|
|
|
|
|
- 删除
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <el-table v-loading="loading" :data="sipidList" @selection-change="handleSelectionChange" @cell-dblclick="celldblclick">
|
|
|
|
|
- <el-table-column type="selection" :selectable="selectable" width="55" align="center" />
|
|
|
|
|
- <el-table-column label="设备编号" align="center" prop="deviceSipId">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <el-link :underline="false" type="primary" @click="handleViewDevice(scope.row.deviceSipId)">{{ scope.row.deviceSipId }}</el-link>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-2')" align="center" prop="channelSipId" />
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-4')" align="center" prop="status" width="80">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <dict-tag :options="my_dict.type.iot_device_status" :value="scope.row.status" size="small" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-8')" align="center" prop="productName" />
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-9')" align="center" prop="deviceType">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <dict-tag :options="my_dict.type.video_type" :value="scope.row.deviceType" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-15')" align="center" prop="channelType">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <dict-tag :options="my_dict.type.channel_type" :value="scope.row.channelType" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-10')" align="center" prop="citycode" />
|
|
|
|
|
- <el-table-column :label="t('sip.index998533-11')" align="center" prop="registerTime" width="180">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('opation')" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <el-button size="small" type="primary" link :icon="Edit" @click="handleBinding(scope.row)">{{ t('sip.index998533-12') }}</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
|
|
- </el-card>
|
|
|
|
|
-
|
|
|
|
|
- <el-dialog :title="title" v-model="open" width="450px" append-to-body>
|
|
|
|
|
- <el-form :model="createForm" ref="createFormRef">
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-13')">
|
|
|
|
|
- <el-cascader :options="cityOptions" v-model="createForm.city" @change="changeProvince" :props="{ checkStrictly: true }" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-9')" prop="deviceType">
|
|
|
|
|
- <el-select v-model="createForm.deviceType" :placeholder="t('sip.index998533-14')">
|
|
|
|
|
- <el-option v-for="dict in my_dict.type.video_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-15')" prop="channelType">
|
|
|
|
|
- <el-select v-model="createForm.channelType" :placeholder="t('sip.index998533-16')">
|
|
|
|
|
- <el-option v-for="dict in my_dict.type.channel_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-8')" prop="productName">
|
|
|
|
|
- <el-input readonly v-model="createForm.productName" :placeholder="t('sip.index998533-17')">
|
|
|
|
|
- <template #append>
|
|
|
|
|
- <el-button @click="selectProduct()">{{ t('sip.index998533-18') }}</el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-20')" prop="createNum">
|
|
|
|
|
- <el-input-number controls-position="right" v-model="createForm.createNum" :max="10" :placeholder="t('sip.index998533-19')" style="width: 330px" />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <template #footer>
|
|
|
|
|
- <div class="dialog-footer">
|
|
|
|
|
- <el-button type="primary" @click="submitForm">{{ t('sip.index998533-21') }}</el-button>
|
|
|
|
|
- <el-button @click="cancel">{{ t('cancel') }}</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-card class="main-card" shadow="never" style="border: 0">
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryFormRef" :inline="true" style="margin-bottom: -20px">
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-0')" prop="deviceSipId">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.deviceSipId"
|
|
|
|
|
+ :placeholder="t('sip.index998533-1')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-2')" prop="channelSipId">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.channelSipId"
|
|
|
|
|
+ :placeholder="t('sip.index998533-3')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-4')" prop="status">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="queryParams.status"
|
|
|
|
|
+ :placeholder="t('sip.index998533-5')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 150px"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in getStrDictOptions(DICT_TYPE.VIDEO_DEVICE_STATUS)"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" :icon="Search" size="small" @click="handleQuery">搜素</el-button>
|
|
|
|
|
+ <el-button :icon="Refresh" size="small" @click="resetQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+ <el-card class="main-card mt-5" shadow="never" style="border: 0">
|
|
|
|
|
+ <div class="mb-10">
|
|
|
|
|
+ <el-button type="primary" plain :icon="Plus" size="small" @click="handleAdd">
|
|
|
|
|
+ 添加
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ plain
|
|
|
|
|
+ :icon="Delete"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :disabled="multiple || isGeneralUser"
|
|
|
|
|
+ @click="handleDelete"
|
|
|
|
|
+ >
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="sipidList"
|
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
|
+ @cell-dblclick="celldblclick"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-table-column type="selection" :selectable="selectable" width="55" align="center" />
|
|
|
|
|
+ <el-table-column label="设备编号" align="center" prop="deviceSipId">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="handleViewDevice(scope.row.deviceSipId)"
|
|
|
|
|
+ >{{ scope.row.deviceSipId }}</el-link
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-2')" align="center" prop="channelSipId" />
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-4')" align="center" prop="status" width="80">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <dict-tag
|
|
|
|
|
+ :type="DICT_TYPE.VIDEO_DEVICE_STATUS"
|
|
|
|
|
+ :value="scope.row.status"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-8')" align="center" prop="productName" />
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-9')" align="center" prop="deviceType">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <dict-tag :options="DICT_TYPE.VIDEO_TYPE" :value="scope.row.deviceType" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-15')" align="center" prop="channelType">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <dict-tag :options="DICT_TYPE.CHANNEL_TYPE" :value="scope.row.channelType" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column :label="t('sip.index998533-10')" align="center" prop="citycode" />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('sip.index998533-11')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="registerTime"
|
|
|
|
|
+ width="180"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d} {h}:{m}:{s}') }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ label="操作"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ link
|
|
|
|
|
+ :icon="Edit"
|
|
|
|
|
+ @click="handleBinding(scope.row)"
|
|
|
|
|
+ >{{ t('sip.index998533-12') }}</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="total > 0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
|
+ @pagination="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-card>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog :title="title" v-model="open" width="450px" append-to-body>
|
|
|
|
|
+ <el-form :model="createForm" ref="createFormRef">
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-13')">
|
|
|
|
|
+ <el-cascader
|
|
|
|
|
+ :options="cityOptions"
|
|
|
|
|
+ v-model="createForm.city"
|
|
|
|
|
+ @change="changeProvince"
|
|
|
|
|
+ :props="{ checkStrictly: true }"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-9')" prop="deviceType">
|
|
|
|
|
+ <el-select v-model="createForm.deviceType" :placeholder="t('sip.index998533-14')">
|
|
|
|
|
+
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in getStrDictOptions(DICT_TYPE.VIDEO_TYPE)"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-15')" prop="channelType">
|
|
|
|
|
+ <el-select v-model="createForm.channelType" :placeholder="t('sip.index998533-16')">
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="dict in getStrDictOptions(DICT_TYPE.CHANNEL_TYPE)"
|
|
|
|
|
+ :key="dict.value"
|
|
|
|
|
+ :label="dict.label"
|
|
|
|
|
+ :value="dict.value"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-8')" prop="productName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ readonly
|
|
|
|
|
+ v-model="createForm.productName"
|
|
|
|
|
+ :placeholder="t('sip.index998533-17')"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #append>
|
|
|
|
|
+ <el-button @click="selectProduct()">{{ t('sip.index998533-18') }}</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
- </el-dialog>
|
|
|
|
|
- <el-dialog :title="title" v-model="bindingOpen" width="450px" append-to-body>
|
|
|
|
|
- <el-form :model="form" ref="formRef">
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-22')" prop="deviceId">
|
|
|
|
|
- <el-select style="width: 210px" v-model="form.reDeviceId" size="small" :placeholder="t('sip.index998533-23')" filterable @change="handleUpdateDeviceItem">
|
|
|
|
|
- <el-option v-for="(item, index) in deviceList" :key="index" :label="item.deviceName" :value="item.deviceId" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('sip.index998533-24')" prop="sceneId">
|
|
|
|
|
- <el-select style="width: 210px" v-model="form.reSceneModelId" size="small" :placeholder="t('sip.index998533-25')" filterable>
|
|
|
|
|
- <el-option v-for="(item, index) in sceneList" :key="index" :label="item.sceneModelName" :value="item.sceneModelId" />
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <template #footer>
|
|
|
|
|
- <div class="dialog-footer">
|
|
|
|
|
- <el-button type="primary" @click="submitFormBinding">{{ t('confirm') }}</el-button>
|
|
|
|
|
- <el-button @click="cancelBinding">{{ t('cancel') }}</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 选择产品 -->
|
|
|
|
|
- <product-list ref="productListRef" @product-event="getProductData" />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-20')" prop="createNum">
|
|
|
|
|
+ <el-input-number
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ v-model="createForm.createNum"
|
|
|
|
|
+ :max="10"
|
|
|
|
|
+ :placeholder="t('sip.index998533-19')"
|
|
|
|
|
+ style="width: 330px"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitForm">{{ t('sip.index998533-21') }}</el-button>
|
|
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ <el-dialog :title="title" v-model="bindingOpen" width="450px" append-to-body>
|
|
|
|
|
+ <el-form :model="form" ref="formRef">
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-22')" prop="deviceId">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ style="width: 210px"
|
|
|
|
|
+ v-model="form.reDeviceId"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :placeholder="t('sip.index998533-23')"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ @change="handleUpdateDeviceItem"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in deviceList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.deviceName"
|
|
|
|
|
+ :value="item.deviceId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('sip.index998533-24')" prop="sceneId">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ style="width: 210px"
|
|
|
|
|
+ v-model="form.reSceneModelId"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :placeholder="t('sip.index998533-25')"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in sceneList"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item.sceneModelName"
|
|
|
|
|
+ :value="item.sceneModelId"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitFormBinding">确定</el-button>
|
|
|
|
|
+ <el-button @click="cancelBinding">取消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 选择产品 -->
|
|
|
|
|
+ <product-list ref="productListRef" @product-event="getProductData" />
|
|
|
|
|
+ </div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
import { ref, reactive, watch, onMounted } from 'vue'
|
|
import { ref, reactive, watch, onMounted } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
import { useStore } from 'vuex'
|
|
import { useStore } from 'vuex'
|
|
|
import { Search, Refresh, Plus, Delete, Edit } from '@element-plus/icons-vue'
|
|
import { Search, Refresh, Plus, Delete, Edit } from '@element-plus/icons-vue'
|
|
|
-import { regionData } from 'element-china-area-data'
|
|
|
|
|
|
|
+import { regionData,codeToText } from 'element-china-area-data'
|
|
|
import { listChannel, getChannel, delChannel, addChannel, binding } from '@/api/pms/video/channel'
|
|
import { listChannel, getChannel, delChannel, addChannel, binding } from '@/api/pms/video/channel'
|
|
|
import { getDeviceBySerialNumber, listDeviceShort } from '@/api/pms/video/device'
|
|
import { getDeviceBySerialNumber, listDeviceShort } from '@/api/pms/video/device'
|
|
|
import { getSceneModelList } from '@/api/pms/video/list'
|
|
import { getSceneModelList } from '@/api/pms/video/list'
|
|
|
import productList from './product-list.vue'
|
|
import productList from './product-list.vue'
|
|
|
-
|
|
|
|
|
|
|
+import { DICT_TYPE, getDictLabel, getStrDictOptions } from '@/utils/dict'
|
|
|
|
|
|
|
|
// 使用组合式API
|
|
// 使用组合式API
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const store = useStore()
|
|
const store = useStore()
|
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
// 定义 props
|
|
// 定义 props
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
- product: {
|
|
|
|
|
- type: Object,
|
|
|
|
|
- default: null,
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ product: {
|
|
|
|
|
+ type: Object,
|
|
|
|
|
+ default: null
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 定义 emits
|
|
// 定义 emits
|
|
|
const emit = defineEmits(['productEvent'])
|
|
const emit = defineEmits(['productEvent'])
|
|
|
|
|
|
|
|
-
|
|
|
|
|
function parseTime(time, pattern) {
|
|
function parseTime(time, pattern) {
|
|
|
if (arguments.length === 0 || !time) {
|
|
if (arguments.length === 0 || !time) {
|
|
|
return null
|
|
return null
|
|
@@ -168,12 +282,15 @@ function parseTime(time, pattern) {
|
|
|
if (typeof time === 'object') {
|
|
if (typeof time === 'object') {
|
|
|
date = time
|
|
date = time
|
|
|
} else {
|
|
} else {
|
|
|
- if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
|
|
|
|
|
|
+ if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
|
|
|
time = parseInt(time)
|
|
time = parseInt(time)
|
|
|
} else if (typeof time === 'string') {
|
|
} else if (typeof time === 'string') {
|
|
|
- time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.[\d]{3}/gm), '');
|
|
|
|
|
|
|
+ time = time
|
|
|
|
|
+ .replace(new RegExp(/-/gm), '/')
|
|
|
|
|
+ .replace('T', ' ')
|
|
|
|
|
+ .replace(new RegExp(/\.[\d]{3}/gm), '')
|
|
|
}
|
|
}
|
|
|
- if ((typeof time === 'number') && (time.toString().length === 10)) {
|
|
|
|
|
|
|
+ if (typeof time === 'number' && time.toString().length === 10) {
|
|
|
time = time * 1000
|
|
time = time * 1000
|
|
|
}
|
|
}
|
|
|
date = new Date(time)
|
|
date = new Date(time)
|
|
@@ -190,7 +307,9 @@ function parseTime(time, pattern) {
|
|
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
|
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
|
|
let value = formatObj[key]
|
|
let value = formatObj[key]
|
|
|
// Note: getDay() returns 0 on Sunday
|
|
// Note: getDay() returns 0 on Sunday
|
|
|
- if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
|
|
|
|
|
|
|
+ if (key === 'a') {
|
|
|
|
|
+ return ['日', '一', '二', '三', '四', '五', '六'][value]
|
|
|
|
|
+ }
|
|
|
if (result.length > 0 && value < 10) {
|
|
if (result.length > 0 && value < 10) {
|
|
|
value = '0' + value
|
|
value = '0' + value
|
|
|
}
|
|
}
|
|
@@ -205,15 +324,6 @@ const createFormRef = ref(null)
|
|
|
const formRef = ref(null)
|
|
const formRef = ref(null)
|
|
|
const productListRef = ref(null)
|
|
const productListRef = ref(null)
|
|
|
|
|
|
|
|
-// 字典数据(需要根据实际项目情况调整)
|
|
|
|
|
-const my_dict = {
|
|
|
|
|
- type: {
|
|
|
|
|
- iot_device_status: [],
|
|
|
|
|
- video_type: [],
|
|
|
|
|
- channel_type: []
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 响应式数据
|
|
// 响应式数据
|
|
|
const isGeneralUser = ref(true)
|
|
const isGeneralUser = ref(true)
|
|
|
const loading = ref(true)
|
|
const loading = ref(true)
|
|
@@ -231,116 +341,116 @@ const city = ref('')
|
|
|
|
|
|
|
|
// 查询参数
|
|
// 查询参数
|
|
|
const queryParams = reactive({
|
|
const queryParams = reactive({
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- deviceSipId: null,
|
|
|
|
|
- deviceChannelId: null,
|
|
|
|
|
- status: null,
|
|
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ deviceSipId: null,
|
|
|
|
|
+ deviceChannelId: null,
|
|
|
|
|
+ status: null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 表单参数
|
|
// 表单参数
|
|
|
const createForm = reactive({
|
|
const createForm = reactive({
|
|
|
- city: '',
|
|
|
|
|
- deviceType: '',
|
|
|
|
|
- channelType: '',
|
|
|
|
|
- createNum: 1,
|
|
|
|
|
- remark: '',
|
|
|
|
|
- area: '',
|
|
|
|
|
- productId: null,
|
|
|
|
|
- productName: '',
|
|
|
|
|
- tenantId: null,
|
|
|
|
|
- tenantName: '',
|
|
|
|
|
- citycode: ''
|
|
|
|
|
|
|
+ city: '',
|
|
|
|
|
+ deviceType: '',
|
|
|
|
|
+ channelType: '',
|
|
|
|
|
+ createNum: 1,
|
|
|
|
|
+ remark: '',
|
|
|
|
|
+ area: '',
|
|
|
|
|
+ productId: null,
|
|
|
|
|
+ productName: '',
|
|
|
|
|
+ tenantId: null,
|
|
|
|
|
+ tenantName: '',
|
|
|
|
|
+ citycode: ''
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const form = reactive({})
|
|
const form = reactive({})
|
|
|
|
|
|
|
|
// 表单校验规则
|
|
// 表单校验规则
|
|
|
const rules = {
|
|
const rules = {
|
|
|
- protocol: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-26'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- ip: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-27'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- domain: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-28'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- secret: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-29'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- portHttp: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-30'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- portHttps: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-31'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- portRtmp: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-32'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- portRtsp: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-33'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- rtpPortRange: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-34'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- delFlag: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-35'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- createBy: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-36'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
- createTime: [
|
|
|
|
|
- {
|
|
|
|
|
- required: true,
|
|
|
|
|
- message: t('sip.index998533-37'),
|
|
|
|
|
- trigger: 'blur',
|
|
|
|
|
- },
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ protocol: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-26'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ ip: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-27'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ domain: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-28'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ secret: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-29'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ portHttp: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-30'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ portHttps: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-31'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ portRtmp: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-32'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ portRtsp: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-33'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ rtpPortRange: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-34'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ delFlag: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-35'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ createBy: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-36'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
|
|
+ createTime: [
|
|
|
|
|
+ {
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ message: t('sip.index998533-37'),
|
|
|
|
|
+ trigger: 'blur'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 城市选项
|
|
// 城市选项
|
|
@@ -348,330 +458,303 @@ const cityOptions = regionData
|
|
|
|
|
|
|
|
// 监听 product prop 变化
|
|
// 监听 product prop 变化
|
|
|
watch(
|
|
watch(
|
|
|
- () => props.product,
|
|
|
|
|
- (newVal, oldVal) => {
|
|
|
|
|
- productInfo.value = newVal
|
|
|
|
|
- if (productInfo.value && productInfo.value.productId != 0) {
|
|
|
|
|
- queryParams.productId = productInfo.value.productId
|
|
|
|
|
- // deviceParams.productId = productInfo.value.productId
|
|
|
|
|
- getList()
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ () => props.product,
|
|
|
|
|
+ (newVal, oldVal) => {
|
|
|
|
|
+ productInfo.value = newVal
|
|
|
|
|
+ if (productInfo.value && productInfo.value.productId != 0) {
|
|
|
|
|
+ queryParams.productId = productInfo.value.productId
|
|
|
|
|
+ // deviceParams.productId = productInfo.value.productId
|
|
|
|
|
+ getList()
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// 查看设备操作
|
|
// 查看设备操作
|
|
|
const handleViewDevice = (serialNumber) => {
|
|
const handleViewDevice = (serialNumber) => {
|
|
|
- router.push({
|
|
|
|
|
- path: '/iot/device',
|
|
|
|
|
- query: {
|
|
|
|
|
- t: Date.now(),
|
|
|
|
|
- sn: serialNumber,
|
|
|
|
|
- },
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ router.push({
|
|
|
|
|
+ path: '/videocenter/device',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ t: Date.now(),
|
|
|
|
|
+ sn: serialNumber
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 选择产品
|
|
// 选择产品
|
|
|
const selectProduct = () => {
|
|
const selectProduct = () => {
|
|
|
- open.value = false
|
|
|
|
|
- productListRef.value.open = true
|
|
|
|
|
- productListRef.value.getList()
|
|
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ productListRef.value.open = true
|
|
|
|
|
+ productListRef.value.getList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取选中的产品
|
|
// 获取选中的产品
|
|
|
const getProductData = (product) => {
|
|
const getProductData = (product) => {
|
|
|
- open.value = true
|
|
|
|
|
- createForm.productId = product.productId
|
|
|
|
|
- createForm.productName = product.productName
|
|
|
|
|
- createForm.tenantId = product.tenantId
|
|
|
|
|
- createForm.tenantName = product.tenantName
|
|
|
|
|
|
|
+ open.value = true
|
|
|
|
|
+ createForm.productId = product.productId
|
|
|
|
|
+ createForm.productName = product.productName
|
|
|
|
|
+ createForm.tenantId = product.tenantId
|
|
|
|
|
+ createForm.tenantName = product.tenantName
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 行政区划改变
|
|
// 行政区划改变
|
|
|
const changeProvince = (data) => {
|
|
const changeProvince = (data) => {
|
|
|
- // if (data && data[0] != null && data[1] != null && data[2] != null) {
|
|
|
|
|
- // const str = CodeToText[data[0]] + '/' + CodeToText[data[1]] + '/' + CodeToText[data[2]]
|
|
|
|
|
- // createForm.citycode = str
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ if (data && data[0] != null && data[1] != null && data[2] != null) {
|
|
|
|
|
+ const str = codeToText[data[0]] + '/' + codeToText[data[1]] + '/' + codeToText[data[2]]
|
|
|
|
|
+ createForm.citycode = str
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取设备详情
|
|
// 获取设备详情
|
|
|
const getDeviceBySerial = (serialNumber) => {
|
|
const getDeviceBySerial = (serialNumber) => {
|
|
|
- openDevice.value = true
|
|
|
|
|
- getDeviceBySerialNumber(serialNumber).then((response) => {
|
|
|
|
|
- // device.value = response.data
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ openDevice.value = true
|
|
|
|
|
+ getDeviceBySerialNumber(serialNumber).then((response) => {
|
|
|
|
|
+ // device.value = response.data
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 查询通道列表
|
|
// 查询通道列表
|
|
|
const getList = () => {
|
|
const getList = () => {
|
|
|
- // listChannel(queryParams).then((response) => {
|
|
|
|
|
- // sipidList.value = response.rows
|
|
|
|
|
- // total.value = response.total
|
|
|
|
|
- // loading.value = false
|
|
|
|
|
- // })
|
|
|
|
|
-
|
|
|
|
|
- // 模拟数据
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- sipidList.value = [
|
|
|
|
|
- {
|
|
|
|
|
- id: 1,
|
|
|
|
|
- deviceSipId: '31010000010010',
|
|
|
|
|
- channelSipId: '31010000020010',
|
|
|
|
|
- status: 1,
|
|
|
|
|
- productName: '测试产品A',
|
|
|
|
|
- deviceType: '摄像头',
|
|
|
|
|
- channelType: '视频通道',
|
|
|
|
|
- citycode: '上海/上海市/黄浦区',
|
|
|
|
|
- registerTime: 1696118400000,
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- id: 2,
|
|
|
|
|
- deviceSipId: '31010000010020',
|
|
|
|
|
- channelSipId: '31010000020020',
|
|
|
|
|
- status: 2,
|
|
|
|
|
- productName: '测试产品B',
|
|
|
|
|
- deviceType: '摄像头',
|
|
|
|
|
- channelType: '视频通道',
|
|
|
|
|
- citycode: '上海/上海市/徐汇区',
|
|
|
|
|
- registerTime: 1696204800000,
|
|
|
|
|
- },
|
|
|
|
|
- ]
|
|
|
|
|
- total.value = sipidList.value.length
|
|
|
|
|
- loading.value = false
|
|
|
|
|
- }, 500)
|
|
|
|
|
|
|
+ listChannel(queryParams).then((response) => {
|
|
|
|
|
+ sipidList.value = response.list
|
|
|
|
|
+ total.value = response.total
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 取消按钮
|
|
// 取消按钮
|
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
|
- open.value = false
|
|
|
|
|
- reset()
|
|
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ reset()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表单重置
|
|
// 表单重置
|
|
|
const reset = () => {
|
|
const reset = () => {
|
|
|
- Object.assign(createForm, {
|
|
|
|
|
- id: null,
|
|
|
|
|
- deviceSipId: null,
|
|
|
|
|
- channelSipId: null,
|
|
|
|
|
- status: 0,
|
|
|
|
|
- registertime: null,
|
|
|
|
|
- createBy: null,
|
|
|
|
|
- createTime: null,
|
|
|
|
|
- updateBy: null,
|
|
|
|
|
- updateTime: null,
|
|
|
|
|
- remark: null,
|
|
|
|
|
- createNum: 1,
|
|
|
|
|
- })
|
|
|
|
|
- // resetForm('createForm')
|
|
|
|
|
|
|
+ Object.assign(createForm, {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ deviceSipId: null,
|
|
|
|
|
+ channelSipId: null,
|
|
|
|
|
+ status: 0,
|
|
|
|
|
+ registertime: null,
|
|
|
|
|
+ createBy: null,
|
|
|
|
|
+ createTime: null,
|
|
|
|
|
+ updateBy: null,
|
|
|
|
|
+ updateTime: null,
|
|
|
|
|
+ remark: null,
|
|
|
|
|
+ createNum: 1
|
|
|
|
|
+ })
|
|
|
|
|
+ // resetForm('createForm')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 搜索按钮操作
|
|
// 搜索按钮操作
|
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
|
- loading.value = true
|
|
|
|
|
- queryParams.pageNum = 1
|
|
|
|
|
- getList()
|
|
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ queryParams.pageNum = 1
|
|
|
|
|
+ getList()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 重置按钮操作
|
|
// 重置按钮操作
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
- // resetForm('queryForm')
|
|
|
|
|
- handleQuery()
|
|
|
|
|
|
|
+ // resetForm('queryForm')
|
|
|
|
|
+ handleQuery()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 多选框选中数据
|
|
// 多选框选中数据
|
|
|
const handleSelectionChange = (selection) => {
|
|
const handleSelectionChange = (selection) => {
|
|
|
- ids.value = selection.map((item) => item.id)
|
|
|
|
|
- multiple.value = !selection.length
|
|
|
|
|
|
|
+ ids.value = selection.map((item) => item.id)
|
|
|
|
|
+ multiple.value = !selection.length
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 批量新增按钮操作
|
|
// 批量新增按钮操作
|
|
|
const handleAdd = () => {
|
|
const handleAdd = () => {
|
|
|
- reset()
|
|
|
|
|
- open.value = true
|
|
|
|
|
- title.value = t('sip.index998533-38')
|
|
|
|
|
|
|
+ reset()
|
|
|
|
|
+ open.value = true
|
|
|
|
|
+ title.value = t('sip.index998533-38')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 修改按钮操作
|
|
// 修改按钮操作
|
|
|
const handleUpdate = (row) => {
|
|
const handleUpdate = (row) => {
|
|
|
- reset()
|
|
|
|
|
- const id = row.id || ids.value
|
|
|
|
|
- console.log(row)
|
|
|
|
|
- getChannel(id).then((response) => {
|
|
|
|
|
- Object.assign(createForm, response.data)
|
|
|
|
|
- open.value = true
|
|
|
|
|
- title.value = t('sip.index998533-39')
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ reset()
|
|
|
|
|
+ const id = row.id || ids.value
|
|
|
|
|
+ console.log(row)
|
|
|
|
|
+ getChannel(id).then((response) => {
|
|
|
|
|
+ Object.assign(createForm, response.data)
|
|
|
|
|
+ open.value = true
|
|
|
|
|
+ title.value = t('sip.index998533-39')
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 处理绑定
|
|
// 处理绑定
|
|
|
const handleBinding = (row) => {
|
|
const handleBinding = (row) => {
|
|
|
- Object.assign(form, row)
|
|
|
|
|
- bindingOpen.value = true
|
|
|
|
|
- title.value = t('sip.index998533-40')
|
|
|
|
|
|
|
+ Object.assign(form, row)
|
|
|
|
|
+ bindingOpen.value = true
|
|
|
|
|
+ title.value = t('sip.index998533-40')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取设备列表
|
|
// 获取设备列表
|
|
|
const getDeviceList = () => {
|
|
const getDeviceList = () => {
|
|
|
- const params = {
|
|
|
|
|
- showChild: true,
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 9999,
|
|
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ showChild: true,
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 9999
|
|
|
|
|
+ }
|
|
|
|
|
+ listDeviceShort(params).then((res) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ deviceList.value = res.rows
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // $message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
- listDeviceShort(params).then((res) => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- deviceList.value = res.rows
|
|
|
|
|
- } else {
|
|
|
|
|
- // $message.error(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 获取场景列表数据
|
|
// 获取场景列表数据
|
|
|
const getSceneListDatas = () => {
|
|
const getSceneListDatas = () => {
|
|
|
- const params = {
|
|
|
|
|
- pageNum: 1,
|
|
|
|
|
- pageSize: 9999,
|
|
|
|
|
|
|
+ const params = {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 9999
|
|
|
|
|
+ }
|
|
|
|
|
+ getSceneModelList(params).then((res) => {
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ sceneList.value = res.rows
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // $message.error(res.msg)
|
|
|
}
|
|
}
|
|
|
- getSceneModelList(params).then((res) => {
|
|
|
|
|
- if (res.code === 200) {
|
|
|
|
|
- sceneList.value = res.rows
|
|
|
|
|
- } else {
|
|
|
|
|
- // $message.error(res.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 取消绑定
|
|
// 取消绑定
|
|
|
const cancelBinding = () => {
|
|
const cancelBinding = () => {
|
|
|
- bindingOpen.value = false
|
|
|
|
|
- reset()
|
|
|
|
|
|
|
+ bindingOpen.value = false
|
|
|
|
|
+ reset()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 确认绑定设备或场景
|
|
// 确认绑定设备或场景
|
|
|
const submitFormBinding = () => {
|
|
const submitFormBinding = () => {
|
|
|
- const data = {
|
|
|
|
|
- channelId: form.channelSipId,
|
|
|
|
|
- reDeviceId: form.reDeviceId,
|
|
|
|
|
- reSceneModelId: form.reSceneModelId,
|
|
|
|
|
|
|
+ const data = {
|
|
|
|
|
+ channelId: form.channelSipId,
|
|
|
|
|
+ reDeviceId: form.reDeviceId,
|
|
|
|
|
+ reSceneModelId: form.reSceneModelId
|
|
|
|
|
+ }
|
|
|
|
|
+ binding(data).then((response) => {
|
|
|
|
|
+ if (response.code === 200) {
|
|
|
|
|
+ bindingOpen.value = false
|
|
|
|
|
+ ElMessage.success(t('sip.index998533-41'))
|
|
|
|
|
+ } else {
|
|
|
|
|
+ ElMessage.error('失败')
|
|
|
}
|
|
}
|
|
|
- binding(data).then((response) => {
|
|
|
|
|
- if (response.code === 200) {
|
|
|
|
|
- bindingOpen.value = false
|
|
|
|
|
- // $message.success(t('sip.index.998533-41'))
|
|
|
|
|
- } else {
|
|
|
|
|
- // $message.error(response.msg)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 提交按钮
|
|
// 提交按钮
|
|
|
const submitForm = () => {
|
|
const submitForm = () => {
|
|
|
- if (createForm.createNum < 1) {
|
|
|
|
|
- // $modal.alertError(t('sip.index.998533-42'))
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- if (!createForm.productId || createForm.productId == 0) {
|
|
|
|
|
- // $modal.alertError(t('sip.index.998533-43'))
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
- createForm.deviceSipId = createForm.city[2] + '0000' + createForm.deviceType + '0'
|
|
|
|
|
- createForm.channelSipId = createForm.city[2] + '0000' + createForm.channelType + '0'
|
|
|
|
|
- if (createForm.deviceType !== '' && createForm.channelType !== '' && createForm.city.length === 3) {
|
|
|
|
|
- console.log(createForm)
|
|
|
|
|
- addChannel(createForm.createNum, createForm).then((response) => {
|
|
|
|
|
- // $modal.msgSuccess(t('addSuccess'))
|
|
|
|
|
- open.value = false
|
|
|
|
|
- getList()
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- // $message({
|
|
|
|
|
- // type: 'error',
|
|
|
|
|
- // message: t('sip.index.998533-44'),
|
|
|
|
|
- // })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (createForm.createNum < 1) {
|
|
|
|
|
+ // $modal.alertError(t('sip.index.998533-42'))
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!createForm.productId || createForm.productId == 0) {
|
|
|
|
|
+ // $modal.alertError(t('sip.index.998533-43'))
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ createForm.deviceSipId = createForm.city[2] + '0000' + createForm.deviceType + '0'
|
|
|
|
|
+ createForm.channelSipId = createForm.city[2] + '0000' + createForm.channelType + '0'
|
|
|
|
|
+ if (
|
|
|
|
|
+ createForm.deviceType !== '' &&
|
|
|
|
|
+ createForm.channelType !== '' &&
|
|
|
|
|
+ createForm.city.length === 3
|
|
|
|
|
+ ) {
|
|
|
|
|
+ console.log(createForm)
|
|
|
|
|
+ addChannel(createForm.createNum, createForm).then((response) => {
|
|
|
|
|
+ // $modal.msgSuccess(t('addSuccess'))
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // $message({
|
|
|
|
|
+ // type: 'error',
|
|
|
|
|
+ // message: t('sip.index.998533-44'),
|
|
|
|
|
+ // })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 删除按钮操作
|
|
// 删除按钮操作
|
|
|
const handleDelete = (row) => {
|
|
const handleDelete = (row) => {
|
|
|
- const sipIds = row.id || ids.value
|
|
|
|
|
- // $modal
|
|
|
|
|
- // .confirm(t('sip.index.998533-45') + sipIds + t('notify.channel.index.333541-18'))
|
|
|
|
|
- // .then(function() {
|
|
|
|
|
- // return delChannel(sipIds)
|
|
|
|
|
- // })
|
|
|
|
|
- // .then(() => {
|
|
|
|
|
- // getList()
|
|
|
|
|
- // // $modal.msgSuccess(t('delSuccess'))
|
|
|
|
|
- // })
|
|
|
|
|
- // .catch(() => {})
|
|
|
|
|
|
|
+ const sipIds = row.id || ids.value
|
|
|
|
|
+ // $modal
|
|
|
|
|
+ // .confirm(t('sip.index.998533-45') + sipIds + t('notify.channel.index.333541-18'))
|
|
|
|
|
+ // .then(function() {
|
|
|
|
|
+ // return delChannel(sipIds)
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .then(() => {
|
|
|
|
|
+ // getList()
|
|
|
|
|
+ // // $modal.msgSuccess(t('delSuccess'))
|
|
|
|
|
+ // })
|
|
|
|
|
+ // .catch(() => {})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 禁用有绑定设备的复选框,status:1=未使用,2=已使用
|
|
// 禁用有绑定设备的复选框,status:1=未使用,2=已使用
|
|
|
const selectable = (row) => {
|
|
const selectable = (row) => {
|
|
|
- if (row.status == 2 || isGeneralUser.value) {
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- return true
|
|
|
|
|
|
|
+ if (row.status == 2 || isGeneralUser.value) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 表格增加复制功能
|
|
// 表格增加复制功能
|
|
|
const celldblclick = (row, column, cell, event) => {
|
|
const celldblclick = (row, column, cell, event) => {
|
|
|
- // $copyText(row[column.property]).then(
|
|
|
|
|
- // (e) => {
|
|
|
|
|
- // onCopy()
|
|
|
|
|
- // },
|
|
|
|
|
- // function(e) {
|
|
|
|
|
- // onError()
|
|
|
|
|
- // }
|
|
|
|
|
- // )
|
|
|
|
|
|
|
+ // $copyText(row[column.property]).then(
|
|
|
|
|
+ // (e) => {
|
|
|
|
|
+ // onCopy()
|
|
|
|
|
+ // },
|
|
|
|
|
+ // function(e) {
|
|
|
|
|
+ // onError()
|
|
|
|
|
+ // }
|
|
|
|
|
+ // )
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 复制成功
|
|
// 复制成功
|
|
|
const onCopy = () => {
|
|
const onCopy = () => {
|
|
|
- // $notify({
|
|
|
|
|
- // title: t('success'),
|
|
|
|
|
- // message: t('sip.index.998533-46'),
|
|
|
|
|
- // type: 'success',
|
|
|
|
|
- // offset: 50,
|
|
|
|
|
- // duration: 2000,
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ // $notify({
|
|
|
|
|
+ // title: t('success'),
|
|
|
|
|
+ // message: t('sip.index.998533-46'),
|
|
|
|
|
+ // type: 'success',
|
|
|
|
|
+ // offset: 50,
|
|
|
|
|
+ // duration: 2000,
|
|
|
|
|
+ // })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 复制失败
|
|
// 复制失败
|
|
|
const onError = () => {
|
|
const onError = () => {
|
|
|
- // $notify({
|
|
|
|
|
- // title: t('fail'),
|
|
|
|
|
- // message: t('sip.index.998533-47'),
|
|
|
|
|
- // type: 'error',
|
|
|
|
|
- // offset: 50,
|
|
|
|
|
- // duration: 2000,
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ // $notify({
|
|
|
|
|
+ // title: t('fail'),
|
|
|
|
|
+ // message: t('sip.index.998533-47'),
|
|
|
|
|
+ // type: 'error',
|
|
|
|
|
+ // offset: 50,
|
|
|
|
|
+ // duration: 2000,
|
|
|
|
|
+ // })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 处理更新设备项
|
|
// 处理更新设备项
|
|
|
const handleUpdateDeviceItem = (value) => {
|
|
const handleUpdateDeviceItem = (value) => {
|
|
|
- // 实现具体逻辑
|
|
|
|
|
|
|
+ // 实现具体逻辑
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 生命周期钩子
|
|
// 生命周期钩子
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- // 普通用户只能查看自己的通道
|
|
|
|
|
- // if (store.state.user.roles.indexOf('general') === -1) {
|
|
|
|
|
- // isGeneralUser.value = false
|
|
|
|
|
- // }
|
|
|
|
|
- getList()
|
|
|
|
|
- // getDeviceList()
|
|
|
|
|
- // getSceneListDatas()
|
|
|
|
|
|
|
+ // 普通用户只能查看自己的通道
|
|
|
|
|
+ // if (store.state.user.roles.indexOf('general') === -1) {
|
|
|
|
|
+ // isGeneralUser.value = false
|
|
|
|
|
+ // }
|
|
|
|
|
+ getList()
|
|
|
|
|
+ // getDeviceList()
|
|
|
|
|
+ // getSceneListDatas()
|
|
|
})
|
|
})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
.createNum {
|
|
.createNum {
|
|
|
- width: 300px;
|
|
|
|
|
|
|
+ width: 300px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.createNum input {
|
|
.createNum input {
|
|
|
- width: 260px;
|
|
|
|
|
|
|
+ width: 260px;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+</style>
|