|
@@ -3,10 +3,12 @@
|
|
|
<div class="gasReport">
|
|
|
<customHeader>瓦斯巡检任务管理</customHeader>
|
|
|
<div class="report-container">
|
|
|
- <a-space class="search-area">
|
|
|
- <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleEdit">新增任务</a-button>
|
|
|
- </a-space>
|
|
|
<BasicTable @register="registerTable1">
|
|
|
+ <template #tableTitle>
|
|
|
+ <a-space>
|
|
|
+ <a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleEdit">新增任务</a-button>
|
|
|
+ </a-space>
|
|
|
+ </template>
|
|
|
<template #action="{ record }">
|
|
|
<a class="table-action-link" @click="handleManage(record)">管理</a>
|
|
|
<a class="table-action-link" @click="handleDetail(record)">详情</a>
|
|
@@ -84,16 +86,46 @@
|
|
|
import { deleteTeam, getManageTasklist, operateGasCheckTaskDetail, taskDetailsList, teamAdd, teamEdit, teamList } from './gasInspect.api';
|
|
|
import { BasicTable } from '/@/components/Table';
|
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
- import { message } from 'ant-design-vue';
|
|
|
+ import { Modal, message } from 'ant-design-vue';
|
|
|
import { BasicModal, useModal } from '/@/components/Modal';
|
|
|
import { BasicForm, useForm } from '/@/components/Form';
|
|
|
+ import { getAutoScrollContainer } from '/@/utils/common/compUtils';
|
|
|
|
|
|
// 任务列表
|
|
|
+ const searchParams1 = ref<any>({ deviceName: '' });
|
|
|
const { tableContext: tx1 } = useListPage({
|
|
|
tableProps: {
|
|
|
api: teamList,
|
|
|
+ beforeFetch: (params) => {
|
|
|
+ Object.assign(params, searchParams1.value);
|
|
|
+ },
|
|
|
columns: taskColumns,
|
|
|
pagination,
|
|
|
+ formConfig: {
|
|
|
+ labelAlign: 'left',
|
|
|
+ labelWidth: 80,
|
|
|
+ compact: true,
|
|
|
+ schemas: [
|
|
|
+ {
|
|
|
+ label: '日期',
|
|
|
+ field: 'createTime',
|
|
|
+ component: 'DatePicker',
|
|
|
+ componentProps: {
|
|
|
+ showTime: false,
|
|
|
+ valueFormat: 'YYYY-MM-DD',
|
|
|
+ getPopupContainer: getAutoScrollContainer,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属区队',
|
|
|
+ field: 'districtTeam',
|
|
|
+ component: 'JDictSelectTag',
|
|
|
+ componentProps: {
|
|
|
+ dictCode: 'districtTeam',
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
actionColumn: {
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
@@ -102,7 +134,7 @@
|
|
|
slots: { customRender: 'action' },
|
|
|
},
|
|
|
showTableSetting: false,
|
|
|
- useSearchForm: false,
|
|
|
+ useSearchForm: true,
|
|
|
},
|
|
|
pagination: true,
|
|
|
});
|
|
@@ -205,9 +237,43 @@
|
|
|
|
|
|
// 关联明细
|
|
|
function handlePatch(mode) {
|
|
|
+ // 过滤已选择条目,关联至其他任务的已经无法选中所以不做处理,关联至本任务的无法再添加,未关联的无法删除
|
|
|
+ const addedRows = selectedRows.value.filter((e) => {
|
|
|
+ return e.isSelect === true;
|
|
|
+ });
|
|
|
+ const otherRows = selectedRows.value.filter((e) => {
|
|
|
+ return e.isSelect === false;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (mode === 'add' && addedRows.length) {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认',
|
|
|
+ content: '您选择的条目含有已关联项,是否继续添加其他未关联项?',
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk() {
|
|
|
+ patchConfirmHandler(otherRows, mode);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else if (mode === 'del' && otherRows.length) {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '确认',
|
|
|
+ content: '您选择的条目含有未关联项,是否继续删除其他已关联项?',
|
|
|
+ okText: '确认',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk() {
|
|
|
+ patchConfirmHandler(addedRows, mode);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ patchConfirmHandler(selectedRows.value, mode);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function patchConfirmHandler(rows, mode) {
|
|
|
operateGasCheckTaskDetail({
|
|
|
taskId: selectedRow.value.id,
|
|
|
- operateList: selectedRows.value.map((e) => {
|
|
|
+ operateList: rows.map((e) => {
|
|
|
return {
|
|
|
deviceId: e.deviceId, //设备id(巡检地址id)
|
|
|
checkNum: e.checkNum, //巡检次数
|
|
@@ -242,12 +308,15 @@
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
+ @import '/@/design/theme.less';
|
|
|
+
|
|
|
.gasReport {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
padding: 80px 10px 15px 10px;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
+ color: var(--vent-font-color);
|
|
|
|
|
|
.search-area {
|
|
|
margin: 20px 0px;
|
|
@@ -257,7 +326,7 @@
|
|
|
align-items: center;
|
|
|
|
|
|
.item-text {
|
|
|
- color: #fff;
|
|
|
+ color: var(--vent-font-color);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -278,7 +347,7 @@
|
|
|
.zxm-input {
|
|
|
border: 1px solid #3ad8ff77 !important;
|
|
|
background-color: #ffffff00 !important;
|
|
|
- color: #fff !important;
|
|
|
+ color: var(--vent-font-color) !important;
|
|
|
}
|
|
|
}
|
|
|
</style>
|