system-clients 3.1.89-19 → 3.1.89-20-rongchuang-3

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": "system-clients",
3
- "version": "3.1.89-19",
3
+ "version": "3.1.89-20-rongchuang-3",
4
4
  "description": "系统基础框架",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -197,6 +197,11 @@
197
197
  // value: 25645.26,
198
198
  // AddChangeMsgShow: false,
199
199
  // showsum: false
200
+ lockReconnect: false, // 避免重复连接
201
+ timeout: 10000, // 10秒发一次心跳
202
+ connectNumber: 10, // 重连次数
203
+ timeoutObj: null,
204
+ serverTimeoutObj: null
200
205
  }
201
206
  },
202
207
  ready () {
@@ -244,8 +249,90 @@
244
249
  // return false
245
250
  // }
246
251
  this.changeShow()
252
+ vue.prototype.$connectNumber = this.connectNumber
253
+ this.initWebSocket()
247
254
  },
248
255
  methods: {
256
+ // 清除
257
+ reset () {
258
+ clearTimeout(this.timeoutObj)
259
+ clearTimeout(this.serverTimeoutObj)
260
+ },
261
+ // 发送心跳
262
+ start () {
263
+ // 重置
264
+ vue.prototype.$connectNumber = this.connectNumber
265
+ this.timeoutObj = setTimeout(() => {
266
+ this.$socket.send('ping')
267
+ console.log('ping!')
268
+ this.serverTimeoutObj = setTimeout(() => {
269
+ this.$socket.close()
270
+ }, this.timeout)
271
+ }, this.timeout)
272
+ },
273
+ // 重连
274
+ reconnect () {
275
+ if (this.lockReconnect) return
276
+ // if (this.$connectNumber <= 0) {
277
+ // vue.showMessage('连接已断开,将无法接收消息,请重新登录', ['confirm']).then((res) => {
278
+ // if (res === 'confirm') {
279
+ // location.reload()
280
+ // }
281
+ // })
282
+ // return
283
+ // }
284
+ // this.$connectNumber--
285
+ setTimeout(() => {
286
+ console.log('连接异常,尝试重新连接。。。。')
287
+ this.initWebSocket()
288
+ this.lockReconnect = false
289
+ }, 1000 * 60)
290
+ },
291
+ // 初始化
292
+ initWebSocket () {
293
+ let path = `ws://${location.host}/ws?token=${this.$login.f.id}`
294
+ try {
295
+ if ('WebSocket' in window) {
296
+ // 创建对象
297
+ vue.prototype.$socket = new WebSocket(path)
298
+ } else {
299
+ this.$showMessage('您的浏览器不支持websocket的协议,建议使用新版谷歌浏览器,请勿使用IE浏览器,360浏览器请使用极速模式,不要使用兼容模式!"')
300
+ }
301
+ } catch (e) {
302
+ this.reconnect()
303
+ }
304
+
305
+ this.$socket.onopen = this.onOpen // 连接成功
306
+ this.$socket.onmessage = this.onMessage // 收到消息时回调
307
+ this.$socket.onclose = this.onClose // 连接关闭时回调
308
+ this.$socket.onerror = this.onError // 通讯异常
309
+ },
310
+ // 通讯异常
311
+ onError () {
312
+ this.reconnect()
313
+ },
314
+ // 连接成功
315
+ onOpen () {
316
+ console.log('webSocket连接成功')
317
+ this.start()
318
+ },
319
+ // 收到消息时回调函数
320
+ onMessage (event) {
321
+ if (event.data === 'pong') {
322
+ this.reset()
323
+ this.start()
324
+ return
325
+ }
326
+ let data = JSON.parse(event.data)
327
+ this.$broadcast('onMessage', data)
328
+ this.$showMessage(data.message)
329
+ },
330
+ // 关闭连接时回调函数
331
+ onClose () {
332
+ console.log('webSocket连接断开')
333
+ this.reset()
334
+ this.reconnect()
335
+ },
249
336
  hindsetting(){
250
337
 
251
338
  this.setting=!this.setting
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="flex">
3
3
  <p class="bg-info text-center" style="padding: 8px;">参数管理
4
- <span class="btn btn-link add-postition" @click="add('t_parameter')">新增</span>
4
+ <button type="button" name="button" class="button_search button_spacing width-60" @click="add('t_parameter')" style="float:right">新增</button>
5
5
  </p>
6
6
  <div class="auto">
7
7
  <form class="form-horizontal" style="margin-bottom: 5px;">
@@ -25,7 +25,7 @@
25
25
  </form>
26
26
  </div>
27
27
  <div class="span">
28
- <data-grid :model="model" v-ref:params @select-changed="selected" class="list_area table_sy">
28
+ <data-grid :model="model" v-ref:params @select-changed="selected">
29
29
  <template partial='head'>
30
30
  <tr>
31
31
  <th>序号</th>
@@ -50,7 +50,7 @@
50
50
 
51
51
  <p v-if="selectItem" class="bg-info text-center" style="padding: 8px;margin: 8px 0px;">
52
52
  {{selectItem.name}}
53
- <span class="btn btn-link add-postition" @click="add('t_paramvalue')">新增</span>
53
+ <button type="button" name="button" class="button_search button_spacing width-60" @click="add('t_paramvalue')" style="float:right">新增</button>
54
54
  </p>
55
55
  <div v-if="selectItem" class="span">
56
56
  <data-grid :model="params" v-ref:selects >
@@ -2,7 +2,7 @@
2
2
  <div class="flex">
3
3
  <p class="bg-info text-center" style="padding: 8px;">
4
4
  单值管理
5
- <span class="btn btn-link add-postition" @click="add()">新增</span>
5
+ <button type="button" name="button" class="button_search button_spacing width-60 " @click="add()" style="float:right">新增</button>
6
6
  </p>
7
7
  <div class="auto">
8
8
  <form class="form-horizontal" style="margin-bottom: 5px;">
@@ -27,7 +27,7 @@
27
27
  </div>
28
28
  <div class="span">
29
29
  <partial-view v-ref:single-load>
30
- <data-grid :model="model" v-ref:grid class="list_area table_sy">
30
+ <data-grid :model="model" v-ref:grid >
31
31
  <template partial='head'>
32
32
  <tr>
33
33
  <th>序号</th>
@@ -1,17 +1,30 @@
1
1
  <template>
2
2
  <div class="syslogin">
3
3
  <div class="login-title" >
4
- <div class="login-title-chi" style="white-space: nowrap">
5
- <img src="../../../static/newStyle/login-info.png"/>
6
- <span>关于我们</span>
7
- <img src="../../../static/newStyle/login-con.png"/>
8
- <span>联系我们</span>
4
+ <div class="row auto">
5
+ <marquee style="width:80%;margin-top:25px"><span style="font-size: 1.8rem;color: white;">{{notice}}</span></marquee>
6
+ <div class="login-title-chi" style="white-space: nowrap">
7
+ <img src="../../../static/newStyle/login-info.png"/>
8
+ <span @click="showus=true">关于我们</span>
9
+ <img src="../../../static/newStyle/login-con.png"/>
10
+ <span>联系我们</span>
11
+ </div>
9
12
  </div>
10
13
  </div>
14
+
15
+ <modal :show.sync="showus" backdrop="true" width="50%" style="width:auto;">
16
+ <article slot="modal-body" class="modal-body" >
17
+ <img style="height:100%;width:100%" src="../../../static/newStyle/about-us.png"/>
18
+ </article>
19
+ <footer slot="modal-footer" class="modal-footer">
20
+ </footer>
21
+ </modal>
22
+
23
+
11
24
  <div class="logoew" v-if="logoandroid" >
12
25
  <div v-if="logoandroid" class="imglogo"></div>
13
- <p class="logocontent">燃气客服系统Android版</p>
14
- <p class="logofooter">(仅浏览器扫描)</p>
26
+ <p class="logocontent">燃气客服系统Android版</p>
27
+ <p class="logofooter">(仅浏览器扫描)</p>
15
28
  </div>
16
29
  <!--输入框-->
17
30
  <div class="loginmain">
@@ -103,6 +116,7 @@
103
116
  import co from 'co'
104
117
  import $ from 'jquery'
105
118
  import Vue from 'vue'
119
+ import {HttpResetClass} from 'vue-client'
106
120
 
107
121
  let saveGen = function *(self) {
108
122
  try {
@@ -190,7 +204,19 @@
190
204
  }
191
205
  export default {
192
206
  title: '登录',
193
- ready () {
207
+ async ready () {
208
+ let http = new HttpResetClass()
209
+ let res = await http.load('POST', 'rs/sql/singleTable',
210
+ {data:{
211
+ tablename: 't_changedeclare',
212
+ condition: ` f_type ='变更通知' `
213
+ }
214
+ }, {resolveMsg: null, rejectMsg: '获取通知出错!!'})
215
+ if(res.data.length>0){
216
+ console.log("---------------获取通知",res.data[0].f_change_message)
217
+ this.notice=res.data[0].f_change_message
218
+ }
219
+
194
220
  if (this.$login && this.$login.getUrlCompileParames('name') && this.$login.getUrlCompileParames('password')) {
195
221
  this.model.ename = this.$login.getUrlCompileParames('name')
196
222
  this.model.password = this.$login.getUrlCompileParames('password')
@@ -228,7 +254,9 @@
228
254
  picLyanzhengma: '',
229
255
  // 修改密码弹框展示
230
256
  modifyPwShow: false,
231
- logoandroid:false
257
+ logoandroid:false,
258
+ showus:false,
259
+ notice:''
232
260
  }
233
261
  },
234
262
  methods: {
@@ -3,6 +3,7 @@
3
3
  :value.sync="selectres"
4
4
  :multiple="isMul"
5
5
  search="true"
6
+ :disabled="mustselect"
6
7
  :close-on-select="!isMul"
7
8
  @change="resChange"
8
9
  >
@@ -33,6 +34,10 @@
33
34
  type: Array,
34
35
  default() { return [] },
35
36
  },
37
+ mustselect: {
38
+ type: Boolean,
39
+ default: false
40
+ },
36
41
  },
37
42
  data () {
38
43
  return {
@@ -1,184 +1,196 @@
1
- <template>
2
- <div :class="style" v-show="companyshow">
3
- <label class="font_normal_body">公&emsp;&emsp;司</label>
4
- <right-tree @re-res="getorg"
5
- :initresid='initres.org'></right-tree>
6
- </div>
7
- <div :class="style" v-show="departmentshow">
8
- <label class="font_normal_body">部&emsp;&emsp;门</label>
9
- <res-select restype='department' v-ref:department
10
- @res-select="getdep"
11
- :parentresid="depresid"
12
- :initresid='initres.dep'
13
- :is-mul="mul">
14
- </res-select>
15
- </div>
16
- <div :class="style" v-show="operatorshow && (!cascade)">
17
- <label class="font_normal_body">人&emsp;&emsp;员</label>
18
- <res-select restype='user'
19
- @res-select="getuser"
20
- :parentresid="depresid"
21
- :initresid='initres.user'
22
- :is-mul="mul">
23
- </res-select>
24
- </div>
25
- <div :class="style" v-show="operatorshow && cascade">
26
- <label class="font_normal_body">人&emsp;&emsp;员</label>
27
- <res-select restype='user'
28
- @res-select="getuser"
29
- :parentresid="userresid"
30
- :initresid='initres.user'
31
- :is-mul="mul">
32
- </res-select>
33
- </div>
34
- <div :class="style " v-if="sliceareashow" >
35
- <label class="font_normal_body">片&emsp;&emsp;区</label>
36
- <v-select :value.sync="slice_area" v-model="slice_area" @change='getarea'
37
- :options='sliceArea' placeholder='片区/管理站' filer-key="name"
38
- close-on-select v-ref:slice>
39
- </v-select>
40
- </div>
41
- </template>
42
- <script>
43
- import plugin from '../../plugins/GetLoginInfoService'
44
- import { HttpResetClass } from 'vue-client'
45
- export default {
46
- title: '资源选择测试',
47
- props: {
48
- style: {
49
- type: String,
50
- default: 'col-sm-2 form-group'
51
- },
52
- mul: {
53
- type: Boolean,
54
- default: true
55
- },
56
- //初始值
57
- initres: {
58
- type: Object,
59
- default: null,
60
- },
61
- showComponent:{
62
- default:['company','department','operator','slicearea']
63
- },
64
- //人员是否和部门关联
65
- cascade: {
66
- type: Boolean,
67
- default: false
68
- }
69
- },
70
- data () {
71
- return {
72
- orgresid:[this.$login.f.orgid],
73
- depresid:[],
74
- userresid:[],
75
- sliceArea: [],
76
- slice_area:[],
77
- companyshow:false,
78
- departmentshow:false,
79
- operatorshow:false,
80
- sliceareashow:false,
81
- obj:{
82
- orgnames:[],
83
- depnames:[],
84
- operatornames:[]
85
- }
86
- }
87
- },
88
- ready () {
89
- if(this.$login.r.includes('部门默认选中')){
90
- this.initres.dep = [this.$login.f.depids]
91
- }
92
- if(this.$login.r.includes('人员默认选中')){
93
- this.initres.user = [this.$login.f.id]
94
- }
95
- this.initComponent();
96
- this.initAreas(this.$login.f.orgid)
97
- },
98
- methods:{
99
- initComponent(){
100
- let self=this;
101
- this.showComponent.find((item)=>{
102
- switch(item){
103
- case 'company': self.companyshow=true; break;
104
- case 'department': self.departmentshow=true; break;
105
- case 'operator': self.operatorshow=true; break;
106
- case 'slicearea': self.sliceareashow=true; break;
107
- }
108
- })
109
- },
110
- // 初始化片区
111
- async initAreas (val) {
112
- if (val) {
113
- let http = new HttpResetClass()
114
- let getAllArea = await http.load('POST', '/rs/search', {
115
- source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
116
- userid: this.$login.f.id
117
- }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
118
- let arr = getAllArea.data.filter((res) => {
119
- return res.parentid == val
120
- })
121
- this.sliceArea = []
122
- this.slice_area = []
123
- arr.forEach((res) => {
124
- this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
125
- })
126
- }
127
- },
128
- returnOrg(ids){
129
- let limit = this.$login.r.includes('数据授权限定')
130
-
131
- let condition;
132
- if(this.depresid.length > 0)
133
- condition = " and f_orgid in " + plugin.convertToIn(this.depresid);
134
- else
135
- condition = " and f_orgid = " + this.$login.f.orgid;
136
- if(this.userresid.length > 0){
137
- condition += " and f_depid in " + plugin.convertToIn(this.userresid);
138
- } else {
139
- if (limit) {
140
- let depids = []
141
- for (let row of this.$refs.department.resoptions) {
142
- depids.push(row.value)
143
- }
144
- let depid = depids.length ? plugin.convertToIn(depids) : ('')
145
- condition += " and f_depid in " + depid;
146
- }
147
- }
148
- if(ids && ids.length > 0){
149
- condition += " and f_operatorid in " + plugin.convertToIn(ids);
150
- }
151
- if(this.slice_area.length>0){
152
- condition += " and f_zones = '" + this.slice_area[0].name+"'"
153
- }
154
- this.$dispatch('re-res',condition,this.obj)
155
- },
156
- getorg (obj) {
157
- this.depresid=obj.resids
158
- this.obj.orgnames = obj.res
159
- this.initAreas(obj.resids)
160
- this.returnOrg();
161
- },
162
- getdep(obj,val) {
163
- this.obj.depnames = val
164
- this.userresid=obj
165
- this.returnOrg();
166
- },
167
- getuser(obj) {
168
- this.obj.operatornames = obj
169
- this.returnOrg(obj);
170
- },
171
- getarea(val) {
172
- this.slice_area=val
173
- if(this.obj.operatornames){
174
- this.returnOrg(this.obj.operatornames);
175
- }else{
176
- this.returnOrg();
177
- }
178
- }
179
- },
180
- watch: {
181
-
182
- }
183
- }
184
- </script>
1
+ <template>
2
+ <div :class="style" v-show="companyshow">
3
+ <label class="font_normal_body">公&emsp;&emsp;司</label>
4
+ <right-tree @re-res="getorg"
5
+ :mustselect="mustselect"
6
+ :initresid='initres.org'></right-tree>
7
+ </div>
8
+ <div :class="style" v-show="departmentshow">
9
+ <label class="font_normal_body">部&emsp;&emsp;门</label>
10
+ <res-select restype='department' v-ref:department
11
+ @res-select="getdep"
12
+ :parentresid="depresid"
13
+ :initresid='initres.dep'
14
+ :mustselect="mustselect"
15
+ :is-mul="mul">
16
+ </res-select>
17
+ </div>
18
+ <div :class="style" v-show="operatorshow && (!cascade)">
19
+ <label class="font_normal_body">人&emsp;&emsp;员</label>
20
+ <res-select restype='user'
21
+ @res-select="getuser"
22
+ :parentresid="depresid"
23
+ :initresid='initres.user'
24
+ :mustselect="mustselect"
25
+ :is-mul="mul">
26
+ </res-select>
27
+ </div>
28
+ <div :class="style" v-show="operatorshow && cascade">
29
+ <label class="font_normal_body">人&emsp;&emsp;员</label>
30
+ <res-select restype='user'
31
+ @res-select="getuser"
32
+ :parentresid="userresid"
33
+ :initresid='initres.user'
34
+ :mustselect="mustselect"
35
+ :is-mul="mul">
36
+ </res-select>
37
+ </div>
38
+ <div :class="style " v-if="sliceareashow" >
39
+ <label class="font_normal_body">片&emsp;&emsp;区</label>
40
+ <v-select :value.sync="slice_area" v-model="slice_area" @change='getarea'
41
+ :options='sliceArea' placeholder='片区/管理站' filer-key="name"
42
+ close-on-select v-ref:slice>
43
+ </v-select>
44
+ </div>
45
+ </template>
46
+ <script>
47
+ import plugin from '../../plugins/GetLoginInfoService'
48
+ import { HttpResetClass } from 'vue-client'
49
+ export default {
50
+ title: '资源选择测试',
51
+ props: {
52
+ style: {
53
+ type: String,
54
+ default: 'col-sm-2 form-group'
55
+ },
56
+ mul: {
57
+ type: Boolean,
58
+ default: true
59
+ },
60
+ //初始值
61
+ initres: {
62
+ type: Object,
63
+ default: null,
64
+ },
65
+ showComponent:{
66
+ default:['company','department','operator','slicearea']
67
+ },
68
+ //人员是否和部门关联
69
+ cascade: {
70
+ type: Boolean,
71
+ default: false
72
+ },
73
+ selectin: {
74
+ type: Boolean,
75
+ default: false
76
+ }
77
+ },
78
+ data () {
79
+ return {
80
+ orgresid:[this.$login.f.orgid],
81
+ depresid:[],
82
+ userresid:[],
83
+ sliceArea: [],
84
+ slice_area:[],
85
+ companyshow:false,
86
+ departmentshow:false,
87
+ operatorshow:false,
88
+ sliceareashow:false,
89
+ mustselect:false,
90
+ obj:{
91
+ orgnames:[],
92
+ depnames:[],
93
+ operatornames:[]
94
+ }
95
+ }
96
+ },
97
+ ready () {
98
+ if(this.$login.r.includes('部门默认选中')&& this.selectin){
99
+ this.initres.dep = [this.$login.f.depids]
100
+ }
101
+ if(this.$login.r.includes('人员默认选中')&& this.selectin){
102
+ this.initres.user = [this.$login.f.id]
103
+ if(this.$login.r.includes('人员强制选中')){
104
+ this.mustselect = true
105
+ }
106
+ }
107
+ this.initComponent();
108
+ this.initAreas(this.$login.f.orgid)
109
+ },
110
+ methods:{
111
+ initComponent(){
112
+ let self=this;
113
+ this.showComponent.find((item)=>{
114
+ switch(item){
115
+ case 'company': self.companyshow=true; break;
116
+ case 'department': self.departmentshow=true; break;
117
+ case 'operator': self.operatorshow=true; break;
118
+ case 'slicearea': self.sliceareashow=true; break;
119
+ }
120
+ })
121
+ },
122
+ // 初始化片区
123
+ async initAreas (val) {
124
+ if (val) {
125
+ let http = new HttpResetClass()
126
+ let getAllArea = await http.load('POST', '/rs/search', {
127
+ source: 'this.getParentByType($organization$).getAllChildrens().where(row.getType() == $zone$)',
128
+ userid: this.$login.f.id
129
+ }, {resolveMsg: null, rejectMsg: '获取片区出错!!!'})
130
+ let arr = getAllArea.data.filter((res) => {
131
+ return res.parentid == val
132
+ })
133
+ this.sliceArea = []
134
+ this.slice_area = []
135
+ arr.forEach((res) => {
136
+ this.sliceArea.push({label: res.name, value: {name: res.name, code:res.number}})
137
+ })
138
+ }
139
+ },
140
+ returnOrg(ids){
141
+ let limit = this.$login.r.includes('数据授权限定')
142
+
143
+ let condition;
144
+ if(this.depresid.length > 0)
145
+ condition = " and f_orgid in " + plugin.convertToIn(this.depresid);
146
+ else
147
+ condition = " and f_orgid = " + this.$login.f.orgid;
148
+ if(this.userresid.length > 0){
149
+ condition += " and f_depid in " + plugin.convertToIn(this.userresid);
150
+ } else {
151
+ if (limit) {
152
+ let depids = []
153
+ for (let row of this.$refs.department.resoptions) {
154
+ depids.push(row.value)
155
+ }
156
+ let depid = depids.length ? plugin.convertToIn(depids) : ('')
157
+ condition += " and f_depid in " + depid;
158
+ }
159
+ }
160
+ if(ids && ids.length > 0){
161
+ condition += " and f_operatorid in " + plugin.convertToIn(ids);
162
+ }
163
+ if(this.slice_area.length>0){
164
+ condition += " and f_zones = '" + this.slice_area[0].name+"'"
165
+ }
166
+ this.$dispatch('re-res',condition,this.obj)
167
+ },
168
+ getorg (obj) {
169
+ this.depresid=obj.resids
170
+ this.obj.orgnames = obj.res
171
+ this.initAreas(obj.resids)
172
+ this.returnOrg();
173
+ },
174
+ getdep(obj,val) {
175
+ this.obj.depnames = val
176
+ this.userresid=obj
177
+ this.returnOrg();
178
+ },
179
+ getuser(obj) {
180
+ this.obj.operatornames = obj
181
+ this.returnOrg(obj);
182
+ },
183
+ getarea(val) {
184
+ this.slice_area=val
185
+ if(this.obj.operatornames){
186
+ this.returnOrg(this.obj.operatornames);
187
+ }else{
188
+ this.returnOrg();
189
+ }
190
+ }
191
+ },
192
+ watch: {
193
+
194
+ }
195
+ }
196
+ </script>
@@ -26,6 +26,7 @@
26
26
  <v-select v-if="islist"
27
27
  placeholder='请选择'
28
28
  :options='childrenOptions'
29
+ :disabled="mustselect"
29
30
  @change="selectclick"
30
31
  :value-single="true"
31
32
  close-on-select></v-select>
@@ -132,6 +133,10 @@ export default {
132
133
  type: String,
133
134
  default:''
134
135
  },
136
+ mustselect: {
137
+ type: Boolean,
138
+ default: false
139
+ },
135
140
  width:{
136
141
  type:String,
137
142
  default:'60%'