eoss-ui 0.8.29 → 0.8.31

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 (118) 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 +12590 -4233
  18. package/lib/error-page.js +2 -2
  19. package/lib/flow-group.js +158 -129
  20. package/lib/flow-list.js +168 -139
  21. package/lib/flow.js +12157 -4212
  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 +229 -199
  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/flow.css +1 -1
  59. package/lib/theme-chalk/form.css +1 -1
  60. package/lib/theme-chalk/handler.css +1 -1
  61. package/lib/theme-chalk/icon.css +1 -1
  62. package/lib/theme-chalk/icons.css +1 -1
  63. package/lib/theme-chalk/index.css +1 -1
  64. package/lib/theme-chalk/label.css +1 -1
  65. package/lib/theme-chalk/login.css +1 -1
  66. package/lib/theme-chalk/main.css +1 -1
  67. package/lib/theme-chalk/menu.css +1 -1
  68. package/lib/theme-chalk/selector-panel.css +1 -1
  69. package/lib/theme-chalk/simplicity-top.css +1 -1
  70. package/lib/theme-chalk/simplicity.css +1 -1
  71. package/lib/theme-chalk/sizer.css +1 -1
  72. package/lib/theme-chalk/steps.css +1 -1
  73. package/lib/theme-chalk/tree.css +1 -1
  74. package/lib/theme-chalk/upload.css +1 -1
  75. package/lib/tips.js +159 -130
  76. package/lib/toolbar.js +2 -2
  77. package/lib/tree-group.js +158 -129
  78. package/lib/tree.js +159 -130
  79. package/lib/upload.js +188 -154
  80. package/lib/wujie.js +165 -136
  81. package/lib/wxlogin.js +165 -136
  82. package/package.json +1 -1
  83. package/packages/archives/index.js +5 -0
  84. package/packages/archives/src/main.vue +344 -0
  85. package/packages/flow/src/component/Opinions.vue +453 -0
  86. package/packages/flow/src/component/taskUnionExamine.vue +7 -3
  87. package/packages/flow/src/flow.vue +4456 -0
  88. package/packages/flow/src/main.vue +47 -7
  89. package/packages/flow/src/processReject.vue +3 -2
  90. package/packages/flow/src/startTaskRead.vue +7 -1
  91. package/packages/theme-chalk/lib/archives.css +1 -0
  92. package/packages/theme-chalk/lib/base.css +1 -1
  93. package/packages/theme-chalk/lib/calendar.css +1 -1
  94. package/packages/theme-chalk/lib/card.css +1 -1
  95. package/packages/theme-chalk/lib/data-table-form.css +1 -1
  96. package/packages/theme-chalk/lib/flow.css +1 -1
  97. package/packages/theme-chalk/lib/form.css +1 -1
  98. package/packages/theme-chalk/lib/handler.css +1 -1
  99. package/packages/theme-chalk/lib/icon.css +1 -1
  100. package/packages/theme-chalk/lib/icons.css +1 -1
  101. package/packages/theme-chalk/lib/index.css +1 -1
  102. package/packages/theme-chalk/lib/label.css +1 -1
  103. package/packages/theme-chalk/lib/login.css +1 -1
  104. package/packages/theme-chalk/lib/main.css +1 -1
  105. package/packages/theme-chalk/lib/menu.css +1 -1
  106. package/packages/theme-chalk/lib/selector-panel.css +1 -1
  107. package/packages/theme-chalk/lib/simplicity-top.css +1 -1
  108. package/packages/theme-chalk/lib/simplicity.css +1 -1
  109. package/packages/theme-chalk/lib/sizer.css +1 -1
  110. package/packages/theme-chalk/lib/steps.css +1 -1
  111. package/packages/theme-chalk/lib/tree.css +1 -1
  112. package/packages/theme-chalk/lib/upload.css +1 -1
  113. package/packages/theme-chalk/src/archives.scss +33 -0
  114. package/packages/theme-chalk/src/flow.scss +95 -1
  115. package/packages/theme-chalk/src/index.scss +1 -0
  116. package/packages/upload/src/main.vue +14 -5
  117. package/src/config/api.js +27 -0
  118. package/src/index.js +4 -1
@@ -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>