feat(frontend): preset OPERATING_MANUAL authority with filename suggestion
- add 操作手册/培训手册 option and label mapping in knowledge processing - suggest OPERATING_MANUAL on review form when filename contains 手册/指南/教材 and authority is unset/EMPLOYEE_SUBMISSION (prefill only)
This commit is contained in:
@@ -1083,9 +1083,11 @@
|
||||
<el-select v-model="qualityReviewForm.sourceAuthority" filterable allow-create>
|
||||
<el-option label="公司正式制度" value="COMPANY_POLICY" />
|
||||
<el-option label="已批准 SOP" value="APPROVED_SOP" />
|
||||
<el-option label="操作手册/培训手册" value="OPERATING_MANUAL" />
|
||||
<el-option label="法规" value="REGULATION" />
|
||||
<el-option label="员工经验投稿" value="EMPLOYEE_SUBMISSION" />
|
||||
</el-select>
|
||||
<p v-if="authoritySuggested" class="authority-suggestion-tip">已按文件名建议:操作手册/培训手册</p>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源版本">
|
||||
<el-input v-model="qualityReviewForm.sourceVersion" />
|
||||
@@ -1549,6 +1551,10 @@ const qualityReviewForm = ref<QualityReviewRequest>({
|
||||
acceptedReasonCodes: [],
|
||||
supersedesAssetId: undefined
|
||||
});
|
||||
const authoritySuggestedByName = ref(false);
|
||||
const authoritySuggested = computed(
|
||||
() => authoritySuggestedByName.value && qualityReviewForm.value.sourceAuthority === 'OPERATING_MANUAL'
|
||||
);
|
||||
const overview = ref<ProcessingOverview | null>(null);
|
||||
const overviewFailed = ref(false);
|
||||
const categoryKeyword = ref('');
|
||||
@@ -2803,6 +2809,13 @@ async function openQualityReview(asset: QualityAsset) {
|
||||
acceptedReasonCodes: [],
|
||||
supersedesAssetId: undefined
|
||||
};
|
||||
// 文件名含「手册/指南/教材」且来源权威级别未填写或仍为默认「员工经验投稿」时,按文件名建议预填,不强制、可改。
|
||||
const currentAuthority = (asset.sourceAuthority || '').trim();
|
||||
const manualNameMatched = /手册|指南|教材/.test(asset.sourceName || '');
|
||||
authoritySuggestedByName.value = manualNameMatched && (!currentAuthority || currentAuthority === 'EMPLOYEE_SUBMISSION');
|
||||
if (authoritySuggestedByName.value) {
|
||||
qualityReviewForm.value.sourceAuthority = 'OPERATING_MANUAL';
|
||||
}
|
||||
qualityScopeModes.value = {
|
||||
applicableRole: asset.applicableRole?.trim() ? 'SPECIFIED' : 'ALL',
|
||||
applicableRegion: asset.applicableRegion?.trim() ? 'SPECIFIED' : 'ALL',
|
||||
@@ -3051,6 +3064,7 @@ function sourceAuthorityLabel(value: string) {
|
||||
FORMAL_POLICY: '正式制度',
|
||||
COMPANY_POLICY: '公司正式制度',
|
||||
APPROVED_SOP: '已批准 SOP',
|
||||
OPERATING_MANUAL: '操作手册/培训手册',
|
||||
REGULATION: '法规',
|
||||
EMPLOYEE_SUBMISSION: '员工经验投稿',
|
||||
UNKNOWN: '来源待确认'
|
||||
@@ -4279,6 +4293,13 @@ async function requestAssetPurge(asset: QualityAsset) {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.authority-suggestion-tip {
|
||||
margin: 4px 0 0;
|
||||
color: #667085;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.quality-form-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
|
||||
Reference in New Issue
Block a user