kn-cli 1.0.60 → 1.0.61
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/build/build.sh +1 -1
- package/build/dev.sh +1 -1
- package/package.json +1 -1
- package/readme.md +3 -0
- package/src/build.js +28 -9
- package/templates/template_admin/build.sh +7 -1
- package/templates/template_admin/readme.md +8 -0
- package/templates/template_app/build.sh +7 -1
- package/templates/template_app/readme.md +8 -0
- package/templates/template_oa/build.sh +7 -1
- package/templates/template_oa/frontend_build.sh +1 -2
- package/templates/template_oa/package.json +2 -1
- package/templates/template_oa/public/favicon.ico +0 -0
- package/templates/template_oa/public/index.html +1 -1
- package/templates/template_oa/public/src/_antd.less +0 -21
- package/templates/template_oa/public/src/_reset.less +3 -0
- package/templates/template_oa/public/src/_variable.less +1 -1
- package/templates/template_oa/public/src/assets/images/NY-pop-bg.png +0 -0
- package/templates/template_oa/public/src/components/Auth/index.jsx +1 -1
- package/templates/template_oa/public/src/components/Dialog/index.jsx +150 -0
- package/templates/template_oa/public/src/components/Dialog/index.less +123 -0
- package/templates/template_oa/public/src/components/Empty/index.jsx +23 -0
- package/templates/template_oa/public/src/components/Empty/index.less +6 -0
- package/templates/template_oa/public/src/components/FormRow/index.jsx +39 -0
- package/templates/template_oa/public/src/components/FormRow/index.less +67 -0
- package/templates/template_oa/public/src/components/FormTable/index.jsx +136 -0
- package/templates/template_oa/public/src/components/IFrame/index.less +1 -1
- package/templates/template_oa/public/src/components/Layout/Basic/index.jsx +18 -12
- package/templates/template_oa/public/src/components/Layout/Basic/index.less +21 -11
- package/templates/template_oa/public/src/components/Layout/index.jsx +2 -1
- package/templates/template_oa/public/src/components/Nav/index.jsx +163 -100
- package/templates/template_oa/public/src/components/Select/DepSelect/index.jsx +47 -0
- package/templates/template_oa/public/src/components/Select/StaffSelect/index.jsx +97 -0
- package/templates/template_oa/public/src/components/Select/StaffSelect/index.less +24 -0
- package/templates/template_oa/public/src/components/Toast/index.less +1 -1
- package/templates/template_oa/public/src/components/Upload/index.jsx +358 -0
- package/templates/template_oa/public/src/components/title/index.jsx +12 -0
- package/templates/template_oa/public/src/components/title/index.less +21 -0
- package/templates/template_oa/public/src/mock/cases.js +52 -0
- package/templates/template_oa/public/src/mock/index.js +2 -0
- package/templates/template_oa/public/src/pages/components/totalRecord/index.jsx +21 -0
- package/templates/template_oa/public/src/pages/components/totalRecord/index.less +16 -0
- package/templates/template_oa/public/src/pages/login/index.jsx +7 -9
- package/templates/template_oa/public/src/pages/my/index.jsx +14 -0
- package/templates/template_oa/public/src/pages/video/detail/index.jsx +14 -0
- package/templates/template_oa/public/src/pages/video/index.jsx +325 -23
- package/templates/template_oa/public/src/pages/video/index.less +3 -0
- package/templates/template_oa/public/src/provider/app.jsx +14 -81
- package/templates/template_oa/public/src/route.jsx +8 -2
- package/templates/template_oa/public/src/services/cases.js +7 -0
- package/templates/template_oa/public/src/services/common.js +132 -0
- package/templates/template_oa/public/src/services/index.js +42 -8
- package/templates/template_oa/public/src/services/video.js +1 -0
- package/templates/template_oa/public/src/utils/index.js +61 -1
- package/templates/template_oa/readme.md +8 -0
- package/templates/template_oa/webpack.api.js +10 -22
- package/templates/template_offcial/build.sh +7 -1
- package/templates/template_offcial/readme.md +8 -0
- package/templates/template_oa/public/favicon.png +0 -0
- package/templates/template_oa/public/src/components/mask/index.jsx +0 -47
- package/templates/template_oa/public/src/components/mask/index.less +0 -32
- package/templates/template_oa/public/src/dictionary/index.js +0 -39
- package/templates/template_oa/public/src/provider/menu.jsx +0 -20
- package/templates/template_oa/public/src/services/user.js +0 -26
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.content {
|
|
2
|
+
position: fixed;
|
|
3
|
+
bottom: 0;
|
|
4
|
+
left: 0;
|
|
5
|
+
width: 100%;
|
|
6
|
+
height: 120px;
|
|
7
|
+
background: #fafafa;
|
|
8
|
+
z-index: 10;
|
|
9
|
+
box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
|
|
10
|
+
|
|
11
|
+
:global {
|
|
12
|
+
.ant-col {
|
|
13
|
+
button {
|
|
14
|
+
margin-left: 10px;
|
|
15
|
+
border: 1px solid #d8d8d8;
|
|
16
|
+
}
|
|
17
|
+
&:first-child {
|
|
18
|
+
button {
|
|
19
|
+
margin-left: 0;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import React, { useState,useEffect } from 'react';
|
|
2
|
+
import { Upload, message,Button } from 'antd';
|
|
3
|
+
import { UPLOAD_FILE,GET_DOWNLOAD_FILE } from "@/services/common.js";
|
|
4
|
+
// import {getUploadToken,setMediaInfo} from '@/services/common.js';
|
|
5
|
+
// import COS from 'cos-js-sdk-v5';
|
|
6
|
+
|
|
7
|
+
import { UploadOutlined } from '@ant-design/icons';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
function DELAY(time){
|
|
11
|
+
return new Promise(reslove=>{
|
|
12
|
+
setTimeout(reslove,time);
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// export async function uploadToCos(files,onProgress,params){
|
|
17
|
+
// if(params&¶ms.userId){
|
|
18
|
+
// params.type=1;
|
|
19
|
+
// }
|
|
20
|
+
// let token = await getUploadToken(params);
|
|
21
|
+
// let key = token?.data?.fileKey||Date.now();
|
|
22
|
+
// let baseUrl = token?.data?.baseUrl;
|
|
23
|
+
// let credentials={};
|
|
24
|
+
// let data={};
|
|
25
|
+
|
|
26
|
+
// if(+token?.code===0){
|
|
27
|
+
// credentials = token.data.credentials;
|
|
28
|
+
// data=token.data;
|
|
29
|
+
// }
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
// var cos = new COS({
|
|
33
|
+
// getAuthorization:(options,callback)=>{
|
|
34
|
+
// callback({
|
|
35
|
+
// TmpSecretId: credentials.tmpSecretId,
|
|
36
|
+
// TmpSecretKey: credentials.tmpSecretKey,
|
|
37
|
+
// XCosSecurityToken: credentials.sessionToken,
|
|
38
|
+
// StartTime: data.startTime,
|
|
39
|
+
// ExpiredTime: data.expiredTime,
|
|
40
|
+
// })
|
|
41
|
+
// }
|
|
42
|
+
// });
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
// return new Promise(reslove=>{
|
|
46
|
+
// cos.putObject({
|
|
47
|
+
// Bucket:data.bucket,
|
|
48
|
+
// Region:data.region,
|
|
49
|
+
// Key:key,
|
|
50
|
+
// StorageClass: 'STANDARD',
|
|
51
|
+
// Body:files,
|
|
52
|
+
// onProgress: function(progressData) {
|
|
53
|
+
// if(onProgress)onProgress({percent:progressData.percent*100})
|
|
54
|
+
// console.log(JSON.stringify(progressData));
|
|
55
|
+
// }
|
|
56
|
+
// },function(err, data) {
|
|
57
|
+
// if(data){
|
|
58
|
+
// reslove({url:`${baseUrl}/${key}`,key:key});
|
|
59
|
+
// return;
|
|
60
|
+
// }
|
|
61
|
+
// reslove()
|
|
62
|
+
// })
|
|
63
|
+
// })
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
// }
|
|
68
|
+
|
|
69
|
+
function CHECK_FILE_TYPE(types, filename) {
|
|
70
|
+
let reg = '';
|
|
71
|
+
|
|
72
|
+
if (types.constructor === Array) {
|
|
73
|
+
types = types.join('|');
|
|
74
|
+
}
|
|
75
|
+
reg = `[.](${types})$`;
|
|
76
|
+
reg = new RegExp(reg, 'i');
|
|
77
|
+
return reg.test(filename);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
const getImageInfo= async (file)=>{
|
|
82
|
+
return new Promise(resolve=>{
|
|
83
|
+
var reader = new FileReader();
|
|
84
|
+
reader.readAsDataURL(file);
|
|
85
|
+
reader.onload =()=>{
|
|
86
|
+
let img = new Image();
|
|
87
|
+
img.onload=()=>{
|
|
88
|
+
resolve({width:img.width,height:img.height});
|
|
89
|
+
}
|
|
90
|
+
img.src=reader.result;
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
const getVideoInfo= async (file)=>{
|
|
95
|
+
return new Promise(resolve=>{
|
|
96
|
+
var reader = new FileReader();
|
|
97
|
+
reader.readAsDataURL(file);
|
|
98
|
+
reader.onload =()=>{
|
|
99
|
+
let video = document.createElement('video');
|
|
100
|
+
video.addEventListener('canplay',(e)=>{
|
|
101
|
+
const {videoWidth,videoHeight} = e.target;
|
|
102
|
+
resolve({width:videoWidth,height:videoHeight});
|
|
103
|
+
})
|
|
104
|
+
video.setAttribute('src',reader.result);
|
|
105
|
+
// document.body.appendChild(img);
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
export const uploadFile=async (props,detail)=>{
|
|
110
|
+
// let response = await UPLOAD_FILE(detail.file, {}, detail.onProgress);
|
|
111
|
+
// await DELAY(1000);
|
|
112
|
+
// detail.onProgress({ percent: 20 });
|
|
113
|
+
// await DELAY(1000);
|
|
114
|
+
// detail.onProgress({ percent: 100 });
|
|
115
|
+
|
|
116
|
+
// mock 拦截上传模拟上传完成用
|
|
117
|
+
// let url='';
|
|
118
|
+
// switch(detail.file.type){
|
|
119
|
+
// case 'image/jpeg':
|
|
120
|
+
// case 'image/png':url='https://officialwebsite-static.kingnet.com/20201130132001-%E6%9C%AA%E5%91%BD%E5%90%8D_meitu_1.jpg';break;
|
|
121
|
+
// case 'video/mp4':url="http://yayapt-1254024138.cos.ap-shanghai.myqcloud.com/1607653172352"
|
|
122
|
+
// }
|
|
123
|
+
// let response = { url: url, key: detail.file.uid } ;
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
let mimeType = detail.file.type;
|
|
127
|
+
let fileName=detail.file.name;
|
|
128
|
+
let type = 1;
|
|
129
|
+
let fileSize = detail.file.size;
|
|
130
|
+
let module=props?.from||'';
|
|
131
|
+
if(/^video/.test(mimeType)){
|
|
132
|
+
type=2;//视频
|
|
133
|
+
}else if(/^image/.test(mimeType)){
|
|
134
|
+
type=1;//图片
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let info=null;
|
|
138
|
+
// if(props.getWidthHeight){
|
|
139
|
+
if(type===2){
|
|
140
|
+
info =await getVideoInfo(detail.file);
|
|
141
|
+
}else if(type===1){
|
|
142
|
+
info = await getImageInfo(detail.file);
|
|
143
|
+
}
|
|
144
|
+
let uploadServiceType = 'oa';
|
|
145
|
+
// }
|
|
146
|
+
let response;
|
|
147
|
+
if(uploadServiceType==='oa')response = await UPLOAD_FILE(detail.file,null,detail.onProgress);
|
|
148
|
+
// if(uploadServiceType==='cos')response = await uploadToCos(detail.file,detail.onProgress,props.params);
|
|
149
|
+
|
|
150
|
+
if (response) {
|
|
151
|
+
// if(uploadServiceType==='cos'){
|
|
152
|
+
// let infoRet = await setMediaInfo({
|
|
153
|
+
// fileKey:response.key,
|
|
154
|
+
// fileName,
|
|
155
|
+
// mimeType,
|
|
156
|
+
// fileSize,
|
|
157
|
+
// type,
|
|
158
|
+
// module,
|
|
159
|
+
// mediaWidth:info?.width,
|
|
160
|
+
// mediaHeight:info?.height});
|
|
161
|
+
// if(!infoRet){
|
|
162
|
+
// return;
|
|
163
|
+
// }
|
|
164
|
+
// }
|
|
165
|
+
if(detail?.onSuccess){
|
|
166
|
+
detail.onSuccess({
|
|
167
|
+
server_link: response.url,
|
|
168
|
+
client_name:response.key,
|
|
169
|
+
info:info,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
server_link: response.url,
|
|
174
|
+
client_name:response.key,
|
|
175
|
+
info:info,
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
} else {
|
|
179
|
+
if(detail?.onError){
|
|
180
|
+
detail.onError();
|
|
181
|
+
}
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
*
|
|
189
|
+
* {
|
|
190
|
+
* uid:'',//唯一id,负数为默认文件
|
|
191
|
+
* url:'',//下载链接
|
|
192
|
+
* status:'done',//上传状态
|
|
193
|
+
* name:'1.png',//文件名称
|
|
194
|
+
* formData:{ //存放提交给接口表单用的文件参数
|
|
195
|
+
* server_name:'',
|
|
196
|
+
* cli_name:''
|
|
197
|
+
* }
|
|
198
|
+
* }
|
|
199
|
+
*/
|
|
200
|
+
const UploadHelper = (props) => {
|
|
201
|
+
// const [count, setCount] = useState(0);
|
|
202
|
+
// console.log(`upload helper value:${props.value}`)
|
|
203
|
+
const [fileList, setFileList] = useState([]);
|
|
204
|
+
const updateValue=()=>{
|
|
205
|
+
|
|
206
|
+
let defaultFile=[];
|
|
207
|
+
let ret=[];
|
|
208
|
+
if(props.value){
|
|
209
|
+
if(props.value.map){
|
|
210
|
+
defaultFile=[...props.value];
|
|
211
|
+
}else{
|
|
212
|
+
defaultFile.push(props.value);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else if(props.defaultFile){
|
|
216
|
+
if(props.defaultFile.map){
|
|
217
|
+
defaultFile=[...props.defaultFile];
|
|
218
|
+
}else{
|
|
219
|
+
defaultFile.push(props.defaultFile);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (!defaultFile || defaultFile.length <= 0) {
|
|
224
|
+
|
|
225
|
+
}
|
|
226
|
+
else{
|
|
227
|
+
ret= defaultFile?.map((file, idx) => {
|
|
228
|
+
let client_name,server_link,thumbUrl,info;
|
|
229
|
+
if( typeof file ==='string' ){
|
|
230
|
+
server_link = file;
|
|
231
|
+
client_name = '';
|
|
232
|
+
}else{
|
|
233
|
+
client_name=file.client_name
|
|
234
|
+
server_link=file.server_link;
|
|
235
|
+
thumbUrl=file.thumbUrl;
|
|
236
|
+
info=file.info;
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
uid: '-' + idx,
|
|
241
|
+
name: client_name,
|
|
242
|
+
url: server_link,
|
|
243
|
+
status: 'done',
|
|
244
|
+
thumbUrl: file.thumbUrl || props.thumbUrl||null,
|
|
245
|
+
formData: {
|
|
246
|
+
server_link: server_link,
|
|
247
|
+
client_name: client_name,
|
|
248
|
+
info:info,
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
setFileList(ret);
|
|
254
|
+
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
useEffect(()=>{
|
|
258
|
+
updateValue();
|
|
259
|
+
},[props.value,props.defaultFile])
|
|
260
|
+
function beforeUpload(acceptTypes, file) {
|
|
261
|
+
if (acceptTypes && !CHECK_FILE_TYPE(acceptTypes, file.name)) {
|
|
262
|
+
message.error( `文件类型不正确,仅支持:${acceptTypes.join(';')}` );
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
if (props.maxSize && file.size / 1024 > props.maxSize) {
|
|
266
|
+
if(props.maxSize>1024){
|
|
267
|
+
message.error( `文件大小不能超过:${props.maxSize/1024}MB` );
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
message.error( `文件大小不能超过:${props.maxSize}KB` );
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function onChangeFile(detail) {
|
|
277
|
+
let fileList = [];
|
|
278
|
+
let changeFlie = [];
|
|
279
|
+
let change = true;
|
|
280
|
+
// console.log(JSON.stringify(detail.fileList));
|
|
281
|
+
detail.fileList.forEach((file) => {
|
|
282
|
+
if (file.status) {
|
|
283
|
+
fileList.push(file);
|
|
284
|
+
if (file.status === 'uploading') {
|
|
285
|
+
change = false;
|
|
286
|
+
}
|
|
287
|
+
if (file.status === 'done' && file.response && !file.formData) {
|
|
288
|
+
file.formData = {
|
|
289
|
+
server_link: file.response.server_link,
|
|
290
|
+
client_name: file.response.client_name,
|
|
291
|
+
info:file.response.info||null,
|
|
292
|
+
};
|
|
293
|
+
file.formData.thumbUrl = GET_DOWNLOAD_FILE(file.formData.server_link)
|
|
294
|
+
}
|
|
295
|
+
if (file.status === 'done' && file.formData) {
|
|
296
|
+
changeFlie.push(file.formData);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
setFileList(fileList);
|
|
301
|
+
if (change) {
|
|
302
|
+
if (props.onChange) props.onChange(changeFlie);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
const BtnUpload=()=>{
|
|
308
|
+
let {listType} = props;
|
|
309
|
+
|
|
310
|
+
if(listType==='text' || !listType){
|
|
311
|
+
return (
|
|
312
|
+
<Button icon={<UploadOutlined />}>上传</Button>
|
|
313
|
+
)
|
|
314
|
+
}
|
|
315
|
+
return (
|
|
316
|
+
<div style={{ marginTop: 8 }}>上传图片</div>
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
function renderChildren(){
|
|
320
|
+
let {listType,multiple,disabled} = props;
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
//单图模式,在有文件的情况下不显示上传按钮
|
|
324
|
+
if(!multiple){
|
|
325
|
+
if(fileList.length>0){
|
|
326
|
+
return '';
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
if(disabled){
|
|
330
|
+
return '无';
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return <BtnUpload />;
|
|
334
|
+
|
|
335
|
+
}
|
|
336
|
+
function onPreview(file){
|
|
337
|
+
window.open(GET_DOWNLOAD_FILE(file.formData.server_link));
|
|
338
|
+
}
|
|
339
|
+
return (
|
|
340
|
+
<Upload
|
|
341
|
+
multiple={props.multiple}
|
|
342
|
+
beforeUpload={beforeUpload.bind(this, props.acceptTypes)}
|
|
343
|
+
onChange={onChangeFile}
|
|
344
|
+
customRequest={uploadFile.bind(this,props)}
|
|
345
|
+
disabled={props.disabled}
|
|
346
|
+
fileList={fileList}
|
|
347
|
+
listType={props.listType}
|
|
348
|
+
onPreview={props.onPreview||onPreview}
|
|
349
|
+
showUploadList={props.showUploadList}
|
|
350
|
+
className={props.className}
|
|
351
|
+
// previewFile={onPreview}
|
|
352
|
+
>
|
|
353
|
+
{renderChildren()}
|
|
354
|
+
</Upload>
|
|
355
|
+
);
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export default UploadHelper;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import CSS from './index.less';
|
|
3
|
+
|
|
4
|
+
const PageTitle = (props) => {
|
|
5
|
+
return (
|
|
6
|
+
<section className={CSS.title}>
|
|
7
|
+
<div className={CSS.rect}></div>
|
|
8
|
+
<h3 className={CSS.text}>{props.children}</h3>
|
|
9
|
+
</section>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
export default PageTitle;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@import '~@/_variable.less';
|
|
2
|
+
|
|
3
|
+
.title{
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
border-bottom: 1px solid #ddd;
|
|
7
|
+
padding-bottom: var(--margin-small);
|
|
8
|
+
margin-bottom: var(--margin-default);
|
|
9
|
+
}
|
|
10
|
+
.rect {
|
|
11
|
+
background: var(--color-primary);
|
|
12
|
+
margin-right: 7px;
|
|
13
|
+
width: 4px;
|
|
14
|
+
height: 18px;
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
.text{
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
color: #555;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { waitTime, REP_SUCCESS } from './utils.js';
|
|
2
|
+
import qs from 'qs';
|
|
3
|
+
import { GET_REQUEST } from './utils';
|
|
4
|
+
|
|
5
|
+
const getData = () => {
|
|
6
|
+
return Array(100).fill('').map((i, idx) => {
|
|
7
|
+
return {
|
|
8
|
+
id: '' + idx,
|
|
9
|
+
orgId: '系统研发部' + idx,
|
|
10
|
+
orgName: '系统研发部' + idx,
|
|
11
|
+
companyId: '恺英网络' + idx,
|
|
12
|
+
companyName: '恺英网络' + idx,
|
|
13
|
+
reason: ' 案由' + idx,
|
|
14
|
+
number: '案号' + idx,
|
|
15
|
+
targetAmount: '标的额' + idx,
|
|
16
|
+
agency: '管辖机构' + idx,
|
|
17
|
+
type: '' + (idx % 3 + 1), // 案件类型: 1 诉讼/ 2 劳动仲裁/ 3商事仲裁
|
|
18
|
+
status: '' + ((idx % 2) + 1),
|
|
19
|
+
occurrenceTime: '案件发生时间',
|
|
20
|
+
endTime: '2023-05-02', // 终结时间
|
|
21
|
+
key:'关键词',
|
|
22
|
+
isPreservation: '' + ((idx % 2) + 1), // 1 是 / 2 否
|
|
23
|
+
remark:'备注信息',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
const data = getData();
|
|
29
|
+
async function GET_LIST(req, res) {
|
|
30
|
+
const params = GET_REQUEST(req);
|
|
31
|
+
const { current, pageSize, ...p} = params;
|
|
32
|
+
const keys = Object.keys(p);
|
|
33
|
+
const _data = keys.length === 0 ? data: data.filter(i => {
|
|
34
|
+
const a = keys.filter(key => i[key].indexOf(p[key]) > -1);
|
|
35
|
+
return a.length > 0
|
|
36
|
+
})
|
|
37
|
+
await waitTime();
|
|
38
|
+
return {
|
|
39
|
+
code: 1,
|
|
40
|
+
data: {
|
|
41
|
+
current, // 第几页
|
|
42
|
+
pageSize, // 每页数量
|
|
43
|
+
total: _data.length, // 总共多少条数据
|
|
44
|
+
data: _data.slice((current - 1) * pageSize, current * pageSize)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
export default {
|
|
51
|
+
'/api/cases/list': { get: GET_LIST },
|
|
52
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import mock from 'mockjs-async';
|
|
2
2
|
|
|
3
3
|
import auth from './auth.js';
|
|
4
|
+
import cases from './cases.js';
|
|
4
5
|
function regMock(list){
|
|
5
6
|
if(list){
|
|
6
7
|
let keys = Object.keys(list)
|
|
@@ -54,6 +55,7 @@ function regMock(list){
|
|
|
54
55
|
if(MOCK){
|
|
55
56
|
console.log(`=========MOCK OPEN=======`)
|
|
56
57
|
regMock(auth);
|
|
58
|
+
regMock(cases);
|
|
57
59
|
}else{
|
|
58
60
|
console.log(`=========MOCK CLOSE=======`)
|
|
59
61
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import styles from './index.less';
|
|
3
|
+
|
|
4
|
+
const TotalRecord=(props)=>{
|
|
5
|
+
const {count, right=''}= props;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<hgroup
|
|
9
|
+
className={styles.totalRecord}
|
|
10
|
+
>
|
|
11
|
+
<span>
|
|
12
|
+
共有<span className={styles.count}>{count}</span>
|
|
13
|
+
条符合条件的记录
|
|
14
|
+
</span>
|
|
15
|
+
<hgroup className={styles.operGroup}>
|
|
16
|
+
{right}
|
|
17
|
+
</hgroup>
|
|
18
|
+
</hgroup>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
export default TotalRecord;
|
|
@@ -9,17 +9,15 @@ const Page = () => {
|
|
|
9
9
|
const [search] = useSearchParams();
|
|
10
10
|
const providerApp = ProviderApp.useContainer();
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const onLogin=()=>{
|
|
13
|
+
// let url = window.btoa(location.href);
|
|
14
|
+
let redirect=`${LOGIN_URL}/login?debug=1`;
|
|
15
|
+
location.href=redirect;
|
|
16
|
+
|
|
17
17
|
}
|
|
18
|
-
useEffect(kssoLogin,[])
|
|
19
|
-
|
|
20
18
|
return (
|
|
21
|
-
<section className={styles.body}>
|
|
22
|
-
|
|
19
|
+
<section className={styles.body} onClick={onLogin}>
|
|
20
|
+
点击跳转测试环境登录,登录后将cookie复制到本地调试
|
|
23
21
|
</section>
|
|
24
22
|
)
|
|
25
23
|
}
|