vue2-client 1.2.99 → 1.2.102

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/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.2.94 -2022-08-05 - 1.2.98 @张振宇**
4
+ **1.2.94 -2022-08-05 - 1.2.102 @张振宇**
5
5
  - 功能新增:
6
6
  - 新增表单组件 人员选择框
7
7
  - 新增表单配置可以配置自定义请求
@@ -9,6 +9,7 @@
9
9
  - 文件表单项cascader 修改了一下能用了
10
10
  - xformitem修改了两个文件上传框时得bug
11
11
  - 新增制度待确认提示
12
+ - 修改制度待确认提示
12
13
 
13
14
  **1.2.93 -2022-08-03 @江超**
14
15
  - 功能新增:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.99",
3
+ "version": "1.2.102",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -27,6 +27,7 @@
27
27
  "enquire.js": "^2.1.6",
28
28
  "file-saver": "^2.0.5",
29
29
  "highlight.js": "^10.7.3",
30
+ "js-base64": "^3.7.2",
30
31
  "js-cookie": "^2.2.1",
31
32
  "jsencrypt": "^3.2.1",
32
33
  "lodash.get": "^4.4.2",
@@ -2,7 +2,11 @@
2
2
  <a-dropdown :trigger="['click']" v-model="show">
3
3
  <div slot="overlay">
4
4
  <a-spin :spinning="loading">
5
- <a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
5
+ <a-tabs
6
+ class="dropdown-tabs"
7
+ :tabBarStyle="{textAlign: 'center'}"
8
+ :style="{width: '297px'}"
9
+ v-model="activeKey">
6
10
  <a-tab-pane tab="通知" key="1">
7
11
  <a-list>
8
12
  <a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
@@ -24,11 +28,23 @@
24
28
  <a-tab-pane tab="待办" key="3">
25
29
  <a-list item-layout="horizontal" :data-source="backlog" :bordered="true">
26
30
  <a-list-item slot="renderItem" slot-scope="item, index">
27
- <a slot="actions" v-if="item.type==='制度待确认'" @click="confirm_institution(item)">确认</a>
31
+ <a slot="actions" v-if="item.type==='制度待确认'" @click="confirm_institution(item)">查看</a>
28
32
  <a-list-item-meta :title="item.title" :description="item.description"/>
29
33
  </a-list-item>
30
34
  </a-list>
31
35
  </a-tab-pane>
36
+ <a-drawer
37
+ placement="right"
38
+ title="待确认制度详情"
39
+ :width="screenWidth * 0.5"
40
+ :visible="institutionDetailVisible"
41
+ @close="onClose"
42
+ >
43
+ <institution-detail
44
+ :institutionId="institution"
45
+ :affirmInstitution="affirmInstitution"
46
+ @get_to_be_confirmed="getToBeConfirmed"/>
47
+ </a-drawer>
32
48
  </a-tabs>
33
49
  </a-spin>
34
50
  </div>
@@ -42,22 +58,33 @@
42
58
 
43
59
  <script>
44
60
  import { post } from '@vue2-client/services/api'
61
+ import InstitutionDetail from './InstitutionDetail'
45
62
 
