{"id":1218,"date":"2024-11-10T09:45:21","date_gmt":"2024-11-10T01:45:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1218\/"},"modified":"2024-11-10T09:45:21","modified_gmt":"2024-11-10T01:45:21","slug":"%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96%e8%a7%a3%e6%9e%90%e5%90%8e%e7%ab%af%e6%95%b0%e6%8d%ae%e5%b9%b6%e8%b5%8b%e5%80%bc%e7%bb%99-html-%e9%a1%b5%e9%9d%a2%e6%95%b0%e6%8d%ae%e6%a8%a1%e5%9e%8b%e7%9a%84","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1218\/","title":{"rendered":"\u5982\u4f55\u4f18\u5316\u89e3\u6790\u540e\u7aef\u6570\u636e\u5e76\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u6570\u636e\u6a21\u578b\u7684\u4ee3\u7801\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173033318166683.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f18\u5316\u89e3\u6790\u540e\u7aef\u6570\u636e\u5e76\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u6570\u636e\u6a21\u578b\u7684\u4ee3\u7801\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f18\u5316\u89e3\u6790\u540e\u7aef\u6570\u636e\u5e76\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u6570\u636e\u6a21\u578b\u7684\u4ee3\u7801\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f18\u5316\u201c\u5927\u4f6c\u4eec\u8fd9\u6bb5\u4ee3\u7801\u53ef\u4ee5\u600e\u4e48\u4f18\u5316\uff1f\u201d\u7684\u4ee3\u7801<\/strong><\/p>\n<p>\u539f\u95ee\u9898\u4e2d\u63d0\u4f9b\u7684\u4ee3\u7801\u7528\u4e8e\u89e3\u6790\u540e\u7aef\u8fd4\u56de\u7684\u6570\u636e\u5e76\u5c06\u5176\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u4e2d\u7684\u6570\u636e\u6a21\u578b\u3002\u8981\u4f18\u5316\u8be5\u4ee3\u7801\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<p><strong>1. \u7b80\u5316\u5bf9\u8c61\u7ed3\u6784<\/strong><\/p>\n<p>\u53ef\u4ee5\u901a\u8fc7\u5220\u9664 value \u5b57\u6bb5\u5e76\u4f7f\u7528\u5355\u4e00\u7684\u5bf9\u8c61\u7ed3\u6784\u6765\u7b80\u5316\u6570\u636e\u6a21\u578b\u3002\u8fd9\u6837\uff0c\u4ee3\u7801\u5c31\u53ef\u4ee5\u907f\u514d\u590d\u6742\u7684\u5d4c\u5957\u548c\u67e5\u627e\u64cd\u4f5c\u3002<\/p>\n<p><strong>2. \u4f7f\u7528\u89e3\u6784<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u5728\u5c06\u6570\u636e\u8d4b\u503c\u7ed9\u6570\u636e\u6a21\u578b\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 JavaScript \u7684\u89e3\u6784\u529f\u80fd\u6765\u7b80\u5316\u4ee3\u7801\u3002\u8be5\u529f\u80fd\u53ef\u4ee5\u540c\u65f6\u63d0\u53d6\u591a\u4e2a\u5c5e\u6027\uff0c\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\u3002<\/p>\n<p><strong>3. \u4f7f\u7528\u6570\u7ec4\u6241\u5e73\u5316<\/strong><\/p>\n<p>\u4f7f\u7528\u6570\u7ec4\u6241\u5e73\u5316\u65b9\u6cd5\u53ef\u4ee5\u5c06\u5d4c\u5957\u6570\u7ec4\u8f6c\u6362\u4e3a\u4e00\u7ef4\u6570\u7ec4\uff0c\u7b80\u5316\u540e\u7eed\u5904\u7406\u3002<\/p>\n<p><strong>\u4f18\u5316\u540e\u7684\u4ee3\u7801\u793a\u4f8b\uff1a<\/strong><\/p>\n<pre>const dataList = [{\n  title: '\u4e3b\u8425\u4e1a\u52a1',\n  content: [{\n    title: '\u9500\u552e\u6536\u5165',\n    sale_money: ''\n  }, {\n    title: '\u51cf:\u9500\u552e\u4f18\u60e0\u91d1\u989d',\n    sales_discount: ''\n  }, {\n    title: '\u51cf:\u6536\u6b3e\u6298\u6263',\n    payment_all: ''\n  }, {\n    title: '\u9500\u552e\u6210\u672c',\n    cost_all: ''\n  }, {\n    title: '\u51cf:\u8d2d\u8d27\u4f18\u60e0\u91d1\u989d',\n    discount_all: ''\n  }, {\n    title: '\u51cf:\u4ed8\u6b3e\u6298\u6263',\n    sale_money: ''\n  }, {\n    title: '\u76d8\u76c8\u76d8\u4e8f',\n    surplus_loss: ''\n  }]\n}, {\n  title: '\u4e3b\u8425\u4e1a\u52a1\u5229\u6da6',\n  content: [{\n    title: '\u5229\u6da6\u91d1\u989d',\n    main_business: ''\n  }]\n}, {\n  title: '\u5176\u4ed6\u4e1a\u52a1\u5229\u6da6',\n  content: [{\n    title: '\u5229\u6da6\u91d1\u989d',\n    other_income: ''\n  }]\n}];\n\nconst { data, code } = await incomeStatement(this.dateValue);\ndataList.flatMap(it =&gt; it.content)\n  .forEach(it =&gt; {\n    const { title, value, ...rest } = it;\n    it.value = data[Object.keys(rest)[0]];\n  });<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u4f18\u5316\u89e3\u6790\u540e\u7aef\u6570\u636e\u5e76\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u6570\u636e\u6a21\u578b\u7684\u4ee3\u7801\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f18\u5316\u201c\u5927\u4f6c\u4eec\u8fd9\u6bb5\u4ee3\u7801\u53ef\u4ee5\u600e\u4e48\u4f18\u5316\uff1f\u201d\u7684\u4ee3\u7801 \u539f\u95ee\u9898\u4e2d\u63d0\u4f9b\u7684\u4ee3\u7801\u7528\u4e8e\u89e3\u6790\u540e\u7aef\u8fd4\u56de\u7684\u6570\u636e\u5e76\u5c06\u5176\u8d4b\u503c\u7ed9 HTML \u9875\u9762\u4e2d\u7684\u6570\u636e\u6a21\u578b\u3002\u8981\u4f18\u5316\u8be5\u4ee3\u7801\uff0c\u53ef\u4ee5\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a 1. \u7b80\u5316\u5bf9\u8c61\u7ed3\u6784 \u53ef\u4ee5\u901a\u8fc7\u5220\u9664 value \u5b57\u6bb5\u5e76\u4f7f\u7528\u5355\u4e00\u7684\u5bf9\u8c61\u7ed3\u6784\u6765\u7b80\u5316\u6570\u636e\u6a21\u578b\u3002\u8fd9\u6837\uff0c\u4ee3\u7801\u5c31\u53ef\u4ee5\u907f\u514d\u590d\u6742\u7684\u5d4c\u5957\u548c\u67e5\u627e\u64cd\u4f5c\u3002 2. \u4f7f\u7528\u89e3\u6784 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5728\u5c06\u6570\u636e\u8d4b\u503c\u7ed9\u6570\u636e\u6a21\u578b\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 JavaScript \u7684\u89e3\u6784\u529f\u80fd\u6765\u7b80\u5316\u4ee3\u7801\u3002\u8be5\u529f\u80fd\u53ef\u4ee5\u540c\u65f6\u63d0\u53d6\u591a\u4e2a\u5c5e\u6027\uff0c\u4ece\u800c\u51cf\u5c11\u91cd\u590d\u4ee3\u7801\u3002 3. \u4f7f\u7528\u6570\u7ec4\u6241\u5e73\u5316 \u4f7f\u7528\u6570\u7ec4\u6241\u5e73\u5316\u65b9\u6cd5\u53ef\u4ee5\u5c06\u5d4c\u5957\u6570\u7ec4\u8f6c\u6362\u4e3a\u4e00\u7ef4\u6570\u7ec4\uff0c\u7b80\u5316\u540e\u7eed\u5904\u7406\u3002 \u4f18\u5316\u540e\u7684\u4ee3\u7801\u793a\u4f8b\uff1a const dataList = [{ title: &#8216;\u4e3b\u8425\u4e1a\u52a1&#8217;, content: [{ title: &#8216;\u9500\u552e\u6536\u5165&#8217;, sale_money: &#8221; }, { title: &#8216;\u51cf:\u9500\u552e\u4f18\u60e0\u91d1\u989d&#8217;, sales_discount: &#8221; }, { title: &#8216;\u51cf:\u6536\u6b3e\u6298\u6263&#8217;, payment_all: &#8221; }, { title: &#8216;\u9500\u552e\u6210\u672c&#8217;, cost_all: &#8221; }, { title: &#8216;\u51cf:\u8d2d\u8d27\u4f18\u60e0\u91d1\u989d&#8217;, discount_all: &#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1218","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1218"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1218\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}