module.exports = function(compoenntName) {
  return `import asyncService from "@/apis/service/${compoenntName}/index";

    const asyncFn = async (name, data) => {
      let res = await asyncService[name](data);
      return res;
    };
    export default {
      // 添加
      add: async data => await asyncFn("add", data),
      // 删除
      delete: async data => await asyncFn("delete", data),
      // 分页查询
      list: async data => await asyncFn("list", data),
      // 详情
      detail: async data => await asyncFn("detail", data),
      // 更新
      update: async data => await asyncFn("update", data),
      //修改状态
      status: async data => await asyncFn("accountstatus", data),
    };
     `;
};
