Add_Window.cshtml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. @{
  2. ViewBag.Title = "NewProjectProblem";
  3. Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
  4. }
  5. <link href="~/Content/Scripts/plugins/umeditor-1.2.3/themes/default/_css/umeditor.css?v=1.1" rel="stylesheet" />
  6. <script src="~/Content/Scripts/plugins/umeditor-1.2.3/umeditor.min.js"></script>
  7. <script src="~/Content/Scripts/plugins/umeditor-1.2.3/umeditor.config.js?v=1.41"></script>
  8. <script src="~/Content/Scripts/plugins/umeditor-1.2.3/lang/zh-cn/zh-cn.js"></script>
  9. <script src="~/Content/Scripts/plugins/easyui/easyui-lang-zh_CN.js"></script>
  10. <script src="~/ViewModels/NoticeManager.js?r=1.321"></script>
  11. <style>
  12. table {
  13. width: 97%;
  14. }
  15. table td {
  16. padding: 3px;
  17. border-bottom: solid 1px #EEE;
  18. }
  19. </style>
  20. <script type="text/javascript">
  21. var model = new viewModel();
  22. model.Add_Init();
  23. </script>
  24. <form class="easyui-tabs" fit="true" lay-filter="insert_notice" id="insert_notice">
  25. <div title="<i class='fa fa-sticky-note-o'></i> 公告通知" style="padding:5px;display:none;">
  26. <input type="hidden" id="IsShow" name="IsShow" />
  27. <table>
  28. <tr>
  29. <td style="width:80px;">
  30. 标题:
  31. </td>
  32. <td>
  33. <input id="Title" name="Title" autofocus class="easyui-textbox" style="width:454px" />
  34. <input id="EndDate" name="EndDate" editable="false" disabled="disabled" required class="easyui-datetimebox" data-options="label:'截止日期:',labelAlign:'right',limitToList:true" style="width:200px;" />
  35. </td>
  36. </tr>
  37. <tr style="margin-top:20px">
  38. <td>通知类型:</td>
  39. <td>
  40. <input id="Type" name="Type" required panelheight="200px" editable="false" class="easyui-combobox xmid" data-options="labelAlign:'right',prompt:'请选择类型',limitToList:true,tipPosition:'top'" style="width:200px;" />
  41. <input id="NotifyTagert" name="NotifyTagert" editable="false" multiple=multiple required panelheight="200px" class="easyui-combobox" data-options="label:'通知对象:',labelAlign:'right',limitToList:true" style="width:250px;" />
  42. <input id="Property" name="Property" required editable="false" panelheight="200px" class="easyui-combobox" data-options="label:'优先级',labelAlign:'right',limitToList:true,tipPosition:'top'" style="width:200px;" />
  43. </td>
  44. </tr>
  45. <tr>
  46. <td>信息内容:</td>
  47. <td colspan="2">
  48. <textarea id="Deatil" name="Deatil" style="width:98%;height:140px;"></textarea>
  49. </td>
  50. </tr>
  51. <tr>
  52. <td style="border-bottom:0px">公告附件:</td>
  53. <td colspan="2" id="demoList" style="border-bottom:0px">
  54. <a id="ChooseFile" href="#" class="easyui-linkbutton c8" data-options="plain:true"><i class="fa fa-plus-square-o"></i> 添加附件</a>
  55. </td>
  56. </tr>
  57. </table>
  58. <div class="layui-input-inline" style="width:300px;position:fixed;bottom:10px;right:-8%">
  59. <input class="easyui-checkbox checkbox-f" type="checkbox" id="Show" label="登录推送" labelposition="after" labelwidth="60px" style="top:15px;">
  60. <a href="#" onclick="Add_Notice()" class="easyui-linkbutton c1"><i class="fa fa-pencil"></i> 确认</a>&nbsp;&nbsp;&nbsp;
  61. <a onclick="Close()" href="#" class="easyui-linkbutton c5"><i class="fa fa-power-off"></i> 关闭</a>
  62. <button id="btn_upload" style="display:none"></button>
  63. </div>
  64. </div>
  65. </form>
  66. <script type="text/javascript">
  67. //附件上传
  68. layui.use('upload', function () {
  69. var upload = layui.upload;
  70. var demoListView = $('#demoList');
  71. var uploadInst = upload.render({
  72. elem: '#ChooseFile' //文件选择按钮
  73. , url: '/Notice/FileUpload?type=3'
  74. , method: "post"
  75. , accept: 'file' //(文件类型)
  76. , multiple: true //多文件上传
  77. , auto: true //自动上传
  78. , size: 5120
  79. , bindAction: "#btn_upload"
  80. , number: 1//最大允许上传文件数量
  81. , choose: function (obj) {
  82. var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
  83. //读取本地文件
  84. obj.preview(function (index, file, result) {
  85. appOBJ.count++;
  86. var display = "none";
  87. var tr = $(['<tr id="upload-' + index + '">'
  88. , '<td class="uplad-filename">' + file.name + '</td>'
  89. , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
  90. , '<td>等待上传</td>'
  91. , '<td>'
  92. , '<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
  93. , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete" style="height:25px;line-height:25px">删除</button>'
  94. , '</td>'
  95. , '</tr>'].join(''));
  96. //删除
  97. tr.find('.demo-delete').on('click', function () {
  98. delete files[index]; //删除对应的文件
  99. tr.remove();
  100. uploadInst.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
  101. appOBJ.count--;
  102. ClearImg();
  103. });
  104. demoListView.append(tr);
  105. });
  106. }
  107. , before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
  108. appOBJ.index = ZLPMS.Loading3(0)
  109. appOBJ.index2 = top.ZLPMS.Loading3(0);
  110. }
  111. , allDone: function (obj) {
  112. top.ZLPMS.Msg("附件总共上传" + obj.total + ",成功" + obj.successful + "个,失败" + obj.aborted + "个")
  113. if (obj.successful > 0) {
  114. ZLPMS.UnLoading(appOBJ.index)
  115. top.ZLPMS.UnLoading(appOBJ.index2);
  116. return;
  117. }
  118. ZLPMS.UnLoading(appOBJ.index)
  119. top.ZLPMS.UnLoading(appOBJ.index2);
  120. top.ZLPMS.Msg("上传失败", 2);
  121. }
  122. });
  123. });
  124. $(function () {
  125. $('#Show').checkbox({
  126. onChange: function (checked) {
  127. if (checked) {
  128. $('#EndDate').datetimebox({ disabled: false});
  129. } else {
  130. $('#EndDate').datetimebox({ disabled: true });
  131. }
  132. }
  133. });
  134. })
  135. </script>