Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
ZZDataAnalysis
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hlwu
ZZDataAnalysis
Commits
902e5714
Commit
902e5714
authored
Oct 11, 2023
by
whlviolin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修改页面布局,2、增加通用工具子系统四个算法页面
parent
c2a9f8df
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
2681 additions
and
1007 deletions
+2681
-1007
pom.xml
server/pom.xml
+14
-1
ServerApplication.java
...r/src/main/java/cn/ac/iscas/server/ServerApplication.java
+2
-0
AnalysisResultController.java
.../ac/iscas/server/controller/AnalysisResultController.java
+48
-0
DataController.java
...in/java/cn/ac/iscas/server/controller/DataController.java
+52
-10
ProjectController.java
...java/cn/ac/iscas/server/controller/ProjectController.java
+9
-8
AnalysisResultDao.java
...c/main/java/cn/ac/iscas/server/dao/AnalysisResultDao.java
+24
-0
DataDao.java
server/src/main/java/cn/ac/iscas/server/dao/DataDao.java
+4
-3
ProjectDao.java
server/src/main/java/cn/ac/iscas/server/dao/ProjectDao.java
+2
-1
TaskDAO.java
server/src/main/java/cn/ac/iscas/server/dao/TaskDAO.java
+40
-0
AnalysisResult.java
...src/main/java/cn/ac/iscas/server/pojo/AnalysisResult.java
+68
-0
Task.java
server/src/main/java/cn/ac/iscas/server/pojo/Task.java
+213
-0
Year.java
server/src/main/java/cn/ac/iscas/server/pojo/Year.java
+28
-0
AnalysisResultService.java
.../iscas/server/service/analysis/AnalysisResultService.java
+13
-0
AnalysisResultServiceImpl.java
...rver/service/analysis/impl/AnalysisResultServiceImpl.java
+31
-0
DataService.java
...ain/java/cn/ac/iscas/server/service/data/DataService.java
+4
-3
DataServiceImpl.java
...cn/ac/iscas/server/service/data/impl/DataServiceImpl.java
+27
-9
ProjectService.java
...va/cn/ac/iscas/server/service/project/ProjectService.java
+3
-2
ProjectServiceImpl.java
...iscas/server/service/project/impl/ProjectServiceImpl.java
+5
-6
ReadFileUtil.java
.../src/main/java/cn/ac/iscas/server/utils/ReadFileUtil.java
+2
-5
application.properties
server/src/main/resources/application.properties
+3
-1
AnalysisResultMapper.xml
...rc/main/resources/mybatis/mapper/AnalysisResultMapper.xml
+16
-0
DataMapper.xml
server/src/main/resources/mybatis/mapper/DataMapper.xml
+34
-15
FileListMapper.xml
server/src/main/resources/mybatis/mapper/FileListMapper.xml
+2
-2
ProjectMapper.xml
server/src/main/resources/mybatis/mapper/ProjectMapper.xml
+3
-3
.eslintrc.js
web/.eslintrc.js
+23
-31
user.js
web/mock/controller/user.js
+4
-4
data.js
web/src/api/data.js
+98
-47
index.vue
web/src/layouts/components/VabAvatar/index.vue
+1
-1
index.vue
web/src/layouts/components/VabBreadcrumb/index.vue
+1
-1
main.js
web/src/main.js
+0
-2
index.js
web/src/router/index.js
+15
-11
variables.scss
web/src/styles/variables.scss
+1
-1
echartsUtil.js
web/src/utils/echartsUtil.js
+191
-127
request.js
web/src/utils/request.js
+1
-1
analysis.vue
web/src/views/data/components/analysis.vue
+0
-684
index.vue
web/src/views/dataSource/index.vue
+5
-5
analysis.vue
web/src/views/generalTool/components/analysis.vue
+1024
-0
project.bk.vue
web/src/views/generalTool/components/project.bk.vue
+0
-0
project.vue
web/src/views/generalTool/components/project.vue
+0
-0
ahpsimple.vue
web/src/views/generalTool/components/res/ahpsimple.vue
+200
-0
dea.vue
web/src/views/generalTool/components/res/dea.vue
+152
-0
res1.vue
web/src/views/generalTool/components/res/res1.vue
+0
-0
res2.vue
web/src/views/generalTool/components/res/res2.vue
+0
-0
rsr.vue
web/src/views/generalTool/components/res/rsr.vue
+126
-0
topsis.vue
web/src/views/generalTool/components/res/topsis.vue
+126
-0
index copy.vue
web/src/views/generalTool/index copy.vue
+0
-0
index.vue
web/src/views/generalTool/index.vue
+0
-0
sysAllData.vue
web/src/views/myData/components/sysAllData.vue
+66
-23
No files found.
server/pom.xml
View file @
902e5714
...
@@ -33,6 +33,10 @@
...
@@ -33,6 +33,10 @@
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
<!--引入jwt-->
<!--引入jwt-->
<dependency>
<dependency>
<groupId>
com.auth0
</groupId>
<groupId>
com.auth0
</groupId>
...
@@ -49,7 +53,7 @@
...
@@ -49,7 +53,7 @@
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
8.0.15
</version>
<version>
8.0.15
</version>
<!-- <scope>runtime</scope>-->
<!-- <scope>runtime</scope>-->
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.mybatis.spring.boot
</groupId>
<groupId>
org.mybatis.spring.boot
</groupId>
...
@@ -144,6 +148,15 @@
...
@@ -144,6 +148,15 @@
<version>
1.0.0
</version>
<version>
1.0.0
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.apache.tomcat.embed
</groupId>
<artifactId>
tomcat-embed-websocket
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-openfeign-core
</artifactId>
<version>
3.1.6
</version>
</dependency>
</dependencies>
</dependencies>
...
...
server/src/main/java/cn/ac/iscas/server/ServerApplication.java
View file @
902e5714
...
@@ -7,10 +7,12 @@ import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
...
@@ -7,10 +7,12 @@ import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory
;
import
org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.netflix.eureka.EnableEurekaClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
@SpringBootApplication
@SpringBootApplication
@EnableEurekaClient
@EnableEurekaClient
@EnableFeignClients
public
class
ServerApplication
{
public
class
ServerApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
...
...
server/src/main/java/cn/ac/iscas/server/controller/AnalysisResultController.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
controller
;
import
cn.ac.iscas.server.pojo.AnalysisResult
;
import
cn.ac.iscas.server.service.analysis.AnalysisResultService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@CrossOrigin
@RestController
@RequestMapping
(
"/"
)
public
class
AnalysisResultController
{
@Autowired
AnalysisResultService
analysisResultService
;
@RequestMapping
(
value
=
"/createAnalysisResult"
,
method
=
RequestMethod
.
GET
)
public
Result
createAnalysisResult
(
@RequestParam
(
"userId"
)
String
userId
,
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"result"
)
String
result
)
{
try
{
analysisResultService
.
createAnalysisResult
(
userId
,
name
,
type
,
result
);
// 假设DataDao类有一个getAllYear方法来获取年份数据
return
new
Result
(
200
,
"success"
,
true
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
false
);
}
}
@RequestMapping
(
value
=
"/getAnalysisResult"
,
method
=
RequestMethod
.
GET
)
public
Result
getAnalysisResult
()
throws
Exception
{
List
<
AnalysisResult
>
data
=
analysisResultService
.
getAnalysisResult
();
if
(
data
!=
null
)
{
return
new
Result
(
200
,
"success"
,
data
);
}
else
{
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
null
);
}
}
}
server/src/main/java/cn/ac/iscas/server/controller/DataController.java
View file @
902e5714
...
@@ -2,13 +2,15 @@ package cn.ac.iscas.server.controller;
...
@@ -2,13 +2,15 @@ package cn.ac.iscas.server.controller;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Year
;
import
cn.ac.iscas.server.service.data.DataService
;
import
cn.ac.iscas.server.service.data.DataService
;
import
cn.ac.iscas.server.service.pojo.CSVTableData
;
import
com.alibaba.fastjson.JSON
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.*
;
import
java.util.Map
;
@CrossOrigin
@CrossOrigin
@RestController
@RestController
...
@@ -40,7 +42,7 @@ public class DataController {
...
@@ -40,7 +42,7 @@ public class DataController {
}
}
@RequestMapping
(
value
=
"/getyears"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getyears"
,
method
=
RequestMethod
.
GET
)
public
Result
getAllYear
()
throws
Exception
{
public
Result
getAllYear
()
throws
Exception
{
List
<
Intege
r
>
data
=
dataService
.
getAllYear
();
// 假设DataDao类有一个getAllYear方法来获取年份数据
List
<
Yea
r
>
data
=
dataService
.
getAllYear
();
// 假设DataDao类有一个getAllYear方法来获取年份数据
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
new
Result
(
200
,
"success"
,
data
);
return
new
Result
(
200
,
"success"
,
data
);
...
@@ -75,6 +77,15 @@ public class DataController {
...
@@ -75,6 +77,15 @@ public class DataController {
public
Result
getallIndex
()
throws
Exception
{
public
Result
getallIndex
()
throws
Exception
{
List
<
Map
<
String
,
Object
>>
data
=
dataService
.
getallIndex
();
// 假设DataDao类有一个getAllYear方法来获取年份数据
List
<
Map
<
String
,
Object
>>
data
=
dataService
.
getallIndex
();
// 假设DataDao类有一个getAllYear方法来获取年份数据
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++){
Map
<
String
,
Object
>
datamap
=
data
.
get
(
i
);
int
id
=
(
int
)
datamap
.
get
(
"id"
);
int
level
=
(
int
)
datamap
.
get
(
"level"
);
if
(
level
!=
3
){
dataService
.
addChild
(
id
);
}
}
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
new
Result
(
200
,
"success"
,
data
);
return
new
Result
(
200
,
"success"
,
data
);
}
else
{
}
else
{
...
@@ -102,16 +113,47 @@ public class DataController {
...
@@ -102,16 +113,47 @@ public class DataController {
}
}
}
}
@RequestMapping
(
value
=
"/run"
,
method
=
RequestMethod
.
GET
)
// @RequestMapping(value = "/getCondition", method = RequestMethod.GET)
// public Result createProject(
// @RequestParam("name") String name
// ) {
// try {
// // 假设DataDao类有一个getAllYear方法来获取年份数据
// return new Result(200, "success", true);
// }catch (Exception e){
// e.printStackTrace();
// return new Result(HttpStatus.INTERNAL_SERVER_ERROR.value(), "failed",false);
// }
// }
@RequestMapping
(
value
=
"/getCondition"
,
method
=
RequestMethod
.
GET
)
public
Result
run
(
public
Result
run
(
@RequestParam
(
"dataCondition"
)
String
dataCondition
,
@RequestParam
(
"dataCondition"
)
String
dataCondition
,
@RequestParam
(
"address"
)
List
<
String
>
address
,
@RequestParam
(
"address"
)
String
address
,
@RequestParam
(
"years"
)
List
<
String
>
years
@RequestParam
(
"years"
)
String
year
)
throws
Exception
{
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
data
=
dataService
.
getConditionData
(
dataCondition
,
address
,
years
);
// 假设DataDao类有一个getAllYear方法来获取年份数据
List
<
String
>
dataConditions
=
JSON
.
parseArray
(
dataCondition
,
String
.
class
);
List
<
String
>
addresses
=
JSON
.
parseArray
(
address
,
String
.
class
);
List
<
String
>
years
=
JSON
.
parseArray
(
year
,
String
.
class
);
List
<
Map
<
String
,
Object
>>
dataList
=
dataService
.
getConditionData
(
dataConditions
,
years
,
addresses
);
// 假设DataDao类有一个getAllYear方法来获取年份数据
List
<
String
>
keys
=
new
ArrayList
<>();
if
(
dataList
.
size
()>
0
){
keys
.
add
(
"时间"
);
keys
.
add
(
"区域"
);
dataConditions
.
forEach
(
dataC
->{
String
key
=
dataC
+
"("
+(
dataList
.
get
(
0
).
get
(
"unit"
))
+
")"
;
keys
.
add
(
key
);
dataList
.
forEach
(
data
->{
data
.
put
(
key
,
data
.
get
(
dataC
));
});
});
}
if
(
data
!=
null
)
{
Map
<
String
,
Object
>
tbdata
=
new
HashMap
<
String
,
Object
>();
return
new
Result
(
200
,
"success"
,
data
);
tbdata
.
put
(
"header"
,
keys
);
tbdata
.
put
(
"data"
,
dataList
);
if
(
dataList
!=
null
)
{
return
new
Result
(
200
,
"success"
,
tbdata
);
}
else
{
}
else
{
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
null
);
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
null
);
}
}
...
...
server/src/main/java/cn/ac/iscas/server/controller/ProjectController.java
View file @
902e5714
...
@@ -7,6 +7,7 @@ import org.springframework.http.HttpStatus;
...
@@ -7,6 +7,7 @@ import org.springframework.http.HttpStatus;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@CrossOrigin
@CrossOrigin
@RestController
@RestController
...
@@ -19,19 +20,19 @@ public class ProjectController {
...
@@ -19,19 +20,19 @@ public class ProjectController {
public
Result
createProject
(
public
Result
createProject
(
@RequestParam
(
"fId"
)
String
fId
,
@RequestParam
(
"fId"
)
String
fId
,
@RequestParam
(
"name"
)
String
name
@RequestParam
(
"name"
)
String
name
)
throws
Exception
{
)
{
boolean
isCreate
=
projectService
.
createProject
(
fId
,
name
);
// 假设DataDao类有一个getAllYear方法来获取年份数据
try
{
projectService
.
createProject
(
fId
,
name
);
// 假设DataDao类有一个getAllYear方法来获取年份数据
if
(
isCreate
==
true
){
return
new
Result
(
200
,
"success"
,
true
);
return
new
Result
(
200
,
"success"
,
isCreate
);
}
catch
(
Exception
e
){
}
else
{
e
.
printStackTrace
();
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
null
);
return
new
Result
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
(),
"failed"
,
false
);
}
}
}
}
@RequestMapping
(
value
=
"/getProject"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getProject"
,
method
=
RequestMethod
.
GET
)
public
Result
getProject
()
throws
Exception
{
public
Result
getProject
()
throws
Exception
{
List
<
Project
>
data
=
projectService
.
getProject
();
List
<
Map
<
String
,
Object
>>
data
=
projectService
.
getProject
();
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
return
new
Result
(
200
,
"success"
,
data
);
return
new
Result
(
200
,
"success"
,
data
);
...
...
server/src/main/java/cn/ac/iscas/server/dao/AnalysisResultDao.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
dao
;
import
cn.ac.iscas.server.pojo.AnalysisResult
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
@Mapper
public
interface
AnalysisResultDao
{
List
<
AnalysisResult
>
getAnalysisResult
();
boolean
createAnalysisResult
(
AnalysisResult
analysisResult
);
}
server/src/main/java/cn/ac/iscas/server/dao/DataDao.java
View file @
902e5714
...
@@ -3,6 +3,7 @@ package cn.ac.iscas.server.dao;
...
@@ -3,6 +3,7 @@ package cn.ac.iscas.server.dao;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Year
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
import
java.util.List
;
...
@@ -23,18 +24,18 @@ public interface DataDao {
...
@@ -23,18 +24,18 @@ public interface DataDao {
List
<
Industry
>
getAllIndustry
();
List
<
Industry
>
getAllIndustry
();
List
<
Intege
r
>
getAllYear
();
List
<
Yea
r
>
getAllYear
();
List
<
Map
<
String
,
Object
>>
getAllDataType
();
List
<
Map
<
String
,
Object
>>
getAllDataType
();
List
<
Map
<
String
,
Object
>>
addChild
();
List
<
Map
<
String
,
Object
>>
addChild
(
int
p_id
);
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
();
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
();
List
<
Map
<
String
,
Object
>>
getallIndex
();
List
<
Map
<
String
,
Object
>>
getallIndex
();
List
<
Map
<
String
,
Object
>>
getData
(
String
name
);
List
<
Map
<
String
,
Object
>>
getData
(
String
name
);
List
<
Map
<
String
,
Object
>>
getConditionData
(
String
titles
,
List
<
String
>
years
,
List
<
String
>
address_id
);
List
<
Map
<
String
,
Object
>>
getConditionData
(
List
<
String
>
titles_ret
,
List
<
String
>
years
,
List
<
String
>
address_ids
);
...
...
server/src/main/java/cn/ac/iscas/server/dao/ProjectDao.java
View file @
902e5714
...
@@ -5,12 +5,13 @@ import cn.ac.iscas.server.pojo.Project;
...
@@ -5,12 +5,13 @@ import cn.ac.iscas.server.pojo.Project;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
@Mapper
public
interface
ProjectDao
{
public
interface
ProjectDao
{
List
<
Project
>
getProject
();
List
<
Map
<
String
,
Object
>>
getProject
();
boolean
createProject
(
Project
project
);
boolean
createProject
(
Project
project
);
...
...
server/src/main/java/cn/ac/iscas/server/dao/TaskDAO.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
dao
;
import
cn.ac.iscas.server.pojo.Task
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
@Mapper
public
interface
TaskDAO
{
void
insert
(
Task
task
);
void
update
(
Task
task
);
/**
* 任务查询功能,不返回任务的具体代码
* @param size
* @param userId
* @param startTime
* @param endTime
* @param type
* @param status
* @return
*/
List
<
Task
>
gets
(
@Param
(
"size"
)
int
size
,
@Param
(
"userId"
)
String
userId
,
@Param
(
"startTime"
)
Date
startTime
,
@Param
(
"endTime"
)
Date
endTime
,
@Param
(
"type"
)
String
type
,
@Param
(
"status"
)
String
status
);
void
delete
(
Task
task
);
Task
get
(
@Param
(
"taskId"
)
String
taskId
);
List
<
Task
>
getUnfinishedTasks
(
String
userId
);
}
server/src/main/java/cn/ac/iscas/server/pojo/AnalysisResult.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
pojo
;
import
java.util.Date
;
public
class
AnalysisResult
{
public
AnalysisResult
(
String
id
,
String
userId
,
String
type
,
String
name
,
String
result
,
Date
create_time
)
{
this
.
id
=
id
;
this
.
userId
=
userId
;
this
.
type
=
type
;
this
.
name
=
name
;
this
.
result
=
result
;
this
.
create_time
=
create_time
;
}
private
String
id
;
private
String
userId
;
private
String
type
;
private
String
name
;
private
String
result
;
private
Date
create_time
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getResult
()
{
return
result
;
}
public
void
setResult
(
String
result
)
{
this
.
result
=
result
;
}
public
Date
getCreate_time
()
{
return
create_time
;
}
public
void
setCreate_time
(
Date
create_time
)
{
this
.
create_time
=
create_time
;
}
}
server/src/main/java/cn/ac/iscas/server/pojo/Task.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
pojo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
java.util.Date
;
public
class
Task
{
public
static
String
NORMAL
=
"normal"
;
public
static
String
PRO
=
"pro"
;
public
static
String
VIP
=
"vip"
;
public
static
String
CPU
=
"cpu"
;
public
static
String
GPU
=
"gpu"
;
private
String
taskId
;
private
String
name
;
private
String
type
;
private
String
userId
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss.S"
,
timezone
=
"Asia/Shanghai"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss.S"
,
timezone
=
"Asia/Shanghai"
)
private
Date
startTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss.S"
,
timezone
=
"Asia/Shanghai"
)
private
Date
finishTime
;
private
String
status
;
private
String
code
;
private
String
project
;
private
String
version
;
private
String
image
;
private
String
info
;
private
String
kind
;
private
String
userType
=
NORMAL
;
//用户类型
private
String
resType
=
CPU
;
//资源类型
public
String
getKind
()
{
return
kind
;
}
public
void
setKind
(
String
kind
)
{
this
.
kind
=
kind
;
}
public
Task
()
{}
public
Task
(
String
taskId
,
String
name
,
String
type
,
String
userId
,
Date
createTime
,
Date
startTime
,
Date
finishTime
,
String
status
)
{
this
.
taskId
=
taskId
;
this
.
name
=
name
;
this
.
type
=
type
;
this
.
userId
=
userId
;
this
.
createTime
=
createTime
;
this
.
startTime
=
startTime
;
this
.
finishTime
=
finishTime
;
this
.
status
=
status
;
}
public
Task
(
String
taskId
,
String
name
,
String
type
,
String
userId
,
Date
createTime
,
Date
startTime
,
Date
finishTime
,
String
status
,
String
code
,
String
project
,
String
version
,
String
image
,
String
info
,
String
kind
)
{
this
.
taskId
=
taskId
;
this
.
name
=
name
;
this
.
type
=
type
;
this
.
userId
=
userId
;
this
.
createTime
=
createTime
;
this
.
startTime
=
startTime
;
this
.
finishTime
=
finishTime
;
this
.
status
=
status
;
this
.
code
=
code
;
this
.
project
=
project
;
this
.
version
=
version
;
this
.
image
=
image
;
this
.
info
=
info
;
this
.
kind
=
kind
;
}
public
Task
(
String
taskId
,
String
name
,
String
type
,
String
userId
,
Date
createTime
,
Date
startTime
,
Date
finishTime
,
String
status
,
String
code
,
String
project
,
String
version
,
String
image
,
String
info
,
String
kind
,
String
userType
,
String
resType
)
{
this
.
taskId
=
taskId
;
this
.
name
=
name
;
this
.
type
=
type
;
this
.
userId
=
userId
;
this
.
createTime
=
createTime
;
this
.
startTime
=
startTime
;
this
.
finishTime
=
finishTime
;
this
.
status
=
status
;
this
.
code
=
code
;
this
.
project
=
project
;
this
.
version
=
version
;
this
.
image
=
image
;
this
.
info
=
info
;
this
.
kind
=
kind
;
this
.
userType
=
userType
;
this
.
resType
=
resType
;
}
public
String
getTaskId
()
{
return
taskId
;
}
public
void
setTaskId
(
String
taskId
)
{
this
.
taskId
=
taskId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
String
userId
)
{
this
.
userId
=
userId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
Date
startTime
)
{
this
.
startTime
=
startTime
;
}
public
Date
getFinishTime
()
{
return
finishTime
;
}
public
void
setFinishTime
(
Date
finishTime
)
{
this
.
finishTime
=
finishTime
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getProject
()
{
return
project
;
}
public
void
setProject
(
String
project
)
{
this
.
project
=
project
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getImage
()
{
return
image
;
}
public
void
setImage
(
String
image
)
{
this
.
image
=
image
;
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
;
}
public
String
getUserType
()
{
return
userType
;
}
public
void
setUserType
(
String
userType
)
{
this
.
userType
=
userType
;
}
public
String
getResType
()
{
return
resType
;
}
public
void
setResType
(
String
resType
)
{
this
.
resType
=
resType
;
}
}
server/src/main/java/cn/ac/iscas/server/pojo/Year.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
pojo
;
public
class
Year
{
public
Year
(
int
id
,
String
year
)
{
this
.
id
=
id
;
this
.
year
=
year
;
}
int
id
;
String
year
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getYear
()
{
return
year
;
}
public
void
setYear
(
String
year
)
{
this
.
year
=
year
;
}
}
server/src/main/java/cn/ac/iscas/server/service/analysis/AnalysisResultService.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
service
.
analysis
;
import
cn.ac.iscas.server.pojo.AnalysisResult
;
import
java.io.IOException
;
import
java.util.List
;
public
interface
AnalysisResultService
{
public
List
<
AnalysisResult
>
getAnalysisResult
()
throws
IOException
;
public
void
createAnalysisResult
(
String
userId
,
String
name
,
String
type
,
String
result
);
}
server/src/main/java/cn/ac/iscas/server/service/analysis/impl/AnalysisResultServiceImpl.java
0 → 100644
View file @
902e5714
package
cn
.
ac
.
iscas
.
server
.
service
.
analysis
.
impl
;
import
cn.ac.iscas.server.dao.AnalysisResultDao
;
import
cn.ac.iscas.server.pojo.AnalysisResult
;
import
cn.ac.iscas.server.service.analysis.AnalysisResultService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
@Service
public
class
AnalysisResultServiceImpl
implements
AnalysisResultService
{
@Resource
private
AnalysisResultDao
alalysisResultDao
;
@Override
public
List
<
AnalysisResult
>
getAnalysisResult
()
throws
IOException
{
List
<
AnalysisResult
>
alalysisResult
=
alalysisResultDao
.
getAnalysisResult
();
return
alalysisResult
;
}
@Override
public
void
createAnalysisResult
(
String
userId
,
String
name
,
String
type
,
String
result
){
AnalysisResult
alalysisResult
=
new
AnalysisResult
(
UUID
.
randomUUID
().
toString
(),
userId
,
type
,
name
,
result
,
new
Date
());
alalysisResultDao
.
createAnalysisResult
(
alalysisResult
);
}
}
\ No newline at end of file
server/src/main/java/cn/ac/iscas/server/service/data/DataService.java
View file @
902e5714
...
@@ -2,6 +2,7 @@ package cn.ac.iscas.server.service.data;
...
@@ -2,6 +2,7 @@ package cn.ac.iscas.server.service.data;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Year
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -19,11 +20,11 @@ public interface DataService {
...
@@ -19,11 +20,11 @@ public interface DataService {
public
List
<
Address
>
getAllAddresses
()
throws
IOException
;
public
List
<
Address
>
getAllAddresses
()
throws
IOException
;
public
List
<
Industry
>
getAllIndustry
()
throws
IOException
;
public
List
<
Industry
>
getAllIndustry
()
throws
IOException
;
public
List
<
Intege
r
>
getAllYear
()
throws
IOException
;
public
List
<
Yea
r
>
getAllYear
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getAllDataType
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getAllDataType
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
addChild
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
addChild
(
@Param
(
"p_id"
)
int
p_id
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
(
@Param
(
"p_id"
)
int
p_id
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
(
@Param
(
"p_id"
)
int
p_id
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getallIndex
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getallIndex
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getData
(
@Param
(
"name"
)
String
name
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getData
(
@Param
(
"name"
)
String
name
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getConditionData
(
@Param
(
"titles"
)
String
titles
,
@Param
(
"years"
)
List
<
String
>
years
,
@Param
(
"address_id"
)
List
<
String
>
address_id
)
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getConditionData
(
@Param
(
"titles"
)
List
<
String
>
titles
,
@Param
(
"years"
)
List
<
String
>
years
,
@Param
(
"address_id"
)
List
<
String
>
address_id
)
throws
IOException
;
}
}
server/src/main/java/cn/ac/iscas/server/service/data/impl/DataServiceImpl.java
View file @
902e5714
...
@@ -2,11 +2,14 @@ package cn.ac.iscas.server.service.data.impl;
...
@@ -2,11 +2,14 @@ package cn.ac.iscas.server.service.data.impl;
import
cn.ac.iscas.server.dao.DataDao
;
import
cn.ac.iscas.server.dao.DataDao
;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Address
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Industry
;
import
cn.ac.iscas.server.pojo.Year
;
import
cn.ac.iscas.server.service.data.DataService
;
import
cn.ac.iscas.server.service.data.DataService
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -29,8 +32,8 @@ public class DataServiceImpl implements DataService {
...
@@ -29,8 +32,8 @@ public class DataServiceImpl implements DataService {
}
}
@Override
@Override
public
List
<
Intege
r
>
getAllYear
()
throws
IOException
{
public
List
<
Yea
r
>
getAllYear
()
throws
IOException
{
List
<
Intege
r
>
data
=
dataDao
.
getAllYear
();
List
<
Yea
r
>
data
=
dataDao
.
getAllYear
();
return
data
;
return
data
;
}
}
...
@@ -40,11 +43,6 @@ public class DataServiceImpl implements DataService {
...
@@ -40,11 +43,6 @@ public class DataServiceImpl implements DataService {
return
data
;
return
data
;
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
addChild
()
throws
IOException
{
List
<
Map
<
String
,
Object
>>
data
=
dataDao
.
addChild
();
return
data
;
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
(
int
p_id
)
throws
IOException
{
public
List
<
Map
<
String
,
Object
>>
getDataIndexWithLevel
(
int
p_id
)
throws
IOException
{
...
@@ -52,9 +50,14 @@ public class DataServiceImpl implements DataService {
...
@@ -52,9 +50,14 @@ public class DataServiceImpl implements DataService {
return
data
;
return
data
;
}
}
private
List
<
Map
<
String
,
Object
>>
addChildData
()
throws
IOException
{
List
<
Map
<
String
,
Object
>>
data
=
this
.
addChild
(-
1
);
return
data
;
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getallIndex
()
throws
IOException
{
public
List
<
Map
<
String
,
Object
>>
getallIndex
()
throws
IOException
{
List
<
Map
<
String
,
Object
>>
data
=
dataDao
.
getallIndex
();
List
<
Map
<
String
,
Object
>>
data
=
this
.
addChildData
();
return
data
;
return
data
;
}
}
...
@@ -65,8 +68,23 @@ public class DataServiceImpl implements DataService {
...
@@ -65,8 +68,23 @@ public class DataServiceImpl implements DataService {
}
}
@Override
@Override
public
List
<
Map
<
String
,
Object
>>
getConditionData
(
String
titles
,
List
<
String
>
years
,
List
<
String
>
address_ids
)
throws
IOException
{
public
List
<
Map
<
String
,
Object
>>
getConditionData
(
List
<
String
>
titles
,
List
<
String
>
years
,
List
<
String
>
address_ids
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
data
=
dataDao
.
getConditionData
(
titles
,
years
,
address_ids
);
List
<
Map
<
String
,
Object
>>
data
=
dataDao
.
getConditionData
(
titles
,
years
,
address_ids
);
return
data
;
return
data
;
}
}
@Override
public
List
<
Map
<
String
,
Object
>>
addChild
(
@Param
(
"p_id"
)
int
p_id
)
throws
IOException
{
List
<
Map
<
String
,
Object
>>
data
=
dataDao
.
addChild
(
p_id
);
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++){
Map
<
String
,
Object
>
datamap
=
data
.
get
(
i
);
int
id
=
(
int
)
datamap
.
get
(
"id"
);
int
level
=
(
int
)
datamap
.
get
(
"level"
);
if
(
level
!=
3
){
List
<
Map
<
String
,
Object
>>
child
=
this
.
addChild
(
id
);
data
.
get
(
i
).
put
(
"children"
,
child
);
}
}
return
data
;
}
}
}
\ No newline at end of file
server/src/main/java/cn/ac/iscas/server/service/project/ProjectService.java
View file @
902e5714
...
@@ -4,10 +4,11 @@ import cn.ac.iscas.server.pojo.Project;
...
@@ -4,10 +4,11 @@ import cn.ac.iscas.server.pojo.Project;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
public
interface
ProjectService
{
public
interface
ProjectService
{
public
List
<
Project
>
getProject
()
throws
IOException
;
public
List
<
Map
<
String
,
Object
>>
getProject
()
throws
IOException
;
public
boolean
createProject
(
String
fId
,
String
name
)
throws
IOException
;
public
void
createProject
(
String
fId
,
String
name
)
;
}
}
server/src/main/java/cn/ac/iscas/server/service/project/impl/ProjectServiceImpl.java
View file @
902e5714
...
@@ -9,6 +9,7 @@ import javax.annotation.Resource;
...
@@ -9,6 +9,7 @@ import javax.annotation.Resource;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
@Service
@Service
...
@@ -17,17 +18,15 @@ public class ProjectServiceImpl implements ProjectService {
...
@@ -17,17 +18,15 @@ public class ProjectServiceImpl implements ProjectService {
private
ProjectDao
projectDao
;
private
ProjectDao
projectDao
;
@Override
@Override
public
List
<
Project
>
getProject
()
throws
IOException
{
public
List
<
Map
<
String
,
Object
>>
getProject
()
throws
IOException
{
List
<
Project
>
project
=
projectDao
.
getProject
();
List
<
Map
<
String
,
Object
>>
project
=
projectDao
.
getProject
();
return
project
;
return
project
;
}
}
@Override
@Override
public
boolean
createProject
(
String
fId
,
String
name
)
throws
IOException
{
public
void
createProject
(
String
fId
,
String
name
)
{
Project
project
=
new
Project
(
UUID
.
randomUUID
().
toString
(),
fId
,
name
,
new
Date
());
Project
project
=
new
Project
(
UUID
.
randomUUID
().
toString
(),
fId
,
name
,
new
Date
());
projectDao
.
createProject
(
project
);
boolean
isInsert
=
projectDao
.
createProject
(
project
);
return
isInsert
;
}
}
}
}
\ No newline at end of file
server/src/main/java/cn/ac/iscas/server/utils/ReadFileUtil.java
View file @
902e5714
...
@@ -4,10 +4,7 @@ import cn.ac.iscas.server.service.pojo.CSVTableData;
...
@@ -4,10 +4,7 @@ import cn.ac.iscas.server.service.pojo.CSVTableData;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
com.fasterxml.jackson.databind.node.ObjectNode
;
import
java.io.BufferedReader
;
import
java.io.*
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -24,7 +21,7 @@ public class ReadFileUtil {
...
@@ -24,7 +21,7 @@ public class ReadFileUtil {
}
else
{
}
else
{
fileType
=
"csv"
;
fileType
=
"csv"
;
}
}
String
fullName
=
path
+
"."
+
fileType
;
String
fullName
=
path
+
"."
+
fileType
;
try
{
try
{
// 构建FileInputStream对象
// 构建FileInputStream对象
FileInputStream
fip
=
new
FileInputStream
(
fullName
);
FileInputStream
fip
=
new
FileInputStream
(
fullName
);
...
...
server/src/main/resources/application.properties
View file @
902e5714
...
@@ -61,4 +61,6 @@ eureka.instance.hostname = spring-cloud-discovery
...
@@ -61,4 +61,6 @@ eureka.instance.hostname = spring-cloud-discovery
eureka.client.serviceUrl.defaultZone
=
http://127.0.0.1:9090/eureka
eureka.client.serviceUrl.defaultZone
=
http://127.0.0.1:9090/eureka
eureka.instance.prefer-ip-address
=
true
eureka.instance.prefer-ip-address
=
true
spring.mvc.pathmatch.matching-strategy
=
ant_path_matcher
spring.mvc.pathmatch.matching-strategy
=
ant_path_matcher
\ No newline at end of file
server.max-http-header-size
=
102400
server/src/main/resources/mybatis/mapper/AnalysisResultMapper.xml
0 → 100644
View file @
902e5714
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.ac.iscas.server.dao.AnalysisResultDao"
>
<select
id=
"getAnalysisResult"
resultType=
"AnalysisResult"
>
select * from analysis_result
</select>
<insert
id=
"createAnalysisResult"
parameterType=
"AnalysisResult"
>
insert into analysis_result(id, name, type, result, userId,create_time)
values(#{id}, #{name}, #{type}, #{result}, #{userId}, #{create_time} )
</insert>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/mapper/DataMapper.xml
View file @
902e5714
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
select id, name from industry
select id, name from industry
</select>
</select>
<select
id=
"getAllYear"
resultType=
"
Intege
r"
>
<select
id=
"getAllYear"
resultType=
"
Yea
r"
>
select * from year order by year DESC
select * from year order by year DESC
</select>
</select>
...
@@ -27,10 +27,10 @@
...
@@ -27,10 +27,10 @@
</select>
</select>
<select
id=
"addChild"
parameterType=
"int"
resultType=
"Map"
>
<select
id=
"addChild"
parameterType=
"int"
resultType=
"Map"
>
select id , name, p_id, level from data where p_id = #{p_id}
and level!=3
group by name
select id , name, p_id, level from data where p_id = #{p_id} group by name
</select>
</select>
<select
id=
"getallIndex"
resultType=
"Map"
>
<select
id=
"getallIndex"
resultType=
"Map"
>
select id , name, p_id, level from data where p_id = -1
and level!=3
group by name
select id , name, p_id, level from data where p_id = -1 group by name
</select>
</select>
<select
id=
"getData"
parameterType=
"string"
resultType=
"Map"
>
<select
id=
"getData"
parameterType=
"string"
resultType=
"Map"
>
...
@@ -41,19 +41,38 @@
...
@@ -41,19 +41,38 @@
where name = #{name}
where name = #{name}
</select>
</select>
<select
id=
"getConditionData"
parameterType=
"string"
resultType=
"Map"
>
<select
id=
"getConditionData"
resultType=
"Map"
>
select d.id , d.name, d.value, d.unit, a.address, y.year
from data d
select year as '时间', address as '区域',
left join year y on y.id = d.year_id
<foreach
collection=
"titles_ret"
item=
"title"
index=
"index"
separator=
","
>
left join address a on a.id = d.address_id
MAX(CASE name WHEN #{title} THEN value END) AS #{title}
where name in (#{titles_ret})
</foreach>
<if
test=
"years!=null and years.length>0"
>
,unit
and year_id in (#{years})
from (
</if>
select d.id , d.name, d.value, d.unit, a.address, y.year
<if
test=
"address_ids!=null and address_ids.length>0>0"
>
from data d
and address_id in (#{address_ids})
left join year y on y.id = d.year_id
</if>
left join address a on a.id = d.address_id
where d.name in
<foreach
collection=
"titles_ret"
item=
"title"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{title}
</foreach>
<if
test=
"years!=null and years.size>0"
>
and d.year_id in
<foreach
collection=
"years"
item=
"year"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{year}
</foreach>
</if>
<if
test=
"address_ids!=null and address_ids.size>0"
>
and d.address_id in
<foreach
collection=
"address_ids"
item=
"address_id"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{address_id}
</foreach>
</if>
)
as tb
GROUP BY year;
</select>
</select>
...
...
server/src/main/resources/mybatis/mapper/FileListMapper.xml
View file @
902e5714
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
from file_list
from file_list
</select>
</select>
<
selec
t
id=
"insertFileList"
parameterType=
"FileList"
>
<
inser
t
id=
"insertFileList"
parameterType=
"FileList"
>
insert into file_list(id, name, type, path, create_time, update_time, is_dir)
insert into file_list(id, name, type, path, create_time, update_time, is_dir)
values(#{id}, #{name}, #{type}, #{path}, #{create_time}, #{update_time}, #{is_dir} )
values(#{id}, #{name}, #{type}, #{path}, #{create_time}, #{update_time}, #{is_dir} )
</
selec
t>
</
inser
t>
</mapper>
</mapper>
\ No newline at end of file
server/src/main/resources/mybatis/mapper/ProjectMapper.xml
View file @
902e5714
...
@@ -3,15 +3,15 @@
...
@@ -3,15 +3,15 @@
<mapper
namespace=
"cn.ac.iscas.server.dao.ProjectDao"
>
<mapper
namespace=
"cn.ac.iscas.server.dao.ProjectDao"
>
<select
id=
"getProject"
resultType=
"
Project
"
>
<select
id=
"getProject"
resultType=
"
Map
"
>
select p.id, p.name, p.fId, DATE_FORMAT(p.update_time,"%Y-%m-%d %H:%i:%s") as updateTime, f.name as fileName, f.type as type from project p
select p.id, p.name, p.fId, DATE_FORMAT(p.update_time,"%Y-%m-%d %H:%i:%s") as updateTime, f.name as fileName, f.type as type from project p
inner join file_list f on p.fId = f.id
inner join file_list f on p.fId = f.id
</select>
</select>
<
selec
t
id=
"createProject"
parameterType=
"Project"
>
<
inser
t
id=
"createProject"
parameterType=
"Project"
>
insert into project(id, name, fId, update_time)
insert into project(id, name, fId, update_time)
values(#{id}, #{name}, #{fId}, #{update_time} )
values(#{id}, #{name}, #{fId}, #{update_time} )
</
selec
t>
</
inser
t>
</mapper>
</mapper>
\ No newline at end of file
web/.eslintrc.js
View file @
902e5714
/**
* @author https://vue-admin-beautiful.com (不想保留author可删除)
* @description .eslintrc.js
*/
module
.
exports
=
{
module
.
exports
=
{
root
:
true
,
"env"
:
{
env
:
{
"browser"
:
true
,
node
:
true
,
"es2021"
:
true
},
extends
:
[
'plugin:vue/recommended'
,
'@vue/prettier'
],
rules
:
{
'no-console'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
'no-debugger'
:
process
.
env
.
NODE_ENV
===
'production'
?
'warn'
:
'off'
,
'vue/no-v-html'
:
'off'
,
'vue/multi-word-component-names'
:
'off'
,
'vue/no-useless-template-attributes'
:
'off'
,
'vue/no-reserved-component-names'
:
'off'
,
},
parserOptions
:
{
parser
:
'babel-eslint'
,
},
overrides
:
[
{
files
:
[
'**/__tests__/*.{j,t}s?(x)'
,
'**/tests/unit/**/*.spec.{j,t}s?(x)'
,
],
env
:
{
jest
:
true
,
},
},
},
],
"extends"
:
"eslint:recommended"
,
"overrides"
:
[
{
"env"
:
{
"node"
:
true
},
"files"
:
[
".eslintrc.{js,cjs}"
],
"parserOptions"
:
{
"sourceType"
:
"script"
}
}
],
"parserOptions"
:
{
"ecmaVersion"
:
"latest"
,
"sourceType"
:
"module"
},
"rules"
:
{
}
}
}
web/mock/controller/user.js
View file @
902e5714
...
@@ -74,10 +74,10 @@ module.exports = [
...
@@ -74,10 +74,10 @@ module.exports = [
data
:
{
data
:
{
permissions
,
permissions
,
username
,
username
,
'avatar|1'
:
[
//
'avatar|1': [
'https://i.gtimg.cn/club/item/face/img/2/15922_100.gif'
,
//
'https://i.gtimg.cn/club/item/face/img/2/15922_100.gif',
'https://i.gtimg.cn/club/item/face/img/8/15918_100.gif'
,
//
'https://i.gtimg.cn/club/item/face/img/8/15918_100.gif',
],
//
],
},
},
}
}
},
},
...
...
web/src/api/data.js
View file @
902e5714
...
@@ -9,50 +9,50 @@ export function getyear() {
...
@@ -9,50 +9,50 @@ export function getyear() {
}
}
export
function
getIndustry
()
{
export
function
getIndustry
()
{
return
request
({
return
request
({
url
:
'http://localhost:5000/getindustry'
,
url
:
'http://localhost:5000/getindustry'
,
method
:
'get'
,
method
:
'get'
,
})
})
}
}
export
function
getAddress
()
{
export
function
getAddress
()
{
return
request
({
return
request
({
url
:
'http://localhost:5000/getaddrs'
,
url
:
'http://localhost:5000/getaddrs'
,
method
:
'get'
,
method
:
'get'
,
})
})
}
}
export
function
detDataTitle
()
{
export
function
detDataTitle
()
{
return
request
({
return
request
({
url
:
'http://localhost:5000/getdatatitles'
,
url
:
'http://localhost:5000/getdatatitles'
,
method
:
'get'
,
method
:
'get'
,
})
})
}
}
export
function
run
(
condition
)
{
export
function
getCondition
(
params
)
{
return
request
({
return
request
({
url
:
'http://localhost:5000/run'
,
url
:
"http://localhost:5000/getCondition"
,
method
:
'post'
,
method
:
'get'
,
data
:
condition
params
})
}
})
}
export
function
getTree
()
{
export
function
getTree
()
{
return
request
({
return
request
({
url
:
"http://localhost:5000/getallIndex"
,
url
:
"http://localhost:5000/getallIndex"
,
method
:
'get'
,
method
:
'get'
,
})
})
}
}
export
function
readFile
(
params
)
{
export
function
readFile
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/readfile"
,
url
:
"http://localhost:5000/readfile"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
})
}
}
...
@@ -60,9 +60,9 @@ export function readFile(params) {
...
@@ -60,9 +60,9 @@ export function readFile(params) {
export
function
saveTempFile
(
params
)
{
export
function
saveTempFile
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/saveTempFile"
,
url
:
"http://localhost:5000/saveTempFile"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
})
}
}
...
@@ -70,9 +70,9 @@ export function saveTempFile(params) {
...
@@ -70,9 +70,9 @@ export function saveTempFile(params) {
export
function
runAlgo
(
params
)
{
export
function
runAlgo
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/algo/run"
,
url
:
"http://localhost:5000/algo/run"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
})
}
}
...
@@ -80,9 +80,9 @@ export function runAlgo(params) {
...
@@ -80,9 +80,9 @@ export function runAlgo(params) {
export
function
runDEAAlgo
(
params
)
{
export
function
runDEAAlgo
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/algo/runDEA"
,
url
:
"http://localhost:5000/algo/runDEA"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
})
}
}
...
@@ -90,25 +90,25 @@ export function runDEAAlgo(params) {
...
@@ -90,25 +90,25 @@ export function runDEAAlgo(params) {
export
function
getDataHeader
(
params
)
{
export
function
getDataHeader
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/getDataHeader"
,
url
:
"http://localhost:5000/getDataHeader"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
})
}
}
export
function
getProject
()
{
export
function
getProject
()
{
return
request
({
return
request
({
url
:
"http://localhost:5000/getProject"
,
url
:
"http://localhost:5000/getProject"
,
method
:
'get'
method
:
'get'
})
})
}
}
export
function
getFileList
()
{
export
function
getFileList
()
{
return
request
({
return
request
({
url
:
"http://localhost:5000/getFileList"
,
url
:
"http://localhost:5000/getFileList"
,
method
:
'get'
method
:
'get'
})
})
}
}
...
@@ -116,9 +116,26 @@ export function getFileList() {
...
@@ -116,9 +116,26 @@ export function getFileList() {
export
function
createProject
(
params
)
{
export
function
createProject
(
params
)
{
return
request
({
return
request
({
url
:
"http://localhost:5000/createProject"
,
url
:
"http://localhost:5000/createProject"
,
method
:
'get'
,
method
:
'get'
,
params
params
})
}
export
function
getAnalysisResult
()
{
return
request
({
url
:
"http://localhost:5000/getAnalysisResult"
,
method
:
'get'
})
}
export
function
createAnalysisResult
(
params
)
{
return
request
({
url
:
"http://localhost:5000/createAnalysisResult"
,
method
:
'get'
,
params
})
})
}
}
...
@@ -137,3 +154,37 @@ export function getData(params) {
...
@@ -137,3 +154,37 @@ export function getData(params) {
params
params
})
})
}
}
export
function
getAHPList
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getAHPList"
,
method
:
'get'
,
params
})
}
export
function
getTOPSISList
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getTOPSISList"
,
method
:
'get'
,
params
})
}
export
function
getRSRList
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getRSRList"
,
method
:
'get'
,
params
})
}
export
function
getDEAList
(
params
)
{
return
request
({
url
:
"http://localhost:8001/getDEAList"
,
method
:
'get'
,
params
})
}
web/src/layouts/components/VabAvatar/index.vue
View file @
902e5714
<
template
>
<
template
>
<el-dropdown
@
command=
"handleCommand"
>
<el-dropdown
@
command=
"handleCommand"
>
<span
class=
"avatar-dropdown"
>
<span
class=
"avatar-dropdown"
>
<img
class=
"user-avatar"
:src=
"avatar"
alt=
""
/
>
<!--
<img
class=
"user-avatar"
:src=
"avatar"
alt=
""
/>
--
>
<div
class=
"user-name"
>
<div
class=
"user-name"
>
{{
username
}}
{{
username
}}
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
<i
class=
"el-icon-arrow-down el-icon--right"
></i>
...
...
web/src/layouts/components/VabBreadcrumb/index.vue
View file @
902e5714
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
{{
$route
.
query
.
name
}}
{{
$route
.
query
.
name
}}
</
template
>
</
template
>
<
template
v-else
>
<
template
v-else
>
{{
item
.
meta
.
title
}}
{{
item
.
meta
.
title
}}
</
template
>
</
template
>
</el-breadcrumb-item>
</el-breadcrumb-item>
</el-breadcrumb>
</el-breadcrumb>
...
...
web/src/main.js
View file @
902e5714
...
@@ -16,8 +16,6 @@ if (process.env.NODE_ENV === 'production') {
...
@@ -16,8 +16,6 @@ if (process.env.NODE_ENV === 'production') {
Vue
.
config
.
productionTip
=
false
Vue
.
config
.
productionTip
=
false
new
Vue
({
new
Vue
({
el
:
'#vue-admin-beautiful'
,
el
:
'#vue-admin-beautiful'
,
router
,
router
,
...
...
web/src/router/index.js
View file @
902e5714
...
@@ -8,6 +8,7 @@ import VueRouter from 'vue-router'
...
@@ -8,6 +8,7 @@ import VueRouter from 'vue-router'
import
Layout
from
'@/layouts'
import
Layout
from
'@/layouts'
import
EmptyLayout
from
'@/layouts/EmptyLayout'
import
EmptyLayout
from
'@/layouts/EmptyLayout'
import
{
publicPath
,
routerMode
}
from
'@/config'
import
{
publicPath
,
routerMode
}
from
'@/config'
import
{
size
}
from
"lodash/collection"
;
Vue
.
use
(
VueRouter
)
Vue
.
use
(
VueRouter
)
export
const
constantRoutes
=
[
export
const
constantRoutes
=
[
...
@@ -47,7 +48,8 @@ export const asyncRoutes = [
...
@@ -47,7 +48,8 @@ export const asyncRoutes = [
component
:
()
=>
import
(
'@/views/index/index'
),
component
:
()
=>
import
(
'@/views/index/index'
),
meta
:
{
meta
:
{
title
:
'首页'
,
title
:
'首页'
,
icon
:
'home'
icon
:
'home'
,
},
},
},
},
],
],
...
@@ -57,7 +59,7 @@ export const asyncRoutes = [
...
@@ -57,7 +59,7 @@ export const asyncRoutes = [
component
:
Layout
,
component
:
Layout
,
name
:
'myData'
,
name
:
'myData'
,
redirect
:
'/myData'
,
redirect
:
'/myData'
,
meta
:
{
title
:
'通用工具子系统'
,
icon
:
'box-open'
},
meta
:
{
title
:
'通用工具子系统'
,
icon
:
'box-open'
,
},
children
:
[
children
:
[
{
{
path
:
'/myData'
,
path
:
'/myData'
,
...
@@ -65,7 +67,9 @@ export const asyncRoutes = [
...
@@ -65,7 +67,9 @@ export const asyncRoutes = [
component
:
()
=>
import
(
'@/views/myData'
),
component
:
()
=>
import
(
'@/views/myData'
),
meta
:
{
meta
:
{
title
:
'数据查询'
,
title
:
'数据查询'
,
icon
:
'hockey-puck'
icon
:
'hockey-puck'
,
width
:
'60px'
,
},
},
},
},
{
{
...
@@ -134,16 +138,16 @@ export const asyncRoutes = [
...
@@ -134,16 +138,16 @@ export const asyncRoutes = [
{
{
path
:
'/
data1
'
,
path
:
'/
generalTool
'
,
component
:
Layout
,
component
:
Layout
,
name
:
'
data1
'
,
name
:
'
generalTool
'
,
redirect
:
'/
data1
'
,
redirect
:
'/
generalTool
'
,
meta
:
{
title
:
'
数据可视化分析
'
,
icon
:
'box-open'
},
meta
:
{
title
:
'
通用工具子系统
'
,
icon
:
'box-open'
},
children
:
[
children
:
[
{
{
path
:
'/
data1
'
,
path
:
'/
generalTool
'
,
name
:
'
data1
'
,
name
:
'
generalTool
'
,
component
:
()
=>
import
(
'@/views/
data
'
),
component
:
()
=>
import
(
'@/views/
generalTool
'
),
meta
:
{
meta
:
{
title
:
'通用工具子系统'
,
title
:
'通用工具子系统'
,
icon
:
'hand-middle-finger'
,
icon
:
'hand-middle-finger'
,
...
@@ -153,7 +157,7 @@ export const asyncRoutes = [
...
@@ -153,7 +157,7 @@ export const asyncRoutes = [
path
:
'analysis'
,
path
:
'analysis'
,
name
:
'analysis'
,
name
:
'analysis'
,
hidden
:
true
,
hidden
:
true
,
component
:
()
=>
import
(
'@/views/
data
/components/analysis'
),
component
:
()
=>
import
(
'@/views/
generalTool
/components/analysis'
),
meta
:
{
meta
:
{
title
:
'数据'
title
:
'数据'
},
},
...
...
web/src/styles/variables.scss
View file @
902e5714
...
@@ -10,7 +10,7 @@ $base-color-default: #eb8d00;
...
@@ -10,7 +10,7 @@ $base-color-default: #eb8d00;
$base-z-index
:
999
;
$base-z-index
:
999
;
//横向布局纵向布局时菜单背景色
//横向布局纵向布局时菜单背景色
// $base-menu-background: #252525;
// $base-menu-background: #252525;
$base-menu-background
:
#
2aa0bb
;
$base-menu-background
:
#
0078D4
;
//菜单文字颜色
//菜单文字颜色
$base-menu-color
:
hsla
(
0
,
0%
,
91%
,
0
.95
);
$base-menu-color
:
hsla
(
0
,
0%
,
91%
,
0
.95
);
//菜单选中文字颜色
//菜单选中文字颜色
...
...
web/src/utils/echartsUtil.js
View file @
902e5714
...
@@ -2,74 +2,74 @@
...
@@ -2,74 +2,74 @@
export
function
getOption
(
data1
)
{
export
function
getOption
(
data1
)
{
console
.
log
(
data1
)
console
.
log
(
data1
)
// if(data1["data"].length == 0) {
// if(data1["data"].length == 0) {
// return
// return
// }
// }
// prettier-ignore
// prettier-ignore
const
hours
=
data1
[
"columns"
];
const
hours
=
data1
[
"columns"
];
// prettier-ignore
// prettier-ignore
const
days
=
data1
[
"index"
];
const
days
=
data1
[
"index"
];
// prettier-ignore
// prettier-ignore
let
data
=
[]
let
data
=
[]
for
(
let
item
in
data1
.
data
)
{
for
(
let
item
in
data1
.
data
)
{
for
(
let
col
in
data1
.
data
[
item
])
{
for
(
let
col
in
data1
.
data
[
item
])
{
data
.
push
([
parseInt
(
item
),
parseInt
(
col
),
data1
.
data
[
item
][
col
]])
data
.
push
([
parseInt
(
item
),
parseInt
(
col
),
data1
.
data
[
item
][
col
]])
}
}
}
// const data = [[0, 0, 5]]
}
// .map(function (item) {
// const data = [[0, 0, 5]]
// return [item[1], item[0], item[2] || '-'];
// .map(function (item) {
// });
// return [item[1], item[0], item[2] || '-'];
console
.
log
(
data
)
// });
let
option
=
{
console
.
log
(
data
)
tooltip
:
{
let
option
=
{
position
:
'top'
tooltip
:
{
},
position
:
'top'
grid
:
{
},
height
:
'50%'
,
grid
:
{
top
:
'10%'
height
:
'50%'
,
},
top
:
'10%'
xAxis
:
{
},
type
:
'category'
,
xAxis
:
{
data
:
hours
,
type
:
'category'
,
splitArea
:
{
data
:
hours
,
show
:
true
splitArea
:
{
}
show
:
true
}
},
yAxis
:
{
type
:
'category'
,
data
:
days
,
splitArea
:
{
show
:
true
}
},
visualMap
:
{
min
:
0
,
max
:
1
,
calculable
:
true
,
orient
:
'horizontal'
,
left
:
'center'
,
bottom
:
'15%'
},
series
:
[
{
name
:
'Punch Card'
,
type
:
'heatmap'
,
data
:
data
,
label
:
{
show
:
true
},
},
yAxis
:
{
emphasis
:
{
type
:
'category'
,
itemStyle
:
{
data
:
days
,
shadowBlur
:
10
,
splitArea
:
{
shadowColor
:
'rgba(0, 0, 0, 0.5)'
show
:
true
}
}
}
},
}
visualMap
:
{
]
min
:
0
,
};
max
:
1
,
return
option
;
calculable
:
true
,
orient
:
'horizontal'
,
left
:
'center'
,
bottom
:
'15%'
},
series
:
[
{
name
:
'Punch Card'
,
type
:
'heatmap'
,
data
:
data
,
label
:
{
show
:
true
},
emphasis
:
{
itemStyle
:
{
shadowBlur
:
10
,
shadowColor
:
'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
return
option
;
}
}
...
@@ -77,71 +77,135 @@ export function getOption(data1) {
...
@@ -77,71 +77,135 @@ export function getOption(data1) {
export
function
getOption2
(
res
)
{
export
function
getOption2
(
res
)
{
let
seriesList
=
[]
let
seriesList
=
[]
let
col
=
[]
let
leg
=
[]
let
header
=
res
[
'header'
]
//["决策单元",'技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)']
let
data
=
res
[
'value'
]
for
(
let
i
in
header
){
console
.
log
(
header
[
i
])
let
litem
=
header
[
i
]
let
datalist
=
[]
for
(
let
j
in
data
)
{
let
ditem
=
data
[
j
]
let
value
=
ditem
[
litem
]
if
(
litem
==
"index"
)
{
col
.
push
(
value
)
continue
;
}
if
(
litem
==
"有效性"
)
{
continue
;
}
datalist
.
push
(
value
)
}
if
(
litem
!=
"决策单元"
&&
litem
!=
"有效性"
&&
litem
!=
"index"
)
{
leg
.
push
(
litem
)
let
obj
=
{
name
:
litem
,
type
:
'line'
,
data
:
datalist
,
symbol
:
'none'
,
let
col
=
[]
let
leg
=
[]
let
header
=
res
[
'header'
]
//["决策单元",'技术效益(BCC)','规模效益(CCR/BCC)','综合技术效益(CCR)']
let
data
=
res
[
'data'
]
for
(
let
i
in
header
){
console
.
log
(
header
[
i
])
let
litem
=
header
[
i
]
let
datalist
=
[]
for
(
let
j
in
data
)
{
let
ditem
=
data
[
j
]
let
value
=
ditem
[
litem
]
if
(
litem
==
"决策单元"
)
{
col
.
push
(
value
)
continue
;
}
if
(
litem
==
"有效性"
)
{
continue
;
}
datalist
.
push
(
value
)
}
if
(
litem
!=
"决策单元"
&&
litem
!=
"有效性"
)
{
leg
.
push
(
litem
)
let
obj
=
{
name
:
litem
,
type
:
'line'
,
data
:
datalist
}
seriesList
.
push
(
obj
)
}
}
seriesList
.
push
(
obj
)
}
}
console
.
log
(
col
)
console
.
log
(
seriesList
)
}
let
option
=
{
console
.
log
(
col
)
title
:
{
console
.
log
(
seriesList
)
text
:
'效益有效性分析'
let
option
=
{
},
title
:
{
tooltip
:
{
text
:
''
trigger
:
'axis'
},
},
tooltip
:
{
legend
:
{
trigger
:
'axis'
,
data
:
leg
position
:
function
(
pt
)
{
},
return
[
pt
[
0
],
'20%'
];
grid
:
{
},
left
:
'3%'
,
valueFormatter
:
(
value
)
=>
parseFloat
(
value
).
toFixed
(
Number
(
3
))
right
:
'4%'
,
},
bottom
:
'3%'
,
legend
:
{
containLabel
:
true
data
:
leg
},
dataZoom
:
[
{
type
:
'inside'
,
start
:
0
,
end
:
100
},
{
start
:
0
,
end
:
100
}
],
grid
:
{
left
:
'3%'
,
right
:
'4%'
,
// bottom: '3%',
containLabel
:
true
},
toolbox
:
{
feature
:
{
dataZoom
:
{
yAxisIndex
:
'none'
},
},
toolbox
:
{
restore
:
{},
feature
:
{
saveAsImage
:
{}
saveAsImage
:
{}
}
},
xAxis
:
{
type
:
'category'
,
boundaryGap
:
false
,
data
:
col
},
yAxis
:
{
type
:
'value'
,
min
:
"dataMin"
,
max
:
"dataMax"
,
boundaryGap
:
[
0
,
'100%'
]
},
series
:
seriesList
};
return
option
;
}
export
function
getOptionByDEA
(
res
)
{
let
resdata
=
res
[
'value'
]
let
data
=
[]
for
(
let
i
in
resdata
){
let
value
=
[]
value
.
push
(
resdata
[
i
][
'投入'
])
value
.
push
(
resdata
[
i
][
'产出'
])
value
.
push
(
resdata
[
i
][
'决策单元'
])
data
.
push
(
value
)
}
let
option
=
{
xAxis
:
{},
yAxis
:
{},
tooltip
:
{
trigger
:
'axis'
},
series
:
[
{
symbolSize
:
20
,
data
:
data
,
itemStyle
:
{
normal
:
{
label
:
{
position
:
[
25
,
9
],
show
:
true
,
formatter
:
function
(
params
)
{
return
params
.
value
[
2
]
}
}
}
}
},
},
xAxis
:
{
type
:
'category'
,
type
:
'scatter'
boundaryGap
:
false
,
}
data
:
col
]
},
};
yAxis
:
{
return
option
;
type
:
'value'
},
series
:
seriesList
};
return
option
;
}
}
web/src/utils/request.js
View file @
902e5714
...
@@ -78,7 +78,7 @@ instance.interceptors.request.use(
...
@@ -78,7 +78,7 @@ instance.interceptors.request.use(
instance
.
interceptors
.
response
.
use
(
instance
.
interceptors
.
response
.
use
(
(
response
)
=>
{
(
response
)
=>
{
debugger
;
//
debugger;
if
(
loadingInstance
)
loadingInstance
.
close
()
if
(
loadingInstance
)
loadingInstance
.
close
()
const
{
data
,
config
}
=
response
const
{
data
,
config
}
=
response
...
...
web/src/views/data/components/analysis.vue
deleted
100644 → 0
View file @
c2a9f8df
This diff is collapsed.
Click to expand it.
web/src/views/dataSource/index.vue
View file @
902e5714
...
@@ -137,11 +137,11 @@
...
@@ -137,11 +137,11 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
getyear
,
getAddress
,
detDataTitle
,
getIndustry
,
ru
n
,
getTree
}
from
'@/api/data'
import
{
getyear
,
getAddress
,
detDataTitle
,
getIndustry
,
getConditio
n
,
getTree
}
from
'@/api/data'
import
{
getOption
}
from
"@/utils/echartsUtil"
import
{
getOption
}
from
"@/utils/echartsUtil"
import
VabChart
from
'@/plugins/echarts'
import
VabChart
from
'@/plugins/echarts'
export
default
{
export
default
{
...
@@ -158,7 +158,7 @@
...
@@ -158,7 +158,7 @@
},
},
activeNames
:
"1"
,
activeNames
:
"1"
,
idxData
:
[],
idxData
:
[],
defaultProps
:
{
defaultProps
:
{
children
:
'children'
,
children
:
'children'
,
label
:
'name'
label
:
'name'
...
@@ -417,7 +417,7 @@
...
@@ -417,7 +417,7 @@
},
},
showDate
()
{
showDate
()
{
// this.resultData = false;
// this.resultData = false;
ru
n
(
this
.
params
).
then
(
res
=>
{
getConditio
n
(
this
.
params
).
then
(
res
=>
{
this
.
resultData
=
true
;
this
.
resultData
=
true
;
console
.
log
(
res
)
console
.
log
(
res
)
this
.
tableHeader
=
res
.
data
.
header
;
this
.
tableHeader
=
res
.
data
.
header
;
...
@@ -509,4 +509,4 @@
...
@@ -509,4 +509,4 @@
color
:
#303133
;
color
:
#303133
;
line-height
:
1.7692307692
;
line-height
:
1.7692307692
;
}
}
</
style
>
</
style
>
\ No newline at end of file
web/src/views/generalTool/components/analysis.vue
0 → 100644
View file @
902e5714
This diff is collapsed.
Click to expand it.
web/src/views/
data
/components/project.bk.vue
→
web/src/views/
generalTool
/components/project.bk.vue
View file @
902e5714
File moved
web/src/views/
data
/components/project.vue
→
web/src/views/
generalTool
/components/project.vue
View file @
902e5714
File moved
web/src/views/generalTool/components/res/ahpsimple.vue
0 → 100644
View file @
902e5714
<
template
>
<div
style=
"height:100%;width:100%"
>
<div
style=
"height: 100%;position:relative;"
>
<div
style=
"height:41px;line-height:41px; font-size:16px;font-weight:600;border-bottom:1px solid #e3e3e3"
>
<span
style=
"margin-left:30px"
>
{{
algoName
}}
</span>
</div>
<div
v-if=
"loading"
style=
"position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"
>
<div
style=
"padding-bottom: 100px;"
>
<div
style=
"width: 100%; height:100px;margin:10px 50px;"
>
<span
style=
"font-weight:600;font-size:16px"
>
算法结果描述
</span>
</div>
<div
class=
"dynamicComp"
>
<div
v-for=
"(item,idx) in compDataList"
>
<!--
<component
:is=
"item.type"
></component>
-->
<div
style=
"margin:50px;"
>
<div
style=
"margin:15px"
>
<span
style=
"font-weight:600;font-size:18px"
>
{{
item
.
name
}}
</span>
</div>
<el-table
border
height=
"100%"
:data=
item.value
:style=
"
{'width': '100%'}">
<template
v-for=
"item1 in item.header"
>
<el-table-column
:prop=
"item1"
align=
"center"
:label=
"item1"
:sortable=
"true"
min-width=
"200"
>
</el-table-column>
</
template
>
</el-table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
getOption2
}
from
"@/utils/echartsUtil"
import
*
as
echarts
from
'echarts'
;
import
VabChart
from
'@/plugins/echarts'
import
Vue
from
'vue'
//引入echarts
export
default
{
name
:
'res3'
,
props
:
{
algoName
:
{
},
algoRes
:
{
},
algoAllHeader
:{
}
},
components
:
{
VabChart
},
data
()
{
return
{
compDataList
:[],
fwl
:
{},
tableHeader
:
[],
tableData
:
[],
tableHeader1
:
[],
tableData1
:
[],
loading
:
false
,
}
},
mounted
()
{
this
.
initData
();
},
methods
:
{
initData
()
{
this
.
tableData
=
[];
this
.
tableHeader
=
[]
console
.
log
(
this
.
algoRes
)
let
data
=
JSON
.
parse
(
this
.
algoRes
)
let
newHeader
=
[
'指标'
,
...
this
.
algoAllHeader
]
this
.
loading
=
true
;
for
(
let
i
in
data
){
let
item
=
data
[
i
]
let
header
=
Object
.
keys
(
item
.
value
)
if
(
item
.
name
==
'输出结果1:指标指数'
){
item
[
'header'
]
=
newHeader
let
data1
=
this
.
arraysToJsonObjectArray
(
newHeader
,
item
.
value
)
item
[
'value'
]
=
data1
this
.
compDataList
.
push
(
item
)
}
else
if
(
item
.
name
==
'输出结果2:AHP层次分析结果'
){
let
value
=
item
.
value
let
data
=
this
.
AHPResultToJsonObject
(
value
)
item
[
'header'
]
=
[
'项'
,
...
header
]
item
[
'value'
]
=
data
this
.
compDataList
.
push
(
item
)
}
else
if
(
item
.
name
==
'输出结果3:一致性检验结果'
){
item
[
'header'
]
=
Object
.
keys
(
item
.
value
)
let
obj
=
item
.
value
let
rows
=
[];
for
(
let
key
in
obj
)
{
let
value
=
obj
[
key
];
if
(
value
==
true
)
value
=
'通过'
else
if
(
value
==
false
)
value
=
'不通过'
obj
[
key
]
=
value
}
rows
.
push
(
obj
)
item
[
'value'
]
=
rows
this
.
compDataList
.
push
(
item
)
}
Vue
.
filter
(
'formate'
,(
value
)
=>
{
if
(
value
)
return
'通过'
return
value
=
'不通过'
})
console
.
log
(
item
)
}
},
resultToJsonObjectArray
(
keys
,
values
)
{
let
rows
=
[];
let
item
=
values
[
keys
[
1
]]
for
(
let
j
=
0
;
j
<
Object
.
keys
(
item
).
length
;
j
++
)
{
let
key
=
Object
.
keys
(
item
)[
j
]
let
row
=
{}
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
i
==
0
){
row
[
keys
[
i
]]
=
key
}
else
{
let
key1
=
keys
[
i
];
let
value
=
values
[
key1
][
key
];
row
[
key1
]
=
value
}
}
rows
.
push
(
row
)
}
return
rows
;
},
arraysToJsonObjectArray
(
keys
,
values
)
{
let
rows
=
[];
for
(
let
i
=
0
;
i
<
values
.
length
;
i
++
)
{
let
item
=
values
[
i
]
let
row
=
{}
for
(
var
j
=
0
;
j
<=
item
.
length
;
j
++
)
{
// 在每次迭代中,将 i 的值累加到 sum 中
if
(
j
==
0
){
row
[
keys
[
j
]]
=
keys
[
i
+
1
]
}
else
{
let
key
=
keys
[
j
];
let
value
=
item
[
j
-
1
];
row
[
key
]
=
value
}
}
rows
.
push
(
row
)
}
return
rows
;
},
AHPResultToJsonObject
(
data
)
{
let
index
=
data
[
'项'
]
let
ci
=
data
[
'CI值'
]
let
max
=
data
[
'最大特征根'
]
let
weightValue
=
data
[
'权重值'
]
let
featureVector
=
data
[
'特征向量'
]
let
rows
=
[];
for
(
let
i
=
0
;
i
<
weightValue
.
length
;
i
++
)
{
let
row
=
{}
let
value
=
weightValue
[
i
];
row
[
'项'
]
=
this
.
algoAllHeader
[
i
];
row
[
'权重值'
]
=
value
;
row
[
'特征向量'
]
=
featureVector
[
i
];
row
[
'CI值'
]
=
ci
row
[
'最大特征根'
]
=
max
rows
.
push
(
row
)
}
return
rows
;
}
}
}
</
script
>
<
style
scoped
>
</
style
>
web/src/views/generalTool/components/res/dea.vue
0 → 100644
View file @
902e5714
<
template
>
<div
style=
"height:100%;width:100%"
>
<div
style=
"height: 100%;position:relative;"
>
<div
style=
"height:41px;line-height:41px; font-size:16px;font-weight:600;border-bottom:1px solid #e3e3e3"
>
<span
style=
"margin-left:30px"
>
{{
algoName
}}
</span>
</div>
<div
v-if=
"loading"
style=
"position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"
>
<div
style=
"padding-bottom: 100px;"
>
<div
style=
"width: 100%; height:80px;margin:10px 30px;"
>
<span
style=
"font-weight:600;font-size:14px"
>
算法结果描述
</span>
</div>
<div
class=
"dynamicComp"
>
<div
v-for=
"(item,idx) in compDataList"
>
<!--
<component
:is=
"item.type"
></component>
-->
<div
style=
"margin:30px"
>
<span
style=
"font-weight:600;font-size:14px"
>
{{
item
.
name
}}
</span>
</div>
<div
v-if=
"item.name=='输出结果2:效益有效性分析'"
>
<div
style=
"margin:50px; height:600px; display: flex;flex-direction: column; align-content: center;justify-content: center; align-items: center;"
>
<vab-chart
autoresize
:options=
"fwl"
:style=
"
{'width': '80%', 'height':'80%'}" />
</div>
</div>
<div
v-else-if=
"item.name=='输出结果4:象限分析'"
>
<div
style=
"margin:50px; height:600px; display: flex;flex-direction: column; align-content: center;justify-content: center; align-items: center;"
>
<vab-chart
autoresize
:options=
"quadrant"
:style=
"
{'width': '80%', 'height':'80%'}" />
</div>
</div>
<div
v-else
>
<el-table
border
height=
"100%"
:data=
decimalNumberPrecision(item.header,item.value)
:style=
"
{'width': '100%','margin':'30px'}">
<template
v-for=
"item1 in item.header"
>
<el-table-column
:prop=
"item1"
align=
"center"
:label=
"item1"
:sortable=
"true"
min-width=
"200"
>
</el-table-column>
</
template
>
</el-table>
</div>
<div
style=
"margin:15px"
>
<div
style=
"font-weight:600;font-size: 14px;margin:10px 15px;"
>
图表说明:
</div>
<div
style=
"white-space: pre-wrap;font-size: 14px;margin:10px 15px;"
>
{{item.text}}
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
getOption2
,
getOptionByDEA
}
from
"@/utils/echartsUtil"
import
*
as
echarts
from
'echarts'
;
import
VabChart
from
'@/plugins/echarts'
import
{
forEach
}
from
"lodash/fp/_util"
;
//引入echarts
export
default
{
name
:
'res1'
,
props
:
{
algoName
:
{
},
algoRes
:
{
}
},
components
:
{
VabChart
},
data
()
{
return
{
compDataList
:[],
fwl
:
{},
quadrant
:{},
loading
:
false
,
}
},
mounted
()
{
this
.
initData
();
},
methods
:
{
initData
()
{
let
data
=
JSON
.
parse
(
this
.
algoRes
)
console
.
log
(
this
.
algoRes
)
this
.
loading
=
true
;
let
newHeader
=
[]
for
(
let
i
in
data
)
{
let
item
=
data
[
i
]
let
header
=
Object
.
keys
(
item
.
value
)
if
(
item
.
name
.
indexOf
(
'输出结果3:规模报酬分析'
)
>=
0
)
newHeader
=
[
'项'
,
...
header
]
else
newHeader
=
[
'决策单元'
,
...
header
]
let
data1
=
this
.
resultToJsonObjectArray
(
newHeader
,
item
.
value
)
item
[
'header'
]
=
newHeader
item
[
'value'
]
=
data1
this
.
compDataList
.
push
(
item
)
if
(
item
.
name
.
indexOf
(
'效益有效性分析'
)
>=
0
){
this
.
fwl
=
getOption2
(
item
)
}
if
(
item
.
name
.
indexOf
(
'输出结果5:象限分析输出汇总'
)
>=
0
){
this
.
quadrant
=
getOptionByDEA
(
item
)
}
}
},
decimalNumberPrecision
(
headers
,
datas
){
datas
.
forEach
(
function
(
data
)
{
headers
.
forEach
(
function
(
header
)
{
let
value
=
data
[
header
];
if
(
typeof
value
===
'number'
)
data
[
header
]
=
value
.
toFixed
(
3
)
});
});
return
datas
},
resultToJsonObjectArray
(
keys
,
values
)
{
let
rows
=
[];
let
item
=
values
[
keys
[
1
]]
for
(
let
j
=
0
;
j
<
Object
.
keys
(
item
).
length
;
j
++
)
{
let
key
=
Object
.
keys
(
item
)[
j
]
let
row
=
{}
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
i
==
0
){
row
[
keys
[
i
]]
=
key
}
else
{
let
key1
=
keys
[
i
];
let
value
=
values
[
key1
][
key
];
row
[
key1
]
=
value
}
}
rows
.
push
(
row
)
}
return
rows
;
},
}
}
</
script
>
<
style
scoped
>
</
style
>
web/src/views/
data
/components/res/res1.vue
→
web/src/views/
generalTool
/components/res/res1.vue
View file @
902e5714
File moved
web/src/views/
data
/components/res/res2.vue
→
web/src/views/
generalTool
/components/res/res2.vue
View file @
902e5714
File moved
web/src/views/generalTool/components/res/rsr.vue
0 → 100644
View file @
902e5714
<
template
>
<div
style=
"height:100%;width:100%"
>
<div
style=
"height: 100%;position:relative;"
>
<div
style=
"height:41px;line-height:41px; font-size:16px;font-weight:600;border-bottom:1px solid #e3e3e3"
>
<span
style=
"margin-left:30px"
>
{{
algoName
}}
</span>
</div>
<div
v-if=
"loading"
style=
"position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"
>
<div
style=
"padding-bottom: 100px;"
>
<div
style=
"width: 100%; height:100px;margin:10px 50px;"
>
<span
style=
"font-weight:600;font-size:16px"
>
算法结果描述
</span>
</div>
<div
class=
"dynamicComp"
>
<div
v-for=
"(item,idx) in compDataList"
>
<!--
<component
:is=
"item.type"
></component>
-->
<div
style=
"margin:50px;"
>
<div
style=
"margin:15px"
>
<span
style=
"font-weight:600;font-size:18px"
>
{{
item
.
name
}}
</span>
</div>
<el-table
border
height=
"100%"
:data=
item.value
:style=
"
{'width': '100%'}">
<template
v-for=
"item1 in item.header"
>
<el-table-column
:prop=
"item1"
align=
"center"
:label=
"item1"
:sortable=
"true"
min-width=
"200"
>
</el-table-column>
</
template
>
</el-table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
getOption2
}
from
"@/utils/echartsUtil"
import
*
as
echarts
from
'echarts'
;
import
VabChart
from
'@/plugins/echarts'
import
Vue
from
'vue'
//引入echarts
export
default
{
name
:
'res4'
,
props
:
{
algoName
:
{
},
algoRes
:
{
},
algoAllHeader
:{
}
},
components
:
{
VabChart
},
data
()
{
return
{
compDataList
:[],
loading
:
false
,
}
},
mounted
()
{
this
.
initData
();
},
methods
:
{
initData
()
{
console
.
log
(
this
.
algoRes
)
let
data
=
JSON
.
parse
(
this
.
algoRes
)
let
newHeader
=
[]
this
.
loading
=
true
;
for
(
let
i
in
data
){
let
item
=
data
[
i
]
if
(
item
.
name
.
indexOf
(
'评价'
)
>=
0
){
let
header
=
Object
.
keys
(
item
.
value
)
newHeader
=
[
'索引值'
,
...
header
]
}
else
{
let
header
=
Object
.
keys
(
item
.
value
)
//[Object.keys(item.value)[0]]
newHeader
=
[
'项'
,
...
header
]
}
item
[
'header'
]
=
newHeader
let
data1
=
this
.
TOPResultToJsonObjectArray
(
newHeader
,
item
.
value
)
item
[
'value'
]
=
data1
this
.
compDataList
.
push
(
item
)
console
.
log
(
item
)
}
},
TOPResultToJsonObjectArray
(
keys
,
values
)
{
let
rows
=
[];
let
item
=
values
[
keys
[
1
]]
for
(
let
j
=
0
;
j
<
Object
.
keys
(
item
).
length
;
j
++
)
{
let
key
=
Object
.
keys
(
item
)[
j
]
let
row
=
{}
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
i
==
0
){
row
[
keys
[
i
]]
=
key
}
else
{
let
key1
=
keys
[
i
];
let
value
=
values
[
key1
][
key
];
row
[
key1
]
=
value
}
}
rows
.
push
(
row
)
}
return
rows
;
},
}
}
</
script
>
<
style
scoped
>
</
style
>
web/src/views/generalTool/components/res/topsis.vue
0 → 100644
View file @
902e5714
<
template
>
<div
style=
"height:100%;width:100%"
>
<div
style=
"height: 100%;position:relative;"
>
<div
style=
"height:41px;line-height:41px; font-size:16px;font-weight:600;border-bottom:1px solid #e3e3e3"
>
<span
style=
"margin-left:30px"
>
{{
algoName
}}
</span>
</div>
<div
v-if=
"loading"
style=
"position: absolute; top: 41px; right:0px; left:0px; bottom:0px;overflow: scroll;"
>
<div
style=
"padding-bottom: 100px;"
>
<div
style=
"width: 100%; height:100px;margin:10px 50px;"
>
<span
style=
"font-weight:600;font-size:16px"
>
算法结果描述
</span>
</div>
<div
class=
"dynamicComp"
>
<div
v-for=
"(item,idx) in compDataList"
>
<!--
<component
:is=
"item.type"
></component>
-->
<div
style=
"margin:50px;"
>
<div
style=
"margin:15px"
>
<span
style=
"font-weight:600;font-size:18px"
>
{{
item
.
name
}}
</span>
</div>
<el-table
border
height=
"100%"
:data=
item.value
:style=
"
{'width': '100%'}">
<template
v-for=
"item1 in item.header"
>
<el-table-column
:prop=
"item1"
align=
"center"
:label=
"item1"
:sortable=
"true"
min-width=
"200"
>
</el-table-column>
</
template
>
</el-table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<
script
>
import
{
getOption2
}
from
"@/utils/echartsUtil"
import
*
as
echarts
from
'echarts'
;
import
VabChart
from
'@/plugins/echarts'
import
Vue
from
'vue'
//引入echarts
export
default
{
name
:
'res4'
,
props
:
{
algoName
:
{
},
algoRes
:
{
},
algoAllHeader
:{
}
},
components
:
{
VabChart
},
data
()
{
return
{
compDataList
:[],
loading
:
false
,
}
},
mounted
()
{
this
.
initData
();
},
methods
:
{
initData
()
{
console
.
log
(
this
.
algoRes
)
let
data
=
JSON
.
parse
(
this
.
algoRes
)
let
newHeader
=
[]
this
.
loading
=
true
;
for
(
let
i
in
data
){
let
item
=
data
[
i
]
if
(
item
.
name
.
indexOf
(
'评价'
)
>=
0
){
let
header
=
Object
.
keys
(
item
.
value
)
newHeader
=
[
'索引值'
,
...
header
]
}
else
{
let
header
=
Object
.
keys
(
item
.
value
)
//[Object.keys(item.value)[0]]
newHeader
=
[
'项'
,
...
header
]
}
item
[
'header'
]
=
newHeader
let
data1
=
this
.
TOPResultToJsonObjectArray
(
newHeader
,
item
.
value
)
item
[
'value'
]
=
data1
this
.
compDataList
.
push
(
item
)
console
.
log
(
item
)
}
},
TOPResultToJsonObjectArray
(
keys
,
values
)
{
let
rows
=
[];
let
item
=
values
[
keys
[
1
]]
for
(
let
j
=
0
;
j
<
Object
.
keys
(
item
).
length
;
j
++
)
{
let
key
=
Object
.
keys
(
item
)[
j
]
let
row
=
{}
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
if
(
i
==
0
){
row
[
keys
[
i
]]
=
key
}
else
{
let
key1
=
keys
[
i
];
let
value
=
values
[
key1
][
key
];
row
[
key1
]
=
value
}
}
rows
.
push
(
row
)
}
return
rows
;
},
}
}
</
script
>
<
style
scoped
>
</
style
>
web/src/views/
data
/index copy.vue
→
web/src/views/
generalTool
/index copy.vue
View file @
902e5714
File moved
web/src/views/
data
/index.vue
→
web/src/views/
generalTool
/index.vue
View file @
902e5714
File moved
web/src/views/myData/components/sysAllData.vue
View file @
902e5714
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
</el-collapse-item>
</el-collapse-item>
<el-collapse-item
title=
"数据指标"
name=
"1"
>
<el-collapse-item
title=
"数据指标"
name=
"1"
>
<div
style=
"height: 380px;overflow: scroll;"
>
<div
style=
"height: 380px;overflow: scroll;"
>
<el-tree
@
check=
"checkNode"
:data=
"idxData"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
show-checkbox
>
<el-tree
@
check=
"checkNode"
:data=
"idxData"
:props=
"defaultProps"
@
node-click=
"handleNodeClick"
show-checkbox
ref=
"tree"
node-key=
"name"
>
</el-tree>
</el-tree>
</div>
</div>
<div
style=
"margin-top:2px;margin-left: 40%;"
>
<div
style=
"margin-top:2px;margin-left: 40%;"
>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
</el-collapse>
</el-collapse>
</div>
</div>
<div
class=
"right"
>
<div
class=
"right"
>
<div
class=
"entry"
style=
"height:35%;"
>
<div
class=
"entry"
style=
"height:35%;"
>
<div
class=
"header"
style=
""
>
指标
</div>
<div
class=
"header"
style=
""
>
指标
</div>
<div
class=
"body"
>
<div
class=
"body"
>
...
@@ -83,7 +83,7 @@
...
@@ -83,7 +83,7 @@
</div>
</div>
<div
style=
"width: 100%; width: 100%; height: 41px; background: white; line-height: 41px;position: relative;position: relative;display: flex;"
>
<div
style=
"width: 100%; width: 100%; height: 41px; background: white; line-height: 41px;position: relative;position: relative;display: flex;"
>
<div
class=
"btn"
style=
"text-align: center;width: 50%;background: #f7c57a;color: white;"
@
click=
"clearAll"
>
清空
</div>
<div
class=
"btn"
style=
"text-align: center;width: 50%;background: #f7c57a;color: white;"
@
click=
"clearAll"
>
清空
</div>
<div
class=
"btn"
style=
"text-align: center;flex:1;background: #00
8f70
;color: white;"
@
click=
"showDate"
>
预览
</div>
<div
class=
"btn"
style=
"text-align: center;flex:1;background: #00
78D4
;color: white;"
@
click=
"showDate"
>
预览
</div>
</div>
</div>
</div>
</div>
<div
style=
"flex:1;background:white;overflow: scroll;"
>
<div
style=
"flex:1;background:white;overflow: scroll;"
>
...
@@ -110,17 +110,17 @@
...
@@ -110,17 +110,17 @@
</div>
</div>
</div>
</div>
<div
style=
"position: absolute; bottom: 0px; right: 17px;"
v-show=
"!saveFlag"
>
<div
style=
"position: absolute; bottom: 0px; right: 17px;"
v-show=
"!saveFlag"
>
<el-button
type=
"success"
@
click=
"toSaveTempFile"
style=
"margin-left:14px;margin-right:4px"
>
保存数据
</el-button>
<el-button
type=
"success"
@
click=
"toSaveTempFile"
style=
"margin-left:14px;margin-right:4px
;background-color: #358FD4
"
>
保存数据
</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
</template>
<
script
>
<
script
>
import
{
getyear
,
getAddress
,
detDataTitle
,
getIndustry
,
run
,
getTree
,
saveTempFile
}
from
'@/api/data'
import
{
getyear
,
getAddress
,
detDataTitle
,
getIndustry
,
getCondition
,
getTree
,
saveTempFile
,
createProject
}
from
'@/api/data'
import
{
getOption
}
from
"@/utils/echartsUtil"
import
{
getOption
}
from
"@/utils/echartsUtil"
import
VabChart
from
'@/plugins/echarts'
import
VabChart
from
'@/plugins/echarts'
export
default
{
export
default
{
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
},
},
activeNames
:
"1"
,
activeNames
:
"1"
,
idxData
:
[],
idxData
:
[],
defaultProps
:
{
defaultProps
:
{
children
:
'children'
,
children
:
'children'
,
label
:
'name'
label
:
'name'
...
@@ -185,8 +185,8 @@
...
@@ -185,8 +185,8 @@
},
},
methods
:
{
methods
:
{
handleNodeClick
()
{
handleNodeClick
(
obj
)
{
this
.
checkDataTitle
(
obj
)
},
},
init
()
{
init
()
{
this
.
getAllYear
();
this
.
getAllYear
();
...
@@ -206,9 +206,14 @@
...
@@ -206,9 +206,14 @@
checkNode
(
obj
,
dList
)
{
checkNode
(
obj
,
dList
)
{
console
.
log
(
obj
);
console
.
log
(
obj
);
console
.
log
(
dList
)
console
.
log
(
dList
)
this
.
condition
.
dataCondition
=
dList
.
checkedNodes
.
filter
(
item
=>
{
// if(obj.checked) {
return
item
.
level
==
3
;
// this.condition.dataCondition.push(obj)
})
// }else{
this
.
condition
.
dataCondition
=
dList
.
checkedNodes
.
filter
(
item
=>
{
return
item
.
level
==
3
;
})
// }
this
.
selectData
()
},
},
getAllIndustry
()
{
getAllIndustry
()
{
this
.
industry
=
[]
this
.
industry
=
[]
...
@@ -277,40 +282,45 @@
...
@@ -277,40 +282,45 @@
this
.
condition
.
dataCondition
=
this
.
condition
.
dataCondition
.
filter
(
function
(
item
)
{
this
.
condition
.
dataCondition
=
this
.
condition
.
dataCondition
.
filter
(
function
(
item
)
{
return
item
.
name
!=
obj
.
name
;
return
item
.
name
!=
obj
.
name
;
});
});
console
.
log
(
this
.
condition
.
dataCondition
)
}
}
},
},
checkAddress
(
obj
)
{
checkAddress
(
obj
)
{
console
.
log
(
obj
)
console
.
log
(
obj
)
if
(
obj
.
checked
)
{
if
(
obj
.
checked
)
{
this
.
condition
.
address
.
push
(
obj
)
this
.
condition
.
address
.
push
(
obj
)
;
}
}
else
{
else
{
this
.
condition
.
address
=
this
.
condition
.
address
.
filter
(
function
(
item
)
{
this
.
condition
.
address
=
this
.
condition
.
address
.
filter
(
function
(
item
)
{
return
item
.
name
!=
obj
.
name
;
return
item
.
name
!=
obj
.
name
;
});
});
}
}
this
.
selectAddr
();
},
},
checkYear
(
obj
)
{
checkYear
(
obj
)
{
console
.
log
(
obj
)
console
.
log
(
obj
)
if
(
obj
.
checked
)
{
if
(
obj
.
checked
)
{
this
.
condition
.
years
.
push
(
obj
)
this
.
condition
.
years
.
push
(
obj
)
;
}
}
else
{
else
{
this
.
condition
.
years
=
this
.
condition
.
years
.
filter
(
function
(
item
)
{
this
.
condition
.
years
=
this
.
condition
.
years
.
filter
(
function
(
item
)
{
return
item
.
year
!=
obj
.
year
;
return
item
.
year
!=
obj
.
year
;
});
});
}
}
this
.
selectYear
()
},
},
checkIndustry
(
obj
)
{
checkIndustry
(
obj
)
{
console
.
log
(
obj
)
console
.
log
(
obj
)
if
(
obj
.
checked
)
{
if
(
obj
.
checked
)
{
this
.
condition
.
industry
.
push
(
obj
)
this
.
condition
.
industry
.
push
(
obj
)
;
}
}
else
{
else
{
this
.
condition
.
industry
=
this
.
condition
.
industry
.
filter
(
function
(
item
)
{
this
.
condition
.
industry
=
this
.
condition
.
industry
.
filter
(
function
(
item
)
{
return
item
.
name
!=
obj
.
name
;
return
item
.
name
!=
obj
.
name
;
});
});
}
}
this
.
selectIndustry
();
},
},
selectIndustry
()
{
selectIndustry
()
{
...
@@ -328,7 +338,14 @@
...
@@ -328,7 +338,14 @@
address
:
[],
address
:
[],
years
:
[],
years
:
[],
industry
:
[]
industry
:
[]
},
this
.
condition
=
{
dataCondition
:
[],
address
:
[],
years
:
[],
industry
:
[]
}
}
this
.
$refs
.
tree
.
setCheckedKeys
([])
},
},
toShowData
()
{
toShowData
()
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
...
@@ -347,13 +364,29 @@
...
@@ -347,13 +364,29 @@
showDate
()
{
showDate
()
{
this
.
saveFileName
=
''
;
this
.
saveFileName
=
''
;
// this.resultData = false;
// this.resultData = false;
run
(
this
.
params
).
then
(
res
=>
{
let
params
=
{
"dataCondition"
:
this
.
getArrayStrFromObj
(
this
.
params
.
dataCondition
,
'name'
),
"address"
:
this
.
getArrayStrFromObj
(
this
.
params
.
address
,
'id'
),
"years"
:
this
.
getArrayStrFromObj
(
this
.
params
.
years
,
'id'
),
}
// let params = {
// name: 'test'
// }
// getCondition(params).then(res => {
// console.log(res)
// }).catch(err=> {
// console.log(err);
// })
getCondition
(
params
).
then
(
res
=>
{
this
.
resultData
=
true
;
this
.
resultData
=
true
;
console
.
log
(
res
)
console
.
log
(
res
)
this
.
tableHeader
=
res
.
data
.
header
;
this
.
tableHeader
=
res
.
data
.
header
;
this
.
tableData
=
JSON
.
parse
(
res
.
data
.
data
)
this
.
tableData
=
res
.
data
.
data
;
// this.algoRes = JSON.parse(res.data.res)
// this.algoRes = JSON.parse(res.data.res)
this
.
saveFileName
=
res
.
data
.
tempFile
//
this.saveFileName = res.data.tempFile
this
.
saveFlag
=
false
;
this
.
saveFlag
=
false
;
// this.initResultMap()
// this.initResultMap()
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -361,6 +394,16 @@
...
@@ -361,6 +394,16 @@
this
.
resultData
=
true
;
this
.
resultData
=
true
;
})
})
},
},
getArrayStrFromObj
(
selectItem
,
type
){
let
selectValues
=
[]
selectItem
.
forEach
((
item
,
index
)
=>
{
if
(
type
==
'name'
)
selectValues
.
push
(
item
.
name
)
else
selectValues
.
push
(
item
.
id
)
})
return
JSON
.
stringify
(
selectValues
);
},
runDate
()
{
runDate
()
{
},
},
...
@@ -372,7 +415,7 @@
...
@@ -372,7 +415,7 @@
}).
then
(({
value
})
=>
{
}).
then
(({
value
})
=>
{
this
.
saveDate
(
value
)
this
.
saveDate
(
value
)
}).
catch
(()
=>
{
}).
catch
(()
=>
{
});
});
}
}
},
},
...
@@ -386,7 +429,7 @@
...
@@ -386,7 +429,7 @@
this
.
$message
({
this
.
$message
({
type
:
'info'
,
type
:
'info'
,
message
:
'保存成功'
message
:
'保存成功'
});
});
this
.
saveFileName
=
''
;
this
.
saveFileName
=
''
;
this
.
saveFlag
=
true
;
this
.
saveFlag
=
true
;
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
...
@@ -458,7 +501,7 @@
...
@@ -458,7 +501,7 @@
height
:
40px
;
height
:
40px
;
line-height
:
40px
;
line-height
:
40px
;
font-weight
:
600
;
font-weight
:
600
;
background
:
#
00977e
b8
;
background
:
#
358FD4
;
border-radius
:
2px
;
border-radius
:
2px
;
}
}
.right
.btn
:hover
{
.right
.btn
:hover
{
...
@@ -478,4 +521,4 @@
...
@@ -478,4 +521,4 @@
height
:
41px
;
height
:
41px
;
line-height
:
41px
;
line-height
:
41px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment