hd-idevvue3 3.0.7 → 3.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.
Files changed (151) hide show
  1. package/dist/{static/js/index-DbUA6jg0.js → index.js} +1 -1
  2. package/package.json +7 -2
  3. package/.env.development +0 -5
  4. package/.env.production +0 -5
  5. package/.eslintrc.js +0 -151
  6. package/dist/static/js/index-Dl4O91nB.js +0 -73768
  7. package/index.html +0 -18
  8. package/pnpm-lock.yaml +0 -3541
  9. package/src/App.vue +0 -11
  10. package/src/assets/sound/notify.wav +0 -0
  11. package/src/demo/demo.vue +0 -42
  12. package/src/demo/dropdemo.vue +0 -42
  13. package/src/demo/extsets.vue +0 -208
  14. package/src/demo/formedit.vue +0 -157
  15. package/src/demo/hightquery.vue +0 -366
  16. package/src/demo/inlineedit.vue +0 -182
  17. package/src/demo/selfdrop.vue +0 -58
  18. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
  19. package/src/directive/el-dragDialog/drag.js +0 -124
  20. package/src/directive/el-dragDialog/index.js +0 -13
  21. package/src/errorLog.js +0 -16
  22. package/src/hdcom/BigGrid.js +0 -179
  23. package/src/hdcom/BillShow.vue +0 -111
  24. package/src/hdcom/BillUpload.vue +0 -311
  25. package/src/hdcom/BtnRight.vue +0 -101
  26. package/src/hdcom/ErrHint.vue +0 -42
  27. package/src/hdcom/ExtendColumn.vue +0 -115
  28. package/src/hdcom/ExtendCommon.js +0 -40
  29. package/src/hdcom/ExtendForm.vue +0 -141
  30. package/src/hdcom/FacePicUpload.vue +0 -80
  31. package/src/hdcom/FaceRecTest.vue +0 -114
  32. package/src/hdcom/GridChart.vue +0 -207
  33. package/src/hdcom/GridExField.vue +0 -375
  34. package/src/hdcom/GridShow.vue +0 -288
  35. package/src/hdcom/HdAside.vue +0 -225
  36. package/src/hdcom/HdBtn.vue +0 -125
  37. package/src/hdcom/HdButton.vue +0 -161
  38. package/src/hdcom/HdComFaceRec.vue +0 -106
  39. package/src/hdcom/HdComGrid.vue +0 -876
  40. package/src/hdcom/HdComQuery.vue +0 -362
  41. package/src/hdcom/HdComQueryDetail.vue +0 -205
  42. package/src/hdcom/HdComSortDetail.vue +0 -161
  43. package/src/hdcom/HdDatePicker.vue +0 -94
  44. package/src/hdcom/HdDialog.vue +0 -81
  45. package/src/hdcom/HdDrop.vue +0 -188
  46. package/src/hdcom/HdFileUpload.vue +0 -167
  47. package/src/hdcom/HdFilterBox.vue +0 -90
  48. package/src/hdcom/HdFooter.vue +0 -182
  49. package/src/hdcom/HdForm.vue +0 -351
  50. package/src/hdcom/HdFormBtn.vue +0 -131
  51. package/src/hdcom/HdFormItem.vue +0 -39
  52. package/src/hdcom/HdGctosGrid +0 -0
  53. package/src/hdcom/HdGrid.vue +0 -1022
  54. package/src/hdcom/HdGridEditBtn.vue +0 -58
  55. package/src/hdcom/HdGridExt.js +0 -250
  56. package/src/hdcom/HdGridSel.vue +0 -257
  57. package/src/hdcom/HdHeader.vue +0 -180
  58. package/src/hdcom/HdHotKey.vue +0 -84
  59. package/src/hdcom/HdInputHint.vue +0 -53
  60. package/src/hdcom/HdMain.vue +0 -41
  61. package/src/hdcom/HdMessage.vue +0 -201
  62. package/src/hdcom/HdNum.vue +0 -79
  63. package/src/hdcom/HdPopSel.vue +0 -80
  64. package/src/hdcom/HdRightMenu.vue +0 -63
  65. package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
  66. package/src/hdcom/HdTableColumn.vue +0 -381
  67. package/src/hdcom/HdTempSave.vue +0 -162
  68. package/src/hdcom/HdTree.vue +0 -103
  69. package/src/hdcom/HdTreeTable/eval.js +0 -39
  70. package/src/hdcom/HdTreeTable/index.vue +0 -229
  71. package/src/hdcom/ImportExcel.vue +0 -178
  72. package/src/hdcom/index.js +0 -75
  73. package/src/idev.common.js +0 -79
  74. package/src/index.js +0 -11
  75. package/src/utils/HdQuery.js +0 -65
  76. package/src/utils/comutils.js +0 -120
  77. package/src/utils/gogocodeTransfer.js +0 -59
  78. package/src/utils/utils.js +0 -116
  79. package/src/vendor/Blob.js +0 -187
  80. package/src/vendor/Export2Excel.js +0 -231
  81. package/src/vendor/Export2Zip.js +0 -25
  82. package/src/views/layout/AppMain.vue +0 -34
  83. package/src/views/layout/HdLayout.vue +0 -90
  84. package/src/views/layout/header/ElasticSearch.vue +0 -262
  85. package/src/views/layout/header/HZRecorder.js +0 -259
  86. package/src/views/layout/header/HeaderSearch.vue +0 -218
  87. package/src/views/layout/header/Levelbar.vue +0 -55
  88. package/src/views/layout/header/MainHeader.vue +0 -315
  89. package/src/views/layout/header/Navbar.vue +0 -101
  90. package/src/views/layout/header/ScrollPane.vue +0 -103
  91. package/src/views/layout/header/TagsView.vue +0 -215
  92. package/src/views/layout/header/VocRec.vue +0 -105
  93. package/src/views/layout/header/changepswform.vue +0 -130
  94. package/src/views/layout/index.js +0 -10
  95. package/src/views/layout/menu/Hamburger.vue +0 -63
  96. package/src/views/layout/menu/HdMenu.vue +0 -204
  97. package/src/views/layout/menu/css/menu.css +0 -288
  98. package/src/views/layout/menu/index.vue +0 -27
  99. package/src/views/privilege/commsg/commsg.vue +0 -152
  100. package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
  101. package/src/views/privilege/commsg/commsgRole.vue +0 -220
  102. package/src/views/privilege/commsg/commsgform.vue +0 -184
  103. package/src/views/privilege/commsg/commsgiframe.vue +0 -40
  104. package/src/views/privilege/commsg/commsgto.vue +0 -199
  105. package/src/views/privilege/commsg/commsgtoform.vue +0 -114
  106. package/src/views/privilege/commsg/commsgtrans.vue +0 -227
  107. package/src/views/privilege/exfield/comexcolumn.vue +0 -161
  108. package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
  109. package/src/views/privilege/exfield/comexfield.vue +0 -29
  110. package/src/views/privilege/exfield/comexfieldform.vue +0 -112
  111. package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
  112. package/src/views/privilege/index.js +0 -41
  113. package/src/views/privilege/menu/comMenu.vue +0 -49
  114. package/src/views/privilege/menu/menu.vue +0 -250
  115. package/src/views/privilege/menu/menuinfo.vue +0 -63
  116. package/src/views/privilege/menu/rolelist.vue +0 -92
  117. package/src/views/privilege/menu/userlist.vue +0 -92
  118. package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
  119. package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
  120. package/src/views/privilege/orgDept/authOrgn.vue +0 -188
  121. package/src/views/privilege/orgDept/authorgnform.vue +0 -157
  122. package/src/views/privilege/orgDept/orgDept.vue +0 -38
  123. package/src/views/privilege/orgDept/orgTree.vue +0 -99
  124. package/src/views/privilege/orgDept/orgnselect.vue +0 -155
  125. package/src/views/privilege/personDept/authuser.vue +0 -229
  126. package/src/views/privilege/personDept/authuserform.vue +0 -206
  127. package/src/views/privilege/personDept/facerec.vue +0 -162
  128. package/src/views/privilege/personDept/orgncascader.vue +0 -144
  129. package/src/views/privilege/personDept/personDept.vue +0 -33
  130. package/src/views/privilege/quartz/comquartzjob.vue +0 -150
  131. package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
  132. package/src/views/privilege/quartz/comquartzlog.vue +0 -143
  133. package/src/views/privilege/role/btnRole.vue +0 -173
  134. package/src/views/privilege/role/menuRole.vue +0 -84
  135. package/src/views/privilege/role/orgnRole.vue +0 -78
  136. package/src/views/privilege/role/role.vue +0 -84
  137. package/src/views/privilege/role/rolelist.vue +0 -136
  138. package/src/views/privilege/role/roleselect.vue +0 -74
  139. package/src/views/privilege/search/comsearch.vue +0 -196
  140. package/src/views/privilege/search/menu.vue +0 -68
  141. package/src/views/privilege/syscode/syscode.vue +0 -191
  142. package/src/views/privilege/syscode/sysfield.vue +0 -119
  143. package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
  144. package/src/views/privilege/syslog/menulog.vue +0 -68
  145. package/src/views/privilege/syslog/syslog.vue +0 -182
  146. package/src/views/privilege/syslog/syslogconfig.vue +0 -128
  147. package/src/views/privilege/syslog/syslogform.vue +0 -85
  148. package/src/views/privilege/syslog/syslogframe.vue +0 -26
  149. package/src/views/privilege/userRole/userRole.vue +0 -220
  150. package/vite.config.js +0 -124
  151. /package/dist/{static/css/index-DRHIlcVU.css → index.css} +0 -0
