提交
This commit is contained in:
1 parent
8248e5ef15
commit
b9b4cc2673
57 files changed
+42800
-30473
No files matched your search
@@ -31,77 +31,72 @@
|
||||
<div class="form-container">
|
||||
<div class="form-header">
|
||||
<h2>欢迎登录</h2>
|
||||
<p>微信扫一扫,授权手机号后自动登录</p>
|
||||
<p>{{ loginTab === 'wechat' ? '微信扫一扫,授权手机号后自动登录' : '请输入账号密码登录系统' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="qr-login">
|
||||
<div class="qr-frame">
|
||||
<img v-if="qrImage" class="qr-image" :src="qrImage" alt="登录二维码" />
|
||||
<div v-else class="qr-placeholder">{{ qrStatus === 'creating' ? '生成中…' : '暂无二维码' }}</div>
|
||||
</div>
|
||||
<p class="qr-status" :class="{ error: qrStatus === 'failed' || qrStatus === 'expired' }">
|
||||
{{ qrStatusText }}
|
||||
</p>
|
||||
<el-button :loading="qrLoading" @click="refreshQr">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
刷新二维码
|
||||
</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="loginTab" class="login-tabs" stretch @tab-change="handleLoginTabChange">
|
||||
<el-tab-pane label="微信扫码" name="wechat">
|
||||
<div class="qr-login">
|
||||
<div class="qr-frame">
|
||||
<img v-if="qrImage" class="qr-image" :src="qrImage" alt="登录二维码" />
|
||||
<div v-else class="qr-placeholder">
|
||||
{{ qrStatus === 'creating' ? '生成中…' : '暂无二维码' }}
|
||||
</div>
|
||||
</div>
|
||||
<p class="qr-status" :class="{ error: qrStatus === 'failed' || qrStatus === 'expired' }">
|
||||
{{ qrStatusText }}
|
||||
</p>
|
||||
<el-button :loading="qrLoading" @click="refreshQr">
|
||||
<el-icon><Refresh /></el-icon>
|
||||
刷新二维码
|
||||
</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
<div class="password-toggle" @click="showPasswordLogin = !showPasswordLogin">
|
||||
<span class="divider-line"></span>
|
||||
<button type="button" class="toggle-btn">
|
||||
<el-icon>
|
||||
<ArrowDown v-if="!showPasswordLogin" />
|
||||
<ArrowUp v-else />
|
||||
</el-icon>
|
||||
或使用账号密码登录
|
||||
</button>
|
||||
<span class="divider-line"></span>
|
||||
</div>
|
||||
|
||||
<el-form
|
||||
v-show="showPasswordLogin"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
@keyup.enter="handleSubmit"
|
||||
class="login-form"
|
||||
>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model.trim="formData.username"
|
||||
placeholder="请输入用户名"
|
||||
size="large"
|
||||
:prefix-icon="User"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model.trim="formData.password"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
size="large"
|
||||
:prefix-icon="Lock"
|
||||
show-password
|
||||
autocomplete="off"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
class="login-btn"
|
||||
@click="handleSubmit"
|
||||
<el-tab-pane label="账号密码" name="password">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
@keyup.enter="handleSubmit"
|
||||
class="login-form"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
登 录
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form-item prop="username">
|
||||
<el-input
|
||||
v-model.trim="formData.username"
|
||||
placeholder="请输入用户名"
|
||||
size="large"
|
||||
:prefix-icon="User"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
v-model.trim="formData.password"
|
||||
type="password"
|
||||
placeholder="请输入密码"
|
||||
size="large"
|
||||
:prefix-icon="Lock"
|
||||
show-password
|
||||
autocomplete="off"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
class="login-btn"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<el-icon><Check /></el-icon>
|
||||
登 录
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<div class="form-footer">
|
||||
<span class="copyright">中科兴皖 © {{ currentYear }}</span>
|
||||
@@ -118,7 +113,8 @@
|
||||
import { resolveSafeRedirectTarget } from '@/utils/router'
|
||||
import { ElNotification, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { User, Lock, Refresh, Check, ArrowDown, ArrowUp } from '@element-plus/icons-vue'
|
||||
import { User, Lock, Refresh, Check } from '@element-plus/icons-vue'
|
||||
import type { TabPaneName } from 'element-plus'
|
||||
|
||||
defineOptions({ name: 'Login' })
|
||||
|
||||
@@ -129,7 +125,7 @@
|
||||
const route = useRoute()
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
const showPasswordLogin = ref(false)
|
||||
const loginTab = ref<'wechat' | 'password'>('wechat')
|
||||
|
||||
const formData = reactive({
|
||||
username: '',
|
||||
@@ -281,6 +277,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
const handleLoginTabChange = (name: TabPaneName) => {
|
||||
if (name === 'password') {
|
||||
stopPoll()
|
||||
return
|
||||
}
|
||||
if (name === 'wechat') {
|
||||
if (!sessionId.value || qrStatus.value === 'failed' || qrStatus.value === 'expired') {
|
||||
void refreshQr()
|
||||
} else if (qrStatus.value === 'pending' || qrStatus.value === 'scanned') {
|
||||
startPoll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 登录
|
||||
const handleSubmit = async () => {
|
||||
if (!formRef.value) return
|
||||
@@ -415,7 +425,7 @@
|
||||
}
|
||||
|
||||
.form-header {
|
||||
margin-bottom: 28px;
|
||||
margin-bottom: 20px;
|
||||
text-align: center;
|
||||
|
||||
h2 {
|
||||
@@ -432,12 +442,45 @@
|
||||
}
|
||||
}
|
||||
|
||||
.login-tabs {
|
||||
:deep(.el-tabs__header) {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__nav-wrap::after) {
|
||||
height: 1px;
|
||||
background-color: #e5e7eb;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item) {
|
||||
font-size: 15px;
|
||||
color: #64748b;
|
||||
|
||||
&:hover {
|
||||
color: #10b981;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
color: #10b981;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background-color: #10b981;
|
||||
}
|
||||
|
||||
:deep(.el-tabs__content) {
|
||||
overflow: visible;
|
||||
}
|
||||
}
|
||||
|
||||
.qr-login {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
margin-bottom: 8px;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
.qr-frame {
|
||||
@@ -475,39 +518,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
.password-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin: 24px 0 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.divider-line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: #e5e7eb;
|
||||
}
|
||||
|
||||
.toggle-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: #64748b;
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
|
||||
&:hover {
|
||||
color: #10b981;
|
||||
}
|
||||
}
|
||||
|
||||
.login-form {
|
||||
margin-top: 16px;
|
||||
padding-top: 4px;
|
||||
|
||||
:deep(.el-form-item) {
|
||||
margin-bottom: 24px;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<!-- 旧「采集协议号管理」菜单入口:重定向至细胞采集基础信息维护 -->
|
||||
<!-- 旧「采集协议号管理」菜单入口:重定向至采集地区及医院(历史入口保留) -->
|
||||
<template>
|
||||
<div />
|
||||
</template>
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<section class="panel">
|
||||
<el-tabs v-model="activeTab" class="panel-pill-tabs panel-pill-tabs--lg">
|
||||
<el-tab-pane label="采集地区及医院" name="region">
|
||||
<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">
|
||||
@@ -89,15 +91,27 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="工作人员"
|
||||
min-width="160"
|
||||
align="left"
|
||||
min-width="240"
|
||||
align="center"
|
||||
header-align="center"
|
||||
class-name="hospital-info-col"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.staffNames && row.staffNames.length">
|
||||
<div v-for="(name, idx) in row.staffNames" :key="idx" class="hospital-cell-line">
|
||||
{{ name }}
|
||||
<div class="staff-names-grid">
|
||||
<div
|
||||
v-for="(col, colIdx) in splitStaffNameColumns(row.staffNames)"
|
||||
:key="colIdx"
|
||||
class="staff-names-col"
|
||||
>
|
||||
<div
|
||||
v-for="(name, idx) in col"
|
||||
:key="idx"
|
||||
class="hospital-cell-line"
|
||||
>
|
||||
{{ name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<span v-else class="muted">—</span>
|
||||
@@ -257,96 +271,107 @@
|
||||
<div class="hospital-dialog-head">
|
||||
<span class="muted">当前地区:{{ currentRegionName }}</span>
|
||||
</div>
|
||||
<div class="list-toolbar hospital-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ hospitalSelected.length }}</span> 项
|
||||
<section class="panel dialog-nested-list">
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ hospitalSelected.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAddHospital">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增医院
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="hospitalSelected.length === 0"
|
||||
@click="handleBatchDeleteHospital"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAddHospital">
|
||||
<el-icon><Plus /></el-icon>
|
||||
新增医院
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="hospitalSelected.length === 0"
|
||||
@click="handleBatchDeleteHospital"
|
||||
>
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-body list-wrap hospital-table-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="hospitalTable"
|
||||
v-loading="hospitalLoading"
|
||||
stripe
|
||||
row-key="id"
|
||||
max-height="360"
|
||||
@selection-change="onHospitalSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="hospitalName"
|
||||
label="医院名称"
|
||||
min-width="200"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="hospitalTable"
|
||||
v-loading="hospitalLoading"
|
||||
stripe
|
||||
row-key="id"
|
||||
max-height="360"
|
||||
@selection-change="onHospitalSelectionChange"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.remark">{{ row.remark }}</span>
|
||||
<span v-else class="muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleEditHospital(row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button class="btn-op-item" @click="handleDeleteHospital(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="hospitalPagination.page"
|
||||
:page-size="hospitalPagination.pageSize"
|
||||
:total="hospitalPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(hospitalPagination.page = 1),
|
||||
(hospitalPagination.pageSize = val),
|
||||
loadHospitals()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((hospitalPagination.page = val), loadHospitals())"
|
||||
/>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="
|
||||
(index) =>
|
||||
(hospitalPagination.page - 1) * hospitalPagination.pageSize + index + 1
|
||||
"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="hospitalName"
|
||||
label="医院名称"
|
||||
min-width="200"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="remark"
|
||||
label="备注"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.remark">{{ row.remark }}</span>
|
||||
<span v-else class="muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="handleEditHospital(row)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleDeleteHospital(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="hospitalPagination.page"
|
||||
:page-size="hospitalPagination.pageSize"
|
||||
:total="hospitalPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(hospitalPagination.page = 1),
|
||||
(hospitalPagination.pageSize = val),
|
||||
loadHospitals()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((hospitalPagination.page = val), loadHospitals())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-dialog
|
||||
v-model="hospitalFormVisible"
|
||||
@@ -404,8 +429,8 @@
|
||||
<el-dialog
|
||||
v-model="staffDialogVisible"
|
||||
:title="staffDialogTitle"
|
||||
width="860px"
|
||||
class="dialog-form-layout"
|
||||
width="1100px"
|
||||
class="dialog-form-layout staff-config-dialog"
|
||||
align-center
|
||||
append-to-body
|
||||
modal-class="protocol-dialog-mask"
|
||||
@@ -416,124 +441,127 @@
|
||||
<div class="hospital-dialog-head">
|
||||
<span class="muted">当前地区:{{ currentRegionName }}</span>
|
||||
</div>
|
||||
<div class="list-toolbar hospital-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ staffSelected.length }}</span> 项
|
||||
<section class="panel dialog-nested-list">
|
||||
<div class="list-toolbar">
|
||||
<div class="list-toolbar-row">
|
||||
<div class="list-toolbar-selected">
|
||||
已选 <span class="sel-num">{{ staffSelected.length }}</span> 项
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAddStaff">
|
||||
<el-icon><Plus /></el-icon>
|
||||
添加人员
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="staffSelected.length === 0"
|
||||
@click="handleBatchDeleteStaff"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
批量移除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button class="btn-main" type="primary" @click="handleAddStaff">
|
||||
<el-icon><Plus /></el-icon>
|
||||
添加人员
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-ghost"
|
||||
type="danger"
|
||||
:disabled="staffSelected.length === 0"
|
||||
@click="handleBatchDeleteStaff"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
批量移除
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="list-body list-wrap hospital-table-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="staffTable"
|
||||
v-loading="staffLoading"
|
||||
stripe
|
||||
row-key="id"
|
||||
max-height="360"
|
||||
@selection-change="onStaffSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
label="姓名"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="userNo"
|
||||
label="工号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="deptName"
|
||||
label="部门"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
<div class="list-body list-wrap">
|
||||
<el-table
|
||||
class="list-table"
|
||||
:data="staffTable"
|
||||
v-loading="staffLoading"
|
||||
stripe
|
||||
row-key="id"
|
||||
max-height="560"
|
||||
@selection-change="onStaffSelectionChange"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.deptName">{{ row.deptName }}</span>
|
||||
<span v-else class="muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否负责人"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.isLeader" type="success" size="small">负责人</el-tag>
|
||||
<el-tag v-else type="info" size="small">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="toggleStaffLeader(row)">
|
||||
<el-icon>
|
||||
<StarFilled v-if="row.isLeader" />
|
||||
<Star v-else />
|
||||
</el-icon>
|
||||
{{ row.isLeader ? '取消负责人' : '设为负责人' }}
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleDeleteStaff(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="staffPagination.page"
|
||||
:page-size="staffPagination.pageSize"
|
||||
:total="staffPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(staffPagination.page = 1), (staffPagination.pageSize = val), loadStaff()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((staffPagination.page = val), loadStaff())"
|
||||
/>
|
||||
<el-table-column type="selection" min-width="55" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="(index) => (staffPagination.page - 1) * staffPagination.pageSize + index + 1"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="userName"
|
||||
label="姓名"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="userNo"
|
||||
label="工号"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="deptName"
|
||||
label="部门"
|
||||
min-width="140"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.deptName">{{ row.deptName }}</span>
|
||||
<span v-else class="muted">—</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="是否负责人"
|
||||
min-width="120"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.isLeader" type="success" size="small">负责人</el-tag>
|
||||
<el-tag v-else type="info" size="small">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
min-width="260"
|
||||
fixed="right"
|
||||
align="center"
|
||||
header-align="center"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="toggleStaffLeader(row)">
|
||||
<el-icon>
|
||||
<StarFilled v-if="row.isLeader" />
|
||||
<Star v-else />
|
||||
</el-icon>
|
||||
{{ row.isLeader ? '取消负责人' : '设为负责人' }}
|
||||
</el-button>
|
||||
<el-button class="btn-op-item" @click="handleDeleteStaff(row)">
|
||||
<el-icon><Delete /></el-icon>
|
||||
移除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
:current-page="staffPagination.page"
|
||||
:page-size="staffPagination.pageSize"
|
||||
:total="staffPagination.total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="
|
||||
(val) => (
|
||||
(staffPagination.page = 1), (staffPagination.pageSize = val), loadStaff()
|
||||
)
|
||||
"
|
||||
@current-change="(val) => ((staffPagination.page = val), loadStaff())"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-dialog
|
||||
v-model="staffAddVisible"
|
||||
title="添加人员"
|
||||
width="520px"
|
||||
width="640px"
|
||||
class="dialog-form-layout"
|
||||
align-center
|
||||
append-to-body
|
||||
@@ -544,13 +572,17 @@
|
||||
<el-form label-position="top">
|
||||
<el-form-item label="系统人员" required>
|
||||
<el-select
|
||||
v-model="staffAddForm.userId"
|
||||
v-model="staffAddForm.userIds"
|
||||
multiple
|
||||
filterable
|
||||
remote
|
||||
clearable
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
:max-collapse-tags="4"
|
||||
:remote-method="remoteSearchUsers"
|
||||
:loading="staffUserLoading"
|
||||
placeholder="搜索姓名/账号"
|
||||
placeholder="搜索并选择一人或多名人员"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
@@ -561,7 +593,11 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设为负责人">
|
||||
<el-form-item>
|
||||
<template #label>
|
||||
设为负责人
|
||||
<span class="form-label-tip">勾选后,本次添加的人员均标记为负责人</span>
|
||||
</template>
|
||||
<el-switch v-model="staffAddForm.isLeader" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -596,8 +632,6 @@
|
||||
:meta="viewRow?.createTime ? '创建时间:' + viewRow.createTime : ''"
|
||||
:sections="viewSections"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
@@ -641,7 +675,14 @@
|
||||
} from '@/api/admin'
|
||||
defineOptions({ name: 'BizCollectionRegion' })
|
||||
|
||||
const activeTab = ref('region')
|
||||
/** 工作人员两列展示:左列 ceil(n/2),右列剩余(如 5 人 → 3+2) */
|
||||
function splitStaffNameColumns(names: string[]): [string[], string[]] {
|
||||
const list = names || []
|
||||
if (list.length <= 1) return [list, []]
|
||||
const mid = Math.ceil(list.length / 2)
|
||||
return [list.slice(0, mid), list.slice(mid)]
|
||||
}
|
||||
|
||||
const searchForm = reactive<{ keyword: string }>({ keyword: '' })
|
||||
const tableData = ref<Api.BizCollectionRegion.RegionItem[]>([])
|
||||
const selectedRows = ref<Api.BizCollectionRegion.RegionItem[]>([])
|
||||
@@ -943,8 +984,8 @@
|
||||
const staffPagination = reactive({ page: 1, pageSize: 10, total: 0 })
|
||||
const staffAddVisible = ref(false)
|
||||
const staffAddLoading = ref(false)
|
||||
const staffAddForm = reactive<{ userId: string; isLeader: boolean }>({
|
||||
userId: '',
|
||||
const staffAddForm = reactive<{ userIds: string[]; isLeader: boolean }>({
|
||||
userIds: [],
|
||||
isLeader: false
|
||||
})
|
||||
const staffUserOptions = ref<Api.User.UserItem[]>([])
|
||||
@@ -971,11 +1012,20 @@
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await fetchRegionStaffList(currentRegionId.value, {
|
||||
page: 1,
|
||||
pageSize: 500
|
||||
})
|
||||
boundStaffUserIds.value = new Set((res.list || []).map((s) => s.userId))
|
||||
// 后端 pageSize 上限为 100,分页拉全量已绑定人员用于「添加人员」下拉去重
|
||||
const pageSize = 100
|
||||
const ids = new Set<string>()
|
||||
let page = 1
|
||||
let total = 0
|
||||
do {
|
||||
const res = await fetchRegionStaffList(currentRegionId.value, { page, pageSize })
|
||||
for (const s of res.list || []) {
|
||||
if (s.userId) ids.add(s.userId)
|
||||
}
|
||||
total = res.total ?? 0
|
||||
page += 1
|
||||
} while (ids.size < total)
|
||||
boundStaffUserIds.value = ids
|
||||
} catch {
|
||||
boundStaffUserIds.value = new Set(staffTable.value.map((s) => s.userId))
|
||||
}
|
||||
@@ -1005,7 +1055,7 @@
|
||||
}
|
||||
|
||||
function handleAddStaff() {
|
||||
staffAddForm.userId = ''
|
||||
staffAddForm.userIds = []
|
||||
staffAddForm.isLeader = false
|
||||
staffUserOptions.value = []
|
||||
staffAddVisible.value = true
|
||||
@@ -1017,36 +1067,52 @@
|
||||
try {
|
||||
const res = await fetchUserList({
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 50,
|
||||
keyword: query || undefined,
|
||||
status: '1'
|
||||
})
|
||||
const bound = boundStaffUserIds.value
|
||||
staffUserOptions.value = (res.list || []).filter((u) => !bound.has(u.id))
|
||||
const selectedIds = new Set(staffAddForm.userIds)
|
||||
const keep = staffUserOptions.value.filter((u) => selectedIds.has(u.id))
|
||||
const keepIds = new Set(keep.map((u) => u.id))
|
||||
const searched = (res.list || []).filter((u) => !bound.has(u.id) && !keepIds.has(u.id))
|
||||
staffUserOptions.value = [...keep, ...searched]
|
||||
} finally {
|
||||
staffUserLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function submitAddStaff() {
|
||||
if (!staffAddForm.userId) {
|
||||
const userIds = [...staffAddForm.userIds]
|
||||
if (userIds.length === 0) {
|
||||
ElMessage.warning('请选择系统人员')
|
||||
return
|
||||
}
|
||||
staffAddLoading.value = true
|
||||
try {
|
||||
await fetchCreateRegionStaff(currentRegionId.value, {
|
||||
userId: staffAddForm.userId,
|
||||
isLeader: staffAddForm.isLeader
|
||||
})
|
||||
ElMessage.success('添加成功')
|
||||
let ok = 0
|
||||
let fail = 0
|
||||
for (const userId of userIds) {
|
||||
try {
|
||||
await fetchCreateRegionStaff(currentRegionId.value, {
|
||||
userId,
|
||||
isLeader: staffAddForm.isLeader
|
||||
})
|
||||
ok += 1
|
||||
} catch {
|
||||
fail += 1
|
||||
}
|
||||
}
|
||||
if (ok === 0) {
|
||||
ElMessage.error('添加失败')
|
||||
return
|
||||
}
|
||||
ElMessage.success(fail > 0 ? `成功添加 ${ok} 人,${fail} 人失败` : `成功添加 ${ok} 人`)
|
||||
staffAddVisible.value = false
|
||||
staffAddForm.userId = ''
|
||||
staffAddForm.userIds = []
|
||||
staffAddForm.isLeader = false
|
||||
await loadStaff()
|
||||
await loadData()
|
||||
} catch {
|
||||
/* */
|
||||
} finally {
|
||||
staffAddLoading.value = false
|
||||
}
|
||||
@@ -1115,12 +1181,10 @@
|
||||
color: var(--mint-text-muted);
|
||||
}
|
||||
|
||||
.hospital-toolbar {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.hospital-table-wrap {
|
||||
padding-top: 0;
|
||||
/* 弹窗内嵌标准列表面板:工具栏与表格由全局 list-toolbar / list-body 分隔 */
|
||||
.dialog-nested-list {
|
||||
margin-top: 0;
|
||||
min-height: 480px;
|
||||
}
|
||||
|
||||
:deep(.hospital-info-col .cell) {
|
||||
@@ -1128,6 +1192,19 @@
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.staff-names-grid {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.staff-names-col {
|
||||
min-width: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hospital-cell-line {
|
||||
line-height: 1.8;
|
||||
}
|
||||
@@ -1140,3 +1217,15 @@
|
||||
color: var(--mint-text-muted);
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
/* append-to-body 弹窗需非 scoped,才能提高可视高度 */
|
||||
.el-dialog.staff-config-dialog.dialog-form-layout {
|
||||
width: 1100px;
|
||||
max-height: calc(100vh - 48px);
|
||||
}
|
||||
|
||||
.el-dialog.staff-config-dialog.dialog-form-layout .el-dialog__body {
|
||||
min-height: 560px;
|
||||
}
|
||||
</style>
|
||||
@@ -90,19 +90,20 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oa-detail__section">
|
||||
<section class="oa-detail__section oa-detail__section--progress">
|
||||
<OaProgressChain
|
||||
v-if="detail?.id"
|
||||
:items="timelineItems"
|
||||
:instance-id="detail.id"
|
||||
@refresh="load"
|
||||
/>
|
||||
<OaCommentPanel
|
||||
v-if="detail?.id"
|
||||
:instance-id="detail.id"
|
||||
:instance-status="detail.status || ''"
|
||||
:comments="detail.comments || []"
|
||||
@refresh="load"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<section class="oa-detail__section oa-detail__section--progress">
|
||||
<OaProgressChain :items="timelineItems" />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
@@ -215,6 +216,7 @@
|
||||
} from '@/api/oaApproval'
|
||||
import OaCommentPanel from '@/components/oa-approval/OaCommentPanel.vue'
|
||||
import OaProgressChain from '@/components/oa-approval/OaProgressChain.vue'
|
||||
import { mergeProgressWithComments } from '@/utils/oa-progress-merge-comments'
|
||||
import { MAX_ADMIN_LIST_PAGE_SIZE } from '@/utils/fetch-paged-list'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { refreshOaMenuBadges } from '@/utils/oa-menu-badge'
|
||||
@@ -254,11 +256,13 @@
|
||||
|
||||
const prettyForm = computed(() => JSON.stringify(detail.value?.formDataJson || {}, null, 2))
|
||||
|
||||
/** 进度以详情 API progress 投影为准(勿回落无序 tasks) */
|
||||
/** 进度 + 讨论评论按时间交错(钉钉式);未到达节点仍在轴末 */
|
||||
const timelineItems = computed(() => {
|
||||
const list = detail.value?.progress
|
||||
if (!Array.isArray(list) || !list.length) return []
|
||||
return list
|
||||
if (!Array.isArray(list) || !list.length) {
|
||||
return mergeProgressWithComments([], detail.value?.comments || [])
|
||||
}
|
||||
const progressMapped = list
|
||||
.filter((p: any) => {
|
||||
// 打回只保留审批人节点,过滤独立终态「已打回」行
|
||||
const kind = String(p?.kind || '')
|
||||
@@ -292,6 +296,7 @@
|
||||
}))
|
||||
: []
|
||||
}))
|
||||
return mergeProgressWithComments(progressMapped, detail.value?.comments || [])
|
||||
})
|
||||
|
||||
const currentUserId = computed(() => {
|
||||
|
||||
@@ -0,0 +1,298 @@
|
||||
<!-- OA 提到我的 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<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.appName"
|
||||
placeholder="请输入流程名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人">
|
||||
<el-input
|
||||
v-model="searchForm.initiatorName"
|
||||
placeholder="请输入申请人"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请时间">
|
||||
<el-date-picker
|
||||
v-model="applyTimeRange"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程状态">
|
||||
<el-select v-model="searchForm.instanceStatus" placeholder="全部" clearable>
|
||||
<el-option label="全部" value="" />
|
||||
<el-option label="进行中" value="running" />
|
||||
<el-option label="已完成" value="completed" />
|
||||
<el-option label="已拒绝" value="rejected" />
|
||||
<el-option label="已打回" value="returned" />
|
||||
<el-option label="已撤销" value="cancelled" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="filter-actions-row">
|
||||
<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="rows" v-loading="loading" stripe>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
min-width="68"
|
||||
align="center"
|
||||
header-align="center"
|
||||
:index="indexMethod"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="appName"
|
||||
label="流程名称"
|
||||
min-width="160"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.appName || row.title || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="initiatorUserName"
|
||||
label="申请人"
|
||||
min-width="120"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.initiatorUserName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="170"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.applyTime || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="currentNodeName"
|
||||
label="当前节点"
|
||||
min-width="140"
|
||||
align="center"
|
||||
>
|
||||
<template #default="{ row }">{{ row.currentNodeName || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="currentApproverNames"
|
||||
label="当前审批人"
|
||||
min-width="140"
|
||||
align="center"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">{{ row.currentApproverNames || '-' }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="instanceStatus" label="流程状态" min-width="110" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag size="small" :type="statusType(row.instanceStatus)">
|
||||
{{ statusText(row.instanceStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" min-width="260" fixed="right" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-button class="btn-op-item primary" @click="openDetail(row)">
|
||||
<el-icon><View /></el-icon>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
class="btn-op-item"
|
||||
:loading="printingId === row.id"
|
||||
@click="printRow(row)"
|
||||
>
|
||||
<el-icon><Printer /></el-icon>
|
||||
打印
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<el-pagination
|
||||
v-model:current-page="page"
|
||||
v-model:page-size="pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
background
|
||||
@size-change="load"
|
||||
@current-change="load"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onActivated, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Printer, RefreshLeft, Search, View } from '@element-plus/icons-vue'
|
||||
import { fetchOaInstanceDetail, fetchOaTasks } from '@/api/oaApproval'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { exportOaApprovalPdf } from '@/utils/oa-approval-print'
|
||||
|
||||
defineOptions({ name: 'OaApprovalMention' })
|
||||
|
||||
const router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const loading = ref(false)
|
||||
const printingId = ref('')
|
||||
const rows = ref<any[]>([])
|
||||
const page = ref(1)
|
||||
const pageSize = ref(20)
|
||||
const total = ref(0)
|
||||
const applyTimeRange = ref<string[] | null>(null)
|
||||
const searchForm = reactive({
|
||||
appName: '',
|
||||
initiatorName: '',
|
||||
instanceStatus: ''
|
||||
})
|
||||
|
||||
function indexMethod(index: number) {
|
||||
return (page.value - 1) * pageSize.value + index + 1
|
||||
}
|
||||
|
||||
function currentPrinterName() {
|
||||
const info: any = userStore.info || userStore.getUserInfo || {}
|
||||
return String(
|
||||
info.realName || info.nickName || info.userName || info.username || ''
|
||||
).trim()
|
||||
}
|
||||
|
||||
function statusType(s: string) {
|
||||
if (s === 'pending' || s === 'running') return 'warning'
|
||||
if (s === 'approved' || s === 'completed' || s === 'done') return 'success'
|
||||
if (s === 'rejected' || s === 'cancelled' || s === 'returned') return 'danger'
|
||||
return 'info'
|
||||
}
|
||||
|
||||
function statusText(s: string) {
|
||||
if (!s) return '-'
|
||||
const map: Record<string, string> = {
|
||||
pending: '待处理',
|
||||
running: '进行中',
|
||||
approved: '已同意',
|
||||
rejected: '已拒绝',
|
||||
completed: '已完成',
|
||||
cancelled: '已撤销',
|
||||
done: '已结束',
|
||||
returned: '已打回',
|
||||
transferred: '已转交'
|
||||
}
|
||||
return map[s] || s
|
||||
}
|
||||
|
||||
function openDetail(row: any) {
|
||||
const id = row.id
|
||||
if (!id) return
|
||||
router.push({ path: `/system-manage/oa-approval/instances/${id}` })
|
||||
}
|
||||
|
||||
async function printRow(row: any) {
|
||||
const id = String(row?.id || '').trim()
|
||||
if (!id || printingId.value) return
|
||||
printingId.value = id
|
||||
let detail: any
|
||||
try {
|
||||
detail = await fetchOaInstanceDetail(id)
|
||||
} catch {
|
||||
printingId.value = ''
|
||||
ElMessage.error('加载审批单失败')
|
||||
return
|
||||
}
|
||||
try {
|
||||
await exportOaApprovalPdf(detail, { printerName: currentPrinterName() })
|
||||
ElMessage.success('PDF 已下载')
|
||||
} catch {
|
||||
ElMessage.error('导出 PDF 失败')
|
||||
} finally {
|
||||
printingId.value = ''
|
||||
}
|
||||
}
|
||||
|
||||
function buildFilterParams() {
|
||||
const range = applyTimeRange.value
|
||||
return {
|
||||
appName: searchForm.appName,
|
||||
initiatorName: searchForm.initiatorName,
|
||||
instanceStatus: searchForm.instanceStatus,
|
||||
applyTimeFrom: range?.[0] || '',
|
||||
applyTimeTo: range?.[1] || '',
|
||||
page: page.value,
|
||||
pageSize: pageSize.value
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
page.value = 1
|
||||
void load()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.appName = ''
|
||||
searchForm.initiatorName = ''
|
||||
searchForm.instanceStatus = ''
|
||||
applyTimeRange.value = null
|
||||
page.value = 1
|
||||
void load()
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await fetchOaTasks('mention', buildFilterParams())
|
||||
rows.value = res?.list || []
|
||||
total.value = res?.total || 0
|
||||
} catch {
|
||||
rows.value = []
|
||||
total.value = 0
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
watchDebounced(
|
||||
[searchForm, applyTimeRange],
|
||||
() => {
|
||||
page.value = 1
|
||||
void load()
|
||||
},
|
||||
{ debounce: 300, deep: true }
|
||||
)
|
||||
|
||||
onMounted(load)
|
||||
onActivated(load)
|
||||
</script>
|
||||
Reference in new issue
Block a user