123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- @using WeApp.TrainingCampGroup.Dto
- @{
- Layout = "~/Views/Shared/Layout/_Layout.Stu.cshtml";
- CampGroupDto group = ViewBag.Group;
- ViewBag.Title = "学员屏(" + group.Name + ")";
- string id = group.Id,
- groupName = group.Name,
- campNo = group.CampNo;
- }
- @section css{
- <link href="~/Content/Css/Exercise/student.min.css" rel="stylesheet" />
- <style>
- .select2-container .select2-selection--single {
- height: 38px;
- }
- .select2-container--default .select2-selection--single .select2-selection__arrow {
- top: 6px;
- }
- </style>
- }
- <div class="stu-box">
- <div class="box-h">
- <div class="title">
- <h3 class="">@(groupName)指挥部 —— 组员</h3>
- </div>
- </div>
- <div class="box-b">
- <div class="handle-box">
- <div class="handle-role">
- <select class="form-control" id="role-select" name="role" style="width: 100%" autocomplete="off" placeholder="请选择角色"></select>
- </div>
- <div class="handle-content">
- <textarea class="form-control" rows="6" name="message" placeholder="请输入指令内容"></textarea>
- </div>
- <div class="handle-button">
- <button type="button" class="btn btn-dl btn-block" onclick="RoleHandle(this)">提交</button>
- </div>
- </div>
- <div class="handle-box">
- <div class="handle-role">
- <input class="form-control" id="role-name" name="role" style="width: 100%" autocomplete="off" placeholder="请填写自定义角色" />
- </div>
- <div class="handle-content">
- <textarea class="form-control" rows="6" name="message" placeholder="请输入指令内容"></textarea>
- </div>
- <div class="handle-button">
- <button type="button" class="btn btn-dl btn-block" onclick="RoleHandle(this)">提交</button>
- </div>
- </div>
- </div>
- </div>
- @section scripts
- {
- <script>
- $(function() {
- $.iwbAjax4({
- url: abp.appUrl + 'Query/GetGroupRoleSelectStr?no=@(id)',
- success: function(res) {
- if (res) {
- $('#role-select').html(res).select2();
- }
- }
- });
- });
- function RoleHandle(that) {
- var $that = $(that).closest('.handle-box'),
- role = $that.find('.form-control[name="role"]').val(),
- word = $that.find('textarea').val();
- if (!role) {
- abp.message.warn('请选择(或填写)角色后再提交!');
- return;
- }
- if (!word) {
- abp.message.warn('请输入指令后再提交!');
- return;
- }
- $.iwbAjax4({
- url: abp.appUrl + 'Eval/SaveOperationScene',
- data: { groupNo: '@(id)', behaviorRole: role, behaviorWord: word},
- success: function() {
- $that.find('textarea').val('').focus();
- }
- });
- @*window.iwbHub.server.sendOperationLog('@(id)',role,text).done(function() {
- abp.log.debug('OperationLog[' + id + ']:', role, word);
- });*@
- }
- </script>
- <script id="hub">
- abp.signalr.connect(['@(id)','@(campNo)']);
- iwbHub.client.getReloadAll = function (msg) {
- console.log('getReloadAll: ', msg);
- if (msg) {
- try {
- var data = JSON.parse(msg);
- if (data) {
- if (data.no == '@(id)'|| data.no == '@(campNo)') {
- window.location.reload();
- }
- }
- } catch (e) {
- console.log('getReloadAll: ', e);
- }
- }
- };
- iwbHub.client.getReloadStu = function (msg) {
- console.log('getReloadStu: ', msg);
- if (msg) {
- try {
- var data = JSON.parse(msg);
- if (data) {
- if (data.no == '@(id)'|| data.no == '@(campNo)') {
- window.location.reload();
- }
- }
- } catch (e) {
- console.log('getReloadStu: ', e);
- }
- }
- };
- </script>
- }
|