formeditFL.js 112 KB

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