| | |
| | | </div> |
| | | </div> |
| | | |
| | | <script type="text/html" id="productQuestionToolbar"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:aiAdd" lay-event="productQuestionJobStateClose">停止</button> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="difficultyFormat"> |
| | | {{# if(d.difficulty == 1) { }} |
| | | <span>简单</span> |
| | |
| | | <span>中等</span> |
| | | {{# }else if(d.difficulty == 3) { }} |
| | | <span>困难</span> |
| | | {{# } else { }} |
| | | <span>-</span> |
| | | {{# } }} |
| | | </script> |
| | | |
| | | <script type="text/html" id="questionJobStateFormat"> |
| | | {{# if(d.state == 1) { }} |
| | | <span>进行中</span> |
| | | {{# }else if(d.state == 2) { }} |
| | | <span>已完成</span> |
| | | {{# }else if(d.state == 0) { }} |
| | | <span>未启动</span> |
| | | {{# } else { }} |
| | | <span>-</span> |
| | | {{# } }} |
| | |
| | | // 表格初始化 |
| | | initproductQuestionJobTable(); |
| | | |
| | | // 初始化表格操作栏各个按钮功能 |
| | | table.on('toolbar(productQuestionJobToolbar)', function (obj) { |
| | | let data = obj.data, |
| | | layEvent = obj.event; |
| | | if (layEvent === 'productQuestionJobStateClose') { |
| | | |
| | | var checkData = table.checkStatus('productQuestionJobTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择'); |
| | | return; |
| | | } |
| | | febs.modal.confirm('状态', '停止?', function () { |
| | | var ids = []; |
| | | layui.each(checkData, function (key, item) { |
| | | ids.push(item.id) |
| | | }); |
| | | productQuestionJobStateClose(ids.join(',')); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function productQuestionJobStateClose(ids) { |
| | | febs.post(ctx + 'admin/productQuestion/jobStateUpdate/' + ids, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | }); |
| | | } |
| | | |
| | | function initproductQuestionJobTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |
| | |
| | | {field: 'questionCnt', title: '生成总数', minWidth: 100,align:'center'}, |
| | | {field: 'questionDoneCnt', title: '已完成', minWidth: 100,align:'center'}, |
| | | {templet:"#difficultyFormat", title: '难度', minWidth: 140,align:'center'}, |
| | | {templet:"#questionJobStateFormat", title: '状态', minWidth: 140,align:'center'}, |
| | | {field: 'companyId', title: '公司编码', minWidth: 150,align:'center'}, |
| | | ]] |
| | | }); |