hd-idevvue3 3.0.7 → 3.0.8

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.
Files changed (148) hide show
  1. package/package.json +6 -1
  2. package/.env.development +0 -5
  3. package/.env.production +0 -5
  4. package/.eslintrc.js +0 -151
  5. package/index.html +0 -18
  6. package/pnpm-lock.yaml +0 -3541
  7. package/src/App.vue +0 -11
  8. package/src/assets/sound/notify.wav +0 -0
  9. package/src/demo/demo.vue +0 -42
  10. package/src/demo/dropdemo.vue +0 -42
  11. package/src/demo/extsets.vue +0 -208
  12. package/src/demo/formedit.vue +0 -157
  13. package/src/demo/hightquery.vue +0 -366
  14. package/src/demo/inlineedit.vue +0 -182
  15. package/src/demo/selfdrop.vue +0 -58
  16. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
  17. package/src/directive/el-dragDialog/drag.js +0 -124
  18. package/src/directive/el-dragDialog/index.js +0 -13
  19. package/src/errorLog.js +0 -16
  20. package/src/hdcom/BigGrid.js +0 -179
  21. package/src/hdcom/BillShow.vue +0 -111
  22. package/src/hdcom/BillUpload.vue +0 -311
  23. package/src/hdcom/BtnRight.vue +0 -101
  24. package/src/hdcom/ErrHint.vue +0 -42
  25. package/src/hdcom/ExtendColumn.vue +0 -115
  26. package/src/hdcom/ExtendCommon.js +0 -40
  27. package/src/hdcom/ExtendForm.vue +0 -141
  28. package/src/hdcom/FacePicUpload.vue +0 -80
  29. package/src/hdcom/FaceRecTest.vue +0 -114
  30. package/src/hdcom/GridChart.vue +0 -207
  31. package/src/hdcom/GridExField.vue +0 -375
  32. package/src/hdcom/GridShow.vue +0 -288
  33. package/src/hdcom/HdAside.vue +0 -225
  34. package/src/hdcom/HdBtn.vue +0 -125
  35. package/src/hdcom/HdButton.vue +0 -161
  36. package/src/hdcom/HdComFaceRec.vue +0 -106
  37. package/src/hdcom/HdComGrid.vue +0 -876
  38. package/src/hdcom/HdComQuery.vue +0 -362
  39. package/src/hdcom/HdComQueryDetail.vue +0 -205
  40. package/src/hdcom/HdComSortDetail.vue +0 -161
  41. package/src/hdcom/HdDatePicker.vue +0 -94
  42. package/src/hdcom/HdDialog.vue +0 -81
  43. package/src/hdcom/HdDrop.vue +0 -188
  44. package/src/hdcom/HdFileUpload.vue +0 -167
  45. package/src/hdcom/HdFilterBox.vue +0 -90
  46. package/src/hdcom/HdFooter.vue +0 -182
  47. package/src/hdcom/HdForm.vue +0 -351
  48. package/src/hdcom/HdFormBtn.vue +0 -131
  49. package/src/hdcom/HdFormItem.vue +0 -39
  50. package/src/hdcom/HdGctosGrid +0 -0
  51. package/src/hdcom/HdGrid.vue +0 -1022
  52. package/src/hdcom/HdGridEditBtn.vue +0 -58
  53. package/src/hdcom/HdGridExt.js +0 -250
  54. package/src/hdcom/HdGridSel.vue +0 -257
  55. package/src/hdcom/HdHeader.vue +0 -180
  56. package/src/hdcom/HdHotKey.vue +0 -84
  57. package/src/hdcom/HdInputHint.vue +0 -53
  58. package/src/hdcom/HdMain.vue +0 -41
  59. package/src/hdcom/HdMessage.vue +0 -201
  60. package/src/hdcom/HdNum.vue +0 -79
  61. package/src/hdcom/HdPopSel.vue +0 -80
  62. package/src/hdcom/HdRightMenu.vue +0 -63
  63. package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
  64. package/src/hdcom/HdTableColumn.vue +0 -381
  65. package/src/hdcom/HdTempSave.vue +0 -162
  66. package/src/hdcom/HdTree.vue +0 -103
  67. package/src/hdcom/HdTreeTable/eval.js +0 -39
  68. package/src/hdcom/HdTreeTable/index.vue +0 -229
  69. package/src/hdcom/ImportExcel.vue +0 -178
  70. package/src/hdcom/index.js +0 -75
  71. package/src/idev.common.js +0 -79
  72. package/src/index.js +0 -11
  73. package/src/utils/HdQuery.js +0 -65
  74. package/src/utils/comutils.js +0 -120
  75. package/src/utils/gogocodeTransfer.js +0 -59
  76. package/src/utils/utils.js +0 -116
  77. package/src/vendor/Blob.js +0 -187
  78. package/src/vendor/Export2Excel.js +0 -231
  79. package/src/vendor/Export2Zip.js +0 -25
  80. package/src/views/layout/AppMain.vue +0 -34
  81. package/src/views/layout/HdLayout.vue +0 -90
  82. package/src/views/layout/header/ElasticSearch.vue +0 -262
  83. package/src/views/layout/header/HZRecorder.js +0 -259
  84. package/src/views/layout/header/HeaderSearch.vue +0 -218
  85. package/src/views/layout/header/Levelbar.vue +0 -55
  86. package/src/views/layout/header/MainHeader.vue +0 -315
  87. package/src/views/layout/header/Navbar.vue +0 -101
  88. package/src/views/layout/header/ScrollPane.vue +0 -103
  89. package/src/views/layout/header/TagsView.vue +0 -215
  90. package/src/views/layout/header/VocRec.vue +0 -105
  91. package/src/views/layout/header/changepswform.vue +0 -130
  92. package/src/views/layout/index.js +0 -10
  93. package/src/views/layout/menu/Hamburger.vue +0 -63
  94. package/src/views/layout/menu/HdMenu.vue +0 -204
  95. package/src/views/layout/menu/css/menu.css +0 -288
  96. package/src/views/layout/menu/index.vue +0 -27
  97. package/src/views/privilege/commsg/commsg.vue +0 -152
  98. package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
  99. package/src/views/privilege/commsg/commsgRole.vue +0 -220
  100. package/src/views/privilege/commsg/commsgform.vue +0 -184
  101. package/src/views/privilege/commsg/commsgiframe.vue +0 -40
  102. package/src/views/privilege/commsg/commsgto.vue +0 -199
  103. package/src/views/privilege/commsg/commsgtoform.vue +0 -114
  104. package/src/views/privilege/commsg/commsgtrans.vue +0 -227
  105. package/src/views/privilege/exfield/comexcolumn.vue +0 -161
  106. package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
  107. package/src/views/privilege/exfield/comexfield.vue +0 -29
  108. package/src/views/privilege/exfield/comexfieldform.vue +0 -112
  109. package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
  110. package/src/views/privilege/index.js +0 -41
  111. package/src/views/privilege/menu/comMenu.vue +0 -49
  112. package/src/views/privilege/menu/menu.vue +0 -250
  113. package/src/views/privilege/menu/menuinfo.vue +0 -63
  114. package/src/views/privilege/menu/rolelist.vue +0 -92
  115. package/src/views/privilege/menu/userlist.vue +0 -92
  116. package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
  117. package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
  118. package/src/views/privilege/orgDept/authOrgn.vue +0 -188
  119. package/src/views/privilege/orgDept/authorgnform.vue +0 -157
  120. package/src/views/privilege/orgDept/orgDept.vue +0 -38
  121. package/src/views/privilege/orgDept/orgTree.vue +0 -99
  122. package/src/views/privilege/orgDept/orgnselect.vue +0 -155
  123. package/src/views/privilege/personDept/authuser.vue +0 -229
  124. package/src/views/privilege/personDept/authuserform.vue +0 -206
  125. package/src/views/privilege/personDept/facerec.vue +0 -162
  126. package/src/views/privilege/personDept/orgncascader.vue +0 -144
  127. package/src/views/privilege/personDept/personDept.vue +0 -33
  128. package/src/views/privilege/quartz/comquartzjob.vue +0 -150
  129. package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
  130. package/src/views/privilege/quartz/comquartzlog.vue +0 -143
  131. package/src/views/privilege/role/btnRole.vue +0 -173
  132. package/src/views/privilege/role/menuRole.vue +0 -84
  133. package/src/views/privilege/role/orgnRole.vue +0 -78
  134. package/src/views/privilege/role/role.vue +0 -84
  135. package/src/views/privilege/role/rolelist.vue +0 -136
  136. package/src/views/privilege/role/roleselect.vue +0 -74
  137. package/src/views/privilege/search/comsearch.vue +0 -196
  138. package/src/views/privilege/search/menu.vue +0 -68
  139. package/src/views/privilege/syscode/syscode.vue +0 -191
  140. package/src/views/privilege/syscode/sysfield.vue +0 -119
  141. package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
  142. package/src/views/privilege/syslog/menulog.vue +0 -68
  143. package/src/views/privilege/syslog/syslog.vue +0 -182
  144. package/src/views/privilege/syslog/syslogconfig.vue +0 -128
  145. package/src/views/privilege/syslog/syslogform.vue +0 -85
  146. package/src/views/privilege/syslog/syslogframe.vue +0 -26
  147. package/src/views/privilege/userRole/userRole.vue +0 -220
  148. package/vite.config.js +0 -124
