This commit is contained in:
wenjiarui 2023-06-28 21:36:14 +08:00
commit b436edc4b5
53 changed files with 340 additions and 1095 deletions

View File

@ -0,0 +1,3 @@
.container {
width: 950px;
}

View File

@ -0,0 +1,3 @@
.container {
width: 950px;
}

View File

@ -5,6 +5,7 @@ exports.ECode = void 0;
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
// @ts-ignore
var react_router_dom_1 = require("react-router-dom");
var assets_result_403_svg_1 = require("./assets/svg/assets-result-403.svg");
var assets_result_404_svg_1 = require("./assets/svg/assets-result-404.svg");

View File

@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = require("react");
// @ts-ignore
var react_router_dom_1 = require("react-router-dom");
var antd_1 = require("antd");
var icons_1 = require("@ant-design/icons");

View File

@ -17,7 +17,7 @@ export declare class ExtraFile<ED extends EntityDict, Cxt extends BackendRuntime
url: string;
bucket: string;
}>;
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): any;
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
/**
* 使使url时URL.revokeObjectURL释放缓存
*

View File

@ -1,4 +0,0 @@
/// <reference types="wechat-miniprogram" />
/// <reference types="react" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../general-app-domain").EntityDict, "article", false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export default _default;

View File

@ -1,42 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
entity: 'article',
projection: {
id: 1,
iState: 1,
title: 1,
author: 1,
abstract: 1,
content: 1,
entity: 1,
entityId: 1,
},
isList: false,
formData: function (_a) {
var article = _a.data, features = _a.features;
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, {
id: article === null || article === void 0 ? void 0 : article.id,
iState: article === null || article === void 0 ? void 0 : article.iState,
title: article === null || article === void 0 ? void 0 : article.title,
abstract: article === null || article === void 0 ? void 0 : article.abstract,
author: article === null || article === void 0 ? void 0 : article.author,
content: article === null || article === void 0 ? void 0 : article.content,
}];
});
});
},
listeners: {
content: function (prev, next) {
if (prev.content !== next.content) {
var ac = window.document.getElementById('article-content');
if (ac) {
ac.innerHTML = next.content;
}
}
},
},
});

View File

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "文章详情",
"usingComponents": {}
}

View File

@ -1,3 +0,0 @@
{
"detail": "详情"
}

View File

@ -1,9 +0,0 @@
import { EntityDict } from './../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
export default function render(props: WebComponentProps<EntityDict, 'article', false, {
title?: string;
author?: string;
abstract?: string;
content?: string;
html?: string;
}, {}>): import("react/jsx-runtime").JSX.Element;

View File

@ -1,12 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
function render(props) {
var methods = props.methods, data = props.data;
var t = methods.t;
var title = data.title, author = data.author, abstract = data.abstract, content = data.content;
return ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.content }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.editorContainer }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.titleContainer }, { children: (0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: web_module_less_1.default.title }, { children: title })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.authorContainer }, { children: (0, jsx_runtime_1.jsx)("span", tslib_1.__assign({ className: web_module_less_1.default.author }, { children: author })) })), (0, jsx_runtime_1.jsx)("div", { id: "article-content" })] })) })) })));
}
exports.default = render;

View File

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "文章管理",
"usingComponents": {}
}

View File

@ -1,5 +0,0 @@
{
"action": {
"add": "添加"
}
}

View File

@ -1,6 +1,39 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
min-height: 450px;
.article {
display: flex;
flex-direction: row;
.menu {
display: flex;
}
.editor {
display: flex;
margin-left: 20px;
.rightContainer {
width: 950px;
}
}
}
}
.space {
margin-bottom: 15px;
}
.tree {
:global {
.ant-tree-title {
display: flex;
flex: 1;
}
}
}

View File

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "文章预览",
"usingComponents": {}
}

View File

@ -1,3 +0,0 @@
{
"detail": "预览"
}

View File

@ -1,24 +1,31 @@
.container {
background-color: var(--oak-bg-color-page);
padding: 30px 32px;
height: 100%;
background-color: #f3f5f7;
padding: 30px 300px;
min-height: 100vh;
}
.content {
background-color: var(--oak-bg-color-page);
width: 100%
display: flex;
background-color: #f3f5f7;
width: 100%;
justify-content: center;
}
.editorContainer {
// width: 100%;
margin: 30px auto 50px auto;
// margin: 30px auto 50px auto;
width: 100%;
display: flex;
flex-direction: column;
background: var(--oak-bg-color-container);
padding: 20px 50px 50px 50px;
box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}
.titleContainer {
display: flex;
justify-content: center;
padding: 5px 0 10px 0;
}
@ -27,7 +34,7 @@
}
.title {
font-size: 18px !important;
font-size: 32px !important;
font-weight: bold !important;
}

View File

@ -1,4 +0,0 @@
{
"navigationBarTitleText": "编辑文章",
"usingComponents": {}
}

View File

@ -1,13 +0,0 @@
{
"submit": "提交",
"reset": "重置",
"placeholder": {
"author": "请输入作者",
"title": "请在这里输入标题",
"content": "从这里开始正文",
"abstract": "选填摘要会在订阅号消息、转发链接等文章外的场景显露帮助读者快速了解内容如不填写则默认抓取正文前54字"
},
"tips": {
"content": "请先输入一段正文(或者标题),再点击保存按钮。"
}
}

View File

@ -1,73 +1,73 @@
.container {
background-color: var(--oak-bg-color-page);
// padding: 30px 32px;
background-color: var(--oak-bg-color-page);
// padding: 30px 32px;
}
.content {
background-color: var(--oak-bg-color-page);
// height: calc(100% - 40px);
//overflow-y: auto;
position: relative;
background-color: var(--oak-bg-color-page);
// height: calc(100% - 40px);
//overflow-y: auto;
position: relative;
}
.editorContainer {
width: 850px;
margin: 30px auto 50px auto;
background: var(--oak-bg-color-container);
padding: 20px 50px 50px 50px;
box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
width: 850px;
margin: 30px auto 50px auto;
background: var(--oak-bg-color-container);
padding: 20px 60px 50px 60px;
box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}
.titleContainer {
padding: 5px 0;
border-bottom: 1px solid #e8e8e8;
padding: 5px 0;
border-bottom: 1px solid #e8e8e8;
}
.authorContainer {
padding: 5px 0;
//border-bottom: 1px solid #e8e8e8;
padding: 5px 0;
//border-bottom: 1px solid #e8e8e8;
}
.input {
border: unset !important;
box-shadow: none !important;
border: unset !important;
box-shadow: none !important;
}
.titleInput {
border: unset !important;
box-shadow: none !important;
font-size: 18px !important;
font-weight: bold !important;
border: unset !important;
box-shadow: none !important;
font-size: 18px !important;
font-weight: bold !important;
}
.input:hover {
border: unset !important;
border: unset !important;
}
.abstract {
width: 100%;
border-top: 1px solid #e8e8e8;
width: 100%;
border-top: 1px solid #e8e8e8;
}
.card {
:global {
.ant-card-head {
border: none;
}
}
:global {
.ant-card-head {
border: none;
}
}
}
.footer {
// position: absolute;
bottom: 0;
height: 50px;
// position: absolute;
bottom: 0;
height: 50px;
}
.contentNumber {
display: flex;
min-height: 32px;
flex-direction: column;
justify-content: center;
color: var(--oak-text-color-secondary);
display: flex;
min-height: 32px;
flex-direction: column;
justify-content: center;
color: var(--oak-text-color-secondary);
}

View File

@ -1,5 +0,0 @@
/// <reference types="wechat-miniprogram" />
/// <reference types="react" />
import { EntityDict } from "../../../general-app-domain";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "articleMenu", true, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export default _default;

View File

@ -1,382 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.default = OakComponent({
entity: 'articleMenu',
projection: {
id: 1,
name: 1,
isArticle: 1,
isLeaf: 1,
parent: {
id: 1,
name: 1,
isArticle: 1,
isLeaf: 1,
},
extraFile$entity: {
$entity: 'extraFile',
data: {
id: 1,
tag1: 1,
origin: 1,
bucket: 1,
objectId: 1,
filename: 1,
extra1: 1,
extension: 1,
type: 1,
entity: 1,
entityId: 1,
},
filter: {
tag1: {
$in: ['logo', 'introduce'],
},
},
},
},
isList: true,
formData: function (_a) {
var articleMenu = _a.data;
return {
articleMenu: articleMenu,
};
},
filters: [],
lifetimes: {
ready: function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var articles, articleMenus, newArticleMenus, newArticles, arr, rootNodes, treeData;
var _this = this;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.features.cache.refresh('article', {
data: {
id: 1,
name: 1,
content: 1,
articleMenuId: 1,
},
})];
case 1:
articles = (_a.sent()).data;
return [4 /*yield*/, this.features.cache.refresh('articleMenu', {
data: {
id: 1,
name: 1,
isArticle: 1,
isLeaf: 1,
parent: {
id: 1,
name: 1,
isArticle: 1,
isLeaf: 1,
},
extraFile$entity: {
$entity: 'extraFile',
data: {
id: 1,
tag1: 1,
origin: 1,
bucket: 1,
objectId: 1,
filename: 1,
extra1: 1,
extension: 1,
type: 1,
entity: 1,
entityId: 1,
},
filter: {
tag1: {
$in: ['logo'],
},
},
},
},
sorter: [
{
$attr: {
$$createAt$$: 1,
},
$direction: 'asc',
},
],
})];
case 2:
articleMenus = (_a.sent()).data;
newArticleMenus = articleMenus === null || articleMenus === void 0 ? void 0 : articleMenus.map(function (ele) {
var _a;
return tslib_1.__assign(tslib_1.__assign({}, ele), { logo: _this.features.extraFile.getUrl((_a = ele === null || ele === void 0 ? void 0 : ele.extraFile$entity) === null || _a === void 0 ? void 0 : _a.find(function (ele) { return ele.tag1 === 'logo'; })) });
});
newArticles = articles === null || articles === void 0 ? void 0 : articles.map(function (ele) { return ({
id: ele === null || ele === void 0 ? void 0 : ele.id,
name: ele === null || ele === void 0 ? void 0 : ele.name,
parent: ele === null || ele === void 0 ? void 0 : ele.articleMenuId,
parentId: ele === null || ele === void 0 ? void 0 : ele.articleMenuId,
isArticle: true,
content: ele === null || ele === void 0 ? void 0 : ele.content,
logo: null,
}); });
arr = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(newArticleMenus), false), tslib_1.__read(newArticles), false);
rootNodes = arr === null || arr === void 0 ? void 0 : arr.filter(function (node) { return !node.parent; });
treeData = rootNodes === null || rootNodes === void 0 ? void 0 : rootNodes.map(function (rootNode) {
var _a;
return {
label: rootNode.name,
title: rootNode.name,
key: (_a = (rootNode.id)) === null || _a === void 0 ? void 0 : _a.toString(),
isArticle: rootNode.isArticle,
logo: rootNode === null || rootNode === void 0 ? void 0 : rootNode.logo,
children: _this.buildTreeData(arr, rootNode.id),
};
});
this.setState({
arr: arr,
treeData: treeData
});
return [2 /*return*/];
}
});
});
}
},
methods: {
buildTreeData: function (nodes, parentId) {
var e_1, _a;
var children = [];
try {
for (var nodes_1 = tslib_1.__values(nodes), nodes_1_1 = nodes_1.next(); !nodes_1_1.done; nodes_1_1 = nodes_1.next()) {
var node = nodes_1_1.value;
if (node.parentId === parentId) {
var treeNode = {
label: node.name,
title: node.name,
key: node.id.toString(),
isArticle: node.isArticle,
isLeaf: node.isLeaf,
logo: node.logo,
};
var nestedChildren = this.buildTreeData(nodes, node.id);
if (nestedChildren.length > 0) {
treeNode.children = nestedChildren;
}
children.push(treeNode);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (nodes_1_1 && !nodes_1_1.done && (_a = nodes_1.return)) _a.call(nodes_1);
}
finally { if (e_1) throw e_1.error; }
}
return children;
},
gotoUpsert: function (parentId) {
this.setState({
parentId: parentId,
id: '',
articleMenuId: '',
});
},
gotoUpsertById: function (id) {
var _a, _b, _c, _d;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var articleMenu;
return tslib_1.__generator(this, function (_e) {
switch (_e.label) {
case 0:
if (!id) return [3 /*break*/, 2];
return [4 /*yield*/, this.features.cache.refresh('articleMenu', {
data: {
id: 1,
name: 1,
isArticle: 1,
parentId: 1,
extraFile$entity: {
$entity: 'extraFile',
data: {
id: 1,
tag1: 1,
origin: 1,
bucket: 1,
objectId: 1,
filename: 1,
extra1: 1,
extension: 1,
type: 1,
entity: 1,
entityId: 1,
},
filter: {
tag1: {
$in: ['logo'],
},
},
},
},
filter: {
$or: [
{
id: id,
},
{
parentId: id,
}
]
},
})];
case 1:
articleMenu = (_e.sent()).data;
if (articleMenu && (articleMenu === null || articleMenu === void 0 ? void 0 : articleMenu.length) > 1) {
console.log(this.features.extraFile.getUrl((_a = articleMenu[0]) === null || _a === void 0 ? void 0 : _a.extraFile$entity[0]));
this.setState({
id: articleMenu[0].id,
name: articleMenu[0].name,
parentId: '',
articleMenuId: '',
isArticle: articleMenu[0].isArticle,
isChildren: true,
logo: this.features.extraFile.getUrl((_b = articleMenu[0]) === null || _b === void 0 ? void 0 : _b.extraFile$entity[0])
});
}
if (articleMenu && (articleMenu === null || articleMenu === void 0 ? void 0 : articleMenu.length) === 1) {
console.log(this.features.extraFile.getUrl((_c = articleMenu[0]) === null || _c === void 0 ? void 0 : _c.extraFile$entity[0]));
this.setState({
id: articleMenu[0].id,
name: articleMenu[0].name,
parentId: '',
articleMenuId: '',
isArticle: articleMenu[0].isArticle,
isChildren: false,
logo: this.features.extraFile.getUrl((_d = articleMenu[0]) === null || _d === void 0 ? void 0 : _d.extraFile$entity[0])
});
}
_e.label = 2;
case 2: return [2 /*return*/];
}
});
});
},
gotoArticleUpsert: function (articleId) {
var _a;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var article;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
if (!articleId) return [3 /*break*/, 2];
return [4 /*yield*/, this.features.cache.refresh('article', {
data: {
id: 1,
name: 1,
content: 1,
articleMenuId: 1,
},
filter: {
id: articleId
},
})];
case 1:
article = (_b.sent()).data;
if (article) {
this.setState({
content: (_a = article[0]) === null || _a === void 0 ? void 0 : _a.content,
articleId: articleId,
id: '',
parentId: '',
});
}
;
_b.label = 2;
case 2:
;
return [2 /*return*/];
}
});
});
},
gotoEdit: function (id) {
if (id) {
this.navigateTo({
url: '/articleMenu/upsert',
oakId: id,
});
}
else {
this.navigateTo({
url: '/articleMenu/upsert',
});
}
},
gotoEditByParentId: function (parentId) {
this.navigateTo({
url: '/articleMenu/upsert',
parentId: parentId
});
},
gotoArticleEdit: function (articleId) {
this.navigateTo({
url: '/article2/upsert',
oakId: articleId
});
},
gotoArticleEditByArticleMenuId: function (articleMenuId) {
this.navigateTo({
url: '/article2/upsert',
articleMenuId: articleMenuId
});
},
onRemoveArticleMenu: function (id) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.removeItem(id);
return [4 /*yield*/, this.execute()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
},
onRemoveArticle: function (id) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
this.removeItem(id);
return [4 /*yield*/, this.execute()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
},
check: function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!this.state.name) {
this.setMessage({
type: 'error',
content: '请输入文章分类名称',
});
return [2 /*return*/];
}
return [4 /*yield*/, this.execute()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
},
}
});

