widget.js
7.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
var self = new Vue({
el:'#app',
data(){
return {
search:'',
pageNum:1,
pageSize:10,
total:0,
projectId:null,
userId:null,
// 表格数据
tabaledata:[
{
xh:'1',
ajmc:'关于青海省XX房地产开发有限公司乐家湾土地闲置的处罚案件',
anlx:'批后',
zrdw:'规划建设和土地管理局',
ssqy:'周家泉街道',
ljr:'向小华',
djsh:'2020-07-05',
jssi:'2020-07-05',
},
{
xh:'2',
ajmc:'关于青海省XX房地产开发有限公司XX建设项目不符合规划设计条件的查处案件',
anlx:'批后',
zrdw:'规划建设和土地管理局',
ssqy:' 大众街街道',
ljr:'向小华',
djsh:'2020-07-05',
jssi:'2020-07-05',
},
{
xh:'3',
ajmc:'关于民和路辅路以北违法侵占道路红线案件',
anlx:'批后',
zrdw:'规划建设和土地管理局',
ssqy:' 清真巷街道 ',
ljr:'向小华',
djsh:'2020-07-05',
jssi:'2020-07-05',
},
{
xh:'4',
ajmc:'关于韵家口镇街道乔家湾违法侵占基本农田的查处案件',
anlx:'批后',
zrdw:'规划建设和土地管理局',
ssqy:'韵家口镇街道',
ljr:'向小华',
djsh:'2020-07-05',
jssi:'2020-07-05',
},
{
xh:'5',
ajmc:'关于青海省XX钢铁有限公司违法占地扩建钢厂案件',
anlx:'批后',
zrdw:'规划建设和土地管理局',
ssqy:'韵家口镇街道',
ljr:'向小华',
djsh:'2020-07-05',
jssi:'2020-07-05',
},
],
isActive:1,
}
},
directives:{
focus: {
inserted:function f(el) {
el.focus()
}
}
},
mounted(){
this.getData();
},
methods:{
//获取数据
getData() {
axios.get(CONF_NEWGHSC_SERVERURL + '/dblb/list/worked', {
params: {
pageIndex:this.pageNum,
pageSize:this.pageSize,
flowIds: this.flowid.toString(),
userName: this.userName,
keyWord:this.search
}
}).then(res => {
this.total=res.data.total;
let data=res.data.data.Data;
let result =[]
if(data.length){
for (let i=0;i<data.length;i++){
for (let j=0;j<data[i].length;j++){
result.push( data[i][[j]]);
}
}
}
this.total = result.length;
this.tabaledata = result.slice((this.pageNum - 1) * this.pageSize, (this.pageNum - 1) * this.pageSize + this.pageSize);
}).catch(res=>{
console.log(res)
});
},
handleSizeChange(pageSize){
this.pageSize = pageSize
this.getData()
},
handleCurrentChange(pageNum){
this.pageNum = pageNum
this.getData()
},
click(val){
this.isActive = val
},
//搜索事件
SearchInfo(){
if(!this.search){
this.$message.warning('请先输入关键字后轻敲Enter键搜索')
}
},
openHandleJumpUrl (flowId, itemTypeId, _stats = 'create') {
var unique = this.uuid();
let url = CONF_FRONT_SERVERURL + 'view/projecttask/detailproject.jsp?';
url += 'stats=' + _stats;
url += '&flowid=' + flowId;
url += '&create=' + (this.projectId ? 1 : 0);
url += '&projectid=' + (this.projectId || "");
url += '&flowItemTypeId=' + (itemTypeId || "");
url += '&uniquePath=' + unique;
window.open(this.handleJumpUrl(url));
this.addFlowUserCount(flowId);
},
addFlowUserCount (flowId) {
if (flowId === null || flowId === undefined) {
return false;
}
this.ajaxPromise({
data: JSON.stringify({"flowId": flowId,"userId": this.userId}),
contentType: "application/json",
url: CONF_BACK_SERVERURL + "/mvc/flow/saveFlowUserCount.do"
}).catch((error)=> {
console.error(error);
});
},
handleJumpUrl(url){
var myid = "guid" + this.guid();
var tempArr = url.split("?");
var returnStr = tempArr[0] + "?guid=" + myid;
var urlValue = tempArr[1];
var cacheUrlValue = null;
var data = {
paramUrl:urlValue,
ftoken:$.cookie('ftoken')
};
if(window.globalLocalCache){
cacheUrlValue = window.globalLocalCache.AddCache(myid,"","",data);
}
return returnStr;
},
S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
},
guid() {
return (this.S4()+this.S4()+"-"+this.S4()+"-"+this.S4()+"-"+this.S4()+"-"+this.S4()+this.S4()+this.S4());
},
uuid(){
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[14] = "4";
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
},
ajaxPromise(options) {
return new Promise(function (resolve, reject) {
if ( typeof options !== "object" ) {
return reject("参数错误!");
}
let _type = options.type || "POST";
//'application/json'
$.ajax({
type: _type,
url: options.url,
data: options.data,
dataType: options.dataType,
contentType: options.contentType,
headers: {"token":$.cookie('ftoken') },
success: function(result){
resolve(result);
},
error: function (error) {
reject(error);
}
});
})
}
}
})