This commit is contained in:
zuowei1216
2025-12-30 14:46:22 +08:00
parent 6c73b31100
commit 12395d8eca
181 changed files with 1255 additions and 114 deletions

View File

@@ -1,3 +0,0 @@
## 目录说明
- cep 插件壳模板文件
- cep.config.json 配置文件

View File

@@ -1,65 +0,0 @@
import { ICepConfig } from "@plugins";
const config: ICepConfig = {
name: "cepName",
id: "com.cepName",
version: "1.0.0",
extensionVersion: "6.1.0",
requiredRuntimeVersion: "9.0",
type: "Panel",
parameters: [
"--enable-nodejs",
],
panels: [
{
name: "cepName",
displayName: "panelName",
main: "./index.html",
width: 400,
height: 300,
minWidth: 400,
minHeight: 300,
maxWidth: 4000,
maxHeight: 3000,
}
],
hosts:[
{
name: "AEFT",
version: "[0.0,99.9]",
},
{
name: "PPRO",
version: "[0.0,99.9]",
},
{
name: "ILST",
version: "[0.0,99.9]",
},
{
name: "PHXS",
version: "[0.0,99.9]",
},
{
name: "FLPR",
version: "[0.0,99.9]",
},
],
build: {
jsxBin: false,
/**国家 */
country: "CN",
/**省份 */
province: "GD",
/**公司名称 */
org: "你的公司名称",
/**签名密码 */
password: "",
tsa: "",
},
zxp: {
jsxBin: false
}
}
export default config;

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="com.temp.id" ExtensionBundleVersion="1.0" Version="6.0"> <!-- MAJOR-VERSION-UPDATE-MARKER -->
<ExtensionList>
<Extension Id="com.temp.id" Version="6.1.0"/>
</ExtensionList>
<ExecutionEnvironment>
<HostList>
<Host Name="PHXS" Version="[11.0,99.9]"/>
<Host Name="ILST" Version="[11.0,99.9]"/>
</HostList>
<LocaleList>
<Locale Code="All"/>
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="7.0"/> <!-- MAJOR-VERSION-UPDATE-MARKER -->
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
</DispatchInfoList>
</ExtensionManifest>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,16 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{name}}</title>
<script>
window.location.href = "{{serverURL}}"
</script>
</head>
<body>
</body>
</html>

View File

@@ -1,15 +0,0 @@
export function joinDebug(id: string, hosts: { name: string }[]) {
let port = 7090
return `
<?xml version="1.0" encoding="UTF-8"?>
<ExtensionList>
<Extension Id="${id}">
<HostList>
${hosts
.map((host) => `<Host Name="${host.name}" Port="${port++}"/>`)
.join("\n")}
</HostList>
</Extension>
</ExtensionList>
`
}

View File

