n20-common-lib 1.3.42 → 1.3.43

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": "n20-common-lib",
3
- "version": "1.3.42",
3
+ "version": "1.3.43",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -94,20 +94,6 @@
94
94
  "xlsx": "0.14.1",
95
95
  "xlsx-style": "^0.8.13"
96
96
  },
97
- "eslintConfig": {
98
- "root": true,
99
- "env": {
100
- "node": true
101
- },
102
- "extends": [
103
- "plugin:vue/essential",
104
- "eslint:recommended"
105
- ],
106
- "parserOptions": {
107
- "parser": "babel-eslint"
108
- },
109
- "rules": {}
110
- },
111
97
  "browserslist": [
112
98
  "> 1%",
113
99
  "last 2 versions",
@@ -510,6 +510,10 @@ $--input-max: 304px;
510
510
  }
511
511
  }
512
512
 
513
+ .el-select .el-input__inner{
514
+ text-overflow: ellipsis;
515
+ }
516
+
513
517
  .n20-date-editor.el-input--prefix {
514
518
  width: $--input-width;
515
519
 
@@ -596,7 +596,7 @@ iframe {
596
596
  --------------- */
597
597
  .font {
598
598
  &-w600 {
599
- font-weight: var(--font-weight-primary);
599
+ font-weight: var(--font-weight-bold);
600
600
  }
601
601
  }
602
602
 
@@ -0,0 +1,319 @@
1
+ <template>
2
+ <div class="n20-approval-img-por">
3
+ <svg v-pre style="display: none">
4
+ <symbol id="symbol_node_User">
5
+ <g transform="translate(13, 6)">
6
+ <path
7
+ d="M7.90909091,7.88279417 C8.63636364,8.68785247 9,9.58236169 9,10.6557728 L9,15.4861225 C9,15.5755735 9,15.6650244 8.90909091,15.8439262 C8.90909091,15.9333772 8.81818182,16.0228281 8.63636364,16.2017299 C8.45454545,16.3806318 8.18181818,16.4700827 7.90909091,16.5595336 C7.54545455,16.4700827 7.27272727,16.3806318 7.09090909,16.2017299 C6.81818182,15.9333772 6.72727273,15.7544753 6.72727273,15.4861225 L6.72727273,21.9265889 C6.72727273,22.1949417 6.63636364,22.4632945 6.36363636,22.6421963 C6.18181818,22.9105491 5.90909091,23 5.63636364,23 C5.45454545,23 5.27272727,23 5.18181818,22.9105491 C5,22.8210982 4.90909091,22.7316472 4.81818182,22.6421963 C4.63636364,22.4632945 4.45454545,22.1949417 4.45454545,21.9265889 C4.45454545,22.1949417 4.36363636,22.4632945 4.09090909,22.6421963 C4,22.7316472 3.90909091,22.8210982 3.81818182,22.9105491 C3.63636364,23 3.45454545,23 3.36363636,23 C3,23 2.81818182,22.9105491 2.54545455,22.6421963 C2.36363636,22.4632945 2.18181818,22.1949417 2.18181818,21.9265889 L2.18181818,15.4861225 C2.18181818,15.7544753 2.09090909,15.9333772 1.90909091,16.2017299 C1.63636364,16.3806318 1.36363636,16.4700827 1.09090909,16.5595336 C0.727272727,16.4700827 0.545454545,16.3806318 0.272727273,16.2017299 C0.0909090909,15.9333772 0,15.7544753 0,15.4861225 L0,10.6557728 C0,9.58236169 0.363636364,8.68785247 1.09090909,7.88279417 C1.09090909,7.79334325 1.18181818,7.79334325 1.27272727,7.79334325 C2.09090909,6.89883403 3.18181818,6.45157942 4.45454545,6.45157942 C5.72727273,6.45157942 6.81818182,6.89883403 7.63636364,7.79334325 C7.72727273,7.79334325 7.81818182,7.79334325 7.90909091,7.88279417 Z M1.32857705,2.70047865 C1.23766796,1.89542035 1.51039524,1.26926389 2.05584978,0.732558361 C2.60130433,0.195852828 3.23766796,-0.0724999378 4.05584978,0.0169509843 C4.78312251,-0.0724999378 5.41948615,0.195852828 5.96494069,0.732558361 C6.41948615,1.26926389 6.69221342,1.89542035 6.78312251,2.70047865 C6.69221342,3.41608602 6.41948615,4.04224248 5.96494069,4.57894801 C5.41948615,5.02620262 4.78312251,5.38400631 4.05584978,5.38400631 C3.23766796,5.38400631 2.60130433,5.02620262 2.05584978,4.57894801 C1.51039524,4.04224248 1.23766796,3.41608602 1.32857705,2.70047865 Z"
8
+ />
9
+ </g>
10
+ </symbol>
11
+ <symbol id="symbol_node_Department">
12
+ <g transform="translate(8,8.5)">
13
+ <path
14
+ d="M18.7974851,12.756941 L18.7974851,13.0227567 C18.7974851,13.0816828 18.7974851,13.1406089 18.738559,13.2584611 C18.738559,13.3173872 18.6796329,13.3763133 18.5617807,13.4941655 C18.4439285,13.6120177 18.2671502,13.6709438 18.0903718,13.7298699 C17.8546674,13.6709438 17.6778891,13.6120177 17.5600369,13.4941655 C17.3864764,13.3206049 17.3265168,13.2038449 17.3243915,13.0323521 L17.3243915,16.9818835 C17.3243915,16.9851013 17.3243719,16.9883191 17.3243325,16.9915365 L17.3243325,17.2654359 C17.3243325,17.4422142 17.2654064,17.6189925 17.0886281,17.7368447 C16.9707759,17.913623 16.7939976,17.9725491 16.6172193,17.9725491 C16.4993671,17.9725491 16.3815149,17.9725491 16.3225888,17.913623 C16.2047366,17.8546969 16.1458105,17.7957708 16.0868844,17.7368447 C15.9690322,17.6189925 15.85118,17.4422142 15.85118,17.2654359 C15.85118,17.4422142 15.7922539,17.6189925 15.6154756,17.7368447 C15.5565495,17.7957708 15.4976234,17.8546969 15.4386973,17.913623 C15.3208451,17.9725491 15.2029929,17.9725491 15.1440668,17.9725491 C14.9083624,17.9725491 14.7905102,17.913623 14.6137319,17.7368447 C14.4958797,17.6189925 14.3780275,17.4422142 14.3780275,17.2654359 L14.3780275,13.0227567 C14.3780275,13.199535 14.3191014,13.3173872 14.2012492,13.4941655 C14.0244709,13.6120177 13.8476926,13.6709438 13.6709143,13.7298699 C13.4352099,13.6709438 13.3173577,13.6120177 13.1405794,13.4941655 C13.0227272,13.3173872 12.9638011,13.199535 12.9638011,13.0227567 L12.9638011,9.84074723 C12.9638011,9.8342922 12.9638207,9.82784699 12.96386,9.82141156 L12.96386,9.55719484 C12.96386,8.85008163 13.1995644,8.26082062 13.6709732,7.73048571 C13.6709732,7.67155961 13.7298993,7.67155961 13.7888254,7.67155961 C14.3191603,7.08229861 15.0262735,6.7876681 15.8512389,6.7876681 C16.6762044,6.7876681 17.3833176,7.08229861 17.9136525,7.67155961 C17.9725786,7.67155961 18.0315047,7.67155961 18.0904308,7.73048571 C18.5618396,8.26082062 18.797544,8.85008163 18.797544,9.55719484 L18.797544,12.7392043 C18.797544,12.7450969 18.797544,12.7509895 18.7974851,12.756941 Z M15.910224,2.95747156 C16.3816328,2.89854545 16.7941155,3.07532376 17.1476721,3.42888036 C17.4423026,3.78243697 17.6190809,4.19491967 17.6190809,4.72525458 C17.6190809,5.19666338 17.4423026,5.60914609 17.1476721,5.96270269 C16.7941155,6.3162593 16.3816328,6.4930376 15.910224,6.4930376 C15.3798891,6.4930376 14.9674064,6.3162593 14.6138498,5.96270269 C14.2602932,5.66807219 14.0835149,5.25558948 14.142441,4.72525458 C14.0835149,4.19491967 14.2602932,3.78243697 14.6138498,3.42888036 C14.9674064,3.07532376 15.3798891,2.89854545 15.910224,2.95747156 Z M14.2011313,0.482752103 C14.4957619,0.836308707 14.6725402,1.24879141 14.7314663,1.77912632 C14.7314663,2.25053512 14.554688,2.66301783 14.2011313,3.01657443 C13.8475747,3.31120494 13.435092,3.54690934 12.9636832,3.54690934 C12.4333483,3.54690934 12.0208656,3.31120494 11.667309,3.01657443 C11.3137524,2.66301783 11.1369741,2.25053512 11.1369741,1.77912632 C11.1369741,1.24879141 11.3137524,0.836308707 11.667309,0.482752103 C12.0208656,0.129195499 12.4333483,0.0113432971 12.9636832,0.0113432971 C13.435092,0.0113432971 13.8475747,0.129195499 14.2011313,0.482752103 Z M12.2566879,13.2584611 C12.2566879,13.3173872 12.1977618,13.3763133 12.0799096,13.4941655 C11.9620574,13.6120177 11.7852791,13.6709438 11.6085008,13.7298699 C11.3727964,13.6709438 11.1960181,13.6120177 11.0781659,13.4941655 C10.9013876,13.3173872 10.8424615,13.199535 10.8424615,13.0227567 L10.8424615,17.2654359 C10.8424615,17.4422142 10.7835354,17.6189925 10.6067571,17.7368447 C10.4889049,17.913623 10.3121266,17.9725491 10.1353483,17.9725491 C10.017496,17.9725491 9.89964385,17.9725491 9.84071775,17.913623 C9.72286555,17.8546969 9.66393945,17.7957708 9.60501334,17.7368447 C9.48716114,17.6189925 9.36930894,17.4422142 9.36930894,17.2654359 C9.36930894,17.4422142 9.31038284,17.6189925 9.13360454,17.7368447 C9.07467844,17.7957708 9.01575234,17.8546969 8.95682624,17.913623 C8.83897404,17.9725491 8.72112183,17.9725491 8.66219573,17.9725491 C8.42649133,17.9725491 8.30863913,17.913623 8.13186083,17.7368447 C8.01400863,17.6189925 7.89615642,17.4422142 7.89615642,17.2654359 L7.89615642,13.0227567 C7.89615642,13.199535 7.83723032,13.3173872 7.71937812,13.4941655 C7.54259982,13.6120177 7.36582152,13.6709438 7.18904322,13.7298699 C6.95333881,13.6709438 6.83548661,13.6120177 6.65870831,13.4941655 C6.54085611,13.3173872 6.48193001,13.199535 6.48193001,13.0227567 L6.48193001,9.84074723 C6.48193001,9.13363402 6.71763441,8.54437302 7.18904322,8.01403811 C7.18904322,7.95511201 7.24796932,7.95511201 7.30689542,7.95511201 C7.83723032,7.365851 8.54434353,7.0712205 9.36930894,7.0712205 C10.1942744,7.0712205 10.9013876,7.365851 11.4317225,7.95511201 C11.4906486,7.95511201 11.5495747,7.95511201 11.6085008,8.01403811 C12.0799096,8.54437302 12.315614,9.13363402 12.315614,9.84074723 L12.315614,13.0227567 C12.315614,13.0816828 12.315614,13.1406089 12.2566879,13.2584611 Z M9.42835289,2.95747156 C9.8997617,2.89854545 10.3122444,3.07532376 10.665801,3.42888036 C10.9604315,3.78243697 11.1372098,4.19491967 11.1372098,4.72525458 C11.1372098,5.19666338 10.9604315,5.60914609 10.665801,5.96270269 C10.3122444,6.3162593 9.8997617,6.4930376 9.42835289,6.4930376 C8.89801799,6.4930376 8.48553528,6.3162593 8.13197868,5.96270269 C7.77842207,5.66807219 7.60164377,5.25558948 7.66056987,4.72525458 C7.60164377,4.19491967 7.77842207,3.78243697 8.13197868,3.42888036 C8.48553528,3.07532376 8.89801799,2.89854545 9.42835289,2.95747156 Z M5.12657076,7.73054464 C5.59797957,8.26087955 5.83368397,8.85014055 5.83368397,9.55725376 L5.83368397,12.7392632 C5.83368397,12.7981893 5.83368397,12.8571154 5.77475787,12.9749676 C5.77475787,13.0338937 5.71583177,13.0928198 5.59797957,13.210672 C5.48012737,13.3285242 5.30334907,13.3874503 5.12657076,13.4463764 C4.89086636,13.3874503 4.71408806,13.3285242 4.59623586,13.210672 C4.41945755,13.0338937 4.36053145,12.9160415 4.36053145,12.7392632 L4.36053145,16.9819425 C4.36053145,17.1587208 4.30160535,17.3354991 4.12482705,17.4533513 C4.00697485,17.6301296 3.83019655,17.6890557 3.65341825,17.6890557 C3.53556604,17.6890557 3.41771384,17.6890557 3.35878774,17.6301296 C3.24093554,17.5712035 3.18200944,17.5122774 3.12308334,17.4533513 C3.00523114,17.3354991 2.88737894,17.1587208 2.88737894,16.9819425 C2.88737894,17.1587208 2.82845283,17.3354991 2.65167453,17.4533513 C2.59274843,17.5122774 2.53382233,17.5712035 2.47489623,17.6301296 C2.35704403,17.6890557 2.23919183,17.6890557 2.18026573,17.6890557 C1.94456132,17.6890557 1.82670912,17.6301296 1.64993082,17.4533513 C1.53207862,17.3354991 1.41422642,17.1587208 1.41422642,16.9819425 L1.41422642,12.7392632 C1.41422642,12.9160415 1.35530032,13.0338937 1.23744812,13.210672 C1.06066981,13.3285242 0.883891511,13.3874503 0.707113209,13.4463764 C0.471408806,13.3874503 0.353556604,13.3285242 0.176778302,13.210672 C0.0589261007,13.0338937 0,12.9160415 0,12.7392632 L0,9.55725376 C0,8.85014055 0.235704403,8.26087955 0.707113209,7.73054464 C0.707113209,7.67161854 0.766039309,7.67161854 0.82496541,7.67161854 C1.35530032,7.08235753 2.06241353,6.78772703 2.88737894,6.78772703 C3.71234435,6.78772703 4.41945755,7.08235753 4.94979246,7.67161854 C5.00871856,7.67161854 5.06764466,7.67161854 5.12657076,7.73054464 Z M1.17869879,4.72525458 C1.11977269,4.19491967 1.29655099,3.78243697 1.6501076,3.42888036 C2.0036642,3.07532376 2.41614691,2.89854545 2.94648181,2.95747156 C3.41789062,2.89854545 3.83037333,3.07532376 4.18392993,3.42888036 C4.47856043,3.78243697 4.65533874,4.19491967 4.71426484,4.72525458 C4.65533874,5.19666338 4.47856043,5.60914609 4.18392993,5.96270269 C3.83037333,6.2573332 3.41789062,6.4930376 2.94648181,6.4930376 C2.41614691,6.4930376 2.0036642,6.2573332 1.6501076,5.96270269 C1.29655099,5.60914609 1.11977269,5.19666338 1.17869879,4.72525458 Z M7.12999926,2.95747156 C6.77644266,3.31102816 6.36395995,3.48780646 5.89255115,3.48780646 C5.36221624,3.48780646 4.94973354,3.31102816 4.59617693,2.95747156 C4.24262033,2.66284105 4.06584202,2.25035835 4.12476812,1.77894954 L4.12476812,1.72002344 C4.06584202,1.18968853 4.24262033,0.777205828 4.59617693,0.482575325 C4.94973354,0.12901872 5.36221624,-0.0477595819 5.89255115,0.0111665188 C6.36395995,-0.0477595819 6.77644266,0.12901872 7.12999926,0.482575325 C7.42462977,0.836131929 7.60140807,1.24861463 7.60140807,1.77894954 C7.60140807,2.25035835 7.42462977,2.66284105 7.12999926,2.95747156 Z"
15
+ />
16
+ </g>
17
+ </symbol>
18
+ </svg>
19
+ <div ref="activiti-svg-wrap" class="activiti-svg-wrap"></div>
20
+ <div ref="msgEl" class="activiti-msg">
21
+ <div>
22
+ <span class="color-primary">待审批: </span>{{ daishengpi.toString() }}
23
+ </div>
24
+ <div>
25
+ <span class="color-success">已审批: </span>{{ yishengpi.toString() }}
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <script>
32
+ import { tipShow, tipHide } from '../../directives/VTitle/index.js'
33
+
34
+ export default {
35
+ data() {
36
+ this.svgW = undefined
37
+ this.svgC = undefined
38
+ return {
39
+ daishengpi: [],
40
+ yishengpi: []
41
+ }
42
+ },
43
+ async mounted() {
44
+ this.svgW = this.$refs['activiti-svg-wrap']
45
+
46
+ let { flowString, seqRecords, taskDefIdMap } = await this.$axios.get(
47
+ '/server-assets/approvalImgDate.json'
48
+ )
49
+ this.setSvgAttrs(flowString)
50
+ seqRecords.forEach((obj) => {
51
+ this.setTaskRecord(obj)
52
+ })
53
+ taskDefIdMap.forEach((obj) => {
54
+ this.addEvent(obj)
55
+ })
56
+ },
57
+ methods: {
58
+ Fn() {
59
+ tipShow(
60
+ document.getElementById('xxx-yyy'),
61
+ document.getElementById('popper-x')
62
+ )
63
+ },
64
+ setSvgAttrs(str) {
65
+ this.svgW.innerHTML = str
66
+ this.svgC = this.svgW.querySelector('svg')
67
+ let width = this.svgC.getAttribute('width')
68
+ let height = this.svgC.getAttribute('height')
69
+ let viewBox = this.svgC.getAttribute('viewBox').split(' ')
70
+ viewBox = [
71
+ Number(viewBox[0]) - 10,
72
+ Number(viewBox[1]) - 10,
73
+ Number(viewBox[2]) + 10,
74
+ Number(viewBox[3]) + 10
75
+ ]
76
+ viewBox = viewBox.join(' ')
77
+
78
+ this.svgC.setAttribute('width', Number(width) + 10)
79
+ this.svgC.setAttribute('height', Number(height) + 10)
80
+ this.svgC.setAttribute('viewBox', viewBox)
81
+ },
82
+ setTaskRecord(obj) {
83
+ let {
84
+ resouceTaskDefId: from,
85
+ targetTaskDefId: to,
86
+ flowLine: line,
87
+ type: type,
88
+ suggestion: msg
89
+ } = obj
90
+ if (type === '0') {
91
+ this.svgW
92
+ .querySelector(`[data-element-id="${from}"]`)
93
+ .classList.add('activiti-node-achieve')
94
+ this.svgW
95
+ .querySelector(`[data-element-id="${to}"]`)
96
+ .classList.add('activiti-node-achieve')
97
+ this.svgW
98
+ .querySelector(`[data-element-id="${line}"]`)
99
+ .classList.add('activiti-line-achieve')
100
+ } else {
101
+ this.svgW
102
+ .querySelector(`[data-element-id="${from}"]`)
103
+ .classList.add('activiti-node-reject')
104
+ this.svgW
105
+ .querySelector(`[data-element-id="${to}"]`)
106
+ .classList.add('activiti-node-reject')
107
+ this.setRejectLink(from, to, msg)
108
+ }
109
+ },
110
+ setRejectLink(from, to, msg) {
111
+ const fromO = this.getElRect(from)
112
+ const toO = this.getElRect(to)
113
+ let oTop = Math.min(fromO.top, toO.top) - 12
114
+ let d = `M${fromO.left + fromO.with / 2},${fromO.top} L${
115
+ fromO.left + fromO.with / 2
116
+ },${oTop} L${toO.left + toO.with / 2},${oTop} L${
117
+ toO.left + toO.with / 2
118
+ },${toO.top}`
119
+
120
+ let path = document.createElementNS('http://www.w3.org/2000/svg', 'path')
121
+ path.setAttribute('class', 'activiti-line-reject')
122
+ path.setAttribute('d', d)
123
+ this.svgC.appendChild(path)
124
+
125
+ if (msg) {
126
+ let text = document.createElementNS(
127
+ 'http://www.w3.org/2000/svg',
128
+ 'text'
129
+ )
130
+ text.setAttribute('class', 'activiti-text-reject')
131
+ text.setAttribute(
132
+ 'x',
133
+ (fromO.left + fromO.with / 2 + toO.left + toO.with / 2) / 2
134
+ )
135
+ text.setAttribute('y', oTop + 6)
136
+ text.textContent = msg
137
+ this.svgC.appendChild(text)
138
+
139
+ let textO = text.getBBox()
140
+ let rect = document.createElementNS(
141
+ 'http://www.w3.org/2000/svg',
142
+ 'rect'
143
+ )
144
+ rect.setAttribute('class', 'activiti-text-bg-reject')
145
+ rect.setAttribute('x', textO.x)
146
+ rect.setAttribute('y', textO.y)
147
+ rect.setAttribute('width', textO.width)
148
+ rect.setAttribute('height', textO.height)
149
+ this.svgC.insertBefore(rect, text)
150
+ }
151
+ },
152
+ getElRect(id) {
153
+ let g = this.svgW.querySelector(`[data-element-id="${id}"]`)
154
+ let rect = {
155
+ with: 100,
156
+ height: 80,
157
+ left: undefined,
158
+ top: undefined
159
+ }
160
+
161
+ if (g.querySelector('circle')) {
162
+ rect.with = 36
163
+ rect.height = 36
164
+ }
165
+ let matrix = g.getAttribute('transform')
166
+ if (matrix) {
167
+ matrix = matrix.replace(/matrix\(|\)/g, '')
168
+ matrix = matrix.split(' ')
169
+ rect.left = Number(matrix[4])
170
+ rect.top = Number(matrix[5])
171
+ }
172
+ return rect
173
+ },
174
+ addEvent(obj) {
175
+ let { taskDefId, daishengpi, yishengpi } = obj
176
+ let task = this.svgW.querySelector(`[data-element-id="${taskDefId}"]`)
177
+ task.addEventListener('mouseenter', () => {
178
+ this.daishengpi = daishengpi
179
+ this.yishengpi = yishengpi
180
+ this.$nextTick(() => {
181
+ tipShow(task, this.$refs['msgEl'])
182
+ })
183
+ })
184
+ task.addEventListener('mouseleave', () => {
185
+ tipHide(task)
186
+ })
187
+ }
188
+ }
189
+ }
190
+ /*
191
+ setRejectLink(from, to) {
192
+ console.log(this.getElRect(from), 444)
193
+ console.log(this.getElRect(to), 444)
194
+ const fromO = this.getElRect(from)
195
+ const toO = this.getElRect(to)
196
+ let direction = undefined
197
+ if (fromO.left + fromO.with < toO.left) {
198
+ if (fromO.top + fromO.height < toO.top) {
199
+ direction = '↘'
200
+ } else if (fromO.top > toO.top + toO.height) {
201
+ direction = '↗'
202
+ } else {
203
+ direction = '→'
204
+ }
205
+ } else if (fromO.left - fromO.with > toO.left) {
206
+ if (fromO.top + fromO.height < toO.top) {
207
+ direction = '↙'
208
+ } else if (fromO.top > toO.top + toO.height) {
209
+ direction = '↖'
210
+ } else {
211
+ direction = '←'
212
+ }
213
+ } else {
214
+ if (fromO.top < toO.top) {
215
+ direction = '↓'
216
+ } else {
217
+ direction = '↑'
218
+ }
219
+ }
220
+ console.log(direction)
221
+ let d = ''
222
+ switch (direction) {
223
+ case '↘':
224
+ d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
225
+ L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
226
+ L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
227
+ L${toO.left + toO.with / 2},${toO.top}`
228
+ break
229
+ case '↗':
230
+ d = `M${fromO.left + fromO.with / 2},${fromO.top}
231
+ L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
232
+ L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
233
+ L${toO.left + toO.with / 2},${toO.top + toO.height}`
234
+ break
235
+ case '→':
236
+ d = `M${fromO.left + fromO.with},${fromO.top + fromO.height / 2}
237
+ L${(fromO.left + fromO.with + toO.left) / 2},${fromO.top + fromO.height / 2}
238
+ L${(fromO.left + fromO.with + toO.left) / 2},${toO.top + toO.height / 2}
239
+ L${toO.left},${toO.top + toO.height / 2}`
240
+ break
241
+ case '↙':
242
+ d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
243
+ L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
244
+ L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
245
+ L${toO.left + toO.with / 2},${toO.top}`
246
+ break
247
+ case '↖':
248
+ d = `M${fromO.left + fromO.with / 2},${fromO.top}
249
+ L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
250
+ L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
251
+ L${toO.left + toO.with / 2},${toO.top + toO.height}`
252
+ break
253
+ case '←':
254
+ d = `M${fromO.left},${fromO.top + fromO.height / 2}
255
+ L${(fromO.left + toO.left + toO.with) / 2},${fromO.top + fromO.height / 2}
256
+ L${(fromO.left + toO.left + toO.with) / 2},${toO.top + toO.height / 2}
257
+ L${toO.left + toO.with},${toO.top + toO.height / 2}`
258
+ break
259
+ case '↓':
260
+ d = `M${fromO.left + fromO.with / 2},${fromO.top + fromO.height}
261
+ L${fromO.left + fromO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
262
+ L${toO.left + toO.with / 2},${(fromO.top + fromO.height + toO.top) / 2}
263
+ L${toO.left + toO.with / 2},${toO.top}`
264
+ break
265
+ case '↑':
266
+ d = `M${fromO.left + fromO.with / 2},${fromO.top}
267
+ L${fromO.left + fromO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
268
+ L${toO.left + toO.with / 2},${(fromO.top + toO.top + toO.height) / 2}
269
+ L${toO.left + toO.with / 2},${toO.top + toO.height}`
270
+ break
271
+ }
272
+ d = d.replace(/[\s\n]+/g, ' ')
273
+
274
+ // = `M ${fromO.left},${fromO.top}L${toO.left},${toO.top}`
275
+
276
+ let path = document.createElementNS('http://www.w3.org/2000/svg', 'path')
277
+ path.setAttribute('class', 'activiti-line-reject')
278
+ path.setAttribute('d', d)
279
+ this.svgC.appendChild(path)
280
+ },
281
+ */
282
+ </script>
283
+
284
+ <style>
285
+ .n20-approval-img-por .djs-hit-all,
286
+ .n20-approval-img-por .djs-outline {
287
+ display: none !important;
288
+ }
289
+ .n20-approval-img-por .activiti-msg {
290
+ display: none;
291
+ }
292
+
293
+ .activiti-node-achieve circle,
294
+ .activiti-node-achieve rect,
295
+ .activiti-line-achieve path {
296
+ stroke: var(--color-primary) !important;
297
+ }
298
+ .activiti-node-reject circle,
299
+ .activiti-node-reject rect {
300
+ stroke: var(--color-danger) !important;
301
+ }
302
+ .activiti-line-reject {
303
+ fill: none;
304
+ stroke-width: 1px;
305
+ stroke: var(--color-danger) !important;
306
+ stroke-linejoin: round;
307
+ marker-end: url('#sequenceflow-end-white-black-3aw0mc6w8vg7jarca1qf355gu');
308
+ }
309
+ .activiti-text-reject {
310
+ fill: var(--color-danger) !important;
311
+ font-family: Arial, sans-serif;
312
+ font-size: 12px;
313
+ font-weight: normal;
314
+ text-anchor: middle;
315
+ }
316
+ .activiti-text-bg-reject {
317
+ fill: #ffffff;
318
+ }
319
+ </style>
@@ -481,7 +481,7 @@ export default {
481
481
 
482
482
  async getFileInfo(row) {
483
483
  if (this.getFileMethod) {
484
- return await this.getFileMethod(row)
484
+ return this.getFileMethod(row)
485
485
  }
486
486
 
487
487
  let _url = row[this.keys.url]
@@ -90,20 +90,26 @@ export default {
90
90
  this.init()
91
91
  },
92
92
  methods: {
93
- init() {
94
- axios
95
- .get(`/bems/1.0/sysSetting/list`, null, {
96
- loading: false,
97
- noMsg: true
98
- })
99
- .then(({ data }) => {
100
- this.getdata(data)
101
- })
102
- .finally(() => {
103
- this.setConfig()
104
- })
93
+ async init() {
94
+ const { _layoutData } = await getJsonc('/server-config.jsonc')
95
+ console.log(_layoutData.loginSetting, 11)
96
+ if (_layoutData.loginSetting === 'JSON') {
97
+ this.setConfig()
98
+ } else {
99
+ axios
100
+ .get(`/bems/1.0/sysSetting/list`, null, {
101
+ loading: false,
102
+ noMsg: true
103
+ })
104
+ .then(({ data }) => {
105
+ this.getdata(data)
106
+ })
107
+ .finally(() => {
108
+ this.setConfig()
109
+ })
105
110
 
106
- this.getLogoImag()
111
+ this.getLogoImag()
112
+ }
107
113
  },
108
114
  async getLogoImag() {
109
115
  axios
@@ -1,54 +1,11 @@
1
- import { Popover as elPopover } from 'element-ui'
2
-
3
- let timer = undefined
1
+ let tooltip = undefined
4
2
  const popClass = 'at-title-pop-' + Date.now()
5
3
 
6
- function tipShow(el, tip) {
7
- if (el.$tooltipTitle) {
8
- if (!el.$tooltipTitleOverflow || el.clientWidth < el.scrollWidth) {
9
- document.querySelector('.' + popClass).innerText = el.$tooltipTitle
10
-
11
- tip.$refs['title-pop'].referenceElm = el
12
- tip.$refs['title-pop'].doDestroy()
13
-
14
- tip.$nextTick(() => {
15
- tip.visible = true
16
- timer = setInterval(() => {
17
- if (tip.visible && !el.scrollWidth) tipHide(el, tip)
18
- }, 1000)
19
- })
20
- }
21
- } else {
22
- let _input = el.querySelector('.el-input__inner')
23
- if (_input && _input.clientWidth < _input.scrollWidth) {
24
- document.querySelector('.' + popClass).innerText = _input.value
25
-
26
- tip.$refs['title-pop'].referenceElm = el
27
- tip.$refs['title-pop'].doDestroy()
28
-
29
- tip.$nextTick(() => {
30
- tip.visible = true
31
- timer = setInterval(() => {
32
- if (tip.visible && !el.scrollWidth) tipHide(el, tip)
33
- }, 1000)
34
- })
35
- }
36
- }
37
- }
38
-
39
- function tipHide(el, tip) {
40
- tip.visible = false
41
- clearInterval(timer)
42
- }
4
+ function tipInit(Vue) {
5
+ const el = document.createElement('div')
6
+ document.body.appendChild(el)
43
7
 
44
- const TitleDirective = {}
45
- TitleDirective.install = (Vue) => {
46
- if (Vue.prototype.$isServer) return
47
- const tooltip = new Vue({
48
- el: document.createElement('div'),
49
- components: {
50
- elPopover
51
- },
8
+ tooltip = new Vue({
52
9
  data() {
53
10
  return {
54
11
  visible: false
@@ -75,30 +32,76 @@ TitleDirective.install = (Vue) => {
75
32
  [_h('span', { staticClass: popClass })]
76
33
  )
77
34
  }
78
- })
79
- document.querySelector('body').appendChild(tooltip.$el)
35
+ }).$mount(el)
36
+ }
37
+
38
+ export function tipShow(el, popC) {
39
+ let _C = undefined
40
+ if (popC) {
41
+ _C = popC
42
+ } else if (el.$tooltipTitle) {
43
+ if (!el.$tooltipTitleOverflow || el.clientWidth < el.scrollWidth) {
44
+ _C = el.$tooltipTitle
45
+ }
46
+ } else {
47
+ let _input = el.querySelector('.el-input__inner')
48
+ if (_input && _input.clientWidth < _input.scrollWidth) {
49
+ _C = _input.value
50
+ }
51
+ }
52
+
53
+ if (_C) {
54
+ let popEl = document.querySelector('.' + popClass)
55
+ if (_C.nodeName) {
56
+ popEl.innerText = ''
57
+ _C = _C.cloneNode(true)
58
+ popEl.appendChild(_C)
59
+ } else {
60
+ popEl.innerText = _C
61
+ }
62
+
63
+ if (tooltip.$refs['title-pop'].referenceElm !== el) {
64
+ tooltip.$refs['title-pop'].doDestroy()
65
+ tooltip.$refs['title-pop'].referenceElm = el
66
+ }
67
+
68
+ tooltip.visible = true
69
+ }
70
+ }
80
71
 
72
+ export function tipHide(el) {
73
+ if (tooltip.$refs['title-pop'].referenceElm === el) {
74
+ tooltip.visible = false
75
+ }
76
+ }
77
+
78
+ const TitleDirective = {}
79
+ TitleDirective.install = (Vue) => {
80
+ if (Vue.prototype.$isServer) return
81
81
  Vue.directive('title', {
82
82
  bind: function (el, binding, vnode) {
83
- if (vnode.data && vnode.data.attrs) {
84
- el.$tooltipTitleOverflow = vnode.data.attrs['show-overflow-tooltip']
85
- }
83
+ tooltip || tipInit(Vue)
84
+
85
+ el.$tooltipTitleOverflow =
86
+ vnode.data.attrs && vnode.data.attrs['show-overflow-tooltip']
86
87
  el.$tooltipTitle = binding.value
87
- el.$tooltipShow = () => tipShow(el, tooltip)
88
- el.$tooltipHide = () => tipHide(el, tooltip)
89
- el.addEventListener('mouseenter', el.$tooltipShow)
90
- el.addEventListener('mouseleave', el.$tooltipHide)
88
+
89
+ let vmethods = vnode.child ? vnode.child.$options : vnode.context.$options
90
+ vmethods.deactivated || (vmethods.deactivated = [])
91
+
92
+ vmethods.deactivated.push(tipHide.bind(null, el))
93
+ el.$tipShow = () => tipShow(el)
94
+ el.$tipHide = () => tipHide(el)
95
+ el.addEventListener('mouseenter', el.$tipShow)
96
+ el.addEventListener('mouseleave', el.$tipHide)
91
97
  },
92
98
  update: function (el, binding) {
93
- if (binding.value !== binding.oldValue) {
94
- el.$tooltipTitle = binding.value
95
- }
99
+ el.$tooltipTitle = binding.value
96
100
  },
97
101
  unbind: function (el, binding) {
98
- el.$tooltipHide()
99
- el.removeEventListener('mouseenter', el.$tooltipShow)
100
- el.removeEventListener('mouseleave', el.$tooltipHide)
101
- clearInterval(timer)
102
+ tipHide(el)
103
+ el.removeEventListener('mouseenter', el.$tipShow)
104
+ el.removeEventListener('mouseleave', el.$tipHide)
102
105
  }
103
106
  })
104
107
  }
package/src/index.js CHANGED
@@ -54,7 +54,6 @@ import PageHeader from './components/PageHeader/index.vue'
54
54
  import Descriptions from './components/Descriptions/index.vue'
55
55
  import EventBubble from './components/EventBubble/index.vue'
56
56
  // ECharts 不要打包进来
57
- // import Search from './components/Search/index.vue'
58
57
  import Stamp from './components/Stamp/index.vue'
59
58
  /* old */
60
59
  import TableO from './components/Table/indexO.vue'
@@ -74,6 +73,7 @@ import VHas from './directives/VHas/index.js'
74
73
  /** 注入方法 */
75
74
  import dayjs from 'dayjs'
76
75
  import numerify from 'numerify'
76
+ import { tipShow, tipHide } from './directives/VTitle'
77
77
  import axios from './utils/axios.js'
78
78
  import auth from './utils/auth.js'
79
79
  import { msgPor, msgboxPor } from './utils/msgboxPor.js'
@@ -145,7 +145,6 @@ const components = [
145
145
  PageHeader,
146
146
  Descriptions,
147
147
  EventBubble,
148
- // Search,
149
148
  approvalImg,
150
149
  Stamp,
151
150
  /* old */
@@ -204,6 +203,8 @@ export {
204
203
  isHasG,
205
204
  dayjs,
206
205
  numerify,
206
+ tipShow,
207
+ tipHide,
207
208
  // 组件
208
209
  ContentLoading,
209
210
  ContentNull,
@@ -258,7 +259,6 @@ export {
258
259
  PageHeader,
259
260
  Descriptions,
260
261
  EventBubble,
261
- // Search,
262
262
  approvalImg,
263
263
  Stamp
264
264
  }
@@ -95,7 +95,7 @@ function errorFn(status, msg, noMsg) {
95
95
  noMsg || showMsg('500,服务器链接失败!')
96
96
  } else if (status === 'ECONNABORTED' && msg.includes('timeout')) {
97
97
  showMsg('请求超时')
98
- } else if (status >= 900) {
98
+ } else if (status >= 900 || status === -1) {
99
99
  noMsg || showMsg(msg)
100
100
  } else {
101
101
  // noMsg || showMsg(msg)