{"id":53297,"date":"2024-12-03T10:34:31","date_gmt":"2024-12-03T02:34:31","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53297\/"},"modified":"2024-12-03T10:34:31","modified_gmt":"2024-12-03T02:34:31","slug":"%e5%8a%a8%e6%80%81%e6%b7%bb%e5%8a%a0%e6%97%b6%e9%97%b4%e8%8c%83%e5%9b%b4%ef%bc%8c%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e5%b7%b2%e9%80%89%e6%97%b6%e9%97%b4%e7%bd%ae%e7%81%b0%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53297\/","title":{"rendered":"\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f<\/h1>\n<p>\u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f\u300b<\/span>\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241128\/17328060286748858cd96cf.jpg\" class=\"aligncenter\" title=\"\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f\u63d2\u56fe\" alt=\"\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u7f6e\u7070\u5df2\u9009\u62e9\u65f6\u95f4\uff1f<\/strong><\/p>\n<p><strong>\u95ee\u9898\uff1a<\/strong><\/p>\n<p>\u9700\u8981\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u8981\u6c42\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a<\/p>\n<ol>\n<li>\u5f00\u59cb\u65f6\u6bb5\u5c0f\u4e8e\u7ed3\u675f\u65f6\u6bb5\u3002<\/li>\n<li>\u540e\u7eed\u6dfb\u52a0\u7684\u65f6\u95f4\u8303\u56f4\u5185\uff0c\u524d\u9762\u5df2\u9009\u62e9\u7684\u65f6\u95f4\u7f6e\u7070\u4e0d\u53ef\u9009\u3002<\/li>\n<li>\u5220\u9664\u67d0\u884c\u5df2\u9009\u7684\u65f6\u95f4\u540e\uff0c\u8be5\u65f6\u95f4\u8303\u56f4\u91cd\u65b0\u7f6e\u4e3a\u53ef\u9009\u3002<\/li>\n<\/ol>\n<p><strong>\u89e3\u51b3\u65b9\u6848\uff1a<\/strong><\/p>\n<p>\u65b9\u6848\u57fa\u4e8e vue.js \u6846\u67b6\u5b9e\u73b0\uff0c\u5305\u62ec\u7236\u7ec4\u4ef6\u548c\u5b50\u7ec4\u4ef6\uff1a<\/p>\n<p><strong>\u7236\u7ec4\u4ef6<\/strong><\/p>\n<ul>\n<li>\u8d1f\u8d23\u7ba1\u7406\u8868\u683c\u548c\u65b0\u589e\u6570\u636e\u5bf9\u8bdd\u6846\u3002<\/li>\n<li>\n<p><strong>\u5173\u952e\u4ee3\u7801\uff1a<\/strong><\/p>\n<pre>mounted() {\nconst season = [\"\u6625\u5b63\", \"\u590f\u5b63\"];\nconst period = [\"\u5c16\u5cf0\", \"\u9ad8\u5cf0\", \"\u4f4e\u8c37\"];\nthis.tabledata = array.from({ length: season.length }, (_, i) =&gt;\n  period.map((pj, j) =&gt; ({\n    season: season[i],\n    period: pj,\n    timelist: [],\n  }))\n).flat();\nthis.merge(this.tabledata);\n},\nmethods: {\n\/\/ \u8868\u683c\u884c\u5408\u5e76\u65b9\u6cd5\nmerge(tabledata) {\n  this.companyarr = [];\n  this.companypos = 0;\n  for (let i = 0; i &lt; tabledata.length; i++) {\n    if (i === 0) {\n      this.companyarr.push(1);\n      this.companypos = 0;\n    } else {\n      if (tabledata[i].season === tabledata[i - 1].season) {\n        this.companyarr[this.companypos] += 1;\n        this.companyarr.push(0);\n      } else {\n        this.companyarr.push(1);\n        this.companypos = i;\n      }\n    }\n  }\n},\n\/\/ \u65b0\u589e\u6570\u636e\nhandleformedit(list, index) {\n  let arr = deepclone(this.tabledata),\n    brr = [];\n  brr = arr\n    .filter((item) =&gt; item.season === list.season)\n    .map((item) =&gt; item.timelist)\n    .flat();\n  this.idx = index;\n  this.showadddialog = {\n    visible: true,\n    title: \"\u7f16\u8f91\",\n    data: brr,\n    list: list.timelist,\n  };\n},<\/pre>\n<\/li>\n<\/ul>\n<p><strong>\u5b50\u7ec4\u4ef6<\/strong><\/p>\n<ul>\n<li>\u8d1f\u8d23\u6dfb\u52a0\u548c\u4fee\u6539\u65f6\u95f4\u8303\u56f4\u3002<\/li>\n<li>\n<p><strong>\u5173\u952e\u4ee3\u7801\uff1a<\/strong><\/p>\n<pre>watch: {\n  showAddDialog: {\n    handler(newVal, oldVal) {\n      this.tableData = [];\n      if (newVal.list.length) {\n        this.tableData = newVal.list.map((item) =&gt; ({\n          ...item,\n          disabled: true,\n        }));\n      } else {\n        this.tableData = [{ startTime: \"\", endTime: \"\" }];\n      }\n      ...\n    },\n    deep: true,\n  },\n},\ncomputed: {\n  ...\n  startTimeList() {\n    return this.timeOptions.map((item) =&gt; ({\n      value: item,\n      label: item,\n      disabled: false,\n    }));\n  },\n  endTimeList() {\n    return this.timeOptions.map((item) =&gt; ({\n      value: item,\n      label: item,\n      disabled: false,\n    }));\n  },\n},\nmethods: {\n  ...\n  handleStartChange(time) {\n    let times = this.timeOptions;\n    ...\n    for (let i = start_index + 1; i &lt; this.startTimeList.length; i++) {\n      if (this.startTimeList[i].disabled) {\n        ...\n      } else {\n        this.endTimeList[i].disabled = false;\n      }\n    }\n  },\n  handleDisable() {\n    let times = this.timeOptions;\n    ...\n    this.startTimeList.forEach((start) =&gt; {\n      start.disabled = false;\n    });\n    ...\n  },\n  ...\n},<\/pre>\n<\/li>\n<\/ul>\n<p><strong>\u4ea4\u4e92\u6d41\u7a0b\uff1a<\/strong><\/p>\n<ol>\n<li>\u70b9\u51fb &#8220;\u6dfb\u52a0\u4e00\u884c\u6570\u636e&#8221; \u6309\u94ae\uff0c\u6253\u5f00\u65b0\u589e\u5bf9\u8bdd\u6846\u3002<\/li>\n<li>\u5728\u5bf9\u8bdd\u6846\u4e2d\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\u3002<\/li>\n<li>\u5f53\u5f00\u59cb\u65f6\u6bb5\u9009\u62e9\u540e\uff0c\u5c0f\u4e8e\u5f00\u59cb\u65f6\u6bb5\u7684\u503c\u7f6e\u7070\u4e0d\u53ef\u9009\u3002<\/li>\n<li>\u70b9\u51fb\u65b0\u589e\u65f6\uff0c\u524d\u8fb9\u5df2\u9009\u7684\u6570\u636e\u7f6e\u7070\u4e0d\u53ef\u9009\uff0c\u65b0\u6570\u636e\u53ea\u53ef\u4ee5\u9009\u62e9\u672a\u7f6e\u7070\u7684\u65f6\u95f4\u6bb5\u3002<\/li>\n<li>\u5220\u9664\u5df2\u9009\u6570\u636e\u65f6\uff0c\u8be5\u65f6\u95f4\u8303\u56f4\u91cd\u65b0\u7f6e\u4e3a\u53ef\u9009\u3002<\/li>\n<\/ol>\n<p>\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u4e5f\u5c31\u8bb2\u5b8c\u4e86\u300a\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f\u300b\u7684\u5185\u5bb9\u4e86\u3002\u4e2a\u4eba\u8ba4\u4e3a\uff0c\u57fa\u7840\u77e5\u8bc6\u7684\u5b66\u4e60\u548c\u5de9\u56fa\uff0c\u662f\u4e3a\u4e86\u66f4\u597d\u7684\u5c06\u5176\u8fd0\u7528\u5230\u9879\u76ee\u4e2d\uff0c\u6b22\u8fce\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u5e26\u4f60\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u7684\u77e5\u8bc6\u70b9\uff01<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u4f18\u96c5\u5730\u68c0\u67e5\u51fd\u6570\u53c2\u6570\u662f\u5426\u90fd\u662f\u6570\u5b57\u578b\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f \u4eca\u65e5\u4e0d\u80af\u57cb\u5934\uff0c\u660e\u65e5\u4f55\u4ee5\u62ac\u5934\uff01\u6bcf\u65e5\u4e00\u53e5\u52aa\u529b\u81ea\u5df1\u7684\u8bdd\u54c8\u54c8~\u54c8\u55bd\uff0c\u4eca\u5929\u6211\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u300a\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u5b9e\u73b0\u5df2\u9009\u65f6\u95f4\u7f6e\u7070\uff1f\u300b\uff0c\u4e3b\u8981\u5185\u5bb9\u662f\u8bb2\u89e3\u7b49\u7b49\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u6536\u85cf\u6216\u8005\u6709\u66f4\u597d\u7684\u5efa\u8bae\u5728\u8bc4\u8bba\u63d0\u51fa\uff0c\u6211\u90fd\u4f1a\u8ba4\u771f\u770b\u7684\uff01\u5927\u5bb6\u4e00\u8d77\u8fdb\u6b65\uff0c\u4e00\u8d77\u5b66\u4e60\uff01 \u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u5982\u4f55\u7f6e\u7070\u5df2\u9009\u62e9\u65f6\u95f4\uff1f \u95ee\u9898\uff1a \u9700\u8981\u52a8\u6001\u6dfb\u52a0\u65f6\u95f4\u8303\u56f4\uff0c\u8981\u6c42\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a \u5f00\u59cb\u65f6\u6bb5\u5c0f\u4e8e\u7ed3\u675f\u65f6\u6bb5\u3002 \u540e\u7eed\u6dfb\u52a0\u7684\u65f6\u95f4\u8303\u56f4\u5185\uff0c\u524d\u9762\u5df2\u9009\u62e9\u7684\u65f6\u95f4\u7f6e\u7070\u4e0d\u53ef\u9009\u3002 \u5220\u9664\u67d0\u884c\u5df2\u9009\u7684\u65f6\u95f4\u540e\uff0c\u8be5\u65f6\u95f4\u8303\u56f4\u91cd\u65b0\u7f6e\u4e3a\u53ef\u9009\u3002 \u89e3\u51b3\u65b9\u6848\uff1a \u65b9\u6848\u57fa\u4e8e vue.js \u6846\u67b6\u5b9e\u73b0\uff0c\u5305\u62ec\u7236\u7ec4\u4ef6\u548c\u5b50\u7ec4\u4ef6\uff1a \u7236\u7ec4\u4ef6 \u8d1f\u8d23\u7ba1\u7406\u8868\u683c\u548c\u65b0\u589e\u6570\u636e\u5bf9\u8bdd\u6846\u3002 \u5173\u952e\u4ee3\u7801\uff1a mounted() { const season = [&#8220;\u6625\u5b63&#8221;, &#8220;\u590f\u5b63&#8221;]; const period = [&#8220;\u5c16\u5cf0&#8221;, &#8220;\u9ad8\u5cf0&#8221;, &#8220;\u4f4e\u8c37&#8221;]; this.tabledata = array.from({ length: season.length }, (_, i) =&gt; period.map((pj, j) =&gt; ({ season: season[i], period: pj, timelist: [], })) ).flat(); this.merge(this.tabledata); }, methods: { \/\/ \u8868\u683c\u884c\u5408\u5e76\u65b9\u6cd5 [&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-53297","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53297","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=53297"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53297\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}