manage-client 3.2.134 → 3.2.137

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.
@@ -1,79 +1,137 @@
1
1
  <template>
2
2
  <div class="flex">
3
- <div class="row" style="height: 5%">
4
- <div class="col-sm-10">
5
- <label class="font_normal_body">报表名称:</label>
6
- <v-select multiple
7
- :value.sync="modelinfo.f_report_name"
8
- class="select_list select"
9
- v-model="modelinfo.f_report_name"
10
- :options='reportNames' placeholder='请选择'
11
- @keyup.enter="chaxun()"
12
- ></v-select>
13
- </div>
14
- <div class="col-sm-2">
15
- <button class="button_search left" @click="chaxun()">查询</button>
16
- &nbsp;&nbsp;
17
- </div>
18
- </div>
19
- <partial-view v-ref:pv>
20
- <div class="span" v-show="!filtrate">
21
- <p class="bg-info text-center" style="padding: 8px;background: #5ac0d9;color: white;border-radius:10px 10px 0 0" >报表类型
22
- <button class="button_search-3 button_spacing border-right" v-if="this.$login.r.includes('报表配置权限')" @click="saveReport()">新增</button></p>
3
+ <div class="row" style="height: 5%">
4
+ <div class="col-sm-10">
5
+ <label class="font_normal_body">报表名称:</label>
6
+ <v-select multiple
7
+ :value.sync="modelinfo.f_report_name"
8
+ class="select_list select"
9
+ v-model="modelinfo.f_report_name"
10
+ :options='reportNames' placeholder='请选择'
11
+ @keyup.enter="chaxun()"
12
+ ></v-select>
13
+ </div>
14
+ <div class="col-sm-2">
15
+ <button class="button_search left" @click="chaxun()">查询</button>
16
+ &nbsp;&nbsp;
17
+ </div>
18
+ </div>
19
+ <partial-view v-ref:pv>
20
+ <div class="span" v-show="!filtrate && !reportHistory">
21
+ <p class="bg-info text-center" style="padding: 8px;background: #5ac0d9;color: white;border-radius:10px 10px 0 0">
22
+ <button class="button_search-3 button_spacing border-right" @click="showReportHistory()">历史报表</button>
23
+ <button class="button_search-3 button_spacing border-right" @click="$dispatch('save-report-html')">保存报表</button>
24
+ </p>
25
+ <p class="bg-info text-center"
26
+ style="padding: 8px;background: #5ac0d9;color: white;border-radius:10px 10px 0 0">报表类型
27
+ <button class="button_search-3 button_spacing border-right" v-if="this.$login.r.includes('报表配置权限')"
28
+ @click="saveReport()">新增
29
+ </button>
30
+ </p>
23
31
  <div style="height: 87%;overflow: auto;width: 104%">
24
- <div style="padding:3px" :style="{background: index===row ? '#dfedfb' : 'white'}" :class="styles=='2'?'col-sm-6 auto':'col-sm-12 auto'" v-for="(index,type) in types"
25
- @click="$dispatch('select-type',index, type),changecolor(index,type,'0')"
32
+ <div style="padding:3px" :style="{background: index===row ? '#dfedfb' : 'white'}"
33
+ :class="styles=='2'?'col-sm-6 auto':'col-sm-12 auto'" v-for="(index,type) in types"
34
+ @click="$dispatch('select-type',index, type),changecolor(index,type,'0')"
26
35
  :id="'div-'+index">
27
- <div class="row auto"><img :src="type.f_image_path" alt="图片加载失败" class="img-rounded" style="width: 60px;"></div>
28
- <div style="height:40px" class="row auto">{{index+1}}、
29
- <span @click="changecolor(index,type,'1')" title="点击报表名称可对该报表配置进行修改!注:需要权限【报表配置权限】">{{type.f_report_name}}</span></div>
36
+ <div class="row auto"><img :src="type.f_image_path" alt="图片加载失败" class="img-rounded" style="width: 60px;">
30
37
  </div>
38
+ <div style="height:40px" class="row auto">{{ index + 1 }}、
39
+ <span @click="changecolor(index,type,'1')"
40
+ title="点击报表名称可对该报表配置进行修改!注:需要权限【报表配置权限】">{{ type.f_report_name }}</span></div>
41
+ </div>
31
42
  </div>
