const fs = require('fs');
['src/pages/chanxiao/supplyXuQiu.vue', 'src/pages/chanxiao/purchaseXuQiu.vue'].forEach(filePath => {
    let file = fs.readFileSync(filePath, 'utf8');
    // Replace ' required\n' or ' required ' inside tags
    file = file.replace(/\s+required(\s*[\n>])/g, ' :required="isSave"$1');
    file = file.replace(/class="form-item required flex align-center"/g, ':class="[\'form-item\', \'flex\', \'align-center\', isSave ? \'required\' : \'\']"');
    file = file.replace(/placeholder="([^"]+)"/g, ':placeholder="isSave ? \'$1\' : \'\'"');
    fs.writeFileSync(filePath, file);
});
