Portrait.cshtml 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221
  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. var scoreChart = echarts.init(document.getElementById('score-chart_' + groupNo));
  644. if ($('#score-chart_' + groupNo).data('use') === true) {
  645. scoreChart.resize();
  646. return;
  647. }
  648. if (data && data.length > 0) {
  649. console.log("RoundScore", data);
  650. } else {
  651. console.log("RoundScore-Null");
  652. return;
  653. }
  654. var series = [];
  655. for (var i = 1; i <= data.length; i++) {
  656. var temp = {
  657. name: '第 ' + i + ' 轮',
  658. type: 'bar',
  659. stack: '总分',
  660. label: {
  661. normal: {
  662. show: true,
  663. position: 'inside',
  664. color: "#fff",
  665. fontSize: 14,
  666. fontWeight: 'bold',
  667. formatter: '{a}: {c} 分'
  668. }
  669. },
  670. barWidth: 39,
  671. barMinHeight: 140,
  672. itemStyle: {},
  673. data: [data[i - 1]]
  674. }
  675. if (i === 1) {
  676. temp.itemStyle = {
  677. color: roundColor[0],
  678. barBorderRadius: [30, 0, 0, 30]
  679. }
  680. temp.label.normal.color = "#fff";
  681. } else if (i === data.length) {
  682. temp.itemStyle = {
  683. color: roundColor[2],
  684. barBorderRadius: [0, 30, 30, 0]
  685. }
  686. temp.label.normal.color = "#fff";
  687. } else {
  688. if (i % 3 === 1) {
  689. temp.itemStyle = {
  690. color: roundColor[0]
  691. }
  692. temp.label.normal.color = "#fff";
  693. } else if (i % 3 === 2) {
  694. temp.itemStyle = {
  695. color: roundColor[1]
  696. }
  697. } else if (i % 3 === 0) {
  698. temp.itemStyle = {
  699. color: roundColor[2]
  700. }
  701. temp.label.normal.color = "#fff";
  702. }
  703. }
  704. series.push(temp);
  705. }
  706. //console.log(series);
  707. var option = {
  708. grid: {
  709. left: 30,
  710. right: 140
  711. },
  712. xAxis: {
  713. show: false,
  714. type: 'value'
  715. },
  716. yAxis: {
  717. show: false,
  718. type: 'category',
  719. data: ['分数']
  720. },
  721. series: series
  722. };
  723. scoreChart.setOption(option);
  724. scoreChart.resize();
  725. $('#score-chart_' + groupNo).data('use', true);
  726. }
  727. //四功
  728. function SiGongChart(groupNo, data) {
  729. var siGongChart = echarts.init(document.getElementById('sg-chart_' + groupNo));
  730. if ($('#sg-chart_' + groupNo).data('use') === true) {
  731. siGongChart.resize();
  732. return;
  733. }
  734. if (data && data.length > 0) {
  735. //console.log("SiGong", data);
  736. } else {
  737. //console.log("SiGong-Null");
  738. return;
  739. }
  740. var series = [];
  741. var legendDate = [];
  742. var sgData = [[], [], []];
  743. for (var i = 1; i <= data.length; i++) {
  744. if (i > 4) {
  745. return;
  746. }
  747. var item = data[i - 1];
  748. legendDate.push(item.name);
  749. for (var q = 0; q < 3; q++) {
  750. sgData[q].push(data[i - 1].tagScoreInfos[q]);
  751. }
  752. }
  753. for (var j = 1; j < 4; j++) {
  754. var temp = {
  755. name: '第 ' + j + ' 轮',
  756. type: 'bar',
  757. label: {
  758. normal: {
  759. show: true,
  760. formatter: '{a}:{c} 分',
  761. color: "#fff",
  762. rotate: 90
  763. }
  764. },
  765. barMinHeight: 40,
  766. itemStyle: {
  767. color: {
  768. type: 'linear',
  769. x: 0,
  770. y: 0,
  771. x2: 0,
  772. y2: 1,
  773. colorStops: [
  774. {
  775. offset: 0,
  776. color: '#FFA939' // 0% 处的颜色
  777. }, {
  778. offset: 1,
  779. color: '#27303f' // 100% 处的颜色
  780. }
  781. ]
  782. },
  783. barBorderRadius: [50, 50, 0, 0]
  784. //shadowBlur: 2,
  785. //shadowColor: "#666",
  786. //shadowOffsetX: 2,
  787. //shadowOffsetY: 1
  788. },
  789. data: sgData[j - 1]
  790. }
  791. if (j === 1) {
  792. //temp.itemStyle = {
  793. // color: roundColor[0]
  794. //}
  795. temp.itemStyle.color.colorStops[0].color = roundColor[0];
  796. temp.label.normal.color = "#fff";
  797. } else if (j === 2) {
  798. //temp.itemStyle = {
  799. // color: roundColor[1]
  800. //}
  801. temp.itemStyle.color.colorStops[0].color = roundColor[1];
  802. } else {
  803. //temp.itemStyle = {
  804. // color: roundColor[2]
  805. //}
  806. temp.itemStyle.color.colorStops[0].color = roundColor[2];
  807. temp.label.normal.color = "#fff";
  808. }
  809. series.push(temp);
  810. }
  811. var option = {
  812. grid: {
  813. top: 20,
  814. bottom: 30,
  815. left: 30,
  816. right: 30,
  817. borderColor: '#2d8aea'
  818. },
  819. //legend: {
  820. // data: legendDate
  821. //},
  822. xAxis: {
  823. type: 'category',
  824. data: legendDate,
  825. axisLabel: {
  826. color: '#fff'
  827. },
  828. axisLine: {
  829. show: true,
  830. lineStyle: {
  831. color: '#2d8aea'
  832. }
  833. }
  834. },
  835. yAxis: {
  836. type: 'value',
  837. axisLabel: {
  838. color: '#fff'
  839. },
  840. axisLine: {
  841. show: true,
  842. lineStyle: {
  843. color: '#2d8aea'
  844. }
  845. },
  846. splitLine: {
  847. lineStyle: {
  848. color: '#2d8aea'
  849. }
  850. }
  851. },
  852. series: series
  853. };
  854. //console.log(option);
  855. siGongChart.setOption(option);
  856. siGongChart.resize();
  857. $('#sg-chart_' + groupNo).data('use', true);
  858. }
  859. //五力
  860. function WuLiChart(groupNo, data) {
  861. var wuLiChart = echarts.init(document.getElementById('wl-chart_' + groupNo));
  862. if ($('#wl-chart_' + groupNo).data('use') === true) {
  863. wuLiChart.resize();
  864. return;
  865. }
  866. if (data && data.length > 0) {
  867. //console.log("WuLi", data);
  868. } else {
  869. //console.log("WuLi-Null");
  870. return;
  871. }
  872. var series = [];
  873. var indicatorData = [];
  874. var wlData = [
  875. { name: '第 1 轮', value: [], lineStyle: { color: roundColor[0] } },
  876. { name: '第 2 轮', value: [], lineStyle: { color: roundColor[1] } },
  877. { name: '第 3 轮', value: [], lineStyle: { color: roundColor[2] } }
  878. ];
  879. for (var i = 1; i <= data.length; i++) {
  880. if (i > 5) {
  881. return;
  882. }
  883. var item = data[i - 1];
  884. indicatorData.push({ text: item.name, max: 100, color: color[i - 1] });
  885. for (var q = 0; q < 3; q++) {
  886. wlData[q].value.push(data[i - 1].tagScoreInfos[q]);
  887. }
  888. }
  889. for (var j = 0; j < 4; j++) {
  890. var temp = {
  891. name: '第 ' + j + ' 轮',
  892. type: 'radar',
  893. radarIndex: j
  894. }
  895. if (j === 0) {
  896. temp.name = '三轮五力雷达图';
  897. temp.data = wlData;
  898. } else {
  899. if (j === 1) {
  900. temp.lineStyle = {
  901. color: roundColor[0]
  902. }
  903. //temp.label.normal.color = "#fff";
  904. } else if (j === 2) {
  905. temp.lineStyle = {
  906. color: roundColor[1]
  907. }
  908. // temp.label.normal.color = "#fff";
  909. } else {
  910. temp.lineStyle = {
  911. color: roundColor[2]
  912. }
  913. }
  914. temp.data = [wlData[j - 1]];
  915. }
  916. series.push(temp);
  917. }
  918. var option = {
  919. grid: {
  920. top: 10,
  921. bottom: 10,
  922. left: 30,
  923. right: 30
  924. },
  925. radar: [
  926. {
  927. indicator: indicatorData,
  928. center: ['30%', '50%'],
  929. radius: 120,
  930. splitNumber: 4,
  931. axisLine: {
  932. lineStyle: {
  933. color: ['#C1CDCD']
  934. }
  935. },
  936. splitLine: {
  937. lineStyle: {
  938. color: ['#F0FFFF', '#C1CDCD']
  939. }
  940. }
  941. },
  942. {
  943. indicator: indicatorData,
  944. radius: 40,
  945. center: ['77%', '20%'],
  946. splitNumber: 3,
  947. nameGap: 5,
  948. axisLine: {
  949. show: false
  950. },
  951. splitLine: {
  952. lineStyle: {
  953. color: ['#F0FFFF', '#C1CDCD']
  954. }
  955. }
  956. },
  957. {
  958. indicator: indicatorData,
  959. radius: 40,
  960. center: ['77%', '50%'],
  961. splitNumber: 3,
  962. nameGap: 5,
  963. axisLine: {
  964. show: false
  965. },
  966. splitLine: {
  967. lineStyle: {
  968. color: ['#F0FFFF', '#C1CDCD']
  969. }
  970. }
  971. },
  972. {
  973. indicator: indicatorData,
  974. center: ['77%', '80%'],
  975. radius: 40,
  976. splitNumber: 3,
  977. nameGap: 5,
  978. axisLine: {
  979. show: false
  980. },
  981. splitLine: {
  982. lineStyle: {
  983. color: ['#F0FFFF', '#C1CDCD']
  984. }
  985. }
  986. }
  987. ],
  988. series: series
  989. };
  990. //console.log(option);
  991. wuLiChart.setOption(option);
  992. wuLiChart.resize();
  993. $('#wl-chart_' + groupNo).data('use', true);
  994. }
  995. function ConvertTreeData(data, isRadial) {
  996. var newData = [];
  997. var color1 = "#1E90FF",
  998. color2 = "#999",
  999. width1 = isRadial ? 2 : 4,
  1000. width2 = isRadial ? 1 : 3;
  1001. if (data && data.length) {
  1002. data.forEach(function (v) {
  1003. var newItem = $.extend(true, {}, {
  1004. itemStyle: {
  1005. color: color2,
  1006. borderColor: color2,
  1007. width: width2
  1008. },
  1009. label: {
  1010. color: "#1E90FF"
  1011. },
  1012. lineStyle: {
  1013. color: color2,
  1014. borderColor: color2,
  1015. width: width2
  1016. }
  1017. }, v);
  1018. newItem.collapsed = true;
  1019. if (v.isRun) {
  1020. newItem.itemStyle.color = color1;
  1021. newItem.itemStyle.borderColor = color1;
  1022. newItem.itemStyle.width = width1;
  1023. newItem.label.color = color1;
  1024. newItem.label.fontWeight = 'bold';
  1025. newItem.lineStyle.color = color1;
  1026. newItem.lineStyle.borderColor = color1;
  1027. newItem.lineStyle.width = width1;
  1028. newItem.collapsed = false;
  1029. }
  1030. if (v.children && v.children.length) {
  1031. newItem.children = ConvertTreeData(v.children, isRadial);
  1032. }
  1033. newData.push(newItem);
  1034. });
  1035. }
  1036. return newData;
  1037. }
  1038. </script>
  1039. <script>
  1040. function EditInfo($that) {
  1041. var $content = $that.find('span'), $btn = $that.find('button'), $text = $that.find('textarea');
  1042. if ($text.css('display') === 'flex') {
  1043. return;
  1044. }
  1045. var text = $content.text();
  1046. $content.css('display', 'none');
  1047. $btn.css('display', 'block');
  1048. $text.css('display', 'flex').off('blur').on('blur.text',
  1049. function (e) {
  1050. e.preventDefault();
  1051. SaveInfo($(this));
  1052. });
  1053. $text.val(text);
  1054. $text[0].focus();
  1055. }
  1056. function SaveInfo($that) {
  1057. var text = $that.val(),
  1058. $that2 = $that.closest('.span-textarea'),
  1059. $content = $that2.find('span'),
  1060. $btn = $that2.find('button');
  1061. var type = $that2.data('type');
  1062. var groupNo = $that2.data('id');
  1063. $that.css('display', 'none');
  1064. $btn.css('display', 'none');
  1065. $content.text(text).css('display', 'flex');
  1066. UpdateRemark({
  1067. groupNo: groupNo,
  1068. type: type,
  1069. remark: text
  1070. });
  1071. }
  1072. function UpdateRemark(data) {
  1073. $.iwbAjax5({
  1074. url: abp.appUrl + 'Portrait/UpdateRemark',
  1075. data: data
  1076. });
  1077. }
  1078. function PortraitRemark($that, type) {
  1079. $(".span-textarea textarea").off('blur.text');
  1080. var no = $($that).closest(".tab-pane").data("id");
  1081. $.iwbAjax4({
  1082. url: abp.appUrl + 'PortraitRemark/GetRemarkByType?type=' + type + "&no=" + no,
  1083. success: function (res) {
  1084. if (res && res.length > 0) {
  1085. var str = '';
  1086. var $text = $that.closest('.span-textarea').find('textarea');
  1087. res.forEach(function (v) {
  1088. str +=
  1089. '<div class="tip-remark"><span>{0}</span><button class="btn btn-iwb btn-sm select-remark">选择</button></div>'
  1090. .format(v.remarkContent);
  1091. });
  1092. $(document).iwbModal('create',
  1093. {
  1094. modal: 'modal-remark',
  1095. modaltitle: '预置信息提示',
  1096. modalSize: 'modal-lg',
  1097. modalBody: str,
  1098. shownAfter: function () {
  1099. $('#modal-remark .select-remark').off('mousedown.addInfo').on('mousedown.addInfo',
  1100. function (e) {
  1101. e.preventDefault();
  1102. var text = $(this).closest('.tip-remark').find('span').text();
  1103. $text.val($text.val() + text);
  1104. $(this).prop('disabled', true);
  1105. });
  1106. $('#modal-remark').off('hidden.bs.modal').on('hidden.bs.modal',
  1107. function () {
  1108. $text[0].focus();
  1109. $('.span-textarea textarea').off('blur.text').on('blur.text',
  1110. function (e) {
  1111. e.preventDefault();
  1112. SaveInfo($(this));
  1113. });
  1114. });
  1115. }
  1116. });
  1117. } else {
  1118. abp.message.warn('未查询到提示信息!').done(function () {
  1119. $('.span-textarea textarea').off('blur.text').on('blur.text',
  1120. function (e) {
  1121. e.preventDefault();
  1122. SaveInfo($(this));
  1123. });
  1124. });
  1125. }
  1126. },
  1127. error: function () {
  1128. $(".span-textarea textarea").off('blur.text').on('blur.text',
  1129. function () {
  1130. SaveInfo($(this));
  1131. });
  1132. }
  1133. });
  1134. }
  1135. </script>
  1136. <!--格式化-->
  1137. <script id="formatter-script" type="text/javascript">
  1138. function TypeFormatter(v) {
  1139. var name = $('#hid-type option[value="' + v + '"]').text();
  1140. switch (v) {
  1141. case 0:
  1142. return '<span class="label label-danger">' + name + '</span>';
  1143. default:
  1144. return '<span class="label label-info">' + name + '</span>';
  1145. }
  1146. }
  1147. function StateFormatter(v) {
  1148. var name = $('#hid-state option[value="' + v + '"]').text();
  1149. switch (v) {
  1150. case '@(CampGroupStateDefinition.New)':
  1151. return '<span class="label label-info">' + name + '</span>';
  1152. case '@(CampGroupStateDefinition.Run)':
  1153. return '<span class="label label-iwb">' + name + '</span>';
  1154. case '@(CampGroupStateDefinition.Error)':
  1155. case '@(CampGroupStateDefinition.End)':
  1156. return '<span class="label label-danger">' + name + '</span>';
  1157. default:
  1158. return '<span class="label label-info">' + name + '</span>';
  1159. }
  1160. }
  1161. </script>
  1162. }
  1163. <section style="display: none">
  1164. <select id="hid-type">
  1165. <option value=""></option>
  1166. </select>
  1167. <select id="hid-camp-state">
  1168. @(Html.Raw(campState))
  1169. </select>
  1170. <select id="hid-group-state">
  1171. @(Html.Raw(groupState))
  1172. </select>
  1173. @*@Html.DropDownList("hid-type", type)*@
  1174. </section>