vue2-client 1.2.96 → 1.2.99-test

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,12 +1,14 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.2.94 -2022-08-05 - 1.2.96 @张振宇**
4
+ **1.2.94 -2022-08-05 - 1.2.98 @张振宇**
5
5
  - 功能新增:
6
6
  - 新增表单组件 人员选择框
7
7
  - 新增表单配置可以配置自定义请求
8
8
  - 文件表单项新增附件用途配置
9
9
  - 文件表单项cascader 修改了一下能用了
10
+ - xformitem修改了两个文件上传框时得bug
11
+ - 新增制度待确认提示
10
12
 
11
13
  **1.2.93 -2022-08-03 @江超**
12
14
  - 功能新增:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.96",
3
+ "version": "1.2.99-test",
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",
@@ -79,15 +79,6 @@ export default {
79
79
  type: Array,
80
80
  default: () => []
81
81
  },
82
- // 默认选中key
83
- defaultCheckedNames: {
84
- type: Array,
85
- default: () => []
86
- },
87
- defaultCheckedIds: {
88
- type: Array,
89
- default: () => []
90
- },
91
82
  // // 返回数据类型 String,Array 发现返回类型只能有一个
92
83
  // type: {
93
84
  // type: String,
@@ -115,10 +106,8 @@ export default {
115
106
  this.visible = true
116
107
  this.searchValue = ''
117
108
  this.treeData = this.sourceTreeData
118
- if (this.defaultCheckedIds.length > 0) {
119
- this.checkedKeys = this.getCheckedKeys(this.defaultCheckedIds)
120
- } else if (this.defaultCheckedNames.length > 0) {
121
- this.checkedKeys = this.getCheckedKeys(this.defaultCheckedNames)
109
+ if (this.value.length > 0) {
110
+ this.checkedKeys = this.getCheckedKeys(this.value)
122
111
  }
123
112
  this.expandedKeys = []
124
113
  },
@@ -70,7 +70,12 @@ export default {
70
70
  ...mapState('account', { currUser: 'user' })
71
71
  },
72
72
  created () {
73
- this.uploadedFileList = this.model.type === 'file' ? [...this.files] : [...this.images]
73
+ const list = this.model.type === 'file' ? [...this.files] : [...this.images]
74
+ if (this.model.useType) {
75
+ this.uploadedFileList = list.filter(item => item.f_use_type === this.model.useType)
76
+ } else {
77
+ this.uploadedFileList = list
78
+ }
74
79
  },
75
80
  methods: {
76
81
  uploadFiles (info) {
@@ -323,7 +323,11 @@ export default {
323
323
  }
324
324
  const item = this.realJsonData[i]
325
325
  if (this.modifyModelData.data[item.model] || this.modifyModelData.data[item.model] === 0) {
326
- this.form[item.model] = this.modifyModelData.data[item.model] + ''
326
+ if (this.modifyModelData.data[item.model] instanceof Array) {
327
+ this.form[item.model] = this.modifyModelData.data[item.model]
328
+ } else {
329
+ this.form[item.model] = this.modifyModelData.data[item.model] + ''
330
+ }
327
331
  } else {
328
332
  this.form[item.model] = undefined
329
333
  }
@@ -174,7 +174,7 @@
174
174
  :disabled="disabled"
175
175
  change-on-select
176
176
  :options="option"
177
- :value="form[attr.model]"
177
+ v-model="form[attr.model]"
178
178
  :placeholder="attr.placeholder ? attr.placeholder : '请选择'+attr.name.replace(/\s*/g, '')"
179
179
  :rows="4"/>
180
180
  </a-form-model-item>
@@ -313,7 +313,6 @@ export default {
313
313
  created () {
314
314
  if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
315
315
  this.getData({}, res => {
316
- console.log(res, '====')
317
316
  this.option = res
318
317
  })
319
318
  }
@@ -325,7 +324,10 @@ export default {
325
324
  },
326
325
  // 文件框时设置上传组件的值
327
326
  setFiles (fileIds) {
328
- this.form[this.attr.model] = fileIds
327
+ if (!this.form[this.attr.model]) {
328
+ this.form[this.attr.model] = []
329
+ }
330
+ this.form[this.attr.model] = [...this.form[this.attr.model], ...fileIds]
329
331
  },
330
332
  // 懒加载检索方法
331
333
  fetchFunction (value) {
@@ -1,96 +1,158 @@
1
- <template>
2
- <a-dropdown :trigger="['click']" v-model="show">
3
- <div slot="overlay">
4
- <a-spin :spinning="loading">
5
- <a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
6
- <a-tab-pane tab="通知" key="1">
7
- <a-list>
8
- <a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
9
- <a-list-item-meta :title="'设备号'+ item.e_f_device_id" :description="item.e_f_error_msg" @click="read(item)">
10
- <a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
11
- </a-list-item-meta>
12
- </a-list-item>
13
- </a-list>
14
- </a-tab-pane>
15
- <a-tab-pane tab="消息" key="2">
16
- <a-list class="tab-pane"></a-list>
17
- </a-tab-pane>
18
- <a-tab-pane tab="待办" key="3">
19
- <a-list class="tab-pane"></a-list>
20
- </a-tab-pane>
21
- </a-tabs>
22
- </a-spin>
23
- </div>
24
- <span @click="fetchNotice" class="header-notice">
25
- <a-badge class="notice-badge" :count=" exception.length">
26
- <a-icon :class="['header-notice-icon']" type="bell" />
27
- </a-badge>
28
- </span>
29
- </a-dropdown>
30
- </template>
31
-
32
- <script>
33
- import { post } from '@vue2-client/services/api'
34
- export default {
35
- name: 'HeaderNotice',
36
- data () {
37
- return {
38
- loading: false,
39
- show: false,
40
- exception: []
41
- }
42
- },
43
- computed: {
44
- },
45
- created () {
46
- },
47
- methods: {
48
- read (item) {
49
- post('/webmeterapi/saveSingleTable', { data: { tablename: 't_iot_device_exception', param: { id: item.e_id, f_is_read: 1 } } }).then(res => {
50
- this.refresh()
51
- })
52
- },
53
- refresh () {
54
- post('/webmeterapi/commonQuery', { queryParamsName: 'deviceExceptionQueryParams', conditionParams: { e_f_is_read: 0 }, pageNo: 1, pageSize: 999999 }).then(res => {
55
- this.exception = res.data
56
- })
57
- },
58
- fetchNotice () {
59
- if (this.loading) {
60
- this.loading = false
61
- return
62
- }
63
- this.loadding = true
64
- setTimeout(() => {
65
- this.loadding = false
66
- }, 1000)
67
- }
68
- }
69
- }
70
- </script>
71
-
72
- <style lang="less">
73
- .header-notice{
74
- display: inline-block;
75
- transition: all 0.3s;
76
- span {
77
- vertical-align: initial;
78
- }
79
- .notice-badge{
80
- color: inherit;
81
- .header-notice-icon{
82
- font-size: 16px;
83
- padding: 4px;
84
- }
85
- }
86
- }
87
- .dropdown-tabs{
88
- background-color: @base-bg-color;
89
- box-shadow: 0 2px 8px @shadow-color;
90
- border-radius: 4px;
91
- .tab-pane{
92
- padding: 0 24px 12px;
93
- min-height: 250px;
94
- }
95
- }
96
- </style>
1
+ <template>
2
+ <a-dropdown :trigger="['click']" v-model="show">
3
+ <div slot="overlay">
4
+ <a-spin :spinning="loading">
5
+ <a-tabs class="dropdown-tabs" :tabBarStyle="{textAlign: 'center'}" :style="{width: '297px'}">
6
+ <a-tab-pane tab="通知" key="1">
7
+ <a-list>
8
+ <a-list-item :key="item.id" class="tab-pane" v-for=" item in exception">
9
+ <a-list-item-meta
10
+ :title="'设备号'+ item.e_f_device_id"
11
+ :description="item.e_f_error_msg"
12
+ @click="read(item)">
13
+ <a-avatar
14
+ style="background-color: white"
15
+ slot="avatar"
16
+ src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
17
+ </a-list-item-meta>
18
+ </a-list-item>
19
+ </a-list>
20
+ </a-tab-pane>
21
+ <a-tab-pane tab="消息" key="2">
22
+ <a-list class="tab-pane"></a-list>
23
+ </a-tab-pane>
24
+ <a-tab-pane tab="待办" key="3">
25
+ <a-list item-layout="horizontal" :data-source="backlog" :bordered="true">
26
+ <a-list-item slot="renderItem" slot-scope="item, index">
27
+ <a slot="actions" v-if="item.type==='制度待确认'" @click="confirm_institution(item)">确认</a>
28
+ <a-list-item-meta :title="item.title" :description="item.description"/>
29
+ </a-list-item>
30
+ </a-list>
31
+ </a-tab-pane>
32
+ </a-tabs>
33
+ </a-spin>
34
+ </div>
35
+ <span @click="fetchNotice" class="header-notice">
36
+ <a-badge class="notice-badge" :count="exception.length + backlog.length">
37
+ <a-icon :class="['header-notice-icon']" type="bell"/>
38
+ </a-badge>
39
+ </span>
40
+ <a-drawer
41
+ placement="right"
42
+ title="待确认制度详情"
43
+ :width="screenWidth * 0.5"
44
+ :visible="institutionDetailVisible"
45
+ @close="institutionDetailVisible = false"
46
+ >
47
+ <institution-detail
48
+ :institutionId="institution"
49
+ affirmInstitution="affirmInstitution"
50
+ @get_to_be_confirmed="getToBeConfirmed"/>
51
+ </a-drawer>
52
+ </a-dropdown>
53
+ </template>
54
+
55
+ <script>
56
+ import { post } from '@vue2-client/services/api'
57
+ import InstitutionDetail from './InstitutionDetail'
58
+
59
+ export default {
60
+ name: 'HeaderNotice',
61
+ data () {
62
+ return {
63
+ loading: false,
64
+ screenWidth: document.documentElement.clientWidth,
65
+ show: false,
66
+ institutionDetailVisible: false,
67
+ institution: undefined,
68
+ affirmInstitution: undefined,
69
+ exception: [],
70
+ backlog: []
71
+ }
72
+ },
73
+ components: { InstitutionDetail },
74
+ computed: {},
75
+ created () {
76
+ this.getToBeConfirmed()
77
+ },
78
+ methods: {
79
+ read (item) {
80
+ post('/webmeterapi/saveSingleTable', {
81
+ data: {
82
+ tablename: 't_iot_device_exception',
83
+ param: { id: item.e_id, f_is_read: 1 }
84
+ }
85
+ }).then(res => {
86
+ this.refresh()
87
+ })
88
+ },
89
+ getToBeConfirmed () {
90
+ try {
91
+ if (this.$login.f.name) {
92
+ post('/webmetersql/getToBeConfirmed', { data: { condition: `state = '待确认' and f_affirm_by = '${this.$login.f.name}'` } }).then(res => {
93
+ this.backlog = [...res]
94
+ })
95
+ }
96
+ } catch (e) {
97
+ console.log(e)
98
+ }
99
+ },
100
+ confirm_institution (item) {
101
+ this.institution = item.institution
102
+ this.affirmInstitution = item.id
103
+ this.institutionDetailVisible = true
104
+ },
105
+ refresh () {
106
+ post('/webmeterapi/commonQuery', {
107
+ queryParamsName: 'deviceExceptionQueryParams',
108
+ conditionParams: { e_f_is_read: 0 },
109
+ pageNo: 1,
110
+ pageSize: 999999
111
+ }).then(res => {
112
+ this.exception = res.data
113
+ })
114
+ },
115
+ fetchNotice () {
116
+ if (this.loading) {
117
+ this.loading = false
118
+ return
119
+ }
120
+ this.loadding = true
121
+ setTimeout(() => {
122
+ this.loadding = false
123
+ }, 1000)
124
+ }
125
+ }
126
+ }
127
+ </script>
128
+
129
+ <style lang="less">
130
+ .header-notice {
131
+ display: inline-block;
132
+ transition: all 0.3s;
133
+
134
+ span {
135
+ vertical-align: initial;
136
+ }
137
+
138
+ .notice-badge {
139
+ color: inherit;
140
+
141
+ .header-notice-icon {
142
+ font-size: 16px;
143
+ padding: 4px;
144
+ }
145
+ }
146
+ }
147
+
148
+ .dropdown-tabs {
149
+ background-color: @base-bg-color;
150
+ box-shadow: 0 2px 8px @shadow-color;
151
+ border-radius: 4px;
152
+
153
+ .tab-pane {
154
+ padding: 0 24px 12px;
155
+ min-height: 250px;
156
+ }
157
+ }
158
+ </style>
@@ -0,0 +1,176 @@
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
+ </div>
38
+ </template>
39
+
40
+ <script>
41
+ import { Base64 } from 'js-base64'
42
+ import { post } from '@vue2-client/services/api/restTools'
43
+ import { formatDate } from '@vue2-client/utils/util'
44
+
45
+ export default {
46
+ name: 'InstitutionDetail',
47
+ props: {
48
+ institutionId: {
49
+ type: Number,
50
+ default: undefined
51
+ },
52
+ affirmInstitution: {
53
+ type: Number,
54
+ default: undefined
55
+ }
56
+ },
57
+ data () {
58
+ return {
59
+ institutionDocUrl: undefined,
60
+ showDocument: false,
61
+ otherFiles: [],
62
+ institutionData: {},
63
+ previewDocVisible: false,
64
+ previewDocUrl: undefined,
65
+ previewDocLoading: false
66
+ }
67
+ },
68
+ watch: {
69
+ institutionId () {
70
+ this.getDetailData()
71
+ }
72
+ },
73
+ mounted () {
74
+ this.getDetailData()
75
+ },
76
+ methods: {
77
+ // 获取详情数据
78
+ getDetailData () {
79
+ if (!this.institutionId) {
80
+ return
81
+ }
82
+ const otherFiles = []
83
+ post('/webmeterapi/getInstitutionDetail', {
84
+ id: this.institutionId
85
+ }).then(res => {
86
+ res.files.forEach(item => {
87
+ if (item.use_type === '制度文件') {
88
+ const institutionDocUrl = previewDocService + encodeURIComponent(Base64.encode(fileServer + item.url))
89
+ this.institutionDocUrl = institutionDocUrl
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 (item) {
119
+ this.institution = item.institution
120
+ post('/webmeterapi/affirmInstitution', {
121
+ data: {
122
+ tobe: [
123
+ {
124
+ id: item.id,
125
+ f_affirm_type: '系统确认'
126
+ }
127
+ ]
128
+ }
129
+ }).then(res => {
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
+ .content {
143
+ height: 80vh;
144
+ img {
145
+ max-width: 100%;
146
+ }
147
+ }
148
+ .other-file {
149
+ margin: 16px 0;
150
+ .title {
151
+ margin-bottom: 6px;
152
+ }
153
+ }
154
+ .file-item {
155
+ .file-action {
156
+ padding: 3px 4px;
157
+ color: #1890ff;
158
+ &:hover {
159
+ background: #e6f7ff;
160
+ }
161
+ }
162
+ .anticon {
163
+ margin-right: 3px;
164
+ }
165
+ }
166
+ .file-list-title {
167
+ color: rgba(0, 0, 0, 0.85);
168
+ font-weight: bold;
169
+ font-size: 16px;
170
+ margin-bottom: 8px;
171
+ }
172
+ .preview-doc-container {
173
+ height: calc(100vh - 92px);
174
+ padding-top: 20px;
175
+ }
176
+ </style>
package/vue.config.js CHANGED
@@ -34,7 +34,7 @@ const isProd = process.env.NODE_ENV === 'production'
34
34
  // ]
35
35
  // }
36
36
 
37
- const server = 'http://121.36.106.17:8400'
37
+ const server = 'http://123.60.214.109:8406'
38
38
  const local = 'http://localhost:8445/webmeter'
39
39
  // const local = 'http://123.60.214.109:8405/webmeter'
40
40