How to use the @choerodon/master.store function in @choerodon/master

To help you get started, we’ve selected a few @choerodon/master examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github choerodon / test-manager-service / react / store / ExecuteDetailStore.js View on Github external
import {
  observable, action, computed, toJS,
} from 'mobx';
import { store } from '@choerodon/master';
import _ from 'lodash';
import { getParams } from '../common/utils';
import {
  getCycle, getCycleDetails, getCycleHistiorys,
} from '../api/ExecuteDetailApi';
import { getStatusList } from '../api/TestStatusApi';
import { getUsers } from '../api/IamApi';
import { getIssueList, getIssuesForDefects } from '../api/agileApi';

@store('ExecuteDetailStore')
class ExecuteDetailStore {
  @observable id = null;

  @observable issueList = [];

  @observable loading = false;

  @observable selectLoading = false;

  @observable ExecuteDetailSideVisible = true;

  @observable userList = [];

  // 用户列表
  @observable statusList = [];
github choerodon / manager-service / react / src / app / iam / stores / global / instance / InstanceStore.js View on Github external
/**
 * Created by hulingfangzi on 2018/6/20.
 */
import { action, computed, observable } from 'mobx';
import { axios, store, stores } from '@choerodon/master';

@store('InstanceStore')
class InstanceStore {
  @observable service = [];
  @observable currentService = { name: 'total' };
  @observable loading = true;
  @observable instanceData = [];
  @observable instanceDetail = null;

  @action setLoading(flag) {
    this.loading = flag;
  }

  @action setCurrentService(data) {
    this.currentService = data;
  }

  @computed get getCurrentService() {
github choerodon / devops-service / react / routes / code-manager / stores / DevPipelineStore.js View on Github external
* @param collection 所有数据
 * @param value 当前数据项
 * @param number 显示最近使用的条数
 * @returns {*[]}
 */
function saveRecent(collection = [], value, number) {
  const index = findDataIndex(collection, value);
  if (index !== -1) {
    return collection.splice(index, 1).concat(collection.slice());
  } else {
    collection.unshift(value);
    return collection.slice(0, number);
  }
}

@store('DevPipelineStore')
class DevPipelineStore {
  @observable appData = [];

  @observable selectedApp = null;

  @observable defaultAppName = null;

  @observable recentApp = null;

  @observable preProId = AppState.currentMenuType.id;

  @observable loading = false;

  @observable selectAppData = {};

  @computed get getSelectAppData() {
github choerodon / devops-service / react / routes / environment / main-view / contents / detail / modals / resource-setting / store / NotificationsStore.js View on Github external
/**
 * @author ale0720@163.com
 * @date 2019-05-13 14:46
 */
import { observable, action, computed } from 'mobx';
import { axios, store } from '@choerodon/master';
import { handlePromptError } from '../../../../../../../../utils/index';
import { HEIGHT, SORTER_MAP } from '../Constants';


@store('NotificationsStore')
class NotificationsStore {
  @observable listData = [];

  @observable loading = false;

  @observable pageInfo = {
    current: 1,
    total: 0,
    pageSize: 10,
  };

  @observable users = [];

  @observable singleData = {};

  @observable disabledEvent = [];

@choerodon/master

A package of Master for Choerodon platform.

ISC
Latest version published 2 years ago

Package Health Score

43 / 100
Full package analysis