46
63
  export default {
47
64
  name: 'HeaderNotice',
48
65
  data () {
49
66
  return {
50
67
  loading: false,
68
+ screenWidth: document.documentElement.clientWidth,
51
69
  show: false,
70
+ institutionDetailVisible: false,
71
+ institution: undefined,
72
+ affirmInstitution: undefined,
52
73
  exception: [],
53
- backlog: []
74
+ backlog: [],
75
+ activeKey: '1'
54
76
  }
55
77
  },
78
+ components: { InstitutionDetail },
56
79
  computed: {},
57
80
  created () {
58
- this.get_to_be_confirmed()
81
+ this.getToBeConfirmed()
59
82
  },
60
83
  methods: {
84
+ onClose () {
85
+ this.institutionDetailVisible = false
86
+ this.getToBeConfirmed()
87
+ },
61
88
  read (item) {
62
89
  post('/webmeterapi/saveSingleTable', {
63
90
  data: {
@@ -68,30 +95,53 @@ export default {
68
95
  this.refresh()
69
96
  })
70
97
  },
71
- get_to_be_confirmed (item) {
98
+ getToBeConfirmed () {
99
+ this.institutionDetailVisible = false
72
100
  try {
73
101
  if (this.$login.f.name) {
74
102
  post('/webmetersql/getToBeConfirmed', { data: { condition: `state = '待确认' and f_affirm_by = '${this.$login.f.name}'` } }).then(res => {
75
103
  this.backlog = [...res]
104
+ if (this.backlog.length > 0) {
105
+ const key = `open${Date.now()}`
106
+ this.$notification.open({
107
+ key,
108
+ message: `您有${this.backlog.length}条待办需要确认`,
109
+ top: '50px',
110
+ description: this.backlog.map((item, index) => index + 1 + '、' + item.title).join(';'),
111
+ icon: <a-icon type="container" style="color: #f5222d"/>,
112
+ btn: h => {
113
+ return h(
114
+ 'a-button',
115
+ {
116
+ props: {
117
+ type: 'primary',
118
+ size: 'small',
119
+ },
120
+ on: {
121
+ click: () => this.viewBacklog(key),
122
+ },
123
+ },
124
+ '查看',
125
+ )
126
+ }
127
+ })
128
+ }
76
129
  })
77
130
  }
78
131
  } catch (e) {
79
132
  console.log(e)
80
133
  }
81
134
  },
135
+ viewBacklog (key) {
136
+ this.$notification.close(key)
137
+ this.show = true
138
+ this.activeKey = '3'
139
+ },
82
140
  confirm_institution (item) {
83
- post('/webmeterapi/affirmInstitution', {
84
- data: {
85
- tobe: [
86
- {
87
- id: item.id,
88
- f_affirm_type: '系统确认'
89
- }
90
- ]
91
- }
92
- }).then(res => {
93
- this.get_to_be_confirmed()
94
- })
141
+ this.institutionDetailVisible = true
142
+ this.show = false
143
+ this.institution = item.institution
144
+ this.affirmInstitution = item.id
95
145
  },
96
146
  refresh () {
97
147
  post('/webmeterapi/commonQuery', {
@@ -0,0 +1,177 @@
1
+ <template>
2
+ <div>
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" width="100%" height="100%" frameborder="0"></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" @click="handlePreDowDoc(file)" target="_blank"><a-icon type="download" />下载</a>
21
+ </a>
22
+ </div>
23
+ </div>
24
+ <!-- 其他附件预览 -->
25
+ <a-modal v-model="previewDocVisible" :footer="null" :dialog-style="{ top: '20px' }" width="97%" :z-index="1001">
26
+ <div class="preview-doc-container">
27
+ <a-spin size="large" :spinning="previewDocLoading" />
28
+ <iframe
29
+ v-show="!previewDocLoading"
30
+ :src="previewDocUrl"
31
+ width="100%"
32
+ height="100%"
33
+ frameborder="0"
34
+ @load="previewDocLoading = false" />
35
+ </div>
36
+ </a-modal>
37
+ <a-button 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('/webmeterapi/getInstitutionDetail', {
85
+ id: this.institutionId
86
+ }).then(res => {
87
+ res.files.forEach(item => {
88
+ if (item.use_type === '制度文件') {
89
+ const institutionDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + item.url))
90
+ this.institutionDocUrl = institutionDocUrl
91
+ this.showDocument = true
92
+ } else {
93
+ otherFiles.push(item)
94
+ }
95
+ })
96
+ this.institutionData = res.institution
97
+ this.otherFiles = otherFiles
98
+ })
99
+ },
100
+ format (dateStr) {
101
+ return formatDate(dateStr, 'yyyy-MM-dd')
102
+ },
103
+ // 其他附件预览
104
+ handlePreviewDoc (url) {
105
+ const previewDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + url))
106
+ if (this.previewDocUrl != previewDocUrl) {
107
+ this.previewDocLoading = true
108
+ this.previewDocUrl = previewDocUrl
109
+ }
110
+ this.previewDocVisible = true
111
+ },
112
+ // 下载文档
113
+ handlePreDowDoc (file) {
114
+ const a = document.createElement('a')
115
+ a.href = file.url
116
+ a.download = file.name
117
+ a.click()
118
+ },
119
+ confirm_institution () {
120
+ post('/webmeterapi/affirmInstitution', {
121
+ data: {
122
+ tobe: [
123
+ {
124
+ id: this.affirmInstitution,
125
+ f_affirm_type: '系统确认'
126
+ }
127
+ ]
128
+ }
129
+ }).then(res => {
130
+ this.$message.success('确认成功')
131
+ this.$emit('get_to_be_confirmed')
132
+ })
133
+ },
134
+ }
135
+ }
136
+ // 文档预览服务 API
137
+ const previewDocService = 'http://123.60.214.109:8012/onlinePreview?url='
138
+ // 文件服务器地址
139
+ const fileServer = 'http://123.60.214.109:8406'
140
+ </script>
141
+
142
+ <style lang="less" scoped>
143
+ .content {
144
+ height: 80vh;
145
+ img {
146
+ max-width: 100%;
147
+ }
148
+ }
149
+ .other-file {
150
+ margin: 16px 0;
151
+ .title {
152
+ margin-bottom: 6px;
153
+ }
154
+ }
155
+ .file-item {
156
+ .file-action {
157
+ padding: 3px 4px;
158
+ color: #1890ff;
159
+ &:hover {
160
+ background: #e6f7ff;
161
+ }
162
+ }
163
+ .anticon {
164
+ margin-right: 3px;
165
+ }
166
+ }
167
+ .file-list-title {
168
+ color: rgba(0, 0, 0, 0.85);
169
+ font-weight: bold;
170
+ font-size: 16px;
171
+ margin-bottom: 8px;
172
+ }
173
+ .preview-doc-container {
174
+ height: calc(100vh - 92px);
175
+ padding-top: 20px;
176
+ }
177
+ </style>
@@ -1,58 +1,58 @@
1
- import { METHOD, request } from '@vue2-client/utils/request'
2
- import { indexedDB } from '@vue2-client/utils/indexedDB'
3
-
4
- const commonApi = {
5
- // 获取表格列配置
6
- getColumnsJson: '/webmeterapi/getColumns',
7
- // 通用查询
8
- query: '/webmeterapi/commonQuery',
9
- // 表单通用查询
10
- queryWithResource: '/webmeterapi/commonQueryWithResource',
11
- // 通用新增/修改
12
- addOrModify: '/webmeterapi/commonAddOrModify',
13
- // 通用删除
14
- delete: '/webmeterapi/commonDelete',
15
- // 获取字典键列表
16
- getDictionaryParam: '/webmeterapi/getDictionaryParam',
17
- // 获取所有员工及其部门的级联菜单数据
18
- getEmpTree: '/webmeterapi/getEmpTree',
19
- }
20
-
21
- /**
22
- * 带缓存查询的表格配置文件查询
23
- * @param queryParamsName 配置名称
24
- * @param callback 回调函数
25
- */
26
- export function getColumnsJson (queryParamsName, callback) {
27
- indexedDB.getByWeb(queryParamsName, commonApi.getColumnsJson, { str: queryParamsName }, callback)
28
- }
29
-
30
- /**
31
- * 通用表单查询
32
- */
33
- export function query (parameter) {
34
- return request(commonApi.query, METHOD.POST, parameter)
35
- }
36
-
37
- /**
38
- * 通用表单查询
39
- */
40
- export function queryWithResource (parameter, api = commonApi.queryWithResource) {
41
- return request(api, METHOD.POST, parameter)
42
- }
43
-
44
- /**
45
- * 通用新增/修改
46
- */
47
- export function addOrModify (parameter, api = commonApi.queryWithResource) {
48
- return request(api, METHOD.POST, parameter)
49
- }
50
-
51
- /**
52
- * 通用删除
53
- */
54
- export function remove (parameter) {
55
- return request(commonApi.delete, METHOD.POST, parameter)
56
- }
57
-
58
- export { commonApi }
1
+ import { METHOD, request } from '@vue2-client/utils/request'
2
+ import { indexedDB } from '@vue2-client/utils/indexedDB'
3
+
4
+ const commonApi = {
5
+ // 获取表格列配置
6
+ getColumnsJson: '/webmeterapi/getColumns',
7
+ // 通用查询
8
+ query: '/webmeterapi/commonQuery',
9
+ // 表单通用查询
10
+ queryWithResource: '/webmeterapi/commonQueryWithResource',
11
+ // 通用新增/修改
12
+ addOrModify: '/webmeterapi/commonAddOrModify',
13
+ // 通用删除
14
+ delete: '/webmeterapi/commonDelete',
15
+ // 获取字典键列表
16
+ getDictionaryParam: '/webmeterapi/getDictionaryParam',
17
+ // 获取所有员工及其部门的级联菜单数据
18
+ getEmpTree: '/webmeterapi/getEmpTree',
19
+ }
20
+
21
+ /**
22
+ * 带缓存查询的表格配置文件查询
23
+ * @param queryParamsName 配置名称
24
+ * @param callback 回调函数
25
+ */
26
+ export function getColumnsJson (queryParamsName, callback) {
27
+ indexedDB.getByWeb(queryParamsName, commonApi.getColumnsJson, { str: queryParamsName }, callback)
28
+ }
29
+
30
+ /**
31
+ * 通用表单查询
32
+ */
33
+ export function query (parameter) {
34
+ return request(commonApi.query, METHOD.POST, parameter)
35
+ }
36
+
37
+ /**
38
+ * 通用表单查询
39
+ */
40
+ export function queryWithResource (parameter, api = commonApi.queryWithResource) {
41
+ return request(api, METHOD.POST, parameter)
42
+ }
43
+
44
+ /**
45
+ * 通用新增/修改
46
+ */
47
+ export function addOrModify (parameter, api = commonApi.addOrModify) {
48
+ return request(api, METHOD.POST, parameter)
49
+ }
50
+
51
+ /**
52
+ * 通用删除
53
+ */
54
+ export function remove (parameter) {
55
+ return request(commonApi.delete, METHOD.POST, parameter)
56
+ }
57
+
58
+ export { commonApi }