whois.handle: AL-3
whois.name: Alibaba Cloud LLC
whois.cidrs: 47.235.0.0/16 47.236.0.0/14 47.240.0.0/14 47.244.0.0/15 47.246.0.0/16
whois.created: 2016-04-15T00:00:00.000000
whois.updated: 2017-04-26T00:00:00.000000
whois.allocation_type: ALLOCATION
whois.handle: AL-3
whois.name: Alibaba Cloud LLC
whois.street: 400 S El Camino Real, Suite 400
whois.city: San Mateo
whois.state: CA
whois.postal_code: 94402
whois.country: US
whois.handle: NETWO4028-ARIN
whois.name: Network Abuse
whois.email: abuse@alibaba-inc.com
whois.handle: ALIBA-ARIN
whois.name: Alibaba NOC
whois.email: abuse@alibaba-inc.com
whois.handle: ALIBA-ARIN
whois.name: Alibaba NOC
whois.email: abuse@alibaba-inc.com
services.protocol: SSH
services.transport_protocol: TCP
services.scan_time: 2025-07-28T09:10:24.503308
services.banner: SSH-2.0-OpenSSH_7.4
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: OpenBSD
services.product: OpenSSH
services.version: 7.4
services.cpe: cpe:2.3:a:openbsd:openssh:7.4:*:*:*:*:*:*:*
services.source: OSI_TRANSPORT_LAYER
services.part: o
services.product: linux
services.cpe: cpe:2.3:o:*:linux:*:*:*:*:*:*:*:*
services.value: remote-access
services.raw: SSH-2.0-OpenSSH_7.4
services.protocol_version: 2.0
services.software_version: OpenSSH_7.4
services.kex_algorithms: curve25519-sha256 curve25519-sha256@libssh.org ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 diffie-hellman-group-exchange-sha256 diffie-hellman-group16-sha512 diffie-hellman-group18-sha512 diffie-hellman-group-exchange-sha1 diffie-hellman-group14-sha256 diffie-hellman-group14-sha1 diffie-hellman-group1-sha1
services.host_key_algorithms: ssh-rsa rsa-sha2-512 rsa-sha2-256 ecdsa-sha2-nistp256 ssh-ed25519
services.client_to_server_ciphers: chacha20-poly1305@openssh.com aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com aes128-cbc aes192-cbc aes256-cbc blowfish-cbc cast128-cbc 3des-cbc
services.server_to_client_ciphers: chacha20-poly1305@openssh.com aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com aes128-cbc aes192-cbc aes256-cbc blowfish-cbc cast128-cbc 3des-cbc
services.client_to_server_macs: umac-64-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com hmac-sha1-etm@openssh.com umac-64@openssh.com umac-128@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha1
services.server_to_client_macs: umac-64-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com hmac-sha1-etm@openssh.com umac-64@openssh.com umac-128@openssh.com hmac-sha2-256 hmac-sha2-512 hmac-sha1
services.client_to_server_compression: none zlib@openssh.com
services.server_to_client_compression: none zlib@openssh.com
services.kex_algorithm: curve25519-sha256@libssh.org
services.host_key_algorithm: ecdsa-sha2-nistp256
services.cipher: aes128-ctr
services.mac: hmac-sha2-256
services.compression: none
services.cipher: aes128-ctr
services.mac: hmac-sha2-256
services.compression: none
services.curve: P-256
services.hassh_fingerprint: 6832f1ce43d4397c2c0a3e2f8c94334e
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-28T07:21:15.656197
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 1072
  Last-Modified: Sun, 19 Jan 2025 06:58:11 GMT
  Connection: keep-alive
  ETag: "678ca283-430"
  Accept-Ranges: bytes
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-28T07:21:15.656197
services.uri: http://47.236.191.52/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Sun, 19 Jan 2025 06:58:11 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "678ca283-430"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 1072
services.html_tags: <title>欢迎来到 AI 编程网站</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
services.body: <!DOCTYPE html>
  <html lang="zh">
  <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>欢迎来到 AI 编程网站</title>
      <style>
          body {
              font-family: Arial, sans-serif;
              background-color: #f4f4f4;
              color: #333;
              text-align: center;
              padding: 50px;
          }
          h1 {
              font-size: 2.5em;
              margin-bottom: 20px;
          }
          p {
              font-size: 1.2em;
              margin-bottom: 30px;
          }
          a {
              text-decoration: none;
              color: #fff;
              background-color: #007bff;
              padding: 10px 20px;
              border-radius: 5px;
              transition: background-color 0.3s;
          }
          a:hover {
              background-color: #0056b3;
          }
      </style>
  </head>
  <body>
      <h1>欢迎来到 AI 编程网站</h1>
      <p>希望你能够通过学习这节课的内容，建一个自己的网站</p>
  </body>
  </html>
services.body_hash_sha1: sha1:91e709c392531d39e95ac185d3e60a4d83d47dc0
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T21:49:36.543306
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 7679
  Last-Modified: Sun, 28 Jul 2024 05:18:00 GMT
  Connection: keep-alive
  ETag: "66a5d488-1dff"
  Accept-Ranges: bytes
  
services.version_selected: TLSv1_2
services.cipher_selected: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
services.ja4s: t120300_cca8_bec8bdbaef8a
services.version: TLSv1_2
services.ja4s: t120300_cca8_bec8bdbaef8a
services.version: TLSv1_1
services.ja4s: t110200_c013_344b4dce5a52
services.version: TLSv1_0
services.ja4s: t100200_c013_344b4dce5a52
services.issuer_dn: C=CN, ST=gd, L=shenzhen, O=yc, OU=yc, CN=yc, emailAddress=steve_pann@outlook.com
services.common_name: yc
services.country: CN
services.locality: shenzhen
services.province: gd
services.organization: yc
services.organizational_unit: yc
services.email_address: steve_pann@outlook.com
services.subject_dn: C=CN, ST=gd, L=shenzhen, O=yc, OU=yc, CN=yc, emailAddress=steve_pann@outlook.com
services.common_name: yc
services.country: CN
services.locality: shenzhen
services.province: gd
services.organization: yc
services.organizational_unit: yc
services.email_address: steve_pann@outlook.com
services.scan_time: 2025-07-20T01:00:46.050510
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.value: bootstrap
services.value: jquery
services.value: modernizr
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T21:49:36.543306
services.uri: https://47.236.191.52/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Sun, 28 Jul 2024 05:18:00 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "66a5d488-1dff"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 7679
services.html_tags: <title>AI电力助手</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1">
services.body: <!DOCTYPE html>
  <html class="no-js" lang="">
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="x-ua-compatible" content="ie=edge">
      <title>AI电力助手</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <style>
          /*#ehelper-input { font-family: "宋体"; font-size: 20px; color: #0000FF; font-weight: bold; }*/
          #ehelper-input { font-size: 18px; color: #0000FF; font-weight: bold; }
          #ehelper-response { font-size: 18px; color: #0000FF; font-weight: bold; }
      </style>
      <!-- favicon icon -->
      <link rel="icon" href="img/favicon.png">
      <!-- All CSS Files Here -->
      <link rel="stylesheet" href="css/bootstrap.min.css">
      <link rel="stylesheet" href="css/et-line-fonts.css">
      <link rel="stylesheet" href="css/ionicons.min.css">
      <link rel="stylesheet" href="css/magnific-popup.css">
      <link rel="stylesheet" href="css/meanmenu.css">
      <link rel="stylesheet" href="css/global.css">
      <link rel="stylesheet" href="style.css">
      <link rel="stylesheet" href="css/responsive.css">
      <script src="js/modernizr-2.8.3.min.js"></script>
    </head>
    <body>
      <div class="page-loader">
        <div class="loader">Loading...</div></div>
      <header id="sticky-header" class="">
        <div class="header-area">
          <div class="container sm-100">
            <div class="row">
              <div class="col-md-3 col-sm-3">
                <div class="logo text-upper">
                  <h4>
                    <a href="index.html">AI电力助手</a></h4>
                </div>
              </div>
            </div>
          </div>
        </div>
      </header>
      <div class="basic-portfolio-area ptb-10">
        <div class="gray-bg text-center">
  
        </div>
        <div class="call-to-action-area gray-bg ptb-10">
          <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-3 col-xs-3">
                    <div class="col-12">
                        <img src="img/portrait.jpg" class="ptb-10">
                    </div>
                    <br><br>
  
                    <div class="col-12 text-center">
                      <button id="audioInteractModeBtn"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #666; color: #f4f4f4; border-radius: 10px;">
                        <span id="audioInteractModeBtnText" class="spinner-border spinner-border-sm" role="status" aria-hidden="true">进入演示模式</span></button>
                    </div>
                      <br><br>
                     <div class="col-12 filter-menu">
                        <span id="interactModeText" class="color:#f4f4f4" role="status" aria-hidden="true">
                            进入演示模式后，您可以这样提问：<br>
                              1.请先说：【小电小电】，唤醒AI助手。<br>
                              2.等待AI助手回复后，再说出您的问题。<br>
                              3.想让AI助手停止语音播报，请说：【停止】。<br>
                              4.要退出演示模式，请说：【退出】，或点击上方【退出演示模式按钮】。<br>
                        </span>
                    </div>
                </div>
              <div class="col-md-9 col-sm-9 col-xs-9">
                  <div class="col-12">
                    <div class="form-group">
                      <!--<label></label>-->
                      <textarea class="form-control" id="ehelper-input" placeholder="" rows="3" resize="none" style="width: 100%; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 12px;"></textarea>
                    </div>
                  </div>
                  <div class="col-12">
                      <div class="call-to-action">
                          <div class="col-3">
                              <button id="recordButton" onclick="recordAudio()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;">
                                  <span id="recordButtonText" class="spinner-border spinner-border-sm" role="status" aria-hidden="true">语音提问</span></button>
                              <img id="volume-gif" style="width:40px;height:40px;display:none;" src="./img/volume.gif" alt="Volume Indicator" />
                              <span>  </span>
                              <img id="stop-play-voice" style="width:30px;height:30px;display:none;" src="./img/stop-play.jpg" alt="停止播放" />
                              <!--<button id="stop-play-voice" onclick="stopPlayVoice()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;display: none;">停止播放</button>-->
                          </div>
                          <div class="col-3">
                          <button id="callEhelperButton" onclick="callEhelper()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;">
                              <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true">文字提问</span></button>
                          </div>
                          <br><br>
                      </div>
                  </div>
                  <div class="col-12">
                      <div class="form-group">
                        <label></label>
                        <textarea class="form-control" id="ehelper-response" placeholder="" rows="16" resize="none" style="width: 100%;height: auto; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 10px; overflow: scroll;" readonly="true"></textarea>
  <!--                        <div id="markdown-response"></div>-->
                      </div>
                      <audio id="audioPlayer" controls style="display:none"></audio>
                  </div>
              </div>
            </div>
          </div>
          <footer>
              <div class="basic-footer gray-bg text-center ptb-10">
                  <div class="container">
                      <div class="footer-logo mb-30">
                          <h6>内容由AI大模型生成</h6>
                      </div>
                  </div>
              </div>
          </footer>
  
          <script src="js/jquery-1.12.0.min.js"></script>
          <script src="js/bootstrap.min.js"></script>
          <script src="js/isotope.pkgd.min.js"></script>
          <script src="js/imagesloaded.pkgd.min.js"></script>
          <script src="js/jquery.magnific-popup.min.js"></script>
          <script src="js/jquery.meanmenu.js"></script>
          <script src="js/plugins.js"></script>
          <script src="js/main.js"></script>
          <script src="js/ehelper.js"></script>
          <script src="js/audiorecorder.js"></script>
  <!--        <script src="js/marked.min.js"></script>-->
          
          <script>
            // 输入文本框自适应调整高度
            var input_textarea = document.getElementById('ehelper-input')
            input_textarea.addEventListener('input', (e) => {
              input_textarea.style.height = '76px';
              input_textarea.style.height = e.target.scrollHeight + 'px';
            });
            // document.getElementById('ehelper-response').addEventListener('input', function() {
            //     console.log("marked:" + this.value);
            //     document.getElementById('ehelper-response').innerHTML = marked(this.value);
            // });
          </script>
  
  </div></div><a id="scrollUp" href="index.html#top" style="position: fixed; z-index: 2147483647; display: none;"><i class="ion-chevron-up"></i></a></body></html>
  
services.name: https://47.236.191.52/img/favicon.png
services.body_hash_sha1: sha1:68a8e0e4329acb7eb487e08f0e5e54af74b5d727
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T18:57:23.434277
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 7649
  Last-Modified: Mon, 18 Nov 2024 16:21:39 GMT
  Connection: keep-alive
  ETag: "673b6993-1de1"
  Accept-Ranges: bytes
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.value: google-analytics
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T18:57:23.434277
services.uri: http://47.236.191.52:7070/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Mon, 18 Nov 2024 16:21:39 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "673b6993-1de1"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 7649
services.html_tags: <title>
  			Main | Grand&Teens
  		</title> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="description" content="Grand&Teens">
services.body: <!doctype html>
  <html lang="en-US">
  	<head>
  		<title>
  			Main | Grand&Teens
  		</title>
  		<meta charset="utf-8">
  		<meta http-equiv="x-ua-compatible" content="ie=edge">
  		<meta name="viewport" content="width=device-width,initial-scale=1">
  		<meta name="description" content="Grand&Teens">
  		<script src="./static/js/accordion.js" defer="defer"></script>
  		<script src="./static/js/header-mobile.js" defer="defer"></script>
  		<script src="./static/js/main.js" defer="defer"></script>
  		<script src="./static/js/newsletter-subscribe.js" defer="defer"></script>
  		<script src="./static/js/sponsorship.js" defer="defer"></script>
  		<link rel="stylesheet" href="styles.css">
  		<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  		<link rel="preload" as="style" href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300;700&family=Open+Sans:wght@300;400;600;700;800&display=swap">
  		<link rel="stylesheet" media="print" onload="this.onload=null;this.removeAttribute('media');"
  		href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300;700&family=Open+Sans:wght@300;400;600;700;800&display=swap">
  		<noscript>
  			<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300;700&family=Open+Sans:wght@300;400;600;700;800&display=swap"></noscript>
  		<link rel="icon" type="image/png" href="./static/images/favicon.png">
  		<script defer="defer" src="https://www.googletagmanager.com/gtag/js?id=UA-119780408-1"></script>
  	</head>
  	<body class="">
  		<header id="header-mobile" class="mobile-only" style="top: 0px;">
  			<nav aria-label="Primary navigation">
  				<button id="hamburger-menu">
  					<img src="./static/images/hamburger-menu.svg" alt="" aria-hidden="true"
  					focusable="false">
  					<span class="visually-hidden">
  						Menu
  					</span>
  				</button>
  				<a href="/">
  					<img src="./static/images/logo-mobile.svg" alt="Home" focusable="false"></a>
  				<!-- <a href="https://www.mit.edu/">
  					<img src="./static/images/logo-mit.svg" alt="Massachusetts Institute of Technology"
  					focusable="false">
  				</a> -->
  			</nav>
  			<nav aria-label="Navigate by topic">
  				<ul id="main-nav-list">
  					<li id="mobile-nav-cta">
  						<a href="/main-page/grandteens.html" class="button-main wide-mode">
  							Grand&Teens
  						</a>
  						<a href="/main-page/aboutus.html#contact" class="button-main-hollow wide-mode">
  							Contact
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/aboutus.html">
  							About us
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/lifestories.html">
  							Life Stories
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/techforelders.html">
  							Tech for Elders
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/sketching.html">
  							Sketching
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/forum.html">
  							Forum
  						</a>
  					</li>
  					<li>
  						<a class="thematic-section-link" href="/main-page/aboutus.html#donate">
  							Donate
  						</a>
  					</li>
  				</ul>
  			</nav>
  		</header>
  		<nav id="bottom-nav-list" class="mobile-only" aria-label="Grand&Teens">
  			<ul>
  				<li>
  					<a href="/main-page/grandteens.html">
  						Grand&Teens
  					</a>
  				</li>
  				<li>
  					<a href="/main-page/aboutus.html">
  						About us
  					</a>
  				</li>
  				<li>
  					<a href="/main-page/lifestories.html">
  						Life Stories
  					</a>
  				</li>
  				<li>
  					<a href="/main-page/techforelders.html">
  						Tech for Elders
  					</a>
  				</li>
  			</ul>
  		</nav>
  		<a href="#main-content" id="skip-link">
  			Skip to main content
  		</a>
  		
  		<div>
  			
  			<header id="header-desktop" class="desktop-only" aria-hidden="false">
  				<nav aria-label="Page menu" data-thematic="">
  					<ul>
  						<li>
  							<a href="/main-page/grandteens.html" class="active" style="white-space: nowrap;">
  								Grand&Teens
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/aboutus.html" class="">
  								About us
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/lifestories.html" class="">
  								Life Stories
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/techforelders.html" class="">
  								Tech for Elders
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/sketching.html" class="">
  								Sketching
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/forum.html" class="">
  								Forum
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/aboutus.html#contact" class="button-main-hollow">
  								Contact
  							</a>
  						</li>
  						<li>
  							<a href="/main-page/aboutus.html#donate" class="button-main-hollow">
  								Donate
  							</a>
  						</li>
  					</ul>
  				</nav>
  			</header>
  			<main id="main-content" class="sponsorship">
  				<!-- <h1>
  					Our Goal
  				</h1> -->
  				<div class="card banner">
  					<div class="card-image-container" style="position: relative; padding: 0; margin: 0;">
  						<img class="card-image" src="./static/uploads/scene1.jpg">
  						<div style="position: absolute; top: 0; left: 0; width: calc(100%); height: calc(100%); background: rgba(58,58,58,0.48); display: flex; align-items: center; justify-content: center; text-align: center; color: white; padding: 20px;">
  							Building a bridge between generations to connect the elderly and the young<br>
  							Creating a space where life wisdom and fresh perspectives come together
  						</div>
  					</div>
  					<!-- <div>
  						<p>
  							Organizations can connect with the AgeLab through three different types
  							of working relationships: Member, Consortia, and Partner.
  						</p>
  					</div> -->
  				</div>
  				<section id="introduction">
  					<h2>
  						Introduction
  					</h2>
  					<p class="section-sub-headline">
  						<b>Welcome to Grand & Teen</b> - an innovative platform designed to bridge the gap between generations. Our mission is to create meaningful connections between the elderly and teenagers, fostering a space where life wisdom meets youthful energy.<br><br>
  
  						This idea grew from my volunteer experience. Each time I visited a nursing home, I learned invaluable insights from the elderly. They guided me as if I were one of their own, and I, in turn, shared with them the latest in smartphone technology and exciting AI developments. They became like grandparents to me, and our conversations brought joy and inspiration to all of us.<br><br>
  
  						Now, I want to expand these interactions, giving more elderly and young people the chance to experience this joy and gain valuable insights. Our mission is to:<br>
  						• Build a bridge connecting generations<br>
  						• Spark a community where life wisdom and fresh perspectives come together<br><br>
  
  						We invite you to be a part of this mission:<br>
  						• <b>As an individual</b>, register on our platform, join discussions, and participate in activities.<br>
  						• <b>As an organization</b>, sign up to organize local events and bring this vision to your community.<br><br>
  
  						We believe open conversations, shared stories, and community activities can empower both generations. <br><br>
  
  						<b>Join us today</b> at Grand & Teen to connect, learn, and inspire.<br><br>
  					</p>
  				</section>
  			</main>
  			<!-- <footer>
  			</footer> -->
  		</div>
  	</body>
  
  </html>