View File

@ -1,42 +0,0 @@
import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "../../../general-app-domain";
interface DataNode {
label: string;
title: string;
key: string;
isArticle?: boolean;
children?: DataNode[];
}
export default function render(props: WebComponentProps<EntityDict, "articleMenu", true, {
articleMenu: EntityDict["articleMenu"]["Schema"][];
articles: EntityDict["article"]["Schema"][];
treeData: DataNode[];
content: string;
arr: {
id: string | undefined;
name: string | undefined;
parent: string | undefined;
parentId: string | undefined;
isArticle: boolean;
isLeaf: boolean;
}[];
id: string;
parentId: string;
articleId: string;
name: string;
isArticle: boolean;
isChildren: boolean;
logo: string;
}, {
gotoUpsert: (id?: string) => void;
gotoUpsertById: (id: string) => void;
gotoArticleUpsert: (articleId: string) => void;
check: () => void;
onRemoveArticleMenu: (id: string) => void;
gotoEdit: (id?: string) => void;
gotoEditByParentId: (parentId: string) => void;
gotoArticleEdit: (articleId: string) => void;
onRemoveArticle: (id: string) => void;
gotoArticleEditByArticleMenuId: (articleMenuId: string) => void;
}>): import("react/jsx-runtime").JSX.Element;
export {};

