topicGroupEdit.html 3.75 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="groupName" name="groupName" class="easyui-textbox" style="width: 380px;"/>
                    </td>
                </tr>

                <tr style="height: 60px">
                    <td>
                       <label>分组图标</label> <br>

                        <div id="imageUpload">
                        </div>
                        <!-- <span style=" margin-left: 10px; color: red"> 图片宽高(186x170)</span>-->
                    </td>
                </tr>

                <tr style="height: 60px">
                    <td>
                        <span style="color:red">*</span><label>话题状态</label> <br>
                        <input type="radio" value="1"   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 () {

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


        $("#imageUpload").imageUpload({
            width: 171,
            height: 120,
            realInputName: "imageUrl",
            url: serverContextPath + '/fileupload/uploadFile',
            queryParams: {
                bucket: "grassImg"
            },
            onBeforeSubmit: function () {
                $.messager.progress({
                    title: "正在执行",
                    msg: "正在执行,请稍后...",
                    interval: 500,
                    text: ""
                });
            },
            filterFileName: function (data) {
                debugger;
                if (!data || data.code != 200) {
                    $.messager.progress("close");
                    $.messager.alert("错误", data.message);
                    return "";
                }
                return data.data.url;
            },
            onLoadSuccess: function (data) {
                $.messager.progress("close");
                //$("#imageUpload").hide();
                //$("#fileName").val(data.data.fileName);
                //$("#videoSize").val(data.data.fileSize); //如果有大小校验
                /*$("#callBackDiv").html("<div id='videoUploadDiv' class='image-upload' style='position: relative;top:19px;width: 120px; height: 150px;'><img id='imageShow' src='"+data.data.url+"?vframe/jpg/offset/0' width='120' height='150'/></div>"
                 +"<span style='position: relative;top: -40px;left: 30px;'>"+data.data.fileName+"</span><span style='position: relative;left: 50px;top: -40px;'>"+data.data.fileSize+"M</span>").show();
                 */
                return false;
            }
        });

        var data = paramObject.mkData;

        if (data){

            $("#groupName").textbox("setValue", data.groupName);
            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);
            }

            $("#imageUpload").imageUpload('setValue', data.imageUrl);
        }

    });


</script>