@nstc-business/tbm 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nstc-business/tbm",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "private": false,
5
+ "main": "src/index.js",
5
6
  "scripts": {
6
7
  "serve": "vue-cli-service serve",
7
8
  "test": "vue-cli-service serve --test",
@@ -17,10 +18,10 @@
17
18
  "dependencies": {
18
19
  "axios": "^0.21.4",
19
20
  "core-js": "^3.6.5",
20
- "numerify": "*",
21
21
  "dayjs": "^1.10.7",
22
22
  "el-table-draggable": "^1.4.4",
23
23
  "element-ui": "^2.15.6",
24
+ "numerify": "*",
24
25
  "n20-common-lib": "2.7.57",
25
26
  "vxe-table": "^3.6.17",
26
27
  "qrcode": "^1.5.0",
@@ -31,7 +32,8 @@
31
32
  "vuex": "^3.6.2"
32
33
  },
33
34
  "files": [
34
- "src/components"
35
+ "src/components",
36
+ "src/index.js"
35
37
  ],
36
38
  "devDependencies": {
37
39
  "@babel/plugin-proposal-optional-chaining": "^7.14.5",
@@ -99,7 +99,7 @@
99
99
  </template>
100
100
 
101
101
  <script>
102
- import { dayjs } from 'n20-common-lib'
102
+ import dayjs from 'dayjs'
103
103
  export default {
104
104
  components: {},
105
105
  props: {
@@ -21,7 +21,7 @@
21
21
  </el-descriptions>
22
22
  </template>
23
23
  <script>
24
- import { numerify } from 'n20-common-lib'
24
+ import numerify from 'numerify'
25
25
  export default {
26
26
  watch: {
27
27
  'value.contractType': {
@@ -33,6 +33,7 @@
33
33
  :columns="columns"
34
34
  @sort-change-method="sortChange"
35
35
  @filter-change-method="filterChange"
36
+ :key="key"
36
37
  />
37
38
  <div slot="footer" class="flex-box flex-lr m-t-s">
38
39
  <div class="flex-box flex-v">
@@ -203,7 +204,8 @@ export default {
203
204
  current: 1,
204
205
  pageSize: 200,
205
206
  totalSize: 0
206
- }
207
+ },
208
+ key: 0
207
209
  }
208
210
  },
209
211
  mounted() {
@@ -262,6 +264,7 @@ export default {
262
264
  return obj
263
265
  })
264
266
  }
267
+ this.key++
265
268
  },
266
269
  filterChange(filters) {
267
270
  Object.keys(filters).forEach(key => {
@@ -382,8 +382,14 @@
382
382
  </template>
383
383
 
384
384
  <script>
385
+ import numerify from 'numerify'
385
386
  export default {
386
387
  components: {},
388
+ filter: {
389
+ toThousands(val) {
390
+ return numerify(val, '0,0.00')
391
+ }
392
+ },
387
393
  props: {
388
394
  tradeId: {
389
395
  type: [String, Number],
@@ -0,0 +1,8 @@
1
+ import Test from './src/index.vue'
2
+
3
+ /* istanbul ignore next */
4
+ Test.install = function (Vue) {
5
+ Vue.component(Test.name, Test)
6
+ }
7
+
8
+ export default Test
@@ -0,0 +1,28 @@
1
+ <template>
2
+ <div>
3
+ <!-- <span>测试组件</span> -->
4
+ <el-button type="primary" @click="setInfo">发票详情</el-button>
5
+ <!-- 发票详情组件 -->
6
+ <invoiceDetail ref="invoiceDetail"></invoiceDetail>
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import invoiceDetail from '@/components/invoiceDetail'
12
+ export default {
13
+ name: 'Test',
14
+ components: {
15
+ invoiceDetail
16
+ },
17
+ data() {
18
+ return {}
19
+ },
20
+ methods: {
21
+ setInfo() {
22
+ this.$refs['invoiceDetail'].setInfo({ invoiceId: 275 })
23
+ }
24
+ }
25
+ }
26
+ </script>
27
+
28
+ <style lang="less" scoped></style>
package/src/index.js ADDED
@@ -0,0 +1,24 @@
1
+ // 组件导入
2
+ import Test from './components/test/index.js'
3
+
4
+ const components = [Test]
5
+
6
+ const install = function (Vue, options = { prefix: '' }) {
7
+ components.forEach(component => {
8
+ let name = component.name
9
+ if (!name) return console.error('必须设置组件名称:', component)
10
+ name = options.prefix + name.replace(name[0], name[0].toUpperCase())
11
+ Vue.component(name, component)
12
+ })
13
+ }
14
+
15
+ /* istanbul ignore if */
16
+ if (typeof window !== 'undefined' && window.Vue) {
17
+ install(window.Vue)
18
+ }
19
+
20
+ export default {
21
+ version: '0.1.0',
22
+ install,
23
+ Test
24
+ }