fix(admin): 统一后台使用说明、普通金额和报表辅助色
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<el-alert class="admin-page-hint" :type="settings.adminUi === 'v2' ? 'info' : 'warning'" :title="title" :closable="false" show-icon />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import useSettingStore from '@/stores/modules/setting'
|
||||
|
||||
// Static page descriptions only. Errors, account state and financial warnings use el-alert directly.
|
||||
defineProps<{ title: string }>()
|
||||
const settings = useSettingStore()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
:root[data-admin-ui='v2'] .admin-page-hint {
|
||||
--el-alert-bg-color: var(--zyt-surface-subtle);
|
||||
color: var(--zyt-text);
|
||||
}
|
||||
</style>
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:用于管理网站的分类,只可添加到一级"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:用于管理网站的分类,只可添加到一级" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never" v-loading="pager.loading">
|
||||
<div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert type="warning" title="温馨提示:H5设置" :closable="false" show-icon />
|
||||
<admin-page-hint title="温馨提示:H5设置" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<el-form ref="formRef" :model="formData" label-width="120px">
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:填写微信开放平台开发配置,请前往微信开放平台创建应用并完成认证;网站应用配置主要用于网站微信登录和微信支付"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:填写微信开放平台开发配置,请前往微信开放平台创建应用并完成认证;网站应用配置主要用于网站微信登录和微信支付" />
|
||||
</el-card>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="160px">
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:填写微信小程序开发配置,请前往微信公众平台申请小程序并完成认证"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:填写微信小程序开发配置,请前往微信公众平台申请小程序并完成认证" />
|
||||
</el-card>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:填写微信公众号开发配置,请前往微信公众平台申请服务号并完成认证"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:填写微信公众号开发配置,请前往微信公众平台申请服务号并完成认证" />
|
||||
</el-card>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:1.粉丝在公众号发送内容时,系统无法匹配情况下发送启用的默认文本回复;2.同时只能启用一个默认回复。"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:1.粉丝在公众号发送内容时,系统无法匹配情况下发送启用的默认文本回复;2.同时只能启用一个默认回复。" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:1.粉丝关注公众号时,会自动发送启用的关注回复;2.同时只能启用一个关注回复。"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:1.粉丝关注公众号时,会自动发送启用的关注回复;2.同时只能启用一个关注回复。" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:1.粉丝在公众号发送内容时,通过关键词可触发关键词回复;2.同时可启用多个关键词回复,有多条关键词匹配时优选选择排序靠前的一条"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:1.粉丝在公众号发送内容时,通过关键词可触发关键词回复;2.同时可启用多个关键词回复,有多条关键词匹配时优选选择排序靠前的一条" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
|
||||
@@ -1171,3 +1171,22 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .qywx-im {
|
||||
background-color: var(--zyt-canvas);
|
||||
|
||||
// Keep incoming white bubbles visible against an inset messaging surface.
|
||||
.col-message { background-color: var(--art-gray-200); }
|
||||
.col-profile { background-color: var(--zyt-surface-subtle); }
|
||||
|
||||
.session-name, .msg-customer-name, .no-session h4 { color: var(--zyt-ink); }
|
||||
.session-preview, .session-time, .session-staff, .msg-customer-sub,
|
||||
.message-list .end-tip, .profile-fields .field .label,
|
||||
.no-session, .no-session .tips .text-sm {
|
||||
color: var(--zyt-text);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -167,11 +167,11 @@
|
||||
修改
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="stat-value text-red-500 font-bold text-xl">¥{{ detailData.amount }}</div>
|
||||
<div class="stat-value po-regular-metric text-red-500 font-bold text-xl">¥{{ detailData.amount }}</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="stat-card border border-gray-100 bg-gray-50/50">
|
||||
<div class="stat-title text-gray-500 text-xs mb-1">已付总额</div>
|
||||
<div class="stat-value text-green-600 font-bold text-xl">¥{{ detailData.linked_pay_paid_total || 0 }}</div>
|
||||
<div class="stat-value po-regular-metric text-green-600 font-bold text-xl">¥{{ detailData.linked_pay_paid_total || 0 }}</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="stat-card border border-gray-100 bg-gray-50/50">
|
||||
<div class="stat-title text-gray-500 text-xs mb-1">退款金额</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
</el-card>
|
||||
<el-card shadow="never" class="stat-card border border-gray-100 bg-gray-50/50">
|
||||
<div class="stat-title text-gray-500 text-xs mb-1">已付笔数</div>
|
||||
<div class="stat-value text-primary font-bold text-xl">{{ detailLinkedPayOrders.length }} 笔</div>
|
||||
<div class="stat-value po-regular-metric text-primary font-bold text-xl">{{ detailLinkedPayOrders.length }} 笔</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
{{ detailPrescription.usage_instruction || detailPrescription.usage_method || '—' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="处方金额">
|
||||
<span class="text-red-500 font-medium">¥{{ detailPrescription.amount ?? '—' }}</span>
|
||||
<span class="po-regular-metric text-red-500 font-medium">¥{{ detailPrescription.amount ?? '—' }}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="消费者审核">
|
||||
<el-tag :type="consumerRxAuditTag(detailPrescription.audit_status)" size="small">
|
||||
@@ -478,7 +478,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="86" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="text-red-500">¥{{ row.amount }}</span>
|
||||
<span class="po-regular-metric text-red-500">¥{{ row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
@@ -541,7 +541,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="86" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="text-red-500">¥{{ row.amount }}</span>
|
||||
<span class="po-regular-metric text-red-500">¥{{ row.amount }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
@@ -1979,4 +1979,11 @@ defineExpose({
|
||||
margin: 0 2px 0 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* The nested drawer may teleport to body; standalone H5 has no admin layout. */
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark):has(.layout-default) .po-regular-metric {
|
||||
color: var(--zyt-ink);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<el-radio :value="1">开启</el-radio>
|
||||
<el-radio :value="0">关闭</el-radio>
|
||||
</el-radio-group>
|
||||
<div class="p-[15px] rounded-[8px] bg-[#f3f8ff] text-[#136bdf] mt-2">
|
||||
<div class="banner-editor-hint p-[15px] rounded-[8px] bg-[#f3f8ff] text-[#136bdf] mt-2">
|
||||
开启背景联动后,需为轮播图设置背景图,轮播图切换时,背景图也跟随切换,此时该页面自身的“页面背景“设置将失效。
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -178,3 +178,10 @@ const handleDelete = (index: number) => {
|
||||
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
:root[data-admin-ui='v2'] .banner-editor-hint {
|
||||
background-color: var(--zyt-surface-subtle);
|
||||
color: var(--zyt-text);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<template>
|
||||
<div class="decoration-pages min-w-[1100px]">
|
||||
<el-card shadow="never" class="!border-none !rounded-none !bg-primary">
|
||||
<el-card shadow="never" class="pc-editor-toolbar !border-none !rounded-none">
|
||||
<div class="flex justify-between w-full">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
:icon="ArrowLeft"
|
||||
style="color: #fff"
|
||||
class="pc-editor-back"
|
||||
@click="handleBack"
|
||||
>
|
||||
返回
|
||||
</el-button>
|
||||
<el-button v-perms="['decorate:pages:save']" @click="setData"> 保存 </el-button>
|
||||
<el-button v-perms="['decorate:pages:save']" :type="settings.adminUi === 'v2' ? 'primary' : 'default'" @click="setData"> 保存 </el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<div class="flex-1 h-full">
|
||||
@@ -24,10 +24,12 @@ import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
|
||||
import { getDecoratePages, setDecoratePages } from '@/api/decoration'
|
||||
import feedback from '@/utils/feedback'
|
||||
import useSettingStore from '@/stores/modules/setting'
|
||||
|
||||
import PreviewPc from './component/pages/preview-pc.vue'
|
||||
|
||||
const router = useRouter()
|
||||
const settings = useSettingStore()
|
||||
|
||||
enum pagesTypeEnum {
|
||||
HOME = '4'
|
||||
@@ -89,4 +91,13 @@ watch(
|
||||
min-height: calc(100vh);
|
||||
@apply flex flex-col;
|
||||
}
|
||||
/* The editor toolbar belongs to the admin; the PC preview keeps its own colors. */
|
||||
.pc-editor-toolbar {
|
||||
background-color: var(--editor-toolbar-surface, var(--el-color-primary));
|
||||
.pc-editor-back { color: var(--editor-toolbar-ink, #fff); }
|
||||
}
|
||||
:root[data-admin-ui='v2'] .pc-editor-toolbar {
|
||||
--editor-toolbar-surface: var(--zyt-surface);
|
||||
--editor-toolbar-ink: var(--zyt-text);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
<el-table-column prop="unit" label="单位" width="80" align="center" />
|
||||
<el-table-column prop="settlement_price" label="结算价(元)" width="110" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="text-blue-600">{{ formatPrice(row.settlement_price) }}</span>
|
||||
<span class="medicine-price text-blue-600">{{ formatPrice(row.settlement_price) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="retail_price" label="零售价(元)" width="110" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="text-green-600 font-medium">{{ formatPrice(row.retail_price) }}</span>
|
||||
<span class="medicine-price text-green-600 font-medium">{{ formatPrice(row.retail_price) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="stock" label="库存" width="100" align="center">
|
||||
@@ -436,4 +436,10 @@ onMounted(() => {
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .medicine-library .medicine-price {
|
||||
color: var(--zyt-ink);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<div class="grid grid-cols-4 gap-4 mb-4">
|
||||
<el-card shadow="hover">
|
||||
<div class="text-gray-500 text-sm mb-1">总客户数</div>
|
||||
<div class="text-2xl font-bold text-primary">{{ stats.total }}</div>
|
||||
<div class="customer-kpi-value text-2xl font-bold text-primary">{{ stats.total }}</div>
|
||||
</el-card>
|
||||
<el-card shadow="hover" class="today-arrival-card cursor-pointer" @click="openArrivalDrawer">
|
||||
<div class="flex items-center justify-between mb-1">
|
||||
@@ -50,7 +50,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="flex items-end gap-2">
|
||||
<div class="text-2xl font-bold text-success leading-none">{{ stats.today }}</div>
|
||||
<div class="customer-kpi-value text-2xl font-bold text-success leading-none">{{ stats.today }}</div>
|
||||
<div class="text-xs text-gray-400 pb-1">人</div>
|
||||
</div>
|
||||
<!-- 24 小时分布迷你柱:高度相对今日峰值等比 -->
|
||||
@@ -1370,3 +1370,13 @@ onUnmounted(() => {
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .qywx-customer-page {
|
||||
.customer-kpi-value { color: var(--zyt-ink); }
|
||||
.hourly-bar:not(.is-empty) { background-color: var(--zyt-selected-ink, var(--zyt-primary)); }
|
||||
.hourly-bar.is-current { outline-color: var(--zyt-ink); }
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:用户账户变动记录"
|
||||
:closable="false"
|
||||
show-icon
|
||||
></el-alert>
|
||||
<admin-page-hint title="温馨提示:用户账户变动记录" />
|
||||
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
|
||||
<el-form-item class="w-[280px]" label="用户信息">
|
||||
<el-input
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:用户充值记录"
|
||||
:closable="false"
|
||||
show-icon
|
||||
></el-alert>
|
||||
<admin-page-hint title="温馨提示:用户充值记录" />
|
||||
<el-form ref="formRef" class="mb-[-16px] mt-[16px]" :model="queryParams" :inline="true">
|
||||
<el-form-item class="w-[280px]" label="充值单号">
|
||||
<el-input
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:平台配置在各个场景下的通知发送方式和内容模板"
|
||||
:closable="false"
|
||||
show-icon
|
||||
></el-alert>
|
||||
<admin-page-hint title="温馨提示:平台配置在各个场景下的通知发送方式和内容模板" />
|
||||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<el-tabs v-model="tabsActive" @tab-change="getLists">
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:设置系统支持的支付方式"
|
||||
:closable="false"
|
||||
show-icon
|
||||
/>
|
||||
<admin-page-hint title="温馨提示:设置系统支持的支付方式" />
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt-4 !border-none">
|
||||
<div>
|
||||
|
||||
@@ -2,12 +2,7 @@
|
||||
<template>
|
||||
<div class="cache">
|
||||
<el-card class="!border-none" shadow="never">
|
||||
<el-alert
|
||||
type="warning"
|
||||
title="温馨提示:管理系统运行过程中产生的缓存"
|
||||
:closable="false"
|
||||
show-icon
|
||||
></el-alert>
|
||||
<admin-page-hint title="温馨提示:管理系统运行过程中产生的缓存" />
|
||||
</el-card>
|
||||
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
|
||||
@@ -875,7 +875,7 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
.rate-cell-sub {
|
||||
font-size: 11px;
|
||||
color: var(--el-text-color-placeholder);
|
||||
color: var(--revisit-ratio-ink, var(--el-text-color-placeholder));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -898,4 +898,9 @@ onBeforeUnmount(() => {
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .revisit-rate-page {
|
||||
--revisit-ratio-ink: var(--zyt-text);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -869,7 +869,7 @@ onMounted(() => {
|
||||
|
||||
.rate-cell-sub {
|
||||
font-size: 11px;
|
||||
color: var(--el-text-color-placeholder);
|
||||
color: var(--revisit-ratio-ink, var(--el-text-color-placeholder));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -895,4 +895,9 @@ onMounted(() => {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .revisit-rate-page {
|
||||
--revisit-ratio-ink: var(--zyt-text);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="120" align="right">
|
||||
<template #default="{ row }">
|
||||
<span class="text-red-500 font-semibold">¥{{ formatAmount(row.amount) }}</span>
|
||||
<span class="patient-order-amount text-red-500 font-semibold">¥{{ formatAmount(row.amount) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="医生" prop="doctor_name" width="110" show-overflow-tooltip>
|
||||
@@ -273,4 +273,10 @@ defineExpose({ refresh: () => getLists() })
|
||||
flex-wrap: wrap;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
@media screen {
|
||||
:root[data-admin-ui='v2']:not(.dark) .layout-default .patient-order-amount {
|
||||
color: var(--zyt-ink);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const assert = require('node:assert/strict')
|
||||
const test = require('node:test')
|
||||
const { parse, compileScript } = require('@vue/compiler-sfc')
|
||||
const ts = require('typescript')
|
||||
const vue = require('vue')
|
||||
const { renderToString } = require('vue/server-renderer')
|
||||
const src = path.join(__dirname, '../src')
|
||||
const read = rel => fs.readFileSync(path.join(src, rel), 'utf8')
|
||||
const pages = ["channel/h5","channel/open_setting","channel/weapp","channel/wx_oa/config","channel/wx_oa/reply/default_reply","channel/wx_oa/reply/follow_reply","channel/wx_oa/reply/keyword_reply","article/column/index","finance/balance_details","finance/recharge_record","message/notice/index","setting/pay/config/index","setting/system/cache"]
|
||||
test('普通说明仅在 V2 使用原生 info 图标,经典版保留 warning;内容与关闭行为不变', async () => {
|
||||
const filename = path.join(src, 'components/AdminPageHint.vue')
|
||||
const { descriptor } = parse(fs.readFileSync(filename, 'utf8'), { filename })
|
||||
const { content } = compileScript(descriptor, { id: 'hint', inlineTemplate: true })
|
||||
const js = ts.transpileModule(content, { compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2022 } }).outputText
|
||||
for (const [adminUi, type] of [['v2','info'], ['legacy','warning']]) {
|
||||
const m = { exports: {} }
|
||||
new Function('require', 'module', 'exports', js)(k => k === '@/stores/modules/setting' ? { default: () => ({ adminUi }) } : require(k), m, m.exports)
|
||||
let actual
|
||||
const app = vue.createSSRApp(m.exports.default, { title: '用户充值记录' })
|
||||
app.component('el-alert', { props: { title: String, type: String, closable: Boolean, showIcon: Boolean },
|
||||
setup(props) { actual = { ...props };return () => vue.h('div', props.title) } })
|
||||
assert.match(await renderToString(app), /用户充值记录/)
|
||||
assert.deepEqual(actual, { title: '用户充值记录', type, closable: false, showIcon: true })
|
||||
}
|
||||
})
|
||||
test('仅这 13 个常驻使用说明启用;存储迁移、身份冲突和退款仍使用原语义', () => {
|
||||
for (const page of pages) assert.match(read('views/'+page+'.vue'), /<admin-page-hint title="温馨提示:[^"]+"\s*\/>/)
|
||||
const storage = read('views/setting/storage/index.vue')
|
||||
assert.match(storage, /<el-alert type="warning"/)
|
||||
assert.match(storage, /请勿随意切换存储方式/)
|
||||
assert.match(read('views/permission/identity/index.vue'), /type="warning"/)
|
||||
assert.doesNotMatch(read('views/finance/refund_record.vue'), /admin-page-hint/)
|
||||
})
|
||||
@@ -0,0 +1,45 @@
|
||||
const assert = require('node:assert/strict')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const test = require('node:test')
|
||||
const { parse, compileStyle } = require('@vue/compiler-sfc')
|
||||
const postcss = require('postcss')
|
||||
|
||||
const cases = [
|
||||
['doctor/medicine.vue', 'medicine-price', ['row.settlement_price', 'row.retail_price']],
|
||||
['tcm/diagnosis/components/PatientOrderList.vue', 'patient-order-amount', ['row.amount']],
|
||||
['consumer/prescription/components/PrescriptionOrderDetailDrawer.vue', 'po-regular-metric', [
|
||||
'detailData.amount', 'detailData.linked_pay_paid_total', 'detailLinkedPayOrders.length',
|
||||
'detailPrescription.amount', 'row.amount', 'row.amount'
|
||||
]]
|
||||
]
|
||||
|
||||
for (const [rel, marker, fields] of cases) {
|
||||
test(rel + ':只给普通金额/笔数上浅色墨色,不覆盖同屏状态或 H5', () => {
|
||||
const filename = path.join(__dirname, '../src/views', rel)
|
||||
const { descriptor, errors } = parse(fs.readFileSync(filename, 'utf8'), { filename })
|
||||
assert.deepEqual(errors, [])
|
||||
const template = descriptor.template.content
|
||||
const nodes = [...template.matchAll(new RegExp('<(?:div|span) class="[^"]*\\b' + marker + '\\b[^"]*">([^<]+)<', 'g'))]
|
||||
assert.deepEqual(nodes.map((m, n) => m[1].includes(fields[n])), fields.map(() => true))
|
||||
|
||||
const rules = []
|
||||
for (const block of descriptor.styles) {
|
||||
const style = compileStyle({ filename, source: block.content, id: 'data-v-price-test', scoped: block.scoped, preprocessLang: block.lang })
|
||||
assert.deepEqual(style.errors, [])
|
||||
postcss.parse(style.code).walkRules(rule => {
|
||||
if (rule.selector.includes('.' + marker)) rules.push(rule)
|
||||
})
|
||||
}
|
||||
assert.equal(rules.length, 1)
|
||||
const rule = rules[0]
|
||||
assert.equal(rule.selectors.length, 1)
|
||||
assert.equal(rule.parent.name, 'media')
|
||||
assert.equal(rule.parent.params, 'screen')
|
||||
assert.match(rule.selector, /:root\[data-admin-ui=['"]?v2['"]?\]:not\(\.dark\)/)
|
||||
assert.ok(rule.selector.endsWith('.' + marker + '[data-v-price-test]'))
|
||||
// 共享子件会出现在独立 H5 诊单;透传到 body 的订单详情仍须以后台外壳为限。
|
||||
if (rel.includes('/components/')) assert.ok(rule.selector.includes('.layout-default'))
|
||||
assert.deepEqual(rule.nodes.map(d => [d.prop, d.value]), [['color', 'var(--zyt-ink)']])
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
const test = require('node:test')
|
||||
const assert = require('node:assert/strict')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const { parse, compileStyle } = require('@vue/compiler-sfc')
|
||||
const postcss = require('postcss')
|
||||
|
||||
function read(name) {
|
||||
const filename = path.join(__dirname, '../src/views/decoration', name)
|
||||
const { descriptor, errors } = parse(fs.readFileSync(filename, 'utf8'), { filename })
|
||||
assert.deepEqual(errors, [])
|
||||
const rules = []
|
||||
for (const block of descriptor.styles) {
|
||||
const css = compileStyle({ filename, source: block.content, id: 'data-v-editor-test', scoped: block.scoped, preprocessLang: block.lang })
|
||||
assert.deepEqual(css.errors, [])
|
||||
postcss.parse(css.code).walkRules(rule => rules.push(rule))
|
||||
}
|
||||
return { rules, template: descriptor.template.content }
|
||||
}
|
||||
test('PC 编辑工具条只在新版换成系统卡面;保存身份校验和原操作不变', () => {
|
||||
const { rules, template } = read('pc_details.vue')
|
||||
const theme = rules.filter(r => /data-admin-ui=['"]?v2/.test(r.selector))
|
||||
assert.equal(theme.length, 1)
|
||||
assert.match(theme[0].selector, /\.pc-editor-toolbar\[/)
|
||||
assert.deepEqual(Object.fromEntries(theme[0].nodes.map(d => [d.prop, d.value])), {
|
||||
'--editor-toolbar-surface': 'var(--zyt-surface)', '--editor-toolbar-ink': 'var(--zyt-text)'
|
||||
})
|
||||
assert.match(template, /v-perms="\['decorate:pages:save'\]"/)
|
||||
assert.match(template, /:type="settings\.adminUi === 'v2' \? 'primary' : 'default'"/)
|
||||
assert.match(template, /@click="setData"/)
|
||||
assert.match(template, /@click="handleBack"/)
|
||||
})
|
||||
test('轮播的后台说明取中性底色和正文色;改动不选择预览图或单选项', () => {
|
||||
const { rules, template } = read('component/widgets/banner/attr.vue')
|
||||
const theme = rules.filter(r => /data-admin-ui=['"]?v2/.test(r.selector))
|
||||
assert.equal(theme.length, 1)
|
||||
assert.match(theme[0].selector, /\.banner-editor-hint\[/)
|
||||
assert.deepEqual(Object.fromEntries(theme[0].nodes.map(d => [d.prop, d.value])), {
|
||||
'background-color': 'var(--zyt-surface-subtle)', color: 'var(--zyt-text)'
|
||||
})
|
||||
assert.match(template, /banner-editor-hint[^>]*>\s*开启背景联动后/)
|
||||
assert.match(template, /v-model="contentData.bg_style"/)
|
||||
})
|
||||
@@ -0,0 +1,28 @@
|
||||
const assert = require('node:assert/strict')
|
||||
const test = require('node:test')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const postcss = require('postcss')
|
||||
const { parse, compileStyle } = require('@vue/compiler-sfc')
|
||||
for (const file of ['revisit_rate/index.vue', 'revisit_assign_rate/components/CohortReport.vue']) {
|
||||
test(file + ':真实分母不冒用占位色;经典、暗色与打印保持原值', () => {
|
||||
const filename = path.join(__dirname, '../src/views/stats', file)
|
||||
const { descriptor } = parse(fs.readFileSync(filename,'utf8'), { filename })
|
||||
const block = descriptor.styles.at(-1)
|
||||
const result = compileStyle({ filename, id: 'data-v-rate', scoped: block.scoped, source: block.content, preprocessLang: block.lang })
|
||||
assert.deepEqual(result.errors, [])
|
||||
const css = postcss.parse(result.code), refs = []
|
||||
css.walkDecls('--revisit-ratio-ink', d => {
|
||||
assert.equal(d.value, 'var(--zyt-text)')
|
||||
assert.match(d.parent.selector, /data-admin-ui=v2\]:not\(\.dark\).*\.revisit-rate-page/)
|
||||
assert.equal(d.parent.parent.params, 'screen')
|
||||
refs.push('definition')
|
||||
})
|
||||
css.walkDecls('color', d => { if(d.value.includes('--revisit-ratio-ink')) {
|
||||
assert.equal(d.value,'var(--revisit-ratio-ink, var(--el-text-color-placeholder))')
|
||||
assert.match(d.parent.selector,/\.rate-cell-sub/)
|
||||
refs.push('consumer')
|
||||
}})
|
||||
assert.deepEqual(refs, ['definition','consumer'])
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
const assert = require('node:assert/strict')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
const test = require('node:test')
|
||||
const postcss = require('postcss')
|
||||
const { compileStyle, parse } = require('@vue/compiler-sfc')
|
||||
|
||||
function lightPageStyle(page, root) {
|
||||
const filename = path.join(__dirname, '../src/views', page)
|
||||
const { descriptor, errors } = parse(fs.readFileSync(filename, 'utf8'), { filename })
|
||||
assert.deepEqual(errors, [])
|
||||
const block = descriptor.styles.find(s => s.scoped && s.content.includes('data-admin-ui'))
|
||||
assert.ok(block, page + ' 缺少局部亮色规则')
|
||||
const css = compileStyle({
|
||||
filename, id: 'data-v-tone-test', scoped: true, source: block.content, preprocessLang: block.lang
|
||||
})
|
||||
assert.deepEqual(css.errors, [])
|
||||
const declarations = new Map()
|
||||
postcss.parse(css.code).walkRules(rule => {
|
||||
assert.equal(rule.parent.name, 'media')
|
||||
assert.equal(rule.parent.params, 'screen')
|
||||
for (const selector of rule.selectors) {
|
||||
assert.ok(selector.startsWith(':root[data-admin-ui=v2]:not(.dark) ' + root))
|
||||
assert.match(selector, /\[data-v-tone-test\]/)
|
||||
assert.doesNotMatch(selector, /\.el-|\.active\b|\.bubble-|\.task-error|\.session-tag/)
|
||||
rule.walkDecls(decl => {
|
||||
assert.match(decl.prop, /^(?:color|background-color|outline-color)$/)
|
||||
assert.ok(!decl.important)
|
||||
declarations.set(selector.replaceAll('[data-v-tone-test]', '') + ':' + decl.prop, decl.value)
|
||||
})
|
||||
}
|
||||
})
|
||||
function value(target, prop) {
|
||||
return declarations.get(':root[data-admin-ui=v2]:not(.dark) ' + root + ' ' + target + ':' + prop)
|
||||
}
|
||||
return { value, template: descriptor.template.content, original: descriptor.styles[0].content }
|
||||
}
|
||||
|
||||
test('企微会话的管理区小字采用正常可读的正文色,保留会话选中、消息方向和任务状态', () => {
|
||||
const { value, original } = lightPageStyle('chat/index.vue', '.qywx-im')
|
||||
for (const name of ['.session-preview', '.session-time', '.session-staff', '.msg-customer-sub', '.no-session .tips .text-sm']) {
|
||||
assert.equal(value(name, 'color'), 'var(--zyt-text)', name)
|
||||
}
|
||||
assert.equal(value('.col-message', 'background-color'), 'var(--art-gray-200)')
|
||||
assert.match(original, /&\.active\s*\{\s*background: #e6f1fc;/)
|
||||
assert.match(fs.readFileSync(path.join(__dirname, '../src/views/chat/components/MessageBubble.vue'), 'utf8'), /background: #95ec69;/)
|
||||
})
|
||||
|
||||
test('企微客户总数与今日新增共用指标文字色,24 小时图保留零值轨道和当前小时标记', () => {
|
||||
const { value, template, original } = lightPageStyle('fans/qywx.vue', '.qywx-customer-page')
|
||||
assert.equal(value('.customer-kpi-value', 'color'), 'var(--zyt-ink)')
|
||||
assert.equal(value('.hourly-bar:not(.is-empty)', 'background-color'), 'var(--zyt-selected-ink, var(--zyt-primary))')
|
||||
assert.equal(value('.hourly-bar.is-current', 'outline-color'), 'var(--zyt-ink)')
|
||||
for (const metric of ['total', 'today']) {
|
||||
assert.match(template, new RegExp('class="[^"]*customer-kpi-value[^"]*">\\s*{{ stats\\.' + metric + ' }}'))
|
||||
}
|
||||
assert.match(template, /'is-empty': c === 0/)
|
||||
assert.match(template, /'is-current': h === currentHour/)
|
||||
assert.match(template, /:type="syncStatusTagType"/)
|
||||
assert.match(original, /&\.is-empty\s*\{\s*background: var\(--el-border-color-lighter\);/)
|
||||
})
|
||||
Reference in New Issue
Block a user