formedit1.js 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130
  1. 'use strict';
  2. var app = angular.module('app', []);
  3. //定义一个全局的截图插件变量
  4. var cropper;
  5. app.controller("formeditCtrl", ["$scope", "$http", "$timeout", '$sce', function ($scope, $http, $timeout, $sce) {
  6. var self = this;
  7. var s4 = new SM4Util();
  8. self.userId = $.cookie("GlWorkPlatform-userid");
  9. self.userName = $.cookie("GlWorkPlatform-chineseName");
  10. self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
  11. self.routeid = sp.getUrlName("routeid");
  12. self.routeinfoid = sp.getUrlName("routeinfoid");
  13. self.directionid = sp.getUrlName("directionid");
  14. self.formeditid = sp.getUrlName("formeditid");
  15. self.mbid = sp.getUrlName("mbid");
  16. self.fjid = sp.getUrlName("fjid");
  17. self.docmode = sp.getUrlName("docmode");
  18. self.dotype = sp.getUrlName("dotype");
  19. self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno");
  20. self.get_lastReturnPage = sp.getUrlName("lastReturnPage");
  21. self.get_type = sp.getUrlName("type");
  22. self.return = "../list.html?lastReturnPageno=" + self.get_lastReturnPageno + "&type=" + self.get_type
  23. self.deviceType = localStorage.getItem("tjJxtGoldenlinkWork-deviceType");
  24. var base64 = new Base64(); //声明base解码和编码类
  25. var postCfg = {
  26. headers: {
  27. 'Content-Type': 'application/json',
  28. 'Authorization': "Bearer " + self.get_AccessToken
  29. }
  30. };
  31. self.FormTitle = $.cookie("GlWorkPlatform-SYSNAME");
  32. //初始化只读数组
  33. self.readonly = {
  34. BT: false,
  35. FBT: false,
  36. LM: false,
  37. SFSYLB: false,
  38. WJBT: false,
  39. FBR: false,
  40. FBBM: false,
  41. FBRQ: false,
  42. FBNR: false,
  43. IMAGESDATA: false,
  44. VIDEODATA: false,
  45. IMAGEDATA: false,
  46. YJ: false
  47. }
  48. //初始化右上角按钮
  49. self.buttonList = []
  50. var uploadformat = strToJson(s4.decryptData_CBC(apiurljs.uploadformat)).data.map(function (item) {
  51. return item.CNAME
  52. })
  53. //上传附件
  54. self.arrayFile1 = [];
  55. self.arrayFile2 = [];
  56. self.arrayFile3 = [];
  57. self.beforeUpload = function (n) {
  58. if (self.data.ID == 0) {
  59. if (spngvld.submit(".formedit")) {
  60. var getContent = editor2.html();
  61. var getContent_base64 = base64.encode(getContent);
  62. self.data.FBNR = getContent_base64;
  63. var dataArray = [];
  64. dataArray.push(self.data);
  65. var data = {
  66. ckey: "WJFB_TPXW",
  67. id: self.data.ID,
  68. routeid: self.routeid,
  69. routeinfoid: self.routeinfoid,
  70. routeinfotitle: self.data.BT,
  71. directionid: self.directionid,
  72. formeditid: self.formeditid,
  73. data: JSON.stringify(dataArray)
  74. }
  75. $http.post(apiurljs.login + "g2app/abase/saveData", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  76. .success(function (obj) {
  77. var res = strToJson(s4.decryptData_CBC(obj.data));
  78. if (res.code == 0) {
  79. self.data.ID = res.data.ID;
  80. self.routeid = res.data.ROUTEID;
  81. self.routeinfoid = res.data.ROUTEINFOID;
  82. self.getSwenList(1)
  83. self.upload(n)
  84. } else {
  85. sp.dialog(res.message)
  86. }
  87. })
  88. }
  89. } else {
  90. self.upload(n)
  91. }
  92. }
  93. self.upload = function (n) {
  94. var column = n == 1 ? "IMAGESDATA" : "VIDEODATA"
  95. var acceptFileTypes = n == 1 ? /(jpg|png)$/i : /(mp4)$/i
  96. $('#fileupload' + n).fileupload({
  97. url: apiurljs.login + 'g2app/abase/saveUploadFileName',
  98. dataType: 'json',
  99. beforeSend: function (xhr, data) {
  100. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  101. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=WJFB_TPXW,column=" + column + ",routeinfoid=" + self.routeinfoid + ",loaded=" + data.loaded + ",total=" + data.total));
  102. },
  103. add: function (e, data) {
  104. var num = 0;
  105. //文件类型判断
  106. $.each(data.originalFiles, function (index, item) {
  107. if (item['type'] != null && item['type'] != undefined && !acceptFileTypes.test(item['name'])) {
  108. if (n == 2) {
  109. sp.dialog("您好,请上传MP4格式的文件!");
  110. } else {
  111. sp.dialog("您好,请上传JPG、PNG格式的文件!");
  112. }
  113. return;
  114. } else {
  115. num++
  116. }
  117. })
  118. if (num == data.originalFiles.length) {
  119. data.submit();
  120. }
  121. },
  122. // 上传完成后的执行逻辑
  123. done: function (e, data) {
  124. var arrayFile = strToJson(s4.decryptData_CBC(data.result.data).slice(0, s4.decryptData_CBC(data.result.data).lastIndexOf("}") + 1))
  125. self["arrayFile" + n] = arrayFile.data;
  126. self["arrayFile" + n].forEach(function (item) {
  127. item.FILEURL1 = $sce.trustAsResourceUrl(apiurljs.login + "g2work" + item.FILEURL)
  128. })
  129. $scope.$apply();//绑定数据局部刷新
  130. }
  131. })
  132. $timeout(function () {
  133. $("#fileupload" + n).trigger("click")
  134. }, 1)
  135. }
  136. self.downLoad = function (item) {
  137. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  138. }
  139. self.deleteFile = function (file) {
  140. var dialogHead = "<span class=\"sp-dialog-head\"><span class=\"sp-dialog-tip\">温馨提示</span><span class=\"sp-dialog-close sp-closeDialog\" title=\"关闭\">×</span></span>";
  141. var dialogBody = "<div class=\"sp-dialog-body\">删除后不可恢复,您确认要删除吗?</div>";
  142. 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>";
  143. $('.sp-dialog').html(dialogHead + dialogBody + dialogFoot);
  144. sp.openCenter(".sp-dialog");
  145. ///取消按钮
  146. $('.sp-closeDialog').click(function (event) {
  147. sp.closeCenter(".sp-dialog");
  148. event.preventDefault();
  149. event.stopPropagation();
  150. });
  151. //post消息的id
  152. $("#delDataTrue").click(function () {
  153. var data = {
  154. tablename: "FILE_ATTACH",
  155. id: file.ID
  156. };
  157. $http.post(apiurljs.login + "g2app/dataabase/delDataById", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  158. .success(function (obj) {
  159. var res = strToJson(s4.decryptData_CBC(obj.data));
  160. sp.dialoghide();
  161. if (res.success) {
  162. self.getOther();
  163. } else {
  164. sp.dialog("删除失败,请联系管理员!");
  165. }
  166. });
  167. });
  168. }
  169. self.goAttach = function (obj) {
  170. if (obj) {
  171. if (apiurljs.zhType.indexOf(obj.FILEEXT) == -1) {
  172. sp.dialog("文件暂不支持在线预览,请点击下载查看!")
  173. return
  174. }
  175. $("#attachlist")[0].contentWindow.openFile(obj)
  176. if ($(".fa-chevron-down").is(":hidden") == true) {
  177. showToggle(document.getElementById("toggleButton"))
  178. }
  179. } else {
  180. $("#attachlist").attr("src", "attachlist.html?page=formedit&routeinfoid=" + self.routeinfoid)
  181. }
  182. }
  183. self.getSwenList = function (n) {
  184. self.SwenList = [];
  185. var data = {
  186. directionid: self.directionid,
  187. userid: self.userId,
  188. routeinfoid: self.routeinfoid,
  189. routeid: self.routeid,
  190. formeditid: ""
  191. }
  192. $http.post(apiurljs.login + "g2app/abase/queryDataLink", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  193. .success(function (obj) {
  194. var res = strToJson(s4.decryptData_CBC(obj.data));
  195. $.each(res.data.LINKS, function (index, item) {
  196. if (item.TEMPFORM.indexOf("formedit.html") > -1) {
  197. self.Title = item.VNAME;
  198. }
  199. if (item.TEMPFORM.indexOf("?docmode") > 0) {
  200. if (item.TEMPFORM.indexOf("attachlist") > -1) {
  201. item.TEMPFORM = item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  202. } else {
  203. item.TEMPFORM = "../" + item.TEMPFORM + "&dotype=" + self.dotype + "&type=" + self.get_type + "&lastReturnPageno=" + self.get_lastReturnPageno + "&lastReturnPage=" + self.get_lastReturnPage;
  204. }
  205. } else {
  206. item.TEMPFORM = "#";
  207. }
  208. self.SwenList.push(item)
  209. })
  210. self.SwenList.push({
  211. VNAME: "流程图",
  212. DIRECTIONID: self.SwenList[0].DIRECTIONID,
  213. TEMPFORM: "modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1]
  214. })
  215. if (n == 0) {
  216. self.getZRBM()
  217. } else {
  218. self.getData()
  219. }
  220. })
  221. }
  222. self.getSwenList(0)
  223. self.getZRBM = function () {
  224. var data = {
  225. ckey: "CODE_ZRBM",
  226. routeinfoid: self.routeinfoid
  227. }
  228. $http.post(apiurljs.login + "g2app/abase/queryDataCode", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  229. .success(function (obj) {
  230. var res = strToJson(s4.decryptData_CBC(obj.data));
  231. self.ZRBM = res.data.CODE_ZRBM;
  232. self.getSFSYLB()
  233. })
  234. }
  235. self.getSFSYLB = function () {
  236. var data = {
  237. ckey: "CODE_SFSYLB",
  238. routeinfoid: self.routeinfoid
  239. }
  240. $http.post(apiurljs.login + "g2app/abase/queryDataCode", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  241. .success(function (obj) {
  242. var res = strToJson(s4.decryptData_CBC(obj.data));
  243. self.SFSYLB = res.data.CODE_SFSYLB;
  244. self.getLM()
  245. })
  246. }
  247. self.getLM = function () {
  248. var data = {
  249. ckey: "CODE_LM",
  250. routeinfoid: self.routeinfoid
  251. }
  252. $http.post(apiurljs.login + "g2app/abase/queryDataCode", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  253. .success(function (obj) {
  254. var res = strToJson(s4.decryptData_CBC(obj.data));
  255. self.LM = res.data.CODE_LM;
  256. self.getDP()
  257. })
  258. }
  259. self.getDP = function () {
  260. var data = {
  261. userid: self.userId
  262. }
  263. $http.post(apiurljs.login + "g2app/richang/queryDpInfo", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  264. .success(function (obj) {
  265. var res = strToJson(s4.decryptData_CBC(obj.data));
  266. self.userDp = res.data.length == 0 ? "" : res.data[0].CODE;
  267. self.getData()
  268. })
  269. }
  270. //获取数据
  271. self.getData = function () {
  272. var data = {
  273. ckey: "WJFB_TPXW",
  274. id: 0,
  275. directionid: self.directionid,
  276. formeditid: self.formeditid,
  277. routeid: self.routeid,
  278. routeinfoid: self.routeinfoid
  279. }
  280. $http.post(apiurljs.login + "g2app/abase/queryData", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  281. .success(function (obj) {
  282. var res = strToJson(s4.decryptData_CBC(obj.data));
  283. self.data = {
  284. ID: res.data.WJFB_TPXW.ID,
  285. BT: res.data.WJFB_TPXW.BT,
  286. FBT: res.data.WJFB_TPXW.FBT,
  287. LM: "",
  288. FBNR: res.data.WJFB_TPXW.FBNR == null ? "" : res.data.WJFB_TPXW.FBNR,
  289. SFSYLB: res.data.WJFB_TPXW.SFSYLB == "" ? self.SFSYLB[0].CODE : res.data.WJFB_TPXW.SFSYLB,
  290. WJBT: res.data.WJFB_TPXW.WJBT,
  291. FBR: res.data.WJFB_TPXW.FBR == "" ? self.userName : res.data.WJFB_TPXW.FBR,
  292. FBBM: res.data.WJFB_TPXW.FBBM == "" ? self.userDp : res.data.WJFB_TPXW.FBBM,
  293. FBRQ: res.data.WJFB_TPXW.FBRQ == "" ? sp.format(sp.getLocalDate()) : sp.format(res.data.WJFB_TPXW.FBRQ),
  294. YJ: res.data.WJFB_TPXW.YJ,
  295. IMAGEDATA: res.data.WJFB_TPXW.IMAGEDATA
  296. }
  297. console.log(res.data.WJFB_TPXW.IMAGEDATA)
  298. self.readonly = {
  299. BT: res.data.WJFB_TPXW["BT.EREADONLY"] == "true",
  300. FBT: res.data.WJFB_TPXW["FBT.EREADONLY"] == "true",
  301. LM: res.data.WJFB_TPXW["LM.EREADONLY"] == "true",
  302. SFSYLB: res.data.WJFB_TPXW["SFSYLB.EREADONLY"] == "true",
  303. WJBT: res.data.WJFB_TPXW["WJBT.EREADONLY"] == "true",
  304. FBR: res.data.WJFB_TPXW["FBR.EREADONLY"] == "true",
  305. FBBM: res.data.WJFB_TPXW["FBBM.EREADONLY"] == "true",
  306. FBRQ: res.data.WJFB_TPXW["FBRQ.EREADONLY"] == "true",
  307. FBNR: res.data.WJFB_TPXW["FBNR.EREADONLY"] == "true",
  308. IMAGESDATA: res.data.WJFB_TPXW["IMAGESDATA.EREADONLY"] == "true",
  309. VIDEODATA: res.data.WJFB_TPXW["VIDEODATA.EREADONLY"] == "true",
  310. IMAGEDATA: res.data.WJFB_TPXW["IMAGEDATA.EREADONLY"] == "true",
  311. YJ: res.data.WJFB_TPXW["YJ.EREADONLY"] == "true"
  312. }
  313. editor2.html(base64.decode(self.data.FBNR));
  314. if (self.data.FBBM == "") {
  315. self.ZRBM.forEach(function (item) {
  316. if (item.CNAME == self.userDp) {
  317. self.data.FBBM = item.CODE;
  318. }
  319. })
  320. }
  321. if (self.data.ID == 0) {
  322. self.filedChange = true;
  323. } else {
  324. self.filedChange = false;
  325. }
  326. if (res.data.WJFB_TPXW.IMAGESDATA && res.data.WJFB_TPXW.IMAGESDATA != "") {
  327. self.arrayFile1 = JSON.parse(res.data.WJFB_TPXW.IMAGESDATA);
  328. self.arrayFile1.forEach(function (item) {
  329. item.FILEURL1 = $sce.trustAsResourceUrl(apiurljs.login + "g2work" + item.FILEURL)
  330. })
  331. }
  332. if (res.data.WJFB_TPXW.VIDEODATA && res.data.WJFB_TPXW.VIDEODATA != "") {
  333. self.arrayFile2 = JSON.parse(res.data.WJFB_TPXW.VIDEODATA);
  334. self.arrayFile2.forEach(function (item) {
  335. item.FILEURL1 = $sce.trustAsResourceUrl(apiurljs.login + "g2work" + item.FILEURL)
  336. })
  337. }
  338. //if (res.data.WJFB_TPXW.IMAGEDATA && res.data.WJFB_TPXW.IMAGEDATA != "") {
  339. // self.arrayFile3 = JSON.parse(res.data.WJFB_TPXW.IMAGEDATA);
  340. // self.arrayFile3.forEach(function (item) {
  341. // item.FILEURL1 = $sce.trustAsResourceUrl(apiurljs.login + "g2work" + item.FILEURL)
  342. // })
  343. //}
  344. editor2.html(base64.decode(res.data.WJFB_TPXW.FBNR));
  345. self.buttonList = res.data["WJFB_TPXW.FUNCLIST"];
  346. self.getOpinion("YJ")
  347. //watermark({
  348. // "watermarl_element": "app",
  349. // "watermark_txt": "测试水印内容",
  350. // "watermark_width": 150,
  351. // "watermark_height": 110,
  352. // "watermark_angle": 345
  353. //})
  354. })
  355. }
  356. //获取意见
  357. self.getOpinion = function (str) {
  358. var data = {
  359. cmanid: self.userId,
  360. routeinfoid: self.routeinfoid,
  361. routeid: "",//self.routeid,
  362. tableid: "WJFB_TPXW",
  363. colid: str,
  364. opiniontype: 0,
  365. orderbycol: "CDATE desc"
  366. }
  367. $http.post(apiurljs.login + "g2app/abase/queryDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  368. .success(function (obj) {
  369. var res = strToJson(s4.decryptData_CBC(obj.data));
  370. if (res.success == true) {
  371. self.YJ[str] = res.data;
  372. self.YJ[str + "STATUS"] = false;
  373. self.YJ[str].forEach(function (item) {
  374. item.CDATE = sp.datefmt("yyyy-MM-dd", item.CDATE);
  375. if (item.ROUTEID == self.routeid) {
  376. self.YJ[str + "STATUS"] = true;
  377. }
  378. })
  379. } else {
  380. sp.dialog(res.message)
  381. }
  382. })
  383. }
  384. //判断页面字段是否只读readonly、是否隐藏show
  385. self.hide = function (type, field) {
  386. if (self.dotype == 0 && type == "readonly") {
  387. return true;
  388. } else {
  389. if (self[type][field] == true) {
  390. return true;
  391. } else {
  392. return false;
  393. }
  394. }
  395. }
  396. //右上角按钮调用方法
  397. self.btnEvent = function (item) {
  398. switch (item.CODE) {
  399. case "SAVEITEM":
  400. self.btnSave(0);
  401. break;
  402. case "PRINTITEM":
  403. self.btnPrint();
  404. break;
  405. case "MEETITEM":
  406. self.Meet();
  407. break;
  408. case "SENDLOG":
  409. self.RouteList();
  410. break;
  411. default:
  412. self.forward(item);
  413. break;
  414. }
  415. }
  416. //保存提交,0直接保存,1保存后转发,2保存后对多人转发,3保存后跳转浏览
  417. self.btnSave = function (n) {
  418. //if (self.data.ID != 0 && self.arrayFile2.length != 0 && self.arrayFile3.length == 0) {
  419. // self.screenshot();
  420. // return
  421. //}
  422. if (spngvld.submit(".formedit")) {
  423. var getContent = editor2.html();
  424. var getContent_base64 = base64.encode(getContent);
  425. self.data.FBNR = getContent_base64;
  426. var dataArray = [];
  427. self.data.YJ = "";
  428. dataArray.push(self.data);
  429. var data = {
  430. ckey: "WJFB_TPXW",
  431. id: self.data.ID,
  432. routeid: self.routeid,
  433. routeinfoid: self.routeinfoid,
  434. routeinfotitle: self.data.BT,
  435. directionid: self.directionid,
  436. formeditid: self.formeditid,
  437. data: JSON.stringify(dataArray)
  438. }
  439. $http.post(apiurljs.login + "g2app/abase/saveData", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  440. .success(function (obj) {
  441. var res = strToJson(s4.decryptData_CBC(obj.data));
  442. if (res.code == 0) {
  443. self.data.ID = res.data.ID;
  444. self.routeid = res.data.ROUTEID;
  445. self.routeinfoid = res.data.ROUTEINFOID;
  446. self.filedChange = false;
  447. if (n == 0) {
  448. sp.dialog("保存成功!");
  449. $timeout(function () {
  450. sp.dialoghide()
  451. }, 1500)
  452. self.getSwenList(1)
  453. } else if (n == 1) {
  454. self.forward(self.btnItem);
  455. } else if (n == 2) {
  456. self.sendAll();
  457. } else if (n == 3) {
  458. self.browse()
  459. }
  460. } else {
  461. sp.dialog(res.message)
  462. }
  463. })
  464. }
  465. }
  466. //图片详情
  467. self.seePic = function (obj) {
  468. self.seePicUrl = obj.FILEURL1
  469. $('.sp-bgMask').fadeIn(200);
  470. $(".sp-bgMask").bind("click", function () {
  471. $(this).fadeOut(200);
  472. if ($("#seePic").is(":visible")) { //若对话框显示则淡出
  473. $("#seePic").fadeOut(200);
  474. }
  475. });
  476. $timeout(function () {
  477. sp.setCenter("#seePic")
  478. }, 1)
  479. }
  480. //浏览
  481. self.browse = function () {
  482. window.top.sp.addTabNav(self.data.ID, "预览", window.location.pathname.replace("formedit", "detail") + "?id=" + self.data.ID + "&formPage=formedit")
  483. }
  484. //打印
  485. self.btnPrint = function () {
  486. // 创建隐藏的可下载链接
  487. var eleLink = document.createElement('a');
  488. eleLink.download = "";
  489. eleLink.style.display = 'none';
  490. eleLink.href = apiurljs.login + "g2app/shouwen/PrintWord?data=" + encodeURIComponent(s4.encryptData_CBC("templatefilename=XZYGQJ.ftl&tablename=WJFB_TPXW&outfilepath=/tmp/市住建委干部因公请假申请表.wps&prtdate=TBSJ,QJSJKS,QJSJJS&routeinfoid=" + self.routeinfoid));
  491. // 触发点击
  492. document.body.appendChild(eleLink);
  493. eleLink.click();
  494. // 然后移除
  495. document.body.removeChild(eleLink);
  496. //window.open(apiurljs.login + "g2app/shouwen/PrintWord?templatefilename=shouwen.ftl&tablename=WJFB_TPXW&outfilepath=" + apiurljs.print + "&routeinfoid=" + self.routeinfoid)
  497. }
  498. //下载附件
  499. self.download = function (item) {
  500. window.open(apiurljs.login + "g2work/files/" + item.FILEURL.slice(7))
  501. }
  502. //删除附件
  503. self.deleteFile = function (item, str) {
  504. var data = {
  505. tablename: "WJFB_TPXW",
  506. column: str,
  507. routeinfoid: self.routeinfoid,
  508. fileid: item.FILEID,
  509. filenames: item.FILEOLDNAME
  510. }
  511. $http.post(apiurljs.login + "g2app/abase/deleteUploadFileName", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  512. .success(function (obj) {
  513. var res = strToJson(s4.decryptData_CBC(obj.data));
  514. if (res.success == true) {
  515. if (str == "IMAGESDATA") {
  516. self.arrayFile1 = res.data;
  517. } else if (str == "VIDEODATA") {
  518. self.arrayFile2 = res.data;
  519. } else {
  520. self.arrayFile3 = res.data;
  521. }
  522. } else {
  523. sp.dialog(res.message)
  524. }
  525. })
  526. }
  527. //视频截图
  528. self.screenshot = function () {
  529. var data = {
  530. tablename: "WJFB_TPXW",
  531. routeinfoid: self.routeinfoid,
  532. fileid: self.arrayFile2[0].FILEID,
  533. filecdate: self.arrayFile2[0].FILECDATE,
  534. filepath: self.arrayFile2[0].FILEURL,
  535. imgcolumn: "IMAGEDATA",
  536. count: 1
  537. }
  538. $http.post(apiurljs.login + "g2app/filepublishing/randomGrabberFFmpegImage", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  539. .success(function (obj) {
  540. var res = strToJson(s4.decryptData_CBC(obj.data));
  541. if (res.success == true) {
  542. self.btnSave(0)
  543. }
  544. })
  545. }
  546. //签写意见编辑状态
  547. self.opinion = {
  548. YJ: false,
  549. YJImg: false,
  550. }
  551. self.YJ = {
  552. YJ: [],
  553. YJSTATUS: false,
  554. }
  555. //下载意见表附件
  556. self.downLoadOption = function (item) {
  557. window.open(apiurljs.login + "g2work/files/" + item.FILEPATH.slice(7))
  558. }
  559. //删除意见表附件
  560. self.deleteOptionFile = function (file, str) {
  561. var data = {
  562. routeid: file.ROUTEID,
  563. tableid: "WJFB_TPXW",
  564. colid: str,
  565. fileid: file.FILEID
  566. };
  567. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinionWithRouteAttach", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  568. .success(function (obj) {
  569. var res = strToJson(s4.decryptData_CBC(obj.data));
  570. sp.dialoghide();
  571. if (res.success) {
  572. self.getOpinion(str);
  573. } else {
  574. sp.dialog("删除失败,请联系管理员!");
  575. }
  576. });
  577. }
  578. //意见附件(上表)
  579. self.upload2 = function (str) {
  580. $('#fileupload-' + str).fileupload({
  581. url: apiurljs.login + 'g2app/abase/UploadWholeFileWithRouteAttach',
  582. dataType: 'json',
  583. beforeSend: function (xhr, data) {
  584. xhr.setRequestHeader("Authorization", "Bearer " + self.get_AccessToken);
  585. xhr.setRequestHeader("File-Argument", s4.encryptData_CBC("tablename=SYS_ROUTE_ATTACHLIST,userid=" + self.userId + ",routeinfoid=" + self.routeinfoid
  586. + ",routeid=" + self.routeid + ",tableid=WJFB_TPXW,colid=" + str));
  587. },
  588. // 上传完成后的执行逻辑
  589. done: function (e, data) {
  590. self.uploading1 = false;
  591. self.getOpinion(str)
  592. }
  593. })
  594. }
  595. //签写意见
  596. self.openOpinion = function (str) {
  597. if (self.routeinfoid == 0 && self.routeid == 0) {
  598. sp.dialog("请先保存!")
  599. return;
  600. }
  601. self.opinion[str] = true;
  602. }
  603. //修改意见
  604. self.changeOpinion = function (str) {
  605. self.data[str] = self.YJ[str][0].OPINION;
  606. self.opinion[str] = true;
  607. }
  608. self.changeOpinionItem = function (str, item) {
  609. if (item.OPINIONIMAGE != "") {
  610. self.QianZi(str);
  611. self.opinion[str + "Img"] = true;
  612. }
  613. self.data[str] = item.OPINION;
  614. self.opinion[str] = true;
  615. }
  616. //提交意见
  617. self.Sopinion = function (str) {
  618. if (self.opinion[str + "Img"] == true) {
  619. self.data[str] = $("#" + str + "QZ").find("canvas")[0].toDataURL();
  620. } else {
  621. self.data[str] = $("#" + str).val();
  622. }
  623. var data = {
  624. cmanid: self.userId,
  625. routeinfoid: self.routeinfoid,
  626. routeid: self.routeid,
  627. tableid: "WJFB_TPXW",
  628. colid: str,
  629. opiniontype: 0,
  630. cresult: "",
  631. opinion: self.opinion[str + "Img"] == false ? self.data[str] : "",
  632. opinionimage: self.opinion[str + "Img"] == true ? self.data[str] : ""
  633. }
  634. $http.post(apiurljs.login + "g2app/abase/saveDataOpinion", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  635. .success(function (obj) {
  636. var res = strToJson(s4.decryptData_CBC(obj.data));
  637. if (res.success == true) {
  638. sp.dialog("保存成功!");
  639. self.getOpinion(str);
  640. self.opinion[str] = false;
  641. self.opinion[str + "Img"] = false;
  642. self.data[str] = "";
  643. self.changeFiled(str)
  644. } else {
  645. sp.dialog(res.message)
  646. }
  647. })
  648. }
  649. //删除意见
  650. self.Dopinion = function (str, item) {
  651. var data = {
  652. cmanid: self.userId,
  653. routeid: self.routeid,
  654. tableid: "WJFB_TPXW",
  655. colid: str,
  656. }
  657. $http.post(apiurljs.login + "g2app/abase/deleteDataOpinion", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  658. .success(function (obj) {
  659. var res = strToJson(s4.decryptData_CBC(obj.data));
  660. if (res.success == true) {
  661. self.getOpinion(str);
  662. self.changeFiled(str)
  663. } else {
  664. sp.dialog(res.message)
  665. }
  666. })
  667. }
  668. self.phraseText = "";//添加常用语
  669. self.phraseList = []//常用语列表
  670. //获取常用语库
  671. self.phrase = function (colid) {
  672. sp.layer("#phrase");
  673. self.colid = colid;
  674. self.getPhrase();
  675. }
  676. //添加常用语到常用语库
  677. self.Aphrase = function () {
  678. if (self.phraseText == "") {
  679. return;
  680. }
  681. var data = {
  682. cmanid: self.userId,
  683. tableid: "WJFB_TPXW",
  684. colid: self.colid,
  685. contents: self.phraseText
  686. }
  687. $http.post(apiurljs.login + "g2app/abase/insertDataPatterns", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  688. .success(function (obj) {
  689. var res = strToJson(s4.decryptData_CBC(obj.data));
  690. if (res.success == true) {
  691. self.phraseText = "";
  692. self.getPhrase();
  693. } else {
  694. sp.dialog(res.message)
  695. }
  696. })
  697. }
  698. //获取常用语库
  699. self.getPhrase = function () {
  700. var data = {
  701. cmanid: self.userId,
  702. tableid: "WJFB_TPXW",
  703. colid: self.colid
  704. }
  705. $http.post(apiurljs.login + "g2app/abase/queryDataPatterns", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  706. .success(function (obj) {
  707. var res = strToJson(s4.decryptData_CBC(obj.data));
  708. self.phraseList = res.data;
  709. self.phraseSelect = self.phraseList[0].CONTENTS;
  710. })
  711. }
  712. //从常用语库删除
  713. self.Dphrase = function () {
  714. var id = null;
  715. $.each(self.phraseList, function (index, item) {
  716. if (item.CONTENTS == self.phraseSelect) {
  717. id = item.ID;
  718. }
  719. })
  720. var data = {
  721. id: id
  722. }
  723. $http.post(apiurljs.login + "g2app/abase/deleteDataPatterns", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  724. .success(function (obj) {
  725. var res = strToJson(s4.decryptData_CBC(obj.data));
  726. self.getPhrase();
  727. })
  728. }
  729. //常用语确认为意见
  730. self.btnPhrase = function () {
  731. if (!self.colid) {
  732. self.nulla = self.phraseSelect;
  733. } else {
  734. self.data[self.colid] = self.phraseSelect;
  735. }
  736. sp.layerhide();
  737. }
  738. //签字—手写
  739. self.QianZi = function (str) {
  740. self.opinion[str + "Img"] = true;
  741. setTimeout(function () {
  742. new lineCanvas(str + "QZ")
  743. }, 1)
  744. }
  745. //清除手写
  746. self.canvasClear = function (str) {
  747. var cxt = $("#" + str + "QZ").find("canvas")[0].getContext("2d");
  748. cxt.clearRect(0, 0, $("#" + str + "QZ").find("canvas")[0].width, $("#" + str + "QZ").find("canvas")[0].height)
  749. }
  750. //发生修改
  751. self.changeFiled = function (str) {
  752. self.filedChange = true;
  753. }
  754. //转发
  755. self.forward = function (obj) {
  756. self.btnItem = obj;
  757. if (self.filedChange == true) {
  758. self.btnSave(1)
  759. } else {
  760. $("#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=wenjianbg")
  761. sp.layer("#forward")
  762. }
  763. }
  764. //查看流转记录
  765. self.RouteList = function () {
  766. sp.openNewWindow("../../forward/modeler_read.html?" + self.SwenList[0].TEMPFORM.split("?")[1], "流程图")
  767. //var data = {
  768. // directionid: self.directionid,
  769. // userid: self.userId,
  770. // routeid: self.routeid,
  771. // routeinfoid: self.routeinfoid,
  772. //}
  773. //$http.post(apiurljs.login + "g2app/abase/queryDataRouteList", {data: s4.encryptData_CBC(JSON.stringify(data))}, postCfg)
  774. // .success(function (obj) {
  775. // var res = strToJson(s4.decryptData_CBC(obj.data));
  776. // self.routeList = res.data;
  777. // $.each(self.routeList, function (index, item) {
  778. // item.mainUser = [];
  779. // item.copyUsers = [];
  780. // $.each(item.USERS, function (index1, item1) {
  781. // if (item1.KIND == 0) {
  782. // item.mainUser.push(item1.USERNAME);
  783. // } else {
  784. // item.copyUsers.push(item1.USERNAME);
  785. // }
  786. // })
  787. // item.mainUser = item.mainUser.join(",");
  788. // item.copyUsers = item.copyUsers.join(",");
  789. // })
  790. // setTimeout(function (item) {
  791. // sp.layer("#RouteList");
  792. // }, 100);
  793. // })
  794. }
  795. self.reSizeRow = function () {
  796. var bodybox = document.getElementById("bodyDiv");
  797. var topbox = document.getElementById("topDiv");
  798. var bottombox = document.getElementById("bottomDiv");
  799. var line = document.getElementById("lineDiv");
  800. document.getElementById("lineDiv").addEventListener("mousedown", function (event) {
  801. $(".mousemove").show()
  802. var bodyboxH = bodybox.clientHeight;
  803. var topboxH = topbox.clientHeight;
  804. var bottomboxH = bottombox.clientHeight;
  805. //var y = event.pageY - line.offsetTop;
  806. var y = event.pageY - line.clientHeight;
  807. document.addEventListener("mousemove", boxMove)
  808. function boxMove(event) {
  809. if (topboxH * 1 + (event.pageY - y) * 1 - 36 <= 45) {
  810. //
  811. } else if (bottomboxH * 1 - (event.pageY - y) * 1 - 36 <= 45) {
  812. //
  813. } else {
  814. topbox.style.height = topboxH * 1 + (event.pageY - y) * 1 - 36 + "px";
  815. //topbox.getElementsByTagName("iframe")[0].style.height = topboxH * 1 + (event.pageY - y) * 1 - 45 + "px";
  816. bottombox.style.height = bodyboxH * 1 - topboxH * 1 - (event.pageY - y) * 1 + 36 + "px";
  817. bottombox.getElementsByTagName("iframe")[0].style.height = bodyboxH * 1 - topboxH * 1 - (event.pageY - y) * 1 - 25 + "px";
  818. }
  819. }
  820. document.addEventListener("mouseup", function () {
  821. $(".mousemove").hide()
  822. document.removeEventListener("mousemove", boxMove)
  823. })
  824. })
  825. }
  826. ////头部关键字搜索---20230905
  827. self.headBtnSearchKeyword = "";
  828. self.headSearchResult = [];
  829. self.headSearchResult_view = false;
  830. self.headBtnSearch = function () {
  831. if (sp.isval(self.headBtnSearchKeyword)) {
  832. self.headSearchResult = [];
  833. var data = {
  834. "url": "/basic/api/StatSelect/selectCodeList",
  835. "data": { "keyWord": self.headBtnSearchKeyword }
  836. }
  837. //console.log(JSON.stringify(data));
  838. $http.post(apiurljs.login + "g2app/yizhangtu/selectCodeList", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
  839. .success(function (obj) {
  840. var res = strToJson(s4.decryptData_CBC(obj.data));
  841. //console.log(JSON.stringify(res.data));
  842. self.headSearchResult = res.data.build;
  843. if (sp.isval(self.headSearchResult)) {
  844. self.headSearchResult_view = true;
  845. } else {
  846. self.headSearchResult_view = false;
  847. }
  848. })
  849. } else {
  850. self.headSearchResult_view = false;
  851. }
  852. };
  853. self.headKeywordPage = function (itemdata) {
  854. var get_token = localStorage.getItem("main-token");
  855. var set_url = apiurljs.onePic + "wholeProcessPage/?token=" + get_token + "&name=" + itemdata.name + "&type=" + itemdata.type + "&id=" + itemdata.id;
  856. $('#attachlist')[0].contentWindow.openTool(set_url, '一张图');
  857. self.headSearchResult_view = false;
  858. };
  859. self.onePic = function () {
  860. $('#attachlist')[0].contentWindow.openTool(apiurljs.onePic + "wholeProcessPage/?token=" + localStorage.getItem("main-token"), "地图搜索")
  861. }
  862. //头部下滚冻结
  863. $(function () {
  864. $(".sp-page-center").eq(0).css("max-height", $("#topDiv").height()).css("height", $("#topDiv").height())
  865. //$("body").bind("scroll", function () {
  866. // var scrollTop = $("body").scrollTop();
  867. // if (scrollTop == 0) {
  868. // $(".FixTop").removeClass("FixTop");
  869. // }
  870. // if (scrollTop > 35) {
  871. // $(".sp-page-title").parents(".sp-box").addClass("FixTop");
  872. // }
  873. //});
  874. //页面高度撑满
  875. setTimeout(function () {
  876. if ($(".ibox-content").height() < $(window).height() - 31) {
  877. $(".ibox-content").css("height", $(window).height() - 31)
  878. }
  879. $(".mousemove").css("top", 0).css("left", 0).css("width", $(window).width()).css("height", $(window).height() - 10)
  880. }, 1)
  881. })
  882. var editor2;
  883. self.setKindEditor2 = function () {
  884. var options = {
  885. uploadJson: "",
  886. fileManagerJson: '',
  887. filterMode: true,//过滤HTML代码
  888. allowImageUpload: true,
  889. allowFlashUpload: false,
  890. allowMediaUpload: false,
  891. allowFileManager: false,
  892. themeType: 'simple',
  893. items: ['source', '|', 'undo', 'redo', '|', 'preview', 'template', '|',
  894. 'cut', 'copy', 'paste', 'plainpaste', 'wordpaste', '|',
  895. 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', '|',
  896. 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', '|',
  897. 'subscript', 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
  898. 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', '|',
  899. 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|',
  900. 'table', 'hr', 'emoticons', '|', 'pagebreak', 'anchor', '|', 'about'],
  901. //'table', 'image', 'insertfile', 'hr', 'emoticons', 'baidumap', '|',
  902. //'pagebreak', 'anchor', 'link', 'unlink', '|', 'about'],
  903. afterUpload: function (url, data, name) {
  904. this.sync();
  905. }, //图片上传后,将上传内容同步到textarea中
  906. afterBlur: function () {
  907. this.sync();
  908. }, ////失去焦点时,将内容同步到textarea中
  909. afterCreate: function () {
  910. this.sync();
  911. }
  912. }
  913. editor2 = KindEditor.create('#kindEditor_Content', options);
  914. };
  915. self.setKindEditor2();
  916. //视频截图功能
  917. //用来保存当前编辑图片的地址
  918. self.nowImgUrl = "";
  919. self.getVideoImg = function () {
  920. self.nowImgUrl="";
  921. var player = document.getElementById('videoBox'); //获取video的Dom节点
  922. var canvas = document.createElement("canvas");
  923. canvas.width = 1920;
  924. canvas.height = 1080;
  925. canvas.getContext("2d").drawImage(player, 0, 0, canvas.width, canvas.height);//截
  926. var dataURL = canvas.toDataURL("image/png"); //将图片转成base64格式
  927. self.nowImgUrl=dataURL;
  928. self.openImgLayer();
  929. }
  930. //打开截图收藏框
  931. self.cutType="type1";
  932. self.openImgLayer = function () {
  933. //每次打开截图层初始化截图窗口
  934. self.cutType="type1";
  935. var image = document.querySelector('#imageCut');
  936. cropper = new Cropper(image, {
  937. aspectRatio: 16 / 9,
  938. viewMode: 1,
  939. scalable: false,
  940. minCropBoxWidth: 64,
  941. minCropBoxHeight: 36,
  942. autoCrop: true,
  943. fillColor: "#fff",
  944. responsive:false,
  945. minContainerWidth:"640",//容器的最小宽度 默认:200;
  946. minContainerHeight:"360",//容器的最小高度 默认:100;
  947. });
  948. cropper.replace(self.nowImgUrl, false);
  949. sp.layer('#layer_fav',1);
  950. }
  951. self.closeImgLayer = function () {
  952. self.nowImgUrl = "";
  953. cropper.destroy();
  954. sp.closeCenter('.sp-layer');
  955. }
  956. self.changeCutType=function(){
  957. if(self.cutType=="type1"){
  958. cropper.options= {
  959. aspectRatio: 16 / 9,
  960. viewMode: 1,
  961. scalable: false,
  962. minCropBoxWidth: 64,
  963. minCropBoxHeight: 36,
  964. autoCrop: true,
  965. fillColor: "#fff",
  966. responsive:false,
  967. minContainerWidth:"640",//容器的最小宽度 默认:200;
  968. minContainerHeight:"360",//容器的最小高度 默认:100;
  969. };
  970. }else if(self.cutType=="type2"){
  971. cropper.options= {
  972. viewMode: 1,
  973. scalable: false,
  974. minCropBoxWidth: 64,
  975. minCropBoxHeight: 36,
  976. autoCrop: true,
  977. fillColor: "#fff",
  978. responsive:false,
  979. minContainerWidth:"640",//容器的最小宽度 默认:200;
  980. minContainerHeight:"360",//容器的最小高度 默认:100;
  981. };
  982. }
  983. }
  984. self.saveData = function () {
  985. var cas = cropper.getCroppedCanvas();
  986. var base64url = cas.toDataURL('image/png');
  987. var data = {
  988. base64: base64url
  989. }
  990. $http.post(apiurljs.login + "g2app/richang/base64ToImageUrl", data, postCfg)
  991. .success(function (obj) {
  992. var res = strToJson(s4.decryptData_CBC(obj.data));
  993. console.log(res);
  994. self.data.IMAGEDATA = apiurljs.login + "g2work" + res.data[0].url;
  995. //sp.closeCenter('.sp-layer');
  996. self.closeImgLayer()
  997. })
  998. }
  999. self.reset = function () {
  1000. if(self.nowImgUrl!=''){
  1001. cropper.reset();
  1002. }
  1003. }
  1004. self.zoomOut = function () {
  1005. if(self.nowImgUrl!=''){
  1006. cropper.zoom(0.1);
  1007. }
  1008. }
  1009. self.zoomIn = function () {
  1010. if(self.nowImgUrl!=''){
  1011. cropper.zoom(-0.1);
  1012. }
  1013. }
  1014. self.clear=function () {
  1015. if(self.nowImgUrl!=''){
  1016. self.nowImgUrl = "";
  1017. $("#imgUpload").blur();
  1018. $("#imgUpload").val("");
  1019. cropper.replace(" ",false);
  1020. }
  1021. }
  1022. }])
  1023. app.filter('trustHtml', function ($sce) {
  1024. return function (input) {
  1025. return $sce.trustAsHtml(input.replace(/\n/g, '<br/>').replace(/\s/g, '&nbsp;'));
  1026. };
  1027. });
  1028. //canvas画布签字
  1029. function lineCanvas(obj) {
  1030. var self = this;
  1031. self.linewidth = 1;
  1032. self.color = "#000000";
  1033. self.background = "#ffffff";
  1034. self.canvas = document.createElement("canvas");
  1035. document.getElementById(obj).appendChild(self.canvas);
  1036. self.cxt = self.canvas.getContext("2d");
  1037. self.canvas.width = document.getElementById(obj).clientWidth;
  1038. self.canvas.height = document.getElementById(obj).scrollHeight;
  1039. self.cxt.fillStyle = self.background;
  1040. self.cxt.fillRect(0, 0, self.canvas.width, self.canvas.width);
  1041. self.cxt.strokeStyle = self.color;
  1042. self.cxt.lineWidth = self.linewidth;
  1043. self.cxt.lineCap = "round";
  1044. //开始绘制
  1045. self.canvas.addEventListener("mousedown", function (e) {
  1046. self.cxt.beginPath();
  1047. self.cxt.lineTo(e.pageX - document.getElementById(obj).offsetLeft - 25, e.pageY - document.getElementById(obj).offsetTop + $(".sp-page-center").scrollTop() - 25);
  1048. self.canvas.addEventListener("mousemove", move)
  1049. }.bind(self), false);
  1050. //绘制中
  1051. function move() {
  1052. var e = window.event;
  1053. self.cxt.lineTo(e.pageX - document.getElementById(obj).offsetLeft - 25, e.pageY - document.getElementById(obj).offsetTop + $(".sp-page-center").scrollTop() - 25);
  1054. self.cxt.stroke();
  1055. }
  1056. //结束绘制
  1057. self.canvas.addEventListener("mouseup", up)
  1058. function up() {
  1059. self.cxt.closePath();
  1060. self.canvas.removeEventListener("mousemove", move)
  1061. }
  1062. };
  1063. var parentData = {}
  1064. function getData() {
  1065. parentData = angular.element(document.getElementById("app")).scope().data
  1066. return parentData
  1067. }
  1068. function showToggle(e) {
  1069. $(e).children().toggle()
  1070. $(e).next().toggle()
  1071. }
  1072. function toggleYJL(e) {
  1073. if ($(e).children(".fa-angle-double-down").is(":hidden") == true) {
  1074. $("#topDiv").css("height", 160)
  1075. $(e).parent().css("height", 450)
  1076. $("#attachlist").css("height", 200)
  1077. $("#bottomDiv").css("height", "")
  1078. } else {
  1079. $("#topDiv").css("height", 600)
  1080. $(e).parent().css("height", 10)
  1081. }
  1082. $(e).children().toggle()
  1083. }