Browse Source

任务

master
DX 2 weeks ago
parent
commit
c62c2103be
  1. 8
      src/styles/variables.scss
  2. 10
      src/views/enterprises/index.vue
  3. 4
      src/views/task/create copy 2.vue
  4. 142
      src/views/task/index.vue

8
src/styles/variables.scss

@ -6,7 +6,7 @@ $elNamespace: el;
.el-form--inline { .el-form--inline {
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
gap: 40px; gap: 20px;
margin-bottom: 0; margin-bottom: 0;
.el-form-item { .el-form-item {
margin-right: 0; margin-right: 0;
@ -19,13 +19,17 @@ $elNamespace: el;
.el-table { .el-table {
border: 1px solid #ebeef5; border: 1px solid #ebeef5;
border-bottom: none;
--el-table-header-bg-color: #f5f7fa; --el-table-header-bg-color: #f5f7fa;
.el-table__header { .el-table__header {
color: #909399; color: #909399;
} }
} }
.el-pagination--large .btn-next, .el-pagination--large .btn-prev, .el-pagination--large .el-pager li{ .el-pagination--large .btn-next,
.el-pagination--large .btn-prev,
.el-pagination--large .el-pager li {
height: fit-content; height: fit-content;
line-height: normal; line-height: normal;
} }

10
src/views/enterprises/index.vue

@ -17,16 +17,6 @@
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="邀请人" prop="userId">-->
<!-- <el-select-->
<!-- v-model="queryParams.userId"-->
<!-- placeholder="请选择邀请人"-->
<!-- clearable-->
<!-- class="!w-240px"-->
<!-- >-->
<!-- <el-option label="请选择字典生成" value="" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="企业类型" prop="type"> <el-form-item label="企业类型" prop="type">
<el-select <el-select
v-model="queryParams.type" v-model="queryParams.type"

4
src/views/task/create copy 2.vue

@ -454,10 +454,6 @@ const filterList = (list: EnterprisesVO[]) => {
const typeMatch = qy ? item.region == qy : true; const typeMatch = qy ? item.region == qy : true;
// //
let test = hy.filter(h => item.tagList.includes(h))
console.log('test', test)
const hyMatch = hy ? hy.filter(h => item.tagList.includes(h)) : true const hyMatch = hy ? hy.filter(h => item.tagList.includes(h)) : true
const userIdMatch = userId ? item.userId == userId : true const userIdMatch = userId ? item.userId == userId : true

142
src/views/task/index.vue

@ -1,29 +1,17 @@
<template> <template>
<ContentWrap style="padding: 10px;"> <ContentWrap style="padding: 10px">
<!-- 搜索工作栏 --> <section class="flex flex-col gap-20px">
<el-form <el-form :model="queryParams" ref="queryFormRef" inline>
class="formClass"
:model="queryParams"
ref="queryFormRef"
:inline="true"
size="large"
>
<el-form-item label="" prop="title"> <el-form-item label="" prop="title">
<el-input <el-input
v-model="queryParams.title" v-model="queryParams.title"
placeholder="请输入任务标题" placeholder="请输入任务标题"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
class="!w-240px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="" prop="taskType"> <el-form-item label="" prop="taskType">
<el-select <el-select v-model="queryParams.taskType" placeholder="请选择任务类型" clearable>
v-model="queryParams.taskType"
placeholder="请选择任务类型"
clearable
class="!w-240px"
>
<el-option <el-option
v-for="dict in taskTypeList" v-for="dict in taskTypeList"
:key="dict.id" :key="dict.id"
@ -33,12 +21,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="taskType"> <el-form-item label="" prop="taskType">
<el-select <el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable>
v-model="queryParams.status"
placeholder="请选择任务状态"
clearable
class="!w-240px"
>
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.TASK_STATE)" v-for="dict in getIntDictOptions(DICT_TYPE.TASK_STATE)"
:key="dict.value" :key="dict.value"
@ -49,12 +32,7 @@
</el-form-item> </el-form-item>
<el-form-item label="" prop="taskType"> <el-form-item label="" prop="taskType">
<el-select <el-select v-model="queryParams.taskType" placeholder="请选择任务类型" clearable>
v-model="queryParams.taskType"
placeholder="请选择任务类型"
clearable
class="!w-240px"
>
<el-option <el-option
v-for="dict in taskTypeList" v-for="dict in taskTypeList"
:key="dict.id" :key="dict.id"
@ -63,13 +41,8 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="startDate" style="width: 100%;"> <el-form-item label="" prop="startDate">
<el-select <el-select v-model="queryParams.selectWeek" placeholder="请选择日期范围" clearable>
v-model="queryParams.selectWeek"
placeholder="请选择日期范围"
clearable
class="!w-240px"
>
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.SELECT_WEEK)" v-for="dict in getIntDictOptions(DICT_TYPE.SELECT_WEEK)"
:key="dict.value" :key="dict.value"
@ -79,18 +52,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery" type="primary" plain
><Icon icon="ep:search" class="mr-5px" /> 查询</el-button
>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
</el-form-item> </el-form-item>
<el-form-item class="mergeClass" > <el-form-item class="last-children">
<el-button <el-button
type="primary" type="primary"
plain
v-hasPermi="['system:task-info:create']" v-hasPermi="['system:task-info:create']"
@click="push({ path: '/task/create' })" @click="push({ path: '/task/create' })"
> >
<Icon icon="ep:plus" class="mr-5px" /> 新增 <Icon icon="ep:circle-plus" class="mr-5px" /> 新增
</el-button> </el-button>
<!-- <el-button <!-- <el-button
type="success" type="success"
@ -103,12 +76,13 @@
</el-button> --> </el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> <el-table
v-loading="loading"
:data="list"
:show-overflow-tooltip="true"
<!-- 列表 --> >
<ContentWrap> <el-table-column label="任务名称" align="left" prop="title" width="200" />
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" :cell-style="{'text-align': 'left'}">
<el-table-column label="任务名称" align="left" prop="title" width="200"/>
<el-table-column label="任务类型" align="left" prop="taskType"> <el-table-column label="任务类型" align="left" prop="taskType">
<template #default="scope"> <template #default="scope">
<el-tag>{{ scope.row.taskTypeName }}</el-tag> <el-tag>{{ scope.row.taskTypeName }}</el-tag>
@ -122,26 +96,18 @@
</el-table-column> </el-table-column>
<el-table-column label="执法对象" align="left" min-width="100px"> <el-table-column label="执法对象" align="left" min-width="100px">
<template #default="scope"> <template #default="scope">
{{new Set(scope.row.enterpriseIdes?.map(e => e.type)).size }}个区域 , {{ new Set(scope.row.enterpriseIdes?.map((e) => e.type)).size }}个区域 ,
{{scope.row.enterpriseIdes.length}}家企业 {{ scope.row.enterpriseIdes.length }}家企业
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="执行时间" align="left" prop="startDate">
label="执行时间"
align="left"
prop="startDate"
>
<template #default="scope"> <template #default="scope">
{{scope.row.startDate}} {{ scope.row.startDate }}
{{ getDictLabel(DICT_TYPE.TASK_NOTICE_TIME, scope.row.execCycle) }} {{ getDictLabel(DICT_TYPE.TASK_NOTICE_TIME, scope.row.execCycle) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作选项" align="left" min-width="50px"> <el-table-column label="操作选项" align="center" width="100px">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -155,7 +121,6 @@
}) })
" "
v-hasPermi="['system:task-info:update']" v-hasPermi="['system:task-info:update']"
> >
详情 详情
</el-button> </el-button>
@ -163,32 +128,32 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <el-pagination
:total="total" :total="total"
v-model:page="queryParams.pageNo" :show-page-size="false"
v-model:limit="queryParams.pageSize" layout="total, prev, pager, next"
@pagination="getList" v-model:current-page="queryParams.pageNo"
v-model:page-size="queryParams.pageSize"
@change="getList"
class="ml-auto"
/> />
</section>
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<TaskInfoForm ref="formRef" @success="getList" /> <TaskInfoForm ref="formRef" @success="getList" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getDictLabel, DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { getDictLabel, DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import download from '@/utils/download' import download from '@/utils/download'
import { TaskInfoApi, TaskInfoVO } from '@/api/system/taskinfo' import { TaskInfoApi, TaskInfoVO } from '@/api/system/taskinfo'
import TaskInfoForm from './TaskInfoForm.vue' import TaskInfoForm from './TaskInfoForm.vue'
import { TagLibraryApi } from '@/api/system/taglibrary' import { TagLibraryApi } from '@/api/system/taglibrary'
/** 任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。 列表 */ /** 任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。 列表 */
defineOptions({ name: 'TaskList' }) defineOptions({ name: 'TaskList' })
@ -198,7 +163,7 @@ const { push } = useRouter()
const loading = ref(true) // const loading = ref(true) //
const list = ref<TaskInfoVO[]>([]) // const list = ref<TaskInfoVO[]>([]) //
const total = ref(0) // const total = ref(0) //
const taskTypeMap=ref() const taskTypeMap = ref()
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -222,11 +187,9 @@ const queryParams = reactive({
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const taskTypeList:any = ref([]) const taskTypeList: any = ref([])
const mydateFormatter3 = ()=> { const mydateFormatter3 = () => {}
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -236,8 +199,6 @@ const getList = async () => {
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
// //
const params = { const params = {
tagType: 2, tagType: 2,
@ -246,7 +207,6 @@ const getList = async () => {
const tag = await TagLibraryApi.getTagLibraryPage(params) const tag = await TagLibraryApi.getTagLibraryPage(params)
taskTypeList.value = tag.list taskTypeList.value = tag.list
} finally { } finally {
loading.value = false loading.value = false
} }
@ -254,7 +214,6 @@ const getList = async () => {
// //
const taskExec = async (data) => { const taskExec = async (data) => {
loading.value = true loading.value = true
try { try {
@ -263,7 +222,6 @@ const taskExec = async (data) => {
getList() getList()
} finally { } finally {
loading.value = false loading.value = false
} }
} }
@ -322,27 +280,11 @@ onMounted(() => {
}) })
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.formClass { ::v-deep(.el-form-item) {
display: grid; width: calc(25% - 15px);
grid-template-columns: 1fr 1fr 1fr 1fr; &:last-child {
grid-template-rows: 2fr; margin-left: auto;
align-items: center; width: fit-content;
row-gap: 20px;
column-gap: 40px;
.mergeClass {
grid-column: 2 span;
:deep(.el-form-item__content) {
display: flex !important;
justify-content:flex-end !important;
}
}
:deep(.el-form-item) {
margin: 0 !important;
}
} }
}
</style> </style>

Loading…
Cancel
Save