widget.qw 1.0.81 → 1.0.83
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/.env.development +10 -10
- package/.env.production +8 -8
- package/README.md +75 -75
- package/build/style.css +471 -471
- package/build/widget.qw.es.js +64 -65
- package/build/widget.qw.umd.js +64 -65
- package/index.html +17 -17
- package/package.json +47 -47
- package/src/App.vue +26 -26
- package/src/api/index.js +165 -165
- package/src/components/AuditBar.vue +396 -396
- package/src/components/BillCard.vue +164 -164
- package/src/components/CascaderPicker.vue +132 -132
- package/src/components/CascaderPop.vue +371 -371
- package/src/components/CheckGroup.vue +113 -113
- package/src/components/DatetimePicker/DatetimePop.vue +342 -342
- package/src/components/DatetimePicker/index.vue +124 -124
- package/src/components/DayDropdown.vue +56 -56
- package/src/components/FilePicker.vue +169 -169
- package/src/components/Input.vue +80 -80
- package/src/components/MonthDropdown.vue +51 -51
- package/src/components/MultiPicker.vue +123 -123
- package/src/components/ObjsEditor.vue +334 -334
- package/src/components/SecretNotify.js +5 -5
- package/src/components/Sheet.vue +92 -92
- package/src/components/SingleApiPicker.vue +108 -108
- package/src/components/SinglePicker.vue +102 -102
- package/src/components/SingleUserSelector.vue +425 -425
- package/src/components/Switch.vue +64 -64
- package/src/components/TreePicker.vue +113 -113
- package/src/components/UserPicker.vue +106 -106
- package/src/components/UserProfile.vue +129 -129
- package/src/components/UsersPicker.vue +118 -118
- package/src/components/YearDropdown.vue +59 -59
- package/src/components/data_selector.vue +303 -303
- package/src/components/image_picker.vue +123 -123
- package/src/components/images_picker.vue +195 -195
- package/src/components/index.js +162 -162
- package/src/components/mult_list_selector.vue +155 -155
- package/src/components/subdepartment_selector.vue +481 -481
- package/src/components/user_selector.vue +639 -639
- package/src/components/widget/DataPop.vue +95 -95
- package/src/components/widget/TreePop.vue +88 -88
- package/src/components/widget/UserPop.vue +347 -347
- package/src/env.d.ts +8 -8
- package/src/main.js +117 -117
- package/src/router/index.ts +173 -173
- package/src/util/array_util.js +32 -32
- package/src/util/auth_util.js +72 -73
- package/src/util/bool_util.js +5 -5
- package/src/util/bus.js +1 -1
- package/src/util/cache_util.js +18 -18
- package/src/util/errer_code.js +6 -6
- package/src/util/eval_util.js +19 -19
- package/src/util/icon_util.js +36 -36
- package/src/util/image_util.js +27 -27
- package/src/util/index.js +57 -57
- package/src/util/num_util.js +70 -70
- package/src/util/obj_util.js +28 -28
- package/src/util/request.js +73 -73
- package/src/util/request_json.js +71 -71
- package/src/util/request_json_mute.js +65 -65
- package/src/util/request_upload.js +79 -79
- package/src/util/route_util.js +31 -31
- package/src/util/str_util.js +143 -143
- package/src/util/time_util.js +406 -406
- package/src/util/toast_util.js +24 -24
- package/src/util/tree_util.js +153 -153
- package/src/util/uuid_util.js +9 -9
- package/src/util/validate.js +182 -182
- package/src/util/vue_filter.js +223 -223
- package/src/views/auditbar/index.vue +78 -78
- package/src/views/billcard/index.vue +48 -48
- package/src/views/cascaderpop/index.vue +90 -90
- package/src/views/checkgroup/index.vue +35 -35
- package/src/views/dataSelector/index.vue +48 -48
- package/src/views/datetimepicker/index.vue +34 -34
- package/src/views/daydropdown/index.vue +31 -31
- package/src/views/filepicker/index.vue +32 -32
- package/src/views/imagepicker/index.vue +31 -31
- package/src/views/imagespicker/index.vue +37 -37
- package/src/views/input/index.vue +35 -35
- package/src/views/monthdropdown/index.vue +31 -31
- package/src/views/multListSelector/index.vue +61 -61
- package/src/views/multipicker/index.vue +36 -36
- package/src/views/objseditor/index.vue +277 -277
- package/src/views/productSelector/index.vue +35 -35
- package/src/views/projectpicker/index.vue +41 -41
- package/src/views/secretnotify/index.vue +27 -27
- package/src/views/sheet/index.vue +45 -45
- package/src/views/singlepicker/index.vue +35 -35
- package/src/views/subdepartmentSelector/index.vue +40 -40
- package/src/views/switch/index.vue +34 -34
- package/src/views/treepicker/index.vue +41 -41
- package/src/views/userSelector/index.vue +54 -54
- package/src/views/userSelectorNew/index.vue +45 -45
- package/src/views/userpicker/index.vue +43 -43
- package/src/views/userprofile/index.vue +30 -30
- package/src/views/userspicker/index.vue +43 -43
- package/src/views/yeardropdown/index.vue +32 -32
- package/src/vm/index.js +1 -1
- package/tsconfig.json +19 -19
- package/tsconfig.node.json +8 -8
- package/vite.config.ts +122 -122
package/src/util/vue_filter.js
CHANGED
|
@@ -1,223 +1,223 @@
|
|
|
1
|
-
// 加载Vue的过滤器
|
|
2
|
-
import Vue from 'vue'
|
|
3
|
-
import { date2Chinese, date2yyyyMMdd, date2yyyyMMddhhmm, time2hhmm, time2hhmmss } from './time_util.js'
|
|
4
|
-
import moment from "moment";
|
|
5
|
-
//使用中文日期
|
|
6
|
-
moment.locale('zh-cn');
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 绝对时间格式化为相对时间
|
|
10
|
-
* @param value 调用过滤器时,调用的绝对时间字符串
|
|
11
|
-
*/
|
|
12
|
-
Vue.filter('time2Lapse', function (date) {
|
|
13
|
-
let m2 = moment(); //当下时间
|
|
14
|
-
// let m2=moment('2019-12-18 10:10:00');
|
|
15
|
-
let m1 = moment(date);
|
|
16
|
-
let du = moment.duration(m2 - m1, 'ms'); //做差
|
|
17
|
-
let years = du.get('years');
|
|
18
|
-
let months = du.get('months');
|
|
19
|
-
let monthAbsolute = m1.format('MM');
|
|
20
|
-
let days = du.get('days');
|
|
21
|
-
let dayAbsolute = m1.format('Do');
|
|
22
|
-
let hours = du.get('hours');
|
|
23
|
-
let hourAbosolute = m1.format('a h');
|
|
24
|
-
let mins = du.get('minutes');
|
|
25
|
-
let minAbsolute = m1.format('mm');
|
|
26
|
-
let ss = du.get('seconds');
|
|
27
|
-
console.log(days, hours, mins, ss)
|
|
28
|
-
// 输出结果为 01天08时09分40秒
|
|
29
|
-
|
|
30
|
-
if(years>2){
|
|
31
|
-
return years + '年前';
|
|
32
|
-
}else if(years>1){
|
|
33
|
-
return '前年'+monthAbsolute+'月';
|
|
34
|
-
}else if(years>0){
|
|
35
|
-
return '去年'+monthAbsolute+'月';
|
|
36
|
-
}else if(months>1){
|
|
37
|
-
return months+'个月前';
|
|
38
|
-
}else if(months>0){
|
|
39
|
-
return '上个月'+dayAbsolute;
|
|
40
|
-
}else if(days>2){
|
|
41
|
-
return days + '天前';
|
|
42
|
-
}else if(days>1){
|
|
43
|
-
return '前天'+hourAbosolute+':'+minAbsolute;
|
|
44
|
-
}else if(days>0){
|
|
45
|
-
return '昨天'+hourAbosolute+':'+minAbsolute;
|
|
46
|
-
}else if (hours > 0) {
|
|
47
|
-
return hours + '小时之前';
|
|
48
|
-
}else if(mins > 0) {
|
|
49
|
-
return mins + '分钟之前';
|
|
50
|
-
}else {
|
|
51
|
-
return ss + '秒之前';
|
|
52
|
-
}
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 字符串转数字
|
|
57
|
-
* @param value 调用过滤器时,调用的文本
|
|
58
|
-
*/
|
|
59
|
-
Vue.filter('str2num', function (value) {
|
|
60
|
-
return Number(value);
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* 整数转字符串,正数前加+,负数前加-,0返回0
|
|
65
|
-
* @param value 调用过滤器时,调用的文本
|
|
66
|
-
*/
|
|
67
|
-
Vue.filter('aliImage', function (value) {
|
|
68
|
-
return value + '?x-oss-process=image/resize,w_500';
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 数字转千进制,保留小数点后一位
|
|
73
|
-
* 例如:输入:12300,输出:12.3k
|
|
74
|
-
* @param value 调用过滤器时,调用的文本
|
|
75
|
-
*/
|
|
76
|
-
Vue.filter('num2kBy1', function (value) {
|
|
77
|
-
let num = 0;
|
|
78
|
-
if (typeof (value) === 'string')
|
|
79
|
-
num = parseInt(value);
|
|
80
|
-
else
|
|
81
|
-
num = value;
|
|
82
|
-
|
|
83
|
-
if (num >= 1000) {
|
|
84
|
-
num = num / 1000;
|
|
85
|
-
// 文本包含小数,保留小数点后1位
|
|
86
|
-
return num.toFixed(1) + 'k';
|
|
87
|
-
} else {
|
|
88
|
-
return num;
|
|
89
|
-
}
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* 整数转字符串,正数前加+,负数前加-,0返回0
|
|
94
|
-
* @param value 调用过滤器时,调用的文本
|
|
95
|
-
*/
|
|
96
|
-
Vue.filter('numAddSign', function (value) {
|
|
97
|
-
let num = 0;
|
|
98
|
-
if (typeof (value) === 'string'){
|
|
99
|
-
num = parseInt(value);
|
|
100
|
-
if(Number.isNaN(num))
|
|
101
|
-
return value;
|
|
102
|
-
}
|
|
103
|
-
else
|
|
104
|
-
num = value;
|
|
105
|
-
|
|
106
|
-
if (num == 0)
|
|
107
|
-
return num + '';
|
|
108
|
-
else if (num > 0)
|
|
109
|
-
return '+' + num;
|
|
110
|
-
else
|
|
111
|
-
return num + '';
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* 金额数据处理
|
|
116
|
-
* 保留小数点后2位,输入单位:元
|
|
117
|
-
* @param value 调用过滤器时,调用的文本
|
|
118
|
-
*/
|
|
119
|
-
Vue.filter('priceValue', function (value) {
|
|
120
|
-
// 如果文本不存在,返回空字符
|
|
121
|
-
// value === 0 ; !0 === true.
|
|
122
|
-
if (!value) {
|
|
123
|
-
return '0.00'
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// 文本转化为 float
|
|
127
|
-
const result = parseFloat(value)
|
|
128
|
-
|
|
129
|
-
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
130
|
-
// if (Number.isInteger(result)) {
|
|
131
|
-
// return result
|
|
132
|
-
// }
|
|
133
|
-
|
|
134
|
-
// 文本包含小数,保留小数点后2位
|
|
135
|
-
return result.toFixed(2)
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* 分钱转元,保留小数点后2位
|
|
140
|
-
* @param value 调用过滤器时,调用的文本
|
|
141
|
-
*/
|
|
142
|
-
Vue.filter('cent2yuan', function (value) {
|
|
143
|
-
// 如果文本不存在,返回空字符
|
|
144
|
-
// value === 0 ; !0 === true.
|
|
145
|
-
if (!value) {
|
|
146
|
-
return '0'
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
// 文本转化为 float
|
|
150
|
-
const result = parseInt(value) / 100;
|
|
151
|
-
|
|
152
|
-
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
153
|
-
// if (Number.isInteger(result)) {
|
|
154
|
-
// return result
|
|
155
|
-
// }
|
|
156
|
-
|
|
157
|
-
// 文本包含小数,保留小数点后0位
|
|
158
|
-
return result;
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* 分钱转元,保留小数点后2位
|
|
163
|
-
* @param value 调用过滤器时,调用的文本
|
|
164
|
-
*/
|
|
165
|
-
Vue.filter('cent2yuanByDot', function (value) {
|
|
166
|
-
// 如果文本不存在,返回空字符
|
|
167
|
-
// value === 0 ; !0 === true.
|
|
168
|
-
if (!value) {
|
|
169
|
-
return '0.00'
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// 文本转化为 float
|
|
173
|
-
const result = parseFloat(value) / 100;
|
|
174
|
-
|
|
175
|
-
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
176
|
-
// if (Number.isInteger(result)) {
|
|
177
|
-
// return result
|
|
178
|
-
// }
|
|
179
|
-
|
|
180
|
-
// 文本包含小数,保留小数点后2位
|
|
181
|
-
return result.toFixed(2);
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* 空数据转0
|
|
186
|
-
*/
|
|
187
|
-
Vue.filter('null2Zero', function (value) {
|
|
188
|
-
// 如果文本不存在,返回空字符
|
|
189
|
-
// value === 0 ; !0 === true.
|
|
190
|
-
if (!value) {
|
|
191
|
-
return 0;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
return value;
|
|
195
|
-
})
|
|
196
|
-
|
|
197
|
-
// xx月xx日
|
|
198
|
-
Vue.filter('chineseDay', function (date) {
|
|
199
|
-
return date2Chinese(date);
|
|
200
|
-
})
|
|
201
|
-
|
|
202
|
-
// xxxx年xx月xx日
|
|
203
|
-
Vue.filter('yyyyMMdd', function (date) {
|
|
204
|
-
return date2yyyyMMdd(date);
|
|
205
|
-
})
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// xxxx年xx月xx日xx时xx分
|
|
209
|
-
Vue.filter('yyyyMMddhhmm', function (date) {
|
|
210
|
-
return date2yyyyMMddhhmm(date);
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
// xx时:xx分
|
|
214
|
-
Vue.filter('hhmm', function (time) {
|
|
215
|
-
return time2hhmm(time);
|
|
216
|
-
})
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* xx时:xx分:xx秒
|
|
220
|
-
*/
|
|
221
|
-
Vue.filter('hhmmss', function (time) {
|
|
222
|
-
return time2hhmmss(time)
|
|
223
|
-
})
|
|
1
|
+
// 加载Vue的过滤器
|
|
2
|
+
import Vue from 'vue'
|
|
3
|
+
import { date2Chinese, date2yyyyMMdd, date2yyyyMMddhhmm, time2hhmm, time2hhmmss } from './time_util.js'
|
|
4
|
+
import moment from "moment";
|
|
5
|
+
//使用中文日期
|
|
6
|
+
moment.locale('zh-cn');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 绝对时间格式化为相对时间
|
|
10
|
+
* @param value 调用过滤器时,调用的绝对时间字符串
|
|
11
|
+
*/
|
|
12
|
+
Vue.filter('time2Lapse', function (date) {
|
|
13
|
+
let m2 = moment(); //当下时间
|
|
14
|
+
// let m2=moment('2019-12-18 10:10:00');
|
|
15
|
+
let m1 = moment(date);
|
|
16
|
+
let du = moment.duration(m2 - m1, 'ms'); //做差
|
|
17
|
+
let years = du.get('years');
|
|
18
|
+
let months = du.get('months');
|
|
19
|
+
let monthAbsolute = m1.format('MM');
|
|
20
|
+
let days = du.get('days');
|
|
21
|
+
let dayAbsolute = m1.format('Do');
|
|
22
|
+
let hours = du.get('hours');
|
|
23
|
+
let hourAbosolute = m1.format('a h');
|
|
24
|
+
let mins = du.get('minutes');
|
|
25
|
+
let minAbsolute = m1.format('mm');
|
|
26
|
+
let ss = du.get('seconds');
|
|
27
|
+
console.log(days, hours, mins, ss)
|
|
28
|
+
// 输出结果为 01天08时09分40秒
|
|
29
|
+
|
|
30
|
+
if(years>2){
|
|
31
|
+
return years + '年前';
|
|
32
|
+
}else if(years>1){
|
|
33
|
+
return '前年'+monthAbsolute+'月';
|
|
34
|
+
}else if(years>0){
|
|
35
|
+
return '去年'+monthAbsolute+'月';
|
|
36
|
+
}else if(months>1){
|
|
37
|
+
return months+'个月前';
|
|
38
|
+
}else if(months>0){
|
|
39
|
+
return '上个月'+dayAbsolute;
|
|
40
|
+
}else if(days>2){
|
|
41
|
+
return days + '天前';
|
|
42
|
+
}else if(days>1){
|
|
43
|
+
return '前天'+hourAbosolute+':'+minAbsolute;
|
|
44
|
+
}else if(days>0){
|
|
45
|
+
return '昨天'+hourAbosolute+':'+minAbsolute;
|
|
46
|
+
}else if (hours > 0) {
|
|
47
|
+
return hours + '小时之前';
|
|
48
|
+
}else if(mins > 0) {
|
|
49
|
+
return mins + '分钟之前';
|
|
50
|
+
}else {
|
|
51
|
+
return ss + '秒之前';
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* 字符串转数字
|
|
57
|
+
* @param value 调用过滤器时,调用的文本
|
|
58
|
+
*/
|
|
59
|
+
Vue.filter('str2num', function (value) {
|
|
60
|
+
return Number(value);
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 整数转字符串,正数前加+,负数前加-,0返回0
|
|
65
|
+
* @param value 调用过滤器时,调用的文本
|
|
66
|
+
*/
|
|
67
|
+
Vue.filter('aliImage', function (value) {
|
|
68
|
+
return value + '?x-oss-process=image/resize,w_500';
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 数字转千进制,保留小数点后一位
|
|
73
|
+
* 例如:输入:12300,输出:12.3k
|
|
74
|
+
* @param value 调用过滤器时,调用的文本
|
|
75
|
+
*/
|
|
76
|
+
Vue.filter('num2kBy1', function (value) {
|
|
77
|
+
let num = 0;
|
|
78
|
+
if (typeof (value) === 'string')
|
|
79
|
+
num = parseInt(value);
|
|
80
|
+
else
|
|
81
|
+
num = value;
|
|
82
|
+
|
|
83
|
+
if (num >= 1000) {
|
|
84
|
+
num = num / 1000;
|
|
85
|
+
// 文本包含小数,保留小数点后1位
|
|
86
|
+
return num.toFixed(1) + 'k';
|
|
87
|
+
} else {
|
|
88
|
+
return num;
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* 整数转字符串,正数前加+,负数前加-,0返回0
|
|
94
|
+
* @param value 调用过滤器时,调用的文本
|
|
95
|
+
*/
|
|
96
|
+
Vue.filter('numAddSign', function (value) {
|
|
97
|
+
let num = 0;
|
|
98
|
+
if (typeof (value) === 'string'){
|
|
99
|
+
num = parseInt(value);
|
|
100
|
+
if(Number.isNaN(num))
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
else
|
|
104
|
+
num = value;
|
|
105
|
+
|
|
106
|
+
if (num == 0)
|
|
107
|
+
return num + '';
|
|
108
|
+
else if (num > 0)
|
|
109
|
+
return '+' + num;
|
|
110
|
+
else
|
|
111
|
+
return num + '';
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 金额数据处理
|
|
116
|
+
* 保留小数点后2位,输入单位:元
|
|
117
|
+
* @param value 调用过滤器时,调用的文本
|
|
118
|
+
*/
|
|
119
|
+
Vue.filter('priceValue', function (value) {
|
|
120
|
+
// 如果文本不存在,返回空字符
|
|
121
|
+
// value === 0 ; !0 === true.
|
|
122
|
+
if (!value) {
|
|
123
|
+
return '0.00'
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// 文本转化为 float
|
|
127
|
+
const result = parseFloat(value)
|
|
128
|
+
|
|
129
|
+
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
130
|
+
// if (Number.isInteger(result)) {
|
|
131
|
+
// return result
|
|
132
|
+
// }
|
|
133
|
+
|
|
134
|
+
// 文本包含小数,保留小数点后2位
|
|
135
|
+
return result.toFixed(2)
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* 分钱转元,保留小数点后2位
|
|
140
|
+
* @param value 调用过滤器时,调用的文本
|
|
141
|
+
*/
|
|
142
|
+
Vue.filter('cent2yuan', function (value) {
|
|
143
|
+
// 如果文本不存在,返回空字符
|
|
144
|
+
// value === 0 ; !0 === true.
|
|
145
|
+
if (!value) {
|
|
146
|
+
return '0'
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 文本转化为 float
|
|
150
|
+
const result = parseInt(value) / 100;
|
|
151
|
+
|
|
152
|
+
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
153
|
+
// if (Number.isInteger(result)) {
|
|
154
|
+
// return result
|
|
155
|
+
// }
|
|
156
|
+
|
|
157
|
+
// 文本包含小数,保留小数点后0位
|
|
158
|
+
return result;
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* 分钱转元,保留小数点后2位
|
|
163
|
+
* @param value 调用过滤器时,调用的文本
|
|
164
|
+
*/
|
|
165
|
+
Vue.filter('cent2yuanByDot', function (value) {
|
|
166
|
+
// 如果文本不存在,返回空字符
|
|
167
|
+
// value === 0 ; !0 === true.
|
|
168
|
+
if (!value) {
|
|
169
|
+
return '0.00'
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// 文本转化为 float
|
|
173
|
+
const result = parseFloat(value) / 100;
|
|
174
|
+
|
|
175
|
+
// 如果文本为 integer 类型的文本,表示当前文本没有小数
|
|
176
|
+
// if (Number.isInteger(result)) {
|
|
177
|
+
// return result
|
|
178
|
+
// }
|
|
179
|
+
|
|
180
|
+
// 文本包含小数,保留小数点后2位
|
|
181
|
+
return result.toFixed(2);
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 空数据转0
|
|
186
|
+
*/
|
|
187
|
+
Vue.filter('null2Zero', function (value) {
|
|
188
|
+
// 如果文本不存在,返回空字符
|
|
189
|
+
// value === 0 ; !0 === true.
|
|
190
|
+
if (!value) {
|
|
191
|
+
return 0;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return value;
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
// xx月xx日
|
|
198
|
+
Vue.filter('chineseDay', function (date) {
|
|
199
|
+
return date2Chinese(date);
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
// xxxx年xx月xx日
|
|
203
|
+
Vue.filter('yyyyMMdd', function (date) {
|
|
204
|
+
return date2yyyyMMdd(date);
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
// xxxx年xx月xx日xx时xx分
|
|
209
|
+
Vue.filter('yyyyMMddhhmm', function (date) {
|
|
210
|
+
return date2yyyyMMddhhmm(date);
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
// xx时:xx分
|
|
214
|
+
Vue.filter('hhmm', function (time) {
|
|
215
|
+
return time2hhmm(time);
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* xx时:xx分:xx秒
|
|
220
|
+
*/
|
|
221
|
+
Vue.filter('hhmmss', function (time) {
|
|
222
|
+
return time2hhmmss(time)
|
|
223
|
+
})
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="page">
|
|
3
|
-
<widget-qw-audit-bar v-if="data.userId" :processId="data.processId" :mouldId="data.mouldId" :userId="data.userId" :form="data.form"
|
|
4
|
-
@apply="onApply" @pass="onPass" @refuse="onRefuse" @auth="onAuth" />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup>
|
|
9
|
-
import { onMounted, reactive } from "vue";
|
|
10
|
-
import util from '@/util'
|
|
11
|
-
|
|
12
|
-
const data = reactive({
|
|
13
|
-
// processId: 46, // 流程ID
|
|
14
|
-
processId:
|
|
15
|
-
mouldId:
|
|
16
|
-
userId: '
|
|
17
|
-
form:null
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
onMounted(()=>{
|
|
21
|
-
query()
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
const query = async () => {
|
|
25
|
-
console.log("-------------------query.id-----------------------", util.getQueryParams().id);
|
|
26
|
-
let id = util.getQueryParams().id.toString() || '';
|
|
27
|
-
console.log("-------------------id-----------------------", id);
|
|
28
|
-
let res = await util.reform_detail({ id });
|
|
29
|
-
console.log("-------------------TargetData-----------------------", res);
|
|
30
|
-
if (res.code == 200) {
|
|
31
|
-
data.processId = res.data.processId
|
|
32
|
-
data.form = res.data
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const onApply = (e) => {
|
|
37
|
-
console.log('onApply',e)
|
|
38
|
-
// e: {
|
|
39
|
-
// memo:"审批意见"
|
|
40
|
-
// }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const onPass = (e) => {
|
|
44
|
-
console.log('onPass',e)
|
|
45
|
-
// e: {
|
|
46
|
-
// memo:"审批意见"
|
|
47
|
-
// }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const onRefuse = (e) => {
|
|
51
|
-
console.log('onRefuse',e)
|
|
52
|
-
// e: {
|
|
53
|
-
// action: {
|
|
54
|
-
// stepId: 1
|
|
55
|
-
// text: "隐患排查上报"
|
|
56
|
-
// }
|
|
57
|
-
// memo: "审批意见"
|
|
58
|
-
// }
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const onAuth = (auth) => {
|
|
62
|
-
console.log('onAuth', auth)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style lang="scss" scoped>
|
|
68
|
-
.page {
|
|
69
|
-
height: 100vh;
|
|
70
|
-
background: #fff;
|
|
71
|
-
text-align: center;
|
|
72
|
-
background-size: cover;
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
justify-content: flex-start;
|
|
76
|
-
padding: 80px 15px 0 15px;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="page">
|
|
3
|
+
<widget-qw-audit-bar v-if="data.userId" :processId="data.processId" :mouldId="data.mouldId" :userId="data.userId" :form="data.form"
|
|
4
|
+
@apply="onApply" @pass="onPass" @refuse="onRefuse" @auth="onAuth" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { onMounted, reactive } from "vue";
|
|
10
|
+
import util from '@/util'
|
|
11
|
+
|
|
12
|
+
const data = reactive({
|
|
13
|
+
// processId: 46, // 流程ID
|
|
14
|
+
processId: 457, // 流程ID
|
|
15
|
+
mouldId: 71, // 模板ID
|
|
16
|
+
userId: 'HouMu',
|
|
17
|
+
form:null
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
onMounted(()=>{
|
|
21
|
+
query()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const query = async () => {
|
|
25
|
+
console.log("-------------------query.id-----------------------", util.getQueryParams().id);
|
|
26
|
+
let id = util.getQueryParams().id.toString() || '';
|
|
27
|
+
console.log("-------------------id-----------------------", id);
|
|
28
|
+
let res = await util.reform_detail({ id });
|
|
29
|
+
console.log("-------------------TargetData-----------------------", res);
|
|
30
|
+
if (res.code == 200) {
|
|
31
|
+
data.processId = res.data.processId
|
|
32
|
+
data.form = res.data
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const onApply = (e) => {
|
|
37
|
+
console.log('onApply',e)
|
|
38
|
+
// e: {
|
|
39
|
+
// memo:"审批意见"
|
|
40
|
+
// }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const onPass = (e) => {
|
|
44
|
+
console.log('onPass',e)
|
|
45
|
+
// e: {
|
|
46
|
+
// memo:"审批意见"
|
|
47
|
+
// }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const onRefuse = (e) => {
|
|
51
|
+
console.log('onRefuse',e)
|
|
52
|
+
// e: {
|
|
53
|
+
// action: {
|
|
54
|
+
// stepId: 1
|
|
55
|
+
// text: "隐患排查上报"
|
|
56
|
+
// }
|
|
57
|
+
// memo: "审批意见"
|
|
58
|
+
// }
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const onAuth = (auth) => {
|
|
62
|
+
console.log('onAuth', auth)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
.page {
|
|
69
|
+
height: 100vh;
|
|
70
|
+
background: #fff;
|
|
71
|
+
text-align: center;
|
|
72
|
+
background-size: cover;
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
justify-content: flex-start;
|
|
76
|
+
padding: 80px 15px 0 15px;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
}
|
|
79
79
|
</style>
|