升级owl后台,并引入excel

main
liutk 2024-04-02 17:50:45 +08:00
parent cac6340b98
commit 5af0202f13
323 changed files with 7637 additions and 6758 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
/public/build /public/build
/public/hot /public/hot
/public/storage /public/storage
/public/.user.ini
/storage/*.key /storage/*.key
/vendor /vendor
.env .env

View File

@ -18,7 +18,7 @@ class AuthController extends AdminAuthController
return $this->response()->fail(__('admin.required', ['attribute' => __('admin.captcha')])); return $this->response()->fail(__('admin.required', ['attribute' => __('admin.captcha')]));
} }
if (strtolower(admin_decode($request->sys_captcha)) != strtolower($request->captcha)) { if (strtolower(cache()->pull($request->sys_captcha)) != strtolower($request->captcha)) {
return $this->response()->fail(__('admin.captcha_error')); return $this->response()->fail(__('admin.captcha_error'));
} }
} }
@ -44,8 +44,8 @@ class AuthController extends AdminAuthController
} else { } else {
if ($user && Hash::check($request->password, $user->password)) { if ($user && Hash::check($request->password, $user->password)) {
$module = Admin::currentModule(true); $module = Admin::currentModule(true);
$prefix = $module ? $module.'.' : ''; $prefix = $module ? $module . '.' : '';
$token = $user->createToken($prefix.'admin')->plainTextToken; $token = $user->createToken($prefix . 'admin')->plainTextToken;
return $this->response()->success(compact('token'), __('admin.login_successful')); return $this->response()->success(compact('token'), __('admin.login_successful'));
} }

View File

@ -28,6 +28,7 @@ class KeywordController extends AdminController
//去掉分页-end //去掉分页-end
->headerToolbar([ ->headerToolbar([
$this->createButton(true)->visible(Admin::user()->can('admin.system.keywords.create')), $this->createButton(true)->visible(Admin::user()->can('admin.system.keywords.create')),
$this->exportAction(),
amis('reload')->align('right'), amis('reload')->align('right'),
amis('filter-toggler')->align('right'), amis('filter-toggler')->align('right'),
]) ])

View File

@ -0,0 +1,22 @@
<?php
namespace App\Admin\Middleware;
use Closure;
use Slowlyo\OwlAdmin\Admin;
use Illuminate\Http\Response;
class Authenticate
{
public function handle($request, Closure $next)
{
if (Admin::permission()->authIntercept($request)) {
return Admin::response()
->additional(['code' => Response::HTTP_UNAUTHORIZED])
->doNotDisplayToast()
->fail(__('admin.please_login'));
}
return $next($request);
}
}

View File

@ -11,7 +11,8 @@
"laravel/framework": "^10.10", "laravel/framework": "^10.10",
"laravel/sanctum": "^3.3", "laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8", "laravel/tinker": "^2.8",
"slowlyo/owl-admin": "^3.0", "rap2hpoutre/fast-excel": "^5.4",
"slowlyo/owl-admin": "^3.5",
"tucker-eric/eloquentfilter": "^3.2" "tucker-eric/eloquentfilter": "^3.2"
}, },
"require-dev": { "require-dev": {

258
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b2333ae7a977ba073ff6ef0f01f5de43", "content-hash": "6ce90738fadc40a447dfead6b131ec62",
"packages": [ "packages": [
{ {
"name": "aliyuncs/oss-sdk-php", "name": "aliyuncs/oss-sdk-php",
@ -1994,6 +1994,99 @@
], ],
"time": "2023-02-08T01:06:31+00:00" "time": "2023-02-08T01:06:31+00:00"
}, },
{
"name": "openspout/openspout",
"version": "v4.23.0",
"source": {
"type": "git",
"url": "https://github.com/openspout/openspout.git",
"reference": "28f6a0e45acc3377f34c26cc3866e21f0447e0c8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/openspout/openspout/zipball/28f6a0e45acc3377f34c26cc3866e21f0447e0c8",
"reference": "28f6a0e45acc3377f34c26cc3866e21f0447e0c8",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-fileinfo": "*",
"ext-filter": "*",
"ext-libxml": "*",
"ext-xmlreader": "*",
"ext-zip": "*",
"php": "~8.1.0 || ~8.2.0 || ~8.3.0"
},
"require-dev": {
"ext-zlib": "*",
"friendsofphp/php-cs-fixer": "^3.46.0",
"infection/infection": "^0.27.9",
"phpbench/phpbench": "^1.2.15",
"phpstan/phpstan": "^1.10.55",
"phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan-strict-rules": "^1.5.2",
"phpunit/phpunit": "^10.5.5"
},
"suggest": {
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
"ext-mbstring": "To handle non UTF-8 CSV files (if \"iconv\" is not already installed)"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.3.x-dev"
}
},
"autoload": {
"psr-4": {
"OpenSpout\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Adrien Loison",
"email": "adrien@box.com"
}
],
"description": "PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way",
"homepage": "https://github.com/openspout/openspout",
"keywords": [
"OOXML",
"csv",
"excel",
"memory",
"odf",
"ods",
"office",
"open",
"php",
"read",
"scale",
"spreadsheet",
"stream",
"write",
"xlsx"
],
"support": {
"issues": "https://github.com/openspout/openspout/issues",
"source": "https://github.com/openspout/openspout/tree/v4.23.0"
},
"funding": [
{
"url": "https://paypal.me/filippotessarotto",
"type": "custom"
},
{
"url": "https://github.com/Slamdunk",
"type": "github"
}
],
"time": "2024-01-09T09:30:37+00:00"
},
{ {
"name": "phpoption/phpoption", "name": "phpoption/phpoption",
"version": "1.9.2", "version": "1.9.2",
@ -2632,17 +2725,146 @@
"time": "2023-11-08T05:53:05+00:00" "time": "2023-11-08T05:53:05+00:00"
}, },
{ {
"name": "slowlyo/owl-admin", "name": "rap2hpoutre/fast-excel",
"version": "v3.1.6", "version": "v5.4.0",
"source": {
"type": "git",
"url": "https://github.com/rap2hpoutre/fast-excel.git",
"reference": "27c346ca2a4de448f856d0926b05d7e2511e43b8"
},
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://mirrors.tencent.com/repository/composer/slowlyo/owl-admin/v3.1.6/slowlyo-owl-admin-v3.1.6.zip", "url": "https://api.github.com/repos/rap2hpoutre/fast-excel/zipball/27c346ca2a4de448f856d0926b05d7e2511e43b8",
"reference": "1c62b5ad6d57ba4276e4219f5e19207073e3fe4b", "reference": "27c346ca2a4de448f856d0926b05d7e2511e43b8",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"illuminate/support": "~9|~10", "illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
"php": ">=8.0" "openspout/openspout": "^4.1.1",
"php": "^8.0"
},
"require-dev": {
"illuminate/database": "^6.20.12 || ^7.30.4 || ^8.24.0 || ^9.0 || ^10.0 || ^11.0",
"phpunit/phpunit": "^9.5 || ^10.1",
"squizlabs/php_codesniffer": "3.*"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Rap2hpoutre\\FastExcel\\Providers\\FastExcelServiceProvider"
]
}
},
"autoload": {
"files": [
"src/functions/fastexcel.php"
],
"psr-4": {
"Rap2hpoutre\\FastExcel\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "rap2h",
"email": "raphaelht@gmail.com"
}
],
"description": "Fast Excel import/export for Laravel",
"keywords": [
"csv",
"excel",
"laravel",
"xls",
"xlsx"
],
"support": {
"issues": "https://github.com/rap2hpoutre/fast-excel/issues",
"source": "https://github.com/rap2hpoutre/fast-excel/tree/v5.4.0"
},
"funding": [
{
"url": "https://github.com/rap2hpoutre",
"type": "github"
}
],
"time": "2024-03-06T16:03:49+00:00"
},
{
"name": "slowlyo/laravel-support",
"version": "v0.0.1",
"source": {
"type": "git",
"url": "https://github.com/Slowlyo/laravel-support.git",
"reference": "8c6d3b2cb176518a8e0cc87eb35fcce93c72c49b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Slowlyo/laravel-support/zipball/8c6d3b2cb176518a8e0cc87eb35fcce93c72c49b",
"reference": "8c6d3b2cb176518a8e0cc87eb35fcce93c72c49b",
"shasum": ""
},
"require": {
"laravel/framework": ">=8",
"php": ">=7.4.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Slowlyo\\Support\\SupportServiceProvider"
]
}
},
"autoload": {
"files": [
"./src/functions.php"
],
"psr-4": {
"Slowlyo\\Support\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Slowlyo",
"email": "slowlyo_email@qq.com"
}
],
"description": "php/laravel部分代码封装",
"support": {
"issues": "https://github.com/Slowlyo/laravel-support/issues",
"source": "https://github.com/Slowlyo/laravel-support/tree/v0.0.1"
},
"time": "2024-02-22T09:48:11+00:00"
},
{
"name": "slowlyo/owl-admin",
"version": "v3.5.6",
"source": {
"type": "git",
"url": "https://github.com/slowlyo/owl-admin.git",
"reference": "29767ca4deebfcd3676dc055c750a185484ff77f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/slowlyo/owl-admin/zipball/29767ca4deebfcd3676dc055c750a185484ff77f",
"reference": "29767ca4deebfcd3676dc055c750a185484ff77f",
"shasum": ""
},
"require": {
"ext-gd": "*",
"ext-zip": "*",
"illuminate/support": ">=9",
"php": ">=8.0",
"slowlyo/laravel-support": "*"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
@ -2663,25 +2885,33 @@
"Slowlyo\\OwlAdmin\\": "src/" "Slowlyo\\OwlAdmin\\": "src/"
} }
}, },
"notification-url": "https://packagist.org/downloads/",
"license": [ "license": [
"MIT" "MIT"
], ],
"authors": [ "authors": [
{ {
"name": "Slowlyo", "name": "slowlyo",
"email": "slowlyo_email@qq.com.com", "email": "slowlyo_email@qq.com",
"homepage": "https://gitee.com/slowlyo" "homepage": "https://github.com/slowlyo"
} }
], ],
"description": "基于 laravel、amis 开发的后台框架~", "description": "基于 laravel、amis 开发的后台框架~",
"homepage": "https://github.com/slowlyo/owl-admin", "homepage": "https://github.com/slowlyo/owl-admin",
"keywords": [ "keywords": [
"OwlAdmin",
"admin", "admin",
"amis", "amis",
"laravel" "laravel",
"owl-admin"
], ],
"time": "2024-01-15T03:15:01+00:00" "support": {
"email": "slowlyo_email@qq.com",
"forum": "https://github.com/Slowlyo/owl-admin/discussions",
"issues": "https://github.com/Slowlyo/owl-admin/issues",
"source": "https://github.com/slowlyo/owl-admin/tree/v3.5.6",
"wiki": "https://doc.owladmin.com/"
},
"time": "2024-04-02T06:12:27+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
@ -6404,5 +6634,5 @@
"php": "^8.1" "php": "^8.1"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }

View File

@ -22,7 +22,7 @@ return [
'domain' => null, 'domain' => null,
'namespace' => 'App\\Admin\\Controllers', 'namespace' => 'App\\Admin\\Controllers',
'middleware' => [ 'middleware' => [
'admin.auth', \App\Admin\Middleware\Authenticate::class,
'admin.bootstrap', 'admin.bootstrap',
\App\Admin\Middleware\CheckPermission::class, \App\Admin\Middleware\CheckPermission::class,
'sanctum', 'sanctum',
@ -41,6 +41,8 @@ return [
'enable' => true, 'enable' => true,
// 是否开启鉴权 // 是否开启鉴权
'permission' => true, 'permission' => true,
// token 有效期 (分钟), 为空则不会过期
'token_expiration' => null,
'guard' => 'admin', 'guard' => 'admin',
'guards' => [ 'guards' => [
'admin' => [ 'admin' => [
@ -67,6 +69,12 @@ return [
'file' => 'files', 'file' => 'files',
'rich' => 'rich', 'rich' => 'rich',
], ],
// 临时目录
'tem_directory' => [
'image' => 'temporary/images',
'file' => 'temporary/file',
'rich' => 'temporary/rich',
]
], ],
'https' => env('ADMIN_HTTPS', false), 'https' => env('ADMIN_HTTPS', false),
@ -120,6 +128,10 @@ return [
'admin_permission' => \Slowlyo\OwlAdmin\Models\AdminPermission::class, 'admin_permission' => \Slowlyo\OwlAdmin\Models\AdminPermission::class,
], ],
'modules_namespace' => 'AdminModules',
'modules_dir' => base_path('admin-modules'),
'modules' => [ 'modules' => [
], ],
]; ];

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

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

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 @@
import{B as b,c as B,b as T,m as E,a as S,e as z,f as x,r as L,g as N}from"./index-C8YrUFHM.js";import"./tslib.es6-BDyQ-Jie.js";function r(t,n){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=n,this._projection=new BMap.MercatorProjection}r.prototype.type="bmap";r.prototype.dimensions=["lng","lat"];r.prototype.setZoom=function(t){this._zoom=t};r.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))};r.prototype.setMapOffset=function(t){this._mapOffset=t};r.prototype.getBMap=function(){return this._bmap};r.prototype.dataToPoint=function(t){var n=new BMap.Point(t[0],t[1]),e=this._bmap.pointToOverlayPixel(n),a=this._mapOffset;return[e.x-a[0],e.y-a[1]]};r.prototype.pointToData=function(t){var n=this._mapOffset;return t=this._bmap.overlayPixelToPoint({x:t[0]+n[0],y:t[1]+n[1]}),[t.lng,t.lat]};r.prototype.getViewRect=function(){var t=this._api;return new b(0,0,t.getWidth(),t.getHeight())};r.prototype.getRoamTransform=function(){return B()};r.prototype.prepareCustoms=function(){var t=this.getViewRect();return{coordSys:{type:"bmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:T(this.dataToPoint,this),size:T(V,this)}}};r.prototype.convertToPixel=function(t,n,e){return this.dataToPoint(e)};r.prototype.convertFromPixel=function(t,n,e){return this.pointToData(e)};function V(t,n){return n=n||[0,0],E([0,1],function(e){var a=n[e],o=t[e]/2,f=[],m=[];return f[e]=a-o,m[e]=a+o,f[1-e]=m[1-e]=n[1-e],Math.abs(this.dataToPoint(f)[e]-this.dataToPoint(m)[e])},this)}var _;r.dimensions=r.prototype.dimensions;function H(){function t(n){this._root=n}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(n){return n.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}r.create=function(t,n){var e,a=n.getDom();return t.eachComponent("bmap",function(o){var f=n.getZr().painter,m=f.getViewportRoot();if(typeof BMap>"u")throw new Error("BMap api is not loaded");if(_=_||H(),e)throw new Error("Only one bmap component can exist");var i;if(!o.__bmap){var p=a.querySelector(".ec-extension-bmap");p&&(m.style.left="0px",m.style.top="0px",a.removeChild(p)),p=document.createElement("div"),p.className="ec-extension-bmap",p.style.cssText="position:absolute;width:100%;height:100%",a.appendChild(p);var s=o.get("mapOptions");s&&(s=S(s),delete s.mapType),i=o.__bmap=new BMap.Map(p,s);var d=new _(m);i.addOverlay(d),f.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}i=o.__bmap;var l=o.get("center"),c=o.get("zoom");if(l&&c){var y=i.getCenter(),v=i.getZoom(),u=o.centerOrZoomChanged([y.lng,y.lat],v);if(u){var w=new BMap.Point(l[0],l[1]);i.centerAndZoom(w,c)}}e=new r(i,n),e.setMapOffset(o.__mapOffset||[0,0]),e.setZoom(c),e.setCenter(l),o.coordinateSystem=e}),t.eachSeries(function(o){o.get("coordinateSystem")==="bmap"&&(o.coordinateSystem=e)}),e&&[e]};function R(t,n){return t&&n&&t[0]===n[0]&&t[1]===n[1]}z({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,n){this.option.center=t,this.option.zoom=n},centerOrZoomChanged:function(t,n){var e=this.option;return!(R(t,e.center)&&n===e.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},mapOptions:{},roam:!1}});function Z(t){for(var n in t)if(t.hasOwnProperty(n))return!1;return!0}x({type:"bmap",render:function(t,n,e){var a=!0,o=t.getBMap(),f=e.getZr().painter.getViewportRoot(),m=t.coordinateSystem,i=function(w,D){if(!a){var O=f.parentNode.parentNode.parentNode,h=[-parseInt(O.style.left,10)||0,-parseInt(O.style.top,10)||0],g=f.style,C=h[0]+"px",P=h[1]+"px";g.left!==C&&(g.left=C),g.top!==P&&(g.top=P),m.setMapOffset(h),t.__mapOffset=h,e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}};function p(){a||e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("moveend",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",i),o.addEventListener("moveend",i),o.addEventListener("zoomend",p),this._oldMoveHandler=i,this._oldZoomEndHandler=p;var s=t.get("roam");s&&s!=="scale"?o.enableDragging():o.disableDragging(),s&&s!=="move"?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var d=t.__mapStyle,l=t.get("mapStyle")||{},c=JSON.stringify(l);JSON.stringify(d)!==c&&(Z(l)||o.setMapStyle(S(l)),t.__mapStyle=JSON.parse(c));var y=t.__mapStyle2,v=t.get("mapStyleV2")||{},u=JSON.stringify(v);JSON.stringify(y)!==u&&(Z(v)||o.setMapStyleV2(S(v)),t.__mapStyle2=JSON.parse(u)),a=!1}});L("bmap",r);N({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,n){n.eachComponent("bmap",function(e){var a=e.getBMap(),o=a.getCenter();e.setCenterAndZoom([o.lng,o.lat],a.getZoom())})});var j="1.0.0";export{j as version};

Binary file not shown.

View File

@ -1 +0,0 @@
import{B as b,c as B,b as T,m as E,a as S,e as z,f as x,r as L,g as N}from"./index-a466bea1.js";function r(t,n){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=n,this._projection=new BMap.MercatorProjection}r.prototype.type="bmap";r.prototype.dimensions=["lng","lat"];r.prototype.setZoom=function(t){this._zoom=t};r.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))};r.prototype.setMapOffset=function(t){this._mapOffset=t};r.prototype.getBMap=function(){return this._bmap};r.prototype.dataToPoint=function(t){var n=new BMap.Point(t[0],t[1]),e=this._bmap.pointToOverlayPixel(n),a=this._mapOffset;return[e.x-a[0],e.y-a[1]]};r.prototype.pointToData=function(t){var n=this._mapOffset;return t=this._bmap.overlayPixelToPoint({x:t[0]+n[0],y:t[1]+n[1]}),[t.lng,t.lat]};r.prototype.getViewRect=function(){var t=this._api;return new b(0,0,t.getWidth(),t.getHeight())};r.prototype.getRoamTransform=function(){return B()};r.prototype.prepareCustoms=function(){var t=this.getViewRect();return{coordSys:{type:"bmap",x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:T(this.dataToPoint,this),size:T(V,this)}}};r.prototype.convertToPixel=function(t,n,e){return this.dataToPoint(e)};r.prototype.convertFromPixel=function(t,n,e){return this.pointToData(e)};function V(t,n){return n=n||[0,0],E([0,1],function(e){var a=n[e],o=t[e]/2,f=[],l=[];return f[e]=a-o,l[e]=a+o,f[1-e]=l[1-e]=n[1-e],Math.abs(this.dataToPoint(f)[e]-this.dataToPoint(l)[e])},this)}var _;r.dimensions=r.prototype.dimensions;function H(){function t(n){this._root=n}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(n){return n.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}r.create=function(t,n){var e,a=n.getDom();return t.eachComponent("bmap",function(o){var f=n.getZr().painter,l=f.getViewportRoot();if(typeof BMap>"u")throw new Error("BMap api is not loaded");if(_=_||H(),e)throw new Error("Only one bmap component can exist");var i;if(!o.__bmap){var p=a.querySelector(".ec-extension-bmap");p&&(l.style.left="0px",l.style.top="0px",a.removeChild(p)),p=document.createElement("div"),p.className="ec-extension-bmap",p.style.cssText="position:absolute;width:100%;height:100%",a.appendChild(p);var s=o.get("mapOptions");s&&(s=S(s),delete s.mapType),i=o.__bmap=new BMap.Map(p,s);var d=new _(l);i.addOverlay(d),f.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}i=o.__bmap;var m=o.get("center"),c=o.get("zoom");if(m&&c){var y=i.getCenter(),v=i.getZoom(),u=o.centerOrZoomChanged([y.lng,y.lat],v);if(u){var w=new BMap.Point(m[0],m[1]);i.centerAndZoom(w,c)}}e=new r(i,n),e.setMapOffset(o.__mapOffset||[0,0]),e.setZoom(c),e.setCenter(m),o.coordinateSystem=e}),t.eachSeries(function(o){o.get("coordinateSystem")==="bmap"&&(o.coordinateSystem=e)}),e&&[e]};function R(t,n){return t&&n&&t[0]===n[0]&&t[1]===n[1]}z({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,n){this.option.center=t,this.option.zoom=n},centerOrZoomChanged:function(t,n){var e=this.option;return!(R(t,e.center)&&n===e.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},mapStyleV2:{},mapOptions:{},roam:!1}});function Z(t){for(var n in t)if(t.hasOwnProperty(n))return!1;return!0}x({type:"bmap",render:function(t,n,e){var a=!0,o=t.getBMap(),f=e.getZr().painter.getViewportRoot(),l=t.coordinateSystem,i=function(w,D){if(!a){var O=f.parentNode.parentNode.parentNode,h=[-parseInt(O.style.left,10)||0,-parseInt(O.style.top,10)||0],g=f.style,C=h[0]+"px",P=h[1]+"px";g.left!==C&&(g.left=C),g.top!==P&&(g.top=P),l.setMapOffset(h),t.__mapOffset=h,e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}};function p(){a||e.dispatchAction({type:"bmapRoam",animation:{duration:0}})}o.removeEventListener("moving",this._oldMoveHandler),o.removeEventListener("moveend",this._oldMoveHandler),o.removeEventListener("zoomend",this._oldZoomEndHandler),o.addEventListener("moving",i),o.addEventListener("moveend",i),o.addEventListener("zoomend",p),this._oldMoveHandler=i,this._oldZoomEndHandler=p;var s=t.get("roam");s&&s!=="scale"?o.enableDragging():o.disableDragging(),s&&s!=="move"?(o.enableScrollWheelZoom(),o.enableDoubleClickZoom(),o.enablePinchToZoom()):(o.disableScrollWheelZoom(),o.disableDoubleClickZoom(),o.disablePinchToZoom());var d=t.__mapStyle,m=t.get("mapStyle")||{},c=JSON.stringify(m);JSON.stringify(d)!==c&&(Z(m)||o.setMapStyle(S(m)),t.__mapStyle=JSON.parse(c));var y=t.__mapStyle2,v=t.get("mapStyleV2")||{},u=JSON.stringify(v);JSON.stringify(y)!==u&&(Z(v)||o.setMapStyleV2(S(v)),t.__mapStyle2=JSON.parse(u)),a=!1}});L("bmap",r);N({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,n){n.eachComponent("bmap",function(e){var a=e.getBMap(),o=a.getCenter();e.setCenterAndZoom([o.lng,o.lat],a.getZoom())})});var J="1.0.0";export{J as version};

View File

@ -1,4 +1,4 @@
import{cu as Rt,f as Lt}from"./index-c791cd12.js";import{h as Bt}from"./index-a466bea1.js";function Xt(J,rt){for(var $=0;$<rt.length;$++){const Y=rt[$];if(typeof Y!="string"&&!Array.isArray(Y)){for(const R in Y)if(R!=="default"&&!(R in J)){const j=Object.getOwnPropertyDescriptor(Y,R);j&&Object.defineProperty(J,R,j.get?j:{enumerable:!0,get:()=>Y[R]})}}}return Object.freeze(Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}))}var Tt={exports:{}};const Yt=Rt(Bt);(function(J,rt){(function(Y,R){J.exports=R(Yt)})(self,function($){return(()=>{var Y={"./index.js":(L,K,mt)=>{mt.r(K);var O=mt("echarts/lib/echarts");O.extendSeriesModel({type:"series.wordCloud",visualStyleAccessPath:"textStyle",visualStyleMapper:function(f){return{fill:f.get("color")}},visualDrawType:"fill",optionUpdated:function(){var f=this.option;f.gridSize=Math.max(Math.floor(f.gridSize),4)},getInitialData:function(f,o){var a=O.helper.createDimensions(f.data,{coordDimensions:["value"]}),l=new O.List(a,this);return l.initData(f.data),l},defaultOption:{maskImage:null,shape:"circle",keepAspect:!1,left:"center",top:"center",width:"70%",height:"80%",sizeRange:[12,60],rotationRange:[-90,90],rotationStep:45,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,textStyle:{fontWeight:"normal"}}}),O.extendChartView({type:"wordCloud",render:function(f,o,a){var l=this.group;l.removeAll();var t=f.getData(),x=f.get("gridSize");f.layoutInstance.ondraw=function(d,r,T,P){var B=t.getItemModel(T),q=B.getModel("textStyle"),b=new O.graphic.Text({style:O.helper.createTextStyle(q),scaleX:1/P.info.mu,scaleY:1/P.info.mu,x:(P.gx+P.info.gw/2)*x,y:(P.gy+P.info.gh/2)*x,rotation:P.rot});b.setStyle({x:P.info.fillTextOffsetX,y:P.info.fillTextOffsetY+r*.5,text:d,verticalAlign:"middle",fill:t.getItemVisual(T,"style").fill,fontSize:r}),l.add(b),t.setItemGraphicEl(T,b),b.ensureState("emphasis").style=O.helper.createTextStyle(B.getModel(["emphasis","textStyle"]),{state:"emphasis"}),b.ensureState("blur").style=O.helper.createTextStyle(B.getModel(["blur","textStyle"]),{state:"blur"}),O.helper.enableHoverEmphasis(b,B.get(["emphasis","focus"]),B.get(["emphasis","blurScope"])),b.stateTransition={duration:f.get("animation")?f.get(["stateAnimation","duration"]):0,easing:f.get(["stateAnimation","easing"])},b.__highDownDispatcher=!0},this._model=f},remove:function(){this.group.removeAll(),this._model.layoutInstance.dispose()},dispose:function(){this._model.layoutInstance.dispose()}});/*! import{V as Rt,p as Lt}from"./index-5zY5TMAp.js";import{h as Bt}from"./index-C8YrUFHM.js";function Xt(J,rt){for(var $=0;$<rt.length;$++){const Y=rt[$];if(typeof Y!="string"&&!Array.isArray(Y)){for(const R in Y)if(R!=="default"&&!(R in J)){const j=Object.getOwnPropertyDescriptor(Y,R);j&&Object.defineProperty(J,R,j.get?j:{enumerable:!0,get:()=>Y[R]})}}}return Object.freeze(Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}))}var Tt={exports:{}};const Yt=Rt(Bt);(function(J,rt){(function(Y,R){J.exports=R(Yt)})(self,function($){return(()=>{var Y={"./index.js":(L,K,mt)=>{mt.r(K);var O=mt("echarts/lib/echarts");O.extendSeriesModel({type:"series.wordCloud",visualStyleAccessPath:"textStyle",visualStyleMapper:function(f){return{fill:f.get("color")}},visualDrawType:"fill",optionUpdated:function(){var f=this.option;f.gridSize=Math.max(Math.floor(f.gridSize),4)},getInitialData:function(f,o){var a=O.helper.createDimensions(f.data,{coordDimensions:["value"]}),l=new O.List(a,this);return l.initData(f.data),l},defaultOption:{maskImage:null,shape:"circle",keepAspect:!1,left:"center",top:"center",width:"70%",height:"80%",sizeRange:[12,60],rotationRange:[-90,90],rotationStep:45,gridSize:8,drawOutOfBound:!1,shrinkToFit:!1,textStyle:{fontWeight:"normal"}}}),O.extendChartView({type:"wordCloud",render:function(f,o,a){var l=this.group;l.removeAll();var t=f.getData(),x=f.get("gridSize");f.layoutInstance.ondraw=function(d,r,T,P){var B=t.getItemModel(T),q=B.getModel("textStyle"),b=new O.graphic.Text({style:O.helper.createTextStyle(q),scaleX:1/P.info.mu,scaleY:1/P.info.mu,x:(P.gx+P.info.gw/2)*x,y:(P.gy+P.info.gh/2)*x,rotation:P.rot});b.setStyle({x:P.info.fillTextOffsetX,y:P.info.fillTextOffsetY+r*.5,text:d,verticalAlign:"middle",fill:t.getItemVisual(T,"style").fill,fontSize:r}),l.add(b),t.setItemGraphicEl(T,b),b.ensureState("emphasis").style=O.helper.createTextStyle(B.getModel(["emphasis","textStyle"]),{state:"emphasis"}),b.ensureState("blur").style=O.helper.createTextStyle(B.getModel(["blur","textStyle"]),{state:"blur"}),O.helper.enableHoverEmphasis(b,B.get(["emphasis","focus"]),B.get(["emphasis","blurScope"])),b.stateTransition={duration:f.get("animation")?f.get(["stateAnimation","duration"]):0,easing:f.get(["stateAnimation","easing"])},b.__highDownDispatcher=!0},this._model=f},remove:function(){this.group.removeAll(),this._model.layoutInstance.dispose()},dispose:function(){this._model.layoutInstance.dispose()}});/*!
* wordcloud2.js * wordcloud2.js
* http://timdream.org/wordcloud2.js/ * http://timdream.org/wordcloud2.js/
* *

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Some files were not shown because too many files have changed in this diff Show More