32
-
33
43
  </div>
34
- <div class="span" v-show="filtrate">
35
- <p class="bg-info text-center" style="padding: 8px;background: #5ac0d9;color: white;border-radius:10px 10px 0 0">
44
+ <div class="span" v-show="filtrate && !reportHistory">
45
+ <p class="bg-info text-center"
46
+ style="padding: 8px;background: #5ac0d9;color: white;border-radius:10px 10px 0 0">
36
47
  <!--true新增,false修改-->
37
- {{saveflag?'新增报表':'修改报表配置'}}
48
+ {{ saveflag ? '新增报表' : '修改报表配置' }}
38
49
  </p>
39
50
  <div style="height: 94%;overflow: auto;width: 104%">
40
51
  <table style="border-style: none;width: 95%;">
41
52
 
42
53
  <tr style="display:block;margin:15px 0;" v-for="(key,value) in infos">
43
54
  <td style="text-align: left;">
44
- <label class="font_normal_body" style="text-align: right;">{{key}}:</label>
45
- <input type="text" style="width: 70%;" class="input_search" v-model="value" v-bind:title="[key =='报表状态'?'1表示显示其他表示不显示':'']"/>
55
+ <label class="font_normal_body" style="text-align: right;">{{ key }}:</label>
56
+ <input type="text" style="width: 70%;" class="input_search" v-model="value"
57
+ v-bind:title="[key =='报表状态'?'1表示显示其他表示不显示':'']"/>
46
58
  </td>
47
59
  </tr>
48
60
  <tr style="display:block;margin:15px 0;">
49
- <td style="text-align: right;width: 50%;"><button class="button_clear button_spacing" @click="clear(true)">清空</button></td>
61
+ <td style="text-align: right;width: 50%;">
62
+ <button class="button_clear button_spacing" @click="clear(true)">清空</button>
63
+ </td>
50
64
  <!--修改的保存-->
51
- <td style="text-align: right;width: 25%;" v-if="!saveflag"><button class="button_clear button_spacing" @click="saveOrUpdate(1)">保存</button></td>
65
+ <td style="text-align: right;width: 25%;" v-if="!saveflag">
66
+ <button class="button_clear button_spacing" @click="saveOrUpdate(1)">保存</button>
67
+ </td>
52
68
  <!--新增的保存-->
53
- <td style="text-align: left;width: 25%;" v-if="saveflag"><button class="button_search button_spacing" @click="saveOrUpdate(2)">保存</button></td>
54
- <td style="text-align: left;width: 25%;"><button class="button_search button_spacing" @click="goback">返回</button></td>
69
+ <td style="text-align: left;width: 25%;" v-if="saveflag">
70
+ <button class="button_search button_spacing" @click="saveOrUpdate(2)">保存</button>
71
+ </td>
72
+ <td style="text-align: left;width: 25%;">
73
+ <button class="button_search button_spacing" @click="goback">返回</button>
74
+ </td>
55
75
  </tr>
56
76
  </table>
57
77
  </div>
78
+ </div>
58
79
 
80
+ <div style="overflow: auto;width: 104%" v-show="reportHistory">
81
+ <criteria-paged :model="model" v-ref:paged>
82
+ <criteria partial='criteria' @condition-changed='search' v-ref:criteria>
83
+ <p class="bg-info text-center" style="padding: 8px;">报表历史纪录</p>
84
+ <div novalidate class="form-horizontal select-overspread container-fluid auto" partial >
85
+ <div class="row">
86
+ <div class="col-sm-6 form-group" >
87
+ <input placeholder='报表名' type="text" class="form-control" v-model="model.f_files_name" condition="f_files_name like '%{}%'">
88
+ </div>
89
+ <div class="col-sm-3 form-group">
90
+ <button class="button_search button_spacing" @click="search">查询</button>
91
+ </div>
92
+ <div class="col-sm-3 form-group">
93
+ <button class="button_search button_spacing" @click="$parent.$parent.$parent.goback">返回</button>
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </criteria>
98
+ <data-grid :model="model" partial='list' v-ref:grid id="test" >
99
+ <template partial='head'>
100
+ <tr>
101
+ <th>表名</th>
102
+ <th>保存人</th>
103
+ <th>保存时间</th>
104
+ <!-- <th>操作</th>-->
105
+ </tr>
106
+ </template>
107
+ <template partial='body' >
108
+ <td>{{row.f_files_name}}</td>
109
+ <td>{{row.f_operator}}</td>
110
+ <td>{{row.f_operate_date}}</td>
111
+ <!-- <td><button type="button" class="btn btn-link" @click.stop="$parent.$parent.$parent.delete(row)">删除</button></td>-->
112
+ </template>
113
+ </data-grid>
114
+ </criteria-paged>
59
115
  </div>