@@ -1,162 +0,0 @@
1
- <template>
2
- <span>
3
- <el-dropdown @command="handleCommand">
4
- <span class="el-dropdown-link">
5
- <a @click="save">{{ $t('存盘') }}</a>
6
- <el-icon class="el-icon--right"><el-icon-arrow-down /></el-icon
7
- ></span>
8
- <el-dropdown-menu
9
- slot="dropdown"
10
- style="max-height: 400px; overflow: auto"
11
- >
12
- <el-dropdown-item :command="lastAuto" v-if="lastAuto">{{
13
- lastAuto.title
14
- }}</el-dropdown-item>
15
- <el-dropdown-item divided></el-dropdown-item>
16
- <el-dropdown-item
17
- v-for="(item, key, index) in allTemp"
18
- :key="item.id"
19
- :command="item"
20
- >
21
- <div v-if="!item.isEdit">
22
- {{ item.title }} &nbsp;&nbsp;<el-icon><el-icon-edit /></el-icon>
23
- &nbsp; <el-icon><el-icon-delete /></el-icon>
24
- </div>
25
- </el-dropdown-item>
26
- </el-dropdown-menu>
27
- </el-dropdown>
28
- </span>
29
- </template>
30
-
31
- <script>
32
- import {
33
- ArrowDown as ElIconArrowDown,
34
- Edit as ElIconEdit,
35
- Delete as ElIconDelete,
36
- } from '@element-plus/icons-vue'
37
- export default {
38
- components: {
39
- ElIconArrowDown,
40
- ElIconEdit,
41
- ElIconDelete,
42
- },
43
- name: 'HdTempSave',
44
- data() {
45
- return {
46
- allTemp: [],
47
- lastAuto: {},
48
- timeInterval: null,
49
- }
50
- },
51
- inheritAttrs: false,
52
- /**
53
- * Props
54
- * @prop {Function} saveFun 备份时的存储
55
- * @prop {event} reload 还原时的触发事件
56
- * @prop {boolean} auto true会自动保存(5秒),弹窗必须加v-if 来关闭定时
57
- */
58
- props: ['saveFun', 'auto'],
59
- mounted() {
60
- this.find()
61
- this.findAuto()
62
- },
63
- beforeDestroy() {
64
- console.info('close')
65
- this.close()
66
- },
67
- methods: {
68
- save() {
69
- let ts = new Date().getTime()
70
- //id是唯一标识,disName是当前页面区分
71
- let obj = {
72
- id: ts,
73
- disName: this.$route.name,
74
- title: new Date().format('MM-dd HH:mm'),
75
- result: this.saveFun(),
76
- }
77
- let tempStore = localStorage.getItem('HdTempStore')
78
- let storeObj = []
79
- if (tempStore) {
80
- storeObj = JSON.parse(tempStore)
81
- }
82
- storeObj.unshift(obj)
83
- localStorage.setItem('HdTempStore', JSON.stringify(storeObj))
84
- this.find()
85
- },
86
- saveForAuto() {
87
- let ts = new Date().getTime()
88
- //id是唯一标识,disName是当前页面区分
89
- let obj = {
90
- id: ts,
91
- disName: this.$route.name,
92
- title: this.$t('自动存盘') + new Date().format('MM-dd HH:mm'),
93
- result: this.saveFun(),
94
- }
95
- localStorage.setItem(
96
- 'HdTempAutoStore' + this.$route.name,
97
- JSON.stringify(obj)
98
- )
99
- },
100
- find() {
101
- let tempStore = localStorage.getItem('HdTempStore')
102
- if (!tempStore) {
103
- return
104
- }
105
- let storeObj = JSON.parse(tempStore)
106
- this.allTemp = storeObj.filter((v) => v.disName == this.$route.name)
107
- },
108
- findAuto() {
109
- let tempStore = localStorage.getItem('HdTempAutoStore' + this.$route.name)
110
- this.lastAuto = JSON.parse(tempStore)
111
- },
112
- remove(item) {
113
- let tempStore = localStorage.getItem('HdTempStore')
114
- let storeObj = JSON.parse(tempStore)
115
- let newSt = storeObj.filter((v) => v.id != item.id)
116
- localStorage.setItem('HdTempStore', JSON.stringify(newSt))
117
- this.find()
118
- },
119
- rename(item) {
120
- this.$prompt(this.$t('请输入名称'), this.$t('提示'), {})
121
- .then(({ value }) => {
122
- let tempStore = localStorage.getItem('HdTempStore')
123
- let storeObj = JSON.parse(tempStore)
124
- let newSt = storeObj.map((v) => {
125
- if (v.id == item.id) {
126
- v.title = value
127
- }
128
- return v
129
- })
130
- localStorage.setItem('HdTempStore', JSON.stringify(newSt))
131
- this.find()
132
- })
133
- .catch(() => {})
134
- },
135
- autoSave() {
136
- this.timeInterval = setInterval(() => {
137
- this.saveForAuto()
138
- }, 5000)
139
- },
140
- close() {
141
- if (this.timeInterval) clearInterval(this.timeInterval)
142
- this.timeInterval = null
143
- },
144
- handleCommand(cmd) {
145
- if (cmd && cmd.result) this.$emit('reload', cmd.result)
146
- },
147
- },
148
- watch: {
149
- auto: {
150
- //定时执行
151
- immediate: true,
152
- handler(newVal) {
153
- if (newVal) {
154
- this.autoSave()
155
- } else {
156
- this.close()
157
- }
158
- },
159
- },
160
- },
161
- }
162
- </script>
@@ -1,103 +0,0 @@
1
- <template>
2
- <div style="height: 100%; overflow: auto">
3
- <el-tree
4
- :expand-on-click-node="false"
5
- :renderContent="myrenderContent"
6
- highlight-current
7
- node-key="id"
8
- ref="eltree"
9
- v-bind="$attrs"
10
- v-on="$listeners"
11
- >
12
- </el-tree>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- /**
18
- * HdTree 对 ElTree 封装了一些样式 idev8请使用EzTreeBean,能控制到展示与伸缩 可参考orgTree和orgnselect(下拉树)
19
- * @module HdNum
20
- */
21
- export default {
22
- name: 'HdTree',
23
- data() {
24
- return {}
25
- },
26
- inheritAttrs: false,
27
- updated() {
28
- const treeData = this.$attrs.data
29
- const rs = []
30
- this.initChecked(treeData, rs)
31
- if (rs) {
32
- this.$refs.eltree.setCheckedNodes(rs)
33
- }
34
- },
35
- methods: {
36
- getCheckedNodes(onlyLeaf = true) {
37
- return this.$refs.eltree.getCheckedNodes(onlyLeaf)
38
- },
39
- initChecked(treeData, rs) {
40
- if (!treeData) {
41
- return false
42
- }
43
- for (let i = 0; i < treeData.length; i++) {
44
- const one = treeData[i]
45
- if (one.checked == 'Y') {
46
- rs.push(one)
47
- }
48
- if (one.children) {
49
- this.initChecked(one.children, rs)
50
- }
51
- }
52
- },
53
- myrenderContent(h, { node, data, store }) {
54
- if (data.state == 'open') {
55
- node.expanded = true
56
- }
57
- // if (data.checked == 'Y') {
58
- //
59
- // //node.checked = true
60
- // // let par = node.parent
61
- // // while (par) {
62
- // // if (par.checked) {
63
- // // break;
64
- // // }
65
- // // par.indeterminate = true
66
- // // par = par.parent
67
- // // }
68
- // }
69
- return h(
70
- 'span',
71
- {
72
- class: {
73
- 'el-tree-node__label': true,
74
- },
75
- style: {
76
- width: 'auto',
77
- 'padding-right': '10px',
78
- },
79
- },
80
- [
81
- h('i', {
82
- class: {
83
- 'el-icon-star-off': true,
84
- },
85
- style: {
86
- paddingRight: '4px',
87
- },
88
- }),
89
- h(
90
- 'span',
91
- {
92
- class: {
93
- 'el-tree-node__label': true,
94
- },
95
- },
96
- data.text
97
- ),
98
- ]
99
- )
100
- },
101
- },
102
- }
103
- </script>
@@ -1,39 +0,0 @@
1
- /**
2
- * @Author: jianglei
3
- * @Date: 2017-10-12 12:06:49
4
- */
5
- 'use strict'
6
- import { createApp } from 'vue'
7
- const Vue = createApp({})
8
-
9
- export default function treeToArray(
10
- data,
11
- expandAll,
12
- parent = null,
13
- level = null
14
- ) {
15
- let tmp = []
16
- Array.from(data).forEach(function (record) {
17
- if (record.state === 'open') {
18
- record._expanded = true
19
- }
20
- if (record._expanded === undefined) {
21
- Vue.set(record, '_expanded', expandAll)
22
- }
23
- let _level = 1
24
- if (level !== undefined && level !== null) {
25
- _level = level + 1
26
- }
27
- Vue.set(record, '_level', _level)
28
- // 如果有父元素
29
- if (parent) {
30
- Vue.set(record, 'parent', parent)
31
- }
32
- tmp.push(record)
33
- if (record.children && record.children.length > 0) {
34
- const children = treeToArray(record.children, expandAll, record, _level)
35
- tmp = tmp.concat(children)
36
- }
37
- })
38
- return tmp
39
- }
@@ -1,229 +0,0 @@
1
- <template>
2
- <el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
3
- <el-table-column v-if="columns.length === 0" width="150">
4
- <template slot-scope="scope">
5
- <span
6
- v-for="space in scope.row._level"
7
- class="ms-tree-space"
8
- :key="space"
9
- ></span>
10
- <span
11
- class="tree-ctrl"
12
- v-if="iconShow(0, scope.row)"
13
- @click="toggleExpanded(scope.$index)"
14
- >
15
- <el-icon><el-icon-plus /></el-icon>
16
- <el-icon><el-icon-minus /></el-icon>
17
- </span>
18
- {{ scope.$index }}
19
- </template>
20
- </el-table-column>
21
- <el-table-column
22
- v-else
23
- v-for="(column, index) in columns"
24
- :key="column.value"
25
- :label="column.text"
26
- :width="column.width"
27
- >
28
- <template slot-scope="scope">
29
- <span
30
- v-if="index === 0"
31
- v-for="space in scope.row._level"
32
- class="ms-tree-space"
33
- :key="space"
34
- ></span>
35
- <span
36
- class="tree-ctrl"
37
- v-if="iconShow(index, scope.row)"
38
- @click="toggleExpanded(scope.$index)"
39
- >
40
- <el-icon><el-icon-plus /></el-icon>
41
- <el-icon><el-icon-minus /></el-icon>
42
- </span>
43
- {{ scope.row[column.value] }}
44
- </template>
45
- </el-table-column>
46
- <slot></slot>
47
- </el-table>
48
- </template>
49
-
50
- <script>
51
- import { Plus as ElIconPlus, Minus as ElIconMinus } from '@element-plus/icons-vue'
52
- /**
53
- Auth: Lei.j1ang
54
- Created: 2018/1/19-13:59
55
- */
56
- import treeToArray from './eval'
57
- export default {
58
- components: {
59
- ElIconPlus,
60
- ElIconMinus,
61
- },
62
- name: 'treeTable',
63
- props: {
64
- data: {
65
- type: [Array, Object],
66
- required: true,
67
- },
68
- columns: {
69
- type: Array,
70
- default: () => [],
71
- },
72
- evalFunc: Function,
73
- evalArgs: Array,
74
- expandAll: {
75
- type: Boolean,
76
- default: false,
77
- },
78
- },
79
- computed: {
80
- // 格式化数据源
81
- formatData: function () {
82
- let tmp
83
- if (!Array.isArray(this.data)) {
84
- tmp = [this.data]
85
- } else {
86
- tmp = this.data
87
- }
88
- const func = this.evalFunc || treeToArray
89
- const args = this.evalArgs
90
- ? Array.concat([tmp, this.expandAll], this.evalArgs)
91
- : [tmp, this.expandAll]
92
- return func.apply(null, args)
93
- },
94
- },
95
- methods: {
96
- showRow: function (row) {
97
- const show = row.row.parent
98
- ? row.row.parent._expanded && row.row.parent._show
99
- : true
100
- row.row._show = show
101
- return show
102
- ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;'
103
- : 'display:none;'
104
- },
105
- // 切换下级是否展开
106
- toggleExpanded: function (trIndex) {
107
- const record = this.formatData[trIndex]
108
- record._expanded = !record._expanded
109
- },
110
- // 图标显示
111
- iconShow(index, record) {
112
- return index === 0 && record.children && record.children.length > 0
113
- },
114
- },
115
- }
116
- </script>
117
-
118
- <style rel="stylesheet/css">
119
- @keyframes treeTableShow {
120
- from {
121
- opacity: 0;
122
- }
123
- to {
124
- opacity: 1;
125
- }
126
- }
127
- @-webkit-keyframes treeTableShow {
128
- from {
129
- opacity: 0;
130
- }
131
- to {
132
- opacity: 1;
133
- }
134
- }
135
- </style>
136
-
137
- <style lang="scss" rel="stylesheet/scss" scoped>
138
- $color-blue: #2196f3;
139
- $space-width: 8px;
140
- .ms-tree-space {
141
- position: relative;
142
- top: 1px;
143
- display: inline-block;
144
- font-style: normal;
145
- font-weight: 400;
146
- line-height: 1;
147
- width: $space-width;
148
- height: 14px;
149
- &::before {
150
- content: '';
151
- }
152
- }
153
- .processContainer {
154
- width: 100%;
155
- height: 100%;
156
- }
157
- table td {
158
- line-height: 26px;
159
- }
160
- .tree-ctrl {
161
- position: relative;
162
- cursor: pointer;
163
- color: $color-blue;
164
- margin-left: -$space-width;
165
- }
166
- .el-table {
167
- height: 100%;
168
- width: 100%;
169
- flex: 1;
170
- .el-table__body-wrapper {
171
- width: 100%;
172
- }
173
- .el-table__header-wrapper th {
174
- //列表标题
175
- background-color: #f6f6f6;
176
- }
177
-
178
- .el-table__fixed-header-wrapper th {
179
- //固定的列表标题
180
- background-color: #f6f6f6;
181
- }
182
- td,
183
- th {
184
- //列表标题及内容
185
- padding: 1px 0;
186
- }
187
- .cell,
188
- .el-table th div,
189
- .el-table--border th:first-child .cell,
190
- .el-table--border td:first-child .cell {
191
- //列表的margin
192
- padding-left: 5px !important;
193
- padding-right: 1px !important;
194
- padding-top: 1.5px !important;
195
- padding-bottom: 1.5px !important;
196
- }
197
- .el-table__empty-block {
198
- position: static;
199
- text-align: center;
200
- width: 100%;
201
- height: 80%;
202
- }
203
- .el-table__body {
204
- //列表下面加了空白
205
- margin-bottom: 10px;
206
- }
207
- .el-table__body-wrapper {
208
- height: 100%;
209
- overflow-y: auto;
210
- }
211
- .el-input__inner {
212
- height: 27px;
213
- margin-bottom: 0px;
214
- }
215
- .el-input,
216
- .el-form-item__content,
217
- .el-form-item__label,
218
- .el-input__icon {
219
- line-height: 30px;
220
- }
221
- .el-input__inner {
222
- padding: 5px;
223
- }
224
- .el-input--prefix .el-input__inner {
225
- //日期的有logo不一样
226
- padding-left: 30px;
227
- }
228
- }
229
- </style>
@@ -1,178 +0,0 @@
1
- <template>
2
- <el-dialog title="Excel上传" :visible.sync="visible" width="65%" top="10vh">
3
- <input
4
- id="excel-upload-input"
5
- ref="excel-upload-input"
6
- type="file"
7
- accept=".xlsx, .xls"
8
- class="c-hide"
9
- @change="handkeFileChange"
10
- />
11
- <div
12
- class="excelSel"
13
- @drop="handleDrop"
14
- @dragover="handleDragover"
15
- @dragenter="handleDragover"
16
- >
17
- {{ $t('Excel导入,需要以导出的Excel为模板') }}<br />
18
- {{ $t('Excel文件拖动到或点击按钮上传') }}
19
- <el-button
20
- style="margin-left: 16px"
21
- type="primary"
22
- @click="handleUpload"
23
- >{{ $t('浏览') }}</el-button
24
- >
25
- </div>
26
- <el-dialog
27
- title="sheet选择"
28
- :visible.sync="sheetVisible"
29
- width="55%"
30
- top="15vh"
31
- >
32
- <div style="margin: 10px">
33
- {{ $t('发现excel中存在多个sheet,请选择一个') }}
34
- </div>
35
- <el-radio-group v-model="selSheet">
36
- <el-radio
37
- v-for="(name, index) in allSheet"
38
- :label="name"
39
- :key="index"
40
- >{{ name }}</el-radio
41
- >
42
- </el-radio-group>
43
- <el-button style="margin-left: 16px" type="primary" @click="sheetSure">{{
44
- $t('确定')
45
- }}</el-button>
46
- </el-dialog>
47
- </el-dialog>
48
- </template>
49
-
50
- <script>
51
- import * as XLSX from 'xlsx'
52
-
53
- export default {
54
- data() {
55
- return {
56
- loading: false,
57
- excelData: {
58
- header: null,
59
- results: null,
60
- },
61
- visible: false,
62
- allSheet: [],
63
- selSheet: '',
64
- workbook: null,
65
- sheetVisible: false,
66
- }
67
- },
68
- methods: {
69
- show() {
70
- this.visible = true
71
- },
72
- generateDate({ header, results }) {
73
- this.excelData.header = header
74
- this.excelData.results = results
75
- this.$emit('on-selected-file', this.excelData)
76
- },
77
- handleDrop(e) {
78
- e.stopPropagation()
79
- e.preventDefault()
80
- const files = e.dataTransfer.files
81
- if (files.length !== 1) {
82
- this.$message.error(this.$t('只支持单文件!'))
83
- return
84
- }
85
- const itemFile = files[0] // only use files[0]
86
- this.readerData(itemFile)
87
- e.stopPropagation()
88
- e.preventDefault()
89
- },
90
- handleDragover(e) {
91
- e.stopPropagation()
92
- e.preventDefault()
93
- e.dataTransfer.dropEffect = 'copy'
94
- },
95
- handleUpload() {
96
- document.getElementById('excel-upload-input').click()
97
- },
98
- handkeFileChange(e) {
99
- const files = e.target.files
100
- const itemFile = files[0] // only use files[0]
101
- if (!itemFile) return
102
- this.readerData(itemFile)
103
- this.$refs['excel-upload-input'].value = null // fix can't select the same excel
104
- },
105
- readerData(itemFile) {
106
- const reader = new FileReader()
107
- reader.onload = (e) => {
108
- const data = e.target.result
109
- const fixedData = this.fixdata(data)
110
- this.workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
111
- this.allSheet = this.workbook.SheetNames
112
- this.selSheet = this.workbook.SheetNames[0]
113
- if (this.allSheet.length == 1) {
114
- this.sheetSure()
115
- } else {
116
- this.sheetVisible = true
117
- }
118
- }
119
- reader.readAsArrayBuffer(itemFile)
120
- },
121
- sheetSure() {
122
- // this.sheetVisible = false
123
- const worksheet = this.workbook.Sheets[this.selSheet]
124
- const header = this.get_header_row(worksheet)
125
- const results = XLSX.utils.sheet_to_json(worksheet)
126
- this.generateDate({ header, results })
127
- },
128
- fixdata(data) {
129
- let o = ''
130
- let l = 0
131
- const w = 10240
132
- for (; l < data.byteLength / w; ++l)
133
- o += String.fromCharCode.apply(
134
- null,
135
- new Uint8Array(data.slice(l * w, l * w + w))
136
- )
137
- o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
138
- return o
139
- },
140
- get_header_row(sheet) {
141
- const headers = []
142
- const range = XLSX.utils.decode_range(sheet['!ref'])
143
- let C
144
- const R = range.s.r
145
- /* start in the first row */
146
- for (C = range.s.c; C <= range.e.c; ++C) {
147
- /* walk every column in the range */
148
- var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
149
- /* find the cell in the first row */
150
- var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
151
- if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
152
- headers.push(hdr)
153
- }
154
- return headers
155
- },
156
- },
157
- }
158
- </script>
159
-
160
- <style scoped>
161
- #excel-upload-input {
162
- display: none;
163
- z-index: -9999;
164
- }
165
-
166
- .excelSel {
167
- border: 2px dashed #bbb;
168
- width: 600px;
169
- height: 160px;
170
- line-height: 80px;
171
- margin: 0 auto;
172
- font-size: 24px;
173
- border-radius: 5px;
174
- text-align: center;
175
- color: #bbb;
176
- position: relative;
177
- }
178
- </style>