services.name: http://47.236.191.52:7070/./static/images/favicon.png
services.body_hash_sha1: sha1:dc46e821f512c5ab4406ee875b64f25dec1ba1b3
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T13:52:31.281250
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 88729
  Last-Modified: Sat, 04 Jan 2025 11:14:39 GMT
  Connection: keep-alive
  ETag: "6779181f-15a99"
  Accept-Ranges: bytes
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T13:52:31.281250
services.uri: http://47.236.191.52:8001/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Sat, 04 Jan 2025 11:14:39 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "6779181f-15a99"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 88729
services.html_tags: <title>OMEGA | MIT AgeLab</title> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="description" content="OMEGA"> <meta property="og:title" content="OMEGA | MIT AgeLab"> <meta property="og:type" content="website"> <meta property="og:description" content="OMEGA"> <meta name="twitter:image" content="http://localhost:8000/static/uploads/scene1.jpg"> <meta property="og:image" content="http://localhost:8000/static/uploads/scene1.jpg">
services.body: <!doctype html>
  <html lang="en-US">
  <head>
      <title>OMEGA | MIT AgeLab</title>
      <meta charset="utf-8">
      <meta http-equiv="x-ua-compatible" content="ie=edge">
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <meta name="description" content="OMEGA">
      <meta property="og:title" content="OMEGA | MIT AgeLab">
      <meta property="og:type" content="website">
      <meta property="og:description" content="OMEGA">
      <meta name="twitter:image" content="http://localhost:8000/static/uploads/scene1.jpg">
      <meta property="og:image" content="http://localhost:8000/static/uploads/scene1.jpg">
      <script src="/static/js/accordion.js" defer="defer"></script>
      <script src="/static/js/header-mobile.js" defer="defer"></script>
      <script src="/static/js/main.js" defer="defer"></script>
      <script src="/static/js/newsletter-subscribe.js" defer="defer"></script>
      <style>
          :root {
              --main-color: #E4002B;
              --main-color-: #B00021;
              --main-color--: #FFE4E9;
              --contrast-color: #FFFFFF;
              --contrast-color-: #F9F9F9;
              --contrast-color--: #ADAEAF;
              --contrast-color---: #D8D8D8;
              --contrast-color----: #ECECEC;
              --opposite-color: #535353;
              --opposite-color-: #53565A;
              --opposite-color--: #202020;
              --opposite-color---: #000000;
              --opposite-color----: #333436;
              --opposite-color-----: #595959;
              --thematic-color-caregiving: #537C78;
              --thematic-color-caregiving-: #E6F0EF;
              --thematic-color-home: #7BA591;
              --thematic-color-home-: #E1F1EA;
              --thematic-color-retirement: #CC222B;
              --thematic-color-retirement-: #FFEFF0;
              --thematic-color-transportation: #F15B4C;
              --thematic-color-transportation-: #FFF0EE;
              --thematic-color-ai: #FAA41B;
              --thematic-color-ai-: #FFF1DB;
              --thematic-color-covid: #FFD45B;
              --thematic-color-covid-: #FFF6DB;
              --main-font: 'Open Sans', sans-serif;
              --alt-font: 'Open Sans Condensed', sans-serif;
              --font-weight-light: 300;
              --font-weight-normal: 400;
              --font-weight-heavier: 600;
              --font-weight-bold: 700;
              --font-weight-extra-bold: 800;
              --media-desktop-max: 1921px;
              --media-desktop-: 1441px;
              --media-desktop--: 1369px;
              --media-desktop---: 1281px;
              --media-desktop-min: 1025px;
              --media-mobile-max: 901px;
              --media-mobile-: 769px;
              --media-mobile--: 421px;
              --media-mobile-min: 321px;
              --visual-separator: 1px solid var(--contrast-color---);
              --box-shadow: 0.8px 0.8px 0.7px rgba(0, 0, 0, 0.065), 1.1px 1.1px 1.5px rgba(0, 0, 0, 0.095), 2px 2px 4px rgba(0, 0, 0, 0.16);
              --box-shadow-hover: 4.1px 4.1px 2.7px rgba(0, 0, 0, 0.032), 5.4px 5.4px 5.8px rgba(0, 0, 0, 0.048), 10px 10px 15px rgba(0, 0, 0, 0.08)
          }
  
          * {
              margin: 0;
              padding: 0;
              border: 0;
              box-sizing: border-box
          }
  
          html {
              font-size: 16px;
              font-family: var(--main-font)
          }
  
          :root {
              --px-to-rem-4: 0.25rem;
              --px-to-rem-6: 0.375rem;
              --px-to-rem-8: 0.5rem;
              --px-to-rem-10: 0.625rem;
              --px-to-rem-12: 0.75rem;
              --px-to-rem-14: 0.875rem;
              --px-to-rem-16: 1rem;
              --px-to-rem-18: 1.125rem;
              --px-to-rem-19: 1.187rem;
              --px-to-rem-20: 1.25rem;
              --px-to-rem-21: 1.312rem;
              --px-to-rem-22: 1.375rem;
              --px-to-rem-24: 1.5rem;
              --px-to-rem-25: 1.562rem;
              --px-to-rem-28: 1.75rem;
              --px-to-rem-30: 1.875rem;
              --px-to-rem-32: 2rem;
              --px-to-rem-34: 2.125rem;
              --px-to-rem-38: 2.375rem;
              --px-to-rem-40: 2.5rem;
              --px-to-rem-48: 3rem;
              --px-to-rem-50: 3.125rem;
              --px-to-rem-56: 3.5rem;
              --px-to-rem-60: 3.75rem;
              --px-to-rem-91: 5.687rem
          }
  
          @media (min-width:769px) {
              html {
                  font-size: 18px
              }
  
              :root {
                  --px-to-rem-4: 0.222rem;
                  --px-to-rem-6: 0.333rem;
                  --px-to-rem-8: 0.444rem;
                  --px-to-rem-12: 0.666rem;
                  --px-to-rem-14: 0.777rem;
                  --px-to-rem-16: 0.888rem;
                  --px-to-rem-18: 1rem;
                  --px-to-rem-19: 1.055rem;
                  --px-to-rem-20: 1.111rem;
                  --px-to-rem-21: 1.166rem;
                  --px-to-rem-22: 1.222rem;
                  --px-to-rem-24: 1.333rem;
                  --px-to-rem-25: 1.388rem;
                  --px-to-rem-28: 1.555rem;
                  --px-to-rem-30: 1.666rem;
                  --px-to-rem-32: 1.777rem;
                  --px-to-rem-34: 1.889rem;
                  --px-to-rem-38: 2.111rem;
                  --px-to-rem-40: 2.222rem;
                  --px-to-rem-48: 2.666rem;
                  --px-to-rem-50: 2.777rem;
                  --px-to-rem-56: 3.111rem;
                  --px-to-rem-60: 3.333rem;
                  --px-to-rem-91: 5.055rem
              }
          }
  
          @media (min-width:1025px) {
              html {
                  font-size: 18px
              }
  
              :root {
                  --px-to-rem-4: 0.222rem;
                  --px-to-rem-6: 0.333rem;
                  --px-to-rem-8: 0.444rem;
                  --px-to-rem-12: 0.666rem;
                  --px-to-rem-14: 0.777rem;
                  --px-to-rem-16: 0.888rem;
                  --px-to-rem-18: 1rem;
                  --px-to-rem-19: 1.055rem;
                  --px-to-rem-20: 1.111rem;
                  --px-to-rem-21: 1.166rem;
                  --px-to-rem-22: 1.222rem;
                  --px-to-rem-24: 1.333rem;
                  --px-to-rem-25: 1.388rem;
                  --px-to-rem-28: 1.555rem;
                  --px-to-rem-30: 1.666rem;
                  --px-to-rem-32: 1.777rem;
                  --px-to-rem-34: 1.889rem;
                  --px-to-rem-38: 2.111rem;
                  --px-to-rem-40: 2.222rem;
                  --px-to-rem-48: 2.666rem;
                  --px-to-rem-50: 2.777rem;
                  --px-to-rem-56: 3.111rem;
                  --px-to-rem-60: 3.333rem;
                  --px-to-rem-91: 5.055rem
              }
          }
  
          @media (min-width:1181px) {
              html {
                  font-size: 19px
              }
  
              :root {
                  --px-to-rem-4: 0.21rem;
                  --px-to-rem-6: 0.315rem;
                  --px-to-rem-8: 0.421rem;
                  --px-to-rem-12: 0.631rem;
                  --px-to-rem-14: 0.736rem;
                  --px-to-rem-16: 0.842rem;
                  --px-to-rem-18: 0.947rem;
                  --px-to-rem-19: 1rem;
                  --px-to-rem-20: 1.052rem;
                  --px-to-rem-21: 1.105rem;
                  --px-to-rem-22: 1.157rem;
                  --px-to-rem-24: 1.263rem;
                  --px-to-rem-25: 1.315rem;
                  --px-to-rem-28: 1.473rem;
                  --px-to-rem-30: 1.578rem;
                  --px-to-rem-32: 1.684rem;
                  --px-to-rem-34: 1.789rem;
                  --px-to-rem-38: 2rem;
                  --px-to-rem-40: 2.105rem;
                  --px-to-rem-48: 2.526rem;
                  --px-to-rem-50: 2.631rem;
                  --px-to-rem-56: 2.947rem;
                  --px-to-rem-60: 3.157rem;
                  --px-to-rem-91: 4.789rem
              }
          }
  
          @media (min-width:1281px) {
              html {
                  font-size: 20px
              }
  
              :root {
                  --px-to-rem-4: 0.2rem;
                  --px-to-rem-6: 0.3rem;
                  --px-to-rem-8: 0.4rem;
                  --px-to-rem-12: 0.6rem;
                  --px-to-rem-14: 0.7rem;
                  --px-to-rem-16: 0.8rem;
                  --px-to-rem-18: 0.9rem;
                  --px-to-rem-19: 0.95rem;
                  --px-to-rem-20: 1rem;
                  --px-to-rem-21: 1.05rem;
                  --px-to-rem-22: 1.1rem;
                  --px-to-rem-24: 1.2rem;
                  --px-to-rem-25: 1.25rem;
                  --px-to-rem-28: 1.4rem;
                  --px-to-rem-30: 1.5rem;
                  --px-to-rem-32: 1.6rem;
                  --px-to-rem-34: 1.7rem;
                  --px-to-rem-38: 1.9rem;
                  --px-to-rem-40: 2rem;
                  --px-to-rem-48: 2.4rem;
                  --px-to-rem-50: 2.5rem;
                  --px-to-rem-56: 2.8rem;
                  --px-to-rem-60: 3rem;
                  --px-to-rem-91: 4.55rem
              }
          }
  
          @media (min-width:1601px) {
              html {
                  font-size: 22px
              }
  
              :root {
                  --px-to-rem-4: 0.182rem;
                  --px-to-rem-6: 0.272rem;
                  --px-to-rem-8: 0.363rem;
                  --px-to-rem-12: 0.545rem;
                  --px-to-rem-14: 0.636rem;
                  --px-to-rem-16: 0.727rem;
                  --px-to-rem-18: 0.818rem;
                  --px-to-rem-19: 0.863rem;
                  --px-to-rem-20: 0.909rem;
                  --px-to-rem-21: 0.954rem;
                  --px-to-rem-22: 1rem;
                  --px-to-rem-24: 1.09rem;
                  --px-to-rem-25: 1.136rem;
                  --px-to-rem-28: 1.272rem;
                  --px-to-rem-30: 1.363rem;
                  --px-to-rem-32: 1.454rem;
                  --px-to-rem-34: 1.545rem;
                  --px-to-rem-38: 1.727rem;
                  --px-to-rem-40: 1.818rem;
                  --px-to-rem-48: 2.181rem;
                  --px-to-rem-50: 2.272rem;
                  --px-to-rem-56: 2.545rem;
                  --px-to-rem-60: 2.727rem;
                  --px-to-rem-91: 4.136rem
              }
          }
  
          @media (min-width:1921px) {
              html {
                  font-size: 24px
              }
  
              :root {
                  --px-to-rem-4: 0.167rem;
                  --px-to-rem-6: 0.25rem;
                  --px-to-rem-8: 0.333rem;
                  --px-to-rem-12: 0.5rem;
                  --px-to-rem-14: 0.583rem;
                  --px-to-rem-16: 0.666rem;
                  --px-to-rem-18: 0.75rem;
                  --px-to-rem-19: 0.791rem;
                  --px-to-rem-20: 0.833rem;
                  --px-to-rem-21: 0.875rem;
                  --px-to-rem-22: 0.916rem;
                  --px-to-rem-24: 1rem;
                  --px-to-rem-25: 1.041rem;
                  --px-to-rem-28: 1.166rem;
                  --px-to-rem-30: 1.25rem;
                  --px-to-rem-32: 1.333rem;
                  --px-to-rem-34: 1.417rem;
                  --px-to-rem-38: 1.583rem;
                  --px-to-rem-40: 1.666rem;
                  --px-to-rem-48: 2rem;
                  --px-to-rem-50: 2.083rem;
                  --px-to-rem-56: 2.333rem;
                  --px-to-rem-60: 2.5rem;
                  --px-to-rem-91: 3.791rem
              }
          }
  
          @media (min-width:2001px) {
              html {
                  font-size: 28px;
                  font-size: clamp(24px, 3.25vh, 28px)
              }
  
              :root {
                  --px-to-rem-4: 0.2rem;
                  --px-to-rem-6: 0.3rem;
                  --px-to-rem-8: 0.4rem;
                  --px-to-rem-12: 0.6rem;
                  --px-to-rem-14: 0.7rem;
                  --px-to-rem-16: 0.8rem;
                  --px-to-rem-18: 0.9rem;
                  --px-to-rem-19: 0.95rem;
                  --px-to-rem-20: 1rem;
                  --px-to-rem-21: 1.05rem;
                  --px-to-rem-22: 1.1rem;
                  --px-to-rem-24: 1.2rem;
                  --px-to-rem-25: 1.25rem;
                  --px-to-rem-28: 1.4rem;
                  --px-to-rem-30: 1.5rem;
                  --px-to-rem-32: 1.6rem;
                  --px-to-rem-34: 1.7rem;
                  --px-to-rem-38: 1.9rem;
                  --px-to-rem-40: 2rem;
                  --px-to-rem-48: 2.4rem;
                  --px-to-rem-50: 2.5rem;
                  --px-to-rem-56: 2.8rem;
                  --px-to-rem-60: 3rem;
                  --px-to-rem-91: 4.55rem
              }
          }
  
          body {
              background-color: var(--contrast-color-);
              max-width: unset;
              display: flex
          }
  
          body>div {
              max-width: 90ch;
              display: flex;
              flex-direction: column
          }
  
          body>div>#header-desktop {
              order: 1
          }
  
          body>div>#breadcrumbs {
              order: 2
          }
  
          body>div>main {
              order: 3
          }
  
          body>div>footer {
              order: 4
          }
  
          body>div>main {
              padding: var(--px-to-rem-19) var(--px-to-rem-28)
          }
  
          @media (max-width:901px) {
              body {
                  flex-direction: column
              }
  
              body>div {
                  max-width: 100vw;
                  padding-top: 60px
              }
  
              body>div>main {
                  max-width: 100%;
                  padding: var(--px-to-rem-16)
              }
          }
  
          @media (prefers-reduced-motion:no-preference) {
              body {
                  animation: appear-on-load .5s ease-in-out;
                  animation-iteration-count: 1
              }
          }
  
          @keyframes appear-on-load {
              0% {
                  opacity: 0
              }
  
              100% {
                  opacity: 1
              }
          }
  
          body>div>main h1 {
              font-size: var(--px-to-rem-48);
              line-height: var(--px-to-rem-56);
              font-weight: var(--font-weight-bold);
              color: var(--opposite-color-);
              max-width: 85%
          }
  
          body>div>main p.section-sub-headline,
          body>div>main>p {
              font-size: var(--px-to-rem-18);
              line-height: var(--px-to-rem-28);
              font-weight: var(--font-weight-normal);
              color: var(--opposite-color);
              margin: var(--px-to-rem-32) 0
          }
  
          body>div>main section>h2 {
              font-size: var(--px-to-rem-32);
              line-height: var(--px-to-rem-40);
              font-weight: var(--font-weight-normal);
              color: var(--opposite-color-);
              margin: var(--px-to-rem-32) 0
          }
  
          body>div>main hr {
              border-bottom: var(--visual-separator)
          }
  
          :focus {
              outline: 2px solid #7070FF;
              outline-offset: 2px
          }
  
          @media (min-width:901px) {
              body>div {
                  min-width: 890px
              }
          }
  
          @media (min-width:422px) and (max-width:901px) {
              body>div>main p {
                  max-width: 75ch
              }
          }
  
          @media (max-width:901px) {
              body>div>main h1 {
                  font-size: var(--px-to-rem-34);
                  line-height: var(--px-to-rem-50);
                  max-width: unset
              }
  
              body>div>main section>h2 {
                  font-size: var(--px-to-rem-24);
                  line-height: var(--px-to-rem-32)
              }
          }
  
          @media (min-width:1921px) {
              body>div {
                  max-width: 75ch
              }
  
              body>div>main p.section-sub-headline,
              body>div>main>p {
                  font-size: var(--px-to-rem-22);
                  line-height: var(--px-to-rem-32)
              }
          }
  
          nav#breadcrumbs {
              border-radius: var(--px-to-rem-34);
              margin-left: var(--px-to-rem-30);
              margin-top: var(--px-to-rem-16);
              grid-area: breadcrumbs
          }
  
          nav#breadcrumbs ol {
              display: flex;
              list-style: none
          }
  
          nav#breadcrumbs ol li {
              margin-right: .1rem;
              padding: var(--px-to-rem-4) var(--px-to-rem-8);
              display: flex;
              align-items: center
          }
  
          nav#breadcrumbs ol li a,
          nav#breadcrumbs ol li span {
              text-decoration: none;
              font-size: var(--px-to-rem-16);
              color: var(--opposite-color----);
              border-bottom: 1px solid transparent;
              transition: all ease-in-out .25s;
              transition-property: border-bottom-color color
          }
  
          nav#breadcrumbs ol li a:hover {
              color: var(--opposite-color---);
              border-bottom-color: var(--opposite-color---)
          }
  
          nav#breadcrumbs ol li:first-of-type {
              padding-left: var(--px-to-rem-16);
              border-top-left-radius: var(--px-to-rem-25);
              border-bottom-left-radius: var(--px-to-rem-25)
          }
  
          nav#breadcrumbs ol li:first-of-type a {
              margin-top: var(--px-to-rem-4)
          }
  
          nav#breadcrumbs ol li:last-of-type {
              padding-right: var(--px-to-rem-16);
              border-top-right-radius: var(--px-to-rem-25);
              border-bottom-right-radius: var(--px-to-rem-25)
          }
  
          nav#breadcrumbs ol li:last-of-type a {
              color: var(--opposite-color---)
          }
  
          nav#breadcrumbs ol li:first-of-type img {
              width: var(--px-to-rem-16)
          }
  
          nav#breadcrumbs[data-thematic=""] li {
              background-color: var(--main-color--)
          }
  
          nav#breadcrumbs[data-thematic=caregiving-and-well-being] li {
              background-color: var(--thematic-color-caregiving-)
          }
  
          nav#breadcrumbs[data-thematic=home-logistics-and-services] li {
              background-color: var(--thematic-color-home-)
          }
  
          nav#breadcrumbs[data-thematic=retirement-and-longevity-planning] li {
              background-color: var(--thematic-color-retirement-)
          }
  
          nav#breadcrumbs[data-thematic=transportation-and-livable-communities] li {
              background-color: var(--thematic-color-transportation-)
          }
  
          @media (max-width:901px) {
              nav#breadcrumbs {
                  padding-top: var(--px-to-rem-20);
                  margin-left: var(--px-to-rem-16)
              }
  
              nav#breadcrumbs>a {
                  color: var(--opposite-color-);
                  font-weight: var(--font-weight-bold);
                  display: flex;
                  align-items: center
              }
  
              nav#breadcrumbs>a>img {
                  margin-right: var(--px-to-rem-8)
              }
          }
  
          footer {
              background-color: var(--opposite-color----);
              border-top: var(--px-to-rem-4) solid var(--main-color);
              color: var(--contrast-color);
              display: grid;
              gap: var(--px-to-rem-32);
              grid-area: footer;
              grid-template-columns: 2.25fr 1fr 1fr;
              margin-top: var(--px-to-rem-56);
              padding: var(--px-to-rem-32)
          }
  
          footer form>div:first-of-type {
              display: flex;
              gap: var(--px-to-rem-16);
              justify-content: space-between
          }
  
          footer form button,
          footer form>div:first-of-type>div {
              width: 50%
          }
  
          footer form>div.styled-input-wrapper {
              margin-top: var(--px-to-rem-16)
          }
  
          footer form>div#button-message-container {
              align-items: baseline;
              display: flex;
              gap: var(--px-to-rem-16);
              margin-top: var(--px-to-rem-16)
          }
  
          footer form button {
              margin-top: var(--px-to-rem-24)
          }
  
          footer form div p.form-message {
              font-size: var(--px-to-rem-18);
              min-height: var(--px-to-rem-20);
              opacity: 0;
              transition: visibility 0s, opacity .25s ease-in-out;
              visibility: hidden
          }
  
          footer form div p.form-message.visible {
              opacity: 1;
              visibility: visible
          }
  
          footer>div:first-of-type>h2 {
              font-size: var(--px-to-rem-32);
              font-weight: var(--font-weight-normal);
              margin-bottom: var(--px-to-rem-18)
          }
  
          footer>div:nth-of-type(2)>h2 {
              font-size: var(--px-to-rem-18);
              font-weight: var(--font-weight-bold);
              margin-bottom: var(--px-to-rem-12);
              padding-top: var(--px-to-rem-12)
          }
  
          footer>nav>ul {
              list-style: none
          }
  
          footer>nav>ul>li {
              margin-bottom: 1rem
          }
  
          footer>nav>ul>li>a {
              text-decoration: none;
              color: var(--contrast-color);
              font-size: var(--px-to-rem-18);
              font-weight: var(--font-weight-bold);
              transition: none;
              position: relative
          }
  
          footer>nav>ul>li>a::after {
              content: "";
              width: 0;
              height: 2px;
              background-color: var(--contrast-color);
              position: absolute;
              bottom: 0;
              left: 0
          }
  
          footer>nav>ul>li>a:hover::after {
              width: 100%
          }
  
          footer>nav>ul>li:first-of-type {
              margin-bottom: var(--px-to-rem-8);
              margin-top: var(--px-to-rem-12)
          }
  
          footer>nav>ul>li:nth-of-type(2)>a,
          footer>nav>ul>li:nth-of-type(3)>a {
              font-weight: var(--font-weight-normal);
              font-size: var(--px-to-rem-16)
          }
  
          footer>div:nth-of-type(2)>address {
              font-size: var(--px-to-rem-16);
              line-height: var(--px-to-rem-24);
              font-style: normal;
              margin-bottom: var(--px-to-rem-24)
          }
  
          footer>div:nth-of-type(2)>address>a {
              text-decoration: none;
              color: var(--contrast-color);
              transition: none
          }
  
          footer>div:nth-of-type(2)>address>a:hover {
              border-bottom: 2px solid var(--contrast-color)
          }
  
          footer>div:nth-of-type(2)>a {
              width: 100%;
              margin-bottom: var(--px-to-rem-24)
          }
  
          footer>div:nth-of-type(2) a.accessibility-link {
              color: var(--contrast-color);
              font-size: var(--px-to-rem-19);
              line-height: var(--px-to-rem-32);
              margin: var(--px-to-rem-24) 0
          }
  
          footer>div:nth-of-type(2)>nav>ul {
              list-style: none;
              display: flex;
              flex-direction: row;
              justify-content: space-between;
              margin-top: var(--px-to-rem-32)
          }
  
          footer>div:nth-of-type(2)>nav a>img {
              width: var(--px-to-rem-20);
              height: var(--px-to-rem-20)
          }
  
          @media (prefers-reduced-motion:no-preference) {
              footer>div:nth-of-type(2)>nav a:hover>img {
                  animation: wiggle .5s ease-in-out infinite
              }
          }
  
          @keyframes wiggle {
              0% {
                  transform: rotate(0)
              }
  
              25% {
                  transform: rotate(10deg)
              }
  
              75% {
                  transform: rotate(-10deg)
              }
  
              100% {
                  transform: rotate(0)
              }
          }
  
          @media (max-width:901px) {
              footer {
                  display: flex;
                  flex-direction: column;
                  margin-bottom: var(--px-to-rem-60)
              }
  
              footer form>div:first-of-type {
                  flex-direction: column
              }
  
              footer form div button.newsletter-submit,
              footer form>div:first-of-type>div {
                  width: 100%
              }
  
              footer form div#button-message-container {
                  flex-direction: column;
                  margin-top: var(--px-to-rem-32)
              }
  
              footer form div p.form-message {
                  margin-top: var(--px-to-rem-16)
              }
  
              footer>div:first-of-type>h2 {
                  font-size: var(--px-to-rem-32);
                  margin-bottom: var(--px-to-rem-19)
              }
  
              footer>div:nth-of-type(2)>h2 {
                  font-size: var(--px-to-rem-32);
                  font-weight: var(--font-weight-normal);
                  margin-bottom: var(--px-to-rem-19);
                  padding-top: unset
              }
  
              footer>div:nth-of-type(2)>nav {
                  margin-top: var(--px-to-rem-48)
              }
  
              footer>div:nth-of-type(2)>address {
                  font-size: var(--px-to-rem-19);
                  line-height: var(--px-to-rem-32)
              }
  
              footer>div:last-of-type {
                  display: flex;
                  flex-direction: row;
                  justify-content: space-between;
                  margin: var(--px-to-rem-10) 0
              }
  
              footer img.mit-logo {
                  width: 5rem;
                  height: auto
              }
  
              footer>div:last-of-type>p {
                  font-size: var(--px-to-rem-14);
                  line-height: var(--px-to-rem-24);
                  font-weight: var(--font-weight-normal);
                  margin-left: var(--px-to-rem-8)
              }
          }
  
          @media (prefers-reduced-motion:no-preference) {
              footer>nav>ul>li>a::after {
                  transition: width .1s
              }
  
              footer>div:nth-of-type(2)>address>a::after {
                  transition: border-bottom .1s
              }
          }
  
          header#header-desktop {
              margin-top: var(--px-to-rem-19);
              grid-area: header-desktop;
              display: flex;
              font-size: var(--px-to-rem-16);
              font-weight: var(--font-weight-bold);
              justify-content: flex-end;
              margin-right: var(--px-to-rem-8);
              padding-left: var(--px-to-rem-28)
          }
  
          header#header-desktop h1 {
              align-self: flex-end;
              color: var(--opposite-color-);
              flex: 1 1 0;
              font-size: var(--px-to-rem-32);
              font-weight: var(--font-weight-normal);
              line-height: var(--px-to-rem-40);
              padding-left: var(--px-to-rem-28);
              vertical-align: text-bottom
          }
  
          header#header-desktop nav ul {
              display: flex;
              align-items: center;
              list-style: none;
              padding-right: var(--px-to-rem-22);
              gap: var(--px-to-rem-10)
          }
  
          header#header-desktop nav ul li a:not([class*=button-]) {
              color: var(--opposite-color-);
              margin-right: var(--px-to-rem-14);
              padding: var(--px-to-rem-8) var(--px-to-rem-4);
              text-decoration: none;
              transition: all ease-in-out .25s;
              transition-property: color, background-color
          }
  
          header#header-desktop nav ul li a[class*=button-].active {
              color: var(--main-color);
              background-color: var(--contrast-color);
              border: 1px solid var(--main-color)
          }
  
          header#header-desktop nav ul li a.active {
              color: var(--opposite-color---)
          }
  
          header#header-desktop nav[data-thematic=""] ul li a.active:not([class*=button-]) {
              border-top: var(--px-to-rem-4) solid var(--main-color)
          }
  
          header#header-desktop nav[data-thematic=""] ul li a:hover:not([class*=button-]) {
              background-color: var(--main-color--);
              color: var(--opposite-color---)
          }
  
          header#header-desktop nav[data-thematic=caregiving-and-well-being] ul li a.active:not([class*=button-]) {
              border-top: var(--px-to-rem-4) solid var(--thematic-color-caregiving)
          }
  
          header#header-desktop nav[data-thematic=caregiving-and-well-being] ul li a:hover:not([class*=button-]) {
              background-color: var(--thematic-color-caregiving-);
              color: var(--opposite-color---)
          }
  
          header#header-desktop nav[data-thematic=home-logistics-and-services] ul li a.active:not([class*=button-]) {
              border-top: var(--px-to-rem-4) solid var(--thematic-color-home)
          }
  
          header#header-desktop nav[data-thematic=home-logistics-and-services] ul li a:hover:not([class*=button-]) {
              background-color: var(--thematic-color-home-);
              color: var(--opposite-color---)
          }
  
          header#header-desktop nav[data-thematic=retirement-and-longevity-planning] ul li a.active:not([class*=button-]) {
              border-top: var(--px-to-rem-4) solid var(--thematic-color-retirement)
          }
  
          header#header-desktop nav[data-thematic=retirement-and-longevity-planning] ul li a:hover:not([class*=button-]) {
              background-color: var(--thematic-color-retirement-);
              color: var(--opposite-color---)
          }
  
          header#header-desktop nav[data-thematic=transportation-and-livable-communities] ul li a.active:not([class*=button-]) {
              border-top: var(--px-to-rem-4) solid var(--thematic-color-transportation)
          }
  
          header#header-desktop nav[data-thematic=transportation-and-livable-communities] ul li a:hover:not([class*=button-]) {
              background-color: var(--thematic-color-transportation-);
              color: var(--opposite-color---)
          }
  
          @media (min-width:1921px) {
              header#header-desktop {
                  justify-content: unset;
                  margin-right: unset;
                  margin-left: auto
              }
          }
  
          body.header-mobile-expanded {
              overflow-y: hidden
          }
  
          header#header-mobile {
              flex-wrap: wrap;
              max-width: 100vw;
              width: 100%;
              grid-area: header-mobile;
              background-color: var(--contrast-color);
              height: 64px;
              position: fixed;
              z-index: 4
          }
  
          header#header-mobile.nav-expanded {
              top: 0;
              left: 0;
              height: 100%;
              overflow-y: auto
          }
  
          header#header-mobile :not(a.button-main) {
              background-color: var(--contrast-color)
          }
  
          @media (prefers-reduced-motion:no-preference) {
              header#header-mobile {
                  transition: top .25s ease-in-out
              }
  
              header#header-mobile button img {
                  transition: transform ease-in-out .25s
              }
  
              header#header-mobile nav ul#main-nav-list>li div button img {
                  width: 100%;
                  transition: transform ease-in-out .25s
              }
          }
  
          header#header-mobile>nav:first-of-type {
              display: flex;
              align-items: center;
              width: 100%;
              padding: var(--px-to-rem-19) var(--px-to-rem-14);
              border-bottom: 1px solid var(--contrast-color---)
          }
  
          header#header-mobile button {
              background-color: var(--contrast-color);
              height: var(--px-to-rem-24)
          }
  
          header#header-mobile button img {
              height: 100%;
              transform: rotate(-90deg)
          }
  
          header#header-mobile.nav-expanded button img {
              transform: unset
          }
  
          header#header-mobile>nav:first-of-type>a:first-of-type {
              margin: 0 auto;
              height: var(--px-to-rem-24)
          }
  
          header#header-mobile>nav:first-of-type>a:first-of-type img {
              height: 100%
          }
  
          header#header-mobile>nav:first-of-type>a:last-of-type {
              height: var(--px-to-rem-24)
          }
  
          header#header-mobile>nav:first-of-type>a:last-of-type>img {
              height: 100%
          }
  
          header#header-mobile nav:last-of-type {
              display: none;
              opacity: 0;
              visibility: hidden;
              -webkit-transition: opacity .6s, visibility .6s;
              transition: opacity .6s, visibility .6s
          }
  
          header#header-mobile.nav-expanded nav:last-of-type {
              display: block;
              visibility: visible;
              opacity: 1;
              animation: fade .5s
          }
  
          @keyframes fade {
              0% {
                  opacity: 0
              }
  
              100% {
                  opacity: 1
              }
          }
  
          header#header-mobile nav ul li {
              list-style: none
          }
  
          header#header-mobile nav ul#main-nav-list>li {
              margin: 0 auto;
              list-style-type: none;
              border-bottom: 1px solid var(--contrast-color---)
          }
  
          header#header-mobile nav ul#main-nav-list>li#mobile-nav-cta {
              background-color: var(--contrast-color-);
              display: flex;
              flex-direction: column;
              justify-content: space-around;
              gap: var(--px-to-rem-19);
              padding: var(--px-to-rem-19) 0
          }
  
          a.wide-mode {
              display: block;
              width: 90%;
              margin: 0 auto
          }
  
          header#header-mobile nav ul#main-nav-list>li.expanded {
              padding-bottom: 0;
              border-bottom: 0
          }
  
          header#header-mobile nav ul#main-nav-list>li h2 {
              background-color: var(--contrast-color);
              padding: var(--px-to-rem-8) var(--px-to-rem-16)
          }
  
          header#header-mobile nav ul#main-nav-list>li h2 button {
              display: flex;
              align-items: center;
              justify-content: space-between;
              padding: var(--px-to-rem-32) 0 var(--px-to-rem-32) var(--px-to-rem-16);
              width: 100%;
              text-align: left;
              white-space: normal
          }
  
          header#header-mobile nav ul#main-nav-list>li>h2>button>span {
              font-family: var(--main-font);
              font-size: var(--px-to-rem-18);
              color: var(--opposite-color-);
              font-weight: var(--font-weight-heavier);
              line-height: var(--px-to-rem-28);
              pointer-events: none
          }
  
          header#header-mobile nav ul#main-nav-list>li h2 button img {
              height: var(--px-to-rem-16);
              pointer-events: none
          }
  
          header#header-mobile nav ul#main-nav-list>li.expanded h2 button img {
              transform: rotate(180deg)
          }
  
          header#header-mobile nav ul#main-nav-list>li.active,
          header#header-mobile nav ul#main-nav-list>li.active h2 button {
              background-color: var(--contrast-color-)
          }
  
          header#header-mobile nav ul#main-nav-list>li[data-thematic=menu-caregiving-and-well-being] h2 button {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-caregiving)
          }
  
          header#header-mobile nav ul#main-nav-list>li[data-thematic=menu-home-logistics-and-services] h2 button {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-home)
          }
  
          header#header-mobile nav ul#main-nav-list>li[data-thematic=menu-retirement-and-longevity-planning] h2 button {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-retirement)
          }
  
          header#header-mobile nav ul#main-nav-list>li[data-thematic=menu-transportation-and-livable-communities] h2 button {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-transportation)
          }
  
          header#header-mobile nav ul#main-nav-list>li ul {
              width: 100%;
              padding: var(--px-to-rem-8) 0;
              margin-top: var(--px-to-rem-8);
              background-color: var(--contrast-color----);
              border-top: 1px solid var(--contrast-color---);
              border-bottom: 1px solid var(--contrast-color---);
              display: none
          }
  
          header#header-mobile nav ul#main-nav-list>li ul.expanded {
              display: block
          }
  
          header#header-mobile nav ul#main-nav-list>li ul li {
              padding-left: var(--px-to-rem-38);
              margin-bottom: var(--px-to-rem-14);
              background-color: inherit
          }
  
          header#header-mobile nav ul#main-nav-list>li ul li:last-of-type {
              margin-bottom: 0
          }
  
          header#header-mobile nav ul#main-nav-list>li ul li a {
              font-size: var(--px-to-rem-18);
              color: var(--opposite-color----);
              text-decoration: none;
              font-weight: var(--font-weight-bold);
              background-color: inherit
          }
  
          header#header-mobile nav ul#main-nav-list>li ul li a.active {
              display: block;
              width: 85%;
              background-color: var(--main-color);
              color: var(--contrast-color);
              padding: var(--px-to-rem-8) var(--px-to-rem-4) var(--px-to-rem-8) var(--px-to-rem-8);
              margin-left: calc(var(--px-to-rem-8) * -1);
              border-radius: var(--px-to-rem-4)
          }
  
          header#header-mobile nav ul#main-nav-list>li:not([data-thematic]):not([id=mobile-nav-cta]) {
              padding: var(--px-to-rem-19) calc(var(--px-to-rem-32) + var(--px-to-rem-4))
          }
  
          header#header-mobile nav ul#main-nav-list>li:not([data-thematic]):not([id=mobile-nav-cta])>a {
              text-decoration: none;
              font-family: var(--main-font);
              font-size: var(--px-to-rem-18);
              color: var(--opposite-color-);
              font-weight: var(--font-weight-heavier);
              line-height: var(--px-to-rem-28)
          }
  
          header#header-mobile nav ul#main-nav-list>li[data-thematic=about-us] div {
              border-left: var(--px-to-rem-4) solid transparent
          }
  
          a#skip-link {
              font-size: var(--px-to-rem-19);
              padding: var(--px-to-rem-4);
              text-decoration: underline;
              color: var(--contrast-color);
              background-color: var(--main-color);
              position: absolute;
              top: calc(var(--px-to-rem-38) * -1);
              left: 0;
              z-index: 9999
          }
  
          @media (prefers-reduced-motion:no-preference) {
              a#skip-link {
                  transition: top .5s ease-in-out
              }
          }
  
          a#skip-link:focus {
              top: 0
          }
  
          nav#bottom-nav-list ul {
              list-style: none;
              display: flex;
              justify-content: space-between;
              position: fixed;
              padding: var(--px-to-rem-28) var(--px-to-rem-8);
              width: 100%;
              max-width: 100vw;
              bottom: 0;
              left: 0;
              background-color: var(--contrast-color);
              z-index: 100;
              box-shadow: var(--box-shadow);
              border-top: 2px solid var(--main-color)
          }
  
          @media (prefers-reduced-motion:no-preference) {
              nav#bottom-nav-list ul {
                  transition: bottom .25s
              }
          }
  
          header#header-mobile.nav-expanded+nav#bottom-nav-list ul {
              bottom: calc(var(--px-to-rem-91) * -1)
          }
  
          nav#bottom-nav-list ul li a {
              color: var(--main-color);
              text-decoration: none;
              text-transform: uppercase;
              padding: var(--px-to-rem-8) var(--px-to-rem-4);
              font-size: var(--px-to-rem-14);
              font-weight: var(--font-weight-bold)
          }
  
          nav#bottom-nav-list ul li a.active {
              text-decoration: underline
          }
  
          @media (max-width:350px) {
              nav#bottom-nav-list ul li a {
                  font-size: var(--px-to-rem-12)
              }
          }
  
          aside#sidebar {
              background-color: var(--contrast-color);
              grid-area: sidebar
          }
  
          aside#sidebar>div {
              display: flex;
              flex-direction: column;
              height: 100vh;
              width: 15.6rem;
              max-width: 312px;
              margin-left: auto;
              padding: 0 var(--px-to-rem-32);
              position: sticky;
              top: 0;
              left: 0;
              overflow: auto;
              box-shadow: .8px .8px .7px rgba(0, 0, 0, .065), 1.1px 1.1px 1.5px rgba(0, 0, 0, .095), 2px 2px 4px rgba(0, 0, 0, .16)
          }
  
          aside#sidebar a>img {
              width: 100%;
              padding-top: var(--px-to-rem-18)
          }
  
          aside#sidebar h2 {
              font-size: var(--px-to-rem-19);
              font-weight: var(--font-weight-heavier);
              margin: var(--px-to-rem-19) var(--px-to-rem-24) var(--px-to-rem-8) var(--px-to-rem-18);
              color: var(--opposite-color----)
          }
  
          aside#sidebar nav ul {
              display: flex;
              flex-direction: column;
              justify-content: center
          }
  
          aside#sidebar nav ul li {
              list-style-type: none;
              margin: var(--px-to-rem-8) 0;
              padding: var(--px-to-rem-6) 0 var(--px-to-rem-8) var(--px-to-rem-12)
          }
  
          aside#sidebar nav ul li:last-of-type {
              margin-bottom: var(--px-to-rem-16)
          }
  
          aside#sidebar nav ul li:hover a {
              color: var(--main-color)
          }
  
          aside#sidebar nav ul li a {
              font-size: var(--px-to-rem-18);
              color: var(--opposite-color-);
              text-decoration: none;
              font-weight: var(--font-weight-heavier);
              line-height: var(--px-to-rem-24)
          }
  
          aside#sidebar nav ul li#explore-blog-link {
              display: flex;
              justify-content: flex-start;
              align-items: center;
              gap: var(--px-to-rem-8);
              padding-left: 0
          }
  
          aside#sidebar nav ul li#explore-blog-link a {
              color: var(--main-color)
          }
  
          aside#sidebar nav ul li[data-thematic=caregiving-and-well-being] {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-caregiving)
          }
  
          aside#sidebar nav[data-thematic=caregiving-and-well-being] ul li[data-thematic=caregiving-and-well-being] {
              border-left: var(--px-to-rem-8) solid var(--thematic-color-caregiving);
              background-color: var(--thematic-color-caregiving-);
              text-decoration: none
          }
  
          aside#sidebar nav[data-thematic=caregiving-and-well-being] ul li[data-thematic=caregiving-and-well-being] a {
              color: var(--opposite-color---)
          }
  
          aside#sidebar nav ul li[data-thematic=home-logistics-and-services] {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-home)
          }
  
          aside#sidebar nav[data-thematic=home-logistics-and-services] ul li[data-thematic=home-logistics-and-services] {
              border-left: var(--px-to-rem-8) solid var(--thematic-color-home);
              background-color: var(--thematic-color-home-);
              text-decoration: none
          }
  
          aside#sidebar nav[data-thematic=home-logistics-and-services] ul li[data-thematic=home-logistics-and-services] a {
              color: var(--opposite-color---)
          }
  
          aside#sidebar nav ul li[data-thematic=retirement-and-longevity-planning] {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-retirement)
          }
  
          aside#sidebar nav[data-thematic=retirement-and-longevity-planning] ul li[data-thematic=retirement-and-longevity-planning] {
              border-left: var(--px-to-rem-8) solid var(--thematic-color-retirement);
              background-color: var(--thematic-color-retirement-);
              text-decoration: none
          }
  
          aside#sidebar nav[data-thematic=retirement-and-longevity-planning] ul li[data-thematic=retirement-and-longevity-planning] a {
              color: var(--opposite-color---)
          }
  
          aside#sidebar nav ul li[data-thematic=transportation-and-livable-communities] {
              border-left: var(--px-to-rem-4) solid var(--thematic-color-transportation)
          }
  
          aside#sidebar nav[data-thematic=transportation-and-livable-communities] ul li[data-thematic=transportation-and-livable-communities] {
              border-left: var(--px-to-rem-8) solid var(--thematic-color-transportation);
              background-color: var(--thematic-color-transportation-);
              text-decoration: none
          }
  
          aside#sidebar nav[data-thematic=transportation-and-livable-communities] ul li[data-thematic=transportation-and-livable-communities] a {
              color: var(--opposite-color---)
          }
  
          aside#sidebar nav ul li:hover {
              background-color: var(--contrast-color-);
              text-decoration: underline
          }
  
          aside#sidebar nav ul li a:hover {
              color: var(--main-color)
          }
  
          aside#sidebar nav ul li a.active {
              color: var(--opposite-color---)
          }
  
          aside#sidebar div>div:last-of-type {
              display: flex;
              flex-direction: row;
              margin-top: auto;
              padding-bottom: var(--px-to-rem-18)
          }
  
          aside#sidebar div>div:last-of-type a {
              width: var(--px-to-rem-56);
              height: var(--px-to-rem-38)
          }
  
          aside#sidebar div>div:last-of-type img {
              width: var(--px-to-rem-56);
              padding-top: unset
          }
  
          aside#sidebar div>p {
              font-size: var(--px-to-rem-12);
              margin-left: var(--px-to-rem-8);
              color: var(--opposite-color)
          }
  
          @media (min-width:1921px) {
              aside#sidebar {
                  min-width: 500px;
                  width: 20%
              }
  
              aside#sidebar>div {
                  max-width: 15.6rem
              }
          }
  
          @media (min-width:2000px) {
              aside#sidebar {
                  width: 25%
              }
  
              aside#sidebar>div>div>a {
                  display: block;
                  margin: 0 auto;
                  width: 75%
              }
          }
  
          div.styled-dropdown-wrapper {
              display: flex;
              flex-direction: column
          }
  
          div.styled-dropdown-wrapper label {
              color: var(--opposite-color);
              font-size: var(--px-to-rem-19);
              margin-bottom: var(--px-to-rem-4)
          }
  
          div.styled-dropdown-wrapper label span {
              font-style: italic;
              font-size: var(--px-to-rem-16)
          }
  
          div.styled-dropdown-wrapper .select-wrapper {
              align-items: center;
              position: relative;
              min-width: 15ch;
              border: 1px solid var(--contrast-color---);
              border-radius: var(--px-to-rem-4);
              padding: var(--px-to-rem-10) var(--px-to-rem-16);
              font-size: var(--px-to-rem-19);
              cursor: pointer;
              background-color: var(--contrast-color)
          }
  
          div.styled-dropdown-wrapper select {
              appearance: none;
              -webkit-appearance: none;
              outline: 0;
              background-color: transparent;
              color: var(--opposite-color);
              border: none;
              width: 100%;
              height: 100%;
              margin: 0;
              font-family: inherit;
              font-size: inherit;
              cursor: inherit;
              line-height: inherit
          }
  
          div.styled-dropdown-wrapper .select-wrapper:after {
              position: absolute;
              right: var(--px-to-rem-8);
              top: var(--px-to-rem-19);
              content: "";
              width: var(--px-to-rem-14);
              height: var(--px-to-rem-8);
              background-color: var(--contrast-color--);
              pointer-events: none;
              clip-path: polygon(100% 0%, 0 0%, 50% 100%)
          }
  
          select:focus+.focus {
              position: absolute;
              top: -1px;
              left: -1px;
              right: -1px;
              bottom: -1px;
              border: 2px solid Highlight;
              border-radius: inherit
          }
  
          @media (max-width:901px) {
              div.styled-dropdown-wrapper label {
                  font-size: var(--px-to-rem-16);
                  margin-bottom: var(--px-to-rem-4)
              }
  
              div.styled-dropdown-wrapper .select-wrapper {
                  border-radius: var(--px-to-rem-4);
                  font-size: var(--px-to-rem-16)
              }
  
              div.styled-dropdown-wrapper .select-wrapper:after {
                  right: var(--px-to-rem-8);
                  top: var(--px-to-rem-16);
                  width: var(--px-to-rem-12);
                  height: var(--px-to-rem-6)
              }
  
              div.styled-dropdown-wrapper label span {
                  font-size: var(--px-to-rem-14)
              }
          }
  
          input.styled-input {
              display: block;
              width: 100%;
              border-radius: var(--px-to-rem-4);
              padding: var(--px-to-rem-8);
              margin-top: var(--px-to-rem-4);
              color: var(--opposite-color);
              font-family: var(--main-font);
              font-size: var(--px-to-rem-19)
          }
  
          input.styled-input label span {
              font-style: italic;
              font-size: var(--px-to-rem-16)
          }
  
          input.styled-input:not(.dark) {
              border: 1px solid var(--contrast-color---);
              background-color: var(--contrast-color);
              color: var(--opposite-color)
          }
  
          input.styled-input.dark {
              border: 1px solid var(--contrast-color);
              background-color: var(--opposite-color-);
              color: var(--contrast-color)
          }
  
          label.styled-input {
              font-size: var(--px-to-rem-19);
              font-weight: var(--font-weight-normal);
              color: var(--opposite-color)
          }
  
          label.styled-input.dark {
              color: var(--contrast-color)
          }
  
          @media (max-width:901px) {
              input.styled-input {
                  margin-top: var(--px-to-rem-8);
                  font-size: var(--px-to-rem-16)
              }
  
              label.styled-input {
                  font-size: var(--px-to-rem-16)
              }
  
              input.styled-input label span {
                  font-size: var(--px-to-rem-14)
              }
          }
  
          a.styled-link,
          p.styled-link {
              font-family: var(--main-font);
              font-weight: 700;
              font-size: var(--px-to-rem-14);
              color: var(--main-color);
              text-decoration: none;
              text-transform: uppercase;
              transition: color .1s
          }
  
          a.styled-link.contrast-mode,
          p.styled-link.contrast-mode {
              color: var(--contrast-color)
          }
  
          a.styled-link img,
          p.styled-link img {
              height: var(--px-to-rem-8);
              transition: filter .1s
          }
  
          a.styled-link img.play-icon,
          p.styled-link img.play-icon {
              margin-right: .25rem;
              height: var(--px-to-rem-12)
          }
  
          a.styled-link:not(.contrast-mode):hover,
          p.styled-link:not(.contrast-mode):hover {
              color: var(--main-color-)
          }
  
          a.styled-link:not(.contrast-mode):hover img,
          p.styled-link:not(.contrast-mode):hover img {
              filter: brightness(.6)
          }
  
          a.styled-link.contrast-mode:hover,
          p.styled-link.contrast-mode:hover {
              color: var(--contrast-color----)
          }
  
          a.styled-link.contrast-mode:hover img,
          p.styled-link.contrast-mode:hover img {
              filter: brightness(.9)
          }
  
          @media (prefers-reduced-motion:no-preference) {
  
              a.styled-link img,
              p.styled-link img {
                  transition: transform .2s
              }
  
              a.styled-link:hover img[src*=icon-arrow],
              p.styled-link:hover img[src*=icon-arrow] {
                  transform: translateX(30%)
              }
  
              a.styled-link:hover img[src="icon-arrow-back.svg"],
              p.styled-link:hover img[src="icon-arrow-back.svg"] {
                  transform: translateX(-30%)
              }
  
              a.styled-link:hover img.play-icon,
              p.styled-link:hover img.play-icon {
                  transform: rotate(360deg)
              }
  
              .card:hover a.styled-link img[src*=icon-arrow],
              .card:hover p.styled-link img[src*=icon-arrow] {
                  transform: translateX(30%)
              }
  
              .card:hover a.styled-link img[src="icon-arrow-back.svg"],
              .card:hover p.styled-link img[src="icon-arrow-back.svg"] {
                  transform: translateX(-30%)
              }
  
              .card:hover a.styled-link img.play-icon,
              .card:hover p.styled-link img.play-icon {
                  transform: rotate(360deg)
              }
          }
  
          div.search-label-and-input-wrapper {
              display: flex;
              flex-direction: column;
              position: relative;
              flex: 1
          }
  
          div.search-label-and-input-wrapper label {
              color: var(--opposite-color);
              margin-bottom: var(--px-to-rem-4)
          }
  
          div.search-label-and-input-wrapper input {
              border: 1px solid var(--contrast-color---);
              padding: var(--px-to-rem-14) var(--px-to-rem-28) var(--px-to-rem-14) var(--px-to-rem-16);
              border-radius: var(--px-to-rem-4);
              font-family: var(--main-font);
              color: var(--opposite-color);
              background: url('/static/images/search.svg') no-repeat 98.5% center, #fff;
              font-size: var(--px-to-rem-16)
          }
  
          div.search-label-and-input-wrapper input[type=search]::-webkit-search-decoration {
              display: none
          }
  
          div.search-label-and-input-wrapper input::placeholder {
              bottom: 22%;
              font-family: var(--main-font);
              color: var(--opposite-color);
              font-size: var(--px-to-rem-19);
              line-height: var(--px-to-rem-28)
          }
  
          div.search-label-and-input-wrapper.full-width {
              width: 100%
          }
  
          @media (max-width:901px) {
              div.search-label-and-input-wrapper input::placeholder {
                  font-size: var(--px-to-rem-16)
              }
  
              div.search-label-and-input-wrapper input {
                  padding: var(--px-to-rem-10) var(--px-to-rem-28) var(--px-to-rem-10) var(--px-to-rem-16)
              }
          }
      </style>
      <style>
          form.subscribe-form {
              display: flex;
              flex-direction: column
          }
  
          form.subscribe-form>div:not(div:first-of-type) {
              margin: var(--px-to-rem-14);
              margin-left: unset
          }
  
          form.subscribe-form>div:first-of-type {
              width: 98%;
              display: flex;
              flex-direction: row;
              justify-content: space-between
          }
  
          form.subscribe-form>div.name-inputs>div {
              flex-basis: 49%;
              margin-left: unset
          }
  
          form.subscribe-form>div>label {
              font-size: var(--px-to-rem-18)
          }
  
          form.subscribe-form>div>label>p>em {
              font-size: var(--px-to-rem-14);
              color: var(--contrast-color--)
          }
  
          form.subscribe-form>button {
              width: 25%;
              margin-top: var(--px-to-rem-18)
          }
  
          form.subscribe-form>p.form-message {
              color: var(--opposite-color-);
              margin-top: var(--px-to-rem-18);
              min-height: var(--px-to-rem-28);
              opacity: 0;
              transition: visibility 0s, opacity .25s ease-in-out;
              visibility: hidden
          }
  
          form.subscribe-form>p.form-message.visible {
              opacity: 1;
              visibility: visible
          }
  
          @media (max-width:901px) {
              form.subscribe-form>div:not(div:first-of-type) {
                  width: 100%;
                  margin: unset;
                  margin-top: var(--px-to-rem-14);
                  margin-bottom: var(--px-to-rem-14)
              }
  
              form.subscribe-form>div:first-of-type {
                  flex-direction: column;
                  width: 100%
              }
  
              form.subscribe-form>div.name-inputs>div {
                  flex-basis: unset;
                  width: 100%
              }
  
              form.subscribe-form>div.name-inputs>div:last-of-type {
                  margin-top: var(--px-to-rem-25);
                  margin-bottom: var(--px-to-rem-14)
              }
  
              form.subscribe-form>button {
                  width: 100%
              }
          }
      </style>
      <style>
          a[class*=button-],
          button[class*=button-] {
              border-radius: var(--px-to-rem-25);
              padding: var(--px-to-rem-16) var(--px-to-rem-20);
              font-size: var(--px-to-rem-14);
              font-weight: var(--font-weight-bold);
              text-decoration: none;
              text-transform: uppercase;
              text-align: center;
              white-space: nowrap;
              cursor: pointer;
              transition: background-color .2s;
              transition-timing-function: ease-in-out
          }
  
          a[class*=button-] {
              display: inline-block
          }
  
          a.button-main,
          button.button-main {
              background-color: var(--main-color);
              color: var(--contrast-color);
              border: none
          }
  
          a.button-main-hollow,
          button.button-main-hollow {
              background-color: transparent;
              color: var(--main-color);
              border: 1px solid var(--main-color)
          }
  
          a.button-contrast,
          button.button-contrast {
              background-color: var(--contrast-color);
              color: var(--opposite-color-);
              border: none
          }
  
          a.button-contrast-hollow,
          button.button-contrast-hollow {
              background-color: transparent;
              color: var(--opposite-color-);
              border: 1px solid var(--opposite-color-)
          }
  
          a.button-opposite,
          button.button-opposite {
              background-color: var(--opposite-color----);
              color: var(--contrast-color);
              border: 1px solid var(--contrast-color)
          }
  
          a[class*=button-]:disabled,
          button[class*=button-]:disabled {
              pointer-events: none;
              opacity: .5
          }
  
          a.button-main:hover,
          button.button-main:hover {
              background-color: var(--main-color-)
          }
  
          a.button-main-hollow:hover,
          button.button-main-hollow:hover {
              background-color: var(--contrast-color)
          }
  
          a.button-contrast:hover,
          button.button-contrast:hover {
              background-color: var(--contrast-color-)
          }
  
          a.button-contrast-hollow:hover,
          button.button-contrast-hollow:hover {
              background-color: var(--contrast-color)
          }
  
          a.button-opposite:hover,
          button.button-opposite:hover {
              background-color: var(--opposite-color---)
          }
  
          @media (prefers-reduced-motion:no-preference) {
  
              a[class*=button-],
              button[class*=button-] {
                  transition: background-color .2s, transform .2s
              }
  
              a[class*=button-]:hover,
              button[class*=button-]:hover {
                  transform: scale(.98)
              }
          }
  
          .card {
              background-color: var(--contrast-color);
              border-radius: var(--px-to-rem-8);
              overflow: hidden
          }
  
          .card:hover {
              text-decoration: none
          }
  
          .card a:not(.button-main),
          .card a:not(.styled-link) {
              text-decoration: none;
              color: var(--opposite-color-)
          }
  
          .card:hover>a:not(.styled-link) h2,
          .card:hover>a:not(.styled-link) p {
              color: var(--main-color);
              text-decoration: underline
          }
  
          .card {
              transition: box-shadow .5s;
              box-shadow: var(--box-shadow)
          }
  
          .card:hover {
              box-shadow: var(--box-shadow-hover)
          }
  
          .card.no-hover:hover {
              box-shadow: var(--box-shadow)
          }
  
          @media (min-width:902px) {
              .card.full-width-desktop {
                  width: 100%
              }
  
              .card.half-width-desktop {
                  width: calc(100% / 2)
              }
  
              .card.third-width-desktop {
                  width: calc(100% / 3)
              }
  
              .card.two-thirds-width-desktop {
                  max-width: calc(66.6% - var(--px-to-rem-32))
              }
  
              .card.fourth-width-desktop {
                  width: calc(100% / 4)
              }
          }
  
          .card.horizontal-flow {
              display: flex;
              flex-direction: row
          }
  
          .card.vertical-flow {
              display: flex;
              flex-direction: column
          }
  
          .card.short .card-image {
              height: 7.5rem;
              width: 100%;
              object-fit: cover
          }
  
          .card.medium .card-image {
              height: 9rem;
              width: 100%;
              object-fit: cover
          }
  
          .card.medium.person .card-image {
              height: 10.5rem;
              width: 100%;
              object-fit: cover
          }
  
          .card.tall .card-image {
              height: 11rem;
              width: 100%;
              object-fit: cover
          }
  
          .card.large-overview .card-image {
              height: 14rem;
              width: 100%;
              object-fit: cover
          }
  
          .card.large .card-image {
              height: 60%;
              width: 100%;
              object-fit: cover
          }
  
          .card.extra-large .card-image {
              height: 100%;
              width: 75%;
              object-fit: cover
          }
  
          .card.banner .card-image {
              height: 24rem;
              width: 66%;
              object-fit: cover
          }
  
          .card.book .card-image {
              display: block;
              height: 10.25rem;
              margin: 0 auto var(--px-to-rem-16) auto
          }
  
          @media (max-width:1281px) {
              .card.banner .card-image {
                  width: 100%;
                  height: 20rem
              }
          }
  
          @media (max-width:901px) {
              .card {
                  width: 100%
              }
  
              .card .card-image {
                  height: 10.5rem
              }
  
              .card.extra-large .card-image {
                  height: 50%;
                  width: 100%;
                  object-fit: cover
              }
  
              .card.large .card-image {
                  height: 15rem
              }
  
              .card.medium .card-image {
                  height: 10.5rem
              }
  
              .card.short .card-image {
                  height: 11.5rem;
                  width: 100%;
                  object-fit: cover
              }
  
              .card.tall .card-image {
                  height: 15.75rem
              }
  
              .card.banner .card-image {
                  height: 12rem;
                  width: 100%;
                  object-fit: cover
              }
  
              .card.book .card-image {
                  margin: 0 0 var(--px-to-rem-16) 0
              }
  
              .card.horizontal-flow {
                  flex-direction: column
              }
          }
  
          @media (max-width:421px) {
              .card {
                  width: 100%;
                  max-width: 100%
              }
          }
  
        
