2024.9.19(周四)

主任测试连接hadoop,以下是我完成增的部分的核心代码

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>技术需求征集填报</title>
  <style>
    body {
      font-family: Arial, sans-serif;
      margin: 20px;
      padding: 20px;
      border: 1px solid #ccc;
      border-radius: 5px;
      background-color: #f9f9f9;
    }
    h2 {
      color: #333;
    }
    label {
      display: block;
      margin: 10px 0 5px;
    }
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
      width: 100%;
      padding: 8px;
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 4px;
    }
    input[type="radio"],
    input[type="checkbox"] {
      margin-right: 10px;
    }
    .section {
      margin-bottom: 20px;
    }
    .button-container {
      display: flex;
      justify-content: space-between;
    }
  </style>
</head>
<body>
<h2>河北省重大技术需求征集</h2>
<form action="submit.jsp" method="post">
  <div class="section">
    <label for="institutionName">机构全称:</label>
    <input type="text" id="institutionName" name="institutionName" required>

    <label for="department">归口管理部门:</label>
    <input type="text" id="department" name="department">

    <label for="address">通讯地址:</label>
    <input type="text" id="address" name="address" required>

    <label for="region">所在地域:</label>
    <input type="text" id="region" name="region" required>

    <label for="email">电子信箱:</label>
    <input type="email" id="email" name="email" required>

    <label for="representative">法人代表:</label>
    <input type="text" id="representative" name="representative">

    <label for="postalCode">邮政编码:</label>
    <input type="text" id="postalCode" name="postalCode">

    <label for="contactPerson">联系人:</label>
    <input type="text" id="contactPerson" name="contactPerson">

    <label for="phoneFixed">电话 (固定):</label>
    <input type="tel" id="phoneFixed" name="phoneFixed">

    <label for="phoneMobile">电话 (手机):</label>
    <input type="tel" id="phoneMobile" name="phoneMobile">

    <label for="fax">传真:</label>
    <input type="tel" id="fax" name="fax">
  </div>

  <div class="section">
    <label>机构属性:</label>
    <input type="radio" id="enterprise" name="institutionType" value="企业">企业
    <input type="radio" id="college" name="institutionType" value="高等院校">高等院校
    <input type="radio" id="research" name="institutionType" value="研究机构">研究机构
    <input type="radio" id="other" name="institutionType" value="其他">其他
  </div>

  <div class="section">
    <label for="introduction">机构简介:</label>
    <textarea id="introduction" name="introduction" rows="4" cols="50"></textarea>

    <label for="techNeedName">技术需求名称:</label>
    <input type="text" id="techNeedName" name="techNeedName" required>

    <label for="deadline">需求时限:</label>
    <input type="text" id="deadline" name="deadline">

    <label for="techOverview">技术需求概述:</label>
    <textarea id="techOverview" name="techOverview" rows="4" cols="50"></textarea>

    <label for="mainProblem">主要问题:</label>
    <textarea id="mainProblem" name="mainProblem" rows="4" cols="50"></textarea>

    <label for="techKey">技术关键:</label>
    <textarea id="techKey" name="techKey" rows="4" cols="50"></textarea>

    <label for="expectedGoal">预期目标:</label>
    <textarea id="expectedGoal" name="expectedGoal" rows="4" cols="50"></textarea>

    <label for="keywords">关键字:</label>
    <input type="text" id="keywords" name="keywords">

    <label for="investment">拟投入资金总额 (万元):</label>
    <input type="number" id="investment" name="investment" step="0.01">
  </div>

  <div class="section">
    <label>技术需求解决方式:</label>
    <input type="radio" id="independent" name="solutionMethod" value="独立研发">独立研发
    <input type="radio" id="commission" name="solutionMethod" value="委托研发">委托研发
    <input type="radio" id="cooperation" name="solutionMethod" value="合作研发">合作研发
    <input type="radio" id="otherMethod" name="solutionMethod" value="其他">其他
  </div>

  <div class="section">
    <label for="cooperationIntent">合作意向单位:</label>
    <input type="text" id="cooperationIntent" name="cooperationIntent">
  </div>

  <div class="section">
    <label>科技活动类型:</label>
    <input type="radio" id="basicResearch" name="techActivityType" value="基础研究">基础研究
    <input type="radio" id="appliedResearch" name="techActivityType" value="应用研究">应用研究
    <input type="radio" id="experimentDevelopment" name="techActivityType" value="试验发展">试验发展
    <input type="radio" id="resultApplication" name="techActivityType" value="研究与试验发展成果应用">研究与试验发展成果应用
    <input type="radio" id="techPromotion" name="techActivityType" value="技术推广与科技服务">技术推广与科技服务
    <input type="radio" id="productiveActivity" name="techActivityType" value="生产性活动">生产性活动
  </div>

  <div class="section">
    <%--@declare id="discipline"--%><label for="discipline">学科分类:</label>
    <select id="firstDiscipline" name="firstDiscipline" onchange="loadSecondLevel1(this.value, 'secondDiscipline', 'disciplineValue')">
      <option value="">请选择第一级</option>
      <option value="science">理科</option>
      <option value="engineering">工科</option>
      <!-- 其他第一级分类 -->
    </select>

    <select id="secondDiscipline" name="secondDiscipline" onchange="loadThirdLevel1(this.value, 'thirdDiscipline', 'disciplineValue')">
      <option value="">请选择第二级</option>
    </select>

    <select id="thirdDiscipline" name="thirdDiscipline">
      <option value="">请选择第三级</option>
    </select>

    <input type="hidden" id="disciplineValue" name="disciplineValue">
  </div>

  <div class="section">
    <label>需求技术所属领域:</label>
    <input type="checkbox" id="electronic" name="techField" value="电子信息">电子信息
    <input type="checkbox" id="mechatronics" name="techField" value="光机电一体化">光机电一体化
    <input type="checkbox" id="biotech" name="techField" value="生物技术与制药">生物技术与制药
    <!-- 这里可以添加其他领域的复选框 -->
  </div>

  <div class="section">
    <label>需求技术应用行业:</label>
    <select id="firstIndustry" name="firstIndustry" onchange="loadSecondLevel(this.value, 'secondIndustry', 'industryValue')">
      <option value="">请选择第一级</option>
      <option value="manufacturing">制造业</option>
      <option value="service">服务业</option>
      <!-- 其他第一级分类 -->
    </select>

    <select id="secondIndustry" name="secondIndustry" onchange="loadThirdLevel(this.value, 'thirdIndustry', 'industryValue')">
      <option value="">请选择第二级</option>
    </select>

    <select id="thirdIndustry" name="thirdIndustry">
      <option value="">请选择第三级</option>
    </select>

    <input type="hidden" id="industryValue" name="industryValue">
  </div>

  <div class="button-container">
    <a href="result.jsp">跳转1</a>
    <a href="search.jsp">跳转2</a>
    <input type="submit" value="提交">
  </div>
</form>
<script>
  function loadSecondLevel1(firstLevelValue, secondLevelId, hiddenInputId) {
    var secondLevelSelect = document.getElementById(secondLevelId);
    secondLevelSelect.innerHTML = ''; // 清除现有选项
    var defaultOption = document.createElement("option");
    defaultOption.value = "";
    defaultOption.text = "请选择第二级";
    secondLevelSelect.appendChild(defaultOption);

    // 根据firstLevelValue设置第二级选项
    if(firstLevelValue === "science") {
      var option1 = document.createElement("option");
      option1.value = "mathematics";
      option1.text = "数学";
      secondLevelSelect.appendChild(option1);
    } else if(firstLevelValue === "engineering") {
      var option2 = document.createElement("option");
      option2.value = "civil_engineering";
      option2.text = "土木工程";
      secondLevelSelect.appendChild(option2);
    }
  }

  function loadThirdLevel1(secondLevelValue, thirdLevelId, hiddenInputId) {
    var thirdLevelSelect = document.getElementById(thirdLevelId);
    thirdLevelSelect.innerHTML = ''; // 清除现有选项
    var defaultOption = document.createElement("option");
    defaultOption.value = "";
    defaultOption.text = "请选择第三级";
    thirdLevelSelect.appendChild(defaultOption);

    // 根据secondLevelValue设置第三级选项
    if(secondLevelValue === "mathematics") {
      var option1 = document.createElement("option");
      option1.value = "applied_mathematics";
      option1.text = "应用数学";
      thirdLevelSelect.appendChild(option1);
    } else if(secondLevelValue === "civil_engineering") {
      var option2 = document.createElement("option");
      option2.value = "structural_engineering";
      option2.text = "结构工程";
      thirdLevelSelect.appendChild(option2);
    }
  }

  // 当第三级下拉框选项变化时,更新隐藏输入框的值
  document.getElementById('thirdDiscipline').addEventListener('change', function() {
    var hiddenInput = document.getElementById('disciplineValue');
    hiddenInput.value = document.getElementById('firstDiscipline').value + ' > ' +
            document.getElementById('secondDiscipline').value + ' > ' +
            this.value;
  });
  // 加载第二级分类的函数
  function loadSecondLevel(firstLevelValue, secondLevelId, hiddenInputId) {
    var secondLevelSelect = document.getElementById(secondLevelId);
    secondLevelSelect.innerHTML = ''; // 清除现有选项
    var defaultOption = document.createElement("option");
    defaultOption.value = "";
    defaultOption.text = "请选择第二级";
    secondLevelSelect.appendChild(defaultOption);

    // 根据firstLevelValue设置第二级选项
    switch(firstLevelValue) {
      case "manufacturing":
        var option1 = document.createElement("option");
        option1.value = "heavy_industry";
        option1.text = "重工业";
        secondLevelSelect.appendChild(option1);

        var option2 = document.createElement("option");
        option2.value = "light_industry";
        option2.text = "轻工业";
        secondLevelSelect.appendChild(option2);
        break;
      case "service":
        var option3 = document.createElement("option");
        option3.value = "finance";
        option3.text = "金融业";
        secondLevelSelect.appendChild(option3);

        var option4 = document.createElement("option");
        option4.value = "education";
        option4.text = "教育业";
        secondLevelSelect.appendChild(option4);
        break;
    }
  }

  function loadThirdLevel(secondLevelValue, thirdLevelId, hiddenInputId) {
    var thirdLevelSelect = document.getElementById(thirdLevelId);
    thirdLevelSelect.innerHTML = ''; // 清除现有选项
    var defaultOption = document.createElement("option");
    defaultOption.value = "";
    defaultOption.text = "请选择第三级";
    thirdLevelSelect.appendChild(defaultOption);

    // 根据secondLevelValue设置第三级选项
    switch(secondLevelValue) {
      case "heavy_industry":
        var option1 = document.createElement("option");
        option1.value = "steel";
        option1.text = "钢铁行业";
        thirdLevelSelect.appendChild(option1);

        var option2 = document.createElement("option");
        option2.value = "machinery";
        option2.text = "机械行业";
        thirdLevelSelect.appendChild(option2);
        break;
      case "light_industry":
        var option3 = document.createElement("option");
        option3.value = "food";
        option3.text = "食品行业";
        thirdLevelSelect.appendChild(option3);

        var option4 = document.createElement("option");
        option4.value = "textile";
        option4.text = "纺织行业";
        thirdLevelSelect.appendChild(option4);
        break;
      case "finance":
        var option5 = document.createElement("option");
        option5.value = "banking";
        option5.text = "银行";
        thirdLevelSelect.appendChild(option5);

        var option6 = document.createElement("option");
        option6.value = "insurance";
        option6.text = "保险";
        thirdLevelSelect.appendChild(option6);
        break;
      case "education":
        var option7 = document.createElement("option");
        option7.value = "primary";
        option7.text = "基础教育";
        thirdLevelSelect.appendChild(option7);

        var option8 = document.createElement("option");
        option8.value = "higher";
        option8.text = "高等教育";
        thirdLevelSelect.appendChild(option8);
        break;
    }
  }

  // 当第三级下拉框选项变化时,更新隐藏输入框的值
  document.getElementById('thirdIndustry').addEventListener('change', function() {
    var hiddenInput = document.getElementById('industryValue');
    hiddenInput.value = document.getElementById('firstIndustry').value + ' > ' +
            document.getElementById('secondIndustry').value + ' > ' +
            this.value;
  });
</script>
</body>
</html>

 

posted @ 2024-09-22 23:55  记得关月亮  阅读(1)  评论(0编辑  收藏  举报