| | |
| | | <form class="layui-form layui-table-form" lay-filter="productQuestion-table-form"> |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md10"> |
| | | <div class="layui-form-item"> |
| | | <div class="layui-row layui-col-space6 layui-form-item"> |
| | | <div class="layui-col-lg3"> |
| | | <label class="layui-form-label">产品分类:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="product-qutestion-category-query"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> |
| | |
| | | |
| | | <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:add" lay-event="productQuestionAdd">新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:add" lay-event="productQuestionAdd">手动新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:aiAdd" lay-event="productQuestionAiAdd">AI新增</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | <script type="text/html" id="difficultyFormat"> |
| | | {{# if(d.difficulty == 1) { }} |
| | | <span>简单</span> |
| | | {{# }else if(d.isNormal == 2) { }} |
| | | {{# }else if(d.difficulty == 2) { }} |
| | | <span>中等</span> |
| | | {{# }else if(d.isNormal == 3) { }} |
| | | {{# }else if(d.difficulty == 3) { }} |
| | | <span>困难</span> |
| | | {{# } else { }} |
| | | <span>-</span> |
| | |
| | | <!-- 表格操作栏 end --> |
| | | <script data-th-inline="none" type="text/javascript"> |
| | | // 引入组件并初始化 |
| | | layui.use([ 'jquery', 'form', 'table', 'febs'], function () { |
| | | layui.use([ 'jquery', 'form', 'table', 'febs', 'xmSelect'], function () { |
| | | var $ = layui.jquery, |
| | | febs = layui.febs, |
| | | form = layui.form, |
| | |
| | | tableIns; |
| | | |
| | | form.render(); |
| | | |
| | | var categoryQuestion = xmSelect.render({ |
| | | el: '#product-qutestion-category-query', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | tips: '请选择', |
| | | filterable: true, |
| | | radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/productCategory/categoryTree', null, function(res) { |
| | | categoryQuestion.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }) |
| | | |
| | | // 表格初始化 |
| | | initProductQuestionTable(); |
| | |
| | | } |
| | | }); |
| | | } |
| | | if(layEvent === 'productQuestionAiAdd'){ |
| | | febs.modal.open('新增', 'modules/ai/productQuestion/aiAdd/', { |
| | | btn: ['提交', '取消'], |
| | | area:['100%','100%'], |
| | | yes: function (index, layero) { |
| | | $('#febs-productQuestion-ai-add').find('#submit').trigger('click'); |
| | | }, |
| | | btn2: function () { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | function initProductQuestionTable() { |
| | |
| | | productSwitch(data.value,0); |
| | | } |
| | | }) |
| | | function productSwitch(id,type,state) { |
| | | function productSwitch(id,state) { |
| | | febs.get(ctx + 'admin/productQuestion/changeState/' + id+'/' + state, null, function (data) { |
| | | febs.alert.success(data.message); |
| | | $query.click(); |
| | |
| | | |
| | | // 刷新按钮 |
| | | $reset.on('click', function () { |
| | | |
| | | var categoryList = []; |
| | | categoryQuestion.setValue(categoryList); |
| | | $searchForm[0].reset(); |
| | | sortObject.type = 'null'; |
| | | tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); |
| | | tableIns.reload({where: null, page: {curr: 1}, initSort: sortObject}); |
| | | }); |
| | | // 获取查询参数 |
| | | function getQueryParams() { |
| | | return { |
| | | productCategoryId: categoryQuestion.getValue('valueStr'), |
| | | }; |
| | | } |
| | | |