Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
a746bb44
Commit
a746bb44
authored
Aug 23, 2018
by
xinyuandu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改商学院附件上限 1-->5
parent
09be2404
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
35 deletions
+52
-35
new_text.html
application/index/view/news/new_text.html
+16
-18
schoolBusinessNew.js
public/resource/js/schoolBusinessNew.js
+36
-17
No files found.
application/index/view/news/new_text.html
View file @
a746bb44
...
...
@@ -252,9 +252,9 @@
<div
class=
"panel-body"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-bordered table-hover table-condensed"
>
<tbody
id=
""
class=
"text-center"
>
<tr>
<td>
<tbody
id=
""
class=
"text-center"
>
<tr>
<td>
<form
class=
"form-horizontal"
action=
"/agents/add_user"
id=
""
>
<div
class=
"form-group"
>
<label
for=
"inputEmail3"
class=
"col-sm-2 control-label"
>
标题:
</label>
...
...
@@ -263,7 +263,7 @@
<span
class=
"use-span text-danger"
>
(20字以内,显示在首页列表)
</span>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
标签:
</label>
<div
class=
"col-sm-9"
>
...
...
@@ -295,39 +295,37 @@
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
内容:
</label>
<div
class=
"col-sm-9"
>
<div
class=
"form-group"
style=
"width: 100%;"
>
<!--<div class="form-group" style="width: 100%;">-->
<div
class=
""
style=
"width: 100%;"
>
<!--<label for="" style="width: 100%;">内容</label>-->
<div
class=
"input-group"
style=
"width: 100%;"
id=
"dajiangtang"
>
<?php
create_editor('goods_sup_id','');
?>
create_editor('goods_sup_id','');
?>
</div>
</div>
</div>
</div>
<!--附件-->
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc,选填,上限为
1
个):
</label>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc,选填,上限为
5
个):
</label>
<div
class=
"col-sm-9"
>
<div
class=
"file-upload-area"
>
<div
class=
"file-upload-area"
style=
"padding-left:15px!important"
>
<div
class=
"btn-area"
>
<input
type=
"file"
id=
"file_input"
class=
""
data-limittop=
"
1"
/
>
<input
type=
"file"
id=
"file_input"
class=
""
data-limittop=
"
5"
/>
<!--修改上传文件的最大数字--
>
<button
class=
"btn btn-default"
>
选择附件
</button>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
<p>
点击文件名称即可下载
</p>
</div>
</div>
</div>
</form>
<button
type=
"button"
class=
"btn btn-primary"
id=
"add_news"
>
保存
</button>
</td>
</tr>
<button
type=
"button"
class=
"btn btn-primary"
id=
"add_news"
>
保存
</button>
</td>
</tr>
</tbody>
</table>
</div>
...
...
public/resource/js/schoolBusinessNew.js
View file @
a746bb44
...
...
@@ -249,16 +249,41 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
//附件
var
_tempArr
=
_data
[
'annex_file_path'
].
split
(
'/'
);
_data
[
'annex_file_path'
]
&&
$
(
'#fujian_ul'
).
html
(
'<li class="pdf-pre-li"><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
_data
[
'annex_file_path'
],
'1'
:
dealFileName
(
decodeURI
(
_tempArr
[
_tempArr
.
length
-
1
]))
}));
var
file_paths
=
_data
[
'file'
];
console
.
log
(
file_paths
)
for
(
var
i
=
0
;
i
<
file_paths
.
length
;
i
++
){
console
.
log
(
file_paths
[
i
][
'file_name'
])
var
_tempArr
=
file_paths
[
i
][
'file_name'
].
split
(
'/'
);
file_paths
[
i
][
'file_name'
]
&&
$
(
'#fujian_ul'
).
append
(
'<li class="pdf-pre-li" id='
+
file_paths
[
i
][
'file_id'
]
+
'><a class="pdf-pre-a" download="{1}" href="{0}" title="点击可下载">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
file_paths
[
i
][
'file_name'
],
'1'
:
dealFileName
(
decodeURI
(
_tempArr
[
_tempArr
.
length
-
1
]))
}));
}
//添加删除附件事件
user
.
addDeleteNewsEvent
();
}
else
{}
}
});
},
addDeleteNewsEvent
:
function
(){
$
(
'.delet-pic-btn'
).
unbind
(
'click'
).
bind
(
'click'
,
function
(){
var
file_id
=
$
(
this
).
parent
(
'li'
).
attr
(
'id'
)
-
0
;
$
.
ajax
({
url
:
'/index/delNewsFile'
,
type
:
'POST'
,
async
:
true
,
data
:
{
'file_id'
:
file_id
},
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
alert
(
'文件删除成功'
);
}
}
});
});
},
getDistrict
:
function
(
fn
)
{
$
.
ajax
({
url
:
'/index/getNewsLabel'
,
...
...
@@ -305,28 +330,22 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
//附件相关
var
_fujianObj
=
$
(
'#fujian_ul'
).
find
(
'li>a.pdf-pre-a'
);
//附件看的是删除按钮的个数
/* var fileName = '' ;
if
(
_fujianObj
.
length
>
0
){
//判断附件存在,同时,附件可能存在0到5个
for ( vari= 0 ; i < _fujianObj.length ; i++ ){
for
(
var
i
=
0
;
i
<
_fujianObj
.
length
;
i
++
){
var
one_name
=
_fujianObj
[
i
].
getAttribute
(
'data-filename'
);
if ( i == _fujianObj.length-1 ){
fileName += one_name;
} else {
fileName += one_name + ",";
}
_data
[
'annex_file_name['
+
i
+
']'
]
=
one_name
;
}
_data['annex_file_name'] = fileName //上传的是一个字符串,以','分割;
}
*/
if
(
_fujianObj
.
length
===
1
)
{
/*if(_fujianObj.length === 1) {
_data['annex_file_name'] = _fujianObj[0].getAttribute('data-filename'); //附件取得是data-filename
};
};
*/
$
.
ajax
({
url
:
'/index/addNews'
,
type
:
'POST'
,
async
:
true
,
data
:
_data
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
$
(
"#modal_add_user"
).
modal
(
'hide'
);
//提交成功 关闭模态框
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment