Browse Source

资源导入

jack 7 years ago
parent
commit
881fb05df0
1 changed files with 19 additions and 4 deletions
  1. 19 4
      js/resourceImport.js

+ 19 - 4
js/resourceImport.js

58
	}
58
	}
59
	 getRecourceMe(1,true);
59
	 getRecourceMe(1,true);
60
function resourceHtml($data) {
60
function resourceHtml($data) {
61
	console.log($data);
61
 	for(var i = 0; i < $data.length; i++) {
62
 	for(var i = 0; i < $data.length; i++) {
62
 		var imgSrc = "../images/default-resource.jpg";
63
 		var imgSrc = "../images/default-resource.jpg";
63
 		var oSpec="",orgName="",domain="";
64
 		var oSpec="",orgName="",domain="",subject="",orgName="",spec="",comp="",parameter="";
64
 		if($data[i].img) {
65
 		if($data[i].img) {
65
 			imgSrc = "/data/resource/" + $data[i].img;
66
 			imgSrc = "/data/resource/" + $data[i].img;
66
 		}
67
 		}
67
 		if($data[i].spec) {
68
 		if($data[i].spec) {
68
 			oSpec="厂商型号:"+$data[i].spec
69
 			oSpec="厂商型号:"+$data[i].spec;
70
 			spec=$data[i].spec;
69
 		}
71
 		}
70
 		if($data[i].orgName) {
72
 		if($data[i].orgName) {
71
 			orgName="所属机构:"+$data[i].orgName;
73
 			orgName="所属机构:"+$data[i].orgName;
74
 			orgName=$data[i].orgName;
72
 		}
75
 		}
73
 		if($data[i].domain) {
76
 		if($data[i].domain) {
74
 			domain="关键词:"+$data[i].domain;
77
 			domain="关键词:"+$data[i].domain;
78
 			subject=$data[i].domain
79
 		}
80
 		if($data[i].comp) {
81
 			comp=$data[i].comp;
75
 		}
82
 		}
76
 		var oImg="";
83
 		var oImg="";
77
 		if($data[i].img) {
84
 		if($data[i].img) {
78
 			oImg=$data[i].img;
85
 			oImg=$data[i].img;
79
 		}
86
 		}
87
 		if($data[i].parameter){
88
 			parameter=$data[i].parameter
89
 		}
80
 		var oName1=$data[i].name;
90
 		var oName1=$data[i].name;
81
 		var oId=$data[i].id;
91
 		var oId=$data[i].id;
82
 		var oIndu=$data[i].majorFunc
92
 		var oIndu=$data[i].majorFunc;
83
 		$.ajax({
93
 		$.ajax({
84
			"url": "/ajax/resource/isImportRes",
94
			"url": "/ajax/resource/isImportRes",
85
			"type": "GET",
95
			"type": "GET",
105
		 			'</div>' +
115
		 			'</div>' +
106
		 			'</a>' +
116
		 			'</a>' +
107
		 			'<div class="importBtn">' +
117
		 			'<div class="importBtn">' +
108
		 			'<span class="importResource '+oT+'" data-id="'+oId+'" data-name="'+oName1+'" data-indu="'+oIndu+'" flag="1" data-img="'+oImg+'">'+oText+'</span>' +
118
		 			'<span class="importResource '+oT+'" data-id="'+oId+'" data-parameter="'+parameter+'" data-comp="'+comp+'" data-spec="'+spec+'" data-orgName="'+orgName+'" data-subject="'+subject+'" data-name="'+oName1+'" data-indu="'+oIndu+'" flag="1" data-img="'+oImg+'">'+oText+'</span>' +
109
		 			/*'<span class="importSpan-2">再次导入</span>' +
119
		 			/*'<span class="importSpan-2">再次导入</span>' +
110
		 			'<span class="importSpan-3">已导入</span>' +*/
120
		 			'<span class="importSpan-3">已导入</span>' +*/
111
		 			'</div>' +
121
		 			'</div>' +
154
					
164
					
155
			},
165
			},
156
			"data": {
166
			"data": {
167
				subject:$(this).attr("data-subject"),
168
				orgName:$(this).attr("data-orgName"),
169
				comp:$(this).attr("data-comp"),
170
				spec:$(this).attr("data-spec"),
171
				parameter:$(this).attr("data-parameter"),
157
				resourceTmpId:$(this).attr("data-id"),
172
				resourceTmpId:$(this).attr("data-id"),
158
				resourceName:$(this).attr("data-name"),
173
				resourceName:$(this).attr("data-name"),
159
				professorId:userid,
174
				professorId:userid,