vue2-client 1.2.96 → 1.2.99

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",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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,149 @@
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-dropdown>
41
+ </template>
42
+
43
+ <script>
44
+ import { post } from '@vue2-client/services/api'
45
+
46
+ export default {
47
+ name: 'HeaderNotice',
48
+ data () {
49
+ return {
50
+ loading: false,
51
+ show: false,
52
+ exception: [],
53
+ backlog: []
54
+ }
55
+ },
56
+ computed: {},
57
+ created () {
58
+ this.get_to_be_confirmed()
59
+ },
60
+ methods: {
61
+ read (item) {
62
+ post('/webmeterapi/saveSingleTable', {
63
+ data: {
64
+ tablename: 't_iot_device_exception',
65
+ param: { id: item.e_id, f_is_read: 1 }
66
+ }
67
+ }).then(res => {
68
+ this.refresh()
69
+ })
70
+ },
71
+ get_to_be_confirmed (item) {
72
+ try {
73
+ if (this.$login.f.name) {
74
+ post('/webmetersql/getToBeConfirmed', { data: { condition: `state = '待确认' and f_affirm_by = '${this.$login.f.name}'` } }).then(res => {
75
+ this.backlog = [...res]
76
+ })
77
+ }
78
+ } catch (e) {
79
+ console.log(e)
80
+ }
81
+ },
82
+ 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
+ })
95
+ },
96
+ refresh () {
97
+ post('/webmeterapi/commonQuery', {
98
+ queryParamsName: 'deviceExceptionQueryParams',
99
+ conditionParams: { e_f_is_read: 0 },
100
+ pageNo: 1,
101
+ pageSize: 999999
102
+ }).then(res => {
103
+ this.exception = res.data
104
+ })
105
+ },
106
+ fetchNotice () {
107
+ if (this.loading) {
108
+ this.loading = false
109
+ return
110
+ }
111
+ this.loadding = true
112
+ setTimeout(() => {
113
+ this.loadding = false
114
+ }, 1000)
115
+ }
116
+ }
117
+ }
118
+ </script>
119
+
120
+ <style lang="less">
121
+ .header-notice {
122
+ display: inline-block;
123
+ transition: all 0.3s;
124
+
125
+ span {
126
+ vertical-align: initial;
127
+ }
128
+
129
+ .notice-badge {
130
+ color: inherit;
131
+
132
+ .header-notice-icon {
133
+ font-size: 16px;
134
+ padding: 4px;
135
+ }
136
+ }
137
+ }
138
+
139
+ .dropdown-tabs {
140
+ background-color: @base-bg-color;
141
+ box-shadow: 0 2px 8px @shadow-color;
142
+ border-radius: 4px;
143
+
144
+ .tab-pane {
145
+ padding: 0 24px 12px;
146
+ min-height: 250px;
147
+ }
148
+ }
149
+ </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