n20-common-lib 2.4.62 → 2.4.64

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": "2.4.62",
3
+ "version": "2.4.64",
4
4
  "private": false,
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -49,6 +49,7 @@
49
49
  "dependencies": {
50
50
  "axios": "*",
51
51
  "dayjs": "*",
52
+ "element-ui": "^2.15.14",
52
53
  "js-cookie": "^3.0.1",
53
54
  "jsonwebtoken": "^8.5.1",
54
55
  "lz-string": "^1.4.4",
@@ -75,7 +76,6 @@
75
76
  "copy-webpack-plugin": "^6.4.1",
76
77
  "core-js": "^3.6.5",
77
78
  "echarts": "^5.3.3",
78
- "element-ui": "^2.15.9",
79
79
  "eslint": "^6.7.2",
80
80
  "eslint-plugin-vue": "^6.2.2",
81
81
  "exceljs": "^4.3.0",
@@ -105,11 +105,11 @@
105
105
  "vue-router": "^3.5.2",
106
106
  "vue-template-compiler": "^2.6.11",
107
107
  "vuex": "^3.6.2",
108
+ "vxe-table": "^3.6.17",
108
109
  "webpack-bundle-analyzer": "^3.9.0",
110
+ "xe-utils": "^3.5.11",
109
111
  "xlsx": "0.14.1",
110
- "xlsx-style": "^0.8.13",
111
- "vxe-table": "^3.6.17",
112
- "xe-utils": "^3.5.11"
112
+ "xlsx-style": "^0.8.13"
113
113
  },
114
114
  "browserslist": [
115
115
  "> 1%",
@@ -18,27 +18,27 @@
18
18
 
19
19
  <script>
20
20
  import { $lc } from '../../utils/i18n/index'
21
- import dayjs from 'dayjs'
22
- let startDate = ''
21
+ // import dayjs from 'dayjs'
22
+ // let startDate = ''
23
23
 
24
- const onPick = ({ maxDate, minDate }) => {
25
- startDate = minDate.getMonth() + 1 + '-' + minDate.getDate()
26
- let startSh = shortcuts_2.find((s) => s.text.includes($lc('开始')))
27
- startSh.text = startDate + $lc('开始')
28
- startSh.onClick = (picker) => {
29
- const start = dayjs(minDate).format('YYYY-MM-DD HH:mm:ss')
30
- const end = dayjs(minDate).add(100, 'year').format('YYYY-MM-DD HH:mm:ss')
31
- picker.$emit('pick', [start, end])
32
- }
24
+ // const onPick = ({ maxDate, minDate }) => {
25
+ // startDate = minDate.getMonth() + 1 + '-' + minDate.getDate()
26
+ // let startSh = shortcuts_2.find((s) => s.text.includes($lc('开始')))
27
+ // startSh.text = startDate + $lc('开始')
28
+ // startSh.onClick = (picker) => {
29
+ // const start = dayjs(minDate).format('YYYY-MM-DD HH:mm:ss')
30
+ // const end = dayjs(minDate).add(100, 'year').format('YYYY-MM-DD HH:mm:ss')
31
+ // picker.$emit('pick', [start, end])
32
+ // }
33
33
 
34
- let endSh = shortcuts_2.find((s) => s.text.includes($lc('截止')))
35
- endSh.text = startDate + $lc('截止')
36
- endSh.onClick = (picker) => {
37
- const end = dayjs(minDate).format('YYYY-MM-DD HH:mm:ss')
38
- const start = dayjs(minDate).subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
39
- picker.$emit('pick', [start, end])
40
- }
41
- }
34
+ // let endSh = shortcuts_2.find((s) => s.text.includes($lc('截止')))
35
+ // endSh.text = startDate + $lc('截止')
36
+ // endSh.onClick = (picker) => {
37
+ // const end = dayjs(minDate).format('YYYY-MM-DD HH:mm:ss')
38
+ // const start = dayjs(minDate).subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
39
+ // picker.$emit('pick', [start, end])
40
+ // }
41
+ // }
42
42
 
43
43
  let disabledDate_1 = (t) => {
44
44
  let now = new Date()
@@ -95,23 +95,23 @@ let shortcuts_2 = [
95
95
  end.setHours(23, 59, 59)
96
96
  picker.$emit('pick', [start, end])
97
97
  }
98
- },
99
- {
100
- text: $lc('今天开始'),
101
- onClick(picker) {
102
- const start = dayjs().format('YYYY-MM-DD HH:mm:ss')
103
- const end = dayjs().add(99, 'year').format('YYYY-MM-DD HH:mm:ss')
104
- picker.$emit('pick', [start, end])
105
- }
106
- },
107
- {
108
- text: $lc('今天截止'),
109
- onClick(picker) {
110
- const end = dayjs().format('YYYY-MM-DD HH:mm:ss')
111
- const start = dayjs().subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
112
- picker.$emit('pick', [start, end])
113
- }
114
98
  }
99
+ // {
100
+ // text: $lc('今天开始'),
101
+ // onClick(picker) {
102
+ // const start = dayjs().format('YYYY-MM-DD HH:mm:ss')
103
+ // const end = dayjs().add(99, 'year').format('YYYY-MM-DD HH:mm:ss')
104
+ // picker.$emit('pick', [start, end])
105
+ // }
106
+ // },
107
+ // {
108
+ // text: $lc('今天截止'),
109
+ // onClick(picker) {
110
+ // const end = dayjs().format('YYYY-MM-DD HH:mm:ss')
111
+ // const start = dayjs().subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
112
+ // picker.$emit('pick', [start, end])
113
+ // }
114
+ // }
115
115
  ]
