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

hyhc-objselector

v3.0.3

Published

华云合创PC组件-objSelector 3.0, js原生控件-浏览器 ie9及以上版本

Downloads

4

Readme

hyhc-objselector

华云合创PC组件-objSelector 3.0, js原生控件 浏览器兼容性: ie9及以上版本

1.引入


//es6 import引入
import objSelect from 'hyhc-objselector';

//require引入
let objSelect = require('hyhc-objselector');

//script引入
<script src="./objSelector3.0.js"></script>

使用测试


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="./objSelect.css">
    <script src="./objSelect3.0.js"></script>
    <style>
        div.test{
            position: absolute;
            left : 50%;
            top: 50%;
            width: 200px;
            transform: translate(-50%,-50%);
        }
        div.test a{
            display: block;
            padding: 20px 0;
            background: #4da9df;
            color: #fff;
            margin: 10px 0;
            text-align: center;
            font-size: 13px;
        }
    </style>
</head>
<body>

<div class="test">
    <a href="javascript:;" id="ojb1">组织架构组件-1 <br />最大:8,<br />允许选择部门: 假</a>
    <a href="javascript:;" id="ojb2">组织架构组件-2 <br />最大:15,<br />允许选择部门: 真</a>
</div>

<script>

    document.getElementById('ojb1').addEventListener('click',function () {

        var a = objSelector({
            max : 8,
            allowSelectDepartment: false,
            //确定
            callback : function (data) {
                console.log("确认:",data);
            },
            //取消
            cancle :function () {
                console.log("取消")
            }
        });

    });

    document.getElementById('ojb2').addEventListener('click',function () {
        var b = objSelector({
            max : 15,
            allowSelectDepartment: true,
            //确定
            callback : function (data) {
                console.log("确认:",data);
            },
            //取消
            cancle :function () {
                console.log("取消")
            }
        });

    });



</script>
</body>
</html>

Options 参数

| 参数 | 默认值 | 描述 | | ------------------------ | -------------------- | ------------------------------- | | title | 选择联系人 | 组件框标题 | | max | 50 | 最大选择人数 | | userId | 10053 | 用户ID | | companyId | 100206 | 公司ID | | token | 123456 | token | | allowSelectDepartment | true | 是否允许选择部门 | | host | JS内查找 | api请求主机地址,参考JS代码 | | baseUrl | JS内查找 | url前缀 | | custom | `` | 自定义api请求配置, 一个object {} |

custom 自定义请求实例


var a = objSelector({
            max : 8,
            title : '请选择联系人',
            allowSelectDepartment: false,

            //自定义请求数据,不适合树形数据,如果传入该字段 allowSelectDepartment无效
            custom : {
                url  : 'http://192.168.2.161:8080/plugin-attendance-record/rest/group/all/100202',  //完整的URL地址,不再与baseUrl希哈
                data : {},            //非必传 --默认是一个对象字面量
                method : 'get',       //非必传 --默认get方式
                menuTitle : '签到对象',  //自定义列表框上方标题
                nameFeild : 'groupName',    //自定义显示字段                      --默认groupName
                mapFeild : 'uuid'       //自定义数据记录map 映射字段,              --默认uuid
            },

            //确定
            callback : function (data) {
                console.log("确认:",data);
            },
            //取消
            cancle :function () {
                console.log("取消")
            }
        });