services.body_hash_sha1: sha1:c07cce1dd7e79dc17d18d4236d03e2167cb16b59
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-28T10:05:11.049246
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 36602
  Last-Modified: Tue, 23 Apr 2024 17:28:09 GMT
  Connection: keep-alive
  ETag: "6627efa9-8efa"
  Accept-Ranges: bytes
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.value: bootstrap
services.value: jquery
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-28T10:05:11.049246
services.uri: http://47.236.191.52:8010/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Tue, 23 Apr 2024 17:28:09 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "6627efa9-8efa"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 36602
services.html_tags: <title>kpi管理系统</title> <meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
services.body: <!DOCTYPE html>
  <html>
  <head>
  	<meta charset="UTF-8">
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  	<title>kpi管理系统</title>
  	<link href="resource/third-party/bootstrap/css/bootstrap.css" rel="stylesheet">
  	<style>
  		bigtitle {
  			margin: 10px;
  			margin-bottom: 100px;
  			font-family: "yahei", "微软雅黑", "宋体";
  			font-size: 25px;
  			color: #333333;
  			background-color: #ffffff;
  			overflow-x: auto;
  		}
  		body {
  			margin: 10px;
  			margin-bottom: 100px;
  			font-family: "yahei", "微软雅黑", "宋体";
  			font-size: 15px;
  			color: #333333;
  			background-color: #ffffff;
  			overflow-x: auto;
  		}
  		a:link, a:visited {
  			color: white;
  		}
  		.pg .current{
  			box-sizing: content-box;
  		}
  		table.wTable {
  			margin-top:5px;
  			margin-bottom: 5px;
  			border-collapse:collapse;
  			border:1px solid #aaa;
  			width:100%;
  		}
  		table.wTable th {
  			vertical-align:baseline;
  			padding:5px 15px 5px 6px;
  			background-color:#3F3F3F;
  			border:1px solid #3F3F3F;
  			text-align:left;
  			color:#fff;
  		}
  		table.wTable td {
  			vertical-align:text-top;
  			padding:6px 15px 6px 6px;
  			border:1px solid #aaa;
  		}
  		table.wTable tr:nth-child(odd) {
  			background-color:#F5F5F5;
  		}
  		table.wTable tr:nth-child(even) {
  			background-color:#fff;
  		}
  		textarea {
  			margin-top: 5px;
  			width:100%;
  			height:100%;
  			overflow-x: auto;
  		}
  		.footer {
  			position: fixed;
  			left: 0;
  			bottom: 0;
  			width: 100%;
  			background-color: #333;
  			color: white;
  			text-align: center;
  			padding: 10px 0;
  		}
  	</style>
  </head>
  
  <body>
  <script src="resource/js/jquery-2.0.3.min.js"></script>
  <script	src="resource/plugin/My97DatePicker/WdatePicker.js"></script>
  <script src="resource/js/bootstrap.min.js" type="text/javascript"></script>
  <div class="bigtitle">
  	<p style="font-size: 30px;">kpi管理系统</p>
  </div>
  <div id="pre_kpi_report" style="display:block">
  <!--	<div id="userLogin" style="display:none">-->
  <!--		<br>-->
  <!--		<label>第一步，</label>-->
  <!--		<input type="button" onClick="login();" value="企业微信登录"/>-->
  <!--		<p style="color:red" id="userLoginResult"></p>-->
  <!--	</div>-->
  	<div id="userStatus"></div>
  	<div>
  		<br>
  		<label>第1步，选日期(确认是kpi报告当月日期即可)</label>
  		<input class="form-control reportC" inputt="report_time" type="text" value="" name="report_time" id="report_time" onclick="WdatePicker({dateFmt:'yyyy-MM', maxDate:'%y-%M', onpicked:selectDate})" style="width:180px">
  	</div>
  	<div>
  		<br>
  		<label>第2步，</label>
  		<input type="button" onClick="showReport();" value="开始填报" id="show_report"/>
  		<p style="color:red" id="begin_report_result"></p>
  	</div>
  </div>
  <div id="main_kpi_report" style="display:none">
  	<p><b>
  		填报方法：<br>
  		&nbsp&nbsp 1. 按条填报和提交。<br>
  		&nbsp&nbsp 2. 修改后点"提交"，则更新之前的提交记录。<br>
  		&nbsp&nbsp 3. 点"删除"是删除当前一条记录。<br>
  	</b></p>
  	<br>
  	<p><b>本月工作业绩<span id="cur_month"></span></b></p>
  	<p id="edit_date_tips"></p>
  	<fieldset>
  		<table class="wTable" id="wTable_cur" style="background-color:#eeeeee;" bordercolor="#aaaaaa" border="1" cellpadding="0" cellpadding="2" width="100%">
  			<thead>
  			<tr>
  				<th style="width:70px;text-align:center;">操作</th>
  				<th style="width:100px;text-align:center;">主要职责</th>
  				<th style="width:200px;text-align:center;">业绩(工作项目)</th>
  				<th style="width:30px;text-align:center;">权重</th>
  				<th style="width:200px;text-align:center;">自评完成情况</th>
  				<th style="width:50px;text-align:center;">自评得分</th>
  				<th style="width:50px;text-align:center;">综合得分</th>
  			</tr>
  			</thead>
  			<tbody>
  			<tr id="cur_tr_0">
  				<td style="text-align:center;">
  					<input type="button" onClick="submitCurItem(0);" value="提交"/>&nbsp
  					<input type="button" onClick="delCurItem(0);" value="删除"/>
  					<p id="op_status" style="color:red" ></p>
  				</td>
  				<td><textarea id="title" rows="4";></textarea></td>
  				<td><textarea id="content" rows="4";></textarea></td>
  				<td><textarea id="weight" rows="4";></textarea></td>
  				<td><textarea id="memo" rows="4";></textarea></td>
  				<td><textarea id="self_score" rows="4";></textarea></td>
  				<td style="text-align:center;"><span id="weighted_score"></span></td>
  			</tr>
  			</tbody>
  		</table>
  	</fieldset>
  	<input id="add_row_cur" type="button" onClick="addRowCur();" value="添加一行"/>
  	&nbsp<span id="cur_total_weight"></span>
  	<!--	<div><br><input type="button" onClick="saveCur();" style="font-size:16px;" value=" 提交 "/></div>-->
  
  	<br><br><br>
  	<p><b>本月总结(优点、缺点、如何改进)</b></p>
  	<div>
  		<textarea id="summary" style="width:700px;" rows="5"></textarea>
  	</div>
  
  	<input id="save_summary" type="button" onClick="saveSummary();" value=" 提交 "/>
  	<p id="save_summary_op_status" style="color:red" ></p>
  
  	<br><br><br>
  	<p><b>下个月的计划<span id="next_month"></span></b></p>
  	<fieldset>
  		<table class="wTable" id="wTable_next" style="background-color:#eeeeee;" bordercolor="#aaaaaa" border="1" cellpadding="0" cellpadding="2" width="100%">
  			<thead>
  			<tr>
  				<th style="width:70px;text-align:center;">操作</th>
  				<th style="width:100px;text-align:center;">主要职责</th>
  				<th style="width:300px;text-align:center;">业绩(工作项目)</th>
  				<th style="width:30px;text-align:center;">权重</th>
  			</tr>
  			</thead>
  			<tbody>
  			<tr id="next_tr_0">
  				<td style="text-align:center;">
  					<input type="button" onClick="submitNextItem(0);" value="提交"/>&nbsp
  					<input type="button" onClick="delNextItem(0);" value="删除"/>
  					<p id="op_status" style="color:red" ></p>
  				</td>
  				<td><textarea id="title" rows="4";></textarea></td>
  				<td><textarea id="content" rows="4";></textarea></td>
  				<td><textarea id="weight" rows="4";></textarea></td>
  			</tr>
  			</tbody>
  		</table>
  	</fieldset>
  
  	<input id="add_row_next" type="button" onClick="addRowNext();" value="添加一行"/>
  	&nbsp<span id="next_total_weight"></span>
  	<!--	<div><br><input type="button" onClick="saveNext();" style="font-size:16px;" value=" 提交 "/></div>-->
  </div>
  
  <script>
  	const DEBUG = true;
  	// 一般是每个月的最后一周进行述职，所以填报时间是述职前一周，到述职后几天
  	const START_PERIOD_DAY = 13; // 每个月哪一天开始填报
  	const END_PERIOD_DAY = 7;	// 每个月哪一天结束填报
  	var IS_IN_EDIT_PERIOD = false; // 是否在填报时间内
  	const ERROR_CODE_NOT_IN_PERIOD = 4;  // 不在填报时间
  	const ERROR_MSG_NOT_IN_PERIOD = "当前不在系统填报时间";
  	var IS_FIRST_SUBMIT = false; // 是否是第一次填报kpi的新同事
  	var curKpiId; 	// 对应用户当前月度的kpi记录
  	var nextKpiId; 	// 对应用户下个月度的kpi记录
  	var curKpiIndex = 0; // 当月kpi表，行index
  	var nextKpiIndex = 0; // 下个月kpi表，行index
  	var lastKpiDate; // 上一个kpi总结的月份
  	var curKpiDate; // 当前kpi总结的月份
  	var nextKpiDate; // 下一个kpi的月份
  	var userId; // 用户名
  	var sessionKey; // 后面用于操作认证校验
  	if(DEBUG){
  		userId = "michael"; // for test
  	}
  
  	function selectDate(){
  		// alert("selectDate");
  		setKpiMonth(document.getElementById("report_time").value); // 设置当前月和下个月的月份
  		showLogin();
  	}
  
  	// 获取指定名称的cookie值：
  	function getCookie(key){
  		var arr1 = document.cookie.split('; ');
  		for(var i = 0; i < arr1.length; i++){
  			var arr2 = arr1[i].split('=');
  			if(arr2[0] == key){
  				return arr2[1];//对编码后的内容进行解码
  			}
  		}
  	}
  
  	// 设置cookie, 同时设置cookie的有效时间，是有效时间t的单位是"天"
  	function setCookie(key, value, t){
  		var oDate = new Date();
  		oDate.setDate(oDate.getDate()+t);
  		//使用escape()对内容进行编码
  		document.cookie = key+'='+value+';expires='+oDate.toGMTString();
  	}
  
  	// 移除cookie
  	function removeCookie(key){
  		setCookie(key,'',-1);
  	}
  
  	// 加载完页面后读取url参数，如果有code参数，则执行登录
  	window.addEventListener("load", function(){
  		setKpiMonth(); // 先执行一次
  		showLogin();
  		var query = window.location.search.substring(1);
  		var vars = query.split("&");
  		for (var i = 0; i < vars.length; i++) {
  			var pair = vars[i].split("=");
  			console.log("loginflag:" + getCookie("loginflag"));
  			//如果当前元素的键等于参数名，则返回对应的值
  			if (pair[0] == "code" && getCookie("loginflag")) {
  				removeCookie("loginflag");
  				code = pair[1];
  				doLogin(code);
  			}
  		}
  	});
  
  	// 如果已有登录态，展示用户信息。如果没有登录态，展示登录按钮
  	function showLogin(){
  		// userId = getCookie("loginuser");
  		//
  		// console.log("userId:", userId);
  		// // 已登录
  		// if(typeof userId != "undefined" || userId == ""){
  		// 	document.getElementById('userLogin').style.display = "none";
  		// 	var userHtml = '<span>当前用户：</span><span><b>' + userId + '</b> </span> <input type="button" onClick="unLogin();" value="登出"/>';
  		// 	$('#userStatus').html(userHtml);
  		// 	document.getElementById('userStatus').style.display = "block";
  		//
  		// 	console.log("showLogin. IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  		// 	if(IS_IN_EDIT_PERIOD == false){
  		// 		document.getElementById("show_report").value = "查看填报";
  		// 	} else{
  		// 		document.getElementById("show_report").value = "开始填报";
  		// 	}
  		// } else{
  		// 	document.getElementById('userStatus').style.display = "none";
  		// 	document.getElementById('userLogin').style.display = "block";
  		// }
  	}
  
  	// 登出
  	function unLogin(){
  		removeCookie("loginuser");
  		console.log("cookie loginuser:", getCookie("loginuser"));
  		showLogin();
  	}
  
  	// 登录
  	function doLogin(code){
  
  	}
  
  	// 企业微信快捷登录
  	function login(){
  	}
  
  	// 当前月kpi添加一行
  	function addRowCur(){
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var tr = tbody.insertRow(tbody.rows.length);
  		curKpiIndex++; // 添加一行，index也要随之增加
  
  		var trHtml = "<td style=\"text-align:center;\"><input type=\"button\" onClick=\"submitCurItem("+curKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  				"<input type=\"button\" onClick=\"delCurItem("+curKpiIndex+");\" value=\"删除\"/>\n" +
  				"<p id=\"op_status\" style=\"color:red\" ></p></td>" +
  				"<td><textarea id=\"title\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"content\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"weight\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"memo\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"self_score\" rows=\"4\";></textarea></td>\n" +
  				"<td style=\"text-align:center;\"><span id=\"weighted_score\"></span></td>\n";
  
  		tr.id = "cur_tr_"+curKpiIndex;
  		tr.innerHTML = trHtml;
  	}
  
  	// 下个月kpi添加一行
  	function addRowNext(){
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var tr = tbody.insertRow(tbody.rows.length);
  		nextKpiIndex++; // 添加一行，index也要随之增加
  
  		var trHtml = "<td style=\"text-align:center;\">\n" +
  				"<input type=\"button\" onClick=\"submitNextItem("+nextKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  				"<input type=\"button\" onClick=\"delNextItem("+nextKpiIndex+");\" value=\"删除\"/>\n" +
  				"<p id=\"op_status\" style=\"color:red\" ></p>\n" +
  				"</td>\n" +
  				"<td><textarea id=\"title\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"content\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"weight\" rows=\"4\";></textarea></td>";
  		// tr.style.height = "80px";
  		tr.id = "next_tr_"+nextKpiIndex;
  		tr.innerHTML = trHtml;
  	}
  
  	// 显示kpi填报页
  	function showReportMainPage(flag){
  		if(flag){
  			document.getElementById("main_kpi_report").style.display = "block";
  			document.getElementById("pre_kpi_report").style.display = "none";
  
  		}else{
  			document.getElementById("main_kpi_report").style.display = "none";
  			document.getElementById("pre_kpi_report").style.display = "block";
  		}
  	}
  
  	// 展示已填报的kpi
  	function showReport(){
  		setKpiMonth(document.getElementById("report_time").value); // 设置当前月和下个月的月份
  		// if(typeof userId == "undefined"){
  		// 	$('#begin_report_result').html("请先登录");
  		// 	return;
  		// }
  
  		queryReport(userId, curKpiDate); // 查询当月kpi记录，包括当月总结
  		queryReport(userId, nextKpiDate); // 查询下个月kpi记录
  	}
  
  	// 查询已填报的kpi
  	function queryReport(_userId, _kpiDate){
  		if(typeof _userId == "undefined" || _userId == ""){
  			_userId = userId;
  		}
  		if(typeof _kpiDate == "undefined" || _kpiDate == 0){
  			_kpiDate = curKpiDate;
  		}
  
  		console.log('用户ID:', _userId);
  		console.log('kpi日期:', _kpiDate);  // 格式为:YYYYMM
  		var data = {
  			user_id: _userId,
  			begin_month: _kpiDate,
  			end_month: _kpiDate
  		}
  
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/query_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				var code = response.err_code;
  				if(response.err_code != 0){
  					// 没有记录
  					if(code == 107){
  						// 如果当前kpiid记录不存在，就创建一个
  						createMonth(_userId, _kpiDate);	// 创建kpi记录
  					} else {
  						$('#begin_report_result').html(response.ret_msg);
  					}
  				} else{
  					$('#begin_report_result').html('查询成功');
  
  					if(response.data.length > 0){
  						var res = response.data[0];
  						if(curKpiDate == _kpiDate){
  							curKpiId = res.id;
  							showSummary(res.memo);
  							showCurKpiItems(res.details);
  						}else if(nextKpiDate == _kpiDate){
  							nextKpiId = res.id;
  							showNextKpiItems(res.details);
  						}
  						console.log("kpiDate:" + _kpiDate + ", kpiId:", res.id);
  					}
  				}
  			},
  			error: function(xhr, status, error) {
  				$('#begin_report_result').html('查询遇到后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	 // 是否是第一次填报kpi的新同事
  	function isFirstSubmit(){
  		var data = {
  			user_id: userId,
  			begin_month: lastKpiDate,
  			end_month: lastKpiDate
  		}
  
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/query_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				var code = response.err_code;
  				if(response.err_code != 0){
  					// 没有记录
  					if(code == 107){
  						return true; // 上个月无记录，是新同事
  					} else {
  						console.log('查询上个月kpi记录遇到后台错误：' + response.ret_msg);
  					}
  				} else{
  					return false; // 上个月有记录，不是新同事
  				}
  			},
  			error: function(xhr, status, error) {
  				console.log('查询上个月kpi记录遇到后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	// 展示当月kpi填报记录
  	function showCurKpiItems(detailArr){
  		showReportMainPage(true);
  
  		if(detailArr == null || detailArr.length <= 0){
  			return;
  		}
  
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var total_weight = 0;
  		var total_score = 0;
  		document.getElementById("cur_tr_0").remove(); // 删除原先的第一条
  		$.each(detailArr, function(i, detail) {
  			var tr = tbody.insertRow(tbody.rows.length);
  			var weighted_score = detail.weight * detail.self_score / 100.0;
  			var trHtml = "";
  
  			// 第一次提交kpi的同事，才能对当月的kpi所有字段进行编辑
  			// if(isFirstSubmit()){
  			if(true){
  				trHtml = "<td style=\"text-align:center;\"><input type=\"button\" onClick=\"submitCurItem("+curKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  					"<input type=\"button\" onClick=\"delCurItem("+curKpiIndex+");\" value=\"删除\"/>\n" +
  					"<p id=\"op_status\" style=\"color:red\" ></p></td>" +
  					"<td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>\n" +
  					"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>\n" +
  					"<td><textarea id=\"memo\" rows=\"4\";>"+detail.memo+"</textarea></td>\n" +
  					"<td><textarea id=\"self_score\" rows=\"4\";>"+detail.self_score+"</textarea></td>\n" +
  					"<td style=\"text-align:center;\"><span id=\"weighted_score\">"+weighted_score+"</span></td>\n";
  				document.getElementById("add_row_cur").style.display = "block";
  			} else{
  				trHtml = "<td style=\"text-align:center;\"></td><td><span id=\"title\" rows=\"4\";>"+detail.title+"</span></td>" +
  						"<td><span id=\"content\" rows=\"4\";>"+detail.content+"</span></td>\n" +
  					"<td><span id=\"weight\" rows=\"4\";>"+detail.weight+"</span></td>\n" +
  					"<td><textarea id=\"memo\" rows=\"4\";>"+detail.memo+"</textarea></td>\n" +
  					"<td><textarea id=\"self_score\" rows=\"4\";>"+detail.self_score+"</textarea></td>\n" +
  					"<td style=\"text-align:center;\"><span id=\"weighted_score\">"+weighted_score+"</span></td>\n";
  				document.getElementById("add_row_cur").style.display = "none";
  			}
  
  
  			tr.value = detail.id;
  			tr.id = "cur_tr_"+curKpiIndex;
  			tr.innerHTML = trHtml;
  			curKpiIndex++; // 添加一行，index也要随之增加
  			total_weight += detail.weight;
  			total_score += weighted_score;
  			console.log("i:"+i+" detail_id:"+detail.id+" title:"+detail.title+" content:"+detail.content+" weight:"+detail.weight
  					+" self_score:"+detail.self_score+" memo:"+detail.memo);
  		});
  		calCurScore();
  	}
  
  	// 当前月份汇总计算
  	function calCurScore(){
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var trList = tbody.getElementsByTagName("tr");
  		var totalWeight = 0;
  		var totalScore = 0;
  		// var rows = tbody.rows;
  		for(var i = 0; i < trList.length; i++){
  			var tdList = trList[i].getElementsByTagName("td");
  			for(var j = 1; j < tdList.length; j++){
  				// 权重总和
  				var textarea = tdList[j].getElementsByTagName("textarea")[0];
  				if(textarea && textarea.getAttribute && textarea.getAttribute("id") == "weight"){
  					var value = parseInt(textarea.value) || 0;
  					totalWeight += value;
  				} else{ // 不可更改的情况
  					var spanarea = tdList[j].getElementsByTagName("span")[0];
  					if(spanarea && spanarea.getAttribute && spanarea.getAttribute("id") == "weight"){
  						var value = parseInt(spanarea.innerHTML) || 0;
  						totalWeight += value;
  					}
  				}
  				// 综合得分
  				var spanItem = tdList[j].getElementsByTagName("span")[0];
  				if(spanItem && spanItem.getAttribute && spanItem.getAttribute("id") == "weighted_score"){
  					var value = parseFloat(spanItem.innerHTML) || 0;
  					totalScore += value;
  				}
  			}
  		}
  		totalScore = parseFloat(totalScore).toFixed(2);
  		document.getElementById("cur_total_weight").innerHTML = "  权重总和：<span style='color:red'>" + totalWeight + "</span>，  综合总分：<span style='color:red'>" + totalScore + "</span>";
  	}
  
  	// 展示下个月kpi填报记录
  	function showNextKpiItems(detailArr){
  		if(IS_IN_EDIT_PERIOD == true){
  			document.getElementById("add_row_next").style.display = "block";
  		} else{
  			document.getElementById("add_row_next").style.display = "none";
  		}
  
  		if(detailArr == null || detailArr.length <= 0){
  			return;
  		}
  
  
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  
  		document.getElementById("next_tr_0").remove(); // 删除原先的第一条
  		$.each(detailArr, function(i, detail) {
  			var tr = tbody.insertRow(tbody.rows.length);
  			var trHtml = "<td style=\"text-align:center;\">\n" +
  					"<input type=\"button\" onClick=\"submitNextItem("+nextKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  					"<input type=\"button\" onClick=\"delNextItem("+nextKpiIndex+");\" value=\"删除\"/>\n" +
  					"<p id=\"op_status\" style=\"color:red\" ></p>\n" +
  					"</td>\n" +
  					"<td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>\n" +
  					"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>";
  
  			// 不在填报时间段内
  			if(IS_IN_EDIT_PERIOD == false){
  				trHtml = "<td style=\"text-align:center;\"></td><td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>" +
  						"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>";
  			}
  
  			tr.value = detail.id;
  			// tr.style.height = "80px";
  			tr.id = "next_tr_"+nextKpiIndex;
  			tr.innerHTML = trHtml;
  			nextKpiIndex++; // 添加一行，index也要随之增加
  			console.log("i:"+i+" detail_id:"+detail.id+" title:"+detail.title+" content:"+detail.content+" weight:"+detail.weight
  					+" self_score:"+detail.self_score+" memo:"+detail.memo);
  		});
  		calNextScore();
  	}
  
  	// 下个月份汇总计算
  	function calNextScore(){
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var trList = tbody.getElementsByTagName("tr");
  		var totalWeight = 0;
  		// var rows = tbody.rows;
  		for(var i = 0; i < trList.length; i++){
  			var tdList = trList[i].getElementsByTagName("td");
  			for(var j = 1; j < tdList.length; j++){
  				var textarea = tdList[j].getElementsByTagName("textarea")[0];
  				if(textarea && textarea.getAttribute){
  					var key = textarea.getAttribute("id");
  					var value = textarea.value;
  					// 权重
  					if(key == "weight"){
  						value = parseInt(value) || 0;
  						totalWeight += value;
  					}
  				}
  			}
  		}
  		totalWeight = parseInt(totalWeight);
  		document.getElementById("next_total_weight").innerHTML = "  权重总和：<span style='color:red'>" + totalWeight + "</span>";
  	}
  
  	/*
  	* 获取当前日期的上个月
  	* 例如，当前是2023-01-02，则返回202212
  	*
  	*/
  	function getLastMonth(){
  		var currentDate = new Date();
  		currentDate.setMonth(currentDate.getMonth()-1)
  		var year = currentDate.getFullYear();
  		var month = (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		var lastYearMonth = parseInt(year + month);
  
  		return lastYearMonth;
  	}
  
  	/*
  	 * 判断并设置是否在允许的填报期
  	 * currentDay: 当天，比如2023-11-03，currentDay=03
  	 * currentMonth: 系统当前时间的月份，比如2023-11-03，currentMonth=202311
  	 * selectMonth: 选择的月份，比如选择2023-10-01，selectMonth=202310
  	*/
  	function setIsInEditPeriod(currentDay, currentMonth, selectMonth){
  		currentDay = parseInt(currentDay);
  		// 填报时间大于允许的开始填报时间 或 小于允许的结束填报时间，则可以填报。
  
  		// if( (currentDay >= START_PERIOD_DAY || currentDay <= END_PERIOD_DAY) && (currentMonth == selectMonth) ){
  		// 可填报的时间段区间：当月大于开始时间 或 次月小于结束时间
  		if((currentDay >= START_PERIOD_DAY && currentMonth == selectMonth) || (currentDay <= END_PERIOD_DAY && getLastMonth() == selectMonth)){
  			IS_IN_EDIT_PERIOD = true;
  		} else {
  			IS_IN_EDIT_PERIOD = false;
  		}
  		console.log("currentDay:" + currentDay + " START_PERIOD_DAY:" + START_PERIOD_DAY + " END_PERIOD_DAY:" + END_PERIOD_DAY
  				+ " currentMonth:" + currentMonth + " getLastMonth:" + getLastMonth() + " selectMonth:" + selectMonth + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  	}
  
  	function setEditTips(currentDay, currentYearMonth, selectYearMonth, startEditDay, endEditDay){
  		var tipsHtml = '';
  		console.log("currentDay:" + currentDay + " currentYearMonth:" + currentYearMonth + " selectYearMonth:" + selectYearMonth +
  				" startEditDay:" + startEditDay + " endEditDay:" + endEditDay + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  		// 将来月份填报还未开始
  		if(currentYearMonth < selectYearMonth){
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报还未开始)</span>';
  		} else if(currentYearMonth == selectYearMonth && currentDay < START_PERIOD_DAY) { // 本月填报还未开始
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报将于'+(startEditDay)+'开始)</span>';
  		} else if(IS_IN_EDIT_PERIOD == true){ // 填报已开始
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报将于'+(endEditDay)+'结束提交，结束后不能修改)</span>';
  		} else{ // 填报已结束
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报已结束)</span>';
  		}
  		tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报已开始)</span>'
  		document.getElementById("edit_date_tips").innerHTML = tipsHtml;
  	}
  
  	// 设置当前kpi及下个kpi的月度
  	function setKpiMonth(date){
  		var currentDate = new Date();
  		var currentYear = currentDate.getFullYear();
  		var currentMonth = (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		var currentDay = currentDate.getDate().toString().padStart(2, '0');
  		var currentYearMonth = parseInt(currentYear+currentMonth);
  
  
  		var selectDate = date ? new Date(date) : currentDate;
  
  		// 当天日期如果小于开始填报时间，则还未开始填报，先默认展示上个月
  		if(currentDay < START_PERIOD_DAY){
  			currentDate.setMonth(currentDate.getMonth()-1);
  			document.getElementById("report_time").value = currentDate.getFullYear() + '-' + (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		}
  
  		var year = selectDate.getFullYear();
  		var month = (selectDate.getMonth() + 1).toString().padStart(2, '0');  // 获取当前月份（注意月份从0开始，所以需要加1）
  		var day = selectDate.getDate().toString().padStart(2, '0');
  		var selectYearMonth = parseInt(year+month);
  		document.getElementById("report_time").value = year + '-' + month;
  
  		setIsInEditPeriod(currentDay, currentYearMonth, selectYearMonth);
  		var startEditDay = year + "-" + month + '-' + START_PERIOD_DAY;
  		var endEditDay = year + "-" + month + '-' + END_PERIOD_DAY;
  		setEditTips(currentDay, currentYearMonth, selectYearMonth, startEditDay, endEditDay);
  
  
  		console.log("day:" + (year+month+day) + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  
  		// 当天日期如果小于等于结束填报时间，则按照上个月的填报期来算
  		// if(currentDay <= END_PERIOD_DAY){
  		// 	selectDate.setMonth(selectDate.getMonth()-1)
  		// 	month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		// }
  
  		document.getElementById("cur_month").innerHTML = "("+year + "-" + month+")";
  		curKpiDate = parseInt(year + month);
  
  		// 下一个kpi月
  		selectDate.setMonth(selectDate.getMonth()+1, 1); //setMonth有顺延现象: 当前月份如果没有31天,而设置了31的话,当前月份会顺延。所以主动设置日期为1号
  		year = selectDate.getFullYear();
  		month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		console.log('next: year：' + year + ' month:' + month);  // year month
  		document.getElementById("next_month").innerHTML = "("+year + "-" + month+")";
  		nextKpiDate = parseInt(year + month);
  
  		// 上一个kpi月
  		selectDate.setMonth(selectDate.getMonth()-2, 1);
  		year = selectDate.getFullYear();
  		month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		lastKpiDate = parseInt(year + month);
  	}
  
  	// 创建月度kpi记录
  	function createMonth(_userId, _kpiDate){
  		var data = {
  			user_id: _userId,
  			month: _kpiDate
  		};
  
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/create_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					$('#begin_report_result').html(response.ret_msg);
  				} else{
  					$('#begin_report_result').html('成功');
  
  					if(curKpiDate == _kpiDate){
  						curKpiId = response.data.kpi_id;
  					}else if(nextKpiDate == _kpiDate){
  						nextKpiId = response.data.kpi_id;
  					}
  					console.log("kpiId:", response.data.kpi_id);
  					showReportMainPage(true);
  				}
  			},
  			error: function(xhr, status, error) {
  				if(DEBUG){
  					showReportMainPage(true);
  					return;
  				}
  				$('#begin_report_result').html('后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	// 提交当前月kpi记录
  	function submitCurItem(index){
  		var trTag = "cur_tr_" + index;
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  		// var requiredItems = ["title","content","weight","memo","self_score"];
  		var requiredItemsTextarea = ["memo","self_score"];
  		var requiredItemsSpan = ["title","content","weight"];
  
  		// var data = [];
  		var row = {};
  		row["kpi_id"] = curKpiId;
  		for (var j = 1; j < tdList.length; j++) {
  			var textarea = tdList[j].getElementsByTagName("textarea")[0];
  			if(textarea && textarea.getAttribute){
  				var key = textarea.getAttribute("id");
  				var value = textarea.value;
  				if(key == "weight" || key == "self_score")
  					value = parseInt(value) || 0;
  
  				if(requiredItemsTextarea.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  			var spanarea = tdList[j].getElementsByTagName("span")[0];
  			if(spanarea && spanarea.getAttribute){
  				var key = spanarea.getAttribute("id");
  				var value = spanarea.innerHTML;
  				if(key == "weight")
  					value = parseInt(value) || 0;
  
  				if(requiredItemsSpan.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  			// 计算和显示综合得分
  			var spanItem = tdList[j].getElementsByTagName("span")[0];
  			if(spanItem && spanItem.getAttribute){
  				if(spanItem.getAttribute("id") == "weighted_score"){
  					spanItem.innerHTML = parseFloat(row["weight"] * row["self_score"] / 100.0).toFixed(2);
  				}
  			}
  		}
  		// row["title"] = "职责大类"; //后面title会用到，表示职责分类
  		var detailId = trItem.value;
  		if(typeof detailId != "undefined" && parseInt(detailId) > 0){
  			row["detail_id"] = parseInt(detailId);
  			updateKpiItem(row, opStatus, "curmonth");
  		}else{
  			addKpiItem(row, opStatus, trItem, "curmonth");
  		}
  
  		// data.push(row);
  		console.log(JSON.stringify(row));
  	}
  
  	// 提交下个月kpi记录
  	function submitNextItem(index){
  		var trTag = "next_tr_" + index;
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  		var requiredItems = ["title","content","weight"];
  		// var requiredItems = ["content","weight"];
  
  		// var data = [];
  		var row = {};
  		row["kpi_id"] = nextKpiId;
  		for (var j = 1; j < tdList.length; j++) {
  			var textarea = tdList[j].getElementsByTagName("textarea")[0];
  			if(textarea && textarea.getAttribute){
  				var key = textarea.getAttribute("id");
  				var value = textarea.value;
  				if(key == "weight")
  					value = parseInt(value) || 0;
  
  				if(requiredItems.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  		}
  		// row["title"] = "职责大类"; //后面title会用到，表示职责分类
  		var detailId = trItem.value;
  		if(typeof detailId != "undefined" && parseInt(detailId) > 0){
  			row["detail_id"] = parseInt(detailId);
  			updateKpiItem(row, opStatus, "nextmonth");
  		}else{
  			addKpiItem(row, opStatus, trItem, "nextmonth");
  		}
  
  		// data.push(row);
  		console.log(JSON.stringify(row));
  	}
  
  	// 重新计算权重和总分
  	function calScore(monthFlag){
  		if(monthFlag == "curmonth") {
  			calCurScore();
  		}else if(monthFlag == "nextmonth") {
  			calNextScore();
  		}
  	}
  
  	// 更新kpi记录
  	function updateKpiItem(rowData, opStatus, monthFlag){
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/mod_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(rowData),
  			contentType: 'application/json',
  			success: function(response) {
  				// 添加成功
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '提交成功';
  					calScore(monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '提交失败，请联系开发同事';
  			}
  		});
  	}
  
  	// 新增kpi记录
  	function addKpiItem(rowData, opStatus, trItem, monthFlag){
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/add_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(rowData),
  			contentType: 'application/json',
  			success: function(response) {
  				// 添加成功
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '提交成功';
  					trItem.value = response.data.detail_id;
  					calScore(monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '提交失败，请联系开发同事';
  			}
  		});
  	}
  
  	// 删除一条本月kpi记录
  	function delCurItem(index){
  		var trTag = "cur_tr_" + index;
  		delItem(index, trTag, "curmonth");
  	}
  
  	// 删除一条下月kpi记录
  	function delNextItem(index) {
  		var trTag = "next_tr_" + index;
  		delItem(index, trTag, "nextmonth");
  	}
  
  	// 删除记录后的处理
  	function afterDelItem(index, monthFlag){
  		if(monthFlag == "curmonth"){
  			if(index == curKpiIndex){
  				curKpiIndex--;
  			}
  			calCurScore();
  		}
  
  		if(monthFlag == "nextmonth"){
  			if(index == nextKpiIndex){
  				nextKpiIndex--;
  			}
  			calNextScore();
  		}
  	}
  
  	function delItem(index, trTag, monthFlag){
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  
  		console.log("trItem.value:" + trItem.value);
  		if(typeof trItem.value == "undefined"){
  			trItem.remove();
  			afterDelItem(index, monthFlag);
  		}
  		var detailId = trItem.value; // kpi每条记录的id
  		var data = {
  			detail_id: detailId
  		};
  
  		console.log(JSON.stringify(data));
  
  		// 调用接口删除数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/del_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '删除成功';
  					trItem.remove();
  					afterDelItem(index, monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '删除失败，请联系开发同事';
  			}
  		});
  	}
  
  	function showSummary(summary){
  		if(IS_IN_EDIT_PERIOD == true){
  			document.getElementById("save_summary").style.display = "block";
  		} else{
  			document.getElementById("save_summary").style.display = "none";
  		}
  
  		if(typeof summary == "undefined" || summary == ""){
  			return;
  		}
  		document.getElementById("summary").innerHTML = summary;
  
  	}
  
  	function saveSummary(){
  		var monthSummary = document.getElementById("summary").value;
  		var data = {
  			kpi_id: curKpiId,
  			memo: monthSummary
  		};
  
  		console.log(JSON.stringify(data));
  
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/set_kpi_memo',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						$('#save_summary_op_status').html(ERROR_MSG_NOT_IN_PERIOD);
  					}else{
  						$('#save_summary_op_status').html(response.ret_msg);
  					}
  				} else{
  					$('#save_summary_op_status').html('提交成功');
  				}
  			},
  			error: function(xhr, status, error) {
  				$('#save_summary_op_status').html('提交失败，请联系开发同事');
  			}
  		});
  	}
  </script>
  <div class="footer">
    <p>Copyright © 飞笛科技&nbsp;&nbsp;<a target="_blank" href="https://beian.miit.gov.cn">（粤ICP备16035685号）</a></p>
  </div>
  </body>
  </html>
  
services.name: http://47.236.191.52:8010/favicon.ico
services.body_hash_sha1: sha1:3e4fdd721f748a4c03d50cf242e9740d75f83163
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T19:00:31.634435
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 7679
  Last-Modified: Sun, 28 Jul 2024 05:18:00 GMT
  Connection: keep-alive
  ETag: "66a5d488-1dff"
  Accept-Ranges: bytes
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.value: bootstrap
services.value: jquery
services.value: modernizr
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T19:00:31.634435
services.uri: http://47.236.191.52:8088/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Sun, 28 Jul 2024 05:18:00 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "66a5d488-1dff"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 7679
services.html_tags: <title>AI电力助手</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1">
services.body: <!DOCTYPE html>
  <html class="no-js" lang="">
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta http-equiv="x-ua-compatible" content="ie=edge">
      <title>AI电力助手</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <style>
          /*#ehelper-input { font-family: "宋体"; font-size: 20px; color: #0000FF; font-weight: bold; }*/
          #ehelper-input { font-size: 18px; color: #0000FF; font-weight: bold; }
          #ehelper-response { font-size: 18px; color: #0000FF; font-weight: bold; }
      </style>
      <!-- favicon icon -->
      <link rel="icon" href="img/favicon.png">
      <!-- All CSS Files Here -->
      <link rel="stylesheet" href="css/bootstrap.min.css">
      <link rel="stylesheet" href="css/et-line-fonts.css">
      <link rel="stylesheet" href="css/ionicons.min.css">
      <link rel="stylesheet" href="css/magnific-popup.css">
      <link rel="stylesheet" href="css/meanmenu.css">
      <link rel="stylesheet" href="css/global.css">
      <link rel="stylesheet" href="style.css">
      <link rel="stylesheet" href="css/responsive.css">
      <script src="js/modernizr-2.8.3.min.js"></script>
    </head>
    <body>
      <div class="page-loader">
        <div class="loader">Loading...</div></div>
      <header id="sticky-header" class="">
        <div class="header-area">
          <div class="container sm-100">
            <div class="row">
              <div class="col-md-3 col-sm-3">
                <div class="logo text-upper">
                  <h4>
                    <a href="index.html">AI电力助手</a></h4>
                </div>
              </div>
            </div>
          </div>
        </div>
      </header>
      <div class="basic-portfolio-area ptb-10">
        <div class="gray-bg text-center">
  
        </div>
        <div class="call-to-action-area gray-bg ptb-10">
          <div class="container">
            <div class="row">
                <div class="col-md-3 col-sm-3 col-xs-3">
                    <div class="col-12">
                        <img src="img/portrait.jpg" class="ptb-10">
                    </div>
                    <br><br>
  
                    <div class="col-12 text-center">
                      <button id="audioInteractModeBtn"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #666; color: #f4f4f4; border-radius: 10px;">
                        <span id="audioInteractModeBtnText" class="spinner-border spinner-border-sm" role="status" aria-hidden="true">进入演示模式</span></button>
                    </div>
                      <br><br>
                     <div class="col-12 filter-menu">
                        <span id="interactModeText" class="color:#f4f4f4" role="status" aria-hidden="true">
                            进入演示模式后，您可以这样提问：<br>
                              1.请先说：【小电小电】，唤醒AI助手。<br>
                              2.等待AI助手回复后，再说出您的问题。<br>
                              3.想让AI助手停止语音播报，请说：【停止】。<br>
                              4.要退出演示模式，请说：【退出】，或点击上方【退出演示模式按钮】。<br>
                        </span>
                    </div>
                </div>
              <div class="col-md-9 col-sm-9 col-xs-9">
                  <div class="col-12">
                    <div class="form-group">
                      <!--<label></label>-->
                      <textarea class="form-control" id="ehelper-input" placeholder="" rows="3" resize="none" style="width: 100%; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 12px;"></textarea>
                    </div>
                  </div>
                  <div class="col-12">
                      <div class="call-to-action">
                          <div class="col-3">
                              <button id="recordButton" onclick="recordAudio()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;">
                                  <span id="recordButtonText" class="spinner-border spinner-border-sm" role="status" aria-hidden="true">语音提问</span></button>
                              <img id="volume-gif" style="width:40px;height:40px;display:none;" src="./img/volume.gif" alt="Volume Indicator" />
                              <span>  </span>
                              <img id="stop-play-voice" style="width:30px;height:30px;display:none;" src="./img/stop-play.jpg" alt="停止播放" />
                              <!--<button id="stop-play-voice" onclick="stopPlayVoice()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;display: none;">停止播放</button>-->
                          </div>
                          <div class="col-3">
                          <button id="callEhelperButton" onclick="callEhelper()"  autocomplete="off" class="btn btn-large" href="#" style="background-color: #333; color: #f4f4f4; border-radius: 10px;">
                              <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true">文字提问</span></button>
                          </div>
                          <br><br>
                      </div>
                  </div>
                  <div class="col-12">
                      <div class="form-group">
                        <label></label>
                        <textarea class="form-control" id="ehelper-response" placeholder="" rows="16" resize="none" style="width: 100%;height: auto; margin: 0 auto; background-color: #f4f4f4; color: #333; border: 1px solid #ccc; border-radius: 10px; overflow: scroll;" readonly="true"></textarea>
  <!--                        <div id="markdown-response"></div>-->
                      </div>
                      <audio id="audioPlayer" controls style="display:none"></audio>
                  </div>
              </div>
            </div>
          </div>
          <footer>
              <div class="basic-footer gray-bg text-center ptb-10">
                  <div class="container">
                      <div class="footer-logo mb-30">
                          <h6>内容由AI大模型生成</h6>
                      </div>
                  </div>
              </div>
          </footer>
  
          <script src="js/jquery-1.12.0.min.js"></script>
          <script src="js/bootstrap.min.js"></script>
          <script src="js/isotope.pkgd.min.js"></script>
          <script src="js/imagesloaded.pkgd.min.js"></script>
          <script src="js/jquery.magnific-popup.min.js"></script>
          <script src="js/jquery.meanmenu.js"></script>
          <script src="js/plugins.js"></script>
          <script src="js/main.js"></script>
          <script src="js/ehelper.js"></script>
          <script src="js/audiorecorder.js"></script>
  <!--        <script src="js/marked.min.js"></script>-->
          
          <script>
            // 输入文本框自适应调整高度
            var input_textarea = document.getElementById('ehelper-input')
            input_textarea.addEventListener('input', (e) => {
              input_textarea.style.height = '76px';
              input_textarea.style.height = e.target.scrollHeight + 'px';
            });
            // document.getElementById('ehelper-response').addEventListener('input', function() {
            //     console.log("marked:" + this.value);
            //     document.getElementById('ehelper-response').innerHTML = marked(this.value);
            // });
          </script>
  
  </div></div><a id="scrollUp" href="index.html#top" style="position: fixed; z-index: 2147483647; display: none;"><i class="ion-chevron-up"></i></a></body></html>
  
services.name: http://47.236.191.52:8088/img/favicon.png
services.body_hash_sha1: sha1:68a8e0e4329acb7eb487e08f0e5e54af74b5d727
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-28T07:08:44.912597
services.banner: HTTP/1.1 200 OK
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 36602
  Last-Modified: Tue, 23 Apr 2024 17:28:09 GMT
  Connection: keep-alive
  ETag: "6627efa9-8efa"
  Accept-Ranges: bytes
  
services.version_selected: TLSv1_2
services.cipher_selected: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
services.ja4s: t120300_cca8_bec8bdbaef8a
services.version: TLSv1_2
services.ja4s: t120300_cca8_bec8bdbaef8a
services.version: TLSv1_1
services.ja4s: t110200_c013_344b4dce5a52
services.version: TLSv1_0
services.ja4s: t100200_c013_344b4dce5a52
services.issuer_dn: C=CN, ST=gd, L=shenzhen, O=yc, OU=yc, CN=yc, emailAddress=steve_pann@outlook.com
services.common_name: yc
services.country: CN
services.locality: shenzhen
services.province: gd
services.organization: yc
services.organizational_unit: yc
services.email_address: steve_pann@outlook.com
services.subject_dn: C=CN, ST=gd, L=shenzhen, O=yc, OU=yc, CN=yc, emailAddress=steve_pann@outlook.com
services.common_name: yc
services.country: CN
services.locality: shenzhen
services.province: gd
services.organization: yc
services.organizational_unit: yc
services.email_address: steve_pann@outlook.com
services.scan_time: 2025-07-23T04:55:16.738471
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.value: bootstrap
services.value: jquery
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-28T07:08:44.912597
services.uri: https://47.236.191.52:8443/
services.protocol: HTTP/1.1
services.status_reason: OK
services.key: Last-Modified
services.headers: Tue, 23 Apr 2024 17:28:09 GMT
services.key: Server
services.headers: nginx/1.20.1
services.key: Accept-Ranges
services.headers: bytes
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: ETag
services.headers: "6627efa9-8efa"
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 36602
services.html_tags: <title>kpi管理系统</title> <meta charset="UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
services.body: <!DOCTYPE html>
  <html>
  <head>
  	<meta charset="UTF-8">
  	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  	<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
  	<title>kpi管理系统</title>
  	<link href="resource/third-party/bootstrap/css/bootstrap.css" rel="stylesheet">
  	<style>
  		bigtitle {
  			margin: 10px;
  			margin-bottom: 100px;
  			font-family: "yahei", "微软雅黑", "宋体";
  			font-size: 25px;
  			color: #333333;
  			background-color: #ffffff;
  			overflow-x: auto;
  		}
  		body {
  			margin: 10px;
  			margin-bottom: 100px;
  			font-family: "yahei", "微软雅黑", "宋体";
  			font-size: 15px;
  			color: #333333;
  			background-color: #ffffff;
  			overflow-x: auto;
  		}
  		a:link, a:visited {
  			color: white;
  		}
  		.pg .current{
  			box-sizing: content-box;
  		}
  		table.wTable {
  			margin-top:5px;
  			margin-bottom: 5px;
  			border-collapse:collapse;
  			border:1px solid #aaa;
  			width:100%;
  		}
  		table.wTable th {
  			vertical-align:baseline;
  			padding:5px 15px 5px 6px;
  			background-color:#3F3F3F;
  			border:1px solid #3F3F3F;
  			text-align:left;
  			color:#fff;
  		}
  		table.wTable td {
  			vertical-align:text-top;
  			padding:6px 15px 6px 6px;
  			border:1px solid #aaa;
  		}
  		table.wTable tr:nth-child(odd) {
  			background-color:#F5F5F5;
  		}
  		table.wTable tr:nth-child(even) {
  			background-color:#fff;
  		}
  		textarea {
  			margin-top: 5px;
  			width:100%;
  			height:100%;
  			overflow-x: auto;
  		}
  		.footer {
  			position: fixed;
  			left: 0;
  			bottom: 0;
  			width: 100%;
  			background-color: #333;
  			color: white;
  			text-align: center;
  			padding: 10px 0;
  		}
  	</style>
  </head>
  
  <body>
  <script src="resource/js/jquery-2.0.3.min.js"></script>
  <script	src="resource/plugin/My97DatePicker/WdatePicker.js"></script>
  <script src="resource/js/bootstrap.min.js" type="text/javascript"></script>
  <div class="bigtitle">
  	<p style="font-size: 30px;">kpi管理系统</p>
  </div>
  <div id="pre_kpi_report" style="display:block">
  <!--	<div id="userLogin" style="display:none">-->
  <!--		<br>-->
  <!--		<label>第一步，</label>-->
  <!--		<input type="button" onClick="login();" value="企业微信登录"/>-->
  <!--		<p style="color:red" id="userLoginResult"></p>-->
  <!--	</div>-->
  	<div id="userStatus"></div>
  	<div>
  		<br>
  		<label>第1步，选日期(确认是kpi报告当月日期即可)</label>
  		<input class="form-control reportC" inputt="report_time" type="text" value="" name="report_time" id="report_time" onclick="WdatePicker({dateFmt:'yyyy-MM', maxDate:'%y-%M', onpicked:selectDate})" style="width:180px">
  	</div>
  	<div>
  		<br>
  		<label>第2步，</label>
  		<input type="button" onClick="showReport();" value="开始填报" id="show_report"/>
  		<p style="color:red" id="begin_report_result"></p>
  	</div>
  </div>
  <div id="main_kpi_report" style="display:none">
  	<p><b>
  		填报方法：<br>
  		&nbsp&nbsp 1. 按条填报和提交。<br>
  		&nbsp&nbsp 2. 修改后点"提交"，则更新之前的提交记录。<br>
  		&nbsp&nbsp 3. 点"删除"是删除当前一条记录。<br>
  	</b></p>
  	<br>
  	<p><b>本月工作业绩<span id="cur_month"></span></b></p>
  	<p id="edit_date_tips"></p>
  	<fieldset>
  		<table class="wTable" id="wTable_cur" style="background-color:#eeeeee;" bordercolor="#aaaaaa" border="1" cellpadding="0" cellpadding="2" width="100%">
  			<thead>
  			<tr>
  				<th style="width:70px;text-align:center;">操作</th>
  				<th style="width:100px;text-align:center;">主要职责</th>
  				<th style="width:200px;text-align:center;">业绩(工作项目)</th>
  				<th style="width:30px;text-align:center;">权重</th>
  				<th style="width:200px;text-align:center;">自评完成情况</th>
  				<th style="width:50px;text-align:center;">自评得分</th>
  				<th style="width:50px;text-align:center;">综合得分</th>
  			</tr>
  			</thead>
  			<tbody>
  			<tr id="cur_tr_0">
  				<td style="text-align:center;">
  					<input type="button" onClick="submitCurItem(0);" value="提交"/>&nbsp
  					<input type="button" onClick="delCurItem(0);" value="删除"/>
  					<p id="op_status" style="color:red" ></p>
  				</td>
  				<td><textarea id="title" rows="4";></textarea></td>
  				<td><textarea id="content" rows="4";></textarea></td>
  				<td><textarea id="weight" rows="4";></textarea></td>
  				<td><textarea id="memo" rows="4";></textarea></td>
  				<td><textarea id="self_score" rows="4";></textarea></td>
  				<td style="text-align:center;"><span id="weighted_score"></span></td>
  			</tr>
  			</tbody>
  		</table>
  	</fieldset>
  	<input id="add_row_cur" type="button" onClick="addRowCur();" value="添加一行"/>
  	&nbsp<span id="cur_total_weight"></span>
  	<!--	<div><br><input type="button" onClick="saveCur();" style="font-size:16px;" value=" 提交 "/></div>-->
  
  	<br><br><br>
  	<p><b>本月总结(优点、缺点、如何改进)</b></p>
  	<div>
  		<textarea id="summary" style="width:700px;" rows="5"></textarea>
  	</div>
  
  	<input id="save_summary" type="button" onClick="saveSummary();" value=" 提交 "/>
  	<p id="save_summary_op_status" style="color:red" ></p>
  
  	<br><br><br>
  	<p><b>下个月的计划<span id="next_month"></span></b></p>
  	<fieldset>
  		<table class="wTable" id="wTable_next" style="background-color:#eeeeee;" bordercolor="#aaaaaa" border="1" cellpadding="0" cellpadding="2" width="100%">
  			<thead>
  			<tr>
  				<th style="width:70px;text-align:center;">操作</th>
  				<th style="width:100px;text-align:center;">主要职责</th>
  				<th style="width:300px;text-align:center;">业绩(工作项目)</th>
  				<th style="width:30px;text-align:center;">权重</th>
  			</tr>
  			</thead>
  			<tbody>
  			<tr id="next_tr_0">
  				<td style="text-align:center;">
  					<input type="button" onClick="submitNextItem(0);" value="提交"/>&nbsp
  					<input type="button" onClick="delNextItem(0);" value="删除"/>
  					<p id="op_status" style="color:red" ></p>
  				</td>
  				<td><textarea id="title" rows="4";></textarea></td>
  				<td><textarea id="content" rows="4";></textarea></td>
  				<td><textarea id="weight" rows="4";></textarea></td>
  			</tr>
  			</tbody>
  		</table>
  	</fieldset>
  
  	<input id="add_row_next" type="button" onClick="addRowNext();" value="添加一行"/>
  	&nbsp<span id="next_total_weight"></span>
  	<!--	<div><br><input type="button" onClick="saveNext();" style="font-size:16px;" value=" 提交 "/></div>-->
  </div>
  
  <script>
  	const DEBUG = true;
  	// 一般是每个月的最后一周进行述职，所以填报时间是述职前一周，到述职后几天
  	const START_PERIOD_DAY = 13; // 每个月哪一天开始填报
  	const END_PERIOD_DAY = 7;	// 每个月哪一天结束填报
  	var IS_IN_EDIT_PERIOD = false; // 是否在填报时间内
  	const ERROR_CODE_NOT_IN_PERIOD = 4;  // 不在填报时间
  	const ERROR_MSG_NOT_IN_PERIOD = "当前不在系统填报时间";
  	var IS_FIRST_SUBMIT = false; // 是否是第一次填报kpi的新同事
  	var curKpiId; 	// 对应用户当前月度的kpi记录
  	var nextKpiId; 	// 对应用户下个月度的kpi记录
  	var curKpiIndex = 0; // 当月kpi表，行index
  	var nextKpiIndex = 0; // 下个月kpi表，行index
  	var lastKpiDate; // 上一个kpi总结的月份
  	var curKpiDate; // 当前kpi总结的月份
  	var nextKpiDate; // 下一个kpi的月份
  	var userId; // 用户名
  	var sessionKey; // 后面用于操作认证校验
  	if(DEBUG){
  		userId = "michael"; // for test
  	}
  
  	function selectDate(){
  		// alert("selectDate");
  		setKpiMonth(document.getElementById("report_time").value); // 设置当前月和下个月的月份
  		showLogin();
  	}
  
  	// 获取指定名称的cookie值：
  	function getCookie(key){
  		var arr1 = document.cookie.split('; ');
  		for(var i = 0; i < arr1.length; i++){
  			var arr2 = arr1[i].split('=');
  			if(arr2[0] == key){
  				return arr2[1];//对编码后的内容进行解码
  			}
  		}
  	}
  
  	// 设置cookie, 同时设置cookie的有效时间，是有效时间t的单位是"天"
  	function setCookie(key, value, t){
  		var oDate = new Date();
  		oDate.setDate(oDate.getDate()+t);
  		//使用escape()对内容进行编码
  		document.cookie = key+'='+value+';expires='+oDate.toGMTString();
  	}
  
  	// 移除cookie
  	function removeCookie(key){
  		setCookie(key,'',-1);
  	}
  
  	// 加载完页面后读取url参数，如果有code参数，则执行登录
  	window.addEventListener("load", function(){
  		setKpiMonth(); // 先执行一次
  		showLogin();
  		var query = window.location.search.substring(1);
  		var vars = query.split("&");
  		for (var i = 0; i < vars.length; i++) {
  			var pair = vars[i].split("=");
  			console.log("loginflag:" + getCookie("loginflag"));
  			//如果当前元素的键等于参数名，则返回对应的值
  			if (pair[0] == "code" && getCookie("loginflag")) {
  				removeCookie("loginflag");
  				code = pair[1];
  				doLogin(code);
  			}
  		}
  	});
  
  	// 如果已有登录态，展示用户信息。如果没有登录态，展示登录按钮
  	function showLogin(){
  		// userId = getCookie("loginuser");
  		//
  		// console.log("userId:", userId);
  		// // 已登录
  		// if(typeof userId != "undefined" || userId == ""){
  		// 	document.getElementById('userLogin').style.display = "none";
  		// 	var userHtml = '<span>当前用户：</span><span><b>' + userId + '</b> </span> <input type="button" onClick="unLogin();" value="登出"/>';
  		// 	$('#userStatus').html(userHtml);
  		// 	document.getElementById('userStatus').style.display = "block";
  		//
  		// 	console.log("showLogin. IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  		// 	if(IS_IN_EDIT_PERIOD == false){
  		// 		document.getElementById("show_report").value = "查看填报";
  		// 	} else{
  		// 		document.getElementById("show_report").value = "开始填报";
  		// 	}
  		// } else{
  		// 	document.getElementById('userStatus').style.display = "none";
  		// 	document.getElementById('userLogin').style.display = "block";
  		// }
  	}
  
  	// 登出
  	function unLogin(){
  		removeCookie("loginuser");
  		console.log("cookie loginuser:", getCookie("loginuser"));
  		showLogin();
  	}
  
  	// 登录
  	function doLogin(code){
  
  	}
  
  	// 企业微信快捷登录
  	function login(){
  	}
  
  	// 当前月kpi添加一行
  	function addRowCur(){
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var tr = tbody.insertRow(tbody.rows.length);
  		curKpiIndex++; // 添加一行，index也要随之增加
  
  		var trHtml = "<td style=\"text-align:center;\"><input type=\"button\" onClick=\"submitCurItem("+curKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  				"<input type=\"button\" onClick=\"delCurItem("+curKpiIndex+");\" value=\"删除\"/>\n" +
  				"<p id=\"op_status\" style=\"color:red\" ></p></td>" +
  				"<td><textarea id=\"title\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"content\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"weight\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"memo\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"self_score\" rows=\"4\";></textarea></td>\n" +
  				"<td style=\"text-align:center;\"><span id=\"weighted_score\"></span></td>\n";
  
  		tr.id = "cur_tr_"+curKpiIndex;
  		tr.innerHTML = trHtml;
  	}
  
  	// 下个月kpi添加一行
  	function addRowNext(){
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var tr = tbody.insertRow(tbody.rows.length);
  		nextKpiIndex++; // 添加一行，index也要随之增加
  
  		var trHtml = "<td style=\"text-align:center;\">\n" +
  				"<input type=\"button\" onClick=\"submitNextItem("+nextKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  				"<input type=\"button\" onClick=\"delNextItem("+nextKpiIndex+");\" value=\"删除\"/>\n" +
  				"<p id=\"op_status\" style=\"color:red\" ></p>\n" +
  				"</td>\n" +
  				"<td><textarea id=\"title\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"content\" rows=\"4\";></textarea></td>\n" +
  				"<td><textarea id=\"weight\" rows=\"4\";></textarea></td>";
  		// tr.style.height = "80px";
  		tr.id = "next_tr_"+nextKpiIndex;
  		tr.innerHTML = trHtml;
  	}
  
  	// 显示kpi填报页
  	function showReportMainPage(flag){
  		if(flag){
  			document.getElementById("main_kpi_report").style.display = "block";
  			document.getElementById("pre_kpi_report").style.display = "none";
  
  		}else{
  			document.getElementById("main_kpi_report").style.display = "none";
  			document.getElementById("pre_kpi_report").style.display = "block";
  		}
  	}
  
  	// 展示已填报的kpi
  	function showReport(){
  		setKpiMonth(document.getElementById("report_time").value); // 设置当前月和下个月的月份
  		// if(typeof userId == "undefined"){
  		// 	$('#begin_report_result').html("请先登录");
  		// 	return;
  		// }
  
  		queryReport(userId, curKpiDate); // 查询当月kpi记录，包括当月总结
  		queryReport(userId, nextKpiDate); // 查询下个月kpi记录
  	}
  
  	// 查询已填报的kpi
  	function queryReport(_userId, _kpiDate){
  		if(typeof _userId == "undefined" || _userId == ""){
  			_userId = userId;
  		}
  		if(typeof _kpiDate == "undefined" || _kpiDate == 0){
  			_kpiDate = curKpiDate;
  		}
  
  		console.log('用户ID:', _userId);
  		console.log('kpi日期:', _kpiDate);  // 格式为:YYYYMM
  		var data = {
  			user_id: _userId,
  			begin_month: _kpiDate,
  			end_month: _kpiDate
  		}
  
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/query_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				var code = response.err_code;
  				if(response.err_code != 0){
  					// 没有记录
  					if(code == 107){
  						// 如果当前kpiid记录不存在，就创建一个
  						createMonth(_userId, _kpiDate);	// 创建kpi记录
  					} else {
  						$('#begin_report_result').html(response.ret_msg);
  					}
  				} else{
  					$('#begin_report_result').html('查询成功');
  
  					if(response.data.length > 0){
  						var res = response.data[0];
  						if(curKpiDate == _kpiDate){
  							curKpiId = res.id;
  							showSummary(res.memo);
  							showCurKpiItems(res.details);
  						}else if(nextKpiDate == _kpiDate){
  							nextKpiId = res.id;
  							showNextKpiItems(res.details);
  						}
  						console.log("kpiDate:" + _kpiDate + ", kpiId:", res.id);
  					}
  				}
  			},
  			error: function(xhr, status, error) {
  				$('#begin_report_result').html('查询遇到后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	 // 是否是第一次填报kpi的新同事
  	function isFirstSubmit(){
  		var data = {
  			user_id: userId,
  			begin_month: lastKpiDate,
  			end_month: lastKpiDate
  		}
  
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/query_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				var code = response.err_code;
  				if(response.err_code != 0){
  					// 没有记录
  					if(code == 107){
  						return true; // 上个月无记录，是新同事
  					} else {
  						console.log('查询上个月kpi记录遇到后台错误：' + response.ret_msg);
  					}
  				} else{
  					return false; // 上个月有记录，不是新同事
  				}
  			},
  			error: function(xhr, status, error) {
  				console.log('查询上个月kpi记录遇到后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	// 展示当月kpi填报记录
  	function showCurKpiItems(detailArr){
  		showReportMainPage(true);
  
  		if(detailArr == null || detailArr.length <= 0){
  			return;
  		}
  
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var total_weight = 0;
  		var total_score = 0;
  		document.getElementById("cur_tr_0").remove(); // 删除原先的第一条
  		$.each(detailArr, function(i, detail) {
  			var tr = tbody.insertRow(tbody.rows.length);
  			var weighted_score = detail.weight * detail.self_score / 100.0;
  			var trHtml = "";
  
  			// 第一次提交kpi的同事，才能对当月的kpi所有字段进行编辑
  			// if(isFirstSubmit()){
  			if(true){
  				trHtml = "<td style=\"text-align:center;\"><input type=\"button\" onClick=\"submitCurItem("+curKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  					"<input type=\"button\" onClick=\"delCurItem("+curKpiIndex+");\" value=\"删除\"/>\n" +
  					"<p id=\"op_status\" style=\"color:red\" ></p></td>" +
  					"<td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>\n" +
  					"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>\n" +
  					"<td><textarea id=\"memo\" rows=\"4\";>"+detail.memo+"</textarea></td>\n" +
  					"<td><textarea id=\"self_score\" rows=\"4\";>"+detail.self_score+"</textarea></td>\n" +
  					"<td style=\"text-align:center;\"><span id=\"weighted_score\">"+weighted_score+"</span></td>\n";
  				document.getElementById("add_row_cur").style.display = "block";
  			} else{
  				trHtml = "<td style=\"text-align:center;\"></td><td><span id=\"title\" rows=\"4\";>"+detail.title+"</span></td>" +
  						"<td><span id=\"content\" rows=\"4\";>"+detail.content+"</span></td>\n" +
  					"<td><span id=\"weight\" rows=\"4\";>"+detail.weight+"</span></td>\n" +
  					"<td><textarea id=\"memo\" rows=\"4\";>"+detail.memo+"</textarea></td>\n" +
  					"<td><textarea id=\"self_score\" rows=\"4\";>"+detail.self_score+"</textarea></td>\n" +
  					"<td style=\"text-align:center;\"><span id=\"weighted_score\">"+weighted_score+"</span></td>\n";
  				document.getElementById("add_row_cur").style.display = "none";
  			}
  
  
  			tr.value = detail.id;
  			tr.id = "cur_tr_"+curKpiIndex;
  			tr.innerHTML = trHtml;
  			curKpiIndex++; // 添加一行，index也要随之增加
  			total_weight += detail.weight;
  			total_score += weighted_score;
  			console.log("i:"+i+" detail_id:"+detail.id+" title:"+detail.title+" content:"+detail.content+" weight:"+detail.weight
  					+" self_score:"+detail.self_score+" memo:"+detail.memo);
  		});
  		calCurScore();
  	}
  
  	// 当前月份汇总计算
  	function calCurScore(){
  		var wTable = document.getElementById("wTable_cur");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var trList = tbody.getElementsByTagName("tr");
  		var totalWeight = 0;
  		var totalScore = 0;
  		// var rows = tbody.rows;
  		for(var i = 0; i < trList.length; i++){
  			var tdList = trList[i].getElementsByTagName("td");
  			for(var j = 1; j < tdList.length; j++){
  				// 权重总和
  				var textarea = tdList[j].getElementsByTagName("textarea")[0];
  				if(textarea && textarea.getAttribute && textarea.getAttribute("id") == "weight"){
  					var value = parseInt(textarea.value) || 0;
  					totalWeight += value;
  				} else{ // 不可更改的情况
  					var spanarea = tdList[j].getElementsByTagName("span")[0];
  					if(spanarea && spanarea.getAttribute && spanarea.getAttribute("id") == "weight"){
  						var value = parseInt(spanarea.innerHTML) || 0;
  						totalWeight += value;
  					}
  				}
  				// 综合得分
  				var spanItem = tdList[j].getElementsByTagName("span")[0];
  				if(spanItem && spanItem.getAttribute && spanItem.getAttribute("id") == "weighted_score"){
  					var value = parseFloat(spanItem.innerHTML) || 0;
  					totalScore += value;
  				}
  			}
  		}
  		totalScore = parseFloat(totalScore).toFixed(2);
  		document.getElementById("cur_total_weight").innerHTML = "  权重总和：<span style='color:red'>" + totalWeight + "</span>，  综合总分：<span style='color:red'>" + totalScore + "</span>";
  	}
  
  	// 展示下个月kpi填报记录
  	function showNextKpiItems(detailArr){
  		if(IS_IN_EDIT_PERIOD == true){
  			document.getElementById("add_row_next").style.display = "block";
  		} else{
  			document.getElementById("add_row_next").style.display = "none";
  		}
  
  		if(detailArr == null || detailArr.length <= 0){
  			return;
  		}
  
  
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  
  		document.getElementById("next_tr_0").remove(); // 删除原先的第一条
  		$.each(detailArr, function(i, detail) {
  			var tr = tbody.insertRow(tbody.rows.length);
  			var trHtml = "<td style=\"text-align:center;\">\n" +
  					"<input type=\"button\" onClick=\"submitNextItem("+nextKpiIndex+");\" value=\"提交\"/>&nbsp\n" +
  					"<input type=\"button\" onClick=\"delNextItem("+nextKpiIndex+");\" value=\"删除\"/>\n" +
  					"<p id=\"op_status\" style=\"color:red\" ></p>\n" +
  					"</td>\n" +
  					"<td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>\n" +
  					"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>";
  
  			// 不在填报时间段内
  			if(IS_IN_EDIT_PERIOD == false){
  				trHtml = "<td style=\"text-align:center;\"></td><td><textarea id=\"title\" rows=\"4\";>"+detail.title+"</textarea></td>" +
  						"<td><textarea id=\"content\" rows=\"4\";>"+detail.content+"</textarea></td>\n" +
  					"<td><textarea id=\"weight\" rows=\"4\";>"+detail.weight+"</textarea></td>";
  			}
  
  			tr.value = detail.id;
  			// tr.style.height = "80px";
  			tr.id = "next_tr_"+nextKpiIndex;
  			tr.innerHTML = trHtml;
  			nextKpiIndex++; // 添加一行，index也要随之增加
  			console.log("i:"+i+" detail_id:"+detail.id+" title:"+detail.title+" content:"+detail.content+" weight:"+detail.weight
  					+" self_score:"+detail.self_score+" memo:"+detail.memo);
  		});
  		calNextScore();
  	}
  
  	// 下个月份汇总计算
  	function calNextScore(){
  		var wTable = document.getElementById("wTable_next");
  		var tBodies = wTable.tBodies;
  		var tbody = tBodies[0];
  		var trList = tbody.getElementsByTagName("tr");
  		var totalWeight = 0;
  		// var rows = tbody.rows;
  		for(var i = 0; i < trList.length; i++){
  			var tdList = trList[i].getElementsByTagName("td");
  			for(var j = 1; j < tdList.length; j++){
  				var textarea = tdList[j].getElementsByTagName("textarea")[0];
  				if(textarea && textarea.getAttribute){
  					var key = textarea.getAttribute("id");
  					var value = textarea.value;
  					// 权重
  					if(key == "weight"){
  						value = parseInt(value) || 0;
  						totalWeight += value;
  					}
  				}
  			}
  		}
  		totalWeight = parseInt(totalWeight);
  		document.getElementById("next_total_weight").innerHTML = "  权重总和：<span style='color:red'>" + totalWeight + "</span>";
  	}
  
  	/*
  	* 获取当前日期的上个月
  	* 例如，当前是2023-01-02，则返回202212
  	*
  	*/
  	function getLastMonth(){
  		var currentDate = new Date();
  		currentDate.setMonth(currentDate.getMonth()-1)
  		var year = currentDate.getFullYear();
  		var month = (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		var lastYearMonth = parseInt(year + month);
  
  		return lastYearMonth;
  	}
  
  	/*
  	 * 判断并设置是否在允许的填报期
  	 * currentDay: 当天，比如2023-11-03，currentDay=03
  	 * currentMonth: 系统当前时间的月份，比如2023-11-03，currentMonth=202311
  	 * selectMonth: 选择的月份，比如选择2023-10-01，selectMonth=202310
  	*/
  	function setIsInEditPeriod(currentDay, currentMonth, selectMonth){
  		currentDay = parseInt(currentDay);
  		// 填报时间大于允许的开始填报时间 或 小于允许的结束填报时间，则可以填报。
  
  		// if( (currentDay >= START_PERIOD_DAY || currentDay <= END_PERIOD_DAY) && (currentMonth == selectMonth) ){
  		// 可填报的时间段区间：当月大于开始时间 或 次月小于结束时间
  		if((currentDay >= START_PERIOD_DAY && currentMonth == selectMonth) || (currentDay <= END_PERIOD_DAY && getLastMonth() == selectMonth)){
  			IS_IN_EDIT_PERIOD = true;
  		} else {
  			IS_IN_EDIT_PERIOD = false;
  		}
  		console.log("currentDay:" + currentDay + " START_PERIOD_DAY:" + START_PERIOD_DAY + " END_PERIOD_DAY:" + END_PERIOD_DAY
  				+ " currentMonth:" + currentMonth + " getLastMonth:" + getLastMonth() + " selectMonth:" + selectMonth + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  	}
  
  	function setEditTips(currentDay, currentYearMonth, selectYearMonth, startEditDay, endEditDay){
  		var tipsHtml = '';
  		console.log("currentDay:" + currentDay + " currentYearMonth:" + currentYearMonth + " selectYearMonth:" + selectYearMonth +
  				" startEditDay:" + startEditDay + " endEditDay:" + endEditDay + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  		// 将来月份填报还未开始
  		if(currentYearMonth < selectYearMonth){
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报还未开始)</span>';
  		} else if(currentYearMonth == selectYearMonth && currentDay < START_PERIOD_DAY) { // 本月填报还未开始
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报将于'+(startEditDay)+'开始)</span>';
  		} else if(IS_IN_EDIT_PERIOD == true){ // 填报已开始
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报将于'+(endEditDay)+'结束提交，结束后不能修改)</span>';
  		} else{ // 填报已结束
  			tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报已结束)</span>';
  		}
  		tipsHtml = '<span style="color:red">('+selectYearMonth+'月的kpi填报已开始)</span>'
  		document.getElementById("edit_date_tips").innerHTML = tipsHtml;
  	}
  
  	// 设置当前kpi及下个kpi的月度
  	function setKpiMonth(date){
  		var currentDate = new Date();
  		var currentYear = currentDate.getFullYear();
  		var currentMonth = (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		var currentDay = currentDate.getDate().toString().padStart(2, '0');
  		var currentYearMonth = parseInt(currentYear+currentMonth);
  
  
  		var selectDate = date ? new Date(date) : currentDate;
  
  		// 当天日期如果小于开始填报时间，则还未开始填报，先默认展示上个月
  		if(currentDay < START_PERIOD_DAY){
  			currentDate.setMonth(currentDate.getMonth()-1);
  			document.getElementById("report_time").value = currentDate.getFullYear() + '-' + (currentDate.getMonth() + 1).toString().padStart(2, '0');
  		}
  
  		var year = selectDate.getFullYear();
  		var month = (selectDate.getMonth() + 1).toString().padStart(2, '0');  // 获取当前月份（注意月份从0开始，所以需要加1）
  		var day = selectDate.getDate().toString().padStart(2, '0');
  		var selectYearMonth = parseInt(year+month);
  		document.getElementById("report_time").value = year + '-' + month;
  
  		setIsInEditPeriod(currentDay, currentYearMonth, selectYearMonth);
  		var startEditDay = year + "-" + month + '-' + START_PERIOD_DAY;
  		var endEditDay = year + "-" + month + '-' + END_PERIOD_DAY;
  		setEditTips(currentDay, currentYearMonth, selectYearMonth, startEditDay, endEditDay);
  
  
  		console.log("day:" + (year+month+day) + " IS_IN_EDIT_PERIOD:" + IS_IN_EDIT_PERIOD);
  
  		// 当天日期如果小于等于结束填报时间，则按照上个月的填报期来算
  		// if(currentDay <= END_PERIOD_DAY){
  		// 	selectDate.setMonth(selectDate.getMonth()-1)
  		// 	month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		// }
  
  		document.getElementById("cur_month").innerHTML = "("+year + "-" + month+")";
  		curKpiDate = parseInt(year + month);
  
  		// 下一个kpi月
  		selectDate.setMonth(selectDate.getMonth()+1, 1); //setMonth有顺延现象: 当前月份如果没有31天,而设置了31的话,当前月份会顺延。所以主动设置日期为1号
  		year = selectDate.getFullYear();
  		month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		console.log('next: year：' + year + ' month:' + month);  // year month
  		document.getElementById("next_month").innerHTML = "("+year + "-" + month+")";
  		nextKpiDate = parseInt(year + month);
  
  		// 上一个kpi月
  		selectDate.setMonth(selectDate.getMonth()-2, 1);
  		year = selectDate.getFullYear();
  		month = (selectDate.getMonth() + 1).toString().padStart(2, '0');
  		lastKpiDate = parseInt(year + month);
  	}
  
  	// 创建月度kpi记录
  	function createMonth(_userId, _kpiDate){
  		var data = {
  			user_id: _userId,
  			month: _kpiDate
  		};
  
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/create_kpi',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					$('#begin_report_result').html(response.ret_msg);
  				} else{
  					$('#begin_report_result').html('成功');
  
  					if(curKpiDate == _kpiDate){
  						curKpiId = response.data.kpi_id;
  					}else if(nextKpiDate == _kpiDate){
  						nextKpiId = response.data.kpi_id;
  					}
  					console.log("kpiId:", response.data.kpi_id);
  					showReportMainPage(true);
  				}
  			},
  			error: function(xhr, status, error) {
  				if(DEBUG){
  					showReportMainPage(true);
  					return;
  				}
  				$('#begin_report_result').html('后台错误，请联系开发同事');
  			}
  		});
  	}
  
  	// 提交当前月kpi记录
  	function submitCurItem(index){
  		var trTag = "cur_tr_" + index;
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  		// var requiredItems = ["title","content","weight","memo","self_score"];
  		var requiredItemsTextarea = ["memo","self_score"];
  		var requiredItemsSpan = ["title","content","weight"];
  
  		// var data = [];
  		var row = {};
  		row["kpi_id"] = curKpiId;
  		for (var j = 1; j < tdList.length; j++) {
  			var textarea = tdList[j].getElementsByTagName("textarea")[0];
  			if(textarea && textarea.getAttribute){
  				var key = textarea.getAttribute("id");
  				var value = textarea.value;
  				if(key == "weight" || key == "self_score")
  					value = parseInt(value) || 0;
  
  				if(requiredItemsTextarea.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  			var spanarea = tdList[j].getElementsByTagName("span")[0];
  			if(spanarea && spanarea.getAttribute){
  				var key = spanarea.getAttribute("id");
  				var value = spanarea.innerHTML;
  				if(key == "weight")
  					value = parseInt(value) || 0;
  
  				if(requiredItemsSpan.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  			// 计算和显示综合得分
  			var spanItem = tdList[j].getElementsByTagName("span")[0];
  			if(spanItem && spanItem.getAttribute){
  				if(spanItem.getAttribute("id") == "weighted_score"){
  					spanItem.innerHTML = parseFloat(row["weight"] * row["self_score"] / 100.0).toFixed(2);
  				}
  			}
  		}
  		// row["title"] = "职责大类"; //后面title会用到，表示职责分类
  		var detailId = trItem.value;
  		if(typeof detailId != "undefined" && parseInt(detailId) > 0){
  			row["detail_id"] = parseInt(detailId);
  			updateKpiItem(row, opStatus, "curmonth");
  		}else{
  			addKpiItem(row, opStatus, trItem, "curmonth");
  		}
  
  		// data.push(row);
  		console.log(JSON.stringify(row));
  	}
  
  	// 提交下个月kpi记录
  	function submitNextItem(index){
  		var trTag = "next_tr_" + index;
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  		var requiredItems = ["title","content","weight"];
  		// var requiredItems = ["content","weight"];
  
  		// var data = [];
  		var row = {};
  		row["kpi_id"] = nextKpiId;
  		for (var j = 1; j < tdList.length; j++) {
  			var textarea = tdList[j].getElementsByTagName("textarea")[0];
  			if(textarea && textarea.getAttribute){
  				var key = textarea.getAttribute("id");
  				var value = textarea.value;
  				if(key == "weight")
  					value = parseInt(value) || 0;
  
  				if(requiredItems.includes(key) && (value == null || value == "")){
  					opStatus.innerHTML = '检查下是不是有啥没填？';
  					return;
  				}
  				row[key] = value;
  			}
  		}
  		// row["title"] = "职责大类"; //后面title会用到，表示职责分类
  		var detailId = trItem.value;
  		if(typeof detailId != "undefined" && parseInt(detailId) > 0){
  			row["detail_id"] = parseInt(detailId);
  			updateKpiItem(row, opStatus, "nextmonth");
  		}else{
  			addKpiItem(row, opStatus, trItem, "nextmonth");
  		}
  
  		// data.push(row);
  		console.log(JSON.stringify(row));
  	}
  
  	// 重新计算权重和总分
  	function calScore(monthFlag){
  		if(monthFlag == "curmonth") {
  			calCurScore();
  		}else if(monthFlag == "nextmonth") {
  			calNextScore();
  		}
  	}
  
  	// 更新kpi记录
  	function updateKpiItem(rowData, opStatus, monthFlag){
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/mod_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(rowData),
  			contentType: 'application/json',
  			success: function(response) {
  				// 添加成功
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '提交成功';
  					calScore(monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '提交失败，请联系开发同事';
  			}
  		});
  	}
  
  	// 新增kpi记录
  	function addKpiItem(rowData, opStatus, trItem, monthFlag){
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/add_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(rowData),
  			contentType: 'application/json',
  			success: function(response) {
  				// 添加成功
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '提交成功';
  					trItem.value = response.data.detail_id;
  					calScore(monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '提交失败，请联系开发同事';
  			}
  		});
  	}
  
  	// 删除一条本月kpi记录
  	function delCurItem(index){
  		var trTag = "cur_tr_" + index;
  		delItem(index, trTag, "curmonth");
  	}
  
  	// 删除一条下月kpi记录
  	function delNextItem(index) {
  		var trTag = "next_tr_" + index;
  		delItem(index, trTag, "nextmonth");
  	}
  
  	// 删除记录后的处理
  	function afterDelItem(index, monthFlag){
  		if(monthFlag == "curmonth"){
  			if(index == curKpiIndex){
  				curKpiIndex--;
  			}
  			calCurScore();
  		}
  
  		if(monthFlag == "nextmonth"){
  			if(index == nextKpiIndex){
  				nextKpiIndex--;
  			}
  			calNextScore();
  		}
  	}
  
  	function delItem(index, trTag, monthFlag){
  		var trItem = document.getElementById(trTag);
  		var tdList = trItem.getElementsByTagName("td");
  		var opStatus = tdList[0].querySelector("#op_status");
  
  		console.log("trItem.value:" + trItem.value);
  		if(typeof trItem.value == "undefined"){
  			trItem.remove();
  			afterDelItem(index, monthFlag);
  		}
  		var detailId = trItem.value; // kpi每条记录的id
  		var data = {
  			detail_id: detailId
  		};
  
  		console.log(JSON.stringify(data));
  
  		// 调用接口删除数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/del_kpi_detail',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						opStatus.innerHTML = ERROR_MSG_NOT_IN_PERIOD;
  					}else{
  						opStatus.innerHTML = response.ret_msg;
  					}
  				} else{
  					opStatus.innerHTML = '删除成功';
  					trItem.remove();
  					afterDelItem(index, monthFlag);
  				}
  			},
  			error: function(xhr, status, error) {
  				opStatus.innerHTML = '删除失败，请联系开发同事';
  			}
  		});
  	}
  
  	function showSummary(summary){
  		if(IS_IN_EDIT_PERIOD == true){
  			document.getElementById("save_summary").style.display = "block";
  		} else{
  			document.getElementById("save_summary").style.display = "none";
  		}
  
  		if(typeof summary == "undefined" || summary == ""){
  			return;
  		}
  		document.getElementById("summary").innerHTML = summary;
  
  	}
  
  	function saveSummary(){
  		var monthSummary = document.getElementById("summary").value;
  		var data = {
  			kpi_id: curKpiId,
  			memo: monthSummary
  		};
  
  		console.log(JSON.stringify(data));
  
  		// 调用接口添加数据
  		$.ajax({
  			url: 'http://kpi.21fid.com/api/v1/set_kpi_memo',
  			type: 'POST',
  			dataType: 'json',
  			data: JSON.stringify(data),
  			contentType: 'application/json',
  			success: function(response) {
  				if(response.err_code != 0){
  					if(ERROR_CODE_NOT_IN_PERIOD == response.err_code){
  						$('#save_summary_op_status').html(ERROR_MSG_NOT_IN_PERIOD);
  					}else{
  						$('#save_summary_op_status').html(response.ret_msg);
  					}
  				} else{
  					$('#save_summary_op_status').html('提交成功');
  				}
  			},
  			error: function(xhr, status, error) {
  				$('#save_summary_op_status').html('提交失败，请联系开发同事');
  			}
  		});
  	}
  </script>
  <div class="footer">
    <p>Copyright © 飞笛科技&nbsp;&nbsp;<a target="_blank" href="https://beian.miit.gov.cn">（粤ICP备16035685号）</a></p>
  </div>
  </body>
  </html>
  
