/* * Copyright (c) 2018-2025, ztt All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the pig4cloud.com developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: ztt */ import request from '@/router/axios' export function fetchList(query) { return request({ url: '/mes/structure/page', method: 'get', params: query }) } export function addObj(obj) { return request({ url: '/mes/structure', method: 'post', data: obj }) } export function getObj(id) { return request({ url: '/mes/structure/' + id, method: 'get' }) } export function delObj(id) { return request({ url: '/mes/structure/' + id, method: 'delete' }) } export function putObj(obj) { return request({ url: '/mes/structure', method: 'put', data: obj }) } export function getStructureType() { return request({ url: '/mes/structure/type', method: 'get' }) } export function getAllStructure(id) { return request({ url: '/mes/structure/tree/' + id, method: 'get' }) } export function getParts(keyword) { return request({ url: '/mes/part/query/' + keyword, method: 'get' }) } export function changeState(ids, event) { return request({ url: '/mes/structure/state/' + event, method: 'post', data: ids }) } export function copyStructureSave(obj) { return request({ url: '/mes/structure/copy', method: 'post', data: obj }) } export function addComponent(obj) { return request({ url: '/mes/structure/component', method: 'post', data: obj }) } export function putComponent(obj) { return request({ url: '/mes/structure/component', method: 'put', data: obj }) } export function delComponent(id) { return request({ url: '/mes/structure/component/' + id, method: 'delete' }) } export function batchComponent(obj) { return request({ url: '/mes/structure/batchComponent', method: 'post', data: obj }) } export function exportStructureTemplate() { return request({ url: '/mes/structure/exportModel', method: 'get', responseType: 'blob' }) } export function structureIfsSync(obj) { return request({ url: '/mes/structure/structureIfsSync', method: 'post', data: obj }) }