| | |
| | | <up-divider /> |
| | | <view class="item-details"> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">模板类型</text> |
| | | <text class="detail-value">{{ templateTypeText(item.templateType) }}</text> |
| | | <text class="detail-label">审批类型</text> |
| | | <text class="detail-value">{{ businessTypeText(item.businessType) }}</text> |
| | | </view> |
| | | <view class="detail-row"> |
| | | <text class="detail-label">审批节点</text> |
| | |
| | | deleteApprovalTemplate, |
| | | listApprovalTemplatePage, |
| | | } from "@/api/oa/approvalTemplate.js"; |
| | | import { |
| | | buildTypeLabelMap, |
| | | fetchApprovalTemplateTypes, |
| | | getTemplateTypeLabel, |
| | | } from "../../_utils/approvalTemplateType.js"; |
| | | |
| | | const EDIT_STORAGE_KEY = "oa_approve_template_edit_row"; |
| | | const typeLabelMap = ref({}); |
| | | |
| | | const queryParams = reactive({ |
| | | templateName: "", |
| | |
| | | return "info"; |
| | | }; |
| | | |
| | | const templateTypeText = type => { |
| | | const val = Number(type); |
| | | if (val === 0) return "系统内置"; |
| | | if (val === 1) return "自定义"; |
| | | return "-"; |
| | | }; |
| | | const businessTypeText = type => |
| | | getTemplateTypeLabel(type, typeLabelMap.value); |
| | | |
| | | const loadTemplateTypes = () => |
| | | fetchApprovalTemplateTypes() |
| | | .then(opts => { |
| | | typeLabelMap.value = buildTypeLabelMap(opts); |
| | | }) |
| | | .catch(() => {}); |
| | | |
| | | const nodeCount = item => { |
| | | const count = item?.nodes?.length; |
| | |
| | | }; |
| | | |
| | | onShow(() => { |
| | | loadTemplateTypes(); |
| | | handleSearch(); |
| | | }); |
| | | </script> |