@@ -1,15 +0,0 @@
export function joinHtml(name:string,server:string){
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>${name}</title>
<script>
// 直接跳转到目标网址(带时间戳防止缓存)
window.location.href = "https://app.aidg168.uk/?_t=" + Date.now();
</script>
</head>
<body>
</body>
</html>`
}

View File

@@ -1,66 +0,0 @@
import { ICepConfig } from "../types";
export function joinManifest(config: ICepConfig) {
const { id, version, extensionVersion, requiredRuntimeVersion, hosts, parameters, panels } = config
const mainId=`${id}`
const panel = panels[0]
return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<ExtensionManifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ExtensionBundleId="${id}.body" ExtensionBundleVersion="1.0" Version="6.0"> <!-- MAJOR-VERSION-UPDATE-MARKER -->
<ExtensionList>
<Extension Id="${mainId}" Version="${extensionVersion}"/>
</ExtensionList>
<ExecutionEnvironment>
<HostList>
${hosts.map(item => `<Host Name="${item.name}" Version="${item.version}"/>`).join("\n")}
</HostList>
<LocaleList>
<Locale Code="All"/>
</LocaleList>
<RequiredRuntimeList>
<RequiredRuntime Name="CSXS" Version="${requiredRuntimeVersion}"/> <!-- MAJOR-VERSION-UPDATE-MARKER -->
</RequiredRuntimeList>
</ExecutionEnvironment>
<DispatchInfoList>
<Extension Id="${mainId}">
<DispatchInfo>
<Resources>
<MainPath>./index.html</MainPath>
<!-- <ScriptPath>./jsx/core.jsx</ScriptPath> -->
<CEFCommandLine>
${parameters.map(item => `<Parameter>${item}</Parameter>`).join("\n")}
</CEFCommandLine>
</Resources>
<Lifecycle>
<AutoVisible>true</AutoVisible>
</Lifecycle>
<UI>
<Type>Panel</Type>
<Menu>${panel.displayName}</Menu>
<Geometry>
<Size>
<Height>${panel.height}</Height>
<Width>${panel.width}</Width>
</Size>
<MaxSize>
<Height>${panel.maxHeight||panel.height}</Height>
<Width>${panel.maxWidth||panel.width}</Width>
</MaxSize>
<MinSize>
<Height>${panel.minHeight||panel.height}</Height>
<Width>${panel.minWidth||panel.width}</Width>
</MinSize>
</Geometry>
<Icons>
<Icon Type="Normal">./img/highlight.png</Icon>
<Icon Type="RollOver">./img/dark.png</Icon>
<Icon Type="DarkNormal">./img/highlight.png</Icon>
<Icon Type="DarkRollOver">./img/dark.png</Icon>
</Icons>
</UI>
</DispatchInfo>
</Extension>
</DispatchInfoList>
</ExtensionManifest>
`
}

View File

@@ -1,40 +0,0 @@
import { ref, onMounted, onUnmounted } from 'vue';
import { initThemeListener } from '@/utils/theme';
export function useTheme() {
const isDark = ref(true);
// 简易的判断当前是否是深色主题的逻辑
// 实际逻辑由 utils/theme.ts 中的 updateTheme 处理,它会更新 body 的 arco-theme 属性
const checkTheme = () => {
isDark.value = document.body.getAttribute('arco-theme') === 'dark';
};
onMounted(() => {
// 初始化并开始监听
initThemeListener();
// 初始检查
checkTheme();
// 监听 body 属性变化 (以便在 theme.ts 更新 body 属性时我们能感知到)
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === 'attributes' && mutation.attributeName === 'arco-theme') {
checkTheme();
}
});
});
observer.observe(document.body, { attributes: true });
// Cleanup
onUnmounted(() => {
observer.disconnect();
});
});
return {
isDark
};
}

View File

