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

lz-resource-center-form

v1.0.33

Published

不要升级依赖,除非你想处理一些奇奇怪怪的错误

Downloads

8

Readme

重要备注

不要升级依赖,除非你想处理一些奇奇怪怪的错误

"ace-builds": "1.4.12" 版本固定,其余版本会出现打包成组件后 basePath 不正确的问题

defineAsyncComponent 引入组件时可能会导致打包 lib 失败,根据提示修改对应文件引入方式即可

打包

执行 npm run lib

测试

npm link 后测试存在问题,具体原因待分析。

直接发布 npm 进行测试,然后删除错误版本 npm unpublish [email protected] --force, 0.0.9 需要移除的版本名称。

安装

执行 npm i lz-resource-center-form

import lzResourceCenter from "lz-resource-center-form";
import "lz-resource-center-form/style.css";

// 注册插件
const opts = {
    APP_BASE_URL: __iWorkConfig.backEndServerUrl,
};
app.use(lzResourceCenter, opts);

render 体积更小

包含 ResourceCenterFormAdd、ResourceCenterFormDesignView、ResourceCenterFormView 组件

import lzResourceCenterForm from "lz-resource-center-form/render/render.umd";
import "lz-resource-center-form/render/render.style.css";

export default (app) => {
    app.use(lzResourceCenterForm, {
        APP_BASE_URL: window.__iWorkConfig.backEndServerUrl,
        APP_MAP_CENTER: window.__iWorkConfig.VUE_AMAP_CENTER,
    });
};

vite 需额外配置 vite.config.js

export default defineConfig({
    // ...省略其他配置
    optimizeDeps: {
        include: ['lz-resource-center-form'],  //此处路径必须跟main.js中import路径完全一致!
    },
    build: {
        /* 其他build生产打包配置省略 */
        commonjsOptions: {
            include: /node_modules|lz-resource-center-form/   //这里记得把lib目录加进来,否则生产打包会报错!!
        }
    },
})

组件,向外提供三个组件

pageConfig props 参数

const pageConfig = {
    formId: '', // 表单id
    formName: '', // 表单名称
    pageType: '', // 页面类型
    indexName: '', // es 表名
    formDataId: '', // 是表单填报数据的id
    resourceTypeId: '', // 资源类型id
    resourceTypeCode: '', // 资源类型 code
    isCurrentForm: false, // 是否继承上级表单
    dataSourceCode: '', // 数据来源
}

ResourceCenterFormDesign

表单设计


<ResourceCenterFormDesign :page-config="pageConfig"></ResourceCenterFormDesign>

ResourceCenterFormAdd

表单新增、编辑、查看


<ResourceCenterFormAdd :page-config="pageConfig"></ResourceCenterFormAdd>

ResourceCenterFormView

查看组件不可进入编辑

const pageConfig = {
    formId: '',
    token: '',
    formDataId: ''
}

<ResourceCenterFormView :page-config="pageConfig"></ResourceCenterFormView>