109 lines
3.6 KiB
JavaScript
109 lines
3.6 KiB
JavaScript
"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,
|
|
},
|
|
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,
|
|
},
|
|
filter: {
|
|
tag1: {
|
|
$in: ['logo'],
|
|
},
|
|
},
|
|
},
|
|
},
|
|
isList: false,
|
|
formData: function (_a) {
|
|
var _b, _c;
|
|
var articleMenu = _a.data;
|
|
return {
|
|
name: articleMenu === null || articleMenu === void 0 ? void 0 : articleMenu.name,
|
|
parentId: (_b = articleMenu === null || articleMenu === void 0 ? void 0 : articleMenu.parent) === null || _b === void 0 ? void 0 : _b.id,
|
|
parentName: (_c = articleMenu === null || articleMenu === void 0 ? void 0 : articleMenu.parent) === null || _c === void 0 ? void 0 : _c.name,
|
|
};
|
|
},
|
|
filters: [],
|
|
properties: {
|
|
entity: '',
|
|
entityId: '',
|
|
parentId: '',
|
|
},
|
|
lifetimes: {
|
|
ready: function () {
|
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
var _a, parentId, oakId, entity, entityId;
|
|
return tslib_1.__generator(this, function (_b) {
|
|
_a = this.props, parentId = _a.parentId, oakId = _a.oakId, entity = _a.entity, entityId = _a.entityId;
|
|
if (!oakId) {
|
|
if (parentId) {
|
|
this.update({
|
|
parentId: parentId,
|
|
entity: entity,
|
|
entityId: entityId,
|
|
isArticle: false,
|
|
isLeaf: false,
|
|
});
|
|
}
|
|
else {
|
|
this.update({
|
|
entity: entity,
|
|
entityId: entityId,
|
|
isArticle: false,
|
|
isLeaf: false,
|
|
});
|
|
}
|
|
}
|
|
return [2 /*return*/];
|
|
});
|
|
});
|
|
},
|
|
},
|
|
methods: {
|
|
confirm: 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();
|
|
this.navigateBack();
|
|
return [2 /*return*/];
|
|
}
|
|
});
|
|
});
|
|
},
|
|
reset: function () {
|
|
this.clean();
|
|
},
|
|
},
|
|
});
|