Compare commits
24 Commits
3dc28bf225
...
8c90152eac
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c90152eac | |||
| 6bd464d01d | |||
| 0abc0262d1 | |||
| c11a5bdbc5 | |||
| bfb48727e7 | |||
| 5005bf94c3 | |||
| d8651570a3 | |||
| 220781f044 | |||
| 6449dd9d19 | |||
| 5a54976d5c | |||
| ce5ca666f1 | |||
| 2724bbcef1 | |||
| daa7a00daa | |||
| 01598aaac1 | |||
| 8f0a66338b | |||
| 1b50770874 | |||
| 7103c40c44 | |||
| cd6dd3d202 | |||
| 449bd0c09d | |||
| c6116562c2 | |||
| 5e2903488c | |||
| 29775c19e1 | |||
| 62f0cb0e29 | |||
| e576fb8c4c |
3
.env.dev-server
Normal file
@ -0,0 +1,3 @@
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='http://dev-casedata.igandan.com/admin/api'
|
||||
@ -1,3 +1,3 @@
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='SmartAdmin 开发环境(Dev)'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5478'
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5480'
|
||||
@ -1,3 +1,3 @@
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='SmartAdmin 本地环境(Local)'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5478'
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5480'
|
||||
|
||||
2
.env.pre
@ -1,3 +1,3 @@
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin 预发布环境(Pre)'
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api'
|
||||
@ -1,3 +1,3 @@
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin V3.X'
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api'
|
||||
@ -1,3 +1,3 @@
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin 测试环境(Test)'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5478'
|
||||
VITE_APP_TITLE='肝胆相照临床病例库'
|
||||
VITE_APP_API_URL='https://dev-casedata.igandan.com/admin/api'
|
||||
|
||||
88
ENV_CONFIG_README.md
Normal file
@ -0,0 +1,88 @@
|
||||
# 环境配置说明
|
||||
|
||||
## 环境配置文件
|
||||
|
||||
项目包含以下环境配置文件,用于配置不同环境的API地址:
|
||||
|
||||
### 1. `.env.localhost` - 本地开发环境
|
||||
```
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='SmartAdmin 本地环境(Local)'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5480'
|
||||
```
|
||||
|
||||
### 2. `.env.development` - 开发环境
|
||||
```
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='SmartAdmin 开发环境(Dev)'
|
||||
VITE_APP_API_URL='http://127.0.0.1:5480'
|
||||
```
|
||||
|
||||
### 3. `.env.dev-server` - 开发服务器环境
|
||||
```
|
||||
NODE_ENV=development
|
||||
VITE_APP_TITLE='SmartAdmin 开发服务器环境(Dev Server)'
|
||||
VITE_APP_API_URL='http://dev-casedata.igandan.com:5480'
|
||||
```
|
||||
|
||||
### 4. `.env.test` - 测试环境
|
||||
```
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin 测试环境(Test)'
|
||||
VITE_APP_API_URL='http://dev-casedata.igandan.com/admin/api'
|
||||
```
|
||||
|
||||
### 5. `.env.pre` - 预发布环境
|
||||
```
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin 预发布环境(Pre)'
|
||||
VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api'
|
||||
```
|
||||
|
||||
### 6. `.env.production` - 生产环境
|
||||
```
|
||||
NODE_ENV=production
|
||||
VITE_APP_TITLE='SmartAdmin V3.X'
|
||||
VITE_APP_API_URL='https://preview.smartadmin.vip/smart-admin-api'
|
||||
```
|
||||
|
||||
## 使用方法
|
||||
|
||||
### 开发时
|
||||
```bash
|
||||
# 本地开发
|
||||
npm run localhost
|
||||
|
||||
# 开发环境
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### 部署时
|
||||
```bash
|
||||
# 部署到开发服务器
|
||||
npm run build:dev-server
|
||||
|
||||
# 部署到测试环境
|
||||
npm run build:test
|
||||
|
||||
# 部署到预发布环境
|
||||
npm run build:pre
|
||||
|
||||
# 部署到生产环境
|
||||
npm run build:prod
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **API地址配置**: 每个环境配置文件中的 `VITE_APP_API_URL` 决定了该环境使用的后端API地址
|
||||
2. **端口配置**: 本地环境使用5480端口,开发服务器环境也使用5480端口
|
||||
3. **路径配置**: 测试环境使用 `/admin/api` 路径,其他环境根据实际情况配置
|
||||
4. **手动修改**: 如需修改API地址,直接编辑对应的环境配置文件即可
|
||||
|
||||
## 当前配置状态
|
||||
|
||||
- ✅ 本地环境: `http://127.0.0.1:5480`
|
||||
- ✅ 开发服务器环境: `http://dev-casedata.igandan.com:5480`
|
||||
- ✅ 测试环境: `http://dev-casedata.igandan.com/admin/api`
|
||||
- ✅ 预发布环境: `https://preview.smartadmin.vip/smart-admin-api`
|
||||
- ✅ 生产环境: `https://preview.smartadmin.vip/smart-admin-api`
|
||||
118
HOME_PAGE_CHANGE_README.md
Normal file
@ -0,0 +1,118 @@
|
||||
# 首页修改说明
|
||||
|
||||
## 🎯 修改目标
|
||||
|
||||
将系统首页从原来的"首页"改为"文章病例库管理",用户登录后直接进入文章病例库管理页面。
|
||||
|
||||
## 🔧 修改内容
|
||||
|
||||
### 1. 修改常量配置
|
||||
|
||||
#### `src/constants/system/home-const.js`
|
||||
- **HOME_PAGE_NAME**: 从 `'Home'` 改为 `'CaseClinicalArticleList'`
|
||||
- **HOME_PAGE_PATH**: 从 `'/home'` 改为 `'/case-clinical-article/list'`
|
||||
|
||||
#### `src/constants/common-const.js`
|
||||
- **HOME_PAGE_PATH**: 从 `'/home'` 改为 `'/case-clinical-article/list'`
|
||||
|
||||
### 2. 修改路由配置
|
||||
|
||||
#### `src/router/system/home.js`
|
||||
- **路径**: 从 `/home` 改为 `/case-clinical-article/list`
|
||||
- **标题**: 从"首页"改为"文章病例库管理"
|
||||
- **图标**: 从 `HomeOutlined` 改为 `FileTextOutlined`
|
||||
- **组件**: 从首页组件改为文章病例库列表组件
|
||||
|
||||
#### 新增 `src/router/system/case-clinical-article.js`
|
||||
- 创建完整的文章病例库管理路由配置
|
||||
- 包含列表页和表单页两个子路由
|
||||
|
||||
#### `src/router/routers.js`
|
||||
- 引入文章病例库管理路由配置
|
||||
- 将新路由添加到主路由数组中
|
||||
|
||||
## 📁 文件结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── constants/
|
||||
│ ├── system/
|
||||
│ │ └── home-const.js # 首页常量配置
|
||||
│ └── common-const.js # 通用常量配置
|
||||
├── router/
|
||||
│ ├── system/
|
||||
│ │ ├── home.js # 首页路由配置
|
||||
│ │ └── case-clinical-article.js # 文章病例库路由配置
|
||||
│ └── routers.js # 主路由配置
|
||||
└── views/
|
||||
└── business/
|
||||
└── case-clinical-article/
|
||||
├── case-clinical-article-list.vue # 列表页面
|
||||
└── case-clinical-article-form.vue # 表单页面
|
||||
```
|
||||
|
||||
## 🚀 使用方法
|
||||
|
||||
### 1. 用户登录后
|
||||
- 系统自动跳转到 `/case-clinical-article/list`
|
||||
- 显示文章病例库管理列表页面
|
||||
|
||||
### 2. 访问路径
|
||||
- **首页**: `/case-clinical-article/list`
|
||||
- **新增**: `/case-clinical-article/form?type=add`
|
||||
- **编辑**: `/case-clinical-article/form?type=edit&id=xxx`
|
||||
|
||||
### 3. 菜单显示
|
||||
- 主菜单显示"文章病例库管理"
|
||||
- 子菜单显示"文章病例库列表"
|
||||
- 表单页面在菜单中隐藏(hideInMenu: true)
|
||||
|
||||
## 🎨 界面变化
|
||||
|
||||
### 修改前
|
||||
- 首页显示系统概览信息
|
||||
- 图标:🏠 HomeOutlined
|
||||
- 标题:首页
|
||||
|
||||
### 修改后
|
||||
- 首页显示文章病例库管理列表
|
||||
- 图标:📄 FileTextOutlined
|
||||
- 标题:文章病例库管理
|
||||
|
||||
## ⚠️ 注意事项
|
||||
|
||||
1. **路由重定向**: 根路径 `/` 会自动重定向到文章病例库管理页面
|
||||
2. **权限控制**: 确保用户有访问文章病例库管理的权限
|
||||
3. **面包屑导航**: 面包屑会显示"文章病例库管理 > 文章病例库列表"
|
||||
4. **页面缓存**: 如果启用了keepAlive,文章病例库列表页面会被缓存
|
||||
|
||||
## 🔍 验证方法
|
||||
|
||||
### 1. 登录测试
|
||||
- 用户登录后应该直接进入文章病例库管理页面
|
||||
- URL应该是 `/case-clinical-article/list`
|
||||
|
||||
### 2. 菜单测试
|
||||
- 主菜单应该显示"文章病例库管理"
|
||||
- 点击应该能正常跳转
|
||||
|
||||
### 3. 路由测试
|
||||
- 访问根路径 `/` 应该重定向到文章病例库管理
|
||||
- 直接访问 `/case-clinical-article/list` 应该正常显示
|
||||
|
||||
## 📝 后续优化
|
||||
|
||||
1. **添加首页统计**: 在文章病例库列表页面添加统计信息
|
||||
2. **优化加载性能**: 考虑使用懒加载优化页面加载
|
||||
3. **添加快捷操作**: 在首页添加常用的快捷操作按钮
|
||||
4. **个性化配置**: 允许用户自定义首页显示内容
|
||||
|
||||
## ✅ 完成状态
|
||||
|
||||
- [x] 修改首页常量配置
|
||||
- [x] 修改首页路由配置
|
||||
- [x] 创建文章病例库路由配置
|
||||
- [x] 更新主路由配置
|
||||
- [x] 创建说明文档
|
||||
|
||||
**首页修改已完成!** 用户登录后将直接进入文章病例库管理页面。
|
||||
192
JS_PATH_FIX_README.md
Normal file
@ -0,0 +1,192 @@
|
||||
# JS文件路径问题修复说明
|
||||
|
||||
## 🚨 问题描述
|
||||
|
||||
在部署到开发服务器 `dev-casedata.igandan.com` 时,JS文件路径不正确,导致404错误:
|
||||
|
||||
```
|
||||
/admin/js/vue-types-DoCPvpw_.js HTTP/1.1" 405 552
|
||||
```
|
||||
|
||||
**目标路径**: `/admin/web/assets/js/[filename]-[hash].js`
|
||||
|
||||
## 🔍 问题分析
|
||||
|
||||
### 1. 路径配置不一致
|
||||
- **vite.config.js**: `base: '/'` (开发环境)
|
||||
- **package.json构建命令**: `--base=/admin/web/` (生产环境)
|
||||
- **实际部署路径**: `/admin/web/`
|
||||
|
||||
### 2. 构建输出路径问题
|
||||
- JS文件被放在 `js/` 目录下
|
||||
- 但base路径配置为 `/admin/`
|
||||
- 导致最终路径变成 `/admin/js/` 而不是 `/admin/assets/js/`
|
||||
|
||||
## ✅ 解决方案
|
||||
|
||||
### 1. 统一base路径配置
|
||||
|
||||
#### 修改 `vite.config.js`
|
||||
```javascript
|
||||
export default {
|
||||
base: process.env.NODE_ENV === 'production' ? '/admin/web/' : '/',
|
||||
// ... 其他配置
|
||||
}
|
||||
```
|
||||
|
||||
#### 修改 `package.json` 构建命令
|
||||
```json
|
||||
{
|
||||
"scripts": {
|
||||
"build:dev-server": "vite build --config vite.config.dev-server.js --mode dev-server",
|
||||
"build:test": "vite build --base=/admin/ --mode test",
|
||||
"build:pre": "vite build --base=/admin/ --mode pre",
|
||||
"build:prod": "vite build --base=/admin/ --mode production"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 创建专门的开发服务器配置
|
||||
|
||||
#### 新增 `vite.config.dev-server.js`
|
||||
```javascript
|
||||
export default {
|
||||
base: '/admin/web/',
|
||||
// ... 其他配置
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 修复构建输出路径
|
||||
|
||||
#### 修改 `vite.config.js` 中的构建配置
|
||||
```javascript
|
||||
build: {
|
||||
rollupOptions: {
|
||||
output: {
|
||||
chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 🚀 使用方法
|
||||
|
||||
### 1. 构建开发服务器版本
|
||||
```bash
|
||||
# 使用专门的配置文件构建
|
||||
npm run build:dev-server
|
||||
|
||||
# 或者使用构建脚本
|
||||
./build-dev-server.sh
|
||||
```
|
||||
|
||||
### 2. 验证构建结果
|
||||
构建完成后,检查以下文件路径是否正确:
|
||||
|
||||
```
|
||||
dist/
|
||||
├── index.html
|
||||
├── assets/
|
||||
│ ├── js/
|
||||
│ │ ├── index-[hash].js
|
||||
│ │ └── vendor-[hash].js
|
||||
│ ├── css/
|
||||
│ │ └── index-[hash].css
|
||||
│ └── [其他资源文件]
|
||||
```
|
||||
|
||||
### 3. 检查index.html中的路径
|
||||
确保 `dist/index.html` 中的资源路径以 `/admin/web/assets/` 开头:
|
||||
|
||||
```html
|
||||
<script type="module" crossorigin src="/admin/web/assets/js/index-[hash].js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/admin/web/assets/css/index-[hash].css">
|
||||
```
|
||||
|
||||
## 🔧 部署配置
|
||||
|
||||
### Nginx配置示例
|
||||
```nginx
|
||||
server {
|
||||
listen 80;
|
||||
server_name dev-casedata.igandan.com;
|
||||
|
||||
location /admin/web/ {
|
||||
alias /path/to/your/dist/;
|
||||
try_files $uri $uri/ /admin/web/index.html;
|
||||
|
||||
# 处理静态资源
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Docker部署
|
||||
确保构建后的文件正确复制到容器中:
|
||||
|
||||
```dockerfile
|
||||
# 复制构建后的前端资源
|
||||
COPY dist/ /usr/share/nginx/html/
|
||||
```
|
||||
|
||||
## 📋 检查清单
|
||||
|
||||
- [ ] 修改 `vite.config.js` 中的base路径
|
||||
- [ ] 创建 `vite.config.dev-server.js` 专用配置
|
||||
- [ ] 更新 `package.json` 中的构建命令
|
||||
- [ ] 修复构建输出路径配置
|
||||
- [ ] 测试构建结果
|
||||
- [ ] 验证部署后的资源访问
|
||||
|
||||
## 🎯 预期结果
|
||||
|
||||
修复后,JS文件应该能够正确访问:
|
||||
|
||||
- ✅ 正确路径: `/admin/web/assets/js/[filename]-[hash].js`
|
||||
- ❌ 错误路径: `/admin/js/[filename]-[hash].js`
|
||||
|
||||
## 🆘 故障排除
|
||||
|
||||
### 如果问题仍然存在:
|
||||
|
||||
1. **清理构建缓存**
|
||||
```bash
|
||||
rm -rf dist node_modules/.vite
|
||||
npm run build:dev-server
|
||||
```
|
||||
|
||||
2. **检查环境变量**
|
||||
```bash
|
||||
cat .env.dev-server
|
||||
```
|
||||
|
||||
3. **验证构建配置**
|
||||
```bash
|
||||
npm run build:dev-server -- --debug
|
||||
```
|
||||
|
||||
4. **检查网络请求**
|
||||
使用浏览器开发者工具查看Network标签页中的资源请求路径
|
||||
|
||||
## 📞 技术支持
|
||||
|
||||
如果按照以上步骤仍然无法解决问题,请检查:
|
||||
|
||||
1. 构建日志输出
|
||||
2. 浏览器控制台错误信息
|
||||
3. 服务器访问日志
|
||||
4. 网络请求状态码
|
||||
351
README-UEditor.md
Normal file
@ -0,0 +1,351 @@
|
||||
# UEditor 富文本编辑器组件
|
||||
|
||||
## 概述
|
||||
|
||||
UEditor 是一个基于 `vue-ueditor-wrap` 的富文本编辑器组件,专门为文章管理、内容编辑等场景设计。该组件已经集成到文章管理系统中,支持富文本编辑、图片上传、表格插入等功能。
|
||||
|
||||
## 功能特性
|
||||
|
||||
### 🎯 核心功能
|
||||
- **富文本编辑**:支持文本格式化、段落样式、列表等
|
||||
- **图片管理**:支持图片上传、插入、编辑
|
||||
- **表格功能**:支持表格插入、编辑、合并单元格
|
||||
- **媒体支持**:支持视频、附件插入
|
||||
- **代码插入**:支持代码块插入和语法高亮
|
||||
- **内容导入**:支持Word、Markdown文档导入
|
||||
|
||||
### 🚀 增强功能
|
||||
- **自动保存**:60秒自动保存,防止内容丢失
|
||||
- **全屏编辑**:支持全屏模式,提升编辑体验
|
||||
- **响应式设计**:自适应不同屏幕尺寸
|
||||
- **右键菜单**:支持右键快捷操作
|
||||
- **工具栏定制**:丰富的工具栏配置
|
||||
|
||||
## 快速开始
|
||||
|
||||
### 1. 基本用法
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<UEditor v-model="content" :id="'my_editor'" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
|
||||
const content = ref('<p>初始内容</p>');
|
||||
</script>
|
||||
```
|
||||
|
||||
### 2. 表单集成
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<a-form :model="form" :rules="rules">
|
||||
<a-form-item label="标题" name="title">
|
||||
<a-input v-model:value="form.title" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="内容" name="content">
|
||||
<UEditor v-model="form.content" :id="'article_content'" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
|
||||
const form = reactive({
|
||||
title: '',
|
||||
content: ''
|
||||
});
|
||||
|
||||
const rules = {
|
||||
title: [{ required: true, message: '请输入标题' }],
|
||||
content: [{ required: true, message: '请输入内容' }]
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
### 3. 条件显示
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<UEditor
|
||||
v-if="showEditor"
|
||||
v-model="modalForm.content"
|
||||
:id="'modal_content'"
|
||||
/>
|
||||
</template>
|
||||
```
|
||||
|
||||
## 配置说明
|
||||
|
||||
### 编辑器配置
|
||||
|
||||
```javascript
|
||||
const editorConfig = {
|
||||
// 文件上传接口
|
||||
serverUrl: '/admin/api/admin/system/editor',
|
||||
|
||||
// 请求头配置
|
||||
serverHeaders: {
|
||||
'Authorization': 'Bearer ' + localStorage.getItem('token')
|
||||
},
|
||||
|
||||
// 编辑器尺寸
|
||||
initialFrameHeight: 500,
|
||||
initialFrameWidth: '100%',
|
||||
|
||||
// 自动保存
|
||||
enableAutoSave: true,
|
||||
autoSaveInterval: 60000,
|
||||
|
||||
// 其他配置
|
||||
loadConfigFromServer: true,
|
||||
enableContextMenu: true,
|
||||
catchRemoteImageEnable: false
|
||||
};
|
||||
```
|
||||
|
||||
### 工具栏配置
|
||||
|
||||
工具栏包含以下功能组:
|
||||
|
||||
#### 基础编辑
|
||||
- `undo` - 撤销
|
||||
- `redo` - 重做
|
||||
- `formatmatch` - 格式刷
|
||||
- `autotypeset` - 自动排版
|
||||
|
||||
#### 文本格式
|
||||
- `bold` - 加粗
|
||||
- `italic` - 斜体
|
||||
- `underline` - 下划线
|
||||
- `forecolor` - 字体颜色
|
||||
- `backcolor` - 背景色
|
||||
- `fontfamily` - 字体
|
||||
- `fontsize` - 字号
|
||||
|
||||
#### 段落格式
|
||||
- `justifyleft` - 左对齐
|
||||
- `justifycenter` - 居中对齐
|
||||
- `justifyright` - 右对齐
|
||||
- `justifyjustify` - 两端对齐
|
||||
- `indent` - 首行缩进
|
||||
- `lineheight` - 行间距
|
||||
|
||||
#### 插入功能
|
||||
- `simpleupload` - 单图上传
|
||||
- `insertimage` - 多图上传
|
||||
- `insertvideo` - 视频插入
|
||||
- `attachment` - 附件插入
|
||||
- `inserttable` - 表格插入
|
||||
- `link` - 超链接
|
||||
- `insertcode` - 代码插入
|
||||
|
||||
#### 高级功能
|
||||
- `contentimport` - 内容导入
|
||||
- `template` - 模板
|
||||
- `formula` - 公式
|
||||
- `print` - 打印
|
||||
- `preview` - 预览
|
||||
|
||||
## 在文章管理中的应用
|
||||
|
||||
### 文章编辑表单
|
||||
|
||||
文章管理系统中已经集成了UEditor组件,用于编辑文章内容:
|
||||
|
||||
```vue
|
||||
<!-- 文件位置: src/views/business/case-clinical-article/case-clinical-article-form.vue -->
|
||||
<a-form-item label="内容" name="articleContent" v-if="!isLinkChecked">
|
||||
<div class="editor-container">
|
||||
<div class="editor-tip">请在此处编辑文章内容,支持富文本格式、图片上传、表格等功能</div>
|
||||
<UEditor v-model="form.articleContent" :id="'article_content'" />
|
||||
</div>
|
||||
</a-form-item>
|
||||
```
|
||||
|
||||
### 表单验证
|
||||
|
||||
```javascript
|
||||
const rules = {
|
||||
articleContent: [{
|
||||
required: !isLinkChecked.value,
|
||||
message: '内容 必填',
|
||||
validator: (rule, value) => {
|
||||
if (isLinkChecked.value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (!value || value.trim() === '') {
|
||||
return Promise.reject('内容 必填');
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}]
|
||||
};
|
||||
```
|
||||
|
||||
### 内容处理
|
||||
|
||||
```javascript
|
||||
// 获取纯文本内容
|
||||
if (form.articleContent) {
|
||||
form.articleContentText = form.articleContent.replace(/<[^>]*>/g, '');
|
||||
}
|
||||
```
|
||||
|
||||
## 样式定制
|
||||
|
||||
### 编辑器容器样式
|
||||
|
||||
```css
|
||||
.editor-container {
|
||||
position: relative;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
background-color: #fafafa;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.editor-tip {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
background-color: #fff;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
z-index: 1;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
```
|
||||
|
||||
### 组件样式优化
|
||||
|
||||
UEditor组件本身已经包含了样式优化:
|
||||
|
||||
```css
|
||||
.uebox {
|
||||
width: 100%;
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.uebox :deep(.edui-editor-toolbarbox) {
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
### 1. ID唯一性
|
||||
每个UEditor实例必须有唯一的ID,避免冲突:
|
||||
|
||||
```vue
|
||||
<UEditor :id="'editor_1'" />
|
||||
<UEditor :id="'editor_2'" />
|
||||
```
|
||||
|
||||
### 2. 数据绑定
|
||||
使用v-model进行双向数据绑定:
|
||||
|
||||
```vue
|
||||
<UEditor v-model="form.content" :id="'content_editor'" />
|
||||
```
|
||||
|
||||
### 3. 表单验证
|
||||
在表单验证规则中正确处理富文本内容:
|
||||
|
||||
```javascript
|
||||
// 检查内容是否为空
|
||||
if (!form.content || form.content.trim() === '') {
|
||||
return Promise.reject('内容不能为空');
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 内容安全
|
||||
提交时注意HTML内容的处理和安全过滤:
|
||||
|
||||
```javascript
|
||||
// 简单的HTML标签移除
|
||||
const plainText = htmlContent.replace(/<[^>]*>/g, '');
|
||||
|
||||
// 或者使用专门的HTML清理库
|
||||
import DOMPurify from 'dompurify';
|
||||
const cleanHtml = DOMPurify.sanitize(htmlContent);
|
||||
```
|
||||
|
||||
### 5. 性能优化
|
||||
避免在同一个页面中使用过多编辑器实例,合理控制数量。
|
||||
|
||||
## 测试页面
|
||||
|
||||
项目包含了一个测试页面用于验证UEditor组件功能:
|
||||
|
||||
**文件位置**: `src/views/business/ueditor-test.vue`
|
||||
|
||||
测试页面包含:
|
||||
- 基本功能测试
|
||||
- 表单集成测试
|
||||
- 内容预览
|
||||
- 操作按钮测试
|
||||
|
||||
## 文件结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── components/
|
||||
│ └── business/
|
||||
│ └── ueditor.vue # UEditor组件
|
||||
├── views/
|
||||
│ └── business/
|
||||
│ └── case-clinical-article/
|
||||
│ ├── case-clinical-article-form.vue # 文章编辑表单
|
||||
│ └── case-clinical-article-list.vue # 文章列表
|
||||
└── public/
|
||||
└── UEditorPlus/ # UEditor资源文件
|
||||
├── ueditor.all.js
|
||||
├── ueditor.config.js
|
||||
├── ueditor.parse.js
|
||||
└── ...
|
||||
```
|
||||
|
||||
## 依赖说明
|
||||
|
||||
- **vue-ueditor-wrap**: Vue3的UEditor包装器
|
||||
- **UEditorPlus**: 富文本编辑器核心库
|
||||
- **Ant Design Vue**: UI组件库(用于表单和样式)
|
||||
|
||||
## 更新日志
|
||||
|
||||
### v1.0.0 (当前版本)
|
||||
- ✅ 基础富文本编辑功能
|
||||
- ✅ 图片上传和管理
|
||||
- ✅ 表格插入和编辑
|
||||
- ✅ 自动保存功能
|
||||
- ✅ 响应式设计
|
||||
- ✅ 文章管理集成
|
||||
- ✅ 样式优化
|
||||
|
||||
## 技术支持
|
||||
|
||||
如有问题,请检查:
|
||||
1. 控制台错误信息
|
||||
2. 网络请求状态
|
||||
3. 组件导入路径
|
||||
4. ID唯一性
|
||||
5. 数据绑定正确性
|
||||
|
||||
## 相关链接
|
||||
|
||||
- [UEditorPlus 官方文档](https://doc.ueditorplus.com/)
|
||||
- [vue-ueditor-wrap 文档](https://github.com/HaoChuan9421/vue-ueditor-wrap)
|
||||
- [Ant Design Vue 文档](https://antdv.com/)
|
||||
255
UEditor使用示例.md
Normal file
@ -0,0 +1,255 @@
|
||||
# UEditor 富文本编辑器使用示例
|
||||
|
||||
## 组件介绍
|
||||
|
||||
UEditor 是一个基于 vue-ueditor-wrap 的富文本编辑器组件,专门为文章管理、内容编辑等场景设计。
|
||||
|
||||
## 基本用法
|
||||
|
||||
### 1. 导入组件
|
||||
|
||||
```vue
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
```
|
||||
|
||||
### 2. 在模板中使用
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<!-- 基本用法 -->
|
||||
<UEditor v-model="content" :id="'editor_id'" />
|
||||
|
||||
<!-- 带标签的表单用法 -->
|
||||
<a-form-item label="文章内容" name="articleContent">
|
||||
<UEditor v-model="form.articleContent" :id="'article_content'" />
|
||||
</a-form-item>
|
||||
|
||||
<!-- 条件显示 -->
|
||||
<UEditor
|
||||
v-if="showEditor"
|
||||
v-model="modalForm.content"
|
||||
:id="'modal_content'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
```
|
||||
|
||||
## 文章管理中的使用示例
|
||||
|
||||
### 文章编辑表单
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<a-modal title="编辑文章" :open="visible" @cancel="onClose">
|
||||
<a-form :model="form" :rules="rules">
|
||||
<a-form-item label="标题" name="title">
|
||||
<a-input v-model:value="form.title" placeholder="请输入文章标题" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="内容" name="content">
|
||||
<div class="editor-container">
|
||||
<div class="editor-tip">请在此处编辑文章内容,支持富文本格式、图片上传、表格等功能</div>
|
||||
<UEditor v-model="form.content" :id="'article_content'" />
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
<template #footer>
|
||||
<a-space>
|
||||
<a-button @click="onClose">取消</a-button>
|
||||
<a-button type="primary" @click="onSubmit">保存</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
|
||||
const visible = ref(false);
|
||||
const form = reactive({
|
||||
title: '',
|
||||
content: ''
|
||||
});
|
||||
|
||||
const rules = {
|
||||
title: [{ required: true, message: '请输入文章标题' }],
|
||||
content: [{ required: true, message: '请输入文章内容' }]
|
||||
};
|
||||
|
||||
const onSubmit = async () => {
|
||||
// 表单验证和提交逻辑
|
||||
console.log('文章内容:', form.content);
|
||||
};
|
||||
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.editor-container {
|
||||
position: relative;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 4px;
|
||||
padding: 10px;
|
||||
background-color: #fafafa;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.editor-tip {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
background-color: #fff;
|
||||
padding: 5px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 12px;
|
||||
color: #8c8c8c;
|
||||
z-index: 1;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
### 文章列表中的使用
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<a-button type="primary" @click="showAddModal">新建文章</a-button>
|
||||
|
||||
<a-table :columns="columns" :dataSource="articleList">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button type="link" @click="showEditModal(record)">编辑</a-button>
|
||||
<a-button type="link" @click="showViewModal(record)">查看</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<!-- 新建/编辑模态框 -->
|
||||
<article-form-modal
|
||||
ref="formModalRef"
|
||||
@reload="loadArticleList"
|
||||
/>
|
||||
|
||||
<!-- 查看模态框 -->
|
||||
<article-view-modal
|
||||
ref="viewModalRef"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import ArticleFormModal from './components/article-form-modal.vue';
|
||||
import ArticleViewModal from './components/article-view-modal.vue';
|
||||
|
||||
const formModalRef = ref();
|
||||
const viewModalRef = ref();
|
||||
const articleList = ref([]);
|
||||
|
||||
const showAddModal = () => {
|
||||
formModalRef.value.show();
|
||||
};
|
||||
|
||||
const showEditModal = (record) => {
|
||||
formModalRef.value.show(record);
|
||||
};
|
||||
|
||||
const showViewModal = (record) => {
|
||||
viewModalRef.value.show(record);
|
||||
};
|
||||
|
||||
const loadArticleList = () => {
|
||||
// 加载文章列表
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
loadArticleList();
|
||||
});
|
||||
</script>
|
||||
```
|
||||
|
||||
## 组件特性
|
||||
|
||||
### 1. 自动保存
|
||||
- 支持60秒自动保存
|
||||
- 防止内容丢失
|
||||
|
||||
### 2. 丰富的工具栏
|
||||
- 文本格式化(加粗、斜体、下划线等)
|
||||
- 段落样式(对齐、缩进、行距等)
|
||||
- 图片上传和管理
|
||||
- 表格插入和编辑
|
||||
- 链接和锚点
|
||||
- 代码插入
|
||||
- 内容导入(支持Word、Markdown)
|
||||
|
||||
### 3. 响应式设计
|
||||
- 自适应宽度
|
||||
- 可调整高度
|
||||
- 支持全屏编辑
|
||||
|
||||
### 4. 文件上传
|
||||
- 图片上传
|
||||
- 附件上传
|
||||
- 支持拖拽上传
|
||||
|
||||
## 配置说明
|
||||
|
||||
### 编辑器配置
|
||||
|
||||
```javascript
|
||||
const editorConfig = {
|
||||
serverUrl: '/admin/api/admin/system/editor', // 文件上传接口
|
||||
initialFrameHeight: 500, // 编辑器高度
|
||||
initialFrameWidth: '100%', // 编辑器宽度
|
||||
enableAutoSave: true, // 启用自动保存
|
||||
autoSaveInterval: 60000, // 自动保存间隔(毫秒)
|
||||
enableContextMenu: true, // 启用右键菜单
|
||||
catchRemoteImageEnable: false, // 是否抓取远程图片
|
||||
};
|
||||
```
|
||||
|
||||
### 工具栏配置
|
||||
|
||||
工具栏包含以下主要功能组:
|
||||
- **基础编辑**:撤销、重做、格式刷等
|
||||
- **文本格式**:字体、字号、颜色、背景色等
|
||||
- **段落格式**:对齐、缩进、行距等
|
||||
- **插入功能**:图片、视频、表格、链接等
|
||||
- **高级功能**:代码、公式、模板等
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **ID唯一性**:每个UEditor实例必须有唯一的ID
|
||||
2. **数据绑定**:使用v-model进行双向数据绑定
|
||||
3. **表单验证**:在表单验证规则中正确处理富文本内容
|
||||
4. **内容处理**:提交时注意HTML内容的处理和安全过滤
|
||||
5. **性能优化**:避免在同一个页面中使用过多编辑器实例
|
||||
|
||||
## 常见问题
|
||||
|
||||
### Q: 编辑器不显示怎么办?
|
||||
A: 检查是否正确导入了组件,确保ID唯一,检查控制台是否有错误信息。
|
||||
|
||||
### Q: 图片上传失败怎么办?
|
||||
A: 检查serverUrl配置是否正确,确保后端接口正常工作。
|
||||
|
||||
### Q: 如何获取纯文本内容?
|
||||
A: 可以通过正则表达式去除HTML标签:`content.replace(/<[^>]*>/g, '')`
|
||||
|
||||
### Q: 编辑器高度可以调整吗?
|
||||
A: 可以通过initialFrameHeight配置项调整,也支持动态调整。
|
||||
|
||||
## 更多示例
|
||||
|
||||
更多使用示例请参考:
|
||||
- `src/views/business/case-clinical-article/case-clinical-article-form.vue`
|
||||
- `src/components/business/ueditor.vue`
|
||||
160
UEditor导入路径修正说明.md
Normal file
@ -0,0 +1,160 @@
|
||||
# UEditor 组件导入路径修正说明
|
||||
|
||||
## 问题描述
|
||||
|
||||
在项目运行过程中出现以下错误:
|
||||
|
||||
```
|
||||
[plugin:vite:import-analysis] Failed to resolve import "/@/utils/ueditor.vue" from "src/views/business/case-clinical-article/case-clinical-article-form.vue". Does the file exist?
|
||||
```
|
||||
|
||||
## 问题原因
|
||||
|
||||
1. **文件位置变更**:UEditor组件已经从 `src/utils/ueditor.vue` 移动到 `src/components/business/ueditor.vue`
|
||||
2. **导入路径错误**:多个Vue组件文件中仍在使用旧的导入路径
|
||||
3. **路径解析失败**:Vite无法找到指定路径的文件,导致构建失败
|
||||
|
||||
## 修正内容
|
||||
|
||||
### 1. 文章管理表单修正
|
||||
|
||||
**文件**: `src/views/business/case-clinical-article/case-clinical-article-form.vue`
|
||||
|
||||
**修正前**:
|
||||
```javascript
|
||||
import UEditor from '/@/utils/ueditor.vue';
|
||||
```
|
||||
|
||||
**修正后**:
|
||||
```javascript
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
```
|
||||
|
||||
### 2. 病例交流表单修正
|
||||
|
||||
**文件**: `src/views/business/case-exchange/case-exchange-form.vue`
|
||||
|
||||
**修正前**:
|
||||
```javascript
|
||||
import UEditor from '/@/utils/ueditor.vue';
|
||||
```
|
||||
|
||||
**修正后**:
|
||||
```javascript
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
```
|
||||
|
||||
## 文件结构说明
|
||||
|
||||
### 修正后的文件结构
|
||||
|
||||
```
|
||||
src/
|
||||
├── components/
|
||||
│ └── business/
|
||||
│ └── ueditor.vue # UEditor组件(当前位置)
|
||||
├── views/
|
||||
│ └── business/
|
||||
│ ├── case-clinical-article/
|
||||
│ │ └── case-clinical-article-form.vue # 文章管理表单
|
||||
│ └── case-exchange/
|
||||
│ └── case-exchange-form.vue # 病例交流表单
|
||||
```
|
||||
|
||||
### 导入路径规范
|
||||
|
||||
- **组件导入**: `/@/components/business/ueditor.vue`
|
||||
- **资源文件**: `/UEditorPlus/` (对应 `public/UEditorPlus/` 目录)
|
||||
|
||||
## 修正验证
|
||||
|
||||
### 1. 检查导入路径
|
||||
|
||||
所有使用UEditor的组件现在都使用正确的导入路径:
|
||||
|
||||
```javascript
|
||||
// ✅ 正确
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
|
||||
// ❌ 错误(已修正)
|
||||
import UEditor from '/@/utils/ueditor.vue';
|
||||
```
|
||||
|
||||
### 2. 检查组件使用
|
||||
|
||||
UEditor组件在以下文件中正常使用:
|
||||
|
||||
- `case-clinical-article-form.vue` - 文章内容编辑
|
||||
- `case-exchange-form.vue` - 病例交流内容编辑
|
||||
|
||||
### 3. 检查依赖加载
|
||||
|
||||
UEditor依赖文件正确配置:
|
||||
|
||||
```javascript
|
||||
const editorDependencies = [
|
||||
'/UEditorPlus/ueditor.config.js',
|
||||
'/UEditorPlus/ueditor.all.js',
|
||||
'/UEditorPlus/lang/zh-cn/zh-cn.js'
|
||||
]
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
### 1. 路径别名
|
||||
|
||||
项目使用 `/@/` 作为 `src/` 目录的别名:
|
||||
|
||||
```javascript
|
||||
// 这些路径是等价的
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
import UEditor from 'src/components/business/ueditor.vue';
|
||||
```
|
||||
|
||||
### 2. 组件位置
|
||||
|
||||
UEditor组件现在位于 `src/components/business/` 目录下,这是更合理的组织方式:
|
||||
|
||||
- `components/` - 可复用组件
|
||||
- `business/` - 业务相关组件
|
||||
- `ueditor.vue` - 富文本编辑器组件
|
||||
|
||||
### 3. 依赖管理
|
||||
|
||||
确保UEditor的资源文件位于正确位置:
|
||||
|
||||
```
|
||||
public/
|
||||
└── UEditorPlus/
|
||||
├── ueditor.config.js
|
||||
├── ueditor.all.js
|
||||
├── ueditor.parse.js
|
||||
└── lang/
|
||||
└── zh-cn/
|
||||
└── zh-cn.js
|
||||
```
|
||||
|
||||
## 测试建议
|
||||
|
||||
1. **构建测试**: 确保项目能正常构建,没有导入错误
|
||||
2. **组件渲染**: 验证UEditor组件能正常显示
|
||||
3. **功能测试**: 测试富文本编辑、图片上传等功能
|
||||
4. **路径验证**: 确认浏览器控制台没有404或500错误
|
||||
|
||||
## 相关文件
|
||||
|
||||
- **UEditor组件**: `src/components/business/ueditor.vue`
|
||||
- **文章管理表单**: `src/views/business/case-clinical-article/case-clinical-article-form.vue`
|
||||
- **病例交流表单**: `src/views/business/case-exchange/case-exchange-form.vue`
|
||||
- **UEditor资源**: `public/UEditorPlus/`
|
||||
|
||||
## 总结
|
||||
|
||||
通过修正UEditor组件的导入路径,解决了以下问题:
|
||||
|
||||
1. ✅ 修复了Vite构建时的导入解析错误
|
||||
2. ✅ 统一了组件的导入路径规范
|
||||
3. ✅ 确保了UEditor组件能正常加载和使用
|
||||
4. ✅ 维护了项目文件结构的清晰性
|
||||
|
||||
现在UEditor组件应该能正常工作,不会再出现导入路径相关的错误。
|
||||
215
UEditor故障排除指南.md
Normal file
@ -0,0 +1,215 @@
|
||||
# UEditor 故障排除指南
|
||||
|
||||
## 常见错误及解决方案
|
||||
|
||||
### 1. 资源加载失败错误
|
||||
|
||||
**错误信息:**
|
||||
```
|
||||
Uncaught (in promise) Error: [vue-ueditor-wrap] UEditor 资源加载失败!请检查资源是否存在,UEDITOR_HOME_URL 是否配置正确!
|
||||
```
|
||||
|
||||
**可能原因:**
|
||||
- UEditor资源文件路径不正确
|
||||
- 配置文件加载失败
|
||||
- 依赖文件缺失
|
||||
|
||||
**解决方案:**
|
||||
|
||||
#### 方案1:检查文件路径
|
||||
确保以下文件存在于正确位置:
|
||||
```
|
||||
public/
|
||||
└── UEditorPlus/
|
||||
├── ueditor.config.simple.js # 简化配置文件
|
||||
├── ueditor.all.js # 核心文件
|
||||
├── ueditor.config.js # 原始配置文件
|
||||
└── lang/
|
||||
└── zh-cn/
|
||||
└── zh-cn.js # 中文语言包
|
||||
```
|
||||
|
||||
#### 方案2:使用简化配置
|
||||
在UEditor组件中使用简化的配置文件:
|
||||
|
||||
```javascript
|
||||
const editorDependencies = [
|
||||
'/UEditorPlus/ueditor.config.simple.js', // 使用简化配置
|
||||
'/UEditorPlus/ueditor.all.js'
|
||||
]
|
||||
```
|
||||
|
||||
#### 方案3:检查网络请求
|
||||
在浏览器开发者工具中检查:
|
||||
1. Network标签页是否有404错误
|
||||
2. Console标签页是否有JavaScript错误
|
||||
3. 确认UEditor资源文件能正常访问
|
||||
|
||||
### 2. 导入路径错误
|
||||
|
||||
**错误信息:**
|
||||
```
|
||||
Failed to resolve import "/@/utils/ueditor.vue" from "src/views/business/case-clinical-article/case-clinical-article-form.vue". Does the file exist?
|
||||
```
|
||||
|
||||
**解决方案:**
|
||||
更新所有使用UEditor的组件导入路径:
|
||||
|
||||
```javascript
|
||||
// ❌ 错误路径
|
||||
import UEditor from '/@/utils/ueditor.vue';
|
||||
|
||||
// ✅ 正确路径
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
```
|
||||
|
||||
### 3. 配置文件问题
|
||||
|
||||
**问题描述:**
|
||||
UEditor配置文件过于复杂或压缩,导致解析失败。
|
||||
|
||||
**解决方案:**
|
||||
使用简化的配置文件 `ueditor.config.simple.js`,包含基本功能配置。
|
||||
|
||||
## 调试步骤
|
||||
|
||||
### 步骤1:检查控制台错误
|
||||
1. 打开浏览器开发者工具
|
||||
2. 查看Console标签页的错误信息
|
||||
3. 查看Network标签页的资源加载状态
|
||||
|
||||
### 步骤2:验证文件路径
|
||||
在浏览器中直接访问以下URL,确认文件存在:
|
||||
- `http://localhost:8081/UEditorPlus/ueditor.config.simple.js`
|
||||
- `http://localhost:8081/UEditorPlus/ueditor.all.js`
|
||||
|
||||
### 步骤3:检查组件配置
|
||||
确认UEditor组件的配置正确:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div class="uebox">
|
||||
<vue-ueditor-wrap
|
||||
v-model="content"
|
||||
:editor-id="props.id"
|
||||
:config="editorConfig"
|
||||
:editorDependencies="editorDependencies"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { VueUeditorWrap } from 'vue-ueditor-wrap'
|
||||
|
||||
const editorDependencies = [
|
||||
'/UEditorPlus/ueditor.config.simple.js',
|
||||
'/UEditorPlus/ueditor.all.js'
|
||||
]
|
||||
|
||||
const editorConfig = reactive({
|
||||
UEDITOR_HOME_URL: '/UEditorPlus/',
|
||||
initialFrameHeight: 500,
|
||||
initialFrameWidth: '100%',
|
||||
serverUrl: '/support/file/upload',
|
||||
serverHeaders: {
|
||||
'Authorization': 'Bearer '+localStorage.getItem('token')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
```
|
||||
|
||||
### 步骤4:测试简单配置
|
||||
使用最简单的配置测试:
|
||||
|
||||
```vue
|
||||
<vue-ueditor-wrap
|
||||
v-model="content"
|
||||
:editor-id="'test'"
|
||||
:config="{
|
||||
UEDITOR_HOME_URL: '/UEditorPlus/',
|
||||
initialFrameHeight: 300
|
||||
}"
|
||||
/>
|
||||
```
|
||||
|
||||
## 常见配置问题
|
||||
|
||||
### 1. 路径配置
|
||||
```javascript
|
||||
// ❌ 错误:相对路径
|
||||
UEDITOR_HOME_URL: 'UEditorPlus/'
|
||||
|
||||
// ✅ 正确:绝对路径
|
||||
UEDITOR_HOME_URL: '/UEditorPlus/'
|
||||
```
|
||||
|
||||
### 2. 依赖配置
|
||||
```javascript
|
||||
// ❌ 错误:缺少依赖
|
||||
:editorDependencies="[]"
|
||||
|
||||
// ✅ 正确:包含必要依赖
|
||||
:editorDependencies="[
|
||||
'/UEditorPlus/ueditor.config.simple.js',
|
||||
'/UEditorPlus/ueditor.all.js'
|
||||
]"
|
||||
```
|
||||
|
||||
### 3. 服务器配置
|
||||
```javascript
|
||||
// ❌ 错误:从服务器加载配置
|
||||
loadConfigFromServer: true
|
||||
|
||||
// ✅ 正确:使用本地配置
|
||||
loadConfigFromServer: false
|
||||
```
|
||||
|
||||
## 测试建议
|
||||
|
||||
### 1. 创建测试页面
|
||||
创建一个简单的测试页面来验证UEditor功能:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<h2>UEditor 测试</h2>
|
||||
<vue-ueditor-wrap
|
||||
v-model="content"
|
||||
:editor-id="'test_editor'"
|
||||
:config="simpleConfig"
|
||||
/>
|
||||
<div v-html="content"></div>
|
||||
</div>
|
||||
</template>
|
||||
```
|
||||
|
||||
### 2. 逐步添加功能
|
||||
从基本配置开始,逐步添加功能:
|
||||
1. 基本文本编辑
|
||||
2. 工具栏配置
|
||||
3. 文件上传配置
|
||||
4. 样式定制
|
||||
|
||||
### 3. 检查依赖版本
|
||||
确认 `vue-ueditor-wrap` 版本兼容性:
|
||||
```json
|
||||
{
|
||||
"vue-ueditor-wrap": "^3.0.8"
|
||||
}
|
||||
```
|
||||
|
||||
## 联系支持
|
||||
|
||||
如果问题仍然存在,请提供以下信息:
|
||||
1. 错误截图
|
||||
2. 控制台错误信息
|
||||
3. 网络请求状态
|
||||
4. 项目配置文件
|
||||
5. 浏览器版本信息
|
||||
|
||||
## 相关文件
|
||||
|
||||
- **UEditor组件**: `src/components/business/ueditor.vue`
|
||||
- **简化配置**: `public/UEditorPlus/ueditor.config.simple.js`
|
||||
- **测试页面**: `src/views/business/ueditor-simple-test.vue`
|
||||
- **故障排除**: `UEditor故障排除指南.md`
|
||||
149
UEditor配置修正说明.md
Normal file
@ -0,0 +1,149 @@
|
||||
# UEditor 组件配置修正说明
|
||||
|
||||
## 修正内容
|
||||
|
||||
### 1. 导入问题修正
|
||||
|
||||
**修正前:**
|
||||
```javascript
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import userApi from "../api/user";
|
||||
```
|
||||
|
||||
**修正后:**
|
||||
```javascript
|
||||
import { computed, reactive } from 'vue'
|
||||
// 移除了不存在的 userApi 导入
|
||||
// 移除了未使用的 onMounted, ref 导入
|
||||
```
|
||||
|
||||
### 2. 文件上传接口修正
|
||||
|
||||
**修正前:**
|
||||
```javascript
|
||||
serverUrl: '/admin/api/admin/system/editor', // 不存在的接口
|
||||
```
|
||||
|
||||
**修正后:**
|
||||
```javascript
|
||||
serverUrl: '/support/file/upload', // 使用项目中已存在的文件上传接口
|
||||
```
|
||||
|
||||
### 3. UEditor路径配置修正
|
||||
|
||||
**修正前:**
|
||||
```javascript
|
||||
UEDITOR_HOME_URL: import.meta.env.MODE=="development"?'/static/UEditorPlus/':'/admin/web/static/UEditorPlus/',
|
||||
UEDITOR_CORS_URL: import.meta.env.MODE=="development"?'/static/UEditorPlus/':'/admin/web/static/UEditorPlus/',
|
||||
```
|
||||
|
||||
**修正后:**
|
||||
```javascript
|
||||
UEDITOR_HOME_URL: '/UEditorPlus/',
|
||||
UEDITOR_CORS_URL: '/UEditorPlus/',
|
||||
```
|
||||
|
||||
### 4. 配置加载方式修正
|
||||
|
||||
**修正前:**
|
||||
```javascript
|
||||
loadConfigFromServer: true, // 从服务器加载配置
|
||||
```
|
||||
|
||||
**修正后:**
|
||||
```javascript
|
||||
loadConfigFromServer: false, // 使用本地配置,避免服务器配置冲突
|
||||
```
|
||||
|
||||
## 新增配置
|
||||
|
||||
### 文件上传配置
|
||||
|
||||
```javascript
|
||||
// 图片上传配置
|
||||
imageActionName: 'uploadimage',
|
||||
imageFieldName: 'file',
|
||||
imageMaxSize: 2048000, // 2MB
|
||||
imageAllowFiles: ['.png', '.jpg', '.jpeg', '.gif', '.bmp'],
|
||||
imageCompressEnable: true,
|
||||
imageCompressBorder: 1600,
|
||||
|
||||
// 视频上传配置
|
||||
videoActionName: 'uploadvideo',
|
||||
videoFieldName: 'file',
|
||||
videoMaxSize: 102400000, // 100MB
|
||||
videoAllowFiles: ['.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mp4', '.webm'],
|
||||
|
||||
// 附件上传配置
|
||||
fileActionName: 'uploadfile',
|
||||
fileFieldName: 'file',
|
||||
fileMaxSize: 51200000, // 50MB
|
||||
fileAllowFiles: ['.doc', '.docx', '.pdf', '.zip', '.rar', '.txt', '.md']
|
||||
```
|
||||
|
||||
### 错误处理配置
|
||||
|
||||
```javascript
|
||||
tipError: function(message, title) {
|
||||
console.error('UEditor Error:', message);
|
||||
// 可以在这里集成项目的消息提示组件
|
||||
}
|
||||
```
|
||||
|
||||
## 文件上传流程
|
||||
|
||||
UEditor组件现在使用项目中的标准文件上传接口:
|
||||
|
||||
1. **接口地址**: `/support/file/upload`
|
||||
2. **认证方式**: Bearer Token (从localStorage获取)
|
||||
3. **文件字段**: `file`
|
||||
4. **支持格式**: 根据文件类型自动识别
|
||||
|
||||
## 使用说明
|
||||
|
||||
### 基本用法
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<UEditor v-model="content" :id="'my_editor'" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import UEditor from '/@/components/business/ueditor.vue';
|
||||
|
||||
const content = ref('<p>初始内容</p>');
|
||||
</script>
|
||||
```
|
||||
|
||||
### 在文章管理中使用
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<a-form-item label="内容" name="articleContent">
|
||||
<UEditor v-model="form.articleContent" :id="'article_content'" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
1. **文件上传**: 确保后端接口 `/support/file/upload` 正常工作
|
||||
2. **认证**: 确保用户已登录且token有效
|
||||
3. **文件大小**: 图片限制2MB,视频限制100MB,附件限制50MB
|
||||
4. **路径配置**: UEditor资源文件位于 `/public/UEditorPlus/` 目录
|
||||
|
||||
## 测试建议
|
||||
|
||||
1. 测试基本文本编辑功能
|
||||
2. 测试图片上传功能
|
||||
3. 测试视频和附件上传功能
|
||||
4. 检查文件上传后的显示效果
|
||||
5. 验证错误处理是否正常工作
|
||||
|
||||
## 相关文件
|
||||
|
||||
- **组件文件**: `src/components/business/ueditor.vue`
|
||||
- **资源文件**: `public/UEditorPlus/`
|
||||
- **文件上传API**: `src/api/support/file-api.js`
|
||||
- **文章管理表单**: `src/views/business/case-clinical-article/case-clinical-article-form.vue`
|
||||
57
build-dev-server.sh
Executable file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 开发服务器构建脚本
|
||||
# 用于构建部署到 dev-casedata.igandan.com 的前端资源
|
||||
|
||||
echo "🚀 开始构建开发服务器版本..."
|
||||
|
||||
# 清理之前的构建
|
||||
echo "🧹 清理之前的构建文件..."
|
||||
rm -rf dist
|
||||
|
||||
# 安装依赖(如果需要)
|
||||
if [ ! -d "node_modules" ]; then
|
||||
echo "📦 安装依赖..."
|
||||
npm install
|
||||
fi
|
||||
|
||||
# 构建项目
|
||||
echo "🔨 构建项目..."
|
||||
npm run build:dev-server
|
||||
|
||||
# 检查构建结果
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ 构建成功!"
|
||||
echo "📁 构建输出目录: dist/"
|
||||
echo "🌐 访问路径: https://dev-casedata.igandan.com/admin/web/"
|
||||
|
||||
# 显示构建后的文件结构
|
||||
echo "📋 构建文件列表:"
|
||||
find dist -type f | head -20
|
||||
|
||||
# 检查关键文件
|
||||
echo "🔍 检查关键文件:"
|
||||
if [ -f "dist/index.html" ]; then
|
||||
echo " ✅ index.html 存在"
|
||||
# 检查JS文件路径
|
||||
js_files=$(grep -o 'src="[^"]*\.js"' dist/index.html | head -5)
|
||||
echo " 📜 JS文件路径示例:"
|
||||
echo "$js_files"
|
||||
else
|
||||
echo " ❌ index.html 不存在"
|
||||
fi
|
||||
|
||||
if [ -d "dist/assets" ]; then
|
||||
echo " ✅ assets 目录存在"
|
||||
echo " 📁 assets 目录内容:"
|
||||
ls -la dist/assets/
|
||||
else
|
||||
echo " ❌ assets 目录不存在"
|
||||
fi
|
||||
|
||||
else
|
||||
echo "❌ 构建失败!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "🎉 构建完成!"
|
||||
12
package-lock.json
generated
@ -35,6 +35,7 @@
|
||||
"vue": "3.4.27",
|
||||
"vue-i18n": "9.13.1",
|
||||
"vue-router": "4.3.2",
|
||||
"vue-ueditor-wrap": "^3.0.8",
|
||||
"vue3-json-viewer": "2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -6262,6 +6263,17 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue-ueditor-wrap": {
|
||||
"version": "3.0.8",
|
||||
"resolved": "https://registry.npmjs.org/vue-ueditor-wrap/-/vue-ueditor-wrap-3.0.8.tgz",
|
||||
"integrity": "sha512-U1s30pKcz8rr6v2F2ivnomOf1vF1N+n+aNClas4jXfiEf4E5FEtNwkFJBugcyf2VTRFK0UVpx5WspX5nwmImYw==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.x"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vue3-json-viewer": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/vue3-json-viewer/-/vue3-json-viewer-2.2.2.tgz",
|
||||
|
||||
@ -11,9 +11,10 @@
|
||||
"scripts": {
|
||||
"localhost": "vite --mode localhost",
|
||||
"dev": "vite",
|
||||
"build:test": "vite build --base=/admin/ --mode test",
|
||||
"build:pre": "vite build --mode pre",
|
||||
"build:prod": "vite build --mode production"
|
||||
"build:dev-server": "vite build --config vite.config.dev-server.js --mode dev-server",
|
||||
"build:test": "vite build --base=/admin/web/ --mode test",
|
||||
"build:pre": "vite build --base=/admin/web/ --mode pre",
|
||||
"build:prod": "vite build --base=/admin/web/ --mode production"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
@ -43,6 +44,7 @@
|
||||
"vue": "3.4.27",
|
||||
"vue-i18n": "9.13.1",
|
||||
"vue-router": "4.3.2",
|
||||
"vue-ueditor-wrap": "^3.0.8",
|
||||
"vue3-json-viewer": "2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
62
public/UEditorPlus/dialogs/anchor/anchor.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<style type="text/css">
|
||||
* {
|
||||
color: #838383;
|
||||
margin: 0;
|
||||
padding: 0
|
||||
}
|
||||
|
||||
html, body {
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 5px 0 0 15px;
|
||||
}
|
||||
|
||||
input {
|
||||
margin-left: 4px;
|
||||
box-sizing: border-box;
|
||||
width: 210px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border: 1px solid #d7d7d7;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
|
||||
</div>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<script type="text/javascript">
|
||||
var anchorInput = $G('anchorName'),
|
||||
node = editor.selection.getRange().getClosedNode();
|
||||
if (node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))) {
|
||||
anchorInput.value = node;
|
||||
}
|
||||
anchorInput.onkeydown = function (evt) {
|
||||
evt = evt || window.event;
|
||||
if (evt.keyCode == 13) {
|
||||
editor.execCommand('anchor', anchorInput.value);
|
||||
dialog.close();
|
||||
domUtils.preventDefault(evt)
|
||||
}
|
||||
};
|
||||
dialog.onok = function () {
|
||||
editor.execCommand('anchor', anchorInput.value);
|
||||
dialog.close();
|
||||
};
|
||||
$focus(anchorInput);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
3
public/UEditorPlus/dialogs/attachment/attachment.css
Normal file
61
public/UEditorPlus/dialogs/attachment/attachment.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ueditor图片对话框</title>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
|
||||
<!-- jquery -->
|
||||
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?25f4b625"></script>
|
||||
|
||||
<!-- webuploader -->
|
||||
<script src="../../third-party/webuploader/webuploader.js?be202c93"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?b8f06036">
|
||||
|
||||
<!-- attachment dialog -->
|
||||
<link rel="stylesheet" href="attachment.css?32c6a90a" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrapper">
|
||||
<div id="tabhead" class="tabhead">
|
||||
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
|
||||
<span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
|
||||
</div>
|
||||
<div id="tabbody" class="tabbody">
|
||||
<!-- 上传图片 -->
|
||||
<div id="upload" class="panel focus">
|
||||
<div id="queueList" class="queueList">
|
||||
<div class="statusBar element-invisible">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div>
|
||||
<div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePickerBtn"></div>
|
||||
<div class="uploadBtn"><var id="lang_start_upload"></var></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dndArea" class="placeholder">
|
||||
<div class="filePickerContainer">
|
||||
<div id="filePickerReady"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="filelist element-invisible">
|
||||
<li id="filePickerBlock" class="filePickerBlock"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 在线图片 -->
|
||||
<div id="online" class="panel">
|
||||
<div id="fileList"><var id="lang_imgLoading"></var></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="attachment.js?22af21cd"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/attachment/attachment.js
Normal file
BIN
public/UEditorPlus/dialogs/attachment/images/alignicon.gif
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/alignicon.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/bg.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/file-icons.gif
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/file-icons.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/icons.gif
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
public/UEditorPlus/dialogs/attachment/images/icons.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/image.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/progress.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/UEditorPlus/dialogs/attachment/images/success.gif
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
public/UEditorPlus/dialogs/attachment/images/success.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
3
public/UEditorPlus/dialogs/audio/audio.css
Normal file
83
public/UEditorPlus/dialogs/audio/audio.html
Normal file
@ -0,0 +1,83 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<link rel="stylesheet" type="text/css" href="audio.css?622512f6"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div id="audioTab">
|
||||
<div id="tabHeads" class="tabhead">
|
||||
<span tabSrc="audio" class="focus" data-content-id="audio"><var id="lang_tab_insertV"></var></span>
|
||||
<span tabSrc="upload" style="display:none;" data-content-id="upload"><var
|
||||
id="lang_tab_uploadV"></var></span>
|
||||
</div>
|
||||
<div id="tabBodys" class="tabbody">
|
||||
<div id="audio" class="panel focus">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="audioUrl" class="url"><var id="lang_audio_url"></var></label></td>
|
||||
<td><input id="audioUrl" type="text"><a href="javascript:;" id="audioSelect"
|
||||
style="display:none;">选择音频</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="padding:0 5px 5px 5px;color:#999;">
|
||||
外链音频支持MP3格式
|
||||
</div>
|
||||
<div id="preview"></div>
|
||||
<div id="audioInfo">
|
||||
<fieldset>
|
||||
<legend><var id="lang_alignment"></var></legend>
|
||||
<div id="audioFloat"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div id="upload" class="panel">
|
||||
<div id="upload_left">
|
||||
<div id="queueList" class="queueList">
|
||||
<div class="statusBar element-invisible">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div>
|
||||
<div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePickerBtn"></div>
|
||||
<div class="uploadBtn"><var id="lang_start_upload"></var></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dndArea" class="placeholder">
|
||||
<div class="filePickerContainer">
|
||||
<div id="filePickerReady"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="filelist element-invisible">
|
||||
<li id="filePickerBlock" class="filePickerBlock"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="uploadaudioInfo">
|
||||
<fieldset>
|
||||
<legend><var id="lang_upload_alignment"></var></legend>
|
||||
<div id="upload_alignment"></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- jquery -->
|
||||
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?25f4b625"></script>
|
||||
|
||||
<!-- webuploader -->
|
||||
<script type="text/javascript" src="../../third-party/webuploader/webuploader.js?be202c93"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?b8f06036">
|
||||
|
||||
<!-- audio -->
|
||||
<script type="text/javascript" src="audio.js?8e45985b"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/audio/audio.js
Normal file
BIN
public/UEditorPlus/dialogs/audio/images/bg.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/center_focus.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/file-icons.gif
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/file-icons.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/icons.gif
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
public/UEditorPlus/dialogs/audio/images/icons.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/image.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/left_focus.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/none_focus.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/progress.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/right_focus.jpg
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
public/UEditorPlus/dialogs/audio/images/success.gif
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
public/UEditorPlus/dialogs/audio/images/success.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
3
public/UEditorPlus/dialogs/background/background.css
Normal file
@ -0,0 +1,3 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
|
||||
.wrapper{width:424px;margin:10px auto;zoom:1;position:relative}.tabbody{height:225px}.tabbody .panel{position:absolute;width:100%;height:100%;background:#fff;display:none}.tabbody .focus{display:block}body{font-size:12px;color:#888;overflow:hidden}input,label{vertical-align:middle}.clear{clear:both}.pl{padding-left:18px;padding-left:23px \9}#imageList{width:420px;height:215px;margin-top:10px;overflow:hidden;overflow-y:auto}#imageList div{float:left;width:100px;height:95px;margin:5px 10px}#imageList img{cursor:pointer;border:2px solid #fff}.bgarea{margin:10px;padding:5px;height:84%;border:1px solid #A8A297}.content div{margin:10px 0 10px 5px}.content .iptradio{margin:0 5px 5px 0}.txt{width:280px}.wrapcolor{height:19px}div.color{float:left;margin:0}#colorPicker{width:17px;height:17px;border:1px solid #CCC;display:inline-block;border-radius:3px;box-shadow:2px 2px 5px #D3D6DA;margin:0;float:left}div.alignment,#custom{margin-left:23px;margin-left:28px \9}#custom input{height:15px;min-height:15px;width:20px}#repeatType{width:100px}#imgManager{width:100%;height:225px}#imgManager #imageList{width:100%;overflow-x:hidden;overflow-y:auto}#imgManager ul{display:block;list-style:none;margin:0;padding:0}#imgManager li{float:left;display:block;list-style:none;padding:0;width:113px;height:113px;margin:9px 0 0 19px;background-color:#eee;overflow:hidden;cursor:pointer;position:relative}#imgManager li.clearFloat{float:none;clear:both;display:block;width:0;height:0;margin:0;padding:0}#imgManager li img{cursor:pointer}#imgManager li .icon{cursor:pointer;width:113px;height:113px;position:absolute;top:0;left:0;z-index:2;border:0;background-repeat:no-repeat}#imgManager li .icon:hover{width:107px;height:107px;border:3px solid #1094fa}#imgManager li.selected .icon{background-image:url(images/success.png);background-position:75px 75px}#imgManager li.selected .icon:hover{width:107px;height:107px;border:3px solid #1094fa;background-position:72px 72px}
|
||||
59
public/UEditorPlus/dialogs/background/background.html
Normal file
@ -0,0 +1,59 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<link rel="stylesheet" type="text/css" href="background.css?982ee6c2">
|
||||
</head>
|
||||
<body>
|
||||
<div id="bg_container" class="wrapper">
|
||||
<div id="tabHeads" class="tabhead">
|
||||
<span class="focus" data-content-id="normal"><var id="lang_background_normal"></var></span>
|
||||
</div>
|
||||
<div id="tabBodys" class="tabbody">
|
||||
<div id="normal" class="panel focus">
|
||||
<fieldset class="bgarea">
|
||||
<legend><var id="lang_background_set"></var></legend>
|
||||
<div class="content">
|
||||
<div>
|
||||
<label><input id="nocolorRadio" class="iptradio" type="radio" name="t" value="none"
|
||||
checked="checked"><var id="lang_background_none"></var></label>
|
||||
<label><input id="coloredRadio" class="iptradio" type="radio" name="t" value="color"><var
|
||||
id="lang_background_colored"></var></label>
|
||||
</div>
|
||||
<div class="wrapcolor pl">
|
||||
<div class="color">
|
||||
<var id="lang_background_color"></var>:
|
||||
</div>
|
||||
<div id="colorPicker"></div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="wrapcolor pl">
|
||||
<label><var id="lang_background_netimg"></var>:</label><input class="txt" type="text" id="url">
|
||||
</div>
|
||||
<div id="alignment" class="alignment">
|
||||
<var id="lang_background_align"></var>:<select id="repeatType">
|
||||
<option value="center"></option>
|
||||
<option value="repeat-x"></option>
|
||||
<option value="repeat-y"></option>
|
||||
<option value="repeat"></option>
|
||||
<option value="self"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="custom">
|
||||
<var id="lang_background_position"></var>:x:<input type="text" size="1" id="x" maxlength="4"
|
||||
value="0">px y:<input type="text"
|
||||
size="1"
|
||||
id="y"
|
||||
maxlength="4"
|
||||
value="0">px
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="background.js?e67eb657"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/background/background.js
Normal file
BIN
public/UEditorPlus/dialogs/background/images/bg.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/UEditorPlus/dialogs/background/images/success.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
176
public/UEditorPlus/dialogs/contentimport/contentimport.html
Normal file
@ -0,0 +1,176 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<style type="text/css">
|
||||
.wrapper {
|
||||
width: 600px;
|
||||
padding: 10px;
|
||||
height: 352px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border-bottom: 1px solid #d7d7d7;
|
||||
}
|
||||
|
||||
.wrapper .file-upload {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.wrapper .file-upload .file-tip {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
padding-left: 10px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.wrapper .file-manual {
|
||||
background: #EEE;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
margin-top: 10px;
|
||||
line-height: 2;
|
||||
}
|
||||
|
||||
.wrapper .file-manual .title {
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
.wrapper .file-manual .body {
|
||||
}
|
||||
|
||||
.wrapper .file-manual .body li {
|
||||
list-style: disc;
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.wrapper .upload-button {
|
||||
width: 100px;
|
||||
height: 30px;
|
||||
background-color: #F8F8F8;
|
||||
border: 1px solid #EEE;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
flex-shrink: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.wrapper .upload-button .text {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wrapper .upload-button input {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wrapper .file-result {
|
||||
border: 1px solid #333;
|
||||
padding: 10px;
|
||||
border-radius: 5px;
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
top: 50px;
|
||||
background: #FFF;
|
||||
bottom: 10px;
|
||||
overflow: auto;
|
||||
display: none;
|
||||
}
|
||||
.wrapper .file-input{
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
top: 50px;
|
||||
background: #EEE;
|
||||
bottom: 10px;
|
||||
border-radius: 5px;
|
||||
display:none;
|
||||
}
|
||||
.wrapper .file-input textarea{
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
border: none;
|
||||
resize: none;
|
||||
border-radius: 5px;
|
||||
padding: 5px;
|
||||
outline: none;
|
||||
top: 30px;
|
||||
}
|
||||
.wrapper .file-input .tool{
|
||||
text-align: right;
|
||||
padding: 5px 10px;
|
||||
}
|
||||
.wrapper .file-input .tool a{
|
||||
display: inline-block;
|
||||
text-decoration: none;
|
||||
color: #333;
|
||||
background: #FFF;
|
||||
padding: 0 10px;
|
||||
line-height: 20px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="file-upload">
|
||||
<div class="upload-button">
|
||||
<div class="text">选择本地文件</div>
|
||||
<input type="file" id="contentImport"/>
|
||||
</div>
|
||||
<div class="upload-button">
|
||||
<div class="text" onclick="$('.file-input').show();">粘贴Markdown</div>
|
||||
</div>
|
||||
<div class="file-tip"></div>
|
||||
</div>
|
||||
<div class="file-manual">
|
||||
<div class="title">
|
||||
支持文档格式
|
||||
</div>
|
||||
<div class="body">
|
||||
<ul>
|
||||
<li><b>Word</b>:docx</li>
|
||||
<li><b>Markdown</b>:md</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-result"></div>
|
||||
<div class="file-input">
|
||||
<textarea id="fileInputContent"></textarea>
|
||||
<div class="tool">
|
||||
<a href="javascript:;" id="fileInputConfirm">
|
||||
确定
|
||||
</a>
|
||||
<a href="javascript:;" onclick="$(this).closest('.file-input').hide();">
|
||||
关闭
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../third-party/jquery-1.10.2.js?25f4b625"></script>
|
||||
<script src="mammoth.browser.min.js?109831e5"></script>
|
||||
<script src="showdown.min.js?a1c1e879"></script>
|
||||
<script type="text/javascript" src="contentimport.js?100d2e1a"></script>
|
||||
<script type="text/javascript">
|
||||
utils.domReady(function () {
|
||||
var options = {};
|
||||
var callbacks = {};
|
||||
contentImport.init(options, callbacks);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@ -0,0 +1,2 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
function processWord(a){$(".file-tip").html("正在转换Word文件,请稍后..."),$(".file-result").html("").hide();var b=new FileReader;b.onload=function(a){mammoth.convertToHtml({arrayBuffer:a.target.result}).then(function(a){$(".file-tip").html("转换成功"),contentImport.data.result=a.value,$(".file-result").html(a.value).show()},function(a){$(".file-tip").html("Word文件转换失败:"+a)})},b.onerror=function(a){$(".file-tip").html("Word文件转换失败:"+a)},b.readAsArrayBuffer(a)}function processMarkdown(a){var b=new showdown.Converter,c=b.makeHtml(a);$(".file-tip").html("转换成功"),contentImport.data.result=c,$(".file-result").html(c).show()}function processMarkdownFile(a){$(".file-tip").html("正在转换Markdown文件,请稍后..."),$(".file-result").html("").hide();var b=new FileReader;b.onload=function(a){processMarkdown(a.target.result)},b.onerror=function(a){$(".file-tip").html("Markdown文件转换失败:"+a)},b.readAsText(a,"UTF-8")}function addUploadButtonListener(){g("contentImport").addEventListener("change",function(){const a=this.files[0],b=a.name,c=b.substring(b.lastIndexOf(".")+1).toLowerCase();switch(c){case"docx":case"doc":processWord(a);break;case"md":processMarkdownFile(a);break;default:$(".file-tip").html("不支持的文件格式:"+c)}}),g("fileInputConfirm").addEventListener("click",function(){processMarkdown(g("fileInputContent").value),$(".file-input").hide()})}function addOkListener(){dialog.onok=function(){return contentImport.data.result?(editor.fireEvent("saveScene"),editor.execCommand("inserthtml",contentImport.data.result),void editor.fireEvent("saveScene")):(alert("请先上传文件识别内容"),!1)},dialog.oncancel=function(){}}var contentImport={},g=$G;contentImport.data={result:null},contentImport.init=function(a,b){addUploadButtonListener(),addOkListener()};
|
||||
17
public/UEditorPlus/dialogs/contentimport/mammoth.browser.min.js
vendored
Normal file
4
public/UEditorPlus/dialogs/contentimport/showdown.min.js
vendored
Normal file
3
public/UEditorPlus/dialogs/emotion/emotion.css
Normal file
@ -0,0 +1,3 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
|
||||
.jd img{background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.pp img{background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:25px;height:25px;display:block}.ldw img{background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.tsj img{background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.cat img{background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.bb img{background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.youa img{background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;cursor:pointer;width:35px;height:35px;display:block}.smileytable td{height:37px}#tabPanel{margin-left:5px;overflow:hidden}#tabContent{float:left;background:#FFF}#tabContent div{display:none;width:480px;overflow:hidden}#tabIconReview.show{left:17px;display:block}.menuFocus{background:#ACCD3C}.menuDefault{background:#FFF}#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px}img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFF;background-position:center;background-repeat:no-repeat}.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width:95%}.tabbody table{width:100%}.tabbody td{border:1px solid #BAC498}.tabbody td span{display:block;zoom:1;padding:0 4px}
|
||||
70
public/UEditorPlus/dialogs/emotion/emotion.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta name="robots" content="noindex, nofollow"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<link rel="stylesheet" type="text/css" href="emotion.css?f71063c6">
|
||||
</head>
|
||||
<body>
|
||||
<div id="tabPanel" class="wrapper">
|
||||
<div id="tabHeads" class="tabhead">
|
||||
<span><var id="lang_input_choice"></var></span>
|
||||
<span><var id="lang_input_Tuzki"></var></span>
|
||||
<span><var id="lang_input_lvdouwa"></var></span>
|
||||
<span><var id="lang_input_BOBO"></var></span>
|
||||
<span><var id="lang_input_babyCat"></var></span>
|
||||
<span><var id="lang_input_bubble"></var></span>
|
||||
<span><var id="lang_input_youa"></var></span>
|
||||
</div>
|
||||
<div id="tabBodys" class="tabbody">
|
||||
<div id="tab0"></div>
|
||||
<div id="tab1"></div>
|
||||
<div id="tab2"></div>
|
||||
<div id="tab3"></div>
|
||||
<div id="tab4"></div>
|
||||
<div id="tab5"></div>
|
||||
<div id="tab6"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tabIconReview">
|
||||
<img id='faceReview' class='review' src="../../themes/default/images/spacer.gif"/>
|
||||
</div>
|
||||
<script type="text/javascript" src="emotion.js?cb3216b7"></script>
|
||||
<script type="text/javascript">
|
||||
var emotion = {
|
||||
tabNum: 7, //切换面板数量
|
||||
SmilmgName: {
|
||||
tab0: ['j_00', 84],
|
||||
tab1: ['t_00', 40],
|
||||
tab2: ['w_00', 52],
|
||||
tab3: ['B_00', 63],
|
||||
tab4: ['C_00', 20],
|
||||
tab5: ['i_f', 50],
|
||||
tab6: ['y_00', 40]
|
||||
}, //图片前缀名
|
||||
imageFolders: {
|
||||
tab0: 'jx2/',
|
||||
tab1: 'tsj/',
|
||||
tab2: 'ldw/',
|
||||
tab3: 'bobo/',
|
||||
tab4: 'babycat/',
|
||||
tab5: 'face/',
|
||||
tab6: 'youa/'
|
||||
}, //图片对应文件夹路径
|
||||
imageCss: {tab0: 'jd', tab1: 'tsj', tab2: 'ldw', tab3: 'bb', tab4: 'cat', tab5: 'pp', tab6: 'youa'}, //图片css类名
|
||||
imageCssOffset: {tab0: 35, tab1: 35, tab2: 35, tab3: 35, tab4: 35, tab5: 25, tab6: 35}, //图片偏移
|
||||
SmileyInfor: {
|
||||
tab0: ['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
|
||||
tab1: ['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
|
||||
tab2: ['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
|
||||
tab3: ['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
|
||||
tab4: ['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
|
||||
tab5: ['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
|
||||
tab6: ['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/emotion/emotion.js
Normal file
@ -0,0 +1,2 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
function initImgName(){for(var a in emotion.SmilmgName){var b=emotion.SmilmgName[a],c=emotion.SmileyBox[a],d="";if(c.length)return;for(var e=1;e<=b[1];e++)d=b[0],e<10&&(d+="0"),d=d+e+".gif",c.push(d)}}function initEvtHandler(a){for(var b=$G(a),c=0,d=0;c<b.childNodes.length;c++){var e=b.childNodes[c];1==e.nodeType&&(domUtils.on(e,"click",function(a){return function(){switchTab(a)}}(d)),d++)}switchTab(0),$G("tabIconReview").style.display="none"}function InsertSmiley(a,b){var c={src:editor.options.emotionLocalization?editor.options.UEDITOR_HOME_URL+"dialogs/emotion/"+a:a};c._src=c.src,editor.execCommand("insertimage",c),b.ctrlKey||dialog.popup.hide()}function switchTab(a){autoHeight(a),0==emotion.tabExist[a]&&(emotion.tabExist[a]=1,createTab("tab"+a));for(var b=$G("tabHeads").getElementsByTagName("span"),c=$G("tabBodys").getElementsByTagName("div"),d=0,e=b.length;d<e;d++)b[d].className="",c[d].style.display="none";b[a].className="focus",c[a].style.display="block"}function autoHeight(a){var b=dialog.getDom("iframe"),c=b.parentNode.parentNode;switch(a){case 0:b.style.height="380px",c.style.height="392px";break;case 1:b.style.height="220px",c.style.height="232px";break;case 2:b.style.height="260px",c.style.height="272px";break;case 3:b.style.height="300px",c.style.height="312px";break;case 4:b.style.height="140px",c.style.height="152px";break;case 5:b.style.height="260px",c.style.height="272px";break;case 6:b.style.height="230px",c.style.height="242px"}}function createTab(a){for(var b,c,d,e,f,g,h="?v=1.1",i=$G(a),j=emotion.SmileyPath+emotion.imageFolders[a],k=5.5,l=iHeight=35,m=3,n=emotion.imageCss[a],o=emotion.imageCssOffset[a],p=['<table class="smileytable">'],q=0,r=emotion.SmileyBox[a].length,s=11;q<r;){p.push("<tr>");for(var t=0;t<s;t++,q++)b=emotion.SmileyBox[a][q],b?(c=j+b+h,d=j+b,e=t<k?0:1,f=o*q*-1-1,g=emotion.SmileyInfor[a][q],p.push('<td class="'+n+'" border="1" width="'+m+'%" style="border-collapse:collapse;" align="center" bgcolor="transparent" onclick="InsertSmiley(\''+d.replace(/'/g,"\\'")+"',event)\" onmouseover=\"over(this,'"+c+"','"+e+'\')" onmouseout="out(this)">'),p.push("<span>"),p.push('<img style="background-position:left '+f+'px;" title="'+g+'" src="'+emotion.SmileyPath+(editor.options.emotionLocalization?'0.gif" width="':'default/0.gif" width="')+l+'" height="'+iHeight+'"></img>'),p.push("</span>")):p.push('<td width="'+m+'%" bgcolor="#FFFFFF">'),p.push("</td>");p.push("</tr>")}p.push("</table>"),p=p.join(""),i.innerHTML=p}function over(a,b,c){a.style.backgroundColor="#ACCD3C",$G("faceReview").style.backgroundImage="url("+b+")",1==c&&($G("tabIconReview").className="show"),$G("tabIconReview").style.display="block"}function out(a){a.style.backgroundColor="transparent";var b=$G("tabIconReview");b.className="",b.style.display="none"}function createTabList(a){for(var b={},c=0;c<a;c++)b["tab"+c]=[];return b}function createArr(a){for(var b=[],c=0;c<a;c++)b[c]=0;return b}window.onload=function(){editor.setOpt({emotionLocalization:!1}),emotion.SmileyPath=editor.options.emotionLocalization===!0?"images/":"http://img.baidu.com/hi/",emotion.SmileyBox=createTabList(emotion.tabNum),emotion.tabExist=createArr(emotion.tabNum),initImgName(),initEvtHandler("tabHeads")};
|
||||
BIN
public/UEditorPlus/dialogs/emotion/images/0.gif
Normal file
|
After Width: | Height: | Size: 43 B |
BIN
public/UEditorPlus/dialogs/emotion/images/bface.gif
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/cface.gif
Normal file
|
After Width: | Height: | Size: 8.4 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/fface.gif
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/jxface2.gif
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/neweditor-tab-bg.png
Normal file
|
After Width: | Height: | Size: 216 B |
BIN
public/UEditorPlus/dialogs/emotion/images/tface.gif
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/wface.gif
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/UEditorPlus/dialogs/emotion/images/yface.gif
Normal file
|
After Width: | Height: | Size: 28 KiB |
98
public/UEditorPlus/dialogs/formula/formula.html
Normal file
@ -0,0 +1,98 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<style type="text/css">
|
||||
.wrapper {
|
||||
box-sizing: border-box;
|
||||
width: 800px;
|
||||
height: 390px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border-bottom: 1px solid #d7d7d7
|
||||
}
|
||||
|
||||
.editor-wrap {
|
||||
display: flex;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.editor-wrap #editor {
|
||||
width: 0;
|
||||
flex-grow: 1;
|
||||
border: 1px solid #CCC;
|
||||
border-radius: 3px;
|
||||
padding: 5px;
|
||||
height: 100px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.input-tip {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.input-tip a {
|
||||
color: #0f0d0d;
|
||||
}
|
||||
|
||||
.editor-preview {
|
||||
background: #FFF;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #EEE;
|
||||
display: none;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.editor-preview .title {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.editor-preview .body {
|
||||
padding: 5px 5px 15px 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.editor-preview .body .image {
|
||||
max-width: 100%;
|
||||
max-height: 100px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
|
||||
<div id="modeLive" style="display:none;">
|
||||
<iframe id="liveEditor"
|
||||
frameborder="0"
|
||||
style="width:800px;height:390px;border: 0;outline: none;"
|
||||
></iframe>
|
||||
</div>
|
||||
|
||||
<div id="modePlain" style="display:none;">
|
||||
<div class="editor-wrap">
|
||||
<textarea id="editor"></textarea>
|
||||
</div>
|
||||
<div class="input-tip">
|
||||
基于 latex 语法,<a href="javascript:;" id="inputDemo">点击输入示例</a>。
|
||||
</div>
|
||||
<div class="editor-preview" id="preview">
|
||||
<div class="title">预览</div>
|
||||
<div class="body">
|
||||
<img class="image" id="previewImage"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script src="../../third-party/jquery-1.10.2.js?25f4b625"></script>
|
||||
<script type="text/javascript" src="../../third-party/clipboard/clipboard.js?bae63983"></script>
|
||||
<script type="text/javascript" src="formula.js?3e957a67"></script>
|
||||
<script type="text/javascript">
|
||||
utils.domReady(function () {
|
||||
Formula.init();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/formula/formula.js
Normal file
@ -0,0 +1,2 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
function preg_quote(a,b){return(a+"").replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\"+(b||"")+"-]","g"),"\\$&")}function loadScript(a,b){var c;c=document.createElement("script"),c.src=a,c.onload=function(){b&&b({isNew:!0})},document.getElementsByTagName("head")[0].appendChild(c)}var Formula={mode:"plain",latexeasy:null,init:function(){Formula.initMode(),Formula.initEvent(),Formula.initSubmit()},renderPlain:function(){var a=$("#preview"),b=$("#editor").val();if(!b)return void a.hide();b=encodeURIComponent(b);var c=editor.getOpt("formulaConfig"),d=c.imageUrlTemplate.replace(/\{\}/,b);$("#previewImage").attr("src",d),a.show()},setValuePlain:function(a){$("#editor").val(a),Formula.renderPlain()},setValueLive:function(a){return Formula.latexeasy?void Formula.latexeasy.call("set.latex",{latex:a}):void setTimeout(function(){Formula.setValueLive(a)},100)},initMode:function(){var a=editor.getOpt("formulaConfig");"live"===a.editorMode?($("#liveEditor").attr("src",a.editorLiveServer+"/editor"),$("#modeLive").show(),Formula.mode="live"):($("#modePlain").show(),Formula.mode="plain");var b=editor.selection.getRange().getClosedNode();if(b&&null!==b.getAttribute("data-formula-image")){var c=b.getAttribute("data-formula-image");c&&Formula.setValue(decodeURIComponent(c))}},setValue:function(a){switch(Formula.mode){case"plain":Formula.setValuePlain(a);break;case"live":Formula.setValueLive(a)}},getValue:function(a){switch(Formula.mode){case"plain":a($.trim($("#editor").val()));break;case"live":Formula.latexeasy.call("get.latex",{},function(b){a(b.latex)})}},initEvent:function(){var a,b=null;switch(Formula.mode){case"plain":$("#editor").on("change keypress",function(){b&&clearTimeout(b),b=setTimeout(function(){Formula.renderPlain()},1e3)}),$("#inputDemo").on("click",function(){$("#editor").val("f(a) = \\frac{1}{2\\pi i} \\oint\\frac{f(z)}{z-a}dz"),Formula.renderPlain()});break;case"live":var c=editor.getOpt("formulaConfig");loadScript(c.editorLiveServer+"/vendor/LatexEasyEditor/editor/sdk.js",function(){a=new window.LatexEasy(document.getElementById("liveEditor")),a.on("ready",function(){Formula.latexeasy=a}),a.init()})}},initSubmit:function(){dialog.onclose=function(a,b){return!b||(Formula.getValue(function(a){editor.execCommand("formula",a),editor.fireEvent("saveScene"),dialog.close(!1)}),!1)}}};
|
||||
3
public/UEditorPlus/dialogs/help/help.css
Normal file
@ -0,0 +1,3 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
|
||||
.wrapper{width:370px;margin:10px auto;zoom:1}.tabbody{height:360px}.tabbody .panel{width:100%;height:360px;position:absolute;background:#fff}.tabbody .panel h1{font-size:26px;margin:5px 0 0 5px}.tabbody .panel p{font-size:12px;margin:5px 0 0 5px}.tabbody table{width:90%;line-height:20px;margin:5px 0 0 5px}.tabbody table thead{font-weight:700;line-height:25px}
|
||||
82
public/UEditorPlus/dialogs/help/help.html
Normal file
@ -0,0 +1,82 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>帮助</title>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<link rel="stylesheet" type="text/css" href="help.css?94b325b2">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper" id="helptab">
|
||||
<div id="tabHeads" class="tabhead">
|
||||
<span class="focus" tabsrc="about"><var id="lang_input_about"></var></span>
|
||||
<span tabsrc="shortcuts"><var id="lang_input_shortcuts"></var></span>
|
||||
</div>
|
||||
<div id="tabBodys" class="tabbody">
|
||||
<div id="about" class="panel">
|
||||
<h1>UEditor Plus</h1>
|
||||
<p id="version"></p>
|
||||
<p><var id="lang_input_introduction"></var></p>
|
||||
</div>
|
||||
<div id="shortcuts" class="panel">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<td><var id="lang_Txt_shortcuts"></var></td>
|
||||
<td><var id="lang_Txt_func"></var></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ctrl+b</td>
|
||||
<td><var id="lang_Txt_bold"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+c</td>
|
||||
<td><var id="lang_Txt_copy"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+x</td>
|
||||
<td><var id="lang_Txt_cut"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+v</td>
|
||||
<td><var id="lang_Txt_Paste"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+y</td>
|
||||
<td><var id="lang_Txt_undo"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+z</td>
|
||||
<td><var id="lang_Txt_redo"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+i</td>
|
||||
<td><var id="lang_Txt_italic"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+u</td>
|
||||
<td><var id="lang_Txt_underline"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ctrl+a</td>
|
||||
<td><var id="lang_Txt_selectAll"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>shift+enter</td>
|
||||
<td><var id="lang_Txt_visualEnter"></var></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>alt+z</td>
|
||||
<td><var id="lang_Txt_fullscreen"></var></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="help.js?cf43351e"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/help/help.js
Normal file
@ -0,0 +1,2 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
function clickHandler(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d].className="";c.className="focus";for(var f=c.getAttribute("tabSrc"),g=0,h=b.length;g<h;g++){var i=b[g],j=i.getAttribute("id");i.onclick=function(){this.style.zoom=1},j!=f?i.style.zIndex=1:i.style.zIndex=200}}function switchTab(a){for(var b=$G(a).children,c=b[0].children,d=b[1].children,e=0,f=c.length;e<f;e++){var g=c[e];"focus"===g.className&&clickHandler(c,d,g),g.onclick=function(){clickHandler(c,d,this)}}}switchTab("helptab"),document.getElementById("version").innerHTML=parent.UE.version;
|
||||
3
public/UEditorPlus/dialogs/image/image.css
Normal file
125
public/UEditorPlus/dialogs/image/image.html
Normal file
@ -0,0 +1,125 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ueditor图片对话框</title>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
|
||||
<!-- jquery -->
|
||||
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?25f4b625"></script>
|
||||
|
||||
<!-- webuploader -->
|
||||
<script src="../../third-party/webuploader/webuploader.js?be202c93"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?b8f06036">
|
||||
|
||||
<!-- image dialog -->
|
||||
<link rel="stylesheet" href="image.css?4cbad164" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrapper">
|
||||
<div id="tabhead" class="tabhead">
|
||||
<span class="tab focus" data-content-id="remote"><var id="lang_tab_remote"></var></span>
|
||||
<span style="display:none;" class="tab" data-content-id="upload"><var id="lang_tab_upload"></var></span>
|
||||
<span style="display:none;" class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
|
||||
</div>
|
||||
<div class="alignBar">
|
||||
<label class="algnLabel"><var id="lang_input_align"></var></label>
|
||||
<span id="alignIcon">
|
||||
<span id="noneAlign" class="none-align focus" data-align="none"></span>
|
||||
<span id="leftAlign" class="left-align" data-align="left"></span>
|
||||
<span id="rightAlign" class="right-align" data-align="right"></span>
|
||||
<span id="centerAlign" class="center-align" data-align="center"></span>
|
||||
</span>
|
||||
<input id="align" name="align" type="hidden" value="none"/>
|
||||
</div>
|
||||
<div id="tabbody" class="tabbody">
|
||||
|
||||
<!-- 远程图片 -->
|
||||
<div id="remote" class="panel">
|
||||
<div class="top">
|
||||
<div class="row">
|
||||
<label for="url"><var id="lang_input_url"></var></label>
|
||||
<span><input class="text" id="url" type="text"/></span>
|
||||
<a href="javascript:;" id="imageSelect" style="display:none;">选择图片</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left">
|
||||
<div class="row">
|
||||
<label><var id="lang_input_size"></var></label>
|
||||
<span><var id="lang_input_width"> </var><input class="text" type="text"
|
||||
id="width"/>px </span>
|
||||
<span><var id="lang_input_height"> </var><input class="text" type="text" id="height"/>px </span>
|
||||
<span><input id="lock" type="checkbox" disabled="disabled"><span id="lockicon"></span></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_border"></var></label>
|
||||
<span><input class="text" type="text" id="border"/>px </span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_vhspace"></var></label>
|
||||
<span><input class="text" type="text" id="vhSpace"/>px </span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_title"></var></label>
|
||||
<span><input class="text" type="text" id="title"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div id="preview"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 上传图片 -->
|
||||
<div id="upload" class="panel focus">
|
||||
<div id="queueList" class="queueList">
|
||||
<div class="statusBar element-invisible">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div>
|
||||
<div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePickerBtn"></div>
|
||||
<div class="uploadBtn"><var id="lang_start_upload"></var></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dndArea" class="placeholder">
|
||||
<div class="filePickerContainer">
|
||||
<div id="filePickerReady"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="filelist element-invisible">
|
||||
<li id="filePickerBlock" class="filePickerBlock"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 在线图片 -->
|
||||
<div id="online" class="panel">
|
||||
<div id="imageList"><var id="lang_imgLoading"></var></div>
|
||||
</div>
|
||||
|
||||
<!-- 搜索图片 -->
|
||||
<div id="search" class="panel">
|
||||
<div class="searchBar">
|
||||
<input id="searchTxt" class="searchTxt text" type="text"/>
|
||||
<select id="searchType" class="searchType">
|
||||
<option value="&s=4&z=0"></option>
|
||||
<option value="&s=1&z=19"></option>
|
||||
<option value="&s=2&z=0"></option>
|
||||
<option value="&s=3&z=0"></option>
|
||||
</select>
|
||||
<input id="searchReset" type="button"/>
|
||||
<input id="searchBtn" type="button"/>
|
||||
</div>
|
||||
<div id="searchList" class="searchList">
|
||||
<ul id="searchListUl"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="image.js?31837e8b"></script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/image/image.js
Normal file
BIN
public/UEditorPlus/dialogs/image/images/alignicon.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
public/UEditorPlus/dialogs/image/images/bg.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
public/UEditorPlus/dialogs/image/images/icons.gif
Normal file
|
After Width: | Height: | Size: 453 B |
BIN
public/UEditorPlus/dialogs/image/images/icons.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
public/UEditorPlus/dialogs/image/images/image.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
public/UEditorPlus/dialogs/image/images/progress.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
public/UEditorPlus/dialogs/image/images/success.gif
Normal file
|
After Width: | Height: | Size: 445 B |
BIN
public/UEditorPlus/dialogs/image/images/success.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
135
public/UEditorPlus/dialogs/insertframe/insertframe.html
Normal file
@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<link rel="stylesheet" href="../../themes/default/dialog.css?c473027a">
|
||||
<style type="text/css">
|
||||
.warp {
|
||||
width: 320px;
|
||||
height: 200px;
|
||||
margin-left: 5px;
|
||||
padding: 20px 0 0 15px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#url {
|
||||
width: 290px;
|
||||
margin-bottom: 2px;
|
||||
margin-left: -6px;
|
||||
margin-left: -2px \9;
|
||||
*margin-left: 0;
|
||||
_margin-left: 0;
|
||||
}
|
||||
|
||||
.format span {
|
||||
display: inline-block;
|
||||
width: 58px;
|
||||
text-align: left;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
table td {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
#align {
|
||||
width: 65px;
|
||||
height: 23px;
|
||||
line-height: 22px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="warp">
|
||||
<table width="300" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td colspan="2" class="format">
|
||||
<span><var id="lang_input_address"></var></span>
|
||||
<input style="width:200px" id="url" type="text" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="format"><span><var id="lang_input_width"></var></span><input style="width:200px"
|
||||
type="text" id="width"/>
|
||||
px
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="format"><span><var id="lang_input_height"></var></span><input style="width:200px"
|
||||
type="text"
|
||||
id="height"/> px
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span><var id="lang_input_isScroll"></var></span><input type="checkbox" id="scroll"/></td>
|
||||
<td><span><var id="lang_input_frameborder"></var></span><input type="checkbox" id="frameborder"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><span><var id="lang_input_alignMode"></var></span>
|
||||
<select id="align">
|
||||
<option value=""></option>
|
||||
<option value="left"></option>
|
||||
<option value="right"></option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var iframe = editor._iframe;
|
||||
if (iframe) {
|
||||
$G("url").value = iframe.getAttribute("src") || "";
|
||||
$G("width").value = iframe.getAttribute("width") || iframe.style.width.replace("px", "") || "";
|
||||
$G("height").value = iframe.getAttribute("height") || iframe.style.height.replace("px", "") || "";
|
||||
$G("scroll").checked = (iframe.getAttribute("scrolling") == "yes") ? true : false;
|
||||
$G("frameborder").checked = (iframe.getAttribute("frameborder") == "1") ? true : false;
|
||||
$G("align").value = iframe.align ? iframe.align : "";
|
||||
}
|
||||
|
||||
function queding() {
|
||||
var url = $G("url").value.replace(/^\s*|\s*$/ig, ""),
|
||||
width = $G("width").value,
|
||||
height = $G("height").value,
|
||||
scroll = $G("scroll"),
|
||||
frameborder = $G("frameborder"),
|
||||
float = $G("align").value,
|
||||
newIframe = editor.document.createElement("iframe"),
|
||||
div;
|
||||
if (!url) {
|
||||
alert(lang.enterAddress);
|
||||
return false;
|
||||
}
|
||||
newIframe.setAttribute("src", /http:\/\/|https:\/\//ig.test(url) ? url : "http://" + url);
|
||||
/^[1-9]+[.]?\d*$/g.test(width) ? newIframe.setAttribute("width", width) : "";
|
||||
/^[1-9]+[.]?\d*$/g.test(height) ? newIframe.setAttribute("height", height) : "";
|
||||
scroll.checked ? newIframe.setAttribute("scrolling", "yes") : newIframe.setAttribute("scrolling", "no");
|
||||
frameborder.checked ? newIframe.setAttribute("frameborder", "1", 0) : newIframe.setAttribute("frameborder", "0", 0);
|
||||
float ? newIframe.setAttribute("align", float) : newIframe.setAttribute("align", "");
|
||||
if (iframe) {
|
||||
iframe.parentNode.insertBefore(newIframe, iframe);
|
||||
domUtils.remove(iframe);
|
||||
} else {
|
||||
div = editor.document.createElement("div");
|
||||
div.appendChild(newIframe);
|
||||
editor.execCommand("inserthtml", div.innerHTML);
|
||||
}
|
||||
editor._iframe = null;
|
||||
dialog.close();
|
||||
}
|
||||
|
||||
dialog.onok = queding;
|
||||
$G("url").onkeydown = function (evt) {
|
||||
evt = evt || event;
|
||||
if (evt.keyCode == 13) {
|
||||
queding();
|
||||
}
|
||||
};
|
||||
$focus($G("url"));
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
2
public/UEditorPlus/dialogs/internal.js
Normal file
@ -0,0 +1,2 @@
|
||||
/*! UEditorPlus v2.0.0*/
|
||||
!function(){var a=window.parent;dialog=a.$EDITORUI[window.frameElement.id.replace(/_iframe$/,"")],editor=dialog.editor,UE=a.UE,domUtils=UE.dom.domUtils,utils=UE.utils,browser=UE.browser,ajax=UE.ajax,$G=function(a){return document.getElementById(a)},$focus=function(a){setTimeout(function(){if(browser.ie){var b=a.createTextRange();b.collapse(!1),b.select()}else a.focus()},0)},utils.loadFile(document,{href:editor.options.themePath+editor.options.theme+"/dialogbase.css?cache="+Math.random(),tag:"link",type:"text/css",rel:"stylesheet"}),lang=editor.getLang(dialog.className.split("-")[2]),lang&&domUtils.on(window,"load",function(){var a=editor.options.langPath+editor.options.lang+"/images/";for(var b in lang["static"]){var c=$G(b);if(c){var d=c.tagName,e=lang["static"][b];switch(e.src&&(e=utils.extend({},e,!1),e.src=a+e.src),e.style&&(e=utils.extend({},e,!1),e.style=e.style.replace(/url\s*\(/g,"url("+a)),d.toLowerCase()){case"var":c.parentNode.replaceChild(document.createTextNode(e),c);break;case"select":for(var f,g=c.options,h=0;f=g[h];)f.innerHTML=e.options[h++];for(var i in e)"options"!=i&&c.setAttribute(i,e[i]);break;default:domUtils.setAttributes(c,e)}}}})}();
|
||||
155
public/UEditorPlus/dialogs/link/link.html
Normal file
@ -0,0 +1,155 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<style type="text/css">
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #838383;
|
||||
}
|
||||
|
||||
table {
|
||||
font-size: 12px;
|
||||
margin: 10px;
|
||||
line-height: 36px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.txt {
|
||||
box-sizing: border-box;
|
||||
width: 90%;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border: 1px solid #d7d7d7;
|
||||
border-radius: 3px;
|
||||
padding: 0 5px;
|
||||
outline: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding:10px;">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label for="text"> <var id="lang_input_text"></var></label></td>
|
||||
<td><input class="txt" id="text" type="text" disabled="true"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="href"> <var id="lang_input_url"></var></label></td>
|
||||
<td><input class="txt" id="href" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="title"> <var id="lang_input_title"></var></label></td>
|
||||
<td><input class="txt" id="title" type="text"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<label for="target"><var id="lang_input_target"></var></label>
|
||||
<input id="target" type="checkbox"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" id="msg"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
editor.setOpt('allowLinkProtocols', ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:']);
|
||||
var allowLinkProtocols = editor.getOpt('allowLinkProtocols');
|
||||
|
||||
var range = editor.selection.getRange(),
|
||||
link = range.collapsed ? editor.queryCommandValue("link") : editor.selection.getStart(),
|
||||
url,
|
||||
text = $G('text'),
|
||||
rangeLink = domUtils.findParentByTagName(range.getCommonAncestor(), 'a', true),
|
||||
orgText;
|
||||
|
||||
link = domUtils.findParentByTagName(link, "a", true);
|
||||
|
||||
if (link) {
|
||||
url = utils.html(link.getAttribute('_href') || link.getAttribute('href', 2));
|
||||
|
||||
if (rangeLink === link && !link.getElementsByTagName('img').length) {
|
||||
text.removeAttribute('disabled');
|
||||
orgText = text.value = link[browser.ie ? 'innerText' : 'textContent'];
|
||||
} else {
|
||||
text.setAttribute('disabled', 'true');
|
||||
text.value = lang.validLink;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (range.collapsed) {
|
||||
text.removeAttribute('disabled');
|
||||
text.value = '';
|
||||
} else {
|
||||
text.setAttribute('disabled', 'true');
|
||||
text.value = lang.validLink;
|
||||
}
|
||||
|
||||
}
|
||||
$G("title").value = url ? link.title : "";
|
||||
$G("href").value = url ? url : '';
|
||||
$G("target").checked = url && link.target == "_blank" ? true : false;
|
||||
$focus($G("href"));
|
||||
|
||||
function handleDialogOk() {
|
||||
var href = $G('href').value.replace(/^\s+|\s+$/g, '');
|
||||
if (href) {
|
||||
if (!hrefStartWith(href, allowLinkProtocols)) {
|
||||
href = "http://" + href;
|
||||
}
|
||||
var obj = {
|
||||
'href': href,
|
||||
'target': $G("target").checked ? "_blank" : '_self',
|
||||
'title': $G("title").value.replace(/^\s+|\s+$/g, ''),
|
||||
'_href': href
|
||||
};
|
||||
//修改链接内容的情况太特殊了,所以先做到这里了
|
||||
//todo:情况多的时候,做到command里
|
||||
if (orgText && text.value != orgText) {
|
||||
link[browser.ie ? 'innerText' : 'textContent'] = obj.textValue = text.value;
|
||||
range.selectNode(link).select()
|
||||
}
|
||||
if (range.collapsed) {
|
||||
obj.textValue = text.value;
|
||||
}
|
||||
editor.execCommand('link', utils.clearEmptyAttrs(obj));
|
||||
dialog.close();
|
||||
}
|
||||
}
|
||||
|
||||
dialog.onok = handleDialogOk;
|
||||
$G('href').onkeydown = $G('title').onkeydown = function (evt) {
|
||||
evt = evt || window.event;
|
||||
if (evt.keyCode == 13) {
|
||||
handleDialogOk();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
$G('href').onblur = function () {
|
||||
if (!hrefStartWith(this.value, allowLinkProtocols)) {
|
||||
$G("msg").innerHTML = "<span style='color: red'>" + lang.httpPrompt + "</span>";
|
||||
} else {
|
||||
$G("msg").innerHTML = "";
|
||||
}
|
||||
};
|
||||
|
||||
function hrefStartWith(href, arr) {
|
||||
href = href.replace(/^\s+|\s+$/g, '');
|
||||
for (var i = 0, ai; ai = arr[i++];) {
|
||||
if (href.indexOf(ai) == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
45
public/UEditorPlus/dialogs/preview/preview.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<style>
|
||||
html, body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#preview {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#preview * {
|
||||
font-family: sans-serif;
|
||||
font-size: 16px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
||||
<script src="../../ueditor.parse.js?63488b91"></script>
|
||||
<title></title>
|
||||
</head>
|
||||
<body class="view">
|
||||
<div id="preview" style="margin:8px">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
document.getElementById('preview').innerHTML = editor.getContent();
|
||||
uParse('#preview', {
|
||||
rootPath: '../../',
|
||||
chartContainerHeight: 500
|
||||
})
|
||||
dialog.oncancel = function () {
|
||||
document.getElementById('preview').innerHTML = '';
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
BIN
public/UEditorPlus/dialogs/scrawl/images/addimg.png
Normal file
|
After Width: | Height: | Size: 628 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/brush.png
Normal file
|
After Width: | Height: | Size: 608 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/delimg.png
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/delimgH.png
Normal file
|
After Width: | Height: | Size: 578 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/empty.png
Normal file
|
After Width: | Height: | Size: 519 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/emptyH.png
Normal file
|
After Width: | Height: | Size: 657 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/eraser.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
public/UEditorPlus/dialogs/scrawl/images/redo.png
Normal file
|
After Width: | Height: | Size: 454 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/redoH.png
Normal file
|
After Width: | Height: | Size: 536 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/scale.png
Normal file
|
After Width: | Height: | Size: 435 B |
BIN
public/UEditorPlus/dialogs/scrawl/images/scaleH.png
Normal file
|
After Width: | Height: | Size: 330 B |