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

@buyouzzj/basic-component-v2

v1.0.4

Published

基于element-ui的组件二次封装

Downloads

3

Readme

basic-component

一个基于element-plus的组件二次封装库

BasicForm

<template>
    <basic-form
      ref="basicForm"
      colon
      :columns="formColumns"
      :data="formData"
      label-width="130px"
    >
      <template #materialCover>
        <img-upload
          v-model="fileList"
          @success="handleSingleImgSuccess"
        ></img-upload>
      </template>
      <template #content>
        <div class="material-content">
          <el-row class="material-content-type">
            <el-radio-group v-model="formData.materialContentType" size="small">
              <el-radio label="UD">自定义内容</el-radio>
              <el-radio label="HA">h5地址</el-radio>
            </el-radio-group>
          </el-row>
          <el-row v-if="formData.materialContentType === 'UD'">
            <el-tabs tab-position="left" v-model="formData.userdefineContentType">
              <el-tab-pane label="文本" name="RICHTEXT">
                <vue-editor v-model="formData.richText" useCustomImageHandler @image-added="onImageAdded"></vue-editor>
              </el-tab-pane>
              <el-tab-pane label="图片" name="PHOTO">
                <img-upload
                  v-model="photos"
                  :maxCount="9"
                  @success="handleMutipleSuccess"
                ></img-upload>
              </el-tab-pane>
              <el-tab-pane label="视频" name="VIDEO">
                <single-video-upload
                  v-model="video"
                  @success="data => video = data"
                ></single-video-upload>
              </el-tab-pane>
            </el-tabs>
          </el-row>
          <!-- h5 -->
          <el-row v-else>
            <el-input v-model="formData.materialAddr" placeholder="https://" />
          </el-row>
        </div>
      </template>
    </basic-form>
</template>

<script>
export default {
    data() {
        return {
            formData: {},
        }
    },
    computed: {
        formColumns() {
        return [
            { label: '素材分类', prop: 'materialType', type: 'select', list: materialTypeEnum, required: true, span: 13 },
            { label: '素材标题', prop: 'materialTitle', type: 'input', required: true, span: 13 },
            { label: '素材封面', prop: 'materialCover', type: 'slot', span: 23 },
            { label: '', prop: 'content', type: 'slot', span: 23 },
            { label: '客经标签', prop: 'weUserTags', type: 'select', list: this.userTagList, labelKey: 'tagName', valueKey: 'tagKey', span: 13 },
            { label: '企客标签', prop: 'weCustomerTags', type: 'select', list: this.customerTagList, labelKey: 'tagName', valueKey: 'tagKey', span: 13 },
        ];
        },
    },
}

BasicTable

<template>
    <basic-table
      :columns="tableColumns"
      :data="tableData"
      :pageParams="paging"
      :tableLoading="loading"
      type="checkbox"
      selectedDataKey="id"
      v-model:selectedData="selectedData"
      :disabledRow="row => row.status === 0"
      :mergeOptions="{
        isMerge: true,
        mergeKey: 'companyName',
        mergeIndex: [0, 1, 2, 3, 4],
      }"
      @handleSearch="getTableData"
    >
      <template #oper="{row}">
        <el-button type="text" @click="handleDialog(row, 'person')">添加联系人</el-button>
        <el-button type="text" @click="handleDialog(row, 'show')">查看联系人</el-button>
        <el-button type="text" @click="handleDialog(row, 'edit')">编辑</el-button>
      </template>
    </basic-table>
</template>

<script>
import { getCompanyPageList } from '@/api/company.js';
export default {
  data() {
    return {
      selectedData: [],
      loading: false,
    }
  },
  computed: {
    tableColumns() {
      return [
        { label: '创建时间', prop: 'createTime' },
        { label: '企业名称', prop: 'companyName' },
        { label: '所属行业', prop: 'industry' },
        { label: '企业地址', prop: 'address' },
        { label: '标签', prop: 'tags', type: 'tag-select', list: this.tagList },
        { label: '备注', prop: 'remark' },
        { label: '来源客经编号', prop: 'sourceUserid', labelWidth: '120px' },
        { label: '联系人数量', prop: 'customerCount' },
        { label: '操作', prop: 'oper', fixed: 'right', width: 220 },
      ];
    },
  },
  methods: {
    getTableData() {
      this.loading = true;
      const params = {
        ...this.paging,
        ...this.formData,
      };
      getCompanyPageList(params).then(({ data = {} }) => {
        this.tableData = data.data || [];
        this.total = data.pageInfo ? data.pageInfo.total : 0;
      }).finally(() => {
        this.loading = false;
      });
    },
  },
  created() {
    this.getTableData();
  }
}