formeditFL.js 112 KB

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