egg-born-module-a-base-sync
Advanced tools
Comparing version 4.8.29 to 4.8.30
@@ -48,2 +48,15 @@ const require3 = require('require3'); | ||
} | ||
// atomCategoryId | ||
if (item.atomCategoryId && typeof item.atomCategoryId === 'string') { | ||
const category = await this.ctx.bean.category.parseCategoryName({ | ||
atomClass, | ||
language: item.atomLanguage, | ||
categoryName: item.atomCategoryId, | ||
force: false, // not force, because this api maybe called by normal user | ||
}); | ||
if (!category) { | ||
throw new Error(`Category not found: ${item.atomCategoryId}`); | ||
} | ||
item.atomCategoryId = category.id; | ||
} | ||
// add | ||
@@ -50,0 +63,0 @@ const atomId = await this.ctx.bean.atom._add({ atomClass, atom: item, user }); |
@@ -42,3 +42,2 @@ module.exports = app => { | ||
layoutBulk: 45, | ||
draftStatsBulk: 46, | ||
@@ -51,2 +50,7 @@ save: 51, | ||
workflow: 56, | ||
// | ||
draftStatsBulk: 71, | ||
readBulk: 72, | ||
custom: 100, // custom action start from custom | ||
@@ -184,3 +188,12 @@ }, | ||
icon: { f7: ':outline:draft-outline' }, | ||
authorize: false, | ||
}, | ||
readBulk: { | ||
title: 'List', | ||
actionModule: moduleInfo.relativeName, | ||
actionComponent: 'actionBulk', | ||
bulk: true, | ||
icon: { f7: '::visibility' }, | ||
authorize: false, | ||
}, | ||
save: { | ||
@@ -187,0 +200,0 @@ title: 'Save', |
@@ -107,4 +107,16 @@ module.exports = app => { | ||
} | ||
async parseCategoryName() { | ||
const atomClass = this.ctx.request.body.atomClass; | ||
const category = await this.ctx.service.category.parseCategoryName({ | ||
atomClass, | ||
language: this.ctx.request.body.language, | ||
categoryName: this.ctx.request.body.categoryName, | ||
categoryIdParent: this.ctx.request.body.categoryIdParent, | ||
force: false, | ||
}); | ||
this.ctx.success(category); | ||
} | ||
} | ||
return CategoryController; | ||
}; |
@@ -280,2 +280,3 @@ module.exports = app => { | ||
{ method: 'post', path: 'category/relativeTop', controller: 'category' }, // not set function right | ||
{ method: 'post', path: 'category/parseCategoryName', controller: 'category' }, // not set function right | ||
// tag | ||
@@ -282,0 +283,0 @@ { method: 'post', path: 'tag/list', controller: 'tag' }, |
@@ -64,2 +64,12 @@ module.exports = app => { | ||
} | ||
async parseCategoryName({ atomClass, language, categoryName, categoryIdParent, force }) { | ||
return await this.ctx.bean.category.parseCategoryName({ | ||
atomClass, | ||
language, | ||
categoryName, | ||
categoryIdParent, | ||
force, | ||
}); | ||
} | ||
} | ||
@@ -66,0 +76,0 @@ |
@@ -28,3 +28,3 @@ export default { | ||
let action; | ||
let item; | ||
let item = resourceConfig.actionItem; | ||
if (resourceConfig.atomAction === 'create') { | ||
@@ -37,15 +37,20 @@ // | ||
}); | ||
item = { | ||
item = Object.assign({}, item, { | ||
module: resourceConfig.module, | ||
atomClassName: resourceConfig.atomClassName, | ||
}; | ||
}); | ||
} else if (resourceConfig.atomAction === 'read') { | ||
if (!resourceConfig.actionComponent && !resourceConfig.actionPath) { | ||
resourceConfig.actionPath = '/a/basefront/atom/list?module={{module}}&atomClassName={{atomClassName}}'; | ||
action = this.getAction({ | ||
module: resourceConfig.module, | ||
atomClassName: resourceConfig.atomClassName, | ||
name: 'readBulk', | ||
}); | ||
} else { | ||
action = resourceConfig; | ||
} | ||
action = resourceConfig; | ||
item = { | ||
item = Object.assign({}, item, { | ||
module: resourceConfig.module, | ||
atomClassName: resourceConfig.atomClassName, | ||
}; | ||
}); | ||
} else { | ||
@@ -52,0 +57,0 @@ action = resourceConfig; |
@@ -7,2 +7,3 @@ import ActionBase from '../../common/actionBase.js'; | ||
import ActionBulkDraftStats from './actionBulk/actionBulkDraftStats.js'; | ||
import ActionBulkRead from './actionBulk/actionBulkRead.js'; | ||
@@ -20,2 +21,3 @@ export default { | ||
ActionBulkDraftStats, | ||
ActionBulkRead, | ||
], | ||
@@ -34,2 +36,4 @@ methods: { | ||
return await this._onActionBulkDraftStats(); | ||
} else if (this.action.name === 'readBulk') { | ||
return await this._onActionBulkRead(); | ||
} | ||
@@ -36,0 +40,0 @@ }, |
{ | ||
"name": "egg-born-module-a-base-sync", | ||
"version": "4.8.29", | ||
"version": "4.8.30", | ||
"title": "Base", | ||
@@ -5,0 +5,0 @@ "eggBornModule": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3630591
406
59903
6