ComponentOption中增加了stale配置项
This commit is contained in:
parent
41254e9304
commit
57ebc434ba
|
|
@ -482,7 +482,7 @@ const oakBehavior = Behavior({
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
this.oakOption.lifetimes?.ready.call(this);
|
this.oakOption.lifetimes?.ready.call(this);
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath &&
|
if (oakFullpath && !this.oakOption.stale &&
|
||||||
!this.features.runningTree.checkIsModiNode(oakFullpath) &&
|
!this.features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
!this.features.runningTree.isListDescandent(oakFullpath)) {
|
!this.features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -787,7 +787,9 @@ export function createComponent(option, features) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -643,7 +643,9 @@ export function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -701,7 +703,9 @@ export function createComponent(option, features) {
|
||||||
lifetimes?.show && lifetimes.show.call(this);
|
lifetimes?.show && lifetimes.show.call(this);
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ interface ComponentOption<IsList extends boolean, ED extends EntityDict & BaseEn
|
||||||
* 是否为列表组件
|
* 是否为列表组件
|
||||||
*/
|
*/
|
||||||
isList?: IsList;
|
isList?: IsList;
|
||||||
|
stale?: boolean;
|
||||||
zombie?: true;
|
zombie?: true;
|
||||||
getTotal?: {
|
getTotal?: {
|
||||||
max: number;
|
max: number;
|
||||||
|
|
|
||||||
|
|
@ -485,7 +485,7 @@ const oakBehavior = Behavior({
|
||||||
this.oakOption.lifetimes?.ready &&
|
this.oakOption.lifetimes?.ready &&
|
||||||
this.oakOption.lifetimes?.ready.call(this);
|
this.oakOption.lifetimes?.ready.call(this);
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath &&
|
if (oakFullpath && !this.oakOption.stale &&
|
||||||
!this.features.runningTree.checkIsModiNode(oakFullpath) &&
|
!this.features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
!this.features.runningTree.isListDescandent(oakFullpath)) {
|
!this.features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
@ -790,7 +790,9 @@ function createComponent(option, features) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -648,7 +648,9 @@ function createComponent(option, features) {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -706,7 +708,9 @@ function createComponent(option, features) {
|
||||||
lifetimes?.show && lifetimes.show.call(this);
|
lifetimes?.show && lifetimes.show.call(this);
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ interface ComponentOption<IsList extends boolean, ED extends EntityDict & BaseEn
|
||||||
* 是否为列表组件
|
* 是否为列表组件
|
||||||
*/
|
*/
|
||||||
isList?: IsList;
|
isList?: IsList;
|
||||||
|
stale?: boolean;
|
||||||
zombie?: true;
|
zombie?: true;
|
||||||
getTotal?: {
|
getTotal?: {
|
||||||
max: number;
|
max: number;
|
||||||
|
|
|
||||||
|
|
@ -704,7 +704,7 @@ const oakBehavior = Behavior<
|
||||||
|
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (
|
if (
|
||||||
oakFullpath &&
|
oakFullpath && !this.oakOption.stale &&
|
||||||
!this.features.runningTree.checkIsModiNode(
|
!this.features.runningTree.checkIsModiNode(
|
||||||
oakFullpath
|
oakFullpath
|
||||||
) &&
|
) &&
|
||||||
|
|
@ -1115,7 +1115,9 @@ export function createComponent<
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
try {
|
try {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -974,7 +974,9 @@ export function createComponent<
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
await this.refresh();
|
await this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -1042,7 +1044,9 @@ export function createComponent<
|
||||||
lifetimes?.show && lifetimes.show.call(this);
|
lifetimes?.show && lifetimes.show.call(this);
|
||||||
}
|
}
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
if (oakFullpath && !features.runningTree.checkIsModiNode(oakFullpath) && !features.runningTree.isListDescandent(oakFullpath)) {
|
if (oakFullpath && !option.stale &&
|
||||||
|
!features.runningTree.checkIsModiNode(oakFullpath) &&
|
||||||
|
!features.runningTree.isListDescandent(oakFullpath)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,7 @@ interface ComponentOption<
|
||||||
* 是否为列表组件
|
* 是否为列表组件
|
||||||
*/
|
*/
|
||||||
isList?: IsList;
|
isList?: IsList;
|
||||||
|
stale?: boolean;
|
||||||
zombie?: true;
|
zombie?: true;
|
||||||
getTotal?: {
|
getTotal?: {
|
||||||
max: number;
|
max: number;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue