+
开启背景联动后,需为轮播图设置背景图,轮播图切换时,背景图也跟随切换,此时该页面自身的“页面背景“设置将失效。
@@ -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;
}
+
+
diff --git a/admin/src/views/decoration/pc_details.vue b/admin/src/views/decoration/pc_details.vue
index 000cb813b..979d090b7 100755
--- a/admin/src/views/decoration/pc_details.vue
+++ b/admin/src/views/decoration/pc_details.vue
@@ -1,17 +1,17 @@
-
+
返回
- 保存
+ 保存
@@ -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);
+}
diff --git a/admin/src/views/doctor/medicine.vue b/admin/src/views/doctor/medicine.vue
index c01c4a518..db5bf76ce 100755
--- a/admin/src/views/doctor/medicine.vue
+++ b/admin/src/views/doctor/medicine.vue
@@ -43,12 +43,12 @@
- {{ formatPrice(row.settlement_price) }}
+ {{ formatPrice(row.settlement_price) }}
- {{ formatPrice(row.retail_price) }}
+ {{ formatPrice(row.retail_price) }}
@@ -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);
+ }
+}
diff --git a/admin/src/views/fans/qywx.vue b/admin/src/views/fans/qywx.vue
index f2b39c128..1ebed241e 100755
--- a/admin/src/views/fans/qywx.vue
+++ b/admin/src/views/fans/qywx.vue
@@ -40,7 +40,7 @@
总客户数
- {{ stats.total }}
+ {{ stats.total }}
@@ -50,7 +50,7 @@
-
{{ stats.today }}
+
{{ stats.today }}
人
@@ -1370,3 +1370,13 @@ onUnmounted(() => {
}
}
+
+
diff --git a/admin/src/views/finance/balance_details.vue b/admin/src/views/finance/balance_details.vue
index 2e62c7514..9551b2b79 100755
--- a/admin/src/views/finance/balance_details.vue
+++ b/admin/src/views/finance/balance_details.vue
@@ -1,12 +1,7 @@
-
+
-
+
-
+
diff --git a/admin/src/views/setting/pay/config/index.vue b/admin/src/views/setting/pay/config/index.vue
index 842899068..cd515e281 100755
--- a/admin/src/views/setting/pay/config/index.vue
+++ b/admin/src/views/setting/pay/config/index.vue
@@ -1,12 +1,7 @@
-
+
diff --git a/admin/src/views/setting/system/cache.vue b/admin/src/views/setting/system/cache.vue
index 6fc2e2e93..9a0d8abf8 100755
--- a/admin/src/views/setting/system/cache.vue
+++ b/admin/src/views/setting/system/cache.vue
@@ -2,12 +2,7 @@
-
+
diff --git a/admin/src/views/stats/revisit_assign_rate/components/CohortReport.vue b/admin/src/views/stats/revisit_assign_rate/components/CohortReport.vue
index 061ae2f0a..37b6eab75 100755
--- a/admin/src/views/stats/revisit_assign_rate/components/CohortReport.vue
+++ b/admin/src/views/stats/revisit_assign_rate/components/CohortReport.vue
@@ -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);
+ }
+}
diff --git a/admin/src/views/stats/revisit_rate/index.vue b/admin/src/views/stats/revisit_rate/index.vue
index 374a1d51f..4678414cb 100755
--- a/admin/src/views/stats/revisit_rate/index.vue
+++ b/admin/src/views/stats/revisit_rate/index.vue
@@ -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);
+ }
+}
diff --git a/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue b/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue
index e559f25ad..633858b35 100755
--- a/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue
+++ b/admin/src/views/tcm/diagnosis/components/PatientOrderList.vue
@@ -68,7 +68,7 @@
- ¥{{ formatAmount(row.amount) }}
+ ¥{{ formatAmount(row.amount) }}
@@ -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);
+ }
+}
diff --git a/admin/tests/admin-page-hint-tone.test.cjs b/admin/tests/admin-page-hint-tone.test.cjs
new file mode 100644
index 000000000..86f133ee7
--- /dev/null
+++ b/admin/tests/admin-page-hint-tone.test.cjs
@@ -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'), //)
+ const storage = read('views/setting/storage/index.vue')
+ assert.match(storage, / {
+ 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)']])
+ })
+}
diff --git a/admin/tests/decoration-editor-tone.test.cjs b/admin/tests/decoration-editor-tone.test.cjs
new file mode 100644
index 000000000..eec9d8cf6
--- /dev/null
+++ b/admin/tests/decoration-editor-tone.test.cjs
@@ -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"/)
+})
diff --git a/admin/tests/revisit-ratio-tone.test.cjs b/admin/tests/revisit-ratio-tone.test.cjs
new file mode 100644
index 000000000..c42643661
--- /dev/null
+++ b/admin/tests/revisit-ratio-tone.test.cjs
@@ -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'])
+ })
+}
diff --git a/admin/tests/wecom-operations-v2-colors.test.cjs b/admin/tests/wecom-operations-v2-colors.test.cjs
new file mode 100644
index 000000000..df059ddda
--- /dev/null
+++ b/admin/tests/wecom-operations-v2-colors.test.cjs
@@ -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\);/)
+})