123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- @{
- ViewBag.Title = "NewProjectProblem";
- Layout = "~/Views/Shared/_MainLayoutPage.cshtml";
- }
- <link href="~/Content/Scripts/plugins/umeditor-1.2.3/themes/default/_css/umeditor.css?v=1.1" rel="stylesheet" />
- <script src="~/Content/Scripts/plugins/umeditor-1.2.3/umeditor.min.js"></script>
- <script src="~/Content/Scripts/plugins/umeditor-1.2.3/umeditor.config.js?v=1.41"></script>
- <script src="~/Content/Scripts/plugins/umeditor-1.2.3/lang/zh-cn/zh-cn.js"></script>
- <script src="~/Content/Scripts/plugins/easyui/easyui-lang-zh_CN.js"></script>
- <script src="~/ViewModels/NoticeManager.js?r=1.321"></script>
- <style>
- table {
- width: 97%;
- }
- table td {
- padding: 3px;
- border-bottom: solid 1px #EEE;
- }
-
- </style>
- <script type="text/javascript">
- var model = new viewModel();
- model.Add_Init();
- </script>
- <form class="easyui-tabs" fit="true" lay-filter="insert_notice" id="insert_notice">
- <div title="<i class='fa fa-sticky-note-o'></i> 公告通知" style="padding:5px;display:none;">
- <input type="hidden" id="IsShow" name="IsShow" />
- <table>
- <tr>
- <td style="width:80px;">
- 标题:
- </td>
- <td>
- <input id="Title" name="Title" autofocus class="easyui-textbox" style="width:454px" />
- <input id="EndDate" name="EndDate" editable="false" disabled="disabled" required class="easyui-datetimebox" data-options="label:'截止日期:',labelAlign:'right',limitToList:true" style="width:200px;" />
- </td>
- </tr>
- <tr style="margin-top:20px">
- <td>通知类型:</td>
- <td>
- <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;" />
- <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;" />
- <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;" />
- </td>
- </tr>
- <tr>
- <td>信息内容:</td>
- <td colspan="2">
- <textarea id="Deatil" name="Deatil" style="width:98%;height:140px;"></textarea>
- </td>
- </tr>
- <tr>
- <td style="border-bottom:0px">公告附件:</td>
- <td colspan="2" id="demoList" style="border-bottom:0px">
- <a id="ChooseFile" href="#" class="easyui-linkbutton c8" data-options="plain:true"><i class="fa fa-plus-square-o"></i> 添加附件</a>
- </td>
- </tr>
- </table>
- <div class="layui-input-inline" style="width:300px;position:fixed;bottom:10px;right:-8%">
- <input class="easyui-checkbox checkbox-f" type="checkbox" id="Show" label="登录推送" labelposition="after" labelwidth="60px" style="top:15px;">
- <a href="#" onclick="Add_Notice()" class="easyui-linkbutton c1"><i class="fa fa-pencil"></i> 确认</a>
- <a onclick="Close()" href="#" class="easyui-linkbutton c5"><i class="fa fa-power-off"></i> 关闭</a>
- <button id="btn_upload" style="display:none"></button>
- </div>
- </div>
- </form>
- <script type="text/javascript">
- //附件上传
- layui.use('upload', function () {
- var upload = layui.upload;
- var demoListView = $('#demoList');
- var uploadInst = upload.render({
- elem: '#ChooseFile' //文件选择按钮
- , url: '/Notice/FileUpload?type=3'
- , method: "post"
- , accept: 'file' //(文件类型)
- , multiple: true //多文件上传
- , auto: true //自动上传
- , size: 5120
- , bindAction: "#btn_upload"
- , number: 1//最大允许上传文件数量
- , choose: function (obj) {
- var files = this.files = obj.pushFile(); //将每次选择的文件追加到文件队列
- //读取本地文件
- obj.preview(function (index, file, result) {
- appOBJ.count++;
- var display = "none";
- var tr = $(['<tr id="upload-' + index + '">'
- , '<td class="uplad-filename">' + file.name + '</td>'
- , '<td>' + (file.size / 1014).toFixed(1) + 'kb</td>'
- , '<td>等待上传</td>'
- , '<td>'
- , '<button class="layui-btn layui-btn-mini demo-reload layui-hide">重传</button>'
- , '<button class="layui-btn layui-btn-mini layui-btn-danger demo-delete" style="height:25px;line-height:25px">删除</button>'
- , '</td>'
- , '</tr>'].join(''));
- //删除
- tr.find('.demo-delete').on('click', function () {
- delete files[index]; //删除对应的文件
- tr.remove();
- uploadInst.config.elem.next()[0].value = ''; //清空 input file 值,以免删除后出现同名文件不可选
- appOBJ.count--;
- ClearImg();
- });
- demoListView.append(tr);
- });
- }
- , before: function (obj) { //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
- appOBJ.index = ZLPMS.Loading3(0)
- appOBJ.index2 = top.ZLPMS.Loading3(0);
- }
- , allDone: function (obj) {
- top.ZLPMS.Msg("附件总共上传" + obj.total + ",成功" + obj.successful + "个,失败" + obj.aborted + "个")
- if (obj.successful > 0) {
- ZLPMS.UnLoading(appOBJ.index)
- top.ZLPMS.UnLoading(appOBJ.index2);
- return;
- }
- ZLPMS.UnLoading(appOBJ.index)
- top.ZLPMS.UnLoading(appOBJ.index2);
- top.ZLPMS.Msg("上传失败", 2);
- }
- });
- });
- $(function () {
- $('#Show').checkbox({
- onChange: function (checked) {
- if (checked) {
- $('#EndDate').datetimebox({ disabled: false});
- } else {
- $('#EndDate').datetimebox({ disabled: true });
- }
- }
- });
- })
- </script>
|