提交
This commit is contained in:
1 parent
246ad2228e
commit
8e2dd8b9f0
186 files changed
+38821
-2571
No files matched your search
@@ -0,0 +1,288 @@
|
||||
<!-- 审批操作弹窗 -->
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
width="640px"
|
||||
destroy-on-close
|
||||
class="workflow-module-dialog"
|
||||
align-center
|
||||
:close-on-click-modal="false"
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div v-if="bizLoading" v-loading="true" class="dialog-scroll" style="min-height: 120px" />
|
||||
<div v-else class="dialog-scroll">
|
||||
<!-- Hero header -->
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Checked /></el-icon>
|
||||
</div>
|
||||
<div class="view-hero-main">
|
||||
<h2>{{ instanceData?.processName || '审批操作' }}</h2>
|
||||
<div class="view-hero-tags">
|
||||
<el-tag size="small" type="info">{{ instanceData?.businessTypeLabel || instanceData?.businessType || '--' }}</el-tag>
|
||||
</div>
|
||||
<p v-if="instanceData" class="view-hero-meta">
|
||||
发起人:{{ instanceData.starterUserName || '--' }}
|
||||
<span class="dot">·</span>
|
||||
业务单号:{{ instanceData.businessId || '--' }}
|
||||
<span class="dot">·</span>
|
||||
{{ instanceData.createTime || '--' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 申请信息 -->
|
||||
<div v-if="formFields.length" class="view-section">
|
||||
<h3>申请信息</h3>
|
||||
<dl class="view-kv-grid">
|
||||
<div v-for="field in formFields" :key="field.label" class="view-kv">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>{{ field.value || '--' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<!-- 审批操作 -->
|
||||
<div class="view-section">
|
||||
<h3>审批操作</h3>
|
||||
<el-form :model="form" label-position="top">
|
||||
<el-form-item label="审批结果">
|
||||
<el-radio-group v-model="form.approved">
|
||||
<el-radio :value="true">通过</el-radio>
|
||||
<el-radio :value="false">驳回</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="审批意见">
|
||||
<el-input
|
||||
v-model="form.commentText"
|
||||
type="textarea"
|
||||
:rows="3"
|
||||
placeholder="请输入审批意见"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="visible = false"><el-icon><Close /></el-icon>取消</el-button>
|
||||
<el-button type="primary" class="btn-main" :loading="submitting" @click="handleSubmit">
|
||||
<el-icon><Check /></el-icon>
|
||||
确认提交
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { fetchApproveTask, fetchRejectTask, fetchInstanceDetail } from '@/api/workflow'
|
||||
import { Checked, Close, Check } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'ApprovalDialog' })
|
||||
|
||||
const props = defineProps<{
|
||||
visible: boolean
|
||||
taskId: string
|
||||
instanceId?: string
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'update:visible', val: boolean): void
|
||||
(e: 'done'): void
|
||||
}>()
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.visible,
|
||||
set: (val) => emit('update:visible', val)
|
||||
})
|
||||
|
||||
const submitting = ref(false)
|
||||
const form = reactive({
|
||||
approved: true,
|
||||
commentText: ''
|
||||
})
|
||||
|
||||
const bizLoading = ref(false)
|
||||
const formFields = ref<Array<{ label: string; value: string }>>([])
|
||||
const instanceData = ref<Record<string, any> | null>(null)
|
||||
|
||||
async function loadFormData() {
|
||||
if (!props.instanceId) return
|
||||
bizLoading.value = true
|
||||
formFields.value = []
|
||||
instanceData.value = null
|
||||
try {
|
||||
const data = await fetchInstanceDetail(props.instanceId)
|
||||
instanceData.value = data
|
||||
formFields.value = data.businessFormFields || []
|
||||
} catch {
|
||||
// 加载失败不影响审批操作
|
||||
} finally {
|
||||
bizLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.visible,
|
||||
(val) => {
|
||||
if (val) {
|
||||
form.approved = true
|
||||
form.commentText = ''
|
||||
loadFormData()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
async function handleSubmit() {
|
||||
submitting.value = true
|
||||
try {
|
||||
const data = { commentText: form.commentText?.trim() || undefined }
|
||||
if (form.approved) {
|
||||
await fetchApproveTask(props.taskId, data)
|
||||
} else {
|
||||
await fetchRejectTask(props.taskId, data)
|
||||
}
|
||||
visible.value = false
|
||||
emit('done')
|
||||
} catch {
|
||||
// 错误已由全局处理
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-scroll {
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.view-hero {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 20px 22px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view-hero-icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #059669;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.view-hero-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
}
|
||||
|
||||
.view-hero-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.view-hero-meta {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
line-height: 1.5;
|
||||
|
||||
.dot {
|
||||
margin: 0 6px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.view-section {
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0 0 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 28px;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.view-kv-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.workflow-module-dialog {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 12px 22px;
|
||||
border-top: 1px solid #d9e8e2;
|
||||
background: #f8fafc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!-- 流程/任务状态标签 -->
|
||||
<template>
|
||||
<el-tag :type="tagType" size="small">{{ label }}</el-tag>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineOptions({ name: 'ProcessStatusTag' })
|
||||
|
||||
const props = defineProps<{
|
||||
status: string
|
||||
}>()
|
||||
|
||||
const statusMap: Record<string, { type: string; label: string }> = {
|
||||
running: { type: 'warning', label: '进行中' },
|
||||
completed: { type: 'success', label: '已完成' },
|
||||
rejected: { type: 'danger', label: '已驳回' },
|
||||
cancelled: { type: 'info', label: '已取消' },
|
||||
pending: { type: 'warning', label: '待处理' },
|
||||
approved: { type: 'success', label: '已通过' },
|
||||
withdrawn: { type: 'info', label: '已撤回' }
|
||||
}
|
||||
|
||||
const tagType = computed(() => statusMap[props.status]?.type ?? 'info')
|
||||
const label = computed(() => statusMap[props.status]?.label ?? props.status)
|
||||
</script>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,518 @@
|
||||
<!-- 我的申请 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<header class="page-head">
|
||||
<h1>我的申请</h1>
|
||||
<p class="page-desc">查看我发起的所有审批申请及进度。</p>
|
||||
</header>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">申请列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="流程名称/业务单号"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="searchForm.status" placeholder="全部" clearable style="width: 140px">
|
||||
<el-option label="进行中" value="running" />
|
||||
<el-option label="已完成" value="completed" />
|
||||
<el-option label="已驳回" value="rejected" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按流程名称、业务单号模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="processName"
|
||||
label="流程名称"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessTypeLabel"
|
||||
label="业务类型"
|
||||
width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessId"
|
||||
label="业务单号"
|
||||
min-width="200"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="status"
|
||||
label="状态"
|
||||
width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<ProcessStatusTag :status="row.status || ''" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="发起时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="操作" width="160" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleViewDetail(row)"><el-icon><View /></el-icon>查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailVisible"
|
||||
width="720px"
|
||||
class="workflow-module-dialog"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div v-loading="detailLoading" class="dialog-scroll">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
</div>
|
||||
<div class="view-hero-main">
|
||||
<h2>{{ detailRow?.processName || '流程详情' }}</h2>
|
||||
<div class="view-hero-tags">
|
||||
<ProcessStatusTag :status="detailRow?.status || ''" />
|
||||
<el-tag size="small" type="info">{{ detailRow?.businessTypeLabel || detailData.businessType || '--' }}</el-tag>
|
||||
</div>
|
||||
<p class="view-hero-meta">
|
||||
业务单号:{{ detailData.businessId || '--' }}
|
||||
<span class="dot">·</span>
|
||||
{{ detailRow?.createTime || '--' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.businessFormFields && detailData.businessFormFields.length" class="view-section">
|
||||
<h3>申请信息</h3>
|
||||
<dl class="view-kv-grid">
|
||||
<div v-for="field in detailData.businessFormFields" :key="field.label" class="view-kv">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>{{ field.value || '--' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.tasks && detailData.tasks.length" class="view-section">
|
||||
<h3>审批节点(含历史)</h3>
|
||||
<div class="htl-scroll">
|
||||
<div class="htl">
|
||||
<div
|
||||
v-for="(task, idx) in detailData.tasks"
|
||||
:key="task.id"
|
||||
class="htl-item"
|
||||
:class="getTimelineStatusClass(task.status)"
|
||||
>
|
||||
<div class="htl-rail">
|
||||
<span class="htl-node" />
|
||||
<span v-if="idx < detailData.tasks.length - 1" class="htl-line" />
|
||||
</div>
|
||||
<div class="htl-body">
|
||||
<div class="htl-name">{{ task.nodeName || '--' }}</div>
|
||||
<div class="htl-user">{{ task.assigneeUserName || '--' }}</div>
|
||||
<div class="htl-status">
|
||||
<ProcessStatusTag :status="task.status || ''" />
|
||||
</div>
|
||||
<div v-if="task.updateTime" class="htl-time">{{ task.updateTime }}</div>
|
||||
<div v-if="task.commentText" class="htl-comment">{{ task.commentText }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="detailVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { fetchMyInstances, fetchBusinessAllTasks } from '@/api/workflow'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
import { Document, View, Search, RefreshLeft, Close } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'WorkflowMyApplications' })
|
||||
|
||||
const searchForm = reactive<{ keyword: string; status: string }>({ keyword: '', status: '' })
|
||||
const tableData = ref<Api.Workflow.MyInstanceItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
|
||||
const detailVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailData = ref<Api.Workflow.BusinessAllTasks | null>(null)
|
||||
const detailRow = ref<Api.Workflow.MyInstanceItem | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchMyInstances({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined,
|
||||
status: searchForm.status || undefined,
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
searchForm.status = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleViewDetail(row: Api.Workflow.MyInstanceItem) {
|
||||
detailVisible.value = true
|
||||
detailLoading.value = true
|
||||
detailData.value = null
|
||||
detailRow.value = row
|
||||
try {
|
||||
const data = await fetchBusinessAllTasks(
|
||||
row.businessType || '',
|
||||
row.businessId || ''
|
||||
)
|
||||
detailData.value = data
|
||||
} catch {
|
||||
// error handled globally
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getTimelineStatusClass(status: string) {
|
||||
if (['approved', 'completed'].includes(status)) return 'htl-done'
|
||||
if (['running', 'pending'].includes(status)) return 'htl-active'
|
||||
if (status === 'rejected') return 'htl-reject'
|
||||
return 'htl-muted'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-scroll {
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.view-hero {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 20px 22px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view-hero-icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #059669;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.view-hero-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
}
|
||||
|
||||
.view-hero-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.view-hero-meta {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
line-height: 1.5;
|
||||
|
||||
.dot {
|
||||
margin: 0 6px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.view-section {
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0 0 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 28px;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.view-kv-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* horizontal timeline */
|
||||
.htl-scroll {
|
||||
overflow-x: auto;
|
||||
padding: 0 0 4px 12px;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #d1d5db;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.htl {
|
||||
display: inline-flex;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.htl-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 140px;
|
||||
flex: 1 0 140px;
|
||||
}
|
||||
|
||||
.htl-rail {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.htl-node {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
background: #10b981;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 1px #10b981;
|
||||
}
|
||||
|
||||
.htl-line {
|
||||
flex: 1;
|
||||
height: 2px;
|
||||
background: #d1d5db;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.htl-body {
|
||||
padding: 8px 4px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.htl-name {
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-user {
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-status {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-time {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-comment {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.htl-active .htl-node {
|
||||
background: #fff;
|
||||
border: 3px solid #10b981;
|
||||
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
|
||||
.htl-reject .htl-node {
|
||||
background: #ef4444;
|
||||
border-color: #fff;
|
||||
box-shadow: 0 0 0 1px #ef4444;
|
||||
}
|
||||
|
||||
.htl-muted .htl-node {
|
||||
background: #d1d5db;
|
||||
border-color: #fff;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.htl-done + .htl-active .htl-line,
|
||||
.htl-done + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
|
||||
.htl-active + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.workflow-module-dialog {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 12px 22px;
|
||||
border-top: 1px solid #d9e8e2;
|
||||
background: #f8fafc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,352 @@
|
||||
<!-- 流程定义管理 -->
|
||||
<!-- eslint-disable vue/no-v-model-argument -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<header class="page-head">
|
||||
<h1>流程管理</h1>
|
||||
<p class="page-desc">管理审批流程定义,支持图形化设计、版本发布与启停控制。</p>
|
||||
</header>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">流程列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="流程名称/编码"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按流程名称、编码模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAdd">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增流程
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="selectedRows.length === 0"
|
||||
@click="handleBatchDelete"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="processCode"
|
||||
label="流程编码"
|
||||
width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="processName"
|
||||
label="流程名称"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="状态" width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
:model-value="row.status"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="(val) => handleStatusChange(row, val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最新版本" width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
{{ row.latestVersion != null ? `V${row.latestVersion}` : '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="创建时间"
|
||||
width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="操作" width="400" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleDesign(row)"><el-icon><SetUp /></el-icon>流程设计</el-button>
|
||||
<el-button class="btn-op-item" @click="handleEdit(row)"><el-icon><Edit /></el-icon>编辑</el-button>
|
||||
<el-button class="btn-op-item" @click="handleDelete(row)"><el-icon><Delete /></el-icon>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="dialogTitle"
|
||||
width="560px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:close-on-click-modal="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-position="top"
|
||||
scroll-to-error
|
||||
:scroll-into-view-options="{ behavior: 'smooth', block: 'center' }"
|
||||
>
|
||||
<div class="form-grid-2">
|
||||
<el-form-item label="流程编码" prop="processCode">
|
||||
<el-input v-model="formData.processCode" placeholder="请输入流程编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程名称" prop="processName">
|
||||
<el-input v-model="formData.processName" placeholder="请输入流程名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="formData.remark" placeholder="可选" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="dialogVisible = false">
|
||||
<el-icon><Close /></el-icon>
|
||||
取消
|
||||
</el-button>
|
||||
<el-button class="btn-main" type="primary" :loading="submitLoading" @click="handleSubmit">
|
||||
<el-icon><Check /></el-icon>
|
||||
确定
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
|
||||
<!-- 流程设计器 -->
|
||||
<FlowDesigner
|
||||
v-model:visible="designerVisible"
|
||||
:process-def-id="designerDefId"
|
||||
:process-name="designerDefName"
|
||||
@saved="handleDesignerSaved"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Plus, Close, Check, Search, RefreshLeft, Delete, SetUp, Edit } from '@element-plus/icons-vue'
|
||||
import { withFullscreenLoading, fullscreenLoadingText } from '@/utils/fullscreen-loading'
|
||||
import {
|
||||
fetchProcessDefList,
|
||||
fetchCreateProcessDef,
|
||||
fetchUpdateProcessDef,
|
||||
fetchDeleteProcessDef
|
||||
} from '@/api/workflow'
|
||||
import FlowDesigner from '../designer/FlowDesigner.vue'
|
||||
|
||||
defineOptions({ name: 'WorkflowProcess' })
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.Workflow.ProcessDefItem[]>([])
|
||||
const selectedRows = ref<Api.Workflow.ProcessDefItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
|
||||
// 新增/编辑
|
||||
const dialogVisible = ref(false)
|
||||
const dialogTitle = ref('新增流程')
|
||||
const isEdit = ref(false)
|
||||
const submitLoading = ref(false)
|
||||
const formRef = ref()
|
||||
const editingId = ref<string | null>(null)
|
||||
|
||||
const formData = reactive({
|
||||
processCode: '',
|
||||
processName: '',
|
||||
orderNum: 0,
|
||||
remark: ''
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
processCode: [{ required: true, message: '请输入流程编码', trigger: 'blur' }],
|
||||
processName: [{ required: true, message: '请输入流程名称', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
// 设计器
|
||||
const designerVisible = ref(false)
|
||||
const designerDefId = ref('')
|
||||
const designerDefName = ref('')
|
||||
|
||||
const handleSelectionChange = (rows: Api.Workflow.ProcessDefItem[]) => {
|
||||
selectedRows.value = rows
|
||||
}
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchProcessDefList({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
formData.processCode = ''
|
||||
formData.processName = ''
|
||||
formData.orderNum = 0
|
||||
formData.remark = ''
|
||||
editingId.value = null
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
isEdit.value = false
|
||||
dialogTitle.value = '新增流程'
|
||||
resetForm()
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
function handleEdit(row: Api.Workflow.ProcessDefItem) {
|
||||
isEdit.value = true
|
||||
dialogTitle.value = '编辑流程'
|
||||
editingId.value = row.id
|
||||
formData.processCode = row.processCode || ''
|
||||
formData.processName = row.processName || ''
|
||||
formData.orderNum = row.orderNum ?? 0
|
||||
formData.remark = row.remark || ''
|
||||
dialogVisible.value = true
|
||||
formRef.value?.clearValidate?.()
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
await formRef.value?.validate?.()
|
||||
submitLoading.value = true
|
||||
try {
|
||||
const payload = {
|
||||
processCode: formData.processCode.trim(),
|
||||
processName: formData.processName.trim(),
|
||||
orderNum: formData.orderNum,
|
||||
remark: formData.remark?.trim() || undefined
|
||||
}
|
||||
if (isEdit.value && editingId.value) {
|
||||
await fetchUpdateProcessDef(editingId.value, payload)
|
||||
} else {
|
||||
await fetchCreateProcessDef(payload)
|
||||
}
|
||||
dialogVisible.value = false
|
||||
await loadData()
|
||||
} catch {
|
||||
// 校验或接口错误已由全局处理
|
||||
} finally {
|
||||
submitLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleStatusChange(row: Api.Workflow.ProcessDefItem, val: string | number | boolean) {
|
||||
const newStatus = String(val)
|
||||
await fetchUpdateProcessDef(row.id, { status: newStatus })
|
||||
await loadData()
|
||||
}
|
||||
|
||||
async function handleDelete(row: Api.Workflow.ProcessDefItem) {
|
||||
await ElMessageBox.confirm('确定要删除该流程吗?', '提示', { type: 'warning' })
|
||||
await fetchDeleteProcessDef(row.id)
|
||||
await loadData()
|
||||
}
|
||||
|
||||
async function handleBatchDelete() {
|
||||
const ids = selectedRows.value.map((r) => r.id)
|
||||
if (!ids.length) return
|
||||
await ElMessageBox.confirm(`确定删除选中的 ${ids.length} 个流程吗?`, '提示', { type: 'warning' })
|
||||
await withFullscreenLoading(async () => {
|
||||
for (const id of ids) {
|
||||
await fetchDeleteProcessDef(id)
|
||||
}
|
||||
ElMessage.success('批量删除成功')
|
||||
selectedRows.value = []
|
||||
await loadData()
|
||||
}, fullscreenLoadingText.batchDelete)
|
||||
}
|
||||
|
||||
function handleDesign(row: Api.Workflow.ProcessDefItem) {
|
||||
designerDefId.value = row.id
|
||||
designerDefName.value = row.processName
|
||||
designerVisible.value = true
|
||||
}
|
||||
|
||||
function handleDesignerSaved() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,532 @@
|
||||
<!-- 已办任务 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<header class="page-head">
|
||||
<h1>已办任务</h1>
|
||||
<p class="page-desc">查看已处理的审批任务及审批结果。</p>
|
||||
</header>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">已办列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="流程名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按流程名称模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="processName"
|
||||
label="流程名称"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessTypeLabel"
|
||||
label="业务类型"
|
||||
width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessId"
|
||||
label="业务单号"
|
||||
min-width="200"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="starterUserName"
|
||||
label="发起人"
|
||||
width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="审批结果" width="100" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<ProcessStatusTag :status="row.status || ''" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="commentText"
|
||||
label="审批意见"
|
||||
min-width="150"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="updateTime"
|
||||
label="审批时间"
|
||||
min-width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="操作" width="260" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleViewDetail(row)"><el-icon><View /></el-icon>查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailVisible"
|
||||
width="720px"
|
||||
class="workflow-module-dialog"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div v-loading="detailLoading" class="dialog-scroll">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
</div>
|
||||
<div class="view-hero-main">
|
||||
<h2>{{ detailData.processName || '流程详情' }}</h2>
|
||||
<div class="view-hero-tags">
|
||||
<ProcessStatusTag :status="detailData.status || ''" />
|
||||
<el-tag size="small" type="info">{{ detailData.businessTypeLabel || detailData.businessType || '--' }}</el-tag>
|
||||
</div>
|
||||
<p class="view-hero-meta">
|
||||
发起人:{{ detailData.starterUserName || '--' }}
|
||||
<span class="dot">·</span>
|
||||
业务单号:{{ detailData.businessId || '--' }}
|
||||
<span class="dot">·</span>
|
||||
{{ detailData.createTime || '--' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.businessFormFields && detailData.businessFormFields.length" class="view-section">
|
||||
<h3>申请信息</h3>
|
||||
<dl class="view-kv-grid">
|
||||
<div v-for="field in detailData.businessFormFields" :key="field.label" class="view-kv">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>{{ field.value || '--' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.tasks && detailData.tasks.length" class="view-section">
|
||||
<h3>审批节点</h3>
|
||||
<div class="htl-scroll">
|
||||
<div class="htl">
|
||||
<div
|
||||
v-for="(task, idx) in detailData.tasks"
|
||||
:key="idx"
|
||||
class="htl-item"
|
||||
:class="getTimelineStatusClass(task.status)"
|
||||
>
|
||||
<div class="htl-rail">
|
||||
<span class="htl-node" />
|
||||
<span v-if="idx < detailData.tasks.length - 1" class="htl-line" />
|
||||
</div>
|
||||
<div class="htl-body">
|
||||
<div class="htl-name">{{ task.nodeName || '--' }}</div>
|
||||
<div class="htl-user">{{ task.assigneeUserName || '--' }}</div>
|
||||
<div class="htl-status">
|
||||
<ProcessStatusTag :status="task.status || ''" />
|
||||
</div>
|
||||
<div v-if="task.updateTime" class="htl-time">{{ task.updateTime }}</div>
|
||||
<div v-if="task.commentText" class="htl-comment">{{ task.commentText }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="detailVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { fetchCompletedTasks, fetchInstanceDetail } from '@/api/workflow'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
import { Document, View, Search, RefreshLeft, Close } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'WorkflowTaskCompleted' })
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.Workflow.TaskItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
|
||||
// 详情
|
||||
const detailVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailData = ref<Api.Workflow.InstanceDetail | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchCompletedTasks({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleViewDetail(row: Api.Workflow.TaskItem) {
|
||||
detailVisible.value = true
|
||||
detailLoading.value = true
|
||||
detailData.value = null
|
||||
try {
|
||||
const data = await fetchInstanceDetail(row.instanceId)
|
||||
detailData.value = {
|
||||
...data,
|
||||
processName: row.processName,
|
||||
businessType: row.businessType,
|
||||
businessTypeLabel: row.businessTypeLabel,
|
||||
businessId: row.businessId,
|
||||
starterUserId: row.starterUserId,
|
||||
starterUserName: row.starterUserName,
|
||||
} as Api.Workflow.InstanceDetail & {
|
||||
processName?: string
|
||||
businessType?: string
|
||||
businessTypeLabel?: string
|
||||
businessId?: string
|
||||
starterUserId?: string
|
||||
starterUserName?: string
|
||||
}
|
||||
} catch {
|
||||
// 错误已由全局处理
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getTimelineStatusClass(status: string) {
|
||||
if (['approved', 'completed'].includes(status)) return 'htl-done'
|
||||
if (['running', 'pending'].includes(status)) return 'htl-active'
|
||||
if (status === 'rejected') return 'htl-reject'
|
||||
return 'htl-muted'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-scroll {
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.view-hero {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 20px 22px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view-hero-icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #059669;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.view-hero-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
}
|
||||
|
||||
.view-hero-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.view-hero-meta {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
line-height: 1.5;
|
||||
|
||||
.dot {
|
||||
margin: 0 6px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.view-section {
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0 0 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 28px;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.view-kv-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── horizontal timeline ── */
|
||||
.htl-scroll {
|
||||
overflow-x: auto;
|
||||
padding: 0 0 4px 12px;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #d1d5db;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.htl {
|
||||
display: inline-flex;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.htl-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 140px;
|
||||
flex: 1 0 140px;
|
||||
}
|
||||
|
||||
/* rail: node circle + connecting line */
|
||||
.htl-rail {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.htl-node {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
background: #10b981;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 1px #10b981;
|
||||
}
|
||||
|
||||
.htl-line {
|
||||
flex: 1;
|
||||
height: 2px;
|
||||
background: #d1d5db;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.htl-body {
|
||||
padding: 8px 4px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.htl-name {
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-user {
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-status {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-time {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-comment {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* status variants */
|
||||
.htl-active .htl-node {
|
||||
background: #fff;
|
||||
border: 3px solid #10b981;
|
||||
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
|
||||
.htl-reject .htl-node {
|
||||
background: #ef4444;
|
||||
border-color: #fff;
|
||||
box-shadow: 0 0 0 1px #ef4444;
|
||||
}
|
||||
|
||||
.htl-muted .htl-node {
|
||||
background: #d1d5db;
|
||||
border-color: #fff;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.htl-done + .htl-active .htl-line,
|
||||
.htl-done + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
|
||||
.htl-active + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.workflow-module-dialog {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 12px 22px;
|
||||
border-top: 1px solid #d9e8e2;
|
||||
background: #f8fafc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,545 @@
|
||||
<!-- 待办任务 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<header class="page-head">
|
||||
<h1>待办任务</h1>
|
||||
<p class="page-desc">查看并处理待审批的工作流任务。</p>
|
||||
</header>
|
||||
|
||||
<section class="panel">
|
||||
<div class="panel-top">
|
||||
<h2 class="title-bar-heading">待办列表</h2>
|
||||
</div>
|
||||
|
||||
<div class="filter-block">
|
||||
<el-form :model="searchForm" class="filter-form" @submit.prevent>
|
||||
<div class="filter-grid">
|
||||
<el-form-item label="关键词">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="流程名称"
|
||||
clearable
|
||||
@keyup.enter="handleSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<span class="filter-hint">按流程名称模糊查询。</span>
|
||||
<div class="filter-actions-end">
|
||||
<el-button class="btn-ghost" @click="handleReset"><el-icon><RefreshLeft /></el-icon>重置</el-button>
|
||||
<el-button class="btn-main" type="primary" @click="handleSearch"><el-icon><Search /></el-icon>搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="tableData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (pagination.page - 1) * pagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="processName"
|
||||
label="流程名称"
|
||||
width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessTypeLabel"
|
||||
label="业务类型"
|
||||
width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="businessId"
|
||||
label="业务单号"
|
||||
min-width="200"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
prop="starterUserName"
|
||||
label="发起人"
|
||||
width="100"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="到达时间"
|
||||
width="180"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column label="操作" width="260" fixed="right" align="center" header-align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleApprove(row)"><el-icon><EditPen /></el-icon>审批</el-button>
|
||||
<el-button class="btn-op-item" @click="handleViewDetail(row)"><el-icon><View /></el-icon>查看详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="pagination.page"
|
||||
:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="(val) => ((pagination.page = 1), (pagination.pageSize = val), loadData())"
|
||||
@current-change="(val) => ((pagination.page = val), loadData())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 审批弹窗 -->
|
||||
<ApprovalDialog
|
||||
v-model:visible="approvalVisible"
|
||||
:task-id="approvalTaskId"
|
||||
:instance-id="approvalInstanceId"
|
||||
@done="handleApprovalDone"
|
||||
/>
|
||||
|
||||
<!-- 详情弹窗 -->
|
||||
<el-dialog
|
||||
v-model="detailVisible"
|
||||
width="720px"
|
||||
class="workflow-module-dialog"
|
||||
align-center
|
||||
destroy-on-close
|
||||
:show-close="false"
|
||||
style="backdrop-filter: none"
|
||||
>
|
||||
<div v-loading="detailLoading" class="dialog-scroll">
|
||||
<template v-if="detailData">
|
||||
<div class="view-hero">
|
||||
<div class="view-hero-icon">
|
||||
<el-icon :size="28"><Document /></el-icon>
|
||||
</div>
|
||||
<div class="view-hero-main">
|
||||
<h2>{{ detailData.processName || '流程详情' }}</h2>
|
||||
<div class="view-hero-tags">
|
||||
<ProcessStatusTag :status="detailData.status || ''" />
|
||||
<el-tag size="small" type="info">{{ detailData.businessTypeLabel || detailData.businessType || '--' }}</el-tag>
|
||||
</div>
|
||||
<p class="view-hero-meta">
|
||||
发起人:{{ detailData.starterUserName || '--' }}
|
||||
<span class="dot">·</span>
|
||||
业务单号:{{ detailData.businessId || '--' }}
|
||||
<span class="dot">·</span>
|
||||
{{ detailData.createTime || '--' }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.businessFormFields && detailData.businessFormFields.length" class="view-section">
|
||||
<h3>申请信息</h3>
|
||||
<dl class="view-kv-grid">
|
||||
<div v-for="field in detailData.businessFormFields" :key="field.label" class="view-kv">
|
||||
<dt>{{ field.label }}</dt>
|
||||
<dd>{{ field.value || '--' }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div v-if="detailData.tasks && detailData.tasks.length" class="view-section">
|
||||
<h3>审批节点</h3>
|
||||
<div class="htl-scroll">
|
||||
<div class="htl">
|
||||
<div
|
||||
v-for="(task, idx) in detailData.tasks"
|
||||
:key="idx"
|
||||
class="htl-item"
|
||||
:class="getTimelineStatusClass(task.status)"
|
||||
>
|
||||
<div class="htl-rail">
|
||||
<span class="htl-node" />
|
||||
<span v-if="idx < detailData.tasks.length - 1" class="htl-line" />
|
||||
</div>
|
||||
<div class="htl-body">
|
||||
<div class="htl-name">{{ task.nodeName || '--' }}</div>
|
||||
<div class="htl-user">{{ task.assigneeUserName || '--' }}</div>
|
||||
<div class="htl-status">
|
||||
<ProcessStatusTag :status="task.status || ''" />
|
||||
</div>
|
||||
<div v-if="task.updateTime" class="htl-time">{{ task.updateTime }}</div>
|
||||
<div v-if="task.commentText" class="htl-comment">{{ task.commentText }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button class="btn-ghost" @click="detailVisible = false"><el-icon><Close /></el-icon>关闭</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { fetchPendingTasks, fetchInstanceDetail } from '@/api/workflow'
|
||||
import ApprovalDialog from '../components/ApprovalDialog.vue'
|
||||
import ProcessStatusTag from '../components/ProcessStatusTag.vue'
|
||||
import { Document, EditPen, View, Search, RefreshLeft, Close } from '@element-plus/icons-vue'
|
||||
|
||||
defineOptions({ name: 'WorkflowTaskPending' })
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.Workflow.TaskItem[]>([])
|
||||
const loading = ref(false)
|
||||
const pagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
|
||||
// 审批
|
||||
const approvalVisible = ref(false)
|
||||
const approvalTaskId = ref('')
|
||||
const approvalInstanceId = ref('')
|
||||
|
||||
// 详情
|
||||
const detailVisible = ref(false)
|
||||
const detailLoading = ref(false)
|
||||
const detailData = ref<Api.Workflow.InstanceDetail | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchPendingTasks({
|
||||
page: pagination.page,
|
||||
pageSize: pagination.pageSize,
|
||||
keyword: searchForm.keyword || undefined
|
||||
})
|
||||
tableData.value = res.list || []
|
||||
pagination.total = res.total ?? 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.keyword = ''
|
||||
pagination.page = 1
|
||||
loadData()
|
||||
}
|
||||
|
||||
function handleApprove(row: Api.Workflow.TaskItem) {
|
||||
approvalTaskId.value = row.id
|
||||
approvalInstanceId.value = row.instanceId || ''
|
||||
approvalVisible.value = true
|
||||
}
|
||||
|
||||
function handleApprovalDone() {
|
||||
loadData()
|
||||
}
|
||||
|
||||
async function handleViewDetail(row: Api.Workflow.TaskItem) {
|
||||
detailVisible.value = true
|
||||
detailLoading.value = true
|
||||
detailData.value = null
|
||||
try {
|
||||
const data = await fetchInstanceDetail(row.instanceId)
|
||||
detailData.value = {
|
||||
...data,
|
||||
processName: row.processName,
|
||||
businessType: row.businessType,
|
||||
businessTypeLabel: row.businessTypeLabel,
|
||||
businessId: row.businessId,
|
||||
starterUserId: row.starterUserId,
|
||||
starterUserName: row.starterUserName,
|
||||
} as Api.Workflow.InstanceDetail & {
|
||||
processName?: string
|
||||
businessType?: string
|
||||
businessTypeLabel?: string
|
||||
businessId?: string
|
||||
starterUserId?: string
|
||||
starterUserName?: string
|
||||
}
|
||||
} catch {
|
||||
// 错误已由全局处理
|
||||
} finally {
|
||||
detailLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getTimelineStatusClass(status: string) {
|
||||
if (['approved', 'completed'].includes(status)) return 'htl-done'
|
||||
if (['running', 'pending'].includes(status)) return 'htl-active'
|
||||
if (status === 'rejected') return 'htl-reject'
|
||||
return 'htl-muted'
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.dialog-scroll {
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.view-hero {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
padding: 20px 22px;
|
||||
background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 55%);
|
||||
border-bottom: 1px solid #d9e8e2;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.view-hero-icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 12px;
|
||||
border: 1px solid rgba(16, 185, 129, 0.2);
|
||||
background: rgba(16, 185, 129, 0.08);
|
||||
color: #059669;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.view-hero-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
h2 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
}
|
||||
|
||||
.view-hero-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.view-hero-meta {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
line-height: 1.5;
|
||||
|
||||
.dot {
|
||||
margin: 0 6px;
|
||||
opacity: 0.7;
|
||||
}
|
||||
}
|
||||
|
||||
.view-section {
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
h3 {
|
||||
margin: 0 0 14px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
color: #64748b;
|
||||
}
|
||||
}
|
||||
|
||||
.view-kv-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 12px 28px;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
display: grid;
|
||||
grid-template-columns: 96px 1fr;
|
||||
gap: 8px 12px;
|
||||
font-size: 13px;
|
||||
align-items: start;
|
||||
|
||||
dt {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin: 0;
|
||||
color: #1e293b;
|
||||
word-break: break-word;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.view-kv-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.view-kv {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── horizontal timeline ── */
|
||||
.htl-scroll {
|
||||
overflow-x: auto;
|
||||
padding: 0 0 4px 12px;
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #d1d5db;
|
||||
border-radius: 2px;
|
||||
}
|
||||
}
|
||||
|
||||
.htl {
|
||||
display: inline-flex;
|
||||
min-width: 100%;
|
||||
}
|
||||
|
||||
.htl-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 140px;
|
||||
flex: 1 0 140px;
|
||||
}
|
||||
|
||||
/* rail: node circle + connecting line */
|
||||
.htl-rail {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.htl-node {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
background: #10b981;
|
||||
border: 2px solid #fff;
|
||||
box-shadow: 0 0 0 1px #10b981;
|
||||
}
|
||||
|
||||
.htl-line {
|
||||
flex: 1;
|
||||
height: 2px;
|
||||
background: #d1d5db;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.htl-body {
|
||||
padding: 8px 4px 0 0;
|
||||
font-size: 13px;
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.htl-name {
|
||||
font-weight: 600;
|
||||
color: #1e293b;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-user {
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-status {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.htl-time {
|
||||
font-size: 11px;
|
||||
color: #94a3b8;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.htl-comment {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
/* status variants */
|
||||
.htl-active .htl-node {
|
||||
background: #fff;
|
||||
border: 3px solid #10b981;
|
||||
box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
|
||||
}
|
||||
|
||||
.htl-reject .htl-node {
|
||||
background: #ef4444;
|
||||
border-color: #fff;
|
||||
box-shadow: 0 0 0 1px #ef4444;
|
||||
}
|
||||
|
||||
.htl-muted .htl-node {
|
||||
background: #d1d5db;
|
||||
border-color: #fff;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.htl-done + .htl-active .htl-line,
|
||||
.htl-done + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
|
||||
.htl-active + .htl-done .htl-line {
|
||||
background: #10b981;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.workflow-module-dialog {
|
||||
.el-dialog__header {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 12px 22px;
|
||||
border-top: 1px solid #d9e8e2;
|
||||
background: #f8fafc;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user