apply-clients 4.1.27-weinan → 4.1.28-weinan

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": "apply-clients",
3
- "version": "4.1.27-weinan",
3
+ "version": "4.1.28-weinan",
4
4
  "description": "报建前端模块",
5
5
  "main": "src/index.js",
6
6
  "directories": {
@@ -1,194 +1,200 @@
1
- <template>
2
- <div class="auto clearfix">
3
- <show-back-reason :selectdata="data"></show-back-reason>
4
- </div>
5
- <service-view v-ref:service_show :data="data" v-if="showview"></service-view>
6
- </template>
7
- <script>
8
- import Vue from 'vue'
9
- import {HttpResetClass} from 'vue-client'
10
- // Date格式化
11
- Date.prototype.Format = function (fmt) {
12
- var o = {
13
- 'M+': this.getMonth() + 1, // 月份
14
- 'd+': this.getDate(), // 日
15
- 'H+': this.getHours(), // 小时
16
- 'm+': this.getMinutes(), // 分
17
- 's+': this.getSeconds(), // 秒
18
- 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
19
- 'S': this.getMilliseconds() // 毫秒
20
- }
21
- if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
22
- for (var k in o) {
23
- if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
24
- }
25
- return fmt
26
- }
27
- export default {
28
- title: '报建监控控制层',
29
- props: {
30
- selectdata: {
31
- type: Object
32
- },
33
- nodeSnapshot: {
34
- type: Boolean,
35
- default: false
36
- }
37
- },
38
- data() {
39
- return {
40
- data: null, // 展示的数据
41
- json_datas: null, // json配置数据结构
42
- showview: false // 控制显示层显示
43
- }
44
- },
45
- created () {
46
- this.initial()
47
- },
48
- methods: {
49
- // 初始化模块
50
- async initial() {
51
- this.showview = false
52
- this.json_datas = this.$workflow_vue
53
- let sum = 0
54
- let jsonData = {}
55
- this.json_datas.activitys.forEach(item => {
56
- if (this.selectdata.defname === item.title) {
57
- jsonData = item
58
- sum++
59
- }
60
- })
61
- if (sum === 0) {
62
- this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
63
- return
64
- }
65
- if (sum === 1) {
66
- this.data = jsonData
67
- this.data = Object.assign({}, this.data, this.selectdata)
68
-
69
- await this.initializtion()
70
- this.showview = true
71
- return
72
- }
73
- this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
- },
75
- // json配置数据处理
76
- async initializtion() {
77
- this.data.fields.forEach(item => {
78
- if (this.selectdata[item.field]) {
79
- item.value = this.selectdata[item.field]
80
- }
81
- // 如果配置类型为select,获取options
82
- if(item.type==='select'){
83
- item.options=[]
84
- }
85
- if (typeof item.value === 'string' && item.value.startsWith("{") && item.value.endsWith("}")) {
86
- item.value = JSON.parse(item.value)
87
- }
88
- })
89
-
90
- // 控制组件
91
- if (this.data.components) {
92
- this.data.components.forEach(item => {
93
- item.mark = 1
94
- })
95
- }
96
-
97
-
98
- // onetomany 数据获取
99
- if (this.data.onetomany) {
100
- for (let index = 0; index < this.data.onetomany.length; index++) {
101
- let http = new HttpResetClass()
102
- let data = {
103
- tablename: this.data.onetomany[index].tables[0],
104
- condition: `f_process_id='${this.selectdata.f_process_id}'`
105
- }
106
-
107
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
108
- resolveMsg: null,
109
- rejectMsg: 'onetomany查询失败'
110
- })
111
-
112
- // 初始化 onetomany
113
- this.data.onetomany[index].rows = res.data
114
-
115
- // 初始化onetomany中的fields
116
- for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
117
- // 如果配置类型为select,优先从参数列表获取options
118
- if (this.data.onetomany[index].fields[j].type === 'select') {
119
- let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
120
- if (temp && temp.length > 0) {
121
- this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
122
- }
123
- }
124
- }
125
- }
126
- }
127
- // 去除button
128
- this.data.buttons = null
129
-
130
-
131
- // 查询是否有当前节点快照信息,如果有使用快照数据,没有则展示最新数据
132
- if (this.nodeSnapshot && this.data.nodeSnapshot) {
133
- let http = new HttpResetClass()
134
- let data = {
135
- tablename: 't_node_snapshot',
136
- condition: `actid = '${this.selectdata.actid}' and f_process_id='${this.selectdata.f_process_id}'`
137
- }
138
- let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
139
- resolveMsg: null,
140
- rejectMsg: null
141
- })
142
- if (res.data.length > 0) {
143
- data = JSON.parse(res.data[0].f_node_data)
144
-
145
- this.data.fields = data.fields
146
- this.data.onetomany = data.onetomany
147
- this.data.title = data.title
148
- }
149
- }
150
-
151
-
152
- // 将所有field都不可修改,不可操作
153
- this.data.fields.forEach(item => {
154
- item.readonly = true
155
- item.disabled = true
156
- })
157
- // 去除所有onetomany的操作
158
- if (this.data.onetomany) {
159
- this.data.onetomany.forEach(item => {
160
- item.hiddenOperate = true
161
- })
162
- }
163
-
164
- // 完成时间和完成人,部门,分公司
165
- if (this.selectdata.state === '结束') {
166
- let http = new HttpResetClass()
167
- let res = await http.load('POST', 'rs/search', {
168
- source: 'this.getInfo()',
169
- userid: this.selectdata.userid
170
- }, {resolveMsg: null, rejectMsg: null})
171
- let user = res.data
172
- this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
173
- this.data.operator = this.selectdata.person
174
- this.data.f_filiale = user.orgs
175
- this.data.f_parentname = user.deps
176
- }
177
- }
178
- },
179
- events:{
180
- },
181
- watch: {
182
- deep: true
183
- }
184
- }
185
- </script>
186
- <style scoped>
187
- /*清除model中的浮动*/
188
- .clearfix:after,.clearfix:before{
189
- display: table;
190
- }
191
- .clearfix:after{
192
- clear: both;
193
- }
194
- </style>
1
+ <template>
2
+ <div class="auto clearfix">
3
+ <show-back-reason :selectdata="data"></show-back-reason>
4
+ </div>
5
+ <service-view v-ref:service_show :data="data" v-if="showview"></service-view>
6
+ </template>
7
+ <script>
8
+ import Vue from 'vue'
9
+ import {HttpResetClass} from 'vue-client'
10
+ // Date格式化
11
+ Date.prototype.Format = function (fmt) {
12
+ var o = {
13
+ 'M+': this.getMonth() + 1, // 月份
14
+ 'd+': this.getDate(), // 日
15
+ 'H+': this.getHours(), // 小时
16
+ 'm+': this.getMinutes(), // 分
17
+ 's+': this.getSeconds(), // 秒
18
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
19
+ 'S': this.getMilliseconds() // 毫秒
20
+ }
21
+ if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
22
+ for (var k in o) {
23
+ if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
24
+ }
25
+ return fmt
26
+ }
27
+ export default {
28
+ title: '报建监控控制层',
29
+ props: {
30
+ selectdata: {
31
+ type: Object
32
+ },
33
+ nodeSnapshot: {
34
+ type: Boolean,
35
+ default: false
36
+ }
37
+ },
38
+ data() {
39
+ return {
40
+ data: null, // 展示的数据
41
+ json_datas: null, // json配置数据结构
42
+ showview: false // 控制显示层显示
43
+ }
44
+ },
45
+ created () {
46
+ this.initial()
47
+ },
48
+ methods: {
49
+ // 初始化模块
50
+ async initial() {
51
+ this.showview = false
52
+ this.json_datas = this.$workflow_vue
53
+ let sum = 0
54
+ let jsonData = {}
55
+ this.json_datas.activitys.forEach(item => {
56
+ if (this.selectdata.defname === item.title) {
57
+ jsonData = item
58
+ sum++
59
+ }
60
+ })
61
+ if (sum === 0) {
62
+ this.$showMessage(`没有在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置`)
63
+ return
64
+ }
65
+ if (sum === 1) {
66
+ this.data = jsonData
67
+ this.data = Object.assign({}, this.data, this.selectdata)
68
+
69
+ await this.initializtion()
70
+ this.showview = true
71
+ return
72
+ }
73
+ this.$showMessage(`在JSON配置文件中找到活动名为:(${this.selectdata.defname})的节点配置:${sum}个`)
74
+ },
75
+ // json配置数据处理
76
+ async initializtion() {
77
+ this.data.fields.forEach(item => {
78
+ if (this.selectdata[item.field]) {
79
+ item.value = this.selectdata[item.field]
80
+ }
81
+ // 如果配置类型为select,获取options
82
+ if(item.type==='select'){
83
+ item.options=[]
84
+ }
85
+ if (typeof item.value === 'string' && item.value.startsWith("{") && item.value.endsWith("}")) {
86
+ item.value = JSON.parse(item.value)
87
+ }
88
+ })
89
+
90
+ // 控制组件
91
+ if (this.data.components) {
92
+ this.data.components.forEach(item => {
93
+ item.mark = 1
94
+ })
95
+ }
96
+
97
+
98
+ // onetomany 数据获取
99
+ if (this.data.onetomany) {
100
+ for (let index = 0; index < this.data.onetomany.length; index++) {
101
+ let http = new HttpResetClass()
102
+ let data = {
103
+ tablename: this.data.onetomany[index].tables[0],
104
+ condition: `f_process_id='${this.selectdata.f_process_id}'`
105
+ }
106
+
107
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
108
+ resolveMsg: null,
109
+ rejectMsg: 'onetomany查询失败'
110
+ })
111
+
112
+ // 初始化 onetomany
113
+ this.data.onetomany[index].rows = res.data
114
+
115
+ // 初始化onetomany中的fields
116
+ for (let j = 0; j < this.data.onetomany[index].fields.length; j++) {
117
+ // 如果配置类型为select,优先从参数列表获取options
118
+ if (this.data.onetomany[index].fields[j].type === 'select') {
119
+ let temp = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
120
+ if (temp && temp.length > 0) {
121
+ this.data.onetomany[index].fields[j].options = Vue.$appdata.getParam(this.data.onetomany[index].fields[j].label)
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ // 去除button
128
+ this.data.buttons = null
129
+
130
+
131
+ // 查询是否有当前节点快照信息,如果有使用快照数据,没有则展示最新数据
132
+ if (this.nodeSnapshot && this.data.nodeSnapshot) {
133
+ let http = new HttpResetClass()
134
+ let data = {
135
+ tablename: 't_node_snapshot',
136
+ condition: `actid = '${this.selectdata.actid}' and f_process_id='${this.selectdata.f_process_id}'`
137
+ }
138
+ let res = await http.load('POST', 'rs/sql/singleTable', {data: data}, {
139
+ resolveMsg: null,
140
+ rejectMsg: null
141
+ })
142
+ if (res.data.length > 0) {
143
+ data = JSON.parse(res.data[0].f_node_data)
144
+
145
+ this.data.fields = data.fields
146
+ this.data.onetomany = data.onetomany
147
+ this.data.title = data.title
148
+ }
149
+ }
150
+
151
+
152
+ // 将所有field都不可修改,不可操作
153
+ this.data.fields.forEach(item => {
154
+ item.readonly = true
155
+ item.disabled = true
156
+ })
157
+ // 去除所有onetomany的操作
158
+ if (this.data.onetomany) {
159
+ this.data.onetomany.forEach(item => {
160
+ item.hiddenOperate = true
161
+ })
162
+ }
163
+
164
+ // 完成时间和完成人,部门,分公司
165
+ if (this.selectdata.state === '结束') {
166
+ let http = new HttpResetClass()
167
+ let res = await http.load('POST', 'rs/search', {
168
+ source: 'this.getInfo()',
169
+ userid: this.selectdata.userid
170
+ }, {resolveMsg: null, rejectMsg: null})
171
+ let user = res.data
172
+ this.data.operate_date = new Date(this.selectdata.finishtime).Format('yyyy-MM-dd')
173
+ this.data.operator = this.selectdata.person
174
+ this.data.f_filiale = user.orgs
175
+ this.data.f_parentname = user.deps
176
+ }
177
+ for (const item of this.data.fields) {
178
+ debugger
179
+ if(item.label==='气价名称'){
180
+ item.value=this.data.f_price_name
181
+ }
182
+ }
183
+ }
184
+ },
185
+ events:{
186
+ },
187
+ watch: {
188
+ deep: true
189
+ }
190
+ }
191
+ </script>
192
+ <style scoped>
193
+ /*清除model中的浮动*/
194
+ .clearfix:after,.clearfix:before{
195
+ display: table;
196
+ }
197
+ .clearfix:after{
198
+ clear: both;
199
+ }
200
+ </style>