adtec-core-package 1.0.7 → 1.0.9

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,6 +1,6 @@
1
1
  {
2
2
  "name": "adtec-core-package",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1,70 @@
1
+ <!--创建人 丁盼-->
2
+ <!--说明: ElTotalTools 合计工具条-->
3
+ <!--创建时间: 2025/4/1 20:13-->
4
+ <!--修改时间: 2025/4/1 20:13-->
5
+ <template>
6
+ <el-flex height="32px">
7
+ <span
8
+ style="
9
+ width: 32px;
10
+ background: var(--el-color-primary);
11
+ height: 32px;
12
+ color: rgb(255, 255, 255);
13
+ border-radius: 5px;
14
+ cursor: pointer;
15
+ text-align: center;
16
+ vertical-align: middle; /* display: flex; */
17
+ line-height: 32px;
18
+ font-size: 14px;
19
+ font-weight: bold;
20
+ "
21
+ >1</span
22
+ >
23
+ <el-text style="margin-left: 16px">共&nbsp{{ computedModel }}&nbsp条</el-text>
24
+ </el-flex>
25
+ </template>
26
+ <script setup lang="ts">
27
+ import { computed } from 'vue'
28
+
29
+ const props=defineProps({
30
+ /**
31
+ * @type string
32
+ * @default ''
33
+ * @description 提示文字
34
+ */
35
+ children: {
36
+ type: String,
37
+ default: 'children',
38
+ }
39
+ })
40
+ const model = defineModel()
41
+ const computedModel = computed(() => {
42
+ let total
43
+ if (typeof model.value === 'number') {
44
+ total = model.value
45
+ } else if (typeof model.value === 'string') {
46
+ total = model.value
47
+ } else if (Array.isArray(model.value)) {
48
+ let t=0
49
+ model.value.forEach(item=>{
50
+ if(item[props.children]){
51
+ t+=getTotal(item[props.children])
52
+ }
53
+ t++
54
+ })
55
+ total=t
56
+ }
57
+ return total
58
+ })
59
+ const getTotal = (arr:any[]) => {
60
+ let t=0
61
+ arr.forEach(item => {
62
+ if (item[props.children]) {
63
+ t+=getTotal(item[props.children])
64
+ }
65
+ t++
66
+ })
67
+ return t;
68
+ }
69
+ </script>
70
+ <style scoped lang="scss"></style>
@@ -19,6 +19,7 @@ import userSelect from '../components/business/userSelect.vue'
19
19
  import baseEcharts from '../components/baseEcharts/index.vue'
20
20
  import mdmUserSelect from '../components/business/comp.selectUser.vue'
21
21
  import ElScrollbars from '../components/Scrollbars/ElScrollbars.vue'
22
+ import ElTotalTools from '../components/ElTotalTools.vue'
22
23
  //@ts-ignore
23
24
  export const globalMixin = {
24
25
  components: {
@@ -36,6 +37,7 @@ export const globalMixin = {
36
37
  baseEcharts,
37
38
  mdmUserSelect,
38
39
  ElScrollbars,
40
+ ElTotalTools
39
41
  },
40
42
  directives: {
41
43
  keydown: vKeydown,