How to use the maka.actionMixin function in maka

To help you get started, we’ve selected a few maka 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 makajs / maka / packages / example / maka-app-store / apps / base / component / code-mirror / src / index.js View on Github external
import "codemirror/theme/material.css"
import "codemirror/lib/codemirror.css"
import './style.less'
const name = pkgJson.name



registerComponent('CodeMirror', CodeMirror)

const state = {
    data: {
    }
}

@actionMixin('base')
class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }

    onChange = (e) => {
        this.base.setState({ 'data.input': e.target.value })
        console.log(this.base.getState('data.input'))
    }
}

const view = {
    component: 'div',
    className: 'code-mirror',
    children: [{
        component: 'CodeMirror',
github makajs / maka / packages / example / maka-erp / index.js View on Github external
import pkgJson from './package.json'
import { actionMixin } from 'maka'
import './style.less'

const name = pkgJson.name

const state = {
    data: {
        content: 'hello ',
        input: ''
    }
}

@actionMixin('base')
class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }

    onChange = (e) => {
        this.base.setState({ 'data.input': e.target.value })
        console.log(this.base.getState('data.input'))
    }
}

const view = {
    component: 'div',
    className:'home-chart',
    children: [{
        component: 'Echarts',
github makajs / maka / packages / example / maka-mobile-erp / apps / my / my / src / action.js View on Github external
import { actionMixin, fetch, getAction, navigate } from 'maka'

console.log(getAction('numberHelper'))

@actionMixin('base', 'toast', 'numberHelper')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }

    signOut = () => {
        fetch.clearAccessToken()
        navigate.redirect('/sign-in')
    }

    setting = () => {
        this.toast.info('你就告诉我啥不能做吧 !!!', 1)
    }

    setperson = async () => { 
        var openPage = this.base.context.get('openPage')
github makajs / maka / packages / example / maka-erp / apps / set / customer / set-customer / action.js View on Github external
import { actionMixin, fetch } from 'maka'
import React from 'react'

@actionMixin('base', 'lodash', 'moment', 'modal', 'message')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }

    onInit = () => {
        if (this.component.props.setOkListener)
            this.component.props.setOkListener(this.onOk)
        this.load()
    }

    load = async () => {
        if (this.component.props.customerId || this.component.props.customerId == 0) {
            var resp = await fetch.post('/v1/customer/findById', { id: this.component.props.customerId })
            this.base.setState({ 'data.form': resp })
        }
github makajs / maka / packages / example / maka-erp / apps / set / person / set-person / action.js View on Github external
import { actionMixin, fetch } from 'maka'
import React from 'react'

@actionMixin('base', 'lodash', 'moment', 'modal', 'message')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }
    

    onInit = () => {
        if (this.component.props.setOkListener)
            this.component.props.setOkListener(this.onOk)
        this.load()
    }

    load = async () => {
        if (this.component.props.personId || this.component.props.personId == 0) {
            var resp = await fetch.post('/v1/person/findById', { id: this.component.props.personId })
            this.base.setState({ 'data.form': resp })
github makajs / maka / packages / example / maka-erp / apps / set / bom / set-bom-list / action.js View on Github external
import { actionMixin, fetch, createAppElement } from 'maka'

@actionMixin('base', 'lodash', 'moment', 'tableHelper', 'modal', 'message')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
        this.searchReload = this.lodash.debounce(this.searchReload, 200)
    }

    onInit = () => {
        //设置监听tab激活事件
        this.component.props.addTabActiveListener 
            && this.component.props.addTabActiveListener(this.component.props.appFullName, this.tabActive)


        const pagination = this.base.gs('data.pagination')
        this.load(pagination)
    }
github makajs / maka / packages / example / maka-erp / apps / set / customer / set-customer-group / action.js View on Github external
import { actionMixin, fetch } from 'maka'
import React from 'react'

@actionMixin('base', 'lodash', 'moment', 'modal', 'message')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }

    onInit = () => {
        if (this.component.props.setOkListener)
            this.component.props.setOkListener(this.onOk)
        this.load()
    }

    load = async () => {
        if (this.component.props.customerGroupId || this.component.props.customerGroupId == 0) {
            var resp = await fetch.post('/v1/customer/group/findById', { id: this.component.props.customerGroupId })
            this.base.setState({ 'data.form': resp })
        }
github makajs / maka / packages / example / maka-erp / apps / set / customer / set-customer-list / action.js View on Github external
import { actionMixin, fetch, createAppElement } from 'maka'

@actionMixin('base', 'lodash', 'moment', 'tableHelper', 'treeHelper', 'modal', 'message')
export default class action {
    constructor(option) {
        Object.assign(this, option.mixins)
        this.searchReload = this.lodash.debounce(this.searchReload, 200)
    }

    onInit = () => {
        const pagination = this.base.gs('data.pagination')
        this.load('all', pagination)
    }

    load = async (type, pagination, filter = { search: '' }) => {
        var tree, list, customers
        switch (type) {
            case 'all':
                tree = (await fetch.post('/v1/customer/group/queryAll', {})) || []
github makajs / maka / packages / example / maka-antd-pro / apps / theme / primary-color / theme-primary-color-green / src / index.js View on Github external
import pkgJson from '../package.json'
import { actionMixin } from 'maka'
import './style/index.less'

const name = pkgJson.name

const state = {
    data: {
    }
}

@actionMixin('base')
class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }
}

const view = {
    component: 'div',
}

export {
    name,
    state,
    action,
    view
}
github makajs / maka / packages / example / maka-erp / apps / base / font-awesome / index.js View on Github external
import pkgJson from './package.json'
import { actionMixin, registerComponent } from 'maka'
import FA from 'react-fontawesome'
import 'font-awesome/css/font-awesome.css';
import './style.less'

const name = pkgJson.name

registerComponent('FA', FA)

const state = {
    data: {
    }
}

@actionMixin('base')
class action {
    constructor(option) {
        Object.assign(this, option.mixins)
    }
}

const view = {
    component: 'div',
    className: 'zlj-fontawesome',
    children: [{
        component: 'FA',
        style: { fontSize: 30},
        name: 'rocket'
    },{
        component: 'FA',
        style: { fontSize: 30},

maka

maka

ISC
Latest version published 3 years ago

Package Health Score

36 / 100
Full package analysis

Popular maka functions