v3.0.6
11
source/xzs/src/main/resources/application-dev.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
logging:
|
||||
path: ./log/
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: 192.168.0.96
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.0.69:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
11
source/xzs/src/main/resources/application-pre.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
logging:
|
||||
path: /usr/log/xzs/
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: localhost
|
||||
datasource:
|
||||
url: jdbc:mysql://101.132.110.182:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
11
source/xzs/src/main/resources/application-prod.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
logging:
|
||||
path: /usr/log/xzs/
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: localhost
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
11
source/xzs/src/main/resources/application-test.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
logging:
|
||||
path: /usr/log/xzs/
|
||||
|
||||
spring:
|
||||
redis:
|
||||
host: 192.168.0.96
|
||||
datasource:
|
||||
url: jdbc:mysql://192.168.0.69:3306/xzs?useSSL=false&useUnicode=true&serverTimezone=Asia/Shanghai&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true&allowMultiQueries=true
|
||||
username: root
|
||||
password: 123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
80
source/xzs/src/main/resources/application.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
server:
|
||||
port: 8000
|
||||
undertow:
|
||||
io-threads: 16
|
||||
worker-threads: 4000
|
||||
buffer-size: 1024
|
||||
direct-buffers: true
|
||||
compression:
|
||||
enabled: true
|
||||
min-response-size: 1
|
||||
|
||||
#logging logback
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
file: xzs
|
||||
|
||||
#mybatis
|
||||
mybatis:
|
||||
mapper-locations: classpath:/mapper/*.xml
|
||||
configuration:
|
||||
log-prefix: repository.
|
||||
|
||||
|
||||
system:
|
||||
security-ignore-urls:
|
||||
- /api/wx/**
|
||||
- /api/admin/upload/configAndUpload
|
||||
- /api/admin/upload/auth
|
||||
- /api/student/user/register
|
||||
pwdKey:
|
||||
publicKey: MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClwwxhJKwStDnu7c0yCRkwTW2VKuLWwyVtFC6Zx9bYdF1qwqSP26CkDwaF6GHayIvv9b8BHlAaQH4SLIPzir062yzNukqspmthUw4gPJhbx1AQrWRoQJSv3/1Sk+tWyJRHXSiCZJZ3216LDhtx42LQ0HItDP8U9BLtsxA+5LEZzQIDAQAB
|
||||
privateKey: MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAKXDDGEkrBK0Oe7tzTIJGTBNbZUq4tbDJW0ULpnH1th0XWrCpI/boKQPBoXoYdrIi+/1vwEeUBpAfhIsg/OKvTrbLM26Sqyma2FTDiA8mFvHUBCtZGhAlK/f/VKT61bIlEddKIJklnfbXosOG3HjYtDQci0M/xT0Eu2zED7ksRnNAgMBAAECgYEAlCuz5yn2volnt9HNuEo1v92WdN5vAnZSAB0oQsJFpBrwXjw7CXTTNZNQy2YcAot9uzO6Vu+Xvr+jce9ky9BasM7ehz0gnwJWAO79IqUnmu3RRq7HllDwp72qysXIypJZCF4HX5jAzUGlNzlTSUb1H4LtavKc6a//YqPfQ0jTLsECQQDZuGKGAYq6rBCX0+T8qlQpCPc41wsl4Gi9lLD21ks9PMx44JdhsUrqLWItZiGynDzq1LJ3M1hr3gbSsPQcI9HJAkEAwugDFCiRLOqOBRRGlYbzgGdmXbR4SrMNIpcFTFhU+MsEqaMueVPiNtRSIK6W8pS28ZN0aiZDTBAT84fOIENp5QJBAJaVgQ9OYbVa7N8WH3riE/ONz+/wTDWWUNtOzFbtQHzKYGH6dLmM9lOhsBXWXdg7V6bUFdt8F9wDZJS07yHHZIECQG4rHrJiS80Lt8L/NvaGFVVbHO2SePwgQShwHLqOo1kNyFDqv/YsiA1d7h4zEXeEv/PE2WS2xAtWezCIbualtFECQQDPUkYhs3vZoZgsltdeFnv/WoXaXNRIzunMTmksIlh8JP7C1xQHrwdCpUkffgSVphxGJGHkxooMpki7oTC1Mdjx
|
||||
wx:
|
||||
appid: wx143688bee37bad34
|
||||
secret: 320e54e556d5722275b75fc3bba6177b
|
||||
token-to-live: 12h #token 过期时间
|
||||
security-ignore-urls:
|
||||
- /api/wx/student/auth/bind
|
||||
- /api/wx/student/auth/checkBind
|
||||
- /api/wx/student/user/register
|
||||
qn:
|
||||
url: http://image.alvisu.com
|
||||
bucket: alvisu
|
||||
access-key: KabOBTPGVll2sSV8d1OIlW8G4_n_cReE7RSsLafA
|
||||
secret-key: mSltk9_9KtCdFetCmxvvCAgsBg8JZHiXMuQeqSJA
|
||||
|
||||
|
||||
#mybatis page helper
|
||||
pagehelper:
|
||||
autoDialect: true
|
||||
closeConn: true
|
||||
reasonable: true
|
||||
|
||||
|
||||
#mybatis datasource default HikariPool
|
||||
spring:
|
||||
session:
|
||||
store-type: redis
|
||||
datasource:
|
||||
hikari:
|
||||
idle-timeout: 600000 #10 min
|
||||
max-lifetime: 1800000 #30 min
|
||||
redis:
|
||||
timeout: 10000 #超时时间
|
||||
database: 0 #0-15 16个库 默认0
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: 8 #最大连接数
|
||||
max-wait: -1 #默认-1 最大连接阻塞等待时间
|
||||
max-idle: 8 #最大空闲连接 默认8
|
||||
min-idle: 0 #最小空闲连接
|
||||
cache:
|
||||
type: redis
|
||||
redis:
|
||||
time-to-live: 12h #12 hour
|
||||
|
||||
|
||||
#runningtime environment
|
||||
profiles:
|
||||
active: dev
|
||||
67
source/xzs/src/main/resources/logback-spring.xml
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
|
||||
<conversionRule conversionWord="wex"
|
||||
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
|
||||
<conversionRule conversionWord="wEx"
|
||||
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
|
||||
<property name="CONSOLE_LOG_PATTERN"
|
||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<property name="FILE_LOG_PATTERN"
|
||||
value="${FILE_LOG_PATTERN:-%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
||||
<charset>utf8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
<appender name="FILE"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder>
|
||||
<pattern>${FILE_LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>${LOG_PATH}/${LOG_FILE}.%d{yyyyMMdd}.log</fileNamePattern>
|
||||
<maxHistory>30</maxHistory>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
|
||||
<springProfile name="dev">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
<logger name="repository" level="DEBUG" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="FILE"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
|
||||
<springProfile name="test">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
<logger name="repository" level="DEBUG" additivity="false">
|
||||
<appender-ref ref="FILE"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="pre">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
<logger name="repository" level="DEBUG" additivity="false">
|
||||
<appender-ref ref="FILE"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
|
||||
<springProfile name="prod">
|
||||
<root level="INFO">
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
</springProfile>
|
||||
|
||||
</configuration>
|
||||
254
source/xzs/src/main/resources/mapper/ExamPaperAnswerMapper.xml
Normal file
@@ -0,0 +1,254 @@
|
||||
<?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="com.mindskip.xzs.repository.ExamPaperAnswerMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaperAnswer">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId" />
|
||||
<result column="paper_name" jdbcType="VARCHAR" property="paperName" />
|
||||
<result column="paper_type" jdbcType="INTEGER" property="paperType" />
|
||||
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
|
||||
<result column="system_score" jdbcType="INTEGER" property="systemScore" />
|
||||
<result column="user_score" jdbcType="INTEGER" property="userScore" />
|
||||
<result column="paper_score" jdbcType="INTEGER" property="paperScore" />
|
||||
<result column="question_correct" jdbcType="INTEGER" property="questionCorrect" />
|
||||
<result column="question_count" jdbcType="INTEGER" property="questionCount" />
|
||||
<result column="do_time" jdbcType="INTEGER" property="doTime" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, exam_paper_id, paper_name, paper_type, subject_id, system_score, user_score,
|
||||
paper_score, question_correct, question_count, do_time, status, create_user, create_time,
|
||||
task_exam_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_exam_paper_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_exam_paper_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper_answer (id, exam_paper_id, paper_name,
|
||||
paper_type, subject_id, system_score,
|
||||
user_score, paper_score, question_correct,
|
||||
question_count, do_time, status,
|
||||
create_user, create_time, task_exam_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER}, #{paperName,jdbcType=VARCHAR},
|
||||
#{paperType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER}, #{systemScore,jdbcType=INTEGER},
|
||||
#{userScore,jdbcType=INTEGER}, #{paperScore,jdbcType=INTEGER}, #{questionCorrect,jdbcType=INTEGER},
|
||||
#{questionCount,jdbcType=INTEGER}, #{doTime,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
|
||||
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{taskExamId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper_answer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="examPaperId != null">
|
||||
exam_paper_id,
|
||||
</if>
|
||||
<if test="paperName != null">
|
||||
paper_name,
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
paper_type,
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id,
|
||||
</if>
|
||||
<if test="systemScore != null">
|
||||
system_score,
|
||||
</if>
|
||||
<if test="userScore != null">
|
||||
user_score,
|
||||
</if>
|
||||
<if test="paperScore != null">
|
||||
paper_score,
|
||||
</if>
|
||||
<if test="questionCorrect != null">
|
||||
question_correct,
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
question_count,
|
||||
</if>
|
||||
<if test="doTime != null">
|
||||
do_time,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="examPaperId != null">
|
||||
#{examPaperId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperName != null">
|
||||
#{paperName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
#{paperType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
#{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="systemScore != null">
|
||||
#{systemScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userScore != null">
|
||||
#{userScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperScore != null">
|
||||
#{paperScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCorrect != null">
|
||||
#{questionCorrect,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
#{questionCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doTime != null">
|
||||
#{doTime,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
#{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer">
|
||||
update t_exam_paper_answer
|
||||
<set>
|
||||
<if test="examPaperId != null">
|
||||
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperName != null">
|
||||
paper_name = #{paperName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
paper_type = #{paperType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="systemScore != null">
|
||||
system_score = #{systemScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userScore != null">
|
||||
user_score = #{userScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperScore != null">
|
||||
paper_score = #{paperScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCorrect != null">
|
||||
question_correct = #{questionCorrect,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
question_count = #{questionCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doTime != null">
|
||||
do_time = #{doTime,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id = #{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaperAnswer">
|
||||
update t_exam_paper_answer
|
||||
set exam_paper_id = #{examPaperId,jdbcType=INTEGER},
|
||||
paper_name = #{paperName,jdbcType=VARCHAR},
|
||||
paper_type = #{paperType,jdbcType=INTEGER},
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
system_score = #{systemScore,jdbcType=INTEGER},
|
||||
user_score = #{userScore,jdbcType=INTEGER},
|
||||
paper_score = #{paperScore,jdbcType=INTEGER},
|
||||
question_correct = #{questionCorrect,jdbcType=INTEGER},
|
||||
question_count = #{questionCount,jdbcType=INTEGER},
|
||||
do_time = #{doTime,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
task_exam_id = #{taskExamId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.exampaper.ExamPaperAnswerPageVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_exam_paper_answer
|
||||
<where>
|
||||
and create_user = #{createUser}
|
||||
<if test="subjectId != null">
|
||||
and subject_id = #{subjectId}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Integer">
|
||||
SELECT count(*) from t_exam_paper_answer
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT create_time as name,COUNT(create_time) as value from
|
||||
(
|
||||
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_answer
|
||||
WHERE create_time between #{startTime} and #{endTime}
|
||||
) a
|
||||
GROUP BY create_time
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByPidUid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_exam_paper_answer
|
||||
where exam_paper_id = #{pid} and create_user=#{uid}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
331
source/xzs/src/main/resources/mapper/ExamPaperMapper.xml
Normal file
@@ -0,0 +1,331 @@
|
||||
<?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="com.mindskip.xzs.repository.ExamPaperMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaper">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
|
||||
<result column="paper_type" jdbcType="INTEGER" property="paperType" />
|
||||
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
|
||||
<result column="score" jdbcType="INTEGER" property="score" />
|
||||
<result column="question_count" jdbcType="INTEGER" property="questionCount" />
|
||||
<result column="suggest_time" jdbcType="INTEGER" property="suggestTime" />
|
||||
<result column="limit_start_time" jdbcType="TIMESTAMP" property="limitStartTime" />
|
||||
<result column="limit_end_time" jdbcType="TIMESTAMP" property="limitEndTime" />
|
||||
<result column="frame_text_content_id" jdbcType="INTEGER" property="frameTextContentId" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, subject_id, paper_type, grade_level, score, question_count, suggest_time,
|
||||
limit_start_time, limit_end_time, frame_text_content_id, create_user, create_time,
|
||||
deleted, task_exam_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_exam_paper
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_exam_paper
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaper" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper (id, name, subject_id,
|
||||
paper_type, grade_level, score,
|
||||
question_count, suggest_time, limit_start_time,
|
||||
limit_end_time, frame_text_content_id, create_user,
|
||||
create_time, deleted, task_exam_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{subjectId,jdbcType=INTEGER},
|
||||
#{paperType,jdbcType=INTEGER}, #{gradeLevel,jdbcType=INTEGER}, #{score,jdbcType=INTEGER},
|
||||
#{questionCount,jdbcType=INTEGER}, #{suggestTime,jdbcType=INTEGER}, #{limitStartTime,jdbcType=TIMESTAMP},
|
||||
#{limitEndTime,jdbcType=TIMESTAMP}, #{frameTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{taskExamId,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaper" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id,
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
paper_type,
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level,
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score,
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
question_count,
|
||||
</if>
|
||||
<if test="suggestTime != null">
|
||||
suggest_time,
|
||||
</if>
|
||||
<if test="limitStartTime != null">
|
||||
limit_start_time,
|
||||
</if>
|
||||
<if test="limitEndTime != null">
|
||||
limit_end_time,
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
frame_text_content_id,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
#{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
#{paperType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
#{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
#{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
#{questionCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="suggestTime != null">
|
||||
#{suggestTime,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="limitStartTime != null">
|
||||
#{limitStartTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="limitEndTime != null">
|
||||
#{limitEndTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
#{frameTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
#{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaper">
|
||||
update t_exam_paper
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="paperType != null">
|
||||
paper_type = #{paperType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionCount != null">
|
||||
question_count = #{questionCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="suggestTime != null">
|
||||
suggest_time = #{suggestTime,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="limitStartTime != null">
|
||||
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="limitEndTime != null">
|
||||
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id = #{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaper">
|
||||
update t_exam_paper
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
paper_type = #{paperType,jdbcType=INTEGER},
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
score = #{score,jdbcType=INTEGER},
|
||||
question_count = #{questionCount,jdbcType=INTEGER},
|
||||
suggest_time = #{suggestTime,jdbcType=INTEGER},
|
||||
limit_start_time = #{limitStartTime,jdbcType=TIMESTAMP},
|
||||
limit_end_time = #{limitEndTime,jdbcType=TIMESTAMP},
|
||||
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
task_exam_id = #{taskExamId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<resultMap id="PaperInfoResultMap" type="com.mindskip.xzs.viewmodel.student.dashboard.PaperInfo">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="limit_start_time" jdbcType="TIMESTAMP" property="limitStartTime" />
|
||||
<result column="limit_end_time" jdbcType="TIMESTAMP" property="limitEndTime" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_exam_paper
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="id != null ">
|
||||
and id= #{id}
|
||||
</if>
|
||||
<if test="level != null ">
|
||||
and grade_level= #{level}
|
||||
</if>
|
||||
<if test="subjectId != null ">
|
||||
and subject_id= #{subjectId}
|
||||
</if>
|
||||
<if test="paperType != null ">
|
||||
and paper_type= #{paperType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="taskExamPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.exam.ExamPaperPageRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_exam_paper
|
||||
<where>
|
||||
and deleted=0
|
||||
and task_exam_id is null
|
||||
and grade_level= #{level}
|
||||
and paper_type=#{paperType}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.exam.ExamPaperPageVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_exam_paper
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="subjectId != null ">
|
||||
and subject_id=#{subjectId}
|
||||
</if>
|
||||
<if test="levelId != null ">
|
||||
and grade_level=#{levelId}
|
||||
</if>
|
||||
and paper_type=#{paperType}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="indexPaper" resultMap="PaperInfoResultMap" parameterType="com.mindskip.xzs.viewmodel.student.dashboard.PaperFilter">
|
||||
SELECT id,name,limit_start_time,limit_end_time
|
||||
FROM t_exam_paper
|
||||
<where>
|
||||
and deleted=0
|
||||
and paper_type= #{examPaperType}
|
||||
and grade_level=#{gradeLevel}
|
||||
<if test="examPaperType == 3 ">
|
||||
</if>
|
||||
<if test="examPaperType == 4 ">
|
||||
and #{dateTime} between limit_start_time and limit_end_time
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id desc limit 5
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Integer">
|
||||
SELECT count(*) from t_exam_paper where deleted=0
|
||||
</select>
|
||||
|
||||
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT create_time as name,COUNT(create_time) as value from
|
||||
(
|
||||
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper
|
||||
WHERE deleted=0 and create_time between #{startTime} and #{endTime}
|
||||
) a
|
||||
GROUP BY create_time
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateTaskPaper">
|
||||
update t_exam_paper set task_exam_id = #{taskId} where id in
|
||||
<foreach item="id" collection="paperIds" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<update id="clearTaskPaper" parameterType="java.util.List">
|
||||
update t_exam_paper set task_exam_id = null where id in
|
||||
<foreach item="id" collection="paperIds" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,282 @@
|
||||
<?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="com.mindskip.xzs.repository.ExamPaperQuestionCustomerAnswerMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="question_id" jdbcType="INTEGER" property="questionId" />
|
||||
<result column="exam_paper_id" jdbcType="INTEGER" property="examPaperId" />
|
||||
<result column="exam_paper_answer_id" jdbcType="INTEGER" property="examPaperAnswerId" />
|
||||
<result column="question_type" jdbcType="INTEGER" property="questionType" />
|
||||
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
|
||||
<result column="customer_score" jdbcType="INTEGER" property="customerScore" />
|
||||
<result column="question_score" jdbcType="INTEGER" property="questionScore" />
|
||||
<result column="question_text_content_id" jdbcType="INTEGER" property="questionTextContentId" />
|
||||
<result column="answer" jdbcType="VARCHAR" property="answer" />
|
||||
<result column="text_content_id" jdbcType="INTEGER" property="textContentId" />
|
||||
<result column="do_right" jdbcType="BIT" property="doRight" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="item_order" jdbcType="INTEGER" property="itemOrder" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, question_id, exam_paper_id, exam_paper_answer_id, question_type, subject_id,
|
||||
customer_score, question_score, question_text_content_id, answer, text_content_id,
|
||||
do_right, create_user, create_time, item_order
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_exam_paper_question_customer_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_exam_paper_question_customer_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper_question_customer_answer (id, question_id, exam_paper_id,
|
||||
exam_paper_answer_id, question_type, subject_id,
|
||||
customer_score, question_score, question_text_content_id,
|
||||
answer, text_content_id, do_right,
|
||||
create_user, create_time, item_order
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{questionId,jdbcType=INTEGER}, #{examPaperId,jdbcType=INTEGER},
|
||||
#{examPaperAnswerId,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
|
||||
#{customerScore,jdbcType=INTEGER}, #{questionScore,jdbcType=INTEGER}, #{questionTextContentId,jdbcType=INTEGER},
|
||||
#{answer,jdbcType=VARCHAR}, #{textContentId,jdbcType=INTEGER}, #{doRight,jdbcType=BIT},
|
||||
#{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{itemOrder,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_exam_paper_question_customer_answer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="questionId != null">
|
||||
question_id,
|
||||
</if>
|
||||
<if test="examPaperId != null">
|
||||
exam_paper_id,
|
||||
</if>
|
||||
<if test="examPaperAnswerId != null">
|
||||
exam_paper_answer_id,
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
question_type,
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id,
|
||||
</if>
|
||||
<if test="customerScore != null">
|
||||
customer_score,
|
||||
</if>
|
||||
<if test="questionScore != null">
|
||||
question_score,
|
||||
</if>
|
||||
<if test="questionTextContentId != null">
|
||||
question_text_content_id,
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer,
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
text_content_id,
|
||||
</if>
|
||||
<if test="doRight != null">
|
||||
do_right,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
item_order,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionId != null">
|
||||
#{questionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="examPaperId != null">
|
||||
#{examPaperId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="examPaperAnswerId != null">
|
||||
#{examPaperAnswerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
#{questionType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
#{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="customerScore != null">
|
||||
#{customerScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionScore != null">
|
||||
#{questionScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionTextContentId != null">
|
||||
#{questionTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
#{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
#{textContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doRight != null">
|
||||
#{doRight,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
#{itemOrder,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
|
||||
update t_exam_paper_question_customer_answer
|
||||
<set>
|
||||
<if test="questionId != null">
|
||||
question_id = #{questionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="examPaperId != null">
|
||||
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="examPaperAnswerId != null">
|
||||
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
question_type = #{questionType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="customerScore != null">
|
||||
customer_score = #{customerScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionScore != null">
|
||||
question_score = #{questionScore,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionTextContentId != null">
|
||||
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
text_content_id = #{textContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="doRight != null">
|
||||
do_right = #{doRight,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
item_order = #{itemOrder,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.ExamPaperQuestionCustomerAnswer">
|
||||
update t_exam_paper_question_customer_answer
|
||||
set question_id = #{questionId,jdbcType=INTEGER},
|
||||
exam_paper_id = #{examPaperId,jdbcType=INTEGER},
|
||||
exam_paper_answer_id = #{examPaperAnswerId,jdbcType=INTEGER},
|
||||
question_type = #{questionType,jdbcType=INTEGER},
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
customer_score = #{customerScore,jdbcType=INTEGER},
|
||||
question_score = #{questionScore,jdbcType=INTEGER},
|
||||
question_text_content_id = #{questionTextContentId,jdbcType=INTEGER},
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
text_content_id = #{textContentId,jdbcType=INTEGER},
|
||||
do_right = #{doRight,jdbcType=BIT},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
item_order = #{itemOrder,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectListByPaperAnswerId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_exam_paper_question_customer_answer
|
||||
where exam_paper_answer_id = #{id,jdbcType=INTEGER}
|
||||
order by item_order
|
||||
</select>
|
||||
|
||||
|
||||
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.question.answer.QuestionPageStudentRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_exam_paper_question_customer_answer
|
||||
<where>
|
||||
and do_right=FALSE
|
||||
and create_user=#{createUser}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertList" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into t_exam_paper_question_customer_answer ( question_id, question_score,
|
||||
subject_id, create_time, create_user,
|
||||
text_content_id, exam_paper_id, question_type,
|
||||
answer, customer_score, exam_paper_answer_id ,
|
||||
do_right,question_text_content_id,item_order)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index"
|
||||
separator=",">
|
||||
( #{item.questionId,jdbcType=INTEGER}, #{item.questionScore,jdbcType=INTEGER},
|
||||
#{item.subjectId,jdbcType=INTEGER}, #{item.createTime,jdbcType=TIMESTAMP}, #{item.createUser,jdbcType=INTEGER},
|
||||
#{item.textContentId,jdbcType=INTEGER}, #{item.examPaperId,jdbcType=INTEGER}, #{item.questionType,jdbcType=INTEGER},
|
||||
#{item.answer,jdbcType=VARCHAR}, #{item.customerScore,jdbcType=INTEGER}, #{item.examPaperAnswerId,jdbcType=INTEGER},
|
||||
#{item.doRight,jdbcType=BIT},#{item.questionTextContentId,jdbcType=INTEGER},#{item.itemOrder,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Integer">
|
||||
SELECT count(*) from t_exam_paper_question_customer_answer
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT create_time as name,COUNT(create_time) as value from
|
||||
(
|
||||
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_exam_paper_question_customer_answer
|
||||
WHERE create_time between #{startTime} and #{endTime}
|
||||
) a
|
||||
GROUP BY create_time
|
||||
</select>
|
||||
|
||||
<update id="updateScore" parameterType="java.util.List">
|
||||
<foreach collection="list" item="item" >
|
||||
update t_exam_paper_question_customer_answer
|
||||
set customer_score=#{item.customerScore} , do_right=#{item.doRight}
|
||||
where id=#{item.id} ;
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
172
source/xzs/src/main/resources/mapper/MessageMapper.xml
Normal file
@@ -0,0 +1,172 @@
|
||||
<?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="com.mindskip.xzs.repository.MessageMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Message">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="send_user_id" jdbcType="INTEGER" property="sendUserId" />
|
||||
<result column="send_user_name" jdbcType="VARCHAR" property="sendUserName" />
|
||||
<result column="send_real_name" jdbcType="VARCHAR" property="sendRealName" />
|
||||
<result column="receive_user_count" jdbcType="INTEGER" property="receiveUserCount" />
|
||||
<result column="read_count" jdbcType="INTEGER" property="readCount" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, title, content, create_time, send_user_id, send_user_name, send_real_name, receive_user_count,
|
||||
read_count
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_message
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.Message" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_message (id, title, content,
|
||||
create_time, send_user_id, send_user_name,
|
||||
send_real_name, receive_user_count, read_count
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{sendUserId,jdbcType=INTEGER}, #{sendUserName,jdbcType=VARCHAR},
|
||||
#{sendRealName,jdbcType=VARCHAR}, #{receiveUserCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Message" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_message
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="title != null">
|
||||
title,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="sendUserId != null">
|
||||
send_user_id,
|
||||
</if>
|
||||
<if test="sendUserName != null">
|
||||
send_user_name,
|
||||
</if>
|
||||
<if test="sendRealName != null">
|
||||
send_real_name,
|
||||
</if>
|
||||
<if test="receiveUserCount != null">
|
||||
receive_user_count,
|
||||
</if>
|
||||
<if test="readCount != null">
|
||||
read_count,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="title != null">
|
||||
#{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="sendUserId != null">
|
||||
#{sendUserId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sendUserName != null">
|
||||
#{sendUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sendRealName != null">
|
||||
#{sendRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="receiveUserCount != null">
|
||||
#{receiveUserCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="readCount != null">
|
||||
#{readCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Message">
|
||||
update t_message
|
||||
<set>
|
||||
<if test="title != null">
|
||||
title = #{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="sendUserId != null">
|
||||
send_user_id = #{sendUserId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sendUserName != null">
|
||||
send_user_name = #{sendUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="sendRealName != null">
|
||||
send_real_name = #{sendRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="receiveUserCount != null">
|
||||
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="readCount != null">
|
||||
read_count = #{readCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Message">
|
||||
update t_message
|
||||
set title = #{title,jdbcType=VARCHAR},
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
send_user_id = #{sendUserId,jdbcType=INTEGER},
|
||||
send_user_name = #{sendUserName,jdbcType=VARCHAR},
|
||||
send_real_name = #{sendRealName,jdbcType=VARCHAR},
|
||||
receive_user_count = #{receiveUserCount,jdbcType=INTEGER},
|
||||
read_count = #{readCount,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.message.MessagePageRequestVM">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message
|
||||
<where>
|
||||
<if test="sendUserName != null">
|
||||
and send_user_name like concat('%',#{sendUserName},'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message
|
||||
where id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<update id="readAdd" parameterType="java.lang.Integer">
|
||||
UPDATE t_message SET read_count = read_count + 1
|
||||
WHERE id= #{id} and read_count = (SELECT m.read_count from ( SELECT read_count FROM t_message WHERE id = #{id} ) m)
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
174
source/xzs/src/main/resources/mapper/MessageUserMapper.xml
Normal file
@@ -0,0 +1,174 @@
|
||||
<?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="com.mindskip.xzs.repository.MessageUserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.MessageUser">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="message_id" jdbcType="INTEGER" property="messageId" />
|
||||
<result column="receive_user_id" jdbcType="INTEGER" property="receiveUserId" />
|
||||
<result column="receive_user_name" jdbcType="VARCHAR" property="receiveUserName" />
|
||||
<result column="receive_real_name" jdbcType="VARCHAR" property="receiveRealName" />
|
||||
<result column="readed" jdbcType="BIT" property="readed" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="read_time" jdbcType="TIMESTAMP" property="readTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, message_id, receive_user_id, receive_user_name, receive_real_name, readed, create_time,
|
||||
read_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_message_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.MessageUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_message_user (id, message_id, receive_user_id,
|
||||
receive_user_name, receive_real_name, readed,
|
||||
create_time, read_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{messageId,jdbcType=INTEGER}, #{receiveUserId,jdbcType=INTEGER},
|
||||
#{receiveUserName,jdbcType=VARCHAR}, #{receiveRealName,jdbcType=VARCHAR}, #{readed,jdbcType=BIT},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{readTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.MessageUser" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_message_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="messageId != null">
|
||||
message_id,
|
||||
</if>
|
||||
<if test="receiveUserId != null">
|
||||
receive_user_id,
|
||||
</if>
|
||||
<if test="receiveUserName != null">
|
||||
receive_user_name,
|
||||
</if>
|
||||
<if test="receiveRealName != null">
|
||||
receive_real_name,
|
||||
</if>
|
||||
<if test="readed != null">
|
||||
readed,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="readTime != null">
|
||||
read_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="messageId != null">
|
||||
#{messageId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="receiveUserId != null">
|
||||
#{receiveUserId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="receiveUserName != null">
|
||||
#{receiveUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="receiveRealName != null">
|
||||
#{receiveRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="readed != null">
|
||||
#{readed,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="readTime != null">
|
||||
#{readTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.MessageUser" >
|
||||
update t_message_user
|
||||
<set>
|
||||
<if test="messageId != null">
|
||||
message_id = #{messageId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="receiveUserId != null">
|
||||
receive_user_id = #{receiveUserId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="receiveUserName != null">
|
||||
receive_user_name = #{receiveUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="receiveRealName != null">
|
||||
receive_real_name = #{receiveRealName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="readed != null">
|
||||
readed = #{readed,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="readTime != null">
|
||||
read_time = #{readTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.MessageUser">
|
||||
update t_message_user
|
||||
set message_id = #{messageId,jdbcType=INTEGER},
|
||||
receive_user_id = #{receiveUserId,jdbcType=INTEGER},
|
||||
receive_user_name = #{receiveUserName,jdbcType=VARCHAR},
|
||||
receive_real_name = #{receiveRealName,jdbcType=VARCHAR},
|
||||
readed = #{readed,jdbcType=BIT},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
read_time = #{readTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectByMessageIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message_user
|
||||
where message_id in
|
||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="inserts" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_message_user (message_id, receive_user_id,
|
||||
receive_user_name, receive_real_name, readed,
|
||||
create_time)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index"
|
||||
separator=",">
|
||||
(#{item.messageId,jdbcType=INTEGER}, #{item.receiveUserId,jdbcType=INTEGER},
|
||||
#{item.receiveUserName,jdbcType=VARCHAR}, #{item.receiveRealName,jdbcType=VARCHAR}, #{item.readed,jdbcType=BIT},
|
||||
#{item.createTime,jdbcType=TIMESTAMP})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="studentPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.student.user.MessageRequestVM">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_message_user
|
||||
where receive_user_id = #{receiveUserId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="unReadCount" resultType="java.lang.Integer" parameterType="java.lang.Integer">
|
||||
select count(*)
|
||||
from t_message_user
|
||||
where readed='f' and receive_user_id = #{userId}
|
||||
</select>
|
||||
</mapper>
|
||||
228
source/xzs/src/main/resources/mapper/QuestionMapper.xml
Normal file
@@ -0,0 +1,228 @@
|
||||
<?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="com.mindskip.xzs.repository.QuestionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Question">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="question_type" jdbcType="INTEGER" property="questionType" />
|
||||
<result column="subject_id" jdbcType="INTEGER" property="subjectId" />
|
||||
<result column="score" jdbcType="INTEGER" property="score" />
|
||||
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
|
||||
<result column="difficult" jdbcType="INTEGER" property="difficult" />
|
||||
<result column="correct" jdbcType="VARCHAR" property="correct" />
|
||||
<result column="info_text_content_id" jdbcType="INTEGER" property="infoTextContentId" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, question_type, subject_id, score, grade_level, difficult, correct, info_text_content_id,
|
||||
create_user, status, create_time, deleted
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_question
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_question
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.Question" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_question (id, question_type, subject_id,
|
||||
score, grade_level, difficult,
|
||||
correct, info_text_content_id, create_user,
|
||||
status, create_time, deleted
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{questionType,jdbcType=INTEGER}, #{subjectId,jdbcType=INTEGER},
|
||||
#{score,jdbcType=INTEGER}, #{gradeLevel,jdbcType=INTEGER}, #{difficult,jdbcType=INTEGER},
|
||||
#{correct,jdbcType=VARCHAR}, #{infoTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
|
||||
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Question" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
question_type,
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id,
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score,
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level,
|
||||
</if>
|
||||
<if test="difficult != null">
|
||||
difficult,
|
||||
</if>
|
||||
<if test="correct != null">
|
||||
correct,
|
||||
</if>
|
||||
<if test="infoTextContentId != null">
|
||||
info_text_content_id,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="questionType != null">
|
||||
#{questionType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
#{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
#{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
#{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="difficult != null">
|
||||
#{difficult,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="correct != null">
|
||||
#{correct,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="infoTextContentId != null">
|
||||
#{infoTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Question">
|
||||
update t_question
|
||||
<set>
|
||||
<if test="questionType != null">
|
||||
question_type = #{questionType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="subjectId != null">
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="difficult != null">
|
||||
difficult = #{difficult,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="correct != null">
|
||||
correct = #{correct,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="infoTextContentId != null">
|
||||
info_text_content_id = #{infoTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Question">
|
||||
update t_question
|
||||
set question_type = #{questionType,jdbcType=INTEGER},
|
||||
subject_id = #{subjectId,jdbcType=INTEGER},
|
||||
score = #{score,jdbcType=INTEGER},
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
difficult = #{difficult,jdbcType=INTEGER},
|
||||
correct = #{correct,jdbcType=VARCHAR},
|
||||
info_text_content_id = #{infoTextContentId,jdbcType=INTEGER},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
deleted = #{deleted,jdbcType=BIT}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.question.QuestionPageRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_question
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="id != null ">
|
||||
and id= #{id}
|
||||
</if>
|
||||
<if test="level != null ">
|
||||
and grade_level= #{level}
|
||||
</if>
|
||||
<if test="subjectId != null ">
|
||||
and subject_id= #{subjectId}
|
||||
</if>
|
||||
<if test="questionType != null ">
|
||||
and question_type= #{questionType}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap" >
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_question where id in
|
||||
<foreach item="id" collection="ids" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Integer">
|
||||
SELECT count(*) from t_question where deleted=0
|
||||
</select>
|
||||
|
||||
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT create_time as name,COUNT(create_time) as value from
|
||||
(
|
||||
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_question
|
||||
WHERE deleted=0 and create_time between #{startTime} and #{endTime}
|
||||
) a
|
||||
GROUP BY create_time
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
137
source/xzs/src/main/resources/mapper/SubjectMapper.xml
Normal file
@@ -0,0 +1,137 @@
|
||||
<?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="com.mindskip.xzs.repository.SubjectMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.Subject">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="level" jdbcType="INTEGER" property="level" />
|
||||
<result column="level_name" jdbcType="VARCHAR" property="levelName" />
|
||||
<result column="item_order" jdbcType="INTEGER" property="itemOrder" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, level, level_name, item_order, deleted
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_subject
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_subject
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_subject (id, name, level,
|
||||
level_name, item_order, deleted
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER},
|
||||
#{levelName,jdbcType=VARCHAR}, #{itemOrder,jdbcType=INTEGER}, #{deleted,jdbcType=BIT}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.Subject" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_subject
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="level != null">
|
||||
level,
|
||||
</if>
|
||||
<if test="levelName != null">
|
||||
level_name,
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
item_order,
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
#{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="levelName != null">
|
||||
#{levelName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
#{itemOrder,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.Subject">
|
||||
update t_subject
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="level != null">
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="levelName != null">
|
||||
level_name = #{levelName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="itemOrder != null">
|
||||
item_order = #{itemOrder,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.Subject">
|
||||
update t_subject
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
level = #{level,jdbcType=INTEGER},
|
||||
level_name = #{levelName,jdbcType=VARCHAR},
|
||||
item_order = #{itemOrder,jdbcType=INTEGER},
|
||||
deleted = #{deleted,jdbcType=BIT}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
<select id="getSubjectByLevel" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_subject where level= #{level}
|
||||
order by item_order
|
||||
</select>
|
||||
|
||||
|
||||
<select id="allSubject" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_subject
|
||||
</select>
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.education.SubjectPageRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_subject
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="id != null ">
|
||||
and id= #{id}
|
||||
</if>
|
||||
<if test="level != null ">
|
||||
and level= #{level}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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="com.mindskip.xzs.repository.TaskExamCustomerAnswerMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="task_exam_id" jdbcType="INTEGER" property="taskExamId" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="text_content_id" jdbcType="INTEGER" property="textContentId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, task_exam_id, create_user, create_time, text_content_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam_customer_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_task_exam_customer_answer
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_task_exam_customer_answer (id, task_exam_id, create_user,
|
||||
create_time, text_content_id)
|
||||
values (#{id,jdbcType=INTEGER}, #{taskExamId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{textContentId,jdbcType=INTEGER})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_task_exam_customer_answer
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
text_content_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="taskExamId != null">
|
||||
#{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
#{textContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
|
||||
update t_task_exam_customer_answer
|
||||
<set>
|
||||
<if test="taskExamId != null">
|
||||
task_exam_id = #{taskExamId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="textContentId != null">
|
||||
text_content_id = #{textContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TaskExamCustomerAnswer">
|
||||
update t_task_exam_customer_answer
|
||||
set task_exam_id = #{taskExamId,jdbcType=INTEGER},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
text_content_id = #{textContentId,jdbcType=INTEGER}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="getByTUid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam_customer_answer
|
||||
where task_exam_id = #{tid} and create_user=#{uid}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByTUid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam_customer_answer
|
||||
where create_user=#{uid} and
|
||||
task_exam_id in
|
||||
<foreach collection="taskIds" open="(" close=")" separator="," item="id">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
158
source/xzs/src/main/resources/mapper/TaskExamMapper.xml
Normal file
@@ -0,0 +1,158 @@
|
||||
<?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="com.mindskip.xzs.repository.TaskExamMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TaskExam">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="title" jdbcType="VARCHAR" property="title" />
|
||||
<result column="grade_level" jdbcType="INTEGER" property="gradeLevel" />
|
||||
<result column="frame_text_content_id" jdbcType="INTEGER" property="frameTextContentId" />
|
||||
<result column="create_user" jdbcType="INTEGER" property="createUser" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="create_user_name" jdbcType="VARCHAR" property="createUserName" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, title, grade_level, frame_text_content_id, create_user, create_time, deleted,
|
||||
create_user_name
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_task_exam
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.TaskExam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_task_exam (id, title, grade_level,
|
||||
frame_text_content_id, create_user, create_time,
|
||||
deleted, create_user_name)
|
||||
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{gradeLevel,jdbcType=INTEGER},
|
||||
#{frameTextContentId,jdbcType=INTEGER}, #{createUser,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{deleted,jdbcType=BIT}, #{createUserName,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TaskExam" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_task_exam
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="title != null">
|
||||
title,
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level,
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
frame_text_content_id,
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="createUserName != null">
|
||||
create_user_name,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="title != null">
|
||||
#{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
#{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
#{frameTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
#{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createUserName != null">
|
||||
#{createUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TaskExam">
|
||||
update t_task_exam
|
||||
<set>
|
||||
<if test="title != null">
|
||||
title = #{title,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="gradeLevel != null">
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="frameTextContentId != null">
|
||||
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createUser != null">
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="createUserName != null">
|
||||
create_user_name = #{createUserName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TaskExam">
|
||||
update t_task_exam
|
||||
set title = #{title,jdbcType=VARCHAR},
|
||||
grade_level = #{gradeLevel,jdbcType=INTEGER},
|
||||
frame_text_content_id = #{frameTextContentId,jdbcType=INTEGER},
|
||||
create_user = #{createUser,jdbcType=INTEGER},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
create_user_name = #{createUserName,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.task.TaskPageRequestVM">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="gradeLevel != null">
|
||||
and grade_level = #{gradeLevel}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByGradeLevel" resultMap="BaseResultMap" parameterType="java.lang.Integer">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_task_exam
|
||||
where deleted=0
|
||||
and grade_level = #{gradeLevel,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
71
source/xzs/src/main/resources/mapper/TextContentMapper.xml
Normal file
@@ -0,0 +1,71 @@
|
||||
<?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="com.mindskip.xzs.repository.TextContentMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.TextContent">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, content, create_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_text_content
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_text_content
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.TextContent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_text_content (id, content, create_time
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.TextContent" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_text_content
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.TextContent">
|
||||
update t_text_content
|
||||
<set>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.TextContent">
|
||||
update t_text_content
|
||||
set content = #{content,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
</mapper>
|
||||
146
source/xzs/src/main/resources/mapper/UserEventLogMapper.xml
Normal file
@@ -0,0 +1,146 @@
|
||||
<?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="com.mindskip.xzs.repository.UserEventLogMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.UserEventLog">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="real_name" jdbcType="VARCHAR" property="realName" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, user_name, real_name, content, create_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user_event_log
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_user_event_log
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.UserEventLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user_event_log (id, user_id, user_name,
|
||||
real_name, content, create_time
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR},
|
||||
#{realName,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.UserEventLog" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user_event_log
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
#{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.UserEventLog">
|
||||
update t_user_event_log
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.UserEventLog">
|
||||
update t_user_event_log
|
||||
set user_id = #{userId,jdbcType=INTEGER},
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="getUserEventLogByUserId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user_event_log
|
||||
where user_id=#{value}
|
||||
order by id desc
|
||||
limit 10
|
||||
</select>
|
||||
|
||||
<select id="page" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.user.UserEventPageRequestVM">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user_event_log
|
||||
<where>
|
||||
<if test="userId != null">
|
||||
and user_id= #{userId}
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
and user_name= #{userName}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByDate" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT create_time as name,COUNT(create_time) as value from
|
||||
(
|
||||
SELECT DATE_FORMAT(create_time,'%Y-%m-%d') as create_time from t_user_event_log
|
||||
WHERE create_time between #{startTime} and #{endTime}
|
||||
) a
|
||||
GROUP BY create_time
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
414
source/xzs/src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,414 @@
|
||||
<?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="com.mindskip.xzs.repository.UserMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.User">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_uuid" jdbcType="VARCHAR" property="userUuid" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
<result column="password" jdbcType="VARCHAR" property="password" />
|
||||
<result column="real_name" jdbcType="VARCHAR" property="realName" />
|
||||
<result column="age" jdbcType="INTEGER" property="age" />
|
||||
<result column="sex" jdbcType="INTEGER" property="sex" />
|
||||
<result column="birth_day" jdbcType="TIMESTAMP" property="birthDay" />
|
||||
<result column="user_level" jdbcType="INTEGER" property="userLevel" />
|
||||
<result column="phone" jdbcType="VARCHAR" property="phone" />
|
||||
<result column="role" jdbcType="INTEGER" property="role" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="image_path" jdbcType="VARCHAR" property="imagePath" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="modify_time" jdbcType="TIMESTAMP" property="modifyTime" />
|
||||
<result column="last_active_time" jdbcType="TIMESTAMP" property="lastActiveTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="wx_open_id" jdbcType="VARCHAR" property="wxOpenId" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, user_uuid, user_name, password, real_name, age, sex, birth_day, user_level, phone,
|
||||
role, status, image_path, create_time, modify_time, last_active_time, deleted, wx_open_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_user
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.User" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user (id, user_uuid, user_name,
|
||||
password, real_name, age,
|
||||
sex, birth_day, user_level,
|
||||
phone, role, status,
|
||||
image_path, create_time, modify_time,
|
||||
last_active_time, deleted, wx_open_id
|
||||
)
|
||||
values (#{id,jdbcType=INTEGER}, #{userUuid,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR},
|
||||
#{password,jdbcType=VARCHAR}, #{realName,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},
|
||||
#{sex,jdbcType=INTEGER}, #{birthDay,jdbcType=TIMESTAMP}, #{userLevel,jdbcType=INTEGER},
|
||||
#{phone,jdbcType=VARCHAR}, #{role,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
|
||||
#{imagePath,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{modifyTime,jdbcType=TIMESTAMP},
|
||||
#{lastActiveTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT}, #{wxOpenId,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.User" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="userUuid != null">
|
||||
user_uuid,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password,
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name,
|
||||
</if>
|
||||
<if test="age != null">
|
||||
age,
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
sex,
|
||||
</if>
|
||||
<if test="birthDay != null">
|
||||
birth_day,
|
||||
</if>
|
||||
<if test="userLevel != null">
|
||||
user_level,
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone,
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="imagePath != null">
|
||||
image_path,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="modifyTime != null">
|
||||
modify_time,
|
||||
</if>
|
||||
<if test="lastActiveTime != null">
|
||||
last_active_time,
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted,
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
wx_open_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userUuid != null">
|
||||
#{userUuid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
#{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
#{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="age != null">
|
||||
#{age,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
#{sex,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="birthDay != null">
|
||||
#{birthDay,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userLevel != null">
|
||||
#{userLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
#{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
#{role,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="imagePath != null">
|
||||
#{imagePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="modifyTime != null">
|
||||
#{modifyTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="lastActiveTime != null">
|
||||
#{lastActiveTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
#{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
#{wxOpenId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.User">
|
||||
update t_user
|
||||
<set>
|
||||
<if test="userUuid != null">
|
||||
user_uuid = #{userUuid,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="password != null">
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="realName != null">
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="age != null">
|
||||
age = #{age,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sex != null">
|
||||
sex = #{sex,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="birthDay != null">
|
||||
birth_day = #{birthDay,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userLevel != null">
|
||||
user_level = #{userLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="phone != null">
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="role != null">
|
||||
role = #{role,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="imagePath != null">
|
||||
image_path = #{imagePath,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="modifyTime != null">
|
||||
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="lastActiveTime != null">
|
||||
last_active_time = #{lastActiveTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="deleted != null">
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.User">
|
||||
update t_user
|
||||
set user_uuid = #{userUuid,jdbcType=VARCHAR},
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
password = #{password,jdbcType=VARCHAR},
|
||||
real_name = #{realName,jdbcType=VARCHAR},
|
||||
age = #{age,jdbcType=INTEGER},
|
||||
sex = #{sex,jdbcType=INTEGER},
|
||||
birth_day = #{birthDay,jdbcType=TIMESTAMP},
|
||||
user_level = #{userLevel,jdbcType=INTEGER},
|
||||
phone = #{phone,jdbcType=VARCHAR},
|
||||
role = #{role,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
image_path = #{imagePath,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
||||
last_active_time = #{lastActiveTime,jdbcType=TIMESTAMP},
|
||||
deleted = #{deleted,jdbcType=BIT},
|
||||
wx_open_id = #{wxOpenId,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="getAllUser" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user where deleted=0
|
||||
</select>
|
||||
|
||||
<select id="getUserById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user
|
||||
where id=#{value}
|
||||
</select>
|
||||
|
||||
<select id="getUserByUserName" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user
|
||||
where deleted=0 and user_name=#{value} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getUserByUserNamePwd" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user
|
||||
where deleted=0 and user_name=#{username} and password=#{pwd} limit 1
|
||||
</select>
|
||||
|
||||
<select id="getUserByUuid" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from t_user
|
||||
where deleted=0 and user_uuid=#{value,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="userPageList" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_user
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="name != null and name != ''">
|
||||
and real_name like concat('%',#{name},'%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY id
|
||||
<if test="offset != null and limit != null ">
|
||||
<bind name="patternAdd" value="limit*offset"/>
|
||||
limit #{limit} OFFSET #{offset}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="userPageCount" resultType="java.lang.Integer">
|
||||
select count(*) from t_user
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="name != null and name != ''">
|
||||
and real_name like concat('%', #{name}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="userPage" resultMap="BaseResultMap" parameterType="com.mindskip.xzs.viewmodel.admin.user.UserPageRequestVM">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM t_user
|
||||
<where>
|
||||
and deleted=0
|
||||
<if test="userName != null and userName != ''">
|
||||
and user_name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="role != null ">
|
||||
and role= #{role}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<insert id="insertUser" parameterType="com.mindskip.xzs.domain.User"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user
|
||||
(user_uuid,user_name,password,real_name,age, last_active_time)
|
||||
values
|
||||
(#{userUuid,jdbcType=VARCHAR},#{userName},#{password},#{realName},#{age},#{lastActiveTime})
|
||||
</insert>
|
||||
|
||||
<insert id="insertUsers" parameterType="java.util.List"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user
|
||||
(user_uuid,user_name,password,real_name,age,last_active_time)
|
||||
values
|
||||
<foreach collection="list" item="item" index="index"
|
||||
separator=",">
|
||||
(#{item.userUuid},#{item.userName},#{item.password},#{item.realName},#{item.age},
|
||||
#{item.lastActiveTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateUser" parameterType="com.mindskip.xzs.domain.User">
|
||||
update t_user
|
||||
<set>
|
||||
<if test="realName != null">real_name = #{realName},</if>
|
||||
<if test="age != null">age = #{age},</if>
|
||||
<if test="lastActiveTime != null">last_active_time = #{lastActiveTime},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateUsersAge">
|
||||
update t_user set age = #{age} where id in
|
||||
<foreach item="id" collection="idslist" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteUsersByIds">
|
||||
delete from t_user where id in
|
||||
<foreach item="id" collection="list" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAllCount" resultType="java.lang.Integer">
|
||||
SELECT count(*) from t_user where deleted=0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByUserName" resultType="com.mindskip.xzs.domain.other.KeyValue">
|
||||
SELECT id as value,user_name as name
|
||||
from t_user
|
||||
where deleted=0 and user_name like concat('%',#{value},'%')
|
||||
limit 5
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByIds" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user
|
||||
where id in
|
||||
<foreach item="id" collection="list" open="(" separator=","
|
||||
close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectByWxOpenId" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user
|
||||
where deleted=0 and wx_open_id = #{wxOpenId}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
132
source/xzs/src/main/resources/mapper/UserTokenMapper.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?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="com.mindskip.xzs.repository.UserTokenMapper">
|
||||
<resultMap id="BaseResultMap" type="com.mindskip.xzs.domain.UserToken">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="token" jdbcType="VARCHAR" property="token" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="wx_open_id" jdbcType="VARCHAR" property="wxOpenId" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
id, token, user_id, wx_open_id, create_time, end_time, user_name
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user_token
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
delete from t_user_token
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.mindskip.xzs.domain.UserToken" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user_token (id, token, user_id,
|
||||
wx_open_id, create_time, end_time,
|
||||
user_name)
|
||||
values (#{id,jdbcType=INTEGER}, #{token,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},
|
||||
#{wxOpenId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
||||
#{userName,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.mindskip.xzs.domain.UserToken" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into t_user_token
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="token != null">
|
||||
token,
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
wx_open_id,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time,
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="token != null">
|
||||
#{token,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
#{wxOpenId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
#{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
#{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.mindskip.xzs.domain.UserToken">
|
||||
update t_user_token
|
||||
<set>
|
||||
<if test="token != null">
|
||||
token = #{token,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="wxOpenId != null">
|
||||
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="endTime != null">
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="userName != null">
|
||||
user_name = #{userName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.mindskip.xzs.domain.UserToken">
|
||||
update t_user_token
|
||||
set token = #{token,jdbcType=VARCHAR},
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
wx_open_id = #{wxOpenId,jdbcType=VARCHAR},
|
||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||
user_name = #{userName,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="getToken" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_user_token
|
||||
where token = #{token,jdbcType=VARCHAR}
|
||||
order by id desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts-en.common.min.js
vendored
Normal file
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts-en.min.js
vendored
Normal file
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts-en.simple.min.js
vendored
Normal file
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts.common.min.js
vendored
Normal file
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts.min.js
vendored
Normal file
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/echarts.simple.min.js
vendored
Normal file
@@ -0,0 +1,418 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
|
||||
(factory((global.bmap = {}),global.echarts));
|
||||
}(this, (function (exports,echarts) { 'use strict';
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/* global BMap */
|
||||
|
||||
function BMapCoordSys(bmap, api) {
|
||||
this._bmap = bmap;
|
||||
this.dimensions = ['lng', 'lat'];
|
||||
this._mapOffset = [0, 0];
|
||||
|
||||
this._api = api;
|
||||
|
||||
this._projection = new BMap.MercatorProjection();
|
||||
}
|
||||
|
||||
BMapCoordSys.prototype.dimensions = ['lng', 'lat'];
|
||||
|
||||
BMapCoordSys.prototype.setZoom = function (zoom) {
|
||||
this._zoom = zoom;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.setCenter = function (center) {
|
||||
this._center = this._projection.lngLatToPoint(new BMap.Point(center[0], center[1]));
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.setMapOffset = function (mapOffset) {
|
||||
this._mapOffset = mapOffset;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getBMap = function () {
|
||||
return this._bmap;
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.dataToPoint = function (data) {
|
||||
var point = new BMap.Point(data[0], data[1]);
|
||||
// TODO mercator projection is toooooooo slow
|
||||
// var mercatorPoint = this._projection.lngLatToPoint(point);
|
||||
|
||||
// var width = this._api.getZr().getWidth();
|
||||
// var height = this._api.getZr().getHeight();
|
||||
// var divider = Math.pow(2, 18 - 10);
|
||||
// return [
|
||||
// Math.round((mercatorPoint.x - this._center.x) / divider + width / 2),
|
||||
// Math.round((this._center.y - mercatorPoint.y) / divider + height / 2)
|
||||
// ];
|
||||
var px = this._bmap.pointToOverlayPixel(point);
|
||||
var mapOffset = this._mapOffset;
|
||||
return [px.x - mapOffset[0], px.y - mapOffset[1]];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.pointToData = function (pt) {
|
||||
var mapOffset = this._mapOffset;
|
||||
var pt = this._bmap.overlayPixelToPoint({
|
||||
x: pt[0] + mapOffset[0],
|
||||
y: pt[1] + mapOffset[1]
|
||||
});
|
||||
return [pt.lng, pt.lat];
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getViewRect = function () {
|
||||
var api = this._api;
|
||||
return new echarts.graphic.BoundingRect(0, 0, api.getWidth(), api.getHeight());
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.getRoamTransform = function () {
|
||||
return echarts.matrix.create();
|
||||
};
|
||||
|
||||
BMapCoordSys.prototype.prepareCustoms = function (data) {
|
||||
var rect = this.getViewRect();
|
||||
return {
|
||||
coordSys: {
|
||||
// The name exposed to user is always 'cartesian2d' but not 'grid'.
|
||||
type: 'bmap',
|
||||
x: rect.x,
|
||||
y: rect.y,
|
||||
width: rect.width,
|
||||
height: rect.height
|
||||
},
|
||||
api: {
|
||||
coord: echarts.util.bind(this.dataToPoint, this),
|
||||
size: echarts.util.bind(dataToCoordSize, this)
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
function dataToCoordSize(dataSize, dataItem) {
|
||||
dataItem = dataItem || [0, 0];
|
||||
return echarts.util.map([0, 1], function (dimIdx) {
|
||||
var val = dataItem[dimIdx];
|
||||
var halfSize = dataSize[dimIdx] / 2;
|
||||
var p1 = [];
|
||||
var p2 = [];
|
||||
p1[dimIdx] = val - halfSize;
|
||||
p2[dimIdx] = val + halfSize;
|
||||
p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx];
|
||||
return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]);
|
||||
}, this);
|
||||
}
|
||||
|
||||
var Overlay;
|
||||
|
||||
// For deciding which dimensions to use when creating list data
|
||||
BMapCoordSys.dimensions = BMapCoordSys.prototype.dimensions;
|
||||
|
||||
function createOverlayCtor() {
|
||||
function Overlay(root) {
|
||||
this._root = root;
|
||||
}
|
||||
|
||||
Overlay.prototype = new BMap.Overlay();
|
||||
/**
|
||||
* 初始化
|
||||
*
|
||||
* @param {BMap.Map} map
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.initialize = function (map) {
|
||||
map.getPanes().labelPane.appendChild(this._root);
|
||||
return this._root;
|
||||
};
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
Overlay.prototype.draw = function () {};
|
||||
|
||||
return Overlay;
|
||||
}
|
||||
|
||||
BMapCoordSys.create = function (ecModel, api) {
|
||||
var bmapCoordSys;
|
||||
var root = api.getDom();
|
||||
|
||||
// TODO Dispose
|
||||
ecModel.eachComponent('bmap', function (bmapModel) {
|
||||
var painter = api.getZr().painter;
|
||||
var viewportRoot = painter.getViewportRoot();
|
||||
if (typeof BMap === 'undefined') {
|
||||
throw new Error('BMap api is not loaded');
|
||||
}
|
||||
Overlay = Overlay || createOverlayCtor();
|
||||
if (bmapCoordSys) {
|
||||
throw new Error('Only one bmap component can exist');
|
||||
}
|
||||
if (!bmapModel.__bmap) {
|
||||
// Not support IE8
|
||||
var bmapRoot = root.querySelector('.ec-extension-bmap');
|
||||
if (bmapRoot) {
|
||||
// Reset viewport left and top, which will be changed
|
||||
// in moving handler in BMapView
|
||||
viewportRoot.style.left = '0px';
|
||||
viewportRoot.style.top = '0px';
|
||||
root.removeChild(bmapRoot);
|
||||
}
|
||||
bmapRoot = document.createElement('div');
|
||||
bmapRoot.style.cssText = 'width:100%;height:100%';
|
||||
// Not support IE8
|
||||
bmapRoot.classList.add('ec-extension-bmap');
|
||||
root.appendChild(bmapRoot);
|
||||
var bmap = bmapModel.__bmap = new BMap.Map(bmapRoot);
|
||||
|
||||
var overlay = new Overlay(viewportRoot);
|
||||
bmap.addOverlay(overlay);
|
||||
|
||||
// Override
|
||||
painter.getViewportRootOffset = function () {
|
||||
return {offsetLeft: 0, offsetTop: 0};
|
||||
};
|
||||
}
|
||||
var bmap = bmapModel.__bmap;
|
||||
|
||||
// Set bmap options
|
||||
// centerAndZoom before layout and render
|
||||
var center = bmapModel.get('center');
|
||||
var zoom = bmapModel.get('zoom');
|
||||
if (center && zoom) {
|
||||
var pt = new BMap.Point(center[0], center[1]);
|
||||
bmap.centerAndZoom(pt, zoom);
|
||||
}
|
||||
|
||||
bmapCoordSys = new BMapCoordSys(bmap, api);
|
||||
bmapCoordSys.setMapOffset(bmapModel.__mapOffset || [0, 0]);
|
||||
bmapCoordSys.setZoom(zoom);
|
||||
bmapCoordSys.setCenter(center);
|
||||
|
||||
bmapModel.coordinateSystem = bmapCoordSys;
|
||||
});
|
||||
|
||||
ecModel.eachSeries(function (seriesModel) {
|
||||
if (seriesModel.get('coordinateSystem') === 'bmap') {
|
||||
seriesModel.coordinateSystem = bmapCoordSys;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
function v2Equal(a, b) {
|
||||
return a && b && a[0] === b[0] && a[1] === b[1];
|
||||
}
|
||||
|
||||
echarts.extendComponentModel({
|
||||
type: 'bmap',
|
||||
|
||||
getBMap: function () {
|
||||
// __bmap is injected when creating BMapCoordSys
|
||||
return this.__bmap;
|
||||
},
|
||||
|
||||
setCenterAndZoom: function (center, zoom) {
|
||||
this.option.center = center;
|
||||
this.option.zoom = zoom;
|
||||
},
|
||||
|
||||
centerOrZoomChanged: function (center, zoom) {
|
||||
var option = this.option;
|
||||
return !(v2Equal(center, option.center) && zoom === option.zoom);
|
||||
},
|
||||
|
||||
defaultOption: {
|
||||
|
||||
center: [104.114129, 37.550339],
|
||||
|
||||
zoom: 5,
|
||||
|
||||
mapStyle: {},
|
||||
|
||||
roam: false
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
echarts.extendComponentView({
|
||||
type: 'bmap',
|
||||
|
||||
render: function (bMapModel, ecModel, api) {
|
||||
var rendering = true;
|
||||
|
||||
var bmap = bMapModel.getBMap();
|
||||
var viewportRoot = api.getZr().painter.getViewportRoot();
|
||||
var coordSys = bMapModel.coordinateSystem;
|
||||
var moveHandler = function (type, target) {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
var offsetEl = viewportRoot.parentNode.parentNode.parentNode;
|
||||
var mapOffset = [
|
||||
-parseInt(offsetEl.style.left, 10) || 0,
|
||||
-parseInt(offsetEl.style.top, 10) || 0
|
||||
];
|
||||
viewportRoot.style.left = mapOffset[0] + 'px';
|
||||
viewportRoot.style.top = mapOffset[1] + 'px';
|
||||
|
||||
coordSys.setMapOffset(mapOffset);
|
||||
bMapModel.__mapOffset = mapOffset;
|
||||
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
};
|
||||
|
||||
function zoomEndHandler() {
|
||||
if (rendering) {
|
||||
return;
|
||||
}
|
||||
api.dispatchAction({
|
||||
type: 'bmapRoam'
|
||||
});
|
||||
}
|
||||
|
||||
bmap.removeEventListener('moving', this._oldMoveHandler);
|
||||
// FIXME
|
||||
// Moveend may be triggered by centerAndZoom method when creating coordSys next time
|
||||
// bmap.removeEventListener('moveend', this._oldMoveHandler);
|
||||
bmap.removeEventListener('zoomend', this._oldZoomEndHandler);
|
||||
bmap.addEventListener('moving', moveHandler);
|
||||
// bmap.addEventListener('moveend', moveHandler);
|
||||
bmap.addEventListener('zoomend', zoomEndHandler);
|
||||
|
||||
this._oldMoveHandler = moveHandler;
|
||||
this._oldZoomEndHandler = zoomEndHandler;
|
||||
|
||||
var roam = bMapModel.get('roam');
|
||||
if (roam && roam !== 'scale') {
|
||||
bmap.enableDragging();
|
||||
}
|
||||
else {
|
||||
bmap.disableDragging();
|
||||
}
|
||||
if (roam && roam !== 'move') {
|
||||
bmap.enableScrollWheelZoom();
|
||||
bmap.enableDoubleClickZoom();
|
||||
bmap.enablePinchToZoom();
|
||||
}
|
||||
else {
|
||||
bmap.disableScrollWheelZoom();
|
||||
bmap.disableDoubleClickZoom();
|
||||
bmap.disablePinchToZoom();
|
||||
}
|
||||
|
||||
var originalStyle = bMapModel.__mapStyle;
|
||||
|
||||
var newMapStyle = bMapModel.get('mapStyle') || {};
|
||||
// FIXME, Not use JSON methods
|
||||
var mapStyleStr = JSON.stringify(newMapStyle);
|
||||
if (JSON.stringify(originalStyle) !== mapStyleStr) {
|
||||
// FIXME May have blank tile when dragging if setMapStyle
|
||||
if (Object.keys(newMapStyle).length) {
|
||||
bmap.setMapStyle(newMapStyle);
|
||||
}
|
||||
bMapModel.__mapStyle = JSON.parse(mapStyleStr);
|
||||
}
|
||||
|
||||
rendering = false;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* BMap component extension
|
||||
*/
|
||||
|
||||
echarts.registerCoordinateSystem('bmap', BMapCoordSys);
|
||||
|
||||
// Action
|
||||
echarts.registerAction({
|
||||
type: 'bmapRoam',
|
||||
event: 'bmapRoam',
|
||||
update: 'updateLayout'
|
||||
}, function (payload, ecModel) {
|
||||
ecModel.eachComponent('bmap', function (bMapModel) {
|
||||
var bmap = bMapModel.getBMap();
|
||||
var center = bmap.getCenter();
|
||||
bMapModel.setCenterAndZoom([center.lng, center.lat], bmap.getZoom());
|
||||
});
|
||||
});
|
||||
|
||||
var version = '1.0.0';
|
||||
|
||||
exports.version = version;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=bmap.js.map
|
||||
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/extension/bmap.min.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],e):e(t.bmap={},t.echarts)}(this,function(t,e){"use strict";function o(t,e){this._bmap=t,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=e,this._projection=new BMap.MercatorProjection}function n(t,o){return o=o||[0,0],e.util.map([0,1],function(e){var n=o[e],i=t[e]/2,a=[],r=[];return a[e]=n-i,r[e]=n+i,a[1-e]=r[1-e]=o[1-e],Math.abs(this.dataToPoint(a)[e]-this.dataToPoint(r)[e])},this)}function i(){function t(t){this._root=t}return t.prototype=new BMap.Overlay,t.prototype.initialize=function(t){return t.getPanes().labelPane.appendChild(this._root),this._root},t.prototype.draw=function(){},t}function a(t,e){return t&&e&&t[0]===e[0]&&t[1]===e[1]}o.prototype.dimensions=["lng","lat"],o.prototype.setZoom=function(t){this._zoom=t},o.prototype.setCenter=function(t){this._center=this._projection.lngLatToPoint(new BMap.Point(t[0],t[1]))},o.prototype.setMapOffset=function(t){this._mapOffset=t},o.prototype.getBMap=function(){return this._bmap},o.prototype.dataToPoint=function(t){var e=new BMap.Point(t[0],t[1]),o=this._bmap.pointToOverlayPixel(e),n=this._mapOffset;return[o.x-n[0],o.y-n[1]]},o.prototype.pointToData=function(t){var e=this._mapOffset;return[(t=this._bmap.overlayPixelToPoint({x:t[0]+e[0],y:t[1]+e[1]})).lng,t.lat]},o.prototype.getViewRect=function(){var t=this._api;return new e.graphic.BoundingRect(0,0,t.getWidth(),t.getHeight())},o.prototype.getRoamTransform=function(){return e.matrix.create()},o.prototype.prepareCustoms=function(t){var o=this.getViewRect();return{coordSys:{type:"bmap",x:o.x,y:o.y,width:o.width,height:o.height},api:{coord:e.util.bind(this.dataToPoint,this),size:e.util.bind(n,this)}}};var r;o.dimensions=o.prototype.dimensions,o.create=function(t,e){var n,a=e.getDom();t.eachComponent("bmap",function(t){var p=e.getZr().painter,s=p.getViewportRoot();if("undefined"==typeof BMap)throw new Error("BMap api is not loaded");if(r=r||i(),n)throw new Error("Only one bmap component can exist");if(!t.__bmap){var m=a.querySelector(".ec-extension-bmap");m&&(s.style.left="0px",s.style.top="0px",a.removeChild(m)),(m=document.createElement("div")).style.cssText="width:100%;height:100%",m.classList.add("ec-extension-bmap"),a.appendChild(m);var c=t.__bmap=new BMap.Map(m),d=new r(s);c.addOverlay(d),p.getViewportRootOffset=function(){return{offsetLeft:0,offsetTop:0}}}var c=t.__bmap,f=t.get("center"),l=t.get("zoom");if(f&&l){var h=new BMap.Point(f[0],f[1]);c.centerAndZoom(h,l)}(n=new o(c,e)).setMapOffset(t.__mapOffset||[0,0]),n.setZoom(l),n.setCenter(f),t.coordinateSystem=n}),t.eachSeries(function(t){"bmap"===t.get("coordinateSystem")&&(t.coordinateSystem=n)})},e.extendComponentModel({type:"bmap",getBMap:function(){return this.__bmap},setCenterAndZoom:function(t,e){this.option.center=t,this.option.zoom=e},centerOrZoomChanged:function(t,e){var o=this.option;return!(a(t,o.center)&&e===o.zoom)},defaultOption:{center:[104.114129,37.550339],zoom:5,mapStyle:{},roam:!1}}),e.extendComponentView({type:"bmap",render:function(t,e,o){function n(){i||o.dispatchAction({type:"bmapRoam"})}var i=!0,a=t.getBMap(),r=o.getZr().painter.getViewportRoot(),p=t.coordinateSystem,s=function(e,n){if(!i){var a=r.parentNode.parentNode.parentNode,s=[-parseInt(a.style.left,10)||0,-parseInt(a.style.top,10)||0];r.style.left=s[0]+"px",r.style.top=s[1]+"px",p.setMapOffset(s),t.__mapOffset=s,o.dispatchAction({type:"bmapRoam"})}};a.removeEventListener("moving",this._oldMoveHandler),a.removeEventListener("zoomend",this._oldZoomEndHandler),a.addEventListener("moving",s),a.addEventListener("zoomend",n),this._oldMoveHandler=s,this._oldZoomEndHandler=n;var m=t.get("roam");m&&"scale"!==m?a.enableDragging():a.disableDragging(),m&&"move"!==m?(a.enableScrollWheelZoom(),a.enableDoubleClickZoom(),a.enablePinchToZoom()):(a.disableScrollWheelZoom(),a.disableDoubleClickZoom(),a.disablePinchToZoom());var c=t.__mapStyle,d=t.get("mapStyle")||{},f=JSON.stringify(d);JSON.stringify(c)!==f&&(Object.keys(d).length&&a.setMapStyle(d),t.__mapStyle=JSON.parse(f)),i=!1}}),e.registerCoordinateSystem("bmap",o),e.registerAction({type:"bmapRoam",event:"bmapRoam",update:"updateLayout"},function(t,e){e.eachComponent("bmap",function(t){var e=t.getBMap(),o=e.getCenter();t.setCenterAndZoom([o.lng,o.lat],e.getZoom())})});t.version="1.0.0"});
|
||||
@@ -0,0 +1,851 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('echarts')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'echarts'], factory) :
|
||||
(factory((global.dataTool = {}),global.echarts));
|
||||
}(this, (function (exports,echarts) { 'use strict';
|
||||
|
||||
/**
|
||||
* @module zrender/core/util
|
||||
*/
|
||||
|
||||
// 用于处理merge时无法遍历Date等对象的问题
|
||||
var arrayProto = Array.prototype;
|
||||
var nativeMap = arrayProto.map;
|
||||
|
||||
|
||||
/**
|
||||
* Those data types can be cloned:
|
||||
* Plain object, Array, TypedArray, number, string, null, undefined.
|
||||
* Those data types will be assgined using the orginal data:
|
||||
* BUILTIN_OBJECT
|
||||
* Instance of user defined class will be cloned to a plain object, without
|
||||
* properties in prototype.
|
||||
* Other data types is not supported (not sure what will happen).
|
||||
*
|
||||
* Caution: do not support clone Date, for performance consideration.
|
||||
* (There might be a large number of date in `series.data`).
|
||||
* So date should not be modified in and out of echarts.
|
||||
*
|
||||
* @param {*} source
|
||||
* @return {*} new
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} target
|
||||
* @param {*} source
|
||||
* @param {boolean} [overwrite=false]
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array} targetAndSources The first item is target, and the rests are source.
|
||||
* @param {boolean} [overwrite=false]
|
||||
* @return {*} target
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {*} target
|
||||
* @param {*} source
|
||||
* @memberOf module:zrender/core/util
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {*} target
|
||||
* @param {*} source
|
||||
* @param {boolean} [overlay=false]
|
||||
* @memberOf module:zrender/core/util
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询数组中元素的index
|
||||
* @memberOf module:zrender/core/util
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 构造类继承关系
|
||||
*
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Function} clazz 源类
|
||||
* @param {Function} baseClazz 基类
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Object|Function} target
|
||||
* @param {Object|Function} sorce
|
||||
* @param {boolean} overlay
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Consider typed array.
|
||||
* @param {Array|TypedArray} data
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 数组或对象遍历
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Object|Array} obj
|
||||
* @param {Function} cb
|
||||
* @param {*} [context]
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 数组映射
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Array} obj
|
||||
* @param {Function} cb
|
||||
* @param {*} [context]
|
||||
* @return {Array}
|
||||
*/
|
||||
function map(obj, cb, context) {
|
||||
if (!(obj && cb)) {
|
||||
return;
|
||||
}
|
||||
if (obj.map && obj.map === nativeMap) {
|
||||
return obj.map(cb, context);
|
||||
}
|
||||
else {
|
||||
var result = [];
|
||||
for (var i = 0, len = obj.length; i < len; i++) {
|
||||
result.push(cb.call(context, obj[i], i, obj));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Array} obj
|
||||
* @param {Function} cb
|
||||
* @param {Object} [memo]
|
||||
* @param {*} [context]
|
||||
* @return {Array}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 数组过滤
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Array} obj
|
||||
* @param {Function} cb
|
||||
* @param {*} [context]
|
||||
* @return {Array}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 数组项查找
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Array} obj
|
||||
* @param {Function} cb
|
||||
* @param {*} [context]
|
||||
* @return {*}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Function} func
|
||||
* @param {*} context
|
||||
* @return {Function}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Function} func
|
||||
* @return {Function}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Whether is exactly NaN. Notice isNaN('a') returns true.
|
||||
* @param {*} value
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* If value1 is not null, then return value1, otherwise judget rest of values.
|
||||
* Low performance.
|
||||
* @memberOf module:zrender/core/util
|
||||
* @return {*} Final value
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {Array} arr
|
||||
* @param {number} startIndex
|
||||
* @param {number} endIndex
|
||||
* @return {Array}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Normalize css liked array configuration
|
||||
* e.g.
|
||||
* 3 => [3, 3, 3, 3]
|
||||
* [4, 2] => [4, 2, 4, 2]
|
||||
* [4, 3, 2] => [4, 3, 2, 3]
|
||||
* @param {number|Array.<number>} val
|
||||
* @return {Array.<number>}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {boolean} condition
|
||||
* @param {string} message
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @memberOf module:zrender/core/util
|
||||
* @param {string} str string to be trimed
|
||||
* @return {string} trimed string
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Set an object as primitive to be ignored traversing children in clone or merge
|
||||
*/
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
// GEXF File Parser
|
||||
// http://gexf.net/1.2draft/gexf-12draft-primer.pdf
|
||||
|
||||
function parse(xml) {
|
||||
var doc;
|
||||
if (typeof xml === 'string') {
|
||||
var parser = new DOMParser();
|
||||
doc = parser.parseFromString(xml, 'text/xml');
|
||||
}
|
||||
else {
|
||||
doc = xml;
|
||||
}
|
||||
if (!doc || doc.getElementsByTagName('parsererror').length) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var gexfRoot = getChildByTagName(doc, 'gexf');
|
||||
|
||||
if (!gexfRoot) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var graphRoot = getChildByTagName(gexfRoot, 'graph');
|
||||
|
||||
var attributes = parseAttributes(getChildByTagName(graphRoot, 'attributes'));
|
||||
var attributesMap = {};
|
||||
for (var i = 0; i < attributes.length; i++) {
|
||||
attributesMap[attributes[i].id] = attributes[i];
|
||||
}
|
||||
|
||||
return {
|
||||
nodes: parseNodes(getChildByTagName(graphRoot, 'nodes'), attributesMap),
|
||||
links: parseEdges(getChildByTagName(graphRoot, 'edges'))
|
||||
};
|
||||
}
|
||||
|
||||
function parseAttributes(parent) {
|
||||
return parent ? map(getChildrenByTagName(parent, 'attribute'), function (attribDom) {
|
||||
return {
|
||||
id: getAttr(attribDom, 'id'),
|
||||
title: getAttr(attribDom, 'title'),
|
||||
type: getAttr(attribDom, 'type')
|
||||
};
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseNodes(parent, attributesMap) {
|
||||
return parent ? map(getChildrenByTagName(parent, 'node'), function (nodeDom) {
|
||||
|
||||
var id = getAttr(nodeDom, 'id');
|
||||
var label = getAttr(nodeDom, 'label');
|
||||
|
||||
var node = {
|
||||
id: id,
|
||||
name: label,
|
||||
itemStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var vizSizeDom = getChildByTagName(nodeDom, 'viz:size');
|
||||
var vizPosDom = getChildByTagName(nodeDom, 'viz:position');
|
||||
var vizColorDom = getChildByTagName(nodeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(nodeDom, 'viz:shape');
|
||||
|
||||
var attvaluesDom = getChildByTagName(nodeDom, 'attvalues');
|
||||
|
||||
if (vizSizeDom) {
|
||||
node.symbolSize = parseFloat(getAttr(vizSizeDom, 'value'));
|
||||
}
|
||||
if (vizPosDom) {
|
||||
node.x = parseFloat(getAttr(vizPosDom, 'x'));
|
||||
node.y = parseFloat(getAttr(vizPosDom, 'y'));
|
||||
// z
|
||||
}
|
||||
if (vizColorDom) {
|
||||
node.itemStyle.normal.color = 'rgb(' +[
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// node.shape = getAttr(vizShapeDom, 'shape');
|
||||
// }
|
||||
if (attvaluesDom) {
|
||||
var attvalueDomList = getChildrenByTagName(attvaluesDom, 'attvalue');
|
||||
|
||||
node.attributes = {};
|
||||
|
||||
for (var j = 0; j < attvalueDomList.length; j++) {
|
||||
var attvalueDom = attvalueDomList[j];
|
||||
var attId = getAttr(attvalueDom, 'for');
|
||||
var attValue = getAttr(attvalueDom, 'value');
|
||||
var attribute = attributesMap[attId];
|
||||
|
||||
if (attribute) {
|
||||
switch (attribute.type) {
|
||||
case 'integer':
|
||||
case 'long':
|
||||
attValue = parseInt(attValue, 10);
|
||||
break;
|
||||
case 'float':
|
||||
case 'double':
|
||||
attValue = parseFloat(attValue);
|
||||
break;
|
||||
case 'boolean':
|
||||
attValue = attValue.toLowerCase() == 'true';
|
||||
break;
|
||||
default:
|
||||
}
|
||||
node.attributes[attId] = attValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return node;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function parseEdges(parent) {
|
||||
return parent ? map(getChildrenByTagName(parent, 'edge'), function (edgeDom) {
|
||||
var id = getAttr(edgeDom, 'id');
|
||||
var label = getAttr(edgeDom, 'label');
|
||||
|
||||
var sourceId = getAttr(edgeDom, 'source');
|
||||
var targetId = getAttr(edgeDom, 'target');
|
||||
|
||||
var edge = {
|
||||
id: id,
|
||||
name: label,
|
||||
source: sourceId,
|
||||
target: targetId,
|
||||
lineStyle: {
|
||||
normal: {}
|
||||
}
|
||||
};
|
||||
|
||||
var lineStyle = edge.lineStyle.normal;
|
||||
|
||||
var vizThicknessDom = getChildByTagName(edgeDom, 'viz:thickness');
|
||||
var vizColorDom = getChildByTagName(edgeDom, 'viz:color');
|
||||
// var vizShapeDom = getChildByTagName(edgeDom, 'viz:shape');
|
||||
|
||||
if (vizThicknessDom) {
|
||||
lineStyle.width = parseFloat(vizThicknessDom.getAttribute('value'));
|
||||
}
|
||||
if (vizColorDom) {
|
||||
lineStyle.color = 'rgb(' + [
|
||||
getAttr(vizColorDom, 'r') | 0,
|
||||
getAttr(vizColorDom, 'g') | 0,
|
||||
getAttr(vizColorDom, 'b') | 0
|
||||
].join(',') + ')';
|
||||
}
|
||||
// if (vizShapeDom) {
|
||||
// edge.shape = vizShapeDom.getAttribute('shape');
|
||||
// }
|
||||
|
||||
return edge;
|
||||
}) : [];
|
||||
}
|
||||
|
||||
function getAttr(el, attrName) {
|
||||
return el.getAttribute(attrName);
|
||||
}
|
||||
|
||||
function getChildByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
|
||||
while (node) {
|
||||
if (
|
||||
node.nodeType != 1 ||
|
||||
node.nodeName.toLowerCase() != tagName.toLowerCase()
|
||||
) {
|
||||
node = node.nextSibling;
|
||||
} else {
|
||||
return node;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getChildrenByTagName (parent, tagName) {
|
||||
var node = parent.firstChild;
|
||||
var children = [];
|
||||
while (node) {
|
||||
if (node.nodeName.toLowerCase() == tagName.toLowerCase()) {
|
||||
children.push(node);
|
||||
}
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
|
||||
var gexf = (Object.freeze || Object)({
|
||||
parse: parse
|
||||
});
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* A third-party license is embeded for some of the code in this file:
|
||||
* The method "quantile" was copied from "d3.js".
|
||||
* (See more details in the comment of the method below.)
|
||||
* The use of the source code of this file is also subject to the terms
|
||||
* and consitions of the license of "d3.js" (BSD-3Clause, see
|
||||
* </licenses/LICENSE-d3>).
|
||||
*/
|
||||
|
||||
/**
|
||||
* Linear mapping a value from domain to range
|
||||
* @memberOf module:echarts/util/number
|
||||
* @param {(number|Array.<number>)} val
|
||||
* @param {Array.<number>} domain Domain extent domain[0] can be bigger than domain[1]
|
||||
* @param {Array.<number>} range Range extent range[0] can be bigger than range[1]
|
||||
* @param {boolean} clamp
|
||||
* @return {(number|Array.<number>}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Convert a percent string to absolute number.
|
||||
* Returns NaN if percent is not a valid string or number
|
||||
* @memberOf module:echarts/util/number
|
||||
* @param {string|number} percent
|
||||
* @param {number} all
|
||||
* @return {number}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* (1) Fix rounding error of float numbers.
|
||||
* (2) Support return string to avoid scientific notation like '3.5e-7'.
|
||||
*
|
||||
* @param {number} x
|
||||
* @param {number} [precision]
|
||||
* @param {boolean} [returnStr]
|
||||
* @return {number|string}
|
||||
*/
|
||||
|
||||
|
||||
function asc(arr) {
|
||||
arr.sort(function (a, b) {
|
||||
return a - b;
|
||||
});
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get precision
|
||||
* @param {number} val
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|number} val
|
||||
* @return {number}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Minimal dicernible data precisioin according to a single pixel.
|
||||
*
|
||||
* @param {Array.<number>} dataExtent
|
||||
* @param {Array.<number>} pixelExtent
|
||||
* @return {number} precision
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Get a data of given precision, assuring the sum of percentages
|
||||
* in valueList is 1.
|
||||
* The largest remainer method is used.
|
||||
* https://en.wikipedia.org/wiki/Largest_remainder_method
|
||||
*
|
||||
* @param {Array.<number>} valueList a list of all data
|
||||
* @param {number} idx index of the data to be processed in valueList
|
||||
* @param {number} precision integer number showing digits of precision
|
||||
* @return {number} percent ranging from 0 to 100
|
||||
*/
|
||||
|
||||
|
||||
// Number.MAX_SAFE_INTEGER, ie do not support.
|
||||
|
||||
|
||||
/**
|
||||
* To 0 - 2 * PI, considering negative radian.
|
||||
* @param {number} radian
|
||||
* @return {number}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @param {type} radian
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
|
||||
/* eslint-enable */
|
||||
|
||||
/**
|
||||
* @param {string|Date|number} value These values can be accepted:
|
||||
* + An instance of Date, represent a time in its own time zone.
|
||||
* + Or string in a subset of ISO 8601, only including:
|
||||
* + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06',
|
||||
* + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123',
|
||||
* + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00',
|
||||
* all of which will be treated as local time if time zone is not specified
|
||||
* (see <https://momentjs.com/>).
|
||||
* + Or other string format, including (all of which will be treated as loacal time):
|
||||
* '2012', '2012-3-1', '2012/3/1', '2012/03/01',
|
||||
* '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123'
|
||||
* + a timestamp, which represent a time in UTC.
|
||||
* @return {Date} date
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Quantity of a number. e.g. 0.1, 1, 10, 100
|
||||
*
|
||||
* @param {number} val
|
||||
* @return {number}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* find a “nice” number approximately equal to x. Round the number if round = true,
|
||||
* take ceiling if round = false. The primary observation is that the “nicest”
|
||||
* numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
|
||||
*
|
||||
* See "Nice Numbers for Graph Labels" of Graphic Gems.
|
||||
*
|
||||
* @param {number} val Non-negative value.
|
||||
* @param {boolean} round
|
||||
* @return {number}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This code was copied from "d3.js"
|
||||
* <https://github.com/d3/d3/blob/9cc9a875e636a1dcf36cc1e07bdf77e1ad6e2c74/src/arrays/quantile.js>.
|
||||
* See the license statement at the head of this file.
|
||||
* @param {Array.<number>} ascArr
|
||||
*/
|
||||
function quantile(ascArr, p) {
|
||||
var H = (ascArr.length - 1) * p + 1;
|
||||
var h = Math.floor(H);
|
||||
var v = +ascArr[h - 1];
|
||||
var e = H - h;
|
||||
return e ? v + e * (ascArr[h] - v) : v;
|
||||
}
|
||||
|
||||
/**
|
||||
* Order intervals asc, and split them when overlap.
|
||||
* expect(numberUtil.reformIntervals([
|
||||
* {interval: [18, 62], close: [1, 1]},
|
||||
* {interval: [-Infinity, -70], close: [0, 0]},
|
||||
* {interval: [-70, -26], close: [1, 1]},
|
||||
* {interval: [-26, 18], close: [1, 1]},
|
||||
* {interval: [62, 150], close: [1, 1]},
|
||||
* {interval: [106, 150], close: [1, 1]},
|
||||
* {interval: [150, Infinity], close: [0, 0]}
|
||||
* ])).toEqual([
|
||||
* {interval: [-Infinity, -70], close: [0, 0]},
|
||||
* {interval: [-70, -26], close: [1, 1]},
|
||||
* {interval: [-26, 18], close: [0, 1]},
|
||||
* {interval: [18, 62], close: [0, 1]},
|
||||
* {interval: [62, 150], close: [0, 1]},
|
||||
* {interval: [150, Infinity], close: [0, 0]}
|
||||
* ]);
|
||||
* @param {Array.<Object>} list, where `close` mean open or close
|
||||
* of the interval, and Infinity can be used.
|
||||
* @return {Array.<Object>} The origin list, which has been reformed.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
||||
* ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
||||
* subtraction forces infinities to NaN
|
||||
*
|
||||
* @param {*} v
|
||||
* @return {boolean}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* See:
|
||||
* <https://en.wikipedia.org/wiki/Box_plot#cite_note-frigge_hoaglin_iglewicz-2>
|
||||
* <http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/boxplot.stats.html>
|
||||
*
|
||||
* Helper method for preparing data.
|
||||
*
|
||||
* @param {Array.<number>} rawData like
|
||||
* [
|
||||
* [12,232,443], (raw data set for the first box)
|
||||
* [3843,5545,1232], (raw datat set for the second box)
|
||||
* ...
|
||||
* ]
|
||||
* @param {Object} [opt]
|
||||
*
|
||||
* @param {(number|string)} [opt.boundIQR=1.5] Data less than min bound is outlier.
|
||||
* default 1.5, means Q1 - 1.5 * (Q3 - Q1).
|
||||
* If 'none'/0 passed, min bound will not be used.
|
||||
* @param {(number|string)} [opt.layout='horizontal']
|
||||
* Box plot layout, can be 'horizontal' or 'vertical'
|
||||
* @return {Object} {
|
||||
* boxData: Array.<Array.<number>>
|
||||
* outliers: Array.<Array.<number>>
|
||||
* axisData: Array.<string>
|
||||
* }
|
||||
*/
|
||||
var prepareBoxplotData = function (rawData, opt) {
|
||||
opt = opt || [];
|
||||
var boxData = [];
|
||||
var outliers = [];
|
||||
var axisData = [];
|
||||
var boundIQR = opt.boundIQR;
|
||||
var useExtreme = boundIQR === 'none' || boundIQR === 0;
|
||||
|
||||
for (var i = 0; i < rawData.length; i++) {
|
||||
axisData.push(i + '');
|
||||
var ascList = asc(rawData[i].slice());
|
||||
|
||||
var Q1 = quantile(ascList, 0.25);
|
||||
var Q2 = quantile(ascList, 0.5);
|
||||
var Q3 = quantile(ascList, 0.75);
|
||||
var min = ascList[0];
|
||||
var max = ascList[ascList.length - 1];
|
||||
|
||||
var bound = (boundIQR == null ? 1.5 : boundIQR) * (Q3 - Q1);
|
||||
|
||||
var low = useExtreme
|
||||
? min
|
||||
: Math.max(min, Q1 - bound);
|
||||
var high = useExtreme
|
||||
? max
|
||||
: Math.min(max, Q3 + bound);
|
||||
|
||||
boxData.push([low, Q1, Q2, Q3, high]);
|
||||
|
||||
for (var j = 0; j < ascList.length; j++) {
|
||||
var dataItem = ascList[j];
|
||||
if (dataItem < low || dataItem > high) {
|
||||
var outlier = [i, dataItem];
|
||||
opt.layout === 'vertical' && outlier.reverse();
|
||||
outliers.push(outlier);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
boxData: boxData,
|
||||
outliers: outliers,
|
||||
axisData: axisData
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var version = '1.0.0';
|
||||
|
||||
// For backward compatibility, where the namespace `dataTool` will
|
||||
// be mounted on `echarts` is the extension `dataTool` is imported.
|
||||
// But the old version of echarts do not have `dataTool` namespace,
|
||||
// so check it before mounting.
|
||||
if (echarts.dataTool) {
|
||||
echarts.dataTool.version = version;
|
||||
echarts.dataTool.gexf = gexf;
|
||||
echarts.dataTool.prepareBoxplotData = prepareBoxplotData;
|
||||
}
|
||||
|
||||
exports.version = version;
|
||||
exports.gexf = gexf;
|
||||
exports.prepareBoxplotData = prepareBoxplotData;
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=dataTool.js.map
|
||||
22
source/xzs/src/main/resources/static/admin/admin/components/echarts/extension/dataTool.min.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("echarts")):"function"==typeof define&&define.amd?define(["exports","echarts"],t):t(e.dataTool={},e.echarts)}(this,function(e,t){"use strict";function r(e,t,r){if(e&&t){if(e.map&&e.map===c)return e.map(t,r);for(var a=[],n=0,o=e.length;n<o;n++)a.push(t.call(r,e[n],n,e));return a}}function a(e){return e?r(u(e,"attribute"),function(e){return{id:i(e,"id"),title:i(e,"title"),type:i(e,"type")}}):[]}function n(e,t){return e?r(u(e,"node"),function(e){var r={id:i(e,"id"),name:i(e,"label"),itemStyle:{normal:{}}},a=l(e,"viz:size"),n=l(e,"viz:position"),o=l(e,"viz:color"),s=l(e,"attvalues");if(a&&(r.symbolSize=parseFloat(i(a,"value"))),n&&(r.x=parseFloat(i(n,"x")),r.y=parseFloat(i(n,"y"))),o&&(r.itemStyle.normal.color="rgb("+[0|i(o,"r"),0|i(o,"g"),0|i(o,"b")].join(",")+")"),s){var f=u(s,"attvalue");r.attributes={};for(var c=0;c<f.length;c++){var p=f[c],d=i(p,"for"),v=i(p,"value"),g=t[d];if(g){switch(g.type){case"integer":case"long":v=parseInt(v,10);break;case"float":case"double":v=parseFloat(v);break;case"boolean":v="true"==v.toLowerCase()}r.attributes[d]=v}}}return r}):[]}function o(e){return e?r(u(e,"edge"),function(e){var t={id:i(e,"id"),name:i(e,"label"),source:i(e,"source"),target:i(e,"target"),lineStyle:{normal:{}}},r=t.lineStyle.normal,a=l(e,"viz:thickness"),n=l(e,"viz:color");return a&&(r.width=parseFloat(a.getAttribute("value"))),n&&(r.color="rgb("+[0|i(n,"r"),0|i(n,"g"),0|i(n,"b")].join(",")+")"),t}):[]}function i(e,t){return e.getAttribute(t)}function l(e,t){for(var r=e.firstChild;r;){if(1==r.nodeType&&r.nodeName.toLowerCase()==t.toLowerCase())return r;r=r.nextSibling}return null}function u(e,t){for(var r=e.firstChild,a=[];r;)r.nodeName.toLowerCase()==t.toLowerCase()&&a.push(r),r=r.nextSibling;return a}function s(e){return e.sort(function(e,t){return e-t}),e}function f(e,t){var r=(e.length-1)*t+1,a=Math.floor(r),n=+e[a-1],o=r-a;return o?n+o*(e[a]-n):n}var c=Array.prototype.map,p=(Object.freeze||Object)({parse:function(e){var t;if(!(t="string"==typeof e?(new DOMParser).parseFromString(e,"text/xml"):e)||t.getElementsByTagName("parsererror").length)return null;var r=l(t,"gexf");if(!r)return null;for(var i=l(r,"graph"),u=a(l(i,"attributes")),s={},f=0;f<u.length;f++)s[u[f].id]=u[f];return{nodes:n(l(i,"nodes"),s),links:o(l(i,"edges"))}}}),d=function(e,t){for(var r=[],a=[],n=[],o=(t=t||[]).boundIQR,i="none"===o||0===o,l=0;l<e.length;l++){n.push(l+"");var u=s(e[l].slice()),c=f(u,.25),p=f(u,.5),d=f(u,.75),v=u[0],g=u[u.length-1],h=(null==o?1.5:o)*(d-c),b=i?v:Math.max(v,c-h),m=i?g:Math.min(g,d+h);r.push([b,c,p,d,m]);for(var y=0;y<u.length;y++){var x=u[y];if(x<b||x>m){var w=[l,x];"vertical"===t.layout&&w.reverse(),a.push(w)}}}return{boxData:r,outliers:a,axisData:n}};t.dataTool&&(t.dataTool.version="1.0.0",t.dataTool.gexf=p,t.dataTool.prepareBoxplotData=d),e.version="1.0.0",e.gexf=p,e.prepareBoxplotData=d});
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {
|
||||
/* eslint-disable */
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
/* eslint-enable */
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
var contrastColor = '#eee';
|
||||
var axisCommon = function () {
|
||||
return {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
lineStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
type: 'dashed',
|
||||
color: '#aaa'
|
||||
}
|
||||
},
|
||||
splitArea: {
|
||||
areaStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var colorPalette = [
|
||||
'#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53',
|
||||
'#eedd78', '#73a373', '#73b9bc', '#7289ab', '#91ca8c', '#f49f42'
|
||||
];
|
||||
var theme = {
|
||||
color: colorPalette,
|
||||
backgroundColor: '#333',
|
||||
tooltip: {
|
||||
axisPointer: {
|
||||
lineStyle: {
|
||||
color: contrastColor
|
||||
},
|
||||
crossStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
},
|
||||
title: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
iconStyle: {
|
||||
normal: {
|
||||
borderColor: contrastColor
|
||||
}
|
||||
}
|
||||
},
|
||||
dataZoom: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
visualMap: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
},
|
||||
timeline: {
|
||||
lineStyle: {
|
||||
color: contrastColor
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: colorPalette[1]
|
||||
}
|
||||
},
|
||||
label: {
|
||||
normal: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
}
|
||||
},
|
||||
controlStyle: {
|
||||
normal: {
|
||||
color: contrastColor,
|
||||
borderColor: contrastColor
|
||||
}
|
||||
}
|
||||
},
|
||||
timeAxis: axisCommon(),
|
||||
logAxis: axisCommon(),
|
||||
valueAxis: axisCommon(),
|
||||
categoryAxis: axisCommon(),
|
||||
|
||||
line: {
|
||||
symbol: 'circle'
|
||||
},
|
||||
graph: {
|
||||
color: colorPalette
|
||||
},
|
||||
gauge: {
|
||||
title: {
|
||||
textStyle: {
|
||||
color: contrastColor
|
||||
}
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#FD1050',
|
||||
color0: '#0CF49B',
|
||||
borderColor: '#FD1050',
|
||||
borderColor0: '#0CF49B'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
theme.categoryAxis.splitLine.show = false;
|
||||
echarts.registerTheme('dark', theme);
|
||||
}));
|
||||
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
var colorPalette = [
|
||||
'#C1232B','#27727B','#FCCE10','#E87C25','#B5C334',
|
||||
'#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD',
|
||||
'#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'
|
||||
];
|
||||
|
||||
var theme = {
|
||||
|
||||
color: colorPalette,
|
||||
|
||||
title: {
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
color: '#27727B'
|
||||
}
|
||||
},
|
||||
|
||||
visualMap: {
|
||||
color:['#C1232B','#FCCE10']
|
||||
},
|
||||
|
||||
toolbox: {
|
||||
iconStyle: {
|
||||
normal: {
|
||||
borderColor: colorPalette[0]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(50,50,50,0.5)',
|
||||
axisPointer : {
|
||||
type : 'line',
|
||||
lineStyle : {
|
||||
color: '#27727B',
|
||||
type: 'dashed'
|
||||
},
|
||||
crossStyle: {
|
||||
color: '#27727B'
|
||||
},
|
||||
shadowStyle : {
|
||||
color: 'rgba(200,200,200,0.3)'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dataZoom: {
|
||||
dataBackgroundColor: 'rgba(181,195,52,0.3)',
|
||||
fillerColor: 'rgba(181,195,52,0.2)',
|
||||
handleColor: '#27727B'
|
||||
},
|
||||
|
||||
categoryAxis: {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#27727B'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
|
||||
valueAxis: {
|
||||
axisLine: {
|
||||
show: false
|
||||
},
|
||||
splitArea : {
|
||||
show: false
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: ['#ccc'],
|
||||
type: 'dashed'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
timeline: {
|
||||
lineStyle: {
|
||||
color: '#27727B'
|
||||
},
|
||||
controlStyle: {
|
||||
normal: {
|
||||
color: '#27727B',
|
||||
borderColor: '#27727B'
|
||||
}
|
||||
},
|
||||
symbol: 'emptyCircle',
|
||||
symbolSize: 3
|
||||
},
|
||||
|
||||
line: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderWidth:2,
|
||||
borderColor:'#fff',
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
borderWidth:0
|
||||
}
|
||||
},
|
||||
symbol: 'circle',
|
||||
symbolSize: 3.5
|
||||
},
|
||||
|
||||
candlestick: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#C1232B',
|
||||
color0: '#B5C334',
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: '#C1232B',
|
||||
color0: '#B5C334'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
graph: {
|
||||
color: colorPalette
|
||||
},
|
||||
|
||||
map: {
|
||||
label: {
|
||||
normal: {
|
||||
textStyle: {
|
||||
color: '#C1232B'
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
textStyle: {
|
||||
color: 'rgb(100,0,0)'
|
||||
}
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
areaColor: '#ddd',
|
||||
borderColor: '#eee'
|
||||
},
|
||||
emphasis: {
|
||||
areaColor: '#fe994e'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
gauge: {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: [[0.2, '#B5C334'],[0.8, '#27727B'],[1, '#C1232B']]
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
splitNumber: 2,
|
||||
length: 5,
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
length: '5%',
|
||||
lineStyle: {
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
title : {
|
||||
offsetCenter: [0, -20]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
echarts.registerTheme('infographic', theme);
|
||||
}));
|
||||
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
var colorPalette = [
|
||||
'#2ec7c9','#b6a2de','#5ab1ef','#ffb980','#d87a80',
|
||||
'#8d98b3','#e5cf0d','#97b552','#95706d','#dc69aa',
|
||||
'#07a2a4','#9a7fd1','#588dd5','#f5994e','#c05050',
|
||||
'#59678c','#c9ab00','#7eb00a','#6f5553','#c14089'
|
||||
];
|
||||
|
||||
|
||||
var theme = {
|
||||
color: colorPalette,
|
||||
|
||||
title: {
|
||||
textStyle: {
|
||||
fontWeight: 'normal',
|
||||
color: '#008acd'
|
||||
}
|
||||
},
|
||||
|
||||
visualMap: {
|
||||
itemWidth: 15,
|
||||
color: ['#5ab1ef','#e0ffff']
|
||||
},
|
||||
|
||||
toolbox: {
|
||||
iconStyle: {
|
||||
normal: {
|
||||
borderColor: colorPalette[0]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(50,50,50,0.5)',
|
||||
axisPointer : {
|
||||
type : 'line',
|
||||
lineStyle : {
|
||||
color: '#008acd'
|
||||
},
|
||||
crossStyle: {
|
||||
color: '#008acd'
|
||||
},
|
||||
shadowStyle : {
|
||||
color: 'rgba(200,200,200,0.2)'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dataZoom: {
|
||||
dataBackgroundColor: '#efefff',
|
||||
fillerColor: 'rgba(182,162,222,0.2)',
|
||||
handleColor: '#008acd'
|
||||
},
|
||||
|
||||
grid: {
|
||||
borderColor: '#eee'
|
||||
},
|
||||
|
||||
categoryAxis: {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#008acd'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: ['#eee']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
valueAxis: {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#008acd'
|
||||
}
|
||||
},
|
||||
splitArea : {
|
||||
show : true,
|
||||
areaStyle : {
|
||||
color: ['rgba(250,250,250,0.1)','rgba(200,200,200,0.1)']
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
lineStyle: {
|
||||
color: ['#eee']
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
timeline : {
|
||||
lineStyle : {
|
||||
color : '#008acd'
|
||||
},
|
||||
controlStyle : {
|
||||
normal : { color : '#008acd'},
|
||||
emphasis : { color : '#008acd'}
|
||||
},
|
||||
symbol : 'emptyCircle',
|
||||
symbolSize : 3
|
||||
},
|
||||
|
||||
line: {
|
||||
smooth : true,
|
||||
symbol: 'emptyCircle',
|
||||
symbolSize: 3
|
||||
},
|
||||
|
||||
candlestick: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#d87a80',
|
||||
color0: '#2ec7c9',
|
||||
lineStyle: {
|
||||
color: '#d87a80',
|
||||
color0: '#2ec7c9'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
scatter: {
|
||||
symbol: 'circle',
|
||||
symbolSize: 4
|
||||
},
|
||||
|
||||
map: {
|
||||
label: {
|
||||
normal: {
|
||||
textStyle: {
|
||||
color: '#d87a80'
|
||||
}
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderColor: '#eee',
|
||||
areaColor: '#ddd'
|
||||
},
|
||||
emphasis: {
|
||||
areaColor: '#fe994e'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
graph: {
|
||||
color: colorPalette
|
||||
},
|
||||
|
||||
gauge : {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: [[0.2, '#2ec7c9'],[0.8, '#5ab1ef'],[1, '#d87a80']],
|
||||
width: 10
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
splitNumber: 10,
|
||||
length :15,
|
||||
lineStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
length :22,
|
||||
lineStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
pointer : {
|
||||
width : 5
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
echarts.registerTheme('macarons', theme);
|
||||
}));
|
||||
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
var colorPalette = ['#E01F54','#001852','#f5e8c8','#b8d2c7','#c6b38e',
|
||||
'#a4d8c2','#f3d999','#d3758f','#dcc392','#2e4783',
|
||||
'#82b6e9','#ff6347','#a092f1','#0a915d','#eaf889',
|
||||
'#6699FF','#ff6666','#3cb371','#d5b158','#38b6b6'
|
||||
];
|
||||
|
||||
var theme = {
|
||||
color: colorPalette,
|
||||
|
||||
visualMap: {
|
||||
color:['#e01f54','#e7dbc3'],
|
||||
textStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
|
||||
candlestick: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#e01f54',
|
||||
color0: '#001852',
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: '#f5e8c8',
|
||||
color0: '#b8d2c7'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
graph: {
|
||||
color: colorPalette
|
||||
},
|
||||
|
||||
gauge : {
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: [[0.2, '#E01F54'],[0.8, '#b8d2c7'],[1, '#001852']],
|
||||
width: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
echarts.registerTheme('roma', theme);
|
||||
}));
|
||||
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
|
||||
var colorPalette = [
|
||||
'#c12e34','#e6b600','#0098d9','#2b821d',
|
||||
'#005eaa','#339ca8','#cda819','#32a487'
|
||||
];
|
||||
|
||||
var theme = {
|
||||
|
||||
color: colorPalette,
|
||||
|
||||
title: {
|
||||
textStyle: {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
|
||||
visualMap: {
|
||||
color:['#1790cf','#a2d4e6']
|
||||
},
|
||||
|
||||
toolbox: {
|
||||
iconStyle: {
|
||||
normal: {
|
||||
borderColor: '#06467c'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0,0,0,0.6)'
|
||||
},
|
||||
|
||||
dataZoom: {
|
||||
dataBackgroundColor: '#dedede',
|
||||
fillerColor: 'rgba(154,217,247,0.2)',
|
||||
handleColor: '#005eaa'
|
||||
},
|
||||
|
||||
timeline: {
|
||||
lineStyle: {
|
||||
color: '#005eaa'
|
||||
},
|
||||
controlStyle: {
|
||||
normal: {
|
||||
color: '#005eaa',
|
||||
borderColor: '#005eaa'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
candlestick: {
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#c12e34',
|
||||
color0: '#2b821d',
|
||||
lineStyle: {
|
||||
width: 1,
|
||||
color: '#c12e34',
|
||||
color0: '#2b821d'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
graph: {
|
||||
color: colorPalette
|
||||
},
|
||||
|
||||
map: {
|
||||
label: {
|
||||
normal: {
|
||||
textStyle: {
|
||||
color: '#c12e34'
|
||||
}
|
||||
},
|
||||
emphasis: {
|
||||
textStyle: {
|
||||
color: '#c12e34'
|
||||
}
|
||||
}
|
||||
},
|
||||
itemStyle: {
|
||||
normal: {
|
||||
borderColor: '#eee',
|
||||
areaColor: '#ddd'
|
||||
},
|
||||
emphasis: {
|
||||
areaColor: '#e6b600'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
gauge: {
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: [[0.2, '#2b821d'],[0.8, '#005eaa'],[1, '#c12e34']],
|
||||
width: 5
|
||||
}
|
||||
},
|
||||
axisTick: {
|
||||
splitNumber: 10,
|
||||
length:8,
|
||||
lineStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
textStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
splitLine: {
|
||||
length: 12,
|
||||
lineStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
},
|
||||
pointer: {
|
||||
length: '90%',
|
||||
width: 3,
|
||||
color: 'auto'
|
||||
},
|
||||
title: {
|
||||
textStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
textStyle: {
|
||||
color: 'auto'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
echarts.registerTheme('shine', theme);
|
||||
}));
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
title: {
|
||||
text: 'Area Chart',
|
||||
left: 'center',
|
||||
top: '3%',
|
||||
textStyle: {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '12%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday']
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
splitNumber: 3
|
||||
},
|
||||
dataZoom: {
|
||||
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name:'Email',
|
||||
type:'line',
|
||||
stack: '总量',
|
||||
areaStyle: {normal: {}},
|
||||
data:[120, 132, 101, 134, 90, 230, 210]
|
||||
},
|
||||
{
|
||||
name:'联盟广告',
|
||||
type:'line',
|
||||
stack: '总量',
|
||||
areaStyle: {normal: {}},
|
||||
data:[220, 182, 191, 234, 290, 330, 310]
|
||||
},
|
||||
{
|
||||
name:'视频广告',
|
||||
type:'line',
|
||||
stack: '总量',
|
||||
areaStyle: {normal: {}},
|
||||
data:[150, 232, 201, 154, 190, 330, 410]
|
||||
},
|
||||
{
|
||||
name:'直接访问',
|
||||
type:'line',
|
||||
stack: '总量',
|
||||
areaStyle: {normal: {}},
|
||||
data:[320, 332, 301, 334, 390, 330, 320]
|
||||
},
|
||||
{
|
||||
name:'搜索引擎',
|
||||
type:'line',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'top'
|
||||
}
|
||||
},
|
||||
areaStyle: {normal: {}},
|
||||
data:[820, 932, 901, 934, 1290, 1330, 1320]
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
title: {
|
||||
text: 'Bar Chart',
|
||||
left: 'center',
|
||||
top: '3%',
|
||||
textStyle: {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
toolbox: {
|
||||
top: '3%',
|
||||
feature: {
|
||||
magicType: {
|
||||
type: ['line', 'bar', 'stack', 'tiled']
|
||||
},
|
||||
restore: {},
|
||||
dataZoom: {},
|
||||
saveAsImage: {}
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: '13%',
|
||||
right: '5%',
|
||||
bottom: '5%',
|
||||
textStyle: {
|
||||
fontWeight: 'normal'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday','Sunday']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name:'直接访问',
|
||||
type:'bar',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'insideRight'
|
||||
}
|
||||
},
|
||||
data:[320, 302, 301, 334, 390, 330, 320]
|
||||
},
|
||||
{
|
||||
name:'邮件营销',
|
||||
type:'bar',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'insideRight'
|
||||
}
|
||||
},
|
||||
data:[120, 132, 101, 134, 90, 230, 210]
|
||||
},
|
||||
{
|
||||
name:'联盟广告',
|
||||
type:'bar',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'insideRight'
|
||||
}
|
||||
},
|
||||
data:[220, 182, 191, 234, 290, 330, 310]
|
||||
},
|
||||
{
|
||||
name:'视频广告',
|
||||
type:'bar',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'insideRight'
|
||||
}
|
||||
},
|
||||
data:[150, 212, 201, 154, 190, 330, 410]
|
||||
},
|
||||
{
|
||||
name:'搜索引擎',
|
||||
type:'bar',
|
||||
stack: '总量',
|
||||
label: {
|
||||
normal: {
|
||||
show: true,
|
||||
position: 'insideRight'
|
||||
}
|
||||
},
|
||||
data:[820, 832, 901, 934, 1290, 1330, 1320]
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
visualMap: {
|
||||
show: true,
|
||||
min: 0,
|
||||
max: 1500,
|
||||
right: 50,
|
||||
top: 'middle',
|
||||
text:['高','低']
|
||||
// orient: 'horizontal'
|
||||
},
|
||||
selectedMode: 'single',
|
||||
series : [
|
||||
{
|
||||
name: 'iphone3',
|
||||
type: 'map',
|
||||
map: 'china',
|
||||
showLegendSymbol: true,
|
||||
label: {
|
||||
normal: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{name: '北京',value: 500},
|
||||
{name: '天津',value: 500},
|
||||
{name: '上海',value: 500},
|
||||
{name: '重庆',value: 500},
|
||||
{name: '河北',value: 500},
|
||||
{name: '河南',value: 500},
|
||||
{name: '云南',value: 500},
|
||||
{name: '辽宁',value: 500},
|
||||
{name: '黑龙江',value: 500},
|
||||
{name: '湖南',value: 500},
|
||||
{name: '安徽',value: 500},
|
||||
{name: '山东',value: 500},
|
||||
{name: '新疆',value: 500},
|
||||
{name: '江苏',value: 500},
|
||||
{name: '浙江',value: 500},
|
||||
{name: '江西',value: 500},
|
||||
{name: '湖北',value: 500},
|
||||
{name: '广西',value: 500},
|
||||
{name: '甘肃',value: 500},
|
||||
{name: '山西',value: 500},
|
||||
{name: '内蒙古',value: 500},
|
||||
{name: '陕西',value: 500},
|
||||
{name: '吉林',value: 500},
|
||||
{name: '福建',value: 500},
|
||||
{name: '贵州',value: 500},
|
||||
{name: '广东',value: 500},
|
||||
{name: '青海',value: 500},
|
||||
{name: '西藏',value: 500},
|
||||
{name: '四川',value: 500},
|
||||
{name: '宁夏',value: 500},
|
||||
{name: '海南',value: 500},
|
||||
{name: '台湾',value: 500},
|
||||
{name: '香港',value: 500},
|
||||
{name: '澳门',value: 500}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'iphone4',
|
||||
type: 'map',
|
||||
mapType: 'china',
|
||||
showLegendSymbol: true,
|
||||
label: {
|
||||
normal: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{name: '北京',value: 500},
|
||||
{name: '天津',value: 500},
|
||||
{name: '上海',value: 500},
|
||||
{name: '重庆',value: 500},
|
||||
{name: '河北',value: 500},
|
||||
{name: '安徽',value: 500},
|
||||
{name: '新疆',value: 500},
|
||||
{name: '浙江',value: 500},
|
||||
{name: '江西',value: 500},
|
||||
{name: '山西',value: 500},
|
||||
{name: '内蒙古',value: 500},
|
||||
{name: '吉林',value: 500},
|
||||
{name: '福建',value: 500},
|
||||
{name: '广东',value: 500},
|
||||
{name: '西藏',value: 500},
|
||||
{name: '四川',value: 500},
|
||||
{name: '宁夏',value: 500},
|
||||
{name: '香港',value: 500},
|
||||
{name: '澳门',value: 500}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'iphone5',
|
||||
type: 'map',
|
||||
mapType: 'china',
|
||||
showLegendSymbol: true,
|
||||
label: {
|
||||
normal: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{name: '北京',value: 500},
|
||||
{name: '天津',value: 500},
|
||||
{name: '上海',value: 500},
|
||||
{name: '广东',value: 500},
|
||||
{name: '台湾',value: 500},
|
||||
{name: '香港',value: 500},
|
||||
{name: '澳门',value: 500}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
legend: {
|
||||
bottom: '5%',
|
||||
data: ['rose1', 'rose2', 'rose3', 'rose4']
|
||||
},
|
||||
series : [
|
||||
{
|
||||
name:'半径模式',
|
||||
type:'pie',
|
||||
radius : [20, 80],
|
||||
center : ['25%', 110],
|
||||
label: {
|
||||
normal: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
lableLine: {
|
||||
normal: {
|
||||
show: false
|
||||
},
|
||||
emphasis: {
|
||||
show: true
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{value:10, name:'rose1'},
|
||||
{value:5, name:'rose2'},
|
||||
{value:15, name:'rose3'},
|
||||
{value:25, name:'rose4'},
|
||||
{value:20, name:'rose5'},
|
||||
{value:35, name:'rose6'},
|
||||
{value:30, name:'rose7'},
|
||||
{value:40, name:'rose8'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name:'面积模式',
|
||||
type:'pie',
|
||||
radius : [30, 80],
|
||||
center : ['75%', 110],
|
||||
roseType : 'area',
|
||||
labelLine: {
|
||||
normal: {
|
||||
length: 5
|
||||
}
|
||||
},
|
||||
data:[
|
||||
{value:10, name:'rose1'},
|
||||
{value:5, name:'rose2'},
|
||||
{value:15, name:'rose3'},
|
||||
{value:25, name:'rose4'},
|
||||
{value:20, name:'rose5'},
|
||||
{value:35, name:'rose6'},
|
||||
{value:30, name:'rose7'},
|
||||
{value:40, name:'rose8'}
|
||||
]
|
||||
},
|
||||
{
|
||||
name:'仪表盘',
|
||||
type:'gauge',
|
||||
radius : 100,
|
||||
center : ['50%', 280],
|
||||
detail : {formatter:'{value}%'},
|
||||
data:[
|
||||
{value:50, name:'Gauge'}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
timeline: {
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
data: [
|
||||
'2002-01-01','2003-01-01','2004-01-01',
|
||||
{
|
||||
value: '2005-01-01',
|
||||
symbol: 'diamond',
|
||||
symbolSize: 16
|
||||
},
|
||||
'2006-01-01', '2007-01-01','2008-01-01','2009-01-01','2010-01-01',
|
||||
{
|
||||
value: '2011-01-01',
|
||||
symbol: 'diamond',
|
||||
symbolSize: 18
|
||||
}
|
||||
],
|
||||
label: {
|
||||
formatter : function(s) {
|
||||
return (new Date(s)).getFullYear();
|
||||
}
|
||||
}
|
||||
},
|
||||
options: [{
|
||||
grid: {
|
||||
left: '13%',
|
||||
right: '5%',
|
||||
bottom: '20%'
|
||||
},
|
||||
xAxis: {
|
||||
type : 'value',
|
||||
scale:true,
|
||||
axisLabel : {
|
||||
formatter: '{value} cm'
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
type : 'value',
|
||||
scale:true,
|
||||
axisLabel : {
|
||||
formatter: '{value} kg'
|
||||
}
|
||||
},
|
||||
series : [
|
||||
{
|
||||
name:'女性',
|
||||
type:'scatter',
|
||||
data: [[161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6],
|
||||
[170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2],
|
||||
[172.5, 55.2], [170.9, 54.2], [172.9, 62.5], [153.4, 42.0], [160.0, 50.0],
|
||||
[147.2, 49.8], [168.2, 49.2], [175.0, 73.2], [157.0, 47.8], [167.6, 68.8],
|
||||
[159.5, 50.6], [175.0, 82.5], [166.8, 57.2], [176.5, 87.8], [170.2, 72.8],
|
||||
[174.0, 54.5], [173.0, 59.8], [179.9, 67.3], [170.5, 67.8], [160.0, 47.0],
|
||||
[154.4, 46.2], [162.0, 55.0], [176.5, 83.0], [160.0, 54.4], [152.0, 45.8],
|
||||
[162.1, 53.6], [170.0, 73.2], [160.2, 52.1], [161.3, 67.9], [166.4, 56.6],
|
||||
[168.9, 62.3], [163.8, 58.5], [167.6, 54.5], [160.0, 50.2], [161.3, 60.3],
|
||||
[167.6, 58.3], [165.1, 56.2], [160.0, 50.2], [170.0, 72.9], [157.5, 59.8],
|
||||
[167.6, 61.0], [160.7, 69.1], [163.2, 55.9], [152.4, 46.5], [157.5, 54.3],
|
||||
[168.3, 54.8], [180.3, 60.7], [165.5, 60.0], [165.0, 62.0], [164.5, 60.3],
|
||||
[156.0, 52.7], [160.0, 74.3], [163.0, 62.0], [165.7, 73.1], [161.0, 80.0],
|
||||
[162.0, 54.7], [166.0, 53.2], [174.0, 75.7], [172.7, 61.1], [167.6, 55.7],
|
||||
[151.1, 48.7], [164.5, 52.3], [163.5, 50.0], [152.0, 59.3], [169.0, 62.5],
|
||||
[164.0, 55.7], [161.2, 54.8], [155.0, 45.9], [170.0, 70.6], [176.2, 67.2],
|
||||
[170.0, 69.4], [162.5, 58.2], [170.3, 64.8], [164.1, 71.6], [169.5, 52.8],
|
||||
[163.2, 59.8], [154.5, 49.0], [159.8, 50.0], [173.2, 69.2], [170.0, 55.9],
|
||||
[161.4, 63.4], [169.0, 58.2], [166.2, 58.6], [159.4, 45.7], [162.5, 52.2],
|
||||
[159.0, 48.6], [162.8, 57.8], [159.0, 55.6], [179.8, 66.8], [162.9, 59.4],
|
||||
[161.0, 53.6], [151.1, 73.2], [168.2, 53.4], [168.9, 69.0], [173.2, 58.4],
|
||||
[171.8, 56.2], [178.0, 70.6], [164.3, 59.8], [163.0, 72.0], [168.5, 65.2],
|
||||
[166.8, 56.6], [172.7, 105.2], [163.5, 51.8], [169.4, 63.4], [167.8, 59.0],
|
||||
[159.5, 47.6], [167.6, 63.0], [161.2, 55.2], [160.0, 45.0], [163.2, 54.0],
|
||||
[162.2, 50.2], [161.3, 60.2], [149.5, 44.8], [157.5, 58.8], [163.2, 56.4],
|
||||
[172.7, 62.0], [155.0, 49.2], [156.5, 67.2], [164.0, 53.8], [160.9, 54.4],
|
||||
[162.8, 58.0], [167.0, 59.8], [160.0, 54.8], [160.0, 43.2], [168.9, 60.5],
|
||||
[158.2, 46.4], [156.0, 64.4], [160.0, 48.8], [167.1, 62.2], [158.0, 55.5],
|
||||
[167.6, 57.8], [156.0, 54.6], [162.1, 59.2], [173.4, 52.7], [159.8, 53.2],
|
||||
[170.5, 64.5], [159.2, 51.8], [157.5, 56.0], [161.3, 63.6], [162.6, 63.2],
|
||||
[160.0, 59.5], [168.9, 56.8], [165.1, 64.1], [162.6, 50.0], [165.1, 72.3],
|
||||
[166.4, 55.0], [160.0, 55.9], [152.4, 60.4], [170.2, 69.1], [162.6, 84.5],
|
||||
[170.2, 55.9], [158.8, 55.5], [172.7, 69.5], [167.6, 76.4], [162.6, 61.4],
|
||||
[167.6, 65.9], [156.2, 58.6], [175.2, 66.8], [172.1, 56.6], [162.6, 58.6],
|
||||
[160.0, 55.9], [165.1, 59.1], [182.9, 81.8], [166.4, 70.7], [165.1, 56.8],
|
||||
[177.8, 60.0], [165.1, 58.2], [175.3, 72.7], [154.9, 54.1], [158.8, 49.1],
|
||||
[172.7, 75.9], [168.9, 55.0], [161.3, 57.3], [167.6, 55.0], [165.1, 65.5],
|
||||
[175.3, 65.5], [157.5, 48.6], [163.8, 58.6], [167.6, 63.6], [165.1, 55.2],
|
||||
[165.1, 62.7], [168.9, 56.6], [162.6, 53.9], [164.5, 63.2], [176.5, 73.6],
|
||||
[168.9, 62.0], [175.3, 63.6], [159.4, 53.2], [160.0, 53.4], [170.2, 55.0],
|
||||
[162.6, 70.5], [167.6, 54.5], [162.6, 54.5], [160.7, 55.9], [160.0, 59.0],
|
||||
[157.5, 63.6], [162.6, 54.5], [152.4, 47.3], [170.2, 67.7], [165.1, 80.9],
|
||||
[172.7, 70.5], [165.1, 60.9], [170.2, 63.6], [170.2, 54.5], [170.2, 59.1],
|
||||
[161.3, 70.5], [167.6, 52.7], [167.6, 62.7], [165.1, 86.3], [162.6, 66.4],
|
||||
[152.4, 67.3], [168.9, 63.0], [170.2, 73.6], [175.2, 62.3], [175.2, 57.7],
|
||||
[160.0, 55.4], [165.1, 104.1], [174.0, 55.5], [170.2, 77.3], [160.0, 80.5],
|
||||
[167.6, 64.5], [167.6, 72.3], [167.6, 61.4], [154.9, 58.2], [162.6, 81.8],
|
||||
[175.3, 63.6], [171.4, 53.4], [157.5, 54.5], [165.1, 53.6], [160.0, 60.0],
|
||||
[174.0, 73.6], [162.6, 61.4], [174.0, 55.5], [162.6, 63.6], [161.3, 60.9],
|
||||
[156.2, 60.0], [149.9, 46.8], [169.5, 57.3], [160.0, 64.1], [175.3, 63.6],
|
||||
[169.5, 67.3], [160.0, 75.5], [172.7, 68.2], [162.6, 61.4], [157.5, 76.8],
|
||||
[176.5, 71.8], [164.4, 55.5], [160.7, 48.6], [174.0, 66.4], [163.8, 67.3]
|
||||
],
|
||||
markPoint : {
|
||||
data : [
|
||||
{type : 'max', name: '最大值'},
|
||||
{type : 'min', name: '最小值'}
|
||||
]
|
||||
},
|
||||
markLine : {
|
||||
data : [
|
||||
{type : 'average', name: '平均值'}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
name:'男性',
|
||||
type:'scatter',
|
||||
data: [[174.0, 65.6], [175.3, 71.8], [193.5, 80.7], [186.5, 72.6], [187.2, 78.8],
|
||||
[181.5, 74.8], [184.0, 86.4], [184.5, 78.4], [175.0, 62.0], [184.0, 81.6],
|
||||
[180.0, 76.6], [177.8, 83.6], [192.0, 90.0], [176.0, 74.6], [174.0, 71.0],
|
||||
[184.0, 79.6], [192.7, 93.8], [171.5, 70.0], [173.0, 72.4], [176.0, 85.9],
|
||||
[176.0, 78.8], [180.5, 77.8], [172.7, 66.2], [176.0, 86.4], [173.5, 81.8],
|
||||
[178.0, 89.6], [180.3, 82.8], [180.3, 76.4], [164.5, 63.2], [173.0, 60.9],
|
||||
[183.5, 74.8], [175.5, 70.0], [188.0, 72.4], [189.2, 84.1], [172.8, 69.1],
|
||||
[170.0, 59.5], [182.0, 67.2], [170.0, 61.3], [177.8, 68.6], [184.2, 80.1],
|
||||
[186.7, 87.8], [171.4, 84.7], [172.7, 73.4], [175.3, 72.1], [180.3, 82.6],
|
||||
[182.9, 88.7], [188.0, 84.1], [177.2, 94.1], [172.1, 74.9], [167.0, 59.1],
|
||||
[169.5, 75.6], [174.0, 86.2], [172.7, 75.3], [182.2, 87.1], [164.1, 55.2],
|
||||
[163.0, 57.0], [171.5, 61.4], [184.2, 76.8], [174.0, 86.8], [174.0, 72.2],
|
||||
[177.0, 71.6], [186.0, 84.8], [167.0, 68.2], [171.8, 66.1], [182.0, 72.0],
|
||||
[167.0, 64.6], [177.8, 74.8], [164.5, 70.0], [192.0, 101.6], [175.5, 63.2],
|
||||
[171.2, 79.1], [181.6, 78.9], [167.4, 67.7], [181.1, 66.0], [177.0, 68.2],
|
||||
[174.5, 63.9], [177.5, 72.0], [170.5, 56.8], [182.4, 74.5], [197.1, 90.9],
|
||||
[180.1, 93.0], [175.5, 80.9], [180.6, 72.7], [184.4, 68.0], [175.5, 70.9],
|
||||
[180.6, 72.5], [177.0, 72.5], [177.1, 83.4], [181.6, 75.5], [176.5, 73.0],
|
||||
[175.0, 70.2], [174.0, 73.4], [165.1, 70.5], [177.0, 68.9], [192.0, 102.3],
|
||||
[176.5, 68.4], [169.4, 65.9], [182.1, 75.7], [179.8, 84.5], [175.3, 87.7],
|
||||
[184.9, 86.4], [177.3, 73.2], [167.4, 53.9], [178.1, 72.0], [168.9, 55.5],
|
||||
[157.2, 58.4], [180.3, 83.2], [170.2, 72.7], [177.8, 64.1], [172.7, 72.3],
|
||||
[165.1, 65.0], [186.7, 86.4], [165.1, 65.0], [174.0, 88.6], [175.3, 84.1],
|
||||
[185.4, 66.8], [177.8, 75.5], [180.3, 93.2], [180.3, 82.7], [177.8, 58.0],
|
||||
[177.8, 79.5], [177.8, 78.6], [177.8, 71.8], [177.8, 116.4], [163.8, 72.2],
|
||||
[188.0, 83.6], [198.1, 85.5], [175.3, 90.9], [166.4, 85.9], [190.5, 89.1],
|
||||
[166.4, 75.0], [177.8, 77.7], [179.7, 86.4], [172.7, 90.9], [190.5, 73.6],
|
||||
[185.4, 76.4], [168.9, 69.1], [167.6, 84.5], [175.3, 64.5], [170.2, 69.1],
|
||||
[190.5, 108.6], [177.8, 86.4], [190.5, 80.9], [177.8, 87.7], [184.2, 94.5],
|
||||
[176.5, 80.2], [177.8, 72.0], [180.3, 71.4], [171.4, 72.7], [172.7, 84.1],
|
||||
[172.7, 76.8], [177.8, 63.6], [177.8, 80.9], [182.9, 80.9], [170.2, 85.5],
|
||||
[167.6, 68.6], [175.3, 67.7], [165.1, 66.4], [185.4, 102.3], [181.6, 70.5],
|
||||
[172.7, 95.9], [190.5, 84.1], [179.1, 87.3], [175.3, 71.8], [170.2, 65.9],
|
||||
[193.0, 95.9], [171.4, 91.4], [177.8, 81.8], [177.8, 96.8], [167.6, 69.1],
|
||||
[167.6, 82.7], [180.3, 75.5], [182.9, 79.5], [176.5, 73.6], [186.7, 91.8],
|
||||
[188.0, 84.1], [188.0, 85.9], [177.8, 81.8], [174.0, 82.5], [177.8, 80.5],
|
||||
[171.4, 70.0], [185.4, 81.8], [185.4, 84.1], [188.0, 90.5], [188.0, 91.4],
|
||||
[182.9, 89.1], [176.5, 85.0], [175.3, 69.1], [175.3, 73.6], [188.0, 80.5],
|
||||
[188.0, 82.7], [175.3, 86.4], [170.5, 67.7], [179.1, 92.7], [177.8, 93.6],
|
||||
[175.3, 70.9], [182.9, 75.0], [170.8, 93.2], [188.0, 93.2], [180.3, 77.7],
|
||||
[177.8, 61.4], [185.4, 94.1], [168.9, 75.0], [185.4, 83.6], [180.3, 85.5],
|
||||
[174.0, 73.9], [167.6, 66.8], [182.9, 87.3], [160.0, 72.3], [180.3, 88.6],
|
||||
[167.6, 75.5], [186.7, 101.4], [175.3, 91.1], [175.3, 67.3], [175.9, 77.7],
|
||||
[175.3, 81.8], [179.1, 75.5], [181.6, 84.5], [177.8, 76.6], [182.9, 85.0],
|
||||
[177.8, 102.5], [184.2, 77.3], [179.1, 71.8], [176.5, 87.9], [188.0, 94.3],
|
||||
[174.0, 70.9], [167.6, 64.5], [170.2, 77.3], [167.6, 72.3], [188.0, 87.3],
|
||||
[174.0, 80.0], [176.5, 82.3], [180.3, 73.6], [167.6, 74.1], [188.0, 85.9],
|
||||
[180.3, 73.2], [167.6, 76.3], [183.0, 65.9], [183.0, 90.9], [179.1, 89.1],
|
||||
[170.2, 62.3], [177.8, 82.7], [179.1, 79.1], [190.5, 98.2], [177.8, 84.1],
|
||||
[180.3, 83.2], [180.3, 83.2]
|
||||
],
|
||||
markPoint : {
|
||||
data : [
|
||||
{type : 'max', name: '最大值'},
|
||||
{type : 'min', name: '最小值'}
|
||||
]
|
||||
},
|
||||
markLine : {
|
||||
data : [
|
||||
{type : 'average', name: '平均值'}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}]
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
var glob = require('glob');
|
||||
var Canvas = require('canvas');
|
||||
var echarts = require('echarts');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
require('echarts/map/js/china');
|
||||
|
||||
var options = {
|
||||
bar: require('./option/bar'),
|
||||
area: require('./option/area'),
|
||||
scatter: require('./option/scatter'),
|
||||
pie: require('./option/pie'),
|
||||
graph: require('./option/graph'),
|
||||
map: require('./option/map')
|
||||
};
|
||||
var WIDTH = 600;
|
||||
var HEIGHT = 400;
|
||||
echarts.setCanvasCreator(function () {
|
||||
return createCanvas();
|
||||
});
|
||||
|
||||
var font = new Canvas.Font('Helvetica', '/System/Library/Fonts/Helvetica.dfont');
|
||||
font.addFace('/System/Library/Fonts/Helvetica.dfont', 'bolder');
|
||||
|
||||
glob('../*.js', function (err, themePathList) {
|
||||
themePathList.forEach(function (themePath) {
|
||||
var themeName = path.basename(themePath, '.js');
|
||||
var canvasList = [];
|
||||
require(themePath);
|
||||
echarts.util.each(options, function (option) {
|
||||
var canvas = createCanvas();
|
||||
var chart = echarts.init(canvas, themeName);
|
||||
var optionNeedFix = option;
|
||||
if (option.options) {
|
||||
optionNeedFix = option.options[0];
|
||||
}
|
||||
canvasList.push(canvas);
|
||||
optionNeedFix.animation = false;
|
||||
optionNeedFix.textStyle = {
|
||||
fontFamily: 'Helvetica',
|
||||
fontSize: 12
|
||||
};
|
||||
chart.setOption(option);
|
||||
chart.dispose();
|
||||
});
|
||||
|
||||
var columnCount = 2;
|
||||
var outputCanvas = new Canvas(WIDTH * columnCount, HEIGHT * canvasList.length / columnCount);
|
||||
var outputCtx = outputCanvas.getContext('2d');
|
||||
canvasList.forEach(function (canvas, idx) {
|
||||
outputCtx.drawImage(canvas, idx % columnCount * WIDTH, Math.floor(idx / columnCount) * HEIGHT, WIDTH, HEIGHT);
|
||||
});
|
||||
|
||||
fs.writeFileSync('../thumb/' + themeName + '.png', outputCanvas.toBuffer());
|
||||
});
|
||||
});
|
||||
function createCanvas() {
|
||||
var canvas = new Canvas(WIDTH, HEIGHT);
|
||||
var ctx = canvas.getContext('2d');
|
||||
ctx.addFont(font);
|
||||
return canvas;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['exports', 'echarts'], factory);
|
||||
} else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {
|
||||
// CommonJS
|
||||
factory(exports, require('echarts'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory({}, root.echarts);
|
||||
}
|
||||
}(this, function (exports, echarts) {
|
||||
var log = function (msg) {
|
||||
if (typeof console !== 'undefined') {
|
||||
console && console.error && console.error(msg);
|
||||
}
|
||||
};
|
||||
if (!echarts) {
|
||||
log('ECharts is not Loaded');
|
||||
return;
|
||||
}
|
||||
var colorPalette = ['#d87c7c','#919e8b', '#d7ab82', '#6e7074','#61a0a8','#efa18d', '#787464', '#cc7e63', '#724e58', '#4b565b'];
|
||||
echarts.registerTheme('vintage', {
|
||||
color: colorPalette,
|
||||
backgroundColor: '#fef8ef',
|
||||
graph: {
|
||||
color: colorPalette
|
||||
}
|
||||
});
|
||||
}));
|
||||
@@ -0,0 +1,121 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ueditor图片对话框</title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
|
||||
<!-- jquery -->
|
||||
<script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
|
||||
|
||||
<!-- webuploader -->
|
||||
<script src="../../third-party/webuploader/webuploader.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
|
||||
|
||||
<!-- image dialog -->
|
||||
<link rel="stylesheet" href="image.css" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="wrapper">
|
||||
<div id="tabhead" class="tabhead">
|
||||
<!--xlz去掉线上上传图片的功能-->
|
||||
<!-- <span class="tab" data-content-id="remote"><var id="lang_tab_remote"></var></span>-->
|
||||
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
|
||||
<!--<span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
|
||||
<span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span>-->
|
||||
</div>
|
||||
<div class="alignBar">
|
||||
<label class="algnLabel"><var id="lang_input_align"></var></label>
|
||||
<span id="alignIcon">
|
||||
<span id="noneAlign" class="none-align focus" data-align="none"></span>
|
||||
<span id="leftAlign" class="left-align" data-align="left"></span>
|
||||
<span id="rightAlign" class="right-align" data-align="right"></span>
|
||||
<span id="centerAlign" class="center-align" data-align="center"></span>
|
||||
</span>
|
||||
<input id="align" name="align" type="hidden" value="none"/>
|
||||
</div>
|
||||
<div id="tabbody" class="tabbody">
|
||||
|
||||
<!-- 远程图片 -->
|
||||
<div id="remote" class="panel">
|
||||
<div class="top">
|
||||
<div class="row">
|
||||
<label for="url"><var id="lang_input_url"></var></label>
|
||||
<span><input class="text" id="url" type="text"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="left">
|
||||
<div class="row">
|
||||
<label><var id="lang_input_size"></var></label>
|
||||
<span><var id="lang_input_width"> </var><input class="text" type="text" id="width"/>px </span>
|
||||
<span><var id="lang_input_height"> </var><input class="text" type="text" id="height"/>px </span>
|
||||
<span><input id="lock" type="checkbox" disabled="disabled"><span id="lockicon"></span></span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_border"></var></label>
|
||||
<span><input class="text" type="text" id="border"/>px </span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_vhspace"></var></label>
|
||||
<span><input class="text" type="text" id="vhSpace"/>px </span>
|
||||
</div>
|
||||
<div class="row">
|
||||
<label><var id="lang_input_title"></var></label>
|
||||
<span><input class="text" type="text" id="title"/></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right"><div id="preview"></div></div>
|
||||
</div>
|
||||
|
||||
<!-- 上传图片 -->
|
||||
<div id="upload" class="panel focus">
|
||||
<div id="queueList" class="queueList">
|
||||
<div class="statusBar element-invisible">
|
||||
<div class="progress">
|
||||
<span class="text">0%</span>
|
||||
<span class="percentage"></span>
|
||||
</div><div class="info"></div>
|
||||
<div class="btns">
|
||||
<div id="filePickerBtn"></div>
|
||||
<div class="uploadBtn"><var id="lang_start_upload"></var></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="dndArea" class="placeholder">
|
||||
<div class="filePickerContainer">
|
||||
<div id="filePickerReady"></div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="filelist element-invisible">
|
||||
<li id="filePickerBlock" class="filePickerBlock"></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 在线图片 -->
|
||||
<div id="online" class="panel">
|
||||
<div id="imageList"><var id="lang_imgLoading"></var></div>
|
||||
</div>
|
||||
|
||||
<!-- 搜索图片 -->
|
||||
<div id="search" class="panel">
|
||||
<div class="searchBar">
|
||||
<input id="searchTxt" class="searchTxt text" type="text" />
|
||||
<select id="searchType" class="searchType">
|
||||
<option value="&s=4&z=0"></option>
|
||||
<option value="&s=1&z=19"></option>
|
||||
<option value="&s=2&z=0"></option>
|
||||
<option value="&s=3&z=0"></option>
|
||||
</select>
|
||||
<input id="searchReset" type="button" />
|
||||
<input id="searchBtn" type="button" />
|
||||
</div>
|
||||
<div id="searchList" class="searchList"><ul id="searchListUl"></ul></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="image.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 453 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 445 B |
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1 @@
|
||||
!function(){var e=window.parent;dialog=e.$EDITORUI[window.frameElement.id.replace(/_iframe$/,"")],editor=dialog.editor,UE=e.UE,domUtils=UE.dom.domUtils,utils=UE.utils,browser=UE.browser,ajax=UE.ajax,$G=function(e){return document.getElementById(e)},$focus=function(t){setTimeout(function(){if(browser.ie){var e=t.createTextRange();e.collapse(!1),e.select()}else t.focus()},0)},utils.loadFile(document,{href:"../themes/default/dialogbase.css?cache="+Math.random(),tag:"link",type:"text/css"}),lang=editor.getLang(dialog.className.split("-")[2]),lang&&domUtils.on(window,"load",function(){var e=editor.options.langPath+editor.options.lang+"/images/";for(var t in lang.static){var a=$G(t);if(a){var o=a.tagName,i=lang.static[t];switch(i.src&&((i=utils.extend({},i,!1)).src=e+i.src),i.style&&((i=utils.extend({},i,!1)).style=i.style.replace(/url\s*\(/g,"url("+e)),o.toLowerCase()){case"var":a.parentNode.replaceChild(document.createTextNode(i),a);break;case"select":for(var s,r=a.options,l=0;s=r[l];)s.innerHTML=i.options[l++];for(var n in i)"options"!=n&&a.setAttribute(n,i[n]);break;default:domUtils.setAttributes(a,i)}}}})}();
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<style>
|
||||
html,body{
|
||||
height:100%;
|
||||
width:100%;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#preview{
|
||||
width:100%;
|
||||
height:100%;
|
||||
padding:0;
|
||||
margin:0;
|
||||
}
|
||||
#preview *{font-family:sans-serif;font-size:16px;}
|
||||
</style>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<script src="../../ueditor.parse.min.js"></script>
|
||||
<title></title>
|
||||
</head>
|
||||
<body class="view">
|
||||
<div id="preview" style="margin:8px">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
document.getElementById('preview').innerHTML = editor.getContent();
|
||||
uParse('#preview',{
|
||||
rootPath : '../../',
|
||||
chartContainerHeight:500
|
||||
})
|
||||
dialog.oncancel = function(){
|
||||
document.getElementById('preview').innerHTML = '';
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 304 B |
@@ -0,0 +1 @@
|
||||
body{overflow:hidden;width:540px}.wrapper{margin:10px auto 0;font-size:12px;overflow:hidden;width:520px;height:315px}.clear{clear:both}.wrapper .left{float:left;margin-left:10px}.wrapper .right{float:right;border-left:2px dotted #ededed;padding-left:15px}.section{margin-bottom:15px;width:240px;overflow:hidden}.section h3{font-weight:bold;padding:5px 0;margin-bottom:10px;border-bottom:1px solid #ededed;font-size:12px}.section ul{list-style:none;overflow:hidden;clear:both}.section li{float:left;width:120px}.section .tone{width:80px}.section .preview{width:220px}.section .preview table{text-align:center;vertical-align:middle;color:#666}.section .preview caption{font-weight:bold}.section .preview td{border-width:1px;border-style:solid;height:22px}.section .preview th{border-style:solid;border-color:#DDD;border-width:2px 1px 1px 1px;height:22px;background-color:#f7f7f7}
|
||||
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="edittable.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<div class="left">
|
||||
<div class="section">
|
||||
<h3><var id="lang_tableStyle"></var></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<label onselectstart="return false"><input type="checkbox" id="J_title" name="style"/><var id="lang_insertTitle"></var></label>
|
||||
</li>
|
||||
<li>
|
||||
<label onselectstart="return false"><input type="checkbox" id="J_titleCol" name="style"/><var id="lang_insertTitleCol"></var></label>
|
||||
</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li>
|
||||
<label onselectstart="return false"><input type="checkbox" id="J_caption" name="style"/><var id="lang_insertCaption"></var></label>
|
||||
</li>
|
||||
<li>
|
||||
<label onselectstart="return false"><input type="checkbox" id="J_sorttable" name="style"/><var id="lang_orderbycontent"></var></label>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h3><var id="lang_tableSize"></var></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<label><input type="radio" id="J_autoSizeContent" name="size"/><var id="lang_autoSizeContent"></var></label>
|
||||
</li>
|
||||
<li>
|
||||
<label><input type="radio" id="J_autoSizePage" name="size"/><var id="lang_autoSizePage"></var></label>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="section">
|
||||
<h3><var id="lang_borderStyle"></var></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<span><var id="lang_color"></var></span>
|
||||
<input type="text" class="tone" id="J_tone" readonly='readonly' />
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="section">
|
||||
<h3><var id="lang_example"></var></h3>
|
||||
<div class="preview" id="J_preview">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript" src="edittable.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
!function(){function e(){(r=this).init()}var r,l=$G("J_title"),d=$G("J_titleCol"),i=$G("J_caption"),a=$G("J_sorttable"),c=$G("J_autoSizeContent"),m=$G("J_autoSizePage"),s=$G("J_tone"),u=$G("J_preview");e.prototype={init:function(){var e=new UE.ui.ColorPicker({editor:editor}),t=new UE.ui.Popup({editor:editor,content:e});l.checked=-1==editor.queryCommandState("inserttitle"),d.checked=-1==editor.queryCommandState("inserttitlecol"),i.checked=-1==editor.queryCommandState("insertcaption"),a.checked=1==editor.queryCommandState("enablesort");var o=editor.queryCommandState("enablesort"),n=editor.queryCommandState("disablesort");a.checked=!!(o<0&&0<=n),a.disabled=!!(o<0&&n<0),a.title=o<0&&n<0?lang.errorMsg:"",r.createTable(l.checked,d.checked,i.checked),r.setAutoSize(),r.setColor(r.getColor()),domUtils.on(l,"click",r.titleHanler),domUtils.on(d,"click",r.titleColHanler),domUtils.on(i,"click",r.captionHanler),domUtils.on(a,"click",r.sorttableHanler),domUtils.on(c,"click",r.autoSizeContentHanler),domUtils.on(m,"click",r.autoSizePageHanler),domUtils.on(s,"click",function(){t.showAnchor(s)}),domUtils.on(document,"mousedown",function(){t.hide()}),e.addListener("pickcolor",function(){r.setColor(arguments[1]),t.hide()}),e.addListener("picknocolor",function(){r.setColor(""),t.hide()})},createTable:function(e,t,o){var n=[];if(n.push("<table id='J_example'>"),o&&n.push("<caption>"+lang.captionName+"</caption>"),e){n.push("<tr>"),t&&n.push("<th>"+lang.titleName+"</th>");for(var i=0;i<5;i++)n.push("<th>"+lang.titleName+"</th>");n.push("</tr>")}for(var a=0;a<6;a++){n.push("<tr>"),t&&n.push("<th>"+lang.titleName+"</th>");for(var r=0;r<5;r++)n.push("<td>"+lang.cellsName+"</td>");n.push("</tr>")}n.push("</table>"),u.innerHTML=n.join(""),this.updateSortSpan()},titleHanler:function(){var e=$G("J_example"),t=document.createDocumentFragment(),o=domUtils.getComputedStyle(domUtils.getElementsByTagName(e,"td")[0],"border-color"),n=e.rows[0].children.length;if(l.checked){e.insertRow(0);for(var i,a=0;a<n;a++)(i=document.createElement("th")).innerHTML=lang.titleName,t.appendChild(i);e.rows[0].appendChild(t)}else domUtils.remove(e.rows[0]);r.setColor(o),r.updateSortSpan()},titleColHanler:function(){var e=$G("J_example"),t=domUtils.getComputedStyle(domUtils.getElementsByTagName(e,"td")[0],"border-color"),o=e.rows,n=o.length;if(d.checked)for(var i,a=0;a<n;a++)(i=document.createElement("th")).innerHTML=lang.titleName,o[a].insertBefore(i,o[a].children[0]);else for(a=0;a<n;a++)domUtils.remove(o[a].children[0]);r.setColor(t),r.updateSortSpan()},captionHanler:function(){var e=$G("J_example");if(i.checked){var t=document.createElement("caption");t.innerHTML=lang.captionName,e.insertBefore(t,e.firstChild)}else domUtils.remove(domUtils.getElementsByTagName(e,"caption")[0])},sorttableHanler:function(){r.updateSortSpan()},autoSizeContentHanler:function(){$G("J_example").removeAttribute("width")},autoSizePageHanler:function(){var e=$G("J_example"),t=e.getElementsByTagName(e,"td");utils.each(t,function(e){e.removeAttribute("width")}),e.setAttribute("width","100%")},updateSortSpan:function(){var e=$G("J_example"),t=e.rows[0],o=domUtils.getElementsByTagName(e,"span");utils.each(o,function(e){e.parentNode.removeChild(e)}),a.checked&&utils.each(t.cells,function(e,t){var o=document.createElement("span");o.innerHTML="^",e.appendChild(o)})},getColor:function(){var e=editor.selection.getStart(),t=domUtils.findParentByTagName(e,["td","th","caption"],!0);return t&&domUtils.getComputedStyle(t,"border-color")||"#DDDDDD"},setColor:function(t){var e=$G("J_example"),o=domUtils.getElementsByTagName(e,"td").concat(domUtils.getElementsByTagName(e,"th"),domUtils.getElementsByTagName(e,"caption"));s.value=t,utils.each(o,function(e){e.style.borderColor=t})},setAutoSize:function(){m.checked=!0,this.autoSizePageHanler()}},new e,dialog.onok=function(){editor.__hasEnterExecCommand=!0;var e={title:"inserttitle deletetitle",titleCol:"inserttitlecol deletetitlecol",caption:"insertcaption deletecaption",sorttable:"enablesort disablesort"};for(var t in editor.fireEvent("saveScene"),e){var o=e[t].split(" ");$G("J_"+t).checked?-1!=editor.queryCommandState(o[0])&&editor.execCommand(o[0]):-1!=editor.queryCommandState(o[1])&&editor.execCommand(o[1])}editor.execCommand("edittable",s.value),c.checked&&editor.execCommand("adaptbytext"),m.checked&&editor.execCommand("adaptbywindow"),editor.fireEvent("saveScene"),editor.__hasEnterExecCommand=!1}}();
|
||||
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<style type="text/css">
|
||||
.section {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.section input {
|
||||
margin-left: 5px;
|
||||
width: 70px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="section">
|
||||
<span><var id="lang_tdBkColor"></var></span>
|
||||
<input type="text" id="J_tone"/>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var tone = $G("J_tone"),
|
||||
colorPiker = new UE.ui.ColorPicker({
|
||||
editor:editor
|
||||
}),
|
||||
colorPop = new UE.ui.Popup({
|
||||
editor:editor,
|
||||
content:colorPiker
|
||||
});
|
||||
domUtils.on(tone, "click", function () {
|
||||
colorPop.showAnchor(tone);
|
||||
});
|
||||
domUtils.on(document, 'mousedown', function () {
|
||||
colorPop.hide();
|
||||
});
|
||||
colorPiker.addListener("pickcolor", function () {
|
||||
tone.value = arguments[1];
|
||||
colorPop.hide();
|
||||
});
|
||||
colorPiker.addListener("picknocolor", function () {
|
||||
tone.value="";
|
||||
colorPop.hide();
|
||||
});
|
||||
dialog.onok=function(){
|
||||
editor.execCommand("edittd",tone.value);
|
||||
};
|
||||
|
||||
var start = editor.selection.getStart(),
|
||||
cell = start && domUtils.findParentByTagName(start, ["td", "th"], true);
|
||||
if(cell){
|
||||
var color = domUtils.getComputedStyle(cell,'background-color');
|
||||
if(/^#/.test(color)){
|
||||
tone.value = color
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,33 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>表格删除提示</title>
|
||||
<script type="text/javascript" src="../internal.js"></script>
|
||||
<style type="text/css">
|
||||
.section {
|
||||
width: 200px;
|
||||
margin: 10px auto 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="section">
|
||||
<div class="item">
|
||||
<label><input type="radio" id="J_delRow" name="cmd" checked/><var id="lang_delRow"></var></label>
|
||||
</div>
|
||||
<div class="item">
|
||||
<label><input type="radio" id="J_delCol" name="cmd"/><var id="lang_delCol"></var></label>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
dialog.onok = function () {
|
||||
$G("J_delRow").checked ? editor.execCommand("deleterow") : editor.execCommand("deletecol");
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
UE.registerUI("kityformula",function(t,n){var e=new UE.ui.Dialog({iframeUrl:t.options.UEDITOR_HOME_URL+"kityformula-plugin/kityFormulaDialog.html",editor:t,name:n,title:"插入公式 ",cssRules:"width:783px; height: 386px;",buttons:[{className:"edui-okbutton",label:"确定",onclick:function(){e.close(!0)}},{className:"edui-cancelbutton",label:"取消",onclick:function(){e.close(!1)}}]});t.ready(function(){UE.utils.cssRule("kfformula","img.kfformula{vertical-align: middle;}",t.document)});var i=t.options.UEDITOR_HOME_URL+"kityformula-plugin/kf-icon.png",l=document.createElement("a");l.href=i,l.href=l.href,i=l.href;var o=new UE.ui.Button({name:"插入"+n,title:"插入公式",cssRules:'background: url("'+i+'") !important',onclick:function(){e.render(),e.open()}});return t.addListener("selectionchange",function(){var e=t.queryCommandState(n);-1==e?(o.setDisabled(!0),o.setChecked(!1)):(o.setDisabled(!1),o.setChecked(e))}),o});
|
||||
@@ -0,0 +1 @@
|
||||
UE.plugins.defaultfilter=function(){var n=this;n.setOpt({allowDivTransToP:!0,disabledTableInTable:!0,rgb2Hex:!0}),n.addInputRule(function(e){var s,d=this.options.allowDivTransToP;e.traversal(function(i){if("element"==i.type){if(!UE.dom.dtd.$cdata[i.tagName]&&n.options.autoClearEmptyNode&&UE.dom.dtd.$inline[i.tagName]&&!UE.dom.dtd.$empty[i.tagName]&&(!i.attrs||UE.utils.isEmptyObject(i.attrs)))return void(i.firstChild()?"span"!=i.tagName||i.attrs&&!UE.utils.isEmptyObject(i.attrs)||i.parentNode.removeChild(i,!0):i.parentNode.removeChild(i));switch(i.tagName){case"style":case"script":i.setAttr({cdata_tag:i.tagName,cdata_data:i.innerHTML()||"",_ue_custom_node_:"true"}),i.tagName="div",i.innerHTML("");break;case"a":(s=i.getAttr("href"))&&i.setAttr("_href",s);break;case"img":i.setAttr("_src",i.getAttr("src"));break;case"span":UE.browser.webkit&&(s=i.getStyle("white-space"))&&/nowrap|normal/.test(s)&&(i.setStyle("white-space",""),n.options.autoClearEmptyNode&&UE.utils.isEmptyObject(i.attrs)&&i.parentNode.removeChild(i,!0)),(s=i.getAttr("id"))&&/^_baidu_bookmark_/i.test(s)&&i.parentNode.removeChild(i);break;case"p":(s=i.getAttr("align"))&&(i.setAttr("align"),i.setStyle("text-align",s)),UE.utils.each(i.children,function(e){if("element"==e.type&&"p"==e.tagName){var t=e.nextSibling();i.parentNode.insertAfter(e,i);for(var a=e;t;){var r=t.nextSibling();i.parentNode.insertAfter(t,a),a=t,t=r}return!1}}),i.firstChild()||i.innerHTML(UE.browser.ie?" ":"<br/>");break;case"div":if(i.getAttr("cdata_tag"))break;if((s=i.getAttr("class"))&&/^line number\d+/.test(s))break;if(!d)break;for(var e,t=UE.uNode.createElement("p");e=i.firstChild();)"text"!=e.type&&UE.dom.UE.dom.dtd.$block[e.tagName]?t.firstChild()?(i.parentNode.insertBefore(t,i),t=UE.uNode.createElement("p")):i.parentNode.insertBefore(e,i):t.appendChild(e);t.firstChild()&&i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i);break;case"dl":i.tagName="ul";break;case"dt":case"dd":i.tagName="li";break;case"li":var a=i.getAttr("class");a&&/list\-/.test(a)||i.setAttr();var r=i.getNodesByTagName("ol ul");UE.utils.each(r,function(e){i.parentNode.insertAfter(e,i)});break;case"td":case"th":case"caption":i.children&&i.children.length||i.appendChild(UE.browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":n.options.disabledTableInTable&&function(e){for(;e&&"element"==e.type;){if("td"==e.tagName)return 1;e=e.parentNode}}(i)&&(i.parentNode.insertBefore(UE.uNode.createText(i.innerText()),i),i.parentNode.removeChild(i))}}})}),n.addOutputRule(function(e){var a;e.traversal(function(e){if("element"==e.type){if(n.options.autoClearEmptyNode&&UE.dom.dtd.$inline[e.tagName]&&!UE.dom.dtd.$empty[e.tagName]&&(!e.attrs||UE.utils.isEmptyObject(e.attrs)))return void(e.firstChild()?"span"!=e.tagName||e.attrs&&!UE.utils.isEmptyObject(e.attrs)||e.parentNode.removeChild(e,!0):e.parentNode.removeChild(e));switch(e.tagName){case"div":(a=e.getAttr("cdata_tag"))&&(e.tagName=a,e.appendChild(UE.uNode.createText(e.getAttr("cdata_data"))),e.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(a=e.getAttr("_href"))&&e.setAttr({href:UE.utils.html(a),_href:""});break;case"span":if((a=e.getAttr("id"))&&/^_baidu_bookmark_/i.test(a)&&e.parentNode.removeChild(e),n.getOpt("rgb2Hex")){var t=e.getAttr("style");t&&e.setAttr("style",t.replace(/rgba?\(([\d,\s]+)\)/g,function(e,t){var a=t.split(",");if(3<a.length)return"";t="#";for(var r,i=0;r=a[i++];)t+=1==(r=parseInt(r.replace(/[^\d]/gi,""),10).toString(16)).length?"0"+r:r;return t.toUpperCase()}))}break;case"img":(a=e.getAttr("_src"))&&e.setAttr({src:e.getAttr("_src"),_src:""})}}})})};
|
||||
@@ -0,0 +1 @@
|
||||
UE.Editor.prototype.getKfContent=function(t){var s=this,e=s.getActionUrl(s.getOpt("scrawlActionName")),r=UE.utils.serializeParam(s.queryCommandValue("serverparam"))||"",a=UE.utils.formatUrl(e+(-1==e.indexOf("?")?"?":"&")+r),i=0,n=s.body.getElementsByTagName("img"),o=[];function c(){i>=o.length&&(s.sync(),t(s.getContent()))}UE.utils.each(n,function(t){"data:image/png"===t.getAttribute("src").match(/^[^;]+/)[0]&&o.push(t)}),0==o.length?c():UE.utils.each(o,function(n){var t={};t[s.getOpt("scrawlFieldName")]=n.getAttribute("src").replace(/^[^,]+,/,""),t.onsuccess=function(t){var e=UE.utils.str2json(t.responseText),r=s.options.scrawlUrlPrefix+e.url;n.setAttribute("src",r),n.setAttribute("_src",r),i++,c()},t.onerror=function(t){console.error(t),i++,c()},UE.ajax.request(a,t)})};
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/base.css">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/ui.css">
|
||||
<link rel="stylesheet" href="kityformula/assets/styles/scrollbar.css">
|
||||
<style>
|
||||
html, body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.kf-editor {
|
||||
width: 780px;
|
||||
height: 380px;
|
||||
}
|
||||
#loading {
|
||||
height: 32px;
|
||||
width: 340px;
|
||||
line-height: 32px;
|
||||
position: absolute;
|
||||
top: 42%;
|
||||
left: 50%;
|
||||
margin-left: -170px;
|
||||
font-family: arial, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
||||
}
|
||||
#loading img {
|
||||
position: absolute;
|
||||
}
|
||||
#loading p {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 40px;
|
||||
top: 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="kfEditorContainer" class="kf-editor">
|
||||
<div id="tips" class="tips">
|
||||
sorry! Beta版本仅支持IE9及以上版本的浏览器,正式版本将会支持低版本浏览器,谢谢您的关注!
|
||||
</div>
|
||||
</div>
|
||||
<!--页面中一定要引入internal.js为了能直接使用当前打开dialog的实例变量-->
|
||||
<!--internal.js默认是放到dialogs目录下的-->
|
||||
<script type="text/javascript" src="../dialogs/internal.js"></script>
|
||||
|
||||
<script src="kityformula/js/jquery-1.11.0.min.js"></script>
|
||||
<script src="kityformula/js/kitygraph.all.js"></script>
|
||||
<script src="kityformula/js/kity-formula-render.all.js"></script>
|
||||
<script src="kityformula/js/kity-formula-parser.all.min.js"></script>
|
||||
<script src="kityformula/js/kityformula-editor.all.min.js"></script>
|
||||
<script>
|
||||
jQuery( function ($) {
|
||||
|
||||
if ( document.body.addEventListener ) {
|
||||
|
||||
$( "#tips").html('<div id="loading"><img src="kityformula/loading.gif" alt="loading" /><p>正在加载,请耐心等待...</p></div>' );
|
||||
|
||||
var factory = kf.EditorFactory.create( $( "#kfEditorContainer" )[ 0 ], {
|
||||
render: {
|
||||
fontsize: 24
|
||||
},
|
||||
resource: {
|
||||
path: "./kityformula/resource/"
|
||||
}
|
||||
} );
|
||||
|
||||
factory.ready( function ( KFEditor ) {
|
||||
|
||||
$( "#tips").remove();
|
||||
|
||||
// this指向KFEditor
|
||||
var rng = editor.selection.getRange(),
|
||||
img = rng.getClosedNode(),
|
||||
imgLatex = img && $(img).attr('data-latex');
|
||||
|
||||
this.execCommand( "render", imgLatex || "\\placeholder" );
|
||||
this.execCommand( "focus" );
|
||||
|
||||
window.kfe = this;
|
||||
|
||||
} );
|
||||
|
||||
dialog.onok = function(){
|
||||
kfe.execCommand('get.image.data', function(data){
|
||||
var latex = kfe.execCommand('get.source');
|
||||
editor.execCommand('inserthtml', '<img class="kfformula" src="'+ data.img +'" data-latex="' + latex + '" />');
|
||||
dialog.close();
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} else {
|
||||
$( "#tips").css( "color", "black" );
|
||||
$( "#tips").css( "padding", "10px" );
|
||||
}
|
||||
|
||||
} );
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 925 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 945 B |
|
After Width: | Height: | Size: 1003 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 996 B |
|
After Width: | Height: | Size: 926 B |
|
After Width: | Height: | Size: 938 B |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 994 B |
|
After Width: | Height: | Size: 941 B |
|
After Width: | Height: | Size: 983 B |
|
After Width: | Height: | Size: 988 B |
|
After Width: | Height: | Size: 559 B |
|
After Width: | Height: | Size: 519 B |
|
After Width: | Height: | Size: 317 B |
|
After Width: | Height: | Size: 874 B |
|
After Width: | Height: | Size: 371 B |
|
After Width: | Height: | Size: 305 B |
|
After Width: | Height: | Size: 467 B |
|
After Width: | Height: | Size: 552 B |
|
After Width: | Height: | Size: 239 B |