当前位置: 首页 > news >正文

fastadmin中ajax弹窗修改文字为英文

需要把上图的中文改为  切换语言自动切换成英文

找到这个文件

public/assets/js/backend.js

找到如下图部分  

      // //点击包含.btn-ajax的元素时发送Ajax请求   原页面// $(document).on('click', '.btn-ajax,.ajaxit', function (e) {//     var that = this;//     var options = $.extend({}, $(that).data() || {});//     if (typeof options.url === 'undefined' && $(that).attr("href")) {//         options.url = $(that).attr("href");//     }//     options.url = Backend.api.replaceids(this, options.url);//     var success = typeof options.success === 'function' ? options.success : null;//     var error = typeof options.error === 'function' ? options.error : null;//     delete options.success;//     delete options.error;//     var button = Backend.api.gettablecolumnbutton(options);//     if (button) {//         if (typeof button.success === 'function') {//             success = button.success;//         }//         if (typeof button.error === 'function') {//             error = button.error;//         }//     }//     //如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新//     if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) {//         success = function () {//             $("#" + options.tableId).bootstrapTable('refresh');//         }//     }//     if (typeof options.confirm !== 'undefined') {//         Layer.confirm(options.confirm, function (index) {//             Backend.api.ajax(options, success, error);//             Layer.close(index);//         });//     } else {//         Backend.api.ajax(options, success, error);//     }//     return false;// });

修改为

   $(document).on('click', '.btn-ajax,.ajaxit', function (e) {var that = this;var options = $.extend({}, $(that).data() || {});if (typeof options.url === 'undefined' && $(that).attr("href")) {options.url = $(that).attr("href");}options.url = Backend.api.replaceids(this, options.url);var success = typeof options.success === 'function' ? options.success : null;var error = typeof options.error === 'function' ? options.error : null;delete options.success;delete options.error;var button = Backend.api.gettablecolumnbutton(options);if (button) {if (typeof button.success === 'function') {success = button.success;}if (typeof button.error === 'function') {error = button.error;}}//如果未设备成功的回调,设定了自动刷新的情况下自动进行刷新if (!success && typeof options.tableId !== 'undefined' && typeof options.refresh !== 'undefined' && options.refresh) {success = function () {$("#" + options.tableId).bootstrapTable('refresh');}}if (typeof options.confirm !== 'undefined') {// 添加自定义确认按钮文本var confirmOptions = {title: options.confirmTitle || __('Confirm'), // 标题,默认为"Confirm"btn: [{text: options.confirmBtn || __('OK'), // 确认按钮文本callback: function(index) {Backend.api.ajax(options, success, error);Layer.close(index);}},{text: options.cancelBtn || __('Cancel'), // 取消按钮文本callback: function(index) {Layer.close(index);}}]};Layer.confirm(options.confirm, {title: options.confirmTitle || __('Confirm'),btn: [options.confirmBtn || __('OK'),options.cancelBtn || __('Cancel')]}, function(index){Backend.api.ajax(options, success, error);Layer.close(index);});} else {Backend.api.ajax(options, success, error);}return false;});

按钮使用时添加

   confirmBtn: 'OK', // Confirm button text in English
cancelBtn: 'Cancel', // Cancel button text in English  即可

  buttons: [{name: 'check',text: __('check'), // 按钮文字,语言在对应的lang文件设置title: __('check'), // 提示classname: 'btn btn-xs btn-magic btn-ajax',confirm: __('Are you sure the review has been approved?'),confirmBtn: 'OK', // Confirm button text in EnglishcancelBtn: 'Cancel', // Cancel button text in Englishicon: 'fa fa-pencil', // 更换图标url:'order/check',},

http://www.dtcms.com/a/282297.html

相关文章:

  • Taro.getRandomValues() 用法详解
  • 端侧推理软件栈
  • 搜索框的显示与隐藏(展开与收起)
  • 智能工厂生产设备状态检测算法
  • Navicat Premium17.2.8 下载与安装(免费版)
  • 数字万用表是什么?七位半数字万用表/多用表的核心指标应用及技术趋势?
  • 近期学习总结
  • ADS8331手册驱动开发
  • HTML基础知识 二(创建容器和表格)
  • 达梦数据库CASE_SENSITIVE大小写敏感差异比较
  • HTB cap wp
  • 0 - MIT 6.S081 2020 操作系统 实验环境配置
  • 前端性能与可靠性工程:前端韧性工程 - 优雅降级与离线支持
  • Nginx,MD5和Knife4j
  • 使用TIANAI-CAPTCHA进行行为验证码的生成和缓存的二次校验
  • 【后端】.NET Core API框架搭建(6) --配置使用MongoDB
  • 随机链表的复制数据结构oj题(力口138)
  • 数据结构--准备知识
  • 随机链表的复制数据结构oj题(CM11)
  • SOTI MobiControl vs EasyControl:MDM 解决方案对比 —— 理解差异与价值
  • batchnorm1d,layernorm,revin区别
  • 关于程序=数据结构+算法这句话最近的一些思考
  • 【数据结构】「栈」(顺序栈、共享栈、链栈)
  • iOS 抓包工具选择与配置指南 从零基础到高效调试的完整流程
  • 时序大模型为时序数据库带来的变革与机遇
  • Flutter 记录 使用ModalRoute获取参数
  • flutter app内跳转到其他安卓 app的方法
  • qt udp接收时 丢包
  • 安卓开发使用Android Studio配置flutter环境
  • 《Qt信号与槽机制》详解:从基础到实践