小知识点们

data中的对象恢复初始值:

Object.assign(this.sourceForm, this.$options.data().sourceForm)

表单重置:

this.$refs.sourceForm.resetFields();

请求参数(data,params):

data中的参数直接放到请求体中;params参数自动拼接到路径中,注意数组要转化为字符串类型

字符串替换

将所有的“/”替换成“-”

this.selectTime.startTime = date[0].replace(/\//g,'-')

ivew中table多选时单击某一行就选中

table中的选中某一行的方法:@on-row-click,点击某一行就选中 this.$refs.table.toggleSelect(index) 

前端下载模板

使用正则表达式删除空行

this.programsetNames = this.form.textarea.replace(/(^\s*)|(\s*$)/g, '');

使用正则表达式将换行符替换为|

this.programsetNames = this.form.textarea.replace(/\n/g, '|');

数组去重

Array.from(new Set(arr));

导出sql语句(insert)找出最大id并且+1

(select newId from (select max(id) as newId from sys_menu) t) +1

eg:

INSERT INTO `sys_menu` (`id`, `name`, `parent_id`, `button_type`, `level`, `title`, `type`, `icon`, `sort_order`, `status`, `component`, `path`, `description`, `request_path`, `is_need_inventory_domain`, `is_need_distribution_domain`, `create_by`, `create_time`, `update_by`, `update_time`) VALUES ((select newId from (select max(id) as newId from sys_menu) t) +1, 'downloadManage', 371, '', 3, '下载任务', 0, '/', 5.00, 0, 'my/download-manage/index', '/download-manage', NULL, '/download-manage', 0, 0, 'admin', '2023-02-17 14:16:08', NULL, NULL);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值