Browse Source

im url获取,
im信息同步

Pojun 7 months ago
parent
commit
3a517d1fd7

+ 33 - 18
tip-front/src/main/webapp/tc_suite/index_mbdb.jsp

@@ -1501,8 +1501,8 @@
                                                          alt="">
                                                 </div>
 
-                                                <div class="tipsDiv" style="margin-right: 0" id="openImModal">
-                                                    <img src="${path}/tc_suite/home/images/tips.png" alt="">
+                                                <div style="margin-left: 40px;cursor: pointer" id="openImModal">
+                                                    <img src="${path}/tc_suite/home/images/msg.png" alt="" style="width: 16px;height: 16px">
                                                 </div>
 
                                                 <%--inspired 增加推荐框--%>
@@ -1637,12 +1637,12 @@
                 <!--右侧工具栏-->
                 <div id="showWin" style="position: absolute; right: 5px; top: 5px; display: none">
                 <span style="float: left; padding-top: 6px; margin-left: -5px"><img id="rightImg"
-                                                                                    onclick="showRightWin()"
-                                                                                    src="${path}/tc_ttp/style/default/images/arrow_left.png"
-                                                                                    title="显示处理窗"
-                                                                                    onmouseover="this.style.background='#CACACA'"
-                                                                                    onmouseout="this.style.background=''"
-                                                                                    style="cursor: pointer"></span>
+                                    onclick="showRightWin()"
+                                    src="${path}/tc_ttp/style/default/images/arrow_left.png"
+                                    title="显示处理窗"
+                                    onmouseover="this.style.background='#CACACA'"
+                                    onmouseout="this.style.background=''"
+                                    style="cursor: pointer"></span>
                 </div>
                 <div id="main_right">
                     <div id="loading2" class="loadingDiv">
@@ -3728,16 +3728,31 @@
         event.stopPropagation();
     });
     $("#openImModal").click(function () {
-        $.dialog({
-            title: "",
-            max: false,
-            min: false,
-            content: "url:http://139.129.34.129:8002/webim/pc/#/chat?account=yangzm&password=123456",
-            width: "900px",
-            height: "650px",
-            lock: true,
-            ok:false,
-            cancel: true
+        $.ajax({
+		type: "get",
+		url: TC.config.baseUrl+"/workpro/weburl",
+		dataType: "json",
+            success: function (data) {
+                if(data.state === "success"){
+                    if(data.url){
+                        $.dialog({
+                            title: "",
+                            max: false,
+                            min: false,
+                            content: "url:" + data.url,
+                            width: "900px",
+                            height: "650px",
+                            lock: true,
+                            ok:false,
+                            cancel: true
+                        });
+                    }else {
+                        $.alert("当前账号无法同步IM,请联系管理员");
+                    }
+                }else{
+                    $.alert("IM打开失败,请重试");
+                }
+            },
         });
     });
 

+ 22 - 1
tip-front/src/main/webapp/tc_tgp/organization/department/index.jsp

@@ -68,11 +68,13 @@
 					<button id="downImportTmp" class="aero btn btn-default" onfocus="this.blur()">${tc:i18n("common.button.download.import.template.label")}</button>
 					<button id="departImport" class="aero btn btn-default" onfocus="this.blur()">${tc:i18n("common.button.batch.import.label")}</button>
 					<button id="departExport" class="aero btn btn-default" onfocus="this.blur()">${tc:i18n("common.button.export.label")}</button>
+					<button id="updateImInfo" class="aero btn btn-default" onfocus="this.blur()">同步IM信息</button>
 				</c:if>
 				<c:if test="${unitType == 'Account'}">
 					<button id="mintoImport" class="aero btn btn-default" onfocus="this.blur()">上传案例</button>
 					<button id="mintoExport" class="aero btn btn-default" onfocus="this.blur()">下载案例</button>
 					<button id="resectAccount" class="aero btn btn-default" onfocus="this.blur()">重置单位</button>
+					<button id="updateImInfo" class="aero btn btn-default" onfocus="this.blur()">同步IM信息</button>
 				</c:if>
 
 				<c:if test="${tc:hasModule('seeyon')}">
@@ -809,7 +811,7 @@
 			// $("#downloadIframe").prop("src",TC.config.baseUrl +"/ied/org/unit/export?unitId=" + unitId);
 			window.open(TC.config.baseUrl +"/ied/org/unit/export?unitId=" + unitId);
 		});
