npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

web-public-jinzhan

v1.0.2

Published

金盏web前端公用组件

Downloads

3

Readme

第一步 使用命令下载

npm install web-public-jinzhan

第二步 在相应的页面引用

import 'web-public-jinzhan/css/index.css'

import webPublicJy from 'web-public-jinzhan' // 引入

一、文件上传

listData:[] // 绑定的数据

whiteList="['.doc']" // 允许上传的白名单

fileType:"fileType" // 文件类型别名

fileSize:"fileSize" // 文件大小别名

filePath:"filePath" // 文件路径别名

fileName:"fileName" // 文件名称别名

fileId:"fileId" // 文件ID别名

hide:"false" //是否禁用

width:100 // 文件类型

<JyUploadFile :listData="列表数据" ></JyUploadFile> 

备注1:文件上传

新方法,

1、引入此方法需要在main.js中引入import 'web-public-jy/css/index.css',

2、还需要在request.js文件service.interceptors.request.use中添加

service.interceptors.request.use(
  config => {
    if (!config.noShowLoading) {
      showLoading() // 显示加载中
    }
import { fileSliceSizeUpload } from "@jy/utils/fileSliceSize.js";

const fieldName = {
   fileId: 'fileId',
   fileName: 'fileName',
   filePath: 'filePath',
   fileSize: 'fileSize',
   fileType: 'fileType',
};
const data = {
   file: item.file,  // 文件内容
   fieldName: fieldName, // 需要返回的数据字段名
   businessType: 0, // 0 其他,1头像,3分片上传
   whiteList:['.doc'] // 允许上传的白名单
};
// 文件上传接口
fileSliceSizeUpload(data).then((res) => {
   this.listData.push(res);
});

备注:默认允许文件上传的类型

使用方式
import { fileTypeName,imgTypeName,zipTypeName } from '@jy/constant/url'


// 数据类型

// 基本文件类型
export const fileTypeName = ['.xlsx', '.xls', '.doc', '.docx', '.wps', '.csv'];
// 基本图片类型
export const imgTypeName = ['.pdf', '.png', '.jpg', '.jpeg', '.gif', '.bmp', '.txt'];
// 基本压缩文件类型
export const zipTypeName = ['.zip', '.rar'];

此方法将来作废,不兼容后版本,仅向前兼容

import { fileSliceSize } from "@jy/utils/fileSliceSize.js";
// 参数必传
fileSliceSize(file,fieldName,whiteList)

二、文件预览

fileItem:{

fileType:"文件类型",

filePath:"文件路径",

fileName:"文件名字"

}

@closeFun:为啦清空传入fileItem的数据

<JyFileZipDoor :fileItem="fileItem"  @closeFun="fileItem={}"></JyFileZipDoor>

备注1:换取预览的路径 (非压缩文件)

fileType:" " //文件类型

filePath:" " //文件路径

fileName:" " //文件名称

import { filePreviewFun } from "@jy/utils/filePreview.js";
// 参数必传
filePreviewFun({fileType:"doc",filePath:"路径地址",fileName:"文件名字"})
// 返回数据格式
{path:"文件路径",type:"文件分类,方便上面的预览组件使用"}

备注2:文件下载 (非压缩文件)

filePath:" " //文件路径

fileName:" " //文件名称

import { fileDownloadFun } from "@jy/utils/filePreview.js";
// 参数必传
fileDownloadFun({filePath:"路径地址",fileName:"文件名字"})

备注3:换取可以解压后的文件列表(压缩文件)

fileType:" " //文件类型

filePath:" " //文件路径

fileName:" " //文件名称

import { filePreviewFun } from "@jy/utils/filePreview.js";
// 参数必传
filePreviewFun({fileType:"doc",filePath:"路径地址",fileName:"文件名字"})
// 返回数据格式
{listDataPopup:"解压后数据",type:"文件分类,方便上面的预览组件使用"}
// listDataPopup 数据格式
{
    fileName: 被解压的文件名字,
    filePath: 被解压的文件路径,
    fileType: 文件类型,
    downName: 文件路径,
    name: 文件名字,
    type: "文件分类,预览的时候传入的type"
}

备注4:压缩文件预览路径(压缩文件)

downName:" " //解压后的每个文件的名字

filePath:" " //压缩文件路径

fileName:" " //压缩文件名称

import { rarFileShow } from "@jy/utils/filePreview.js";
// 参数必传
rarFileShow({downName:"解压后的每个文件的名字",filePath:"路径地址",fileName:"文件名字"})
// 返回数据格式
{path:"路径",type:"文件分类,方便上面的预览组件使用"}

备注5:压缩文件下载(压缩文件)

downName:" " //解压后的每个文件的名字

filePath:" " //压缩文件路径

fileName:" " //压缩文件名称

import { rarListDownload } from "@jy/utils/filePreview.js";
// 参数必传
rarListDownload({downName:"解压后的每个文件的名字",filePath:"路径地址",fileName:"文件名字"})