vue2-client 1.3.7 → 1.3.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 (28) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +1 -1
  4. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +1 -1
  5. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +1 -1
  6. package/src/base-client/components/common/Upload/Upload.vue +3 -3
  7. package/src/base-client/components/common/XAddForm/XAddForm.vue +6 -2
  8. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +6 -2
  9. package/src/base-client/components/common/XForm/XForm.vue +1 -1
  10. package/src/base-client/components/common/XForm/XFormItem.vue +4 -2
  11. package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -0
  12. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +1 -1
  13. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +1 -1
  14. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +1 -1
  15. package/src/layouts/header/HeaderNotice.vue +1 -1
  16. package/src/pages/CreateQueryPage.vue +2 -2
  17. package/src/pages/report/ReportTableHome.vue +28 -28
  18. package/src/pages/system/file/index.vue +3 -3
  19. package/src/pages/system/ticket/index.vue +4 -1
  20. package/src/services/api/DictionaryDetailsViewApi.js +1 -1
  21. package/src/services/api/LogDetailsViewApi.js +3 -3
  22. package/src/services/api/QueryParamsDetailsViewApi.js +1 -1
  23. package/src/services/api/TicketDetailsViewApi.js +15 -15
  24. package/src/services/api/common.js +7 -7
  25. package/src/services/api/commonTempTable.js +3 -3
  26. package/src/services/api/manage.js +2 -2
  27. package/vue.config.js +7 -2
  28. package/src/layouts/header/InstitutionDetail.vue +0 -181
package/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.3.3 - 1.3.7 -2022-09-09 @江超**
4
+ **1.3.3 - 1.3.8 -2022-09-09 @江超**
5
5
  - 功能修改:
6
6
  - 移除非基础业务组件
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -141,7 +141,7 @@ export default {
141
141
  if (value !== '') {
142
142
  const logicName = this.attr.keyName
143
143
  const logic = logicName.substring(6)
144
- post('/af-system/logic/' + logic, value).then(res => {
144
+ post('/api/af-system/logic/' + logic, value).then(res => {
145
145
  callback(res)
146
146
  })
147
147
  }
@@ -685,7 +685,7 @@ export default {
685
685
  // 获取所有仓库
686
686
  getStocks () {
687
687
  if (this.stockList.length === 0) {
688
- post('/af-system/logic/getFilesStock', {}).then(res => {
688
+ post('/api/af-system/logic/getFilesStock', {}).then(res => {
689
689
  this.stockList = res.sort((a, b) => b.progress - a.progress)
690
690
  }).catch(e => {})
691
691
  }
@@ -502,7 +502,7 @@ export default {
502
502
  // 获取所有仓库
503
503
  getStocks () {
504
504
  if (this.stockList.length === 0) {
505
- post('/af-system/logic/getFilesStock', {}).then(res => {
505
+ post('/api/af-system/logic/getFilesStock', {}).then(res => {
506
506
  this.stockList = res.sort((a, b) => b.progress - a.progress)
507
507
  }).catch(e => {})
508
508
  }
@@ -116,11 +116,11 @@ export default {
116
116
  formData.append('filesize', (info.file.size / 1024 / 1024).toFixed(4))
117
117
  formData.append('f_operator', this.currUser ? this.currUser.username : '')
118
118
 
119
- // const url = '/af-system/resource'
119
+ // const url = '/api/af-system/resource'
120
120
  // if (process.env.NODE_ENV === 'production') {
121
121
  // url = `/${this.model.stockAlias}/af-system/resource`
122
122
  // }
123
- post(this.serviceName + '/resource/upload', formData, { headers, timeout: 60 * 1000 }).then(res => {
123
+ post('/api/' + this.serviceName + '/resource/upload', formData, { headers, timeout: 60 * 1000 }).then(res => {
124
124
  // 根据服务端返回的结果判断成功与否,设置文件条目的状态
125
125
  if (res.success) {
126
126
  fileInfo.status = 'done'
@@ -143,7 +143,7 @@ export default {
143
143
  // 删除文件
144
144
  deleteFileItem (file) {
145
145
  if (file.id) {
146
- post(this.serviceName + '/entity/t_files', { id: file.id, f_state: '删除' }).then(res => {
146
+ post('/api/' + this.serviceName + '/entity/t_files', { id: file.id, f_state: '删除' }).then(res => {
147
147
  }).catch(e => { })
148
148
  }
149
149
  // 找到当前文件所在列表的索引
@@ -96,6 +96,10 @@ export default {
96
96
  return []
97
97
  }
98
98
  },
99
+ serviceName: {
100
+ type: String,
101
+ default: 'af-system'
102
+ },
99
103
  // 是否显示模态框
100
104
  visible: {
101
105
  type: Boolean,
@@ -159,7 +163,7 @@ export default {
159
163
  if (item.groupIndex === 1) {
160
164
  if (item.keyName.substring(0, 6) === 'logic@') {
161
165
  // 请求logic
162
- post('/af-system/logic/' + item.keyName.substring(6), {}).then(res => {
166
+ post('/api/' + this.serviceName + '/logic/' + item.keyName.substring(6), {}).then(res => {
163
167
  this.SelectsArray[item.group][item.groupIndex] = res
164
168
  this.SelectsArray = JSON.parse(JSON.stringify(this.SelectsArray))
165
169
  })
@@ -311,7 +315,7 @@ export default {
311
315
  })
312
316
  },
313
317
  async getSilenceSource (silenceSource, requestParameters) {
314
- const result = await post('/webmeterapi/' + silenceSource, requestParameters)
318
+ const result = await post('/api/' + this.serviceName + '/logic/' + silenceSource, requestParameters)
315
319
  return result
316
320
  },
317
321
  getModifyModelData () {
@@ -85,6 +85,10 @@ export default {
85
85
  return []
86
86
  }
87
87
  },
88
+ serviceName: {
89
+ type: String,
90
+ default: 'af-system'
91
+ },
88
92
  // 业务类型
89
93
  businessType: {
90
94
  type: String,
@@ -136,7 +140,7 @@ export default {
136
140
  if (item.groupIndex === 1) {
137
141
  if (item.keyName.substring(0, 6) === 'logic@') {
138
142
  // 请求logic
139
- post('/af-system/logic/' + item.keyName.substring(6), {}).then(res => {
143
+ post('/api/' + this.serviceName + '/logic/' + item.keyName.substring(6), {}).then(res => {
140
144
  this.SelectsArray[item.group][item.groupIndex] = res
141
145
  this.SelectsArray = JSON.parse(JSON.stringify(this.SelectsArray))
142
146
  })
@@ -288,7 +292,7 @@ export default {
288
292
  })
289
293
  },
290
294
  async getSilenceSource (silenceSource, requestParameters) {
291
- const result = await post('/af-system/logic/' + silenceSource, requestParameters)
295
+ const result = await post('/api/' + this.serviceName + '/logic/' + silenceSource, requestParameters)
292
296
  return result
293
297
  },
294
298
  getModifyModelData () {
@@ -135,7 +135,7 @@ export default {
135
135
  if (item.groupIndex === 1) {
136
136
  if (item.keyName.substring(0, 6) === 'logic@') {
137
137
  // 请求logic
138
- post('/af-system/logic/' + item.keyName.substring(6), {}).then(res => {
138
+ post('/api/' + this.serviceName + '/logic/' + item.keyName.substring(6), {}).then(res => {
139
139
  this.SelectsArray[item.group][item.groupIndex] = res
140
140
  this.SelectsArray = JSON.parse(JSON.stringify(this.SelectsArray))
141
141
  })
@@ -250,6 +250,7 @@ import XBadge from '@vue2-client/base-client/components/common/XBadge'
250
250
  import CitySelect from '@vue2-client/base-client/components/common/CitySelect'
251
251
  import PersonSetting from '@vue2-client/base-client/components/common/PersonSetting'
252
252
  import AddressSearchCombobox from '@vue2-client/base-client/components/common/AddressSearchCombobox'
253
+ import Upload from '@/base-client/components/common/Upload'
253
254
 
254
255
  export default {
255
256
  name: 'XFormItem',
@@ -258,7 +259,8 @@ export default {
258
259
  XBadge,
259
260
  CitySelect,
260
261
  PersonSetting,
261
- AddressSearchCombobox
262
+ AddressSearchCombobox,
263
+ Upload
262
264
  },
263
265
  data () {
264
266
  // 检索去抖
@@ -366,7 +368,7 @@ export default {
366
368
  if (value !== '') {
367
369
  const logicName = this.attr.keyName
368
370
  const logic = logicName.substring(6)
369
- post('/af-system/logic/' + logic, value).then(res => {
371
+ post('/api/' + this.serviceName + '/logic/' + logic, value).then(res => {
370
372
  callback(res)
371
373
  })
372
374
  }
@@ -6,6 +6,7 @@
6
6
  :business-type="businessType"
7
7
  :fixedAddForm="fixedAddForm"
8
8
  :json-data="formItems"
9
+ :service-name="serviceName"
9
10
  :loading="loading"
10
11
  :modify-model-data="modifyModelData"
11
12
  :visible.sync="modelVisible"
@@ -182,7 +182,7 @@ export default {
182
182
  },
183
183
  // 存储查询配置信息
184
184
  saveQueryParams (source) {
185
- return post('/af-system/logic/updateQueryParamsData', {
185
+ return post('/api/af-system/logic/updateQueryParamsData', {
186
186
  id: this.id,
187
187
  source: source
188
188
  }).then(res => {
@@ -36,7 +36,7 @@
36
36
  :before-upload="beforeUpload"
37
37
  :file-list="fileList"
38
38
  :remove="remove"
39
- action="/af-system/file/upload"
39
+ action="/api/af-system/file/upload"
40
40
  list-type="picture-card"
41
41
  name="avatar"
42
42
  @change="handleChange"
@@ -22,7 +22,7 @@
22
22
  :before-upload="beforeUpload"
23
23
  :file-list="fileList"
24
24
  :remove="remove"
25
- action="/af-system/file/upload"
25
+ action="/api/af-system/file/upload"
26
26
  list-type="picture-card"
27
27
  name="avatar"
28
28
  @change="handleChange"
@@ -77,7 +77,7 @@ export default {
77
77
  this.institutionDetailVisible = false
78
78
  try {
79
79
  if (this.$login.f.name) {
80
- post('/af-system/logic/getTodo', { name: this.$login.f.name }).then(res => {
80
+ post('/api/af-system/logic/getTodo', { name: this.$login.f.name }).then(res => {
81
81
  this.backlog = [...res]
82
82
  if (this.backlog.length > 0) {
83
83
  const key = `open${Date.now()}`
@@ -40,7 +40,7 @@ export default {
40
40
  },
41
41
  // 存储查询配置信息
42
42
  saveQueryParams (source) {
43
- return post('/af-system/logic/addOrEditQueryParams', {
43
+ return post('/api/af-system/logic/addOrEditQueryParams', {
44
44
  source: source
45
45
  }).then(res => {
46
46
  this.$message.success('保存查询配置成功')
@@ -50,7 +50,7 @@ export default {
50
50
  },
51
51
  // 存储基础表单配置信息
52
52
  saveSimpleFormQueryParams (source) {
53
- return post('/af-system/logic/addOrEditSimpleFormQueryParams', {
53
+ return post('/api/af-system/logic/addOrEditSimpleFormQueryParams', {
54
54
  source: source
55
55
  }).then(res => {
56
56
  this.$message.success('保存基础表单配置成功')
@@ -1,28 +1,28 @@
1
- <template>
2
- <report-table :tableData="tableData"></report-table>
3
- </template>
4
-
5
- <script>
6
- import { post } from '@vue2-client/services/api'
7
- import ReportTable from '@vue2-client/pages/report/ReportTable'
8
- export default {
9
- name: 'ReportTableHome',
10
- components: { ReportTable },
11
- data () {
12
- return {
13
- tableData: null
14
- }
15
- },
16
- created () {
17
- },
18
- mounted () {
19
- this.getData()
20
- },
21
- methods: {
22
- async getData () {
23
- this.tableData = await post('webmeterapi/reportTest', {})
24
- console.log('数据=>', JSON.stringify(this.tableData))
25
- }
26
- }
27
- }
28
- </script>
1
+ <template>
2
+ <report-table :tableData="tableData"></report-table>
3
+ </template>
4
+
5
+ <script>
6
+ import { post } from '@vue2-client/services/api'
7
+ import ReportTable from '@vue2-client/pages/report/ReportTable'
8
+ export default {
9
+ name: 'ReportTableHome',
10
+ components: { ReportTable },
11
+ data () {
12
+ return {
13
+ tableData: null
14
+ }
15
+ },
16
+ created () {
17
+ },
18
+ mounted () {
19
+ this.getData()
20
+ },
21
+ methods: {
22
+ async getData () {
23
+ this.tableData = await post('/api/af-system/logic/reportTest', {})
24
+ console.log('数据=>', JSON.stringify(this.tableData))
25
+ }
26
+ }
27
+ }
28
+ </script>
@@ -195,10 +195,10 @@ export default {
195
195
  getStockList () {
196
196
  this.loading = true
197
197
  // 请求仓库列表
198
- post('/af-system/logic/getFilesStock', {}).then(res => {
198
+ post('/api/af-system/logic/getFilesStock', {}).then(res => {
199
199
  this.data = res.sort((a, b) => a.progress - b.progress)
200
200
  // 请求仓库列表
201
- post('/af-system/logic/getFilesColl', {}).then(res => {
201
+ post('/api/af-system/logic/getFilesColl', {}).then(res => {
202
202
  this.coll = res
203
203
  this.loading = false
204
204
  })
@@ -269,7 +269,7 @@ export default {
269
269
  },
270
270
  submitStock () {
271
271
  // 保存仓库信息
272
- post('/webMeterEntity/t_files_manager', this.form).then(res => {
272
+ post('/api/af-system/entity/t_files_manager', this.form).then(res => {
273
273
  this.$message.success('提交成功')
274
274
  this.visible = false
275
275
  this.getStockList()
@@ -252,11 +252,14 @@
252
252
  import { TicketDetailsViewApi, post } from '@vue2-client/services/api'
253
253
  import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable'
254
254
  import submitTicketSuccess from './submitTicketSuccess'
255
+ import Upload from '@/base-client/components/common/Upload'
255
256
 
256
257
  export default {
257
258
  name: 'submitTicket',
258
259
  components: {
259
- XFormTable, submitTicketSuccess
260
+ XFormTable,
261
+ submitTicketSuccess,
262
+ Upload
260
263
  },
261
264
  data () {
262
265
  return {
@@ -1,6 +1,6 @@
1
1
  const DictionaryDetailsViewApi = {
2
2
  // 查询:获取字典详情
3
- getDictionaryDetails: '/af-system/logic/getDictionaryDetails'
3
+ getDictionaryDetails: '/api/af-system/logic/getDictionaryDetails'
4
4
  }
5
5
 
6
6
  export { DictionaryDetailsViewApi }
@@ -1,10 +1,10 @@
1
1
  const LogDetailsViewApi = {
2
2
  // 查询:获取日志详情
3
- getLogDetails: '/af-system/logic/foreignaidGetLogDetails',
3
+ getLogDetails: '/api/af-system/logic/foreignaidGetLogDetails',
4
4
  // 查询:获取日志维护记录
5
- getLogRecordList: '/af-system/logic/foreignaidGetRecordList',
5
+ getLogRecordList: '/api/af-system/logic/foreignaidGetRecordList',
6
6
  // 操作:更新日志状态
7
- updateLogStatusData: '/af-system/logic/foreignaidUpdateLogStatus'
7
+ updateLogStatusData: '/api/af-system/logic/foreignaidUpdateLogStatus'
8
8
  }
9
9
 
10
10
  export { LogDetailsViewApi }
@@ -1,6 +1,6 @@
1
1
  const QueryParamsDetailsViewApi = {
2
2
  // 查询:获取查询配置详情
3
- getQueryParamsDetails: '/af-system/logic/getQueryParamsDetails'
3
+ getQueryParamsDetails: '/api/af-system/logic/getQueryParamsDetails'
4
4
  }
5
5
 
6
6
  export { QueryParamsDetailsViewApi }
@@ -1,34 +1,34 @@
1
1
  const TicketDetailsViewApi = {
2
2
  // 查询:获取工单流转详情
3
- getTicketWorkFlowDetails: '/af-system/logic/getTicketWorkFlowDetails',
3
+ getTicketWorkFlowDetails: '/api/af-system/logic/getTicketWorkFlowDetails',
4
4
  // 查询:获取工单详情
5
- getTicketDetails: '/af-system/logic/getTicketDetails',
5
+ getTicketDetails: '/api/af-system/logic/getTicketDetails',
6
6
  // 手动关闭工单
7
- manualCloseTicket: '/af-system/logic/manualCloseTicket',
7
+ manualCloseTicket: '/api/af-system/logic/manualCloseTicket',
8
8
  // 转交工单给其他人
9
- transferTicketToOthers: '/af-system/logic/transferTicketToOthers',
9
+ transferTicketToOthers: '/api/af-system/logic/transferTicketToOthers',
10
10
  // 确认工单,开始处理
11
- confirmTicket: '/af-system/logic/confirmTicket',
11
+ confirmTicket: '/api/af-system/logic/confirmTicket',
12
12
  // 查询:获取订单详情用于订单追踪
13
- getTicketDetailsForUploader: '/af-system/logic/getTicketDetailsForUploader',
13
+ getTicketDetailsForUploader: '/api/af-system/logic/getTicketDetailsForUploader',
14
14
  // 更新:将工单优先级增加
15
- rushTicket: '/af-system/logic/rushTicket',
15
+ rushTicket: '/api/af-system/logic/rushTicket',
16
16
  // 客户手动关闭工单
17
- manualCloseTicketByCustomer: '/af-system/logic/manualCloseTicketByCustomer',
17
+ manualCloseTicketByCustomer: '/api/af-system/logic/manualCloseTicketByCustomer',
18
18
  // 在工单提交页面删除照片
19
- revocationImage: '/af-system/logic/revocationImage',
19
+ revocationImage: '/api/af-system/logic/revocationImage',
20
20
  // 在工单提交页面删除照片
21
- getTicketImages: '/af-system/logic/getTicketImages',
21
+ getTicketImages: '/api/af-system/logic/getTicketImages',
22
22
  // 用户填写附加信息时取消了操作,将已上传的照片清空
23
- removeAllImages: '/af-system/logic/removeAllImages',
23
+ removeAllImages: '/api/af-system/logic/removeAllImages',
24
24
  // 提交用户填写附加信息
25
- AddonDescriptionToTicket: '/af-system/logic/AddonDescriptionToTicket',
25
+ AddonDescriptionToTicket: '/api/af-system/logic/AddonDescriptionToTicket',
26
26
  // 获取用户填写附加信息
27
- getAddonDescription: '/af-system/logic/getAddonDescription',
27
+ getAddonDescription: '/api/af-system/logic/getAddonDescription',
28
28
  // 发起售后工单流程
29
- createTicket: '/af-system/logic/createTicket',
29
+ createTicket: '/api/af-system/logic/createTicket',
30
30
  // 查询:获取所有员工名,供前端展示备选项
31
- getAllEmployeeName: '/af-system/logic/getAllEmployeeName'
31
+ getAllEmployeeName: '/api/af-system/logic/getAllEmployeeName'
32
32
  }
33
33
 
34
34
  export { TicketDetailsViewApi }
@@ -3,7 +3,7 @@ import { indexedDB } from '@vue2-client/utils/indexedDB'
3
3
 
4
4
  const commonApi = {
5
5
  // 获取表格列配置
6
- getColumnsJson: '/af-system/logic/getColumns',
6
+ getColumnsJson: '/api/af-system/logic/getColumns',
7
7
  // 通用查询
8
8
  query: 'logic/commonQuery',
9
9
  // 表单查询
@@ -13,9 +13,9 @@ const commonApi = {
13
13
  // 通用删除
14
14
  delete: 'logic/commonDelete',
15
15
  // 获取字典键列表
16
- getDictionaryParam: '/af-system/logic/getDictionaryParam',
16
+ getDictionaryParam: '/api/af-system/logic/getDictionaryParam',
17
17
  // 获取所有员工及其部门的级联菜单数据
18
- getEmpTree: '/af-system/logic/getEmpTree',
18
+ getEmpTree: '/api/af-system/logic/getEmpTree',
19
19
  }
20
20
 
21
21
  /**
@@ -31,28 +31,28 @@ export function getColumnsJson (queryParamsName, callback) {
31
31
  * 通用查询
32
32
  */
33
33
  export function query (parameter, api = commonApi.query, serviceName = 'af-system') {
34
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
34
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
35
35
  }
36
36
 
37
37
  /**
38
38
  * 通用表单查询
39
39
  */
40
40
  export function queryWithResource (parameter, api = commonApi.queryWithResource, serviceName = 'af-system') {
41
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
41
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
42
42
  }
43
43
 
44
44
  /**
45
45
  * 通用新增/修改
46
46
  */
47
47
  export function addOrModify (parameter, api = commonApi.addOrModify, serviceName = 'af-system') {
48
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
48
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
49
49
  }
50
50
 
51
51
  /**
52
52
  * 通用删除
53
53
  */
54
54
  export function remove (parameter, api = commonApi.delete, serviceName = 'af-system') {
55
- return request('/' + serviceName + '/' + api, METHOD.POST, parameter, null)
55
+ return request('/api/' + serviceName + '/' + api, METHOD.POST, parameter, null)
56
56
  }
57
57
 
58
58
  export { commonApi }
@@ -1,10 +1,10 @@
1
1
  const CommonTempTable = {
2
2
  // 初始化子表
3
- initApplySubTable: '/af-system/logic/initApplySubTable',
3
+ initApplySubTable: '/api/af-system/logic/initApplySubTable',
4
4
  // 创建临时表,根据配置文件动态生成
5
- createTempTable: '/af-system/logic/createTempTable',
5
+ createTempTable: '/api/af-system/logic/createTempTable',
6
6
  // 向临时表中插入数据
7
- insertDataToTempTable: '/af-system/logic/insertDataToTempTable'
7
+ insertDataToTempTable: '/api/af-system/logic/insertDataToTempTable'
8
8
  }
9
9
 
10
10
  export { CommonTempTable }
@@ -1,8 +1,8 @@
1
1
  const manageApi = {
2
2
  // 查询:获取字典键列表
3
- getDictionaryValue: '/af-system/logic/getDictionaryValue',
3
+ getDictionaryValue: '/api/af-system/logic/getDictionaryValue',
4
4
  // 查询:获取省市区街道三级分类
5
- getDivisionsOhChina: '/af-system/logic/getDivisionsOhChina'
5
+ getDivisionsOhChina: '/api/af-system/logic/getDivisionsOhChina'
6
6
  }
7
7
 
8
8
  export { manageApi }
package/vue.config.js CHANGED
@@ -23,10 +23,15 @@ module.exports = {
23
23
  ws: false,
24
24
  changeOrigin: true
25
25
  },
26
- '/af-system': {
27
- pathRewrite: { '^/af-system': '/rs' },
26
+ '/api': {
27
+ pathRewrite: { '^/api/af-system/': '/rs/' },
28
28
  target: local,
29
29
  changeOrigin: true
30
+ },
31
+ '/resource': {
32
+ pathRewrite: { '^/resource': '/' },
33
+ target: 'http://127.0.0.1:4789',
34
+ changeOrigin: true
30
35
  }
31
36
  }
32
37
  },
@@ -1,181 +0,0 @@
1
- <template>
2
- <div style="position: relative;">
3
- <h2 style="text-align: center">{{ institutionData.f_title }}</h2>
4
- <p>简述: {{ institutionData.f_sketch }}</p>
5
- <p>生效时间: {{ format(institutionData.f_effective_date) }}</p>
6
- <div v-if="showDocument" class="content">
7
- <iframe :src="institutionDocUrl" frameborder="0" height="100%" width="100%"></iframe>
8
- </div>
9
- <!-- 其他附件 -->
10
- <div class="other-file">
11
- <div class="title">其他附件</div>
12
- <div v-for="file in otherFiles" :key="file.id">
13
- <a class="file-item">
14
- <span class="file-action" @click="handlePreviewDoc(file.url)">
15
- <a-icon type="link" />{{ file.name }}
16
- </span>
17
- <span class="file-action" @click="handlePreviewDoc(file.url)">
18
- <a-icon type="eye" />预览
19
- </span>
20
- <a class="file-action" target="_blank" @click="handlePreDowDoc(file)"><a-icon type="download" />下载</a>
21
- </a>
22
- </div>
23
- </div>
24
- <!-- 其他附件预览 -->
25
- <a-modal v-model="previewDocVisible" :dialog-style="{ top: '20px' }" :footer="null" :z-index="1001" width="97%">
26
- <div class="preview-doc-container">
27
- <a-spin :spinning="previewDocLoading" size="large" />
28
- <iframe
29
- v-show="!previewDocLoading"
30
- :src="previewDocUrl"
31
- frameborder="0"
32
- height="100%"
33
- width="100%"
34
- @load="previewDocLoading = false" />
35
- </div>
36
- </a-modal>
37
- <a-button class="submit_btn" type="primary" @click="confirm_institution">确认</a-button>
38
- </div>
39
- </template>
40
-
41
- <script>
42
- import { Base64 } from 'js-base64'
43
- import { post } from '@vue2-client/services/api/restTools'
44
- import { formatDate } from '@vue2-client/utils/util'
45
-
46
- export default {
47
- name: 'InstitutionDetail',
48
- props: {
49
- institutionId: {
50
- type: Number,
51
- default: undefined
52
- },
53
- affirmInstitution: {
54
- type: Number,
55
- default: undefined
56
- }
57
- },
58
- data () {
59
- return {
60
- institutionDocUrl: undefined,
61
- showDocument: false,
62
- otherFiles: [],
63
- institutionData: {},
64
- previewDocVisible: false,
65
- previewDocUrl: undefined,
66
- previewDocLoading: false
67
- }
68
- },
69
- watch: {
70
- institutionId () {
71
- this.getDetailData()
72
- }
73
- },
74
- mounted () {
75
- this.getDetailData()
76
- },
77
- methods: {
78
- // 获取详情数据
79
- getDetailData () {
80
- if (!this.institutionId) {
81
- return
82
- }
83
- const otherFiles = []
84
- post('/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
- }
94
- })
95
- this.institutionData = res.institution
96
- this.otherFiles = otherFiles
97
- })
98
- },
99
- format (dateStr) {
100
- return formatDate(dateStr, 'yyyy-MM-dd')
101
- },
102
- // 其他附件预览
103
- 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
110
- },
111
- // 下载文档
112
- handlePreDowDoc (file) {
113
- const a = document.createElement('a')
114
- a.href = file.url
115
- a.download = file.name
116
- a.click()
117
- },
118
- confirm_institution () {
119
- post('/af-system/logic/affirmInstitution', {
120
- data: {
121
- tobe: [
122
- {
123
- id: this.affirmInstitution,
124
- f_affirm_type: '系统确认'
125
- }
126
- ]
127
- }
128
- }).then(res => {
129
- this.$message.success('确认成功')
130
- this.$emit('get_to_be_confirmed')
131
- })
132
- },
133
- }
134
- }
135
- // 文档预览服务 API
136
- const previewDocService = 'http://123.60.214.109:8012/onlinePreview?url='
137
- // 文件服务器地址
138
- const fileServer = 'http://123.60.214.109:8406'
139
- </script>
140
-
141
- <style lang="less" scoped>
142
- .submit_btn{
143
- position: absolute;
144
- right:0;
145
- top: 0;
146
- }
147
- .content {
148
- height: 80vh;
149
- img {
150
- max-width: 100%;
151
- }
152
- }
153
- .other-file {
154
- margin: 16px 0;
155
- .title {
156
- margin-bottom: 6px;
157
- }
158
- }
159
- .file-item {
160
- .file-action {
161
- padding: 3px 4px;
162
- color: #1890ff;
163
- &:hover {
164
- background: #e6f7ff;
165
- }
166
- }
167
- .anticon {
168
- margin-right: 3px;
169
- }
170
- }
171
- .file-list-title {
172
- color: rgba(0, 0, 0, 0.85);
173
- font-weight: bold;
174
- font-size: 16px;
175
- margin-bottom: 8px;
176
- }
177
- .preview-doc-container {
178
- height: calc(100vh - 92px);
179
- padding-top: 20px;
180
- }
181
- </style>