View File

@ -1,54 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var antd_1 = require("antd");
var confirm = antd_1.Modal.confirm;
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
var useFeatures_1 = tslib_1.__importDefault(require("../../../hooks/useFeatures"));
var pageHeader_1 = tslib_1.__importDefault(require("../../../components/common/pageHeader"));
var detail2_1 = tslib_1.__importDefault(require("../../../components/article/detail2"));
var SubMenu = antd_1.Menu.SubMenu;
function render(props) {
var _a = props.data, arr = _a.arr, treeData = _a.treeData, id = _a.id, parentId = _a.parentId, articleId = _a.articleId, name = _a.name, content = _a.content, oakFullpath = _a.oakFullpath, isArticle = _a.isArticle, isChildren = _a.isChildren, logo = _a.logo;
var _b = props.methods, t = _b.t, gotoUpsert = _b.gotoUpsert, gotoUpsertById = _b.gotoUpsertById, gotoArticleUpsert = _b.gotoArticleUpsert, onRemoveArticleMenu = _b.onRemoveArticleMenu, gotoEdit = _b.gotoEdit, gotoEditByParentId = _b.gotoEditByParentId, gotoArticleEdit = _b.gotoArticleEdit, onRemoveArticle = _b.onRemoveArticle, gotoArticleEditByArticleMenuId = _b.gotoArticleEditByArticleMenuId;
var features = (0, useFeatures_1.default)();
var editorConfig = {
readOnly: true,
autoFocus: true,
scroll: false,
};
var renderMenuItems = function (data) {
return data === null || data === void 0 ? void 0 : data.map(function (menuItem) {
if (menuItem.children || menuItem.isLeaf) {
return ((0, jsx_runtime_1.jsx)(antd_1.Menu.SubMenu, tslib_1.__assign({ icon: menuItem.logo ? (0, jsx_runtime_1.jsx)(antd_1.Image, { height: 32, width: 32, src: menuItem.logo }) : null, title: menuItem.title }, { children: renderMenuItems(menuItem.children) }), menuItem.key));
}
return ((0, jsx_runtime_1.jsx)(antd_1.Menu.Item, tslib_1.__assign({ onClick: function (e) {
gotoArticleUpsert(e.key);
} }, { children: menuItem.label }), menuItem.key));
});
};
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ title: "\u5E2E\u52A9\u6587\u6863" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.article }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.menu }, { children: (0, jsx_runtime_1.jsx)(antd_1.Menu
// onClick={(e) => gotoArticleUpsert(e.keyPath[1])}
, tslib_1.__assign({
// onClick={(e) => gotoArticleUpsert(e.keyPath[1])}
style: { width: 256 }, mode: "inline" }, { children: renderMenuItems(treeData) })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.editor }, { children: (id === null || id === void 0 ? void 0 : id.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.rightContainer }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 16 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 20 } }, { children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t("articleMenu:attr.name"), name: "name" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "".concat(name) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5206\u7AD9LOGO", name: "extraFile$entity" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: logo ? (0, jsx_runtime_1.jsx)(antd_1.Image, { src: logo, width: 100, height: 100 }) : '' }) }))] }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
gotoEdit(id);
} }, { children: "\u7F16\u8F91" })), !isArticle && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
gotoEditByParentId(id);
} }, { children: "\u6DFB\u52A0\u5B50\u8282\u70B9" }))), (!isArticle && !isChildren) && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
gotoArticleEditByArticleMenuId(id);
} }, { children: "\u6DFB\u52A0\u6587\u7AE0" }))), (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "link", onClick: function () {
var modal = confirm({
title: "确定删除该文章分类吗?",
content: "删除后不可恢复",
okText: "确定",
cancelText: "取消",
onOk: function (e) {
onRemoveArticleMenu(id);
modal.destroy();
},
});
} }, { children: "\u5220\u9664" }))] }) }))] })) })) }) }))) : (articleId === null || articleId === void 0 ? void 0 : articleId.length) > 0 ? ((0, jsx_runtime_1.jsx)(detail2_1.default, { oakAutoUnmount: true, content: content, articleId: articleId, oakPath: "$article-detail-".concat(articleId) })) : ("") }))] })) })) })));
}
exports.default = render;

