|
@@ -1,165 +1,172 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <Dialog v-model="dialogVisible" :title="t('route.InspectionRoute')" style="width: 1300px; min-height: 600px">
|
|
|
|
|
- <ContentWrap>
|
|
|
|
|
|
|
+ <Dialog
|
|
|
|
|
+ v-model="dialogVisible"
|
|
|
|
|
+ :title="t('route.SelectInspectionDevice')"
|
|
|
|
|
+ width="min(1280px, 94vw)"
|
|
|
|
|
+ class="inspect-route-select-dialog"
|
|
|
|
|
+ @close="handleClose">
|
|
|
|
|
+ <template #title>
|
|
|
|
|
+ <div class="dialog-title mb-4">
|
|
|
|
|
+ <div class="dialog-title__icon"><Icon icon="ep:guide" /></div>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="dialog-title__text">{{ t('route.SelectInspectionDevice') }}</div>
|
|
|
|
|
+ <div class="dialog-title__subtitle">筛选并选择需要加入计划的巡检设备路线</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="dialog-content">
|
|
|
<el-form
|
|
<el-form
|
|
|
- class="-mb-15px"
|
|
|
|
|
- :model="queryParams"
|
|
|
|
|
ref="queryFormRef"
|
|
ref="queryFormRef"
|
|
|
- :inline="true"
|
|
|
|
|
- label-width="68px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-form-item :label="t('monitor.deviceName')" prop="deviceName" style="margin-left: 25px">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.deviceName"
|
|
|
|
|
- :placeholder="t('iotDevice.nameHolder')"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
- class="!w-220px"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('iotDevice.code')" prop="deviceCode">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.deviceCode"
|
|
|
|
|
- :placeholder="t('iotDevice.codeHolder')"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
- class="!w-220px"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('route.RouteName')" prop="routeName">
|
|
|
|
|
- <el-input
|
|
|
|
|
- v-model="queryParams.routeName"
|
|
|
|
|
- :placeholder="t('route.nHolder')"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter="handleQuery"
|
|
|
|
|
- class="!w-220px"
|
|
|
|
|
- />
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item :label="t('iotDevice.dept')" prop="deptId">
|
|
|
|
|
- <el-tree-select
|
|
|
|
|
- v-model="queryParams.deptId"
|
|
|
|
|
- :data="deptList"
|
|
|
|
|
- :props="defaultProps"
|
|
|
|
|
- check-strictly
|
|
|
|
|
- node-key="id"
|
|
|
|
|
- filterable
|
|
|
|
|
- placeholder="请选择部门"
|
|
|
|
|
- class="!w-220px"
|
|
|
|
|
- />
|
|
|
|
|
- <!-- <el-tree-select-->
|
|
|
|
|
- <!-- v-model="formData.deptId"-->
|
|
|
|
|
- <!-- :data="deptList"-->
|
|
|
|
|
- <!-- :props="defaultProps"-->
|
|
|
|
|
- <!-- check-strictly-->
|
|
|
|
|
- <!-- node-key="id"-->
|
|
|
|
|
- <!-- placeholder="请选择归属部门"-->
|
|
|
|
|
- <!-- />-->
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item>
|
|
|
|
|
- <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> {{ t('chooseMaintain.search') }}</el-button>
|
|
|
|
|
- <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> {{ t('chooseMaintain.reset') }}</el-button>
|
|
|
|
|
- <el-button @click="handleConfirm" type="danger"
|
|
|
|
|
- ><Icon icon="ep:check" class="mr-5px" /> {{ t('chooseMaintain.confirm') }}</el-button
|
|
|
|
|
- >
|
|
|
|
|
-<!-- <el-button @click="toggleAll" type="primary"-->
|
|
|
|
|
-<!-- ><Icon icon="ep:refresh" class="mr-5px" />{{ t('chooseMaintain.selectAll') }}</el-button-->
|
|
|
|
|
-<!-- >-->
|
|
|
|
|
-<!-- <el-button @click="invertSelection" type="info"-->
|
|
|
|
|
-<!-- ><Icon icon="ep:refresh" class="mr-5px" />{{ t('chooseMaintain.cancelAllSelection') }}</el-button-->
|
|
|
|
|
-<!-- >-->
|
|
|
|
|
|
|
+ :model="queryParams"
|
|
|
|
|
+ size="default"
|
|
|
|
|
+ label-width="84px"
|
|
|
|
|
+ class="query-panel">
|
|
|
|
|
+ <div class="query-row">
|
|
|
|
|
+ <el-form-item :label="t('monitor.deviceName')" prop="deviceName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.deviceName"
|
|
|
|
|
+ :placeholder="t('iotDevice.nameHolder')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ class="query-control"
|
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('iotDevice.code')" prop="deviceCode">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.deviceCode"
|
|
|
|
|
+ :placeholder="t('iotDevice.codeHolder')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ class="query-control"
|
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('route.RouteName')" prop="routeName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.routeName"
|
|
|
|
|
+ :placeholder="t('route.nHolder')"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ class="query-control"
|
|
|
|
|
+ @keyup.enter="handleQuery" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item :label="t('iotDevice.dept')" prop="deptId">
|
|
|
|
|
+ <el-tree-select
|
|
|
|
|
+ v-model="queryParams.deptId"
|
|
|
|
|
+ :data="deptList"
|
|
|
|
|
+ :props="defaultProps"
|
|
|
|
|
+ check-strictly
|
|
|
|
|
+ node-key="id"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ clearable
|
|
|
|
|
+ placeholder="请选择部门"
|
|
|
|
|
+ class="query-control" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-form-item class="query-actions">
|
|
|
|
|
+ <el-button type="primary" @click="handleQuery">
|
|
|
|
|
+ <Icon icon="ep:search" class="mr-5px" />{{ t('chooseMaintain.search') }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button @click="resetQuery">
|
|
|
|
|
+ <Icon icon="ep:refresh" class="mr-5px" />{{ t('chooseMaintain.reset') }}
|
|
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
- </ContentWrap>
|
|
|
|
|
- <!-- 新增:已选物料标签区域 -->
|
|
|
|
|
- <ContentWrap v-if="selectedRows.length > 0"
|
|
|
|
|
- style="margin: -10px 0px 10px; padding: 10px 15px; background: #f8fafc; border-radius: 4px; border: 1px solid #ebeef5;">
|
|
|
|
|
- <div style="display: flex; align-items: center; flex-wrap: wrap; gap: 8px;">
|
|
|
|
|
- <div style="font-weight: bold; color: #606266; margin-right: 10px;">已选路线设备:</div>
|
|
|
|
|
- <el-tag
|
|
|
|
|
- v-for="item in selectedRows"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- @close="removeTag(item)"
|
|
|
|
|
- style="margin-bottom: 5px; position: relative; padding-right: 25px;"
|
|
|
|
|
- >
|
|
|
|
|
- {{ item.deviceCode }}-{{ item.routeName }}
|
|
|
|
|
- <!-- 自定义关闭按钮 -->
|
|
|
|
|
- <span class="close-icon" @click.stop="removeTag(item)">
|
|
|
|
|
- <Icon icon="ep:close" style="font-size: 12px; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);"/>
|
|
|
|
|
- </span>
|
|
|
|
|
- </el-tag>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div v-if="selectedRows.length > 0" class="selected-panel">
|
|
|
|
|
+ <div class="selected-panel__label">已选 {{ selectedRows.length }} 条路线</div>
|
|
|
|
|
+ <div class="selected-panel__tags">
|
|
|
|
|
+ <el-tag
|
|
|
|
|
+ v-for="item in selectedRows"
|
|
|
|
|
+ :key="`${item.id}-${item.deviceCode || ''}`"
|
|
|
|
|
+ closable
|
|
|
|
|
+ @close="removeTag(item)">
|
|
|
|
|
+ {{ item.deviceCode }} - {{ item.routeName }}
|
|
|
|
|
+ </el-tag>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <section class="table-section">
|
|
|
|
|
+ <ZmTable
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ :max-height="380"
|
|
|
|
|
+ show-border
|
|
|
|
|
+ settings-cache-key="pms-inspect-plan-route-select"
|
|
|
|
|
+ @row-click="selectRow">
|
|
|
|
|
+ <ZmTableColumn :label="t('workOrderMaterial.select')" :width="64" hide-in-column-settings>
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-checkbox
|
|
|
|
|
+ :model-value="isSelected(row)"
|
|
|
|
|
+ class="no-label-checkbox"
|
|
|
|
|
+ @click.stop="selectRow(row)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ZmTableColumn>
|
|
|
|
|
+ <ZmTableColumn :label="t('iotDevice.code')" prop="deviceCode" />
|
|
|
|
|
+ <ZmTableColumn :label="t('iotDevice.name')" prop="deviceName" />
|
|
|
|
|
+ <ZmTableColumn :label="t('route.RouteName')" prop="routeName" />
|
|
|
|
|
+ <ZmTableColumn :label="t('iotDevice.dept')" prop="deptName" />
|
|
|
|
|
+ <ZmTableColumn
|
|
|
|
|
+ :label="t('common.createTime')"
|
|
|
|
|
+ prop="createTime"
|
|
|
|
|
+ :formatter="dateFormatter" />
|
|
|
|
|
+ <ZmTableColumn :label="t('operationFill.operation')" hide-in-column-settings>
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button link type="primary" @click.stop="viewRoute(scope.row.itemJson)">
|
|
|
|
|
+ <Icon icon="ep:view" class="mr-5px" />{{ t('operationFill.view') }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </ZmTableColumn>
|
|
|
|
|
+ </ZmTable>
|
|
|
|
|
+ <Pagination
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ v-model:page="queryParams.pageNo"
|
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
|
+ @pagination="getList" />
|
|
|
|
|
+ </section>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <span class="selection-summary">已选择 {{ selectedRows.length }} 条路线</span>
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-button size="default" @click="dialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button size="default" type="primary" @click="handleConfirm">
|
|
|
|
|
+ <Icon icon="ep:check" class="mr-5px" />{{ t('chooseMaintain.confirm') }}
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </ContentWrap>
|
|
|
|
|
- <ContentWrap>
|
|
|
|
|
- <el-table
|
|
|
|
|
- ref="tableRef"
|
|
|
|
|
- v-loading="loading"
|
|
|
|
|
- :data="list"
|
|
|
|
|
- :stripe="true"
|
|
|
|
|
- :row-key="rowKey"
|
|
|
|
|
- :show-overflow-tooltip="true"
|
|
|
|
|
- table-layout="auto"
|
|
|
|
|
- @row-click="handleRowClick"
|
|
|
|
|
- class="full-width-table" >
|
|
|
|
|
- <el-table-column width="80" :label="t('workOrderMaterial.select')">
|
|
|
|
|
- <template #default="{ row }">
|
|
|
|
|
- <el-checkbox
|
|
|
|
|
- :model-value="selectedRows.some(item => item.id === row.id&&item.deviceCode===row.deviceCode)"
|
|
|
|
|
- @click.stop="selectRow(row)"
|
|
|
|
|
- class="no-label-radio"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column :label="t('iotDevice.code')" align="center" prop="deviceCode" />
|
|
|
|
|
- <el-table-column :label="t('iotDevice.name')" align="center" prop="deviceName" />
|
|
|
|
|
- <el-table-column :label="t('route.RouteName')" align="center" prop="routeName" />
|
|
|
|
|
- <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" />
|
|
|
|
|
- <el-table-column
|
|
|
|
|
- :label="t('common.createTime')"
|
|
|
|
|
- align="center"
|
|
|
|
|
- prop="createTime"
|
|
|
|
|
- width="180"
|
|
|
|
|
- :formatter="dateFormatter"
|
|
|
|
|
- />
|
|
|
|
|
- <el-table-column :label="t('operationFill.operation')" align="center">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <el-button link type="primary" @click="viewRoute(scope.row.itemJson)">
|
|
|
|
|
- {{ t('operationFill.view') }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- <!-- 分页 -->
|
|
|
|
|
- <Pagination
|
|
|
|
|
- :total="total"
|
|
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
|
|
- @pagination="getList"
|
|
|
|
|
- />
|
|
|
|
|
- <RouteInspectItemDrawer
|
|
|
|
|
- ref="showDrawer"
|
|
|
|
|
- :model-value="drawerVisible"
|
|
|
|
|
- @update:model-value="(val) => (drawerVisible = val)"
|
|
|
|
|
- />
|
|
|
|
|
- </ContentWrap>
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+
|
|
|
|
|
+ <RouteInspectItemDrawer
|
|
|
|
|
+ ref="showDrawer"
|
|
|
|
|
+ :model-value="drawerVisible"
|
|
|
|
|
+ @update:model-value="(val) => (drawerVisible = val)" />
|
|
|
</Dialog>
|
|
</Dialog>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { IotDeviceVO } from '@/api/pms/device'
|
|
import { IotDeviceVO } from '@/api/pms/device'
|
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
import { dateFormatter } from '@/utils/formatTime'
|
|
|
-import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
|
|
|
|
|
import { IotInspectRouteApi } from '@/api/pms/inspect/route'
|
|
import { IotInspectRouteApi } from '@/api/pms/inspect/route'
|
|
|
-import { IotInspectItemVO } from '@/api/pms/inspect/item'
|
|
|
|
|
-import RouteInspectItemDrawer from "@/views/pms/inspect/plan/RouteInspectItemDrawer.vue";
|
|
|
|
|
-import {ref} from "vue";
|
|
|
|
|
-import {defaultProps, handleTree} from "@/utils/tree";
|
|
|
|
|
-import * as DeptApi from "@/api/system/dept";
|
|
|
|
|
|
|
+import RouteInspectItemDrawer from '@/views/pms/inspect/plan/RouteInspectItemDrawer.vue'
|
|
|
|
|
+import { defaultProps, handleTree } from '@/utils/tree'
|
|
|
|
|
+import * as DeptApi from '@/api/system/dept'
|
|
|
|
|
+import { useTableComponents } from '@/components/ZmTable/useTableComponents'
|
|
|
|
|
+
|
|
|
|
|
+type InspectRouteDeviceRow = IotDeviceVO & {
|
|
|
|
|
+ routeName: string
|
|
|
|
|
+ itemJson: string
|
|
|
|
|
+ createTime: string
|
|
|
|
|
+ deviceId: number
|
|
|
|
|
+ item?: string
|
|
|
|
|
+ standard?: string
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const { ZmTable, ZmTableColumn } = useTableComponents<InspectRouteDeviceRow>()
|
|
|
const { t } = useI18n() // 国际化
|
|
const { t } = useI18n() // 国际化
|
|
|
const emit = defineEmits(['choose']) // 定义 success 事件,用于操作成功后的回调
|
|
const emit = defineEmits(['choose']) // 定义 success 事件,用于操作成功后的回调
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
|
|
const loading = ref(true) // 列表的加载中
|
|
const loading = ref(true) // 列表的加载中
|
|
|
const queryFormRef = ref() // 搜索的表单
|
|
const queryFormRef = ref() // 搜索的表单
|
|
|
-const list = ref<IotDeviceVO[]>([]) // 列表的数据
|
|
|
|
|
|
|
+const list = ref<InspectRouteDeviceRow[]>([]) // 列表的数据
|
|
|
const total = ref(0) // 列表的总页数
|
|
const total = ref(0) // 列表的总页数
|
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
const deptList = ref<Tree[]>([]) // 树形结构
|
|
|
const drawerVisible = ref<boolean>(false)
|
|
const drawerVisible = ref<boolean>(false)
|
|
@@ -173,38 +180,34 @@ const queryParams = reactive({
|
|
|
assetClass: undefined,
|
|
assetClass: undefined,
|
|
|
deviceName: undefined,
|
|
deviceName: undefined,
|
|
|
deviceCode: undefined,
|
|
deviceCode: undefined,
|
|
|
- routeName: undefined,
|
|
|
|
|
|
|
+ routeName: undefined
|
|
|
})
|
|
})
|
|
|
-// 生成行唯一标识
|
|
|
|
|
-const rowKey = (row: any) => {
|
|
|
|
|
- return `${row.id}`; // 确保行更新时重新渲染
|
|
|
|
|
-};
|
|
|
|
|
-// 处理单选逻辑
|
|
|
|
|
-const selectRow = (row) => {
|
|
|
|
|
- const index = selectedRows.value.findIndex(item => item.id === row.id&&item.deviceCode===row.deviceCode);
|
|
|
|
|
|
|
+
|
|
|
|
|
+const selectedRows = ref<InspectRouteDeviceRow[]>([])
|
|
|
|
|
+
|
|
|
|
|
+const isSelected = (row: InspectRouteDeviceRow) =>
|
|
|
|
|
+ selectedRows.value.some((item) => item.id === row.id && item.deviceCode === row.deviceCode)
|
|
|
|
|
+
|
|
|
|
|
+const selectRow = (row: InspectRouteDeviceRow) => {
|
|
|
|
|
+ const index = selectedRows.value.findIndex(
|
|
|
|
|
+ (item) => item.id === row.id && item.deviceCode === row.deviceCode
|
|
|
|
|
+ )
|
|
|
if (index > -1) {
|
|
if (index > -1) {
|
|
|
- selectedRows.value.splice(index, 1); // 取消选中
|
|
|
|
|
- // row.quantity = undefined;
|
|
|
|
|
|
|
+ selectedRows.value.splice(index, 1)
|
|
|
} else {
|
|
} else {
|
|
|
- selectedRows.value.push({ ...row }); // 选中
|
|
|
|
|
|
|
+ selectedRows.value.push({ ...row })
|
|
|
}
|
|
}
|
|
|
-};
|
|
|
|
|
-// 新增:移除标签方法
|
|
|
|
|
-const removeTag = (route) => {
|
|
|
|
|
- // 从已选列表中移除
|
|
|
|
|
- const index = selectedRows.value.findIndex(item => item.id === route.id&&item.deviceCode === route.deviceCode);
|
|
|
|
|
- debugger
|
|
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const removeTag = (route: InspectRouteDeviceRow) => {
|
|
|
|
|
+ const index = selectedRows.value.findIndex(
|
|
|
|
|
+ (item) => item.id === route.id && item.deviceCode === route.deviceCode
|
|
|
|
|
+ )
|
|
|
if (index !== -1) {
|
|
if (index !== -1) {
|
|
|
- selectedRows.value.splice(index, 1);
|
|
|
|
|
|
|
+ selectedRows.value.splice(index, 1)
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- // 如果当前行在当前页,取消其选中状态
|
|
|
|
|
- const rowInTable = list.value.find(item => item.id === route.id&&item.deviceCode === route.deviceCode);
|
|
|
|
|
- if (rowInTable) {
|
|
|
|
|
- const rowIndex = list.value.indexOf(rowInTable);
|
|
|
|
|
- // 这里可以添加逻辑强制更新行状态(如果需要)
|
|
|
|
|
- }
|
|
|
|
|
-};
|
|
|
|
|
const handleConfirm = () => {
|
|
const handleConfirm = () => {
|
|
|
if (selectedRows.value.length === 0) {
|
|
if (selectedRows.value.length === 0) {
|
|
|
ElMessage.warning('请至少选择一个')
|
|
ElMessage.warning('请至少选择一个')
|
|
@@ -215,60 +218,22 @@ const handleConfirm = () => {
|
|
|
'choose',
|
|
'choose',
|
|
|
selectedRows.value.map((row) => ({
|
|
selectedRows.value.map((row) => ({
|
|
|
...row,
|
|
...row,
|
|
|
- // 确保返回必要字段
|
|
|
|
|
code: row.item,
|
|
code: row.item,
|
|
|
name: row.standard
|
|
name: row.standard
|
|
|
}))
|
|
}))
|
|
|
)
|
|
)
|
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
- handleClose()
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 关闭时清空选择
|
|
|
|
|
const handleClose = () => {
|
|
const handleClose = () => {
|
|
|
- tableRef.value?.clearSelection()
|
|
|
|
|
selectedRows.value = []
|
|
selectedRows.value = []
|
|
|
emit('close')
|
|
emit('close')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const viewRoute = (itemJson) => {
|
|
const viewRoute = (itemJson) => {
|
|
|
drawerVisible.value = true
|
|
drawerVisible.value = true
|
|
|
showDrawer.value.openDrawer(JSON.parse(itemJson))
|
|
showDrawer.value.openDrawer(JSON.parse(itemJson))
|
|
|
}
|
|
}
|
|
|
-const toggleAll = () => {
|
|
|
|
|
- list.value.forEach((row) => {
|
|
|
|
|
- tableRef.value.toggleRowSelection(row, true)
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-const handleSelectionChange = (val) => {
|
|
|
|
|
- selectedRows.value = val
|
|
|
|
|
-}
|
|
|
|
|
-const invertSelection = () => {
|
|
|
|
|
- selectedRows.value.forEach((row) => {
|
|
|
|
|
- tableRef.value.toggleRowSelection(row, false)
|
|
|
|
|
- selectedRows.value.splice(row)
|
|
|
|
|
- })
|
|
|
|
|
-}
|
|
|
|
|
-const selectedRows = ref<IotInspectItemVO[]>([]) // 多选数据(存储所有选中行的数组)
|
|
|
|
|
-const tableRef = ref()
|
|
|
|
|
-
|
|
|
|
|
-// 多选 切换行选中状态
|
|
|
|
|
-const toggleRow = (row) => {
|
|
|
|
|
- const includes = selectedRows.value.includes(row)
|
|
|
|
|
- if (includes) {
|
|
|
|
|
- selectedRows.value.splice(row)
|
|
|
|
|
- } else {
|
|
|
|
|
- selectedRows.value.push(row) // 选中
|
|
|
|
|
- }
|
|
|
|
|
- tableRef.value.toggleRowSelection(row, !includes)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// 点击整行选中
|
|
|
|
|
-const handleRowClick = (row) => {
|
|
|
|
|
- toggleRow(row)
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
|
|
const open = async (classify) => {
|
|
const open = async (classify) => {
|
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
@@ -280,7 +245,7 @@ const open = async (classify) => {
|
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
|
|
}
|
|
}
|
|
|
defineExpose({ open })
|
|
defineExpose({ open })
|
|
|
-const { wsCache } = useCache()
|
|
|
|
|
|
|
+
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
list.value = []
|
|
list.value = []
|
|
@@ -298,21 +263,188 @@ const handleQuery = () => {
|
|
|
queryParams.pageNo = 1
|
|
queryParams.pageNo = 1
|
|
|
getList()
|
|
getList()
|
|
|
}
|
|
}
|
|
|
-const choose = (row: DictDataVO) => {
|
|
|
|
|
- emit('choose', row)
|
|
|
|
|
- dialogVisible.value = false
|
|
|
|
|
-}
|
|
|
|
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
/** 重置按钮操作 */
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
- queryFormRef.value.resetFields()
|
|
|
|
|
|
|
+ queryFormRef.value?.resetFields()
|
|
|
handleQuery()
|
|
handleQuery()
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
-<style lang="scss">
|
|
|
|
|
-.no-label-radio .el-radio__label {
|
|
|
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
|
+@media (width <= 1400px) {
|
|
|
|
|
+ .inspect-route-select-dialog .query-row {
|
|
|
|
|
+ grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+@media (width <= 768px) {
|
|
|
|
|
+ .inspect-route-select-dialog .dialog-title__subtitle {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .inspect-route-select-dialog .query-panel,
|
|
|
|
|
+ .inspect-route-select-dialog .query-row,
|
|
|
|
|
+ .inspect-route-select-dialog .query-actions,
|
|
|
|
|
+ .inspect-route-select-dialog .query-control {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .inspect-route-select-dialog .query-row {
|
|
|
|
|
+ grid-template-columns: minmax(0, 1fr);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .inspect-route-select-dialog .query-actions :deep(.el-form-item__content) {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .inspect-route-select-dialog .query-actions :deep(.el-button) {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .inspect-route-select-dialog .selected-panel {
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: flex-start;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-title {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-title__icon {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ width: 38px;
|
|
|
|
|
+ height: 38px;
|
|
|
|
|
+ margin-right: 12px;
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ color: var(--el-color-primary);
|
|
|
|
|
+ background: var(--el-color-primary-light-9);
|
|
|
|
|
+ border: 1px solid var(--el-color-primary-light-7);
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-title__text {
|
|
|
|
|
+ font-size: 17px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ line-height: 24px;
|
|
|
|
|
+ color: var(--el-text-color-primary);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-title__subtitle {
|
|
|
|
|
+ margin-top: 1px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ line-height: 18px;
|
|
|
|
|
+ color: var(--el-text-color-secondary);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.dialog-content {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+ padding-top: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-panel {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ padding: 12px 16px;
|
|
|
|
|
+ background: var(--el-fill-color-extra-light);
|
|
|
|
|
+ border: 1px solid var(--el-border-color-lighter);
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ gap: 12px 20px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-row {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ flex: 1 1 880px;
|
|
|
|
|
+ gap: 12px 16px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-actions {
|
|
|
|
|
+ flex: 0 0 auto;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-actions :deep(.el-form-item__content) {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-actions :deep(.el-button) {
|
|
|
|
|
+ margin-left: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-control {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-panel :deep(.el-form-item) {
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.query-panel :deep(.el-form-item__label) {
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-panel {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 10px 14px;
|
|
|
|
|
+ background: var(--el-color-primary-light-9);
|
|
|
|
|
+ border: 1px solid var(--el-color-primary-light-8);
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ gap: 12px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-panel__label {
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: var(--el-color-primary);
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ flex: 0 0 auto;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selected-panel__tags {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ transform: translateY(1.5px);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.table-section {
|
|
|
|
|
+ padding: 12px 12px 0;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ border: 1px solid var(--el-border-color-lighter);
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.table-section :deep(.pagination-container) {
|
|
|
|
|
+ padding: 12px 8px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.no-label-checkbox :deep(.el-checkbox__label) {
|
|
|
display: none;
|
|
display: none;
|
|
|
}
|
|
}
|
|
|
-.no-label-radio .el-radio__inner {
|
|
|
|
|
- margin-right: 0;
|
|
|
|
|
|
|
+
|
|
|
|
|
+.dialog-footer {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.selection-summary {
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ color: var(--el-text-color-secondary);
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|