60
116
  </partial-view>
61
117
  </div>
62
118
  </template>
63
119
 
64
120
  <script>
65
- import {HttpResetClass} from "vue-client";
121
+ import {HttpResetClass, PagedList} from "vue-client";
66
122
 
67
123
  export default {
68
124
  title: '报表选项',
69
125
  props: {
70
- inindex:{}
126
+ inindex: {}
71
127
  },
72
128
  data () {
73
129
  return {
130
+ model: new PagedList('rs/sql/manage_singleTable', 50, {items: '"*"', tablename: '"t_report_record"', orderitem: '"f_operate_date desc"'}),
131
+ reportHistory: false,
74
132
  saveflag: false,
75
133
  types: [],
76
- row:null,
134
+ row: null,
77
135
  infos: {
78
136
  '报表名称': '',
79
137
  '连接页面': '',
@@ -82,15 +140,15 @@ export default {
82
140
  '添 加 人': '',
83
141
  '报表状态': ''
84
142
  },
85
- styles:this.$appdata.getSingleValue('报表样式')?this.$appdata.getSingleValue('报表样式'):'2',
86
- saveinfo:{},
87
- filtrate:false,
143
+ styles: this.$appdata.getSingleValue('报表样式') ? this.$appdata.getSingleValue('报表样式') : '2',
144
+ saveinfo: {},
145
+ filtrate: false,
88
146
  modelinfo: {
89
147
  f_report_name: '',
90
148
  f_report_type: '',
91
149
  f_rank: '1'
92
150
  },
93
- config:{
151
+ config: {
94
152
  f_report_name: '报表名称',
95
153
  f_report_path: '连接页面',
96
154
  f_report_type: '报表类型',
@@ -98,59 +156,67 @@ export default {
98
156
  f_operator: '添 加 人',
99
157
  f_rank: '报表状态'
100
158
  },
101
- conditionStr:'1=1',
159
+ conditionStr: '1=1',
102
160
  reportNames: [],
103
161
  reportTypes: [],
104
- reportState : [{label: '全部', value: ''},{label: '显示', value: '1'},{label: '未显示', value: 'null'},],
162
+ reportState: [{label: '全部', value: ''}, {label: '显示', value: '1'}, {label: '未显示', value: 'null'},],
105
163
  tablename: 't_report_type'
106
164
  }
107
165
  },
108
- ready (){
166
+ ready () {
109
167
  // 获取所有报表类型
110
- this.getReportInfo(null,'1=1 and f_rank=1')
168
+ this.getReportInfo(null, '1=1 and f_rank=1')
111
169
  this.getReportName()
112
170
  this.getReportType()
113
171
  },
114
172
  methods: {
115
- getReportInfo(tname,cond){
173
+ search () {
174
+ this.$refs.paged.$refs.criteria.search()
175
+ },
176
+ showReportHistory () {
177
+ this.reportHistory = true
178
+ this.model.search('1=1')
179
+ },
180
+ getReportInfo (tname, cond) {
116
181
  this.$refs.pv.load('rs/sql/manageSingleTable', {
117
182
  data: {
118
- tablename: tname ? tname:this.tablename,
119
- condition: cond ? cond:this.conditionStr
183
+ tablename: tname ? tname : this.tablename,
184
+ condition: cond ? cond : this.conditionStr
120
185
  }
121
186
  }).then((res) => {
122
- console.log('sssss:',res.data)
187
+ console.log('sssss:', res.data)
123
188
  this.types = res.data
124
189
  }).catch((error) => {
125
190
 
126
191
  })
127
192
  },
128
193
  // 返回
129
- goback(){
194
+ goback () {
130
195
  this.chaxun()
131
196
  },
132
197
  // 保存
133
- saveReport(){
198
+ saveReport () {
134
199
  for (let key in this.infos) {
135
- this.infos[key] =''
200
+ this.infos[key] = ''
136
201
  }
137
202
  this.saveflag = true
138
203
  this.filtrate = true
139
204
  },
140
205
  // 查询
141
- chaxun(){
206
+ chaxun () {
142
207
  this.getReportInfo()
143
208
  this.filtrate = false
209
+ this.reportHistory = false
144
210
  },
145
- changecolor(index,type,int){
146
- this.row=index
211
+ changecolor (index, type, int) {
212
+ this.row = index
147
213
 
148
214
  if (this.$login.r.includes('报表配置权限') && int === '1') {
149
215
  this.saveflag = false
150
- this.filtrate=!this.filtrate
216
+ this.filtrate = !this.filtrate
151
217
  }
152
218
  },
153
- async getReportName(){
219
+ async getReportName () {
154
220
  let HttpReset = new HttpResetClass()
155
221
  var data = await HttpReset.load('POST', 'rs/sql/singleTable_Final', {
156
222
  data: {
@@ -162,23 +228,23 @@ export default {
162
228
  }
163
229
  }, {resolveMsg: null, rejectMsg: '获取报表名称失败!'})
164
230
  let nameArr = [{label: '全部', value: ''}]
165
- for (let row of data.data){
231
+ for (let row of data.data) {
166
232
  nameArr.push({label: row.f_report_name, value: row.f_report_name})
167
233
  }
168
234
  this.reportNames = nameArr
169
235
  },
170
- clear(val){
171
- if(val){
236
+ clear (val) {
237
+ if (val) {
172
238
  for (let key in this.infos) {
173
- this.infos[key] =''
239
+ this.infos[key] = ''
174
240
  }
175
- }else{
241
+ } else {
176
242
  for (let key in this.modelinfo) {
177
- this.modelinfo[key] =[]
243
+ this.modelinfo[key] = []
178
244
  }
179
245
  }
180
246
  },
181
- async getReportType(){
247
+ async getReportType () {
182
248
  let HttpReset = new HttpResetClass()
183
249
  var data = await HttpReset.load('POST', 'rs/sql/singleTable_Final', {
184
250
  data: {
@@ -190,38 +256,41 @@ export default {
190
256
  }
191
257
  }, {resolveMsg: null, rejectMsg: '获取报表类型失败!'})
192
258
  let typeArr = [{label: '全部', value: ''}]
193
- for (let row of data.data){
259
+ for (let row of data.data) {
194
260
  typeArr.push({label: row.f_report_type, value: row.f_report_type})
195
261
  }
196
262
  this.reportTypes = typeArr
197
263
  },
198
- saveOrUpdate(val){
264
+ saveOrUpdate (val) {
199
265
  // let sv={}
200
- for(let [key, value] of Object.entries(this.config)){
201
- let vl=this.infos[value]
202
- this.saveinfo[key]=vl
266
+ for (let [key, value] of Object.entries(this.config)) {
267
+ let vl = this.infos[value]
268
+ this.saveinfo[key] = vl
203
269
  }
204
- this.saveinfo['type']=val
270
+ this.saveinfo['type'] = val
205
271
 
206
- this.$resetpost('rs/logic/saveReport', this.saveinfo, {resolveMsg: '恭喜!提交成功!', rejectMsg: '提交错误!'}).then((res) => {
272
+ this.$resetpost('rs/logic/saveReport', this.saveinfo, {
273
+ resolveMsg: '恭喜!提交成功!',
274
+ rejectMsg: '提交错误!'
275
+ }).then((res) => {
207
276
  this.$showAlert('保存成功', 'success', 3000)
208
- this.getReportInfo(null,'1=1 and f_rank=1')
209
- this.filtrate=!this.filtrate
277
+ this.getReportInfo(null, '1=1 and f_rank=1')
278
+ this.filtrate = !this.filtrate
210
279
  })
211
- console.log('this.saveinfo+++++',this.saveinfo)
280
+ console.log('this.saveinfo+++++', this.saveinfo)
212
281
  }
213
282
  },
214
- watch :{
283
+ watch: {
215
284
  'modelinfo': {
216
285
  deep: true,
217
- handler(val) {
218
- let c='1=1 '
286
+ handler (val) {
287
+ let c = '1=1 '
219
288
  for (let [key, value] of Object.entries(val)) {
220
- if (value && value!='') {
221
- if(key=='f_rank' && value=='null'){
222
- c+='and '+ key + " is " + value +' or '+ key +" = ''"
223
- }else{
224
- c+='and '+ key + " in ('" + value.toString().replace(new RegExp(',','g'),"','") + "') "
289
+ if (value && value != '') {
290
+ if (key == 'f_rank' && value == 'null') {
291
+ c += 'and ' + key + " is " + value + ' or ' + key + " = ''"
292
+ } else {
293
+ c += 'and ' + key + " in ('" + value.toString().replace(new RegExp(',', 'g'), "','") + "') "
225
294
  }
226
295
 
227
296
  }
@@ -229,17 +298,17 @@ export default {
229
298
  this.conditionStr = c
230
299
  }
231
300
  },
232
- 'inindex' (val){
233
- this.infos={}
234
- this.saveinfo=this.types[val]
235
- let flag={}
236
- for(let [key, value] of Object.entries(this.saveinfo)){
237
- let name=this.config[key]
238
- if (name!=null){
239
- flag[name]=value
301
+ 'inindex' (val) {
302
+ this.infos = {}
303
+ this.saveinfo = this.types[val]
304
+ let flag = {}
305
+ for (let [key, value] of Object.entries(this.saveinfo)) {
306
+ let name = this.config[key]
307
+ if (name != null) {
308
+ flag[name] = value
240
309
  }
241
310
  }
242
- this.infos=flag
311
+ this.infos = flag
243
312
  }
244
313
  }
245
314
  }
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div id="unit" class="flex-row binary">
3
3
  <div class="three-left" :style="{width:'18%'}">
4
- <div class="flex">
5
- <report-items @select-type="showReportType" :inindex="index"></report-items>
6
- <!--<report-history @select-changed="showReport" v-ref:history></report-history>-->
7
- </div>
4
+ <div class="flex">
5
+ <report-items @select-type="showReportType" @save-report-html="saveReportHtml" @select-changed="showReport" :inindex="index"></report-items>
6
+ <!-- <report-history @select-changed="showReport" v-ref:history></report-history>-->
7
+ </div>
8
8
  </div>
9
9
  <!-- 使用动态页签
10
10
  <dynamic :comps='[]' name='report'></dynamic> -->
@@ -13,8 +13,23 @@
13
13
  <div class="flex" v-if="$refs.route.cards.length === 0">
14
14
  <echarts-box></echarts-box>
15
15
  </div>
16
- <route v-ref:route @save-success="$refs.history.search" v-show="!($refs.route.cards.length === 0)"></route>
16
+ <route v-ref:route @save-success="$refs.history.search" v-show="!($refs.route.cards.length === 0)"></route>
17
17
  </div>
18
+
19
+ <modal :show.sync="show" v-ref:modal small backdrop="false">
20
+ <header slot="modal-header" class="modal-header">
21
+ <h4 class="modal-title">输入文件名称</h4>
22
+ </header>
23
+ <article slot="modal-body" class="modal-body">
24
+ <div class="form-group">
25
+ <input type="text" class="form-control" v-model="filename" placeholder='保存的文件名'>
26
+ </div>
27
+ </article>
28
+ <footer slot="modal-footer" class="modal-footer">
29
+ <button v-show="show" type="button" class="btn btn-default" @click='close'>取消</button>
30
+ <button v-show="show" type="button" class="btn btn-success" @click='confirm(filename)'>确认</button>
31
+ </footer>
32
+ </modal>
18
33
  </div>
19
34
  </template>
20
35
 
@@ -23,38 +38,95 @@ export default {
23
38
  title: '报表汇总',
24
39
  data () {
25
40
  return {
41
+ filename: '',
42
+ show: false,
43
+ row: null,
26
44
  comp: [],
27
- index:''
45
+ index: ''
28
46
  }
29
47
  },
30
48
  methods: {
49
+ async confirm () {
50
+ if (!this.filename) {
51
+ this.$showAlert('无法保存,文件名不能为空', 'warning', 3000)
52
+ return
53
+ }
54
+ if (this.$refs.route.$children.length <= 0) {
55
+ this.$showAlert('无法保存,请选择一个报表并查询', 'warning', 3000)
56
+ return
57
+ }
58
+ // 验证文件是否重名
59
+ let count = await this.$resetpost('rs/sql/manageSingleTable',
60
+ {data: {tablename: 't_report_record', condition: `f_files_name = '${this.filename}'`}},
61
+ {resolveMsg: null, rejectMsg: null})
62
+ if (count.data.length > 0) {
63
+ this.$showAlert('无法保存,文件名重名', 'warning', 3000)
64
+ return
65
+ }
66
+ try {
67
+ this.$refs.route.$children[0].$refs.paged.$els.handcollect.innerHTML
68
+ } catch (e) {
69
+ this.$showAlert('当前报表无法保存, 请联系管理员', 'warning', 3000)
70
+ return
71
+ }
72
+ const param = {
73
+ f_files_name: this.filename,
74
+ f_files_content: this.$refs.route.$children[0].$refs.paged.$els.handcollect.innerHTML,
75
+ f_files_type: this.row.f_report_type,
76
+ f_component_name: this.row.f_report_path,
77
+ f_query_month: `${this.$refs.route.$children[0].model.model.startDate}-${this.$refs.route.$children[0].model.model.endDate}`,
78
+
79
+ f_operator: this.$login.f.name,
80
+ f_operator_id: this.$login.f.id,
81
+ f_orgid: this.$login.f.orgid,
82
+ f_orgname: this.$login.f.orgs,
83
+ f_depid: this.$login.f.depids,
84
+ f_depname: this.$login.f.deps,
85
+ }
86
+ let saveBack = await this.$resetpost('rs/logic/saveReportHtml', param)
87
+ if (saveBack.data.status === 'succeed') {
88
+ this.show = false
89
+ this.filename = ''
90
+ // 后台保存完成,通知刷新
91
+ this.$showAlert('保存成功!', 'success', 3000)
92
+ }
93
+ },
94
+ close () {
95
+ this.show = false
96
+ },
97
+ // 保存当前的报表
98
+ saveReportHtml () {
99
+ this.show = true
100
+ this.filename = this.row.f_report_name + this.$login.toStandardDateString()
101
+ },
31
102
  // 根据选择的数据直接显示保存的报表
32
103
  showReport (row) {
33
- this.$refs.route.init(row.val.f_component_name, {data: row.val})
104
+ this.$refs.route.init('report-history-show', {data: row.val})
34
105
  },
35
106
  // 根据报表的类型选择显示报表
36
- showReportType (index,row) {
37
- let m=document.getElementsByName('style')
107
+ showReportType (index, row) {
108
+ let m = document.getElementsByName('style')
38
109
  console.log(m.length)
39
- for(let i=0; i < m.length; i++){
40
- m[i].style.backgroundColor="#ffffff"
41
- m[i].style.borderColor="#000000"
42
- m[i].style.color="#000000"
110
+ for (let i = 0; i < m.length; i++) {
111
+ m[i].style.backgroundColor = "#ffffff"
112
+ m[i].style.borderColor = "#000000"
113
+ m[i].style.color = "#000000"
43
114
 
44
- if(i==index){
45
- m[i].style.backgroundColor="#0688ce"
46
- m[i].style.borderColor="#0688ce"
47
- m[i].style.color="#ffffff"
115
+ if (i == index) {
116
+ m[i].style.backgroundColor = "#0688ce"
117
+ m[i].style.borderColor = "#0688ce"
118
+ m[i].style.color = "#ffffff"
48
119
  }
49
120
  }
50
- this.index=index
121
+ this.index = index
122
+ this.row = row
51
123
  this.$refs.route.init(row.f_report_path, {data: row})
52
124
  }
53
125
  }
54
126
  }
55
127
  </script>
56
128
  <style>
57
- . mystyle{
129
+ . mystyle {
58
130
  background-color: #05c3c7;
59
131
  }
60
132
  </style>