View File

@ -1,5 +0,0 @@
/// <reference types="wechat-miniprogram" />
/// <reference types="react" />
import { EntityDict } from '../../../general-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "article", false, WechatMiniprogram.Component.DataOption>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
export default _default;

View File

@ -1,197 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var uuid_1 = require("oak-domain/lib/utils/uuid");
exports.default = OakComponent({
entity: 'article',
projection: {
id: 1,
name: 1,
content: 1,
articleMenu: {
id: 1,
},
entity: 1,
entityId: 1,
},
isList: false,
formData: function (_a) {
var article = _a.data, features = _a.features;
console.log(article);
return {
id: article === null || article === void 0 ? void 0 : article.id,
content: article === null || article === void 0 ? void 0 : article.content,
name: article === null || article === void 0 ? void 0 : article.name,
entity: article === null || article === void 0 ? void 0 : article.entity,
entityId: article === null || article === void 0 ? void 0 : article.entityId,
};
},
data: {
editor: null,
html: '',
origin1: 'qiniu',
contentTip: false,
},
listeners: {
'editor,content': function (prev, next) {
if (next.editor && next.content) {
next.editor.setHtml(next.content);
}
},
},
lifetimes: {
ready: function () {
var _a, _b;
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _c, oakId, articleMenuId, entity, article, _d, articleMenu;
return tslib_1.__generator(this, function (_e) {
switch (_e.label) {
case 0:
_c = this.props, oakId = _c.oakId, articleMenuId = _c.articleMenuId, entity = _c.entity;
if (!oakId) return [3 /*break*/, 2];
return [4 /*yield*/, this.features.cache.refresh('article', {
data: {
id: 1,
name: 1,
content: 1,
articleMenu: {
id: 1,
name: 1,
},
entity: 1,
entityId: 1,
},
filter: {
id: oakId
},
})];
case 1:
article = (_e.sent()).data;
return [3 /*break*/, 4];
case 2: return [4 /*yield*/, this.features.cache.refresh('articleMenu', {
data: {
id: 1,
name: 1,
isArticle: 1,
isLeaf: 1,
},
filter: {
id: articleMenuId,
},
})];
case 3:
_d = tslib_1.__read.apply(void 0, [(_e.sent()).data, 1]), articleMenu = _d[0];
if (articleMenuId && !articleMenu.isArticle) {
this.update({
entity: 'platformProvider',
entityId: (_b = (_a = this.features.application.getApplication()) === null || _a === void 0 ? void 0 : _a.system.platform) === null || _b === void 0 ? void 0 : _b.entityId,
articleMenuId: articleMenuId,
});
}
_e.label = 4;
case 4: return [2 /*return*/];
}
});
});
},
detached: function () {
var editor = this.state.editor;
if (editor == null)
return;
editor.destroy();
this.setEditor(null);
},
},
methods: {
onRemoveArticle: function (id) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
console.log(id);
this.removeItem(id);
return [4 /*yield*/, this.execute()];
case 1:
_a.sent();
this.navigateBack();
return [2 /*return*/];
}
});
});
},
addExtraFile: function (extraFile) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var result;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.features.cache.operate('extraFile', {
action: 'create',
data: extraFile,
id: (0, uuid_1.generateNewId)(),
})];
case 1:
result = _a.sent();
return [2 /*return*/, result];
}
});
});
},
uploadFile: function (extraFile) {
return this.features.extraFile.upload(extraFile);
},
setEditor: function (editor) {
this.setState({
editor: editor,
});
},
clearContentTip: function () {
this.setState({
contentTip: false,
});
},
check: function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (!(this.state.name && this.state.name.length > 0)) return [3 /*break*/, 2];
return [4 /*yield*/, this.execute()];
case 1:
_a.sent();
this.navigateBack();
return [3 /*break*/, 3];
case 2:
this.setMessage({
content: '请填写文章标题!',
type: 'warning',
});
_a.label = 3;
case 3: return [2 /*return*/];
}
});
});
},
reset: function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
// 重置
this.clean();
return [2 /*return*/];
});
});
},
setHtml: function (content) {
this.update({ content: content });
this.setState({ html: content });
},
preview: function () {
var html = this.state.html;
this.save('article_html', JSON.stringify({
content: html,
// author,
// title,
}));
window.open('/article2/preview');
},
},
});

