eoss-ui 0.8.28 → 0.8.30

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 (184) hide show
  1. package/lib/archives.js +1128 -0
  2. package/lib/button-group.js +158 -129
  3. package/lib/button.js +158 -129
  4. package/lib/calendar.js +2 -2
  5. package/lib/calogin.js +227 -214
  6. package/lib/card.js +2 -2
  7. package/lib/cascader.js +2 -2
  8. package/lib/checkbox-group.js +162 -131
  9. package/lib/clients.js +2 -2
  10. package/lib/config/api.js +28 -1
  11. package/lib/data-table-form.js +161 -131
  12. package/lib/data-table.js +164 -134
  13. package/lib/date-picker.js +158 -129
  14. package/lib/dialog.js +158 -129
  15. package/lib/enable-drag.js +2 -2
  16. package/lib/enterprise.js +2 -2
  17. package/lib/eoss-ui.common.js +774 -326
  18. package/lib/error-page.js +2 -2
  19. package/lib/flow-group.js +158 -129
  20. package/lib/flow-list.js +264 -235
  21. package/lib/flow.js +301 -265
  22. package/lib/form.js +161 -131
  23. package/lib/handle-user.js +159 -130
  24. package/lib/handler.js +166 -137
  25. package/lib/icon.js +166 -137
  26. package/lib/icons.js +4 -4
  27. package/lib/index.js +1 -1
  28. package/lib/input-number.js +158 -129
  29. package/lib/input.js +158 -129
  30. package/lib/label.js +2 -2
  31. package/lib/layout.js +2 -2
  32. package/lib/login.js +165 -135
  33. package/lib/main.js +234 -204
  34. package/lib/menu.js +2 -2
  35. package/lib/nav.js +158 -129
  36. package/lib/notify.js +161 -132
  37. package/lib/page.js +158 -129
  38. package/lib/pagination.js +158 -129
  39. package/lib/player.js +162 -133
  40. package/lib/qr-code.js +160 -131
  41. package/lib/radio-group.js +160 -131
  42. package/lib/retrial-auth.js +168 -139
  43. package/lib/select-ganged.js +167 -138
  44. package/lib/select.js +160 -131
  45. package/lib/selector-panel.js +180 -150
  46. package/lib/selector.js +169 -140
  47. package/lib/sizer.js +160 -131
  48. package/lib/steps.js +158 -129
  49. package/lib/switch.js +165 -136
  50. package/lib/table-form.js +158 -129
  51. package/lib/tabs-panel.js +2 -2
  52. package/lib/tabs.js +158 -129
  53. package/lib/theme-chalk/archives.css +1 -0
  54. package/lib/theme-chalk/base.css +1 -1
  55. package/lib/theme-chalk/calendar.css +1 -1
  56. package/lib/theme-chalk/card.css +1 -1
  57. package/lib/theme-chalk/data-table-form.css +1 -1
  58. package/lib/theme-chalk/form.css +1 -1
  59. package/lib/theme-chalk/handler.css +1 -1
  60. package/lib/theme-chalk/icon.css +1 -1
  61. package/lib/theme-chalk/icons.css +1 -1
  62. package/lib/theme-chalk/index.css +1 -1
  63. package/lib/theme-chalk/label.css +1 -1
  64. package/lib/theme-chalk/login.css +1 -1
  65. package/lib/theme-chalk/main.css +1 -1
  66. package/lib/theme-chalk/menu.css +1 -1
  67. package/lib/theme-chalk/selector-panel.css +1 -1
  68. package/lib/theme-chalk/simplicity-top.css +1 -1
  69. package/lib/theme-chalk/simplicity.css +1 -1
  70. package/lib/theme-chalk/sizer.css +1 -1
  71. package/lib/theme-chalk/steps.css +1 -1
  72. package/lib/theme-chalk/tree.css +1 -1
  73. package/lib/theme-chalk/upload.css +1 -1
  74. package/lib/tips.js +159 -130
  75. package/lib/toolbar.js +2 -2
  76. package/lib/tree-group.js +158 -129
  77. package/lib/tree.js +159 -130
  78. package/lib/upload.js +188 -154
  79. package/lib/wujie.js +165 -136
  80. package/lib/wxlogin.js +165 -136
  81. package/package.json +3 -3
  82. package/packages/archives/index.js +5 -0
  83. package/packages/archives/src/main.vue +344 -0
  84. package/packages/button-group/src/main.vue +346 -346
  85. package/packages/calogin/src/main.vue +412 -412
  86. package/packages/clients/src/main.vue +151 -151
  87. package/packages/flow/src/component/CommonOpinions.vue +376 -376
  88. package/packages/flow/src/component/FileList.vue +97 -97
  89. package/packages/flow/src/component/SendMsg.vue +242 -242
  90. package/packages/flow/src/component/SortFlow.vue +110 -110
  91. package/packages/flow/src/form.vue +123 -123
  92. package/packages/flow/src/main.vue +10 -7
  93. package/packages/flow/src/table.vue +58 -58
  94. package/packages/flow-list/src/main.vue +2337 -2337
  95. package/packages/form/src/table.vue +1512 -1512
  96. package/packages/icon/src/main.vue +104 -104
  97. package/packages/login/src/resetPassword.vue +557 -557
  98. package/packages/main/src/public/online.vue +89 -89
  99. package/packages/main/src/public/search.vue +464 -464
  100. package/packages/main/src/public/settings.vue +273 -273
  101. package/packages/main/src/simplicity/apps.vue +388 -388
  102. package/packages/main/src/simplicity/avatar.vue +82 -82
  103. package/packages/main/src/simplicity/handler.vue +158 -158
  104. package/packages/main/src/simplicity/menu-list.vue +135 -135
  105. package/packages/main/src/simplicity/message.vue +293 -293
  106. package/packages/main/src/simplicity/notice.vue +222 -222
  107. package/packages/main/src/simplicity/sub-menu.vue +276 -276
  108. package/packages/main/src/simplicity/user.vue +259 -259
  109. package/packages/main/src/simplicityTop/apps.vue +388 -388
  110. package/packages/main/src/simplicityTop/avatar.vue +82 -82
  111. package/packages/main/src/simplicityTop/handler.vue +215 -215
  112. package/packages/main/src/simplicityTop/lists.vue +84 -84
  113. package/packages/main/src/simplicityTop/menu-list.vue +135 -135
  114. package/packages/main/src/simplicityTop/message.vue +293 -293
  115. package/packages/main/src/simplicityTop/notice.vue +222 -222
  116. package/packages/main/src/simplicityTop/router-page.vue +45 -45
  117. package/packages/main/src/simplicityTop/sub-menu.vue +274 -274
  118. package/packages/main/src/simplicityTop/user.vue +259 -259
  119. package/packages/nav/src/main.vue +351 -351
  120. package/packages/selector/src/main.vue +761 -761
  121. package/packages/selector-panel/src/main.vue +1036 -1036
  122. package/packages/selector-panel/src/selection.vue +174 -174
  123. package/packages/switch/src/main.vue +170 -170
  124. package/packages/theme-chalk/lib/archives.css +1 -0
  125. package/packages/theme-chalk/lib/base.css +1 -1
  126. package/packages/theme-chalk/lib/calendar.css +1 -1
  127. package/packages/theme-chalk/lib/card.css +1 -1
  128. package/packages/theme-chalk/lib/data-table-form.css +1 -1
  129. package/packages/theme-chalk/lib/form.css +1 -1
  130. package/packages/theme-chalk/lib/handler.css +1 -1
  131. package/packages/theme-chalk/lib/icon.css +1 -1
  132. package/packages/theme-chalk/lib/icons.css +1 -1
  133. package/packages/theme-chalk/lib/index.css +1 -1
  134. package/packages/theme-chalk/lib/label.css +1 -1
  135. package/packages/theme-chalk/lib/login.css +1 -1
  136. package/packages/theme-chalk/lib/main.css +1 -1
  137. package/packages/theme-chalk/lib/menu.css +1 -1
  138. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  139. package/packages/theme-chalk/lib/simplicity-top.css +1 -1
  140. package/packages/theme-chalk/lib/simplicity.css +1 -1
  141. package/packages/theme-chalk/lib/sizer.css +1 -1
  142. package/packages/theme-chalk/lib/steps.css +1 -1
  143. package/packages/theme-chalk/lib/tree.css +1 -1
  144. package/packages/theme-chalk/lib/upload.css +1 -1
  145. package/packages/theme-chalk/src/archives.scss +33 -0
  146. package/packages/theme-chalk/src/data-table.scss +297 -297
  147. package/packages/theme-chalk/src/flow-list.scss +55 -55
  148. package/packages/theme-chalk/src/handler.scss +148 -148
  149. package/packages/theme-chalk/src/icon.scss +3452 -3452
  150. package/packages/theme-chalk/src/index.scss +1 -0
  151. package/packages/theme-chalk/src/login.scss +1006 -1006
  152. package/packages/theme-chalk/src/main.scss +664 -664
  153. package/packages/theme-chalk/src/menu.scss +224 -224
  154. package/packages/theme-chalk/src/selector.scss +114 -114
  155. package/packages/theme-chalk/src/simplicity-top.scss +1845 -1845
  156. package/packages/theme-chalk/src/simplicity.scss +1403 -1403
  157. package/packages/theme-chalk/src/upload.scss +172 -172
  158. package/packages/tips/src/main.vue +141 -141
  159. package/packages/upload/src/main.vue +14 -5
  160. package/packages/wujie/src/main.vue +146 -146
  161. package/src/config/api.js +27 -0
  162. package/src/index.js +166 -163
  163. package/src/utils/rules.js +18 -18
  164. package/packages/.DS_Store +0 -0
  165. package/packages/calogin/.DS_Store +0 -0
  166. package/packages/date-picker/.DS_Store +0 -0
  167. package/packages/date-picker/src/.DS_Store +0 -0
  168. package/packages/dialog/.DS_Store +0 -0
  169. package/packages/flow/.DS_Store +0 -0
  170. package/packages/flow/src/.DS_Store +0 -0
  171. package/packages/flow-list/.DS_Store +0 -0
  172. package/packages/form/.DS_Store +0 -0
  173. package/packages/icon/.DS_Store +0 -0
  174. package/packages/login/.DS_Store +0 -0
  175. package/packages/main/.DS_Store +0 -0
  176. package/packages/main/src/.DS_Store +0 -0
  177. package/packages/menu/.DS_Store +0 -0
  178. package/packages/select/.DS_Store +0 -0
  179. package/packages/selector/.DS_Store +0 -0
  180. package/packages/selector-panel/.DS_Store +0 -0
  181. package/packages/theme-chalk/src/.DS_Store +0 -0
  182. package/packages/upload/.DS_Store +0 -0
  183. package/src/.DS_Store +0 -0
  184. package/src/utils/.DS_Store +0 -0