-		
+
 
 		/**
 		 * 部门批量导入
@@ -941,6 +943,25 @@
 			}
 		})
 
+		$("#updateImInfo").click(function (){
+			let	progressBar = $.startProc({
+				msg:"正在执行同步,请耐心等待...",
+				time:30
+			});
+			$.ajax({
+				type: "post",
+				url: TC.config.baseUrl+"/workpro/sync",
+				dataType: "json",
+				success: function (data) {
+					if(data.state === 'success'){
+						$.alert("信息同步成功!");
+					}else {
+						$.alert("信息同步失败,请重试");
+					}
+					progressBar.close()
+				},
+			});
+		})
 	</script>
 </body>
 </html>

+ 27 - 3
tip-front/src/main/webapp/tc_tgp/organization/person/index.jsp

@@ -92,6 +92,9 @@
 				<a onclick="exportPers();" class="aero aerotemp layui-btn layui-btn-primary layui-btn-mini">
 					<span>${tc:i18n("organization.button.export.person.label")}</span>
 				</a>
+				<a onclick="updateImInfo();" class="aero aerotemp layui-btn layui-btn-primary layui-btn-mini">
+					<span>同步IM信息</span>
+				</a>
 			</c:if>
 			<!--</a> <a id="checkingPerson" href="javascript:;" class="aero" onfocus="this.blur()"> <span> 待审核成员 </span></a>
 			 -->
@@ -146,7 +149,7 @@
 		<input id="doType" name="doType" value="" /> <input id="startDate" name="startDate" value="" /> <input id="endDate" name="endDate" value="" /> <input
 			id="pname" name="pname" value="" /> <input id="userName" name="uname" value="" /> <input id="depId" name="depId" value="" /> <input id="postName" name="postName" value="" />
 			<input id="phoneSerialNumber" name="phoneSerialNumber" value="" />
-			
+
 	</form>
 	<iframe id="download4Export" name="download4Export" src="" style="display: none;"></iframe>
 </body>
@@ -180,7 +183,7 @@ var treeSetting = {
     			},
     		callback: {
     				onAsyncSuccess: function(event, treeId, treeNode, msg) {
-    					
+
     				},
     				onClick: function(event, treeId, treeNode, clickFlag) {
     					if(treeNode){
@@ -292,6 +295,27 @@ function exportPers() {
 
 }
 
+function updateImInfo(){
+	let	progressBar = $.startProc({
+		msg:"正在执行同步,请耐心等待...",
+		time:30
+	});
+	$.ajax({
+		type: "post",
+		url: TC.config.baseUrl+"/workpro/sync",
+		dataType: "json",
+		success: function (data) {
+			if(data.state === 'success'){
+				$.alert("信息同步成功!");
+			}else {
+				$.alert("信息同步失败,请重试");
+			}
+			progressBar.close()
+		},
+	});
+}
+
+
 function submitImport(){
 	if (document.getElementById('importFile').value=='') {
         alert('选择一个上传文件!');
@@ -326,7 +350,7 @@ $(function() {
   });
   $("#createPerson").click(function(){
 	  var url = '/org/persons/detail/create';
-	  var nodes = ztreeObj.getSelectedNodes();  
+	  var nodes = ztreeObj.getSelectedNodes();
     if (!nodes || nodes.length <= 0) {
     	TC.topWin.addTab('newPerson',$.i18n("organization.person.new.label"),url);
     } else {