topicEdit.html
6.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
<form name="topicForm" id="topicForm" method="post">
<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="topicName" name="topicName" class="easyui-textbox" style="width: 380px;"/>
</td>
</tr>
<tr style="height: 60px">
<td>
<span style="color:red">*</span><label>话题描述</label> <br>
<textarea id="topicDesc" name="topicDesc" style="width: 380px;" rows="6" placeholder=""
required maxlength="100"></textarea>
</td>
</tr>
<tr style="height: 60px">
<td>
<span style="color:red">*</span><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 class="easyui-combobox" id="relatedGroup" name="relatedGroup">
</input>
<!-- <span style=" margin-left: 10px; color: red"> 图片宽高(186x170)</span>-->
</td>
</tr>
<tr style="height: 60px">
<td >
<input value="1" type="checkbox" id="isOfficial" name="isOfficial" >官方话题</input>
</td>
</tr>
<tr style="height: 60px">
<td >
<span style="color:red">*</span><label>列表模式</label><br>
<input value="1" type="radio" name="viewModel">大图详情</input>
<input value="2" type="radio" name="viewModel" required="true">小图列表</input>
</td>
</tr>
<tr style="height: 60px">
<td >
<input value="1" type="checkbox" id="showAttAmount" name="showAttAmount">展示关注人数</input>
<input value="1" type="checkbox" id="allowAttention" name="allowAttention" >允许用户关注</input>
</td>
</tr>
</table>
</div>
</form>
</div>
<script>
$(function () {
$("#topicName").textbox({
required: true,
missingMessage: "话题名称不能为空",
prompt: "请输入话题名称"
});
/* $("#topicDesc").textarea({
required: true,
maxLength: 100,
missingMessage: "话题描述不能为空,并小于100字",
prompt: "请输入话题名称"
});*/
$("#relatedGroup").combobox({
valueField : "id",
textField : "groupName",
required:true,
prompt: "请选择话题分组",
url : serverContextPath + "/topicGroupManage/getAllTopicGroupInfo",
loadFilter: function (data) {
var data = defaultLoadFilter(data);
data.unshift({'id': '', 'groupName': '--请选择分组--'});
return data;
}
});
$("#imageUpload").imageUpload({
width: 171,
height: 120,
realInputName: "topicImageUrl",
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) {//编辑窗口
$("#topicName").textbox("setValue", data.topicName);
$("#topicDesc").html(data.topicDesc);
//图片
$("#imageUpload").imageUpload('setValue', data.topicImageUrl);
debugger
$("#relatedGroup").combobox('setValue', data.relatedGroup);
if(data.isOfficial == 1){
$("#isOfficial").attr("checked",true)
}
$("input[name='viewModel'][value='"+data.viewModel+"']").attr("checked", "checked").parent().addClass('checked');
if(data.showAttAmount == 1){
$("#showAttAmount").attr("checked",true)
}
if(data.allowAttention == 1){
$("#allowAttention").attr("checked",true)
}
}
});
</script>
</html>