iview中,想在table中是用radio,radio选中事件居然是input
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iview中,想在table中是用radio,radio选中事件居然是input相关的知识,希望对你有一定的参考价值。
参考技术A vm = new Vue(el: '#app',
data:
columns3: [
title: '操作',
key: 'no',
width: 60,
render: (h, params) =>
return h('div', [
h('Button',
props:
type: 'info',
size: 'small',
//long:'100%'
shape: 'circle',
disabled: vm.TableInfo.F_Status == '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH' ? true : false
,
style:
//marginRight: '5px',
width: '100%',
display: 'block'
,
on:
click: () =>
vm.btn_AddProductiveProcess();
, '+'),
h('Button',
props:
type: 'default',
size: 'small',
//long: '100%'
shape: 'circle',
disabled: vm.TableInfo.F_Status == '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH' ? true : false
,
style:
width: '100%'
,
on:
click: () =>
vm.handleRemove(params.row)
, '-')])
,
title: '加工时间',
key: 'F_WorkTime',
width: 90,
align: 'center',
render: (h, params) =>
let createtime = (params.row.F_WorkTime != null && params.row.F_WorkTime != '') ? new Date(params.row.F_WorkTime).Format("yyyy-MM-dd") : '';
if (params.row.$isEdit)
return h('DatePicker',
props:
value: createtime,
,
on:
'on-change': function (event)
params.row.F_WorkTime = event;
vm.handleSave(params.row);
,
);
else
return h('div',
style: color: createtime == '' ? 'red' : '' ,
on:
click: function (event)
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH')
vm.handleEdit(params.row);
,
createtime == '' ? '请输入' : createtime);
,
title: '工序名称',
width: 80,
align: 'center',
key: 'F_Procedure_Name',
,
title: '加工数量',
key: 'F_Machining_Nums',
width: 80,
align: 'center',
render: (h, params) =>
if (params.row.$isEdit)
return h('InputNumber',
props:
value: params.row.F_Machining_Nums,
max: vm.TableInfo.F_Product_Nums,
min: 0,
,
on:
input: function (event)
params.row.F_Machining_Nums = event;
,
'on-blur': function ()
vm.handleSave(params.row);
);
else
return h('div',
style: color: params.row.F_Machining_Nums == '' ? 'red' : '' ,
on:
click: function (event)
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH')
vm.handleEdit(params.row);
, params.row.F_Machining_Nums == 0 ? '请输入' : params.row.F_Machining_Nums);
,
title: '车间人员',
key: 'F_Worker',
width: 79,
align: 'center',
render: (h, params) =>
if (params.row.$isEdit)
return h('Input',
props:
value: params.row.F_Worker,
,
on:
input: function (event)
params.row.F_Worker = event;
,
'on-blur': function ()
vm.handleSave(params.row);
);
else
return h('div',
style: color: (params.row.F_Worker == '' || params.row.F_Worker == null) ? 'red' : '' ,
on:
click: function (event)
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH')
vm.handleEdit(params.row);
, (params.row.F_Worker == '' || params.row.F_Worker == null) ? '请输入' : params.row.F_Worker);
,
title: '合格数量',
key: 'F_Qualified_Nums',
width: 80,
align: 'center',
render: (h, params) =>
if (params.row.$isEdit)
return h('InputNumber',
props:
value: params.row.F_Qualified_Nums,
max: vm.TableInfo.F_Product_Nums,
min:0
,
on:
input: function (event)
params.row.F_Qualified_Nums = event;
,
'on-blur': function ()
vm.handleSave(params.row);
);
else
return h('div',
style: color: (params.row.F_Qualified_Nums == 0 && params.row.F_Unqualified_Nums == 0) ? 'red' : '' ,
on:
click: function (event)
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH')
vm.handleEdit(params.row);
, (params.row.F_Qualified_Nums == 0 && params.row.F_Unqualified_Nums == 0) ? '请输入' : params.row.F_Qualified_Nums);
,
title: '外协',
key: 'F_IsOutProcess_',
width: 105,
align: 'center',
render: (h, params) =>
if (params.row.$isEdit)
return h('radio-group',
props:
type: 'button',
size: 'small',
value: params.row.F_IsOutProcess == true ? "是" : "否",
,
,
[
h('Radio',
props:
label: '是'
,
on:
input : () =>
params.row.F_IsOutProcess = true;
params.row.F_IsOutProcess_ = "是";
vm.handleSave(params.row);
, '是'),
h('Radio',
props:
label: '否'
,
on:
input : () =>
params.row.F_IsOutProcess = false;
params.row.F_IsOutProcess_ = "否";
vm.handleSave(params.row);
, '否'),
]);
else
return h('div',
on:
click: function (event)
if (vm.TableInfo.F_Status != '@ConstantUtils.F_Status.PRODUCTIVETASK_FINISH')
vm.handleEdit(params.row);
, params.row.F_IsOutProcess == true ? "是" : "否",);
,
],
)
iview 中table列 一列显示多个数据(后台返回数组显示在列内)
❶表头颜色设置??
❷测试数据
testData = [ { one: [{a:\'地1\'},{b:\'地2\'},{b:\'地3\'},{b:\'地4\'},{b:\'地5\'}], two: [{n1:2000}, {n2:2000}, {n3:1000}, {n4:3500}, {n5:1500}] }, {
one
: [\'地1\',\'地2\',\'地3\',\'地4\',\'地5\'],
two
: [2000, 2000, 1000, 3500, 1500], } ];
转自:
iview 中table列 一列显示多个数据(后台返回数组显示在列内)
https://blog.csdn.net/weixin_30549657/article/details/96232099 https://www.cnblogs.com/lxn2/p/10179646.html
iview table 合并行/列
https://www.jianshu.com/p/7e8e3877fb5f
https://www.php.cn/js-tutorial-408381.html
http://www.imooc.com/wenda/detail/494403
IVIEW实现一行表格内嵌多行表格的方法(表头分组)
以上是关于iview中,想在table中是用radio,radio选中事件居然是input的主要内容,如果未能解决你的问题,请参考以下文章
thinkphp中怎样获取radio单选框的值(单选框较多)
一个html页面中有一个table,几个text,table从数据库中把值读出来,怎样把table中的值在text显示出来