storage.html 4.78 KB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="../../css/frame.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        #storageForm {
            padding: 8px;
        }

         .tdTitle {
             width: 120px;
         }
    </style>
</head>
<body>
    <form id="storageForm">
        <table class="settingsContainer">
            <tr>
                <td class="tdTitle">结果存储路径</td>
                <td class="tdContent">
                    <input type="text" name="980" id="980" class="settingParameter"/>
                </td>
                <td class="tdContent">
                    <a href="#" name="checkBtn" class="settingBtn" id="btnCheckResultPath">选择</a>
                </td>
            </tr>
<!--             <tr> -->
<!--                 <td class="tdTitle">录像存储路径</td> -->
<!--                 <td class="tdContent"> -->
<!--                     <input type="text" name="981" id="981" class="settingParameter"/>  -->
<!--                 </td> -->
<!--                 <td class="tdContent"> -->
<!--                     <a href="#" name="checkBtn" class="settingBtn" id="btnCheckVideoPath">选择</a> -->
<!--                 </td> -->
<!--             </tr> -->
<!--             <tr> -->
<!--                 <td class="tdTitle">短时录像存储路径</td> -->
<!--                 <td class="tdContent"> -->
<!--                     <input type="text" name="982" id="982" class="settingParameter"/> -->
<!--                 </td> -->
<!--                 <td class="tdContent"> -->
<!--                     <a href="#" name="checkBtn" class="settingBtn" id="btnCheckShortVideoPath">选择</a> -->
<!--                 </td> -->
<!--             </tr> -->
<!--             <tr> -->
<!--                 <td class="tdTitle">Log存储路径</td> -->
<!--                 <td class="tdContent"> -->
<!--                     <input type="text" name="983" id="983" class="settingParameter"/> -->
<!--                 </td> -->
<!--                 <td class="tdContent"> -->
<!--                     <a href="#" name="checkBtn" class="settingBtn" id="btnCheckLogPath">选择</a> -->
<!--                 </td> -->
<!--             </tr> -->
<!--             <tr> -->
<!--                 <td colspan="2"> -->
<!--                     <a href="#" class="settingBtn checkbtn" id="btnSave">保存</a> -->
<!--                 </td> -->
<!--             </tr> -->
        </table>
    </form>
	<object id="infoOcxObj" classid="clsid:09614DB3-38D7-4C11-8C02-4D1BA8675153" style="height:0;width:0;"></object>
    <script src="../../scripts/easyui/jquery.min.js"></script>
    <script src="../../scripts/easyui/jquery.easyui.min.js"></script>
    <script src="../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../scripts/utilities.js"></script>
    <script type="text/javascript">
        var parameterAdaptor = new ParameterAdaptor();
		var defaultresultpath = "C:\\temp\\S2_savedPic";
        $().ready(function() {
            //loadStorageInfo();
            $("#btnSave").click(saveParametersToServer);
            
            initPath();
            btnBindClick();
            
        });
        
        function initPath(){
        	$("#980").val(infoOcxObj.GetRootPath()?infoOcxObj.GetRootPath():defaultresultpath);
        }
        
        function btnBindClick(){
        	$(".tdContent").bind("click",function(event){
           		if(event.target.name == "checkBtn"){
           			switch(event.target.id){
           				case "btnCheckResultPath":
           					var result = infoOcxObj.SetRootPath("");
           		            if (!result) {
           		                $.messager.alert("错误", "设置图片保存路径出错!", "error");
           		            }else{
           		            	$("#980").val(infoOcxObj.GetRootPath());
           		            }
           					break;
           				case "btnCheckVideoPath":
           					break;
           				case "btnCheckShortVideoPath":
           					break;
           				case "btnCheckLogPath":
           					break;
           				default:
           					break;
           			}
           		}
            });
        }

        //加载存储设置
        function loadStorageInfo() {
            var keys = ["980", "981", "982", "983"];

            parameterAdaptor.getParameters(keys, function(data) {
                $("#storageForm").form("load", data);
            });
        }

        function saveParametersToServer() {
            var formObj = $("#storageForm");

            parameterAdaptor.saveParameters(formObj);
        }
    </script>
</body>
</html>