unknown 4 éve
szülő
commit
b6d3e20317
8 módosított fájl, 371 hozzáadás és 352 törlés
  1. 1 1
      admin/algorithm.html
  2. 14 2
      admin/atlas.html
  3. 4 4
      admin/index.html
  4. 0 1
      admin/js/algorithm-add.js
  5. 159 149
      admin/js/algorithm.js
  6. 12 2
      admin/js/atlas.js
  7. 123 172
      admin/js/welcome.js
  8. 58 21
      admin/welcome.html

+ 1 - 1
admin/algorithm.html

@@ -58,7 +58,7 @@
         <script type="text/html" id="operationToolbar">
 			
             <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
-			 <a class="layui-btn layui-btn-xs" lay-event="edit">下载</a>
+			 <a class="layui-btn layui-btn-xs" lay-event="download">下载</a>
             <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
         </script>
     </div>

+ 14 - 2
admin/atlas.html

@@ -24,7 +24,7 @@
 			}
 
 			.input_text {
-				width: 85%;
+				width: 70%;
 				height: 38px;
 				border: 2px solid #c4c7ce;
 				border-radius: 10px 0 0 10px;
@@ -33,7 +33,7 @@
 				outline: none;
 				float: left;
 				border-right: 0;
-				margin-left: 40px;
+				margin-left: 20px;
 			}
 
 			.input_sub {
@@ -52,16 +52,28 @@
 				display: inline-block;
 				margin: 0 auto;
 			}
+
+			#select {
+				width: 130px;
+				height: 40px;
+				float: left;
+			}
 		</style>
 
 	</head>
 
 	<body class="layui-anim layui-anim-up">
 		<div class="x-body">
+			<select id="select">
+				<option value="1">元器件图谱</option>
+				<option value="2">实验图谱</option>
+			</select>
 			<div>
 				<input type="text" class="input_text" placeholder="请输入搜索内容">
 				<input type="submit" value="搜索" class="input_sub">
 			</div>
+
+
 		</div>
 	</body>
 

+ 4 - 4
admin/index.html

@@ -99,8 +99,8 @@
 					<li class="layui-nav-item">
 						<a href="javascript:;"><i class="iconfont">&#xe681;</i> 数据管理</a>
 						<dl class="layui-nav-child">
-							<dd><a href="javascript:;" data-url="datasource.html" data-id='10'
-									data-text="数据源管理">数据源管理</a></dd>
+							<!-- <dd><a href="javascript:;" data-url="datasource.html" data-id='10'
+									data-text="数据源管理">数据源管理</a></dd> -->
 							<dd><a href="javascript:;" data-url="flight.html" data-id='11' data-text="飞参数据管理">飞参数据管理</a>
 							</dd>
 							
@@ -122,13 +122,13 @@
 							</dd>
 							<dd><a href="javascript:;" data-url="algorithmCall.html" data-id='15'
 									data-text="算法调用记录">算法调用记录</a></dd>
-							<dd><a href="javascript:;" data-url="experiment.html" data-id='11' data-text="实验记录管理">实验记录管理</a>
+							<dd><a href="javascript:;" data-url="experiment.html" data-id='16' data-text="实验记录管理">实验记录管理</a>
 									</dd>
 						</dl>
 					</li>
 
 					<li class="layui-nav-item">
-						<a href="javascript:;" data-url="atlas.html" data-id='16' data-text="知识图谱管理"><i
+						<a href="javascript:;" data-url="atlas.html" data-id='17' data-text="知识图谱管理"><i
 								class="iconfont">&#xe604;</i>知识图谱管理</a>
 					</li>
 				</ul>

+ 0 - 1
admin/js/algorithm-add.js

