formeditFL.js 130 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006
  1. 'use strict';
  2. var app = angular.module('app', [
  3. ]);
  4. app.controller("formeditCtrl", ["$scope", "$http", "$timeout", "$interval", "$sce", function ($scope, $http, $timeout, $interval, $sce) {
  5. var self = this;
  6. var s4 = new SM4Util();
  7. self.userId = $.cookie("GlWorkPlatform-userid");
  8. self.userName = $.cookie("GlWorkPlatform-chineseName");
  9. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  10. self.routeid = sp.getUrlName("routeid");
  11. self.routeinfoid = sp.getUrlName("routeinfoid");
  12. self.lastrouteinfoid = sp.getUrlName("lastrouteinfoid");
  13. self.copyrightid = sp.getUrlName("copyrightid");
  14. self.directionid = sp.getUrlName("directionid");
  15. self.formeditid = sp.getUrlName("formeditid");
  16. self.mbid = sp.getUrlName("mbid");
  17. self.fjid = sp.getUrlName("fjid");
  18. self.docmode = sp.getUrlName("docmode");
  19. self.dotype = sp.getUrlName("dotype");
  20. self.gkbutton = sp.getUrlName("gkbutton")
  21. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  22. self.get_lastReturnPage = sp.getUrlName("lastReturnPage");
  23. self.get_type = sp.getUrlName("type");
  24. self.return = "../list.html?lastReturnPageno=" + self.get_lastReturnPageno + "&type=" + self.get_type
  25. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  26. if (self.deviceType != "pad") {
  27. self.photo = $.cookie("GlWorkPlatform-photo").indexOf("AFrontEnd") > -1 ? "../../../" + $.cookie("GlWorkPlatform-photo") : $.cookie("GlWorkPlatform-photo");
  28. }
  29. var postCfg = {
  30. headers: {
  31. 'Content-Type': 'application/json',
  32. 'Authorization': "Bearer " + self.get_AccessToken
  33. }
  34. };
  35. self.FormTitle = $.cookie("GlWorkPlatform-SYSNAME");
  36. //初始化右上角按钮
  37. self.buttonList = []
  38. var uploadformat = strToJson(s4.decryptData_CBC(apiurljs.uploadformat)).data.map(function (item) {
  39. return item.CNAME
  40. })
  41. self.upload_zw = function () {
  42. self.newMoBanFlag = true;
  43. if (self.gaoTypeArrayFirst.length > 0) {
  44. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  45. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  46. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  47. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  48. sp.openCenter(".sp-dialog");
  49. ///取消按钮
  50. $('.sp-closeDialog').click(function (event) {
  51. sp.closeCenter(".sp-dialog");
  52. event.preventDefault();
  53. event.stopPropagation();
  54. });
  55. //post消息的id
  56. $("#delDataTrue").click(function () {
  57. sp.closeCenter(".sp-dialog");
  58. $('#fileupload-zw').fileupload({
  59. url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
  60. dataType: 'json',
  61. beforeSend: function (xhr, data) {
  62. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  63. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
  64. },
  65. add: function (e, data) {
  66. var num = 0;
  67. var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
  68. //文件类型判断
  69. $.each(data.originalFiles, function (index, item) {
  70. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  71. sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
  72. return;
  73. } else {
  74. num++
  75. }
  76. })
  77. if (num == data.originalFiles.length) {
  78. self.uploading_zw = true;
  79. data.submit();
  80. $scope.$apply();
  81. }
  82. },
  83. // 上传完成后的执行逻辑
  84. done: function (e, data) {
  85. self.uploading_zw = false;
  86. self.newMoBanFlag = false;
  87. self.getGCG(1)
  88. }
  89. })
  90. $timeout(function () {
  91. $("#fileupload-zw").trigger("click")
  92. }, 1)
  93. })
  94. } else {
  95. $('#fileupload-zw').fileupload({
  96. url: apiurljs.login + 'g2app/fawenfiles/uploadFileWithForm',
  97. dataType: 'json',
  98. beforeSend: function (xhr, data) {
  99. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  100. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FAWEN_FILES,routeinfoid=" + self.routeinfoid + ",gwtype=" + self.data.GWZL + ",dockind=D01"));
  101. },
  102. add: function (e, data) {
  103. var num = 0;
  104. var acceptFileTypes = eval('/(' + apiurljs.zwType.join("|") + ')$/i')
  105. //文件类型判断
  106. $.each(data.originalFiles, function (index, item) {
  107. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  108. sp.dialog("您好,请上传" + apiurljs.zwType.join("/") + "格式的文件!");
  109. return;
  110. } else {
  111. num++
  112. }
  113. })
  114. if (num == data.originalFiles.length) {
  115. self.uploading_zw = true;
  116. data.submit();
  117. $scope.$apply();
  118. }
  119. },
  120. // 上传完成后的执行逻辑
  121. done: function (e, data) {
  122. self.uploading_zw = false;
  123. self.newMoBanFlag = false;
  124. self.getGCG(1)
  125. }
  126. })
  127. $timeout(function () {
  128. $("#fileupload-zw").trigger("click")
  129. }, 1)
  130. }
  131. }
  132. //上层附件、业务参考、共享沟通组件
  133. self.uploading = false;
  134. self.upload = function () {
  135. $('#fileupload').fileupload({
  136. url: apiurljs.login + 'g2app/abase/uploadFileWithForm',
  137. dataType: 'json',
  138. beforeSend: function (xhr, data) {
  139. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  140. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=FILE_ATTACH,routeinfoid=" + self.routeinfoid + ",ATTACHTYPE=会议纪要"));
  141. },
  142. add: function (e, data) {
  143. var num = 0;
  144. var acceptFileTypes = eval('/(' + uploadformat.join("|") + ')$/i')
  145. //文件类型判断
  146. $.each(data.originalFiles, function (index, item) {
  147. if (item['type'].length > 0 && !acceptFileTypes.test(item['name'])) {
  148. sp.dialog("您好,请上传" + uploadformat.join("/") + "格式的文件!");
  149. return;
  150. } else {
  151. num++
  152. }
  153. })
  154. if (num == data.originalFiles.length) {
  155. self.uploading = true;
  156. data.submit();
  157. $scope.$apply();
  158. }
  159. },
  160. // 上传完成后的执行逻辑
  161. done: function (e, data) {
  162. self.uploading = false;
  163. self.getOther()
  164. }
  165. })
  166. }
  167. self.downLoad = function (item) {
  168. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  169. }
  170. self.deleteFile = function (file) {
  171. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  172. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  173. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  174. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  175. sp.openCenter(".sp-dialog");
  176. ///取消按钮
  177. $('.sp-closeDialog').click(function (event) {
  178. sp.closeCenter(".sp-dialog");
  179. event.preventDefault();
  180. event.stopPropagation();
  181. });
  182. //post消息的id
  183. $("#delDataTrue").click(function () {
  184. var data = {
  185. tablename: "FILE_ATTACH",
  186. id: file.ID
  187. };
  188. $http.post(apiurljs.login + "g2app/dataabase/delDataById", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  189. .success(function (obj) {
  190. var res = strToJson(s4.decryptData_CBC(obj.data));
  191. sp.dialoghide();
  192. if (res.success) {
  193. $.each(self.iframeList, function (index, item) {
  194. if (item.title == file.FILENAMES && item.source == apiurljs.login + "g2work/files2/inline/" + file.FILEURL.slice(7)) {
  195. self.closeItem(index);
  196. return false;
  197. }
  198. })
  199. self.getOther();
  200. } else {
  201. sp.dialog("删除失败,请联系管理员!");
  202. }
  203. });
  204. });
  205. }
  206. self.creatFLOW = function (file) {
  207. var data = {
  208. copyrightid: self.copyrightid,
  209. directionid: self.directionid,
  210. routeinfoid: self.routeinfoid,
  211. userid: self.userId,
  212. relateid: file.ID
  213. }
  214. $http.post(apiurljs.login + "g2app/fawenfiles/createNewWorkFlowWithGwtype", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  215. .success(function (obj) {
  216. var res = strToJson(s4.decryptData_CBC(obj.data));
  217. sp.dialoghide();
  218. if (res.success) {
  219. self.getGLFLOW();
  220. } else {
  221. sp.dialog("删除失败,请联系管理员!");
  222. }
  223. });
  224. }
  225. self.deleteWG = function (file) {
  226. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  227. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  228. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  229. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  230. sp.openCenter(".sp-dialog");
  231. ///取消按钮
  232. $('.sp-closeDialog').click(function (event) {
  233. sp.closeCenter(".sp-dialog");
  234. event.preventDefault();
  235. event.stopPropagation();
  236. });
  237. //post消息的id
  238. $("#delDataTrue").click(function () {
  239. var data = {
  240. id: file.ID
  241. };
  242. $http.post(apiurljs.login + "g2app/fawenfilesrelate/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  243. .success(function (obj) {
  244. var res = strToJson(s4.decryptData_CBC(obj.data));
  245. sp.dialoghide();
  246. if (res.success) {
  247. $.each(self.iframeList, function (index, item) {
  248. if (item.title == file.FILENAMES && item.source == apiurljs.login.split("glwork/")[0] + "glworkweb/" + file.FILEURL) {
  249. self.closeItem(index);
  250. return false;
  251. }
  252. })
  253. self.getGLJ(1);
  254. } else {
  255. sp.dialog("删除失败,请联系管理员!");
  256. }
  257. });
  258. });
  259. }
  260. self.openGL = function (item) {
  261. var data = {
  262. tablename: "SYS_DESKTOP_PLUGIN_TODO",
  263. colums: "*",
  264. order: "SORTID",
  265. sqlwhere: "",
  266. sqlorwhere: "",
  267. sqlinwhere: "",
  268. sqllikewhere: { FLOWID: item.FLOWID }
  269. }
  270. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  271. .success(function (obj) {
  272. var res = strToJson(s4.decryptData_CBC(obj.data));
  273. sp.openNewWindow("../../" + res.data[0].FILEN.split("/")[1] + "/" + item.FILEN + "&flowid=" + item.FLOWID + "&dotype=1", item.TITLE)
  274. });
  275. }
  276. self.downLoaDWG = function (item) {
  277. if (item.FILEURL.indexOf("files") > -1) {
  278. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  279. } else {
  280. window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
  281. }
  282. }
  283. self.readonly = {
  284. JJCD: false,
  285. FWZH: false,
  286. WLDQFL: false,
  287. WLDSSL: false,
  288. XXGKSH: false,
  289. SFXYJD: false,
  290. FLSH: false,
  291. GPJZSC: false,
  292. BGSFHYJ: false,
  293. SX: false,
  294. BMFZRYJ: false,
  295. NGR: false,
  296. NGRQ: false,
  297. HBCSYJ: false,
  298. GWZL: false,
  299. YF: false,
  300. BT: false,
  301. ZS: false,
  302. CS: false,
  303. USAGE: false
  304. }
  305. self.show = {
  306. JJCD: false,
  307. FWZH: false,
  308. WLDQFL: false,
  309. WLDSSL: false,
  310. XXGKSH: false,
  311. SFXYJD: false,
  312. FLSH: false,
  313. GPJZSC: false,
  314. BGSFHYJ: false,
  315. SX: false,
  316. BMFZRYJ: false,
  317. NGR: false,
  318. NGRQ: false,
  319. HBCSYJ: false,
  320. GWZL: false,
  321. YF: false,
  322. BT: false,
  323. ZS: false,
  324. CS: false,
  325. USAGE: false
  326. }
  327. self.type = 1;
  328. self.getSwenList = function (n) {
  329. self.SwenList = [];
  330. var data = {
  331. directionid: self.directionid,
  332. userid: self.userId,
  333. routeinfoid: self.routeinfoid,
  334. routeid: self.routeid,
  335. formeditid: ""
  336. }
  337. $http.post(apiurljs.login + "g2app/abase/queryDataLink", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  338. .success(function (obj) {
  339. var res = strToJson(s4.decryptData_CBC(obj.data));
  340. if (self.copyrightid == "") {
  341. self.copyrightid = res.data.LINKS[0].COPYRIGHTID
  342. }
  343. $.each(res.data.LINKS, function (index, item) {
  344. item.TEMPFORM = item.TEMPFORM + "&flowid=" + sp.getUrlName("flowid")
  345. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  346. if (item.TEMPFORM.indexOf("attachlist") > -1 || item.TEMPFORM.indexOf("fawenfile") > -1) {
  347. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  348. } else {
  349. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  350. }
  351. } else {
  352. item.TEMPFORM = "#";
  353. }
  354. self.SwenList.push(item)
  355. })
  356. self.SwenList.push({
  357. VNAME: "流程图",
  358. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  359. TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  360. })
  361. if (n == 0) {
  362. self.getFLOW()
  363. } else {
  364. self.getData()
  365. }
  366. })
  367. }
  368. self.getSwenList(0)
  369. self.getFLOW = function () {
  370. var data = {
  371. copyrightid: self.copyrightid
  372. }
  373. $http.post(apiurljs.login + "g2work/flow/queryDataByCopyrightid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  374. .success(function (obj) {
  375. var res = strToJson(s4.decryptData_CBC(obj.data));
  376. self.flowTitle = res.data.CNAME;
  377. self.getJJCD()
  378. })
  379. }
  380. self.getJJCD = function () {
  381. var data = {
  382. ckey: "CODE_JJCD",
  383. routeinfoid: self.routeinfoid
  384. }
  385. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  386. .success(function (obj) {
  387. var res = strToJson(s4.decryptData_CBC(obj.data));
  388. self.JJCD = res.data.CODE_JJCD;
  389. self.getXXGKSH()
  390. })
  391. }
  392. self.getXXGKSH = function () {
  393. var data = {
  394. ckey: "CODE_XXGKSH",
  395. routeinfoid: self.routeinfoid
  396. }
  397. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  398. .success(function (obj) {
  399. var res = strToJson(s4.decryptData_CBC(obj.data));
  400. self.XXGKSH = res.data.CODE_XXGKSH;
  401. self.getGWZL()
  402. })
  403. }
  404. self.getGWZL = function () {
  405. var data = {
  406. tablename: "CODE_GWTYPE",
  407. colums: "ID,CODE,CNAME,FLOWID,DOCFILE,REDFILE",
  408. order: "SORTID desc",
  409. sqlwhere: {
  410. USEMARK: 1,
  411. FLOWID: sp.getUrlName("flowid")
  412. },
  413. sqlinwhere: "",
  414. sqllikewhere: ""
  415. }
  416. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  417. .success(function (obj) {
  418. var res = strToJson(s4.decryptData_CBC(obj.data));
  419. console.log(res.data)
  420. self.GWZL = res.data;
  421. self.getSFXYJD()
  422. })
  423. }
  424. self.getSFXYJD = function () {
  425. var data = {
  426. ckey: "CODE_SFXYJD",
  427. routeinfoid: self.routeinfoid
  428. }
  429. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  430. .success(function (obj) {
  431. var res = strToJson(s4.decryptData_CBC(obj.data));
  432. self.SFXYJD = res.data.CODE_SFXYJD;
  433. self.getZDGKLM()
  434. })
  435. }
  436. self.getZDGKLM = function () {
  437. var data = {
  438. ckey: "CODE_ZDGKLM",
  439. routeinfoid: self.routeinfoid
  440. }
  441. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  442. .success(function (obj) {
  443. var res = strToJson(s4.decryptData_CBC(obj.data));
  444. self.ZDGKLM = res.data.CODE_ZDGKLM;
  445. self.getZDGKZT()
  446. })
  447. }
  448. self.getZDGKZT = function () {
  449. var data = {
  450. ckey: "CODE_ZDGKZT",
  451. routeinfoid: self.routeinfoid
  452. }
  453. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  454. .success(function (obj) {
  455. var res = strToJson(s4.decryptData_CBC(obj.data));
  456. self.ZDGKZT = res.data.CODE_ZDGKZT;
  457. self.getBGSFHYJ()
  458. })
  459. }
  460. self.getBGSFHYJ = function () {
  461. var data = {
  462. ckey: "CODE_BGSFHYJ",
  463. routeinfoid: self.routeinfoid
  464. }
  465. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  466. .success(function (obj) {
  467. var res = strToJson(s4.decryptData_CBC(obj.data));
  468. self.BGSFHYJ = res.data.CODE_BGSFHYJ;
  469. self.getUSAGE()
  470. })
  471. }
  472. //标签
  473. self.getUSAGE = function () {
  474. var data = {
  475. ckey: "CODE_SHOUWENLABEL",
  476. routeinfoid: self.routeinfoid
  477. }
  478. $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  479. .success(function (obj) {
  480. var res = strToJson(s4.decryptData_CBC(obj.data));
  481. self.USAGE = res.data.CODE_SHOUWENLABEL;
  482. $.each(self.USAGE, function (index, item) {
  483. item.checked = false;
  484. })
  485. self.getDP()
  486. })
  487. }
  488. self.getDP = function () {
  489. var data = {
  490. userid: self.userId
  491. }
  492. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  493. .success(function (obj) {
  494. var res = strToJson(s4.decryptData_CBC(obj.data));
  495. self.userDpName = res.data.length == 0 ? "" : res.data[0].SECTION;
  496. self.userDpCode = res.data.length == 0 ? "" : res.data[0].CODE;
  497. self.getData();
  498. })
  499. }
  500. //获取数据
  501. self.getData = function () {
  502. var data = {
  503. ckey: "FW_HYJY",
  504. id: 0,
  505. directionid: self.directionid,
  506. formeditid: self.formeditid,
  507. routeid: self.routeid,
  508. routeinfoid: self.routeinfoid
  509. }
  510. $http.post(apiurljs.login + "g2app/abase/queryData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  511. .success(function (obj) {
  512. var res = strToJson(s4.decryptData_CBC(obj.data));
  513. self.data = {
  514. ID: res.data.FW_HYJY.ID,
  515. APPCODE: res.data.FW_HYJY.APPCODE,
  516. JJCD: res.data.FW_HYJY.JJCD == "" ? self.JJCD[0].CODE : res.data.FW_HYJY.JJCD,
  517. FWZH: res.data.FW_HYJY.FWZH,
  518. FWZH1: res.data.FW_HYJY.FWZH,
  519. XXGKSH: res.data.FW_HYJY.XXGKSH == "" ? self.XXGKSH[0].CODE : res.data.FW_HYJY.XXGKSH,
  520. SFXYJD: res.data.FW_HYJY.SFXYJD == "" ? self.SFXYJD[0].CODE : res.data.FW_HYJY.SFXYJD,
  521. BGSFHYJ: res.data.FW_HYJY.BGSFHYJ == "" ? self.BGSFHYJ[0].CODE : res.data.FW_HYJY.BGSFHYJ,
  522. NGR: res.data.FW_HYJY.NGR == "" ? self.userName : res.data.FW_HYJY.NGR,
  523. NGRQ: res.data.FW_HYJY.NGRQ == "" || res.data.FW_HYJY.NGRQ ? sp.format(sp.getLocalDate()) : sp.format(res.data.FW_HYJY.NGRQ),
  524. GWZL: res.data.FW_HYJY.GWZL == "" ? self.GWZL[0].CODE : res.data.FW_HYJY.GWZL,
  525. YF: res.data.FW_HYJY.YF,
  526. BT: res.data.FW_HYJY.BT,
  527. ZS: res.data.FW_HYJY.ZS,
  528. CS: res.data.FW_HYJY.CS,
  529. NGRUSERID: res.data.FW_HYJY.NGRUSERID == "" ? self.userId : res.data.FW_HYJY.NGRUSERID,
  530. NGRBM: res.data.FW_HYJY.NGRBM == "" ? self.userDpName : res.data.FW_HYJY.NGRBM,
  531. NGRBMID: res.data.FW_HYJY.NGRBMID == "" ? self.userDpCode : res.data.FW_HYJY.NGRBMID,
  532. USAGE: res.data.FW_HYJY.USAGE,
  533. MQFMARK: res.data.FW_HYJY.MQFMARK
  534. }
  535. self.readonly = {
  536. JJCD: res.data.FW_HYJY["JJCD.EREADONLY"] == "true",
  537. WLDQFL: res.data.FW_HYJY["WLDQFL.EREADONLY"] == "true",
  538. WLDSSL: res.data.FW_HYJY["WLDSSL.EREADONLY"] == "true",
  539. XXGKSH: res.data.FW_HYJY["XXGKSH.EREADONLY"] == "true",
  540. SFXYJD: res.data.FW_HYJY["SFXYJD.EREADONLY"] == "true",
  541. FLSH: res.data.FW_HYJY["FLSH.EREADONLY"] == "true",
  542. GPJZSC: res.data.FW_HYJY["GPJZSC.EREADONLY"] == "true",
  543. BGSFHYJ: res.data.FW_HYJY["BGSFHYJ.EREADONLY"] == "true",
  544. SX: res.data.FW_HYJY["SX.EREADONLY"] == "true",
  545. BMFZRYJ: res.data.FW_HYJY["BMFZRYJ.EREADONLY"] == "true",
  546. NGR: res.data.FW_HYJY["NGR.EREADONLY"] == "true",
  547. NGRQ: res.data.FW_HYJY["NGRQ.EREADONLY"] == "true",
  548. HBCSYJ: res.data.FW_HYJY["HBCSYJ.EREADONLY"] == "true",
  549. GWZL: res.data.FW_HYJY["GWZL.EREADONLY"] == "true",
  550. YF: res.data.FW_HYJY["YF.EREADONLY"] == "true",
  551. BT: res.data.FW_HYJY["BT.EREADONLY"] == "true",
  552. ZS: res.data.FW_HYJY["ZS.EREADONLY"] == "true",
  553. CS: res.data.FW_HYJY["CS.EREADONLY"] == "true",
  554. FWZH: res.data.FW_HYJY["FWZH.EREADONLY"] == "true",
  555. USAGE: res.data.FW_HYJY["USAGE.EREADONLY"] == "true"
  556. }
  557. self.show = {
  558. JJCD: res.data.FW_HYJY["JJCD.ESHOW"] == "true",
  559. WLDQFL: res.data.FW_HYJY["WLDQFL.ESHOW"] == "true",
  560. WLDSSL: res.data.FW_HYJY["WLDSSL.ESHOW"] == "true",
  561. XXGKSH: res.data.FW_HYJY["XXGKSH.ESHOW"] == "true",
  562. SFXYJD: res.data.FW_HYJY["SFXYJD.ESHOW"] == "true",
  563. FLSH: res.data.FW_HYJY["FLSH.ESHOW"] == "true",
  564. GPJZSC: res.data.FW_HYJY["GPJZSC.ESHOW"] == "true",
  565. BGSFHYJ: res.data.FW_HYJY["BGSFHYJ.ESHOW"] == "true",
  566. SX: res.data.FW_HYJY["SX.ESHOW"] == "true",
  567. BMFZRYJ: res.data.FW_HYJY["BMFZRYJ.ESHOW"] == "true",
  568. NGR: res.data.FW_HYJY["NGR.ESHOW"] == "true",
  569. NGRQ: res.data.FW_HYJY["NGRQ.ESHOW"] == "true",
  570. HBCSYJ: res.data.FW_HYJY["HBCSYJ.ESHOW"] == "true",
  571. GWZL: res.data.FW_HYJY["GWZL.ESHOW"] == "true",
  572. YF: res.data.FW_HYJY["YF.ESHOW"] == "true",
  573. BT: res.data.FW_HYJY["BT.ESHOW"] == "true",
  574. ZS: res.data.FW_HYJY["ZS.ESHOW"] == "true",
  575. CS: res.data.FW_HYJY["CS.ESHOW"] == "true",
  576. FWZH: res.data.FW_HYJY["FWZH.ESHOW"] == "true",
  577. USAGE: res.data.FW_HYJY["USAGE.ESHOW"] == "true"
  578. }
  579. self.selectUSAGEs = self.data.USAGE != "" && self.data.USAGE != null ? self.data.USAGE.split(",") : [];
  580. $.each(self.USAGE, function (index, item) {
  581. if (self.data.USAGE && self.data.USAGE.indexOf(item.CODE) != -1) {
  582. item.checked = true;
  583. }
  584. })
  585. $timeout(function () {
  586. $(".sp-checkbox-blue input[name=USAGE]").each(function () {
  587. if (self.data.USAGE.indexOf($(this).val()) != -1) {
  588. $(this).attr("checked", true);
  589. $(this).parent("label").addClass("chb-blue-checked");
  590. }
  591. })
  592. }, 0)
  593. if (self.data.ID == 0) {
  594. self.filedChange = true;
  595. } else {
  596. self.filedChange = false;
  597. }
  598. var buttonList = [{ CNAME: "转发", CODE: "array", data: [] }];
  599. res.data["FW_HYJY.FUNCLIST"].forEach(function (item) {
  600. if (item.BUTTONGROUP == "FORMITEM") {
  601. buttonList.push(item)
  602. } else {
  603. buttonList[0].data.push(item)
  604. }
  605. })
  606. if (buttonList[0].data.length == 0) {
  607. buttonList = buttonList.slice(1)
  608. } else if (buttonList[0].data.length == 1) {
  609. buttonList[0] = buttonList[0].data[0]
  610. }
  611. console.log(buttonList)
  612. self.buttonList = buttonList;//res.data["FW_HYJY.FUNCLIST"];
  613. if (self.lastrouteinfoid != 0) {
  614. self.getHB()
  615. }
  616. self.getOpinion1(0)
  617. self.getOther()
  618. self.getGLJ(0)
  619. self.getGCG(0)
  620. self.getCWG()
  621. self.getQZG()
  622. if (self.docmode == 'zihao' || self.data.FWZH1 != "") {
  623. self.getFWZH()
  624. }
  625. self.getMeetMsg()
  626. $interval(function () {
  627. self.getNumMeet()
  628. }, 2000)
  629. console.log(!self.hide('show','FWZH'))
  630. $timeout(function () {
  631. $(".formedit center").css("height", $(".formedit center").parent().next("div").height() - $(".formedit center").parent().next("div").children().eq(0).height()).css("line-height", $(".formedit center").next("div").height() / 6 + "px")
  632. var height1 = $(".formedit center").css("height"), height2 = 0;
  633. $(".auto").siblings().each(function () {
  634. height2 = height2 + $(this).outerHeight();
  635. })
  636. if (height1.slice(0, height1.length - 2) - height2 < 277) {
  637. $(".auto").css("height", 277);
  638. $(".formedit center").css("height", $(".formedit center").height() + (277 - (height1.slice(0, height1.length - 2) - height2)))
  639. } else {
  640. $(".auto").css("height", height1.slice(0, height1.length - 2) - height2);
  641. }
  642. }, 100)
  643. })
  644. }
  645. self.getFWZH = function () {
  646. var data = {
  647. flowid: sp.getUrlName("flowid"),
  648. code: "",
  649. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  650. routeinfoidmark: self.routeinfoid,
  651. zihao: self.data.FWZH
  652. }
  653. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  654. .success(function (obj) {
  655. var res = strToJson(s4.decryptData_CBC(obj.data));
  656. self.FWZH = res.data.map(function (item) {
  657. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  658. });
  659. if (self.data.FWZH == "") { self.data.FWZH = self.FWZH[0].CODE }
  660. })
  661. }
  662. //生成左侧合并文件
  663. self.getHB = function () {
  664. if (self.data.MQFMARK == 1) {
  665. var data = {
  666. routeinfoid: self.routeinfoid
  667. }
  668. $http.post(apiurljs.login + "g2app/dataabase/mergeOFDByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  669. .success(function (obj) {
  670. var res = strToJson(s4.decryptData_CBC(obj.data));
  671. if (res.data != "") {
  672. let postData = {
  673. convertType: 570,
  674. fileUrl: res.data,
  675. isPrint: 1,
  676. isDownload: 1,
  677. };
  678. var postCfg_transfer = {
  679. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  680. transformRequest: function (data) {
  681. return $.param(data);
  682. }
  683. };
  684. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  685. .success(function (res) {
  686. self.LoadYZ = false;
  687. if (res.errorcode === 0) {
  688. self.iframeList[0] = { id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } };
  689. self.iframeLast = self.iframeList.length - 1;
  690. self.iframeShow = self.iframeList.length;
  691. self.iframeHide = self.iframeList.length - self.iframeShow;
  692. } else {
  693. sp.dialog(res.message);
  694. }
  695. });
  696. } else {
  697. var data = {
  698. routeinfoid: self.routeinfoid
  699. }
  700. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoidWithCurrentRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  701. .success(function (obj) {
  702. var res = strToJson(s4.decryptData_CBC(obj.data));
  703. if (res.data != "") {
  704. let postData = {
  705. convertType: 20,
  706. fileUrl: res.data,
  707. isPrint: 1,
  708. isDownload: 1,
  709. };
  710. var postCfg_transfer = {
  711. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  712. transformRequest: function (data) {
  713. return $.param(data);
  714. }
  715. };
  716. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  717. .success(function (res) {
  718. self.LoadYZ = false;
  719. if (res.errorcode === 0) {
  720. self.iframeList[0] = { id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } };
  721. self.iframeLast = self.iframeList.length - 1;
  722. self.iframeShow = self.iframeList.length;
  723. self.iframeHide = self.iframeList.length - self.iframeShow;
  724. } else {
  725. sp.dialog(res.message);
  726. }
  727. });
  728. }
  729. })
  730. }
  731. })
  732. } else {
  733. var data = {
  734. routeinfoid: self.routeinfoid
  735. }
  736. $http.post(apiurljs.login + "g2app/dataabase/mergeFileByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  737. .success(function (obj) {
  738. var res = strToJson(s4.decryptData_CBC(obj.data));
  739. if (res.data.result != "") {
  740. let postData = {
  741. convertType: res.data.mark == "ofd" ? 570 : 20,
  742. isDownload: 1,
  743. isPrint: 1,
  744. fileUrl: res.data.result
  745. };
  746. var postCfg_transfer = {
  747. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  748. transformRequest: function (data) {
  749. return $.param(data);
  750. }
  751. };
  752. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  753. .success(function (res) {
  754. if (res.errorcode === 0) {
  755. self.iframeList = [{ id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } }];
  756. self.iframeLast = self.iframeList.length - 1;
  757. self.iframeShow = self.iframeList.length;
  758. self.iframeHide = self.iframeList.length - self.iframeShow;
  759. } else {
  760. sp.dialog(res.message);
  761. }
  762. });
  763. } else {
  764. var data = {
  765. routeinfoid: self.routeinfoid
  766. }
  767. $http.post(apiurljs.login + "g2app/dataabase/mergePDFByLastRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  768. .success(function (obj) {
  769. var res = strToJson(s4.decryptData_CBC(obj.data));
  770. if (res.data.result != "") {
  771. let postData = {
  772. convertType: res.data.mark == "ofd" ? 570 : 20,
  773. isDownload: 1,
  774. isPrint: 1,
  775. fileUrl: res.data.result
  776. };
  777. var postCfg_transfer = {
  778. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  779. transformRequest: function (data) {
  780. return $.param(data);
  781. }
  782. };
  783. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  784. .success(function (res) {
  785. if (res.errorcode === 0) {
  786. self.iframeList = [{ id: 1, title: "签报收文", filename: "文档", url: $sce.trustAsResourceUrl(sp.ipChange(res.data.viewUrl)), source: res.data.viewUrl, edit: false, show: 1, boxStyle: { width: $(".leftBox").width() }, iframeStyle: { width: $(".leftBox").width() - 10 } }];
  787. self.iframeLast = self.iframeList.length - 1;
  788. self.iframeShow = self.iframeList.length;
  789. self.iframeHide = self.iframeList.length - self.iframeShow;
  790. } else {
  791. sp.dialog(res.message);
  792. }
  793. });
  794. }
  795. })
  796. }
  797. })
  798. }
  799. }
  800. //获取关联文稿
  801. self.getGLJ = function (n) {
  802. var data = {
  803. dockind: "D01",
  804. routeinfoid: self.routeinfoid
  805. }
  806. $http.post(apiurljs.login + "g2app/fawenfilesrelate/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  807. .success(function (obj) {
  808. var res = strToJson(s4.decryptData_CBC(obj.data));
  809. self.guanlian = res.data;
  810. if (n == 0) {
  811. self.getGLFLOW()
  812. }
  813. if (n == 2) {
  814. self.editFile(self.guanlian[self.guanlian.length - 1], 2)
  815. }
  816. })
  817. }
  818. self.seeGLJ = function () {
  819. if ($(".formedit2").find("iframe").attr("src") == "") {
  820. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  821. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  822. } else {
  823. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  824. }
  825. var data = {
  826. method: 1,
  827. params: {
  828. userId: self.userName,
  829. fileId: "",
  830. fileName: "",
  831. filePath: "",
  832. userRight: self.dotype != 1 ? 1 : 0,
  833. callbackUrl: ""
  834. }
  835. };
  836. if (self.guanlian[0].FILEURL.indexOf("files") > -1) {
  837. data.params.fileId = self.guanlian[0].FILEURL.split("/")[2];
  838. data.params.fileName = self.guanlian[0].FILEURL.split("/")[3];
  839. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.guanlian[0].FILEURL.slice(7);
  840. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  841. } else {
  842. data.params.fileId = self.guanlian[0].ID;
  843. data.params.fileName = self.guanlian[0].FILENAMES;
  844. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.guanlian[0].FILEURL;
  845. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  846. }
  847. $.ajax({
  848. url: apiurljs.yzFileWo + "api.do",
  849. data: {
  850. jsonParams: encodeURIComponent(JSON.stringify(data))
  851. },
  852. type: "POST",
  853. dataType: "json",
  854. general: false,
  855. async: false,
  856. success: function (data) {
  857. if (data) {
  858. if (data.errorCode === "0") {
  859. let rst = data.result;
  860. if (rst && rst.urls) {
  861. var get_urls = rst.urls;
  862. if (typeof (get_urls) === "string") {
  863. $(".formedit2").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.guanlian[0].ID)
  864. }
  865. }
  866. }
  867. }
  868. },
  869. });
  870. }
  871. }
  872. //获取关联流程
  873. self.getGLFLOW = function () {
  874. var data = {
  875. userid: self.userId,
  876. routeinfoid: self.routeinfoid
  877. }
  878. $http.post(apiurljs.login + "g2work/routeinfo/queryDataRelatedFlow", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  879. .success(function (obj) {
  880. var res = strToJson(s4.decryptData_CBC(obj.data));
  881. res.data.FLOWIN.forEach(function (item) {
  882. item.type = "FLOWIN"
  883. })
  884. res.data.FLOWOUT.forEach(function (item) {
  885. item.type = "FLOWOUT"
  886. })
  887. self.glList = res.data.FLOWIN.concat(res.data.FLOWOUT);
  888. })
  889. }
  890. //获取意见(不上表)
  891. self.getOpinion1 = function (n) {
  892. self.HWFJ = [];
  893. var data = {
  894. cmanid: self.userId,
  895. routeinfoid: self.routeinfoid,
  896. routeid: "",//self.routeid,
  897. tableid: "FW_HYJY",
  898. colid: "",
  899. opiniontype: "",//self.opiniontype,
  900. orderbycol: "CDATE desc"
  901. }
  902. $http.post(apiurljs.login + "g2app/abase/queryDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  903. .success(function (obj) {
  904. var res = strToJson(s4.decryptData_CBC(obj.data));
  905. if (res.success == true) {
  906. for (var i in self.YJ) {
  907. if (typeof (self.YJ[i]) == "object") {
  908. self.YJ[i] = [];
  909. self.YJ[i + "STATUS"] = false;
  910. res.data.forEach(function (item) {
  911. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  912. if (i == item.COLID) {
  913. self.YJ[i].push(item)
  914. if (item.ROUTEID == self.routeid) {
  915. self.data[i] = item.opinion;
  916. self.YJ[i + "STATUS"] = true;
  917. }
  918. }
  919. })
  920. }
  921. }
  922. self.YJ.nulla = res.data.filter(function (item) {
  923. return item.COLID == "";
  924. });
  925. self.YJ.nullaSTATUS = false;
  926. self.YJ.nulla.forEach(function (item) {
  927. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  928. if (self.activeOpinion != null) {
  929. self.activeOpinion.FILEDATA = item.FILEDATA
  930. }
  931. })
  932. res.data.forEach(function (item) {
  933. item.FILEDATA.forEach(function (item1) {
  934. self.HWFJ.push(item1)
  935. })
  936. })
  937. //if (n == 1 && self.lastrouteinfoid != 0) {
  938. // self.getHB()
  939. //}
  940. } else {
  941. sp.dialog(res.message)
  942. }
  943. })
  944. }
  945. //获取附件和插件
  946. self.getOther = function () {
  947. if (self.routeinfoid == 0) { return }
  948. var data = {
  949. tablename: "FILE_ATTACH",
  950. colums: "*",
  951. order: "ID asc",
  952. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  953. sqlinwhere: "",
  954. sqllikewhere: ""
  955. }
  956. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  957. .success(function (obj) {
  958. var res = strToJson(s4.decryptData_CBC(obj.data));
  959. self.arrayFile1 = [];
  960. if (res.data.length > 0) {
  961. res.data.forEach(function (item) {
  962. if (item.ATTACHTYPE.indexOf("-正文") == -1) {
  963. self.arrayFile1.push(item)
  964. }
  965. })
  966. }
  967. })
  968. }
  969. //发文打开过程稿在线编辑
  970. self.getGCG = function (n) {
  971. var data = {
  972. dockind: "D01",
  973. routeinfoid: self.routeinfoid
  974. }
  975. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  976. .success(function (obj) {
  977. var res = strToJson(s4.decryptData_CBC(obj.data));
  978. self.gaoTypeArrayFirst = res.data;
  979. self.gaoTypeArrayFirst.forEach(function (item) {
  980. if (item.FILENAMES.split(".").length == 1) {
  981. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  982. }
  983. })
  984. if (self.gaoTypeArrayFirst.length > 0 && self.lastrouteinfoid == 0) {
  985. self.seeGCG()
  986. }
  987. if (n > 0) {
  988. self.editFile(self.gaoTypeArrayFirst[0], 1, "正文");
  989. }
  990. if (self.gaoTypeArrayFirst.length > 1) {
  991. var data = {
  992. id: self.gaoTypeArrayFirst[0].ID
  993. }
  994. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  995. .success(function (obj) {
  996. var res = strToJson(s4.decryptData_CBC(obj.data));
  997. if (res.success) {
  998. self.getGCG(2)
  999. }
  1000. });
  1001. }
  1002. })
  1003. }
  1004. self.seeGCG = function () {
  1005. if ($(".formedit1").find("iframe").attr("src") == "") {
  1006. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1007. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1008. } else {
  1009. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1010. }
  1011. var data = {
  1012. method: 1,
  1013. params: {
  1014. userId: self.userName,
  1015. fileId: "",
  1016. fileName: "",
  1017. filePath: "",
  1018. userRight: self.dotype != 1 ? 1 : 0,
  1019. callbackUrl: ""
  1020. }
  1021. };
  1022. if (self.gaoTypeArrayFirst[0].FILEURL.indexOf("files") > -1) {
  1023. data.params.fileId = self.gaoTypeArrayFirst[0].FILEURL.split("/")[2];
  1024. data.params.fileName = self.gaoTypeArrayFirst[0].FILEURL.split("/")[3];
  1025. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + self.gaoTypeArrayFirst[0].FILEURL.slice(7);
  1026. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  1027. } else {
  1028. data.params.fileId = self.gaoTypeArrayFirst[0].ID;
  1029. data.params.fileName = self.gaoTypeArrayFirst[0].FILENAMES;
  1030. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + self.gaoTypeArrayFirst[0].FILEURL;
  1031. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  1032. }
  1033. $.ajax({
  1034. url: apiurljs.yzFileWo + "api.do",
  1035. data: {
  1036. jsonParams: encodeURIComponent(JSON.stringify(data))
  1037. },
  1038. type: "POST",
  1039. dataType: "json",
  1040. general: false,
  1041. async: false,
  1042. success: function (data) {
  1043. if (data) {
  1044. if (data.errorCode === "0") {
  1045. let rst = data.result;
  1046. if (rst && rst.urls) {
  1047. var get_urls = rst.urls;
  1048. if (typeof (get_urls) === "string") {
  1049. $(".formedit1").find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", self.gaoTypeArrayFirst[0].ID)
  1050. }
  1051. }
  1052. }
  1053. }
  1054. },
  1055. });
  1056. }
  1057. }
  1058. //成文稿
  1059. self.getCWG = function () {
  1060. var data = {
  1061. dockind: "D02",
  1062. routeinfoid: self.routeinfoid
  1063. }
  1064. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1065. .success(function (obj) {
  1066. var res = strToJson(s4.decryptData_CBC(obj.data));
  1067. self.gaoTypeArraySecond = res.data;
  1068. self.gaoTypeArraySecond.forEach(function (item) {
  1069. if (item.FILENAMES.split(".").length == 1) {
  1070. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1071. }
  1072. })
  1073. })
  1074. }
  1075. //签章稿
  1076. self.getQZG = function () {
  1077. var data = {
  1078. dockind: "D03",
  1079. routeinfoid: self.routeinfoid
  1080. }
  1081. $http.post(apiurljs.login + "g2app/fawenfiles/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1082. .success(function (obj) {
  1083. var res = strToJson(s4.decryptData_CBC(obj.data));
  1084. self.gaoTypeArrayThird = res.data;
  1085. self.gaoTypeArrayThird.forEach(function (item) {
  1086. if (item.FILENAMES.split(".").length == 1) {
  1087. item.FILENAMES = item.FILENAMES + "." + item.FILEEXT
  1088. }
  1089. })
  1090. })
  1091. }
  1092. //下载正文/终稿/签章
  1093. self.downloadWG = function (item) {
  1094. //window.open(apiurljs.login.split("glwork/")[0] + "glworkweb/" + item.FILEURL)
  1095. window.open(apiurljs.login + "g2work/gaizhangfiles/" + encodeURIComponent(self.data.BT) + "/" + item.FILENAMES)
  1096. }
  1097. //删除正文/终稿/签章
  1098. self.btnDeleteWG = function (obj, n) {
  1099. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1100. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  1101. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1102. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1103. sp.openCenter(".sp-dialog");
  1104. ///取消按钮
  1105. $('.sp-closeDialog').click(function (event) {
  1106. sp.closeCenter(".sp-dialog");
  1107. event.preventDefault();
  1108. event.stopPropagation();
  1109. });
  1110. //post消息的id
  1111. $("#delDataTrue").click(function () {
  1112. var data = {
  1113. id: obj.ID
  1114. }
  1115. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1116. .success(function (obj) {
  1117. var res = strToJson(s4.decryptData_CBC(obj.data));
  1118. sp.dialoghide();
  1119. if (res.success) {
  1120. if (n == 2) {
  1121. self.getCWG()
  1122. } else if (n == 3) {
  1123. self.getQZG()
  1124. }
  1125. } else {
  1126. sp.dialog("创建失败,请联系管理员!");
  1127. }
  1128. ///
  1129. });
  1130. });
  1131. };
  1132. //生成正文三种方式:空白模板,红头模板,上传本地文件
  1133. self.newMoBanFlag = false;
  1134. self.newMoBan1 = function () {
  1135. self.newMoBanFlag = true;
  1136. if (self.gaoTypeArrayFirst.length > 0) {
  1137. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1138. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1139. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1140. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1141. sp.openCenter(".sp-dialog");
  1142. ///取消按钮
  1143. $('.sp-closeDialog').click(function (event) {
  1144. sp.closeCenter(".sp-dialog");
  1145. event.preventDefault();
  1146. event.stopPropagation();
  1147. });
  1148. //post消息的id
  1149. $("#delDataTrue").click(function () {
  1150. sp.closeCenter(".sp-dialog");
  1151. var data = {
  1152. id: self.gaoTypeArrayFirst[0].ID
  1153. }
  1154. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1155. .success(function (obj) {
  1156. var res = strToJson(s4.decryptData_CBC(obj.data));
  1157. if (res.success) {
  1158. var data = {
  1159. dockind: "D01",
  1160. routeinfoid: self.routeinfoid,
  1161. gwtype: self.data.GWZL,
  1162. filekind: "DOCFILE"
  1163. }
  1164. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1165. .success(function (obj) {
  1166. var res = strToJson(s4.decryptData_CBC(obj.data));
  1167. if (res.success) {
  1168. self.getGCG(1)
  1169. } else {
  1170. sp.dialog("创建失败,请联系管理员!");
  1171. }
  1172. });
  1173. } else {
  1174. sp.dialog("创建失败,请联系管理员!");
  1175. }
  1176. self.newMoBanFlag = false;
  1177. });
  1178. })
  1179. } else {
  1180. var data = {
  1181. dockind: "D01",
  1182. routeinfoid: self.routeinfoid,
  1183. gwtype: self.data.GWZL,
  1184. filekind: "DOCFILE"
  1185. }
  1186. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1187. .success(function (obj) {
  1188. var res = strToJson(s4.decryptData_CBC(obj.data));
  1189. if (res.success) {
  1190. self.getGCG(1)
  1191. } else {
  1192. sp.dialog("创建失败,请联系管理员!");
  1193. }
  1194. self.newMoBanFlag = false;
  1195. });
  1196. }
  1197. }
  1198. self.newMoBan2 = function () {
  1199. self.newMoBanFlag = true;
  1200. if (self.gaoTypeArrayFirst.length > 0) {
  1201. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1202. var dialogBody = "<div class=\"sp-dialog-body\">您确定要覆盖正文吗?</div>";
  1203. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1204. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1205. sp.openCenter(".sp-dialog");
  1206. ///取消按钮
  1207. $('.sp-closeDialog').click(function (event) {
  1208. sp.closeCenter(".sp-dialog");
  1209. event.preventDefault();
  1210. event.stopPropagation();
  1211. });
  1212. //post消息的id
  1213. $("#delDataTrue").click(function () {
  1214. sp.closeCenter(".sp-dialog");
  1215. var data = {
  1216. id: self.gaoTypeArrayFirst[0].ID
  1217. }
  1218. $http.post(apiurljs.login + "g2app/fawenfiles/deleteDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1219. .success(function (obj) {
  1220. var res = strToJson(s4.decryptData_CBC(obj.data));
  1221. if (res.success) {
  1222. var data = {
  1223. dockind: "D01",
  1224. routeinfoid: self.routeinfoid,
  1225. gwtype: self.data.GWZL,
  1226. filekind: "REDFILE"
  1227. }
  1228. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1229. .success(function (obj) {
  1230. var res = strToJson(s4.decryptData_CBC(obj.data));
  1231. if (res.success) {
  1232. self.getGCG(1)
  1233. } else {
  1234. sp.dialog("创建失败,请联系管理员!");
  1235. }
  1236. });
  1237. } else {
  1238. sp.dialog("创建失败,请联系管理员!");
  1239. }
  1240. self.newMoBanFlag = false;
  1241. });
  1242. })
  1243. } else {
  1244. var data = {
  1245. dockind: "D01",
  1246. routeinfoid: self.routeinfoid,
  1247. gwtype: self.data.GWZL,
  1248. filekind: "REDFILE"
  1249. }
  1250. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1251. .success(function (obj) {
  1252. var res = strToJson(s4.decryptData_CBC(obj.data));
  1253. if (res.success) {
  1254. self.getGCG(1)
  1255. } else {
  1256. sp.dialog("创建失败,请联系管理员!");
  1257. }
  1258. self.newMoBanFlag = false;
  1259. });
  1260. }
  1261. }
  1262. //判断页面字段是否只读readonly、是否隐藏show
  1263. self.hide = function (type, field) {
  1264. if (self.dotype == 0 && type == "readonly") {
  1265. return true;
  1266. } else {
  1267. if (self[type][field] == true) {
  1268. return true;
  1269. } else {
  1270. return false;
  1271. }
  1272. }
  1273. }
  1274. //右上角按钮调用方法
  1275. self.btnEvent = function (item) {
  1276. switch (item.CODE) {
  1277. case "SAVEITEM": self.btnSave(0); break;
  1278. case "PRINTITEM": self.btnPrint(); break;
  1279. case "PRINTITEMEXTEND": self.btnPrint1(); break;
  1280. case "SAVEOFD": self.toOFD(); break;
  1281. case "GAIZITEM": self.qianZ(); break;
  1282. case "MEETITEM": self.Meet(); break;
  1283. case "SENDLOG": self.RouteList(); break;
  1284. default: self.forward(item); break;
  1285. }
  1286. }
  1287. //生成终稿
  1288. self.toOFD = function () {
  1289. if (self.gaoTypeArraySecond.length != 0) {
  1290. sp.dialog("请删除成文稿后,点击文件保存!")
  1291. $timeout(function () {
  1292. sp.dialoghide()
  1293. }, 1000)
  1294. return
  1295. }
  1296. var data = {
  1297. routeinfoid: self.routeinfoid,
  1298. gwtype: self.data.GWZL,
  1299. dockind: "D02"
  1300. }
  1301. $http.post(apiurljs.login + "g2app/fawenfiles/convertDataFinalOFDFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1302. .success(function (obj) {
  1303. var res = strToJson(s4.decryptData_CBC(obj.data));
  1304. if (res.success == true) {
  1305. self.getCWG()
  1306. }
  1307. })
  1308. }
  1309. //签章
  1310. self.qianZ = function () {
  1311. if (self.gaoTypeArrayThird.length != 0 || self.gaoTypeArraySecond.length != 0) {
  1312. sp.dialog("请删除终稿、签章稿后,点击签章!")
  1313. $timeout(function () {
  1314. sp.dialoghide()
  1315. }, 1000)
  1316. return
  1317. }
  1318. var data = {
  1319. //srcpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach/" + self.gaoTypeArraySecond[0].FILENAMES,
  1320. //outpath: "/opt/TongWeb7.0/applications/glworkweb/UploadAttach",
  1321. routeinfoid: self.routeinfoid,
  1322. gwtype: self.data.GWZL,
  1323. dockind: "D02"
  1324. }
  1325. //$http.post(apiurljs.login + "g2app/signature/getSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1326. $http.post(apiurljs.login + "g2app/signature/convertDataFinalOFDFileAndgetSignature", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1327. .success(function (obj) {
  1328. var res = strToJson(s4.decryptData_CBC(obj.data));
  1329. if (res.success == true) {
  1330. sp.dialog("生成成功!")
  1331. self.getCWG()
  1332. self.getQZG()
  1333. }
  1334. })
  1335. }
  1336. //打开公文模板弹窗
  1337. self.openGLJ = function () {
  1338. $("#GLJWin").attr("src", "../../forward/GLJ.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "&copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&cookie=shouwenbg")
  1339. sp.layer("#GLJ")
  1340. }
  1341. self.tiaohao = function () {
  1342. var data = {
  1343. data: {
  1344. CYEAR: sp.currentYear(),
  1345. FLOWID: sp.getUrlName("flowid"),
  1346. ZIHAO: "",
  1347. CNAMEMARK: "",
  1348. ROUTEINFOIDMARK: self.routeinfoid,
  1349. THMARK: 1
  1350. }
  1351. }
  1352. self.FWZH.forEach(function (item) {
  1353. if (item.CODE == self.data.FWZH) {
  1354. data.data.ZIHAO = item.CODE;
  1355. data.data.CNAMEMARK = item.CNAMEMARK
  1356. }
  1357. })
  1358. $http.post(apiurljs.login + "g2app/fawen/saveZhanHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1359. .success(function (obj) {
  1360. var res = strToJson(s4.decryptData_CBC(obj.data));
  1361. if (res.success == true) {
  1362. var data1 = {
  1363. flowid: sp.getUrlName("flowid"),
  1364. code: self.data.NGRBMID,
  1365. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1366. routeinfoidmark: self.routeinfoid,
  1367. zihao: self.data.FWZH
  1368. }
  1369. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1370. .success(function (obj1) {
  1371. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1372. self.FWZH = res1.data.map(function (item) {
  1373. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1374. });
  1375. self.data.FWZH = self.FWZH[0].CODE
  1376. self.btnSave(0)
  1377. })
  1378. } else {
  1379. sp.dialog(res.message)
  1380. }
  1381. })
  1382. }
  1383. self.tiaohaoR = function () {
  1384. var data = {
  1385. flowid: sp.getUrlName("flowid"),
  1386. cnamemark: "",
  1387. routeinfoidmark: self.routeinfoid,
  1388. cyear: sp.currentYear(),
  1389. zihao: self.data.FWZH
  1390. }
  1391. self.FWZH.forEach(function (item) {
  1392. if (item.CODE == self.data.FWZH) {
  1393. data.cnamemark = item.CNAMEMARK
  1394. }
  1395. })
  1396. $http.post(apiurljs.login + "g2app/fawen/initZiHaoByRouteinfoidmark", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1397. .success(function (obj) {
  1398. var res = strToJson(s4.decryptData_CBC(obj.data));
  1399. if (res.success == true) {
  1400. if (res.data == 0) {
  1401. sp.dialog("此件当前暂无占号记录!")
  1402. $timeout(function () {
  1403. sp.dialoghide()
  1404. }, 1500)
  1405. return
  1406. }
  1407. var data1 = {
  1408. flowid: sp.getUrlName("flowid"),
  1409. code: self.data.NGRBMID,
  1410. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1411. routeinfoidmark: self.routeinfoid,
  1412. zihao: ""
  1413. }
  1414. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1415. .success(function (obj1) {
  1416. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1417. self.FWZH = res1.data.map(function (item) {
  1418. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1419. });
  1420. self.data.FWZH = self.FWZH[0].CODE
  1421. self.btnSave(0)
  1422. console.log(self.FWZH)
  1423. })
  1424. } else {
  1425. sp.dialog(res.message)
  1426. }
  1427. })
  1428. }
  1429. self.tiaohaoD = function () {
  1430. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  1431. var dialogBody = "<div class=\"sp-dialog-body\">您确定要清除吗?</div>";
  1432. var dialogFoot = "<div class=\"sp-dialog-foot\"><input id='delDataTrue' type='button' value='确 认' class='sp-dialog-btnTrue' /><input type='button' value='取 消' class='sp-dialog-btnCancle sp-closeDialog' /></div>";
  1433. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  1434. sp.openCenter(".sp-dialog");
  1435. ///取消按钮
  1436. $('.sp-closeDialog').click(function (event) {
  1437. sp.closeCenter(".sp-dialog");
  1438. event.preventDefault();
  1439. event.stopPropagation();
  1440. });
  1441. //post消息的id
  1442. $("#delDataTrue").click(function () {
  1443. sp.closeCenter(".sp-dialog");
  1444. var data = {
  1445. routeinfoid: self.routeinfoid,
  1446. tablename: "FW_HYJY",
  1447. colfwname: "FWZH",
  1448. flowid: sp.getUrlName("flowid")
  1449. }
  1450. $http.post(apiurljs.login + "g2app/shouwen/deleteFWCodeByRouteinfoid", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1451. .success(function (obj) {
  1452. var res = strToJson(s4.decryptData_CBC(obj.data));
  1453. if (res.success == true) {
  1454. var data1 = {
  1455. flowid: sp.getUrlName("flowid"),
  1456. code: self.data.NGRBMID,
  1457. cyear: self.data.FWZH == "" ? sp.currentYear() : self.data.FWZH.slice(self.data.FWZH.indexOf("〔") + 1, self.data.FWZH.indexOf("〕")),
  1458. routeinfoidmark: self.routeinfoid,
  1459. zihao: self.data.FWZH
  1460. }
  1461. $http.post(apiurljs.login + "g2app/fawen/queryZiHaoCode", { data: s4.encryptData_CBC(JSON.stringify(data1)) }, postCfg)
  1462. .success(function (obj1) {
  1463. var res1 = strToJson(s4.decryptData_CBC(obj1.data));
  1464. self.FWZH = res1.data.map(function (item) {
  1465. return { CNAME: item.split("|")[0], CODE: item.split("|")[0], CNAMEMARK: item.split("|")[1] }
  1466. });
  1467. self.data.FWZH = "";
  1468. self.data.FWZH1 = "";
  1469. })
  1470. }
  1471. })
  1472. })
  1473. }
  1474. //保存提交
  1475. self.btnSave = function (n) {
  1476. if (spngvld.submit(".formedit")) {
  1477. if (self.docmode == 'zihao' && self.data.FWZH != "") {
  1478. var data = {
  1479. data: {
  1480. CYEAR: sp.currentYear(),
  1481. FLOWID: sp.getUrlName("flowid"),
  1482. ZIHAO: "",
  1483. CNAMEMARK: "",
  1484. ROUTEINFOIDMARK: self.routeinfoid
  1485. }
  1486. }
  1487. self.FWZH.forEach(function (item) {
  1488. if (item.CODE == self.data.FWZH) {
  1489. data.data.ZIHAO = item.CODE;
  1490. data.data.CNAMEMARK = item.CNAMEMARK
  1491. }
  1492. })
  1493. $http.post(apiurljs.login + "g2app/fawen/saveWenHaoByData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1494. .success(function (obj) { })
  1495. }
  1496. var dataArray = [];
  1497. dataArray.push(self.data);
  1498. var data = {
  1499. ckey: "FW_HYJY",
  1500. id: self.data.ID,
  1501. routeid: self.routeid,
  1502. routeinfoid: self.routeinfoid,
  1503. routeinfotitle: self.data.BT.replace(/\n/g, '').replace(/\s/g, ''),//self.data.ZT,
  1504. directionid: self.directionid,
  1505. formeditid: self.formeditid,
  1506. data: JSON.stringify(dataArray)
  1507. }
  1508. $http.post(apiurljs.login + "g2app/abase/saveData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1509. .success(function (obj) {
  1510. var res = strToJson(s4.decryptData_CBC(obj.data));
  1511. if (res.code == 0) {
  1512. self.data.ID = res.data.ID;
  1513. self.routeid = res.data.ROUTEID;
  1514. self.routeinfoid = res.data.ROUTEINFOID;
  1515. // if (self.lastrouteinfoid == 0) {
  1516. // self.getHB()
  1517. // }
  1518. self.filedChange = false;
  1519. if (self.gaoTypeArrayFirst.length == 0) {
  1520. var data = {
  1521. dockind: "D01",
  1522. routeinfoid: self.routeinfoid,
  1523. gwtype: self.data.GWZL,
  1524. filekind: "DOCFILE"
  1525. }
  1526. $http.post(apiurljs.login + "g2app/fawenfiles/newDataFile", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1527. .success(function (obj) {
  1528. var res = strToJson(s4.decryptData_CBC(obj.data));
  1529. if (res.success) {
  1530. if (n == 0) {
  1531. sp.dialog("保存成功!");
  1532. $timeout(function () {
  1533. sp.dialoghide()
  1534. }, 1500)
  1535. self.getSwenList(1)
  1536. } else if (n == 1) {
  1537. self.forward(self.btnItem);
  1538. } else if (n == 2) {
  1539. self.sendAll();
  1540. } else if (n == 3) {
  1541. self.btnPrint();
  1542. } else if (n == 4) {
  1543. sp.layer("#print")
  1544. }
  1545. } else {
  1546. sp.dialog("文稿创建失败,请联系管理员!");
  1547. }
  1548. });
  1549. } else {
  1550. var YZdata = {
  1551. method: 2,
  1552. params: {
  1553. fileId: self.gaoTypeArrayFirst[0].ID
  1554. }
  1555. };
  1556. $.ajax({
  1557. url: apiurljs.yzFileWo + "api.do",
  1558. data: {
  1559. jsonParams: encodeURIComponent(JSON.stringify(YZdata))
  1560. },
  1561. type: "POST",
  1562. dataType: "json",
  1563. general: false,
  1564. async: false,
  1565. success: function (resp) {
  1566. if (n == 0) {
  1567. sp.dialog("保存成功!");
  1568. $timeout(function () {
  1569. sp.dialoghide()
  1570. }, 1500)
  1571. self.getSwenList(1)
  1572. } else if (n == 1) {
  1573. self.forward(self.btnItem);
  1574. } else if (n == 2) {
  1575. self.sendAll();
  1576. } else if (n == 3) {
  1577. self.btnPrint();
  1578. } else if (n == 4) {
  1579. sp.layer("#print")
  1580. }
  1581. }
  1582. });
  1583. }
  1584. } else {
  1585. sp.dialog(res.message)
  1586. }
  1587. })
  1588. }
  1589. }
  1590. /*综合打印*/
  1591. self.printFiled = 1;
  1592. self.btnPrint1 = function () {
  1593. if (self.filedChange == true) {
  1594. self.btnSave(4)
  1595. } else {
  1596. sp.layer("#print")
  1597. }
  1598. }
  1599. self.printSubmit = function () {
  1600. if (self.printFiled == 1) {
  1601. var templatefilename = "moban24"
  1602. } else if (self.printFiled == 2) {
  1603. var templatefilename = "mobanoption"
  1604. } else {
  1605. var templatefilename = "moban24_all"
  1606. }
  1607. var data = {
  1608. templatefilename: templatefilename + ".ftl",
  1609. outfilepath: "/tmp/会议纪要" + sp.datefmt('yyyyMMddHHmmss', sp.getLocalDate()) + ".wps",
  1610. routeinfoid: self.routeinfoid,
  1611. tablename: "FW_HYJY",
  1612. printtype: self.printFiled,
  1613. printdate: "NGRQ"
  1614. }
  1615. console.log(s4.encryptData_CBC(JSON.stringify(data)))
  1616. $http.post(apiurljs.login + "g2app/dataabase/PrintWordExtend", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1617. .success(function (obj) {
  1618. var res = strToJson(s4.decryptData_CBC(obj.data));
  1619. if (self.deviceType == "pad") {
  1620. window.location.href = "../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url
  1621. } else {
  1622. sp.openNewWindow("../../../printPreview.html?url=" + apiurljs.yzFcscloud + "g2work" + res.data[0].url, '打印预览')
  1623. }
  1624. })
  1625. sp.layerhide()
  1626. }
  1627. //签写意见编辑状态
  1628. self.opinion = {
  1629. WLDQFL: false,
  1630. WLDQFLImg: false,
  1631. WLDSSL: false,
  1632. WLDSSLImg: false,
  1633. FLSH: false,
  1634. FLSHImg: false,
  1635. SX: false,
  1636. SXImg: false,
  1637. GPJZSC: false,
  1638. GPJZSCImg: false,
  1639. BMFZRYJ: false,
  1640. BMFZRYJImg: false,
  1641. HBCSYJ: false,
  1642. HBCSYJImg: false,
  1643. nulla: false
  1644. }
  1645. self.YJ = {
  1646. WLDQFL: [],
  1647. WLDQFLSTATUS: false,
  1648. WLDSSL: [],
  1649. WLDSSLSTATUS: false,
  1650. FLSH: [],
  1651. FLSHSTATUS: false,
  1652. SX: [],
  1653. SXSTATUS: false,
  1654. GPJZSC: [],
  1655. GPJZSCSTATUS: false,
  1656. BMFZRYJ: [],
  1657. BMFZRYJSTATUS: false,
  1658. HBCSYJ: [],
  1659. HBCSYJSTATUS: false,
  1660. nulla: [],
  1661. nullaSTATUS: false
  1662. }
  1663. //意见(下表)
  1664. self.openOptionList = function () {
  1665. if (self.routeinfoid == 0 && self.routeid == 0) {
  1666. sp.dialog("请先保存!")
  1667. return;
  1668. }
  1669. if (self.dotype == 0) {
  1670. return
  1671. }
  1672. if (self.opinion.nulla == true) {
  1673. return;
  1674. }
  1675. self.nulla = "";
  1676. self.opinion.nulla = true;
  1677. }
  1678. self.openOptionList1 = function () {
  1679. self.openOptionList()
  1680. self.activeOpinion = null;
  1681. self.showBottom = "opinion";
  1682. self.YJ.nulla.forEach(function (item) {
  1683. if (item.ROUTEID == self.routeid) {
  1684. self.activeOpinion = item;
  1685. self.nulla = item.OPINION;
  1686. }
  1687. })
  1688. }
  1689. self.closeOptionList = function () {
  1690. self.opinion.nulla = false;
  1691. self.activeOpinion = null;
  1692. $(".toggle").trigger("click")
  1693. }
  1694. self.submitOptionList = function () {
  1695. var data = {
  1696. cmanid: self.userId,
  1697. routeinfoid: self.routeinfoid,
  1698. routeid: self.routeid,
  1699. tableid: "FW_HYJY",
  1700. colid: "",
  1701. opiniontype: 99,
  1702. cresult: "",
  1703. opinion: self.nulla,
  1704. opinionimage: ""
  1705. }
  1706. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1707. .success(function (obj) {
  1708. var res = strToJson(s4.decryptData_CBC(obj.data));
  1709. if (res.success == true) {
  1710. self.getOpinion1(2);
  1711. self.opinion.nulla = false;
  1712. $(".toggle").trigger("click")
  1713. } else {
  1714. sp.dialog(res.message)
  1715. }
  1716. })
  1717. }
  1718. self.changeOptionList = function (item) {
  1719. self.showBottom = "opinion";
  1720. self.opinion.nulla = true;
  1721. self.nulla = item.OPINION;
  1722. self.activeOpinion = item;
  1723. $(".toggle").trigger("click")
  1724. }
  1725. //意见附件(下表)
  1726. self.uploading1 = false;
  1727. self.upload1 = function () {
  1728. $('#fileupload1').fileupload({
  1729. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1730. dataType: 'json',
  1731. beforeSend: function (xhr, data) {
  1732. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1733. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1734. + ",routeid=" + self.routeid + ",tableid=FW_HYJY,colid="));
  1735. },
  1736. // 上传完成后的执行逻辑
  1737. done: function (e, data) {
  1738. self.uploading1 = false;
  1739. self.getOpinion1(2)
  1740. }
  1741. })
  1742. }
  1743. //意见附件(下表)
  1744. self.uploading2 = false;
  1745. self.upload2 = function (str) {
  1746. $('#fileupload-' + str).fileupload({
  1747. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  1748. dataType: 'json',
  1749. beforeSend: function (xhr, data) {
  1750. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  1751. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  1752. + ",routeid=" + self.routeid + ",tableid=FW_HYJY,colid=" + str));
  1753. },
  1754. // 上传完成后的执行逻辑
  1755. done: function (e, data) {
  1756. self.uploading1 = false;
  1757. self.getOpinion1(2)
  1758. }
  1759. })
  1760. }
  1761. //下载意见表附件
  1762. self.downLoadOption = function (item) {
  1763. window.open(apiurljs.login + "g2work/files/" + item.FILEPATH.slice(7))
  1764. }
  1765. //删除意见表附件
  1766. self.deleteOptionFile = function (file) {
  1767. var data = {
  1768. routeid: file.ROUTEID,
  1769. tableid: "FW_HYJY",
  1770. colid: file.COLID,
  1771. fileid: file.FILEID
  1772. };
  1773. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1774. .success(function (obj) {
  1775. var res = strToJson(s4.decryptData_CBC(obj.data));
  1776. sp.dialoghide();
  1777. if (res.success) {
  1778. self.getOpinion1(2);
  1779. } else {
  1780. sp.dialog("删除失败,请联系管理员!");
  1781. }
  1782. });
  1783. }
  1784. //签写意见
  1785. self.openOpinion = function (str) {
  1786. if (self.routeinfoid == 0 && self.routeid == 0) {
  1787. sp.dialog("请先保存!")
  1788. return;
  1789. }
  1790. self.opinion[str] = true;
  1791. }
  1792. //修改意见
  1793. self.changeOpinion = function (str) {
  1794. self.data[str] = self.YJ[str][0].OPINION;
  1795. self.opinion[str] = true;
  1796. }
  1797. self.changeOpinionItem = function (str, item) {
  1798. if (item.OPINIONIMAGE != "") {
  1799. self.QianZi(str);
  1800. self.opinion[str + "Img"] = true;
  1801. }
  1802. self.data[str] = item.OPINION;
  1803. self.opinion[str] = true;
  1804. }
  1805. //提交意见
  1806. self.Sopinion = function (str) {
  1807. if (self.opinion[str + "Img"] == true) {
  1808. self.data[str] = $("#" + str + "QZ").find("canvas")[0].toDataURL();
  1809. } else {
  1810. self.data[str] = $("#" + str).val();
  1811. }
  1812. var data = {
  1813. cmanid: self.userId,
  1814. routeinfoid: self.routeinfoid,
  1815. routeid: self.routeid,
  1816. tableid: "FW_HYJY",
  1817. colid: str,
  1818. opiniontype: 0,
  1819. cresult: "",
  1820. opinion: self.opinion[str + "Img"] == false ? self.data[str] : "",
  1821. opinionimage: self.opinion[str + "Img"] == true ? self.data[str] : ""
  1822. }
  1823. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1824. .success(function (obj) {
  1825. var res = strToJson(s4.decryptData_CBC(obj.data));
  1826. if (res.success == true) {
  1827. self.getOpinion1(1);
  1828. self.opinion[str] = false;
  1829. self.opinion[str + "Img"] = false;
  1830. self.data[str] = "";
  1831. self.changeFiled(str)
  1832. } else {
  1833. sp.dialog(res.message)
  1834. }
  1835. })
  1836. }
  1837. //删除意见
  1838. self.Dopinion = function (str) {
  1839. var data = {
  1840. cmanid: self.userId,
  1841. routeid: self.routeid,
  1842. tableid: "FW_HYJY",
  1843. colid: str,
  1844. }
  1845. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinion", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1846. .success(function (obj) {
  1847. var res = strToJson(s4.decryptData_CBC(obj.data));
  1848. if (res.success == true) {
  1849. self.getOpinion1(1);
  1850. self.nulla = "";
  1851. self.activeOpinion = null;
  1852. self.changeFiled(str)
  1853. } else {
  1854. sp.dialog(res.message)
  1855. }
  1856. })
  1857. }
  1858. self.phraseText = "";//添加常用语
  1859. self.phraseList = []//常用语列表
  1860. //获取常用语库
  1861. self.phrase = function (colid) {
  1862. sp.layer("#phrase");
  1863. self.colid = colid;
  1864. self.getPhrase();
  1865. }
  1866. //添加常用语到常用语库
  1867. self.Aphrase = function () {
  1868. if (self.phraseText == "") {
  1869. return;
  1870. }
  1871. var data = {
  1872. cmanid: self.userId,
  1873. tableid: "FW_HYJY",
  1874. colid: self.colid,
  1875. contents: self.phraseText
  1876. }
  1877. $http.post(apiurljs.login + "g2app/abase/insertDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1878. .success(function (obj) {
  1879. var res = strToJson(s4.decryptData_CBC(obj.data));
  1880. if (res.success == true) {
  1881. self.phraseText = "";
  1882. self.getPhrase();
  1883. } else {
  1884. sp.dialog(res.message)
  1885. }
  1886. })
  1887. }
  1888. //获取常用语库
  1889. self.getPhrase = function () {
  1890. var data = {
  1891. cmanid: self.userId,
  1892. tableid: "FW_HYJY",
  1893. colid: self.colid
  1894. }
  1895. $http.post(apiurljs.login + "g2app/abase/queryDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1896. .success(function (obj) {
  1897. var res = strToJson(s4.decryptData_CBC(obj.data));
  1898. self.phraseList = res.data;
  1899. self.phraseSelect = self.phraseList[0].CONTENTS;
  1900. })
  1901. }
  1902. //从常用语库删除
  1903. self.Dphrase = function () {
  1904. var id = null;
  1905. $.each(self.phraseList, function (index, item) {
  1906. if (item.CONTENTS == self.phraseSelect) {
  1907. id = item.ID;
  1908. }
  1909. })
  1910. var data = {
  1911. id: id
  1912. }
  1913. $http.post(apiurljs.login + "g2app/abase/deleteDataPatterns", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  1914. .success(function (obj) {
  1915. var res = strToJson(s4.decryptData_CBC(obj.data));
  1916. self.getPhrase();
  1917. })
  1918. }
  1919. //常用语确认为意见
  1920. self.btnPhrase = function () {
  1921. if (!self.colid) {
  1922. self.nulla = self.phraseSelect;
  1923. } else {
  1924. self.data[self.colid] = self.phraseSelect;
  1925. }
  1926. sp.layerhide();
  1927. }
  1928. //签字—手写
  1929. self.QianZi = function (str) {
  1930. if (self.opinion[str + "Img"] == true) { return; }
  1931. self.opinion[str + "Img"] = true;
  1932. $timeout(function () {
  1933. new lineCanvas(str + "QZ")
  1934. }, 1)
  1935. }
  1936. //清除手写
  1937. self.canvasClear = function (str) {
  1938. var cxt = $("#" + str + "QZ").find("canvas")[0].getContext("2d");
  1939. cxt.clearRect(0, 0, $("#" + str + "QZ").find("canvas")[0].width, $("#" + str + "QZ").find("canvas")[0].height)
  1940. }
  1941. self.selectUSAGE = function (item) {
  1942. item.checked = !item.checked;
  1943. self.selectUSAGEs = [];
  1944. $.each(self.USAGE, function (index, item) {
  1945. if (item.checked == true) {
  1946. self.selectUSAGEs.push(item.CODE)
  1947. }
  1948. })
  1949. self.changeFiled('USAGE')
  1950. }
  1951. //发生修改
  1952. self.changeFiled = function (str) {
  1953. self.filedChange = true;
  1954. }
  1955. //转发
  1956. self.forward = function (obj) {
  1957. self.btnItem = obj;
  1958. if (self.filedChange == true) {
  1959. self.btnSave(1)
  1960. } else {
  1961. $("#forwardWin").attr("src", "../../forward/forward.html?routeid=" + self.routeid + "&routeinfoid=" + self.routeinfoid + "&copyrightid=" + self.copyrightid + "&directionid=" + self.directionid + "&formeditid=" + self.formeditid + "&codefuncbutton=" + obj.CODE + "&directionidtarget=" + obj.DIRECTIONIDTARGET + "&cookie=fawenbg")
  1962. sp.layer("#forward")
  1963. }
  1964. }
  1965. //查看流转记录
  1966. self.RouteList = function () {
  1967. if (self.deviceType == "pad") {
  1968. window.location.href = "../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  1969. } else {
  1970. sp.openNewWindow("../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1], "流程图")
  1971. }
  1972. }
  1973. self.showCol = function ($event, ele) {
  1974. $('.show-col').not(ele).hide();
  1975. $(ele).toggle("fast", function () {
  1976. $(ele).css('overflow-y', 'auto')
  1977. }).autoHide();
  1978. $event.stopPropagation();
  1979. }
  1980. self.iframeList = []
  1981. self.iframeLast = self.iframeList.length - 1;
  1982. self.iframeShow = self.iframeList.length;
  1983. self.iframeHide = self.iframeList.length - self.iframeShow;
  1984. //num为1时为附件表附件,为2时为文稿表附件
  1985. self.seeFile = function (obj, num, str) {
  1986. $('.show-col').hide();
  1987. if (!obj) {
  1988. sp.dialog("文件不存在!")
  1989. return
  1990. }
  1991. if (apiurljs.zhType.indexOf(obj.FILEEXT) == -1) {
  1992. sp.dialog("文件暂不支持在线预览,请点击下载查看!")
  1993. return
  1994. }
  1995. var n = 0;
  1996. self.iframeList.forEach(function (item) {
  1997. if (item.filename == obj.FILENAMES) {
  1998. n++
  1999. }
  2000. })
  2001. if (n == 0) {
  2002. var set_convertType = 0;
  2003. if (obj.FILEEXT == "doc") {
  2004. set_convertType = 0;
  2005. } else if (obj.FILEEXT == "pdf") {
  2006. set_convertType = 20;
  2007. } else if (obj.FILEEXT == "ofd") {
  2008. set_convertType = 570;
  2009. } else if ("png,jpg,jpeg,gif,bmp,jfif,svg,tif,tiff".indexOf(obj.FILEEXT) > -1) {
  2010. set_convertType = 23;
  2011. } else {
  2012. set_convertType = 0;
  2013. }
  2014. let postData = {
  2015. convertType: set_convertType,
  2016. isSignature: 1,
  2017. isPrint: 1,
  2018. fileUrl: num == 1 ? (obj.FILEPATH ? apiurljs.yzFcscloud + "g2work" + obj.FILEPATH : apiurljs.yzFcscloud + "g2work/files2/inline/" + obj.FILEURL.slice(7)) : apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL
  2019. };
  2020. var postCfg_transfer = {
  2021. headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  2022. transformRequest: function (data) {
  2023. return $.param(data);
  2024. }
  2025. };
  2026. $http.post(apiurljs.login.split("glwork/")[0] + "fcscloud/composite/httpfile", postData, postCfg_transfer)
  2027. .success(function (res) {
  2028. if (res.errorcode === 0) {
  2029. if (num == 1) {
  2030. if (obj.FILEPATH) {
  2031. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work" + obj.FILEPATH, str, obj.FILENAMES, false)
  2032. } else {
  2033. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login + "g2work/files2/inline/" + obj.FILEURL.slice(7), str, obj.FILENAMES, false)
  2034. }
  2035. } else {
  2036. self.addItem(sp.ipChange(res.data.viewUrl), apiurljs.login.split("glwork/")[0] + "glworkweb/" + obj.FILEURL, str, obj.FILENAMES, false)
  2037. }
  2038. } else {
  2039. sp.dialog(res.message);
  2040. }
  2041. });
  2042. }
  2043. }
  2044. self.seeZW = function () {
  2045. self.activeFormedit = 0;
  2046. if ($(".rightBox").outerWidth() == 15) {
  2047. showRightBox()
  2048. }
  2049. $("#rightList").css("margin-left", 0);
  2050. }
  2051. self.editFile = function (obj, n, str) {
  2052. if (self.newMoBanFlag == true) {
  2053. return
  2054. }
  2055. $('.show-col').hide();
  2056. if (!obj) {
  2057. sp.dialog("文件不存在!")
  2058. return
  2059. }
  2060. self.activeFormedit = n;
  2061. if ($(".rightBox").outerWidth() == 15) {
  2062. showRightBox()
  2063. }
  2064. if ($(".formedit" + n).find("iframe").attr("data-id") == obj.ID) {
  2065. if (self.iframeList.length == 0) {
  2066. if (n == 0) {
  2067. $("#rightList").css("margin-left", 0);
  2068. } else {
  2069. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2070. }
  2071. } else if (self.iframeHide == self.iframeList.length) {
  2072. if (n == 0) {
  2073. console.log(n)
  2074. $("#rightList").css("margin-left", 0);
  2075. } else {
  2076. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2077. }
  2078. } else {
  2079. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2080. }
  2081. } else {
  2082. if (obj.FILEURL.indexOf("files") > -1) {
  2083. var set_filepath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2084. } else {
  2085. var set_filepath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2086. }
  2087. var data = {
  2088. method: 1,
  2089. params: {
  2090. userId: self.userName,
  2091. fileId: "",
  2092. fileName: "",
  2093. filePath: "",
  2094. userRight: self.dotype != 1 ? 1 : 0,
  2095. callbackUrl: ""
  2096. }
  2097. };
  2098. if (obj.FILEURL.indexOf("files") > -1) {
  2099. data.params.fileId = obj.FILEURL.split("/")[2];
  2100. data.params.fileName = obj.FILEURL.split("/")[3];
  2101. data.params.filePath = apiurljs.yzFcscloud + "g2work/files/" + obj.FILEURL.slice(7);
  2102. data.params.callbackUrl = apiurljs.login + "g2app/attachfiles/uploadFileAttach"
  2103. } else {
  2104. data.params.fileId = obj.ID;
  2105. data.params.fileName = obj.FILENAMES;
  2106. data.params.filePath = apiurljs.yzFcscloud.split("glwork/")[0] + "glworkweb/" + obj.FILEURL;
  2107. data.params.callbackUrl = apiurljs.login + "g2app/fawenfiles/uploadFile"
  2108. }
  2109. $.ajax({
  2110. url: apiurljs.yzFileWo + "api.do",
  2111. data: {
  2112. jsonParams: encodeURIComponent(JSON.stringify(data))
  2113. },
  2114. type: "POST",
  2115. dataType: "json",
  2116. general: false,
  2117. async: false,
  2118. success: function (data) {
  2119. if (data) {
  2120. if (data.errorCode === "0") {
  2121. let rst = data.result;
  2122. if (rst && rst.urls) {
  2123. var get_urls = rst.urls;
  2124. if (typeof (get_urls) === "string") {
  2125. $(".formedit" + n).find("iframe").attr("src", sp.ipChange(get_urls)).attr("data-id", obj.ID)
  2126. if (self.iframeList.length == 0) {
  2127. if (n == 0) {
  2128. $("#rightList").css("margin-left", 0);
  2129. } else {
  2130. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2131. }
  2132. } else if (self.iframeHide == self.iframeList.length) {
  2133. if (n == 0) {
  2134. console.log(n)
  2135. $("#rightList").css("margin-left", 0);
  2136. } else {
  2137. $("#rightList").css("margin-left", (n - 1) * $(".formedit1").width() * -1 - 10);
  2138. }
  2139. } else {
  2140. $("#rightList").css("margin-left", n * $(".formedit").width() * -1);
  2141. }
  2142. }
  2143. }
  2144. }
  2145. }
  2146. },
  2147. })
  2148. }
  2149. }
  2150. self.btnSaveFile = function (id) {
  2151. var data = {
  2152. method: 2,
  2153. params: {
  2154. fileId: id
  2155. }
  2156. };
  2157. $.ajax({
  2158. url: apiurljs.yzFileWo + "api.do",
  2159. data: {
  2160. jsonParams: encodeURIComponent(JSON.stringify(data))
  2161. },
  2162. type: "POST",
  2163. dataType: "json",
  2164. general: false,
  2165. async: false,
  2166. success: function (data) {
  2167. if (data && data.errorCode === "0") {
  2168. sp.dialog("保存成功");
  2169. }
  2170. }
  2171. });
  2172. }
  2173. self.addItem = function (url, source, name, filename, edit, fileid) {
  2174. var n = 0;
  2175. self.iframeList.forEach(function (item) {
  2176. if (item.filename == filename && item.source == source) {
  2177. n++
  2178. }
  2179. })
  2180. if (n == 0) {
  2181. if (edit == false) {
  2182. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1 })
  2183. } else {
  2184. self.iframeList.push({ id: self.iframeList.length + 1, title: name, filename: filename, url: $sce.trustAsResourceUrl(url), source: source, edit: edit, show: 1, fileid: fileid })
  2185. }
  2186. self.changeSize(1)
  2187. }
  2188. }
  2189. self.hideItem = function (n) {
  2190. self.iframeList[n].show = 2;
  2191. self.iframeList[n].boxStyle = { width: 0, float: "left" };
  2192. self.changeIframeSize()
  2193. }
  2194. self.showItem = function (n) {
  2195. self.iframeList[n].show = 1;
  2196. self.changeIframeSize()
  2197. }
  2198. self.changeIframeSize = function () {
  2199. if (self.iframeList.length == 0) {
  2200. } else {
  2201. var n = 0;
  2202. self.iframeList.forEach(function (item, index) {
  2203. if (item.show == 1) {
  2204. self.iframeLast = index;
  2205. }
  2206. if (item.show == 2) {
  2207. n = n + 1;
  2208. }
  2209. })
  2210. self.iframeHide = n;
  2211. self.iframeShow = self.iframeList.length - self.iframeHide;
  2212. for (var i = 0; i < self.iframeList.length; i++) {
  2213. if (self.iframeHide != self.iframeList.length) {
  2214. if (self.iframeList[i].show == 1) {
  2215. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2216. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2217. }
  2218. if ($(".rightBox").outerWidth() == 15) {
  2219. $(".leftBox").css("width", "calc(100% - 15px)");
  2220. $(".border-left-right").show()
  2221. $(".border-left-right").prev().show()
  2222. } else {
  2223. showRightBox()
  2224. }
  2225. } else {
  2226. self.iframeList[i].show = 2
  2227. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2228. self.seeGCG()
  2229. $(".leftBox").css("width", 36)
  2230. $(".border-left-right").hide()
  2231. $(".border-left-right").prev().hide()
  2232. $(".rightBox").css("width", "calc(100% - 36px)")
  2233. $("#rightList").show();
  2234. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2235. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2236. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2237. self.formeditSize()
  2238. var marginLeft = $("#rightList").css("margin-left")
  2239. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2240. } else {
  2241. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2242. }
  2243. }
  2244. }
  2245. if (self.iframeShow == 1) {
  2246. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2247. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2248. } else {
  2249. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2250. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2251. }
  2252. }
  2253. }
  2254. self.changeSize = function (n) {
  2255. if (self.iframeList.length == 0) {
  2256. $(".rightBox").show();
  2257. $("#rightList").show();
  2258. $(".rightBox").css("width", $(window).width())
  2259. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2260. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2261. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2262. self.formeditSize()
  2263. var marginLeft = $("#rightList").css("margin-left")
  2264. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2265. } else {
  2266. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2267. }
  2268. } else {
  2269. if (n == 1 && $(".fa-angle-left").is(":hidden") == false) {
  2270. showRightBox()
  2271. }
  2272. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2273. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2274. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2275. self.formeditSize()
  2276. var marginLeft = $("#rightList").css("margin-left")
  2277. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2278. } else {
  2279. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2280. }
  2281. }
  2282. var num = 0;
  2283. self.iframeList.forEach(function (item, index) {
  2284. self.reSize(index)
  2285. if (item.show == 1) {
  2286. num = num + 1;
  2287. self.iframeLast = index;
  2288. }
  2289. })
  2290. self.iframeShow = num;
  2291. self.iframeHide = self.iframeList.length - self.iframeShow;
  2292. if (self.iframeList.length == 0) {
  2293. } else {
  2294. if (self.iframeShow == self.iframeList.length) {
  2295. self.iframeList.forEach(function (item) {
  2296. item.boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2297. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2298. })
  2299. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() / (self.iframeShow == 1 ? 1 : 2)) - 1 }
  2300. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2301. } else {
  2302. for (var i = 0; i < self.iframeList.length; i++) {
  2303. if (self.iframeHide != self.iframeList.length) {
  2304. if (self.iframeList[i].show == 1) {
  2305. self.iframeList[i].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2 / (self.iframeList.length - 1 - self.iframeHide)) }
  2306. self.iframeList[i].iframeStyle = { width: self.iframeList[i].boxStyle.width - 10 }
  2307. }
  2308. if (n == 1) {
  2309. if ($(".rightBox").outerWidth() == 15) {
  2310. $(".leftBox").css("width", "calc(100% - 15px)");
  2311. $(".border-left-right").show()
  2312. $(".border-left-right").prev().show()
  2313. } else {
  2314. showRightBox()
  2315. }
  2316. }
  2317. } else {
  2318. self.iframeList[i].show = 2
  2319. self.iframeList[i].boxStyle = { width: 0, float: "left" };
  2320. self.seeGCG()
  2321. $(".leftBox").css("width", 36)
  2322. $(".border-left-right").hide()
  2323. $(".border-left-right").prev().hide()
  2324. $(".rightBox").css("width", "calc(100% - 36px)")
  2325. $("#rightList").show();
  2326. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2327. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2328. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2329. var marginLeft = $("#rightList").css("margin-left")
  2330. if (marginLeft.slice(0, marginLeft.length - 2) == $(".formedit1").width() * -1 || marginLeft.slice(0, marginLeft.length - 2) == 0) {
  2331. } else {
  2332. $("#rightList").css("margin-left", $(".formedit1").width() * (self.activeFormedit - 1) * -1)
  2333. }
  2334. }
  2335. }
  2336. if (self.iframeShow == 1) {
  2337. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) - 1 }
  2338. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2339. } else {
  2340. self.iframeList[self.iframeLast].boxStyle = { width: Math.trunc(($(".leftBox").width() - 36 * (self.iframeHide > 0 ? 1 : 0)) / 2) - 1 }
  2341. self.iframeList[self.iframeLast].iframeStyle = { width: self.iframeList[self.iframeLast].boxStyle.width - 10 }
  2342. }
  2343. }
  2344. }
  2345. }
  2346. self.openItem = function (obj) {
  2347. window.open(obj.url)
  2348. }
  2349. self.closeItem = function (n) {
  2350. self.iframeList.splice(n, 1)
  2351. self.changeSize(1)
  2352. }
  2353. self.reSize = function (n) {
  2354. $timeout(function () {
  2355. var leftbox = document.getElementsByClassName("iframe-item")[n];
  2356. var rightbox;
  2357. var line = document.getElementsByClassName("iframe-border-right")[n];
  2358. document.getElementsByClassName("iframe-border-right")[n].addEventListener("mousedown", function (event) {
  2359. for (var i = n + 1; i < self.iframeList.length; i++) {
  2360. if (self.iframeList[i].show == 1) {
  2361. rightbox = document.getElementsByClassName("iframe-item")[i];
  2362. break
  2363. }
  2364. }
  2365. $(".mousemove").show()
  2366. var leftboxW = leftbox.style.width.slice(0, leftbox.style.width.length - 2);
  2367. var rightboxW = rightbox.style.width.slice(0, rightbox.style.width.length - 2);
  2368. var x = event.pageX - (line.offsetLeft - leftboxW) - 10;
  2369. document.addEventListener("mousemove", boxMove)
  2370. function boxMove(event) {
  2371. if (leftboxW * 1 + (event.pageX - x) * 1 <= 36) {
  2372. //leftbox.children[0].style.display = "none"
  2373. self.hideItem(n)
  2374. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 5) {
  2375. //rightbox.children[0].style.display = "none"
  2376. self.hideItem(i)
  2377. } else {
  2378. leftbox.children[0].style.display = "block"
  2379. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2380. leftbox.getElementsByTagName("iframe")[0].style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2381. self.iframeList[n].boxStyle.width = leftboxW * 1 + (event.pageX - x) * 1;
  2382. self.iframeList[n].iframeStyle.width = leftboxW * 1 + (event.pageX - x) * 1 - 10;
  2383. rightbox.children[0].style.display = "block"
  2384. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2385. rightbox.getElementsByTagName("iframe")[0].style.width = rightboxW * 1 - (event.pageX - x) * 1 - 10 + "px";
  2386. self.iframeList[i].boxStyle.width = rightboxW * 1 - (event.pageX - x) * 1;
  2387. self.iframeList[i].iframeStyle.width = rightboxW * 1 - (event.pageX - x) * 1 - 10;
  2388. }
  2389. }
  2390. document.addEventListener("mouseup", function () {
  2391. $(".mousemove").hide()
  2392. $scope.$apply();
  2393. document.removeEventListener("mousemove", boxMove)
  2394. })
  2395. })
  2396. }, 1)
  2397. }
  2398. self.reSizeLR = function (n) {
  2399. var leftbox = document.getElementsByClassName("page-item")[n - 1];
  2400. var rightbox = document.getElementsByClassName("page-item")[n];
  2401. var line = document.getElementsByClassName("left-right")[n - 1];
  2402. document.getElementsByClassName("left-right")[n - 1].addEventListener("mousedown", function (event) {
  2403. $(".mousemove").show()
  2404. var leftboxW = leftbox.clientWidth;
  2405. var rightboxW = rightbox.clientWidth;
  2406. var x = event.pageX - line.offsetLeft;
  2407. document.addEventListener("mousemove", boxMove)
  2408. function boxMove(event) {
  2409. if (leftboxW * 1 + (event.pageX - x) * 1 <= 200) {
  2410. } else if (rightboxW * 1 - (event.pageX - x) * 1 <= 200) {
  2411. } else {
  2412. leftbox.style.width = leftboxW * 1 + (event.pageX - x) * 1 + "px";
  2413. rightbox.style.width = rightboxW * 1 - (event.pageX - x) * 1 + "px";
  2414. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2415. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2416. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2417. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2418. $scope.changeSize()
  2419. }
  2420. }
  2421. document.addEventListener("mouseup", function () {
  2422. $(".mousemove").hide()
  2423. document.removeEventListener("mousemove", boxMove)
  2424. })
  2425. })
  2426. }
  2427. /*右侧formedit折叠*/self.formeditList = [];
  2428. self.hideFormedit = function (num, title) {
  2429. $(".formedit" + num).hide();
  2430. $(".formedit" + num).siblings().css("width", $(".formedit" + num).width() - (self.iframeHide == self.iframeList.length ? 18 : 36));
  2431. self.formeditList.push({ index: num, title: title });
  2432. if (self.iframeHide == self.iframeList.length) {
  2433. if (self.formeditList.length == 2) {
  2434. $(".formedit" + num).siblings().each(function () {
  2435. if ($(this).is(":hidden") == false) {
  2436. if ($(this).is(":hidden") == false) {
  2437. $(this).width("calc(100% - 46px)")
  2438. }
  2439. }
  2440. })
  2441. }
  2442. self.seeGLJ()
  2443. } else {
  2444. if (self.formeditList.length == 2) {
  2445. $(".formedit" + num).siblings().each(function () {
  2446. if ($(this).is(":hidden") == false) {
  2447. if ($(this).is(":hidden") == false) {
  2448. $(this).width("calc(100% - 36px)")
  2449. }
  2450. }
  2451. })
  2452. }
  2453. if ($(".formedit1").find("iframe").attr("src") == "") {
  2454. self.seeGCG()
  2455. } else {
  2456. self.seeGLJ()
  2457. }
  2458. }
  2459. $("#rightList").css("margin-left", 0)
  2460. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2461. }
  2462. self.showFormedit = function (num, obj) {
  2463. $(".formedit" + obj.index).show();
  2464. self.formeditList.splice(num, 1);
  2465. if (self.iframeHide == self.iframeList.length) {
  2466. if (self.formeditList.length == 2) {
  2467. $(".formedit" + obj.index).width("calc(100% - 46px)")
  2468. $("#rightList").css("margin-left", 0)
  2469. } else if (self.formeditList.length == 1) {
  2470. $(".formedit" + obj.index).width(($(".rightBox").width() - 36) / 2)
  2471. $(".formedit" + obj.index).siblings().width(($(".rightBox").width() - 36) / 2)
  2472. $("#rightList").css("margin-left", 0)
  2473. } else {
  2474. $(".formedit" + obj.index).width($(".rightBox").width() / 2)
  2475. $(".formedit" + obj.index).siblings().width($(".rightBox").width() / 2)
  2476. $("#rightList").css("margin-left", obj.index == "" ? 0 : (obj.index - 1) * $(".formedit" + obj.index).width() * -1)
  2477. }
  2478. } else {
  2479. if (self.formeditList.length > 0) {
  2480. $(".formedit" + obj.index).width($(".rightBox").width() - 36)
  2481. $(".formedit" + obj.index).siblings().width($(".rightBox").width() - 36)
  2482. } else {
  2483. $(".formedit" + obj.index).width($(".rightBox").width())
  2484. $(".formedit" + obj.index).siblings().width($(".rightBox").width())
  2485. }
  2486. $("#rightList").css("margin-left", obj.index == "" ? 0 : obj.index * $(".formedit" + obj.index).width() * -1)
  2487. }
  2488. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2489. }
  2490. self.formeditSize = function () {
  2491. if (self.iframeHide == self.iframeList.length) {
  2492. if (self.formeditList.length == 2) {
  2493. $("#rightList").children().each(function () {
  2494. if ($(this).is(":hidden") == false) {
  2495. $(this).css("width", "calc(100% - 36px)")
  2496. }
  2497. })
  2498. } else if (self.formeditList.length == 1) {
  2499. $("#rightList").children().each(function () {
  2500. $(this).width(($(".rightBox").width() - 36) / 2)
  2501. })
  2502. }
  2503. } else {
  2504. if (self.formeditList.length > 0) {
  2505. $("#rightList").children().each(function () {
  2506. $(this).width($(".rightBox").width() - 36)
  2507. })
  2508. }
  2509. }
  2510. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2511. }
  2512. self.getMeetMsg = function () {
  2513. var data = {
  2514. routeid: self.routeid,
  2515. routeinfoid: self.routeinfoid
  2516. }
  2517. $http.post(apiurljs.login + "g2work/meetcoop/queryDataList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2518. .success(function (obj) {
  2519. var res = strToJson(s4.decryptData_CBC(obj.data));
  2520. self.meetList = res.data;
  2521. self.meetNum = 0;
  2522. self.meetList.forEach(function (item) {
  2523. self.meetNum++
  2524. item.FILES.forEach(function (item1) {
  2525. self.meetNum++
  2526. item1.WATCHLIMIT = sp.format(item1.WATCHLIMIT);
  2527. })
  2528. })
  2529. //self.getNumMeet()
  2530. })
  2531. }
  2532. self.getNumMeet = function () {
  2533. var data = {
  2534. routeinfoid: self.routeinfoid
  2535. }
  2536. $http.post(apiurljs.login + "g2work/meetcoop/queryDataListCount", data, postCfg)
  2537. .success(function (obj) {
  2538. var res = strToJson(s4.decryptData_CBC(obj.data));
  2539. if (res.data != self.meetNum) {
  2540. self.getMeetMsg()
  2541. }
  2542. })
  2543. }
  2544. self.Meeting = function () {
  2545. $http.post(apiurljs.login + "g2app/dataabase/getDpList", { data: s4.encryptData_CBC("") }, postCfg)
  2546. .success(function (obj) {
  2547. var res = strToJson(s4.decryptData_CBC(obj.data));
  2548. self.dpList = res.data;
  2549. self.dpList1 = [];
  2550. self.dpList.forEach(function (item) {
  2551. self.dpList1.push(item)
  2552. item.USER.forEach(function (item1) {
  2553. item1.show = true;
  2554. })
  2555. })
  2556. self.activeDep = 0;
  2557. self.userList = self.dpList1[0].USER;
  2558. self.meetUser = [];
  2559. sp.layer("#meet")
  2560. })
  2561. }
  2562. self.searchName = "";
  2563. self.searchPerson = function () {
  2564. self.dpList1 = [];
  2565. self.dpList.forEach(function (item) {
  2566. if (item.DEP.indexOf(self.searchName) > -1) {
  2567. self.dpList1.push(item)
  2568. }
  2569. })
  2570. self.activeDep = 0;
  2571. self.userList = self.dpList1[0].USER;
  2572. }
  2573. self.addmeet = function () {
  2574. self.dpList.forEach(function (item) {
  2575. item.USER.forEach(function (item1) {
  2576. if (item1.checked == true && item1.show == true) {
  2577. self.meetUser.push(item1);
  2578. item1.checked = false;
  2579. item1.show = false;
  2580. }
  2581. })
  2582. })
  2583. }
  2584. self.delmeet = function () {
  2585. self.meetUser.forEach(function (item) {
  2586. if (item.checked == true) {
  2587. item.checked = false;
  2588. item.show = true;
  2589. }
  2590. })
  2591. self.meetUser = self.meetUser.filter(function (item) {
  2592. return item.show == false;
  2593. })
  2594. }
  2595. self.joinMeet = function () {
  2596. var data = {
  2597. tablename: "FW_HYJY",
  2598. colums: "*",
  2599. order: "ID desc",
  2600. sqlwhere: { ROUTEINFOID: self.routeinfoid },
  2601. sqlinwhere: "",
  2602. sqllikewhere: ""
  2603. }
  2604. $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2605. .success(function (obj) {
  2606. var res = strToJson(s4.decryptData_CBC(obj.data));
  2607. var data1 = {
  2608. routeid: self.routeid,
  2609. routeinfoid: self.routeinfoid,
  2610. cman: self.userId,
  2611. cname: res.data[0].BT + "—共享沟通",
  2612. userids: self.meetUser.map(function (item) {
  2613. return item.USERID
  2614. }).join(",")
  2615. }
  2616. $http.post(apiurljs.login + "g2work/meetcoop/createMeetcoop", data1, postCfg)
  2617. .success(function (res1) {
  2618. sp.layerhide()
  2619. if (res1.success == true) {
  2620. self.getMeetMsg()
  2621. } else {
  2622. sp.dialog(res1.message)
  2623. }
  2624. })
  2625. })
  2626. }
  2627. self.updateCname = function (item) {
  2628. self.meeting = {
  2629. type: 1,
  2630. updateTitle: "修改会议标题",
  2631. meetid: item.MEETID,
  2632. cname: item.CNAME
  2633. }
  2634. sp.layer("#meetUpdate")
  2635. }
  2636. self.deleteMeet = function (meet) {
  2637. var data = {
  2638. meetid: meet.MEETID
  2639. }
  2640. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataByID", data, postCfg)
  2641. .success(function (res) {
  2642. if (res.success == true) {
  2643. $.each(self.iframeList, function (index, item) {
  2644. $.each(meet.FILES, function (index1, item1) {
  2645. if (item.title == item1.WATCHLIMIT && item.source == item1.FILEURL) {
  2646. self.closeItem(index1)
  2647. }
  2648. })
  2649. })
  2650. self.getMeetMsg()
  2651. } else {
  2652. sp.dialog(res.message)
  2653. }
  2654. })
  2655. }
  2656. self.updateWatchlimit = function (item) {
  2657. self.meeting = {
  2658. type: 2,
  2659. updateTitle: "修改查看时限",
  2660. fileid: item.FILEID,
  2661. watchlimit: item.WATCHLIMIT
  2662. }
  2663. sp.layer("#meetUpdate")
  2664. }
  2665. self.deleteMFile = function (mfile) {
  2666. var data = {
  2667. fileid: mfile.MEETID
  2668. }
  2669. $http.post(apiurljs.login + "g2work/meetcoop/deleteDataFilesByFileID", data, postCfg)
  2670. .success(function (res) {
  2671. if (res.success == true) {
  2672. $.each(self.iframeList, function (index, item) {
  2673. if (item.title == mfile.WATCHLIMIT && item.source == mfile.FILEURL) {
  2674. self.closeItem(index)
  2675. }
  2676. })
  2677. self.getMeetMsg()
  2678. } else {
  2679. sp.dialog(res.message)
  2680. }
  2681. })
  2682. }
  2683. self.meetUpdate = function () {
  2684. if (self.meeting.type == 1) {
  2685. var data = {
  2686. meetid: self.meeting.meetid,
  2687. cname: self.meeting.cname
  2688. }
  2689. $http.post(apiurljs.login + "g2work/meetcoop/updateCnameByID", data, postCfg)
  2690. .success(function (res) {
  2691. sp.layerhide()
  2692. if (res.success == true) {
  2693. self.getMeetMsg()
  2694. } else {
  2695. sp.dialog(res.message)
  2696. }
  2697. })
  2698. } else {
  2699. var data = {
  2700. fileid: self.meeting.fileid,
  2701. watchlimit: self.meeting.watchlimit
  2702. }
  2703. $http.post(apiurljs.login + "g2work/meetcoop/updateWatchlimitByFileID", data, postCfg)
  2704. .success(function (res) {
  2705. sp.layerhide()
  2706. if (res.success == true) {
  2707. self.getMeetMsg()
  2708. } else {
  2709. sp.dialog(res.message)
  2710. }
  2711. })
  2712. }
  2713. }
  2714. ////头部关键字搜索---20230905
  2715. self.headBtnSearchKeyword = "";
  2716. self.headSearchResult = [];
  2717. self.headSearchResult_view = false;
  2718. self.headBtnSearch = function () {
  2719. if (sp.isval(self.headBtnSearchKeyword)) {
  2720. self.headSearchResult = [];
  2721. var data = {
  2722. "url": "/basic/api/StatSelect/selectCodeList",
  2723. "data": { "keyWord": self.headBtnSearchKeyword }
  2724. }
  2725. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  2726. .success(function (obj) {
  2727. var res = strToJson(s4.decryptData_CBC(obj.data));
  2728. self.headSearchResult = res.data.build;
  2729. if (sp.isval(self.headSearchResult)) {
  2730. self.headSearchResult_view = true;
  2731. } else {
  2732. self.headSearchResult_view = false;
  2733. }
  2734. })
  2735. } else {
  2736. self.headSearchResult_view = false;
  2737. }
  2738. };
  2739. self.headKeywordPage = function (itemdata) {
  2740. var get_token = localStorage.getItem("main-token");
  2741. var set_url = apiurljs.onePic + "wholeProcessPage/?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id;
  2742. self.addItem(set_url, set_url, '一张图', false);
  2743. self.headSearchResult_view = false;
  2744. };
  2745. self.onePic = function () {
  2746. self.addItem(apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), "地图搜索", false)
  2747. }
  2748. $scope.changeSize = function (n) {
  2749. self.changeSize(2)
  2750. if (n == 1) {
  2751. $scope.$apply();
  2752. }
  2753. }
  2754. $scope.openOptionList1 = function () {
  2755. $timeout(function () {
  2756. self.openOptionList1()
  2757. })
  2758. }
  2759. $scope.closeToggle = function () {
  2760. $timeout(function () {
  2761. self.opinion.nulla = false;
  2762. self.activeOpinion = null;
  2763. })
  2764. }
  2765. $scope.refreshGLJ = function (n) {
  2766. if (n == 1) {
  2767. self.getGLJ(2)
  2768. } else {
  2769. self.getGLFLOW()
  2770. }
  2771. }
  2772. //头部下滚冻结
  2773. $(function () {
  2774. //页面高度撑满
  2775. setTimeout(function () {
  2776. $(".rightBox").css("height", $(window).height() - 115)
  2777. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2778. if (self.lastrouteinfoid == 0) {
  2779. $(".rightBox").css("width", $(window).width())
  2780. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2781. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2782. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2783. } else {
  2784. $(".rightBox").css("width", "50%")
  2785. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2786. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2787. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2788. }
  2789. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2790. }, 1)
  2791. $(window).resize(function () {
  2792. $(".rightBox").css("height", $(window).height() - 115)
  2793. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  2794. if (self.iframeList.length == 0) {
  2795. $(".rightBox").css("width", $(window).width())
  2796. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2797. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2798. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2799. self.formeditSize()
  2800. } else if (self.iframeList.length > 0 && self.iframeHide == self.iframeList.length) {
  2801. $(".rightBox").css("width", "calc(100% - 36px)")
  2802. $(".formedit").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2803. $(".formedit1").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2804. $(".formedit2").css("width", $(".rightBox").width() / 2).css("height", $(".rightBox").height())
  2805. self.formeditSize()
  2806. } else {
  2807. $(".rightBox").css("width", "50%")
  2808. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2809. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2810. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2811. self.formeditSize()
  2812. }
  2813. $(".toggle").parent().css("width", $(".formedit").width() - 12)
  2814. if (self.iframeList.length > 0) {
  2815. $("#iframeList").css("height", $(window).height() - 115)
  2816. if (self.iframeList.length == 1) {
  2817. self.iframeList[0].boxStyle = { width: $(".leftBox").width() }
  2818. self.iframeList[0].iframeStyle = { width: $(".leftBox").width() - 10 }
  2819. } else {
  2820. self.iframeList.forEach(function (item) {
  2821. item.boxStyle = { width: Math.trunc($(".leftBox").width() / 2 / (self.iframeList.length - 1)) }
  2822. item.iframeStyle = { width: item.boxStyle.width - 10 }
  2823. })
  2824. self.iframeList[self.iframeList.length - 1].boxStyle = { width: Math.trunc($(".leftBox").width() / 2) - 1 }
  2825. self.iframeList[self.iframeList.length - 1].iframeStyle = { width: self.iframeList[self.iframeList.length - 1].boxStyle.width - 10 }
  2826. }
  2827. $scope.$apply();
  2828. }
  2829. })
  2830. })
  2831. }])
  2832. app.directive("repeatFinish", function () {
  2833. return {
  2834. link: function (scope) {
  2835. if (scope.$last == true) {
  2836. $("#iframeList").css("height", $(window).height() - 115)
  2837. }
  2838. }
  2839. };
  2840. });
  2841. app.directive("spCheckboxBlueItem", function () {
  2842. return {
  2843. restrict: "A",
  2844. link: function (scope, elem, attrs) {
  2845. if (!scope == false) {
  2846. spng.funcheckbox(elem, "chb-blue", "chb-blue-checked"); //蓝色checkbox
  2847. }
  2848. }
  2849. }
  2850. });
  2851. app.filter('trustHtml', function ($sce) {
  2852. return function (input) {
  2853. return $sce.trustAsHtml(input.replace(/\n/g, '<br/>').replace(/\s/g, '&nbsp;'));
  2854. };
  2855. });
  2856. //canvas画布签字
  2857. function lineCanvas(obj) {
  2858. var self = this;
  2859. self.linewidth = 1;
  2860. self.color = "#000000";
  2861. self.background = "#ffffff";
  2862. self.canvas = document.createElement("canvas");
  2863. document.getElementById(obj).appendChild(self.canvas);
  2864. self.cxt = self.canvas.getContext("2d");
  2865. self.canvas.width = document.getElementById(obj).clientWidth;
  2866. self.canvas.height = document.getElementById(obj).scrollHeight;
  2867. self.cxt.fillStyle = self.background;
  2868. self.cxt.fillRect(0, 0, self.canvas.width, self.canvas.width);
  2869. self.cxt.strokeStyle = self.color;
  2870. self.cxt.lineWidth = self.linewidth;
  2871. self.cxt.lineCap = "round";
  2872. //开始绘制
  2873. self.canvas.addEventListener("mousedown", function (e) {
  2874. self.cxt.beginPath();
  2875. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2876. self.canvas.addEventListener("mousemove", move)
  2877. }.bind(self), false);
  2878. //绘制中
  2879. function move() {
  2880. var e = window.event;
  2881. self.cxt.lineTo(e.pageX - $(".formedit .sp-page-center").offset().left - 52, e.pageY - document.getElementById(obj).offsetTop + $(".formedit").scrollTop() - 95);
  2882. self.cxt.stroke();
  2883. }
  2884. //结束绘制
  2885. self.canvas.addEventListener("mouseup", up)
  2886. function up() {
  2887. self.cxt.closePath();
  2888. self.canvas.removeEventListener("mousemove", move)
  2889. }
  2890. };
  2891. function showRightBox() {
  2892. $(".leftBox").css("width", "50%");
  2893. $(".rightBox").css("width", "50%")
  2894. $(".rightBox").show();
  2895. $("#rightList").show();
  2896. $(".border-left-right").show()
  2897. $(".border-left-right").prev().show()
  2898. $(".border-left-right").prev().find(".fa-angle-right").show()
  2899. $(".border-left-right").prev().find(".fa-angle-left").hide()
  2900. if ($("#rightList").prev().is(":hidden") == true) {
  2901. $(".formedit").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2902. $(".formedit1").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2903. $(".formedit2").css("width", $(".rightBox").width()).css("height", $(".rightBox").height())
  2904. } else {
  2905. $(".formedit").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2906. $(".formedit1").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2907. $(".formedit2").css("width", $(".rightBox").width() - 36).css("height", $(".rightBox").height())
  2908. }
  2909. angular.element(document.getElementById("app")).scope().changeSize(2)
  2910. }
  2911. function showRight(e) {
  2912. if ($(e).children(".fa-angle-left").is(":hidden")) {
  2913. $(".leftBox").css("width", "calc(100% - 15px)");
  2914. $(".rightBox").css("width", "15px");
  2915. $(e).siblings().hide()
  2916. $(e).children(".fa-angle-left").show()
  2917. $(e).children(".fa-angle-right").hide()
  2918. } else {
  2919. $(".leftBox").css("width", "50%");
  2920. $(".rightBox").css("width", "50%");
  2921. $(e).siblings().show()
  2922. $(e).children(".fa-angle-left").hide()
  2923. $(e).children(".fa-angle-right").show()
  2924. }
  2925. angular.element(document.getElementById("app")).scope().changeSize(1)
  2926. }
  2927. function showToggle(e) {
  2928. document.getElementById("selectDiv").style.top = e.style.top;
  2929. //document.getElementById("selectDiv").toggle();
  2930. $(e).children().toggle()
  2931. $(e).next().toggle()
  2932. }
  2933. function toggleYJL(e) {
  2934. if ($(e).children(".fa-angle-double-down").is(":hidden") == true) {
  2935. $(e).parent().css("height", 420)
  2936. angular.element(document.getElementById("app")).scope().openOptionList1()
  2937. } else {
  2938. $(e).parent().css("height", 10)
  2939. angular.element(document.getElementById("app")).scope().closeToggle()
  2940. }
  2941. $(e).children().toggle()
  2942. }
  2943. function toggleForm(e) {
  2944. $(e).children().toggle()
  2945. $(".toggleForm").toggle()
  2946. }
  2947. function refreshGLJ(n) {
  2948. angular.element(document.getElementById("app")).scope().refreshGLJ(n)
  2949. }
  2950. //文字不可被选中
  2951. document.body.onselectstart = function () {
  2952. return false;
  2953. }