116
116
 
117
117
  export default {
@@ -168,13 +168,13 @@ export default {
168
168
  this.pickerOptionsAs = Object.assign(
169
169
  {
170
170
  disabledDate: this.minNow ? disabledDate_1 : this.maxNow ? disabledDate_2 : undefined,
171
- shortcuts,
172
- onPick
171
+ shortcuts
172
+ // onPick
173
173
  },
174
174
  this.pickerOptions
175
175
  )
176
176
 
177
- this.listeners = Object.assign({}, this.$listeners, { input: () => {}, change: () => {}, blur: this.HandleBlur })
177
+ this.listeners = Object.assign({}, this.$listeners, { input: () => {}, change: () => {} })
178
178
  return {}
179
179
  },
180
180
  computed: {
@@ -202,12 +202,10 @@ export default {
202
202
  let D = end.getDate()
203
203
  let str = `${Y}-${M > 9 ? M : '0' + M}-${D > 9 ? D : '0' + D}`
204
204
  if (this.valueFormat === 'yyyy-MM-dd HH:mm:ss') str = str + ' 23:59:59'
205
- startDate = val[0]
206
205
  this.$emit('update:start-date', val[0])
207
206
  this.$emit('update:end-date', str)
208
207
  this.$emit('change', [val[0], str])
209
208
  } else {
210
- startDate = val[0]
211
209
  this.$emit('update:start-date', val[0])
212
210
  this.$emit('update:end-date', val[1])
213
211
  this.$emit('change', val)
@@ -225,22 +223,22 @@ export default {
225
223
  }
226
224
  },
227
225
  methods: {
228
- HandleBlur() {
229
- let startSh = shortcuts_2.find((s) => s.text.includes($lc('开始')))
230
- let endSh = shortcuts_2.find((s) => s.text.includes($lc('截止')))
231
- startSh.text = $lc('今天开始')
232
- startSh.onClick = (picker) => {
233
- const start = dayjs().format('YYYY-MM-DD HH:mm:ss')
234
- const end = dayjs().add(100, 'year').format('YYYY-MM-DD HH:mm:ss')
235
- picker.$emit('pick', [start, end])
236
- }
237
- endSh.text = $lc('今天截止')
238
- endSh.onClick = (picker) => {
239
- const end = dayjs().format('YYYY-MM-DD HH:mm:ss')
240
- const start = dayjs().subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
241
- picker.$emit('pick', [start, end])
242
- }
243
- }
226
+ // HandleBlur() {
227
+ // let startSh = shortcuts_2.find((s) => s.text.includes($lc('开始')))
228
+ // let endSh = shortcuts_2.find((s) => s.text.includes($lc('截止')))
229
+ // startSh.text = $lc('今天开始')
230
+ // startSh.onClick = (picker) => {
231
+ // const start = dayjs().format('YYYY-MM-DD HH:mm:ss')
232
+ // const end = dayjs().add(100, 'year').format('YYYY-MM-DD HH:mm:ss')
233
+ // picker.$emit('pick', [start, end])
234
+ // }
235
+ // endSh.text = $lc('今天截止')
236
+ // endSh.onClick = (picker) => {
237
+ // const end = dayjs().format('YYYY-MM-DD HH:mm:ss')
238
+ // const start = dayjs().subtract(100, 'year').format('YYYY-MM-DD HH:mm:ss')
239
+ // picker.$emit('pick', [start, end])
240
+ // }
241
+ // }
244
242
  }
245
243
  }
246
244
  </script>
@@ -11,6 +11,10 @@ export default {
11
11
  appendToBody: {
12
12
  type: Boolean,
13
13
  default: true
14
+ },
15
+ closeOnClickModal: {
16
+ type: Boolean,
17
+ default: false
14
18
  }
15
19
  },
16
20
  watch: {
@@ -186,6 +186,23 @@
186
186
  cursor: pointer;
187
187
  }
188
188
 
189
+ .login-language-box {
190
+ box-sizing: border-box;
191
+ position: absolute;
192
+ top: 57px;
193
+ right: 200px;
194
+ width: 28px;
195
+ height: 28px;
196
+ line-height: 28px;
197
+ font-size: 28px;
198
+ text-align: center;
199
+ color: #ffffff;
200
+ cursor: pointer;
201
+ }
202
+ .login-language-box .set-user-btn {
203
+ font-size: 28px;
204
+ }
205
+
189
206
  .login-copyright {
190
207
  position: absolute;
191
208
  bottom: 24px;
@@ -210,6 +210,23 @@ $swiperW: 860px;
210
210
  color: $colorL;
211
211
  cursor: pointer;
212
212
  }
213
+
214
+ .login-language-box {
215
+ box-sizing: border-box;
216
+ position: absolute;
217
+ top: 57px;
218
+ right: 200px;
219
+ width: 28px;
220
+ height: 28px;
221
+ line-height: 28px;
222
+ font-size: 28px;
223
+ text-align: center;
224
+ color: $colorL;
225
+ cursor: pointer;
226
+ .set-user-btn {
227
+ font-size: 28px;
228
+ }
229
+ }
213
230
  // 版权声明
214
231
  .login-copyright {
215
232
  position: absolute;
@@ -34,6 +34,35 @@
34
34
  />
35
35
  <h3 class="login-logo-text">{{ loginLogoText | $l }}</h3>
36
36
  </div>
37
+
38
+ <el-dropdown
39
+ class="login-language-box m-l-lg"
40
+ :style="{ right: _lang == 'en' ? '260px' : '200px' }"
41
+ @command="setLang"
42
+ >
43
+ <!-- <el-tooltip v-if="!hideLang" :content="'语言切换' | $lc"> -->
44
+ <span
45
+ class="set-user-btn iconfont header-color"
46
+ :class="{
47
+ 'icon-zhongwen': langVal === 'zh-cn',
48
+ 'icon-fanti': langVal === 'zh-hk',
49
+ 'icon-yuyanqiehuan': langVal === 'en'
50
+ }"
51
+ ></span>
52
+ <!-- </el-tooltip> -->
53
+ <el-dropdown-menu slot="dropdown">
54
+ <el-dropdown-item command="zh-cn"
55
+ ><i class="iconfont icon-zhongwen f-s-icon"></i>{{ '简体中文' | $lc }}</el-dropdown-item
56
+ >
57
+ <el-dropdown-item command="zh-hk"
58
+ ><i class="iconfont icon-fanti f-s-icon"></i>{{ '繁体中文' | $lc }}</el-dropdown-item
59
+ >
60
+ <el-dropdown-item command="en"
61
+ ><i class="iconfont icon-yuyanqiehuan f-s-icon"></i>{{ '英文' | $lc }}</el-dropdown-item
62
+ >
63
+ </el-dropdown-menu>
64
+ </el-dropdown>
65
+
37
66
  <div v-if="inspectionCenter" class="login-verify-box" @click="inspectionV = true">{{ '查验中心' | $lc }} ></div>
38
67
 
39
68
  <template v-if="form.LOGIN_TYPE === 'T1'">
@@ -135,7 +164,8 @@ import { $lc } from '../../utils/i18n/index'
135
164
  import getJsonc from '../../assets/getJsonc'
136
165
  import realUrl from '../../assets/realUrl'
137
166
  import axios from '../../utils/axios'
138
-
167
+ import auth from '../../utils/auth.js'
168
+ import Cookies from 'js-cookie'
139
169
  import loginForm from './form.vue'
140
170
  import retrievePw from './retrievePw.vue'
141
171
  import Inspection from './inspection/index.vue'
@@ -206,6 +236,7 @@ export default {
206
236
  loginCopyright: undefined,
207
237
  loginSloganHtml: undefined
208
238
  },
239
+ langVal: window.localStorage.getItem('pageLang') || 'zh-cn',
209
240
  operateType: 'login',
210
241
  alV: false,
211
242
  form: {
@@ -567,6 +598,14 @@ export default {
567
598
  localStorage.setItem('pageInSystemNo', item.NO)
568
599
  localStorage.setItem('pageInType', 'inFront')
569
600
  this.sltSys = item
601
+ },
602
+ setLang(val) {
603
+ this.langVal = val
604
+
605
+ window.localStorage.setItem('pageLang', this.langVal)
606
+ Cookies.set('language', ['zh-cn', 'zh-hk'].includes(this.langVal) ? 'zh' : this.langVal, { expires: 365 })
607
+ auth.setReqLang()
608
+ window.location.reload()
570
609
  }
571
610
  }
572
611
  }
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>页面</title>
4
+ <g id="页面" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="20" height="20"></rect>
6
+ <path d="M16.6914062,5.63867188 C16.8085938,5.75585938 16.875,5.9140625 16.875,6.08007812 L16.875,18.125 C16.875,18.4707031 16.5957031,18.75 16.25,18.75 L3.75,18.75 C3.40429688,18.75 3.125,18.4707031 3.125,18.125 L3.125,1.875 C3.125,1.52929688 3.40429688,1.25 3.75,1.25 L12.0449219,1.25 C12.2109375,1.25 12.3710938,1.31640625 12.4882813,1.43359375 L16.6914062,5.63867188 Z M15.4335938,6.3671875 L11.7578125,2.69140625 L11.7578125,6.3671875 L15.4335938,6.3671875 Z M6.25,9.4140625 C6.16370551,9.4140625 6.09375,9.48401801 6.09375,9.5703125 L6.09375,10.5078125 C6.09375,10.594107 6.16370551,10.6640625 6.25,10.6640625 L13.75,10.6640625 C13.8362945,10.6640625 13.90625,10.594107 13.90625,10.5078125 L13.90625,9.5703125 C13.90625,9.48401801 13.8362945,9.4140625 13.75,9.4140625 L6.25,9.4140625 Z M6.25,12.0703125 C6.16370551,12.0703125 6.09375,12.140268 6.09375,12.2265625 L6.09375,13.1640625 C6.09375,13.250357 6.16370551,13.3203125 6.25,13.3203125 L9.84375,13.3203125 C9.93004449,13.3203125 10,13.250357 10,13.1640625 L10,12.2265625 C10,12.140268 9.93004449,12.0703125 9.84375,12.0703125 L6.25,12.0703125 Z" id="形状" fill="#1677FF" fill-rule="nonzero"></path>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>文件</title>
4
+ <g id="文件" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <rect id="矩形" fill="#000000" fill-rule="nonzero" opacity="0" x="0" y="0" width="20" height="20"></rect>
6
+ <rect id="矩形" fill="#FFBF00" opacity="0.300000012" x="3" y="4" width="14" height="11"></rect>
7
+ <path d="M17.1875,5.828125 L10.1757812,5.828125 L7.88476562,3.63671875 C7.85546875,3.609375 7.81640625,3.59375 7.77734375,3.59375 L2.8125,3.59375 C2.46679688,3.59375 2.1875,3.87304688 2.1875,4.21875 L2.1875,15.78125 C2.1875,16.1269531 2.46679688,16.40625 2.8125,16.40625 L17.1875,16.40625 C17.5332031,16.40625 17.8125,16.1269531 17.8125,15.78125 L17.8125,6.453125 C17.8125,6.10742188 17.5332031,5.828125 17.1875,5.828125 Z" id="路径" fill="#FFBF00" fill-rule="nonzero"></path>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,7 @@
1
+ import Tree from './index.vue'
2
+
3
+ Tree.install = function (Vue) {
4
+ Vue.component(Tree.name, Tree)
5
+ }
6
+
7
+ export default Tree
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <el-tree
3
+ ref="tree"
4
+ :node-key="nodeKey"
5
+ :expand-on-click-node="false"
6
+ :data="data"
7
+ :props="props"
8
+ v-bind="$attrs"
9
+ v-on="$listeners"
10
+ >
11
+ <div
12
+ slot-scope="{ node, data }"
13
+ class="flex-box flex-lr flex-v w-100p"
14
+ @mouseenter="mouseenterTree(node, data)"
15
+ @mouseleave="checkFlag = false"
16
+ >
17
+ <span class="flex-box flex-v">
18
+ <img :src="node.level == 1 ? folder : desc" class="m-r-ss" alt="" />
19
+
20
+ {{ (data[props.value] ? '(' + data[props.value] + ') ' : '') + data[props.label] }}
21
+ </span>
22
+ <el-button
23
+ v-if="node.data[nodeKey] === checkFlag && checkFlag.data && checkFlag.data[nodeKey]"
24
+ type="text"
25
+ @click="handleChecked(node)"
26
+ >{{ '只勾选当前节点' }}</el-button
27
+ >
28
+ </div>
29
+ </el-tree>
30
+ </template>
31
+ <script>
32
+ export default {
33
+ name: 'Tree',
34
+ props: {
35
+ data: {
36
+ type: Array,
37
+ default: () => []
38
+ },
39
+ props: {
40
+ type: Object,
41
+ default: () => ({})
42
+ },
43
+ nodeKey: {
44
+ type: String,
45
+ default: ''
46
+ }
47
+ },
48
+ data() {
49
+ return {
50
+ folder: require('./folder.svg'),
51
+ desc: require('./document.svg'),
52
+ checkFlag: {},
53
+ list: []
54
+ }
55
+ },
56
+ mounted() {
57
+ this.setRefData()
58
+ },
59
+ methods: {
60
+ setRefData() {
61
+ const {
62
+ filter,
63
+ updateKeyChildren,
64
+ getCheckedNodes,
65
+ setCheckedNodes,
66
+ getCheckedKeys,
67
+ setCheckedKeys,
68
+ setChecked,
69
+ getHalfCheckedNodes,
70
+ getHalfCheckedKeys,
71
+ getCurrentKey,
72
+ getCurrentNode,
73
+ setCurrentKey,
74
+ setCurrentNode,
75
+ getNode,
76
+ remove,
77
+ append,
78
+ insertBefore,
79
+ insertAfter
80
+ } = this.$refs['tree']
81
+
82
+ this.filter = filter
83
+ this.updateKeyChildren = updateKeyChildren
84
+ this.getCheckedNodes = getCheckedNodes
85
+ this.setCheckedNodes = setCheckedNodes
86
+ this.getCheckedKeys = getCheckedKeys
87
+ this.setCheckedKeys = setCheckedKeys
88
+ this.setChecked = setChecked
89
+ this.getHalfCheckedNodes = getHalfCheckedNodes
90
+ this.getHalfCheckedKeys = getHalfCheckedKeys
91
+ this.getCurrentKey = getCurrentKey
92
+ this.getCurrentNode = getCurrentNode
93
+ this.setCurrentKey = setCurrentKey
94
+ this.setCurrentNode = setCurrentNode
95
+ this.getNode = getNode
96
+ this.remove = remove
97
+ this.append = append
98
+ this.insertBefore = insertBefore
99
+ this.insertAfter = insertAfter
100
+ },
101
+ handleChecked(node) {
102
+ this.setChecked(node.data, true)
103
+ },
104
+ mouseenterTree(node, data) {
105
+ this.checkFlag = node
106
+ }
107
+ }
108
+ }
109
+ </script>
110
+
111
+ <style scoped></style>
package/src/i18n.json CHANGED
@@ -14,6 +14,15 @@
14
14
  "天!": {
15
15
  "en": "God!"
16
16
  },