@@ -71,7 +71,6 @@ $(function() {
 		    // accept: 'file',
 		    done: function(res) {
 		        if (res.status === 0) {
-					console.log(res)
 		            $("#algorithm_path").val(res.msg);
 		        } else
 		            showMsg(res.msg, 2);

+ 159 - 149
admin/js/algorithm.js

@@ -6,165 +6,175 @@ $(function() {
 	var tableFirstLoad = true;
 
 	layui.use(["form", "table", "laypage", "layer"], function() {
-		var table = layui.table;
-		var laypage = layui.laypage;
-		var layer = layui.layer;
-		var title = $("#realName");
-		var searchTitleKey = "";
+			var table = layui.table;
+			var laypage = layui.laypage;
+			var layer = layui.layer;
+			var title = $("#realName");
+			var searchTitleKey = "";
 
-		function loadalgorithm(page, size, searchTitle) {
-			if (page === null || page === undefined) page = defaultPage;
-			if (size === null || size === undefined) size = defaultSize;
-			var tableOption = {
-				elem: "#algorithm",
-				height: "full-81",
-				limit: size,
-				cols: [
-					[{
-							type: "checkbox"
-						},
+			function loadalgorithm(page, size, searchTitle) {
+				if (page === null || page === undefined) page = defaultPage;
+				if (size === null || size === undefined) size = defaultSize;
+				var tableOption = {
+					elem: "#algorithm",
+					height: "full-81",
+					limit: size,
+					cols: [
+						[{
+								type: "checkbox"
+							},
 
-						{
-							field: "algorithm_type",
-							title: "算法类别",
-							align: "center",
-							width: 200,
-						},
-						{
-							field: "algorithm_name",
-							title: "算法名称",
-							align: "center"
-						},
-						{
-							field: "algorithm_format",
-							title: "调用格式",
-							align: "center"
-						},
-						{
-							field: "device_name",
-							title: "元气件名称",
-							align: "center"
-						},
-						{
-							field: "create_time",
-							title: "创建时间",
-							align: "center"
-						},
-						{
-							field: "algorithm_path",
-							title: "算法地址",
-							align: "center"
-						},
-						{
-							field: "remarks",
-							title: "备注",
-							align: "center"
-						},
-						{
-							fixed: "right",
-							title: "操作",
-							width: 265,
-							toolbar: "#operationToolbar",
-							align: "center"
-						}
+							{
+								field: "algorithm_type",
+								title: "算法类别",
+								align: "center",
+								width: 200,
+							},
+							{
+								field: "algorithm_name",
+								title: "算法名称",
+								align: "center"
+							},
+							{
+								field: "algorithm_format",
+								title: "调用格式",
+								align: "center"
+							},
+							{
+								field: "device_name",
+								title: "元气件名称",
+								align: "center"
+							},
+							{
+								field: "create_time",
+								title: "创建时间",
+								align: "center"
+							},
+							{
+								field: "algorithm_path",
+								title: "算法地址",
+								align: "center"
+							},
+							{
+								field: "remarks",
+								title: "备注",
+								align: "center"
+							},
+							{
+								fixed: "right",
+								title: "操作",
+								width: 265,
+								toolbar: "#operationToolbar",
+								align: "center"
+							}
+						]
 					]
-				]
-			};
+				};
 
-			if (searchTitle === null || searchTitle === undefined || searchTitle === "") {
-				fetchJSON("api/algorithm/listpage?page=" + (page + 1) + "&size=" + size, {}, "get",
-					function(data) {
-						if (data.status === 0) {
-							if (tableFirstLoad) {
-								tableFirstLoad = false;
-								laypage.render({
-									curr: page + 1,
-									elem: "pagination",
-									count: data.data.total,
-									layout: ["count", "prev", "page", "next", "limit",
-										"refresh", "skip"
-									],
-									jump: function(obj, first) {
-										if (first) return;
-										currentPage = obj.curr - 1;
-										currentSize = obj.limit;
-										loadalgorithm(currentPage, currentSize,
-											searchTitleKey);
-									}
-								});
-							}
+				if (searchTitle === null || searchTitle === undefined || searchTitle === "") {
+					fetchJSON("api/algorithm/listpage?page=" + (page + 1) + "&size=" + size, {}, "get",
+						function(data) {
+							if (data.status === 0) {
+								if (tableFirstLoad) {
+									tableFirstLoad = false;
+									laypage.render({
+										curr: page + 1,
+										elem: "pagination",
+										count: data.data.total,
+										layout: ["count", "prev", "page", "next", "limit",
+											"refresh", "skip"
+										],
+										jump: function(obj, first) {
+											if (first) return;
+											currentPage = obj.curr - 1;
+											currentSize = obj.limit;
+											loadalgorithm(currentPage, currentSize,
+												searchTitleKey);
+										}
+									});
+								}
 
-							tableOption.data = data.data.list;
-							table.render(tableOption);
-						} else {
-							showMsg(data.msg, 2, 2000);
-						}
-					});
-			}
+								tableOption.data = data.data.list;
+								table.render(tableOption);
+							} else {
+								showMsg(data.msg, 2, 2000);
+							}
+						});
+				}
 
 
-		}
+			}
 
-		loadalgorithm();
+			loadalgorithm();
 
-		$("#searchArticle").on("click", function(e) {
-			e.preventDefault();
-			tableFirstLoad = true;
-			searchTitleKey = title.val().trim();
-			if (searchTitleKey === "")
-				loadalgorithm(0, currentSize);
-			else
-				loadalgorithm(0, currentSize, searchTitleKey);
-		});
+			$("#searchArticle").on("click", function(e) {
+				e.preventDefault();
+				tableFirstLoad = true;
+				searchTitleKey = title.val().trim();
+				if (searchTitleKey === "")
+					loadalgorithm(0, currentSize);
+				else
+					loadalgorithm(0, currentSize, searchTitleKey);
+			});
 
 
-		$("#keyword").on("keyup", function(e) {
-			e.preventDefault();
-			if (e.keyCode === 13) {
-				$("#searchArticle").click();
-			}
-		});
+			$("#keyword").on("keyup", function(e) {
+				e.preventDefault();
+				if (e.keyCode === 13) {
+					$("#searchArticle").click();
+				}
+			});
 
-		// 监听表内工具条
-		table.on("tool(algorithm)", function(obj) {
-			var data = obj.data;
-			if (obj.event === "edit") {
-				// 打开编辑框 进行详细编辑
-				x_admin_show(
-					"编辑",
-					encodeURI(
-						"../admin/algorithm-add.html?id=" + data.id + "&algorithm_type=" +
-						data.algorithm_type + "&algorithm_name=" + data.algorithm_name +
-						"&algorithm_format=" + data.algorithm_format + "&device_name=" +
-						data.device_name + "&create_time=" + data.create_time +
-						"&algorithm_path=" + data.algorithm_path + "&remarks=" + data
-						.remarks
-					),
-					468,
-					560,
-					function() {
-						loadalgorithm(currentPage, currentSize);
-					}
-				);
-			} else if (obj.event === "delete") {
-				// 删除
-				var ids = [];
-				ids.push(data.id);
-				layer.confirm("确认要删除吗?", function() {
-					fetchJSON("api/algorithm/delete", {
-						ids: ids
-					}, "post", function(data) {
-						if (data.status === 0) {
-							showMsg("已删除!", 1, 2000);
-							tableFirstLoad = true;
-							loadalgorithm(currentPage, currentSize);
-						} else {
-							showMsg(data.msg, 2, 2000);
-						}
-					});
-				});
-			}
-		});
+			// 监听表内工具条
+			table.on("tool(algorithm)", function(obj) {
+					var data = obj.data;
+					if (obj.event === "edit") {
+						// 打开编辑框 进行详细编辑
+						x_admin_show(
+							"编辑",
+							encodeURI(
+								"../admin/algorithm-add.html?id=" + data.id + "&algorithm_type=" +
+								data.algorithm_type + "&algorithm_name=" + data.algorithm_name +
+								"&algorithm_format=" + data.algorithm_format + "&device_name=" +
+								data.device_name + "&create_time=" + data.create_time +
+								"&algorithm_path=" + data.algorithm_path + "&remarks=" + data
+								.remarks
+							),
+							468,
+							560,
+							function() {
+								loadalgorithm(currentPage, currentSize);
+							}
+						);
+					} else if (obj.event === "delete") {
+						// 删除
+						var ids = [];
+						ids.push(data.id);
+						layer.confirm("确认要删除吗?", function() {
+							fetchJSON("api/algorithm/delete", {
+								ids: ids
+							}, "post", function(data) {
+								if (data.status === 0) {
+									showMsg("已删除!", 1, 2000);
+									tableFirstLoad = true;
+									loadalgorithm(currentPage, currentSize);
+								} else {
+									showMsg(data.msg, 2, 2000);
+								}
+							});
+						});
+					} else 
+					if (obj.event === 'download') {
+						var file_path = data.algorithm_path;
+						var newurl = file_path.substr(1, file_path.length);
+						file_path = newurl.substr(newurl.indexOf('\\') + 1, file_path.length);
+						newurl = file_path.substr(0, file_path.indexOf('.'))
+						newurl = urlBase + "sourcekg/" + newurl + ".rar";
+						console.log(newurl)
+						window.open('http://127.0.0.1:11085/sourcekg/1626248784559.rar')
+						
+				}
+			});
 		// 批量删除
 		$("#batchDelete").on("click", function(e) {
 			e.preventDefault();
@@ -204,7 +214,7 @@ $(function() {
 					loadalgorithm(currentPage, currentSize);
 				});
 		});
-		
-		
+
+
 	});
 });

+ 12 - 2
admin/js/atlas.js

@@ -1,14 +1,24 @@
 $(function() {
+	var url = ''
 	var name = $('.input_text')
 	$('.input_sub').on('click', function() {
 		if ($('.input_text').val() == '') {
 			alert('请输入')
 		} else {
-			fetchJSON('api/algorithmCall/findExperimentKg?experimentId=' + $('.input_text').val(), {}, "get", function(
+			var select = $("#select").find("option:selected").val();
+			console.log(select)
+			if(select == 2){
+				url = 'api/algorithmCall/findExperimentKg?experimentId='
+			}else
+			if(select == 1){
+				url = 'api/device/findAircraftKg1?name='
+			}
+			
+			fetchJSON(url + $('.input_text').val(), {}, "get", function(
 				data) {
 				if (data.status === 0) {
 					var res_data = data.data;
-					console.log(res_data)
+					
 					var links = [];
 					for (var i = 0; i < res_data.length; i++) {
 						var str = {

+ 123 - 172
admin/js/welcome.js

@@ -1,6 +1,6 @@
 var majorId = 0;
 var time = new Date();
-var t=''
+var t = '';
 $(function() {
 	window.onload = function() {
 		setInterval(function() {
@@ -9,58 +9,60 @@ $(function() {
 			var minutes = time.getMinutes();
 			var seconds = time.getSeconds();
 			var hours = time.getHours();
-			if(minutes<10){
-				minutes ="0" + minutes
-			}else{
+			if (minutes < 10) {
+				minutes = "0" + minutes
+			} else {
 				minutes
 			}
-			if(seconds<10){
-				seconds ="0" + seconds
-				
-			}else{
+			if (seconds < 10) {
+				seconds = "0" + seconds
+
+			} else {
 				seconds
 			}
 			t = time.getFullYear() + "-" + month + "-" +
-				time.getDate() + "-" + hours + ":" +
+				time.getDate() + "  " + hours + ":" +
 				minutes + ":" + seconds;
 			var str = '<p>当前时间:<span>' + t + '</span><p>'
 			$('#time').html(str)
 		}, 1000);
 	};
-	$('#start').on('click',function(){
-		var arr = '<p>实验开始时间:<span>' + t + '</span><p>'
+	$('#start').on('click', function() {
+		var arr = '<p>开始时间:<span id="startT">' + t + '</span><p>'
 		$('#start_time').html(arr)
 	})
-	$('#end').on('click',function(){
-		var arr = '<p>实验结束时间:<span>' + t + '</span><p>'
+	$('#end').on('click', function() {
+		var arr = '<p>结束时间:<span id="endT">' + t + '</span><p>'
 		$('#end_time').html(arr)
 	})
-	
-	//配置实验信息 实验名称
-	function getexperiment_name() {
-		layui.use(["form", "table", "laypage", "layer"], function() {
-			var form = layui.form
-			fetchJSON("api/experiment/listAll", {}, "get", function(bet) {
+	layui.use(["form", "table", "laypage", "layer", 'upload'], function() {
+		var form = layui.form;
+		var upload = layui.upload;
+		var layer = layui.layer;
+
+		//元器件id
+		function getdevice_id() {
+			fetchJSON("api/device/listAll?deviceType=2", {}, "get", function(bet) {
 				if (bet.status === 0) {
-					$("#experiment_name").empty();
-					$("#experiment_name").append($("<option>", {
+					$("#device_id").empty();
+					$("#device_id").append($("<option>", {
 						value: -1,
 						text: "请选择"
 					}));
 					for (var i = 0; i < bet.data.length; i++) {
 						if (bet.data[i].id === majorId) {
-							$("#experiment_name").append(
+							$("#device_id").append(
 								$("<option>", {
-									value: bet.data[i].id,
-									text: bet.data[i].experiment_name,
+									value: bet.data[i].aircraft_id,
+									text: bet.data[i].aircraft_type,
 									selected: true
 								})
 							);
 						} else {
-							$("#experiment_name").append(
+							$("#device_id").append(
 								$("<option>", {
-									value: bet.data[i].id,
-									text: bet.data[i].experiment_name
+									value: bet.data[i].aircraft_id,
+									text: bet.data[i].aircraft_type
 								})
 							);
 						}
@@ -70,35 +72,31 @@ $(function() {
 					showMsg(bet.msg, 2);
 				}
 			});
-		});
-		
-	}
-	getexperiment_name()
-	//配置实验信息 元气件名
-	function getdevice_name() {
-		layui.use(["form", "table", "laypage", "layer"], function() {
-			var form = layui.form
-			fetchJSON("api/device/listAll?deviceType=2", {}, "get", function(bet) {
+		}
+		getdevice_id()
+		//配置实验信息 实验名称
+		function getexperiment_name() {
+			fetchJSON("api/experiment/listAll", {}, "get", function(bet) {
 				if (bet.status === 0) {
-					$("#device_name").empty();
-					$("#device_name").append($("<option>", {
+					$("#experiment_name").empty();
+					$("#experiment_name").append($("<option>", {
 						value: -1,
 						text: "请选择"
 					}));
 					for (var i = 0; i < bet.data.length; i++) {
 						if (bet.data[i].id === majorId) {
-							$("#device_name").append(
+							$("#experiment_name").append(
 								$("<option>", {
 									value: bet.data[i].id,
-									text: bet.data[i].device_name,
+									text: bet.data[i].experiment_name,
 									selected: true
 								})
 							);
 						} else {
-							$("#device_name").append(
+							$("#experiment_name").append(
 								$("<option>", {
 									value: bet.data[i].id,
-									text: bet.data[i].device_name
+									text: bet.data[i].experiment_name
 								})
 							);
 						}
@@ -108,35 +106,32 @@ $(function() {
 					showMsg(bet.msg, 2);
 				}
 			});
-		});
-		
-	}
-	getdevice_name()
-	//配置实验信息 数据源
-	function getsource_name() {
-		layui.use(["form", "table", "laypage", "layer"], function() {
-			var form = layui.form
-			fetchJSON("api/dataSource/listAll", {}, "get", function(bet) {
+
+		}
+		getexperiment_name()
+		//算法id
+		function getalgorithm_id() {
+			fetchJSON("api/algorithm/listAll", {}, "get", function(bet) {
 				if (bet.status === 0) {
-					$("#source_name").empty();
-					$("#source_name").append($("<option>", {
+					$("#algorithm_id").empty();
+					$("#algorithm_id").append($("<option>", {
 						value: -1,
 						text: "请选择"
 					}));
 					for (var i = 0; i < bet.data.length; i++) {
 						if (bet.data[i].id === majorId) {
-							$("#source_name").append(
+							$("#algorithm_id").append(
 								$("<option>", {
 									value: bet.data[i].id,
-									text: bet.data[i].source_name,
+									text: bet.data[i].algorithm_name,
 									selected: true
 								})
 							);
 						} else {
-							$("#source_name").append(
+							$("#algorithm_id").append(
 								$("<option>", {
 									value: bet.data[i].id,
-									text: bet.data[i].source_name
+									text: bet.data[i].algorithm_name
 								})
 							);
 						}
@@ -146,123 +141,79 @@ $(function() {
 					showMsg(bet.msg, 2);
 				}
 			});
-		});
-		
-	}
-	getsource_name()
-	//数据源
-	function getdataSource() {
-		var defaultPage = 0;
-		var defaultSize = 10;
-		var currentPage = defaultPage;
-		var currentSize = defaultSize;
-		var tableFirstLoad = true;
-
-		layui.use(["form", "table", "laypage", "layer"], function() {
-			var table = layui.table;
-			var laypage = layui.laypage;
-			var layer = layui.layer;
-			var title = $("#realName");
-			var searchTitleKey = "";
-
-			function loaddatasource(page, size, searchTitle) {
-				if (page === null || page === undefined) page = defaultPage;
-				if (size === null || size === undefined) size = defaultSize;
-				var tableOption = {
-					elem: "#datasource",
-					height: "full-81",
-					limit: size,
-					cols: [
-						[{
-								field: "source_name",
-								title: "数据源名",
-								align: "center",
-
-							},
-							{
-								field: "source_ip",
-								title: "数据源ip",
-								align: "center",
-
-							},
-							{
-								field: "port_number",
-								title: "端口号",
-								align: "center",
-
-							},
-							{
-								field: "source_status",
-								title: "数据源状态",
-								align: "center",
-								templet:"#led",
-								// templet: function(d) {
-								// 	return d.source_status == 0 ? "失败" : "成功"
-								// }
-							},
-
-							{
-								fixed: "right",
-								title: "操作",
-								width: 265,
-								toolbar: "#operationToolbar",
-								align: "center"
-							}
-						]
-					]
-				};
-				if (searchTitle === null || searchTitle === undefined || searchTitle === "") {
-					fetchJSON("api/dataSource/listpage?page=" + (page + 1) + "&size=" + size, {}, "get",
-						function(data) {
-							if (data.status === 0) {
-								if (tableFirstLoad) {
-									tableFirstLoad = false;
-									laypage.render({
-										curr: page + 1,
-										elem: "pagination",
-										count: data.data.total,
-										layout: ["count", "prev", "page", "next", "limit",
-											"refresh", "skip"
-										],
-										jump: function(obj, first) {
-											if (first) return;
-											currentPage = obj.curr - 1;
-											currentSize = obj.limit;
-											loaddatasource(currentPage, currentSize,
-												searchTitleKey);
-										}
-									});
-								}
-								tableOption.data = data.data.list;
-								table.render(tableOption);
-							} else {
-								showMsg(data.msg, 2, 2000);
-							}
-						});
-				}
 
+		}
+		getalgorithm_id()
+		//输入的值
+		form.on("select", function(data) {
+			if (data.elem.id === "device_id") {
+				var device_id = data.elem[data.elem.selectedIndex].value;
+				var device_name = data.elem[data.elem.selectedIndex].text;
+				$('#device_name').val(device_name)
+			} else
+			if (data.elem.id === "algorithm_id") {
+				var algorithm_id = data.elem[data.elem.selectedIndex].value;
+				var algorithm_name = data.elem[data.elem.selectedIndex].text;
+				$('#algorithm_name').val(algorithm_name)
 			}
-			loaddatasource();
 
-			table.on("tool(datasource)", function(obj) {
-				var data = obj.data;
-				if (data === null && data === undefined) {
-					showMsg("无效数据!", 2, 2000);
-					return
-				}
-				var param = {
-					id: obj.data.id,
-					nStatus: data.runStatus === 1 ? 0 : 1
-				};
-				// let Url = "sendor/changeStatus?id=" + data.id + "&nStatus=" + (data.runStatus === 1? 0:1);
-				// fetchJSON(Url, {}, "post", function(data) {
-				//   if(data.status === 0){
-				//   showMsg(data.data, 1, 2000);
-				//   loadSendorList();}
-				//   else showMsg(data.msg, 2, 2000);
-				// });
-			});
+		})
+		//自动填写路径
+		upload.render({
+			elem: '#file',
+			url: urlBase + "api/algorithm/importData",
+			accept: 'file', //普通文件
+			headers: {
+				"token": sessionStorage.getItem("token")
+			},
+			data: {},
+			// accept: 'file',
+			done: function(res) {
+				if (res.status === 0) {
+					$("#origin_data_path").val(res.msg);
+				} else
+					showMsg(res.msg, 2);
+			}
 		});
-	}
-	getdataSource()
+		//保存数据
+		$('#add').on('click', function() {
+			var start_time = $('#startT').html();
+			var end_time = $('#endT').html();
+			device_id = $("#device_id").find("option:selected").val();
+			algorithm_id = $("#algorithm_id").find("option:selected").val();
+			experiment_name = $("#experiment_name").find("option:selected").val();
+			device_name = $('#device_name').val()
+			algorithm_name = $('#algorithm_name').val()
+			data_type = $('#data_type').val()
+			origin_data_path = $('#origin_data_path').val()
+			console.log(device_id,algorithm_id,experiment_name,device_name,algorithm_name,data_type,origin_data_path,start_time,end_time)
+			if (startT == undefined) {
+				layer.msg('请选择开始时间');
+			} else
+			if (endT == undefined) {
+				layer.msg('请选择结束时间')
+			}
+			const data = {
+				algorithm_id:algorithm_id,
+				algorithm_name:algorithm_name,
+				data_type:data_type,
+				device_id:device_id,
+				device_name:device_name,
+				end_time:end_time,
+				experiment_name:experiment_name,
+				id:0,
+				origin_data_path:origin_data_path,
+				process_data_path:'string',
+				source_id:0,
+				start_time:start_time
+				
+			}
+			fetchJSON('api/experiment/add', data, "post", function(data) {
+			                if (data.status === 0) {
+			                } else {
+
+			                }
+			            });
+		})
+	});
 });

+ 58 - 21
admin/welcome.html

@@ -40,14 +40,14 @@
 
 			.text {
 				width: 10px;
-				height: 375px;
+				height: 750px;
 				background-color: #ffffff;
 				display: inline-block;
 				float: left;
 			}
 
 			.win {
-				width: 100%;
+				width: 50%;
 				height: 10px;
 				background-color: #ffffff;
 				display: inline-block;
@@ -108,9 +108,33 @@
 	<body>
 		<div class="x-body layui-anim layui-anim-up">
 			<form class="layui-form">
-				<div class="box">
+				<div class="box" style="height: 700px;">
 					<h1 class="p">配置实验信息</h1>
 					<div class="layui-row" style="margin-top: 10%;">
+						<div class="layui-col-sm6">
+							<div class="layui-form-item">
+								<label for="device_id" class="layui-form-label">
+									元器件id
+								</label>
+								<div class="layui-input-inline">
+									<select name="device_id" id="device_id" lay-search="device_id"
+										lay-verify="required"> </select>
+								</div>
+							</div>
+						</div>
+						<div class="layui-col-sm6">
+							<div class="layui-form-item">
+								<label for="device_name" class="layui-form-label">
+									元器件名称
+								</label>
+								<div class="layui-input-inline">
+									<input type="text" id="device_name" name="device_name" autocomplete="off"
+										class="layui-input" disabled="disabled">
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="layui-row" style="margin-top:10%;">
 						<div class="layui-col-sm6">
 							<div class="layui-form-item">
 								<label for="experiment_name" class="layui-form-label">
@@ -118,7 +142,7 @@
 								</label>
 								<div class="layui-input-inline">
 									<select name="experiment_name" id="experiment_name" lay-search="experiment_name"
-										lay-verify="required"> </select>
+										lay-verify="required" > </select>
 								</div>
 							</div>
 						</div>
@@ -134,26 +158,26 @@
 							</div>
 						</div>
 					</div>
-					<div class="layui-row" style="margin-top: 7%;">
+					<div class="layui-row" style="margin-top: 10%;">
 						<div class="layui-col-sm6">
 							<div class="layui-form-item">
-								<label for="device_name" class="layui-form-label">
-									元器件名
+								<label for="algorithm_id" class="layui-form-label">
+									算法id
 								</label>
 								<div class="layui-input-inline">
-									<select name="device_name" id="device_name" lay-search="device_name"
+									<select name="algorithm_id" id="algorithm_id" lay-search="algorithm_id"
 										lay-verify="required"> </select>
 								</div>
 							</div>
 						</div>
 						<div class="layui-col-sm6">
 							<div class="layui-form-item">
-								<label for="source_name" class="layui-form-label">
-									数据源
+								<label for="algorithm_name" class="layui-form-label">
+									算法名称
 								</label>
 								<div class="layui-input-inline">
-									<select name="source_id" id="source_name" lay-search="data_type"
-										lay-verify="required"> </select>
+									<input type="text" id="algorithm_name" name="algorithm_name" autocomplete="off"
+										class="layui-input" disabled="disabled">
 								</div>
 							</div>
 						</div>
@@ -161,6 +185,7 @@
 
 				</div>
 				<div class="text"></div>
+				
 				<div class="box" style="text-align: center;">
 					<h1 class="p">实验时间</h1>
 					<div id="start_time"></div>
@@ -174,16 +199,28 @@
 					</div>
 				</div>
 				<div class="win"></div>
-				<div class="box">
-					<h1 class="p">数据源</h1>
-					<table id="datasource" class="layui-table" lay-filter="datasource" lay-data="{id:'datasource'}">
-					</table>
-				</div>
-				<div class="text"></div>
-				<div class="box" style="text-align: center;">
+				<div class="box" style="text-align: center;float: right;">
 					<h1 class="p">数据路径</h1>
-					<input type="text" id="process_data_path" name="process_data_path" autocomplete="off"
-						class="layui-input">
+					<div class="layui-row" style="margin-top: 30px;">
+						<div class="layui-col-sm12">
+						    <div class="layui-form-item">
+						        <label for="file" class="layui-form-label"></label>
+						        <div class="layui-input-inline" >
+						            <input type="file" name="file" id="file">
+						        </div>
+						    </div>
+						</div>
+						<div class="layui-col-sm12">
+							<div class="layui-form-item">
+								<label for="origin_data_path" class="layui-form-label"> 算法地址 </label>
+								<div class="layui-input-inline">
+									<input style="width: 500px;" type="text" id="origin_data_path" name="origin_data_path" required="" lay-verify="required" autocomplete="off"
+									 class="layui-input" disabled="disabled">
+								</div>
+							</div>
+						</div>
+						
+					</div>
 					<div class="layui-btn layui-btn-normal" id="add">保存实验数据</div>
 				</div>
 			</form>