初始化提交

This commit is contained in:
maticarmy
2025-02-10 10:39:00 +08:00
commit 59cd2c19d1
491 changed files with 54545 additions and 0 deletions

View File

@@ -0,0 +1,209 @@
<?php
// 禁止 HTTP 访问脚本文件
PHP_SAPI === 'cli' or die('Can only run in CLI mode.');
new class() {
private $tree = [];
public function __construct()
{
$this->debug($this->initBd())->write();
}
/**
* 初始化百度地址行政数据
* @return void
*/
protected function initBd(): array
{
$url = 'https://api.map.baidu.com/api_region_search/v1/?keyword=%E5%85%A8%E5%9B%BD&sub_admin=3&ak=S7I1ewwAVr8r2MI3rnSKeF3R6GTCZiOo&extensions_code=1';
$provs = json_decode(file_get_contents($url), true)['districts'][0]['districts'];
usort($provs, function ($a, $b) {
return $a['code'] > $b['code'] ? 1 : -1;
});
foreach ($provs as &$prov) {
$prov['list'] = $prov['districts'];
usort($prov['list'], function ($a, $b) {
return $a['code'] > $b['code'] ? 1 : -1;
});
foreach ($prov['list'] as &$city) {
$city['list'] = $city['districts'];
usort($city['list'], function ($a, $b) {
return $a['code'] > $b['code'] ? 1 : -1;
});
foreach ($city['list'] as &$area) {
unset($area['level'], $area['list'], $area['districts']);
}
unset($city['level'], $city['districts']);
}
unset($prov['level'], $prov['districts']);
}
return $this->tree = $provs;
}
/**
* 初始化腾讯地址行政
* @param array $data
* @return array
*/
protected function initQq(array $data = []): array
{
$url = 'https://apis.map.qq.com/ws/district/v1/list?key=AVDBZ-VXMC6-VD2SU-M7DX2-TGSV7-WVF3U';
foreach (json_decode(file_get_contents($url), true)['result'] as $items) foreach ($items as $item) {
$data[$item['id']] = ['code' => $item['id'], 'name' => $item['fullname'], 'list' => []];
}
ksort($data);
foreach ($data as $item) {
[$k1, $k2, $k3] = str_split($item['code'], 2);
// 整合省份数据
if ($k2 + $k3 == 0) {
$this->tree[$k1] = $item;
}
// 整合城市
if ($k2 > 0 && $k3 == 0) {
$this->tree[$k1]['list'][$k1 . $k2] = $item;
ksort($this->tree[$k1]['list']);
}
// 整合区域
if ($k2 > 0 && $k3 > 0) {
unset($item['list']);
if (!isset($this->tree[$k1]['list'][$k1 . $k2])) {
$this->tree[$k1]['list'][$k1 . $k2] = array_merge($this->tree[$k1], ['list' => []]);
}
$this->tree[$k1]['list'][$k1 . $k2]['list'][$k1 . $k2 . $k3] = $item;
ksort($this->tree[$k1]['list'][$k1 . $k2]['list']);
}
}
return $this->tree;
}
/**
* 打印输出日志
* @param array $data
* @return $this
*/
private function debug(array $data)
{
ob_clean();
header('Content-type:application/json');
echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
return $this;
}
/**
* 写入更新文件
* @return bool
*/
private function write(): bool
{
$data = [];
$items = array_values($this->tree);
foreach ($items as &$prov) {
$line = [];
$prov['list'] = array_values($prov['list']);
foreach ($prov['list'] as &$city) {
$city['list'] = array_values($city['list']);
$line[] = $city['name'] . ',' . join(',', array_column($city['list'], 'name'));
}
$data[] = $prov['name'] . '$' . join('|', $line);
}
// 数据写入文件
$jsonFile = __DIR__ . '/data.json';
$scriptFile = dirname(__DIR__) . '/pcasunzips.js';
$jsonContent = json_encode($items, JSON_UNESCAPED_UNICODE);
$scriptContent = str_replace('__STRING__', join('#', $data), <<<EOL
/********************************************************
*** 加载脚本文件 ***
<script src="pcasunzip.js"></script>
*** 省市联动 ***
new PCAS("Province","City")
new PCAS("Province","City","吉林省")
new PCAS("Province","City","吉林省","吉林市")
*** 省市区联动 ***
new PCAS("Province","City","Area")
new PCAS("Province","City","Area","吉林省")
new PCAS("Province","City","Area","吉林省","松原市")
new PCAS("Province","City","Area","吉林省","松原市","宁江区")
省、市、地区对象取得的值均为实际值。
注:省、市、地区提示信息选项的值为""(空字符串)
*********************************************************/
SPT = window.SPT || "-省份-";
SCT = window.SCT || "-城市-";
SAT = window.SAT || "-地区-";
SWT = window.SWT || 0; // 提示文字 0:不显示 1:显示
function PCAS() {
this.SelP = document.getElementsByName(arguments[0])[0];
this.SelC = document.getElementsByName(arguments[1])[0];
this.SelA = document.getElementsByName(arguments[2])[0];
this.DefP = this.SelA ? arguments[3] : arguments[2];
this.DefC = this.SelA ? arguments[4] : arguments[3];
this.DefA = this.SelA ? arguments[5] : arguments[4];
if (this.SelP) this.SelP.PCA = this;
if (this.SelC) this.SelC.PCA = this;
if (this.SelA) this.SelA.PCA = this;
if (this.SelP && this.SelC) {
this.SelP.onchange = function () {
PCAS.SetC(this.PCA)
};
if (this.SelA) this.SelC.onchange = function () {
PCAS.SetA(this.PCA)
};
}
PCAS.init(this).SetP(this)
}
PCAS.init = function (PCA) {
PCA.PCAP = [], PCA.PCAC = [], PCA.PCAA = [], PCA.PCAD = "__STRING__";
if (SWT) PCA.PCAD = SPT + "$" + SCT + "," + SAT + "#" + PCA.PCAD;
PCA.PCAD.split("#").forEach(function (VAL1, ID1) {
PCA.PCAP[ID1] = VAL1.split("$")[0], PCA.PCAC[ID1] = [], PCA.PCAA[ID1] = [];
VAL1.split("$")[1].split("|").forEach(function (VAL2, ID2) {
PCA.PCAC[ID1].push((PCA.PCAR = VAL2.split(",")).shift()), PCA.PCAA[ID1][ID2] = PCA.PCAR;
});
});
return this;
};
PCAS.SetP = function (PCA) {
PCA.PCAP.forEach(function (VAL, IDX) {
PCA.PCAT = PCA.PCAV = VAL;
if (PCA.PCAT === SPT) PCA.PCAV = "";
PCA.SelP.options.add(new Option(PCA.PCAT, PCA.PCAV));
if (PCA.DefP === PCA.PCAV) PCA.SelP[IDX].selected = true
}), PCA.SelC ? PCAS.SetC(PCA) : $(PCA.SelP).trigger('change');
};
PCAS.SetC = function (PCA) {
PCA.SelC.length = 0;
PCA.PCAC[PCA.SelP.selectedIndex].forEach(function (VAL, IDX) {
PCA.PCAT = PCA.PCAV = VAL;
if (PCA.PCAT === SCT) PCA.PCAV = "";
PCA.SelC.options.add(new Option(PCA.PCAT, PCA.PCAV));
if (PCA.DefC === PCA.PCAV) PCA.SelC[IDX].selected = true
}), PCA.SelA ? PCAS.SetA(PCA) : $(PCA.SelC).trigger('change');
};
PCAS.SetA = function (PCA) {
PCA.SelA.length = 0;
PCA.PCAA[PCA.SelP.selectedIndex][PCA.SelC.selectedIndex].forEach(function (VAL, IDX) {
PCA.PCAT = PCA.PCAV = VAL;
if (PCA.PCAT === SAT) PCA.PCAV = "";
PCA.SelA.options.add(new Option(PCA.PCAT, PCA.PCAV));
if (PCA.DefA === PCA.PCAV) PCA.SelA[IDX].selected = true
}), $(PCA.SelA).trigger('change')
};
EOL
);
// 写入区域文件
return file_put_contents($scriptFile, $scriptContent) && file_put_contents($jsonFile, $jsonContent);
}
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,79 @@
.autocompleter {
left: 0;
top: 37px;
min-width: 100%;
z-index: 100;
background: #fff;
position: absolute;
}
.autocompleter, .autocompleter-hint {
position: absolute
}
.autocompleter-focus .autocompleter-list {
border: 1px solid #c9c9c9;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
.autocompleter-list {
margin: 0;
padding: 0;
text-align: left;
list-style: none;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.autocompleter-item {
color: #444;
cursor: pointer;
padding: 6px 12px;
}
.autocompleter-item strong {
color: #00B83F;
font-weight: 400;
}
.autocompleter-item span {
color: #aaa
}
.autocompleter-item:hover,
.autocompleter-item-selected {
color: #fff;
background: #009688 !important;
}
.autocompleter-item:hover span,
.autocompleter-item:hover strong,
.autocompleter-item-selected span,
.autocompleter-item-selected strong {
color: #fff;
}
.autocompleter-hint {
left: 0;
top: -56px;
width: 100%;
color: #ccc;
display: none;
font-size: 24px;
text-align: left;
font-weight: 400;
padding: 12px 12px 12px 13px;
}
.autocompleter-hint span {
color: transparent
}
.autocompleter-hint-show {
display: block
}
.autocompleter-closed {
display: none
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(){function t(t){this.message=t}var r="undefined"!=typeof exports?exports:self,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",r.btoa||(r.btoa=function(r){for(var o,n,a=String(r),i=0,c=e,d="";a.charAt(0|i)||(c="=",i%1);d+=c.charAt(63&o>>8-i%1*8)){if(n=a.charCodeAt(i+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return d}),r.atob||(r.atob=function(r){var o=String(r).replace(/=+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,a,i=0,c=0,d="";a=o.charAt(c++);~a&&(n=i%4?64*n+a:a,i++%4)?d+=String.fromCharCode(255&n>>(-2*i&6)):0)a=e.indexOf(a);return d})}();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Deprecated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(a,b,c){var d=new XMLHttpRequest;d.open("GET",a),d.responseType="blob",d.onload=function(){g(d.response,b,c)},d.onerror=function(){console.error("could not download file")},d.send()}function d(a){var b=new XMLHttpRequest;b.open("HEAD",a,!1);try{b.send()}catch(a){}return 200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||("object"!=typeof window||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b,g,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g=g||b.name||"download",j.download=g,j.rel="noopener","string"==typeof b?(j.href=b,j.origin===location.origin?e(j):d(j.href)?c(b,g,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b),setTimeout(function(){i.revokeObjectURL(j.href)},4E4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f,g,h){if(g=g||f.name||"download","string"!=typeof f)navigator.msSaveOrOpenBlob(b(f,h),g);else if(d(f))c(f,g,h);else{var i=document.createElement("a");i.href=f,i.target="_blank",setTimeout(function(){e(i)})}}:function(b,d,e,g){if(g=g||open("","_blank"),g&&(g.document.title=g.document.body.innerText="downloading..."),"string"==typeof b)return c(b,d,e);var h="application/octet-stream"===b.type,i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&"undefined"!=typeof FileReader){var k=new FileReader;k.onloadend=function(){var a=k.result;a=j?a:a.replace(/^data:[^;]*;/,"data:attachment/file;"),g?g.location.href=a:location=a,g=null},k.readAsDataURL(b)}else{var l=f.URL||f.webkitURL,m=l.createObjectURL(b);g?g.location=m:location.href=m,g=null,setTimeout(function(){l.revokeObjectURL(m)},4E4)}});f.saveAs=g.saveAs=g,"undefined"!=typeof module&&(module.exports=g)});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"object"!=typeof JSON&&(JSON={}),function(){"use strict";function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,u,f,a=gap,i=e[t];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(t)),"function"==typeof rep&&(i=rep.call(e,t,i)),typeof i){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,f=[],"[object Array]"===Object.prototype.toString.apply(i)){for(u=i.length,r=0;r<u;r+=1)f[r]=str(r,i)||"null";return o=0===f.length?"[]":gap?"[\n"+gap+f.join(",\n"+gap)+"\n"+a+"]":"["+f.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(u=rep.length,r=0;r<u;r+=1)"string"==typeof rep[r]&&(n=rep[r],o=str(n,i),o&&f.push(quote(n)+(gap?": ":":")+o));else for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=str(n,i),o&&f.push(quote(n)+(gap?": ":":")+o));return o=0===f.length?"{}":gap?"{\n"+gap+f.join(",\n"+gap)+"\n"+a+"}":"{"+f.join(",")+"}",gap=a,o}}var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,r){var n;if(gap="",indent="","number"==typeof r)for(n=0;n<r;n+=1)indent+=" ";else"string"==typeof r&&(indent=r);if(rep=e,e&&"function"!=typeof e&&("object"!=typeof e||"number"!=typeof e.length))throw new Error("JSON.stringify");return str("",{"":t})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(t,e){var r,n,o=t[e];if(o&&"object"==typeof o)for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n=walk(o,r),void 0!==n?o[r]=n:delete o[r]);return reviver.call(t,e,o)}var j;if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();

13
public/static/plugs/jquery/jszip.min.js vendored Normal file

File diff suppressed because one or more lines are too long

10
public/static/plugs/jquery/less.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
public/static/plugs/jquery/md5.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
public/static/plugs/jquery/xlsx.min.js vendored Normal file

File diff suppressed because one or more lines are too long