services.name: https://47.236.191.52:8443/favicon.ico
services.body_hash_sha1: sha1:3e4fdd721f748a4c03d50cf242e9740d75f83163
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T11:07:00.516576
services.banner: HTTP/1.1 404 NOT FOUND
  Content-Type: text/html; charset=utf-8
  Content-Length: 232
  Date:  <REDACTED>
  
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T11:07:00.516576
services.uri: http://47.236.191.52:9878/
services.protocol: HTTP/1.1
services.status_reason: NOT FOUND
services.key: Content-Type
services.headers: text/html; charset=utf-8
services.key: Content-Length
services.headers: 232
services.key: Date
services.headers: <REDACTED>
services.html_tags: <title>404 Not Found</title>
services.body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  <title>404 Not Found</title>
  <h1>Not Found</h1>
  <p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
  
services.body_hash_sha1: sha1:8b56a18d01c00f757df29faeb95b2711ecd3cd18
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-28T06:10:22.027400
services.banner: HTTP/1.1 404 NOT FOUND
  Server: gunicorn
  Date:  <REDACTED>
  Connection: keep-alive
  Content-Type: text/html; charset=utf-8
  Content-Length: 232
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: Gunicorn
services.product: Gunicorn
services.cpe: cpe:2.3:a:gunicorn:gunicorn:*:*:*:*:*:*:*:*
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-28T06:10:22.027400
services.uri: http://47.236.191.52:9910/
services.protocol: HTTP/1.1
services.status_reason: NOT FOUND
services.key: Server
services.headers: gunicorn
services.key: Content-Type
services.headers: text/html; charset=utf-8
services.key: Date
services.headers: <REDACTED>
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 232
services.html_tags: <title>404 Not Found</title>
services.body: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  <title>404 Not Found</title>
  <h1>Not Found</h1>
  <p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>
  
