加入ViewerJS,目前什么都没有实现

This commit is contained in:
Chenx221 2024-02-18 18:43:47 +08:00
parent c1f6934a86
commit 797a958490
Signed by: chenx221
GPG Key ID: D7A9EC07024C3021
3 changed files with 105 additions and 80 deletions

13
assets/ViewerJsAsset.php Normal file
View File

@ -0,0 +1,13 @@
<?php
namespace app\assets;
use yii\web\AssetBundle;
class ViewerJsAsset extends AssetBundle
{
public $sourcePath = '@npm/viewerjs/dist';
public $js = [
'viewer.min.js',
];
}

View File

@ -1,7 +1,12 @@
{ {
"name": "yiisoft/yii2-app-basic", "name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template", "description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"], "keywords": [
"yii2",
"framework",
"basic",
"project template"
],
"homepage": "https://www.yiiframework.com/", "homepage": "https://www.yiiframework.com/",
"type": "project", "type": "project",
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
@ -26,7 +31,8 @@
"ext-rar": "*", "ext-rar": "*",
"wapmorgan/unified-archive": "^1.2", "wapmorgan/unified-archive": "^1.2",
"symfony/console": "^6.1", "symfony/console": "^6.1",
"gemorroj/archive7z": "^5.7" "gemorroj/archive7z": "^5.7",
"npm-asset/viewerjs": "^1.11"
}, },
"require-dev": { "require-dev": {
"yiisoft/yii2-debug": "~2.1.0", "yiisoft/yii2-debug": "~2.1.0",
@ -76,6 +82,10 @@
} }
}, },
"repositories": [ "repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
},
{ {
"type": "composer", "type": "composer",
"url": "https://asset-packagist.org" "url": "https://asset-packagist.org"

View File

@ -6,6 +6,7 @@
/* @var $directory string 当前路径 */ /* @var $directory string 当前路径 */
use app\assets\ViewerJsAsset;
use app\models\NewFolderForm; use app\models\NewFolderForm;
use app\models\RenameForm; use app\models\RenameForm;
use app\models\Share; use app\models\Share;
@ -24,6 +25,7 @@ $this->title = '文件管理';
$this->params['breadcrumbs'][] = $this->title; $this->params['breadcrumbs'][] = $this->title;
FontAwesomeAsset::register($this); FontAwesomeAsset::register($this);
JqueryAsset::register($this); JqueryAsset::register($this);
ViewerJsAsset::register($this);
$this->registerCssFile('@web/css/home_style.css'); $this->registerCssFile('@web/css/home_style.css');
?> ?>
<div class="home-directory"> <div class="home-directory">