@@ -1,122 +1,49 @@
<template>
<div class="home-view">
<header class="header">
<h1>Designer 管理后台</h1>
<p class="subtitle">集成开发与资源管理中心</p>
</header>
<div class="card-grid">
<div class="card" @click="goToIframe">
<div class="icon">🌐</div>
<h3>外部预览</h3>
<p>嵌入式浏览器页面查看</p>
</div>
<div class="card" @click="toggleTheme">
<div class="icon">{{ isDark ? '🌙' : '☀️' }}</div>
<h3>主题切换</h3>
<p>当前: {{ isDark ? '深色模式' : '浅色模式' }}</p>
</div>
</div>
<div class="status-panel">
<h3>系统状态</h3>
<div class="status-item">
<span>版本:</span>
<code>{{ version }}</code>
</div>
<div class="status-item">
<span>运行模式:</span>
<span class="badge" :class="{ dev: isDev }">{{ isDev ? '开发模式' : '生产模式' }}</span>
</div>
<div class="loading-container">
<div class="spinner"></div>
<p>正在加载 Designer...</p>
</div>
</div>
</template>
<script setup lang="ts">
import { onMounted } from 'vue'
import { useRouter } from 'vue-router'
import { useTheme } from '@/hooks/useTheme'
const router = useRouter()
const { isDark, toggleTheme } = useTheme()
const version = __VERSION__
const isDev = __DEV__
const goToIframe = () => {
router.push('/iframe')
}
onMounted(() => {
// 自动跳转到 Iframe 页面
router.replace('/iframe')
})
</script>
<style scoped>
.home-view {
padding: 24px;
height: 100vh;
display: flex;
flex-direction: column;
gap: 32px;
justify-content: center;
align-items: center;
background-color: #1e1e1e; /* PS 默认深色背景 */
color: #ffffff;
}
.header h1 {
margin: 0;
font-size: 24px;
background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.subtitle {
margin: 10px 0 0;
opacity: 0.6;
}
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
}
.card {
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 12px;
padding: 24px;
cursor: pointer;
transition: all 0.3s ease;
.loading-container {
text-align: center;
}
.card:hover {
background: rgba(255, 255, 255, 0.1);
transform: translateY(-4px);
border-color: #4facfe;
.spinner {
width: 40px;
height: 40px;
border: 4px solid rgba(255, 255, 255, 0.1);
border-left-color: #0078d7;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 16px;
}
.icon {
font-size: 32px;
margin-bottom: 12px;
}
.status-panel {
background: rgba(0, 0, 0, 0.2);
border-radius: 8px;
padding: 16px;
}
.status-item {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
font-family: monospace;
}
.badge {
padding: 2px 8px;
border-radius: 4px;
font-size: 12px;
}
.badge.dev {
background: #f39c12;
color: #000;
@keyframes spin {
to { transform: rotate(360deg); }
}
</style>

View File

@@ -44,8 +44,11 @@ const frameRef = ref<HTMLIFrameElement | null>(null)
const loading = ref(true)
const currentUrl = ref(
// localStorage.getItem('adminPanelUrl') || 'https://app.aidg168.uk'
localStorage.getItem('adminPanelUrl') || 'http://localhost:5173/#/login'
localStorage.getItem('adminPanelUrl') || (
__DEV__
? 'http://localhost:5173'
: 'https://app.aidg168.uk'
)
)
function goBack() {

View File

@@ -1,56 +0,0 @@
/**
* 在你的网站https://app.aidg168.uk中添加此代码
* 用于接收来自 Photoshop CEP 插件的主题信息
*/
// 监听来自 PS 插件的主题消息
window.addEventListener('message', function(event) {
// 安全检查(可选)
// if (event.origin !== 'expected-origin') return;
const data = event.data;
// 检查是否是 PS 主题消息
if (data && data.type === 'PS_THEME' && data.theme) {
const theme = data.theme;
console.log('📨 收到 PS 主题:', theme);
// theme.bgColor: 背景颜色 (例如 'rgb(50, 50, 50)')
// theme.isLight: 是否为浅色主题 (true/false)
// theme.fontSize: 字体大小 (数字)
// 应用主题到你的网站
applyPSTheme(theme);
}
});
// 应用 PS 主题到网站
function applyPSTheme(theme) {
const root = document.documentElement;
// 设置 CSS 变量
root.style.setProperty('--ps-bg-color', theme.bgColor);
root.style.setProperty('--ps-font-size', theme.fontSize + 'px');
// 根据亮度切换主题
if (theme.isLight) {
// 浅色主题
document.body.classList.remove('dark-theme');
document.body.classList.add('light-theme');
root.style.setProperty('--ps-text-color', '#222222');
} else {
// 深色主题
document.body.classList.remove('light-theme');
document.body.classList.add('dark-theme');
root.style.setProperty('--ps-text-color', '#dfdfdf');
}
// 直接应用到 body
document.body.style.backgroundColor = theme.bgColor;
console.log('✅ PS 主题已应用');
}
// 可选:主动请求主题(如果插件已经加载)
window.parent.postMessage({ type: 'REQUEST_THEME' }, '*');