템플릿 출력 준비

템플릿에 option 확인 기능 추가
현재 수뇌 여부도 반환
This commit is contained in:
2018-02-11 05:30:34 +09:00
parent 0a7d9cbe21
commit 18e663c529
6 changed files with 53 additions and 8 deletions
+1
View File
@@ -3,6 +3,7 @@
"server":"d1af658a-f094-4303-9496-9a27a8180b0b", "server":"d1af658a-f094-4303-9496-9a27a8180b0b",
"sequence":1122, "sequence":1122,
"generalID":11, "generalID":11,
"isChief":true,
"national":[ "national":[
{ {
"id":1009, "id":1009,
+43 -7
View File
@@ -17,7 +17,7 @@ var messageTemplate = `
bgcolor="#000055" bgcolor="#000055"
<%} %> <%} %>
style="font-size:13px;table-layout:fixed;word-break:break-all;" style="font-size:13px;table-layout:fixed;word-break:break-all;"
data-id="<%id%>" id="msg_<%id%>"
> >
<tbody><tr> <tbody><tr>
<td width="64px" height="64px"> <td width="64px" height="64px">
@@ -52,19 +52,55 @@ var messageTemplate = `
<font size="1">&lt;<%e($datetime)%>&gt;</font> <font size="1">&lt;<%e($datetime)%>&gt;</font>
<br> <br>
<%e(message)%> <%e(message)%>
<%if(this.option){ console.log('HasOption!!'); %>
<div>
<button class="prompt_yes btn_prompt">수락</button><button class="prompt_no btn_prompt">거정</button>
</div>
<%} %>
</td> </td>
</tr></tbody> </tr></tbody>
</table> </table>
`; `;
jQuery(function($){ var refreshMsg = (function(){
var generalID=null;
var generalID=1; var isChief = false;
var sequence =null; var sequence =null;
function refreshMsg(){
} return function(){
var deferred = $.ajax({
url: option.targetJson,
type: 'post',
dataType:'json',
contentType: 'application/json',
data: JSON.stringify({
sequence:sequence
})
});
function registerGlobal(obj){
if(!obj.result){
deferred.reject();
return;
}
generalID = obj.generalID;
isChief = obj.isChief;
sequence = obj.sequence;
return obj;
}
deferred
.then(registerGlobal);
};
})();
jQuery(function($){
refreshMsg(); refreshMsg();
}); });
+6 -1
View File
@@ -13,7 +13,7 @@
bgcolor="#000055" bgcolor="#000055"
<%} %> <%} %>
style="font-size:13px;table-layout:fixed;word-break:break-all;" style="font-size:13px;table-layout:fixed;word-break:break-all;"
data-id="<%id%>" id="msg_<%id%>"
> >
<tbody><tr> <tbody><tr>
<td width="64px" height="64px"> <td width="64px" height="64px">
@@ -48,6 +48,11 @@
<font size="1">&lt;<%e($datetime)%>&gt;</font> <font size="1">&lt;<%e($datetime)%>&gt;</font>
<br> <br>
<%e(message)%> <%e(message)%>
<%if(this.option){ console.log('HasOption!!'); %>
<div>
<button class="prompt_yes btn_prompt">수락</button><button class="prompt_no btn_prompt">거정</button>
</div>
<%} %>
</td> </td>
</tr></tbody> </tr></tbody>
</table> </table>
+1
View File
@@ -3,6 +3,7 @@
"server":"d1af658a-f094-4303-9496-9a27a8180b0b", "server":"d1af658a-f094-4303-9496-9a27a8180b0b",
"sequence":1357, "sequence":1357,
"generalID":11, "generalID":11,
"isChief":true,
"national":[ "national":[
], ],
+1
View File
@@ -3,6 +3,7 @@
"server":"d1af658a-f094-4303-9496-9a27a8180b0b", "server":"d1af658a-f094-4303-9496-9a27a8180b0b",
"sequence":1366, "sequence":1366,
"generalID":11, "generalID":11,
"isChief":true,
"national":[ "national":[
], ],
+1
View File
@@ -3,6 +3,7 @@
"server":"d1af658a-f094-4303-9496-9a27a8180b0b", "server":"d1af658a-f094-4303-9496-9a27a8180b0b",
"sequence":1811, "sequence":1811,
"generalID":11, "generalID":11,
"isChief":false,
"national":[ "national":[
], ],