@@ -1,161 +0,0 @@
1
- <template>
2
- <el-container>
3
- <el-main class="gridShow" :title="title">
4
- <el-tag
5
- v-for="tag in list"
6
- :key="tag.text"
7
- closable
8
- :disable-transitions="false"
9
- @close="handleClose(tag)"
10
- >
11
- {{ tag.text }}
12
- </el-tag>
13
- <el-cascader
14
- v-model="inputValue"
15
- :placeholder="$t('请选择')"
16
- class="input-new-tag"
17
- ref="saveTagInput"
18
- v-if="inputVisible"
19
- @keyup.enter.native="handleInputConfirm"
20
- size="small"
21
- @change="(v) => change(v)"
22
- :options="sortOption"
23
- :props="{ expandTrigger: 'hover' }"
24
- >
25
- </el-cascader>
26
- <el-button v-else class="button-new-tag" size="small" @click="showInput"
27
- >+ New Tag</el-button
28
- >
29
- </el-main>
30
- </el-container>
31
- </template>
32
-
33
- <script>
34
- export default {
35
- name: 'HdComSortDetail',
36
- data() {
37
- return {
38
- inputVisible: false,
39
- inputValue: '',
40
- }
41
- },
42
- inheritAttrs: false,
43
- props: {
44
- allColumn: Array,
45
- list: Array,
46
- title: String,
47
- },
48
- mounted() {},
49
- methods: {
50
- handleClose(tag) {
51
- this.list.splice(this.list.indexOf(tag), 1)
52
- },
53
-
54
- showInput() {
55
- this.inputVisible = true
56
- this.$nextTick((_) => {
57
- this.$refs.saveTagInput.$refs.input.focus()
58
- })
59
- },
60
-
61
- change(val) {
62
- console.log('inputValue', val)
63
- let inputValue = this.inputValue
64
- if (inputValue) {
65
- let item = this.genItem(inputValue)
66
- this.list.forEach((v, i) => {
67
- if (v.sortProperty == item.sortProperty) {
68
- this.list.splice(i, 1)
69
- }
70
- })
71
- this.list.push(item)
72
- }
73
- console.log('list', this.list)
74
- this.inputVisible = false
75
- this.inputValue = ''
76
- // if (!val) { // clear触发
77
- // row.key = ''
78
- // // this.queryRel.value = ''
79
- // return false
80
- // }
81
- // row.selCol = val
82
- // row.key = val.$attrs.prop
83
- // // this.queryRel.value = ''//切换时先清
84
- // if (!row.selCol.input) {
85
- // return false
86
- // }
87
- //
88
- // row.type = ''// 默认字符串
89
- // if (typeof val.input != 'string') { // 自定义组件会传入function
90
- // return false
91
- // }
92
- // if (val.input.indexOf('date') >= 0 || val.input.indexOf('Date') >= 0) { // 日期格式
93
- // if (val.inputProp.type == 'date') {
94
- // row.type = 'date'
95
- // }
96
- // if (val.inputProp.type == 'datetime') {
97
- // row.type = 'datetime'
98
- // }
99
- // // row = val
100
- // }
101
- // if (val.input.indexOf('num') >= 0 || val.input.indexOf('Num') >= 0) { // 数字格式
102
- // row.type = 'number'
103
- // }
104
- },
105
- genItem(val) {
106
- return {
107
- sortProperty: val[0],
108
- sortType: val[1],
109
- alias: 'a',
110
- text:
111
- this.allColumn.find((v) => v.$attrs.prop == val[0]).$attrs.label +
112
- '/' +
113
- (val[1] == 'ASC' ? '升序' : '降序'),
114
- }
115
- },
116
- },
117
- computed: {
118
- sortOption() {
119
- let rtn = this.allColumn.map((v) => {
120
- return {
121
- value: v.$attrs.prop,
122
- label: v.$attrs.label,
123
- children: [
124
- {
125
- value: 'ASC',
126
- label: '升序',
127
- },
128
- {
129
- value: 'DESC',
130
- label: '降序',
131
- },
132
- ],
133
- }
134
- })
135
- return rtn
136
- },
137
- },
138
- }
139
- </script>
140
-
141
- <style lang="scss" rel="stylesheet/scss">
142
- .gridShow {
143
- .el-tag + .el-tag {
144
- margin-left: 10px;
145
- }
146
-
147
- .button-new-tag {
148
- margin-left: 10px;
149
- height: 32px;
150
- line-height: 30px;
151
- padding-top: 0;
152
- padding-bottom: 0;
153
- }
154
-
155
- .input-new-tag {
156
- width: 90px;
157
- margin-left: 10px;
158
- vertical-align: bottom;
159
- }
160
- }
161
- </style>
@@ -1,94 +0,0 @@
1
- <template>
2
- <ExDatePicker
3
- ref="exDatePicker"
4
- v-model="selVal"
5
- v-bind="$attrs"
6
- v-on="$listeners"
7
- :format="dateFormat"
8
- :valueFormat="$attrs.valueFormat || valueFormat"
9
- :placeholder="placeholder"
10
- @focus="dateFocus"
11
- @blur="dateBlur"
12
- :clearable="false"
13
- >
14
- </ExDatePicker>
15
- </template>
16
-
17
- <script>
18
- /**
19
- * 继承ElDatePicker ElementUi的日期以时间戳形式,这里改为字符串形式'yyyy-MM-dd HH:mm' 简化调用
20
- * @module HdDatePicker
21
- */
22
- export default {
23
- name: 'HdDatePicker',
24
- data() {
25
- return {
26
- format: '',
27
- valueFormat: '',
28
- placeholder: this.$t('选择日期'),
29
- dateFormat: '',
30
- focusValue: '',
31
- }
32
- },
33
- props: ['value'],
34
- inheritAttrs: false,
35
- created() {
36
- // 判断
37
- if (this.$attrs.type == 'date' || this.$attrs.type == 'daterange') {
38
- this.format = 'yyyy-MM-dd'
39
- this.valueFormat = 'yyyy-MM-dd'
40
- this.placeholder = this.$t('选择日期')
41
- } else if (
42
- this.$attrs.type == 'datetime' ||
43
- this.$attrs.type == 'datetimerange'
44
- ) {
45
- this.format = 'yyyy-MM-dd HH:mm'
46
- this.valueFormat = 'yyyy-MM-dd HH:mm'
47
- this.placeholder = this.$t('选择日期时间')
48
- } else if (this.$attrs.type == 'month') {
49
- this.format = 'yyyy-MM'
50
- this.valueFormat = 'yyyy-MM'
51
- this.placeholder = this.$t('选择月份')
52
- } else if (this.$attrs.type == 'year') {
53
- this.format = 'yyyy'
54
- this.valueFormat = 'yyyy'
55
- this.placeholder = this.$t('选择年份')
56
- } else {
57
- this.format = 'yyyy-MM-dd'
58
- this.valueFormat = 'yyyy-MM-dd'
59
- this.placeholder = this.$t('选择日期')
60
- }
61
- console.log('created', this.format, this.valueFormat)
62
- this.dateFormat = this.$attrs.format || this.format
63
- },
64
- methods: {
65
- dateFocus(v) {
66
- this.dateFormat = (this.$attrs.format || this.format).replaceAll(
67
- /(-|:|\s|y)/,
68
- ''
69
- )
70
- if (!this.value) {
71
- this.$set(this.$refs.exDatePicker, 'userInput', new Date().format('MM'))
72
- }
73
- },
74
- dateBlur() {
75
- this.dateFormat = this.$attrs.format || this.format
76
- },
77
- },
78
- computed: {
79
- // 给外层v-model赋值
80
- selVal: {
81
- // 动态计算selVal的值
82
- get: function () {
83
- console.log('调用了get属性')
84
- return this.value
85
- },
86
- set: function (val) {
87
- // v-model input
88
- console.log('调用了set属性', val)
89
- this.$emit('input', val)
90
- },
91
- },
92
- },
93
- }
94
- </script>
@@ -1,81 +0,0 @@
1
- <template>
2
- <ExDialog
3
- :fullscreen="fullscreen"
4
- v-el-drag-dialog
5
- v-bind="$attrs"
6
- v-on="$listeners"
7
- :close-on-click-modal="false"
8
- append-to-body
9
- v-if="$attrs.modal == null || $attrs.modal == true"
10
- :title="$t($attrs.title)"
11
- >
12
- <slot></slot>
13
- <div slot="footer">
14
- <slot name="footer"></slot>
15
- </div>
16
- </ExDialog>
17
- <ExDialog
18
- :fullscreen="fullscreen"
19
- v-el-drag-dialog
20
- v-bind="$attrs"
21
- v-on="$listeners"
22
- :close-on-click-modal="false"
23
- append-to-body
24
- class="wrapperChg"
25
- custom-class="dialogChg"
26
- v-else
27
- >
28
- <slot></slot>
29
- <div slot="footer">
30
- <slot name="footer"></slot>
31
- </div>
32
- </ExDialog>
33
- </template>
34
-
35
- <script>
36
- /**
37
- * 继承并重写ElDialog 使弹窗可拖动
38
- * 7.6实现 在modal=false时,可以点击底层内容
39
- * @module HdDialog
40
- */
41
- import elDragDialog from '../directive/el-dragDialog' // base on element-ui
42
- export default {
43
- name: 'HdDialog',
44
- directives: { elDragDialog },
45
- inheritAttrs: false,
46
- components: {},
47
- data() {
48
- return { nowFull: false }
49
- },
50
- mounted() {
51
- // $(".el-dialog").draggable({handle: '.el-dialog__header'});
52
- // $(".el-dialog__header").css("cursor", "move")
53
- },
54
- computed: {
55
- fullscreen() {
56
- if (this.nowFull) {
57
- return true
58
- }
59
-
60
- if (this.$attrs.fullscreen === '' || this.$attrs.fullscreen === true) {
61
- return true
62
- }
63
- },
64
- },
65
- }
66
- </script>
67
-
68
- <style lang="scss" rel="stylesheet/scss">
69
- .wrapperChg {
70
- //为了让弹窗底层的内容可以修改,在model:false时增加class
71
- position: static !important;
72
- z-index: 1;
73
- }
74
-
75
- .dialogChg {
76
- position: absolute !important;
77
- z-index: 1001;
78
- left: 0;
79
- right: 0;
80
- }
81
- </style>
@@ -1,188 +0,0 @@
1
- <template>
2
- <el-select
3
- v-model="selVal"
4
- filterable
5
- :clearable="clearable"
6
- :placeholder="placeholder ? $t(placeholder) : $t('请选择')"
7
- style="width: 100%"
8
- v-bind="$attrs"
9
- v-on="$listeners"
10
- @change="change"
11
- :filter-method="filterMe"
12
- @visible-change="visibleChange"
13
- >
14
- <el-option
15
- v-for="item in options"
16
- :key="item.codeId"
17
- :label="item.name"
18
- :value="item.code"
19
- >
20
- <!--item[myts]可以实现动态label-->
21
- <span style="float: left">{{ item.name }}</span>
22
- <span style="float: right; color: #8492a6; font-size: 13px">{{
23
- item.code
24
- }}</span>
25
- </el-option>
26
- </el-select>
27
- </template>
28
-
29
- <script>
30
- /**
31
- * 继承ElSelect属性和事件,syscode下的field只需要传入field,其它的需要传入url
32
- * @module HdDrop
33
- */
34
- export default {
35
- name: 'HdDrop',
36
- data() {
37
- return {
38
- options: [],
39
- backUpArr: [], // 备份
40
- }
41
- },
42
- /**
43
- * Props
44
- * @prop {String} value v-model双向绑定
45
- * @prop {String} field syscode时,传入下拉field
46
- * @prop {String} placeholder
47
- * @prop {String} url 不使用syscode下拉时指定url
48
- * @prop {String} txtVal 加.sync双向绑定 选择的label
49
- * @prop {Array} codeIn 有值时,只显示指定的code :codeIn="['A','S']"
50
- */
51
- props: {
52
- value: String,
53
- field: String,
54
- placeholder: String,
55
- name: String,
56
- url: String,
57
- txtVal: String,
58
- codeIn: Array,
59
- clearable: {
60
- type: Boolean,
61
- default: true,
62
- },
63
- }, // 设置value为props属性-必须,name.sync(不能用)和txtVal.sync双向
64
- inheritAttrs: false,
65
- mounted() {
66
- if (this.url || this.field) {
67
- this.doQuery()
68
- }
69
- },
70
- methods: {
71
- doQuery() {
72
- let quUrl = ''
73
- if (!this.url) {
74
- quUrl =
75
- '/webresources/login/privilege/SysCode/findAll?fieldCod=' + this.field
76
- } else {
77
- quUrl = this.url
78
- }
79
- this.$http.get(quUrl).then((response) => {
80
- this.options = response.data
81
- if (this.codeIn) {
82
- // 如果options的code和codeIn相同,就显示
83
- this.options = this.options.filter((item) => {
84
- return this.codeIn.find((v) => v == item.code)
85
- })
86
- }
87
- this.backUpArr = this.options
88
- })
89
- },
90
- change(val) {
91
- this.upName(val)
92
- //this.$emit('change', val) 不用写,el-select会传递到上层
93
- },
94
- visibleChange(val) {
95
- // 下拉隐藏时还原
96
- if (!val) {
97
- // 隐藏时
98
- this.options = this.backUpArr
99
- }
100
- },
101
- filterMe(val) {
102
- // 过滤 根据name code
103
- if (val) {
104
- // val存在
105
- this.options = this.backUpArr.filter((item) => {
106
- if (item.code.indexOf(val) >= 0 || item.name.indexOf(val) >= 0) {
107
- return true
108
- }
109
- })
110
- } else {
111
- // val为空时,还原数组
112
- this.options = this.backUpArr
113
- }
114
- },
115
- upName(value) {
116
- if (!value) {
117
- this.$emit('update:name', null) // 匹配不上
118
- }
119
- for (let i = 0; i < this.options.length; i++) {
120
- if (this.options[i].code == value) {
121
- const obj = this.options[i]
122
- this.$emit('update:name', obj.name) // 用txtVal
123
- this.$emit('update:txtVal', obj.name)
124
- return true
125
- }
126
- }
127
- },
128
- },
129
- watch: {
130
- // // 针对编辑时,不改变 hddrop里的内容
131
- // val: function (value) {
132
- // for (let i = 0; i < this.options.length; i++) {
133
- // if (this.options[i].code == value) {
134
- // let obj = this.options[i]
135
- // this.$emit('update:name', obj.name)
136
- // return true
137
- // }
138
- // }
139
- // },
140
- // //针对增加编辑时,改变了hddrop里的值
141
- // value: function (value) {
142
- // for (let i = 0; i < this.options.length; i++) {
143
- // if (this.options[i].code == value) {
144
- // let obj = this.options[i]
145
- // this.$emit('update:name', obj.name)
146
- // return true
147
- // }
148
- // }
149
- // }
150
- url: function () {
151
- this.doQuery()
152
- },
153
- field: function () {
154
- this.doQuery()
155
- },
156
- codeIn: {
157
- handler(newValue, oldValue) {
158
- // codeIn改变时计算
159
- for (let i = 0; i < newValue.length; i++) {
160
- if (newValue[i] != oldValue[i]) {
161
- this.doQuery()
162
- return true
163
- }
164
- }
165
- },
166
- deep: true,
167
- },
168
- },
169
- computed: {
170
- // 给外层v-model赋值
171
- selVal: {
172
- // 动态计算selVal的值
173
- get: function () {
174
- if (!this.value) {
175
- // filterMe在null时不触发,''就没问题
176
- return ''
177
- }
178
- return this.value
179
- },
180
- set: function (val) {
181
- // v-model input
182
- // upName(val)//更新name
183
- this.$emit('input', val)
184
- },
185
- },
186
- },
187
- }
188
- </script>
@@ -1,167 +0,0 @@
1
- <template>
2
- <el-dialog
3
- :visible.sync="fileUploadVisible"
4
- append-to-body
5
- title="文件上传"
6
- width="450px"
7
- >
8
- <el-alert
9
- :closable="false"
10
- :title="$t('点击文件即可下载')"
11
- type="warning"
12
- ></el-alert>
13
- <el-upload
14
- :action="upUrl"
15
- :auto-upload="false"
16
- :before-remove="beforeRemove"
17
- :before-upload="beforeUpload"
18
- :file-list="fileList"
19
- :multiple="multiple"
20
- :on-preview="handlePreview"
21
- :on-remove="handleRemove"
22
- :on-success="onUpSuccess"
23
- ref="upload"
24
- style="min-height: 300px; width: 400px"
25
- v-bind="$attrs"
26
- >
27
- <el-button slot="trigger" type="primary" v-if="canEdit">{{
28
- $t('选取文件')
29
- }}</el-button>
30
- <el-button
31
- @click="submitUpload"
32
- style="margin-left: 10px"
33
- type="success"
34
- v-if="canEdit"
35
- >{{ $t('上传到服务器') }}
36
- </el-button>
37
- <div class="el-upload__tip" slot="tip"></div>
38
- </el-upload>
39
- </el-dialog>
40
- </template>
41
-
42
- <script>
43
- var FileSaver = require('file-saver')
44
- /**
45
- * 文件上传 包括上传和下载后台idev8入口为comfileupload
46
- * @module HdFileUpload
47
- */
48
-
49
- export default {
50
- components: {},
51
- name: 'HdFileUpload',
52
- /**
53
- * @prop 参考element-ui的el-upload
54
- * */
55
- props: {
56
- url: {
57
- type: String,
58
- default: '/webresources/login/com/SysFile/comfileupload',
59
- },
60
- },
61
- inheritAttrs: false,
62
- data() {
63
- return {
64
- upUrl: '',
65
- fileUploadVisible: false,
66
- fileDownVisible: false,
67
- fileList: [],
68
- entityId: '',
69
- entityName: '',
70
- canEdit: true,
71
- uploadNum: 0,
72
- }
73
- },
74
- mounted() {},
75
- methods: {
76
- beforeUpload(file) {
77
- this.uploadNum++
78
- },
79
- /**
80
- * @method open
81
- * @param entityName 区分名
82
- * @param entityId 区分id
83
- * @param canEdit 是否可编辑
84
- * @event complete 文件全部上传完结束的事件
85
- */
86
- open(entityName, entityId, canEdit) {
87
- this.entityId = entityId
88
- this.entityName = entityName
89
- this.fileUploadVisible = true
90
- this.canEdit = canEdit
91
- this.upUrl = `${this.url}/upload?entityId=${this.entityId}&entityName=${this.entityName}`
92
- this.doQuery()
93
- },
94
- downShow() {
95
- this.fileDownVisible = true
96
- },
97
- doQuery() {
98
- const url = `${this.url}/find?entityId=${this.entityId}&entityName=${this.entityName}`
99
- this.$http.post(url).then((response) => {
100
- const fileLs = response.data
101
- this.fileList = []
102
- for (let i = 0; i < fileLs.length; i++) {
103
- const fileOne = fileLs[i]
104
- const oneObj = {}
105
- oneObj.name = fileOne.fileName
106
- oneObj.uploadId = fileOne.uploadId
107
- this.fileList.push(oneObj)
108
- }
109
- })
110
- },
111
- submitUpload() {
112
- this.$refs.upload.submit()
113
- },
114
- onUpSuccess(response, file, fileList) {
115
- this.uploadNum--
116
- if (this.uploadNum == 0) {
117
- this.$emit('complete')
118
- }
119
- file.uploadId = response.message
120
- },
121
- beforeRemove(file, fileList) {
122
- if (!this.canEdit) {
123
- this.$message({
124
- type: 'error',
125
- message: this.$t('无权删除'),
126
- })
127
- return false
128
- }
129
- return this.$confirm(this.$t('确定删除') + file.name + '?').then(() => {
130
- if (!file.uploadId) {
131
- return true
132
- }
133
- this.$http
134
- .post(`${this.url}/delete?uploadId=${file.uploadId}`)
135
- .then((response) => {
136
- const data = response.data
137
- this.$message({
138
- type: data.code == '-1' ? 'error' : 'success',
139
- message: this.$t('操作成功'),
140
- })
141
- if (data.code == '-1') {
142
- return false
143
- }
144
- // this.doQuery()
145
- })
146
- })
147
- },
148
- handleRemove(file, fileList) {},
149
- handlePreview(file) {
150
- if (!file.uploadId) {
151
- this.$message({
152
- type: 'error',
153
- message: this.$t('这是未上传的文件'),
154
- })
155
- return false
156
- }
157
- const url = `${this.url}/download?uploadId=${file.uploadId}`
158
- this.$http
159
- .post(url, {}, { responseType: 'arraybuffer' })
160
- .then((response) => {
161
- var blob = new Blob([response.data])
162
- FileSaver.saveAs(blob, file.name)
163
- })
164
- },
165
- },
166
- }
167
- </script>