View File

@ -1,28 +0,0 @@
import '@wangeditor/editor/dist/css/style.css';
import { EntityDict } from './../../../general-app-domain';
import { WebComponentProps } from 'oak-frontend-base';
export default function Render(props: WebComponentProps<EntityDict, 'article', false, {
id: string;
name: string;
editor: any;
abstract?: string;
content?: string;
html?: string;
origin?: string;
contentTip: boolean;
origin1: string;
entity: string;
entityId: string;
}, {
setHtml: (content: string) => void;
setEditor: (editor: any) => void;
check: () => void;
preview: () => void;
addExtraFile: (file: EntityDict['extraFile']['CreateSingle']['data']) => Promise<void>;
uploadFile: (file: EntityDict['extraFile']['CreateSingle']['data']) => Promise<{
bucket: string;
url: string;
}>;
clearContentTip: () => void;
onRemoveArticle: (id: string) => void;
}>): import("react/jsx-runtime").JSX.Element;

View File

@ -1,151 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var jsx_runtime_1 = require("react/jsx-runtime");
var uuid_1 = require("oak-domain/lib/utils/uuid");
var antd_1 = require("antd");
var confirm = antd_1.Modal.confirm;
require("@wangeditor/editor/dist/css/style.css"); // 引入 css
var editor_for_react_1 = require("@wangeditor/editor-for-react");
var web_module_less_1 = tslib_1.__importDefault(require("./web.module.less"));
var useFeatures_1 = tslib_1.__importDefault(require("../../../hooks/useFeatures"));
// 工具栏配置
var toolbarConfig = {
excludeKeys: ['fullScreen'],
}; // TS 语法
// 自定义校验图片
function customCheckImageFn(src, alt, url) {
// TS 语法
if (!src) {
return;
}
if (src.indexOf('http') !== 0) {
return '图片网址必须以 http/https 开头';
}
return true;
// 返回值有三种选择:
// 1. 返回 true ,说明检查通过,编辑器将正常插入图片
// 2. 返回一个字符串,说明检查未通过,编辑器会阻止插入。会 alert 出错误信息(即返回的字符串)
// 3. 返回 undefined即没有任何返回说明检查未通过编辑器会阻止插入。但不会提示任何信息
}
function Render(props) {
var method = props.methods, data = props.data;
var t = method.t, setEditor = method.setEditor, check = method.check, preview = method.preview, addExtraFile = method.addExtraFile, uploadFile = method.uploadFile, update = method.update, setHtml = method.setHtml, onRemoveArticle = method.onRemoveArticle;
var id = data.id, content = data.content, editor = data.editor, origin1 = data.origin1, oakFullpath = data.oakFullpath, entity = data.entity, entityId = data.entityId;
var features = (0, useFeatures_1.default)();
return ((0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.container }, { children: [(0, jsx_runtime_1.jsx)(antd_1.Affix, tslib_1.__assign({ offsetTop: 64 }, { children: (0, jsx_runtime_1.jsx)(editor_for_react_1.Toolbar, { editor: editor, defaultConfig: toolbarConfig, mode: "default" }) })), (0, jsx_runtime_1.jsxs)(antd_1.Row, { children: [(0, jsx_runtime_1.jsx)(antd_1.Col, { flex: 4 }), (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ flex: 16 }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.content }, { children: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.editorContainer }, { children: [(0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.titleContainer }, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { onChange: function (e) {
return update({ name: e.target.value });
}, value: data.name, placeholder: '请输入文章标题', size: "large", maxLength: 64, suffix: "".concat(tslib_1.__spreadArray([], tslib_1.__read((data.name || '')), false).length, "/64"), className: web_module_less_1.default.titleInput }) })), data.contentTip && ((0, jsx_runtime_1.jsx)(antd_1.Alert, { type: "info", message: t('tips.content'), closable: true, onClose: function () { return method.clearContentTip(); } })), (0, jsx_runtime_1.jsx)(editor_for_react_1.Editor, { defaultConfig: {
placeholder: '请输入文章内容...',
MENU_CONF: {
checkImage: customCheckImageFn,
uploadImage: {
// 自定义上传
customUpload: function (file, insertFn) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var name, size, type, extension, filename, extraFile, _a, url, bucket, err_1;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
name = file.name, size = file.size, type = file.type;
extension = name.substring(name.lastIndexOf('.') +
1);
filename = name.substring(0, name.lastIndexOf('.'));
extraFile = {
entity: entity,
entityId: entityId,
extra1: file,
origin: origin1,
type: 'image',
tag1: 'source',
objectId: (0, uuid_1.generateNewId)(),
filename: filename,
size: size,
extension: extension,
bucket: '',
id: (0, uuid_1.generateNewId)(),
};
_b.label = 1;
case 1:
_b.trys.push([1, 4, , 5]);
return [4 /*yield*/, features.extraFile.upload(extraFile)];
case 2:
_a = _b.sent(), url = _a.url, bucket = _a.bucket;
extraFile.bucket = bucket;
extraFile.extra1 = null;
return [4 /*yield*/, addExtraFile(extraFile)];
case 3:
_b.sent();
// 最后插入图片
insertFn('http://' + url, extraFile.filename);
return [3 /*break*/, 5];
case 4:
err_1 = _b.sent();
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
});
});
},
},
uploadVideo: {
// 自定义上传
customUpload: function (file, insertFn) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var name, size, type, extension, filename, extraFile, _a, url, bucket, err_2;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
name = file.name, size = file.size, type = file.type;
extension = name.substring(name.lastIndexOf('.') +
1);
filename = name.substring(0, name.lastIndexOf('.'));
extraFile = {
entity: entity,
entityId: entityId,
extra1: file,
origin: origin1,
type: 'video',
tag1: 'source',
objectId: (0, uuid_1.generateNewId)(),
filename: filename,
size: size,
extension: extension,
bucket: '',
id: (0, uuid_1.generateNewId)(),
};
_b.label = 1;
case 1:
_b.trys.push([1, 4, , 5]);
return [4 /*yield*/, features.extraFile.upload(extraFile)];
case 2:
_a = _b.sent(), url = _a.url, bucket = _a.bucket;
extraFile.bucket = bucket;
extraFile.extra1 = null;
return [4 /*yield*/, addExtraFile(extraFile)];
case 3:
_b.sent();
// 最后插入图片
insertFn('http://' + url, 'http://' +
url +
'?vframe/jpg/offset/0');
return [3 /*break*/, 5];
case 4:
err_2 = _b.sent();
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
});
});
},
},
},
}, value: content, onCreated: setEditor, onChange: function (editorDom) {
setHtml(editorDom.getHtml());
}, style: {
minHeight: 440
}, mode: "default" }), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.footer }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, tslib_1.__assign({ align: "middle" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ flex: "none" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
check();
} }, { children: "\u4FDD\u5B58" })) }) })) })) }))] })) })) })), (0, jsx_runtime_1.jsx)(antd_1.Col, { flex: 4 })] })] })));
}
exports.default = Render;

