This commit is contained in:
2026-08-20 18:02:52 +08:00
parent 4ae5e7c672
commit 80947cd9ce
65 changed files with 1386 additions and 1083 deletions
@@ -6,7 +6,7 @@ function source(name: string) {
return readFileSync(resolve(process.cwd(), `src/modules/overseas-master-data/pages/${name}.vue`), 'utf8')
}
describe('overseas master data pending-contract pages', () => {
describe('overseas master data real contract pages', () => {
it('gives every list query toolbar a unique stable preference key', () => {
const expectedKeys = new Map([
['OverseasQuotesView', 'overseas-quotes-query'],
@@ -32,37 +32,38 @@ describe('overseas master data pending-contract pages', () => {
const quotes = source('OverseasQuotesView')
const exchangeRates = source('ExchangeRatesView')
const vehicles = source('VehiclesView')
expect(quotes.indexOf("key: 'actions'")).toBeLessThan(quotes.indexOf("key: 'name'"))
expect(quotes.indexOf("key:'actions'")).toBeLessThan(quotes.indexOf("key:'name'"))
for (const label of ['报价名称', '海外仓', '服务商', '币种', '生效日期', '失效日期', '报价版本', '状态', '更新时间', '备注']) {
expect(quotes).toContain(`label: '${label}'`)
expect(quotes).toContain(`label:'${label}'`)
}
const exchangeColumns = exchangeRates.slice(exchangeRates.indexOf('const columns'))
expect(exchangeColumns.indexOf("key: 'actions'")).toBeLessThan(exchangeColumns.indexOf("key: 'month'"))
expect(vehicles.indexOf("key: 'actions'")).toBeLessThan(vehicles.indexOf("key: 'plateNumber'"))
for (const label of ['自有车辆', '外派车辆', '当前派送单', '最近更换原因']) expect(vehicles).toContain(label)
expect(vehicles).toContain("key: 'region'")
expect(vehicles).toContain("placeholder: '全部区域'")
expect(vehicles.indexOf("key:'actions'")).toBeLessThan(vehicles.indexOf("key:'plateNumber'"))
for (const label of ['自有车辆', '外派车辆', '司机 / 外派单位']) expect(vehicles).toContain(label)
expect(vehicles).toContain("key:'region'")
expect(vehicles).toContain("placeholder:'全部区域'")
expect(vehicles).toContain('class="status-tabs"')
expect(vehicles).toContain("'status-tab', { 'is-active': ownership === tab.value }")
expect(vehicles).toContain("'status-tab',{'is-active':ownership===tab[1]}")
expect(vehicles).not.toContain('<el-segmented')
expect(vehicles).not.toContain('aria-label="车辆区域"')
})
it('keeps all write and export entry points disabled with an explicit contract message', () => {
it('uses real API operations and canonical action permissions', () => {
for (const name of ['OverseasQuotesView', 'ExchangeRatesView', 'VehiclesView']) {
const view = source(name)
expect(view).toContain('海外区域')
expect(view).toMatch(/<el-button[^>]*disabled/)
expect(view).not.toContain('ElMessage.success')
expect(view).toContain("from '../api/overseasMasterData'")
expect(view).toContain('access.can(permission.')
expect(view).toContain('ElMessage.success')
}
})
it('uses an independent vehicle detail page without inventing a record', () => {
it('uses an independent API-backed vehicle detail page without inventing fulfillment history', () => {
const detail = source('VehicleDetailView')
expect(detail).toContain('车辆信息')
expect(detail).toContain('派送订单明细')
expect(detail).toContain('派送更换记录')
expect(detail).toContain('<ContractPendingNotice domain="车辆详情" detail />')
expect(detail).toContain('getVehicle(')
expect(detail).toContain('明确不包含派送履约记录')
expect(detail).not.toContain('AppDrawer')
expect(detail).not.toContain('const vehicle =')
})
@@ -74,13 +75,11 @@ describe('overseas master data pending-contract pages', () => {
expect(matrix).toContain('原型未定义车辆文件预览、审核/确认流程')
})
it('records audited service boundaries without treating truck orders as vehicle master data', () => {
it('records the real service boundary and remaining unsupported operations', () => {
const gaps = readFileSync(resolve(process.cwd(), 'src/modules/overseas-master-data/CONTRACT_GAPS.md'), 'utf8')
expect(gaps).toContain('/api/platform/v1/warehouse-admin')
expect(gaps).toContain('/api/platform/v1/last-leg/us-truck-orders')
expect(gaps).toContain('它不是车辆档案')
expect(gaps).toContain('/internal/warehouses/overseas-partners')
expect(gaps).toContain('前端不得调用该内部端点')
expect(gaps).toContain('保持结构化空态')
expect(gaps).toContain('/api/platform/v1/last-leg/master-data')
expect(gaps).toContain('/overseas-quotes/warehouse-options')
expect(gaps).toContain('浏览器不调用国内')
expect(gaps).toContain('没有删除端点')
})
})