{"size": 2418, "ext": "js", "max_stars_repo_path": "src/store/module/workflow.js", "max_stars_repo_name": "Kyligence/byzer-notebook-vue", "max_stars_repo_stars_event_min_datetime": "2021-11-15T09:54:01.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-29T10:14:49.000Z", "max_issues_repo_path": "src/store/module/workflow.js", "max_issues_repo_name": "Kyligence/byzer-notebook-vue", "max_issues_repo_issues_event_min_datetime": "2021-12-08T03:38:16.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-31T10:10:33.000Z", "max_forks_repo_path": "src/store/module/workflow.js", "max_forks_repo_name": "Kyligence/byzer-notebook-vue", "max_forks_repo_forks_event_min_datetime": "2021-11-15T07:26:10.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-15T12:12:24.000Z"}
{"max_stars_count": 8, "max_issues_count": 63, "max_forks_count": 9, "avg_line_length": 33.5833333333, "max_line_length": 77, "alphanum_fraction": 0.6426799007}
import * as types from '../type'
import { workflow } from '@/service'
export default {
  state: {
    currentDragNode: null,
    nodeList: []
  },
  mutations: {
    [types.SET_CURRENT_DRAG_NODE]: (state, payload) => {
      state.currentDragNode = payload
    },
    [types.SET_NODE_LIST]: (state, payload) => {
      state.nodeList = payload
    }
  },
  actions: {
    [types.CREATE_WORKFLOW]: (_, payload) => {
      return workflow.createWorkflow(payload)
    },
    [types.CREATE_WORKFLOW_NODE]: ({ getters }, payload) => {
      return workflow.createWorkflowNode(getters.activeNotebookId, payload)
    },
    [types.DELETE_WORKFLOW_NODE]: ({getters}, node_id) => {
      return workflow.deleteWorkflowNode(getters.activeNotebookId, node_id)
    },
    [types.GET_NODE_LIST]: (_, { workflow_id, commit_id }) => {
      return workflow.getNodeList(workflow_id, commit_id)
    },
    [types.GET_WORKFLOW_PREVIEW]: (_, { workflow_id, commit_id }) => {
      return workflow.getWorkflowPreview(workflow_id, commit_id)
    },
    [types.SAVE_WORKFLOW_AS_NOTEBOOK]: ({ getters }, payload) => {
      return workflow.saveAsNotebook(getters.activeNotebookId, payload)
    },
    [types.CHECK_MLSQL]: (_, payload) => {
      return workflow.checkMlsql(payload)
    },
    [types.GET_NODE_INFO]: ({ getters }, { node_id }) => {
      return workflow.getNodeInfo(getters.activeNotebookId, node_id)
    },
    [types.UPDATE_FLOW_NODE]: ({ getters }, { node_id, data }) => {
      return workflow.updateFlowNode(getters.activeNotebookId, node_id, data)
    },
    [types.GET_EXISTING_TABLE]: ({ getters }) => {
      return workflow.getExsitingTable(getters.activeNotebookId)
    },
    [types.GET_EXISTING_MODEL]: (_, id) => {
      return workflow.getExsitingModel(id)
    },
    [types.UPDATE_NODE_POSITION]: (_, { workflow_id, node_id, data }) => {
      return workflow.updateNodePosition(workflow_id, node_id, data)
    },
    [types.GET_LOAD_PARAMS]: (_, payload) => {
      return workflow.getLoadParams(payload)
    },
    [types.GET_ET_LIST]: () => {
      return workflow.getETList()
    },
    [types.GET_ET_PARAMS]: (_, id) => {
      return workflow.getETParams(id)
    },
    [types.GET_ET_DEPENENCY]: (_, payload) => {
      return workflow.getETDependency(payload)
    }
  },
  getters: {
    activeNotebookId: (state, getters, rootState) => {
      return rootState.notebook.activeNotebook?.id
    }
  }
}
