Portrait.cshtml 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. @using WeApp.Configuration
  2. @using WeApp.Authorization
  3. @using WeApp.TrainingCamp.Dto
  4. @using WeApp.TrainingCampGroup.Dto
  5. @{
  6. var isEdit = ViewBag.IsEdit;
  7. ViewBag.Title = "演练培训营画像";
  8. string activeMenu = PermissionNames.PagesTrainMgPortraitMg;
  9. ViewBag.ActiveMenu = activeMenu;
  10. string campState = ViewBag.CampState, groupState = ViewBag.GroupState;
  11. List<CampGroupDto> groups = ViewBag.Groups;
  12. CampDto camp = ViewBag.Camp;
  13. string campNo = camp.Id;
  14. //List<string> groupNos = groups?.Select(a => a.Id).ToList() ?? new List<string>();
  15. }
  16. @section css{
  17. <link href="~/Content/Css/portrait.css" rel="stylesheet" />
  18. <style>
  19. .tip-remark {
  20. display: flex;
  21. border: 1px solid #1e90ff;
  22. padding: 6px 5px;
  23. margin: 5px 10px;
  24. }
  25. .tip-remark span {
  26. width: 90%;
  27. display: flex;
  28. align-items: center;
  29. padding: 0 10px;
  30. }
  31. .tip-remark button {
  32. width: 10%;
  33. }
  34. .btn-report {
  35. position: absolute;
  36. left: 800px;
  37. top: 8px;
  38. z-index: 1089;
  39. }
  40. </style>
  41. }
  42. <div class="nav-box">
  43. @if (groups != null && groups.Any())
  44. {
  45. <ul class="nav">
  46. @foreach (var g in groups)
  47. {
  48. var id = g.Id;
  49. <li class="nav-item">
  50. <a class="nav-link" data-toggle="pill" data-target="#group_@(id)" data-id="@(id)" role="tab">@(g.Name)</a>
  51. </li>
  52. }
  53. @if (isEdit)
  54. {
  55. <li class="nav-item">
  56. <a class="nav-link " style="background: coral; border: 1px solid coral;color:#fff" href="javascript:RefreshPortrait()">重新生成画像</a>
  57. </li>
  58. }
  59. </ul>
  60. }
  61. </div>
  62. <div class="row">
  63. @if (groups != null && groups.Any())
  64. {
  65. <div class="tab-content" style="width: 100%;">
  66. @foreach (var g in groups)
  67. {
  68. var id = g.Id;
  69. <div class="tab-pane fade" id="group_@(id)" data-id="@(id)">
  70. <a class="btn btn-report btn-iwb" href="@Url.Action("Report","Train",new{g.Id})" target="_blank"> @(g.Name) 评估报告</a>
  71. <div class="col-md-12" id="group-box_@(g.Id)">
  72. <div id="group-info_@(id)" class="portrait-box">
  73. <div class="title-box">
  74. <div class="left">
  75. <span>演练信息</span>
  76. </div>
  77. <div class="right"></div>
  78. </div>
  79. </div>
  80. <div id="group-process_@(id)" class="portrait-box">
  81. <div class="title-box ra">
  82. <div class="left">
  83. <span>演练过程</span>
  84. </div>
  85. <div class="right"></div>
  86. </div>
  87. <div class="content-box">
  88. <div class="inner-box" style="width: 25%;">
  89. <div class="inner-title">演练情景</div>
  90. <div class="inner-content fdc">
  91. <div id="scene-info_@(id)" class="tab-box fdc" style="height: calc(100% - 110px);"></div>
  92. <div class="remark-box" style="height: 100px; margin-top: 10px;">
  93. <div class="inner-title">主情景说明</div>
  94. <div class="inner-content">
  95. <div class="span-textarea" style="" data-type="@(PortraitRemarkTypeDefinition.Scene)" data-id="@(id)">
  96. <span id="scene_remark_@(id)" class="span-remark"></span>
  97. @if (isEdit)
  98. {
  99. <button class="btn btn-iwb btn-sm" data-type="@(PortraitRemarkTypeDefinition.Scene)">信息提示</button>
  100. <textarea id="scene_text_@(id)" name="" style="width: 100%; height: 100%;" placeholder="演练场景简要说明"></textarea>
  101. }
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="inner-box" style="width: 50%; margin-left: 5px;">
  108. <div class="inner-title">推演网格</div>
  109. <div id="training-info_@(id)" class="inner-content">
  110. <div class="tab-box fdc">
  111. <div class="tab-header" style="width: 100%;">
  112. <ul class="nav training">
  113. <li class="nav-item">
  114. <a class="nav-link" id="tab-ti-fc_@(id)" data-no="@(id)" data-toggle="pill" data-target="#ti-fc_@(id)">蜂巢网格</a>
  115. </li>
  116. <li class="nav-item">
  117. <a class="nav-link" id="tab-ti-sx_@(id)" data-type="1" data-no="@(id)" data-toggle="pill" data-target="#ti-sx_@(id)">树形网格</a>
  118. </li>
  119. <li class="nav-item">
  120. <a class="nav-link" id="tab-ti-hx_@(id)" data-type="2" data-no="@(id)" data-toggle="pill" data-target="#ti-hx_@(id)">环形网格</a>
  121. </li>
  122. </ul>
  123. </div>
  124. <div class="tab-content" style="width: 100%; height: 500px; padding: 0 5px 5px 5px;">
  125. <div class="tab-pane fade" id="ti-fc_@(id)" style="height: 100%;">
  126. <div id="ti-fc-box_@(id)" class="chart-box" style="height: 100%;"></div>
  127. </div>
  128. <div class="tab-pane fade" id="ti-sx_@(id)" style="height: 100%;">
  129. <div id="ti-sx-box_@(id)" class="chart-box" style="height: 100%;"></div>
  130. </div>
  131. <div class="tab-pane fade" id="ti-hx_@(id)" style="height: 100%;">
  132. <div id="ti-hx-box_@(id)" class="chart-box" style="height: 100%;"></div>
  133. </div>
  134. </div>
  135. </div>
  136. </div>
  137. </div>
  138. <div class="inner-box" style="width: 25%; margin-left: 5px;">
  139. <div class="inner-title">组织角色</div>
  140. <div class="inner-content ">
  141. <div id="cmd-info_@(id)" class="tab-box fdc">
  142. </div>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <div id="group-eval_@(id)" class="portrait-box">
  148. <div class="title-box ra">
  149. <div class="left">
  150. <span>演练评估</span>
  151. </div>
  152. <div class="right">
  153. <div id="score-chart_@(id)" style="width: 100%; height: 100%"></div>
  154. </div>
  155. </div>
  156. <div class="content-box">
  157. <div class="inner-box" style="width: 38%;">
  158. <div class="inner-title">四功评估</div>
  159. <div class="inner-content fdc eval-box">
  160. <div class="chart-box" id="sg-chart_@(id)" style="width: 100%; height: 100%"></div>
  161. <div class="" style="height: 100px">
  162. <div class="span-textarea" style="" data-type="@(PortraitRemarkTypeDefinition.SiGong)" data-id="@(id)">
  163. <span id="sg_remark_@(id)" class="span-remark @(isEdit?"generate":"")"></span>
  164. @if (isEdit)
  165. {
  166. <button class="btn btn-iwb btn-sm" data-type="@(PortraitRemarkTypeDefinition.SiGong)">信息提示</button>
  167. <textarea id="sg_text_@(id)" name="" style="width: 100%; height: 100%;" placeholder="四功评估简要说明"></textarea>
  168. }
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="inner-box" style="width: 38%; margin-left: 5px;">
  174. <div class="inner-title">五力评估</div>
  175. <div class="inner-content fdc eval-box">
  176. <div class="chart-box" id="wl-chart_@(id)" style="width: 100%; height: 100%"></div>
  177. <div class="" style="height: 100px">
  178. <div class="span-textarea" style="" data-type="@(PortraitRemarkTypeDefinition.WuLi)" data-id="@(id)">
  179. <span id="wl_remark_@(id)" class="span-remark @(isEdit?"generate":"")"></span>
  180. @if (isEdit)
  181. {
  182. <button class="btn btn-iwb btn-sm" data-type="@(PortraitRemarkTypeDefinition.WuLi)">信息提示</button>
  183. <textarea id="wl_text_@(id)" name="" style="width: 100%; height: 100%;" placeholder="五力评估简要说明"></textarea>
  184. }
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. <div class="inner-box" style="width: 24%; margin-left: 5px;">
  190. <div style="height: 50%;">
  191. <div class="inner-title">演练成绩与不足</div>
  192. <div class="inner-content eval-box">
  193. <div class="span-textarea" style="" data-type="@(PortraitRemarkTypeDefinition.Short)" data-id="@(id)">
  194. <span id="short_remark_@(id)" class="span-remark @(isEdit?"generate":"")"></span>
  195. @if (isEdit)
  196. {
  197. <button class="btn btn-iwb btn-sm" data-type="@(PortraitRemarkTypeDefinition.Short)">信息提示</button>
  198. <textarea id="short_text_@(id)" name="" style="width: 100%; height: 100%;" placeholder="演练成绩与不足简要说明"></textarea>
  199. }
  200. </div>
  201. </div>
  202. </div>
  203. <div style="height: 50%;margin-top: 10px">
  204. <div class="inner-title">专家评语</div>
  205. <div class="inner-content eval-box">
  206. <div class="span-textarea" style="" data-type="@(PortraitRemarkTypeDefinition.ZhuanJia)" data-id="@(id)">
  207. <span id="zj_remark_@(id)" class="span-remark @(isEdit?"generate":"")"></span>
  208. @if (isEdit)
  209. {
  210. <button class="btn btn-iwb btn-sm" data-type="@(PortraitRemarkTypeDefinition.ZhuanJia)">信息提示</button>
  211. <textarea id="zj_text_@(id)" name="" style="width: 100%; height: 100%;" placeholder="专家评语"></textarea>
  212. }
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. }
  222. </div>
  223. }
  224. </div>
  225. @section scripts
  226. {
  227. <script src="~/Content/Libs/eCharts/echarts.min.js"></script>
  228. @*<script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/highcharts.js"></script>
  229. <script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/modules/heatmap.js"></script>
  230. <script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/modules/oldie.js"></script>
  231. <script type="text/javascript" src="https://code.highcharts.com.cn/highcharts/modules/tilemap.js"></script>*@
  232. <script src="~/Content/Libs/highcharts/highcharts.min.js"></script>
  233. <script src="~/Content/Libs/highcharts/modules/heatmap.min.js"></script>
  234. <script src="~/Content/Libs/highcharts/modules/oldie.min.js"></script>
  235. <script src="~/Content/Libs/highcharts/modules/tilemap.min.js"></script>
  236. <script>
  237. $(function() {
  238. $('.nav-box .nav .nav-item a.nav-link').on('show.bs.tab',
  239. function(e) {
  240. var id = $(e.target).data('id');
  241. GetGroupInfo(id);
  242. });
  243. $('.nav-box .nav .nav-item').eq(0).find('a.nav-link').tab('show');
  244. $('.training .nav-item a.nav-link').on('shown.bs.tab',
  245. function(e) {
  246. var id = $(e.target).data('target');
  247. var active = $(id + ' .tab-header').find('.nav .nav-item a.nav-link.active');
  248. if (active.length) {
  249. active.removeClass('active').tab('show');
  250. } else {
  251. $(id + ' .tab-header').find('.nav .nav-item').eq(0).find('a.nav-link').tab('show');
  252. }
  253. });
  254. @if (isEdit)
  255. {
  256. <text>
  257. $('.span-textarea').off('click.text').on('click.text',
  258. function() {
  259. EditInfo($(this));
  260. });
  261. $('.span-textarea button').on('mousedown',
  262. function(e) {
  263. e.preventDefault();
  264. var $that = $(this);
  265. var type = $that.data('type');
  266. PortraitRemark($that, type);
  267. });
  268. </text>
  269. }
  270. });
  271. function RefreshPortrait() {
  272. $.iwbAjax4({
  273. url: abp.appUrl + "Portrait/CleanPortrait?no=@(campNo)",
  274. success: function() {
  275. $('.nav-box .nav .nav-item').eq(0).find('a.nav-link').removeClass('active').tab('show').trigger('shown.bs.tab');
  276. }
  277. });
  278. }
  279. function GetGroupInfo(no) {
  280. $.iwbAjax4({
  281. url: abp.appUrl + "Portrait/GenerateGroupPortrait?no=" + no,
  282. success: function(res) {
  283. if (res) {
  284. FormatterGroupInfo(res, no);
  285. }
  286. }
  287. });
  288. }
  289. function FormatterGroupInfo(data, no) {
  290. var line = '<dl class="line"><dt>{0}</dt><dd>{1}</dd></dl>', str = '';
  291. str += line.format("参演单位:", data.groupName ? data.groupName : "");
  292. str += line.format("演练主题:", data.campName ? data.campName : "");
  293. str += line.format("演练地点:", data.address ? data.address : "");
  294. str += line.format("演练时间:", data.startDate ? new Date(data.startDate).format("yyyy-MM-dd hh:mm") : "");
  295. $('#group-info_' + no).find('.title-box .right').html(str);
  296. str = '';
  297. str += line.format("演练用时:", '<span class="mid">{0}</span>分钟'.format(data.trainingMinute));
  298. str += line.format("情景数量:", '<span class="mid">{0}</span>条'.format(data.sceneCount));
  299. str += line.format("组织角色:", '<span class="mid">{0}</span>个'.format(data.roleCount));
  300. str += line.format("下达指令:", '<span class="mid">{0}</span>条'.format(data.cmdCount));
  301. $('#group-process_' + no).find('.title-box .right').html(str);
  302. $('#scene_remark_' + no).html(data.sceneRemark ? data.sceneRemark : "");
  303. $('#sg_remark_' + no).html(data.siGongRemark ? data.siGongRemark : "");
  304. $('#wl_remark_' + no).html(data.wuLiRemark ? data.wuLiRemark : "");
  305. $('#short_remark_' + no).html(data.shortRemark ? data.shortRemark : "");
  306. $('#zj_remark_' + no).html(data.zhuanJiaRemark ? data.zhuanJiaRemark : "");
  307. FormatterRoundScene(data.sceneInfos, no);
  308. FormatterRoleCmdInfo(data.roleCmdInfos, no);
  309. try {
  310. var trainingData = JSON.parse(data.trainingInfos);
  311. FormatterChartBox(trainingData, no, 'fc', FcRoundChart);
  312. FormatterChartBox(trainingData, no, 'sx', TreePathChart);
  313. FormatterChartBox(trainingData, no, 'hx', TreePathChart);
  314. $('#tab-ti-fc_' + no).tab('show').trigger('shown.bs.tab');
  315. } catch (e1) {
  316. console.log(e1);
  317. }
  318. try {
  319. var scoreData = JSON.parse(data.roundScoreInfos);
  320. RoundScoreChart(no, scoreData);
  321. } catch (e3) {
  322. console.log(e3);
  323. }
  324. try {
  325. var sgData = JSON.parse(data.siGongInfos);
  326. SiGongChart(no, sgData);
  327. } catch (e4) {
  328. console.log(e4);
  329. }
  330. try {
  331. var wlData = JSON.parse(data.wuLiInfos);
  332. WuLiChart(no, wlData);
  333. } catch (e5) {
  334. console.log(e5);
  335. }
  336. }
  337. function FormatterRoundScene(dataStr, no) {
  338. var str = '';
  339. try {
  340. var data = JSON.parse(dataStr);
  341. if (data && data.length > 0) {
  342. var str1 = '', str2 = '';
  343. data.forEach(function(v) {
  344. str1 +=
  345. '<li class="nav-item"><a class="nav-link" data-toggle="pill" data-target="#scene_{0}_{1}" role="tab">第{1}轮</a></li>'
  346. .format(no, v.roundIndex);
  347. str2 +=
  348. '<div class="tab-pane fade" id="scene_{0}_{1}"><div class="body-content">{2}</div></div>'
  349. .format(no, v.roundIndex, FormatterScene(v.sceneInfos));
  350. });
  351. str += '<div class="tab-header"><ul class="nav">{0}</ul></div>'.format(str1);
  352. str += '<div class="tab-content" style="width: 100%;">{0}</div>'.format(str2);
  353. }
  354. } catch (e) {
  355. console.log(e);
  356. }
  357. $('#scene-info_' + no).empty();
  358. if (str) {
  359. $('#scene-info_' + no).html(str);
  360. $('#scene-info_' + no).find('.nav-item').eq(0).find('a.nav-link').tab('show');
  361. OverlayScrollbar($('#scene-info_' + no + ' .body-content'));
  362. }
  363. }
  364. function FormatterScene(data) {
  365. var str = '';
  366. if (data && data.length > 0) {
  367. data.forEach(function(v) {
  368. str +=
  369. '<div class="scene-box"><span class="name">{0}:</span><span class="content">{1}</span></div>'
  370. .format(v.name,
  371. v.description);
  372. });
  373. }
  374. return str;
  375. }
  376. function FormatterChartBox(data, no, idStr, callBack) {
  377. var str = '';
  378. try {
  379. // var data = JSON.parse(dataStr);
  380. if (data && data.length > 0) {
  381. var str1 = '', str2 = '';
  382. data.forEach(function(v) {
  383. str1 +=
  384. '<li class="nav-item"><a class="nav-link" data-toggle="pill" data-target="#{2}-chart_{0}_{1}" data-no="{0}" data-round="{1}" role="tab">第{1}轮</a></li>'
  385. .format(no, v.roundIndex, idStr);
  386. str2 +=
  387. '<div class="tab-pane fade" id="{2}-chart_{0}_{1}" style="width: 100%; height: 100%;"><div class="body-content" style="width: 100%; height: 100%;"><div id="{2}-container_{0}_{1}" style="width:100%;height:100%"></div></div></div>'
  388. .format(no, v.roundIndex, idStr);
  389. });
  390. str += '<div class="tab-header"><ul class="nav">{0}</ul></div>'.format(str1);
  391. str += '<div class="tab-content" style="width: 100%;">{0}</div>'.format(str2);
  392. }
  393. } catch (e) {
  394. console.log(e);
  395. }
  396. $('#ti-' + idStr + '-box_' + no).empty();
  397. if (str) {
  398. $('#ti-' + idStr + '-box_' + no).html(str);
  399. $('#ti-' + idStr + '-box_' + no + '>.tab-header').find('.nav .nav-item a.nav-link').on('shown.bs.tab',
  400. function(e) {
  401. if (callBack && typeof callBack == 'function') {
  402. var no = $(e.target).data('no'),
  403. round = $(e.target).data('round');
  404. var roundData = data.find(function(v) {
  405. return v.roundIndex == round;
  406. });
  407. callBack(no, roundData, idStr);
  408. }
  409. });
  410. //$('#ti-' + idStr + '-box_' + no + '>.tab-header').find('.nav .nav-item').eq(0).find('a.nav-link').tab('show');
  411. OverlayScrollbar($('#ti-' + idStr + '-box_' + no + ' .body-content'));
  412. }
  413. }
  414. function FormatterRoleCmdInfo(dataStr, no) {
  415. var str = '';
  416. try {
  417. var data = JSON.parse(dataStr);
  418. if (data && data.length > 0) {
  419. var str1 = '', str2 = '';
  420. data.forEach(function(v) {
  421. str1 +=
  422. '<li class="nav-item"><a class="nav-link" data-toggle="pill" data-id="{0}_{1}" data-target="#cmd_{0}_{1}" role="tab">第{1}轮</a></li>'
  423. .format(no, v.roundIndex);
  424. str2 += '<div class="tab-pane fade" id="cmd_{0}_{1}"><div class="body-content">{2}</div></div>'
  425. .format(no,
  426. v.roundIndex,
  427. FormatterCmd(v.roleCmdInfos, 'cmd-role_{0}_{1}'.format(no, v.roundIndex)));
  428. });
  429. str += '<div class="tab-header"><ul class="nav">{0}</ul></div>'.format(str1);
  430. str += '<div class="tab-content" style="width: 100%;">{0}</div>'.format(str2);
  431. }
  432. } catch (e) {
  433. console.log(e);
  434. }
  435. $('#cmd-info_' + no).empty();
  436. if (str) {
  437. $('#cmd-info_' + no).html(str);
  438. $('#cmd-info_' + no + '>.tab-header').find('.nav .nav-item a.nav-link').on('shown.bs.tab',
  439. function(e) {
  440. var id = $(e.target).data('id');
  441. $('#cmd-role_' + id).find('.nav .nav-item').eq(0).find('a.nav-link').tab('show');
  442. OverlayScrollbar($('#cmd-role_' + no + ' .body-content'));
  443. });
  444. $('#cmd-info_' + no + '>.tab-header').find('.nav .nav-item').eq(0).find('a.nav-link').tab('show');
  445. OverlayScrollbar($('#cmd-info_' + no + ' .body-content'));
  446. }
  447. }
  448. function FormatterCmd(data, no) {
  449. var str = '';
  450. if (data && data.length > 0) {
  451. var str1 = '', str2 = '', i = 0;
  452. data.forEach(function(v) {
  453. var ran = new Date().getTime() + Math.floor(Math.random() * 10000);
  454. str1 +=
  455. '<li class="nav-item"><a class="nav-link" data-toggle="pill" data-target="#role_{0}" role="tab">{1}</a></li>'
  456. .format(ran, v.roleName);
  457. var str3 = '';
  458. if (v.cmdInfo) {
  459. v.cmdInfo.forEach(function(val) {
  460. var arr = val.split('|');
  461. var style = arr[0] == '@(LogStateDefinition.NotSend)' ? "not-send" : "";
  462. str3 += '<div class="cmd-box {0}"><span class="content">{1}</span></div>'.format(style,
  463. arr[1]);
  464. });
  465. }
  466. str2 +=
  467. '<div class="tab-pane fade" id="role_{0}" style=""><div class="body-content" style="height: 100%;">{1}</div></div>'
  468. .format(ran, str3);
  469. i++;
  470. });
  471. str += '<div class="tab-box" id="{0}" style="height: 100%;">'.format(no);
  472. str +=
  473. '<div class="tab-header" style="height: 100%;width:200px; "><ul class="nav nav-role">{0}</ul></div>'
  474. .format(str1);
  475. str +=
  476. '<div class="tab-content" style="width: 100%;height: 100%;padding:0;border:none;border-left: 2px solid #007bff;border-radius: 0;">{0}</div>'
  477. .format(str2);
  478. str += '</div>';
  479. }
  480. return str;
  481. }
  482. </script>
  483. <script>
  484. var color = ['#FF3030', '#FF6A6A', '#FFD700', '#54FF9F', '#00E5EE'];
  485. var roundColor = ['#FFA939', '#FF6A69', '#35D480'];
  486. //推演网格
  487. function TreePathChart(groupNo, data, idStr) {
  488. if (data) {
  489. console.log("TreePath", data);
  490. } else {
  491. console.log("TreePath-Null");
  492. return;
  493. }
  494. var isRadial = idStr == "hx";
  495. idStr = idStr + '-container_' + groupNo + '_' + data.roundIndex;
  496. if ($('#' + idStr).data('use') === true) {
  497. return;
  498. }
  499. var treeChart = echarts.init(document.getElementById(idStr)), seriesOpt = {};
  500. var d = ConvertTreeData(data.infos, isRadial);
  501. console.log("ConvertTreeData", d);
  502. if (isRadial) {
  503. seriesOpt = {
  504. layout: 'radial'
  505. }
  506. }
  507. var opt = {
  508. type: 'tree',
  509. data: d,
  510. top: '5%',
  511. left: '5%',
  512. bottom: '5%',
  513. right: '5%',
  514. symbolSize: 15,
  515. initialTreeDepth: 2,
  516. label: {
  517. position: 'top',
  518. rotate: 0,
  519. fontSize: 13,
  520. fontWeight: 'normal',
  521. distance: 5
  522. },
  523. lineStyle: {
  524. width: 2
  525. },
  526. itemStyle: {
  527. borderWidth: 1
  528. },
  529. leaves: {
  530. itemStyle: {
  531. borderWidth: 1.5
  532. }
  533. },
  534. expandAndCollapse: true,
  535. animationDuration: 550,
  536. animationDurationUpdate: 450
  537. };
  538. var o = $.extend(true, {}, opt, seriesOpt);
  539. console.log(o);
  540. var option = {
  541. tooltip: {
  542. trigger: 'item',
  543. triggerOn: 'mousemove'
  544. },
  545. series: [o]
  546. };
  547. treeChart.setOption(option);
  548. $('#' + idStr).data('use', true);
  549. }
  550. //蜂巢网格
  551. function FcRoundChart(groupNo, data, idStr) {
  552. if (data) {
  553. var seriesData = [];
  554. seriesData.push($.extend({}, { name: data.fcInfo.name, type: 'tilemap', data: data.fcInfo.fcInfos }));
  555. if (data.fcFlowInfo && data.fcFlowInfo.length > 0) {
  556. data.fcFlowInfo.forEach(function (v) {
  557. seriesData.push($.extend({}, { name: v.name, type: 'spline', data: v.flowInfos }));
  558. });
  559. }
  560. console.log(seriesData);
  561. idStr = idStr + '-container_' + groupNo + '_' + data.roundIndex;
  562. if ($('#' + idStr).data('use') === true) {
  563. return;
  564. }
  565. window.Highcharts.chart(idStr,
  566. {
  567. chart: {
  568. reflow: true,
  569. height: '60%',
  570. margin: 5,
  571. inverted: false,
  572. backgroundColor: 'transparent'
  573. },
  574. exporting: {
  575. enabled: false
  576. },
  577. title: {
  578. visible: false,
  579. text: null
  580. },
  581. xAxis: {
  582. visible: false
  583. },
  584. yAxis: {
  585. visible: false,
  586. reversed: true
  587. },
  588. colorAxis: {
  589. visible: false,
  590. dataClasses: [
  591. {
  592. from: 0,
  593. to: 1,
  594. color: '#c7f0f3',
  595. name: ''
  596. }, {
  597. from: 1,
  598. to: 2,
  599. color: '#02595a',
  600. name: ''
  601. }
  602. ]
  603. },
  604. tooltip: {
  605. enabled: false,
  606. headerFormat: '',
  607. pointFormat: ''
  608. },
  609. colors: ['#c7f0f3'],
  610. legend: {
  611. enabled: false
  612. },
  613. credits: {
  614. enabled: false
  615. },
  616. plotOptions: {
  617. tilemap: {
  618. allowPointSelect: true,
  619. clip: true,
  620. cursor: 'pointer',
  621. enableMouseTracking: false,
  622. },
  623. spline: {
  624. enableMouseTracking: false,
  625. lineWidth: 5,
  626. marker: {
  627. enabled: false
  628. },
  629. series: {
  630. animation: {
  631. duration: 3000
  632. }
  633. }
  634. }
  635. },
  636. series: seriesData
  637. });
  638. $('#' + idStr).data('use', true);
  639. }
  640. }
  641. //轮次得分条
  642. function RoundScoreChart(groupNo, data) {
  643. if ($('#score-chart_' + groupNo).data('use') === true) {
  644. return;
  645. }
  646. if (data && data.length > 0) {
  647. console.log("RoundScore", data);
  648. } else {
  649. console.log("RoundScore-Null");
  650. return;
  651. }
  652. var scoreChart = echarts.init(document.getElementById('score-chart_' + groupNo));
  653. var series = [];
  654. for (var i = 1; i <= data.length; i++) {
  655. var temp = {
  656. name: '第 ' + i + ' 轮',
  657. type: 'bar',
  658. stack: '总分',
  659. label: {
  660. normal: {
  661. show: true,
  662. position: 'inside',
  663. color: "#fff",
  664. fontSize: 14,
  665. fontWeight: 'bold',
  666. formatter: '{a}: {c} 分'
  667. }
  668. },
  669. barWidth: 39,
  670. barMinHeight: 140,
  671. itemStyle: {},
  672. data: [data[i - 1]]
  673. }
  674. if (i === 1) {
  675. temp.itemStyle = {
  676. color: roundColor[0],
  677. barBorderRadius: [30, 0, 0, 30]
  678. }
  679. temp.label.normal.color = "#fff";
  680. } else if (i === data.length) {
  681. temp.itemStyle = {
  682. color: roundColor[2],
  683. barBorderRadius: [0, 30, 30, 0]
  684. }
  685. temp.label.normal.color = "#fff";
  686. } else {
  687. if (i % 3 === 1) {
  688. temp.itemStyle = {
  689. color: roundColor[0]
  690. }
  691. temp.label.normal.color = "#fff";
  692. } else if (i % 3 === 2) {
  693. temp.itemStyle = {
  694. color: roundColor[1]
  695. }
  696. } else if (i % 3 === 0) {
  697. temp.itemStyle = {
  698. color: roundColor[2]
  699. }
  700. temp.label.normal.color = "#fff";
  701. }
  702. }
  703. series.push(temp);
  704. }
  705. //console.log(series);
  706. var option = {
  707. grid: {
  708. left: 30,
  709. right: 140
  710. },
  711. xAxis: {
  712. show: false,
  713. type: 'value'
  714. },
  715. yAxis: {
  716. show: false,
  717. type: 'category',
  718. data: ['分数']
  719. },
  720. series: series
  721. };
  722. scoreChart.setOption(option);
  723. $('#score-chart_' + groupNo).data('use', true);
  724. }
  725. //四功
  726. function SiGongChart(groupNo, data) {
  727. if ($('#sg-chart_' + groupNo).data('use') === true) {
  728. return;
  729. }
  730. if (data && data.length > 0) {
  731. console.log("SiGong", data);
  732. } else {
  733. console.log("SiGong-Null");
  734. return;
  735. }
  736. var siGongChart = echarts.init(document.getElementById('sg-chart_' + groupNo));
  737. var series = [];
  738. var legendDate = [];
  739. var sgData = [[], [], []];
  740. for (var i = 1; i <= data.length; i++) {
  741. if (i > 4) {
  742. return;
  743. }
  744. var item = data[i - 1];
  745. legendDate.push(item.name);
  746. for (var q = 0; q < 3; q++) {
  747. sgData[q].push(data[i - 1].tagScoreInfos[q]);
  748. }
  749. }
  750. for (var j = 1; j < 4; j++) {
  751. var temp = {
  752. name: '第 ' + j + ' 轮',
  753. type: 'bar',
  754. label: {
  755. normal: {
  756. show: true,
  757. formatter: '{a}:{c} 分',
  758. color: "#fff",
  759. rotate: 90
  760. }
  761. },
  762. barMinHeight: 40,
  763. itemStyle: {
  764. color: {
  765. type: 'linear',
  766. x: 0,
  767. y: 0,
  768. x2: 0,
  769. y2: 1,
  770. colorStops: [
  771. {
  772. offset: 0,
  773. color: '#FFA939' // 0% 处的颜色
  774. }, {
  775. offset: 1,
  776. color: '#27303f' // 100% 处的颜色
  777. }
  778. ]
  779. },
  780. barBorderRadius: [50, 50, 0, 0]
  781. //shadowBlur: 2,
  782. //shadowColor: "#666",
  783. //shadowOffsetX: 2,
  784. //shadowOffsetY: 1
  785. },
  786. data: sgData[j - 1]
  787. }
  788. if (j === 1) {
  789. //temp.itemStyle = {
  790. // color: roundColor[0]
  791. //}
  792. temp.itemStyle.color.colorStops[0].color = roundColor[0];
  793. temp.label.normal.color = "#fff";
  794. } else if (j === 2) {
  795. //temp.itemStyle = {
  796. // color: roundColor[1]
  797. //}
  798. temp.itemStyle.color.colorStops[0].color = roundColor[1];
  799. } else {
  800. //temp.itemStyle = {
  801. // color: roundColor[2]
  802. //}
  803. temp.itemStyle.color.colorStops[0].color = roundColor[2];
  804. temp.label.normal.color = "#fff";
  805. }
  806. series.push(temp);
  807. }
  808. var option = {
  809. grid: {
  810. top: 20,
  811. bottom: 30,
  812. left: 30,
  813. right: 30,
  814. borderColor: '#2d8aea'
  815. },
  816. //legend: {
  817. // data: legendDate
  818. //},
  819. xAxis: {
  820. type: 'category',
  821. data: legendDate,
  822. axisLabel: {
  823. color: '#fff'
  824. },
  825. axisLine: {
  826. show: true,
  827. lineStyle: {
  828. color: '#2d8aea'
  829. }
  830. }
  831. },
  832. yAxis: {
  833. type: 'value',
  834. axisLabel: {
  835. color: '#fff'
  836. },
  837. axisLine: {
  838. show: true,
  839. lineStyle: {
  840. color: '#2d8aea'
  841. }
  842. },
  843. splitLine: {
  844. lineStyle: {
  845. color: '#2d8aea'
  846. }
  847. }
  848. },
  849. series: series
  850. };
  851. console.log(option);
  852. siGongChart.setOption(option);
  853. $('#sg-chart_' + groupNo).data('use', true);
  854. }
  855. //五力
  856. function WuLiChart(groupNo, data) {
  857. if ($('#wl-chart_' + groupNo).data('use') === true) {
  858. return;
  859. }
  860. if (data && data.length > 0) {
  861. console.log("WuLi", data);
  862. } else {
  863. console.log("WuLi-Null");
  864. return;
  865. }
  866. var wuLiChart = echarts.init(document.getElementById('wl-chart_' + groupNo));
  867. var series = [];
  868. var indicatorData = [];
  869. var wlData = [
  870. { name: '第 1 轮', value: [], lineStyle: { color: roundColor[0] } },
  871. { name: '第 2 轮', value: [], lineStyle: { color: roundColor[1] } },
  872. { name: '第 3 轮', value: [], lineStyle: { color: roundColor[2] } }
  873. ];
  874. for (var i = 1; i <= data.length; i++) {
  875. if (i > 5) {
  876. return;
  877. }
  878. var item = data[i - 1];
  879. indicatorData.push({ text: item.name, max: 100, color: color[i - 1] });
  880. for (var q = 0; q < 3; q++) {
  881. wlData[q].value.push(data[i - 1].tagScoreInfos[q]);
  882. }
  883. }
  884. for (var j = 0; j < 4; j++) {
  885. var temp = {
  886. name: '第 ' + j + ' 轮',
  887. type: 'radar',
  888. radarIndex: j
  889. }
  890. if (j === 0) {
  891. temp.name = '三轮五力雷达图';
  892. temp.data = wlData;
  893. } else {
  894. if (j === 1) {
  895. temp.lineStyle = {
  896. color: roundColor[0]
  897. }
  898. //temp.label.normal.color = "#fff";
  899. } else if (j === 2) {
  900. temp.lineStyle = {
  901. color: roundColor[1]
  902. }
  903. // temp.label.normal.color = "#fff";
  904. } else {
  905. temp.lineStyle = {
  906. color: roundColor[2]
  907. }
  908. }
  909. temp.data = [wlData[j - 1]];
  910. }
  911. series.push(temp);
  912. }
  913. var option = {
  914. grid: {
  915. top: 10,
  916. bottom: 10,
  917. left: 30,
  918. right: 30
  919. },
  920. radar: [
  921. {
  922. indicator: indicatorData,
  923. center: ['30%', '50%'],
  924. radius: 120,
  925. splitNumber: 4,
  926. axisLine: {
  927. lineStyle: {
  928. color: ['#C1CDCD']
  929. }
  930. },
  931. splitLine: {
  932. lineStyle: {
  933. color: ['#F0FFFF', '#C1CDCD']
  934. }
  935. }
  936. },
  937. {
  938. indicator: indicatorData,
  939. radius: 40,
  940. center: ['77%', '20%'],
  941. splitNumber: 3,
  942. nameGap: 5,
  943. axisLine: {
  944. show: false
  945. },
  946. splitLine: {
  947. lineStyle: {
  948. color: ['#F0FFFF', '#C1CDCD']
  949. }
  950. }
  951. },
  952. {
  953. indicator: indicatorData,
  954. radius: 40,
  955. center: ['77%', '50%'],
  956. splitNumber: 3,
  957. nameGap: 5,
  958. axisLine: {
  959. show: false
  960. },
  961. splitLine: {
  962. lineStyle: {
  963. color: ['#F0FFFF', '#C1CDCD']
  964. }
  965. }
  966. },
  967. {
  968. indicator: indicatorData,
  969. center: ['77%', '80%'],
  970. radius: 40,
  971. splitNumber: 3,
  972. nameGap: 5,
  973. axisLine: {
  974. show: false
  975. },
  976. splitLine: {
  977. lineStyle: {
  978. color: ['#F0FFFF', '#C1CDCD']
  979. }
  980. }
  981. }
  982. ],
  983. series: series
  984. };
  985. //console.log(option);
  986. wuLiChart.setOption(option);
  987. $('#wl-chart_' + groupNo).data('use', true);
  988. }
  989. function ConvertTreeData(data, isRadial) {
  990. var newData = [];
  991. var color1 = "#1E90FF",
  992. color2 = "#999",
  993. width1 = isRadial ? 2 : 4,
  994. width2 = isRadial ? 1 : 3;
  995. if (data && data.length) {
  996. data.forEach(function (v) {
  997. var newItem = $.extend(true, {}, {
  998. itemStyle: {
  999. color: color2,
  1000. borderColor: color2,
  1001. width: width2
  1002. },
  1003. label: {
  1004. color: "#1E90FF"
  1005. },
  1006. lineStyle: {
  1007. color: color2,
  1008. borderColor: color2,
  1009. width: width2
  1010. }
  1011. }, v);
  1012. newItem.collapsed = true;
  1013. if (v.isRun) {
  1014. newItem.itemStyle.color = color1;
  1015. newItem.itemStyle.borderColor = color1;
  1016. newItem.itemStyle.width = width1;
  1017. newItem.label.color = color1;
  1018. newItem.label.fontWeight = 'bold';
  1019. newItem.lineStyle.color = color1;
  1020. newItem.lineStyle.borderColor = color1;
  1021. newItem.lineStyle.width = width1;
  1022. newItem.collapsed = false;
  1023. }
  1024. if (v.children && v.children.length) {
  1025. newItem.children = ConvertTreeData(v.children, isRadial);
  1026. }
  1027. newData.push(newItem);
  1028. });
  1029. }
  1030. return newData;
  1031. }
  1032. </script>
  1033. <script>
  1034. function EditInfo($that) {
  1035. var $content = $that.find('span'), $btn = $that.find('button'), $text = $that.find('textarea');
  1036. if ($text.css('display') === 'flex') {
  1037. return;
  1038. }
  1039. var text = $content.text();
  1040. $content.css('display', 'none');
  1041. $btn.css('display', 'block');
  1042. $text.css('display', 'flex').off('blur').on('blur.text',
  1043. function (e) {
  1044. e.preventDefault();
  1045. SaveInfo($(this));
  1046. });
  1047. $text.val(text);
  1048. $text[0].focus();
  1049. }
  1050. function SaveInfo($that) {
  1051. var text = $that.val(),
  1052. $that2 = $that.closest('.span-textarea'),
  1053. $content = $that2.find('span'),
  1054. $btn = $that2.find('button');
  1055. var type = $that2.data('type');
  1056. var groupNo = $that2.data('id');
  1057. $that.css('display', 'none');
  1058. $btn.css('display', 'none');
  1059. $content.text(text).css('display', 'flex');
  1060. UpdateRemark({
  1061. groupNo: groupNo,
  1062. type: type,
  1063. remark: text
  1064. });
  1065. }
  1066. function UpdateRemark(data) {
  1067. $.iwbAjax5({
  1068. url: abp.appUrl + 'Portrait/UpdateRemark',
  1069. data: data
  1070. });
  1071. }
  1072. function PortraitRemark($that, type) {
  1073. $(".span-textarea textarea").off('blur.text');
  1074. var no = $($that).closest(".tab-pane").data("id");
  1075. $.iwbAjax4({
  1076. url: abp.appUrl + 'PortraitRemark/GetRemarkByType?type=' + type + "&no=" + no,
  1077. success: function (res) {
  1078. if (res && res.length > 0) {
  1079. var str = '';
  1080. var $text = $that.closest('.span-textarea').find('textarea');
  1081. res.forEach(function (v) {
  1082. str +=
  1083. '<div class="tip-remark"><span>{0}</span><button class="btn btn-iwb btn-sm select-remark">选择</button></div>'
  1084. .format(v.remarkContent);
  1085. });
  1086. $(document).iwbModal('create',
  1087. {
  1088. modal: 'modal-remark',
  1089. modaltitle: '预置信息提示',
  1090. modalSize: 'modal-lg',
  1091. modalBody: str,
  1092. shownAfter: function () {
  1093. $('#modal-remark .select-remark').off('mousedown.addInfo').on('mousedown.addInfo',
  1094. function (e) {
  1095. e.preventDefault();
  1096. var text = $(this).closest('.tip-remark').find('span').text();
  1097. $text.val($text.val() + text);
  1098. $(this).prop('disabled', true);
  1099. });
  1100. $('#modal-remark').off('hidden.bs.modal').on('hidden.bs.modal',
  1101. function () {
  1102. $text[0].focus();
  1103. $('.span-textarea textarea').off('blur.text').on('blur.text',
  1104. function (e) {
  1105. e.preventDefault();
  1106. SaveInfo($(this));
  1107. });
  1108. });
  1109. }
  1110. });
  1111. } else {
  1112. abp.message.warn('未查询到提示信息!').done(function () {
  1113. $('.span-textarea textarea').off('blur.text').on('blur.text',
  1114. function (e) {
  1115. e.preventDefault();
  1116. SaveInfo($(this));
  1117. });
  1118. });
  1119. }
  1120. },
  1121. error: function () {
  1122. $(".span-textarea textarea").off('blur.text').on('blur.text',
  1123. function () {
  1124. SaveInfo($(this));
  1125. });
  1126. }
  1127. });
  1128. }
  1129. </script>
  1130. <!--格式化-->
  1131. <script id="formatter-script" type="text/javascript">
  1132. function TypeFormatter(v) {
  1133. var name = $('#hid-type option[value="' + v + '"]').text();
  1134. switch (v) {
  1135. case 0:
  1136. return '<span class="label label-danger">' + name + '</span>';
  1137. default:
  1138. return '<span class="label label-info">' + name + '</span>';
  1139. }
  1140. }
  1141. function StateFormatter(v) {
  1142. var name = $('#hid-state option[value="' + v + '"]').text();
  1143. switch (v) {
  1144. case '@(CampGroupStateDefinition.New)':
  1145. return '<span class="label label-info">' + name + '</span>';
  1146. case '@(CampGroupStateDefinition.Run)':
  1147. return '<span class="label label-iwb">' + name + '</span>';
  1148. case '@(CampGroupStateDefinition.Error)':
  1149. case '@(CampGroupStateDefinition.End)':
  1150. return '<span class="label label-danger">' + name + '</span>';
  1151. default:
  1152. return '<span class="label label-info">' + name + '</span>';
  1153. }
  1154. }
  1155. </script>
  1156. }
  1157. <section style="display: none">
  1158. <select id="hid-type">
  1159. <option value=""></option>
  1160. </select>
  1161. <select id="hid-camp-state">
  1162. @(Html.Raw(campState))
  1163. </select>
  1164. <select id="hid-group-state">
  1165. @(Html.Raw(groupState))
  1166. </select>
  1167. @*@Html.DropDownList("hid-type", type)*@
  1168. </section>