vue2-client 1.18.56 → 1.18.58

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": "vue2-client",
3
- "version": "1.18.56",
3
+ "version": "1.18.58",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -74,7 +74,7 @@
74
74
  </a-button>
75
75
  </a-upload>
76
76
 
77
- <height-scanner v-if="useScanner" @confirmPhoto="confirmPhoto" ref="heightScanner"/>
77
+ <height-scanner v-if="useScanner" :show="showScanner" @confirmPhoto="confirmPhoto" @cancel="handleCancelScanner" ref="heightScanner"/>
78
78
 
79
79
  <!-- 使用封装的图片预览组件 -->
80
80
  <image-preview-modal
@@ -105,7 +105,8 @@ export default {
105
105
  uploadedFileList: [],
106
106
  previewVisible: false,
107
107
  previewImage: '',
108
- previewImageName: ''
108
+ previewImageName: '',
109
+ showScanner: false
109
110
  }
110
111
  },
111
112
  props: {
@@ -219,7 +220,12 @@ export default {
219
220
 
220
221
  useScannerUpload (e) {
221
222
  // 打开高拍仪
222
- this.$refs.heightScanner.show = true
223
+ this.showScanner = true
224
+ },
225
+
226
+ handleCancelScanner () {
227
+ // 关闭高拍仪弹窗
228
+ this.showScanner = false
223
229
  },
224
230
 
225
231
  uploadFiles (info) {
@@ -1229,7 +1229,7 @@ export default {
1229
1229
  */
1230
1230
  refresh (bool) {
1231
1231
  this.$nextTick(() => {
1232
- this.$refs.table.refresh(bool)
1232
+ this.$refs.table?.refresh(bool)
1233
1233
  })
1234
1234
  },
1235
1235
  setScrollYHeight ({ extraHeight = this.extraHeight, id = this.uniqueId, type = '' }) {
@@ -101,7 +101,7 @@
101
101
  <a-col :span="24">
102
102
  <a-space>
103
103
  高拍仪
104
- <a-button @click="handleCancel">取消</a-button>
104
+ <a-button @click="handleCancel">关闭</a-button>
105
105
  </a-space>
106
106
  </a-col>
107
107
  </a-row>
@@ -582,7 +582,7 @@ export default {
582
582
  this.$emit('confirmPhoto', this.previewImage)
583
583
  },
584
584
  handleCancel () {
585
- this.show = false
585
+ this.$emit('cancel')
586
586
  }
587
587
  },
588
588
 
@@ -42,6 +42,7 @@
42
42
  import { Base64 } from 'js-base64'
43
43
  import { post } from '@vue2-client/services/api/restTools'
44
44
  import { formatDate } from '@vue2-client/utils/util'
45
+ import { getConfigByNameAsync } from '@/services/api/common'
45
46
 
46
47
  export default {
47
48
  name: 'InstitutionDetail',
@@ -63,7 +64,9 @@ export default {
63
64
  institutionData: {},
64
65
  previewDocVisible: false,
65
66
  previewDocUrl: undefined,
66
- previewDocLoading: false
67
+ previewDocLoading: false,
68
+ previewDocService: 'http://aote-office.8866.org:32510/onlinePreview?url=',
69
+ fileServer: 'http://aote-office.8866.org:8406'
67
70
  }
68
71
  },
69
72
  watch: {
@@ -75,25 +78,42 @@ export default {
75
78
  this.getDetailData()
76
79
  },
77
80
  methods: {
81
+ async getPreviewDocService () {
82
+ if (this.compatible === 'OA') {
83
+ this.fileServer = 'http://aote-office.8866.org:8406'
84
+ this.previewDocService = 'http://aote-office.8866.org:32510/onlinePreview?url='
85
+ return
86
+ }
87
+ await getConfigByNameAsync('previewDocServiceConfig').then(res => {
88
+ if (!res.fileServer) {
89
+ this.$message.error('文件预览服务配置错误')
90
+ } else {
91
+ this.previewDocService = res.previewDocService
92
+ this.fileServer = res.fileServer
93
+ }
94
+ })
95
+ },
78
96
  // 获取详情数据
79
97
  getDetailData () {
80
98
  if (!this.institutionId) {
81
99
  return
82
100
  }
83
101
  const otherFiles = []
84
- post('/api/af-system/logic/getInstitutionDetail', {
85
- id: this.institutionId
86
- }).then(res => {
87
- res.files.forEach(item => {
88
- if (item.use_type === '制度文件') {
89
- this.institutionDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + item.url))
90
- this.showDocument = true
91
- } else {
92
- otherFiles.push(item)
93
- }
102
+ this.getPreviewDocService().then(() => {
103
+ post('/api/af-system/logic/getInstitutionDetail', {
104
+ id: this.institutionId
105
+ }).then(res => {
106
+ res.files.forEach(item => {
107
+ if (item.use_type === '制度文件') {
108
+ this.institutionDocUrl = this.previewDocService + encodeURIComponent(Base64.encode(this.fileServer + item.url))
109
+ this.showDocument = true
110
+ } else {
111
+ otherFiles.push(item)
112
+ }
113
+ })
114
+ this.institutionData = res.institution
115
+ this.otherFiles = otherFiles
94
116
  })
95
- this.institutionData = res.institution
96
- this.otherFiles = otherFiles
97
117
  })
98
118
  },
99
119
  format (dateStr) {
@@ -101,12 +121,14 @@ export default {
101
121
  },
102
122
  // 其他附件预览
103
123
  handlePreviewDoc (url) {
104
- const previewDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + url))
105
- if (this.previewDocUrl !== previewDocUrl) {
106
- this.previewDocLoading = true
107
- this.previewDocUrl = previewDocUrl
108
- }
109
- this.previewDocVisible = true
124
+ this.getPreviewDocService().then(() => {
125
+ const previewDocUrl = this.previewDocService + encodeURIComponent(Base64.encode(this.fileServer + url))
126
+ if (this.previewDocUrl !== previewDocUrl) {
127
+ this.previewDocLoading = true
128
+ this.previewDocUrl = previewDocUrl
129
+ }
130
+ this.previewDocVisible = true
131
+ })
110
132
  },
111
133
  // 下载文档
112
134
  handlePreDowDoc (file) {
@@ -116,7 +138,11 @@ export default {
116
138
  a.click()
117
139
  },
118
140
  confirm_institution () {
119
- post('/api/af-system/logic/affirmInstitution', {
141
+ let serviceName = 'af-oa'
142
+ if (this.compatible === 'OA') {
143
+ serviceName = 'af-system'
144
+ }
145
+ post(`/api/${serviceName}/logic/affirmInstitution`, {
120
146
  data: {
121
147
  tobe: [
122
148
  {
@@ -132,10 +158,6 @@ export default {
132
158
  },
133
159
  }
134
160
  }
135
- // 文档预览服务 API
136
- const previewDocService = 'http://aote-office.8866.org:32510/onlinePreview?url='
137
- // 文件服务器地址
138
- const fileServer = 'http://aote-office.8866.org:8406'
139
161
  </script>
140
162
 
141
163
  <style lang="less" scoped>
@@ -14,5 +14,5 @@ export async function blobValidate (data) {
14
14
  export function isDebugUser () {
15
15
  const store = Vue.$store
16
16
  const currUser = store.state.account?.user
17
- return currUser.name === '1' || currUser.rolesnames.indexOf('运维人员') > -1
17
+ return currUser.name === '1' || currUser.rolesnames?.indexOf('运维人员') > -1
18
18
  }