{"id":3374,"date":"2026-10-21T14:45:15","date_gmt":"2026-10-21T06:45:15","guid":{"rendered":"https:\/\/www.srdc.org.tw\/srdc\/?page_id=3374"},"modified":"2026-10-21T15:07:26","modified_gmt":"2026-10-21T07:07:26","slug":"%e8%8a%b1%e6%9d%b1%e5%81%a5%e5%ba%b7%e7%99%82%e7%99%92%e7%94%a2%e6%a5%ad%e8%b3%87%e6%96%99%e5%ba%ab","status":"publish","type":"page","link":"https:\/\/www.srdc.org.tw\/srdc\/%e8%8a%b1%e6%9d%b1%e5%81%a5%e5%ba%b7%e7%99%82%e7%99%92%e7%94%a2%e6%a5%ad%e8%b3%87%e6%96%99%e5%ba%ab\/","title":{"rendered":"\u82b1\u6771\u5065\u5eb7\u7642\u7652\u7522\u696d\u8cc7\u6599\u5eab"},"content":{"rendered":"\n<link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/1.13.8\/css\/jquery.dataTables.min.css\">\n\n<link rel=\"stylesheet\" href=\"https:\/\/cdn.datatables.net\/responsive\/2.5.0\/css\/responsive.dataTables.min.css\">\n\n<script src=\"https:\/\/code.jquery.com\/jquery-3.7.1.min.js\"><\/script>\n\n<script src=\"https:\/\/cdn.datatables.net\/1.13.8\/js\/jquery.dataTables.min.js\"><\/script>\n\n<script src=\"https:\/\/cdn.datatables.net\/responsive\/2.5.0\/js\/dataTables.responsive.min.js\"><\/script>\n\n<script src=\"https:\/\/cdn.jsdelivr.net\/npm\/sweetalert2@11\"><\/script>\n\n<style>\n\nbody{\n    font-family: Microsoft JhengHei,sans-serif;\n    background:#f5f6fa;\n    margin:20px;\n}\n\nh1{\n    text-align:center;\n}\n\n.card{\n    background:white;\n    padding:20px;\n    border-radius:10px;\n    box-shadow:0 2px 10px rgba(0,0,0,.1);\n}\n\n.detail-btn{\n    background:#1976d2;\n    color:#fff;\n    border:none;\n    border-radius:5px;\n    padding:6px 12px;\n    cursor:pointer;\n}\n\n.detail-btn:hover{\n    background:#1565c0;\n}\n\n.detail-table{\n    width:100%;\n    border-collapse:collapse;\n}\n\n.detail-table td{\n    border:1px solid #ddd;\n    padding:8px;\n    text-align:left;\n    vertical-align:top;\n}\n\n.detail-table td:first-child{\n    width:180px;\n    background:#f8f8f8;\n    font-weight:bold;\n}\n\n.action-btn{\n    display:inline-block;\n    margin:3px;\n    padding:8px 14px;\n    text-decoration:none;\n    color:white;\n    border-radius:5px;\n}\n\n.website-btn{\n    background:#2e7d32;\n}\n\n.map-btn{\n    background:#ff6f00;\n}\n\n.tel-btn{\n    background:#5e35b1;\n}\n\n.detail-link{\n    color:#1976d2;\n    font-weight:600;\n    text-decoration:none;\n}\n\n.detail-link:hover{\n    text-decoration:underline;\n    color:#0d47a1;\n}\n\n<\/style>\n\n\n<div class=\"card\">\n    <table id=\"dataTable\" class=\"display responsive nowrap\" style=\"width:100%\">\n        <thead>\n            <tr>\n                <th>ID<\/th>\n                <th>\u7e23\u5e02<\/th>\n                <th>\u9109\u93ae\u5e02\u5340<\/th>\n                <th>\u55ae\u4f4d\uff0f\u5834\u57df\u540d\u7a31<\/th>\n                <th>\u7522\u696d\u985e\u5225<\/th>\n                <th>\u6838\u5fc3\u8cc7\u6e90<\/th>\n            <\/tr>\n        <\/thead>\n    <\/table>\n<\/div>\n\n<script>\n\nconst DATA_URL =\n'https:\/\/docs.google.com\/spreadsheets\/d\/1iQqpH-ZKnuBfkIANdyF20akhzAXny9xqaifLuaZXWeA\/gviz\/tq?tqx=out:json';\n\nlet sourceData = [];\n\nfunction parseGoogleJson(text){\n\n    const jsonText =\n        text.match(\n            \/google\\.visualization\\.Query\\.setResponse\\(([\\s\\S]*)\\);\/\n        )[1];\n\n    return JSON.parse(jsonText);\n}\n\nfetch(DATA_URL)\n.then(res => res.text())\n.then(text => {\n\n    const json = parseGoogleJson(text);\n\n    const rows = json.table.rows;\n\n    \/\/ \u7b2c\u4e00\u5217\u662f\u6b04\u4f4d\u540d\u7a31\n    const headers = rows[0].c.map(col => col?.v || '');\n\n    \/\/ \u5176\u9918\u624d\u662f\u771f\u6b63\u8cc7\u6599\n    sourceData = rows.slice(1).map(row => {\n\n        let obj = {};\n\n        headers.forEach((header,index)=>{\n\n            let value =\n                row.c[index]?.v ?? '';\n\n            \/\/ \u6e05\u9664 html \u6a19\u7c64\n            if(typeof value === 'string'){\n\n                value = value\n                    .replace(\/<[^>]*>\/g,'')\n                    .trim();\n            }\n\n            obj[header] = value;\n        });\n\n        return obj;\n    });\n\n    initTable();\n\n})\n.catch(err=>{\n\n    console.error(err);\n\n    Swal.fire({\n        icon:'error',\n        title:'\u8cc7\u6599\u8f09\u5165\u5931\u6557',\n        text:err.message\n    });\n\n});\n\nfunction initTable(){\n\n    $('#dataTable').DataTable({\n\n\t\tdestroy:true,\n\t\n\t\tdata: sourceData,\n\t\n\t\tscrollX:true,\n\t\n\t\tresponsive:false,\n\t\n\t\tautoWidth:false,\n\t\n\t\tpageLength:10,\n\t\n\t\torder:[[0,'asc']],\n\t\n\t\tcolumns:[\n\n\t\t\t{ data:'ID' },\n\t\t\n\t\t\t{ data:'\u7e23\u5e02' },\n\t\t\n\t\t\t{ data:'\u9109\u93ae\u5e02\u5340' },\n\t\t\n\t\t\t{\n\t\t\t\tdata:'\u55ae\u4f4d\uff0f\u5834\u57df\u540d\u7a31',\n\t\t\n\t\t\t\trender:function(data, type, row){\n\t\t\n\t\t\t\t\treturn `\n\t\t\t\t\t\t<a href=\"#\"\n\t\t\t\t\t\tclass=\"detail-link\"\n\t\t\t\t\t\tdata-id=\"${row.ID}\">\n\t\t\t\t\t\t\t${data}\n\t\t\t\t\t\t<\/a>`;\n\t\t\t\t}\n\t\t\t},\n\t\t\n\t\t\t{ data:'\u7522\u696d\u985e\u5225' },\n\t\t\n\t\t\t{ data:'\u6838\u5fc3\u8cc7\u6e90' }\n\t\t\n\t\t],\n\t\n\t\tlanguage:{\n\t\t\turl:'https:\/\/cdn.datatables.net\/plug-ins\/1.13.8\/i18n\/zh-HANT.json'\n\t\t}\n\t\n\t});\n\n}\n\n$(document).on(\n    'click',\n    '.detail-link',\n    function(e){\n\n        e.preventDefault();\n\n        const id =\n            $(this).data('id');\n\n        const item =\n            sourceData.find(\n                x => x.ID === id\n            );\n\n        let html =\n            '<table class=\"detail-table\">';\n\n\t\tObject.entries(item).forEach(\n\t\t\t([key,value]) => {\n\t\t\n\t\t\t\tif(!value) value = '';\n\t\t\n\t\t\t\t\/\/ \u5b98\u65b9\u7db2\u7ad9\u986f\u793a\u8d85\u9023\u7d50\n\t\t\t\tif(\n\t\t\t\t\tkey === '\u5b98\u65b9\u7db2\u7ad9' &&\n\t\t\t\t\tString(value).startsWith('http')\n\t\t\t\t){\n\t\t\n\t\t\t\t\tvalue = `\n\t\t\t\t\t\t<a href=\"${value}\"\n\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\trel=\"noopener noreferrer\">\n\t\t\t\t\t\t\t${value}\n\t\t\t\t\t\t<\/a>`;\n\t\t\t\t}\n\t\t\n\t\t\t\thtml += `\n\t\t\t\t<tr>\n\t\t\t\t\t<td>${key}<\/td>\n\t\t\t\t\t<td>${value}<\/td>\n\t\t\t\t<\/tr>`;\n\t\t\t}\n\t\t);\n\n        html += '<\/table>';\n\n        Swal.fire({\n            title: item['\u55ae\u4f4d\uff0f\u5834\u57df\u540d\u7a31'],\n            width: 1000,\n            html: html,\n\n            showConfirmButton: false,\n            showCloseButton: true,\n            allowOutsideClick: true\n        });\n\n    }\n);\n\n<\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ID \u7e23\u5e02 \u9109\u93ae\u5e02\u5340 \u55ae\u4f4d\uff0f\u5834\u57df\u540d\u7a31 \u7522<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"colormag_page_container_layout":"no_sidebar_full_width","colormag_page_sidebar_layout":"no_sidebar","ngg_post_thumbnail":0,"footnotes":""},"class_list":["post-3374","page","type-page","status-publish","hentry"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/pages\/3374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/comments?post=3374"}],"version-history":[{"count":12,"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/pages\/3374\/revisions"}],"predecessor-version":[{"id":3387,"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/pages\/3374\/revisions\/3387"}],"wp:attachment":[{"href":"https:\/\/www.srdc.org.tw\/srdc\/wp-json\/wp\/v2\/media?parent=3374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}