Browse Source

Merge pull request #58 in DEC/decision-webui-dcm from ~ALAN/decision-webui-dcm:feature/10.0 to feature/10.0

* commit 'f4d36fbcd81d356a2e48b11d7e2172c8f3be3a43':
  fix: 修改webpack
  fix: 清除无用代码
  fix: 使用loadingbar
  fix: setLoaded拿到外面去做
  fix: KERNEL-1395 数据连接列表分页显示
qufenxi
alan 5 years ago
parent
commit
d725594158
  1. 22
      src/modules/pages/connection/list/list.ts
  2. 2
      src/modules/pages/connection/list/list_item/list_item.model.ts
  3. 2
      src/ui/fineui.ts
  4. 733
      yarn.lock

22
src/modules/pages/connection/list/list.ts

@ -1,5 +1,5 @@
import { shortcut, store } from '@core/core';
import { ButtonGroup, Vertical, CenterAdapt, Label, Layout, Vtape } from 'ui';
import { CenterAdapt, Label, Layout, Vtape, Loader } from 'ui';
import { ListItemXtype } from './list_item/list_item';
import { ConnectionListModel, ConnectionListModelXtype } from './list.model';
import { Connection } from '../../../crud/crud.typings';
@ -20,13 +20,13 @@ export class ConnectionList extends BI.LoadingPane {
}
watch = {
connections() {
connections: () => {
this.groupWidget.populate(this.renderList());
},
}
render() {
if (this.model.connections.length === 0) {
if (BI.size(this.model.connections) === 0) {
return {
type: CenterAdapt,
items: [
@ -54,19 +54,17 @@ export class ConnectionList extends BI.LoadingPane {
}
return {
type: ButtonGroup,
layouts: [{
type: Vertical,
}],
items: this.renderList(),
ref: (_ref: any) => {
this.groupWidget = _ref;
type: Loader,
itemsCreator: (options: {times: number}, populate) => {
populate(this.renderList((options.times - 1) * 50, options.times * 50));
},
hasNext: options => options.times * 50 < BI.size(this.model.connections),
};
}
private renderList() {
return this.model.connections.map((item: Connection) => {
private renderList(start = 0, end = 0) {
return this.model.connections.slice(start, end).map((item: Connection) => {
return {
type: ListItemXtype,
name: item.connectionName,

2
src/modules/pages/connection/list/list_item/list_item.model.ts

@ -76,7 +76,7 @@ export class ListItemModel extends Model<{
return api.updateConnection(connection).then(re => {
if (!re.errorCode) {
this.store.setIsEdit(false, oldName);
this.setIsEdit(false, oldName);
this.model.connections = this.model.connections.map(item => {
return {
...item,

2
src/ui/fineui.ts

@ -50,7 +50,7 @@ export const Img = 'bi.img';
export const BubbleCombo = 'bi.bubble_combo';
export const TextBubblePopupBarView = 'bi.text_bubble_bar_popup_view';
export const TextValueCombo = 'bi.text_value_combo';
export const Loader = 'bi.loader';
// 布局
export const VerticalAdapt = 'bi.vertical_adapt';

733
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save