generalDetails.js 4.17 KB
Newer Older
wangdanlei's avatar
wangdanlei committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
const state = {
  refresh: false,
  updatedObj: {},
  renameObj: {},
  tyFlag: false,
  craftPathRefresh: false,
  updetedCraftObj: null,
  releventDocPlanId: '',
  craftNode: null,
  checkCanzhuangjian: false,
  craftOutput: false,
  currentIndex: null,
  craftId: null,
  canzhuangjianId: null,
  topNode: null,
  operationLabel: null,
  showNavigation: false,
  // 跳转工艺编辑器标志
  routeCraft: false,
  // 新建子工艺标志
  subProcess: false
}
const mutations = {
  REFRESH_OPEN: (state) => {
    state.refresh = true
  },
  REFRESH_CLOSE: (state) => {
    state.refresh = false
  },
  SET_UPDATED_OBJ: (state, obj) => {
    state.updatedObj = obj
  },
  CLEAR_UPDATED_OBJ: (state) => {
    state.updatedObj = {}
  },
  SET_RENAME_OBJ: (state, obj) => {
    state.renameObj = obj
  },
  TY_OPEN: (state) => {
    state.tyFlag = true
  },
  TY_CLOSE: (state) => {
    state.tyFlag = false
  },
  CRAFT_PATH_REFRESH: (state, obj) => {
    if (obj) {
      state.updetedCraftObj = obj
    }
    state.craftPathRefresh = true
  },
  CRAFT_PATH_REFRESH_CLOSE: (state) => {
    state.updetedCraftObj = null
    state.craftPathRefresh = false
  },
  SET_RELEVENT_DOC_PLANID: (state, obj) => {
    state.releventDocPlanId = obj
  },
  CLEAR_RELEVENT_DOC_PLANID: (state) => {
    state.releventDocPlanId = ''
  },
  UPDATE_CRAFT_TREE_NODE: (state, id) => {
    state.craftNode = id
  },
  CLEAR_CRAFT_TREE_NODE: (state) => {
    state.craftNode = null
  },
  CHECK_CANZHUANGJIAN: (state, id) => {
    state.checkCanzhuangjian = true
  },
  CANCEL_CHECK_CANZHUANGJIAN: (state) => {
    state.checkCanzhuangjian = false
  },
  CRAFT_OUTPUT: (state) => {
    state.craftOutput = true
  },
  CRAFT_OUTPUT_CLOSE: (state) => {
    state.craftOutput = false
  },
  SET_CURRENT_INDEX: (state, index) => {
    state.currentIndex = index
  },
  NEW_CRAFT: (state, id) => {
    state.craftId = id
  },
  REFRESH_CANZHUANGJIAN: (state, id) => {
    state.canzhuangjianId = id
  },
  SET_TOP_NODE: (state, obj) => {
    state.topNode = obj
  },
  SET_OPERATION_LABEL: (state, obj) => {
    state.operationLabel = obj
  },
  SHOW_NAVIGATION: (state, flag) => {
    state.showNavigation = flag
  },
  SET_ROUTECRAFT: (state, flag) => {
    state.routeCraft = flag
  },
  SET_SUBPROCESS: (state, flag) => {
    state.subProcess = flag
  }
}
const actions = {
  refreshOpen({ commit }) {
    commit('REFRESH_OPEN')
  },
  refreshClose({ commit }) {
    commit('REFRESH_CLOSE')
  },
  setUpdatedObj({ commit }, obj) {
    commit('SET_UPDATED_OBJ', obj)
  },
  clearUpdatedObj({ commit }) {
    commit('CLEAR_UPDATED_OBJ')
  },
  setRenameObj({ commit }, obj) {
    commit('SET_RENAME_OBJ', obj)
  },
  tyOpen({ commit }) {
    commit('TY_OPEN')
  },
  tyClose({ commit }) {
    commit('TY_CLOSE')
  },
  craftPathRefresh({ commit }, obj) {
    commit('CRAFT_PATH_REFRESH', obj)
  },
  craftPathRefreshClose({ commit }) {
    commit('CRAFT_PATH_REFRESH_CLOSE')
  },
  setReleventDocPlanId({ commit }, obj) {
    commit('SET_RELEVENT_DOC_PLANID', obj)
  },
  clearReleventDocPlanId({ commit }) {
    commit('CLEAR_RELEVENT_DOC_PLANID')
  },
  updateCraftTreeNode({ commit }, id) {
    commit('UPDATE_CRAFT_TREE_NODE', id)
  },
  clearCraftTreeNode({ commit }) {
    commit('CLEAR_CRAFT_TREE_NODE')
  },
  checkCanzhuangjian({ commit }) {
    commit('CHECK_CANZHUANGJIAN')
  },
  cancelCheckCanzhuangjian({ commit }) {
    commit('CANCEL_CHECK_CANZHUANGJIAN')
  },
  craftOutput({ commit }) {
    commit('CRAFT_OUTPUT')
  },
  craftOutputClose({ commit }) {
    commit('CRAFT_OUTPUT_CLOSE')
  },
  setCurrentIndex({ commit }, index) {
    commit('SET_CURRENT_INDEX', index)
  },
  newCraft({ commit }, id) {
    commit('NEW_CRAFT', id)
  },
  refreshCanzhuangjian({ commit }, id) {
    commit('REFRESH_CANZHUANGJIAN', id)
  },
  setTopNode({ commit }, obj) {
    commit('SET_TOP_NODE', obj)
  },
  setOperationLabel({ commit }, obj) {
    commit('SET_OPERATION_LABEL', obj)
  },
  showNavigation({ commit }, flag) {
    commit('SHOW_NAVIGATION', flag)
  },
  setRouteCraft({ commit }, flag) {
    commit('SET_ROUTECRAFT', flag)
  },
  setSubProcess({ commit }, flag) {
    commit('SET_SUBPROCESS', flag)
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}