17
+ "今天开始": {
18
+ "en": "Today starts"
19
+ },
20
+ "今天截止": {
21
+ "en": "Today ends"
22
+ },
23
+ "截止": {
24
+ "en": "The deadline"
25
+ },
17
26
  "审批进度查看": {
18
27
  "en": "Review of approval progress"
19
28
  },
package/src/index.js CHANGED
@@ -61,6 +61,9 @@ import TertiaryTab from './components/TertiaryTab/index.vue'
61
61
  import TimePicker from './components/TimePicker/index.vue'
62
62
  import Upload from './components/Upload/index.vue'
63
63
  import WornPagination from './components/WornPagination/index.vue'
64
+
65
+ import Tree from './components/Tree/index.js'
66
+
64
67
  // 新版日期选择框
65
68
  import BusiDatePicker from './components/DateSelect/busiDate.vue'
66
69
  import QuarterDatePicker from './components/DateSelect/quarterDatePicker.vue'
@@ -190,6 +193,7 @@ const components = [
190
193
  TableTransfer,
191
194
  WorkCard,
192
195
  UploadMsg,
196
+ Tree,
193
197
  /* old */
194
198
  TableO,
195
199
  FiltersO,
@@ -339,5 +343,6 @@ export {
339
343
  // 页签/路由
340
344
  setTabs,
341
345
  refreshTab,
346
+ Tree,
342
347
  version
343
348
  }