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

centaline-data-driven

v1.6.33

Published

ccai

Downloads

992

Readme

centaline-data-driven

centaline-data-driven

安装、使用

# install dependencies
npm install

# serve with hot reload at localhost:3333
npm run dev

# 打包
npm run build

# 发布到npm(记得先打包一下)
npm publish

# 外部引用
# 安装
npm install -save centaline-data-driven

# 使用
import DataDriven from 'centaline-data-driven'

Vue.use(centaline, {
  baseUrl: process.env.BASE_API,
  zindex: 999,
  handler: {
    // 打开tab页
    openTab: function (action, submitData, pageTitle) {
      alert("打开tab页:" + action +",标题:"+ pageTitle)
    },
    // 获取请求头
    getRequestHeaders: function () {
      return {
        token: "1234"
      };
    },
    // 请求完成事件,可判断是否登录过期执行响应操作
    requestComplete: function (response) {
      console.log(response);
    }
  }});

# ct-form 
<template>
  <div id="app" style="width:100%;height:100%;overflow:auto">
    <ct-form :api="'api/Form/formdata'" />
    <ct-dialog-list />
  </div>
</template>

# ct-searchlist
<template>
  <div style="height: calc(100vh - 84px)">
    <ct-searchlist :search-condition-api="'api/ContractList/GetLayoutOfSearch'" :search-data-api="'api/ContractList/readlist'" />
    <ct-dialog-list />
  </div>
</template>

ct-form的js内置对象formData的方法(供手写js进行取值或设置值)


/**
* @method
* @param {string} id 指定Field的fieldName1
* @param {string} attrKey 指定Field的属性attrKey
* @desc 获取指定Field的指定Field的值
* @returns {string} 指定Field的指定Field的值
*/
getValueByFieldName(id, attrKey)

/**
* @method 表单列表弹层编辑时,弹层formData添加获取父表单数据方法
* @param {string} id 指定Field的fieldName1
* @param {string} attrKey 指定Field的属性attrKey
* @desc 获取指定Field的指定Field的值
* @returns {string} 指定Field的指定Field的值
*/
getValueByFieldNameFromParent(id, attrKey)

/**
* @method
* @param {string} id 指定Field的fieldName1
* @param {string} attrKey 指定Field的属性名
* @param {string} attrValue 需要设置的属性值
* @desc 设置指定Field的指定Field的值
* @returns {boolean} 是否成功
*/
setValueByFieldName(id, attrKey, attrValue)

/**
  * @method
  * @param {string} tableName 指定的表fieldName1 默认当前表
  * @desc 获取指定列表的行数(注意 这里包括列头)
  * @returns {number} 列表行数
  */
getListCount(tableName)

/**
  * @method
  * @param {String} tableName 表fieldName1 默认当前表
  * @param {Number} rowNum 行号 默认当前行号(注意 这里第0行是列头)
  * @param {String} fiedlId 列fieldName1 默认当前列fieldName1
  * @param {String} attrName 需要获取attr,如code1,code2 默认code1
  * @param {String} defaultValue 默认值,若该行被删除时,则直接返回这个值,可空
  * @desc 获取指定列表中的指定Field的指定属性值
  * @returns {String} 指定列表中的指定Field的指定属性值
  */
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue)

/**
  * @method 表单列表弹层编辑时,弹层formData添加获取父表单数据方法
  * @param {String} tableName 表fieldName1 默认当前表
  * @param {Number} rowNum 行号 默认当前行号(注意 这里第0行是列头)
  * @param {String} fiedlId 列fieldName1 默认当前列fieldName1
  * @param {String} attrName 需要获取attr,如code1,code2 默认code1
  * @param {String} defaultValue 默认值,若该行被删除时,则直接返回这个值,可空
  * @desc 获取指定列表中的指定Field的指定属性值
  * @returns {String} 指定列表中的指定Field的指定属性值
  */
getListFieldValueFromParent(tableName, rowNum, fiedlId, attrName, defaultValue)

/**
  * @method
  * @param {String} value 设置的值
  * @param {String} tableName 表fieldName1
  * @param {Number} rowNum 行号 默认当前行号(注意 这里第0行是列头)
  * @param {String} fiedlId 列fieldName1
  * @param {String} attrName 需要改的attrName,如code1,code2
  * @desc 设置指定列表中的指定Field的指定属性
  * @returns {boolean} 是否成功
  */
setListFieldValue(value, tableName, rowNum, fiedlId, attrName)

/**
  * @method
  * @param {String} action action。
  * @param {Object} object 传到后台的数据。
  * @param {Function} successCallback 成功后的回调,只请求成功且response.clientActionType==1时才执行。
  * @desc 获取后台数据,并返回脚本或执行回调。
  */
execServerScript(action, object, successCallback)


/**
  * @method
  * @param {string} message 消息文字。
  * @param {string} type 主题:success/warning/info/error。
  * @param {boolean} center 是否居中。
  * @param {number} duration 显示时间,1500毫秒。设为 0 则不会自动关闭。
  * @param {boolean} showClose 是否显示关闭按钮。
  * @param {boolean} dangerouslyUseHTMLString 是否将 message 属性作为 HTML 片段处理。
  * @desc 消息提示。常用于主动操作后的反馈提示。
  */
message(message, type, center, duration, showClose,dangerouslyUseHTMLString)