From f670b79094c95d791fc43c8fc8b5858ebf8426dc Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期四, 17 九月 2026 13:50:29 +0800
Subject: [PATCH] 一些向web对齐
---
src/pages/oa/ApproveManage/approve-list/template-select.vue | 59 +++++++++++++++++------------------------------------------
1 files changed, 17 insertions(+), 42 deletions(-)
diff --git a/src/pages/oa/ApproveManage/approve-list/template-select.vue b/src/pages/oa/ApproveManage/approve-list/template-select.vue
index 073b556..e984952 100644
--- a/src/pages/oa/ApproveManage/approve-list/template-select.vue
+++ b/src/pages/oa/ApproveManage/approve-list/template-select.vue
@@ -7,7 +7,6 @@
<view class="template-select-page sales-account">
<PageHeader :title="pageHeaderTitle"
@back="goBack" />
-
<view v-if="typeOptions.length && !moduleKey"
class="step-section">
<view class="tabs-wrap">
@@ -17,12 +16,6 @@
@click="onTabClick" />
</view>
</view>
-
- <view v-if="useAllTemplatesFallback && allTemplates.length"
- class="fallback-hint">
- <text>褰撳墠绫诲瀷涓嬫棤鍖归厤妯℃澘锛屽凡鏄剧ず鍏ㄩ儴 {{ allTemplates.length }} 涓彲鐢ㄦā鏉�</text>
- </view>
-
<view class="search-section">
<view class="search-bar">
<view class="search-input">
@@ -38,7 +31,6 @@
</view>
</view>
</view>
-
<scroll-view class="list-scroll"
scroll-y
:show-scrollbar="false">
@@ -144,29 +136,21 @@
const currentTypeOption = computed(() => typeOptions.value[activeTab.value]);
- /** 鏃� moduleKey 涓斿綋鍓� Tab 绛涗笉鍒版椂锛屽睍绀哄叏閮ㄦā鏉块伩鍏嶃�屾湁鏁版嵁鍗寸┖鐧姐�� */
- const useAllTemplatesFallback = computed(() => {
- if (moduleKey.value) return false;
- if (!allTemplates.value.length) return false;
- const businessType = currentTypeOption.value?.value;
- if (businessType == null || businessType === "") return true;
- return filterTemplatesByBusinessType(allTemplates.value, businessType).length === 0;
- });
+ /** 涓嶅厑璁告墜宸ュ彂璧峰鎵圭殑绫诲瀷锛堥噰璐�/鎶ヤ环/鍙戣揣锛岀敱涓氬姟鍗曟嵁浜х敓锛屼笌 Web 涓�鑷达級 */
+ const SUBMIT_EXCLUDED_BUSINESS_TYPES = [5, 6, 7];
+ /** 褰撳墠 Tab锛堟垨涓氬姟妯″潡锛変笅鍙彂璧风殑妯℃澘 */
const currentSource = computed(() => {
if (moduleKey.value && moduleBusinessTypes.value.length) {
- const filtered = filterTemplatesByBusinessTypes(
+ return filterTemplatesByBusinessTypes(
allTemplates.value,
moduleBusinessTypes.value
);
- if (filtered.length) return filtered;
- return allTemplates.value;
}
- if (useAllTemplatesFallback.value) {
- return allTemplates.value;
- }
- const businessType = currentTypeOption.value?.value;
- return filterTemplatesByBusinessType(allTemplates.value, businessType);
+ return filterTemplatesByBusinessType(
+ allTemplates.value,
+ currentTypeOption.value?.value
+ );
});
const displayList = computed(() => {
@@ -184,15 +168,11 @@
if (moduleConfig.value?.label) {
return `鏆傛棤${moduleConfig.value.label}鍙敤妯℃澘`;
}
- if (useAllTemplatesFallback.value) {
- return "褰撳墠绫诲瀷涓嬫棤鍖归厤妯℃澘";
- }
const typeName = currentTypeOption.value?.name || "璇ュ鎵圭被鍨�";
return `鏆傛棤${typeName}涓嬬殑妯℃澘锛堝彲鍒囨崲涓婃柟绫诲瀷锛塦;
});
- const businessTypeText = type =>
- getBusinessTypeLabel(type, typeLabelMap.value);
+ const businessTypeText = type => getBusinessTypeLabel(type, typeLabelMap.value);
const enabledText = enabled => {
const val = String(enabled ?? "");
@@ -222,10 +202,15 @@
fetchApprovalTemplateTypes(),
fetchEnabledApprovalTemplates(),
]);
- let resolvedOpts = opts?.length ? opts : buildTypeOptionsFromTemplates(templates);
+ let resolvedOpts = opts?.length
+ ? opts
+ : buildTypeOptionsFromTemplates(templates);
if (!resolvedOpts.length) {
resolvedOpts = [...FALLBACK_BUSINESS_TYPE_OPTIONS];
}
+ resolvedOpts = resolvedOpts.filter(
+ opt => !SUBMIT_EXCLUDED_BUSINESS_TYPES.includes(Number(opt.value))
+ );
typeOptions.value = resolvedOpts;
typeLabelMap.value = buildTypeLabelMap(resolvedOpts);
allTemplates.value = templates;
@@ -239,8 +224,8 @@
}
if (moduleKey.value) {
- const resolved = resolveModuleBusinessType(moduleKey.value, opts);
- const idx = opts.findIndex(
+ const resolved = resolveModuleBusinessType(moduleKey.value, resolvedOpts);
+ const idx = resolvedOpts.findIndex(
opt => String(opt.value) === String(resolved)
);
activeTab.value =
@@ -292,16 +277,6 @@
display: flex;
flex-direction: column;
min-height: 100vh;
- }
-
- .fallback-hint {
- margin: 8px 12px 0;
- padding: 8px 12px;
- font-size: 12px;
- color: #e6a23c;
- background: #fdf6ec;
- border-radius: 6px;
- line-height: 1.5;
}
.step-section {
--
Gitblit v1.9.3