labelEdit.html 2.52 KB

<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
    <form name="activityAddForm" id="activityAddForm" method="post" enctype="multipart/form-data">
        <div style="margin-top: 20px;margin-left: 30px">
            <table border="0" style="width:95%;margin-top:5px;line-height:30px;" id="tab">
                <tr style="height: 60px">

                    <td >
                        <span style="color:red">*</span><label>标签名称</label>  <br>
                        <input id="labelName" name="labelName" class="easyui-textbox" style="width: 380px;"/>
                    </td>
                </tr>

                <tr style="height: 60px">

                    <td >
                        <span style="color:red">*</span><label>分组名称</label>  <br>
                        <input id="groupId" name="groupId" class="easyui-textbox" style="width: 380px;"/>
                    </td>
                </tr>

                <tr style="height: 60px">
                    <td>
                        <span style="color:red">*</span><label>标签状态</label> <br>
                        <input type="radio" value="1" checked  name="status" style="width:30px">开启</input>
                        <input type="radio" value="0"  name="status" style="width:30px">关闭</input>
                    </td>
                </tr>

            </table>
        </div>
    </form>
</div>
<script>
    $(function () {

        $("#labelName").textbox({
            required: true,
            missingMessage: "标签名称不能为空",
            prompt: "请输入标签名称"
        });

        $("#groupId").combobox({
            valueField : "id",
            textField : "groupName",
            required:false,
            prompt: "请选择分组",
            url : serverContextPath + "/labelGroupManage/getAllLabelGroupInfo",
            loadFilter: function (data) {
                var data = defaultLoadFilter(data);
                data.unshift({'id': '', 'groupName': '--请选择分组--'});
                return data;
            }
        });



        var data = paramObject.mkData;

        if (data){
            $("#labelName").textbox("setValue", data.labelName);
            if(data.status == 0){
                $(":radio[name='status'][value='0']").prop("checked",true);
            }else if(data.status == 1){
                $(":radio[name='status'][value='1']").prop("checked",true);
            }
            $("#groupId").combobox('setValue', data.groupId);
        }

    });


</script>