const start = ``; let variablesData = ``; let functionData = ``; const scriptCombined = () => { return ` ${start} import request from '@/utils/request'; const formDataOperation = ref({}) ${getVariablesData()} ${functionData} ${end} `; }; let variablesStructure = {}; const addVariables = (tier, key, type) => { let obj = variablesStructure; if (tier.length > 0) { tier.forEach((t) => { obj = obj[t]; }); obj[key] = type; } else { obj[key] = type; } }; const getVariablesData = () => { return `const pageForm = ref(${JSON.stringify(variablesStructure)})`; }; const addFunction = (code) => { functionData += code; }; const resetScript = (data) => { variablesData = ``; variablesStructure = {}; functionData = ``; }; export { addVariables, addFunction, scriptCombined, resetScript };