table.on('load-success.bs.table', function (e, data) { time_arr = Config.time_arr; fields =[ {checkbox: true}, {field: 'n.company_id', title: __('所属公司'),visible:false,searchList: Config.companylist}, {field: 'add_fans_time', title: __('加粉日期'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field:'search_type',title:'类型',visible: false,searchList: {1:'投产比','2':'转化率',3:'单粉产值'}}, {field: 'promotion_fee', title: __('总推广费'),formatter:function(value,row,index){ if(value >0){ return parseInt(value); } },operate: false}, {field: 'add_fans', title: __('总加粉数'),operate: false}, {field: 'customer_number', title: __('总客户数'),operate: false}, {field: 'order_money', title: __('总订单金额'),operate: false}, ]; $.each(time_arr,function(n,e){ fields.push({field: e, title: e,operate:false}); }); table.bootstrapTable('refreshOptions', {columns: fields}); });
时间: 2024-02-15 11:26:59 浏览: 19
这段代码使用了 Bootstrap Table 插件,在表格加载成功后重新定义了表格的列属性(columns),并刷新了表格的配置。其中,time_arr 是一个时间数组,fields 是列属性数组。在添加列时,使用了 fields.push() 方法,循环添加了 time_arr 中的每个时间属性。最后,使用 table.bootstrapTable('refreshOptions', {columns: fields}) 方法刷新表格配置。
相关问题
def load_dataset(seq_len,batch_size=32): note_arr = np.load("notes_array.npy") _n_notes, _n_durations = note_arr.shape[1:] offset_arr = np.load("offsets_array.npy") _n_offsets = offset_arr.shape[1] note_arr = np.reshape(note_arr, (note_arr.shape[0], -1)) note_data = np.concatenate([note_arr, offset_arr], axis=-1) _n_embeddings = note_data.shape[-1]
这段代码定义了一个名为load_dataset()的函数,用来加载音符和节奏序列数据集。它首先从文件中加载note_arr、offset_arr数组,这两个数组分别表示音符和节奏序列的二维矩阵形式。然后,通过np.concatenate()函数将这两个数组按列合并成一个新的数组note_data,其中每个元素都表示一个音符或节奏的特征向量。接着,通过np.reshape()函数将note_arr数组转换成二维矩阵形式,方便后续处理。最后,该函数返回了经过预处理和划分后的数据集dataset,以及音符、节奏和偏移量的个数n_notes、n_durations和n_offsets,以及嵌入向量的维度n_embeddings。
marker_full_data_arr = utility.exact_full_marker_data(csv_file, [pcd_result_ls[-1]])
这段代码调用了名为`exact_full_marker_data`的`utility`函数,用于提取完整的Marker数据。它传入了一个csv文件路径`csv_file`和一个包含单个元素的列表,其中元素是`pcd_result_ls`列表的最后一个元素。这个函数将根据csv文件中的数据提取出完整的Marker数据,并将其返回给`marker_full_data_arr`变量。