View File

@ -41,7 +41,7 @@ function render(props) {
// onClick={(e) => gotoArticleUpsert(e.keyPath[1])}
, tslib_1.__assign({
// onClick={(e) => gotoArticleUpsert(e.keyPath[1])}
style: { width: 256 }, mode: "inline" }, { children: renderMenuItems(treeData) })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.editor }, { children: (id === null || id === void 0 ? void 0 : id.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.rightContainer }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 16 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 20 } }, { children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: '分类标题', name: "name" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "".concat(name) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5206\u7C7BLOGO", name: "extraFile$entity" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: logo ? ((0, jsx_runtime_1.jsx)(antd_1.Image, { src: logo, width: 100, height: 100 })) : ("暂无图片") }) }))] }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
style: { width: 256 }, mode: "inline" }, { children: renderMenuItems(treeData) })) })), (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.editor }, { children: (id === null || id === void 0 ? void 0 : id.length) > 0 ? ((0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: web_module_less_1.default.rightContainer }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 16 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 20 } }, { children: [(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: '分类标题', name: "name" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "".concat(name) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "LOGO", name: "extraFile$entity" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: logo ? ((0, jsx_runtime_1.jsx)(antd_1.Image, { src: logo, width: 100, height: 100 })) : ("暂无图片") }) }))] }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
gotoEdit(id);
} }, { children: "\u7F16\u8F91" })), !isArticle && ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ onClick: function () {
gotoEditByParentId(id);

View File

@ -0,0 +1,41 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
.article {
display: flex;
flex-direction: row;
.menu {
display: flex;
}
.editor {
display: flex;
margin-left: 20px;
.rightContainer {
width: 950px;
}
}
}
}
.space {
margin-bottom: 15px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.tree {
:global {
.ant-tree-title {
display: flex;
flex: 1;
}
}
}

View File

@ -12,27 +12,27 @@ function render(props) {
var data = props.data, methods = props.methods;
var t = methods.t, update = methods.update, reset = methods.reset, confirm = methods.confirm;
var name = data.name, parentId = data.parentId, parentName = data.parentName, oakFullpath = data.oakFullpath;
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u6DFB\u52A0\u6587\u7AE0\u5206\u7C7B" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: (0, classnames_1.default)(common_module_less_1.default.pageWithPadding, common_module_less_1.default.pageWithColor) }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 16 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 20 } }, { children: [parentId ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t("articleMenu:attr.parent"), name: "parent" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tooltip, { children: parentName }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t("articleMenu:attr.name"), name: "name", rules: [
return ((0, jsx_runtime_1.jsx)(pageHeader_1.default, tslib_1.__assign({ showBack: true, title: "\u6DFB\u52A0\u6587\u7AE0\u5206\u7C7B" }, { children: (0, jsx_runtime_1.jsx)("div", tslib_1.__assign({ className: (0, classnames_1.default)(common_module_less_1.default.pageWithPadding, common_module_less_1.default.pageWithColor) }, { children: (0, jsx_runtime_1.jsx)(antd_1.Row, { children: (0, jsx_runtime_1.jsx)(antd_1.Col, tslib_1.__assign({ xs: 24, sm: 16 }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Form, tslib_1.__assign({ colon: true, labelCol: { span: 4 }, wrapperCol: { span: 20 } }, { children: [parentId ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t("articleMenu:attr.parent"), name: "parent" }, { children: (0, jsx_runtime_1.jsx)(antd_1.Tooltip, { children: parentName }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "分类名称", name: "name", rules: [
{
required: true,
message: "文章分类名称必填",
message: "分类名称必填",
},
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165\u6587\u7AE0\u5206\u7C7B\u540D\u79F0", onChange: function (e) {
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0", onChange: function (e) {
update({
name: e.target.value,
});
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5206\u7C7BLOGO", name: "extraFile$entity", help: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.help }, { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8BF7\u4E0A\u4F20\u5206\u7C7BLOGO\u9AD8\u6E05\u56FE\u7247\uFF0C" }), (0, jsx_runtime_1.jsx)("span", { children: "108*108\u50CF\u7D20\uFF0C\u4EC5\u652F\u6301PNG\u3001JPG\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7300KB\u3002" })] })) }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(gallery_1.default, { oakPath: oakFullpath
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "LOGO", name: "extraFile$entity", help: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.help }, { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8BF7\u4E0A\u4F20LOGO\u9AD8\u6E05\u56FE\u7247\uFF0C" }), (0, jsx_runtime_1.jsx)("span", { children: "108*108\u50CF\u7D20\uFF0C\u4EC5\u652F\u6301PNG\u3001JPG\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7300KB\u3002" })] })) }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(gallery_1.default, { oakPath: oakFullpath
? "".concat(oakFullpath, ".extraFile$entity$1")
: undefined, type: "image", origin: "qiniu", tag1: "logo", entity: "articleMenu", accept: ".PNG, .JPG", maxNumber: 1 }) }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: t("articleMenu:attr.name"), name: "name", rules: [
: undefined, type: "image", origin: "qiniu", tag1: "logo", entity: "articleMenu", accept: ".PNG, .JPG", maxNumber: 1 }) }) }))] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "分类名称", name: "name", rules: [
{
required: true,
message: "文章分类名称必填",
message: "分类名称必填",
},
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165\u6587\u7AE0\u5206\u7C7B\u540D\u79F0", onChange: function (e) {
] }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(antd_1.Input, { placeholder: "\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0", onChange: function (e) {
update({
name: e.target.value,
});
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5206\u7C7BLOGO", name: "extraFile$entity", help: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.help }, { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8BF7\u4E0A\u4F20\u5206\u7C7BLOGO\u9AD8\u6E05\u56FE\u7247\uFF0C" }), (0, jsx_runtime_1.jsx)("span", { children: "108*108\u50CF\u7D20\uFF0C\u4EC5\u652F\u6301PNG\u3001JPG\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7300KB\u3002" })] })) }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(gallery_1.default, { oakPath: oakFullpath
}, value: name }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "LOGO", name: "extraFile$entity", help: (0, jsx_runtime_1.jsxs)("div", tslib_1.__assign({ className: web_module_less_1.default.help }, { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u8BF7\u4E0A\u4F20LOGO\u9AD8\u6E05\u56FE\u7247\uFF0C" }), (0, jsx_runtime_1.jsx)("span", { children: "108*108\u50CF\u7D20\uFF0C\u4EC5\u652F\u6301PNG\u3001JPG\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8D85\u8FC7300KB\u3002" })] })) }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(gallery_1.default, { oakPath: oakFullpath
? "".concat(oakFullpath, ".extraFile$entity$1")
: undefined, type: "image", origin: "qiniu", tag1: "logo", entity: "articleMenu", accept: ".PNG, .JPG", maxNumber: 1 }) }) }))] })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: { offset: 4 } }, { children: (0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ type: "primary", onClick: function () {
confirm();

View File

@ -0,0 +1,12 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}
.help {
display: flex;
flex-direction: column;
margin-bottom: 24px;
}

View File

@ -5,10 +5,10 @@ exports.default = OakComponent({
entity: 'article',
projection: {
id: 1,
iState: 1,
title: 1,
author: 1,
abstract: 1,
// iState: 1,
// title: 1,
// author: 1,
// abstract: 1,
content: 1,
entity: 1,
entityId: 1,
@ -20,10 +20,10 @@ exports.default = OakComponent({
return tslib_1.__generator(this, function (_b) {
return [2 /*return*/, {
id: article === null || article === void 0 ? void 0 : article.id,
iState: article === null || article === void 0 ? void 0 : article.iState,
title: article === null || article === void 0 ? void 0 : article.title,
abstract: article === null || article === void 0 ? void 0 : article.abstract,
author: article === null || article === void 0 ? void 0 : article.author,
// iState: article?.iState,
// title: article?.title,
// abstract: article?.abstract,
// author: article?.author,
content: article === null || article === void 0 ? void 0 : article.content,
}];
});

View File

@ -15,7 +15,6 @@ exports.default = OakComponent({
},
isList: true,
formData: function (_a) {
var _b;
var articles = _a.data, features = _a.features;
var filter = this.getFilterByName('title');
var pagination = this.getPagination();
@ -23,17 +22,17 @@ exports.default = OakComponent({
articles: articles === null || articles === void 0 ? void 0 : articles.map(function (article, index) {
return {
id: article === null || article === void 0 ? void 0 : article.id,
iState: article === null || article === void 0 ? void 0 : article.iState,
title: article === null || article === void 0 ? void 0 : article.title,
abstract: article === null || article === void 0 ? void 0 : article.abstract,
author: article === null || article === void 0 ? void 0 : article.author,
// iState: article?.iState,
// title: article?.title,
// abstract: article?.abstract,
// author: article?.author,
content: article === null || article === void 0 ? void 0 : article.content,
entity: article === null || article === void 0 ? void 0 : article.entity,
entityId: article === null || article === void 0 ? void 0 : article.entityId,
};
}),
pagination: pagination,
searchValue: (_b = filter === null || filter === void 0 ? void 0 : filter.title) === null || _b === void 0 ? void 0 : _b.$includes,
// searchValue: (filter?.title as { $includes: string })?.$includes,
};
},
filters: [
@ -104,14 +103,6 @@ exports.default = OakComponent({
searchValueChange: function (value) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
this.addNamedFilter({
filter: {
title: {
$includes: value,
},
},
'#name': 'title',
});
return [2 /*return*/];
});
});

View File

@ -0,0 +1,6 @@
.container {
background: var(--oak-bg-color-container);
box-shadow: 0 2px 3px #0000001a;
border-radius: 3px;
padding: 30px 32px;
}

View File

@ -0,0 +1,42 @@
.container {
background-color: var(--oak-bg-color-page);
padding: 30px 32px;
height: 100%;
}
.content {
background-color: var(--oak-bg-color-page);
width: 100%
}
.editorContainer {
// width: 100%;
margin: 30px auto 50px auto;
background: var(--oak-bg-color-container);
padding: 20px 50px 50px 50px;
box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}
.titleContainer {
padding: 5px 0 10px 0;
}
.authorContainer {
padding: 5px 0 10px 0;
}
.title {
font-size: 18px !important;
font-weight: bold !important;
}
.author {
color: var(--oak-text-color-brand);
font-size: 14px;
}
.abstract {
width: 100%;
border-top: 1px solid #e8e8e8;
}

View File

@ -6,10 +6,10 @@ exports.default = OakComponent({
entity: 'article',
projection: {
id: 1,
iState: 1,
title: 1,
author: 1,
abstract: 1,
// iState: 1,
// title: 1,
// author: 1,
// abstract: 1,
content: 1,
entity: 1,
entityId: 1,
@ -19,10 +19,10 @@ exports.default = OakComponent({
var article = _a.data, features = _a.features;
return {
id: article === null || article === void 0 ? void 0 : article.id,
iState: article === null || article === void 0 ? void 0 : article.iState,
title: article === null || article === void 0 ? void 0 : article.title,
abstract: article === null || article === void 0 ? void 0 : article.abstract,
author: article === null || article === void 0 ? void 0 : article.author,
// iState: article?.iState,
// title: article?.title,
// abstract: article?.abstract,
// author: article?.author,
content: article === null || article === void 0 ? void 0 : article.content,
};
},
@ -134,11 +134,12 @@ exports.default = OakComponent({
this.setState({ html: content });
},
preview: function () {
var _a = this.state, html = _a.html, title = _a.title, author = _a.author;
// const { html, title, author } = this.state;
var html = this.state.html;
this.save('article_html', JSON.stringify({
content: html,
author: author,
title: title,
// author,
// title,
}));
window.open('/article/preview');
},

View File

@ -0,0 +1,73 @@
.container {
background-color: var(--oak-bg-color-page);
// padding: 30px 32px;
}
.content {
background-color: var(--oak-bg-color-page);
// height: calc(100% - 40px);
//overflow-y: auto;
position: relative;
}
.editorContainer {
width: 850px;
margin: 30px auto 50px auto;
background: var(--oak-bg-color-container);
padding: 20px 50px 50px 50px;
box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}
.titleContainer {
padding: 5px 0;
border-bottom: 1px solid #e8e8e8;
}
.authorContainer {
padding: 5px 0;
//border-bottom: 1px solid #e8e8e8;
}
.input {
border: unset !important;
box-shadow: none !important;
}
.titleInput {
border: unset !important;
box-shadow: none !important;
font-size: 18px !important;
font-weight: bold !important;
}
.input:hover {
border: unset !important;
}
.abstract {
width: 100%;
border-top: 1px solid #e8e8e8;
}
.card {
:global {
.ant-card-head {
border: none;
}
}
}
.footer {
// position: absolute;
bottom: 0;
height: 50px;
}
.contentNumber {
display: flex;
min-height: 32px;
flex-direction: column;
justify-content: center;
color: var(--oak-text-color-secondary);
}

View File

@ -1,6 +1,7 @@
import React from 'react';
import { Button } from 'antd';
// @ts-ignore
import { useNavigate } from 'react-router-dom';
import { ReactComponent as Light403Icon } from './assets/svg/assets-result-403.svg';

View File

@ -1,4 +1,5 @@
import React, { memo } from 'react';
// @ts-ignore
import { useNavigate } from 'react-router-dom';
import { Row, Col, Button } from 'antd';
import { ArrowLeftOutlined } from '@ant-design/icons';

View File

@ -204,7 +204,7 @@ export default function render(
>
<>{`${name}`}</>
</Form.Item>
<Form.Item label="分类LOGO" name="extraFile$entity">
<Form.Item label="LOGO" name="extraFile$entity">
<>
{logo ? (
<Image src={logo} width={100} height={100} />
@ -234,7 +234,7 @@ export default function render(
</Button>
)}
{!isArticle && (
{!isArticle && !isChildren && (
<Button
onClick={() => {
gotoArticleEditByArticleMenuId(id);

View File

@ -45,18 +45,18 @@ export default function render(
<Tooltip>{parentName}</Tooltip>
</Form.Item>
<Form.Item
label={t("articleMenu:attr.name")}
label={"分类名称"}
name="name"
rules={[
{
required: true,
message: "文章分类名称必填",
message: "分类名称必填",
},
]}
>
<>
<Input
placeholder="请输入文章分类名称"
placeholder="请输入分类名称"
onChange={(e) => {
update({
name: e.target.value,
@ -67,11 +67,11 @@ export default function render(
</>
</Form.Item>
<Form.Item
label="分类LOGO"
label="LOGO"
name="extraFile$entity"
help={
<div className={Style.help}>
<span>LOGO高清图片</span>
<span>LOGO高清图片</span>
<span>
108*108PNGJPG格式300KB
</span>
@ -98,18 +98,18 @@ export default function render(
) : (
<>
<Form.Item
label={t("articleMenu:attr.name")}
label={"分类名称"}
name="name"
rules={[
{
required: true,
message: "文章分类名称必填",
message: "分类名称必填",
},
]}
>
<>
<Input
placeholder="请输入文章分类名称"
placeholder="请输入分类名称"
onChange={(e) => {
update({
name: e.target.value,
@ -120,11 +120,11 @@ export default function render(
</>
</Form.Item>
<Form.Item
label="分类LOGO"
label="LOGO"
name="extraFile$entity"
help={
<div className={Style.help}>
<span>LOGO高清图片</span>
<span>LOGO高清图片</span>
<span>
108*108PNGJPG格式300KB
</span>

View File

@ -4,10 +4,10 @@ export default OakComponent({
entity: 'article',
projection: {
id: 1,
iState: 1,
title: 1,
author: 1,
abstract: 1,
// iState: 1,
// title: 1,
// author: 1,
// abstract: 1,
content: 1,
entity: 1,
entityId: 1,
@ -16,10 +16,10 @@ export default OakComponent({
formData: async function ({ data: article, features }) {
return {
id: article?.id,
iState: article?.iState,
title: article?.title,
abstract: article?.abstract,
author: article?.author,
// iState: article?.iState,
// title: article?.title,
// abstract: article?.abstract,
// author: article?.author,
content: article?.content,
};
},

View File

@ -20,17 +20,17 @@ export default OakComponent({
articles: articles?.map((article, index: number) => {
return {
id: article?.id,
iState: article?.iState,
title: article?.title,
abstract: article?.abstract,
author: article?.author,
// iState: article?.iState,
// title: article?.title,
// abstract: article?.abstract,
// author: article?.author,
content: article?.content,
entity: article?.entity,
entityId: article?.entityId,
};
}),
pagination,
searchValue: (filter?.title as { $includes: string })?.$includes,
// searchValue: (filter?.title as { $includes: string })?.$includes,
};
},
filters: [
@ -82,14 +82,14 @@ export default OakComponent({
this.searchValueChange(value);
},
async searchValueChange(value: string) {
this.addNamedFilter({
filter: {
title: {
$includes: value!,
},
},
'#name': 'title',
});
// this.addNamedFilter({
// filter: {
// title: {
// $includes: value!,
// },
// },
// '#name': 'title',
// });
},
async searchCancel() {
this.removeNamedFilterByName('title');