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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nstc-business/imes

v1.0.40

Published

``` import modelCalculate from '@nstc-business/imes/src/components/model-calculate/index.vue' <modelCalculate :modelId="modelId"></modelCalculate> ```

Readme

模型测算工具

import modelCalculate from '@nstc-business/imes/src/components/model-calculate/index.vue'
<modelCalculate :modelId="modelId"></modelCalculate>

新版模型测算组件

指标计量项目可以直接把原来的本地组件导入替换为包导入:

import { MeasureCalc } from '@nstc-business/imes'

export default {
  components: {
    measureCalc: MeasureCalc
  }
}

原模板不需要改名:

<measureCalc
  :id="modelId"
  :code="modelCode"
  :log-id="logId"
  :model-data="modelData"
  :readonly="isReadonly"
  :show-measure-cond="true"
  :default-collapsed="true"
  :cond-param="condParam"
  @calcResult="handleCalcResult"
  @getLogId="handleLogId"
  @modelLoaded="handleModelLoaded"
  @calcComplete="handleCalcComplete"
/>

modelData 和 id/code/logId 二选一;传入 modelData 时优先使用完整模型数据。执行测算时必须提供 condParam.cltNo,或开启 showMeasureCond 由用户填写单位编号。

readonly 会隐藏整体和子模型测算按钮,并禁用所有录入项,展开、收起和锚点查看仍然可用。defaultCollapsed 控制模型加载后是否默认收起全部分组/分区,默认 false(不收起);传 true 时初始全部收起,仍可用「全部展开」或单个展开。modelLoaded 返回组件归一化后的模型值,calcComplete 返回完整测算结果;原有的 calcResult 和 getLogId 事件继续兼容。

宿主保存或提交前可通过公开方法完成校验和取值:

const validation = this.$refs.measureCalc.validate({ silent: true })
const value = this.$refs.measureCalc.getValue()

getValue() 包含模型编号、版本、日志 ID、结果、测算入参以及兼容旧评级申报书的 qualitativeData 字符串。

宿主项目需要先安装 Element UI 和 n20-common-lib。Vue.use(n20) 会注入组件使用的 $axios:

import Vue from 'vue'
import ElementUI from 'element-ui'
import n20 from 'n20-common-lib'
import Imes from '@nstc-business/imes'

import 'element-ui/lib/theme-chalk/index.css'
import 'n20-common-lib/style/index.css'

Vue.use(ElementUI)
Vue.use(n20, { prefix: 'N20' })
Vue.use(Imes)

全局安装后组件名默认为 <n-measure-calc />。如果宿主使用 Vue CLI,因为包发布的是源码,需要在 vue.config.js 中保留:

module.exports = {
  transpileDependencies: ['n20-common-lib', '@nstc-business/imes']
}

测算详情弹框

import calculateDetailDialog from "@nstc-business/imes/src/components/calculateDetail/dialog.vue";
<calculateDetailDialog ref="calculateDetailDialog"></calculateDetailDialog>
this.$refs.calculateDetailDialog.open({
        modelId: '476cfddfec584e3ab5ae53719ff03819',
        logId: '9ed289ff9e4c46f99df7f58172011d7b',
        showModelInfo: true // 是否显示模型信息
      });