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
c71914c2
Commit
c71914c2
authored
Aug 01, 2018
by
xishifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
附件
parent
ba6871d7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
130 additions
and
11 deletions
+130
-11
new_text.html
application/index/view/news/new_text.html
+3
-3
add_notice_view.html
application/index/view/notice/add_notice_view.html
+20
-0
index.html
application/index/view/notice/index.html
+4
-0
addNoticeView.js
public/resource/js/addNoticeView.js
+67
-0
notice.js
public/resource/js/notice.js
+15
-3
schoolBusiness.js
public/resource/js/schoolBusiness.js
+1
-1
schoolBusinessNew.js
public/resource/js/schoolBusinessNew.js
+19
-3
notice_template_tpl.html
public/resource/template/notice_template_tpl.html
+1
-1
No files found.
application/index/view/news/new_text.html
View file @
c71914c2
...
...
@@ -308,7 +308,7 @@
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc/xls):
</label>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc/xls
,选填,上限为1个
):
</label>
<div
class=
"col-sm-9"
>
<!--选择图片-->
<ul
class=
"list-group"
>
...
...
@@ -317,10 +317,10 @@
<div
class=
"form-group full-width-100 full-pic-area"
>
<!--<label for="">列表页封面图(1张)</label>-->
<input
readonly=
"readonly"
type=
"text"
name=
"fujian_input"
class=
"form-control"
style=
"width: 150px !important;display:none"
id=
"fujian_input"
placeholder=
"请选择图片"
>
<button
class=
"btn btn-default upload-image-btn"
id=
"fujian_btn"
data-spfile=
"pdf"
type=
"button"
data-limittop=
"
5
"
>
选择附件
</button>
<button
class=
"btn btn-default upload-image-btn"
id=
"fujian_btn"
data-spfile=
"pdf"
type=
"button"
data-limittop=
"
1
"
>
选择附件
</button>
<span
class=
"tip"
></span>
</div>
<ul
class=
"img-pre-ul"
id=
"
liebiao_pic
_ul"
></ul>
<ul
class=
"img-pre-ul"
id=
"
fujian
_ul"
></ul>
</li>
</ul>
</div>
...
...
application/index/view/notice/add_notice_view.html
View file @
c71914c2
...
...
@@ -277,6 +277,26 @@
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
附件(格式为pdf/doc/xls,选填,上限为1个):
</label>
<div
class=
"col-sm-9"
>
<!--选择图片-->
<ul
class=
"list-group"
>
<li
class=
"list-group-item"
>
<!--封面图 一张-->
<div
class=
"form-group full-width-100 full-pic-area"
>
<!--<label for="">列表页封面图(1张)</label>-->
<input
readonly=
"readonly"
type=
"text"
name=
"fujian_input"
class=
"form-control"
style=
"width: 150px !important;display:none"
id=
"fujian_input"
placeholder=
"请选择图片"
>
<button
class=
"btn btn-default upload-image-btn"
id=
"fujian_btn"
data-spfile=
"pdf"
type=
"button"
data-limittop=
"1"
>
选择附件
</button>
<span
class=
"tip"
></span>
</div>
<ul
class=
"img-pre-ul"
id=
"fujian_ul"
></ul>
</li>
</ul>
</div>
</div>
</form>
<button
type=
"button"
class=
"btn btn-primary"
id=
"add_announcement"
>
保存
...
...
application/index/view/notice/index.html
View file @
c71914c2
...
...
@@ -261,6 +261,10 @@
<div
class=
"notice-time text-right"
>
2018-12-12 12:00:00
</div>
<div
class=
"clear"
></div>
<div
class=
"notice-text"
></div>
<div
class=
"notice-fujian-area"
>
<span>
附件(点击可下载):
</span>
<a
download=
"ff.pdf"
href=
"ff.pdf"
title=
"点击可下载"
>
pp.pdf
</a>
</div>
</div>
...
...
public/resource/js/addNoticeView.js
View file @
c71914c2
...
...
@@ -18,6 +18,65 @@ define (['doT', 'text!temp/notice_template_tpl.html','ckfinder','ckfinderStart',
user
.
user_id
=
$
(
this
).
attr
(
"data-id"
);
user
.
add_announcement
();
});
//处理文件名,长度过长时处理
function
dealFileName
(
str
)
{
//如果文件超过30的长度,则用*代替
if
(
str
.
length
>
26
)
{
return
str
.
slice
(
0
,
23
)
+
'***'
+
str
.
slice
(
-
4
);
}
else
{
return
str
;
};
};
//图片上传,附件上传处理事件
$
(
".upload-image-btn"
).
click
(
function
()
{
var
_this
=
$
(
this
),
_spFile
=
_this
.
data
(
'spfile'
),
_limitTop
=
_this
.
data
(
'limittop'
),
_fileNum
=
_this
.
parent
().
next
().
find
(
'.delet-pic-btn'
).
length
;
//根据删除按钮的个数,确定文件的个数
if
(
_limitTop
&&
(
_fileNum
<
_limitTop
))
{
BrowseServer
(
_this
.
prev
().
attr
(
'id'
),
function
(
url
)
{
console
.
log
(
url
);
if
(
_spFile
==
'pdf'
)
{
if
(
/
(\.
pdf|
\.
doc|
\.
xls
)
$/i
.
test
(
url
))
{
_this
.
parent
().
next
().
prepend
(
'<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'
:
url
,
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
//dealFileName不要忘记
}));
}
else
{
alert
(
'所选择的格式不是pdf/doc/xls,请重新选择'
);
return
false
;
}
}
else
{
if
(
/
(\.
jpg|
\.
jpeg|
\.
png|
\.
gif|
\.
bmp
)
$/i
.
test
(
url
))
{
_this
.
parent
().
next
().
prepend
(
'<li><img title="点击查看大图" src="{0}" /><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
'0'
:
url
}));
}
else
{
alert
(
'所选择的格式不正确,请重新选择'
);
return
false
;
}
};
});
}
else
{
alert
(
'上传上限为 '
+
_limitTop
);
return
false
;
};
});
//图片,附件上传删除键事件
_doc
.
on
(
'click'
,
'.delet-pic-btn'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
e
.
stopPropagation
();
if
(
confirm
(
'确定删除该文件吗?'
))
{
var
_imgId
=
_this
.
parent
().
attr
(
'data-imgid'
);
_this
.
parent
().
remove
();
};
});
},
add_announcement
:
function
()
{
...
...
@@ -47,6 +106,14 @@ define (['doT', 'text!temp/notice_template_tpl.html','ckfinder','ckfinderStart',
// $("#announcement_content").focus();
// return ;
// }
//附件相关
var
_fujianObj
=
$
(
'#fujian_ul'
).
find
(
'li>a.pdf-pre-a'
);
//附件看的是删除按钮的个数
var
_tempArr
=
_fujianObj
[
0
].
href
.
split
(
'/'
);
if
(
_fujianObj
.
length
===
1
)
{
params
[
'annex_file_name'
]
=
_tempArr
[
_tempArr
.
length
-
1
];
//附件取得是href值
};
$
.
ajax
({
url
:
'/index/addNotice'
,
type
:
'POST'
,
...
...
public/resource/js/notice.js
View file @
c71914c2
...
...
@@ -66,9 +66,21 @@ define (['doT', 'text!temp/notice_template_tpl.html','ckfinder','ckfinderStart',
// ===========================新增公告====================
$
(
document
).
delegate
(
".announcement-details"
,
"click"
,
function
()
{
//点击公告详情
$
(
'.notice-title'
).
html
(
$
(
this
).
attr
(
"data-title"
));
$
(
'.notice-time'
).
html
(
$
(
this
).
attr
(
"data-createTime"
));
$
(
'.notice-text'
).
html
(
$
(
this
).
attr
(
"data-content"
));
$
(
'.notice-title'
).
html
(
$
(
this
).
attr
(
"data-title"
));
$
(
'.notice-time'
).
html
(
$
(
this
).
attr
(
"data-createTime"
));
$
(
'.notice-text'
).
html
(
$
(
this
).
attr
(
"data-content"
));
var
_filePath
=
$
(
this
).
attr
(
'data-fujian'
);
var
_tempArr
=
_filePath
.
split
(
'/'
);
var
_lastObj
=
_tempArr
[
_tempArr
.
length
-
1
];
if
(
_lastObj
){
$
(
'.notice-fujian-area'
).
show
().
html
(
'<span>附件(点击可下载):</span><a download="{0}" href="{1}" title="点击可下载">{0}</a>'
.
stringFormatObj
({
'0'
:
_lastObj
,
'1'
:
_filePath
}))
}
else
{
$
(
'.notice-fujian-area'
).
html
(
''
).
hide
();
}
});
$
(
document
).
on
(
"input"
,
"#set_father_id3"
,
function
()
{
//手机号搜索客方
if
(
$
(
"#set_father_id3"
).
val
()
==
''
){
...
...
public/resource/js/schoolBusiness.js
View file @
c71914c2
...
...
@@ -104,7 +104,7 @@ define (['doT', 'text!temp/schoolBusiness_template_tpl.html','ckfinder','ckfinde
console
.
log
(
url
);
if
(
_spFile
==
'pdf'
)
{
if
(
/
(\.
pdf
)
$/i
.
test
(
url
))
{
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a class="pdf-pre-a"
href="{0}" target="_blank
" title="点击查看">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
_this
.
parent
().
next
().
prepend
(
'<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'
:
url
,
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
}));
...
...
public/resource/js/schoolBusinessNew.js
View file @
c71914c2
...
...
@@ -94,9 +94,9 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
console
.
log
(
url
);
if
(
_spFile
==
'pdf'
)
{
if
(
/
(\.
pdf|
\.
doc|
\.
xls
)
$/i
.
test
(
url
))
{
_this
.
parent
().
next
().
prepend
(
'<li class="pdf-pre-li"><a class="pdf-pre-a"
href="{0}" target="_blank" title="点击查看
">{1}</a><a href="javascript:;" class="delet-pic-btn">删除</a></li>'
.
stringFormatObj
({
_this
.
parent
().
next
().
prepend
(
'<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'
:
url
,
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
'1'
:
dealFileName
(
decodeURI
(
url
.
slice
(
url
.
lastIndexOf
(
'/'
)
+
1
)))
//dealFileName不要忘记
}));
}
else
{
alert
(
'所选择的格式不是pdf/doc/xls,请重新选择'
);
...
...
@@ -119,7 +119,7 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
};
});
//图片上传删除键事件
//图片
,附件
上传删除键事件
_doc
.
on
(
'click'
,
'.delet-pic-btn'
,
function
(
e
)
{
var
_this
=
$
(
this
);
e
.
preventDefault
();
...
...
@@ -195,6 +195,15 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
//获取编辑器里的内容
// setCKeditorValue(id,content)
setCKeditorValue
(
"goods_sup_id"
,
_data
[
'content'
]);
//附件
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'
:
_tempArr
[
_tempArr
.
length
-
1
]
}));
}
else
{}
}
});
...
...
@@ -242,6 +251,13 @@ define(['doT', 'text!temp/schoolBusiness_template_tpl.html', 'ckfinder', 'ckfind
_data
.
s_label_id
=
$
(
"#district_id2"
).
val
();
//商学院标签id
_data
.
file_img
=
_liebiaoPicObj
[
0
].
src
.
replace
(
_urlCut
,
''
);
//封面图 剪切后的字符串
_data
.
content
=
_dajiangtangVal
;
//附件相关
var
_fujianObj
=
$
(
'#fujian_ul'
).
find
(
'li>a.pdf-pre-a'
);
//附件看的是删除按钮的个数
var
_tempArr
=
_fujianObj
[
0
].
href
.
split
(
'/'
);
if
(
_fujianObj
.
length
===
1
)
{
_data
[
'annex_file_name'
]
=
_tempArr
[
_tempArr
.
length
-
1
];
//附件取得是href值
};
$
.
ajax
({
url
:
'/index/addNews'
,
type
:
'POST'
,
...
...
public/resource/template/notice_template_tpl.html
View file @
c71914c2
...
...
@@ -10,7 +10,7 @@
<
/td
>
<
td
>
[
%=
it
[
item
][
"title"
]
%
]
<
/td
>
<
td
>
<
a
class
=
"btn1 btn-success announcement-details"
href
=
"#modal-record"
data
-
toggle
=
"modal"
data
-
createTime
=
'[%= it[item]["create_time"] %]'
data
-
title
=
'[%= it[item]["title"] %]'
data
-
content
=
'[%= it[item]["content"] %]'
>
<
a
class
=
"btn1 btn-success announcement-details"
href
=
"#modal-record"
data
-
toggle
=
"modal"
data
-
createTime
=
'[%= it[item]["create_time"] %]'
data
-
title
=
'[%= it[item]["title"] %]'
data
-
content
=
'[%= it[item]["content"] %]'
data
-
fujian
=
'[%= it[item]["annex_file_path"] %]'
>
查看
<
/a
>
[
%
if
(
check_auth
(
'index/delNotice'
))
{
%
]
...
...
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