@@ -0,0 +1,344 @@
1
+ <template>
2
+ <div class="es-archives" @click="addOrEditDocument">
3
+ <!-- <div class="icon">
4
+ <img src="@/assets/image/officialDocument/icon_zhengwen.png" alt="" />
5
+ </div> -->
6
+ <span>{{ propsDocumentTitle }}</span>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ import { docHubApi, documentCode } from 'eoss-ui/src/config/api.js';
11
+ import bus from 'eoss-ui/src/utils/bus';
12
+ export default {
13
+ name: 'EsArchives',
14
+ inheritAttrs: false,
15
+
16
+ props: {
17
+ isDispatch: {
18
+ type: Boolean,
19
+ default: true
20
+ },
21
+ businessTitle: {
22
+ type: String,
23
+ default: ''
24
+ },
25
+ documentId: {
26
+ type: String,
27
+ default: ''
28
+ },
29
+ businessId: {
30
+ type: String,
31
+ default: ''
32
+ },
33
+ documentParams: {
34
+ type: Object,
35
+ default: () => {
36
+ return {
37
+ cmd: 'New',
38
+ redFileElementOption: {}
39
+ };
40
+ }
41
+ },
42
+ readonly: {
43
+ default: false
44
+ },
45
+ pageType: {
46
+ type: Number,
47
+ default: 0
48
+ },
49
+ documentTitle: {
50
+ type: String,
51
+ default: '新增正文'
52
+ },
53
+ code: {
54
+ type: String,
55
+ default: ''
56
+ }
57
+ },
58
+ data() {
59
+ return {
60
+ fileInput: null,
61
+ textInfo: [],
62
+ contentFileId: this.documentId,
63
+ propsDocumentTitle: this.documentTitle,
64
+ onlineType: this.documentParams.cmd,
65
+ dochubBoot: null
66
+ };
67
+ },
68
+ watch: {
69
+ documentTitle: {
70
+ deep: true,
71
+ handler(val) {
72
+ console.log('this.textInfo', this.textInfo);
73
+ if (this.textInfo.length > 0) {
74
+ this.propsDocumentTitle = val;
75
+ } else {
76
+ this.propsDocumentTitle = '新增正文';
77
+ }
78
+ }
79
+ }
80
+ },
81
+ mounted() {
82
+ if (this.pageType != 0) {
83
+ this.getDucumentInfo();
84
+ }
85
+ this.initFileInput();
86
+ // 默认加载脚本并初始化 dochubBoot
87
+ this.initDochubBoot();
88
+ this.pubLoadJS('/dochub-ui/js/dochub.js', () => {
89
+ this.pubLoadJS('/dochub-ui/js/link/notify.js', () => {
90
+ this.initDochubNotify(documentCode.dispatchAcc, 'archivesFile');
91
+ this.initDochubNotify(documentCode.dispatchOnlyAcc, 'sendFile');
92
+ });
93
+ });
94
+ // 监听事件
95
+ bus.$on('callBootCommit', (callback) => {
96
+ console.log('callBootCommit,bus.on');
97
+ this.callBootCommit(callback);
98
+ });
99
+ },
100
+ methods: {
101
+ pubLoadJS: function (url, callback) {
102
+ var script = document.createElement('script'),
103
+ fn = callback || function () {};
104
+ script.type = 'text/javascript';
105
+ //IE
106
+ if (script.readyState) {
107
+ script.onreadystatechange = function () {
108
+ if (
109
+ script.readyState == 'loaded' ||
110
+ script.readyState == 'complete'
111
+ ) {
112
+ script.onreadystatechange = null;
113
+ fn();
114
+ }
115
+ };
116
+ } else {
117
+ //其他浏览器
118
+ script.onload = function () {
119
+ fn();
120
+ };
121
+ }
122
+ script.src = url;
123
+ document.getElementsByTagName('head')[0].appendChild(script);
124
+ },
125
+ getDucumentInfo() {
126
+ this.$.ajax({
127
+ url: docHubApi.queryDocument,
128
+ params: {
129
+ documentId: this.documentId
130
+ }
131
+ }).then((res) => {
132
+ console.log('res', res);
133
+ if (res.rCode == 0) {
134
+ if (res.results) {
135
+ this.textInfo = [res.results.documentFile];
136
+ } else {
137
+ this.$message({
138
+ type: 'error',
139
+ message: '未找到该正文信息,请重新上传!'
140
+ });
141
+ this.propsDocumentTitle = '新增正文';
142
+ }
143
+ }
144
+ });
145
+ },
146
+ // 新增方法,用于让外部组件调用 boot.commit()
147
+ callBootCommit(callback) {
148
+ console.log('callBootCommit,methods');
149
+ if (this.dochubBoot) {
150
+ try {
151
+ return this.dochubBoot.commit(callback);
152
+ // return true;
153
+ } catch (e) {
154
+ return true;
155
+ }
156
+ }
157
+ },
158
+ // 抽取公共初始化方法
159
+ initDochubBoot(openAfterInit = false) {
160
+ const _this = this;
161
+ this.pubLoadJS('/dochub-ui/upload/dochubDocumentBoot.js', function () {
162
+ _this.dochubBoot = new DochubDocumentBoot(
163
+ {
164
+ openMode: 'docHub',
165
+ businessId: _this.businessId,
166
+ bucketCode: documentCode.archivesDocument,
167
+ documentId: _this.contentFileId,
168
+ docHubCode: _this.code,
169
+ businessTitle: _this.businessTitle,
170
+ cmd: _this.onlineType,
171
+ action: _this.documentParams.action,
172
+ adjunctId: _this.businessId,
173
+ // 红头参数
174
+ redFileElementOption: _this.documentParams.redFileElementOption,
175
+ updateDocumentCallback: function (data) {
176
+ console.log('initDochubData', data);
177
+ _this.textInfo = [data.document.documentFile];
178
+ if (
179
+ _this.documentTitle != '套红' &&
180
+ _this.documentTitle != '用印'
181
+ ) {
182
+ _this.propsDocumentTitle = '编辑正文';
183
+ }
184
+ _this.contentFileId = data.document
185
+ ? data.document.docTagId
186
+ : data.docTagId;
187
+ _this.$emit('updateDocument', _this.contentFileId);
188
+ _this.onlineType = 'Edit';
189
+ }
190
+ },
191
+ openAfterInit ? () => _this.dochubBoot.open() : null
192
+ );
193
+ });
194
+ },
195
+ // 抽取通知初始化方法
196
+ initDochubNotify(bucketCode, type) {
197
+ const notify = new window.DochubNotify({
198
+ notifyCode: 'dochubDocumentBoot',
199
+ bucketCode: bucketCode,
200
+ businessId: this.businessId
201
+ });
202
+ notify.events.documentListChanged.received = (data) => {
203
+ console.log(bucketCode + '附件上传回调事件 ', data);
204
+ this.$emit('updateAttachment', { type: type });
205
+ };
206
+ return notify;
207
+ },
208
+ // 初始化文件输入框
209
+ initFileInput() {
210
+ this.$.ajax({
211
+ url: docHubApi.getDocumentProperties,
212
+ params: { code: documentCode.archivesDocument }
213
+ }).then((res) => {
214
+ if (res.rCode == 0) {
215
+ this.fileInput.accept = res.results.fileTypeExtName.replace(
216
+ /;/g,
217
+ ','
218
+ );
219
+ }
220
+ });
221
+ // 检查是否已存在文件输入框
222
+ if (!this.fileInput) {
223
+ this.fileInput = document.createElement('input');
224
+ this.fileInput.type = 'file';
225
+ // this.fileInput.accept = '.doc,.docx,.pdf,.ofd'; // 限制文件类型
226
+ this.fileInput.style.display = 'none';
227
+
228
+ // 监听文件选择事件
229
+ this.fileInput.addEventListener('change', (e) => {
230
+ const file = e.target.files[0];
231
+ if (file) {
232
+ this.handleFileUpload(file);
233
+ }
234
+ // 重置输入框,以便能重复选择同一个文件
235
+ this.fileInput.value = '';
236
+ });
237
+
238
+ // 添加到文档中
239
+ document.body.appendChild(this.fileInput);
240
+ }
241
+ },
242
+ // 处理文件上传
243
+ handleFileUpload(file) {
244
+ // 显示加载状态
245
+ this.$loading({ text: '文件上传中...' });
246
+
247
+ const formData = new FormData();
248
+ formData.append('file', file);
249
+ formData.append('businessId', this.businessId);
250
+ formData.append('bucketCode', documentCode.archivesDocument);
251
+
252
+ // 使用原生fetch API上传文件
253
+ fetch(docHubApi.uploadDocument, {
254
+ method: 'POST',
255
+ body: formData,
256
+ credentials: 'include' // 包含cookies
257
+ })
258
+ .then((response) => response.json())
259
+ .then((res) => {
260
+ this.$loading().close();
261
+ if (res.rCode == 0 && res.results) {
262
+ // 更新文件信息
263
+ const fileInfo = res.results.documentFile || res.results;
264
+ this.textInfo = [fileInfo];
265
+ this.contentFileId = res.results.docTagId;
266
+ this.propsDocumentTitle = '编辑正文';
267
+ this.$emit(
268
+ 'uploadDocument',
269
+ fileInfo.docName.replace(/\.[^/.]+$/, ''),
270
+ res.results.docTagId
271
+ );
272
+ this.initDochubBoot();
273
+ this.onlineType = 'Edit';
274
+ this.initDochubBoot();
275
+ if (fileInfo.warningWordMsg) {
276
+ this.$alert(fileInfo.warningWordMsg);
277
+ } else {
278
+ this.$message({
279
+ type: 'success',
280
+ message: '文件上传成功!'
281
+ });
282
+ }
283
+ } else {
284
+ this.$message({
285
+ type: 'error',
286
+ message: res.msg || '文件上传失败!'
287
+ });
288
+ }
289
+ })
290
+ .catch((error) => {
291
+ this.$loading().close();
292
+ console.error('文件上传错误:', error);
293
+ this.$message({
294
+ type: 'error',
295
+ message: '文件上传过程中发生错误!'
296
+ });
297
+ });
298
+ },
299
+ addOrEditDocument() {
300
+ if (this.textInfo.length > 0) {
301
+ this.documentClick();
302
+ } else {
303
+ this.uploadDocument();
304
+ }
305
+ },
306
+ // 修改uploadDocument方法,使用原生文件上传
307
+ uploadDocument() {
308
+ // 触发文件选择对话框
309
+ if (this.fileInput) {
310
+ this.fileInput.click();
311
+ } else {
312
+ // 如果文件输入框未初始化,先初始化再触发
313
+ this.initFileInput();
314
+ setTimeout(() => {
315
+ if (this.fileInput) {
316
+ this.fileInput.click();
317
+ }
318
+ }, 100);
319
+ }
320
+ },
321
+ // 正文点击事件
322
+ documentClick() {
323
+ if (
324
+ this.propsDocumentTitle === '套红' ||
325
+ this.propsDocumentTitle === '用印'
326
+ ) {
327
+ this.$emit('validateDocument', (isValid) => {
328
+ if (isValid) {
329
+ this.$nextTick(() => {
330
+ if (this.isDispatch) {
331
+ this.saveArchiveForm();
332
+ } else {
333
+ this.initDochubBoot(true);
334
+ }
335
+ });
336
+ }
337
+ });
338
+ } else {
339
+ this.initDochubBoot(true);
340
+ }
341
+ }
342
+ }
343
+ };
344
+ </script>