按方案 A 增加租户级 ACL(字段+人员),详情返回可编辑字段,保存改为服务端 merge;弹窗 footer 提供权限配置入口。关联 #93。 Co-authored-by: Cursor <cursoragent@cursor.com>
62 lines
1.6 KiB
TypeScript
62 lines
1.6 KiB
TypeScript
import request from '@/utils/http'
|
|
|
|
export type SampleStorageCertQcDetail = {
|
|
sampleCode: string
|
|
labFlowCode: string
|
|
protocolCode: string
|
|
motherName: string
|
|
sampleTypeName: string
|
|
sampleTypeKey: string | null
|
|
collectionProtocolId?: string
|
|
qcWorkOrderId?: string
|
|
filledFlag: boolean
|
|
payload: Record<string, unknown>
|
|
prefill?: Record<string, unknown>
|
|
editableFieldKeys?: string[]
|
|
canConfigureAcl?: boolean
|
|
aclStrict?: boolean
|
|
}
|
|
|
|
export type StorageCertQcAclScope = 'qc' | 'production'
|
|
|
|
export type StorageCertQcAclDetail = {
|
|
scope: StorageCertQcAclScope
|
|
fieldKeys: string[]
|
|
userIds: string[]
|
|
users: Array<{ id: string; nickName: string; userName: string }>
|
|
configuredFlag: boolean
|
|
aclStrict: boolean
|
|
}
|
|
|
|
export function fetchSampleStorageCertQc(sampleCode: string) {
|
|
return request.get({
|
|
url: `/web/admin/sample-storage-cert-qc/${encodeURIComponent(sampleCode)}`
|
|
})
|
|
}
|
|
|
|
export function saveSampleStorageCertQc(
|
|
sampleCode: string,
|
|
data: { payload: Record<string, unknown>; qcWorkOrderId?: string }
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/sample-storage-cert-qc/${encodeURIComponent(sampleCode)}`,
|
|
data
|
|
})
|
|
}
|
|
|
|
export function fetchSampleStorageCertQcAcl(scope: StorageCertQcAclScope) {
|
|
return request.get({
|
|
url: `/web/admin/sample-storage-cert-qc-acl/${encodeURIComponent(scope)}`
|
|
})
|
|
}
|
|
|
|
export function saveSampleStorageCertQcAcl(
|
|
scope: StorageCertQcAclScope,
|
|
data: { fieldKeys: string[]; userIds: string[] }
|
|
) {
|
|
return request.put({
|
|
url: `/web/admin/sample-storage-cert-qc-acl/${encodeURIComponent(scope)}`,
|
|
data
|
|
})
|
|
}
|