功能优化和新增 (#956)

* feat: 首页项目拖拽排序功能

* feat: 增加首页项目拖拽排序增加只能管理员进行, 排序失败元素回到原本位置

* perf: 新建文章以后直接进入到编辑文章页面

* perf: 优化文档打开时或刷新时样式闪动问题

* perf: 优化表格样式

* feat: 支持上传视频功能

* feat: 视频样式调整

* feat: 直接粘贴视频上传功能

* perf: 优化markdown目录显示
This commit is contained in:
zhanzhenping
2024-07-05 15:31:34 +08:00
committed by GitHub
parent 710d5bcf50
commit 1ea922106d
12 changed files with 243 additions and 131 deletions

View File

@@ -245,18 +245,22 @@ $(function () {
//如果没有选中节点则选中默认节点
openLastSelectedNode();
uploadImage("docEditor", function ($state, $res) {
uploadResource("docEditor", function ($state, $res) {
if ($state === "before") {
return layer.load(1, {
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
});
} else if ($state === "success") {
// if ($res.errcode === 0) {
// var value = '![](' + $res.url + ')';
// 3xxx 20240602
if ($res[0].errcode === 0) {
var value = '![](' + $res[0].url + ')';
window.editor.insertValue(value);
if ($res.errcode === 0) {
if ($res.resource_type === 'video') {
let value = `<video controls><source src="${$res.url}" type="video/mp4"></video>`;
window.editor.insertValue(value);
} else {
let value = '![](' + $res.url + ')';
window.editor.insertValue(value);
}
} else {
layer.msg("上传失败:" + $res.message);
}
}
});