Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SooonerHotel
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
吴贤德
SooonerHotel
Commits
384958f8
Commit
384958f8
authored
Nov 14, 2019
by
wangjiangze
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
媒资注入,媒资筛选增加状态、分类、类型
parent
d6725c92
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
119 additions
and
79 deletions
+119
-79
add.html
SooonerHotel/App/Tpl/Inject/zh-cn/Inject/add.html
+119
-79
No files found.
SooonerHotel/App/Tpl/Inject/zh-cn/Inject/add.html
View file @
384958f8
...
...
@@ -78,32 +78,32 @@ body{padding:20px}
<option
value=
"playlist"
>
播单
</option>
</select>
</div>
<!-- <div class="col-sm-2">
<select class="form-control hidden" id="status">
<div
class=
"col-sm-2 hidden"
>
<select
class=
"form-control"
id=
"playlist"
>
<option
value=
"0"
>
播单
</option>
<volist
name=
"play_lists"
id=
"item"
>
<option
value=
"{$item.id}"
ids=
"{$item.media_ids}"
sp_id=
"{$item.sp_id}"
>
{$item.name}
</option>
</volist>
</select>
</div>
<div
class=
"col-sm-2 hidden"
>
<select
class=
"form-control"
id=
"status"
>
<option
value=
"0"
>
-状态-
</option>
<option
value=
"1"
>
上线
</option>
<option
value=
"2"
>
下线
</option>
</select>
</div>
<div class="col-sm-2">
<select class="form-control
hidden
" id="type">
<div
class=
"col-sm-2
hidden
"
>
<select
class=
"form-control"
id=
"type"
>
<option
value=
"0"
>
-分类-
</option>
<option
value=
"1"
>
电竞
</option>
<option
value=
"2"
>
电影
</option>
</select>
</div>
<div class="col-sm-2">
<select class="form-control
hidden
" id="programType">
<div
class=
"col-sm-2
hidden
"
>
<select
class=
"form-control"
id=
"programType"
>
<option
value=
"0"
>
-类型-
</option>
</select>
</div>-->
<div
class=
"col-sm-2"
>
<select
class=
"form-control hidden"
id=
"playlist"
>
<option
value=
"0"
>
播单
</option>
<volist
name=
"play_lists"
id=
"item"
>
<option
value=
"{$item.id}"
ids=
"{$item.media_ids}"
sp_id=
"{$item.sp_id}"
>
{$item.name}
</option>
</volist>
</select>
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -229,7 +229,7 @@ $().ready(function(){
var
spid
=
$
(
this
).
val
();
$
(
"#laiyuan"
).
val
(
0
);
$
(
"#multiselectMedia"
).
empty
();
$
(
"#playlist"
).
addClass
(
"hidden"
);
$
(
"#playlist"
).
parent
().
addClass
(
"hidden"
);
if
(
spid
>
0
){
// $("#playlist option").addClass("hidden");
// $("#playlist option[value='0']").removeClass("hidden");
...
...
@@ -268,18 +268,26 @@ $().ready(function(){
$
(
"#laiyuan"
).
val
(
0
);
return
;
}
$
(
"select#status"
).
removeClass
(
"hidden"
);
$
(
"select#type"
).
removeClass
(
"hidden"
);
$
(
"select#programType"
).
removeClass
(
"hidden"
);
if
(
tmp_val
==
'playlist'
){
$
(
"#playlist"
).
removeClass
(
"hidden"
);
$
(
"select#status"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#type"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#programType"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#status"
).
val
(
0
);
$
(
"select#type"
).
val
(
0
);
$
(
"select#programType"
).
val
(
0
);
$
(
"#playlist"
).
parent
().
removeClass
(
"hidden"
);
$
(
"#playlist option"
).
addClass
(
"hidden"
);
$
(
"#playlist option[value='0']"
).
removeClass
(
"hidden"
);
$
(
"#playlist option[sp_id='"
+
sp_val
+
"']"
).
removeClass
(
"hidden"
);
$
(
"#multiselectMedia"
).
empty
();
}
else
if
(
tmp_val
==
'cloud'
){
$
(
"#playlist"
).
addClass
(
"hidden"
);
$
(
"select#status"
).
parent
().
removeClass
(
"hidden"
);
$
(
"select#type"
).
parent
().
removeClass
(
"hidden"
);
$
(
"select#programType"
).
parent
().
removeClass
(
"hidden"
);
$
(
"#playlist"
).
parent
().
addClass
(
"hidden"
);
$
(
"#multiselectMedia"
).
empty
();
$
.
each
(
eval
(
media_json
),
function
(
i
,
item
){
if
(
item
.
sp_ids
.
indexOf
(
sp_val
)
>-
1
){
...
...
@@ -289,10 +297,14 @@ $().ready(function(){
}
});
}
else
{
$
(
"#playlist"
).
addClass
(
"hidden"
);
$
(
"select#status"
).
addClass
(
"hidden"
);
$
(
"select#type"
).
addClass
(
"hidden"
);
$
(
"select#programType"
).
addClass
(
"hidden"
);
$
(
"#playlist"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#status"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#type"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#programType"
).
parent
().
addClass
(
"hidden"
);
$
(
"#playlist"
).
val
(
0
);
$
(
"select#status"
).
val
(
0
);
$
(
"select#type"
).
val
(
0
);
$
(
"select#programType"
).
val
(
0
);
$
(
"#multiselectMedia"
).
empty
();
}
});
...
...
@@ -302,6 +314,10 @@ $().ready(function(){
var
tmp_ids
=
$
(
this
).
find
(
"option:selected"
).
attr
(
"ids"
);
$
(
"#multiselectMedia"
).
empty
();
if
(
tmp_val
>
0
){
$
(
"select#status"
).
parent
().
removeClass
(
"hidden"
);
$
(
"select#type"
).
parent
().
removeClass
(
"hidden"
);
$
(
"select#programType"
).
parent
().
removeClass
(
"hidden"
);
var
tmp_ids_arr
=
tmp_ids
.
split
(
","
);
$
.
each
(
eval
(
media_json
),
function
(
i
,
item
){
//console.log(tmp_ids_arr.indexOf(item.id));
...
...
@@ -311,67 +327,91 @@ $().ready(function(){
}
}
});
return
;
}
$
(
"select#status"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#type"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#programType"
).
parent
().
addClass
(
"hidden"
);
$
(
"select#status"
).
val
(
0
);
$
(
"select#type"
).
val
(
0
);
$
(
"select#programType"
).
val
(
0
);
});
// $("select#status").bind("change",function(){
// var tmp_val = $(this).val();
// var sp_val = $("select[name='sp'] option:selected").val();
// $("#multiselectMedia").empty();
// if(tmp_val>0){
// $.each(eval(media_json),function(i,item){
// if(item.sp_ids.indexOf(sp_val)>-1&&item.status==tmp_val){
// if($("select[name='media_lists[]'] option[value='"+item.id+"']").length==0){
// $("#multiselectMedia").append("
<
option
value
=
'"+item.id+"'
>
"+item.title+"
<
/option>"
)
;
// }
// }
// });
// }
// });
//
// $("select#type").bind("change",function(){
// var class_val = $(this).val();
// $("select#programType").empty();
// $("select#programType").append('
<
option
value
=
"0"
>-
类型
-<
/option>'
)
;
// $.each(eval(type_lists),function(i,item){
// if(class_val==2){
// if(item.type=='movie'){
// $("select#programType").append('
<
option
value
=
"'+item.programType+'"
>
'+item.programType+'
<
/option>'
)
;
// }
// }else{
// if(item.type!='movie'){
// $("select#programType").append('
<
option
value
=
"'+item.programType+'"
>
'+item.programType+'
<
/option>'
)
;
// }
// }
// });
// var tmp_val = class_val==1?"news":'movie';
// var sp_val = $("select[name='sp'] option:selected").val();
// $("#multiselectMedia").empty();
// if(class_val>0){
// $.each(eval(media_json),function(i,item){
// if(item.sp_ids.indexOf(sp_val)>-1&&item.type==tmp_val){
// if($("select[name='media_lists[]'] option[value='"+item.id+"']").length==0){
// $("#multiselectMedia").append("
<
option
value
=
'"+item.id+"'
>
"+item.title+"
<
/option>"
)
;
// }
// }
// });
// }
// });
//
// $("select#programType").bind("change",function(){
// var tmp_val = $(this).val();
// var sp_val = $("select[name='sp'] option:selected").val();
// $("#multiselectMedia").empty();
// if(tmp_val!=0){
// $.each(eval(media_json),function(i,item){
// if(item.sp_ids.indexOf(sp_val)>-1&&item.programType==tmp_val){
$
(
"select#status,select#type,select#programType"
).
bind
(
"change"
,
function
(){
var
laiyuan_val
=
$
(
"select#laiyuan"
).
val
()
var
playlist_ids
=
$
(
"select#playlist"
).
find
(
"option:selected"
).
attr
(
"ids"
)
var
status_val
=
$
(
"select#status"
).
val
()
var
type_val
=
$
(
"select#type"
).
val
()
var
programType_val
=
$
(
"select#programType"
).
val
()
var
sp_val
=
$
(
"select[name='sp'] option:selected"
).
val
()
$
(
"#multiselectMedia"
).
empty
();
var
search_arr
=
new
Array
();
if
(
laiyuan_val
==
'cloud'
){
//云端片库
$
.
each
(
eval
(
media_json
),
function
(
i
,
item
){
if
(
item
.
sp_ids
.
indexOf
(
sp_val
)
>-
1
){
if
(
$
(
"select[name='media_lists[]'] option[value='"
+
item
.
id
+
"']"
).
length
==
0
){
//$("#multiselectMedia").append("
<
option
value
=
'"+item.id+"'
>
"+item.title+"
<
/option>"
)
;
search_arr
.
push
(
item
);
}
}
});
}
else
if
(
laiyuan_val
==
'playlist'
){
//播单片库
var
tmp_ids_arr
=
playlist_ids
.
split
(
","
);
$
.
each
(
eval
(
media_json
),
function
(
i
,
item
){
//console.log(tmp_ids_arr.indexOf(item.id));
if
(
tmp_ids_arr
.
indexOf
(
item
.
id
)
>=
0
){
// if($("select[name='media_lists[]'] option[value='"+item.id+"']").length==0){
// $("#multiselectMedia").append("
<
option
value
=
'"+item.id+"'
>
"+item.title+"
<
/option>"
)
;
search_arr
.
push
(
item
);
// }
// }
// });
// }
// });
}
});
}
if
(
status_val
!=
0
){
//筛选 上下线状态数据
search_arr
=
search_arr
.
filter
(
function
(
item
)
{
return
item
.
status
==
status_val
});
}
if
(
type_val
!=
0
&&
programType_val
==
0
){
//筛选 电竞/电影数据
search_arr
=
search_arr
.
filter
(
function
(
item
)
{
return
(
item
.
type
==
'news'
?
1
:
2
)
==
type_val
});
//选择分类【电影/电竞】切换类型下拉数据
$
(
"select#programType"
).
empty
();
$
(
"select#programType"
).
append
(
'<option value="0">-类型-</option>'
);
$
.
each
(
eval
(
type_lists
),
function
(
i
,
item
){
if
(
type_val
==
2
){
if
(
item
.
type
==
'movie'
){
$
(
"select#programType"
).
append
(
'<option value="'
+
item
.
programType
+
'">'
+
item
.
programType
+
'</option>'
);
}
}
else
{
if
(
item
.
type
!=
'movie'
){
$
(
"select#programType"
).
append
(
'<option value="'
+
item
.
programType
+
'">'
+
item
.
programType
+
'</option>'
);
}
}
});
}
if
(
programType_val
!=
0
){
//筛选 电竞/电影子分类数据
search_arr
=
search_arr
.
filter
(
function
(
item
)
{
return
item
.
programType
==
programType_val
});
}
$
.
each
(
search_arr
,
function
(
i
,
item
){
//console.log(tmp_ids_arr.indexOf(item.id));
if
(
$
(
"select[name='media_lists[]'] option[value='"
+
item
.
id
+
"']"
).
length
==
0
){
$
(
"#multiselectMedia"
).
append
(
"<option value='"
+
item
.
id
+
"'>"
+
item
.
title
+
"</option>"
);
}
});
});
});
</script>
</body>
...
...
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