fix(pl): 修正合同额度统计中的销售及框架合同类型文案。
This commit is contained in:
1 parent
0d1d264bc7
commit
72cf0d9c3d
3 files changed
+41
-6
No files matched your search
@@ -261,3 +261,31 @@ test('statistics API maps each view to the server endpoint and preserves respons
|
||||
)
|
||||
assert.deepEqual(calls[1].options.params, { certType: 'transport', pageSize: 20 })
|
||||
})
|
||||
|
||||
import * as statisticsLabels from '../src/views/pl/quota-statistics/labels'
|
||||
test('contract type tags translate all server values and legacy framework', () => {
|
||||
const template = parse(
|
||||
readFileSync(
|
||||
new URL('../src/views/pl/quota-statistics/StatisticsPanel.vue', import.meta.url),
|
||||
'utf8'
|
||||
)
|
||||
).descriptor.template!.content
|
||||
const expression = template.match(
|
||||
/v-else-if="column.prop === 'contractType'"[^>]*>\s*\{\{([\s\S]*?)\}\}/
|
||||
)![1]
|
||||
const renderLabel = new Function(
|
||||
'row',
|
||||
...Object.keys(statisticsLabels),
|
||||
`return (${expression})`
|
||||
)
|
||||
for (const [contractType, label] of Object.entries({
|
||||
sale: '销售合同',
|
||||
purchase: '采购合同',
|
||||
framework_sale: '框架销售合同',
|
||||
framework_purchase: '框架采购合同',
|
||||
framework: '框架合同',
|
||||
'': '—'
|
||||
})) {
|
||||
assert.equal(renderLabel({ contractType }, ...Object.values(statisticsLabels)), label)
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user