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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ecarx-uploader

v1.1.5

Published

1.分片上传,断点续传,秒传等

Downloads

9

Readme

ecarx-uploader

主要用于KSC的大文件上传,通用组件可扩展到其他项目

1.分片上传,断点续传,秒传等

2.拖动文件夹到区域,上传文件内的所有文件

3.目前暂不支持空文件夹

npm i ecarx-uploader -S

关键性代码

具体参考代码路径
ksc/src/components/BigUpload/index.vue


以下仅为扩展参考,不属于大文件上传范畴,属于KSC文件创建阶段
<a-form-item v-else-if="option.key === 'upload'" :label="$t('common.btn.uploadFile')">
  <Uploader :opt="{token:token,uploadUrl:uploadUrl,mergeUrl:mergeUrl}"
    v-decorator="['fileList', { initialValue: [], rules: [{ required: true, message: $t('common.rules.waitComplete') }] }]" />
</a-form-item>
绑定表单fileList

import Uploader from '@/components/BigUpload/index';
import auth from '@/utils/auth';

...

data() {
    return {
      uploadUrl: `${process.env.VUE_APP_API_BASE_URL}/multipartfile/multipartUpload`,
      mergeUrl: `${process.env.VUE_APP_API_BASE_URL}/multipartfile/completeMultipartUpload`,
      token: auth.getToken(),
...

handleUploadFile(params) {
      const { fileList } = params;
      // console.log(JSON.stringify(fileList));
      // return;
      const {
        id, pathId, name: cname, path, step, category,
      } = this.cPath;
      const exist = {};
      let flag = 0;
      const files = fileList.map((file) => {
        // console.log(file);
        let finallyName = '';
        const {
          contentType, downloadUrl, fileId: uid, originalFilename: name, siz, suffix, viewUrl,
        } = file || {};
        finallyName = name.substr(0, name.lastIndexOf('.')) || name;
        const relativePath = file.relativePath || `/${finallyName}${suffix}`;
        // 判断同一路径下是否同名
        // const aliasName = name.split('.')[0];
        const aliasPath = relativePath.substr(0, relativePath.lastIndexOf('.'));
        // console.log(aliasName, exist[aliasName]);
        if (exist[name]) {
          console.log(exist[name].aliasPath === aliasPath);
        }
        if (exist[name] && exist[name].flag && exist[name].aliasPath === aliasPath) {
          flag = 1;
        } else {
          exist[name] = {};
          exist[name].flag = 1;
          exist[name].aliasPath = aliasPath;
        }
        return {
          contentType, downloadUrl, uid, name: finallyName, siz, suffix, viewUrl, relativePath,
        };
      });
      // console.log(flag);
      if (flag) {
        this.$message.error(`${this.$t('pages.fileLib.sameName')}`);
      }
      const obj = {
        pathId: `${pathId}/${id}`,
        path: `${path}/${cname}`,
        step,
        category,
        folderId: id,
        files,
      };
      // console.log(obj.files);
      // return;
      this.fileBatchCreate(obj).then((res) => {
        // console.log(res);
        const { list } = res;
        if (list.length === 0) {
          this.visible = false;
          this.$bus.$emit('refreshList');
          this.$message.success(this.$t('pages.fileLib.createSuccess'));// 创建成功
        } else {
          // list.forEach((item) => {
          this.$message.error(`“${list[0].name}${list[0].suffix}” ${this.$t('pages.fileLib.exist')}`);// 文件名已存在
          // });
        }
        // this.$message[success ? 'success' : 'error'](msg);
      });
    },