!238 新增 todo done 页面,优化redis页面

* chore: update deps
* feat: add todo done pages
* chore: update deps
* docs: update
* feat: redis dialog
This commit is contained in:
xingyu
2022-07-29 07:57:48 +00:00
committed by 芋道源码
parent 35413b52c9
commit f3e1fc4f9b
12 changed files with 466 additions and 68 deletions

View File

@ -0,0 +1,94 @@
import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() // 国际化
// CrudSchema
const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.index'),
field: 'id',
type: 'index'
},
{
label: '任务名称',
field: 'name',
search: {
show: true
}
},
{
label: '所属流程',
field: 'processInstance.name'
},
{
label: '流程发起人',
field: 'processInstance.startUserNickname'
},
{
label: '结果',
field: 'result',
dictType: DICT_TYPE.BPM_PROCESS_INSTANCE_RESULT
},
{
label: '审批意见',
field: 'reason'
},
{
label: t('common.createTime'),
field: 'createTime',
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)],
shortcuts: [
{
text: '近一周',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
}
},
{
text: '近一个月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
}
},
{
text: '近三个月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
}
}
]
}
}
},
{
label: '审批时间',
field: 'endTime'
},
{
label: '耗时',
field: 'durationInMillis'
},
{
label: t('table.action'),
field: 'action',
width: '100px'
}
])
export const { allSchemas } = useCrudSchemas(crudSchemas)

View File

@ -1,7 +1,67 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable'
import { useI18n } from '@/hooks/web/useI18n'
import type { TaskDoneVO } from '@/api/bpm/task/types'
import { allSchemas } from './done.data'
import * as TaskDoneApi from '@/api/bpm/task'
import { useRouter } from 'vue-router'
dayjs.extend(duration)
const { t } = useI18n() // 国际化
const { push } = useRouter()
// ========== 列表相关 ==========
const { register, tableObject, methods } = useTable<TaskDoneVO>({
getListApi: TaskDoneApi.getDoneTaskPage
})
const { getList, setSearchParams } = methods
// 审批操作
const handleAudit = async (row: TaskDoneVO) => {
push('/bpm/process-instance/detail?id=' + row.processInstance.id)
}
// ========== 初始化 ==========
getList()
</script>
<template>
<div>index</div>
<!-- 搜索工作区 -->
<ContentWrap>
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<ContentWrap>
<!-- 列表 -->
<Table
:columns="allSchemas.tableColumns"
:selection="false"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
@register="register"
>
<template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #endTime="{ row }">
<span>{{ dayjs(row.endTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #durationInMillis="{ row }">
<span>{{ dayjs.duration(row.durationInMillis).asMilliseconds() }}</span>
</template>
<template #action="{ row }">
<el-button link type="primary" v-hasPermi="['bpm:task:query']" @click="handleAudit(row)">
<Icon icon="ep:view" class="mr-1px" /> {{ t('action.detail') }}
</el-button>
</template>
</Table>
</ContentWrap>
</template>
<style scoped></style>

View File

@ -0,0 +1,76 @@
import { reactive } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
const { t } = useI18n() // 国际化
// CrudSchema
const crudSchemas = reactive<CrudSchema[]>([
{
label: t('common.index'),
field: 'id',
type: 'index'
},
{
label: '任务名称',
field: 'name',
search: {
show: true
}
},
{
label: '所属流程',
field: 'processInstance.name'
},
{
label: '流程发起人',
field: 'processInstance.startUserNickname'
},
{
label: t('common.createTime'),
field: 'createTime',
search: {
show: true,
component: 'DatePicker',
componentProps: {
type: 'datetimerange',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
defaultTime: [new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)],
shortcuts: [
{
text: '近一周',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
return [start, end]
}
},
{
text: '近一个月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
return [start, end]
}
},
{
text: '近三个月',
value: () => {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
return [start, end]
}
}
]
}
}
},
{
label: t('table.action'),
field: 'action',
width: '100px'
}
])
export const { allSchemas } = useCrudSchemas(crudSchemas)

View File

@ -1,7 +1,57 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import dayjs from 'dayjs'
import { DICT_TYPE } from '@/utils/dict'
import { useTable } from '@/hooks/web/useTable'
import type { TaskTodoVO } from '@/api/bpm/task/types'
import { allSchemas } from './done.data'
import * as TaskTodoApi from '@/api/bpm/task'
import { useRouter } from 'vue-router'
const { push } = useRouter()
// ========== 列表相关 ==========
const { register, tableObject, methods } = useTable<TaskTodoVO>({
getListApi: TaskTodoApi.getTodoTaskPage
})
const { getList, setSearchParams } = methods
// 审批操作
const handleAudit = async (row: TaskTodoVO) => {
push('/bpm/process-instance/detail?id=' + row.processInstance.id)
}
// ========== 初始化 ==========
getList()
</script>
<template>
<div>index</div>
<!-- 搜索工作区 -->
<ContentWrap>
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<ContentWrap>
<!-- 列表 -->
<Table
:columns="allSchemas.tableColumns"
:selection="false"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
@register="register"
>
<template #status="{ row }">
<DictTag :type="DICT_TYPE.COMMON_STATUS" :value="row.status" />
</template>
<template #createTime="{ row }">
<span>{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
<template #action="{ row }">
<el-button link type="primary" v-hasPermi="['bpm:task:update']" @click="handleAudit(row)">
<Icon icon="ep:edit" class="mr-1px" /> 审批
</el-button>
</template>
</Table>
</ContentWrap>
</template>
<style scoped></style>