feat(short-drama-agent-front): 优化分镜界面并新增弹窗手势
This commit is contained in:
1 parent
b15a6011ce
commit
d68f03471c
59 files changed
+2694
-857
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>移动弹窗手势隔离验收</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./mobile-panels.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,109 @@
|
||||
import { createApp, defineComponent, h, ref } from 'vue'
|
||||
import { NButton, NCheckbox, NConfigProvider, NInput, darkTheme } from 'naive-ui'
|
||||
import AppDialog from '../../src/components/ui/AppDialog.vue'
|
||||
import AppDrawer from '../../src/components/ui/AppDrawer.vue'
|
||||
import '../../src/styles/styles.css'
|
||||
import '../../src/styles/admin.css'
|
||||
|
||||
/** 本页所有请求都拒绝,不连接项目或模型。 */
|
||||
window.fetch = async () => new Response(JSON.stringify({ message: '隔离验收禁止联网请求' }), { status: 403 })
|
||||
/** 覆盖手机和桌面超长标题,完整原文仍通过标题提示保留。 */
|
||||
const longTitle = '标题只占一行,超出宽度显示省略号,并保留完整名称。'.repeat(8)
|
||||
/** 仅在内存中观察关闭、输入、提交锁和长内容,不保存正式数据。 */
|
||||
const Preview = defineComponent({
|
||||
setup() {
|
||||
/** 普通弹窗开关。 */ const dialog = ref(false)
|
||||
/** 全屏抽屉开关。 */ const drawer = ref(false)
|
||||
/** 模拟真实提交锁,不发起任务。 */ const busy = ref(false)
|
||||
/** 切换普通弹窗长内容。 */ const long = ref(false)
|
||||
/** 关闭后重新打开仍保留父组件输入。 */ const draft = ref('这段隔离输入关闭后仍保留')
|
||||
/** 展示真实完成关闭次数。 */ const closed = ref(0)
|
||||
/**
|
||||
* 两种公共弹层共用的验证正文。
|
||||
* @param full 是否默认长内容
|
||||
* @returns 原生表单及长文
|
||||
*/
|
||||
function body(full: boolean) {
|
||||
return h('div', { class: 'workspace-section-stack' }, [
|
||||
h('p', '按住顶部横条向下拖动关闭;轻触和短拖保持展开。'),
|
||||
h(
|
||||
NCheckbox,
|
||||
{ checked: busy.value, 'onUpdate:checked': (value: boolean) => (busy.value = value) },
|
||||
() => '模拟提交中'
|
||||
),
|
||||
h(NInput, {
|
||||
value: draft.value,
|
||||
'onUpdate:value': (value: string) => (draft.value = value),
|
||||
'aria-label': '隔离输入'
|
||||
}),
|
||||
!full &&
|
||||
h(
|
||||
NCheckbox,
|
||||
{ checked: long.value, 'onUpdate:checked': (value: boolean) => (long.value = value) },
|
||||
() => '显示长内容'
|
||||
),
|
||||
...(full || long.value
|
||||
? Array.from({ length: 35 }, (_, index) =>
|
||||
h(
|
||||
'p',
|
||||
`段落 ${index + 1}:这是只读测试内容,用于核对正文滚动不会拖动面板,底部关闭按钮保持可见。`
|
||||
)
|
||||
)
|
||||
: [])
|
||||
])
|
||||
}
|
||||
return () =>
|
||||
h(
|
||||
NConfigProvider,
|
||||
{ theme: darkTheme },
|
||||
{
|
||||
default: () =>
|
||||
h('main', { style: 'padding:24px' }, [
|
||||
h('h1', '手机面板隔离验收'),
|
||||
h(
|
||||
'p',
|
||||
{ style: 'margin:16px 0' },
|
||||
`真实请求0次 · 关闭完成${closed.value}次 · 普通弹窗${dialog.value ? '已打开' : '已关闭'} · 全屏抽屉${drawer.value ? '已打开' : '已关闭'}`
|
||||
),
|
||||
h('div', { class: 'flex flex-wrap gap-3' }, [
|
||||
h(NButton, { onClick: () => (dialog.value = true) }, () => '打开普通弹窗'),
|
||||
h(NButton, { onClick: () => (drawer.value = true) }, () => '打开全屏抽屉')
|
||||
]),
|
||||
h(
|
||||
AppDialog,
|
||||
{
|
||||
open: dialog.value,
|
||||
'onUpdate:open': (value: boolean) => (dialog.value = value),
|
||||
title: `普通弹窗 · ${longTitle}`,
|
||||
busy: busy.value,
|
||||
onClosed: () => closed.value++
|
||||
},
|
||||
{ default: () => body(false) }
|
||||
),
|
||||
h(
|
||||
AppDrawer,
|
||||
{
|
||||
open: drawer.value,
|
||||
'onUpdate:open': (value: boolean) => (drawer.value = value),
|
||||
title: `全屏抽屉 · ${longTitle}`,
|
||||
busy: busy.value,
|
||||
onClosed: () => closed.value++
|
||||
},
|
||||
{
|
||||
default: () => body(true),
|
||||
footer: () => [
|
||||
h(
|
||||
NButton,
|
||||
{ disabled: busy.value, onClick: () => (drawer.value = false) },
|
||||
() => '关闭'
|
||||
),
|
||||
h(NButton, { disabled: true, type: 'primary' }, () => '模拟保存')
|
||||
]
|
||||
}
|
||||
)
|
||||
])
|
||||
}
|
||||
)
|
||||
}
|
||||
})
|
||||
createApp(Preview).mount('#app')
|
||||
@@ -22,14 +22,19 @@ const review = {
|
||||
)
|
||||
}
|
||||
/**
|
||||
* 只允许免费诊断和只读回读,批准、签收、执行及恢复全部拒绝。
|
||||
* 只允许免费诊断、布局输入预览和只读回读,批准、签收、执行及恢复全部拒绝。
|
||||
* @param input 请求地址
|
||||
* @param init 请求选项
|
||||
* @returns 隔离响应
|
||||
*/
|
||||
window.fetch = async (input, init) => {
|
||||
const path = String(input)
|
||||
if (init?.method && init.method !== 'GET' && !path.endsWith('/continuity/diagnosis'))
|
||||
const path = new URL(String(input), window.location.origin).pathname
|
||||
if (
|
||||
init?.method &&
|
||||
init.method !== 'GET' &&
|
||||
!path.endsWith('/continuity/diagnosis') &&
|
||||
!path.endsWith('/keyframe/preview')
|
||||
)
|
||||
return new Response(JSON.stringify({ message: '隔离页禁止写入与付费' }), { status: 403 })
|
||||
let data: unknown
|
||||
if (path.includes('/vision/preview'))
|
||||
|
||||
Reference in new issue
Block a user