services.body_hash_sha1: sha1:8b56a18d01c00f757df29faeb95b2711ecd3cd18
services.supported_versions: HTTP/1.1
services.protocol: HTTP
services.transport_protocol: TCP
services.scan_time: 2025-07-27T13:03:56.911265
services.banner: HTTP/1.1 502 Bad Gateway
  Server: nginx/1.20.1
  Date:  <REDACTED>
  Content-Type: text/html
  Content-Length: 157
  Connection: keep-alive
  
services.source: OSI_APPLICATION_LAYER
services.part: a
services.vendor: nginx
services.product: nginx
services.version: 1.20.1
services.cpe: cpe:2.3:a:f5:nginx:1.20.1:*:*:*:*:*:*:*
services.path: /
services.endpoint_type: HTTP
services.scan_time: 2025-07-27T13:03:56.911265
services.uri: http://47.236.191.52:9911/
services.protocol: HTTP/1.1
services.status_reason: Bad Gateway
services.key: Server
services.headers: nginx/1.20.1
services.key: Content-Type
services.headers: text/html
services.key: Date
services.headers: <REDACTED>
services.key: Connection
services.headers: keep-alive
services.key: Content-Length
services.headers: 157
services.html_tags: <title>502 Bad Gateway</title>
services.body: <html>
  <head><title>502 Bad Gateway</title></head>
  <body>
  <center><h1>502 Bad Gateway</h1></center>
  <hr><center>nginx/1.20.1</center>
  </body>
  </html>
  
services.body_hash_sha1: sha1:c6e573d2662d3a8368f3928eb53f76e368ba7375
services.supported_versions: HTTP/1.1
[binary data, 57 values, 1,548 bytes]