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

@mrfzq/simple-common

v0.0.9

Published

基于antdv进行二次开发form表单,集成的组件有 CommonForm,BaseForm,FormItem,CommonInput,CommonInputNumber, CommonSelect,CommonCascader,CommonDatePicker,CommonInputPwd, CommonRadioGroup,CommonRangePicker,CommonSwitch,CommonText,CommonTextarea, CommonTimePicker,CommonTimeSelec

Downloads

4

Readme

基于antdv进行二次开发form表单,集成的组件有 CommonForm,BaseForm,FormItem,CommonInput,CommonInputNumber, CommonSelect,CommonCascader,CommonDatePicker,CommonInputPwd, CommonRadioGroup,CommonRangePicker,CommonSwitch,CommonText,CommonTextarea, CommonTimePicker,CommonTimeSelect,CommonTransfer,CommonTreeSelect, CommonUpload,CommonUploadImage等等

安装

pnpm install @mrfzq/simple-common -S
or
yarn add @mrfzq/simple-common

使用

方式一(列表查询时候的form表单,其中默认有查询、重置按钮)

<script setup lang="ts">
import { ref, computed } from "vue";
import { CommonForm } from "@mrfzq/simple-common";
import FormInterface from "@mrfzq/simple-common/dist/components/src/types/formInterface";

const form = ref({
  search: "",
  label: "",
  status: null,
  is_value: 0,
});

const queryFields = computed<FormInterface.FieldItem[]>(() => [
  {
    label: "关键词",
    itemType: "input",
    value: "search",
    field: {
      placeholder: "请输入关键词",
      allowClear: true,
    },
  },
  {
    label: "字典名称",
    itemType: "input",
    value: "label",
    field: {
      placeholder: "请输入字典名称",
      allowClear: true,
    },
  },
  {
    label: "状态",
    itemType: "select",
    value: "status",
    field: {
      placeholder: "请选择状态",
      allowClear: true,
      options: [],
    },
  },
]);
</script>
<template>
  <div>
    <CommonForm v-model:form="form" :fields="queryFields" @query="() => {}" />
  </div>
</template>
<style scoped lang="scss"></style>


方式二(在弹窗中填写表单,包含验证,可以动态显示隐藏单项)
const rowStyle = {
  colStyle: {
    md: 24,
    lg: 24,
    xl: 24,
    xxl: 24,
  }
}
const from: any = ref({
  label: "",
  value: "",
  status: true,
  sort: 1,
  description: "",
});
const fields = computed<FormInterface.FieldItem[]>(() => [
  {
    label: "字典名称",
    itemType: "input",
    value: "label",
    ...rowStyle,
    field: {
      disabled: isDisabled.value,
      placeholder: "请输入字典名称",
      allowClear: true,
    },
    rules: [
      { required: true, message: "请输入字典名称" },
      { max: 20, message: "20个字符以内" },
    ],
  },
  {
    label: "字典编号",
    itemType: "input",
    value: "value",
    ...rowStyle,
    field: {
      disabled: isDisabled.value,
      placeholder: "请输入字典编号",
      allowClear: true,
    },
    rules: [
      { required: true, message: "请输入字典编号" },
      { max: 20, message: "20个字符以内" },
    ],
  },
  {
    label: "状态",
    itemType: "switch",
    value: "status",
    ...rowStyle,
    field: {
      disabled: isDisabled.value,
    },
    rules: [{ required: true, message: "请选择状态" }],
  },
  {
    label: "排序",
    itemType: "input-number",
    value: "sort",
    ...rowStyle,
    field: {
      disabled: isDisabled.value,
      min: 0,
    },
  },
  {
    label: "备注",
    itemType: "textarea",
    value: "description",
    ...rowStyle,
    field: {
      disabled: isDisabled.value,
      placeholder: "请输入备注",
      allowClear: true,
      showCount: true,
      maxlength: 200,
      rows: 3,
    },
    rules: [{ max: 200, message: "200个字符以内" }],
  },
]);

<template>
  <div>
    <BaseForm
      ref="fromRef"
      v-model:form="from"
      :fields="fields"
      label-align="right"
    />
  </div>
</template>
<style scoped lang="scss"></style>