| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link href="../css/Table/table1.css" rel="stylesheet" />
- <link href="../css/init.css" rel="stylesheet" />
- <link rel="stylesheet" href="../css/Quality/bootstrap-editable.css" />
- <script src="../js/Questions/bootstrap-editable.js"></script>
- <title></title>
- <style>
- table tr {
- margin-bottom: 20px;
- }
-
- table tr td {
- text-align: left;
- padding: 5px;
- }
-
- .Content {
- padding: 10px;
- }
-
- .btn {
- background: #1ab394;
- }
-
- .Btn_box {
- margin-top: 20px;
- color: #fff;
- }
-
- .inpBox select {
- width: 150px;
- padding: 3px 6px;
- }
-
- .F_Remark {
- width: 100%;
- }
-
- .tab {
- border-bottom: 1px solid #ccc;
- }
-
- .Check_box {
- display: none;
- }
- </style>
- </head>
- <body>
- <div>
- <div class="Content">
- <div class="tab">
- <table id="sqzx" style="width: 100%;" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <th>指标标题:</th>
- <td>
- <div class="inpBox">
- <select name="">
- <option value="0">问答题</option>
- <option value="1">单选题</option>
- </select>
- </div>
- </td>
- <th>指标标题:</th>
- <td>
- <div class="inpBox">
- <select name="" id="CheckQuestion">
- <option value="0">问答题</option>
- <option value="1">单选题</option>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <th>指标描述:</th>
- <td colspan="5">
- <textarea name="" rows="3" cols="20" class="F_Remark"></textarea>
- </td>
- </tr>
- </table>
- </div>
- <div class="Check_box">
- <h3>试题选项</h3>
- <h3 style="font-size: 14px; text-align: right;"><i class="fa fa-plus size-14" id="Add"></i>添加选项</h3>
- <table id="tbr" style="width: 100%;">
- <thead>
- <tr>
- <th data-align="center" data-field="id" data-formatter="setCode">序号</th>
- <th data-align="center" data-field="F_CategoryName" data-formatter="Check">选项</th>
- <th data-align="center" data-field="F_Title" data-formatter="Remove">操作</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- <div style="text-align: center; margin-top: 50px;">
- <button class="btns searchGo size-14">保存</button>
- </div>
- </div>
- </div>
- <script>
- $(document).ready(function() {
- $("#CheckQuestion").change(function() {
- var ss = $(this).children('option:selected').val();
- if(ss == "1") {
- $(".Check_box").show();
- } else if(ss == "0") {
- $(".Check_box").hide();
- }
- });
- });
- var $tableLeft = $('#tbr');
- //销毁表格
- $tableLeft.bootstrapTable('destroy');
- // 初始化表格,动态从服务器加载数据
- $tableLeft.bootstrapTable({
- method: "get", //使用get请求到服务器获取数据
- // url: huayi.config.callcenter_url + "IndexBase/GetList",
- // url: "//117.158.196.116:8878/IndexBase/GetList",
- striped: true, //表格显示条纹
- pagination: true, //启动分页
- pageSize: 5, //每页显示的记录数
- pageNumber: 1, //当前第几页
- pageList: [5, 20, 50, 100], //记录数可选列表
- search: false, //是否启用查询
- showColumns: false, //显示下拉框勾选要显示的列
- showRefresh: false, //显示刷新按钮
- sidePagination: "server", //表示服务端请求
- //设置为undefined可以获取pageNumber,pageSize,searchText,sortName,sortOrder
- //设置为limit可以获取limit, offset, search, sort, order
- queryParamsType: "undefined",
- queryParams: function queryParams(params) { //设置查询参数
- var param = {
- page: params.pageNumber,
- pagesize: params.pageSize,
- categoryid: Left_Cids,
- key: Keys
- };
- return param;
- },
- onLoadSuccess: function() { //加载成功时执行
- // layer.msg("加载成功");
- },
- onLoadError: function() { //加载失败时执行
- //layer.msg("加载数据失败", { time: 1500, icon: 2 });
- }
- });
-
- //序号
- function setCode(value, row, index) {
- return index + 1;
- }
- //修改
- function Check(value, row, index){
- return'<a title="点击移入" class="username">'+value+'</a>'
-
- }
- //操作
- function Remove(value, row, index){
- return '<div><a title="点击移入" ><i class="fa fa-remove size-14"></i></a></div>'
- }
- $("#Add").click(function() {
- var index = $tableLeft.bootstrapTable('getData').length;
- $tableLeft.bootstrapTable('insertRow', {
- index: index,
- row: {
- id: '测试',
- F_CategoryName: '测试测试'
- }
- });
- });
-
- $('.username').editable({
-
- });
-
- </script>
- </body>
- </html>
|