Browse Source

编辑任务

master
parent
commit
fa4dfc5ef6
  1. 2
      src/api/system/taglibrary/index.ts
  2. 2
      src/api/system/taskinfo/index.ts
  3. 4
      src/layout/components/Logo/src/Logo.vue
  4. 3
      src/store/modules/app.ts
  5. 18
      src/views/task/create.vue
  6. 40
      src/views/task/index.vue

2
src/api/system/taglibrary/index.ts

@ -18,7 +18,7 @@ export const TagLibraryApi = {
},
// 查询企业标签详情
getTagLibrary: async (id: number) => {
getTagLibrary: async (id: any) => {
return await request.get({ url: `/system/tag-library/get?id=` + id })
},

2
src/api/system/taskinfo/index.ts

@ -25,7 +25,7 @@ export const TaskInfoApi = {
},
// 查询任务表,用于存储所有的任务信息,任务可由不同用户创建并管理。详情
getTaskInfo: async (id: number) => {
getTaskInfo: async (id: any) => {
return await request.get({ url: `/system/task-info/get?id=` + id })
},

4
src/layout/components/Logo/src/Logo.vue

@ -62,7 +62,7 @@ watch(
:class="[
prefixCls,
layout !== 'classic' ? `${prefixCls}__Top` : '',
'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative decoration-none overflow-hidden'
'flex !h-[var(--logo-height)] items-center cursor-pointer justify-center relative decoration-none overflow-hidden p-20px'
]"
to="/"
>
@ -77,7 +77,7 @@ watch(
<div
v-if="show"
:class="[
'ml-10px text-16px font-700',
'ml-10px text-16px font-700 flex-1',
{
'text-[var(--logo-title-text-color)]': layout === 'classic',
'text-[var(--top-header-text-color)]':

3
src/store/modules/app.ts

@ -46,7 +46,7 @@ export const useAppStore = defineStore('app', {
sizeMap: ['default', 'large', 'small'],
mobile: false, // 是否是移动端
title: import.meta.env.VITE_APP_TITLE, // 标题
pageLoading: false, // 路由跳转loading
pageLoading: true, // 路由跳转loading
breadcrumb: true, // 面包屑
breadcrumbIcon: true, // 面包屑图标
collapse: false, // 折叠菜单
@ -65,7 +65,6 @@ export const useAppStore = defineStore('app', {
footer: true, // 显示页脚
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
fixedMenu: wsCache.get('fixedMenu') || false, // 是否固定菜单
layout: wsCache.get(CACHE_KEY.LAYOUT) || 'classic', // layout布局
// isDark: wsCache.get(CACHE_KEY.IS_DARK) || false, // 是否是暗黑模式
isDark: false, // 是否是暗黑模式

18
src/views/task/create.vue

@ -9,7 +9,7 @@
<el-date-picker
v-model="formData.planTime"
type="daterange"
value-format="x"
format="YYYY年MM月DD日"
range-separator="至"
start-placeholder="选择任务计划开始时间"
end-placeholder="选择任务计划结束时间"
@ -239,7 +239,7 @@ const formData = ref({
parentType: undefined,
taskStep: undefined,
taskTotal: undefined,
planTime: [],
planTime: [] as any,
tags: [],
enterprises: ref<any>([])
})
@ -258,6 +258,7 @@ const formRules = reactive({
],
planTime: [{ required: true, message: '时间周期不能为空', trigger: 'blur' }]
})
const {query}=useRoute()
const formRef = ref() // Ref
const tagList = ref([])
const queryFormRef = ref() //
@ -387,8 +388,21 @@ async function submitForm() {
}
}
function init(){
if(query.id){
TaskInfoApi.getTaskInfo(query.id).then(res=>{
formData.value=res
formData.value.planTime=[formData.value.startDate,formData.value.endDate]
formData.value.enterprises=res.enterpriseInspectionsIdes
})
}
}
getEnterPriseList()
getTagList()
onMounted(()=>{
init()
})
</script>
<style scoped lang="scss">

40
src/views/task/index.vue

@ -71,10 +71,10 @@
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="任务状态" align="center" prop="status" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_STATE" :value="scope.row.status" />
</template>
<el-table-column label="任务状态" align="center" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_STATE" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="任务名称" align="center" prop="title" />
<!-- <el-table-column label="执行周期" align="center" prop="execCycle">
@ -94,7 +94,7 @@
</el-table-column>
<el-table-column label="发布部门" align="center" prop="publishDep" />
<el-table-column
label="计划开始时间"
align="center"
@ -122,14 +122,12 @@
</template>
</el-table-column> -->
<!-- <el-table-column label="执行到第几" align="center" prop="taskStep" /> -->
<el-table-column label="执法对象" align="center" min-width="120px">
<template #default="scope">
<el-button link type="primary" @click="selectEnterprise(scope.row.id)">
<el-button link type="primary" @click="selectEnterprise(scope.row.id)">
已选&nbsp;0
</el-button>
</template>
</el-table-column>
@ -138,7 +136,14 @@
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
@click="
push({
path: 'create',
query: {
id: scope.row.id
}
})
"
v-hasPermi="['system:task-info:update']"
>
编辑
@ -152,22 +157,9 @@
删除
</el-button>
<el-button
link
type="primary"
@click="openForm(scope.row.id)"
>
详情
</el-button>
<el-button link type="primary" @click="openForm(scope.row.id)"> 详情 </el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination

Loading…
Cancel
Save