Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a781db819a | ||
|
|
291535e242 |
@@ -821,7 +821,6 @@ onMounted(async () => { await Promise.all([loadCustomers(), loadRows()]) })
|
||||
<style scoped>
|
||||
.container-page { display: grid; gap: var(--admin-space-5); min-width: 0; }.container-page small { display: block; margin-top: var(--admin-space-1); color: var(--cc-muted); }.container-query-panel { min-width: 0; }.container-query-toolbar { border: 0; }.row-actions { flex-wrap: nowrap; white-space: nowrap; }.row-actions :deep(.el-button + .el-button) { margin-left: 0; }.container-editor-table { table-layout: fixed; }.fleet-select { width: 100%; }.arrival-time-cell { display: flex; align-items: center; width: 100%; min-width: 0; padding-right: var(--admin-space-1); box-sizing: border-box; }.arrival-time-picker { width: 200px !important; max-width: 100%; min-width: 0; box-sizing: border-box; }.details :deep(.el-descriptions__label) { width: 120px; }.drayage-load-alert { margin-bottom: var(--admin-space-5); }.drayage-summary { margin-bottom: var(--admin-space-5); }
|
||||
.container-query-panel { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
|
||||
.container-query-toolbar :deep(.query-toolbar__tail) { width: 100%; flex: 0 0 100%; }
|
||||
.container-page .table-panel { width: 100%; max-width: 100%; min-width: 0; }
|
||||
@media(max-width:720px){.details :deep(.el-descriptions__body table),.details :deep(tbody),.details :deep(tr),.details :deep(td){display:block;width:100%!important}.row-actions { min-width: 180px; }}
|
||||
@media(max-width:720px){.container-editor-table :is(tbody,tr,td){display:block}}
|
||||
|
||||
@@ -885,7 +885,7 @@ defineExpose({ saveDraft, submitForReview, updateWeightEvidence, submissionBlock
|
||||
</div>
|
||||
</AppDialog>
|
||||
|
||||
<el-dialog class="admin-density-dialog" v-model="manualEntryOpen" :title="detail?.inboundCode ? `手动录入箱规 · ${detail.inboundCode}` : '手动录入箱规'" width="min(880px, 92vw)" destroy-on-close append-to-body>
|
||||
<el-dialog class="admin-density-dialog" v-model="manualEntryOpen" :title="detail?.inboundCode ? `手动录入箱规 · ${detail.inboundCode}` : '手动录入箱规'" width="min(1000px, 92vw)" destroy-on-close append-to-body>
|
||||
<el-alert v-if="manualEntryErrors.length" type="error" :closable="false" show-icon class="manual-entry-alert" title="请修正以下问题">
|
||||
<ul><li v-for="error in manualEntryErrors" :key="error">{{ error }}</li></ul>
|
||||
</el-alert>
|
||||
|
||||
@@ -656,7 +656,7 @@ defineExpose({ reload: loadWorkspace })
|
||||
:show-confirm="Boolean(previewResult && previewCanConfirm && (previewResult.recognitionStatus !== 'CONFIRMED' || reviewCorrectionEnabled))"
|
||||
:confirm-text="previewConfirmText"
|
||||
confirm-type="success"
|
||||
width="min(920px, calc(100vw - 28px))"
|
||||
width="min(1080px, calc(100vw - 28px))"
|
||||
fullscreenable
|
||||
@confirm="previewResult && confirmResult(previewResult, true)"
|
||||
>
|
||||
|
||||
@@ -194,7 +194,7 @@ describe('InboundFeeDetailManager', () => {
|
||||
const dialog = document.querySelector<HTMLElement>('.el-dialog.admin-density-dialog')!
|
||||
expect(dialog).not.toBeNull()
|
||||
expect(dialog.querySelector('.density-form')).not.toBeNull()
|
||||
expect(dialog.style.getPropertyValue('--el-dialog-width')).toBe(action === '编辑' ? 'min(880px, calc(100vw - 28px))' : 'min(720px, calc(100vw - 28px))')
|
||||
expect(dialog.style.getPropertyValue('--el-dialog-width')).toBe(action === '编辑' ? 'min(1000px, calc(100vw - 28px))' : 'min(880px, calc(100vw - 28px))')
|
||||
if (action === '驳回') {
|
||||
const confirm = [...dialog.querySelectorAll<HTMLButtonElement>('button')].find(button => button.textContent?.trim() === '确认驳回')!
|
||||
confirm.click()
|
||||
|
||||
@@ -336,7 +336,7 @@ onMounted(() => void load())
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<AppDialog class="admin-density-dialog" v-model="editorOpen" :title="editorMode === 'create' ? '新增费用' : editorMode === 'adjust' ? '调整已审核费用' : '编辑费用'" width="min(880px, calc(100vw - 28px))" :confirm-loading="saving" confirm-text="保存" @confirm="save">
|
||||
<AppDialog class="admin-density-dialog" v-model="editorOpen" :title="editorMode === 'create' ? '新增费用' : editorMode === 'adjust' ? '调整已审核费用' : '编辑费用'" width="min(1000px, calc(100vw - 28px))" :confirm-loading="saving" confirm-text="保存" @confirm="save">
|
||||
<el-alert v-if="editorMode === 'adjust'" title="调整将生成新版本并重新进入待审核状态" type="warning" :closable="false" show-icon />
|
||||
<el-alert v-if="selectedFeeItem?.feeCode === privateDeliveryFeeCode" title="私人仓尾程派送费仅适用于目的仓类型为“私人仓”的订单,最终资格由服务端校验。" type="info" :closable="false" show-icon />
|
||||
<el-alert v-if="!canViewFeeItems" title="当前账号缺少费用项目查看权限,无法新增或修改费用" type="warning" :closable="false" show-icon />
|
||||
@@ -369,7 +369,7 @@ onMounted(() => void load())
|
||||
</el-form>
|
||||
</section>
|
||||
</AppDialog>
|
||||
<AppDialog class="admin-density-dialog" v-model="rejectOpen" title="驳回费用" :confirm-loading="saving" confirm-text="确认驳回" confirm-type="warning" width="min(720px, calc(100vw - 28px))" @confirm="reject">
|
||||
<AppDialog class="admin-density-dialog" v-model="rejectOpen" title="驳回费用" :confirm-loading="saving" confirm-text="确认驳回" confirm-type="warning" width="min(880px, calc(100vw - 28px))" @confirm="reject">
|
||||
<el-alert v-if="actionError" type="error" :closable="true" @close="actionError = null"><template #title>{{ actionError.message }}</template><ApiErrorMeta :details="actionError" /></el-alert>
|
||||
<el-form class="density-form" label-position="top"><el-form-item label="驳回原因" required><el-input v-model="rejectReason" type="textarea" :rows="4" maxlength="500" show-word-limit placeholder="请输入驳回原因" /></el-form-item></el-form>
|
||||
</AppDialog>
|
||||
|
||||
@@ -2403,15 +2403,15 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="fee-confirm-weight">计费毛重</label></th>
|
||||
<td><div class="density-table-editor"><el-input-number id="fee-confirm-weight" v-model="feeConfirmWeight" :min="0" :precision="3" :controls="false" placeholder="请输入计费毛重" /><span>kg</span></div></td>
|
||||
<td><div class="density-table-editor density-table-editor--outlined"><el-input-number id="fee-confirm-weight" v-model="feeConfirmWeight" :min="0" :precision="3" :controls="false" placeholder="请输入计费毛重" /><span>kg</span></div></td>
|
||||
<th scope="row"><label for="fee-confirm-volume">计费体积</label></th>
|
||||
<td><div class="density-table-editor"><el-input-number id="fee-confirm-volume" v-model="feeConfirmVolume" :min="0" :precision="6" :controls="false" placeholder="请输入计费体积" /><span>m³</span></div></td>
|
||||
<td><div class="density-table-editor density-table-editor--outlined"><el-input-number id="fee-confirm-volume" v-model="feeConfirmVolume" :min="0" :precision="6" :controls="false" placeholder="请输入计费体积" /><span>m³</span></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">价格表参考单价</th>
|
||||
<td>{{ feeConfirmPriceMissing ? '未命中' : feeConfirmReference?.unitPrice == null ? '正在读取参考单价' : `${formatNumber(Number(feeConfirmReference.unitPrice), 4)} ${feeConfirmPriceUnit}` }}</td>
|
||||
<th scope="row"><label for="fee-confirm-unit-price">本次对客单价</label></th>
|
||||
<td><div class="density-table-editor"><el-input-number id="fee-confirm-unit-price" v-model="feeConfirmUnitPrice" :min="0" :precision="4" :controls="false" :disabled="feeConfirmReferenceLoading" placeholder="请输入对客单价" /><span>{{ feeConfirmPriceUnit }}</span></div></td>
|
||||
<td><div class="density-table-editor density-table-editor--outlined"><el-input-number id="fee-confirm-unit-price" v-model="feeConfirmUnitPrice" :min="0" :precision="4" :controls="false" :disabled="feeConfirmReferenceLoading" placeholder="请输入对客单价" /><span>{{ feeConfirmPriceUnit }}</span></div></td>
|
||||
</tr>
|
||||
<tr v-if="feeConfirmReference">
|
||||
<th scope="row">参考计费量</th><td>{{ formatNumber(Number(feeConfirmReference.chargeableQuantity), feeConfirmReference.roundingScale) }} {{ feeConfirmReference.chargeUnit }}</td>
|
||||
@@ -2931,7 +2931,7 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
</template>
|
||||
|
||||
</ListPageLayout>
|
||||
<AppDialog class="admin-density-dialog" v-model="legacyImportOpen" title="导入旧系统订单" width="min(760px, calc(100vw - 28px))" confirm-text="开始导入" :confirm-loading="legacyImportSaving" :confirm-disabled="!legacyImportFile || legacyImportSaving || !!legacyImportResult" destroy-on-close @confirm="submitLegacyImport">
|
||||
<AppDialog class="admin-density-dialog" v-model="legacyImportOpen" title="导入旧系统订单" width="min(880px, calc(100vw - 28px))" confirm-text="开始导入" :confirm-loading="legacyImportSaving" :confirm-disabled="!legacyImportFile || legacyImportSaving || !!legacyImportResult" destroy-on-close @confirm="submitLegacyImport">
|
||||
<div class="legacy-import-content density-dialog-sections">
|
||||
<section class="density-dialog-section" data-tone="source">
|
||||
<h3 class="density-dialog-section__title">导入规则</h3>
|
||||
@@ -2981,7 +2981,7 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
</section>
|
||||
</template>
|
||||
</AppDialog>
|
||||
<AppDialog class="admin-density-dialog" v-model="coLoadCreateOpen" title="合柜报关" confirm-text="确认建组" :confirm-loading="coLoadSaving" :confirm-disabled="!canCreateCoLoadGroup" width="min(720px, calc(100vw - 28px))" @confirm="createCoLoadGroup">
|
||||
<AppDialog class="admin-density-dialog" v-model="coLoadCreateOpen" title="合柜报关" confirm-text="确认建组" :confirm-loading="coLoadSaving" :confirm-disabled="!canCreateCoLoadGroup" width="min(880px, calc(100vw - 28px))" @confirm="createCoLoadGroup">
|
||||
<el-alert type="warning" :closable="false" show-icon :title="`所选 ${selectedOrders.length} 票须属于同一国内仓、同一渠道,并全量进入同一柜;目的仓或目的港可以不同。资格由服务端按完整入仓片段校验。`" />
|
||||
<section class="density-dialog-section" data-tone="source">
|
||||
<h3 class="density-dialog-section__title">所选入仓码</h3>
|
||||
@@ -2989,7 +2989,7 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
</section>
|
||||
<div v-if="coLoadError" class="coload-error" role="alert"><span>{{ coLoadError.message }}</span><ApiErrorMeta :details="coLoadError" /></div>
|
||||
</AppDialog>
|
||||
<AppDialog class="admin-density-dialog" v-model="coLoadDetailOpen" title="同柜组成员" :show-confirm="false" cancel-text="关闭" width="min(720px, 94vw)" :loading="coLoadDetailLoading" :confirm-loading="coLoadCancelSaving">
|
||||
<AppDialog class="admin-density-dialog" v-model="coLoadDetailOpen" title="同柜组成员" :show-confirm="false" cancel-text="关闭" width="min(880px, 94vw)" :loading="coLoadDetailLoading" :confirm-loading="coLoadCancelSaving">
|
||||
<LoadErrorState v-if="coLoadDetailError" title="同柜组成员加载失败" :message="coLoadDetailError.message" :loading="coLoadDetailLoading" @retry="loadCoLoadDetail"><template #details><ApiErrorMeta :details="coLoadDetailError" /></template></LoadErrorState>
|
||||
<template v-else-if="coLoadDetailSummary">
|
||||
<div class="coload-detail-summary"><el-tag size="small" :type="coLoadDetailSummary.status === 'ACTIVE' ? 'warning' : 'info'">{{ coLoadGroupSummary(coLoadDetailSummary) }}</el-tag><span>{{ coLoadDetailSummary.memberCount }} 个成员</span></div>
|
||||
@@ -3019,7 +3019,7 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
/>
|
||||
</AppDrawer>
|
||||
|
||||
<AppDialog class="admin-density-dialog" v-model="noteOpen" :title="orderDialogTitle('编辑订单备注', noteOrder?.inboundCode)" width="min(880px, calc(100vw - 28px))" confirm-text="保存备注" :confirm-loading="noteSaving" @confirm="saveNote">
|
||||
<AppDialog class="admin-density-dialog" v-model="noteOpen" :title="orderDialogTitle('编辑订单备注', noteOrder?.inboundCode)" width="min(1000px, calc(100vw - 28px))" confirm-text="保存备注" :confirm-loading="noteSaving" @confirm="saveNote">
|
||||
<el-form label-position="top" class="order-remarks-form">
|
||||
<el-form-item label="客户备注(只读)"><el-input :model-value="noteOrder?.customerRemark || '—'" disabled /></el-form-item>
|
||||
<el-form-item label="内部备注"><el-input v-model="noteForm.internalRemark" type="textarea" :rows="3" maxlength="1000" show-word-limit /></el-form-item>
|
||||
@@ -3028,12 +3028,12 @@ function orderDialogTitle(action: string, inboundCode?: string | null) {
|
||||
</el-form>
|
||||
</AppDialog>
|
||||
|
||||
<AppDialog class="admin-density-dialog" v-model="holdDialogOpen" :title="orderDialogTitle(holdAction === 'HOLD' ? '确认扣货' : '确认解除扣货', detail?.summary.inboundCode)" :confirm-text="holdAction === 'HOLD' ? '确认扣货' : '确认解除'" :confirm-type="holdAction === 'HOLD' ? 'danger' : 'primary'" :confirm-loading="holdSaving" :confirm-disabled="!holdReason.trim() || holdReason.trim().length > 1000" width="min(720px, calc(100vw - 28px))" destroy-on-close @confirm="submitHoldAction">
|
||||
<AppDialog class="admin-density-dialog" v-model="holdDialogOpen" :title="orderDialogTitle(holdAction === 'HOLD' ? '确认扣货' : '确认解除扣货', detail?.summary.inboundCode)" :confirm-text="holdAction === 'HOLD' ? '确认扣货' : '确认解除'" :confirm-type="holdAction === 'HOLD' ? 'danger' : 'primary'" :confirm-loading="holdSaving" :confirm-disabled="!holdReason.trim() || holdReason.trim().length > 1000" width="min(880px, calc(100vw - 28px))" destroy-on-close @confirm="submitHoldAction">
|
||||
<el-alert :title="holdAction === 'HOLD' ? '扣货后服务端将阻止后续实物履约操作。' : '解除后是否可继续履约仍以服务端状态为准。'" :type="holdAction === 'HOLD' ? 'warning' : 'info'" :closable="false" show-icon />
|
||||
<el-form label-position="top" class="hold-command-form"><el-form-item :label="holdAction === 'HOLD' ? '扣货原因' : '解除原因'" required><el-input v-model="holdReason" type="textarea" :rows="4" maxlength="1000" show-word-limit :placeholder="holdAction === 'HOLD' ? '请输入扣货原因' : '请输入解除扣货原因'" aria-label="扣货操作原因" /></el-form-item><el-form-item label="关联文件(选填)"><el-upload :key="holdEvidenceUploadKey" :auto-upload="false" :limit="1" accept=".txt,.pdf,.jpg,.jpeg,.png,text/plain,application/pdf,image/jpeg,image/png" :disabled="holdSaving" :on-change="selectHoldEvidenceFile" :on-remove="removeHoldEvidenceFile"><el-button :disabled="holdSaving"><FileUp :size="15" />选择文件</el-button><template #tip><div class="el-upload__tip">仅支持 TXT、PDF、JPG、PNG,单文件不超过 10MB。</div></template></el-upload></el-form-item><LoadErrorState v-if="holdEvidenceError" compact title="关联文件处理失败" :message="holdEvidenceError.message" :show-retry="false"><template #details><ApiErrorMeta :details="holdEvidenceError" /></template></LoadErrorState></el-form>
|
||||
</AppDialog>
|
||||
|
||||
<AppDialog class="admin-density-dialog" v-model="approvalOpen" :title="orderDialogTitle('审核订单', approvalOrder?.inboundCode)" confirm-text="审核通过" confirm-type="success" :confirm-loading="approvalSaving" width="min(720px, calc(100vw - 28px))" destroy-on-close @confirm="approveOrder" @cancel="closeApproval">
|
||||
<AppDialog class="admin-density-dialog" v-model="approvalOpen" :title="orderDialogTitle('审核订单', approvalOrder?.inboundCode)" confirm-text="审核通过" confirm-type="success" :confirm-loading="approvalSaving" width="min(880px, calc(100vw - 28px))" destroy-on-close @confirm="approveOrder" @cancel="closeApproval">
|
||||
<section v-if="approvalOrder" class="density-dialog-section" data-tone="summary">
|
||||
<h3 class="density-dialog-section__title">订单审核资料</h3>
|
||||
<dl class="approval-facts">
|
||||
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
import { listAllPlatformWarehouses, type PlatformWarehouseResource } from '../../../warehouses/api/platformWarehouses'
|
||||
import QueryToolbar, { type QueryField, type QueryModel } from '@/shared/components/QueryToolbar.vue'
|
||||
import DataTable from '@/shared/components/DataTable.vue'
|
||||
import LayoutPreferenceList from '@/shared/components/LayoutPreferenceList.vue'
|
||||
import LocationsView from './LocationsView.vue'
|
||||
|
||||
const locationsSource = readFileSync(resolve(process.cwd(), 'src/modules/warehouse-resources/locations/pages/LocationsView.vue'), 'utf8')
|
||||
@@ -162,7 +163,7 @@ describe('LocationsView', () => {
|
||||
it('uses the prototype-sized centered editor without a detail drawer or section cards', () => {
|
||||
expect(locationsSource).not.toContain('AppDrawer')
|
||||
expect(locationsSource).not.toContain('FormSection')
|
||||
expect(locationsSource).toContain('width="min(880px, calc(100vw - 28px))"')
|
||||
expect(locationsSource).toContain('width="min(1000px, calc(100vw - 28px))"')
|
||||
expect(densitySource).toContain('.admin-density-dialog.el-dialog .el-dialog__body { min-height: 0; overflow-y: auto;')
|
||||
expect(locationsSource).toContain('.editor-field-grid { grid-template-columns: minmax(0, 1fr); }')
|
||||
})
|
||||
@@ -179,6 +180,27 @@ describe('LocationsView', () => {
|
||||
vi.mocked(createPlatformLocation).mockReset()
|
||||
})
|
||||
|
||||
it('renders missing maximum weights as a dash and preserves zero and populated weights', async () => {
|
||||
const missingWeight = { ...availableLocation }
|
||||
Reflect.deleteProperty(missingWeight, 'maxWeightKg')
|
||||
const records = [missingWeight, ...[null, '', 0, 2000, '10000.125'].map((maxWeightKg, index) => ({
|
||||
...availableLocation, id: `weight-${index}`, locationCode: `WEIGHT-${index}`, maxWeightKg,
|
||||
}))]
|
||||
vi.mocked(listPlatformLocations).mockResolvedValue({ records, page: 1, size: 20, total: records.length, pages: 1 })
|
||||
const wrapper = await mountView()
|
||||
await wrapper.get('button[aria-label="列设置"]').trigger('click')
|
||||
await flushPromises()
|
||||
const preferences = wrapper.findComponent(DataTable).findComponent(LayoutPreferenceList)
|
||||
preferences.vm.$emit('visibility', 'maxWeightKg', true)
|
||||
await flushPromises()
|
||||
const column = wrapper.findAll('thead th').findIndex(header => header.text().includes('最大承重'))
|
||||
expect(column).toBeGreaterThan(-1)
|
||||
expect(wrapper.findAll('tbody tr').map(row => row.findAll('td')[column]!.text())).toEqual([
|
||||
'—', '—', '—', '0 kg', '2,000 kg', '10,000.125 kg',
|
||||
])
|
||||
expect(wrapper.text()).not.toContain('undefined kg')
|
||||
})
|
||||
|
||||
it('loads only domestic warehouse candidates for querying and writes', async () => {
|
||||
const wrapper = await mountView()
|
||||
const toolbar = wrapper.findComponent(QueryToolbar)
|
||||
|
||||
@@ -188,8 +188,8 @@ function optionalText(value: string) {
|
||||
return value.trim() || null
|
||||
}
|
||||
|
||||
function formatWeight(value: number | string | null) {
|
||||
if (value === null || value === '') return '—'
|
||||
function formatWeight(value: number | string | null | undefined) {
|
||||
if (value == null || value === '') return '—'
|
||||
const numeric = Number(value)
|
||||
return Number.isFinite(numeric) ? `${numeric.toLocaleString('zh-CN', { maximumFractionDigits: 3 })} kg` : `${value} kg`
|
||||
}
|
||||
@@ -600,7 +600,7 @@ onMounted(() => {
|
||||
<AppDialog
|
||||
v-model="editorOpen"
|
||||
:title="editorMode === 'edit' && form.locationCode ? `${editorTitle} · ${form.locationCode}` : editorTitle"
|
||||
width="min(880px, calc(100vw - 28px))"
|
||||
width="min(1000px, calc(100vw - 28px))"
|
||||
class="location-editor-dialog admin-density-dialog"
|
||||
:confirm-loading="saving"
|
||||
:close-on-click-modal="false"
|
||||
|
||||
@@ -252,6 +252,11 @@
|
||||
--el-input-hover-border-color: var(--admin-table-border);
|
||||
--el-input-bg-color: transparent;
|
||||
}
|
||||
:is(.admin-density, .admin-density-dialog) .density-table--editable .density-table-editor--outlined .el-input {
|
||||
--el-input-border-color: var(--el-color-primary-light-5);
|
||||
--el-input-hover-border-color: var(--el-color-primary);
|
||||
--el-input-bg-color: var(--admin-surface);
|
||||
}
|
||||
:is(.admin-density, .admin-density-dialog) .density-table-editor { display: flex; align-items: center; gap: var(--admin-space-3); min-width: 0; }
|
||||
:is(.admin-density, .admin-density-dialog) .density-table-editor .el-input-number { flex: 1; width: 100%; min-width: 0; }
|
||||
:is(.admin-density, .admin-density-dialog) .density-table--editable .el-input__inner { text-align: left; }
|
||||
|
||||
@@ -178,6 +178,45 @@ const cssRoot = (css: string) => {
|
||||
}
|
||||
|
||||
describe('approved Admin density ownership', () => {
|
||||
it('outlines only the three opted-in customer billing editors without overriding native focus or disabled styles', () => {
|
||||
const rules = new Map<string, Record<string, string>>()
|
||||
cssRoot(shared).walkRules(rule => {
|
||||
const values: Record<string, string> = {}
|
||||
rule.walkDecls(decl => { values[decl.prop] = decl.value })
|
||||
rules.set(rule.selector, values)
|
||||
})
|
||||
expect(rules.get(':is(.admin-density, .admin-density-dialog) .density-table--editable .density-table-editor--outlined .el-input')).toEqual({
|
||||
'--el-input-border-color': 'var(--el-color-primary-light-5)',
|
||||
'--el-input-hover-border-color': 'var(--el-color-primary)',
|
||||
'--el-input-bg-color': 'var(--admin-surface)',
|
||||
})
|
||||
const ast = parse(read('modules/unified-orders/pages/UnifiedOrdersView.vue')).descriptor.template!.ast!
|
||||
const inputIds: string[] = []
|
||||
const visit = (nodes: typeof ast.children) => { for (const node of nodes) {
|
||||
if (node.type !== 1) continue
|
||||
if (classesOf(node).includes('density-table-editor--outlined')) {
|
||||
const input = node.children.find(child => child.type === 1 && child.tag === 'el-input-number') as ElementNode | undefined
|
||||
expect(input).toBeDefined()
|
||||
const id = input!.props.find(prop => prop.type === 6 && prop.name === 'id')
|
||||
inputIds.push(id?.type === 6 ? id.value?.content || '' : '')
|
||||
}
|
||||
visit(node.children)
|
||||
} }
|
||||
visit(ast.children)
|
||||
expect(inputIds).toEqual(['fee-confirm-weight', 'fee-confirm-volume', 'fee-confirm-unit-price'])
|
||||
})
|
||||
it('allows container filters and their final action group to wrap by available width', () => {
|
||||
const source = read('modules/container-loading/pages/ContainersView.vue')
|
||||
for (const style of parse(source).descriptor.styles) {
|
||||
cssRoot(style.content).walkRules(rule => {
|
||||
if (!rule.selector.includes('.query-toolbar__tail')) return
|
||||
rule.walkDecls(decl => {
|
||||
if (decl.prop === 'width') expect(decl.value).not.toBe('100%')
|
||||
if (decl.prop === 'flex') expect(decl.value).not.toBe('0 0 100%')
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
it('keeps declaration order fields on the continuous cell-editor baseline', () => {
|
||||
const source = read('modules/unified-orders/components/OrderDeclarationEditorDialog.vue')
|
||||
const orderFields = source.slice(source.indexOf('<el-form label-position="left"'), source.indexOf('</el-form>') + '</el-form>'.length)
|
||||
|
||||
Reference in New Issue
Block a user