views
1 class limit:
2
3 def limit(self,res,obj):
4 limit = int(res.GET.get('limit',1))
5 pagelimit = int(res.GET.get('pagelimit',30))
6 startlimit = (limit-1)*pagelimit
7 endlimit = limit*pagelimit
8 logdb = obj[startlimit:endlimit]
9 page_count,lastpage_count = divmod(obj.count(),pagelimit)
10 if lastpage_count:
11 page_count +=1
12 startpage = 1
13 endpage = page_count
14 hrefli=[]
15 pagenumber = [30,50,70,100,200]
16 part1 = '
limit.py
url.py
form.py
manage.py
models.py
1 from django.shortcuts import render,redirect,HttpResponse
2 from dw import models
3 from dw.views import form
4 from django.views.decorators.csrf import csrf_exempt
5 from functools import wraps
6 from django.db.models import Q
7 from django.utils.safestring import mark_safe
8 # Create your views here.
9 def auth(func):
10 @wraps(func)
11 def check_login(res,*args,**kwargs):
12 try:
13 res.session['name']
14 return func(res,*args,**kwargs)
15 except:
16 return redirect('/login.html')
17 return check_login
18 @csrf_exempt
19 def login(request):
20 form_obj = form.login()
21 if request.method == 'GET':
22 return render(request,'login.html',{'form_obj':form_obj})
23 elif request.method == 'POST':
24 auth_obj = models.login.objects
25 request_form = form.login(request.POST)
26 if request_form.is_valid():
27 user_info = request_form.clean()
28 if auth_obj.filter(**user_info):
29 request.session['name']=user_info['username']
30 return redirect('/index.html/')
31 else:
32 errors = '用户名或密码错误'
33 return render(request,'login.html',{'form_obj':form_obj,'errors':errors})
34 else:
35 errors = request_form.errors()
36 return render(request,'login.html',{'form_obj':form_obj,'errors':errors})
37 return render(request,'login.html',{'form_obj':form_obj})
38 @csrf_exempt
39 def register(request):
40 form_obj = form.register()
41 if request.method == 'GET':
42 return render(request,'register.html',{'form_obj':form_obj})
43 elif request.method == 'POST':
44 register_form = form.register(request.POST)
45 if register_form.is_valid():
46 userinfo = register_form.clean()
47 if models.login.objects.filter(username=userinfo['username']):
48 errors='用户名已经被注册'
49 return render(request,'register.html',{'form_obj':form_obj,'errors':errors})
50 else:
51 models.login.objects.create(**userinfo)
52 return redirect('/index.html/')
53 else:
54 errors = register_form.errors['pwd'][0]
55 return render(request,'register.html',{'form_obj':form_obj,'errors':errors})
56 @csrf_exempt
57 @auth
58 def index(request):
59 return render(request,'index.html')
60 @csrf_exempt
61 @auth
62 def module(request):
63 obj = models.module_info.objects
64 if request.method == 'GET':
65 search = request.GET.get('search','')
66 db_search = obj.filter( Q(module_vendor__vendor_name__icontains=search)|\
67 Q(module_type__device_type__icontains=search)|\
68 Q(module_model__module_model__icontains=search)|\
69 Q(module_length__length__icontains=search)|\
70 Q(module_sn__icontains=search)|\
71 Q(module_status__icontains=search))
72 form_obj = form.moduladd()
73 if search:
74 count = db_search.count()
75 web_limit = '
共计:%s
'%count共计:%s
'%count共计:%s
'%count共计:%s
'%countviews.py
CSS
cable.css
1 *{margin: 0;padding: 0; }
2 .top{
3 background-color: rgb(83, 83, 236);
4 height: 52px;
5 }
6
7 .top-left{
8 width: 300px;height: 53px;
9 float: left;
10 text-align: center;line-height: 48px;
11 color: seashell;
12
13 }
14
15 .top-right{height: 53px;
16 float: right;
17 text-align: center;line-height: 48px;
18 color: seashell;
19 margin-right: 60px;
20 }
21
22 .left{background-color: whitesmoke;
23 position: absolute;left: 0;top: 48px;bottom: 0; z-index: 99;
24 width: 300px;
25 border-right:1px solid black;
26 z-index: 99;
27 }
28
29 .right{
30 background-color: whitesmoke;
31 position: absolute;left: 301px;top: 48px;bottom: 0;right: 0; z-index: 99;
32 overflow: scroll;
33 z-index: 99;
34 }
35
36 a:hover{
37 background-color: cornflowerblue;
38 }
39
40 .leftmenu{
41 display: block;padding: 10px;
42 }
43
44 .block{
45 position: absolute;top: 0;bottom: 0;right: 0;left: 0;
46 background-color: black ;opacity: 0.2;z-index: 100;
47 }
48 .currsor:hover{
49 cursor: pointer;
50 }
51 .hidden{
52 display: none;
53 }
54 .pitch{
55 background-color:black;color: white;
56 }
57 .unpitch{
58 background-color: white;color: black;
59 }
60 .page{
61 margin-left: 10px;
62 }
index.css
1 .font{font-family: verdana,arial,sans-serif;}
2
3 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
4
5 .manageadd{
6 position: absolute;top: 50%;left: 50%;
7 transform: translate(-50%,-50%);
8 z-index: 101;
9 background-color: whitesmoke;
10 width: 500px;
11 height: 50px;
12 }
13
14 .manageadd input{height: 20px;}
15
16
17
18 table.gridtable {
19 font-family: verdana,arial,sans-serif;
20 font-size:11px;
21 width: 50%;
22 color:#333333;
23 border-width: 1px;
24 border-color: #666666;
25 border-collapse: collapse;
26 }
27 table.gridtable th {
28 border-width: 1px;
29 padding: 8px;
30 border-style: solid;
31 border-color: #666666;
32 background-color: #dedede;
33 }
34 .change{
35 width: 70px;
36 }
37 table.gridtable td {
38 border-width: 1px;
39 padding: 8px;
40 border-style: solid;
41 border-color: #666666;
42 background-color: #ffffff;
43 }
length_manage.css
1 *{margin: 0;padding:0}
2 body{background-color: royalblue;}
3 .login{position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);}
4 .button,input{width: 300px; height: 20px;margin-top: 10px;}
5 h1{text-align: center; color: seashell}
6 .errors{color: red;}
login.css
1 /* .swadd{
2 position: absolute;top: 50%;left: 50%;
3 transform: translate(-50%,-50%);
4 z-index: 101;
5 background-color:teal;
6 width: 300px;
7 } */
8 .font{font-family: verdana,arial,sans-serif;}
9
10 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
11
12 .manageadd{
13 position: absolute;top: 50%;left: 50%;
14 transform: translate(-50%,-50%);
15 z-index: 101;
16 background-color: whitesmoke;
17 width: 500px;
18 height: 50px;
19 }
20
21 .manageadd input{height: 20px;}
22
23
24
25
26 table.gridtable {
27 font-family: verdana,arial,sans-serif;
28 font-size:11px;
29 width: 50%;
30 color:#333333;
31 border-width: 1px;
32 border-color: #666666;
33 border-collapse: collapse;
34 }
35 table.gridtable th {
36 border-width: 1px;
37 padding: 8px;
38 border-style: solid;
39 border-color: #666666;
40 background-color: #dedede;
41 }
42 .change{
43 width: 70px;
44 }
45 table.gridtable td {
46 border-width: 1px;
47 padding: 8px;
48 border-style: solid;
49 border-color: #666666;
50 background-color: #ffffff;
51 }
model_manage.css
1 /* .swadd{
2 position: absolute;top: 50%;left: 50%;
3 transform: translate(-50%,-50%);
4 z-index: 101;
5 background-color:teal;
6 width: 300px;
7 } */
8 .font{
9 font-family: verdana,arial,sans-serif;
10 font-size:11px;
11 }
12
13 .search{
14 float: right;margin-right: 10px;
15 }
16
17 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
18
19 .swadd{
20 position: absolute;top:0px;bottom: 0px; right: 0px;
21 z-index: 101;
22 background-color: whitesmoke;
23 width: 500px;
24 }
25
26 .swadd p,hr{
27 margin-top: 50px;
28 }
29
30 .swadd input,.swadd select{
31 width: 50%;height: 20px;
32 }
33 .info input{
34 border: none
35 }
36 .info .date{
37 width: 100px;
38 }
39 .info .short{
40 width: 70px;
41 }
42
43 .info .long{
44 width: 100%;
45 }
46
47
48 table.gridtable {
49 font-family: verdana,arial,sans-serif;
50 font-size:11px;
51 width: 100%;
52 color:#333333;
53 border-width: 1px;
54 border-color: #666666;
55 border-collapse: collapse;
56 }
57 table.gridtable th {
58 border-width: 1px;
59 padding: 8px;
60 border-style: solid;
61 border-color: #666666;
62 background-color: #dedede;
63 }
64 .change{
65 width: 70px;
66 }
67 table.gridtable td {
68 border-width: 1px;
69 padding: 8px;
70 border-style: solid;
71 border-color: #666666;
72 background-color: #ffffff;
73 }
module.css
1 /* .swadd{
2 position: absolute;top: 50%;left: 50%;
3 transform: translate(-50%,-50%);
4 z-index: 101;
5 background-color:teal;
6 width: 300px;
7 } */
8 .font{
9 font-family: verdana,arial,sans-serif;
10 font-size:11px;
11 }
12
13 .search{
14 float: right;margin-right: 10px;
15 }
16
17 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
18
19 .serveradd{
20 position: absolute;top:0px;bottom: 0px; right: 0px;
21 z-index: 101;
22 background-color: whitesmoke;
23 width: 500px;
24 }
25
26 .serveradd p,hr{
27 margin-top: 50px;
28 }
29
30 .serveradd input,.serveradd select{
31 width: 50%;height: 20px;
32 }
33 .info input{
34 border: none
35 }
36 .info .date{
37 width: 100px;
38 }
39 .info .short{
40 width: 70px;
41 }
42
43 .info .long{
44 width: 100%;
45 }
46
47
48 table.gridtable {
49 font-family: verdana,arial,sans-serif;
50 font-size:11px;
51 width: 100%;
52 color:#333333;
53 border-width: 1px;
54 border-color: #666666;
55 border-collapse: collapse;
56 }
57 table.gridtable th {
58 border-width: 1px;
59 padding: 8px;
60 border-style: solid;
61 border-color: #666666;
62 background-color: #dedede;
63 }
64 .change{
65 width: 70px;
66 }
67 table.gridtable td {
68 border-width: 1px;
69 padding: 8px;
70 border-style: solid;
71 border-color: #666666;
72 background-color: #ffffff;
73 }
server.css
1 .font{
2 font-family: verdana,arial,sans-serif;
3 font-size:11px;
4 }
5
6 .search{
7 float: right;margin-right: 10px;
8 }
9
10
11 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
12
13 .swadd{
14 position: absolute;top:0px;bottom: 0px; right: 0px;
15 z-index: 101;
16 background-color: whitesmoke;
17 width: 500px;
18 }
19
20 .swadd p,hr{
21 margin-top: 50px;
22 }
23
24 .swadd input,.swadd select{
25 width: 50%;height: 20px;
26 }
27 .info input{
28 border: none
29 }
30 .info .date{
31 width: 100px;
32 }
33 .info .short{
34 width: 70px;
35 }
36
37 .info .long{
38 width: 100%;
39 }
40
41
42 table.gridtable {
43 font-family: verdana,arial,sans-serif;
44 font-size:11px;
45 width: 100%;
46 color:#333333;
47 border-width: 1px;
48 border-color: #666666;
49 border-collapse: collapse;
50 }
51 table.gridtable th {
52 border-width: 1px;
53 padding: 8px;
54 border-style: solid;
55 border-color: #666666;
56 background-color: #dedede;
57 }
58 .change{
59 width: 70px;
60 }
61 table.gridtable td {
62 border-width: 1px;
63 padding: 8px;
64 border-style: solid;
65 border-color: #666666;
66 background-color: #ffffff;
67 }
switch.css
1 .font{font-family: verdana,arial,sans-serif;}
2
3 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
4
5 .manageadd{
6 position: absolute;top: 50%;left: 50%;
7 transform: translate(-50%,-50%);
8 z-index: 101;
9 background-color: whitesmoke;
10 width: 500px;
11 height: 50px;
12 }
13
14 .manageadd input{height: 20px;}
15
16
17
18 table.gridtable {
19 font-family: verdana,arial,sans-serif;
20 font-size:11px;
21 width: 50%;
22 color:#333333;
23 border-width: 1px;
24 border-color: #666666;
25 border-collapse: collapse;
26 }
27 table.gridtable th {
28 border-width: 1px;
29 padding: 8px;
30 border-style: solid;
31 border-color: #666666;
32 background-color: #dedede;
33 }
34 .change{
35 width: 70px;
36 }
37 table.gridtable td {
38 border-width: 1px;
39 padding: 8px;
40 border-style: solid;
41 border-color: #666666;
42 background-color: #ffffff;
43 }
type_manage.css
1 .font{font-family: verdana,arial,sans-serif;}
2
3 .add{padding: 6px;margin-top: 3px;margin-bottom: 3px;}
4
5 .manageadd{
6 position: absolute;top: 50%;left: 50%;
7 transform: translate(-50%,-50%);
8 z-index: 101;
9 background-color: whitesmoke;
10 width: 500px;
11 height: 50px;
12 }
13
14 .manageadd input{height: 20px;}
15
16
17
18 table.gridtable {
19 font-family: verdana,arial,sans-serif;
20 font-size:11px;
21 width: 50%;
22 color:#333333;
23 border-width: 1px;
24 border-color: #666666;
25 border-collapse: collapse;
26 }
27 table.gridtable th {
28 border-width: 1px;
29 padding: 8px;
30 border-style: solid;
31 border-color: #666666;
32 background-color: #dedede;
33 }
34 .change{
35 width: 70px;
36 }
37 table.gridtable td {
38 border-width: 1px;
39 padding: 8px;
40 border-style: solid;
41 border-color: #666666;
42 background-color: #ffffff;
43 }
vendor_manage.css
JQuery
1 $(function(){
2 add()
3 cancel()
4 del()
5 edit()
6 commit()
7 pagelimit()
8 })
9
10 function add(){
11 $('.add').click(function(){
12 $('.block').removeClass('hidden')
13 $('.cableadd').removeClass('hidden')
14 })
15 }
16
17 function cancel(){
18 $('.cancel').click(function(){
19 $('.cableadd').addClass('hidden')
20 $('.block').addClass('hidden')
21 })
22 }
23 function del(){
24 $('.delete').click(function(){
25 var id = $(this).attr('sid')
26 $.ajax({
27 url:'/cable.html/',
28 data:{'id':id},
29 type:'POST',
30 success:function(){
31 location.reload()
32 }
33 })
34 })
35 }
36
37 function edit(){
38 $('.edit').click(function(){
39 var id = $(this).attr('sid')
40 $('.commit'+id).removeClass('hidden')
41 $(this).addClass('hidden')
42 $('.'+id).removeAttr('readonly')
43 $('.option'+id).removeClass('hidden')
44 $('.p'+id).addClass('hidden')
45 })
46 }
47
48 function commit(){
49 $('.commit').click(function(){
50 $(this).addClass('hidden')
51 $('.edit').removeClass('hidden')
52 var id = $(this).attr('sid')
53 $('.'+id).attr('readonly','readonly')
54 var data = $('.'+id)
55 var list = new Array()
56 $(this).parent().siblings().find('select option:checked').each(function(k,v){
57 list.push(v.text)
58 })
59 data.each(function(index,x){
60 list.push(x.value)
61 });
62 list.push(id)
63 $.ajax({
64 url:'/cable.html/',
65 data:{'data':list},
66 type:'POST',
67 traditional:true,
68 success:function(res){
69 if(res=='ok'){
70 location.reload()
71 }
72 else{
73 alert(res)
74 }
75 }
76 })
77 })
78 }
79
80
81
82 // function pagelimit(){
83 // var option = $('.pagelimit').val()
84 // var pagelimit = '&'+'?pagelimit'+option
85 // var a = $('.page')
86 // a.each(function(){
87 // var base_href = $(this).attr('href')
88 // var new_href = base_href + pagelimit
89 // console.log(new_href)
90 // })
91 // // for(x in a){
92 // // console.log(x)
93 // // }
94 // }
cable.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 edit()
6 commit()
7 // pagelimit()
8 text()
9 })
10
11 function add(){
12 $('.add').click(function(){
13 $('.block').removeClass('hidden')
14 $('.swadd').removeClass('hidden')
15 })
16 }
17
18 function cancel(){
19 $('.cancel').click(function(){
20 $('.swadd').addClass('hidden')
21 $('.block').addClass('hidden')
22 })
23 }
24 function del(){
25 $('.delete').click(function(){
26 var id = $(this).attr('sid')
27 $.ajax({
28 url:'/module.html/',
29 data:{'id':id},
30 type:'POST',
31 success:function(){
32 location.reload()
33 }
34 })
35 })
36 }
37
38 function edit(){
39 $('.edit').click(function(){
40 var id = $(this).attr('sid')
41 $('.commit'+id).removeClass('hidden')
42 $(this).addClass('hidden')
43 $('.'+id).removeAttr('readonly')
44 $('.option'+id).removeClass('hidden')
45 $('.p'+id).addClass('hidden')
46 })
47 }
48
49 function commit(){
50 $('.commit').click(function(){
51 $(this).addClass('hidden')
52 $('.edit').removeClass('hidden')
53 var id = $(this).attr('sid')
54 $('.'+id).attr('readonly','readonly')
55 var data = $('.'+id)
56 var list = new Array()
57 $(this).parent().siblings().find('select option:checked').each(function(k,v){
58 list.push(v.text)
59 })
60 data.each(function(index,x){
61 list.push(x.value)
62 });
63 list.push(id)
64 console.log(list)
65 $.ajax({
66 url:'/module.html/',
67 data:{'data':list},
68 type:'POST',
69 traditional:true,
70 success:function(res){
71 if(res=='ok'){
72 location.reload()
73 }
74 else{
75 alert(res)
76 }
77 }
78 })
79 })
80 }
81
82
83
84 // function pagelimit(){
85 // var option = $('.pagelimit').val()
86 // var pagelimit = '&'+'?pagelimit'+option
87 // var a = $('.page')
88 // a.each(function(){
89 // var base_href = $(this).attr('href')
90 // var new_href = base_href + pagelimit
91 // console.log(new_href)
92 // })
93 // // for(x in a){
94 // // console.log(x)
95 // // }
96 // }
module.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 edit()
6 commit()
7 pagelimit()
8 })
9
10 function add(){
11 $('.add').click(function(){
12 $('.block').removeClass('hidden')
13 $('.serveradd').removeClass('hidden')
14 })
15 }
16
17 function cancel(){
18 $('.cancel').click(function(){
19 $('.serveradd').addClass('hidden')
20 $('.block').addClass('hidden')
21 })
22 }
23 function del(){
24 $('.delete').click(function(){
25 var id = $(this).attr('sid')
26 $.ajax({
27 url:'/server.html/',
28 data:{'id':id},
29 type:'POST',
30 success:function(){
31 location.reload()
32 }
33 })
34 })
35 }
36
37 function edit(){
38 $('.edit').click(function(){
39 var id = $(this).attr('sid')
40 $('.commit'+id).removeClass('hidden')
41 $(this).addClass('hidden')
42 $('.'+id).removeAttr('readonly')
43 $('.option'+id).removeClass('hidden')
44 $('.p'+id).addClass('hidden')
45 })
46 }
47
48 function commit(){
49 $('.commit').click(function(){
50 $(this).addClass('hidden')
51 $('.edit').removeClass('hidden')
52 var id = $(this).attr('sid')
53 $('.'+id).attr('readonly','readonly')
54 var data = $('.'+id)
55 var list = new Array()
56 $(this).parent().siblings().find('select option:checked').each(function(k,v){
57 list.push(v.text)
58 })
59 data.each(function(index,x){
60 list.push(x.value)
61 });
62 list.push(id)
63
64 $.ajax({
65 url:'/server.html/',
66 data:{'data':list},
67 type:'POST',
68 traditional:true,
69 success:function(res){
70 if(res=='ok'){
71 location.reload()
72 }
73 else{
74 alert(res)
75 }
76 }
77 })
78 })
79 }
80
81
82
83 // function pagelimit(){
84 // var option = $('.pagelimit').val()
85 // var pagelimit = '&'+'?pagelimit'+option
86 // var a = $('.page')
87 // a.each(function(){
88 // var base_href = $(this).attr('href')
89 // var new_href = base_href + pagelimit
90 // console.log(new_href)
91 // })
92 // // for(x in a){
93 // // console.log(x)
94 // // }
95 // }
server.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 edit()
6 commit()
7 })
8
9 function add(){
10 $('.add').click(function(){
11 $('.block').removeClass('hidden')
12 $('.swadd').removeClass('hidden')
13 })
14 }
15
16 function cancel(){
17 $('.cancel').click(function(){
18 $('.swadd').addClass('hidden')
19 $('.block').addClass('hidden')
20 })
21 }
22 function del(){
23 $('.delete').click(function(){
24 var id = $(this).attr('sid')
25 $.ajax({
26 url:'/switch.html/',
27 data:{'id':id},
28 type:'POST',
29 success:function(){
30 location.reload()
31 }
32 })
33 })
34 }
35
36 function edit(){
37 $('.edit').click(function(){
38 var id = $(this).attr('sid')
39 $('.commit'+id).removeClass('hidden')
40 $(this).addClass('hidden')
41 $('.'+id).removeAttr('readonly')
42 $('.option'+id).removeClass('hidden')
43 $('.p'+id).addClass('hidden')
44 })
45 }
46
47 function commit(){
48 $('.commit').click(function(){
49 $(this).addClass('hidden')
50 $('.edit').removeClass('hidden')
51 var id = $(this).attr('sid')
52 $('.'+id).attr('readonly','readonly')
53 var data = $('.'+id)
54 var list = new Array()
55 $(this).parent().siblings().find('select option:checked').each(function(k,v){
56 list.push(v.text)
57 })
58 data.each(function(index,x){
59 list.push(x.value)
60 });
61 list.push(id)
62 $.ajax({
63 url:'/switch.html/',
64 data:{'data':list},
65 type:'POST',
66 traditional:true,
67 success:function(res){
68 if(res=='ok'){
69 location.reload()
70 }
71 else{
72 alert(res)
73 }
74 }
75 })
76 })
77 }
switch.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 })
6
7 function add(){
8 $('.add').click(function(){
9 $('.block').removeClass('hidden')
10 $('.manageadd').removeClass('hidden')
11 })
12 }
13
14 function cancel(){
15 $('.cancel').click(function(){
16 $('.manageadd').addClass('hidden')
17 $('.block').addClass('hidden')
18 event.preventDefault()
19 })
20 }
21
22 function del(){
23 $('.delete').click(function(){
24 var id = $(this).attr('sid')
25 $.ajax({
26 url:'/length_manage.html/',
27 data:{'id':id},
28 type:'POST',
29 success:function(){
30 location.reload()
31 }
32 })
33 })
34 }
length_manage.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 })
6
7 function add(){
8 $('.add').click(function(){
9 $('.block').removeClass('hidden')
10 $('.manageadd').removeClass('hidden')
11 })
12 }
13
14 function cancel(){
15 $('.cancel').click(function(){
16 $('.manageadd').addClass('hidden')
17 $('.block').addClass('hidden')
18 event.preventDefault()
19 })
20 }
21
22 function del(){
23 $('.delete').click(function(){
24 var id = $(this).attr('sid')
25 var table_name = $(this).attr('dtype')
26 $.ajax({
27 url:'/model_manage.html/',
28 data:{'id':id,'table_name':table_name},
29 type:'POST',
30 success:function(){
31 location.reload()
32 }
33 })
34 })
35 }
model_manage.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 })
6
7 function add(){
8 $('.add').click(function(){
9 $('.block').removeClass('hidden')
10 $('.manageadd').removeClass('hidden')
11 })
12 }
13
14 function cancel(){
15 $('.cancel').click(function(){
16 $('.manageadd').addClass('hidden')
17 $('.block').addClass('hidden')
18 event.preventDefault()
19 })
20 }
21
22 function del(){
23 $('.delete').click(function(){
24 var id = $(this).attr('sid')
25 $.ajax({
26 url:'/type_manage.html/',
27 data:{'id':id},
28 type:'POST',
29 success:function(){
30 location.reload()
31 }
32 })
33 })
34 }
type_manage.js
1 $(function(){
2 add()
3 cancel()
4 del()
5 })
6
7 function add(){
8 $('.add').click(function(){
9 $('.block').removeClass('hidden')
10 $('.manageadd').removeClass('hidden')
11 })
12 }
13
14 function cancel(){
15 $('.cancel').click(function(){
16 $('.manageadd').addClass('hidden')
17 $('.block').addClass('hidden')
18 event.preventDefault()
19 })
20 }
21
22 function del(){
23 $('.delete').click(function(){
24 var id = $(this).attr('sid')
25 $.ajax({
26 url:'/vendor_manage.html/',
27 data:{'id':id},
28 type:'POST',
29 success:function(){
30 location.reload()
31 }
32 })
33 })
34 }
vendor_manage.js
html页面
1
2
3
index.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
11
12 {%endblock%}
13
14 {%block change%}
15
17 线缆信息添加 18
19添加日期 | 82厂商 | 83类型 | 84型号 | 85传输距离 | 86备注 | 87操作 | 88
---|---|---|---|---|---|---|
92 {{x.date}} 93 | 9495 96 | 9798 99 | 100101 102 | 103104 105 | 106107 108 | 109 110111 编辑 112 113 删除 114 | 115
cable.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
10
11 {%endblock%}
12
13 {%block change%}
14
添加日期 | 34传输距离 | 35操作 | 36
---|---|---|
40 {{x.date}} 41 | 42{{x.length}} | 4344 删除 45 | 46
length_manage.html
1
2
3
27 {{errors}} 28
29login.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
10
11 {%endblock%}
12
13 {%block change%}
14
添加日期 | 39型号 | 40操作 | 41
---|---|---|
45 {{x.date}} 46 | 4748 {{x.switch_model}} 49 | 5051 删除 52 | 53
59 {{x.date}} 60 | 6162 {{x.module_model}} 63 | 6465 删除 66 | 67
73 {{x.date}} 74 | 7576 {{x.cable_model}} 77 | 7879 删除 80 | 81
87 {{x.date}} 88 | 8990 {{x.server\_model}} 91 | 92 ¨C145C 95
model_manage.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
11
12 {%endblock%}
13
14 {%block change%}
15
17 模块信息添加 18
19添加日期 | 89厂商 | 90类型 | 91型号 | 92SN | 93传输距离 | 94备注 | 95操作 | 96
---|---|---|---|---|---|---|---|
100 {{x.date}} 101 | 102103 104 | 105106 107 | 108109 110 | 111112 113 | 114115 116 | 117118 119 | 120 121122 编辑 123 124 删除 125 | 126
module.html
1
2
3
register.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
11
12 {%endblock%}
13
14 {%block change%}
15
17 线缆信息添加 18
19添加日期 | 88厂商 | 89类型 | 90型号 | 91SN | 92系统 | 93备注 | 94操作 | 95
---|---|---|---|---|---|---|---|
99 {{x.date}} 100 | 101102 103 | 104105 106 | 107108 109 | 110111 112 | 113114 115 | 116117 118 | 119120 编辑 121 122 删除 123 | 124
server.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
11
12 {%endblock%}
13
14 {%block change%}
15
17 交换机信息添加 18
19添加日期 | 89厂商 | 90类型 | 91型号 | 92SN | 93镜像 | 94备注 | 95操作 | 96
---|---|---|---|---|---|---|---|
100 {{x.date}} 101 | 102103 104 | 105106 107 | 108109 110 | 111112 113 | 114115 116 | 117118 119 | 120121 编辑 122 123 删除 124 | 125
switch.html
1 {% extends 'index.html' %}
2
3 {%block cssandjs%}
4
5
8
9
11
12 {%endblock%}
13
14 {%block change%}
15
添加日期 | 35设备类型 | 36操作 | 37
---|---|---|
41 {{x.date}} 42 | 43{{x.device_type}} | 4445 46 删除 47 | 48
type_manage.html
1 {% extends 'index.html' %}
2 {%block cssandjs%}
3
4
7
8
10
11 {%endblock%}
12
13 {%block change%}
14
添加日期 | 34厂商 | 35操作 | 36
---|---|---|
40 {{x.date}} 41 | 42{{x.vendor_name}} | 4344 删除 45 | 46
vendor_manage.html
手机扫一扫
移动阅读更方便
你可能感兴趣的文章