Compare commits

...

10 Commits

Author SHA1 Message Date
邹景立
a70457b996 Update DataUser.php 2022-05-07 15:48:56 +08:00
邹景立
430ac9d6db Update index.html 2022-05-07 15:34:16 +08:00
邹景立
36032bab0f 修改模板 2022-05-07 11:44:21 +08:00
邹景立
3a69db014d 修改任务表格展示 2022-05-07 11:40:42 +08:00
邹景立
816dd8a4ab 修改文件上传兼容 2022-05-07 11:07:48 +08:00
邹景立
6bc4a88c63 Update area.php 2022-05-07 10:47:53 +08:00
邹景立
17b080ec92 Update area.php 2022-05-07 10:46:44 +08:00
邹景立
f607e8ecc0 Update area.php 2022-05-07 10:46:19 +08:00
邹景立
dfc78fc636 修改省市区 2022-05-07 10:36:36 +08:00
邹景立
55b242211f 修改省市区计算 2022-05-07 10:33:52 +08:00
9 changed files with 51 additions and 29 deletions

View File

@ -75,7 +75,11 @@ define(['md5'], function (SparkMD5, allowMime) {
}
}, done: function (ret, idx) {
// 兼容部分环境不解析 JSON 数据
if (typeof ret === 'string') ret = JSON.parse(ret) || ret;
if (typeof ret === 'string' && ret.length > 0) try {
ret = JSON.parse(ret) || ret;
} catch (e) {
console.log(e)
}
/*! 检查单个文件上传返回的结果 */
if (ret.code < 1) return $.msg.tips(ret.info || '文件上传失败!');
if (typeof opt.cache[idx].xurl !== 'string') return $.msg.tips('无效的文件上传对象!');

View File

@ -64,7 +64,7 @@
cols: [[
{checkbox: true, fixed: 'left'},
{
field: 'id', title: '任务名称', minWidth: 230, sort: true, templet: function (d) {
field: 'id', title: '任务名称', width: '25%', sort: true, templet: function (d) {
if (d.loops_time > 0) {
d.one = '<span class="layui-badge think-bg-blue">循</span>';
} else {
@ -79,7 +79,7 @@
}
},
{
field: 'exec_time', title: '任务计划', minWidth: 300, templet: function (d) {
field: 'exec_time', title: '任务计划', width: '25%', templet: function (d) {
d.html = '执行指令:' + d.command + '<br>计划执行:' + d.exec_time;
if (d.loops_time > 0) {
return d.html + ' ( 每 <b class="color-blue">' + d.loops_time + '</b> 秒 ) ';
@ -89,7 +89,7 @@
}
},
{
field: 'loops_time', title: '执行状态', minWidth: 400, templet: function (d) {
field: 'loops_time', title: '执行状态', width: '30%', templet: function (d) {
d.html = ([
'<span class="pull-left layui-badge layui-badge-middle layui-bg-gray">未知</span>',
'<span class="pull-left layui-badge layui-badge-middle layui-bg-black">等待</span>',

View File

@ -11,5 +11,13 @@ use think\admin\Model;
*/
class DataUser extends Model
{
/**
* 格式化创建时间
* @param string $value
* @return string
*/
public function getCreateAtAttr(string $value): string
{
return format_datetime($value);
}
}

View File

@ -98,7 +98,7 @@
<div>间接团队 <b>{$vo.teams_users_indirect}</b> ( 业绩 <b>{$vo.teams_amount_indirect+0}</b> )</div>
</td>
<td class="nowrap">
<div>注册时间:{$vo.create_at|format_datetime}</div>
<div>注册时间:{$vo.create_at}</div>
<div>
代理关联:<!--{notempty name='vo.pids'}-->
<b class="color-green">永久绑定</b>

View File

@ -1,4 +1,4 @@
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card shadow-none">
<div class="layui-card-header border-0">
<div class="layui-bg-gray padding-col-20 border-radius-5 layui-elip">

View File

@ -1,4 +1,4 @@
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card">
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card shadow-none">
<div class="layui-card-header border-0">
<div class="layui-bg-gray padding-col-20 border-radius-5 layui-elip">

View File

@ -1,47 +1,57 @@
<?php
// 禁止 HTTP 访问脚本文件
PHP_SAPI === 'cli' or die('Can only run in CLI mode.');
// 从腾讯地址接口获取数据
$url = 'https://apis.map.qq.com/ws/district/v1/list?key=AVDBZ-VXMC6-VD2SU-M7DX2-TGSV7-WVF3U';
$result = json_decode(file_get_contents($url), true)['result'];
$items = [];
foreach ($result[0] as $pro) {
$items[$pro['id']] = ['name' => $pro['fullname'], 'list' => []];
// 生成数据字典(方便查询)
$maps = [];
foreach ($result as $items) foreach ($items as $item) {
$id = preg_replace('#(0000$|00$)#', '', $item['id']);
$item['list'] = [];
$item['location'] = join(',', $item['location'] ?? []);
unset($item['cidx'], $item['pinyin']);
$maps[$id] = $item;
}
ksort($maps);
foreach ($result[1] as $prov) {
$pkey = substr($prov['id'], 0, 2) . '0000';
if (substr($prov['id'], 4, 2) > 0) {
$ckey = substr($prov['id'], 0, 4) . '00';
$items[$pkey]['list'][$ckey]['name'] = $items[$pkey]['name'];
$items[$pkey]['list'][$ckey]['list'][$prov['id']] = ['name' => $prov['fullname'], 'list' => []];
// 根据名称生成数据树
$items = [];
foreach ($maps as $key => $map) {
[$c1, $c2, $c3] = str_split("{$key}0000", 2);
$pname = $maps[$c1]['fullname'] ?? '';
$cname = $maps[$c1 . $c2]['fullname'] ?? $pname;
if ($c2 . $c3 === '0000') {
$items[$pname] = $map;
} elseif ($c3 === '00') {
$items[$pname]['list'][$cname] = $map;
} else {
$items[$pkey]['list'][$prov['id']] = ['name' => $prov['fullname'], 'list' => []];
if (empty($items[$pname]['list'][$cname])) {
$items[$pname]['list'][$cname] = $items[$pname];
}
$items[$pname]['list'][$cname]['list'][] = $map;
}
}
foreach ($result[2] as $area) {
$ckey = substr($area['id'], 0, 4) . '00';
$pkey = substr($area['id'], 0, 2) . '0000';
$items[$pkey]['list'][$ckey]['list'][$area['id']] = ['name' => $area['fullname'], 'list' => []];
}
// 生成插件数据(去除索引值)
$data = [];
$items = array_values($items);
foreach ($items as &$prov) {
$lines = [];
$prov['list'] = array_values($prov['list']);
foreach ($prov['list'] as &$city) {
$city['list'] = array_values($city['list']);
$lines[] = $city['name'] . ',' . join(',', array_column($city['list'], 'name'));
$lines[] = $city['fullname'] . ',' . join(',', array_column($city['list'], 'fullname'));
}
$data[] = $prov['name'] . '$' . join('|', $lines);
$data[] = $prov['fullname'] . '$' . join('|', $lines);
}
$jsonFile = __DIR__ . '/data.json';
$scriptFile = dirname(__DIR__) . '/pcasunzips.js';
$jsonContent = json_encode(array_values($items), JSON_UNESCAPED_UNICODE);
$jsonContent = json_encode($items, JSON_UNESCAPED_UNICODE);
$scriptContent = str_replace('__STRING__', join('#', $data), <<<EOL
/********************************************************
*** 加载脚本文件 ***

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long