|
@@ -1,175 +1,184 @@
|
|
<template>
|
|
<template>
|
|
- <ContentWrap>
|
|
|
|
- <!-- 搜索工作栏 -->
|
|
|
|
- <el-form
|
|
|
|
- class="-mb-15px"
|
|
|
|
- :model="queryParams"
|
|
|
|
- ref="queryFormRef"
|
|
|
|
- :inline="true"
|
|
|
|
- label-width="68px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="资产编码" prop="deviceCode">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.deviceCode"
|
|
|
|
- placeholder="请输入资产编码"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-200px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="设备名称" prop="deviceName">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.deviceName"
|
|
|
|
- placeholder="请输入设备名称"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-200px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="品牌" prop="brand">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.brand"
|
|
|
|
- placeholder="请输入品牌"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-200px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <!-- 左侧部门树 -->
|
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
|
+ <ContentWrap class="h-1/1">
|
|
|
|
+ <DeptTree @node-click="handleDeptNodeClick" />
|
|
|
|
+ </ContentWrap>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="20" :xs="24">
|
|
|
|
+ <ContentWrap>
|
|
|
|
+ <!-- 搜索工作栏 -->
|
|
|
|
+ <el-form
|
|
|
|
+ class="-mb-15px"
|
|
|
|
+ :model="queryParams"
|
|
|
|
+ ref="queryFormRef"
|
|
|
|
+ :inline="true"
|
|
|
|
+ label-width="68px"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="资产编码" prop="deviceCode">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.deviceCode"
|
|
|
|
+ placeholder="请输入资产编码"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-200px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="设备名称" prop="deviceName">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.deviceName"
|
|
|
|
+ placeholder="请输入设备名称"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-200px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="品牌" prop="brand">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.brand"
|
|
|
|
+ placeholder="请输入品牌"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-200px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
|
|
|
|
- <el-form-item v-show="ifShow" label="设备状态" prop="deviceStatus">
|
|
|
|
- <el-select
|
|
|
|
- v-model="queryParams.deviceStatus"
|
|
|
|
- placeholder="设备状态"
|
|
|
|
- clearable
|
|
|
|
- class="!w-240px"
|
|
|
|
- >
|
|
|
|
- <el-option
|
|
|
|
- v-for="dict in getIntDictOptions(DICT_TYPE.PMS_DEVICE_STATUS)"
|
|
|
|
- :key="dict.id"
|
|
|
|
- :label="dict.label"
|
|
|
|
- :value="dict.value"
|
|
|
|
- />
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item v-show="ifShow" label="设备状态" prop="deviceStatus">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="queryParams.deviceStatus"
|
|
|
|
+ placeholder="设备状态"
|
|
|
|
+ clearable
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in getIntDictOptions(DICT_TYPE.PMS_DEVICE_STATUS)"
|
|
|
|
+ :key="dict.id"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
- <el-form-item v-show="ifShow" label="资产性质" prop="assetProperty">
|
|
|
|
- <el-input
|
|
|
|
- v-model="queryParams.assetProperty"
|
|
|
|
- placeholder="请输入资产性质"
|
|
|
|
- clearable
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
- class="!w-200px"
|
|
|
|
- />
|
|
|
|
- </el-form-item>
|
|
|
|
|
|
+ <el-form-item v-show="ifShow" label="资产性质" prop="assetProperty">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="queryParams.assetProperty"
|
|
|
|
+ placeholder="请输入资产性质"
|
|
|
|
+ clearable
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
+ class="!w-200px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
|
|
|
|
|
|
- <el-form-item>
|
|
|
|
- <el-button v-if="!ifShow" @click="moreQuery(true)" type="warning"><Icon icon="ep:search" class="mr-5px"/> 更多查询</el-button>
|
|
|
|
- <el-button v-if="ifShow" @click="moreQuery(false)" type="danger"><Icon icon="ep:search" class="mr-5px"/> 收起查询</el-button>
|
|
|
|
- <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="['rq:iot-device:create']"
|
|
|
|
- >
|
|
|
|
- <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- type="success"
|
|
|
|
- plain
|
|
|
|
- @click="handleExport"
|
|
|
|
- :loading="exportLoading"
|
|
|
|
- v-hasPermi="['rq:iot-device:export']"
|
|
|
|
- >
|
|
|
|
- <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
- </el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- </ContentWrap>
|
|
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button v-if="!ifShow" @click="moreQuery(true)" type="warning"><Icon icon="ep:search" class="mr-5px"/> 更多查询</el-button>
|
|
|
|
+ <el-button v-if="ifShow" @click="moreQuery(false)" type="danger"><Icon icon="ep:search" class="mr-5px"/> 收起查询</el-button>
|
|
|
|
+ <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',undefined,queryParams.deptId)"
|
|
|
|
+ v-hasPermi="['rq:iot-device:create']"
|
|
|
|
+ >
|
|
|
|
+ <Icon icon="ep:plus" class="mr-5px" /> 新增
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ type="success"
|
|
|
|
+ plain
|
|
|
|
+ @click="handleExport"
|
|
|
|
+ :loading="exportLoading"
|
|
|
|
+ v-hasPermi="['rq:iot-device:export']"
|
|
|
|
+ >
|
|
|
|
+ <Icon icon="ep:download" class="mr-5px" /> 导出
|
|
|
|
+ </el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </ContentWrap>
|
|
|
|
|
|
- <!-- 列表 -->
|
|
|
|
- <ContentWrap>
|
|
|
|
- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
- <el-table-column label="资产编码" align="center" prop="deviceCode" />
|
|
|
|
- <el-table-column label="设备名称" align="center" prop="deviceName" >
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-link :underline="false" type="primary" @click="handleDetail(scope.row.id)">
|
|
|
|
- {{ scope.row.deviceName }}
|
|
|
|
- </el-link>
|
|
|
|
- </template>
|
|
|
|
-<!-- <template #default="{ row }">-->
|
|
|
|
-<!-- <div class="custom-cell">{{ row.deviceName }}</div>-->
|
|
|
|
-<!-- </template>-->
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="所在部门" align="center" prop="deptName" />
|
|
|
|
- <el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="资产性质" align="center" prop="assetProperty">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <dict-tag :type="DICT_TYPE.PMS_ASSET_PROPERTY" :value="scope.row.assetProperty" />
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-form-item label="创建时间" prop="createTime">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="queryParams.createTime"
|
|
|
|
- value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
- type="daterange"
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
- :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
|
- class="!w-240px"
|
|
|
|
|
|
+ <!-- 列表 -->
|
|
|
|
+ <ContentWrap>
|
|
|
|
+ <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
+ <el-table-column label="资产编码" align="center" prop="deviceCode" />
|
|
|
|
+ <el-table-column label="设备名称" align="center" prop="deviceName" >
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-link :underline="false" type="primary" @click="handleDetail(scope.row.id)">
|
|
|
|
+ {{ scope.row.deviceName }}
|
|
|
|
+ </el-link>
|
|
|
|
+ </template>
|
|
|
|
+ <!-- <template #default="{ row }">-->
|
|
|
|
+ <!-- <div class="custom-cell">{{ row.deviceName }}</div>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="所在部门" align="center" prop="deptName" />
|
|
|
|
+ <el-table-column label="设备状态" align="center" prop="deviceStatus">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.PMS_DEVICE_STATUS" :value="scope.row.deviceStatus" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="资产性质" align="center" prop="assetProperty">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <dict-tag :type="DICT_TYPE.PMS_ASSET_PROPERTY" :value="scope.row.assetProperty" />
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-form-item label="创建时间" prop="createTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="queryParams.createTime"
|
|
|
|
+ value-format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
+ type="daterange"
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
+ :default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
|
|
|
+ class="!w-240px"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-table-column
|
|
|
|
+ label="创建时间"
|
|
|
|
+ align="center"
|
|
|
|
+ prop="createTime"
|
|
|
|
+ :formatter="dateFormatter"
|
|
|
|
+ width="180px"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column label="操作" align="center" min-width="120px">
|
|
|
|
+ <template #default="scope">
|
|
|
|
+ <el-button
|
|
|
|
+ link
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="openForm('update', scope.row.id)"
|
|
|
|
+ v-hasPermi="['rq:iot-device:update']"
|
|
|
|
+ >
|
|
|
|
+ 编辑
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ link
|
|
|
|
+ type="danger"
|
|
|
|
+ @click="handleDelete(scope.row.id)"
|
|
|
|
+ v-hasPermi="['rq:iot-device:delete']"
|
|
|
|
+ >
|
|
|
|
+ 删除
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ link
|
|
|
|
+ type="warning"
|
|
|
|
+ @click="handleUpload(scope.row.id)"
|
|
|
|
+ >
|
|
|
|
+ 资料上传
|
|
|
|
+ </el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <!-- 分页 -->
|
|
|
|
+ <Pagination
|
|
|
|
+ :total="total"
|
|
|
|
+ v-model:page="queryParams.pageNo"
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
+ @pagination="getList"
|
|
/>
|
|
/>
|
|
- </el-form-item>
|
|
|
|
- <el-table-column
|
|
|
|
- label="创建时间"
|
|
|
|
- align="center"
|
|
|
|
- prop="createTime"
|
|
|
|
- :formatter="dateFormatter"
|
|
|
|
- width="180px"
|
|
|
|
- />
|
|
|
|
- <el-table-column label="操作" align="center" min-width="120px">
|
|
|
|
- <template #default="scope">
|
|
|
|
- <el-button
|
|
|
|
- link
|
|
|
|
- type="primary"
|
|
|
|
- @click="openForm('update', scope.row.id)"
|
|
|
|
- v-hasPermi="['rq:iot-device:update']"
|
|
|
|
- >
|
|
|
|
- 编辑
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- link
|
|
|
|
- type="danger"
|
|
|
|
- @click="handleDelete(scope.row.id)"
|
|
|
|
- v-hasPermi="['rq:iot-device:delete']"
|
|
|
|
- >
|
|
|
|
- 删除
|
|
|
|
- </el-button>
|
|
|
|
- <el-button
|
|
|
|
- link
|
|
|
|
- type="warning"
|
|
|
|
- @click="handleUpload(scope.row.id)"
|
|
|
|
- >
|
|
|
|
- 资料上传
|
|
|
|
- </el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
- <!-- 分页 -->
|
|
|
|
- <Pagination
|
|
|
|
- :total="total"
|
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
|
- @pagination="getList"
|
|
|
|
- />
|
|
|
|
- </ContentWrap>
|
|
|
|
-
|
|
|
|
|
|
+ </ContentWrap>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
<!-- 表单弹窗:添加/修改 -->
|
|
<!-- <IotDeviceForm ref="formRef" @success="getList" />-->
|
|
<!-- <IotDeviceForm ref="formRef" @success="getList" />-->
|
|
</template>
|
|
</template>
|
|
@@ -180,6 +189,9 @@ import { IotDeviceApi, IotDeviceVO } from '@/api/pms/device'
|
|
import IotDeviceForm from './IotDeviceForm.vue'
|
|
import IotDeviceForm from './IotDeviceForm.vue'
|
|
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
|
import {DICT_TYPE, getIntDictOptions} from "@/utils/dict";
|
|
import {dateFormatter} from "@/utils/formatTime";
|
|
import {dateFormatter} from "@/utils/formatTime";
|
|
|
|
+import PmsTree from "@/views/system/tree/PmsTree.vue";
|
|
|
|
+import DeptTree from "@/views/system/user/DeptTree.vue";
|
|
|
|
+import {CACHE_KEY, useCache} from "@/hooks/web/useCache";
|
|
|
|
|
|
/** 设备台账 列表 */
|
|
/** 设备台账 列表 */
|
|
defineOptions({ name: 'IotDevicePms' })
|
|
defineOptions({ name: 'IotDevicePms' })
|
|
@@ -200,7 +212,7 @@ const queryParams = reactive({
|
|
deviceName: undefined,
|
|
deviceName: undefined,
|
|
brand: undefined,
|
|
brand: undefined,
|
|
model: undefined,
|
|
model: undefined,
|
|
- orgId: undefined,
|
|
|
|
|
|
+ deptId: undefined,
|
|
deviceStatus: undefined,
|
|
deviceStatus: undefined,
|
|
assetProperty: undefined,
|
|
assetProperty: undefined,
|
|
picUrl: undefined,
|
|
picUrl: undefined,
|
|
@@ -223,6 +235,7 @@ const queryParams = reactive({
|
|
infoRemark: undefined,
|
|
infoRemark: undefined,
|
|
infoUrl: undefined,
|
|
infoUrl: undefined,
|
|
templateJson: undefined,
|
|
templateJson: undefined,
|
|
|
|
+ creator: undefined
|
|
})
|
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
const exportLoading = ref(false) // 导出的加载中
|
|
@@ -239,6 +252,12 @@ const getList = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** 处理部门被点击 */
|
|
|
|
+const handleDeptNodeClick = async (row) => {
|
|
|
|
+ queryParams.deptId = row.id
|
|
|
|
+ await getList()
|
|
|
|
+}
|
|
|
|
+
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
queryParams.pageNo = 1
|
|
queryParams.pageNo = 1
|
|
@@ -257,6 +276,7 @@ const resetQuery = () => {
|
|
const formRef = ref()
|
|
const formRef = ref()
|
|
const openForm = (type: string, id?: number) => {
|
|
const openForm = (type: string, id?: number) => {
|
|
//修改
|
|
//修改
|
|
|
|
+ debugger
|
|
if (typeof id === 'number') {
|
|
if (typeof id === 'number') {
|
|
push({ name: 'DeviceDetailEdit', params: {id } })
|
|
push({ name: 'DeviceDetailEdit', params: {id } })
|
|
return
|
|
return
|
|
@@ -300,9 +320,13 @@ const handleExport = async () => {
|
|
exportLoading.value = false
|
|
exportLoading.value = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+const { wsCache } = useCache()
|
|
/** 初始化 **/
|
|
/** 初始化 **/
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
|
+ const user = wsCache.get(CACHE_KEY.USER)
|
|
|
|
+ console.log(JSON.stringify(user))
|
|
|
|
+ queryParams.deptId = user.user.deptId
|
|
|
|
+ debugger
|
|
getList()
|
|
getList()
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|