|
@@ -20,87 +20,112 @@
|
|
|
:searchData="searchData"
|
|
:searchData="searchData"
|
|
|
@update:searchData="handleSearch"
|
|
@update:searchData="handleSearch"
|
|
|
/>
|
|
/>
|
|
|
- <div class="batch-operation--div fadeIn" v-show="selectionItems.length > 0 && taskManagementPermissions">
|
|
|
|
|
|
|
+ </header>
|
|
|
|
|
+ <div class="batch-table">
|
|
|
|
|
+ <div class="batch-operation--div" v-show="taskManagementPermissions && selectionItems.length > 0">
|
|
|
<span>已选{{ selectionItems.length }}项</span>
|
|
<span>已选{{ selectionItems.length }}项</span>
|
|
|
- <div class="batch-operation--div--button">
|
|
|
|
|
- <el-button type="primary" v-show="isBatchPublish" @click="handleBatchPublish">批量发布</el-button>
|
|
|
|
|
- <el-button type="primary" v-show="isBatchWithdraw" @click="handleBatchWithdraw">批量撤回</el-button>
|
|
|
|
|
- <el-button type="primary" v-show="isBatchDelete" @click="handleBatchDelete">批量删除</el-button>
|
|
|
|
|
|
|
+ <div class="batch-operation--div--close">
|
|
|
|
|
+ <div class="batch-operation--div--button">
|
|
|
|
|
+ <el-button class="custom-el-button" v-show="isBatchPublish" @click="handleBatchPublish"
|
|
|
|
|
+ >批量发布</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button class="custom-el-button" v-show="isBatchWithdraw" @click="handleBatchWithdraw"
|
|
|
|
|
+ >批量撤回</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button class="custom-el-button" v-show="isBatchDelete" @click="handleBatchDelete"
|
|
|
|
|
+ >批量删除</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-icon class="close-icon" @click="handleCloseBatchOperation"><Close /></el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- </header>
|
|
|
|
|
- <BasicTable
|
|
|
|
|
- ref="basicTableRef"
|
|
|
|
|
- :table-config="tableConfig"
|
|
|
|
|
- :table-data="tableData"
|
|
|
|
|
- @update:pageSize="handleSizeChange"
|
|
|
|
|
- @update:pageNumber="handleCurrentChange"
|
|
|
|
|
- @update:selection="handleSelectionChange"
|
|
|
|
|
- >
|
|
|
|
|
- <template #taskName="scope">
|
|
|
|
|
- <div class="task-name--div">
|
|
|
|
|
- <el-tooltip :content="scope.row.name" placement="top" effect="light">
|
|
|
|
|
- <span>{{ scope.row.name }}</span>
|
|
|
|
|
- </el-tooltip>
|
|
|
|
|
- <img :src="OverdueIcon" alt="overdue" v-if="scope.row.overdue" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #inspectType="scope">
|
|
|
|
|
- <span>{{ INSPECT_TYPE_MAP[scope.row.inspectType] }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #effectStatus="scope">
|
|
|
|
|
- <div class="active-status--div">
|
|
|
|
|
- <div
|
|
|
|
|
- class="dot"
|
|
|
|
|
- :style="{ backgroundColor: ACTIVE_STATUS_COLOR[scope.row.effectStatus as ACTIVE_STATUS] }"
|
|
|
|
|
- ></div>
|
|
|
|
|
- <span>{{ ACTIVE_STATUS_MAP[scope.row.effectStatus] }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #taskStage="scope">
|
|
|
|
|
- <span>{{ TASK_STAGE_MAP[scope.row.taskState] }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <template #action="scope">
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="编辑"
|
|
|
|
|
- v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
|
|
|
|
|
- @click="handleEditTask(scope.row.id)"
|
|
|
|
|
- />
|
|
|
|
|
- <ActionButton text="查看" @click="handleViewTask(scope.row.id)" />
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="发布"
|
|
|
|
|
- :popconfirm="{
|
|
|
|
|
- title: '确定要发布?',
|
|
|
|
|
- }"
|
|
|
|
|
- v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
|
|
|
|
|
- @confirm="handlePublishTask(scope.row.id)"
|
|
|
|
|
- />
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="撤回"
|
|
|
|
|
- :popconfirm="{
|
|
|
|
|
- title: '确定要撤回?',
|
|
|
|
|
- }"
|
|
|
|
|
- v-else-if="scope.row.effectStatus === ACTIVE_STATUS.ACTIVE && taskManagementPermissions"
|
|
|
|
|
- @confirm="handleWithdrawTask(scope.row.id)"
|
|
|
|
|
- />
|
|
|
|
|
- <ActionButton
|
|
|
|
|
- text="删除"
|
|
|
|
|
- :popconfirm="{
|
|
|
|
|
- title: '确定要删除?',
|
|
|
|
|
- }"
|
|
|
|
|
- v-if="scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE && taskManagementPermissions"
|
|
|
|
|
- @confirm="handleDeleteTask(scope.row.id)"
|
|
|
|
|
- />
|
|
|
|
|
- </template>
|
|
|
|
|
- </BasicTable>
|
|
|
|
|
|
|
+ <BasicTable
|
|
|
|
|
+ ref="basicTableRef"
|
|
|
|
|
+ :table-config="tableConfig"
|
|
|
|
|
+ :table-data="tableData"
|
|
|
|
|
+ @update:pageSize="handleSizeChange"
|
|
|
|
|
+ @update:pageNumber="handleCurrentChange"
|
|
|
|
|
+ @update:selection="handleSelectionChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #taskName="scope">
|
|
|
|
|
+ <div class="task-name--div">
|
|
|
|
|
+ <el-tooltip
|
|
|
|
|
+ :content="scope.row.name"
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ effect="light"
|
|
|
|
|
+ v-if="isToolTip(scope.row.overdue, scope.row.name)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span>{{ scope.row.name }}</span>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <span v-else>{{ scope.row.name }}</span>
|
|
|
|
|
+ <div class="overdue-icon">
|
|
|
|
|
+ <img :src="OverdueIcon" alt="overdue" v-if="scope.row.overdue" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #inspectType="scope">
|
|
|
|
|
+ <span>{{ INSPECT_TYPE_MAP[scope.row.inspectType] }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #effectStatus="scope">
|
|
|
|
|
+ <div class="active-status--div">
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="dot"
|
|
|
|
|
+ :style="{ backgroundColor: ACTIVE_STATUS_COLOR[scope.row.effectStatus as ACTIVE_STATUS] }"
|
|
|
|
|
+ ></div>
|
|
|
|
|
+ <span>{{ ACTIVE_STATUS_MAP[scope.row.effectStatus] }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #taskStage="scope">
|
|
|
|
|
+ <span>{{ TASK_STAGE_MAP[scope.row.taskState] }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #action="scope">
|
|
|
|
|
+ <div class="action-container--div">
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="编辑"
|
|
|
|
|
+ v-if="taskManagementPermissions && scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
|
|
+ @click="handleEditTask(scope.row.id)"
|
|
|
|
|
+ />
|
|
|
|
|
+ <ActionButton text="查看" @click="handleViewTask(scope.row.id, scope.row.name, scope.row.deptName)" />
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="发布"
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定要发布?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ v-if="taskManagementPermissions && scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
|
|
+ @confirm="handlePublishTask(scope.row.id)"
|
|
|
|
|
+ />
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="撤回"
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定要撤回?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ v-else-if="
|
|
|
|
|
+ taskManagementPermissions &&
|
|
|
|
|
+ scope.row.taskState !== TASK_STAGE.COMPLETED &&
|
|
|
|
|
+ scope.row.effectStatus === ACTIVE_STATUS.ACTIVE
|
|
|
|
|
+ "
|
|
|
|
|
+ @confirm="handleWithdrawTask(scope.row.id)"
|
|
|
|
|
+ />
|
|
|
|
|
+ <ActionButton
|
|
|
|
|
+ text="删除"
|
|
|
|
|
+ :popconfirm="{
|
|
|
|
|
+ title: '确定要删除?',
|
|
|
|
|
+ }"
|
|
|
|
|
+ v-if="taskManagementPermissions && scope.row.effectStatus === ACTIVE_STATUS.NOT_EFFECTIVE"
|
|
|
|
|
+ @confirm="handleDeleteTask(scope.row.id)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
- import { ref, onMounted, reactive, watch } from 'vue';
|
|
|
|
|
- import { Plus } from '@element-plus/icons-vue';
|
|
|
|
|
|
|
+ import { ref, onMounted, reactive } from 'vue';
|
|
|
|
|
+ import { Plus, Close } from '@element-plus/icons-vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
import ActionButton from '@/components/ActionButton.vue';
|
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
import Search from '@/views/disaster/components/Search.vue';
|
|
@@ -114,14 +139,13 @@
|
|
|
import type { TaskManagementListQuery, TaskManagementListResponse } from '@/types/disaster-precaution';
|
|
import type { TaskManagementListQuery, TaskManagementListResponse } from '@/types/disaster-precaution';
|
|
|
import OverdueIcon from '@/assets/svg/overdue.svg';
|
|
import OverdueIcon from '@/assets/svg/overdue.svg';
|
|
|
import { ElMessage } from 'element-plus';
|
|
import { ElMessage } from 'element-plus';
|
|
|
- import { INSPECT_TYPE_MAP, TASK_STAGE_MAP } from './src/constants/task-execution';
|
|
|
|
|
|
|
+ import { INSPECT_TYPE_MAP, TASK_STAGE_MAP, TASK_STAGE } from './src/constants/task-execution';
|
|
|
import { ACTIVE_STATUS, ACTIVE_STATUS_COLOR, ACTIVE_STATUS_MAP } from '@/views/disaster/constant';
|
|
import { ACTIVE_STATUS, ACTIVE_STATUS_COLOR, ACTIVE_STATUS_MAP } from '@/views/disaster/constant';
|
|
|
import {
|
|
import {
|
|
|
TABLE_OPTIONS_MANAGEMENT,
|
|
TABLE_OPTIONS_MANAGEMENT,
|
|
|
TASK_MANAGEMENT_TABLE_COLUMNS,
|
|
TASK_MANAGEMENT_TABLE_COLUMNS,
|
|
|
TASK_MANAGEMENT_SEARCH_CONFIG,
|
|
TASK_MANAGEMENT_SEARCH_CONFIG,
|
|
|
TABLE_MANAGEMENT_HEIGHT_DEFAULT,
|
|
TABLE_MANAGEMENT_HEIGHT_DEFAULT,
|
|
|
- TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION,
|
|
|
|
|
TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION,
|
|
TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION,
|
|
|
} from './src/config';
|
|
} from './src/config';
|
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
@@ -129,13 +153,14 @@
|
|
|
import { DISASTER_PERMISSIONS } from '@/views/disaster/constant';
|
|
import { DISASTER_PERMISSIONS } from '@/views/disaster/constant';
|
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
import { useUserInfoHook } from '@/views/disaster/hooks/userInfo';
|
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
import { openMessageBox } from '@/utils/element-plus/messageBox';
|
|
|
|
|
+ import { isToolTip } from './src/utils/is-tooltip';
|
|
|
|
|
|
|
|
const { permissions } = useUserInfoHook();
|
|
const { permissions } = useUserInfoHook();
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const searchData = reactive({
|
|
const searchData = reactive({
|
|
|
- inspectType: '',
|
|
|
|
|
- effectStatus: '',
|
|
|
|
|
- taskState: '',
|
|
|
|
|
|
|
+ inspectType: null,
|
|
|
|
|
+ effectStatus: null,
|
|
|
|
|
+ taskState: null,
|
|
|
});
|
|
});
|
|
|
const { tableConfig, pagination } = useTableConfig(TASK_MANAGEMENT_TABLE_COLUMNS, TABLE_OPTIONS_MANAGEMENT);
|
|
const { tableConfig, pagination } = useTableConfig(TASK_MANAGEMENT_TABLE_COLUMNS, TABLE_OPTIONS_MANAGEMENT);
|
|
|
let taskManagementListQuery: QueryPageRequest<TaskManagementListQuery> = {
|
|
let taskManagementListQuery: QueryPageRequest<TaskManagementListQuery> = {
|
|
@@ -145,13 +170,13 @@
|
|
|
};
|
|
};
|
|
|
const handleSearch = () => {
|
|
const handleSearch = () => {
|
|
|
taskManagementListQuery.queryParam = {};
|
|
taskManagementListQuery.queryParam = {};
|
|
|
- if (searchData.inspectType !== '') {
|
|
|
|
|
|
|
+ if (searchData.inspectType) {
|
|
|
taskManagementListQuery.queryParam.inspectType = searchData.inspectType;
|
|
taskManagementListQuery.queryParam.inspectType = searchData.inspectType;
|
|
|
}
|
|
}
|
|
|
- if (searchData.effectStatus !== '') {
|
|
|
|
|
|
|
+ if (searchData.effectStatus) {
|
|
|
taskManagementListQuery.queryParam.effectStatus = searchData.effectStatus;
|
|
taskManagementListQuery.queryParam.effectStatus = searchData.effectStatus;
|
|
|
}
|
|
}
|
|
|
- if (searchData.taskState !== '') {
|
|
|
|
|
|
|
+ if (searchData.taskState) {
|
|
|
taskManagementListQuery.queryParam.taskState = searchData.taskState;
|
|
taskManagementListQuery.queryParam.taskState = searchData.taskState;
|
|
|
}
|
|
}
|
|
|
if (Object.keys(taskManagementListQuery.queryParam).length > 0) {
|
|
if (Object.keys(taskManagementListQuery.queryParam).length > 0) {
|
|
@@ -198,6 +223,10 @@
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
const basicTableRef = ref<InstanceType<typeof BasicTable>>();
|
|
|
|
|
+ const handleCloseBatchOperation = () => {
|
|
|
|
|
+ if (!basicTableRef.value) return;
|
|
|
|
|
+ basicTableRef.value.clearSelection();
|
|
|
|
|
+ };
|
|
|
const handleBatchDelete = async () => {
|
|
const handleBatchDelete = async () => {
|
|
|
const confirmed = await openMessageBox('', '删除后任务不可恢复,确认删除吗?', 'warning');
|
|
const confirmed = await openMessageBox('', '删除后任务不可恢复,确认删除吗?', 'warning');
|
|
|
if (!confirmed) return;
|
|
if (!confirmed) return;
|
|
@@ -240,10 +269,10 @@
|
|
|
query: { operate: 'edit', id },
|
|
query: { operate: 'edit', id },
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
- const handleViewTask = (id: number) => {
|
|
|
|
|
|
|
+ const handleViewTask = (id: number, name: string, deptName: string) => {
|
|
|
router.push({
|
|
router.push({
|
|
|
name: defaultName,
|
|
name: defaultName,
|
|
|
- query: { id },
|
|
|
|
|
|
|
+ query: { id, name, deptName },
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
const tableData = ref<TaskManagementListResponse[]>([]);
|
|
const tableData = ref<TaskManagementListResponse[]>([]);
|
|
@@ -274,32 +303,44 @@
|
|
|
? TABLE_MANAGEMENT_HEIGHT_DEFAULT
|
|
? TABLE_MANAGEMENT_HEIGHT_DEFAULT
|
|
|
: TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION;
|
|
: TABLE_MANAGEMENT_HEIGHT_NOT_PERMISSION;
|
|
|
});
|
|
});
|
|
|
- watch(
|
|
|
|
|
- () => selectionItems.value.length,
|
|
|
|
|
- (newLength) => {
|
|
|
|
|
- // 如果没有权限,则不显示批量操作
|
|
|
|
|
- if (!taskManagementPermissions.value) return;
|
|
|
|
|
- if (newLength > 0) {
|
|
|
|
|
- tableConfig.height = TABLE_MANAGEMENT_HEIGHT_BATCH_OPERATION;
|
|
|
|
|
- } else {
|
|
|
|
|
- tableConfig.height = TABLE_MANAGEMENT_HEIGHT_DEFAULT;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- );
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
|
@use '../style/disaster.scss' as *;
|
|
@use '../style/disaster.scss' as *;
|
|
|
@use './src/style/task-execution.scss' as *;
|
|
@use './src/style/task-execution.scss' as *;
|
|
|
|
|
+ .batch-table {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ }
|
|
|
.batch-operation--div {
|
|
.batch-operation--div {
|
|
|
@include flex-center;
|
|
@include flex-center;
|
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
gap: 60px;
|
|
gap: 60px;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 54px;
|
|
|
|
|
|
|
+ height: 48px;
|
|
|
border: 4px;
|
|
border: 4px;
|
|
|
padding: 16px 25px;
|
|
padding: 16px 25px;
|
|
|
background-color: #ddefff;
|
|
background-color: #ddefff;
|
|
|
- margin-top: 20px;
|
|
|
|
|
|
|
+ z-index: 100;
|
|
|
|
|
+ &--close {
|
|
|
|
|
+ @include flex-center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ .close-icon {
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ color: #ff4d4f;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .custom-el-button {
|
|
|
|
|
+ --el-border-color: #1890ff;
|
|
|
|
|
+ --el-text-color-regular: #1890ff;
|
|
|
|
|
+ --el-color-primary: #fff;
|
|
|
|
|
+ --el-color-primary-light-9: #1890ff;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|