diff --git a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar index f3995115..6616b3b3 100644 Binary files a/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar and b/com.actionsoft.apps.coe.pal.publisher/lib/com.actionsoft.apps.coe.pal.publisher.jar differ diff --git a/com.actionsoft.apps.coe.pal.publisher/manifest.xml b/com.actionsoft.apps.coe.pal.publisher/manifest.xml index 1d7acba7..be68135f 100644 --- a/com.actionsoft.apps.coe.pal.publisher/manifest.xml +++ b/com.actionsoft.apps.coe.pal.publisher/manifest.xml @@ -3,7 +3,7 @@ 流程发布 1.0 - 49 + 50 北京炎黄盈动科技发展有限责任公司 2d48c93d3dc26d493c6735c962fc9df6 true @@ -28,10 +28,10 @@ true - - - - + + + + com.actionsoft.apps.coe.pal diff --git a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_32aed7b6782b4b79bd0431b4d1163a44.xml b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_32aed7b6782b4b79bd0431b4d1163a44.xml index 43856c15..7d71eaeb 100644 --- a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_32aed7b6782b4b79bd0431b4d1163a44.xml +++ b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_32aed7b6782b4b79bd0431b4d1163a44.xml @@ -2,68 +2,68 @@ - 8ce080c6-a411-4cae-81a1-8a04c076b901 - - 资产库周期管理 - - L2流程列表 - - - - 10 - - false - - false - - true - - false - - false - - false - - - admin - - admin - - - - PROCESSCODE - - LEVEL_2_PROCESS_ID - 文本 - 文本 - - 流程编码 - - 100 - - false - false - false - - - - - PROCESSNAME - - LEVEL_2_PROCESS_NAME - 文本 - 文本 - - 流程名称 - - 100 - - false - false - false - - - - + 8ce080c6-a411-4cae-81a1-8a04c076b901 + + 资产库周期管理 + + L2流程列表 + + + + 10 + + false + + false + + true + + false + + false + + false + + + admin + + admin + + + + PROCESSCODE + + LEVEL_2_PROCESS_ID + 文本 + 文本 + + 流程编码 + + 100 + + false + false + false + + + + + PROCESSNAME + + LEVEL_2_PROCESS_NAME + 文本 + 文本 + + 流程名称 + + 100 + + false + false + false + + + + - + diff --git a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_9d1c92cb08374c8c93cd689f6791259e.xml b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_9d1c92cb08374c8c93cd689f6791259e.xml index 05f05e77..245f39ea 100644 --- a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_9d1c92cb08374c8c93cd689f6791259e.xml +++ b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_9d1c92cb08374c8c93cd689f6791259e.xml @@ -2,68 +2,68 @@ - 8baf0fb9-d239-488e-b1ce-c284e892c6fb - - 资产库周期管理 - - L1流程列表 - - - - 10 - - false - - false - - true - - false - - false - - false - - - admin - - admin - - - - PROCESSCODE - - LEVEL_1_PROCESS_ID - 文本 - 文本 - - 流程编码 - - 100 - - false - false - false - - - - - PROCESSNAME - - LEVEL_1_PROCESS_NAME - 文本 - 文本 - - 流程名称 - - 100 - - false - false - false - - - - + 8baf0fb9-d239-488e-b1ce-c284e892c6fb + + 资产库周期管理 + + L1流程列表 + + + + 10 + + false + + false + + true + + false + + false + + false + + + admin + + admin + + + + PROCESSCODE + + LEVEL_1_PROCESS_ID + 文本 + 文本 + + 流程编码 + + 100 + + false + false + false + + + + + PROCESSNAME + + LEVEL_1_PROCESS_NAME + 文本 + 文本 + + 流程名称 + + 100 + + false + false + false + + + + - + diff --git a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_e4ce70ec5a974081b61d85e20728fc1a.xml b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_e4ce70ec5a974081b61d85e20728fc1a.xml index e424864e..cf186e6c 100644 --- a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_e4ce70ec5a974081b61d85e20728fc1a.xml +++ b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/dic/dic_e4ce70ec5a974081b61d85e20728fc1a.xml @@ -2,68 +2,68 @@ - 765921e7-2abb-4780-a68e-4cfbf940a41f - - 资产库周期管理 - - L3流程列表 - - - - 10 - - false - - false - - true - - false - - false - - false - - - admin - - admin - - - - PROCESSCODE - - LEVEL_3_PROCESS_ID - 文本 - 文本 - - 流程编码 - - 100 - - false - false - false - - - - - PROCESSNAME - - LEVEL_3_PROCESS_NAME - 文本 - 文本 - - 流程名称 - - 100 - - false - false - false - - - - + 765921e7-2abb-4780-a68e-4cfbf940a41f + + 资产库周期管理 + + L3流程列表 + + + + 10 + + false + + false + + true + + false + + false + + false + + + admin + + admin + + + + PROCESSCODE + + LEVEL_3_PROCESS_ID + 文本 + 文本 + + 流程编码 + + 100 + + false + false + false + + + + + PROCESSNAME + + LEVEL_3_PROCESS_NAME + 文本 + 文本 + + 流程名称 + + 100 + + false + false + false + + + + - + diff --git a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/refer/.xml b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/refer/.xml index 3422308f..78526da2 100644 --- a/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/refer/.xml +++ b/com.actionsoft.apps.coe.pal.publisher/repository/dictionary/refer/.xml @@ -2,15 +2,15 @@ - 0dbcd2ef-52f6-4879-a04b-13c93e1e0913 - - - - - 10 - + 0dbcd2ef-52f6-4879-a04b-13c93e1e0913 + + + + + 10 + - + diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/dao/PublisherClientDao.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/dao/PublisherClientDao.java index e16c1f47..e3d902d3 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/dao/PublisherClientDao.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/dao/PublisherClientDao.java @@ -20,321 +20,321 @@ import com.actionsoft.bpms.server.conf.server.AWSServerConf; import com.actionsoft.bpms.util.DBSql; public class PublisherClientDao { - /** - * 获取模型关联的模型Id - * - * @param id - * @return - * @author zhangming - */ - public List> getFileIdsByRelationFileId(String id) { - String sql = "SELECT DISTINCT(r.FILEID), pal.PLNAME, MODIFYDATE FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_REPOSITORY pal WHERE r.RELATIONFILEID in (" + id + ") AND r.FILEID = pal.ID AND pal.PLCATEGORY='process' ORDER BY MODIFYDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - return map; - } - }); - return list; - } + /** + * 获取模型关联的模型Id + * + * @param id + * @return + * @author zhangming + */ + public List> getFileIdsByRelationFileId(String id) { + String sql = "SELECT DISTINCT(r.FILEID), pal.PLNAME, MODIFYDATE FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_REPOSITORY pal WHERE r.RELATIONFILEID in (" + id + ") AND r.FILEID = pal.ID AND pal.PLCATEGORY='process' ORDER BY MODIFYDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + return map; + } + }); + return list; + } + + /** + * 获取模型关联的模型Id(只有文件属性关联) + * + * @param id + * @return + * @author zhangming + */ + public List> getFileIdsByRelationFileId1(String id) { + String sql = "SELECT DISTINCT(r.FILEID), pal.PLNAME, MODIFYDATE FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_REPOSITORY pal WHERE r.RELATIONFILEID in (" + id + ") AND r.FILEID = pal.ID AND r.SHAPEID='' AND pal.PLCATEGORY='process' ORDER BY MODIFYDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + return map; + } + }); + return list; + } + + /** + * 获取管理标准、技术标准和工作标准的Id + * + * @return + * @author zhangming + */ + public Map getControlPolicyId(String wsId) { + Map resultMap = new HashMap(); + String sql = "SELECT ID, PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME IN (?,?,?) AND WSID=? AND PLMETHODID='control.policy'"; + List> listMap = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + map.put(rs.getString(2), rs.getString(1)); + return map; + } + }, new Object[]{PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD, PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD, PublisherConstant.ORG_RELATION_WORK_STANDARD, wsId}); + for (Map map : listMap) { + Set set = map.keySet(); + for (String key : set) { + resultMap.put(key, map.get(key)); + } + } + return resultMap; + } + + + /** + * 获取某个范围内的关联模型Id + * + * @param relationFileIds + * @return + * @author zhangming + */ + public List> getFileIdsByRelation(String relationFileIds) { + if (relationFileIds == null || "".equals(relationFileIds)) { + return new ArrayList>(); + } + String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE FROM APP_ACT_COE_PAL_REPOSITORY pal, (" + + " SELECT r.FILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" + + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" + + " WHERE r.FILEID = pl.PALREPOSITORYID AND r.RELATIONFILEID IN (" + relationFileIds + ") AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" + + " GROUP BY r.FILEID) p" + + " WHERE pal.ID = p.FILEID and pal.ISPUBLISH=1" + + " ORDER BY p.PUBLISHDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + if (rs.getString(1) == null) { + return null; + } + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + Timestamp publishDate = rs.getTimestamp(3); + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + map.put("publishDate", sdf.format(publishDate)); + return map; + } + }); + return list; + } + + /** + * 获取某个范围内的关联模型Id(只有文件属性关联) + * + * @param relationFileIds + * @return + * @author zhangming + */ + public List> getFileIdsByRelation1(String relationFileIds) { + if (relationFileIds == null || "".equals(relationFileIds)) { + return new ArrayList>(); + } + String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE FROM APP_ACT_COE_PAL_REPOSITORY pal, (" + + " SELECT r.FILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" + + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" + + " WHERE r.FILEID = pl.PALREPOSITORYID AND r.RELATIONFILEID IN (" + relationFileIds + ") AND r.SHAPEID='' AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" + + " GROUP BY r.FILEID) p" + + " WHERE pal.ID = p.FILEID and pal.ISPUBLISH=1" + + " ORDER BY p.PUBLISHDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + if (rs.getString(1) == null) { + return null; + } + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + Timestamp publishDate = rs.getTimestamp(3); + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + map.put("publishDate", sdf.format(publishDate)); + return map; + } + }); + return list; + } + + /** + * 获取某个范围内的被关联模型Id + * + * @param fileIds + * @param relationFileIds + * @return + * @author zhangming + */ + public List> getRelationFileIds(String fileIds, String relationFileIds) { + if (fileIds == null || "".equals(fileIds) || relationFileIds == null || "".equals(relationFileIds)) { + return new ArrayList>(); + } + String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE from APP_ACT_COE_PAL_REPOSITORY pal, (" + + " SELECT r.RELATIONFILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" + + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" + + " WHERE r.RELATIONFILEID = pl.PALREPOSITORYID AND r.FILEID IN (" + fileIds + ") AND r.RELATIONFILEID IN (" + relationFileIds + ") AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" + + " GROUP BY r.RELATIONFILEID) p" + + " WHERE pal.ID=p.RELATIONFILEID and pal.ISPUBLISH=1" + + " ORDER BY p.PUBLISHDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + if (rs.getString(1) == null) { + return null; + } + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + Timestamp publishDate = rs.getTimestamp(3); + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + map.put("publishDate", sdf.format(publishDate)); + return map; + } + }); + return list; + } + + /** + * 发布历史 + * + * @param ids + * @return + * @author zhangming + */ + public List> getPublishListData(String ids, String category, String wsId, String methodId) { + if (ids == null || "".equals(ids)) { + return new ArrayList>(); + } + String sql = "SELECT r.ID, r.PLNAME, p.PUBLISHDATE from APP_ACT_COE_PAL_REPOSITORY r, (" + + " SELECT pl.PALREPOSITORYID, MAX(p.PUBLISHDATE) publishdate " + + " FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" + + " WHERE p.ID=pl.PID AND pl.PALREPOSITORYID IN (" + ids + ")" + + " GROUP BY pl.PALREPOSITORYID ) p" + + " WHERE r.ID = p.PALREPOSITORYID AND r.PLCATEGORY='" + category + "' AND r.PLMETHODID <> 'default' AND r.WSID='" + wsId + "'"; + if (methodId != null && !"".equals(methodId)) { + sql += " AND r.PLMETHODID='" + methodId + "'"; + } + sql += " ORDER BY p.PUBLISHDATE DESC"; + List> list = DBSql.query(sql, new RowMapper>() { + @Override + public Map mapRow(ResultSet rs, int arg1) throws SQLException { + Map map = new HashMap(); + if (rs.getString(1) == null) { + return null; + } + map.put("id", rs.getString(1)); + map.put("name", rs.getString(2)); + Timestamp publishDate = rs.getTimestamp(3); + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + map.put("publishDate", sdf.format(publishDate)); + return map; + } + }); + return list; + } + /** + * 根据name获取未发布的流程文件 + * @param name + * @param wsId + * @param methodId + * @return + */ + public List getCoeProcessLevelByNamen(String name, String wsId, String methodId) { + String namelike = ""; + if (StringUtil.containSpecialChar(name)) { + namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); + } else { + namelike = "'%" + name + "%'"; + } + StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and ISPUBLISH = '0'"); + if (methodId != null && !"".equals(methodId)) { + sql.append(" and PLMETHODID = '" + methodId + "' "); + } + sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); + return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); + } + /** + * 根据name获取有多个版本的流程文件 + * @param name + * @param wsId + * @param methodId + * @return + */ + public List getCoeProcessLevelByNamec(String name, String wsId, String methodId) { + String namelike = ""; + if (StringUtil.containSpecialChar(name)) { + namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); + } else { + namelike = "'%" + name + "%'"; + } + StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and ISPUBLISH = '1'"); + String sqlcount = "select count(*) from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + ""; - /** - * 获取模型关联的模型Id(只有文件属性关联) - * - * @param id - * @return - * @author zhangming - */ - public List> getFileIdsByRelationFileId1(String id) { - String sql = "SELECT DISTINCT(r.FILEID), pal.PLNAME, MODIFYDATE FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_REPOSITORY pal WHERE r.RELATIONFILEID in (" + id + ") AND r.FILEID = pal.ID AND r.SHAPEID='' AND pal.PLCATEGORY='process' ORDER BY MODIFYDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - return map; - } - }); - return list; - } + if (methodId != null && !"".equals(methodId)) { + sql.append(" and PLMETHODID = '" + methodId + "' "); + } + sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); + sqlcount+=" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"; + String num = DBSql.getString(sqlcount); + int number = Integer.parseInt(num); + if(number <= 1) { + List data = null; + return data; + } + return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); + } + /** + * 根据name获取停用的流程文件 + * @param name + * @param wsId + * @param category + * @return + */ + public List getCoeProcessLevelByNameAndCategorys(String name, String wsId, String category) { + + String namelike = ""; + + if (StringUtil.containSpecialChar(name)) { + namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); + } else { + namelike = "'%" + name + "%'"; + } + StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and " + PALRepositoryModelImpl.FIELD_IS_USE + "='1' and ISPUBLISH = '1'"); - /** - * 获取管理标准、技术标准和工作标准的Id - * - * @return - * @author zhangming - */ - public Map getControlPolicyId(String wsId) { - Map resultMap = new HashMap(); - String sql = "SELECT ID, PLNAME FROM APP_ACT_COE_PAL_REPOSITORY WHERE PLNAME IN (?,?,?) AND WSID=? AND PLMETHODID='control.policy'"; - List> listMap = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - map.put(rs.getString(2), rs.getString(1)); - return map; - } - }, new Object[]{PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD, PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD, PublisherConstant.ORG_RELATION_WORK_STANDARD, wsId}); - for (Map map : listMap) { - Set set = map.keySet(); - for (String key : set) { - resultMap.put(key, map.get(key)); - } - } - return resultMap; - } - - - /** - * 获取某个范围内的关联模型Id - * - * @param relationFileIds - * @return - * @author zhangming - */ - public List> getFileIdsByRelation(String relationFileIds) { - if (relationFileIds == null || "".equals(relationFileIds)) { - return new ArrayList>(); - } - String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE FROM APP_ACT_COE_PAL_REPOSITORY pal, (" - + " SELECT r.FILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" - + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" - + " WHERE r.FILEID = pl.PALREPOSITORYID AND r.RELATIONFILEID IN (" + relationFileIds + ") AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" - + " GROUP BY r.FILEID) p" - + " WHERE pal.ID = p.FILEID and pal.ISPUBLISH=1" - + " ORDER BY p.PUBLISHDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - if (rs.getString(1) == null) { - return null; - } - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - Timestamp publishDate = rs.getTimestamp(3); - DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - map.put("publishDate", sdf.format(publishDate)); - return map; - } - }); - return list; - } - - /** - * 获取某个范围内的关联模型Id(只有文件属性关联) - * - * @param relationFileIds - * @return - * @author zhangming - */ - public List> getFileIdsByRelation1(String relationFileIds) { - if (relationFileIds == null || "".equals(relationFileIds)) { - return new ArrayList>(); - } - String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE FROM APP_ACT_COE_PAL_REPOSITORY pal, (" - + " SELECT r.FILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" - + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" - + " WHERE r.FILEID = pl.PALREPOSITORYID AND r.RELATIONFILEID IN (" + relationFileIds + ") AND r.SHAPEID='' AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" - + " GROUP BY r.FILEID) p" - + " WHERE pal.ID = p.FILEID and pal.ISPUBLISH=1" - + " ORDER BY p.PUBLISHDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - if (rs.getString(1) == null) { - return null; - } - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - Timestamp publishDate = rs.getTimestamp(3); - DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - map.put("publishDate", sdf.format(publishDate)); - return map; - } - }); - return list; - } - - /** - * 获取某个范围内的被关联模型Id - * - * @param fileIds - * @param relationFileIds - * @return - * @author zhangming - */ - public List> getRelationFileIds(String fileIds, String relationFileIds) { - if (fileIds == null || "".equals(fileIds) || relationFileIds == null || "".equals(relationFileIds)) { - return new ArrayList>(); - } - String sql = "SELECT pal.ID, pal.PLNAME, p.PUBLISHDATE from APP_ACT_COE_PAL_REPOSITORY pal, (" - + " SELECT r.RELATIONFILEID, MAX(p.PUBLISHDATE) PUBLISHDATE" - + " FROM APP_ACT_COE_PAL_SHAPE_RLAT r, APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" - + " WHERE r.RELATIONFILEID = pl.PALREPOSITORYID AND r.FILEID IN (" + fileIds + ") AND r.RELATIONFILEID IN (" + relationFileIds + ") AND p.ID=pl.PID AND pl.ACTIONTYPE='N'" - + " GROUP BY r.RELATIONFILEID) p" - + " WHERE pal.ID=p.RELATIONFILEID and pal.ISPUBLISH=1" - + " ORDER BY p.PUBLISHDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - if (rs.getString(1) == null) { - return null; - } - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - Timestamp publishDate = rs.getTimestamp(3); - DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - map.put("publishDate", sdf.format(publishDate)); - return map; - } - }); - return list; - } - - /** - * 发布历史 - * - * @param ids - * @return - * @author zhangming - */ - public List> getPublishListData(String ids, String category, String wsId, String methodId) { - if (ids == null || "".equals(ids)) { - return new ArrayList>(); - } - String sql = "SELECT r.ID, r.PLNAME, p.PUBLISHDATE from APP_ACT_COE_PAL_REPOSITORY r, (" - + " SELECT pl.PALREPOSITORYID, MAX(p.PUBLISHDATE) publishdate " - + " FROM APP_ACT_COE_PAL_PUBLISH p, APP_ACT_COE_PAL_PUBLISH_LIST pl" - + " WHERE p.ID=pl.PID AND pl.PALREPOSITORYID IN (" + ids + ")" - + " GROUP BY pl.PALREPOSITORYID ) p" - + " WHERE r.ID = p.PALREPOSITORYID AND r.PLCATEGORY='" + category + "' AND r.PLMETHODID <> 'default' AND r.WSID='" + wsId + "'"; - if (methodId != null && !"".equals(methodId)) { - sql += " AND r.PLMETHODID='" + methodId + "'"; - } - sql += " ORDER BY p.PUBLISHDATE DESC"; - List> list = DBSql.query(sql, new RowMapper>() { - @Override - public Map mapRow(ResultSet rs, int arg1) throws SQLException { - Map map = new HashMap(); - if (rs.getString(1) == null) { - return null; - } - map.put("id", rs.getString(1)); - map.put("name", rs.getString(2)); - Timestamp publishDate = rs.getTimestamp(3); - DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - map.put("publishDate", sdf.format(publishDate)); - return map; - } - }); - return list; - } - /** - * 根据name获取未发布的流程文件 - * @param name - * @param wsId - * @param methodId - * @return - */ - public List getCoeProcessLevelByNamen(String name, String wsId, String methodId) { - String namelike = ""; - if (StringUtil.containSpecialChar(name)) { - namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); - } else { - namelike = "'%" + name + "%'"; - } - StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and ISPUBLISH = '0'"); - if (methodId != null && !"".equals(methodId)) { - sql.append(" and PLMETHODID = '" + methodId + "' "); - } - sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); - return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); - } - /** - * 根据name获取有多个版本的流程文件 - * @param name - * @param wsId - * @param methodId - * @return - */ - public List getCoeProcessLevelByNamec(String name, String wsId, String methodId) { - String namelike = ""; - if (StringUtil.containSpecialChar(name)) { - namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); - } else { - namelike = "'%" + name + "%'"; - } - StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and ISPUBLISH = '1'"); - String sqlcount = "select count(*) from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + ""; - - if (methodId != null && !"".equals(methodId)) { - sql.append(" and PLMETHODID = '" + methodId + "' "); - } - sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); - sqlcount+=" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"; - String num = DBSql.getString(sqlcount); - int number = Integer.parseInt(num); - if(number <= 1) { - List data = null; - return data; - } - return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); - } - /** - * 根据name获取停用的流程文件 - * @param name - * @param wsId - * @param category - * @return - */ - public List getCoeProcessLevelByNameAndCategorys(String name, String wsId, String category) { - - String namelike = ""; - - if (StringUtil.containSpecialChar(name)) { - namelike = "'%" + StringUtil.replaceSqlStr(name, AWSServerConf.isMySQL()) + "%'" + (AWSServerConf.isMySQL() ? "ESCAPE '\\\\'" : " ESCAPE '\\'"); - } else { - namelike = "'%" + name + "%'"; - } - StringBuilder sql = new StringBuilder("select * from " + PALRepositoryModelImpl.DATABASE_ENTITY + " where " + PALRepositoryModelImpl.FIELD_WS_ID + "='" + wsId + "' and " + PALRepositoryModelImpl.FIELD_PL_NAME + " like " + namelike + " and " + PALRepositoryModelImpl.FIELD_IS_USE + "='1' and ISPUBLISH = '1'"); - - if (category != null && !"".equals(category)) { - sql.append(" and PLCATEGORY = '" + category + "' "); - } - sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); - return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); - } - private class PALRespositoryModelMapper implements RowMapper { - PALRepository pal = new PALRepository(); - public PALRepositoryModel mapRow(ResultSet rs, int arg1) throws SQLException { - return (PALRepositoryModel) pal.record2Model(rs); - } - } - /** - * 根据userId获取资源Id列表 - * @param userId - * @return - */ - public List getTeamUserPerms(String userId) { - String sql = " select distinct perm.RESOURCEID from APP_ACT_NETWORK_TEAM_MEMBER tm , APP_ACT_COE_TEAM_PERM perm " + - "where tm.TEAMID=perm.TEAMID and tm.MEMBERSTATUS='1' and tm.USERID=? "; - List resourceIdList = DBSql.query(sql.toString(), new RowMapper() { - @Override - public String mapRow(ResultSet rs, int arg1) throws SQLException { - return rs.getString(1); - } - }, new Object[] { userId }); - if(resourceIdList == null) { - resourceIdList = new ArrayList(); - } - return resourceIdList; - } + if (category != null && !"".equals(category)) { + sql.append(" and PLCATEGORY = '" + category + "' "); + } + sql.append(" ORDER BY " + PALRepositoryModelImpl.FIELD_PL_ORDERINDEX + " ASC"); + return DBSql.query(sql.toString(), new PALRespositoryModelMapper()); + } + private class PALRespositoryModelMapper implements RowMapper { + PALRepository pal = new PALRepository(); + public PALRepositoryModel mapRow(ResultSet rs, int arg1) throws SQLException { + return (PALRepositoryModel) pal.record2Model(rs); + } + } + /** + * 根据userId获取资源Id列表 + * @param userId + * @return + */ + public List getTeamUserPerms(String userId) { + String sql = " select distinct perm.RESOURCEID from APP_ACT_NETWORK_TEAM_MEMBER tm , APP_ACT_COE_TEAM_PERM perm " + + "where tm.TEAMID=perm.TEAMID and tm.MEMBERSTATUS='1' and tm.USERID=? "; + List resourceIdList = DBSql.query(sql.toString(), new RowMapper() { + @Override + public String mapRow(ResultSet rs, int arg1) throws SQLException { + return rs.getString(1); + } + }, new Object[] { userId }); + if(resourceIdList == null) { + resourceIdList = new ArrayList(); + } + return resourceIdList; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/PublisherSkinsDao.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/PublisherSkinsDao.java index d3e975c0..cbb01e49 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/PublisherSkinsDao.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/util/PublisherSkinsDao.java @@ -10,23 +10,23 @@ import com.actionsoft.bpms.util.DBSql; /** * 导航处理类 - * + * * @author ZZ - * + * */ public class PublisherSkinsDao { - public long getPrevLoginTime(String userId) { - long prevLoginTime = 0; - String sql = " select * from SYS_SESSION s where s.userid = '" + userId + "' order by s.STARTTIME desc "; - List list = DBSql.query(SQLPagination.getPaginitionSQL(sql, 0, 2), new RowMapper() { - public Long mapRow(ResultSet rs, int paramInt) throws SQLException { - return rs.getLong("starttime"); - } - }); - if (list != null && list.size() > 0) { - prevLoginTime = list.get(list.size() - 1); - } - return prevLoginTime; - } + public long getPrevLoginTime(String userId) { + long prevLoginTime = 0; + String sql = " select * from SYS_SESSION s where s.userid = '" + userId + "' order by s.STARTTIME desc "; + List list = DBSql.query(SQLPagination.getPaginitionSQL(sql, 0, 2), new RowMapper() { + public Long mapRow(ResultSet rs, int paramInt) throws SQLException { + return rs.getLong("starttime"); + } + }); + if (list != null && list.size() > 0) { + prevLoginTime = list.get(list.size() - 1); + } + return prevLoginTime; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java index d1b97c52..f4786d29 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/client/web/ProcessPublishClientWeb.java @@ -87,4130 +87,4130 @@ import com.alibaba.fastjson.JSONObject; import org.apache.commons.collections4.IteratorUtils; public class ProcessPublishClientWeb extends AbstPortalSkins implements PortalSkinsInterface { - private UserContext _uc; - - public ProcessPublishClientWeb() { - } - - public ProcessPublishClientWeb(UserContext userContext) { - _uc = userContext; - } - - @Override - public String getHomePage(UserContext uc) { - _uc = uc; - // 操作行为日志记录 - if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { - CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_APPCENTER_ACCESS_PREFIX + SDK.getAppAPI().getAppContext(PublisherConf.APPID).getName() + CoEOpLogConst.INFO_APPCENTER_ACCESS_SUFFIX); - } - if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v3")) { - Map macroLibraries = getHomePage2(uc); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home2.html", macroLibraries); - } else { - AppAPI appApi = SDK.getAppAPI(); - JSONArray wsTree = new JSONArray(); - String isIntegrationAWSUser = appApi.getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 - String roleId = ""; - if ("false".equals(isIntegrationAWSUser)) { - roleId = PublishConst.GUESTROLE; - } else { - roleId = uc.getRoleModel().getId(); - } - String emptyMessage = ""; - PALRepository dao = new PALRepository(); - List> allWsList = dao.getWorkSpaceListByPublishRole(roleId, false); - if (allWsList == null || allWsList.size() == 0) { - emptyMessage = "未分配资产库访问权限"; - } - List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true); // 有访问权限的资产库 - StringBuilder wsIds = new StringBuilder(""); - StringBuilder modelIds = new StringBuilder(""); - JSONArray repositoryList = new JSONArray(); // 有访问权限的文件 - if (wsList != null && wsList.size() > 0) { - int i = 0; - List> removeList = new ArrayList>(); - for (Map ws : wsList) { - boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); - if (!isActive) { - removeList.add(ws); - } else { - JSONObject wsJson = new JSONObject(); - wsJson.put("id", ws.get("wsId")); - wsJson.put("name", ws.get("wsName")); - if (i == 0) { - wsJson.put("open", true); - } else { - wsJson.put("open", false); - } - wsJson.put("ws", true); - wsJson.put("wsName", ws.get("wsName")); - if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { - wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER); - } else { - wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); - } - wsTree.add(wsJson); - wsIds.append(ws.get("wsId")).append(","); - i++; - } - } - wsList.removeAll(removeList); - - if (wsList.size() > 0) { - ProcessPublishWeb web = new ProcessPublishWeb(uc); - for (Map ws : wsList) { - List repositoryModelList = dao.getRepositoryListByPublishRole(roleId, ws.get("wsId")); - repositoryList.addAll(web.getRepositoryTree(repositoryModelList, ws.get("wsId"), true, false, false, null, false)); - } - } else { - emptyMessage = "资产库被停用"; - } - } else { - emptyMessage = "可访问流程未发布"; - } - - if (repositoryList != null && repositoryList.size() > 0) { - wsTree.addAll(repositoryList); - for (int i = 0; i < repositoryList.size(); i++) { - String versionId = ""; - if (repositoryList.getJSONObject(i).containsKey("versionId")) { - versionId = repositoryList.getJSONObject(i).getString("versionId"); - } else { - versionId = repositoryList.getJSONObject(i).getString("id"); - } - modelIds.append(versionId).append(","); - } - } - - boolean isComment = PublisherConf.isComment(); //允许留言 - boolean isViewHistory = PublisherConf.isViewHistory(); //允许查看历史发布记录 - boolean isViewAttribute = PublisherConf.isViewAttribute(); //允许查看属性 - boolean isPrint = PublisherConf.isPrint(); //允许打印 - String fotter = PublisherConf.getFotter(); //页底信息 - fotter = fotter == null ? "" : fotter; - String title = PublisherConf.getTitle(); //门户标题 - JSONObject dockDisplay = new JSONObject(); - if (!isComment) { - dockDisplay.put("messageView", "display: none;"); - } - if (!isViewHistory) { - dockDisplay.put("publishView", "display: none;"); - } - if (!isViewAttribute) { - dockDisplay.put("attributeView", "display: none;"); - } - if (!isPrint) { - dockDisplay.put("printView", "display: none;"); - } - Map macroLibraries = new HashMap(); - boolean isCoEUser = CoeUserDaoFactory.createUser().validateIsAccessCOE(uc.getUID()); - //公共方法 判断密码修改周期 - PublicPortalWeb portalWeb = new PublicPortalWeb(uc); - JSONObject params = portalWeb.getLoginCheckSecurityInfo(); - macroLibraries.put("isSecurityPwdChange", params.getBoolean("isSecurityPwdChange")); - macroLibraries.put("forceChangePwd", params.getBoolean("forceChangePwd")); - macroLibraries.put("isSecurityPwdComplexity", params.getBoolean("isSecurityPwdComplexity")); - macroLibraries.put("securityMinPwdLength", params.getIntValue("securityMinPwdLength")); - macroLibraries.put("securityMaxPwdLength", params.getIntValue("securityMaxPwdLength")); - macroLibraries.put("sid", uc.getSessionId()); - macroLibraries.put("roleId", roleId); - macroLibraries.put("wsTree", wsTree); - macroLibraries.put("wsId", (wsList == null || wsList.size() == 0) ? "" : wsList.get(0).get("wsId")); - macroLibraries.put("wsName", (wsList == null || wsList.size() == 0) ? "" : wsList.get(0).get("wsName")); - macroLibraries.put("dockDisplay", dockDisplay.toString()); - macroLibraries.put("fotter", fotter.length() > 40 ? fotter.substring(0, 39) : fotter); - macroLibraries.put("title", title.length() > 20 ? title.substring(0, 19) : title); - macroLibraries.put("isComment", isComment); - macroLibraries.put("isViewHistory", isViewHistory); - macroLibraries.put("isViewAttribute", isViewAttribute); - macroLibraries.put("isPrint", isPrint); - macroLibraries.put("userName", uc.getUserName()); - macroLibraries.put("userPhoto", SDK.getPortalAPI().getUserPhoto(uc, uc.getUID())); - macroLibraries.put("emptyMessage", emptyMessage); - macroLibraries.put("entryCoEView", isCoEUser && HighSecurityUtil.allow3PLoginPal(uc.getUID()) ? "" : "display: none;"); - macroLibraries.put("settingView", uc.getUID().equals("admin") ? "" : "display: none;"); - macroLibraries.put("appId", PublisherConf.APPID); - String wsIdsStr = wsIds.toString(); - macroLibraries.put("wsIds", wsIdsStr.contains(",") ? wsIdsStr.substring(0, wsIdsStr.lastIndexOf(",")) : wsIdsStr); - String modelIdsStr = modelIds.toString(); - macroLibraries.put("modelIds", modelIdsStr.contains(",") ? modelIdsStr.substring(0, modelIdsStr.lastIndexOf(",")) : modelIdsStr); - //App-关联查询 - AppContext relationSearchAppContext = AppsAPIManager.getInstance().getAppContext(PublisherConf.RELATION_SEARCH_ID); - macroLibraries.put("relationSearchId", PublisherConf.RELATION_SEARCH_ID.replace(".", "_")); - macroLibraries.put("relationSearchTitle", PublisherConf.RELATION_SEARCH_NAME); - macroLibraries.put("relationSearchCmd", "_portal_home"); - if (relationSearchAppContext != null && SDK.getAppAPI().isActive(relationSearchAppContext.getId())) { - macroLibraries.put("relationSearchIcon", relationSearchAppContext.getIcon16Url(uc)); - macroLibraries.put("relationSearchName", relationSearchAppContext.getName()); - macroLibraries.put("showRelationSearch", ""); - } else { - macroLibraries.put("showRelationSearch", "display: none;"); - } - if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home.html", macroLibraries); - } else if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v2")) { - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home1.html", macroLibraries); - } - return null; - } - } - - /** - * v3新版门户 - * @return - */ - public Map getHomePage2(UserContext uc) { - Map macroLibraries = new HashMap(); - AppAPI appApi = SDK.getAppAPI(); - JSONArray wsTree = new JSONArray(); - String isIntegrationAWSUser = appApi.getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 - String roleId = ""; - if ("false".equals(isIntegrationAWSUser)) { - roleId = PublishConst.GUESTROLE; - } else { - roleId = uc.getRoleModel().getId(); - } - boolean isCoEUser = CoeUserDaoFactory.createUser().validateIsAccessCOE(uc.getUID()); - //公共方法 判断密码修改周期 - PublicPortalWeb portalWeb = new PublicPortalWeb(uc); - JSONObject params = portalWeb.getLoginCheckSecurityInfo(); - macroLibraries.put("isSecurityPwdChange", params.getBoolean("isSecurityPwdChange")); - macroLibraries.put("forceChangePwd", params.getBoolean("forceChangePwd")); - macroLibraries.put("isSecurityPwdComplexity", params.getBoolean("isSecurityPwdComplexity")); - macroLibraries.put("securityMinPwdLength", params.getIntValue("securityMinPwdLength")); - macroLibraries.put("securityMaxPwdLength", params.getIntValue("securityMaxPwdLength")); - macroLibraries.put("sid", uc.getSessionId()); - macroLibraries.put("roleId", roleId); - macroLibraries.put("wsTree", wsTree); - macroLibraries.put("userName", uc.getUserName()); - macroLibraries.put("userPhoto", SDK.getPortalAPI().getUserPhoto(uc, uc.getUID())); - macroLibraries.put("entryCoEView", isCoEUser && HighSecurityUtil.allow3PLoginPal(uc.getUID()) ? "" : "display: none;"); - macroLibraries.put("settingView", uc.getUID().equals("admin") ? "" : "display: none;"); - macroLibraries.put("appId", PublisherConf.APPID); - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); - JSONArray ws = new JSONArray(); - if (wsList != null && wsList.size() > 0) { - for (int i = 0; i < wsList.size(); i++) { - JSONObject object = new JSONObject(); - object.put("id", wsList.get(i).get("wsId")); - object.put("text", wsList.get(i).get("wsName")); - object.put("initDisplay", "0"); - ws.add(object); - } - } - macroLibraries.put("ws", ws); - macroLibraries.put("palAdmin", new CoeUser().isCoEManager(uc.getUID())); - // 获取logo图片路径 - JSONObject object = getLogoImgPath(uc); - macroLibraries.put("logoImgPath", object.getString("src")); - macroLibraries.put("logoImgName", object.getString("name")); - // 门户参数 - macroLibraries.put("xpagesId", PublisherConf.XPAGES_ID); - macroLibraries.put("portalTabs", PublisherConf.PORTAL_TABS); - return macroLibraries; - } - - /** - * 首页 - * - * @return - * @author zhangming - */ - public String getClientMain(String wsId) { - JSONArray result = search("", null, null, null); //所有文件 - - JSONArray plrdArray = new JSONArray(); - JSONArray plrpArray = new JSONArray(); - PALRepository dao = new PALRepository(); - List> plrds = dao.searchRepositoryPlrdByPublisherPortal(_uc.getRoleModel().getId()); - for (Map plrd : plrds) { - if (plrd != null && plrd.containsKey("id") && !plrd.get("id").equals("")) { - plrdArray.add(plrd); - } - } - List> plrps = dao.searchRepositoryPlrpByPublisherPortal(_uc.getRoleModel().getId()); - for (Map plrp : plrps) { - if (plrp != null && plrp.containsKey("id") && !plrp.get("id").equals("")) { - plrpArray.add(plrp); - } - } - - Map macroLibraries = new HashMap(); - macroLibraries.put("result", result); - macroLibraries.put("plrd", plrdArray); - macroLibraries.put("plrp", plrpArray); - macroLibraries.put("wsId", wsId); - macroLibraries.put("sid", _uc.getSessionId()); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.main.html", macroLibraries); - } - - /** - * 查询 - * - * @param modelIds - * @param filter - * @param order - * @param name - * @return - * @author zhangming - */ - public String searchInClientMain(String modelIds, String filter, String order, String name) { - JSONArray result = search(modelIds, filter, order, name); - - ResponseObject ro = ResponseObject.newOkResponse(); - ro.put("result", result); - return ro.toString(); - } - - private JSONArray search(String modelIds, String filter, String order, String name) { - PALRepository dao = new PALRepository(); - List models = dao.searchRepositoryByPublisherPortal(modelIds, filter, order, name); - - List jsonList = new ArrayList<>(); - for (String id : models) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model == null) { - continue; - } - - boolean isActive = false; - if (model != null && !"default".equals(model.getMethodId())) { - if (PALMethodCache.getPALMethodModelById(model.getMethodId()) == null) { - isActive = false; - } else { - String methodId = PALMethodCache.getPALMethodModelById(model.getMethodId()).getApp().getId(); - isActive = SDK.getAppAPI().isActive(methodId); - } - } - - String processDefId = ""; - String appId = ""; - if (model != null) {// 获取流程版本id - appId = CoeProcessLevelUtil.getAppId(model.getId()); - processDefId = CoeProcessLevelUtil.getProcessDefIdByVer(appId, model.getId(), (int)model.getVersion()); - } - - String p = model.getFilePath(); - String imagePath = "../apps/"+ CoEConstant.APP_ID +"/img/method/default.png"; - if (!processDefId.equals("")) { - imagePath = "data:image/png;base64," + BPMNIO.getBPMNImageThumbnail(CoeProcessLevelUtil.getAppId(model.getId()), processDefId); - } else { - if (!"".equals(p)) { - UtilFile utilFile = new UtilFile(p + "/" + model.getId() + ".small.png"); - if (utilFile.exists()) { - byte[] base64Bytes = Base64.encode(utilFile.readBytes()); - imagePath = "data:image/png;base64," + new String(base64Bytes); - } - } - } - if ("default".equals(model.getMethodId())) { - imagePath = "../apps/com.actionsoft.apps.coe.pal.publisher/img/default_folder.png"; - } - - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("imgPath", imagePath); - object.put("processDefId", processDefId); - object.put("methodId", model.getMethodId()); - String relationType = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_RELATION_TYPE); - object.put("plrd", ""); - object.put("plrp", ""); - if ("address".equals(relationType)) { - String dutyDept = model.getDutyDept(); - if (!UtilString.isEmpty(dutyDept)) { - if (SDK.getORGAPI().getDepartmentById(dutyDept) != null) { - dutyDept = SDK.getORGAPI().getDepartmentById(dutyDept).getName(); - object.put("plrd", dutyDept); - } - } - String dutyPerson = model.getDutyUser(); - if (!UtilString.isEmpty(dutyPerson)) { - object.put("plrp", SDK.getORGAPI().getUserAliasNames(dutyPerson)); - } - } else { - String plrdId = model.getOwnerDept(); - if (plrdId != null && !"".equals(plrdId)) { - List list = DesignerShapeRelationCache.getListByAttrId(id, "", "plRD"); - if (list != null && list.size() > 0) { - object.put("plrd", list.get(0).getRelationShapeText()); - } else { - object.put("plrd", ""); - } - } - String plrpId = model.getOwnerUser(); - if (plrpId != null && !"".equals(plrpId)) { - List list = DesignerShapeRelationCache.getListByAttrId(id, "", "plRP"); - if (list != null && list.size() > 0) { - object.put("plrp", list.get(0).getRelationShapeText()); - } else { - object.put("plrp", ""); - } - } - } - object.put("version", model.getVersion()); - object.put("isActive", isActive); - - if (model.isPublish()) { - PublishListHistory historyDao = new PublishListHistory(); - String lastPublishDate = historyDao.getLastPublishDateByModelId(model.getId()); - if (lastPublishDate != null && !"".equals(lastPublishDate)) { - lastPublishDate = lastPublishDate.substring(0, 10); - } - object.put("publishDate", lastPublishDate == null ? "" : lastPublishDate); - } else { - object.put("publishDate", ""); - } - - jsonList.add(object); - } - - if (order != null && order.contains("plrd")) { - Collections.sort(jsonList, new ComparatorPlrdChinese()); - } - if (order != null && order.contains("plrp")) { - Collections.sort(jsonList, new ComparatorPlrpChinese()); - } - return JSONArray.parseArray(JSON.toJSONString(jsonList)); - } - - private class ComparatorPlrdChinese implements Comparator { - @Override - public int compare(JSONObject model1, JSONObject model2) { - String plrd1 = model1.getString("plrd"); - String plrd2 = model2.getString("plrd"); - return Collator.getInstance(Locale.CHINESE).compare(plrd1, plrd2); - } - } - - private class ComparatorPlrpChinese implements Comparator { - @Override - public int compare(JSONObject model1, JSONObject model2) { - String plrp1 = model1.getString("plrp"); - String plrp2 = model2.getString("plrp"); - return Collator.getInstance(Locale.CHINESE).compare(plrp1, plrp2); - } - } - - /** - * 查询发布历史 - * - * @param start - * @param type N/C/S,如果查询全部该字段为空 - * @return - * @author zhangming - */ - public String getPublishList(String start, String type) { - ProcessPublishWeb web = new ProcessPublishWeb(_uc); - JSONArray list = web.getMorePublishHistory(start, "50", type); - - ResponseObject ro = ResponseObject.newOkResponse(); - ro.put("results", list); - return ro.toString(); - } - - public String getSettingData() { - boolean isComment = PublisherConf.isComment(); //允许留言 - boolean isViewHistory = PublisherConf.isViewHistory(); //允许查看历史发布记录 - boolean isViewAttribute = PublisherConf.isViewAttribute(); //允许查看属性 - boolean isPrint = PublisherConf.isPrint(); //允许打印 - String fotter = PublisherConf.getFotter(); //页底信息 - fotter = fotter == null ? "" : fotter; - String title = PublisherConf.getTitle(); //门户标题 - ResponseObject ro = ResponseObject.newOkResponse(); - ro.put("isComment", isComment + ""); - ro.put("isViewHistory", isViewHistory + ""); - ro.put("isViewAttribute", isViewAttribute + ""); - ro.put("isPrint", isPrint + ""); - ro.put("fotter", fotter); - ro.put("title", title); - return ro.toString(); - } - - /** - * 参数设置 - * - * @param title - * @param fotter - * @param isComment - * @param isPrint - * @param isViewAttribute - * @param isViewHistory - * @return - * @author zhangming - */ - public String setting(String title, String fotter, String isComment, String isPrint, String isViewAttribute, String isViewHistory) { - PublisherConf.setTitle(title); - PublisherConf.setFotter(fotter); - PublisherConf.setComment(isComment); - PublisherConf.setPrint(isPrint); - PublisherConf.setViewAttribute(isViewAttribute); - PublisherConf.setViewHistory(isViewHistory); - ResponseObject ro = ResponseObject.newOkResponse(); - return ro.toString(); - } - - /** - * 获取资产库列表 - * - * @return - * @author zhangming - */ - public String getOrgWsTreeData() { - ResponseObject ro = ResponseObject.newOkResponse(); - - List wsList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstanceAll(); - JSONArray wsTree = new JSONArray(); - if (wsList != null && wsList.size() > 0) { - int i = 0; - for (CoeWorkSpaceModel ws : wsList) { - boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.getUUId()); - if (isActive) { - JSONObject wsJson = new JSONObject(); - String wsId = ws.getUUId(); - wsJson.put("id", wsId); - wsJson.put("name", ws.getWsName()); - if (i == 0) { - wsJson.put("open", true); - } else { - wsJson.put("open", false); - } - wsJson.put("ws", true); - wsJson.put("wsId", wsId); - wsJson.put("wsName", ws.getWsName()); - if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { - wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER); - } else { - wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); - } - wsTree.add(wsJson); - i++; - - JSONArray jsonArray = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsId, "org", "isUsed"); - for (int j = 0; j < jsonArray.size(); j++) { - JSONObject object = jsonArray.getJSONObject(j); - if (object.getString("id").equals("org")) { - object.put("id", wsId + "_org"); - object.put("pid", wsId); - object.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); - } else { - if (object.getString("pid").equals("org")) { - object.put("pid", wsId + "_org"); - } - if (object.getString("isParent") == "true") { - object.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); - } else { - object.put("icon", ""); - } - } - - wsTree.add(object); - } - } - } - } - ro.put("wsTreeData", wsTree); - return ro.toString(); - } - - /** - * 标准化体系页面 - * - * @return - * @author zhangming - */ - public String toOrgRelationPage() { - Map macroLibraries = new HashMap(); - macroLibraries.put("sid", _uc.getSessionId()); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.org.html", macroLibraries); - } - - /** - * 组织模型相关的模型页面 - * - * @return - * @author zhangming - */ - public String toOrgRelationModelPage() { - Map macroLibraries = new HashMap(); - macroLibraries.put("sid", _uc.getSessionId()); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.org.main.html", macroLibraries); - } - - public String getOrgRelativeModel(String orgModelId, String modelIds) { - ResponseObject ro = ResponseObject.newOkResponse(); - ro.put("data", getOrgRelationModelList(orgModelId, modelIds)); - return ro.toString(); - } - - private JSONObject getOrgRelationModelList(String orgModelId, String modelIds) { - JSONObject data = new JSONObject(); - - //如果orgModelId为空,则查询发布历史 - if (orgModelId == null || "".equals(orgModelId)) { - PublisherClientDao publisherDao = new PublisherClientDao(); - String[] modelIdArray = modelIds.split(","); - StringBuilder sb = new StringBuilder(); - if (modelIdArray.length > 0) { - for (String modelId : modelIdArray) { - if (!"".equals(modelId)) { - sb.append("'" + modelId + "',"); - } - } - } - if (sb.length() > 0) { - String wsId = ""; - if (modelIdArray[0].length() > 36) { - wsId = modelIdArray[0].substring(modelIdArray[0].indexOf("_") + 1); - } else if (modelIdArray[0].length() == 36) { - if (PALRepositoryCache.getCache().get(modelIdArray[0]) != null) { - wsId = PALRepositoryCache.getCache().get(modelIdArray[0]).getWsId(); - } - } else { - return data; - } - - String sqlIds = sb.substring(0, sb.lastIndexOf(",")); - List> processList = publisherDao.getPublishListData(sqlIds, "process", wsId, null); - data.put("processList", processList); - Map controlPolicyIds = publisherDao.getControlPolicyId(wsId); - //管理标准 - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { - List> managementRoleList = new ArrayList>(); - List> technicalRoleList = new ArrayList>(); - List> workRoleList = new ArrayList>(); - String publishedManagementStandardIds = ""; - String publishedTechnicalStandardIds = ""; - String publishedWorkStandardIds = ""; - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { - String managementStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD); - publishedManagementStandardIds = getRelationPublishedControlIds(wsId, managementStandardId, "control.policy"); - } - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD)) { - String technicalStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD); - publishedTechnicalStandardIds = getRelationPublishedControlIds(wsId, technicalStandardId, "control.policy"); - } - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_WORK_STANDARD)) { - String workStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_WORK_STANDARD); - publishedWorkStandardIds = getRelationPublishedControlIds(wsId, workStandardId, "control.policy"); - } - - List> list = publisherDao.getPublishListData(sqlIds, "control", wsId, "control.policy"); - if (list != null && list.size() > 0) { - for (Map map : list) { - String id = map.get("id").toString(); - if (publishedManagementStandardIds.contains(id)) { - managementRoleList.add(map); - } else if (publishedTechnicalStandardIds.contains(id)) { - technicalRoleList.add(map); - } else if (publishedWorkStandardIds.contains(id)) { - workRoleList.add(map); - } - - } - } - data.put("managementList", managementRoleList); - data.put("technicalList", technicalRoleList); - data.put("workList", workRoleList); - } else { - data.put("managementList", new ArrayList()); - data.put("technicalList", new ArrayList()); - data.put("workList", new ArrayList()); - } - } - - return data; - } - - PALRepositoryModel orgModel = PALRepositoryCache.getCache().get(orgModelId); - String wsId = orgModel.getWsId(); - if (orgModel != null) { - List orgList = new ArrayList(); - PALRepositoryQueryAPIManager.getInstance().getAllUsedPalRepositoryModelsByPid(wsId, orgModelId, orgList); //组织模型的所有子流程 - StringBuilder sbOrgIds = new StringBuilder("'" + orgModelId + "'"); - if (orgList != null && orgList.size() > 0) { - for (PALRepositoryModel model : orgList) { - sbOrgIds.append(",'").append(model.getId()).append("'"); - } - } - //流程模型 - PublisherClientDao publisherDao = new PublisherClientDao(); - List> processIdList = publisherDao.getFileIdsByRelationFileId1(sbOrgIds.toString()); //org模型关联的流程模型Id - List> processList = publisherDao.getFileIdsByRelation1(sbOrgIds.toString()); - String processIds = ""; //processIds保存org模型关联的所有process模型Id,包括已发布和未发布的 - if (processIdList != null && processIdList.size() > 0) { - StringBuilder sbProcessIds = new StringBuilder(); - for (Map processMap : processIdList) { - String processId = processMap.get("id").toString(); - sbProcessIds.append("'").append(processId).append("',"); - } - processIds = sbProcessIds.substring(0, sbProcessIds.lastIndexOf(",")); - } - data.put("processIds", processIds); - List> processOrgList = new ArrayList>(); - if (processList != null) { - for (Map map : processList) { - if (modelIds.contains(map.get("id").toString())) { - processOrgList.add(map); - } - } - } - data.put("processList", processOrgList); - - //根据流程模型,获取关联的制度模型 - Map controlPolicyIds = publisherDao.getControlPolicyId(wsId); - //管理标准 - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { - String managementStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD); - String publishedManagementStandardIds = getRelationPublishedControlIds(wsId, managementStandardId, "control.policy"); - List> managementList = publisherDao.getRelationFileIds(processIds, publishedManagementStandardIds); - List> managementRoleList = new ArrayList>(); - if (managementList != null && managementList.size() > 0) { - for (Map managementMap : managementList) { - String id = managementMap.get("id").toString(); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (modelIds.contains(model.getVersionId())) { - managementRoleList.add(managementMap); - } - } - } - data.put("managementList", managementRoleList); - } else { - data.put("managementList", new ArrayList()); - } - //技术标准 - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD)) { - String technicalStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD); - String publishedTechnicalStandardIds = getRelationPublishedControlIds(wsId, technicalStandardId, "control.policy"); - List> technicalList = publisherDao.getRelationFileIds(processIds, publishedTechnicalStandardIds); - List> technicalRoleList = new ArrayList>(); - if (technicalList != null && technicalList.size() > 0) { - for (Map managementMap : technicalList) { - String id = managementMap.get("id").toString(); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (modelIds.contains(model.getVersionId())) { - technicalRoleList.add(managementMap); - } - } - } - data.put("technicalList", technicalRoleList); - } else { - data.put("technicalList", new ArrayList()); - } - //工作标准 - if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_WORK_STANDARD)) { - String workStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_WORK_STANDARD); - String publishedWorkStandardIds = getRelationPublishedControlIds(wsId, workStandardId, "control.policy"); - List> workList = publisherDao.getRelationFileIds(processIds, publishedWorkStandardIds); - List> workRoleList = new ArrayList>(); - if (workList != null && workList.size() > 0) { - for (Map managementMap : workList) { - String id = managementMap.get("id").toString(); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (modelIds.contains(model.getVersionId())) { - workRoleList.add(managementMap); - } - } - } - data.put("workList", workRoleList); - } else { - data.put("workList", new ArrayList()); - } - } - return data; - } - - private String getRelationPublishedControlIds(String wsId, String pid, String methodId) { - List standardList = new ArrayList(); - PALRepositoryQueryAPIManager.getInstance().getAllPublishedPalRepositoryModelsByPid(wsId, pid, standardList); - String ids = ""; //已经发布的管理标准 - StringBuilder sbStandardIds = new StringBuilder("'" + pid + "'"); - if (standardList != null && standardList.size() > 0) { - for (PALRepositoryModel model : standardList) { - if (methodId == null || "".equals(methodId) || methodId.equals(model.getMethodId())) { - sbStandardIds.append(",'").append(model.getId()).append("'"); - } - } - } - ids = sbStandardIds.toString(); - return ids; - } - - /** - * 按组织维护流程 - * - * @param wsId - * @return - */ - public String getManageHome(String wsId, String categorys) { - Map result = new HashMap(); - result.put("sid", _uc.getSessionId()); - JSONArray treeData = new JSONArray(); - if (UtilString.isEmpty(wsId)) { - wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); - } - result.put("wsId", wsId); - //根节点 - String[] categoryArray = categorys.split(","); - for (String category : categoryArray) { - category = category.trim(); - JSONObject categoryRoot = new JSONObject(); - categoryRoot.put("id", category); - categoryRoot.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); - categoryRoot.put("open", false); - categoryRoot.put("nocheck", true); - treeData.add(categoryRoot); - - //查询部门下的流程根节点 - List list = PALRepositoryQueryAPIManager.getInstance().getRootPALRepositoryModelsByDeptId(_uc.getUID(), wsId, null, category, true, false); - List newList = new ArrayList(); - for (PALRepositoryModel process : list) { - PALRepositoryModelImpl newProcess = (PALRepositoryModelImpl) process; - newProcess.setNewParentId(category); - newList.add((PALRepositoryModel) newProcess); - } - treeData.addAll(PALRepositoryQueryAPIManager.getInstance().list2Json(_uc, newList, true, false)); - } - result.put("treeData", treeData); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.manage.home.html", result); - } - - /** - * 已发布流程查询 - * - * @param wsId - * @param categorys - * @return - */ - public String getManageSearchHome(String wsId, String categorys) { - Map result = new HashMap(); - result.put("sid", _uc.getSessionId()); - if (UtilString.isEmpty(wsId)) { - wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); - } - - JSONArray treeData = new JSONArray(); - PALRepositoryQueryAPIManager manager = PALRepositoryQueryAPIManager.getInstance(); - PALRepository dao = new PALRepository(); - String[] categoryList = categorys.split(","); - StringBuilder filePerms = new StringBuilder(""); - for (String category : categoryList) { - category = category.trim(); - - JSONObject root = new JSONObject(); - root.put("id", category); - root.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); - root.put("open", false); - treeData.add(root); - - List repositoryModelList = dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, null, "PLNO"); - for (PALRepositoryModel model : repositoryModelList) { - filePerms.append(model.getId()).append(","); - } - List newList = manager.setNewPid(repositoryModelList); - treeData.addAll(manager.list2Json(_uc, newList, false, true)); - } - - result.put("treeData", treeData); - result.put("filePerms", filePerms); - - result.put("wsId", wsId); - result.put("processRootId", SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "processRootId")); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.search.home.html", result); - } - - /** - * 已发布流程查询 - * - * @param wsId - * @param categorys - * @return - */ - public String getManageSearchHomeCondition(String wsId, String categorys) { - Map result = new HashMap(); - result.put("sid", _uc.getSessionId()); - if (UtilString.isEmpty(wsId)) { - wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); - } - - JSONArray treeData = new JSONArray(); - PALRepositoryQueryAPIManager manager = PALRepositoryQueryAPIManager.getInstance(); - PALRepository dao = new PALRepository(); - String[] categoryList = categorys.split(","); - StringBuilder filePerms = new StringBuilder(""); - for (String category : categoryList) { - category = category.trim(); - - JSONObject root = new JSONObject(); - root.put("id", category); - root.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); - root.put("open", false); - treeData.add(root); - - JSONArray params = new JSONArray(); - JSONObject param1 = new JSONObject(); - param1.put("key", "securityclass"); - param1.put("value", "='内部'"); - params.add(param1); - List repositoryModelList = dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, params, "PLNO"); - params = new JSONArray(); - JSONObject param2 = new JSONObject(); - param2.put("key", "securityclass"); - param2.put("value", "='外部公开'"); - params.add(param2); - repositoryModelList.addAll(dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, params, "PLNO")); - for (PALRepositoryModel model : repositoryModelList) { - filePerms.append(model.getId()).append(","); - } - List newList = manager.setNewPid(repositoryModelList); - treeData.addAll(manager.list2Json(_uc, newList, false, true)); - } - - result.put("treeData", treeData); - result.put("filePerms", filePerms); - - result.put("wsId", wsId); - result.put("processRootId", SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "processRootId")); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.search.home.html", result); - } - - private boolean isEmpty(List list) { - return list == null || list.size() == 0; - } - - /** - * 获取当前人权限下的模型id - * 条件: - * 1.模型中有节点关联的是AWS平台的人员且人员与当前人相同 - * 2.模型中有关联节点是角色,且角色是当前人员的所属角色(包括兼职角色) - * 3.模型的文件属性中的责任人是当前人 - * 4.获取的流程文件的当前版本必须是已发布 - * @param uc - * @return - */ - private Set getAwsOrgPermRepositoryByUser(UserContext uc, String category, boolean isPublish) { - Set result = new HashSet<>(); - // 获取当前人的所有角色 - String userId = uc.getUID(); - Set roleIds = new HashSet<>(); - RoleModel roleModel = uc.getRoleModel(); - roleIds.add(roleModel.getId()); - // 兼职角色 - List userMapModels = UserMapCache.getMapListOfUser(userId); - if (!isEmpty(userMapModels)) { - for (UserMapModel role : userMapModels) { - roleIds.add(role.getRoleId()); - } - } - // 条件1,2,4 - List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); - if (!isEmpty(list)) { - for (DesignerShapeRelationModel model : list) { - JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); - if ("user".equalsIgnoreCase(object.getString("type")) && uc.getUID().equals(object.getString("id"))) { - PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); - if (p != null) { - if (isPublish) { - if (p.isPublish()) { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } else { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } - } - if ("role".equalsIgnoreCase(object.getString("type")) && roleIds.contains(object.getString("id"))) { - PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); - if (p != null) { - if (isPublish) { - if (p.isPublish()) { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } else { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } - } - } - } - // 条件3,4 - CoeWorkSpace workSpace = new CoeWorkSpace(); - List wsList = workSpace.getNormalCoeWorkSpaceModelRecodes(); - if (!isEmpty(wsList)) { - for (CoeWorkSpaceModel model : wsList) { - Iterator iterator = PALRepositoryCache.getByWsId(model.getUUId()); - while (iterator.hasNext()) { - PALRepositoryModel pModel = iterator.next(); - if (pModel != null && pModel.getMethodCategory().equals(category) && userId.equals(pModel.getDutyUser())) { - if (isPublish) { - if (pModel.isPublish()) { - result.add(pModel.getId()); - } - } else { - result.add(pModel.getId()); - } - } - } - } - } - return result; - } - - /** - * 获取当前人权限下的模型id - * 条件: - * 1.模型中有节点关联的是AWS平台的人员且人员与当前人相同 - * 2.模型中有关联节点是角色,且角色是当前人员的所属角色(包括兼职角色) - * 3.获取的流程文件的当前版本必须是已发布 - * @param uc - * @return - */ - private Set getAwsOrgPermRealtionRepositoryByUser(UserContext uc, String category, boolean isPublish) { - Set result = new HashSet<>(); - // 获取当前人的所有角色 - String userId = uc.getUID(); - Set roleIds = new HashSet<>(); - RoleModel roleModel = uc.getRoleModel(); - roleIds.add(roleModel.getId()); - // 兼职角色 - List userMapModels = UserMapCache.getMapListOfUser(userId); - if (!isEmpty(userMapModels)) { - for (UserMapModel role : userMapModels) { - roleIds.add(role.getRoleId()); - } - } - // 条件1,2,3 - List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); - if (!isEmpty(list)) { - for (DesignerShapeRelationModel model : list) { - JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); - if ("user".equalsIgnoreCase(object.getString("type")) && uc.getUID().equals(object.getString("id"))) { - PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); - if (p != null) { - if (isPublish) { - if (p.isPublish()) { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } else { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } - } - if ("role".equalsIgnoreCase(object.getString("type")) && roleIds.contains(object.getString("id"))) { - PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); - if (p != null) { - if (isPublish) { - if (p.isPublish()) { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } else { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } - } - } - } - return result; - } - - /** - * 获取责任人是当前人的模型id - * 条件: - * 1.模型的文件属性中的责任人是当前人 - * @param uc - * @return - */ - private Set getPermRepositoryByDutyPerson(UserContext uc, String category, boolean isPublish) { - Set result = new HashSet<>(); - // 获取当前人的所有角色 - String userId = uc.getUID(); - // 条件3,4 - CoeWorkSpace workSpace = new CoeWorkSpace(); - List wsList = workSpace.getNormalCoeWorkSpaceModelRecodes(); - if (!isEmpty(wsList)) { - for (CoeWorkSpaceModel model : wsList) { - Iterator iterator = PALRepositoryCache.getByWsId(model.getUUId()); - while (iterator.hasNext()) { - PALRepositoryModel pModel = iterator.next(); - if (pModel != null && pModel.getMethodCategory().equals(category) && userId.equals(pModel.getDutyUser())) { - if (isPublish) { - if (pModel.isPublish()) { - result.add(pModel.getId()); - } - } else { - result.add(pModel.getId()); - } - } - } - } - } - return result; - } - - /** - * 获取当前人给定部门时权限下的模型id - * 模型中有关联节点是部门,且角色是当前人员的所属角色(包括兼职角色) - * @param uc - * @param category - * @param deptId - * @return - */ - private Set getAwsOrgPermRepositoryByDept(UserContext uc, String category, String deptId, boolean isPublish) { - Set result = new HashSet<>(); - List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); - if (!isEmpty(list)) { - for (DesignerShapeRelationModel model : list) { - JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); - if ("department".equalsIgnoreCase(object.getString("type")) && deptId.equals(object.getString("id"))) { - PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); - if (p != null && p.isPublish()) { - if (isPublish) { - if (p.isPublish()) {// 已发布 - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } else { - if (UtilString.isEmpty(category)) { - result.add(p.getId()); - } else { - if (p.getMethodCategory().equals(category)) { - result.add(p.getId()); - } - } - } - } - } - } - } - return result; - } - - /** - * 获取当前人权限下的资产库id集合 - * @param uc - * @return - */ - private Set getAwsOrgPermWsByUser(UserContext uc, String category) { - Set wsIds = new HashSet<>(); - Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true); - for (String repositoryId : repositoryIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(repositoryId); - if (model != null && PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(model.getWsId())) - wsIds.add(model.getWsId()); - } - return wsIds; - } - - /** - * 根据userId获取具有权限的已发布资产库 - * @return - */ - private List> getPermRepositoryVersionIdByUser(UserContext uc, String roleId) { - // 获取资产库流程Id - PALRepository dao = new PALRepository(); - List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true, true); // 有访问权限的资产库 - if (wsList != null && wsList.size() > 0) { - List> removeList = new ArrayList>(); - for (Map ws : wsList) { - boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); - if (!isActive) { - removeList.add(ws); - } - } - wsList.removeAll(removeList); - } - return wsList; - } - - /** - * 根据userId获取具有权限的已发布资产库 - * pal自身权限+关联AWS平台权限 - * @return - */ - private List> getPalAndAwsPermRepositoryVersionIdByUser(UserContext uc, String roleId, String category) { - // 获取资产库流程Id - PALRepository dao = new PALRepository(); - //List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true, true); // 有访问权限的资产库 - List> wsList = dao.getWorkSpaceListByPublishRole(roleId, false, true); // 有访问权限的资产库(发布+未发布) - if (wsList != null && wsList.size() > 0) { - List> removeList = new ArrayList>(); - for (Map ws : wsList) { - boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); - if (!isActive) { - removeList.add(ws); - } - } - wsList.removeAll(removeList); - } - // 关联AWS组织的资产库权限整合 - if (wsList == null) { - wsList = new ArrayList<>(); - } - Set wsIds = getAwsOrgPermWsByUser(uc, category); - if (wsIds.size() > 0) { - Set temp = new HashSet<>(); - for (Map ws : wsList) { - temp.add(ws.get("wsId")); - } - CoeWorkSpace wsDao = new CoeWorkSpace(); - for (String wsId : wsIds) { - if (!temp.contains(wsId)) { - CoeWorkSpaceModel model = wsDao.getInstance(wsId); - if (model != null) { - Map result = new HashMap<>(); - result.put("wsId", model.getUUId()); - result.put("wsName", model.getWsName()); - wsList.add(result); - } - } - } - } - return wsList; - } - - /** - * 获取基本参数 - * @param uc - * @param count - * @return - */ - private JSONObject getXPagesBasicParam(UserContext uc, String count) { - String isIntegrationAWSUser = SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 - String roleId = ""; - if ("false".equals(isIntegrationAWSUser)) { - roleId = PublishConst.GUESTROLE; - } else { - roleId = uc.getRoleModel().getId(); - } - - boolean limit = true;// 是否限制条数,count为空则不限制 - int c = 0; - if(!UtilString.isEmpty(count)){ - c = Integer.parseInt(count); - } else { - limit = false; - } - JSONObject object = new JSONObject(); - object.put("roleId", roleId); - object.put("c", c); - object.put("limit", limit); - return object; - } - - /** - * 常用流程查询 - * xpages小页面 - * @param count - * @return - */ - public String commonProcessQuery(UserContext uc, String count) { - String category = "process"; - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - JSONObject param = getXPagesBasicParam(uc, count); - String roleId = param.getString("roleId"); - boolean limit = param.getBooleanValue("limit"); - int c = param.getIntValue("c"); - PublishListHistory pHistory = new PublishListHistory(); - JSONArray array = new JSONArray(); - // 获取常用流程数据 - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); - if (wsList != null && wsList.size() > 0) { - PublishCommonDao commonDao = new PublishCommonDao(); - - StringBuffer wsIds = new StringBuffer(); - String sqlParam = ""; - for (Map map : wsList) { - wsIds.append("'").append(map.get("wsId")).append("'").append(","); - } - if (wsIds.length() > 0) { - sqlParam = wsIds.substring(0, wsIds.length() - 1); - } - // 获取降序排列的数据 - Object [] commons = commonDao.getCommonDataByWsIds(sqlParam, category); - @SuppressWarnings("unchecked") - List list = (ArrayList) commons[0];// 按照设定顺序升序排序的id集合 - JSONObject datas = (JSONObject) commons[1]; - if (list != null && list.size() > 0) { - PALRepository repositoryDao = new PALRepository(); - Set versionIds = repositoryDao.getRepositoryVersionIdListByPublishRole(roleId, sqlParam, category); - Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 - for (String str : repositoryIds) { - versionIds.add(PALRepositoryCache.getCache().get(str).getVersionId()); - } - int index = 0; - List list1 = new ArrayList<>(); - for (String id : list) { - if (limit && index >= c) break; - JSONObject data = datas.getJSONObject(id); - int sort = data.getIntValue("sort"); - //将sort为0的数据单独提出来 - if (sort == 0) { - list1.add(data); - continue; - } - List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); - if (temps == null || temps.size() == 0) continue; - for (PALRepositoryModel model : temps) { - if (model.isPublish() && versionIds.contains(model.getVersionId())) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("versionId", model.getVersionId()); - object.put("method", model.getMethodId()); - object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); - String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - index++; - break; - } - } - } - //将sort为0的数据放在数组的末尾 - for (JSONObject data:list1) { - if (limit && index >= c) break; - List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); - if (temps == null || temps.size() == 0) continue; - for (PALRepositoryModel model : temps) { - if (model.isPublish() && versionIds.contains(model.getVersionId())) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("versionId", model.getVersionId()); - object.put("method", model.getMethodId()); - object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); - String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - index++; - break; - } - } - } - } - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.common.html", result); - } - - /** - * 高频流程查询 - * @param uc - * @param count - * @return - */ - public String frequencyProcessQuery(UserContext uc, String count) { - String category = "process"; - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - JSONObject param = getXPagesBasicParam(uc, count); - String roleId = param.getString("roleId"); - boolean limit = param.getBooleanValue("limit"); - int c = param.getIntValue("c"); - - JSONArray array = new JSONArray(); - // 获取高频流程记录数据 - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); - if (wsList != null && wsList.size() > 0) { - PublishFrequencyDao frequencyDao = new PublishFrequencyDao(); - StringBuffer wsIds = new StringBuffer(); - String sqlParam = ""; - for (Map map : wsList) { - wsIds.append("'").append(map.get("wsId")).append("'").append(","); - } - if (wsIds.length() > 0) { - sqlParam = wsIds.substring(0, wsIds.length() - 1); - } - Object [] frequencyModels = frequencyDao.getDatasOrderByCount(sqlParam, category); - @SuppressWarnings("unchecked") - List list = (ArrayList) frequencyModels[0];// 按照访问量降序排序的id集合 - JSONObject datas = (JSONObject) frequencyModels[1]; - PublishListHistory pHistory = new PublishListHistory(); - // 获取所有节点 - if (list != null && list.size() > 0) { - PALRepository repositoryDao = new PALRepository(); - Set versionIds = repositoryDao.getRepositoryVersionIdListByPublishRole(roleId, sqlParam, category); - Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 - for (String str : repositoryIds) { - versionIds.add(PALRepositoryCache.getCache().get(str).getVersionId()); - } - int index = 0; - for (String id : list) { - if (limit && index >= c) break; - JSONObject data = datas.getJSONObject(id); - List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); - if (temps == null || temps.size() == 0) continue; - for (PALRepositoryModel model : temps) { - if (model.isPublish() && versionIds.contains(model.getVersionId())) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("versionId", model.getVersionId()); - object.put("count", data.getString("count")); - object.put("method", model.getMethodId()); - object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); - String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - index++; - break; - } - } - } - } - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.frequency.html", result); - } - - /** - * 系统、数据、组织、控制模型查询 - * @param count - * @return - */ - public String queryDataBycategory(UserContext uc, String count, String category, String page) { - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - JSONObject param = getXPagesBasicParam(uc, count); - String roleId = param.getString("roleId"); - boolean limit = param.getBooleanValue("limit"); - int c = param.getIntValue("c"); - JSONArray array = new JSONArray(); - // 获取系统模型数据 - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); - if (wsList != null && wsList.size() > 0) { - - StringBuffer wsIds = new StringBuffer(); - String sqlParam = ""; - for (Map map : wsList) { - wsIds.append("'").append(map.get("wsId")).append("'").append(","); - } - if (wsIds.length() > 0) { - sqlParam = wsIds.substring(0, wsIds.length() - 1); - } - int index = 0; - PALRepository dao = new PALRepository(); - List plList = dao.getRepositoryListByPublishRoleAndCategory(roleId, sqlParam, category); - Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 - // 整合PAL自身权限文件和关联AWS的权限文件 - if (repositoryIds != null && repositoryIds.size() > 0) { - // 整合完成之后重新排序,按照发布时间,层级,顺序排序 - if (plList == null) { - plList = new ArrayList<>(); - } - Set idSet = new HashSet<>(); - for (PALRepositoryModel plModel : plList) { - idSet.add(plModel.getId()); - } - for (String id : repositoryIds) { - if (!idSet.contains(id)) { - plList.add(PALRepositoryCache.getCache().get(id)); - } - } - // 排序 - Collections.sort(plList, new Comparator() { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - Timestamp p1 = o1.getPublishDate(); - Timestamp p2 = o2.getPublishDate(); - if (!p1.equals(p2)) { - return p2.compareTo(p1); - } - int level1 = o1.getLevel(); - int level2 = o2.getLevel(); - if (level1 != level2) { - return level1 - level2; - } - int order1 = o1.getOrderIndex(); - int order2 = o2.getOrderIndex(); - return order1 - order2; - } - }); - } - if (plList != null && plList.size() > 0) { - for (PALRepositoryModel plModel : plList) { - JSONObject object = new JSONObject(); - object.put("id", plModel.getId()); - object.put("name", plModel.getName()); - object.put("versionId", plModel.getVersionId()); - object.put("date", plModel.getPublishDate() == null ? "" : plModel.getPublishDate()); - object.put("method", plModel.getMethodId()); - object.put("taskId", ""); - array.add(object); - index++; - if (limit && index >= c) { - break; - } - } - } - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages." + page + ".html", result); - } - - - - /** - * 发布动态 - * @param count - * @return - */ - public String queryNotificationData(UserContext uc, String start, String count) { - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - JSONObject param = getXPagesBasicParam(uc, count); - String roleId = param.getString("roleId"); - int startNum = -1; - if (!UtilString.isEmpty(start)) { - startNum = Integer.parseInt(start); - } - int limitNum = 10; - if (!UtilString.isEmpty(count)) { - limitNum = Integer.parseInt(count); - } - JSONArray array = new JSONArray(); - PublishListHistory dao = new PublishListHistory(); - // 获取所有的发布历史 - List modelList = dao.getPublishListHistory(); - if (!isEmpty(modelList)) { - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - palProcessIds.add(model.getId()); - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(uc, null, true); - // 整合所有权限 - for (String id : awsProcessIds) { - String tempVer = PALRepositoryCache.getCache().get(id).getVersionId(); - if (!palProcessIds.contains(tempVer)) { - palProcessIds.add(tempVer); - } - } - int index = 0; - for (PublishListHistoryModel model : modelList) { - if (index >= limitNum) { - break; - } - if (!palProcessIds.contains(model.getPalRepositoryId())) - continue; - PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(model.getPalRepositoryId()); - if (repositoryModel == null) { - continue; - } - JSONObject object = new JSONObject(); - String actionType = model.getActionType(); - object.put("type", actionType); - object.put("date", model.getPublishDate()); - String intro = ""; - if ("N".equals(actionType)) { - intro = "新发布"; - } else if ("C".equals(actionType)) { - intro = "变更"; - } else if ("S".equals(actionType)) { - intro = "停用"; - } - object.put("intro", intro); - object.put("method", repositoryModel.getMethodId()); - object.put("desc", model.getPublishDesc()); - object.put("pid", model.getpId()); - PublishHistoryModel pModel = PublishHistoryCache.getModel(model.getpId()); - object.put("pDesc", pModel.getPublishDesc()); - object.put("id", model.getPalRepositoryId()); - object.put("name", repositoryModel.getName()); - object.put("version", VersionUtil.getVersionStr(repositoryModel.getVersion())); - object.put("isPublish", repositoryModel.isPublish() ? "1" : "0"); - String taskId = model.getTaskId(); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - index ++; - } - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.notification.html", result); - } - - /** - * xpages配置流程地图时查询资产库列表和平台单位列表 - * @param uc - * @return - */ - public String processmapWsAndOrgDataQuery(UserContext uc) { - ResponseObject ro = ResponseObject.newOkResponse(); - // 获取启用中的资产库 - List wsList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getCoeWorkSpaceModelRecodesNoPage(); - JSONArray wsArray = new JSONArray(); - if (!isEmpty(wsList)) { - for (CoeWorkSpaceModel ws : wsList) { - if (ws.getWsState() == 0) { - JSONObject object = new JSONObject(); - object.put("text", ws.getWsName()); - object.put("id", ws.getUUId()); - wsArray.add(object); - } - } - } - // 获取未注销的平台单位 - List cList = SDK.getORGAPI().getCompanys(); - JSONArray orgArray = new JSONArray(); - if (!isEmpty(cList)) { - for (CompanyModel company: cList) { - JSONObject object = new JSONObject(); - object.put("text", company.getName()); - object.put("id", company.getId()); - orgArray.add(object); - } - } - ro.put("wsData", wsArray); - ro.put("orgData", orgArray); - return ro.toString(); - } - - /** - * 流程地图 - * @param orgId - * @param wsId - * @return - */ - public String queryProcessmapData(UserContext uc, String wsId, String orgId) { - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - // 获取资产库一级流程 - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, "process"); - // wsId在wsList内则取wsId,不在则取wsList中第一个元素 - if (wsList != null && wsList.size() > 0) { - Set wsIds = new HashSet<>(); - for (Map map : wsList) { - wsIds.add(map.get("wsId")); - } - if (UtilString.isEmpty(wsId) || !wsIds.contains(wsId)) { - wsId = wsList.get(0).get("wsId"); - } - } - // 获取三个一级流程 - JSONArray processData = getUsedModelsByPid(roleId, wsId, "process"); - result.put("processData", processData); - - // 获取组织架构 - List orgList = SDK.getORGAPI().getCompanys(); - if (orgList != null && orgList.size() > 0) { - Set orgIds = new HashSet<>(); - for (int i = 0; i < orgList.size(); i++) { - if (orgList.get(i).isClosed()) { - continue; - } - orgIds.add(orgList.get(i).getId()); - } - if (UtilString.isEmpty(orgId) || !orgIds.contains(orgId)) { - orgId = orgList.get(0).getId(); - } - } - // 获取三个部门 - JSONArray deptData = getDeptsByCompany(orgId); - result.put("deptData", deptData); - result.put("wsId", wsId); - result.put("orgId", orgId); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.processmap.html", result); - } - - /** - * 获取3个一级部门 - * @param orgId - * @return - */ - private JSONArray getDeptsByCompany(String orgId) { - JSONArray result = new JSONArray(); - List list = SDK.getORGAPI().getDepartmentsByCompanyId(1, orgId); - int index = 0; - for (DepartmentModel model : list) { - if (model.isClosed()) { - continue; - } - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - result.add(object); - index++; - if (index >= 3) { - break; - } - } - return result ; - } - - // 当同一个version流程存在已发布和使用中的,过滤掉使用中的 - private List filterPublisherData(List list) { - if (list != null && list.size() > 0) { - List tempList = new ArrayList<>(); - Set idSet = new HashSet<>(); - for (PALRepositoryModel model : list) { - if (model.isPublish()) { - idSet.add(model.getVersionId()); - tempList.add(model); - } - } - for (PALRepositoryModel model : list) { - if (model.isUse() && !idSet.contains(model.getVersionId())) { - tempList.add(model); - } - } - list = tempList; - } - return list; - } - - /** - * 获取3个一级流程 - * @param wsId - * @param parentId - * @return - */ - private JSONArray getUsedModelsByPid(String roleId, String wsId, String parentId) { - JSONArray result = new JSONArray(); - if (!UtilString.isEmpty(wsId)) { - @SuppressWarnings("unchecked") - List list = IteratorUtils.toList(PALRepositoryCache.getByPid(wsId, "process")); - list = filterPublisherData(list); - if (list != null && list.size() > 0) { - // 排列 - Collections.sort(list, new Comparator() { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0; - } - }); - PALRepository dao = new PALRepository(); - Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); - Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); - if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { - for (String awsId : relationAwsIdSet) { - idSet.add(awsId); - } - } - int index = 0; - for (PALRepositoryModel model : list) { - boolean flag = false; - if (model.isPublish() && idSet.contains(model.getVersionId())) { - flag = true; - } else { - Set ids = new HashSet<>(); - List subList = new ArrayList<>(); - PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); - if (subList != null && subList.size() > 0) { - for (PALRepositoryModel subModel : subList) { - if (subModel.isPublish() && idSet.contains(subModel.getVersionId())) { - flag = true; - break; - } - } - } - } - if (flag) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - result.add(object); - index++; - } - if (index >= 3) { - break; - } - } - } - } - return result; - } - - /** - * 搜索 - * @param uc - * @param text 搜索文本 - * @param type 类型 - * @param templateId xpagesId - * @param wsId 默认展示的流程资产库id - * @return - */ - public String search(UserContext uc, String text, String type, String templateId, String wsId) { - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - result.put("text", text); - result.put("type", type); - result.put("templateId", templateId); - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); - JSONArray ws = new JSONArray(); - if (wsList != null && wsList.size() > 0) { - for (int i = 0; i < wsList.size(); i++) { - JSONObject object = new JSONObject(); - object.put("id", wsList.get(i).get("wsId")); - object.put("text", wsList.get(i).get("wsName")); - if(wsId!=null && wsId.equals(wsList.get(i).get("wsId"))) { - object.put("initDisplay", "1"); //默认使用的流程资产库 - } else { - object.put("initDisplay", "0"); - } - ws.add(object); - } - } - result.put("ws", ws); - - JSONArray scope = new JSONArray(); - JSONObject object = new JSONObject(); - object.put("name", "已发布文件"); - object.put("type", "all"); - scope.add(object); - - // alsp获取xpages数据 - // 调用App - String sourceAppId = PublisherConf.APPID; - // aslp服务地址 - String aslp = "aslp://com.actionsoft.apps.addons.xpages/queryCwListByTemplateId"; - // 参数定义列表 - Map params = new HashMap(); - //模板id,必填 - params.put("templateId", templateId); - params.put("sid", uc.getSessionId()); - AppAPI appAPI = SDK.getAppAPI(); - //查询模板信息 - ResponseObject xpagesList = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); - JSONObject data = JSONObject.parseObject(xpagesList.toDataString()); - JSONArray cwList = data.getJSONArray("cwList"); - for (int i = 0; i < cwList.size(); i++) { - JSONObject obj = cwList.getJSONObject(i).getJSONArray("subList").getJSONObject(0); - JSONObject obj2 = new JSONObject(); - if (obj.getString("cwUrl").contains("com.actionsoft.apps.publisher_xpages_banner_msg")) { - continue; - } - obj2.put("name", obj.getString("cwName")); - String url = obj.getString("cwUrl"); - if (!url.contains("com.actionsoft.apps.publisher_xpages_")) {// 识别PAL流程发布默认的xpages - continue; - } - String type2 = url.substring(url.indexOf("xpages_") + 7, url.indexOf("_msg")); - obj2.put("type", type2); - scope.add(obj2); - } - result.put("scope", scope); - JSONObject logoObject = getLogoImgPath(uc); - result.put("logoImgPath", logoObject.getString("src")); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.search.html", result); - } - - /** - * 查询数据 - * @param searchText - * @param searchType - * @param searchWsId - * @param start - * @param pageLimit - * @return - */ - public String searchData(UserContext uc, String searchText, String searchType, String searchWsId, int start, int pageLimit) { - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - String wsIdsql = ""; - if (UtilString.isEmpty(searchWsId)) { - // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); - if (wsList != null && wsList.size() > 0) { - StringBuffer wsIds = new StringBuffer(); - for (Map map : wsList) { - wsIds.append("'").append(map.get("wsId")).append("'").append(","); - } - if (wsIds.length() > 0) { - wsIdsql = wsIds.substring(0, wsIds.length() - 1); - } - } - } else { - wsIdsql = "'" + searchWsId + "'"; - } - switch (searchType) { - case "all":// 已发布文件 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, null); - case "common":// 常用流程 - return getPublishedCommonData(searchText, wsIdsql, roleId, start, pageLimit, "process"); - case "frequency":// 高频流程 - return getPublishedFrequencyData(searchText, wsIdsql, roleId, start, pageLimit, "process"); - case "system":// 系统地图 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "itsystem"); - case "data":// 数据地图 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "data"); - case "control":// 控制地图 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "control"); - case "org":// 组织地图 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "org"); - case "processmap":// 流程地图 - return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "process"); - default:// 通知公告 - return getPublishNotificationData(searchText, wsIdsql, roleId, start, pageLimit, null); - } - } - - private String getPublishNotificationData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { - ResponseObject ro = ResponseObject.newOkResponse(); - PublishListHistory dao = new PublishListHistory(); - List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, searchText); - - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - palProcessIds.add(model.getId()); - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, null, true); - // 整合所有权限 - for (String id : awsProcessIds) { - String tempVer = PALRepositoryCache.getCache().get(id).getVersionId(); - if (!palProcessIds.contains(tempVer)) { - palProcessIds.add(tempVer); - } - } - - // 过滤最终结果 - List list = new ArrayList<>(); - for (JSONObject object : modelList) { - String repositoryId = object.getString("repositoryId"); - if (palProcessIds.contains(repositoryId)) { - list.add(object); - } - } - List subList = null; - int end = start + pageLimit; - if (start > list.size() - 1) { - subList = new ArrayList<>(); - } else if (list.size() >= end) { - subList = list.subList(start, end); - } else { - subList = list.subList(start, list.size()); - } - JSONArray result = new JSONArray(); - for (JSONObject object : subList) { - JSONObject object2 = new JSONObject(); - String repositoryId = object.getString("repositoryId"); - PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); - object2.put("id", palModel.getId()); - object2.put("version", palModel.getVersion()); - String userName = ""; - if (UserCache.getModel(object.getString("userId")) != null) { - userName = UserCache.getModel(object.getString("userId")).getUserName(); - } - - String actionType = object.getString("actionType"); - String intro = ""; - switch (actionType) { - case "N": - intro = "新发布"; - break; - case "C": - intro = "变更"; - break; - default:// S - intro = "停用"; - break; - } - object2.put("name", palModel.getName() + "[" + intro + "]"); - object2.put("user", userName); - object2.put("dept", getDeptPath(object.getString("userId"))); - object2.put("date", object.getTimestamp("publishDate")); - object2.put("desc", object.getString("publishDesc")); - object2.put("isPublish", palModel.isPublish() ? "1" : "0"); - object2.put("taskId", object.containsKey("taskId") ? object.getString("taskId") : ""); - // 获取路径 - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - sBuilder.append(palModel.getName()); - idSets.add(palModel.getId()); - getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 - object2.put("path", sBuilder.toString()); - result.add(object2); - } - ro.put("data", result); - ro.put("count", result.size()); - return ro.toString(); - } - - /** - * 获取部门路径 - * @param userId - * @return - */ - private String getDeptPath(String userId) { - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - if (!UtilString.isEmpty(userId)) { - DepartmentModel model = SDK.getORGAPI().getDepartmentByUser(userId); - sBuilder.append(model.getName()); - idSets.add(model.getId()); - getDeptPath(model, sBuilder, idSets); - } - return sBuilder.toString(); - } - - private void getDeptPath(DepartmentModel model, StringBuilder sBuilder, Set idSets) { - if (!"0".equals(model.getId())) { - if (!idSets.contains(model.getParentDepartmentId())) { - String parentId = model.getParentDepartmentId(); - DepartmentModel parentModel = SDK.getORGAPI().getDepartmentById(parentId); - if (parentModel != null) { - sBuilder.insert(0, parentModel.getName() + ">"); - idSets.add(parentModel.getId()); - getDeptPath(parentModel, sBuilder, idSets); - } - } - } else { - sBuilder.insert(0, model.getName() + ">"); - } - } - - // 获取高频流程列表 - private String getPublishedFrequencyData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepository dao = new PALRepository(); - List list = dao.getRepositoryFrequencyListByPublishRole(wsIdsql, roleId, searchText, category); - if (list == null) { - list = new ArrayList<>(); - } - Set idSet = new HashSet<>(); - for (PALRepositoryModel model : list) { - idSet.add(model.getId()); - } - // 添加关联aws组织的流程进行合并 - boolean flag = false; - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - if (awsProcessIds != null && awsProcessIds.size() > 0) { - for (String processId : awsProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); - if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { - list.add(model); - idSet.add(model.getId()); - flag = true; - } - } - } - if (flag) {// 合并过数据则需要重新排序 - // 排序 - Collections.sort(list, new MyComparator()); - } - List subList = null; - int end = start + pageLimit; - if (start > list.size() - 1) { - subList = new ArrayList<>(); - } else if (list.size() >= end) { - subList = list.subList(start, end); - } else { - subList = list.subList(start, list.size()); - } - JSONArray result = assembleData(subList); - ro.put("data", result); - ro.put("count", result.size()); - return ro.toString(); - } - - // 获取常用流程列表 - private String getPublishedCommonData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepository dao = new PALRepository(); - // List list = dao.getRepositoryCommonListByPublishRolePagination(wsIdsql, roleId, searchText, start, pageLimit, category); - List list = dao.getRepositoryCommonListByPublishRole(wsIdsql, roleId, searchText, category); - if (list == null) { - list = new ArrayList<>(); - } - Set idSet = new HashSet<>(); - for (PALRepositoryModel model : list) { - idSet.add(model.getId()); - } - // 添加关联aws组织的流程进行合并 - boolean flag = false; - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - if (awsProcessIds != null && awsProcessIds.size() > 0) { - for (String processId : awsProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); - if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { - list.add(model); - idSet.add(model.getId()); - flag = true; - } - } - } - if (flag) {// 合并过数据则需要重新排序 - // 排序 - Collections.sort(list, new MyComparator()); - } - List subList = null; - int end = start + pageLimit; - if (start > list.size() - 1) { - subList = new ArrayList<>(); - } else if (list.size() >= end) { - subList = list.subList(start, end); - } else { - subList = list.subList(start, list.size()); - } - JSONArray result = assembleData(subList); - ro.put("data", result); - ro.put("count", result.size()); - return ro.toString(); - } - - // 获取已发布文件列表 - private String getAllPublishedData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepository dao = new PALRepository(); - List list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, searchText, category); - if (list == null) { - list = new ArrayList<>(); - } - Set idSet = new HashSet<>(); - for (PALRepositoryModel model : list) { - idSet.add(model.getId()); - } - // 添加关联aws组织的流程进行合并 - boolean flag = false; - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - if (awsProcessIds != null && awsProcessIds.size() > 0) { - for (String processId : awsProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); - if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { - list.add(model); - idSet.add(model.getId()); - flag = true; - } - } - } - if (flag) {// 合并过数据则需要重新排序 - // 排序 - Collections.sort(list, new MyComparator()); - } - List subList = null; - int end = start + pageLimit; - if (start > list.size() - 1) { - subList = new ArrayList<>(); - } else if (list.size() >= end) { - subList = list.subList(start, end); - } else { - subList = list.subList(start, list.size()); - } - JSONArray result = assembleData(subList); - ro.put("data", result); - ro.put("count", result.size()); - return ro.toString(); - } - - private class MyComparator implements Comparator { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - Timestamp p1 = o1.getPublishDate(); - Timestamp p2 = o2.getPublishDate(); - if (p1 != null && p2 != null) { - if (!p1.equals(p2)) { - return p2.compareTo(p1); - } - } - int level1 = o1.getLevel(); - int level2 = o2.getLevel(); - if (level1 != level2) { - return level1 - level2; - } - int order1 = o1.getOrderIndex(); - int order2 = o2.getOrderIndex(); - return order1 - order2; - } - } - - // 查询发布信息,拼接结果json - private JSONArray assembleData(List list) { - PublishListHistory pHistory = new PublishListHistory(); - JSONArray result = new JSONArray(); - // 获取已发布分页数据 - for (int i = 0; i < list.size(); i++) { - PALRepositoryModel model = list.get(i); - JSONObject object = pHistory.getLastPublishByModelId(model.getId()); - JSONObject object2 = new JSONObject(); - if (object != null) { - String userId = object.getString("userId"); - String userName = ""; - if (UserCache.getModel(userId) != null) { - userName = UserCache.getModel(userId).getUserName(); - } - object2.put("user", userName); - object2.put("dept", getDeptPath(userId)); - object2.put("date", object.getTimestamp("date")); - object2.put("desc", UtilString.isEmpty(object.getString("desc")) ? "" : object.getString("desc")); - object2.put("taskId", object.containsKey("taskId") ? object.getString("taskId") : ""); - } else { - object2.put("user", ""); - object2.put("dept", ""); - object2.put("date", ""); - object2.put("desc", ""); - object2.put("taskId", ""); - } - object2.put("id", model.getId()); - object2.put("name", model.getName()); - object2.put("version", model.getVersion()); - - // 获取路径 - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - sBuilder.append(model.getName()); - idSets.add(model.getId()); - getFilePath(model, sBuilder,idSets);// 递归获取当前文件名称路径 - object2.put("path", sBuilder.toString()); - result.add(object2); - } - return result; - } - - /** - * 获取文件名称全路径 - * @param model - * @return - */ - private void getFilePath(PALRepositoryModel model, StringBuilder sBuilder, Set idSets) { - if (model.getParentId().length() == 36) { - if (!idSets.contains(model.getParentId())) { - String parentId = model.getParentId(); - PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(parentId); - if (parentModel != null) { - sBuilder.insert(0, parentModel.getName() + ">"); - idSets.add(parentModel.getId()); - getFilePath(parentModel, sBuilder, idSets); - } - } - } else { - sBuilder.insert(0, I18nRes.findValue(CoEConstant.APP_ID, model.getParentId()) + ">"); - } - } - - /** - * 打开流程地图 - * @param wsId - * @param orgId - * @param type - * @return - */ - public String openProcessMapPage(UserContext uc, String wsId, String orgId, String type) { - Map macroLibraries = getHomePage2(uc); - macroLibraries.put("wsId", wsId); - // 获取权限资产库列表 - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, "process"); - // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); - JSONArray ws = new JSONArray(); - if (wsList != null && wsList.size() > 0) { - for (int i = 0; i < wsList.size(); i++) { - JSONObject object = new JSONObject(); - object.put("id", wsList.get(i).get("wsId")); - object.put("text", wsList.get(i).get("wsName")); - ws.add(object); - } - } - macroLibraries.put("ws", ws); - // 在里面则返回名称,不在里面返回空 - macroLibraries.put("orgId", orgId); - // 获取单位列表 - JSONArray org = new JSONArray(); - List orgList = SDK.getORGAPI().getCompanys(); - if (orgList != null && orgList.size() > 0) { - for (int i = 0; i < orgList.size(); i++) { - if (orgList.get(i).isClosed()) { - continue; - } - JSONObject object = new JSONObject(); - object.put("id", orgList.get(i).getId()); - object.put("text", orgList.get(i).getName()); - org.add(object); - } - } - macroLibraries.put("org", org); - macroLibraries.put("type", type); - JSONObject object = getLogoImgPath(uc); - macroLibraries.put("logoImgPath", object.getString("src")); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.html", macroLibraries); - } - - /** - * 业务架构页面 - * @param me - * @param wsId - * @return - */ - public String openProcessMapWsPage(UserContext me, String wsId) { - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - Map macroLibraries = new HashMap<>(); - macroLibraries.put("sid", me.getSessionId()); - macroLibraries.put("uid", me.getUID()); - macroLibraries.put("wsId", wsId); - JSONArray firstLevel = new JSONArray(); - JSONObject secendLevel = new JSONObject(); - if (!UtilString.isEmpty(wsId)) { - @SuppressWarnings("unchecked") - List list = IteratorUtils.toList(PALRepositoryCache.getByPid(wsId, "process")); - list = filterPublisherData(list); - if (list != null && list.size() > 0) { - Collections.sort(list, new Comparator() { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0; - } - }); - PALRepository dao = new PALRepository(); - Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); - Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); - if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { - for (String awsId : relationAwsIdSet) { - idSet.add(awsId); - } - } - for (PALRepositoryModel model : list) { - boolean flag = false; - if (model.isPublish() && idSet.contains(model.getVersionId())) { - flag = true; - } else { - Set ids = new HashSet<>(); - List subList = new ArrayList<>(); - PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); - if (subList != null && subList.size() > 0) { - for (PALRepositoryModel subModel : subList) { - if (subModel.isPublish() && idSet.contains(subModel.getVersionId())) { - flag = true; - break; - } - } - } - } - if (flag) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("versionId", model.getVersionId()); - object.put("name", model.getName()); - object.put("canOpen", idSet.contains(model.getVersionId())); - object.put("isPublish", model.isPublish()); - object.put("method", model.getMethodId()); - firstLevel.add(object); - } - } - - for (int i = 0; i < firstLevel.size(); i++) { - JSONObject firstObject = firstLevel.getJSONObject(i); - getPublishAndRoleChildModel(wsId, idSet, firstObject.getString("versionId"), secendLevel); - } - } - } - macroLibraries.put("firstLevelData", firstLevel); - macroLibraries.put("secendLevelData", secendLevel); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.ws.html", macroLibraries); - } - - /** - * 获取子级节点 - * @param wsId - * @param filterSet - * @param version - * @param result - */ - private void getPublishAndRoleChildModel(String wsId, Set filterSet, String version, JSONObject result) { - List secendList = PALRepositoryCache.getAllSubModelsByPid(wsId, version); - secendList.sort((o1, o2)-> {return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0;}); - Set useVersionIds = new HashSet<>(); - List publishVersionIds = new ArrayList<>(); - JSONArray secendArr = new JSONArray(); - for (PALRepositoryModel model : secendList) { - if (model.isUse()) { - useVersionIds.add(model.getVersionId()); - } - if (model.isPublish()) { - publishVersionIds.add(model.getVersionId()); - } - } - for (String str : useVersionIds) { - if (!publishVersionIds.contains(str)) { - publishVersionIds.add(str); - } - } - for (String versionId : publishVersionIds) { - boolean flag = false; - PALRepositoryModel model = null;// = PALRepositoryCache.getCache().get(versionId); - List models = PALRepositoryCache.getByVersionId(wsId, versionId); - if (models != null && models.size() > 0) { - PALRepositoryModel temp = null; - for (PALRepositoryModel obj : models) { - if (obj.isPublish()) { - temp = obj; - break; - } - } - if (temp == null) { - for (PALRepositoryModel obj : models) { - if (obj.isUse()) { - temp = obj; - } - } - } - model = temp; - } - - if (model != null) { - flag = checkCanShow(wsId, filterSet, flag, model); - } - if (flag) { - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("versionId", model.getVersionId()); - object.put("name", model.getName()); - object.put("canOpen", filterSet.contains(model.getVersionId())); - object.put("child", checkChild(wsId, filterSet, false, model)); - object.put("isPublish", model.isPublish()); - secendArr.add(object); - } - } - result.put(version, secendArr); - } - - /** - * 判断是否有子流程并且有其权限 - * @param wsId - * @param filterSet - * @param flag - * @param model - * @return - */ - private boolean checkChild(String wsId, Set filterSet, boolean flag, PALRepositoryModel model) { - Set ids = new HashSet<>(); - List subList = new ArrayList<>(); - PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); - if (subList != null && subList.size() > 0) { - for (PALRepositoryModel subModel : subList) { - if (subModel.isPublish() && filterSet.contains(subModel.getVersionId())) { - flag = true; - break; - } - } - } - return flag; - } - - /** - * 查看当前流程是否能显示 - * 判断条件:1.当前流程已发布且有权限;2.当前流程的所有子流程存在发布且其有权限查看 - * @param wsId - * @param filterSet - * @param flag - * @return - */ - private boolean checkCanShow(String wsId, Set filterSet, boolean flag, PALRepositoryModel model) { - if (model.isPublish() && filterSet.contains(model.getVersionId())) { - flag = true; - } else { - flag = checkChild(wsId, filterSet, flag, model); - } - return flag; - } - - /** - * 组织架构页面 - * @param me - * @param orgId - * @return - */ - public String openProcessMapOrgPage(UserContext me, String orgId) { - Map macroLibraries = new HashMap<>(); - macroLibraries.put("sid", me.getSessionId()); - macroLibraries.put("uid", me.getUID()); - macroLibraries.put("orgId", orgId); - JSONArray firstLevel = new JSONArray(); - JSONObject secendLevel = new JSONObject(); - if (!UtilString.isEmpty(orgId)) { - List list = SDK.getORGAPI().getDepartmentsByCompanyId(1, orgId); - if (list != null && list.size() > 0) { - // 获取单位下一级部门 - for (DepartmentModel model : list) { - if (model.isClosed()) { - continue; - } - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - boolean isExistSub = SDK.getORGAPI().isExistSubDepartment(model.getId()); - object.put("child", isExistSub); - firstLevel.add(object); - // 获取一级部门下的二级部门 - if (isExistSub) { - List subList = SDK.getORGAPI().getSubDepartments(model.getId()); - JSONArray subArray = new JSONArray(); - if (subList != null && subList.size() > 0) { - for (DepartmentModel subModel : subList) { - if (subModel.isClosed()) { - continue; - } - JSONObject object2 = new JSONObject(); - object2.put("id", subModel.getId()); - object2.put("name", subModel.getName()); - boolean isExistSub2 = SDK.getORGAPI().isExistSubDepartment(subModel.getId()); - object2.put("child", isExistSub2); - subArray.add(object2); - } - } - secendLevel.put(model.getId(), subArray); - } - } - - } - } - macroLibraries.put("firstLevelData", firstLevel); - macroLibraries.put("secendLevelData", secendLevel); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.org.html", macroLibraries); - } - - /** - * 业务架构展开 - * @param me - * @param id - * @param wsId - * @return - */ - public String expendProcessMapWsData(UserContext me, String id, String wsId) { - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model == null) { - throw new AWSException("该流程不存在,请刷新重试"); - } - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - PALRepository dao = new PALRepository(); - Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); - Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); - if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { - for (String awsId : relationAwsIdSet) { - idSet.add(awsId); - } - } - JSONObject nextLevel = new JSONObject(); - getPublishAndRoleChildModel(wsId, idSet, model.getVersionId(), nextLevel); - ro.put("data", nextLevel.get(model.getVersionId())); - return ro.toString(); - } - - /** - * 打开文件时的权限和类型校验 - * @param me - * @param id - * @param wsId - * @return - */ - public String openProcessMapWsDataCheck(UserContext me, String id, String wsId) { - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model == null) { - throw new AWSException("该流程不存在,请刷新重试"); - } - if (UtilString.isEmpty(wsId)) { - wsId = model.getWsId(); - } - String status = "ok"; - if ("default".equals(model.getMethodId())) { - status = "typeError"; - } - if (!model.isPublish()) { - status = "notPublish"; - } - if (!"ok".equals(status)) {// 避免后续查询 - ro.put("status", status); - return ro.toString(); - } - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - PALRepository dao = new PALRepository(); - Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); - Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); - if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { - for (String awsId : relationAwsIdSet) { - idSet.add(awsId); - } - } - if (!idSet.contains(model.getVersionId())) { - status = "noPerm"; - } - ro.put("status", status); - return ro.toString(); - } - - /** - * 组织架构展开 - * @param me - * @param id 部门id - * @param orgId 单位id - * @return - */ - - public String expendProcessMapOrgData(UserContext me, String id, String orgId) { - ResponseObject ro = ResponseObject.newOkResponse(); - DepartmentModel model = SDK.getORGAPI().getDepartmentById(id); - if (model == null) { - throw new AWSException("该部门不存在,请刷新重试"); - } - JSONArray data = new JSONArray(); - List list = SDK.getORGAPI().getSubDepartments(id); - if (list != null && list.size() > 0) { - for (DepartmentModel subModel : list) { - if (subModel.isClosed()) { - continue; - } - JSONObject object = new JSONObject(); - object.put("id", subModel.getId()); - object.put("name", subModel.getName()); - boolean isExistSub = SDK.getORGAPI().isExistSubDepartment(subModel.getId()); - object.put("child", isExistSub); - data.add(object); - } - } - ro.put("data", data); - return ro.toString(); - } - - /** - * 查询组织架构中部门流程 - * @param me - * @param deptId - * @return - */ - public String openProcessMapOrgDeptDialog(UserContext me, String deptId) { - Map macroLibraries = new HashMap<>(); - macroLibraries.put("sid", me.getSessionId()); - macroLibraries.put("uid", me.getUID()); - macroLibraries.put("deptId", deptId); - DepartmentModel model = SDK.getORGAPI().getDepartmentById(deptId); - JSONArray data = new JSONArray(); - String deptName = ""; - if(model != null) { - deptName = model.getName(); - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - PALRepository dao = new PALRepository(); - // List list = dao.getRepositoryListByPublishRole(roleId, null, "process", deptId, "default"); - List list = dao.getRepositoryListByPublishRole(roleId, null, "process", null, "default"); - // 查询关联了当前部门的已发布流程 - Set relationDeptIds = getAwsOrgPermRepositoryByDept(_uc, "process", deptId, true); - if (!isEmpty(list)) { - for (PALRepositoryModel pModel : list) { - if (deptId.equals(pModel.getDutyDept()) || relationDeptIds.contains(pModel.getId())) { - JSONObject object = new JSONObject(); - object.put("id", pModel.getId()); - object.put("name", pModel.getName()); - object.put("method", pModel.getMethodId()); - data.add(object); - } - } - } - } - macroLibraries.put("deptName", deptName); - macroLibraries.put("data", data); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.org.dialog.html", macroLibraries); - } - - // 获取logo图片路径 - private JSONObject getLogoImgPath(UserContext uc) { - JSONObject logo = new JSONObject(); - DCContext logoDcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); - if (dcProfile != null) { - logoDcContext = new DCContext(uc, dcProfile, "portal", "logo"); - } - boolean flag1 = false; - if (logoDcContext != null) { - File file = new File(logoDcContext.getPath()); - if (file.exists()) { - File [] files = file.listFiles(); - if (files != null) { - if (files.length > 0) { - for (File file2 : files) { - String src = new DCContext(uc, dcProfile, CoEConstant.APP_ID, "portal", "logo", file2.getName()).getDownloadURL(); - logo.put("src", src); - logo.put("name", file2.getName()); - flag1 = true; - break; - } - } - } - } - } - if (!flag1) { - // 默认PALlogo - logo.put("src", "../apps/"+ CoEConstant.APP_ID +"/img/logo/portal_logo.png"); - logo.put("name", "portal_logo.png"); - } - return logo; - } - - /** - * 轮播图 - * @param uc - * @return - */ - public String queryBannerData(UserContext uc) { - Map result = new HashMap(); - result.put("sid", uc.getSessionId()); - result.put("uid", uc.getUID()); - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); - DCContext bannerDcContext = null; - if (dcProfile != null) { - bannerDcContext = new DCContext(_uc, dcProfile, "portal", "banner"); - } - // 轮播图设置 - JSONArray pictures = new JSONArray(); - if (bannerDcContext != null) { - File file = new File(bannerDcContext.getPath()); - if (file.exists()) { - File [] files = file.listFiles(); - if (files != null) { - // 按照名称排序 - List fileList = Arrays.asList(files); - Collections.sort(fileList, new Comparator() { - @Override - public int compare(File o1, File o2) { - if (o1.isDirectory() && o2.isFile()) - return -1; - if (o1.isFile() && o2.isDirectory()) - return 1; - return o1.getName().compareTo(o2.getName()); - } - }); - for (int i = 0; i < fileList.size(); i++) { - File file2 = files[i]; - String src = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, "portal", "banner", file2.getName()).getDownloadURL(); - JSONObject object = new JSONObject(); - object.put("src", src); - object.put("name", file2.getName()); - pictures.add(object); - } - } - } - } - if (pictures.isEmpty()) { - JSONObject object = new JSONObject(); - object.put("src", "../apps/"+ CoEConstant.APP_ID +"/img/portal_banner.jpg"); - object.put("name", "portal_banner"); - pictures.add(object); - } - result.put("bannerImgs", pictures); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.banner.html", result); - } - - /*********************永辉接口start***************************/ - - // 查询发布信息,拼接结果json - private JSONArray assembleData2(List list) { - PublishListHistory pHistory = new PublishListHistory(); - JSONArray result = new JSONArray(); - for (int i = 0; i < list.size(); i++) { - PALRepositoryModel model = list.get(i); - JSONObject object = pHistory.getLastPublishByModelId(model.getId()); - JSONObject object2 = new JSONObject(); - if (object != null) { - String userId = object.getString("userId"); - String userName = ""; - if (UserCache.getModel(userId) != null) { - userName = UserCache.getModel(userId).getUserName(); - } - object2.put("user", userName); - object2.put("departmentPath", getDeptPath(userId)); - object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("date"))); - object2.put("publishDesc", object.getString("desc")); - } else { - object2.put("user", ""); - object2.put("departmentPath", ""); - object2.put("publishDate", ""); - object2.put("publishDesc", ""); - } - object2.put("id", model.getId()); - object2.put("name", model.getName()); - object2.put("version", VersionUtil.getVersionStrV(model.getVersion())); - object2.put("method", model.getMethodId()); - object2.put("category", model.getMethodCategory()); - - // 获取路径 - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - sBuilder.append(model.getName()); - idSets.add(model.getId()); - getFilePath(model, sBuilder,idSets);// 递归获取当前文件名称路径 - object2.put("path", sBuilder.toString()); - result.add(object2); - } - return result; - } - - /** - * 获取所有文件 - * @param uc - * @param wsId - * @param category - * @param type 已发布或者全部 - * @return - */ - public String queryPublishRepositoryDataJson(UserContext uc, String wsId, String category, String type) { - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - String wsIdsql = "'" + wsId + "'"; - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepository dao = new PALRepository(); - List list = null; - if (type == null || "publish".equals(type)) { - list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category, true, false); - } else { - list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category, false, true); - } - if (list == null) { - list = new ArrayList<>(); - } - JSONArray result = assembleData2(list); - ro.setData(result); - return ro.toString(); - } - - /** - * 获取所有已发布的文件 - * @param wsId - * @return - */ - public String queryPublishRepositoryDataJson(UserContext uc, String wsId, String category) { - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - String wsIdsql = "'" + wsId + "'"; - ResponseObject ro = ResponseObject.newOkResponse(); - PALRepository dao = new PALRepository(); - List list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category); - if (list == null) { - list = new ArrayList<>(); - } - Set idSet = new HashSet<>(); - for (PALRepositoryModel model : list) { - idSet.add(model.getId()); - } - // 添加关联aws组织的流程进行合并 - boolean flag = false; - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - if (awsProcessIds != null && awsProcessIds.size() > 0) { - for (String processId : awsProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); - if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId())) { - list.add(model); - idSet.add(model.getId()); - flag = true; - } - } - } - if (flag) {// 合并过数据则需要重新排序 - // 排序 - Collections.sort(list, new MyComparator()); - } - JSONArray result = assembleData2(list); - ro.setData(result); - return ro.toString(); - } - - /** - * 获取所有有权限的资产库 - * @return - */ - public String queryPermWorkspaceDataJson(UserContext uc) { - ResponseObject ro = ResponseObject.newOkResponse(); - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); - JSONArray ws = new JSONArray(); - if (wsList != null && wsList.size() > 0) { - for (int i = 0; i < wsList.size(); i++) { - JSONObject object = new JSONObject(); - object.put("wsId", wsList.get(i).get("wsId")); - object.put("wsName", wsList.get(i).get("wsName")); - ws.add(object); - } - } - ro.setData(ws); - return ro.toString(); - } - - /** - * 按照创建时间倒序排序 - * - */ - private class CreateDateComparator implements Comparator { - - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - Timestamp p1 = o1.getCreateDate(); - Timestamp p2 = o2.getCreateDate(); - if (p1 != null && p2 != null) { - if (!p1.equals(p2)) { - return p2.compareTo(p1); - } - } - int level1 = o1.getLevel(); - int level2 = o2.getLevel(); - if (level1 != level2) { - return level1 - level2; - } - int order1 = o1.getOrderIndex(); - int order2 = o2.getOrderIndex(); - return order1 - order2; - } - - } - - /** - * 获取发布动态 - * @param wsId - * @return - */ - public String queryDynamicHistoryDataJson(UserContext uc, String wsId, String type) { - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - String wsIdsql = "'" + wsId + "'"; - ResponseObject ro = ResponseObject.newOkResponse(); - - if (type == null || "publish".equals(type)) {// 获取已发布流程 - - } else {// 按照创建时间倒序获取所有流程 - JSONArray result = new JSONArray(); - List list = new ArrayList<>(); - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Iterator iterator = PALRepositoryCache.getByWsId(wsId); - while (iterator.hasNext()) { - PALRepositoryModel model = iterator.next(); - if (palVersionIds.contains(model.getVersionId())) { - list.add(model); - } - } - // 按照时间倒序,名称升序排序 - Collections.sort(list, new CreateDateComparator()); - for (PALRepositoryModel palModel : list) { - JSONObject object2 = new JSONObject(); - String userName = ""; - String userId = palModel.getCreateUser(); - if (!UtilString.isEmpty(userId) && UserCache.getModel(userId) != null) { - userName = UserCache.getModel(userId).getUserName(); - } - object2.put("id", palModel.getId()); - object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); - object2.put("user", userName); - object2.put("name", palModel.getName()); - object2.put("createDate", UtilDate.datetimeFormat(palModel.getCreateDate())); - object2.put("isPublish", palModel.isPublish() ? "1" : "0"); - object2.put("method", palModel.getMethodId()); - object2.put("category", palModel.getMethodCategory()); - // 获取发布类型名称 - String categoryName = ""; - if (palModel.getLevel() <= 2) { - categoryName = palModel.getName(); - } else { - PALRepositoryModel model = palModel; - while (true) { - String pid = model.getParentId(); - PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid); - if (parentModel == null) { - break; - } else { - if (parentModel.getLevel() <= 2) { - categoryName = parentModel.getName(); - break; - } - } - model = parentModel; - } - } - object2.put("categoryName", categoryName); - result.add(object2); - } - ro.setData(result); - return ro.toString(); - } - - PublishListHistory dao = new PublishListHistory(); - List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, null); - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - palProcessIds.add(model.getId()); - } - } - } - - // 过滤最终结果 - List list = new ArrayList<>(); - for (JSONObject object : modelList) { - String repositoryId = object.getString("repositoryId"); - if (palProcessIds.contains(repositoryId)) { - list.add(object); - } - } - - JSONArray result = new JSONArray(); - for (JSONObject object : list) { - JSONObject object2 = new JSONObject(); - String repositoryId = object.getString("repositoryId"); - PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); - object2.put("id", palModel.getId()); - object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); - String userName = ""; - if (UserCache.getModel(object.getString("userId")) != null) { - userName = UserCache.getModel(object.getString("userId")).getUserName(); - } - - String actionType = object.getString("actionType"); - String intro = ""; - switch (actionType) { - case "N": - intro = "新发布"; - break; - case "C": - intro = "变更"; - break; - default:// S - intro = "停用"; - break; - } - object2.put("name", palModel.getName() + "[" + intro + "]"); - object2.put("user", userName); - object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("publishDate"))); - object2.put("publishDesc", object.getString("publishDesc")); - object2.put("isPublish", palModel.isPublish() ? "1" : "0"); - object2.put("method", palModel.getMethodId()); - object2.put("category", palModel.getMethodCategory()); - // 获取发布类型名称 - String categoryName = ""; - if (palModel.getLevel() <= 2) { - categoryName = palModel.getName(); - } else { - PALRepositoryModel model = palModel; - while (true) { - String pid = model.getParentId(); - PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid); - if (parentModel == null) { - break; - } else { - if (parentModel.getLevel() <= 2) { - categoryName = parentModel.getName(); - break; - } - } - model = parentModel; - } - } - object2.put("categoryName", categoryName); - result.add(object2); - } - ro.setData(result); - return ro.toString(); - } - - /** - * 获取发布动态(更多) - * @param wsId - * @return - */ - public String queryDynamicHistoryMoreDataJson(UserContext uc, String wsId, String type) { - JSONObject param = getXPagesBasicParam(uc, null); - String roleId = param.getString("roleId"); - String wsIdsql = "'" + wsId + "'"; - - ResponseObject ro = ResponseObject.newOkResponse(); - - if (type == null || "publish".equals(type)) {// 获取已发布流程 - - } else {// 按照创建时间倒序获取所有流程 - JSONArray result = new JSONArray(); - List list = new ArrayList<>(); - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Iterator iterator = PALRepositoryCache.getByWsId(wsId); - while (iterator.hasNext()) { - PALRepositoryModel model = iterator.next(); - if (palVersionIds.contains(model.getVersionId())) { - list.add(model); - } - } - // 按照时间倒序,名称升序排序 - Collections.sort(list, new CreateDateComparator()); - for (PALRepositoryModel palModel : list) { - JSONObject object2 = new JSONObject(); - object2.put("id", palModel.getId()); - object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); - String userName = ""; - String userId = palModel.getCreateUser(); - if (!UtilString.isEmpty(userId) && UserCache.getModel(userId) != null) { - userName = UserCache.getModel(userId).getUserName(); - } - object2.put("name", palModel.getName()); - object2.put("user", userName); - object2.put("departmentPath", getDeptPath(palModel.getCreateUser())); - object2.put("createDate", UtilDate.datetimeFormat(palModel.getCreateDate())); - object2.put("isPublish", palModel.isPublish() ? "1" : "0"); - object2.put("method", palModel.getMethodId()); - object2.put("category", palModel.getMethodCategory()); - - // 获取路径 - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - sBuilder.append(palModel.getName()); - idSets.add(palModel.getId()); - getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 - object2.put("path", sBuilder.toString()); - result.add(object2); - } - ro.setData(result); - return ro.toString(); - } - - PublishListHistory dao = new PublishListHistory(); - List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, null); - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - palProcessIds.add(model.getId()); - } - } - } - - // 过滤最终结果 - List list = new ArrayList<>(); - for (JSONObject object : modelList) { - String repositoryId = object.getString("repositoryId"); - if (palProcessIds.contains(repositoryId)) { - list.add(object); - } - } - - JSONArray result = new JSONArray(); - for (JSONObject object : list) { - JSONObject object2 = new JSONObject(); - String repositoryId = object.getString("repositoryId"); - PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); - object2.put("id", palModel.getId()); - object2.put("version",VersionUtil.getVersionStrV(palModel.getVersion())); - String userName = ""; - if (UserCache.getModel(object.getString("userId")) != null) { - userName = UserCache.getModel(object.getString("userId")).getUserName(); - } - - String actionType = object.getString("actionType"); - String intro = ""; - switch (actionType) { - case "N": - intro = "新发布"; - break; - case "C": - intro = "变更"; - break; - default:// S - intro = "停用"; - break; - } - object2.put("name", palModel.getName() + "[" + intro + "]"); - object2.put("user", userName); - object2.put("departmentPath", getDeptPath(object.getString("userId"))); - object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("publishDate"))); - object2.put("publishDesc", object.getString("publishDesc")); - object2.put("isPublish", palModel.isPublish() ? "1" : "0"); - object2.put("method", palModel.getMethodId()); - object2.put("category", palModel.getMethodCategory()); - - // 获取路径 - StringBuilder sBuilder = new StringBuilder();// 名称组合 - Set idSets = new HashSet<>();// id记录,校验防止递归死循环 - sBuilder.append(palModel.getName()); - idSets.add(palModel.getId()); - getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 - object2.put("path", sBuilder.toString()); - result.add(object2); - } - ro.setData(result); - return ro.toString(); - } - - /** - * 根据类别获取权限下的发布流程 - * @param me - * @param type publish:获取当前状态为已发布且有权限的文件 stop: 获取曾经发布过但是当前是未发布状态(使用中)的文件 recentView:按照流程点击量倒序获取当前状态为已发布的文件(类似高频流程) - * @param wsId - * @return - */ - public String queryPublishRepositoryDataJsonByType(UserContext me, String type, String wsId) { - switch (type) { - case "publish": - // 获取已发布流程 - return queryPublishRepositoryDataJson(me, wsId, "process"); - case "stop": - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - PublishListHistory history = new PublishListHistory(); - Set publishHistorySet = history.getPublishDataByActiontype("S", wsId); - // 获取权限下的模型id - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - palProcessIds.add(model.getId()); - } - } - } - // 获取关联AWS组织的版本ID且当前为未发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, null, false); - // 整合所有权限 - palProcessIds.addAll(awsProcessIds); - List list = new ArrayList<>(); - Iterator iterator = PALRepositoryCache.getByWsId(wsId); - while (iterator.hasNext()) { - PALRepositoryModel model = iterator.next(); - if (!model.isPublish() && "process".equals(model.getMethodCategory()) && publishHistorySet.contains(model.getId()) && palProcessIds.contains(model.getId())) {// 未发布&&已停用&&有权限 - list.add(model); - } - } - // 排序 - Collections.sort(list, new MyComparator()); - JSONArray data = assembleData2(list); - ResponseObject r2 = ResponseObject.newOkResponse(); - r2.setData(data); - return r2.toString(); - default:// recentView - List tempList = new ArrayList<>(); - PublishFrequencyDao frequencyDao = new PublishFrequencyDao(); - List frequencyModels = frequencyDao.getDataOrderByCount(wsId); - if (frequencyModels == null || frequencyModels.size() == 0) { - ResponseObject r = ResponseObject.newOkResponse(); - r.setData(tempList); - return r.toString(); - } - Map map = new HashMap<>(); - for (PublishFrequencyModel model : frequencyModels) { - map.put(model.getPlversionId(), model.getCount()); - } - String result = queryPublishRepositoryDataJson(me, wsId, "process"); - JSONObject ro = JSONObject.parseObject(result); - JSONArray array = ro.getJSONArray("data"); - for (int i = 0; i < array.size(); i++) { - JSONObject object = array.getJSONObject(i); - String id = object.getString("id"); - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model!= null) { - String versionId = model.getVersionId(); - if (map.containsKey(versionId)) { - object.put("viewCount", map.get(versionId)); - tempList.add(object); - } - } - } - // 按照访问量降序排序 - Collections.sort(tempList, new CountComparator()); - ResponseObject r = ResponseObject.newOkResponse(); - r.setData(tempList); - return r.toString(); - } - } - - private class CountComparator implements Comparator { - @Override - public int compare(JSONObject o1, JSONObject o2) { - Integer count1 = o1.getInteger("viewCount"); - Integer count2 = o2.getInteger("viewCount"); - return count2 - count1; - } - } - - /** - * 获取所有有权限的部门列表,部门列表来源于所有具有权限的流程的责任部门 - * 已发布 - * @param me - * @param wsId - * @return - */ - public String queryAwsDepartmentDataJson(UserContext me, String wsId) { - String category = "process"; - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - if (model.isPublish() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - // 整合所有权限 - palProcessIds.addAll(awsProcessIds); - - // 获取所有部门ID - Set deptIds = new HashSet<>(); - for (String id : palProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null && model.getWsId().equals(wsId)) { - // 责任部门 - String deptId = model.getDutyDept(); - if (!UtilString.isEmpty(deptId)) { - deptIds.add(deptId); - } - } - } - List list = new ArrayList<>(); - for (String deptId : deptIds) { - JSONObject object = new JSONObject(); - DepartmentModel dModel = SDK.getORGAPI().getDepartmentById(deptId); - if (dModel != null) { - // 获取单位 - CompanyModel cModel = SDK.getORGAPI().getCompanyById(dModel.getCompanyId()); - if (cModel != null) { - object.put("id", dModel.getId()); - object.put("departmentId", dModel.getId()); - object.put("departmentName", dModel.getName()); - object.put("departmentLayer", dModel.getLayer()); - object.put("departmentOrderIndex", dModel.getOrderIndex()); - object.put("departmentClosed", dModel.isClosed()); - object.put("companyId", dModel.getCompanyId()); - object.put("companyName", cModel.getName()); - object.put("companyOrderIndex", cModel.getOrderIndex()); - object.put("companyClosed", cModel.isClosed()); - list.add(object); - } - } - } - // 排序,按照单位部门层级和顺序排序 - Collections.sort(list, new DepartmentComparator()); - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(list); - return ro.toString(); - } - - // 部门排序 - private class DepartmentComparator implements Comparator{ - @Override - public int compare(JSONObject o1, JSONObject o2) { - int cOrder1 = o1.getIntValue("companyOrderIndex"); - int cOrder2 = o2.getIntValue("companyOrderIndex"); - if (cOrder1 != cOrder2) { - return cOrder1 - cOrder2; - } - int dLayer1 = o1.getIntValue("departmentLayer"); - int dLayer2 = o2.getIntValue("departmentLayer"); - if (dLayer1 != dLayer2) { - return dLayer1 - dLayer2; - } - int dOrder1 = o1.getIntValue("departmentOrderIndex"); - int dOrder2 = o2.getIntValue("departmentOrderIndex"); - return dOrder1 - dOrder2; - } - - } - - /** - * 获取当前部门的流程数据(责任部门)和当前部门下具有权限的子部门列表 - * @param me - * @param wsId - * @param departmentId - * @return - */ - public String queryPublishedProcessAndSubDepartment(UserContext me, String wsId, String departmentId) { - JSONObject result = new JSONObject(); - // 获取有权限的已发布流程 - String category = "process"; - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - // 过滤当前责任部门的流程 - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - if (model.isPublish() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - // 整合所有权限id - palProcessIds.addAll(awsProcessIds); - List list = new ArrayList<>(); - Set deptIds = new HashSet<>(); - for (String id : palProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null && model.getWsId().equals(wsId)) { - // 责任部门 - String deptId = model.getDutyDept(); - if (!UtilString.isEmpty(deptId)) { - deptIds.add(deptId); - if (deptId.equals(departmentId)) { - list.add(model); - } - } - } - } - Collections.sort(list, new MyComparator()); - JSONArray repositoryArr = new JSONArray(); - for (PALRepositoryModel model : list) { - // "子部门列表(部门id,部门名称); - // 所有选择了该部门作为责任部门的流程文件列表(流程id,流程名称,是否有附件、附件Id,附件名称、附件链接、流程地图图片)" - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("version",VersionUtil.getVersionStrV(model.getVersion())); - object.put("hasFile", false); - object.put("method", model.getMethodId()); - object.put("category", model.getMethodCategory()); - // 附件 - JSONArray file = new JSONArray(); - StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(model.getId()).append("' and FILETYPE='f'"); - UpFileDao upFileDao = new UpFileDao(); - List search = upFileDao.search(sqlWhere.toString()); - if (search != null && search.size() > 0) { - object.put("hasFile", true); - for (UpfileModel upfileModel : search) { - JSONObject fileObject = new JSONObject(); - fileObject.put("id", upfileModel.getUuid()); - fileObject.put("name", upfileModel.getFileName()); - String downloadUrl = ""; - DCContext dcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - if (dcProfile != null) { - dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); - } - if (dcContext != null) { - downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; - } - fileObject.put("url", downloadUrl); - file.add(fileObject); - } - } - object.put("file", file); - // 流程图片 - String imgSrc = ""; - String path = model.getFilePath(); - if (!UtilString.isEmpty(path)) { - UtilFile utilFile = new UtilFile(path + "/" + model.getId() + ".small.png"); - if (utilFile.exists()) { - byte[] base64Bytes = Base64.encode(utilFile.readBytes()); - imgSrc = "data:image/png;base64," + new String(base64Bytes); - } - } - object.put("imgSrc", imgSrc); - repositoryArr.add(object); - } - result.put("process", repositoryArr); - // 获取子部门列表 - List deptList = new ArrayList<>(); - getPermDepartment(deptList, deptIds, departmentId);// 获取子部门列表 - // 部门排序 - JSONArray deptArr = new JSONArray(); - for (DepartmentModel dept : deptList) { - JSONObject deptObj = new JSONObject(); - deptObj.put("id", dept.getId()); - deptObj.put("departmentName", dept.getName()); - deptArr.add(deptObj); - } - result.put("department", deptArr); - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - return ro.toString(); - } - - // 获取所有符合条件的子部门 - private void getPermDepartment(List list, Set deptIds, String parentId) { - // 获取子部门列表 - List subDeptList = SDK.getORGAPI().getSubDepartments(parentId); - if (!isEmpty(subDeptList)) { - for (DepartmentModel model : subDeptList) { - if (deptIds.contains(model.getId())) { - list.add(model); - } else { - getPermDepartment(list, deptIds, model.getId()); - } - } - } - } - - // 获取子流程列表 - public String queryPublishProcessByParent(UserContext me, String id, String type) { - // 获取有权限的已发布流程 - String category = "process"; - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - // 过滤当前责任部门的流程 - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - if (type == null || "publish".equals(type)) {// 获取已发布流程 - if(model.isPublish() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } else {// 获取当前使用中流程,不区分状态 - if(model.isUse() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } - } - } - } - - // 获取当前流程信息和子流程 - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model == null) { - throw new AWSException("查找失败 uuid: " + id ); - } - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("version", VersionUtil.getVersionStrV(model.getVersion())); - object.put("hasChild", false); - object.put("childData", new JSONArray()); - object.put("method", model.getMethodId()); - object.put("category", model.getMethodCategory()); - object.put("level", model.getLevel()); - object.put("isPublish", model.isPublish()); - - // 获取子流程列表 - List subList = new ArrayList<>(); - getPermSubPalRepository(subList, palProcessIds, model.getId()); - if (!isEmpty(subList)) { - object.put("hasChild", true); - // 获取附件列表,获取流程图片 - JSONArray subArr = new JSONArray(); - for (PALRepositoryModel subModel : subList) { - JSONObject subObj = new JSONObject(); - subObj.put("id", subModel.getId()); - subObj.put("name", subModel.getName()); - subObj.put("version",VersionUtil.getVersionStrV(subModel.getVersion())); - subObj.put("hasFile", false); - subObj.put("method", subModel.getMethodId()); - subObj.put("category", subModel.getMethodCategory()); - subObj.put("level", subModel.getLevel()); - subObj.put("isPublish", subModel.isPublish()); - // 附件 - JSONArray file = new JSONArray(); - StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(subModel.getId()).append("' and FILETYPE='f'"); - UpFileDao upFileDao = new UpFileDao(); - List search = upFileDao.search(sqlWhere.toString()); - if (search != null && search.size() > 0) { - subObj.put("hasFile", true); - for (UpfileModel upfileModel : search) { - JSONObject fileObject = new JSONObject(); - fileObject.put("id", upfileModel.getUuid()); - fileObject.put("name", upfileModel.getFileName()); - String downloadUrl = ""; - DCContext dcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - if (dcProfile != null) { - dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); - } - if (dcContext != null) { - downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; - } - fileObject.put("url", downloadUrl); - file.add(fileObject); - } - } - subObj.put("file", file); - // 流程图片 - String imgSrc = ""; - String path = subModel.getFilePath(); - if (!UtilString.isEmpty(path)) { - UtilFile utilFile = new UtilFile(path + "/" + subModel.getId() + ".small.png"); - if (utilFile.exists()) { - byte[] base64Bytes = Base64.encode(utilFile.readBytes()); - imgSrc = "data:image/png;base64," + new String(base64Bytes); - } - } - subObj.put("imgSrc", imgSrc); - subArr.add(subObj); - } - object.put("childData", subArr); - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(object); - return ro.toString(); - } - - private void getPermSubPalRepository(List list, Set palProcessIds, String pid) { - // 获取子流程 - PALRepositoryModel model = PALRepositoryCache.getCache().get(pid); - if (model != null) { - List subList = PALRepositoryCache.getAllSubModelsByPid(model.getWsId(), model.getId()); - if (!isEmpty(subList)) { - // 排序 - Collections.sort(subList, new Comparator() { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - int level1 = o1.getLevel(); - int level2 = o2.getLevel(); - if (level1 != level2) { - return level1 - level2; - } - int orderIndex1 = o1.getOrderIndex(); - int orderIndex2 = o2.getOrderIndex(); - return orderIndex1 - orderIndex2; - } - }); - for (PALRepositoryModel subModel : subList) { - if (palProcessIds.contains(subModel.getId())) { - list.add(subModel); - } else { - getPermSubPalRepository(list, palProcessIds, subModel.getId()); - } - } - } - } - } - - /** - * 打开流程 - * @param me - * @param uuid - * @return - */ - public String openPublishRepository(UserContext me, String uuid, String type) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); - if (model != null) { - if ("default".equals(model.getMethodId())) { - throw new AWSException("当前文件类型不支持打开"); - } - } - if (type == null || "publish".equals(type)) {// 获取已发布流程 - return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null); - } else {// 不再校验是否已发布 - return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null, false); - } - } - - /** - * 查找二级流程 - * @param me - * @param wsId - * @param type all:所有当前正在使用状态中的模型,包括发布和停用 publish:已发布模型 - * @return - */ - public String querySecondLevelRepositoryDataJson(UserContext me, String wsId, String type) { - JSONArray result = new JSONArray(); - // 暂时不处理权限,取所有二级流程类文件 - List firstLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, "process"); - if (!isEmpty(firstLevelModels)) { - Set versionIds = new HashSet<>(); - for (PALRepositoryModel model : firstLevelModels) { - if (!versionIds.contains(model.getVersionId())) { - // 获取第二级流程 - List secendLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, model.getId()); - if (!isEmpty(secendLevelModels)) { - if (type == null || "publish".equals(type)) {// 获取已发布流程 - for (PALRepositoryModel sModel : secendLevelModels) { - if (sModel.isPublish()) { - JSONObject object = new JSONObject(); - object.put("id", sModel.getId()); - object.put("name", sModel.getName()); - object.put("level", sModel.getLevel()); - object.put("parentId", sModel.getParentId()); - object.put("method", sModel.getMethodId()); - object.put("category", sModel.getMethodCategory()); - object.put("parentName", model.getName()); - object.put("isPublish", model.isPublish()); - result.add(object); - } - } - } else {// 获取当前使用中流程,不区分状态 - for (PALRepositoryModel sModel : secendLevelModels) { - if (sModel.isUse()) { - JSONObject object = new JSONObject(); - object.put("id", sModel.getId()); - object.put("name", sModel.getName()); - object.put("level", sModel.getLevel()); - object.put("parentId", sModel.getParentId()); - object.put("method", sModel.getMethodId()); - object.put("category", sModel.getMethodCategory()); - object.put("parentName", model.getName()); - object.put("isPublish", model.isPublish()); - result.add(object); - } - } - } - } - versionIds.add(model.getVersionId()); - } - } - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - return ro.toString(); - } - - /** - * 查找三级流程(已发布和未发布) - * @param me - * @param wsId - * @param type all:所有当前正在使用状态中的模型,包括发布和停用 publish:已发布模型 - * @return - */ - public String queryThirdLevelRepositoryDataJson(UserContext me, String wsId, String type) { - JSONArray result = new JSONArray(); - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - Set versionIds = new HashSet<>(); - // 一级流程 - List firstLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, "process"); - if(isEmpty(firstLevelModels)) { - return ro.toString(); - } - //非管理员在测试库下(type:all)权限 - CoeUser coeUserDao = CoeUserDaoFactory.createUser(); - boolean isCoEManager = coeUserDao.isCoEManager(me.getUID()); //是否管理员权限 - - PublisherClientDao publisherDao = new PublisherClientDao(); - List resourceIds = publisherDao.getTeamUserPerms(me.getUID()); //拥有的资源权限 - // - for (PALRepositoryModel model : firstLevelModels) { - if(versionIds.contains(model.getVersionId())) { - continue; - } - // 获取第二级流程 - List secendLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, model.getId()); - if(isEmpty(secendLevelModels)) { - continue; - } - for (PALRepositoryModel sModel : secendLevelModels) { - // 获取第三级流程 - List thirdLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, sModel.getId()); - if(isEmpty(thirdLevelModels)) { - continue; - } - for(PALRepositoryModel tModel : thirdLevelModels) { - if (type == null || "publish".equals(type) ) {// 获取已发布流程 - if (tModel.isPublish() || "default".equals(tModel.getMethodId())) { - //第四级流程及以下流程 - List possessionList = new ArrayList(); - this.getAllPalRepositoryModelsByPid(wsId, tModel.getId(), possessionList); //递归得到流程信息 - //过滤统计流程的数量 - long possessionCount = 0; - for(int m = 0; m < possessionList.size(); m++) { - PALRepositoryModel mo = possessionList.get(m); - if("process.bpmn2".equals(mo.getMethodId()) && mo.isPublish()) { //只统计process.bpmn2类 - possessionCount ++; - } - } - JSONObject object = new JSONObject(); - object.put("id", tModel.getId()); - object.put("name", tModel.getName()); - object.put("level", tModel.getLevel()); - object.put("parentId", tModel.getParentId()); - object.put("method", tModel.getMethodId()); - object.put("category", tModel.getMethodCategory()); - object.put("parentName", sModel.getName()); - object.put("isPublish", tModel.isPublish()); - object.put("possessionCount", possessionCount); //目录下包含的所有流程数量,只包含bpmn当前版本的 - object.put("privilege", 1); //已发布的正式库永远有权限 - result.add(object); - } - } else {// 获取当前使用中的流程,不区分状态 - if (tModel.isUse()) { - //第四级流程及以下流程 - List possessionList = new ArrayList(); - this.getAllPalRepositoryModelsByPid(wsId, tModel.getId(), possessionList); //递归得到流程信息 - //privalige:0-没有第三级菜单下的流程权限;1-有第三级菜单下的流程权限 - int privalige = 1; - if(!isCoEManager) { - privalige = 0; - for(int i = 0; i < possessionList.size(); i++) { - PALRepositoryModel mo = possessionList.get(i); - if("process.bpmn2".equals(mo.getMethodId()) && mo.isUse() && resourceIds.contains(mo.getId())) { - privalige = 1; - break; - } - } - } - //过滤统计流程的数量 - long possessionCount = 0; - for(int m = 0; m < possessionList.size(); m++) { - PALRepositoryModel mo = possessionList.get(m); - if("process.bpmn2".equals(mo.getMethodId()) && mo.isUse()) { //只统计process.bpmn2类 - possessionCount ++; - } - } - JSONObject object = new JSONObject(); - object.put("id", tModel.getId()); - object.put("name", tModel.getName()); - object.put("level", tModel.getLevel()); - object.put("parentId", tModel.getParentId()); - object.put("method", tModel.getMethodId()); - object.put("category", tModel.getMethodCategory()); - object.put("parentName", sModel.getName()); - object.put("isPublish", tModel.isPublish()); - object.put("possessionCount", possessionCount); //目录下包含的所有流程数量,只包含bpmn当前版本的 - // 非管理人员测试库下 - if(isCoEManager) { - object.put("privilege", 1); //管理员拥有所有权限 - } else { - object.put("privilege", privalige); //非管理员 - } - result.add(object); - } - } - } //end of third level - } - versionIds.add(model.getVersionId()); - } - return ro.toString(); - } - - /** - * 获取某个流程的所有子流程 - * - * @param wsId - * @param pid - * @param list - */ - private void getAllPalRepositoryModelsByPid(String wsId, String pid, List list) { - List children = PALRepositoryCache.getAllSubModelsByPid(wsId, pid); - if (children != null && children.size() > 0) { - list.addAll(children); - for (PALRepositoryModel model : children) { - getAllPalRepositoryModelsByPid(wsId, model.getId(), list); - } - } - } - - /** - * 获取已加入群组 - * @param me - * @return - */ - public String queryJoinedTeamByUserId(UserContext me) { - JSONArray result = new JSONArray(); - // 获取所有工作网络列表 - JSONArray networks = getAllNetworks(); - - // 查询小组列表 - for (Object object : networks) { - JSONObject network = (JSONObject)object; - String networkId = network.getString("id"); - - Map teamMap = new LinkedHashMap(); - //获取工作网络中所有小组 - AppAPI appAPI = SDK.getAppAPI(); - Map params = new HashMap(); - String aslp = "aslp://com.actionsoft.apps.network/queryTeamsByNetwork"; - params.put("networkId", networkId); - params.put("sid", _uc.getSessionId()); - ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), aslp, params); - if (ro.toJsonObject().get("data") != null ) { - JSONArray teams = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teams"); - if (teams != null && teams.size() > 0) { - for (int i = 0; i < teams.size(); i++) { - JSONObject team = teams.getJSONObject(i); - if ("1".equals(team.getString("teamStatus"))) - teamMap.put(team.getString("id"), team);// 筛选启用中的小组 - } - } - for (Map.Entry entry : teamMap.entrySet()) { - JSONObject team = entry.getValue(); - String id = team.getString("id"); - // 查询小组成员 - Map numberMap = new HashMap<>(); - //小组ID,必填 - numberMap.put("teamId", id); - numberMap.put("sid", _uc.getSessionId()); - //查询某个小组的成员列表 - ResponseObject teamNumberRo = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), "aslp://com.actionsoft.apps.network/queryTeamMemberByTeamId", numberMap); - if (teamNumberRo.toJsonObject().get("data") != null ) { - JSONArray teamNumbers = (JSONObject.parseObject(teamNumberRo.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teamMembers"); - boolean flag = false; - for (Object o : teamNumbers) { - JSONObject teamNumber = (JSONObject)o; - // 查询是否在当前小组中 - if (teamNumber.getString("userId").equals(_uc.getUID())) { - flag = true; - break; - } - } - if (flag) { - String teamName = team.getString("teamName"); - String teamType = team.getString("teamType"); - String teamTypeIcon = "../apps/com.actionsoft.apps.network/img/team/type_" + teamType + ".png"; - String teamTypeName = ""; - if ("1".equals(teamType)) { - teamTypeName = "公共"; - } else if ("2".equals(teamType)) { - teamTypeName = "私有"; - } else if ("3".equals(teamType)) { - teamTypeName = "私密"; - } - String teamLogo = team.getString("teamLogo"); - String teamLogoSrc = "".equals(teamLogo) ? "../apps/com.actionsoft.apps.network/img/team/logo_2.png" : teamLogo; - int teamMembersNum = team.getInteger("memberAmount") == null ? 0 : team.getInteger("memberAmount"); - // 小组成员 - List numbers = new ArrayList<>(); - for (Object o : teamNumbers) { - JSONObject teamNumber = (JSONObject)o; - numbers.add(teamNumber.getString("userName")); - } - Collections.sort(numbers); - JSONObject teamData = new JSONObject(); - - teamData.put("id", id); - teamData.put("name", teamName); - teamData.put("teamType", teamType); - teamData.put("teamTypeIcon", teamTypeIcon); - teamData.put("teamTypeName", teamTypeName); - teamData.put("teamLogoSrc", teamLogoSrc); - teamData.put("teamMembersNum", teamMembersNum); - teamData.put("numbers", String.join(",", numbers)); - result.add(teamData); - } - } - } - } - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - return ro.toString(); - } - - /** - * 获取未加入群组 - * @param me - * @return - */ - public String queryNotJoinTeamByUserId(UserContext me) { - JSONArray result = new JSONArray(); - // 获取所有工作网络列表 - JSONArray networks = getAllNetworks(); - - // 查询小组列表 - for (Object object : networks) { - JSONObject network = (JSONObject)object; - String networkId = network.getString("id"); - - Map teamMap = new LinkedHashMap(); - //获取工作网络中所有小组 - AppAPI appAPI = SDK.getAppAPI(); - Map params = new HashMap(); - String aslp = "aslp://com.actionsoft.apps.network/queryTeamsByNetwork"; - params.put("networkId", networkId); - params.put("sid", _uc.getSessionId()); - ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), aslp, params); - if (ro.toJsonObject().get("data") != null ) { - JSONArray teams = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teams"); - if (teams != null && teams.size() > 0) { - for (int i = 0; i < teams.size(); i++) { - JSONObject team = teams.getJSONObject(i); - if ("1".equals(team.getString("teamStatus"))) - teamMap.put(team.getString("id"), team);// 筛选启用中的小组 - } - } - for (Map.Entry entry : teamMap.entrySet()) { - JSONObject team = entry.getValue(); - String id = team.getString("id"); - String teamType = team.getString("teamType"); - if ("3".equals(teamType)) {// 未加入的私密小组不显示 - continue; - } - // 查询小组成员 - Map numberMap = new HashMap<>(); - //小组ID,必填 - numberMap.put("teamId", id); - numberMap.put("sid", _uc.getSessionId()); - //查询某个小组的成员列表 - ResponseObject teamNumberRo = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), "aslp://com.actionsoft.apps.network/queryTeamMemberByTeamId", numberMap); - if (teamNumberRo.toJsonObject().get("data") != null ) { - JSONArray teamNumbers = (JSONObject.parseObject(teamNumberRo.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teamMembers"); - boolean flag = false; - for (Object o : teamNumbers) { - JSONObject teamNumber = (JSONObject)o; - // 查询是否在当前小组中 - if (teamNumber.getString("userId").equals(_uc.getUID())) { - flag = true; - break; - } - } - if (!flag) { - String teamName = team.getString("teamName"); - String teamTypeIcon = "../apps/com.actionsoft.apps.network/img/team/type_" + teamType + ".png"; - String teamTypeName = ""; - if ("1".equals(teamType)) { - teamTypeName = "公共"; - } else if ("2".equals(teamType)) { - teamTypeName = "私有"; - } else if ("3".equals(teamType)) { - teamTypeName = "私密"; - } - String teamLogo = team.getString("teamLogo"); - String teamLogoSrc = "".equals(teamLogo) ? "../apps/com.actionsoft.apps.network/img/team/logo_2.png" : teamLogo; - int teamMembersNum = team.getInteger("memberAmount") == null ? 0 : team.getInteger("memberAmount"); - - JSONObject teamData = new JSONObject(); - - teamData.put("id", id); - teamData.put("name", teamName); - teamData.put("teamType", teamType); - teamData.put("teamTypeIcon", teamTypeIcon); - teamData.put("teamTypeName", teamTypeName); - teamData.put("teamLogoSrc", teamLogoSrc); - teamData.put("teamMembersNum", teamMembersNum); - result.add(teamData); - } - } - } - } - } - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - return ro.toString(); - } - - /** - * 获取工作网络集合 - */ - private JSONArray getAllNetworks() { - JSONArray result = new JSONArray(); - // 调用App - String sourceAppId = PublisherConf.APPID; - // aslp服务地址 - String aslp = "aslp://com.actionsoft.apps.network/queryAllNetwork"; - // 参数定义列表 - Map params = new HashMap<>(); - params.put("sid", _uc.getSessionId()); - AppAPI appAPI = SDK.getAppAPI(); - //查询工作网络列表 - ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); - if (ro.toJsonObject().get("data") != null) { - JSONArray networks = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("networks"); - for (Object object : networks) { - JSONObject obj = (JSONObject) object; - JSONObject temp = new JSONObject(); - temp.put("networkName", obj.getString("networkName")); - temp.put("id", obj.getString("id")); - result.add(temp); - } - } - return result; - } - - // 获取所有子部门 - private void getSubDepartments(List list, String parentId) { - // 获取子部门列表 - List subDeptList = SDK.getORGAPI().getSubDepartments(parentId); - if (!isEmpty(subDeptList)) { - for (DepartmentModel model : subDeptList) { - list.add(model); - getSubDepartments(list, model.getId()); - } - } + private UserContext _uc; + + public ProcessPublishClientWeb() { + } + + public ProcessPublishClientWeb(UserContext userContext) { + _uc = userContext; + } + + @Override + public String getHomePage(UserContext uc) { + _uc = uc; + // 操作行为日志记录 + if (SDK.getAppAPI().getPropertyBooleanValue(CoEConstant.APP_ID, "IS_RECORD_OP_LOG", false)) { + CoEOpLogAPI.auditOkOp(uc, CoEOpLogConst.MODULE_CATEGORY_APPCENTER, CoEOpLogConst.OP_ACCESS, CoEOpLogConst.INFO_APPCENTER_ACCESS_PREFIX + SDK.getAppAPI().getAppContext(PublisherConf.APPID).getName() + CoEOpLogConst.INFO_APPCENTER_ACCESS_SUFFIX); + } + if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v3")) { + Map macroLibraries = getHomePage2(uc); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home2.html", macroLibraries); + } else { + AppAPI appApi = SDK.getAppAPI(); + JSONArray wsTree = new JSONArray(); + String isIntegrationAWSUser = appApi.getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 + String roleId = ""; + if ("false".equals(isIntegrationAWSUser)) { + roleId = PublishConst.GUESTROLE; + } else { + roleId = uc.getRoleModel().getId(); + } + String emptyMessage = ""; + PALRepository dao = new PALRepository(); + List> allWsList = dao.getWorkSpaceListByPublishRole(roleId, false); + if (allWsList == null || allWsList.size() == 0) { + emptyMessage = "未分配资产库访问权限"; + } + List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true); // 有访问权限的资产库 + StringBuilder wsIds = new StringBuilder(""); + StringBuilder modelIds = new StringBuilder(""); + JSONArray repositoryList = new JSONArray(); // 有访问权限的文件 + if (wsList != null && wsList.size() > 0) { + int i = 0; + List> removeList = new ArrayList>(); + for (Map ws : wsList) { + boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); + if (!isActive) { + removeList.add(ws); + } else { + JSONObject wsJson = new JSONObject(); + wsJson.put("id", ws.get("wsId")); + wsJson.put("name", ws.get("wsName")); + if (i == 0) { + wsJson.put("open", true); + } else { + wsJson.put("open", false); + } + wsJson.put("ws", true); + wsJson.put("wsName", ws.get("wsName")); + if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { + wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER); + } else { + wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); + } + wsTree.add(wsJson); + wsIds.append(ws.get("wsId")).append(","); + i++; + } + } + wsList.removeAll(removeList); + + if (wsList.size() > 0) { + ProcessPublishWeb web = new ProcessPublishWeb(uc); + for (Map ws : wsList) { + List repositoryModelList = dao.getRepositoryListByPublishRole(roleId, ws.get("wsId")); + repositoryList.addAll(web.getRepositoryTree(repositoryModelList, ws.get("wsId"), true, false, false, null, false)); + } + } else { + emptyMessage = "资产库被停用"; + } + } else { + emptyMessage = "可访问流程未发布"; + } + + if (repositoryList != null && repositoryList.size() > 0) { + wsTree.addAll(repositoryList); + for (int i = 0; i < repositoryList.size(); i++) { + String versionId = ""; + if (repositoryList.getJSONObject(i).containsKey("versionId")) { + versionId = repositoryList.getJSONObject(i).getString("versionId"); + } else { + versionId = repositoryList.getJSONObject(i).getString("id"); + } + modelIds.append(versionId).append(","); + } + } + + boolean isComment = PublisherConf.isComment(); //允许留言 + boolean isViewHistory = PublisherConf.isViewHistory(); //允许查看历史发布记录 + boolean isViewAttribute = PublisherConf.isViewAttribute(); //允许查看属性 + boolean isPrint = PublisherConf.isPrint(); //允许打印 + String fotter = PublisherConf.getFotter(); //页底信息 + fotter = fotter == null ? "" : fotter; + String title = PublisherConf.getTitle(); //门户标题 + JSONObject dockDisplay = new JSONObject(); + if (!isComment) { + dockDisplay.put("messageView", "display: none;"); + } + if (!isViewHistory) { + dockDisplay.put("publishView", "display: none;"); + } + if (!isViewAttribute) { + dockDisplay.put("attributeView", "display: none;"); + } + if (!isPrint) { + dockDisplay.put("printView", "display: none;"); + } + Map macroLibraries = new HashMap(); + boolean isCoEUser = CoeUserDaoFactory.createUser().validateIsAccessCOE(uc.getUID()); + //公共方法 判断密码修改周期 + PublicPortalWeb portalWeb = new PublicPortalWeb(uc); + JSONObject params = portalWeb.getLoginCheckSecurityInfo(); + macroLibraries.put("isSecurityPwdChange", params.getBoolean("isSecurityPwdChange")); + macroLibraries.put("forceChangePwd", params.getBoolean("forceChangePwd")); + macroLibraries.put("isSecurityPwdComplexity", params.getBoolean("isSecurityPwdComplexity")); + macroLibraries.put("securityMinPwdLength", params.getIntValue("securityMinPwdLength")); + macroLibraries.put("securityMaxPwdLength", params.getIntValue("securityMaxPwdLength")); + macroLibraries.put("sid", uc.getSessionId()); + macroLibraries.put("roleId", roleId); + macroLibraries.put("wsTree", wsTree); + macroLibraries.put("wsId", (wsList == null || wsList.size() == 0) ? "" : wsList.get(0).get("wsId")); + macroLibraries.put("wsName", (wsList == null || wsList.size() == 0) ? "" : wsList.get(0).get("wsName")); + macroLibraries.put("dockDisplay", dockDisplay.toString()); + macroLibraries.put("fotter", fotter.length() > 40 ? fotter.substring(0, 39) : fotter); + macroLibraries.put("title", title.length() > 20 ? title.substring(0, 19) : title); + macroLibraries.put("isComment", isComment); + macroLibraries.put("isViewHistory", isViewHistory); + macroLibraries.put("isViewAttribute", isViewAttribute); + macroLibraries.put("isPrint", isPrint); + macroLibraries.put("userName", uc.getUserName()); + macroLibraries.put("userPhoto", SDK.getPortalAPI().getUserPhoto(uc, uc.getUID())); + macroLibraries.put("emptyMessage", emptyMessage); + macroLibraries.put("entryCoEView", isCoEUser && HighSecurityUtil.allow3PLoginPal(uc.getUID()) ? "" : "display: none;"); + macroLibraries.put("settingView", uc.getUID().equals("admin") ? "" : "display: none;"); + macroLibraries.put("appId", PublisherConf.APPID); + String wsIdsStr = wsIds.toString(); + macroLibraries.put("wsIds", wsIdsStr.contains(",") ? wsIdsStr.substring(0, wsIdsStr.lastIndexOf(",")) : wsIdsStr); + String modelIdsStr = modelIds.toString(); + macroLibraries.put("modelIds", modelIdsStr.contains(",") ? modelIdsStr.substring(0, modelIdsStr.lastIndexOf(",")) : modelIdsStr); + //App-关联查询 + AppContext relationSearchAppContext = AppsAPIManager.getInstance().getAppContext(PublisherConf.RELATION_SEARCH_ID); + macroLibraries.put("relationSearchId", PublisherConf.RELATION_SEARCH_ID.replace(".", "_")); + macroLibraries.put("relationSearchTitle", PublisherConf.RELATION_SEARCH_NAME); + macroLibraries.put("relationSearchCmd", "_portal_home"); + if (relationSearchAppContext != null && SDK.getAppAPI().isActive(relationSearchAppContext.getId())) { + macroLibraries.put("relationSearchIcon", relationSearchAppContext.getIcon16Url(uc)); + macroLibraries.put("relationSearchName", relationSearchAppContext.getName()); + macroLibraries.put("showRelationSearch", ""); + } else { + macroLibraries.put("showRelationSearch", "display: none;"); + } + if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home.html", macroLibraries); + } else if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v2")) { + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.home1.html", macroLibraries); + } + return null; + } + } + + /** + * v3新版门户 + * @return + */ + public Map getHomePage2(UserContext uc) { + Map macroLibraries = new HashMap(); + AppAPI appApi = SDK.getAppAPI(); + JSONArray wsTree = new JSONArray(); + String isIntegrationAWSUser = appApi.getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 + String roleId = ""; + if ("false".equals(isIntegrationAWSUser)) { + roleId = PublishConst.GUESTROLE; + } else { + roleId = uc.getRoleModel().getId(); + } + boolean isCoEUser = CoeUserDaoFactory.createUser().validateIsAccessCOE(uc.getUID()); + //公共方法 判断密码修改周期 + PublicPortalWeb portalWeb = new PublicPortalWeb(uc); + JSONObject params = portalWeb.getLoginCheckSecurityInfo(); + macroLibraries.put("isSecurityPwdChange", params.getBoolean("isSecurityPwdChange")); + macroLibraries.put("forceChangePwd", params.getBoolean("forceChangePwd")); + macroLibraries.put("isSecurityPwdComplexity", params.getBoolean("isSecurityPwdComplexity")); + macroLibraries.put("securityMinPwdLength", params.getIntValue("securityMinPwdLength")); + macroLibraries.put("securityMaxPwdLength", params.getIntValue("securityMaxPwdLength")); + macroLibraries.put("sid", uc.getSessionId()); + macroLibraries.put("roleId", roleId); + macroLibraries.put("wsTree", wsTree); + macroLibraries.put("userName", uc.getUserName()); + macroLibraries.put("userPhoto", SDK.getPortalAPI().getUserPhoto(uc, uc.getUID())); + macroLibraries.put("entryCoEView", isCoEUser && HighSecurityUtil.allow3PLoginPal(uc.getUID()) ? "" : "display: none;"); + macroLibraries.put("settingView", uc.getUID().equals("admin") ? "" : "display: none;"); + macroLibraries.put("appId", PublisherConf.APPID); + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); + JSONArray ws = new JSONArray(); + if (wsList != null && wsList.size() > 0) { + for (int i = 0; i < wsList.size(); i++) { + JSONObject object = new JSONObject(); + object.put("id", wsList.get(i).get("wsId")); + object.put("text", wsList.get(i).get("wsName")); + object.put("initDisplay", "0"); + ws.add(object); + } + } + macroLibraries.put("ws", ws); + macroLibraries.put("palAdmin", new CoeUser().isCoEManager(uc.getUID())); + // 获取logo图片路径 + JSONObject object = getLogoImgPath(uc); + macroLibraries.put("logoImgPath", object.getString("src")); + macroLibraries.put("logoImgName", object.getString("name")); + // 门户参数 + macroLibraries.put("xpagesId", PublisherConf.XPAGES_ID); + macroLibraries.put("portalTabs", PublisherConf.PORTAL_TABS); + return macroLibraries; + } + + /** + * 首页 + * + * @return + * @author zhangming + */ + public String getClientMain(String wsId) { + JSONArray result = search("", null, null, null); //所有文件 + + JSONArray plrdArray = new JSONArray(); + JSONArray plrpArray = new JSONArray(); + PALRepository dao = new PALRepository(); + List> plrds = dao.searchRepositoryPlrdByPublisherPortal(_uc.getRoleModel().getId()); + for (Map plrd : plrds) { + if (plrd != null && plrd.containsKey("id") && !plrd.get("id").equals("")) { + plrdArray.add(plrd); + } + } + List> plrps = dao.searchRepositoryPlrpByPublisherPortal(_uc.getRoleModel().getId()); + for (Map plrp : plrps) { + if (plrp != null && plrp.containsKey("id") && !plrp.get("id").equals("")) { + plrpArray.add(plrp); + } + } + + Map macroLibraries = new HashMap(); + macroLibraries.put("result", result); + macroLibraries.put("plrd", plrdArray); + macroLibraries.put("plrp", plrpArray); + macroLibraries.put("wsId", wsId); + macroLibraries.put("sid", _uc.getSessionId()); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.main.html", macroLibraries); + } + + /** + * 查询 + * + * @param modelIds + * @param filter + * @param order + * @param name + * @return + * @author zhangming + */ + public String searchInClientMain(String modelIds, String filter, String order, String name) { + JSONArray result = search(modelIds, filter, order, name); + + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("result", result); + return ro.toString(); + } + + private JSONArray search(String modelIds, String filter, String order, String name) { + PALRepository dao = new PALRepository(); + List models = dao.searchRepositoryByPublisherPortal(modelIds, filter, order, name); + + List jsonList = new ArrayList<>(); + for (String id : models) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model == null) { + continue; + } + + boolean isActive = false; + if (model != null && !"default".equals(model.getMethodId())) { + if (PALMethodCache.getPALMethodModelById(model.getMethodId()) == null) { + isActive = false; + } else { + String methodId = PALMethodCache.getPALMethodModelById(model.getMethodId()).getApp().getId(); + isActive = SDK.getAppAPI().isActive(methodId); + } + } + + String processDefId = ""; + String appId = ""; + if (model != null) {// 获取流程版本id + appId = CoeProcessLevelUtil.getAppId(model.getId()); + processDefId = CoeProcessLevelUtil.getProcessDefIdByVer(appId, model.getId(), (int)model.getVersion()); + } + + String p = model.getFilePath(); + String imagePath = "../apps/"+ CoEConstant.APP_ID +"/img/method/default.png"; + if (!processDefId.equals("")) { + imagePath = "data:image/png;base64," + BPMNIO.getBPMNImageThumbnail(CoeProcessLevelUtil.getAppId(model.getId()), processDefId); + } else { + if (!"".equals(p)) { + UtilFile utilFile = new UtilFile(p + "/" + model.getId() + ".small.png"); + if (utilFile.exists()) { + byte[] base64Bytes = Base64.encode(utilFile.readBytes()); + imagePath = "data:image/png;base64," + new String(base64Bytes); + } + } + } + if ("default".equals(model.getMethodId())) { + imagePath = "../apps/com.actionsoft.apps.coe.pal.publisher/img/default_folder.png"; + } + + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("imgPath", imagePath); + object.put("processDefId", processDefId); + object.put("methodId", model.getMethodId()); + String relationType = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_RELATION_TYPE); + object.put("plrd", ""); + object.put("plrp", ""); + if ("address".equals(relationType)) { + String dutyDept = model.getDutyDept(); + if (!UtilString.isEmpty(dutyDept)) { + if (SDK.getORGAPI().getDepartmentById(dutyDept) != null) { + dutyDept = SDK.getORGAPI().getDepartmentById(dutyDept).getName(); + object.put("plrd", dutyDept); + } + } + String dutyPerson = model.getDutyUser(); + if (!UtilString.isEmpty(dutyPerson)) { + object.put("plrp", SDK.getORGAPI().getUserAliasNames(dutyPerson)); + } + } else { + String plrdId = model.getOwnerDept(); + if (plrdId != null && !"".equals(plrdId)) { + List list = DesignerShapeRelationCache.getListByAttrId(id, "", "plRD"); + if (list != null && list.size() > 0) { + object.put("plrd", list.get(0).getRelationShapeText()); + } else { + object.put("plrd", ""); + } + } + String plrpId = model.getOwnerUser(); + if (plrpId != null && !"".equals(plrpId)) { + List list = DesignerShapeRelationCache.getListByAttrId(id, "", "plRP"); + if (list != null && list.size() > 0) { + object.put("plrp", list.get(0).getRelationShapeText()); + } else { + object.put("plrp", ""); + } + } + } + object.put("version", model.getVersion()); + object.put("isActive", isActive); + + if (model.isPublish()) { + PublishListHistory historyDao = new PublishListHistory(); + String lastPublishDate = historyDao.getLastPublishDateByModelId(model.getId()); + if (lastPublishDate != null && !"".equals(lastPublishDate)) { + lastPublishDate = lastPublishDate.substring(0, 10); + } + object.put("publishDate", lastPublishDate == null ? "" : lastPublishDate); + } else { + object.put("publishDate", ""); + } + + jsonList.add(object); + } + + if (order != null && order.contains("plrd")) { + Collections.sort(jsonList, new ComparatorPlrdChinese()); + } + if (order != null && order.contains("plrp")) { + Collections.sort(jsonList, new ComparatorPlrpChinese()); + } + return JSONArray.parseArray(JSON.toJSONString(jsonList)); + } + + private class ComparatorPlrdChinese implements Comparator { + @Override + public int compare(JSONObject model1, JSONObject model2) { + String plrd1 = model1.getString("plrd"); + String plrd2 = model2.getString("plrd"); + return Collator.getInstance(Locale.CHINESE).compare(plrd1, plrd2); + } + } + + private class ComparatorPlrpChinese implements Comparator { + @Override + public int compare(JSONObject model1, JSONObject model2) { + String plrp1 = model1.getString("plrp"); + String plrp2 = model2.getString("plrp"); + return Collator.getInstance(Locale.CHINESE).compare(plrp1, plrp2); + } + } + + /** + * 查询发布历史 + * + * @param start + * @param type N/C/S,如果查询全部该字段为空 + * @return + * @author zhangming + */ + public String getPublishList(String start, String type) { + ProcessPublishWeb web = new ProcessPublishWeb(_uc); + JSONArray list = web.getMorePublishHistory(start, "50", type); + + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("results", list); + return ro.toString(); + } + + public String getSettingData() { + boolean isComment = PublisherConf.isComment(); //允许留言 + boolean isViewHistory = PublisherConf.isViewHistory(); //允许查看历史发布记录 + boolean isViewAttribute = PublisherConf.isViewAttribute(); //允许查看属性 + boolean isPrint = PublisherConf.isPrint(); //允许打印 + String fotter = PublisherConf.getFotter(); //页底信息 + fotter = fotter == null ? "" : fotter; + String title = PublisherConf.getTitle(); //门户标题 + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("isComment", isComment + ""); + ro.put("isViewHistory", isViewHistory + ""); + ro.put("isViewAttribute", isViewAttribute + ""); + ro.put("isPrint", isPrint + ""); + ro.put("fotter", fotter); + ro.put("title", title); + return ro.toString(); + } + + /** + * 参数设置 + * + * @param title + * @param fotter + * @param isComment + * @param isPrint + * @param isViewAttribute + * @param isViewHistory + * @return + * @author zhangming + */ + public String setting(String title, String fotter, String isComment, String isPrint, String isViewAttribute, String isViewHistory) { + PublisherConf.setTitle(title); + PublisherConf.setFotter(fotter); + PublisherConf.setComment(isComment); + PublisherConf.setPrint(isPrint); + PublisherConf.setViewAttribute(isViewAttribute); + PublisherConf.setViewHistory(isViewHistory); + ResponseObject ro = ResponseObject.newOkResponse(); + return ro.toString(); + } + + /** + * 获取资产库列表 + * + * @return + * @author zhangming + */ + public String getOrgWsTreeData() { + ResponseObject ro = ResponseObject.newOkResponse(); + + List wsList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getInstanceAll(); + JSONArray wsTree = new JSONArray(); + if (wsList != null && wsList.size() > 0) { + int i = 0; + for (CoeWorkSpaceModel ws : wsList) { + boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.getUUId()); + if (isActive) { + JSONObject wsJson = new JSONObject(); + String wsId = ws.getUUId(); + wsJson.put("id", wsId); + wsJson.put("name", ws.getWsName()); + if (i == 0) { + wsJson.put("open", true); + } else { + wsJson.put("open", false); + } + wsJson.put("ws", true); + wsJson.put("wsId", wsId); + wsJson.put("wsName", ws.getWsName()); + if (PublisherConf.PUBLISH_PORTAL_VERSION.equals("v1")) { + wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER); + } else { + wsJson.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); + } + wsTree.add(wsJson); + i++; + + JSONArray jsonArray = PALRepositoryQueryAPIManager.getInstance().getPalRepositoryTreeData(_uc, wsId, "org", "isUsed"); + for (int j = 0; j < jsonArray.size(); j++) { + JSONObject object = jsonArray.getJSONObject(j); + if (object.getString("id").equals("org")) { + object.put("id", wsId + "_org"); + object.put("pid", wsId); + object.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); + } else { + if (object.getString("pid").equals("org")) { + object.put("pid", wsId + "_org"); + } + if (object.getString("isParent") == "true") { + object.put("icon", PublisherConf.PORTAL_TREE_ICON_FOLDER1); + } else { + object.put("icon", ""); + } + } + + wsTree.add(object); + } + } + } + } + ro.put("wsTreeData", wsTree); + return ro.toString(); + } + + /** + * 标准化体系页面 + * + * @return + * @author zhangming + */ + public String toOrgRelationPage() { + Map macroLibraries = new HashMap(); + macroLibraries.put("sid", _uc.getSessionId()); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.org.html", macroLibraries); + } + + /** + * 组织模型相关的模型页面 + * + * @return + * @author zhangming + */ + public String toOrgRelationModelPage() { + Map macroLibraries = new HashMap(); + macroLibraries.put("sid", _uc.getSessionId()); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.org.main.html", macroLibraries); + } + + public String getOrgRelativeModel(String orgModelId, String modelIds) { + ResponseObject ro = ResponseObject.newOkResponse(); + ro.put("data", getOrgRelationModelList(orgModelId, modelIds)); + return ro.toString(); + } + + private JSONObject getOrgRelationModelList(String orgModelId, String modelIds) { + JSONObject data = new JSONObject(); + + //如果orgModelId为空,则查询发布历史 + if (orgModelId == null || "".equals(orgModelId)) { + PublisherClientDao publisherDao = new PublisherClientDao(); + String[] modelIdArray = modelIds.split(","); + StringBuilder sb = new StringBuilder(); + if (modelIdArray.length > 0) { + for (String modelId : modelIdArray) { + if (!"".equals(modelId)) { + sb.append("'" + modelId + "',"); + } + } + } + if (sb.length() > 0) { + String wsId = ""; + if (modelIdArray[0].length() > 36) { + wsId = modelIdArray[0].substring(modelIdArray[0].indexOf("_") + 1); + } else if (modelIdArray[0].length() == 36) { + if (PALRepositoryCache.getCache().get(modelIdArray[0]) != null) { + wsId = PALRepositoryCache.getCache().get(modelIdArray[0]).getWsId(); + } + } else { + return data; + } + + String sqlIds = sb.substring(0, sb.lastIndexOf(",")); + List> processList = publisherDao.getPublishListData(sqlIds, "process", wsId, null); + data.put("processList", processList); + Map controlPolicyIds = publisherDao.getControlPolicyId(wsId); + //管理标准 + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { + List> managementRoleList = new ArrayList>(); + List> technicalRoleList = new ArrayList>(); + List> workRoleList = new ArrayList>(); + String publishedManagementStandardIds = ""; + String publishedTechnicalStandardIds = ""; + String publishedWorkStandardIds = ""; + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { + String managementStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD); + publishedManagementStandardIds = getRelationPublishedControlIds(wsId, managementStandardId, "control.policy"); + } + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD)) { + String technicalStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD); + publishedTechnicalStandardIds = getRelationPublishedControlIds(wsId, technicalStandardId, "control.policy"); + } + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_WORK_STANDARD)) { + String workStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_WORK_STANDARD); + publishedWorkStandardIds = getRelationPublishedControlIds(wsId, workStandardId, "control.policy"); + } + + List> list = publisherDao.getPublishListData(sqlIds, "control", wsId, "control.policy"); + if (list != null && list.size() > 0) { + for (Map map : list) { + String id = map.get("id").toString(); + if (publishedManagementStandardIds.contains(id)) { + managementRoleList.add(map); + } else if (publishedTechnicalStandardIds.contains(id)) { + technicalRoleList.add(map); + } else if (publishedWorkStandardIds.contains(id)) { + workRoleList.add(map); + } + + } + } + data.put("managementList", managementRoleList); + data.put("technicalList", technicalRoleList); + data.put("workList", workRoleList); + } else { + data.put("managementList", new ArrayList()); + data.put("technicalList", new ArrayList()); + data.put("workList", new ArrayList()); + } + } + + return data; + } + + PALRepositoryModel orgModel = PALRepositoryCache.getCache().get(orgModelId); + String wsId = orgModel.getWsId(); + if (orgModel != null) { + List orgList = new ArrayList(); + PALRepositoryQueryAPIManager.getInstance().getAllUsedPalRepositoryModelsByPid(wsId, orgModelId, orgList); //组织模型的所有子流程 + StringBuilder sbOrgIds = new StringBuilder("'" + orgModelId + "'"); + if (orgList != null && orgList.size() > 0) { + for (PALRepositoryModel model : orgList) { + sbOrgIds.append(",'").append(model.getId()).append("'"); + } + } + //流程模型 + PublisherClientDao publisherDao = new PublisherClientDao(); + List> processIdList = publisherDao.getFileIdsByRelationFileId1(sbOrgIds.toString()); //org模型关联的流程模型Id + List> processList = publisherDao.getFileIdsByRelation1(sbOrgIds.toString()); + String processIds = ""; //processIds保存org模型关联的所有process模型Id,包括已发布和未发布的 + if (processIdList != null && processIdList.size() > 0) { + StringBuilder sbProcessIds = new StringBuilder(); + for (Map processMap : processIdList) { + String processId = processMap.get("id").toString(); + sbProcessIds.append("'").append(processId).append("',"); + } + processIds = sbProcessIds.substring(0, sbProcessIds.lastIndexOf(",")); + } + data.put("processIds", processIds); + List> processOrgList = new ArrayList>(); + if (processList != null) { + for (Map map : processList) { + if (modelIds.contains(map.get("id").toString())) { + processOrgList.add(map); + } + } + } + data.put("processList", processOrgList); + + //根据流程模型,获取关联的制度模型 + Map controlPolicyIds = publisherDao.getControlPolicyId(wsId); + //管理标准 + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD)) { + String managementStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_MANAGEMENT_STANDARD); + String publishedManagementStandardIds = getRelationPublishedControlIds(wsId, managementStandardId, "control.policy"); + List> managementList = publisherDao.getRelationFileIds(processIds, publishedManagementStandardIds); + List> managementRoleList = new ArrayList>(); + if (managementList != null && managementList.size() > 0) { + for (Map managementMap : managementList) { + String id = managementMap.get("id").toString(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (modelIds.contains(model.getVersionId())) { + managementRoleList.add(managementMap); + } + } + } + data.put("managementList", managementRoleList); + } else { + data.put("managementList", new ArrayList()); + } + //技术标准 + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD)) { + String technicalStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_TECHNICAL_STANDARD); + String publishedTechnicalStandardIds = getRelationPublishedControlIds(wsId, technicalStandardId, "control.policy"); + List> technicalList = publisherDao.getRelationFileIds(processIds, publishedTechnicalStandardIds); + List> technicalRoleList = new ArrayList>(); + if (technicalList != null && technicalList.size() > 0) { + for (Map managementMap : technicalList) { + String id = managementMap.get("id").toString(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (modelIds.contains(model.getVersionId())) { + technicalRoleList.add(managementMap); + } + } + } + data.put("technicalList", technicalRoleList); + } else { + data.put("technicalList", new ArrayList()); + } + //工作标准 + if (controlPolicyIds.containsKey(PublisherConstant.ORG_RELATION_WORK_STANDARD)) { + String workStandardId = controlPolicyIds.get(PublisherConstant.ORG_RELATION_WORK_STANDARD); + String publishedWorkStandardIds = getRelationPublishedControlIds(wsId, workStandardId, "control.policy"); + List> workList = publisherDao.getRelationFileIds(processIds, publishedWorkStandardIds); + List> workRoleList = new ArrayList>(); + if (workList != null && workList.size() > 0) { + for (Map managementMap : workList) { + String id = managementMap.get("id").toString(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (modelIds.contains(model.getVersionId())) { + workRoleList.add(managementMap); + } + } + } + data.put("workList", workRoleList); + } else { + data.put("workList", new ArrayList()); + } + } + return data; + } + + private String getRelationPublishedControlIds(String wsId, String pid, String methodId) { + List standardList = new ArrayList(); + PALRepositoryQueryAPIManager.getInstance().getAllPublishedPalRepositoryModelsByPid(wsId, pid, standardList); + String ids = ""; //已经发布的管理标准 + StringBuilder sbStandardIds = new StringBuilder("'" + pid + "'"); + if (standardList != null && standardList.size() > 0) { + for (PALRepositoryModel model : standardList) { + if (methodId == null || "".equals(methodId) || methodId.equals(model.getMethodId())) { + sbStandardIds.append(",'").append(model.getId()).append("'"); + } + } + } + ids = sbStandardIds.toString(); + return ids; + } + + /** + * 按组织维护流程 + * + * @param wsId + * @return + */ + public String getManageHome(String wsId, String categorys) { + Map result = new HashMap(); + result.put("sid", _uc.getSessionId()); + JSONArray treeData = new JSONArray(); + if (UtilString.isEmpty(wsId)) { + wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); + } + result.put("wsId", wsId); + //根节点 + String[] categoryArray = categorys.split(","); + for (String category : categoryArray) { + category = category.trim(); + JSONObject categoryRoot = new JSONObject(); + categoryRoot.put("id", category); + categoryRoot.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); + categoryRoot.put("open", false); + categoryRoot.put("nocheck", true); + treeData.add(categoryRoot); + + //查询部门下的流程根节点 + List list = PALRepositoryQueryAPIManager.getInstance().getRootPALRepositoryModelsByDeptId(_uc.getUID(), wsId, null, category, true, false); + List newList = new ArrayList(); + for (PALRepositoryModel process : list) { + PALRepositoryModelImpl newProcess = (PALRepositoryModelImpl) process; + newProcess.setNewParentId(category); + newList.add((PALRepositoryModel) newProcess); + } + treeData.addAll(PALRepositoryQueryAPIManager.getInstance().list2Json(_uc, newList, true, false)); + } + result.put("treeData", treeData); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.manage.home.html", result); + } + + /** + * 已发布流程查询 + * + * @param wsId + * @param categorys + * @return + */ + public String getManageSearchHome(String wsId, String categorys) { + Map result = new HashMap(); + result.put("sid", _uc.getSessionId()); + if (UtilString.isEmpty(wsId)) { + wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); + } + + JSONArray treeData = new JSONArray(); + PALRepositoryQueryAPIManager manager = PALRepositoryQueryAPIManager.getInstance(); + PALRepository dao = new PALRepository(); + String[] categoryList = categorys.split(","); + StringBuilder filePerms = new StringBuilder(""); + for (String category : categoryList) { + category = category.trim(); + + JSONObject root = new JSONObject(); + root.put("id", category); + root.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); + root.put("open", false); + treeData.add(root); + + List repositoryModelList = dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, null, "PLNO"); + for (PALRepositoryModel model : repositoryModelList) { + filePerms.append(model.getId()).append(","); + } + List newList = manager.setNewPid(repositoryModelList); + treeData.addAll(manager.list2Json(_uc, newList, false, true)); + } + + result.put("treeData", treeData); + result.put("filePerms", filePerms); + + result.put("wsId", wsId); + result.put("processRootId", SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "processRootId")); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.search.home.html", result); + } + + /** + * 已发布流程查询 + * + * @param wsId + * @param categorys + * @return + */ + public String getManageSearchHomeCondition(String wsId, String categorys) { + Map result = new HashMap(); + result.put("sid", _uc.getSessionId()); + if (UtilString.isEmpty(wsId)) { + wsId = SDK.getAppAPI().getProperty(CoEConstant.APP_ID, CoEConstant.PROPERTY_DEFAULT_WSID); + } + + JSONArray treeData = new JSONArray(); + PALRepositoryQueryAPIManager manager = PALRepositoryQueryAPIManager.getInstance(); + PALRepository dao = new PALRepository(); + String[] categoryList = categorys.split(","); + StringBuilder filePerms = new StringBuilder(""); + for (String category : categoryList) { + category = category.trim(); + + JSONObject root = new JSONObject(); + root.put("id", category); + root.put("name", I18nRes.findValue(CoEConstant.APP_ID, category)); + root.put("open", false); + treeData.add(root); + + JSONArray params = new JSONArray(); + JSONObject param1 = new JSONObject(); + param1.put("key", "securityclass"); + param1.put("value", "='内部'"); + params.add(param1); + List repositoryModelList = dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, params, "PLNO"); + params = new JSONArray(); + JSONObject param2 = new JSONObject(); + param2.put("key", "securityclass"); + param2.put("value", "='外部公开'"); + params.add(param2); + repositoryModelList.addAll(dao.searchRepositoryList(wsId, null, null, "", -1, null, null, null, null, null, null, -1, null, category, null, false, true, "", "", -1, params, "PLNO")); + for (PALRepositoryModel model : repositoryModelList) { + filePerms.append(model.getId()).append(","); + } + List newList = manager.setNewPid(repositoryModelList); + treeData.addAll(manager.list2Json(_uc, newList, false, true)); + } + + result.put("treeData", treeData); + result.put("filePerms", filePerms); + + result.put("wsId", wsId); + result.put("processRootId", SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "processRootId")); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.search.home.html", result); + } + + private boolean isEmpty(List list) { + return list == null || list.size() == 0; + } + + /** + * 获取当前人权限下的模型id + * 条件: + * 1.模型中有节点关联的是AWS平台的人员且人员与当前人相同 + * 2.模型中有关联节点是角色,且角色是当前人员的所属角色(包括兼职角色) + * 3.模型的文件属性中的责任人是当前人 + * 4.获取的流程文件的当前版本必须是已发布 + * @param uc + * @return + */ + private Set getAwsOrgPermRepositoryByUser(UserContext uc, String category, boolean isPublish) { + Set result = new HashSet<>(); + // 获取当前人的所有角色 + String userId = uc.getUID(); + Set roleIds = new HashSet<>(); + RoleModel roleModel = uc.getRoleModel(); + roleIds.add(roleModel.getId()); + // 兼职角色 + List userMapModels = UserMapCache.getMapListOfUser(userId); + if (!isEmpty(userMapModels)) { + for (UserMapModel role : userMapModels) { + roleIds.add(role.getRoleId()); + } + } + // 条件1,2,4 + List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); + if (!isEmpty(list)) { + for (DesignerShapeRelationModel model : list) { + JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); + if ("user".equalsIgnoreCase(object.getString("type")) && uc.getUID().equals(object.getString("id"))) { + PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); + if (p != null) { + if (isPublish) { + if (p.isPublish()) { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } else { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } + } + if ("role".equalsIgnoreCase(object.getString("type")) && roleIds.contains(object.getString("id"))) { + PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); + if (p != null) { + if (isPublish) { + if (p.isPublish()) { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } else { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } + } + } + } + // 条件3,4 + CoeWorkSpace workSpace = new CoeWorkSpace(); + List wsList = workSpace.getNormalCoeWorkSpaceModelRecodes(); + if (!isEmpty(wsList)) { + for (CoeWorkSpaceModel model : wsList) { + Iterator iterator = PALRepositoryCache.getByWsId(model.getUUId()); + while (iterator.hasNext()) { + PALRepositoryModel pModel = iterator.next(); + if (pModel != null && pModel.getMethodCategory().equals(category) && userId.equals(pModel.getDutyUser())) { + if (isPublish) { + if (pModel.isPublish()) { + result.add(pModel.getId()); + } + } else { + result.add(pModel.getId()); + } + } + } + } + } + return result; + } + + /** + * 获取当前人权限下的模型id + * 条件: + * 1.模型中有节点关联的是AWS平台的人员且人员与当前人相同 + * 2.模型中有关联节点是角色,且角色是当前人员的所属角色(包括兼职角色) + * 3.获取的流程文件的当前版本必须是已发布 + * @param uc + * @return + */ + private Set getAwsOrgPermRealtionRepositoryByUser(UserContext uc, String category, boolean isPublish) { + Set result = new HashSet<>(); + // 获取当前人的所有角色 + String userId = uc.getUID(); + Set roleIds = new HashSet<>(); + RoleModel roleModel = uc.getRoleModel(); + roleIds.add(roleModel.getId()); + // 兼职角色 + List userMapModels = UserMapCache.getMapListOfUser(userId); + if (!isEmpty(userMapModels)) { + for (UserMapModel role : userMapModels) { + roleIds.add(role.getRoleId()); + } + } + // 条件1,2,3 + List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); + if (!isEmpty(list)) { + for (DesignerShapeRelationModel model : list) { + JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); + if ("user".equalsIgnoreCase(object.getString("type")) && uc.getUID().equals(object.getString("id"))) { + PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); + if (p != null) { + if (isPublish) { + if (p.isPublish()) { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } else { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } + } + if ("role".equalsIgnoreCase(object.getString("type")) && roleIds.contains(object.getString("id"))) { + PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); + if (p != null) { + if (isPublish) { + if (p.isPublish()) { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } else { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } + } + } + } + return result; + } + + /** + * 获取责任人是当前人的模型id + * 条件: + * 1.模型的文件属性中的责任人是当前人 + * @param uc + * @return + */ + private Set getPermRepositoryByDutyPerson(UserContext uc, String category, boolean isPublish) { + Set result = new HashSet<>(); + // 获取当前人的所有角色 + String userId = uc.getUID(); + // 条件3,4 + CoeWorkSpace workSpace = new CoeWorkSpace(); + List wsList = workSpace.getNormalCoeWorkSpaceModelRecodes(); + if (!isEmpty(wsList)) { + for (CoeWorkSpaceModel model : wsList) { + Iterator iterator = PALRepositoryCache.getByWsId(model.getUUId()); + while (iterator.hasNext()) { + PALRepositoryModel pModel = iterator.next(); + if (pModel != null && pModel.getMethodCategory().equals(category) && userId.equals(pModel.getDutyUser())) { + if (isPublish) { + if (pModel.isPublish()) { + result.add(pModel.getId()); + } + } else { + result.add(pModel.getId()); + } + } + } + } + } + return result; + } + + /** + * 获取当前人给定部门时权限下的模型id + * 模型中有关联节点是部门,且角色是当前人员的所属角色(包括兼职角色) + * @param uc + * @param category + * @param deptId + * @return + */ + private Set getAwsOrgPermRepositoryByDept(UserContext uc, String category, String deptId, boolean isPublish) { + Set result = new HashSet<>(); + List list = DesignerShapeRelationCache.getListByRelationShapeId("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000"); + if (!isEmpty(list)) { + for (DesignerShapeRelationModel model : list) { + JSONObject object = JSONObject.parseObject(model.getRelationShapeText()); + if ("department".equalsIgnoreCase(object.getString("type")) && deptId.equals(object.getString("id"))) { + PALRepositoryModel p = PALRepositoryCache.getCache().get(model.getFileId()); + if (p != null && p.isPublish()) { + if (isPublish) { + if (p.isPublish()) {// 已发布 + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } else { + if (UtilString.isEmpty(category)) { + result.add(p.getId()); + } else { + if (p.getMethodCategory().equals(category)) { + result.add(p.getId()); + } + } + } + } + } + } + } + return result; + } + + /** + * 获取当前人权限下的资产库id集合 + * @param uc + * @return + */ + private Set getAwsOrgPermWsByUser(UserContext uc, String category) { + Set wsIds = new HashSet<>(); + Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true); + for (String repositoryId : repositoryIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(repositoryId); + if (model != null && PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(model.getWsId())) + wsIds.add(model.getWsId()); + } + return wsIds; + } + + /** + * 根据userId获取具有权限的已发布资产库 + * @return + */ + private List> getPermRepositoryVersionIdByUser(UserContext uc, String roleId) { + // 获取资产库流程Id + PALRepository dao = new PALRepository(); + List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true, true); // 有访问权限的资产库 + if (wsList != null && wsList.size() > 0) { + List> removeList = new ArrayList>(); + for (Map ws : wsList) { + boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); + if (!isActive) { + removeList.add(ws); + } + } + wsList.removeAll(removeList); + } + return wsList; + } + + /** + * 根据userId获取具有权限的已发布资产库 + * pal自身权限+关联AWS平台权限 + * @return + */ + private List> getPalAndAwsPermRepositoryVersionIdByUser(UserContext uc, String roleId, String category) { + // 获取资产库流程Id + PALRepository dao = new PALRepository(); + //List> wsList = dao.getWorkSpaceListByPublishRole(roleId, true, true); // 有访问权限的资产库 + List> wsList = dao.getWorkSpaceListByPublishRole(roleId, false, true); // 有访问权限的资产库(发布+未发布) + if (wsList != null && wsList.size() > 0) { + List> removeList = new ArrayList>(); + for (Map ws : wsList) { + boolean isActive = PALRepositoryQueryAPIManager.getInstance().isActiveWorkSpace(ws.get("wsId")); + if (!isActive) { + removeList.add(ws); + } + } + wsList.removeAll(removeList); + } + // 关联AWS组织的资产库权限整合 + if (wsList == null) { + wsList = new ArrayList<>(); + } + Set wsIds = getAwsOrgPermWsByUser(uc, category); + if (wsIds.size() > 0) { + Set temp = new HashSet<>(); + for (Map ws : wsList) { + temp.add(ws.get("wsId")); + } + CoeWorkSpace wsDao = new CoeWorkSpace(); + for (String wsId : wsIds) { + if (!temp.contains(wsId)) { + CoeWorkSpaceModel model = wsDao.getInstance(wsId); + if (model != null) { + Map result = new HashMap<>(); + result.put("wsId", model.getUUId()); + result.put("wsName", model.getWsName()); + wsList.add(result); + } + } + } + } + return wsList; + } + + /** + * 获取基本参数 + * @param uc + * @param count + * @return + */ + private JSONObject getXPagesBasicParam(UserContext uc, String count) { + String isIntegrationAWSUser = SDK.getAppAPI().getProperty(PublisherConstant.PUBLISH, "isIntegrationAWSUser"); //是否整合AWS用户 + String roleId = ""; + if ("false".equals(isIntegrationAWSUser)) { + roleId = PublishConst.GUESTROLE; + } else { + roleId = uc.getRoleModel().getId(); + } + + boolean limit = true;// 是否限制条数,count为空则不限制 + int c = 0; + if(!UtilString.isEmpty(count)){ + c = Integer.parseInt(count); + } else { + limit = false; + } + JSONObject object = new JSONObject(); + object.put("roleId", roleId); + object.put("c", c); + object.put("limit", limit); + return object; + } + + /** + * 常用流程查询 + * xpages小页面 + * @param count + * @return + */ + public String commonProcessQuery(UserContext uc, String count) { + String category = "process"; + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + JSONObject param = getXPagesBasicParam(uc, count); + String roleId = param.getString("roleId"); + boolean limit = param.getBooleanValue("limit"); + int c = param.getIntValue("c"); + PublishListHistory pHistory = new PublishListHistory(); + JSONArray array = new JSONArray(); + // 获取常用流程数据 + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); + if (wsList != null && wsList.size() > 0) { + PublishCommonDao commonDao = new PublishCommonDao(); + + StringBuffer wsIds = new StringBuffer(); + String sqlParam = ""; + for (Map map : wsList) { + wsIds.append("'").append(map.get("wsId")).append("'").append(","); + } + if (wsIds.length() > 0) { + sqlParam = wsIds.substring(0, wsIds.length() - 1); + } + // 获取降序排列的数据 + Object [] commons = commonDao.getCommonDataByWsIds(sqlParam, category); + @SuppressWarnings("unchecked") + List list = (ArrayList) commons[0];// 按照设定顺序升序排序的id集合 + JSONObject datas = (JSONObject) commons[1]; + if (list != null && list.size() > 0) { + PALRepository repositoryDao = new PALRepository(); + Set versionIds = repositoryDao.getRepositoryVersionIdListByPublishRole(roleId, sqlParam, category); + Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 + for (String str : repositoryIds) { + versionIds.add(PALRepositoryCache.getCache().get(str).getVersionId()); + } + int index = 0; + List list1 = new ArrayList<>(); + for (String id : list) { + if (limit && index >= c) break; + JSONObject data = datas.getJSONObject(id); + int sort = data.getIntValue("sort"); + //将sort为0的数据单独提出来 + if (sort == 0) { + list1.add(data); + continue; + } + List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); + if (temps == null || temps.size() == 0) continue; + for (PALRepositoryModel model : temps) { + if (model.isPublish() && versionIds.contains(model.getVersionId())) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("versionId", model.getVersionId()); + object.put("method", model.getMethodId()); + object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); + String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + index++; + break; + } + } + } + //将sort为0的数据放在数组的末尾 + for (JSONObject data:list1) { + if (limit && index >= c) break; + List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); + if (temps == null || temps.size() == 0) continue; + for (PALRepositoryModel model : temps) { + if (model.isPublish() && versionIds.contains(model.getVersionId())) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("versionId", model.getVersionId()); + object.put("method", model.getMethodId()); + object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); + String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + index++; + break; + } + } + } + } + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.common.html", result); + } + + /** + * 高频流程查询 + * @param uc + * @param count + * @return + */ + public String frequencyProcessQuery(UserContext uc, String count) { + String category = "process"; + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + JSONObject param = getXPagesBasicParam(uc, count); + String roleId = param.getString("roleId"); + boolean limit = param.getBooleanValue("limit"); + int c = param.getIntValue("c"); + + JSONArray array = new JSONArray(); + // 获取高频流程记录数据 + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); + if (wsList != null && wsList.size() > 0) { + PublishFrequencyDao frequencyDao = new PublishFrequencyDao(); + StringBuffer wsIds = new StringBuffer(); + String sqlParam = ""; + for (Map map : wsList) { + wsIds.append("'").append(map.get("wsId")).append("'").append(","); + } + if (wsIds.length() > 0) { + sqlParam = wsIds.substring(0, wsIds.length() - 1); + } + Object [] frequencyModels = frequencyDao.getDatasOrderByCount(sqlParam, category); + @SuppressWarnings("unchecked") + List list = (ArrayList) frequencyModels[0];// 按照访问量降序排序的id集合 + JSONObject datas = (JSONObject) frequencyModels[1]; + PublishListHistory pHistory = new PublishListHistory(); + // 获取所有节点 + if (list != null && list.size() > 0) { + PALRepository repositoryDao = new PALRepository(); + Set versionIds = repositoryDao.getRepositoryVersionIdListByPublishRole(roleId, sqlParam, category); + Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 + for (String str : repositoryIds) { + versionIds.add(PALRepositoryCache.getCache().get(str).getVersionId()); + } + int index = 0; + for (String id : list) { + if (limit && index >= c) break; + JSONObject data = datas.getJSONObject(id); + List temps = PALRepositoryCache.getByVersionId(data.getString("wsId"), data.getString("plversionId")); + if (temps == null || temps.size() == 0) continue; + for (PALRepositoryModel model : temps) { + if (model.isPublish() && versionIds.contains(model.getVersionId())) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("versionId", model.getVersionId()); + object.put("count", data.getString("count")); + object.put("method", model.getMethodId()); + object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); + String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + index++; + break; + } + } + } + } + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.frequency.html", result); + } + + /** + * 系统、数据、组织、控制模型查询 + * @param count + * @return + */ + public String queryDataBycategory(UserContext uc, String count, String category, String page) { + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + JSONObject param = getXPagesBasicParam(uc, count); + String roleId = param.getString("roleId"); + boolean limit = param.getBooleanValue("limit"); + int c = param.getIntValue("c"); + JSONArray array = new JSONArray(); + // 获取系统模型数据 + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, category); + if (wsList != null && wsList.size() > 0) { + + StringBuffer wsIds = new StringBuffer(); + String sqlParam = ""; + for (Map map : wsList) { + wsIds.append("'").append(map.get("wsId")).append("'").append(","); + } + if (wsIds.length() > 0) { + sqlParam = wsIds.substring(0, wsIds.length() - 1); + } + int index = 0; + PALRepository dao = new PALRepository(); + List plList = dao.getRepositoryListByPublishRoleAndCategory(roleId, sqlParam, category); + Set repositoryIds = getAwsOrgPermRepositoryByUser(uc, category, true);// aws平台下的资产库流程文件 + // 整合PAL自身权限文件和关联AWS的权限文件 + if (repositoryIds != null && repositoryIds.size() > 0) { + // 整合完成之后重新排序,按照发布时间,层级,顺序排序 + if (plList == null) { + plList = new ArrayList<>(); + } + Set idSet = new HashSet<>(); + for (PALRepositoryModel plModel : plList) { + idSet.add(plModel.getId()); + } + for (String id : repositoryIds) { + if (!idSet.contains(id)) { + plList.add(PALRepositoryCache.getCache().get(id)); + } + } + // 排序 + Collections.sort(plList, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + Timestamp p1 = o1.getPublishDate(); + Timestamp p2 = o2.getPublishDate(); + if (!p1.equals(p2)) { + return p2.compareTo(p1); + } + int level1 = o1.getLevel(); + int level2 = o2.getLevel(); + if (level1 != level2) { + return level1 - level2; + } + int order1 = o1.getOrderIndex(); + int order2 = o2.getOrderIndex(); + return order1 - order2; + } + }); + } + if (plList != null && plList.size() > 0) { + for (PALRepositoryModel plModel : plList) { + JSONObject object = new JSONObject(); + object.put("id", plModel.getId()); + object.put("name", plModel.getName()); + object.put("versionId", plModel.getVersionId()); + object.put("date", plModel.getPublishDate() == null ? "" : plModel.getPublishDate()); + object.put("method", plModel.getMethodId()); + object.put("taskId", ""); + array.add(object); + index++; + if (limit && index >= c) { + break; + } + } + } + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages." + page + ".html", result); + } + + + + /** + * 发布动态 + * @param count + * @return + */ + public String queryNotificationData(UserContext uc, String start, String count) { + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + JSONObject param = getXPagesBasicParam(uc, count); + String roleId = param.getString("roleId"); + int startNum = -1; + if (!UtilString.isEmpty(start)) { + startNum = Integer.parseInt(start); + } + int limitNum = 10; + if (!UtilString.isEmpty(count)) { + limitNum = Integer.parseInt(count); + } + JSONArray array = new JSONArray(); + PublishListHistory dao = new PublishListHistory(); + // 获取所有的发布历史 + List modelList = dao.getPublishListHistory(); + if (!isEmpty(modelList)) { + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + palProcessIds.add(model.getId()); + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(uc, null, true); + // 整合所有权限 + for (String id : awsProcessIds) { + String tempVer = PALRepositoryCache.getCache().get(id).getVersionId(); + if (!palProcessIds.contains(tempVer)) { + palProcessIds.add(tempVer); + } + } + int index = 0; + for (PublishListHistoryModel model : modelList) { + if (index >= limitNum) { + break; + } + if (!palProcessIds.contains(model.getPalRepositoryId())) + continue; + PALRepositoryModel repositoryModel = PALRepositoryCache.getCache().get(model.getPalRepositoryId()); + if (repositoryModel == null) { + continue; + } + JSONObject object = new JSONObject(); + String actionType = model.getActionType(); + object.put("type", actionType); + object.put("date", model.getPublishDate()); + String intro = ""; + if ("N".equals(actionType)) { + intro = "新发布"; + } else if ("C".equals(actionType)) { + intro = "变更"; + } else if ("S".equals(actionType)) { + intro = "停用"; + } + object.put("intro", intro); + object.put("method", repositoryModel.getMethodId()); + object.put("desc", model.getPublishDesc()); + object.put("pid", model.getpId()); + PublishHistoryModel pModel = PublishHistoryCache.getModel(model.getpId()); + object.put("pDesc", pModel.getPublishDesc()); + object.put("id", model.getPalRepositoryId()); + object.put("name", repositoryModel.getName()); + object.put("version", VersionUtil.getVersionStr(repositoryModel.getVersion())); + object.put("isPublish", repositoryModel.isPublish() ? "1" : "0"); + String taskId = model.getTaskId(); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + index ++; + } + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.notification.html", result); + } + + /** + * xpages配置流程地图时查询资产库列表和平台单位列表 + * @param uc + * @return + */ + public String processmapWsAndOrgDataQuery(UserContext uc) { + ResponseObject ro = ResponseObject.newOkResponse(); + // 获取启用中的资产库 + List wsList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getCoeWorkSpaceModelRecodesNoPage(); + JSONArray wsArray = new JSONArray(); + if (!isEmpty(wsList)) { + for (CoeWorkSpaceModel ws : wsList) { + if (ws.getWsState() == 0) { + JSONObject object = new JSONObject(); + object.put("text", ws.getWsName()); + object.put("id", ws.getUUId()); + wsArray.add(object); + } + } + } + // 获取未注销的平台单位 + List cList = SDK.getORGAPI().getCompanys(); + JSONArray orgArray = new JSONArray(); + if (!isEmpty(cList)) { + for (CompanyModel company: cList) { + JSONObject object = new JSONObject(); + object.put("text", company.getName()); + object.put("id", company.getId()); + orgArray.add(object); + } + } + ro.put("wsData", wsArray); + ro.put("orgData", orgArray); + return ro.toString(); + } + + /** + * 流程地图 + * @param orgId + * @param wsId + * @return + */ + public String queryProcessmapData(UserContext uc, String wsId, String orgId) { + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + // 获取资产库一级流程 + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, "process"); + // wsId在wsList内则取wsId,不在则取wsList中第一个元素 + if (wsList != null && wsList.size() > 0) { + Set wsIds = new HashSet<>(); + for (Map map : wsList) { + wsIds.add(map.get("wsId")); + } + if (UtilString.isEmpty(wsId) || !wsIds.contains(wsId)) { + wsId = wsList.get(0).get("wsId"); + } + } + // 获取三个一级流程 + JSONArray processData = getUsedModelsByPid(roleId, wsId, "process"); + result.put("processData", processData); + + // 获取组织架构 + List orgList = SDK.getORGAPI().getCompanys(); + if (orgList != null && orgList.size() > 0) { + Set orgIds = new HashSet<>(); + for (int i = 0; i < orgList.size(); i++) { + if (orgList.get(i).isClosed()) { + continue; + } + orgIds.add(orgList.get(i).getId()); + } + if (UtilString.isEmpty(orgId) || !orgIds.contains(orgId)) { + orgId = orgList.get(0).getId(); + } + } + // 获取三个部门 + JSONArray deptData = getDeptsByCompany(orgId); + result.put("deptData", deptData); + result.put("wsId", wsId); + result.put("orgId", orgId); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.processmap.html", result); + } + + /** + * 获取3个一级部门 + * @param orgId + * @return + */ + private JSONArray getDeptsByCompany(String orgId) { + JSONArray result = new JSONArray(); + List list = SDK.getORGAPI().getDepartmentsByCompanyId(1, orgId); + int index = 0; + for (DepartmentModel model : list) { + if (model.isClosed()) { + continue; + } + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + result.add(object); + index++; + if (index >= 3) { + break; + } + } + return result ; + } + + // 当同一个version流程存在已发布和使用中的,过滤掉使用中的 + private List filterPublisherData(List list) { + if (list != null && list.size() > 0) { + List tempList = new ArrayList<>(); + Set idSet = new HashSet<>(); + for (PALRepositoryModel model : list) { + if (model.isPublish()) { + idSet.add(model.getVersionId()); + tempList.add(model); + } + } + for (PALRepositoryModel model : list) { + if (model.isUse() && !idSet.contains(model.getVersionId())) { + tempList.add(model); + } + } + list = tempList; + } + return list; + } + + /** + * 获取3个一级流程 + * @param wsId + * @param parentId + * @return + */ + private JSONArray getUsedModelsByPid(String roleId, String wsId, String parentId) { + JSONArray result = new JSONArray(); + if (!UtilString.isEmpty(wsId)) { + @SuppressWarnings("unchecked") + List list = IteratorUtils.toList(PALRepositoryCache.getByPid(wsId, "process")); + list = filterPublisherData(list); + if (list != null && list.size() > 0) { + // 排列 + Collections.sort(list, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0; + } + }); + PALRepository dao = new PALRepository(); + Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); + Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); + if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { + for (String awsId : relationAwsIdSet) { + idSet.add(awsId); + } + } + int index = 0; + for (PALRepositoryModel model : list) { + boolean flag = false; + if (model.isPublish() && idSet.contains(model.getVersionId())) { + flag = true; + } else { + Set ids = new HashSet<>(); + List subList = new ArrayList<>(); + PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); + if (subList != null && subList.size() > 0) { + for (PALRepositoryModel subModel : subList) { + if (subModel.isPublish() && idSet.contains(subModel.getVersionId())) { + flag = true; + break; + } + } + } + } + if (flag) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + result.add(object); + index++; + } + if (index >= 3) { + break; + } + } + } + } + return result; + } + + /** + * 搜索 + * @param uc + * @param text 搜索文本 + * @param type 类型 + * @param templateId xpagesId + * @param wsId 默认展示的流程资产库id + * @return + */ + public String search(UserContext uc, String text, String type, String templateId, String wsId) { + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + result.put("text", text); + result.put("type", type); + result.put("templateId", templateId); + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); + JSONArray ws = new JSONArray(); + if (wsList != null && wsList.size() > 0) { + for (int i = 0; i < wsList.size(); i++) { + JSONObject object = new JSONObject(); + object.put("id", wsList.get(i).get("wsId")); + object.put("text", wsList.get(i).get("wsName")); + if(wsId!=null && wsId.equals(wsList.get(i).get("wsId"))) { + object.put("initDisplay", "1"); //默认使用的流程资产库 + } else { + object.put("initDisplay", "0"); + } + ws.add(object); + } + } + result.put("ws", ws); + + JSONArray scope = new JSONArray(); + JSONObject object = new JSONObject(); + object.put("name", "已发布文件"); + object.put("type", "all"); + scope.add(object); + + // alsp获取xpages数据 + // 调用App + String sourceAppId = PublisherConf.APPID; + // aslp服务地址 + String aslp = "aslp://com.actionsoft.apps.addons.xpages/queryCwListByTemplateId"; + // 参数定义列表 + Map params = new HashMap(); + //模板id,必填 + params.put("templateId", templateId); + params.put("sid", uc.getSessionId()); + AppAPI appAPI = SDK.getAppAPI(); + //查询模板信息 + ResponseObject xpagesList = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); + JSONObject data = JSONObject.parseObject(xpagesList.toDataString()); + JSONArray cwList = data.getJSONArray("cwList"); + for (int i = 0; i < cwList.size(); i++) { + JSONObject obj = cwList.getJSONObject(i).getJSONArray("subList").getJSONObject(0); + JSONObject obj2 = new JSONObject(); + if (obj.getString("cwUrl").contains("com.actionsoft.apps.publisher_xpages_banner_msg")) { + continue; + } + obj2.put("name", obj.getString("cwName")); + String url = obj.getString("cwUrl"); + if (!url.contains("com.actionsoft.apps.publisher_xpages_")) {// 识别PAL流程发布默认的xpages + continue; + } + String type2 = url.substring(url.indexOf("xpages_") + 7, url.indexOf("_msg")); + obj2.put("type", type2); + scope.add(obj2); + } + result.put("scope", scope); + JSONObject logoObject = getLogoImgPath(uc); + result.put("logoImgPath", logoObject.getString("src")); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.search.html", result); + } + + /** + * 查询数据 + * @param searchText + * @param searchType + * @param searchWsId + * @param start + * @param pageLimit + * @return + */ + public String searchData(UserContext uc, String searchText, String searchType, String searchWsId, int start, int pageLimit) { + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + String wsIdsql = ""; + if (UtilString.isEmpty(searchWsId)) { + // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); + if (wsList != null && wsList.size() > 0) { + StringBuffer wsIds = new StringBuffer(); + for (Map map : wsList) { + wsIds.append("'").append(map.get("wsId")).append("'").append(","); + } + if (wsIds.length() > 0) { + wsIdsql = wsIds.substring(0, wsIds.length() - 1); + } + } + } else { + wsIdsql = "'" + searchWsId + "'"; + } + switch (searchType) { + case "all":// 已发布文件 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, null); + case "common":// 常用流程 + return getPublishedCommonData(searchText, wsIdsql, roleId, start, pageLimit, "process"); + case "frequency":// 高频流程 + return getPublishedFrequencyData(searchText, wsIdsql, roleId, start, pageLimit, "process"); + case "system":// 系统地图 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "itsystem"); + case "data":// 数据地图 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "data"); + case "control":// 控制地图 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "control"); + case "org":// 组织地图 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "org"); + case "processmap":// 流程地图 + return getAllPublishedData(searchText, wsIdsql, roleId, start, pageLimit, "process"); + default:// 通知公告 + return getPublishNotificationData(searchText, wsIdsql, roleId, start, pageLimit, null); + } + } + + private String getPublishNotificationData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { + ResponseObject ro = ResponseObject.newOkResponse(); + PublishListHistory dao = new PublishListHistory(); + List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, searchText); + + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + palProcessIds.add(model.getId()); + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, null, true); + // 整合所有权限 + for (String id : awsProcessIds) { + String tempVer = PALRepositoryCache.getCache().get(id).getVersionId(); + if (!palProcessIds.contains(tempVer)) { + palProcessIds.add(tempVer); + } + } + + // 过滤最终结果 + List list = new ArrayList<>(); + for (JSONObject object : modelList) { + String repositoryId = object.getString("repositoryId"); + if (palProcessIds.contains(repositoryId)) { + list.add(object); + } + } + List subList = null; + int end = start + pageLimit; + if (start > list.size() - 1) { + subList = new ArrayList<>(); + } else if (list.size() >= end) { + subList = list.subList(start, end); + } else { + subList = list.subList(start, list.size()); + } + JSONArray result = new JSONArray(); + for (JSONObject object : subList) { + JSONObject object2 = new JSONObject(); + String repositoryId = object.getString("repositoryId"); + PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); + object2.put("id", palModel.getId()); + object2.put("version", palModel.getVersion()); + String userName = ""; + if (UserCache.getModel(object.getString("userId")) != null) { + userName = UserCache.getModel(object.getString("userId")).getUserName(); + } + + String actionType = object.getString("actionType"); + String intro = ""; + switch (actionType) { + case "N": + intro = "新发布"; + break; + case "C": + intro = "变更"; + break; + default:// S + intro = "停用"; + break; + } + object2.put("name", palModel.getName() + "[" + intro + "]"); + object2.put("user", userName); + object2.put("dept", getDeptPath(object.getString("userId"))); + object2.put("date", object.getTimestamp("publishDate")); + object2.put("desc", object.getString("publishDesc")); + object2.put("isPublish", palModel.isPublish() ? "1" : "0"); + object2.put("taskId", object.containsKey("taskId") ? object.getString("taskId") : ""); + // 获取路径 + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + sBuilder.append(palModel.getName()); + idSets.add(palModel.getId()); + getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 + object2.put("path", sBuilder.toString()); + result.add(object2); + } + ro.put("data", result); + ro.put("count", result.size()); + return ro.toString(); + } + + /** + * 获取部门路径 + * @param userId + * @return + */ + private String getDeptPath(String userId) { + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + if (!UtilString.isEmpty(userId)) { + DepartmentModel model = SDK.getORGAPI().getDepartmentByUser(userId); + sBuilder.append(model.getName()); + idSets.add(model.getId()); + getDeptPath(model, sBuilder, idSets); + } + return sBuilder.toString(); + } + + private void getDeptPath(DepartmentModel model, StringBuilder sBuilder, Set idSets) { + if (!"0".equals(model.getId())) { + if (!idSets.contains(model.getParentDepartmentId())) { + String parentId = model.getParentDepartmentId(); + DepartmentModel parentModel = SDK.getORGAPI().getDepartmentById(parentId); + if (parentModel != null) { + sBuilder.insert(0, parentModel.getName() + ">"); + idSets.add(parentModel.getId()); + getDeptPath(parentModel, sBuilder, idSets); + } + } + } else { + sBuilder.insert(0, model.getName() + ">"); + } + } + + // 获取高频流程列表 + private String getPublishedFrequencyData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository dao = new PALRepository(); + List list = dao.getRepositoryFrequencyListByPublishRole(wsIdsql, roleId, searchText, category); + if (list == null) { + list = new ArrayList<>(); + } + Set idSet = new HashSet<>(); + for (PALRepositoryModel model : list) { + idSet.add(model.getId()); + } + // 添加关联aws组织的流程进行合并 + boolean flag = false; + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + if (awsProcessIds != null && awsProcessIds.size() > 0) { + for (String processId : awsProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); + if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { + list.add(model); + idSet.add(model.getId()); + flag = true; + } + } + } + if (flag) {// 合并过数据则需要重新排序 + // 排序 + Collections.sort(list, new MyComparator()); + } + List subList = null; + int end = start + pageLimit; + if (start > list.size() - 1) { + subList = new ArrayList<>(); + } else if (list.size() >= end) { + subList = list.subList(start, end); + } else { + subList = list.subList(start, list.size()); + } + JSONArray result = assembleData(subList); + ro.put("data", result); + ro.put("count", result.size()); + return ro.toString(); + } + + // 获取常用流程列表 + private String getPublishedCommonData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository dao = new PALRepository(); + // List list = dao.getRepositoryCommonListByPublishRolePagination(wsIdsql, roleId, searchText, start, pageLimit, category); + List list = dao.getRepositoryCommonListByPublishRole(wsIdsql, roleId, searchText, category); + if (list == null) { + list = new ArrayList<>(); + } + Set idSet = new HashSet<>(); + for (PALRepositoryModel model : list) { + idSet.add(model.getId()); + } + // 添加关联aws组织的流程进行合并 + boolean flag = false; + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + if (awsProcessIds != null && awsProcessIds.size() > 0) { + for (String processId : awsProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); + if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { + list.add(model); + idSet.add(model.getId()); + flag = true; + } + } + } + if (flag) {// 合并过数据则需要重新排序 + // 排序 + Collections.sort(list, new MyComparator()); + } + List subList = null; + int end = start + pageLimit; + if (start > list.size() - 1) { + subList = new ArrayList<>(); + } else if (list.size() >= end) { + subList = list.subList(start, end); + } else { + subList = list.subList(start, list.size()); + } + JSONArray result = assembleData(subList); + ro.put("data", result); + ro.put("count", result.size()); + return ro.toString(); + } + + // 获取已发布文件列表 + private String getAllPublishedData(String searchText, String wsIdsql, String roleId, int start, int pageLimit, String category) { + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository dao = new PALRepository(); + List list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, searchText, category); + if (list == null) { + list = new ArrayList<>(); + } + Set idSet = new HashSet<>(); + for (PALRepositoryModel model : list) { + idSet.add(model.getId()); + } + // 添加关联aws组织的流程进行合并 + boolean flag = false; + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + if (awsProcessIds != null && awsProcessIds.size() > 0) { + for (String processId : awsProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); + if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId()) && model.getName().indexOf(searchText) > -1) { + list.add(model); + idSet.add(model.getId()); + flag = true; + } + } + } + if (flag) {// 合并过数据则需要重新排序 + // 排序 + Collections.sort(list, new MyComparator()); + } + List subList = null; + int end = start + pageLimit; + if (start > list.size() - 1) { + subList = new ArrayList<>(); + } else if (list.size() >= end) { + subList = list.subList(start, end); + } else { + subList = list.subList(start, list.size()); + } + JSONArray result = assembleData(subList); + ro.put("data", result); + ro.put("count", result.size()); + return ro.toString(); + } + + private class MyComparator implements Comparator { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + Timestamp p1 = o1.getPublishDate(); + Timestamp p2 = o2.getPublishDate(); + if (p1 != null && p2 != null) { + if (!p1.equals(p2)) { + return p2.compareTo(p1); + } + } + int level1 = o1.getLevel(); + int level2 = o2.getLevel(); + if (level1 != level2) { + return level1 - level2; + } + int order1 = o1.getOrderIndex(); + int order2 = o2.getOrderIndex(); + return order1 - order2; + } + } + + // 查询发布信息,拼接结果json + private JSONArray assembleData(List list) { + PublishListHistory pHistory = new PublishListHistory(); + JSONArray result = new JSONArray(); + // 获取已发布分页数据 + for (int i = 0; i < list.size(); i++) { + PALRepositoryModel model = list.get(i); + JSONObject object = pHistory.getLastPublishByModelId(model.getId()); + JSONObject object2 = new JSONObject(); + if (object != null) { + String userId = object.getString("userId"); + String userName = ""; + if (UserCache.getModel(userId) != null) { + userName = UserCache.getModel(userId).getUserName(); + } + object2.put("user", userName); + object2.put("dept", getDeptPath(userId)); + object2.put("date", object.getTimestamp("date")); + object2.put("desc", UtilString.isEmpty(object.getString("desc")) ? "" : object.getString("desc")); + object2.put("taskId", object.containsKey("taskId") ? object.getString("taskId") : ""); + } else { + object2.put("user", ""); + object2.put("dept", ""); + object2.put("date", ""); + object2.put("desc", ""); + object2.put("taskId", ""); + } + object2.put("id", model.getId()); + object2.put("name", model.getName()); + object2.put("version", model.getVersion()); + + // 获取路径 + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + sBuilder.append(model.getName()); + idSets.add(model.getId()); + getFilePath(model, sBuilder,idSets);// 递归获取当前文件名称路径 + object2.put("path", sBuilder.toString()); + result.add(object2); + } + return result; + } + + /** + * 获取文件名称全路径 + * @param model + * @return + */ + private void getFilePath(PALRepositoryModel model, StringBuilder sBuilder, Set idSets) { + if (model.getParentId().length() == 36) { + if (!idSets.contains(model.getParentId())) { + String parentId = model.getParentId(); + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(parentId); + if (parentModel != null) { + sBuilder.insert(0, parentModel.getName() + ">"); + idSets.add(parentModel.getId()); + getFilePath(parentModel, sBuilder, idSets); + } + } + } else { + sBuilder.insert(0, I18nRes.findValue(CoEConstant.APP_ID, model.getParentId()) + ">"); + } + } + + /** + * 打开流程地图 + * @param wsId + * @param orgId + * @param type + * @return + */ + public String openProcessMapPage(UserContext uc, String wsId, String orgId, String type) { + Map macroLibraries = getHomePage2(uc); + macroLibraries.put("wsId", wsId); + // 获取权限资产库列表 + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, "process"); + // List> wsList = getPermRepositoryVersionIdByUser(uc, roleId); + JSONArray ws = new JSONArray(); + if (wsList != null && wsList.size() > 0) { + for (int i = 0; i < wsList.size(); i++) { + JSONObject object = new JSONObject(); + object.put("id", wsList.get(i).get("wsId")); + object.put("text", wsList.get(i).get("wsName")); + ws.add(object); + } + } + macroLibraries.put("ws", ws); + // 在里面则返回名称,不在里面返回空 + macroLibraries.put("orgId", orgId); + // 获取单位列表 + JSONArray org = new JSONArray(); + List orgList = SDK.getORGAPI().getCompanys(); + if (orgList != null && orgList.size() > 0) { + for (int i = 0; i < orgList.size(); i++) { + if (orgList.get(i).isClosed()) { + continue; + } + JSONObject object = new JSONObject(); + object.put("id", orgList.get(i).getId()); + object.put("text", orgList.get(i).getName()); + org.add(object); + } + } + macroLibraries.put("org", org); + macroLibraries.put("type", type); + JSONObject object = getLogoImgPath(uc); + macroLibraries.put("logoImgPath", object.getString("src")); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.html", macroLibraries); + } + + /** + * 业务架构页面 + * @param me + * @param wsId + * @return + */ + public String openProcessMapWsPage(UserContext me, String wsId) { + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + Map macroLibraries = new HashMap<>(); + macroLibraries.put("sid", me.getSessionId()); + macroLibraries.put("uid", me.getUID()); + macroLibraries.put("wsId", wsId); + JSONArray firstLevel = new JSONArray(); + JSONObject secendLevel = new JSONObject(); + if (!UtilString.isEmpty(wsId)) { + @SuppressWarnings("unchecked") + List list = IteratorUtils.toList(PALRepositoryCache.getByPid(wsId, "process")); + list = filterPublisherData(list); + if (list != null && list.size() > 0) { + Collections.sort(list, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0; + } + }); + PALRepository dao = new PALRepository(); + Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); + Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); + if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { + for (String awsId : relationAwsIdSet) { + idSet.add(awsId); + } + } + for (PALRepositoryModel model : list) { + boolean flag = false; + if (model.isPublish() && idSet.contains(model.getVersionId())) { + flag = true; + } else { + Set ids = new HashSet<>(); + List subList = new ArrayList<>(); + PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); + if (subList != null && subList.size() > 0) { + for (PALRepositoryModel subModel : subList) { + if (subModel.isPublish() && idSet.contains(subModel.getVersionId())) { + flag = true; + break; + } + } + } + } + if (flag) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("versionId", model.getVersionId()); + object.put("name", model.getName()); + object.put("canOpen", idSet.contains(model.getVersionId())); + object.put("isPublish", model.isPublish()); + object.put("method", model.getMethodId()); + firstLevel.add(object); + } + } + + for (int i = 0; i < firstLevel.size(); i++) { + JSONObject firstObject = firstLevel.getJSONObject(i); + getPublishAndRoleChildModel(wsId, idSet, firstObject.getString("versionId"), secendLevel); + } + } + } + macroLibraries.put("firstLevelData", firstLevel); + macroLibraries.put("secendLevelData", secendLevel); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.ws.html", macroLibraries); + } + + /** + * 获取子级节点 + * @param wsId + * @param filterSet + * @param version + * @param result + */ + private void getPublishAndRoleChildModel(String wsId, Set filterSet, String version, JSONObject result) { + List secendList = PALRepositoryCache.getAllSubModelsByPid(wsId, version); + secendList.sort((o1, o2)-> {return o1.getOrderIndex() > o2.getOrderIndex() ? 1 : o1.getOrderIndex() < o2.getOrderIndex() ? -1 : 0;}); + Set useVersionIds = new HashSet<>(); + List publishVersionIds = new ArrayList<>(); + JSONArray secendArr = new JSONArray(); + for (PALRepositoryModel model : secendList) { + if (model.isUse()) { + useVersionIds.add(model.getVersionId()); + } + if (model.isPublish()) { + publishVersionIds.add(model.getVersionId()); + } + } + for (String str : useVersionIds) { + if (!publishVersionIds.contains(str)) { + publishVersionIds.add(str); + } + } + for (String versionId : publishVersionIds) { + boolean flag = false; + PALRepositoryModel model = null;// = PALRepositoryCache.getCache().get(versionId); + List models = PALRepositoryCache.getByVersionId(wsId, versionId); + if (models != null && models.size() > 0) { + PALRepositoryModel temp = null; + for (PALRepositoryModel obj : models) { + if (obj.isPublish()) { + temp = obj; + break; + } + } + if (temp == null) { + for (PALRepositoryModel obj : models) { + if (obj.isUse()) { + temp = obj; + } + } + } + model = temp; + } + + if (model != null) { + flag = checkCanShow(wsId, filterSet, flag, model); + } + if (flag) { + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("versionId", model.getVersionId()); + object.put("name", model.getName()); + object.put("canOpen", filterSet.contains(model.getVersionId())); + object.put("child", checkChild(wsId, filterSet, false, model)); + object.put("isPublish", model.isPublish()); + secendArr.add(object); + } + } + result.put(version, secendArr); + } + + /** + * 判断是否有子流程并且有其权限 + * @param wsId + * @param filterSet + * @param flag + * @param model + * @return + */ + private boolean checkChild(String wsId, Set filterSet, boolean flag, PALRepositoryModel model) { + Set ids = new HashSet<>(); + List subList = new ArrayList<>(); + PALRepositoryCache.getAllChildrenModelsByPid(wsId, model.getId(), subList, ids); + if (subList != null && subList.size() > 0) { + for (PALRepositoryModel subModel : subList) { + if (subModel.isPublish() && filterSet.contains(subModel.getVersionId())) { + flag = true; + break; + } + } + } + return flag; + } + + /** + * 查看当前流程是否能显示 + * 判断条件:1.当前流程已发布且有权限;2.当前流程的所有子流程存在发布且其有权限查看 + * @param wsId + * @param filterSet + * @param flag + * @return + */ + private boolean checkCanShow(String wsId, Set filterSet, boolean flag, PALRepositoryModel model) { + if (model.isPublish() && filterSet.contains(model.getVersionId())) { + flag = true; + } else { + flag = checkChild(wsId, filterSet, flag, model); + } + return flag; + } + + /** + * 组织架构页面 + * @param me + * @param orgId + * @return + */ + public String openProcessMapOrgPage(UserContext me, String orgId) { + Map macroLibraries = new HashMap<>(); + macroLibraries.put("sid", me.getSessionId()); + macroLibraries.put("uid", me.getUID()); + macroLibraries.put("orgId", orgId); + JSONArray firstLevel = new JSONArray(); + JSONObject secendLevel = new JSONObject(); + if (!UtilString.isEmpty(orgId)) { + List list = SDK.getORGAPI().getDepartmentsByCompanyId(1, orgId); + if (list != null && list.size() > 0) { + // 获取单位下一级部门 + for (DepartmentModel model : list) { + if (model.isClosed()) { + continue; + } + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + boolean isExistSub = SDK.getORGAPI().isExistSubDepartment(model.getId()); + object.put("child", isExistSub); + firstLevel.add(object); + // 获取一级部门下的二级部门 + if (isExistSub) { + List subList = SDK.getORGAPI().getSubDepartments(model.getId()); + JSONArray subArray = new JSONArray(); + if (subList != null && subList.size() > 0) { + for (DepartmentModel subModel : subList) { + if (subModel.isClosed()) { + continue; + } + JSONObject object2 = new JSONObject(); + object2.put("id", subModel.getId()); + object2.put("name", subModel.getName()); + boolean isExistSub2 = SDK.getORGAPI().isExistSubDepartment(subModel.getId()); + object2.put("child", isExistSub2); + subArray.add(object2); + } + } + secendLevel.put(model.getId(), subArray); + } + } + + } + } + macroLibraries.put("firstLevelData", firstLevel); + macroLibraries.put("secendLevelData", secendLevel); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.org.html", macroLibraries); + } + + /** + * 业务架构展开 + * @param me + * @param id + * @param wsId + * @return + */ + public String expendProcessMapWsData(UserContext me, String id, String wsId) { + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model == null) { + throw new AWSException("该流程不存在,请刷新重试"); + } + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + PALRepository dao = new PALRepository(); + Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); + Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); + if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { + for (String awsId : relationAwsIdSet) { + idSet.add(awsId); + } + } + JSONObject nextLevel = new JSONObject(); + getPublishAndRoleChildModel(wsId, idSet, model.getVersionId(), nextLevel); + ro.put("data", nextLevel.get(model.getVersionId())); + return ro.toString(); + } + + /** + * 打开文件时的权限和类型校验 + * @param me + * @param id + * @param wsId + * @return + */ + public String openProcessMapWsDataCheck(UserContext me, String id, String wsId) { + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model == null) { + throw new AWSException("该流程不存在,请刷新重试"); + } + if (UtilString.isEmpty(wsId)) { + wsId = model.getWsId(); + } + String status = "ok"; + if ("default".equals(model.getMethodId())) { + status = "typeError"; + } + if (!model.isPublish()) { + status = "notPublish"; + } + if (!"ok".equals(status)) {// 避免后续查询 + ro.put("status", status); + return ro.toString(); + } + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + PALRepository dao = new PALRepository(); + Set idSet = dao.getRepositoryVersionIdListByPublishRole(roleId, "'" + wsId + "'", "process"); + Set relationAwsIdSet = getAwsOrgPermRepositoryByUser(_uc, "process", true); + if (relationAwsIdSet != null && relationAwsIdSet.size() > 0) { + for (String awsId : relationAwsIdSet) { + idSet.add(awsId); + } + } + if (!idSet.contains(model.getVersionId())) { + status = "noPerm"; + } + ro.put("status", status); + return ro.toString(); + } + + /** + * 组织架构展开 + * @param me + * @param id 部门id + * @param orgId 单位id + * @return + */ + + public String expendProcessMapOrgData(UserContext me, String id, String orgId) { + ResponseObject ro = ResponseObject.newOkResponse(); + DepartmentModel model = SDK.getORGAPI().getDepartmentById(id); + if (model == null) { + throw new AWSException("该部门不存在,请刷新重试"); + } + JSONArray data = new JSONArray(); + List list = SDK.getORGAPI().getSubDepartments(id); + if (list != null && list.size() > 0) { + for (DepartmentModel subModel : list) { + if (subModel.isClosed()) { + continue; + } + JSONObject object = new JSONObject(); + object.put("id", subModel.getId()); + object.put("name", subModel.getName()); + boolean isExistSub = SDK.getORGAPI().isExistSubDepartment(subModel.getId()); + object.put("child", isExistSub); + data.add(object); + } + } + ro.put("data", data); + return ro.toString(); + } + + /** + * 查询组织架构中部门流程 + * @param me + * @param deptId + * @return + */ + public String openProcessMapOrgDeptDialog(UserContext me, String deptId) { + Map macroLibraries = new HashMap<>(); + macroLibraries.put("sid", me.getSessionId()); + macroLibraries.put("uid", me.getUID()); + macroLibraries.put("deptId", deptId); + DepartmentModel model = SDK.getORGAPI().getDepartmentById(deptId); + JSONArray data = new JSONArray(); + String deptName = ""; + if(model != null) { + deptName = model.getName(); + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + PALRepository dao = new PALRepository(); + // List list = dao.getRepositoryListByPublishRole(roleId, null, "process", deptId, "default"); + List list = dao.getRepositoryListByPublishRole(roleId, null, "process", null, "default"); + // 查询关联了当前部门的已发布流程 + Set relationDeptIds = getAwsOrgPermRepositoryByDept(_uc, "process", deptId, true); + if (!isEmpty(list)) { + for (PALRepositoryModel pModel : list) { + if (deptId.equals(pModel.getDutyDept()) || relationDeptIds.contains(pModel.getId())) { + JSONObject object = new JSONObject(); + object.put("id", pModel.getId()); + object.put("name", pModel.getName()); + object.put("method", pModel.getMethodId()); + data.add(object); + } + } + } + } + macroLibraries.put("deptName", deptName); + macroLibraries.put("data", data); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.sso.processmap.org.dialog.html", macroLibraries); + } + + // 获取logo图片路径 + private JSONObject getLogoImgPath(UserContext uc) { + JSONObject logo = new JSONObject(); + DCContext logoDcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); + if (dcProfile != null) { + logoDcContext = new DCContext(uc, dcProfile, "portal", "logo"); + } + boolean flag1 = false; + if (logoDcContext != null) { + File file = new File(logoDcContext.getPath()); + if (file.exists()) { + File [] files = file.listFiles(); + if (files != null) { + if (files.length > 0) { + for (File file2 : files) { + String src = new DCContext(uc, dcProfile, CoEConstant.APP_ID, "portal", "logo", file2.getName()).getDownloadURL(); + logo.put("src", src); + logo.put("name", file2.getName()); + flag1 = true; + break; + } + } + } + } + } + if (!flag1) { + // 默认PALlogo + logo.put("src", "../apps/"+ CoEConstant.APP_ID +"/img/logo/portal_logo.png"); + logo.put("name", "portal_logo.png"); + } + return logo; + } + + /** + * 轮播图 + * @param uc + * @return + */ + public String queryBannerData(UserContext uc) { + Map result = new HashMap(); + result.put("sid", uc.getSessionId()); + result.put("uid", uc.getUID()); + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); + DCContext bannerDcContext = null; + if (dcProfile != null) { + bannerDcContext = new DCContext(_uc, dcProfile, "portal", "banner"); + } + // 轮播图设置 + JSONArray pictures = new JSONArray(); + if (bannerDcContext != null) { + File file = new File(bannerDcContext.getPath()); + if (file.exists()) { + File [] files = file.listFiles(); + if (files != null) { + // 按照名称排序 + List fileList = Arrays.asList(files); + Collections.sort(fileList, new Comparator() { + @Override + public int compare(File o1, File o2) { + if (o1.isDirectory() && o2.isFile()) + return -1; + if (o1.isFile() && o2.isDirectory()) + return 1; + return o1.getName().compareTo(o2.getName()); + } + }); + for (int i = 0; i < fileList.size(); i++) { + File file2 = files[i]; + String src = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, "portal", "banner", file2.getName()).getDownloadURL(); + JSONObject object = new JSONObject(); + object.put("src", src); + object.put("name", file2.getName()); + pictures.add(object); + } + } + } + } + if (pictures.isEmpty()) { + JSONObject object = new JSONObject(); + object.put("src", "../apps/"+ CoEConstant.APP_ID +"/img/portal_banner.jpg"); + object.put("name", "portal_banner"); + pictures.add(object); + } + result.put("bannerImgs", pictures); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.banner.html", result); + } + + /*********************永辉接口start***************************/ + + // 查询发布信息,拼接结果json + private JSONArray assembleData2(List list) { + PublishListHistory pHistory = new PublishListHistory(); + JSONArray result = new JSONArray(); + for (int i = 0; i < list.size(); i++) { + PALRepositoryModel model = list.get(i); + JSONObject object = pHistory.getLastPublishByModelId(model.getId()); + JSONObject object2 = new JSONObject(); + if (object != null) { + String userId = object.getString("userId"); + String userName = ""; + if (UserCache.getModel(userId) != null) { + userName = UserCache.getModel(userId).getUserName(); + } + object2.put("user", userName); + object2.put("departmentPath", getDeptPath(userId)); + object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("date"))); + object2.put("publishDesc", object.getString("desc")); + } else { + object2.put("user", ""); + object2.put("departmentPath", ""); + object2.put("publishDate", ""); + object2.put("publishDesc", ""); + } + object2.put("id", model.getId()); + object2.put("name", model.getName()); + object2.put("version", VersionUtil.getVersionStrV(model.getVersion())); + object2.put("method", model.getMethodId()); + object2.put("category", model.getMethodCategory()); + + // 获取路径 + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + sBuilder.append(model.getName()); + idSets.add(model.getId()); + getFilePath(model, sBuilder,idSets);// 递归获取当前文件名称路径 + object2.put("path", sBuilder.toString()); + result.add(object2); + } + return result; + } + + /** + * 获取所有文件 + * @param uc + * @param wsId + * @param category + * @param type 已发布或者全部 + * @return + */ + public String queryPublishRepositoryDataJson(UserContext uc, String wsId, String category, String type) { + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + String wsIdsql = "'" + wsId + "'"; + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository dao = new PALRepository(); + List list = null; + if (type == null || "publish".equals(type)) { + list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category, true, false); + } else { + list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category, false, true); + } + if (list == null) { + list = new ArrayList<>(); + } + JSONArray result = assembleData2(list); + ro.setData(result); + return ro.toString(); + } + + /** + * 获取所有已发布的文件 + * @param wsId + * @return + */ + public String queryPublishRepositoryDataJson(UserContext uc, String wsId, String category) { + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + String wsIdsql = "'" + wsId + "'"; + ResponseObject ro = ResponseObject.newOkResponse(); + PALRepository dao = new PALRepository(); + List list = dao.getRepositoryListByPublishRole(wsIdsql, roleId, null, category); + if (list == null) { + list = new ArrayList<>(); + } + Set idSet = new HashSet<>(); + for (PALRepositoryModel model : list) { + idSet.add(model.getId()); + } + // 添加关联aws组织的流程进行合并 + boolean flag = false; + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + if (awsProcessIds != null && awsProcessIds.size() > 0) { + for (String processId : awsProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(processId); + if (model != null && wsIdsql.indexOf(model.getWsId()) > -1 && !idSet.contains(model.getId())) { + list.add(model); + idSet.add(model.getId()); + flag = true; + } + } + } + if (flag) {// 合并过数据则需要重新排序 + // 排序 + Collections.sort(list, new MyComparator()); + } + JSONArray result = assembleData2(list); + ro.setData(result); + return ro.toString(); + } + + /** + * 获取所有有权限的资产库 + * @return + */ + public String queryPermWorkspaceDataJson(UserContext uc) { + ResponseObject ro = ResponseObject.newOkResponse(); + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + List> wsList = getPalAndAwsPermRepositoryVersionIdByUser(uc, roleId, null); + JSONArray ws = new JSONArray(); + if (wsList != null && wsList.size() > 0) { + for (int i = 0; i < wsList.size(); i++) { + JSONObject object = new JSONObject(); + object.put("wsId", wsList.get(i).get("wsId")); + object.put("wsName", wsList.get(i).get("wsName")); + ws.add(object); + } + } + ro.setData(ws); + return ro.toString(); + } + + /** + * 按照创建时间倒序排序 + * + */ + private class CreateDateComparator implements Comparator { + + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + Timestamp p1 = o1.getCreateDate(); + Timestamp p2 = o2.getCreateDate(); + if (p1 != null && p2 != null) { + if (!p1.equals(p2)) { + return p2.compareTo(p1); + } + } + int level1 = o1.getLevel(); + int level2 = o2.getLevel(); + if (level1 != level2) { + return level1 - level2; + } + int order1 = o1.getOrderIndex(); + int order2 = o2.getOrderIndex(); + return order1 - order2; + } + + } + + /** + * 获取发布动态 + * @param wsId + * @return + */ + public String queryDynamicHistoryDataJson(UserContext uc, String wsId, String type) { + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + String wsIdsql = "'" + wsId + "'"; + ResponseObject ro = ResponseObject.newOkResponse(); + + if (type == null || "publish".equals(type)) {// 获取已发布流程 + + } else {// 按照创建时间倒序获取所有流程 + JSONArray result = new JSONArray(); + List list = new ArrayList<>(); + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Iterator iterator = PALRepositoryCache.getByWsId(wsId); + while (iterator.hasNext()) { + PALRepositoryModel model = iterator.next(); + if (palVersionIds.contains(model.getVersionId())) { + list.add(model); + } + } + // 按照时间倒序,名称升序排序 + Collections.sort(list, new CreateDateComparator()); + for (PALRepositoryModel palModel : list) { + JSONObject object2 = new JSONObject(); + String userName = ""; + String userId = palModel.getCreateUser(); + if (!UtilString.isEmpty(userId) && UserCache.getModel(userId) != null) { + userName = UserCache.getModel(userId).getUserName(); + } + object2.put("id", palModel.getId()); + object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); + object2.put("user", userName); + object2.put("name", palModel.getName()); + object2.put("createDate", UtilDate.datetimeFormat(palModel.getCreateDate())); + object2.put("isPublish", palModel.isPublish() ? "1" : "0"); + object2.put("method", palModel.getMethodId()); + object2.put("category", palModel.getMethodCategory()); + // 获取发布类型名称 + String categoryName = ""; + if (palModel.getLevel() <= 2) { + categoryName = palModel.getName(); + } else { + PALRepositoryModel model = palModel; + while (true) { + String pid = model.getParentId(); + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid); + if (parentModel == null) { + break; + } else { + if (parentModel.getLevel() <= 2) { + categoryName = parentModel.getName(); + break; + } + } + model = parentModel; + } + } + object2.put("categoryName", categoryName); + result.add(object2); + } + ro.setData(result); + return ro.toString(); + } + + PublishListHistory dao = new PublishListHistory(); + List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, null); + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + palProcessIds.add(model.getId()); + } + } + } + + // 过滤最终结果 + List list = new ArrayList<>(); + for (JSONObject object : modelList) { + String repositoryId = object.getString("repositoryId"); + if (palProcessIds.contains(repositoryId)) { + list.add(object); + } + } + + JSONArray result = new JSONArray(); + for (JSONObject object : list) { + JSONObject object2 = new JSONObject(); + String repositoryId = object.getString("repositoryId"); + PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); + object2.put("id", palModel.getId()); + object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); + String userName = ""; + if (UserCache.getModel(object.getString("userId")) != null) { + userName = UserCache.getModel(object.getString("userId")).getUserName(); + } + + String actionType = object.getString("actionType"); + String intro = ""; + switch (actionType) { + case "N": + intro = "新发布"; + break; + case "C": + intro = "变更"; + break; + default:// S + intro = "停用"; + break; + } + object2.put("name", palModel.getName() + "[" + intro + "]"); + object2.put("user", userName); + object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("publishDate"))); + object2.put("publishDesc", object.getString("publishDesc")); + object2.put("isPublish", palModel.isPublish() ? "1" : "0"); + object2.put("method", palModel.getMethodId()); + object2.put("category", palModel.getMethodCategory()); + // 获取发布类型名称 + String categoryName = ""; + if (palModel.getLevel() <= 2) { + categoryName = palModel.getName(); + } else { + PALRepositoryModel model = palModel; + while (true) { + String pid = model.getParentId(); + PALRepositoryModel parentModel = PALRepositoryCache.getCache().get(pid); + if (parentModel == null) { + break; + } else { + if (parentModel.getLevel() <= 2) { + categoryName = parentModel.getName(); + break; + } + } + model = parentModel; + } + } + object2.put("categoryName", categoryName); + result.add(object2); + } + ro.setData(result); + return ro.toString(); + } + + /** + * 获取发布动态(更多) + * @param wsId + * @return + */ + public String queryDynamicHistoryMoreDataJson(UserContext uc, String wsId, String type) { + JSONObject param = getXPagesBasicParam(uc, null); + String roleId = param.getString("roleId"); + String wsIdsql = "'" + wsId + "'"; + + ResponseObject ro = ResponseObject.newOkResponse(); + + if (type == null || "publish".equals(type)) {// 获取已发布流程 + + } else {// 按照创建时间倒序获取所有流程 + JSONArray result = new JSONArray(); + List list = new ArrayList<>(); + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Iterator iterator = PALRepositoryCache.getByWsId(wsId); + while (iterator.hasNext()) { + PALRepositoryModel model = iterator.next(); + if (palVersionIds.contains(model.getVersionId())) { + list.add(model); + } + } + // 按照时间倒序,名称升序排序 + Collections.sort(list, new CreateDateComparator()); + for (PALRepositoryModel palModel : list) { + JSONObject object2 = new JSONObject(); + object2.put("id", palModel.getId()); + object2.put("version", VersionUtil.getVersionStrV(palModel.getVersion())); + String userName = ""; + String userId = palModel.getCreateUser(); + if (!UtilString.isEmpty(userId) && UserCache.getModel(userId) != null) { + userName = UserCache.getModel(userId).getUserName(); + } + object2.put("name", palModel.getName()); + object2.put("user", userName); + object2.put("departmentPath", getDeptPath(palModel.getCreateUser())); + object2.put("createDate", UtilDate.datetimeFormat(palModel.getCreateDate())); + object2.put("isPublish", palModel.isPublish() ? "1" : "0"); + object2.put("method", palModel.getMethodId()); + object2.put("category", palModel.getMethodCategory()); + + // 获取路径 + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + sBuilder.append(palModel.getName()); + idSets.add(palModel.getId()); + getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 + object2.put("path", sBuilder.toString()); + result.add(object2); + } + ro.setData(result); + return ro.toString(); + } + + PublishListHistory dao = new PublishListHistory(); + List modelList = dao.getPublishListHistoryByRole(roleId, null, wsIdsql, null); + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + palProcessIds.add(model.getId()); + } + } + } + + // 过滤最终结果 + List list = new ArrayList<>(); + for (JSONObject object : modelList) { + String repositoryId = object.getString("repositoryId"); + if (palProcessIds.contains(repositoryId)) { + list.add(object); + } + } + + JSONArray result = new JSONArray(); + for (JSONObject object : list) { + JSONObject object2 = new JSONObject(); + String repositoryId = object.getString("repositoryId"); + PALRepositoryModel palModel = PALRepositoryCache.getCache().get(repositoryId); + object2.put("id", palModel.getId()); + object2.put("version",VersionUtil.getVersionStrV(palModel.getVersion())); + String userName = ""; + if (UserCache.getModel(object.getString("userId")) != null) { + userName = UserCache.getModel(object.getString("userId")).getUserName(); + } + + String actionType = object.getString("actionType"); + String intro = ""; + switch (actionType) { + case "N": + intro = "新发布"; + break; + case "C": + intro = "变更"; + break; + default:// S + intro = "停用"; + break; + } + object2.put("name", palModel.getName() + "[" + intro + "]"); + object2.put("user", userName); + object2.put("departmentPath", getDeptPath(object.getString("userId"))); + object2.put("publishDate", UtilDate.datetimeFormat(object.getTimestamp("publishDate"))); + object2.put("publishDesc", object.getString("publishDesc")); + object2.put("isPublish", palModel.isPublish() ? "1" : "0"); + object2.put("method", palModel.getMethodId()); + object2.put("category", palModel.getMethodCategory()); + + // 获取路径 + StringBuilder sBuilder = new StringBuilder();// 名称组合 + Set idSets = new HashSet<>();// id记录,校验防止递归死循环 + sBuilder.append(palModel.getName()); + idSets.add(palModel.getId()); + getFilePath(palModel, sBuilder,idSets);// 递归获取当前文件名称路径 + object2.put("path", sBuilder.toString()); + result.add(object2); + } + ro.setData(result); + return ro.toString(); + } + + /** + * 根据类别获取权限下的发布流程 + * @param me + * @param type publish:获取当前状态为已发布且有权限的文件 stop: 获取曾经发布过但是当前是未发布状态(使用中)的文件 recentView:按照流程点击量倒序获取当前状态为已发布的文件(类似高频流程) + * @param wsId + * @return + */ + public String queryPublishRepositoryDataJsonByType(UserContext me, String type, String wsId) { + switch (type) { + case "publish": + // 获取已发布流程 + return queryPublishRepositoryDataJson(me, wsId, "process"); + case "stop": + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + PublishListHistory history = new PublishListHistory(); + Set publishHistorySet = history.getPublishDataByActiontype("S", wsId); + // 获取权限下的模型id + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + palProcessIds.add(model.getId()); + } + } + } + // 获取关联AWS组织的版本ID且当前为未发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, null, false); + // 整合所有权限 + palProcessIds.addAll(awsProcessIds); + List list = new ArrayList<>(); + Iterator iterator = PALRepositoryCache.getByWsId(wsId); + while (iterator.hasNext()) { + PALRepositoryModel model = iterator.next(); + if (!model.isPublish() && "process".equals(model.getMethodCategory()) && publishHistorySet.contains(model.getId()) && palProcessIds.contains(model.getId())) {// 未发布&&已停用&&有权限 + list.add(model); + } + } + // 排序 + Collections.sort(list, new MyComparator()); + JSONArray data = assembleData2(list); + ResponseObject r2 = ResponseObject.newOkResponse(); + r2.setData(data); + return r2.toString(); + default:// recentView + List tempList = new ArrayList<>(); + PublishFrequencyDao frequencyDao = new PublishFrequencyDao(); + List frequencyModels = frequencyDao.getDataOrderByCount(wsId); + if (frequencyModels == null || frequencyModels.size() == 0) { + ResponseObject r = ResponseObject.newOkResponse(); + r.setData(tempList); + return r.toString(); + } + Map map = new HashMap<>(); + for (PublishFrequencyModel model : frequencyModels) { + map.put(model.getPlversionId(), model.getCount()); + } + String result = queryPublishRepositoryDataJson(me, wsId, "process"); + JSONObject ro = JSONObject.parseObject(result); + JSONArray array = ro.getJSONArray("data"); + for (int i = 0; i < array.size(); i++) { + JSONObject object = array.getJSONObject(i); + String id = object.getString("id"); + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model!= null) { + String versionId = model.getVersionId(); + if (map.containsKey(versionId)) { + object.put("viewCount", map.get(versionId)); + tempList.add(object); + } + } + } + // 按照访问量降序排序 + Collections.sort(tempList, new CountComparator()); + ResponseObject r = ResponseObject.newOkResponse(); + r.setData(tempList); + return r.toString(); + } + } + + private class CountComparator implements Comparator { + @Override + public int compare(JSONObject o1, JSONObject o2) { + Integer count1 = o1.getInteger("viewCount"); + Integer count2 = o2.getInteger("viewCount"); + return count2 - count1; + } + } + + /** + * 获取所有有权限的部门列表,部门列表来源于所有具有权限的流程的责任部门 + * 已发布 + * @param me + * @param wsId + * @return + */ + public String queryAwsDepartmentDataJson(UserContext me, String wsId) { + String category = "process"; + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + if (model.isPublish() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + // 整合所有权限 + palProcessIds.addAll(awsProcessIds); + + // 获取所有部门ID + Set deptIds = new HashSet<>(); + for (String id : palProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null && model.getWsId().equals(wsId)) { + // 责任部门 + String deptId = model.getDutyDept(); + if (!UtilString.isEmpty(deptId)) { + deptIds.add(deptId); + } + } + } + List list = new ArrayList<>(); + for (String deptId : deptIds) { + JSONObject object = new JSONObject(); + DepartmentModel dModel = SDK.getORGAPI().getDepartmentById(deptId); + if (dModel != null) { + // 获取单位 + CompanyModel cModel = SDK.getORGAPI().getCompanyById(dModel.getCompanyId()); + if (cModel != null) { + object.put("id", dModel.getId()); + object.put("departmentId", dModel.getId()); + object.put("departmentName", dModel.getName()); + object.put("departmentLayer", dModel.getLayer()); + object.put("departmentOrderIndex", dModel.getOrderIndex()); + object.put("departmentClosed", dModel.isClosed()); + object.put("companyId", dModel.getCompanyId()); + object.put("companyName", cModel.getName()); + object.put("companyOrderIndex", cModel.getOrderIndex()); + object.put("companyClosed", cModel.isClosed()); + list.add(object); + } + } + } + // 排序,按照单位部门层级和顺序排序 + Collections.sort(list, new DepartmentComparator()); + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(list); + return ro.toString(); + } + + // 部门排序 + private class DepartmentComparator implements Comparator{ + @Override + public int compare(JSONObject o1, JSONObject o2) { + int cOrder1 = o1.getIntValue("companyOrderIndex"); + int cOrder2 = o2.getIntValue("companyOrderIndex"); + if (cOrder1 != cOrder2) { + return cOrder1 - cOrder2; + } + int dLayer1 = o1.getIntValue("departmentLayer"); + int dLayer2 = o2.getIntValue("departmentLayer"); + if (dLayer1 != dLayer2) { + return dLayer1 - dLayer2; + } + int dOrder1 = o1.getIntValue("departmentOrderIndex"); + int dOrder2 = o2.getIntValue("departmentOrderIndex"); + return dOrder1 - dOrder2; + } + + } + + /** + * 获取当前部门的流程数据(责任部门)和当前部门下具有权限的子部门列表 + * @param me + * @param wsId + * @param departmentId + * @return + */ + public String queryPublishedProcessAndSubDepartment(UserContext me, String wsId, String departmentId) { + JSONObject result = new JSONObject(); + // 获取有权限的已发布流程 + String category = "process"; + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + // 过滤当前责任部门的流程 + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + if (model.isPublish() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + // 整合所有权限id + palProcessIds.addAll(awsProcessIds); + List list = new ArrayList<>(); + Set deptIds = new HashSet<>(); + for (String id : palProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null && model.getWsId().equals(wsId)) { + // 责任部门 + String deptId = model.getDutyDept(); + if (!UtilString.isEmpty(deptId)) { + deptIds.add(deptId); + if (deptId.equals(departmentId)) { + list.add(model); + } + } + } + } + Collections.sort(list, new MyComparator()); + JSONArray repositoryArr = new JSONArray(); + for (PALRepositoryModel model : list) { + // "子部门列表(部门id,部门名称); + // 所有选择了该部门作为责任部门的流程文件列表(流程id,流程名称,是否有附件、附件Id,附件名称、附件链接、流程地图图片)" + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("version",VersionUtil.getVersionStrV(model.getVersion())); + object.put("hasFile", false); + object.put("method", model.getMethodId()); + object.put("category", model.getMethodCategory()); + // 附件 + JSONArray file = new JSONArray(); + StringBuffer sqlWhere = new StringBuffer(); + sqlWhere.append(" and PALREPOSITORYID ='").append(model.getId()).append("' and FILETYPE='f'"); + UpFileDao upFileDao = new UpFileDao(); + List search = upFileDao.search(sqlWhere.toString()); + if (search != null && search.size() > 0) { + object.put("hasFile", true); + for (UpfileModel upfileModel : search) { + JSONObject fileObject = new JSONObject(); + fileObject.put("id", upfileModel.getUuid()); + fileObject.put("name", upfileModel.getFileName()); + String downloadUrl = ""; + DCContext dcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); + if (dcProfile != null) { + dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); + } + if (dcContext != null) { + downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; + } + fileObject.put("url", downloadUrl); + file.add(fileObject); + } + } + object.put("file", file); + // 流程图片 + String imgSrc = ""; + String path = model.getFilePath(); + if (!UtilString.isEmpty(path)) { + UtilFile utilFile = new UtilFile(path + "/" + model.getId() + ".small.png"); + if (utilFile.exists()) { + byte[] base64Bytes = Base64.encode(utilFile.readBytes()); + imgSrc = "data:image/png;base64," + new String(base64Bytes); + } + } + object.put("imgSrc", imgSrc); + repositoryArr.add(object); + } + result.put("process", repositoryArr); + // 获取子部门列表 + List deptList = new ArrayList<>(); + getPermDepartment(deptList, deptIds, departmentId);// 获取子部门列表 + // 部门排序 + JSONArray deptArr = new JSONArray(); + for (DepartmentModel dept : deptList) { + JSONObject deptObj = new JSONObject(); + deptObj.put("id", dept.getId()); + deptObj.put("departmentName", dept.getName()); + deptArr.add(deptObj); + } + result.put("department", deptArr); + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + return ro.toString(); + } + + // 获取所有符合条件的子部门 + private void getPermDepartment(List list, Set deptIds, String parentId) { + // 获取子部门列表 + List subDeptList = SDK.getORGAPI().getSubDepartments(parentId); + if (!isEmpty(subDeptList)) { + for (DepartmentModel model : subDeptList) { + if (deptIds.contains(model.getId())) { + list.add(model); + } else { + getPermDepartment(list, deptIds, model.getId()); + } + } + } + } + + // 获取子流程列表 + public String queryPublishProcessByParent(UserContext me, String id, String type) { + // 获取有权限的已发布流程 + String category = "process"; + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + // 过滤当前责任部门的流程 + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + if (type == null || "publish".equals(type)) {// 获取已发布流程 + if(model.isPublish() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } else {// 获取当前使用中流程,不区分状态 + if(model.isUse() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } + } + } + } + + // 获取当前流程信息和子流程 + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model == null) { + throw new AWSException("查找失败 uuid: " + id ); + } + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("version", VersionUtil.getVersionStrV(model.getVersion())); + object.put("hasChild", false); + object.put("childData", new JSONArray()); + object.put("method", model.getMethodId()); + object.put("category", model.getMethodCategory()); + object.put("level", model.getLevel()); + object.put("isPublish", model.isPublish()); + + // 获取子流程列表 + List subList = new ArrayList<>(); + getPermSubPalRepository(subList, palProcessIds, model.getId()); + if (!isEmpty(subList)) { + object.put("hasChild", true); + // 获取附件列表,获取流程图片 + JSONArray subArr = new JSONArray(); + for (PALRepositoryModel subModel : subList) { + JSONObject subObj = new JSONObject(); + subObj.put("id", subModel.getId()); + subObj.put("name", subModel.getName()); + subObj.put("version",VersionUtil.getVersionStrV(subModel.getVersion())); + subObj.put("hasFile", false); + subObj.put("method", subModel.getMethodId()); + subObj.put("category", subModel.getMethodCategory()); + subObj.put("level", subModel.getLevel()); + subObj.put("isPublish", subModel.isPublish()); + // 附件 + JSONArray file = new JSONArray(); + StringBuffer sqlWhere = new StringBuffer(); + sqlWhere.append(" and PALREPOSITORYID ='").append(subModel.getId()).append("' and FILETYPE='f'"); + UpFileDao upFileDao = new UpFileDao(); + List search = upFileDao.search(sqlWhere.toString()); + if (search != null && search.size() > 0) { + subObj.put("hasFile", true); + for (UpfileModel upfileModel : search) { + JSONObject fileObject = new JSONObject(); + fileObject.put("id", upfileModel.getUuid()); + fileObject.put("name", upfileModel.getFileName()); + String downloadUrl = ""; + DCContext dcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); + if (dcProfile != null) { + dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); + } + if (dcContext != null) { + downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; + } + fileObject.put("url", downloadUrl); + file.add(fileObject); + } + } + subObj.put("file", file); + // 流程图片 + String imgSrc = ""; + String path = subModel.getFilePath(); + if (!UtilString.isEmpty(path)) { + UtilFile utilFile = new UtilFile(path + "/" + subModel.getId() + ".small.png"); + if (utilFile.exists()) { + byte[] base64Bytes = Base64.encode(utilFile.readBytes()); + imgSrc = "data:image/png;base64," + new String(base64Bytes); + } + } + subObj.put("imgSrc", imgSrc); + subArr.add(subObj); + } + object.put("childData", subArr); + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(object); + return ro.toString(); + } + + private void getPermSubPalRepository(List list, Set palProcessIds, String pid) { + // 获取子流程 + PALRepositoryModel model = PALRepositoryCache.getCache().get(pid); + if (model != null) { + List subList = PALRepositoryCache.getAllSubModelsByPid(model.getWsId(), model.getId()); + if (!isEmpty(subList)) { + // 排序 + Collections.sort(subList, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + int level1 = o1.getLevel(); + int level2 = o2.getLevel(); + if (level1 != level2) { + return level1 - level2; + } + int orderIndex1 = o1.getOrderIndex(); + int orderIndex2 = o2.getOrderIndex(); + return orderIndex1 - orderIndex2; + } + }); + for (PALRepositoryModel subModel : subList) { + if (palProcessIds.contains(subModel.getId())) { + list.add(subModel); + } else { + getPermSubPalRepository(list, palProcessIds, subModel.getId()); + } + } + } + } + } + + /** + * 打开流程 + * @param me + * @param uuid + * @return + */ + public String openPublishRepository(UserContext me, String uuid, String type) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); + if (model != null) { + if ("default".equals(model.getMethodId())) { + throw new AWSException("当前文件类型不支持打开"); + } + } + if (type == null || "publish".equals(type)) {// 获取已发布流程 + return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null); + } else {// 不再校验是否已发布 + return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, null, false); + } + } + + /** + * 查找二级流程 + * @param me + * @param wsId + * @param type all:所有当前正在使用状态中的模型,包括发布和停用 publish:已发布模型 + * @return + */ + public String querySecondLevelRepositoryDataJson(UserContext me, String wsId, String type) { + JSONArray result = new JSONArray(); + // 暂时不处理权限,取所有二级流程类文件 + List firstLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, "process"); + if (!isEmpty(firstLevelModels)) { + Set versionIds = new HashSet<>(); + for (PALRepositoryModel model : firstLevelModels) { + if (!versionIds.contains(model.getVersionId())) { + // 获取第二级流程 + List secendLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, model.getId()); + if (!isEmpty(secendLevelModels)) { + if (type == null || "publish".equals(type)) {// 获取已发布流程 + for (PALRepositoryModel sModel : secendLevelModels) { + if (sModel.isPublish()) { + JSONObject object = new JSONObject(); + object.put("id", sModel.getId()); + object.put("name", sModel.getName()); + object.put("level", sModel.getLevel()); + object.put("parentId", sModel.getParentId()); + object.put("method", sModel.getMethodId()); + object.put("category", sModel.getMethodCategory()); + object.put("parentName", model.getName()); + object.put("isPublish", model.isPublish()); + result.add(object); + } + } + } else {// 获取当前使用中流程,不区分状态 + for (PALRepositoryModel sModel : secendLevelModels) { + if (sModel.isUse()) { + JSONObject object = new JSONObject(); + object.put("id", sModel.getId()); + object.put("name", sModel.getName()); + object.put("level", sModel.getLevel()); + object.put("parentId", sModel.getParentId()); + object.put("method", sModel.getMethodId()); + object.put("category", sModel.getMethodCategory()); + object.put("parentName", model.getName()); + object.put("isPublish", model.isPublish()); + result.add(object); + } + } + } + } + versionIds.add(model.getVersionId()); + } + } + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + return ro.toString(); + } + + /** + * 查找三级流程(已发布和未发布) + * @param me + * @param wsId + * @param type all:所有当前正在使用状态中的模型,包括发布和停用 publish:已发布模型 + * @return + */ + public String queryThirdLevelRepositoryDataJson(UserContext me, String wsId, String type) { + JSONArray result = new JSONArray(); + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + Set versionIds = new HashSet<>(); + // 一级流程 + List firstLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, "process"); + if(isEmpty(firstLevelModels)) { + return ro.toString(); + } + //非管理员在测试库下(type:all)权限 + CoeUser coeUserDao = CoeUserDaoFactory.createUser(); + boolean isCoEManager = coeUserDao.isCoEManager(me.getUID()); //是否管理员权限 + + PublisherClientDao publisherDao = new PublisherClientDao(); + List resourceIds = publisherDao.getTeamUserPerms(me.getUID()); //拥有的资源权限 + // + for (PALRepositoryModel model : firstLevelModels) { + if(versionIds.contains(model.getVersionId())) { + continue; + } + // 获取第二级流程 + List secendLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, model.getId()); + if(isEmpty(secendLevelModels)) { + continue; + } + for (PALRepositoryModel sModel : secendLevelModels) { + // 获取第三级流程 + List thirdLevelModels = PALRepositoryCache.getAllSubModelsByPid(wsId, sModel.getId()); + if(isEmpty(thirdLevelModels)) { + continue; + } + for(PALRepositoryModel tModel : thirdLevelModels) { + if (type == null || "publish".equals(type) ) {// 获取已发布流程 + if (tModel.isPublish() || "default".equals(tModel.getMethodId())) { + //第四级流程及以下流程 + List possessionList = new ArrayList(); + this.getAllPalRepositoryModelsByPid(wsId, tModel.getId(), possessionList); //递归得到流程信息 + //过滤统计流程的数量 + long possessionCount = 0; + for(int m = 0; m < possessionList.size(); m++) { + PALRepositoryModel mo = possessionList.get(m); + if("process.bpmn2".equals(mo.getMethodId()) && mo.isPublish()) { //只统计process.bpmn2类 + possessionCount ++; + } + } + JSONObject object = new JSONObject(); + object.put("id", tModel.getId()); + object.put("name", tModel.getName()); + object.put("level", tModel.getLevel()); + object.put("parentId", tModel.getParentId()); + object.put("method", tModel.getMethodId()); + object.put("category", tModel.getMethodCategory()); + object.put("parentName", sModel.getName()); + object.put("isPublish", tModel.isPublish()); + object.put("possessionCount", possessionCount); //目录下包含的所有流程数量,只包含bpmn当前版本的 + object.put("privilege", 1); //已发布的正式库永远有权限 + result.add(object); + } + } else {// 获取当前使用中的流程,不区分状态 + if (tModel.isUse()) { + //第四级流程及以下流程 + List possessionList = new ArrayList(); + this.getAllPalRepositoryModelsByPid(wsId, tModel.getId(), possessionList); //递归得到流程信息 + //privalige:0-没有第三级菜单下的流程权限;1-有第三级菜单下的流程权限 + int privalige = 1; + if(!isCoEManager) { + privalige = 0; + for(int i = 0; i < possessionList.size(); i++) { + PALRepositoryModel mo = possessionList.get(i); + if("process.bpmn2".equals(mo.getMethodId()) && mo.isUse() && resourceIds.contains(mo.getId())) { + privalige = 1; + break; + } + } + } + //过滤统计流程的数量 + long possessionCount = 0; + for(int m = 0; m < possessionList.size(); m++) { + PALRepositoryModel mo = possessionList.get(m); + if("process.bpmn2".equals(mo.getMethodId()) && mo.isUse()) { //只统计process.bpmn2类 + possessionCount ++; + } + } + JSONObject object = new JSONObject(); + object.put("id", tModel.getId()); + object.put("name", tModel.getName()); + object.put("level", tModel.getLevel()); + object.put("parentId", tModel.getParentId()); + object.put("method", tModel.getMethodId()); + object.put("category", tModel.getMethodCategory()); + object.put("parentName", sModel.getName()); + object.put("isPublish", tModel.isPublish()); + object.put("possessionCount", possessionCount); //目录下包含的所有流程数量,只包含bpmn当前版本的 + // 非管理人员测试库下 + if(isCoEManager) { + object.put("privilege", 1); //管理员拥有所有权限 + } else { + object.put("privilege", privalige); //非管理员 + } + result.add(object); + } + } + } //end of third level + } + versionIds.add(model.getVersionId()); + } + return ro.toString(); + } + + /** + * 获取某个流程的所有子流程 + * + * @param wsId + * @param pid + * @param list + */ + private void getAllPalRepositoryModelsByPid(String wsId, String pid, List list) { + List children = PALRepositoryCache.getAllSubModelsByPid(wsId, pid); + if (children != null && children.size() > 0) { + list.addAll(children); + for (PALRepositoryModel model : children) { + getAllPalRepositoryModelsByPid(wsId, model.getId(), list); + } + } + } + + /** + * 获取已加入群组 + * @param me + * @return + */ + public String queryJoinedTeamByUserId(UserContext me) { + JSONArray result = new JSONArray(); + // 获取所有工作网络列表 + JSONArray networks = getAllNetworks(); + + // 查询小组列表 + for (Object object : networks) { + JSONObject network = (JSONObject)object; + String networkId = network.getString("id"); + + Map teamMap = new LinkedHashMap(); + //获取工作网络中所有小组 + AppAPI appAPI = SDK.getAppAPI(); + Map params = new HashMap(); + String aslp = "aslp://com.actionsoft.apps.network/queryTeamsByNetwork"; + params.put("networkId", networkId); + params.put("sid", _uc.getSessionId()); + ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), aslp, params); + if (ro.toJsonObject().get("data") != null ) { + JSONArray teams = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teams"); + if (teams != null && teams.size() > 0) { + for (int i = 0; i < teams.size(); i++) { + JSONObject team = teams.getJSONObject(i); + if ("1".equals(team.getString("teamStatus"))) + teamMap.put(team.getString("id"), team);// 筛选启用中的小组 + } + } + for (Map.Entry entry : teamMap.entrySet()) { + JSONObject team = entry.getValue(); + String id = team.getString("id"); + // 查询小组成员 + Map numberMap = new HashMap<>(); + //小组ID,必填 + numberMap.put("teamId", id); + numberMap.put("sid", _uc.getSessionId()); + //查询某个小组的成员列表 + ResponseObject teamNumberRo = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), "aslp://com.actionsoft.apps.network/queryTeamMemberByTeamId", numberMap); + if (teamNumberRo.toJsonObject().get("data") != null ) { + JSONArray teamNumbers = (JSONObject.parseObject(teamNumberRo.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teamMembers"); + boolean flag = false; + for (Object o : teamNumbers) { + JSONObject teamNumber = (JSONObject)o; + // 查询是否在当前小组中 + if (teamNumber.getString("userId").equals(_uc.getUID())) { + flag = true; + break; + } + } + if (flag) { + String teamName = team.getString("teamName"); + String teamType = team.getString("teamType"); + String teamTypeIcon = "../apps/com.actionsoft.apps.network/img/team/type_" + teamType + ".png"; + String teamTypeName = ""; + if ("1".equals(teamType)) { + teamTypeName = "公共"; + } else if ("2".equals(teamType)) { + teamTypeName = "私有"; + } else if ("3".equals(teamType)) { + teamTypeName = "私密"; + } + String teamLogo = team.getString("teamLogo"); + String teamLogoSrc = "".equals(teamLogo) ? "../apps/com.actionsoft.apps.network/img/team/logo_2.png" : teamLogo; + int teamMembersNum = team.getInteger("memberAmount") == null ? 0 : team.getInteger("memberAmount"); + // 小组成员 + List numbers = new ArrayList<>(); + for (Object o : teamNumbers) { + JSONObject teamNumber = (JSONObject)o; + numbers.add(teamNumber.getString("userName")); + } + Collections.sort(numbers); + JSONObject teamData = new JSONObject(); + + teamData.put("id", id); + teamData.put("name", teamName); + teamData.put("teamType", teamType); + teamData.put("teamTypeIcon", teamTypeIcon); + teamData.put("teamTypeName", teamTypeName); + teamData.put("teamLogoSrc", teamLogoSrc); + teamData.put("teamMembersNum", teamMembersNum); + teamData.put("numbers", String.join(",", numbers)); + result.add(teamData); + } + } + } + } + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + return ro.toString(); + } + + /** + * 获取未加入群组 + * @param me + * @return + */ + public String queryNotJoinTeamByUserId(UserContext me) { + JSONArray result = new JSONArray(); + // 获取所有工作网络列表 + JSONArray networks = getAllNetworks(); + + // 查询小组列表 + for (Object object : networks) { + JSONObject network = (JSONObject)object; + String networkId = network.getString("id"); + + Map teamMap = new LinkedHashMap(); + //获取工作网络中所有小组 + AppAPI appAPI = SDK.getAppAPI(); + Map params = new HashMap(); + String aslp = "aslp://com.actionsoft.apps.network/queryTeamsByNetwork"; + params.put("networkId", networkId); + params.put("sid", _uc.getSessionId()); + ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), aslp, params); + if (ro.toJsonObject().get("data") != null ) { + JSONArray teams = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teams"); + if (teams != null && teams.size() > 0) { + for (int i = 0; i < teams.size(); i++) { + JSONObject team = teams.getJSONObject(i); + if ("1".equals(team.getString("teamStatus"))) + teamMap.put(team.getString("id"), team);// 筛选启用中的小组 + } + } + for (Map.Entry entry : teamMap.entrySet()) { + JSONObject team = entry.getValue(); + String id = team.getString("id"); + String teamType = team.getString("teamType"); + if ("3".equals(teamType)) {// 未加入的私密小组不显示 + continue; + } + // 查询小组成员 + Map numberMap = new HashMap<>(); + //小组ID,必填 + numberMap.put("teamId", id); + numberMap.put("sid", _uc.getSessionId()); + //查询某个小组的成员列表 + ResponseObject teamNumberRo = appAPI.callASLP(appAPI.getAppContext(PublisherConf.APPID), "aslp://com.actionsoft.apps.network/queryTeamMemberByTeamId", numberMap); + if (teamNumberRo.toJsonObject().get("data") != null ) { + JSONArray teamNumbers = (JSONObject.parseObject(teamNumberRo.toJsonObject().toString()).getJSONObject("data")).getJSONArray("teamMembers"); + boolean flag = false; + for (Object o : teamNumbers) { + JSONObject teamNumber = (JSONObject)o; + // 查询是否在当前小组中 + if (teamNumber.getString("userId").equals(_uc.getUID())) { + flag = true; + break; + } + } + if (!flag) { + String teamName = team.getString("teamName"); + String teamTypeIcon = "../apps/com.actionsoft.apps.network/img/team/type_" + teamType + ".png"; + String teamTypeName = ""; + if ("1".equals(teamType)) { + teamTypeName = "公共"; + } else if ("2".equals(teamType)) { + teamTypeName = "私有"; + } else if ("3".equals(teamType)) { + teamTypeName = "私密"; + } + String teamLogo = team.getString("teamLogo"); + String teamLogoSrc = "".equals(teamLogo) ? "../apps/com.actionsoft.apps.network/img/team/logo_2.png" : teamLogo; + int teamMembersNum = team.getInteger("memberAmount") == null ? 0 : team.getInteger("memberAmount"); + + JSONObject teamData = new JSONObject(); + + teamData.put("id", id); + teamData.put("name", teamName); + teamData.put("teamType", teamType); + teamData.put("teamTypeIcon", teamTypeIcon); + teamData.put("teamTypeName", teamTypeName); + teamData.put("teamLogoSrc", teamLogoSrc); + teamData.put("teamMembersNum", teamMembersNum); + result.add(teamData); + } + } + } + } + } + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + return ro.toString(); + } + + /** + * 获取工作网络集合 + */ + private JSONArray getAllNetworks() { + JSONArray result = new JSONArray(); + // 调用App + String sourceAppId = PublisherConf.APPID; + // aslp服务地址 + String aslp = "aslp://com.actionsoft.apps.network/queryAllNetwork"; + // 参数定义列表 + Map params = new HashMap<>(); + params.put("sid", _uc.getSessionId()); + AppAPI appAPI = SDK.getAppAPI(); + //查询工作网络列表 + ResponseObject ro = appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); + if (ro.toJsonObject().get("data") != null) { + JSONArray networks = (JSONObject.parseObject(ro.toJsonObject().toString()).getJSONObject("data")).getJSONArray("networks"); + for (Object object : networks) { + JSONObject obj = (JSONObject) object; + JSONObject temp = new JSONObject(); + temp.put("networkName", obj.getString("networkName")); + temp.put("id", obj.getString("id")); + result.add(temp); + } + } + return result; + } + + // 获取所有子部门 + private void getSubDepartments(List list, String parentId) { + // 获取子部门列表 + List subDeptList = SDK.getORGAPI().getSubDepartments(parentId); + if (!isEmpty(subDeptList)) { + for (DepartmentModel model : subDeptList) { + list.add(model); + getSubDepartments(list, model.getId()); + } + } /*// 获取子部门列表 List subDeptList = SDK.getORGAPI().getSubDepartments(parentId); if (!isEmpty(subDeptList)) { @@ -4221,571 +4221,571 @@ public class ProcessPublishClientWeb extends AbstPortalSkins implements PortalSk getPermDepartment(list, deptIds, model.getId()); } } - }*/ - } - /** - * 查询组织架构中部门流程 - * @param me - * @param wsId - * @return json - */ - public String openProcessMapOrgDeptData(UserContext me, String wsId, String departmentId) { - JSONObject result = new JSONObject(); - //FIXME 由于时间紧急,此方法功能正常,但待优化的地方很多 - // 获取有权限的已发布流程 - String category = "process"; - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - // 过滤当前责任部门的流程 - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - if (model.isPublish() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - // 整合所有权限id - palProcessIds.addAll(awsProcessIds); - Set deptIds = new HashSet<>(); - for (String id : palProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null && model.getWsId().equals(wsId)) { - // 责任部门 - String deptId = model.getDutyDept(); - if (!UtilString.isEmpty(deptId)) { - deptIds.add(deptId); - } - } - } - ///// - // 获取子部门列表 - List deptList = new ArrayList<>(); - //getSubDepartments(deptList, departmentId);// 获取子部门列表 - getPermDepartment(deptList, deptIds, departmentId);// 获取子部门列表 - // 部门排序 - JSONArray deptArr = new JSONArray(); - //加入本部门信息 - JSONObject selfDeptObj = new JSONObject(); - SDK.getORGAPI().getDepartmentById(departmentId); - selfDeptObj.put("id", departmentId); - selfDeptObj.put("departmentName", SDK.getORGAPI().getDepartmentById(departmentId).getName()); - deptArr.add(selfDeptObj); - //加入所有下级部门信息 - for (DepartmentModel dept : deptList) { - JSONObject deptObj = new JSONObject(); - deptObj.put("id", dept.getId()); - deptObj.put("departmentName", dept.getName()); - deptArr.add(deptObj); - } - result.put("department", deptArr); - //循环每一个部门得到流程信息 - JSONArray repositoryArr = new JSONArray(); //保存所有的流程 - Set repositoryModel_Ids = new HashSet(); //暂存流程id,保证流程不重复 - if(deptArr!=null && deptArr.size()>0) { - for(Object obj : deptArr) { - JSONObject deptObj = (JSONObject)obj; - //流程的列表 - JSONArray processArray = this.openProcessMapOrgDeptDataBySelfSubDept(me, wsId, deptObj.getString("id"), repositoryModel_Ids); - for(Object processObj : processArray) { - repositoryArr.add(processObj); - } - } - } - result.put("process", repositoryArr); - ResponseObject ro = ResponseObject.newOkResponse(); - ro.setData(result); - return ro.toString(); - } - /** 返回部门下流程 */ - private JSONArray openProcessMapOrgDeptDataBySelfSubDept(UserContext me, String wsId, String departmentId, Set repositoryModel_Ids) { - // 获取有权限的已发布流程 - String category = "process"; - JSONObject param = getXPagesBasicParam(me, null); - String roleId = param.getString("roleId"); - // 过滤当前责任部门的流程 - // 获取PAL权限版本ID - PALRepository repository = new PALRepository(); - Set palVersionIds = repository.getPalVersionIdByroleId(roleId); - Set palProcessIds = new HashSet<>(); - for (String versionId : palVersionIds) { - List list = PALRepositoryCache.getByVersionId(versionId); - if (!isEmpty(list)) { - for (PALRepositoryModel model : list) { - if (model.isPublish() && model.getMethodCategory().equals(category)) { - palProcessIds.add(model.getId()); - } - } - } - } - // 获取关联AWS组织的版本ID且当前为已发布 - Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); - // 整合所有权限id - palProcessIds.addAll(awsProcessIds); - List list = new ArrayList<>(); - for (String id : palProcessIds) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null && model.getWsId().equals(wsId)) { - // 责任部门 - String deptId = model.getDutyDept(); - if (!UtilString.isEmpty(deptId)) { - if (deptId.equals(departmentId)) { - list.add(model); - } - } - } - } - Collections.sort(list, new MyComparator()); - JSONArray repositoryArr = new JSONArray(); - for (PALRepositoryModel model : list) { - if(repositoryModel_Ids.contains(model.getId())) { - //repositoryModel_Ids已经存在该model则略过 - continue; - } - repositoryModel_Ids.add(model.getId());//该modelId加入repositoryModel_Ids,使得下次不重复加入 + }*/ + } + /** + * 查询组织架构中部门流程 + * @param me + * @param wsId + * @return json + */ + public String openProcessMapOrgDeptData(UserContext me, String wsId, String departmentId) { + JSONObject result = new JSONObject(); + //FIXME 由于时间紧急,此方法功能正常,但待优化的地方很多 + // 获取有权限的已发布流程 + String category = "process"; + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + // 过滤当前责任部门的流程 + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + if (model.isPublish() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + // 整合所有权限id + palProcessIds.addAll(awsProcessIds); + Set deptIds = new HashSet<>(); + for (String id : palProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null && model.getWsId().equals(wsId)) { + // 责任部门 + String deptId = model.getDutyDept(); + if (!UtilString.isEmpty(deptId)) { + deptIds.add(deptId); + } + } + } + ///// + // 获取子部门列表 + List deptList = new ArrayList<>(); + //getSubDepartments(deptList, departmentId);// 获取子部门列表 + getPermDepartment(deptList, deptIds, departmentId);// 获取子部门列表 + // 部门排序 + JSONArray deptArr = new JSONArray(); + //加入本部门信息 + JSONObject selfDeptObj = new JSONObject(); + SDK.getORGAPI().getDepartmentById(departmentId); + selfDeptObj.put("id", departmentId); + selfDeptObj.put("departmentName", SDK.getORGAPI().getDepartmentById(departmentId).getName()); + deptArr.add(selfDeptObj); + //加入所有下级部门信息 + for (DepartmentModel dept : deptList) { + JSONObject deptObj = new JSONObject(); + deptObj.put("id", dept.getId()); + deptObj.put("departmentName", dept.getName()); + deptArr.add(deptObj); + } + result.put("department", deptArr); + //循环每一个部门得到流程信息 + JSONArray repositoryArr = new JSONArray(); //保存所有的流程 + Set repositoryModel_Ids = new HashSet(); //暂存流程id,保证流程不重复 + if(deptArr!=null && deptArr.size()>0) { + for(Object obj : deptArr) { + JSONObject deptObj = (JSONObject)obj; + //流程的列表 + JSONArray processArray = this.openProcessMapOrgDeptDataBySelfSubDept(me, wsId, deptObj.getString("id"), repositoryModel_Ids); + for(Object processObj : processArray) { + repositoryArr.add(processObj); + } + } + } + result.put("process", repositoryArr); + ResponseObject ro = ResponseObject.newOkResponse(); + ro.setData(result); + return ro.toString(); + } + /** 返回部门下流程 */ + private JSONArray openProcessMapOrgDeptDataBySelfSubDept(UserContext me, String wsId, String departmentId, Set repositoryModel_Ids) { + // 获取有权限的已发布流程 + String category = "process"; + JSONObject param = getXPagesBasicParam(me, null); + String roleId = param.getString("roleId"); + // 过滤当前责任部门的流程 + // 获取PAL权限版本ID + PALRepository repository = new PALRepository(); + Set palVersionIds = repository.getPalVersionIdByroleId(roleId); + Set palProcessIds = new HashSet<>(); + for (String versionId : palVersionIds) { + List list = PALRepositoryCache.getByVersionId(versionId); + if (!isEmpty(list)) { + for (PALRepositoryModel model : list) { + if (model.isPublish() && model.getMethodCategory().equals(category)) { + palProcessIds.add(model.getId()); + } + } + } + } + // 获取关联AWS组织的版本ID且当前为已发布 + Set awsProcessIds = getAwsOrgPermRepositoryByUser(_uc, category, true); + // 整合所有权限id + palProcessIds.addAll(awsProcessIds); + List list = new ArrayList<>(); + for (String id : palProcessIds) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null && model.getWsId().equals(wsId)) { + // 责任部门 + String deptId = model.getDutyDept(); + if (!UtilString.isEmpty(deptId)) { + if (deptId.equals(departmentId)) { + list.add(model); + } + } + } + } + Collections.sort(list, new MyComparator()); + JSONArray repositoryArr = new JSONArray(); + for (PALRepositoryModel model : list) { + if(repositoryModel_Ids.contains(model.getId())) { + //repositoryModel_Ids已经存在该model则略过 + continue; + } + repositoryModel_Ids.add(model.getId());//该modelId加入repositoryModel_Ids,使得下次不重复加入 + + // "子部门列表(部门id,部门名称); + // 所有选择了该部门作为责任部门的流程文件列表(流程id,流程名称,是否有附件、附件Id,附件名称、附件链接、流程地图图片)" + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("version", VersionUtil.getVersionStrV(model.getVersion())); + object.put("hasFile", false); + object.put("method", model.getMethodId()); + object.put("category", model.getMethodCategory()); + // 附件 + JSONArray file = new JSONArray(); + StringBuffer sqlWhere = new StringBuffer(); + sqlWhere.append(" and PALREPOSITORYID ='").append(model.getId()).append("' and FILETYPE='f'"); + UpFileDao upFileDao = new UpFileDao(); + List search = upFileDao.search(sqlWhere.toString()); + if (search != null && search.size() > 0) { + object.put("hasFile", true); + for (UpfileModel upfileModel : search) { + JSONObject fileObject = new JSONObject(); + fileObject.put("id", upfileModel.getUuid()); + fileObject.put("name", upfileModel.getFileName()); + String downloadUrl = ""; + DCContext dcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); + if (dcProfile != null) { + dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); + } + if (dcContext != null) { + downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; + } + fileObject.put("url", downloadUrl); + file.add(fileObject); + } + } + object.put("file", file); + // 流程图片 + String imgSrc = ""; + String path = model.getFilePath(); + if (!UtilString.isEmpty(path)) { + UtilFile utilFile = new UtilFile(path + "/" + model.getId() + ".small.png"); + if (utilFile.exists()) { + byte[] base64Bytes = Base64.encode(utilFile.readBytes()); + imgSrc = "data:image/png;base64," + new String(base64Bytes); + } + } + object.put("imgSrc", imgSrc); + repositoryArr.add(object); + } + return repositoryArr; + } + /** + * 依据流程库Id获取该流程库主题风格的轮播图资源 + * @param me + * @return + */ + public String bannerCarouselData(UserContext me ) { + ResponseObject ro = ResponseObject.newOkResponse(); + // dc中文件目录 + DCContext bannerDcContext = null; + DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); + if (dcProfile != null) { + bannerDcContext = new DCContext(_uc, dcProfile, "portal", "banner"); + } + // 轮播图文件 + JSONArray pictures = new JSONArray(); + int total = 0; + if (bannerDcContext != null) { + File file = new File(bannerDcContext.getPath()); + if (file.exists()) { + File [] files = file.listFiles(); + if (files != null) { + // 按照名称排序 + List fileList = Arrays.asList(files); + total = fileList.size(); + Collections.sort(fileList, new Comparator() { + @Override + public int compare(File o1, File o2) { + if (o1.isDirectory() && o2.isFile()) + return -1; + if (o1.isFile() && o2.isDirectory()) + return 1; + return o1.getName().compareTo(o2.getName()); + } + }); + for (int i = 0; i < fileList.size(); i++) { + File file2 = files[i]; + String src = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, "portal", "banner", file2.getName()).getDownloadURL(); + JSONObject object = new JSONObject(); + object.put("index", i); + object.put("src", src); + object.put("name", file2.getName()); + pictures.add(object); + } + } + } + } + // + JSONObject data = new JSONObject(); + data.put("pictures", pictures);//图片资源 + data.put("sid", me.getSessionId()); + data.put("total", total); //图片总数 + ro.put("data", data); + return ro.toString(); + } + + /*********************永辉接口end***************************/ - // "子部门列表(部门id,部门名称); - // 所有选择了该部门作为责任部门的流程文件列表(流程id,流程名称,是否有附件、附件Id,附件名称、附件链接、流程地图图片)" - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("version", VersionUtil.getVersionStrV(model.getVersion())); - object.put("hasFile", false); - object.put("method", model.getMethodId()); - object.put("category", model.getMethodCategory()); - // 附件 - JSONArray file = new JSONArray(); - StringBuffer sqlWhere = new StringBuffer(); - sqlWhere.append(" and PALREPOSITORYID ='").append(model.getId()).append("' and FILETYPE='f'"); - UpFileDao upFileDao = new UpFileDao(); - List search = upFileDao.search(sqlWhere.toString()); - if (search != null && search.size() > 0) { - object.put("hasFile", true); - for (UpfileModel upfileModel : search) { - JSONObject fileObject = new JSONObject(); - fileObject.put("id", upfileModel.getUuid()); - fileObject.put("name", upfileModel.getFileName()); - String downloadUrl = ""; - DCContext dcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, CoeFileConstant.COE_UPFILE); - if (dcProfile != null) { - dcContext = new DCContext(me, dcProfile, CoEConstant.APP_ID, "file",upfileModel.getPl_uuid(), upfileModel.getFileName()); - } - if (dcContext != null) { - downloadUrl = dcContext.getDownloadURL() + "&isInline=false"; - } - fileObject.put("url", downloadUrl); - file.add(fileObject); - } - } - object.put("file", file); - // 流程图片 - String imgSrc = ""; - String path = model.getFilePath(); - if (!UtilString.isEmpty(path)) { - UtilFile utilFile = new UtilFile(path + "/" + model.getId() + ".small.png"); - if (utilFile.exists()) { - byte[] base64Bytes = Base64.encode(utilFile.readBytes()); - imgSrc = "data:image/png;base64," + new String(base64Bytes); - } - } - object.put("imgSrc", imgSrc); - repositoryArr.add(object); - } - return repositoryArr; - } - /** - * 依据流程库Id获取该流程库主题风格的轮播图资源 - * @param me - * @return - */ - public String bannerCarouselData(UserContext me ) { - ResponseObject ro = ResponseObject.newOkResponse(); - // dc中文件目录 - DCContext bannerDcContext = null; - DCPluginProfile dcProfile = DCProfileManager.getDCProfile(CoEConstant.APP_ID, "portalTheme"); - if (dcProfile != null) { - bannerDcContext = new DCContext(_uc, dcProfile, "portal", "banner"); - } - // 轮播图文件 - JSONArray pictures = new JSONArray(); - int total = 0; - if (bannerDcContext != null) { - File file = new File(bannerDcContext.getPath()); - if (file.exists()) { - File [] files = file.listFiles(); - if (files != null) { - // 按照名称排序 - List fileList = Arrays.asList(files); - total = fileList.size(); - Collections.sort(fileList, new Comparator() { - @Override - public int compare(File o1, File o2) { - if (o1.isDirectory() && o2.isFile()) - return -1; - if (o1.isFile() && o2.isDirectory()) - return 1; - return o1.getName().compareTo(o2.getName()); - } - }); - for (int i = 0; i < fileList.size(); i++) { - File file2 = files[i]; - String src = new DCContext(_uc, dcProfile, CoEConstant.APP_ID, "portal", "banner", file2.getName()).getDownloadURL(); - JSONObject object = new JSONObject(); - object.put("index", i); - object.put("src", src); - object.put("name", file2.getName()); - pictures.add(object); - } - } - } - } - // - JSONObject data = new JSONObject(); - data.put("pictures", pictures);//图片资源 - data.put("sid", me.getSessionId()); - data.put("total", total); //图片总数 - ro.put("data", data); - return ro.toString(); - } + /** + * 查询“我参与的”流程 + * @param me + * @param count + * @return + */ + public String participantDataQuery(UserContext me, String count) { + int c = Integer.parseInt(count); + if (c < 0) { + throw new AWSException("xpages配置参数错误count=" + count); + } + Map result = new HashMap(); + result.put("sid", me.getSessionId()); + result.put("uid", me.getUID()); + JSONArray array = new JSONArray(); + // 获取当前人权限下的已发布流程ID集合 + Set ids = getAwsOrgPermRealtionRepositoryByUser(me, "process", true); + // 发布时间倒序 + List list = new ArrayList<>(); + for (String id : ids) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null) { + list.add(model); + } + } + Collections.sort(list, new MyComparator());// 排序 + PublishListHistory pHistory = new PublishListHistory(); + for (int i = 0; i < list.size() && i < c; i++) { + PALRepositoryModel model = list.get(i); + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("versionId", model.getVersionId()); + object.put("method", model.getMethodId()); + object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); + String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.participant.html", result); + } + + /** + * 查询“我负责的“流程 + * @param me + * @param count + * @return + */ + public String responsibleDataQuery(UserContext me, String count) { + int c = Integer.parseInt(count); + if (c < 0) { + throw new AWSException("xpages配置参数错误count=" + count); + } + Map result = new HashMap(); + result.put("sid", me.getSessionId()); + result.put("uid", me.getUID()); + JSONArray array = new JSONArray(); + // 获取责任人是当前人的已发布流程ID集合 + Set ids = getPermRepositoryByDutyPerson(me, "process", true); + List list = new ArrayList<>(); + for (String id : ids) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null) { + list.add(model); + } + } + Collections.sort(list, new MyComparator());// 排序 + PublishListHistory pHistory = new PublishListHistory(); + for (int i = 0; i < list.size() && i < c; i++) { + PALRepositoryModel model = list.get(i); + JSONObject object = new JSONObject(); + object.put("id", model.getId()); + object.put("name", model.getName()); + object.put("versionId", model.getVersionId()); + object.put("method", model.getMethodId()); + object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); + String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); + object.put("taskId", taskId == null ? "" : taskId); + array.add(object); + } + result.put("data", array); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.responsible.html", result); + } - /*********************永辉接口end***************************/ + /** + * 岗位职责模块查询 + * @param me + * @param count + * @return + */ + public String postresponsibilityDataQuery(UserContext me, String count) { + int c = Integer.parseInt(count); + if (c < 0) { + throw new AWSException("xpages配置参数错误count=" + count); + } + Map result = new HashMap(); + result.put("sid", me.getSessionId()); + result.put("uid", me.getUID()); + + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.postresponsibility.html", result); + } - /** - * 查询“我参与的”流程 - * @param me - * @param count - * @return - */ - public String participantDataQuery(UserContext me, String count) { - int c = Integer.parseInt(count); - if (c < 0) { - throw new AWSException("xpages配置参数错误count=" + count); - } - Map result = new HashMap(); - result.put("sid", me.getSessionId()); - result.put("uid", me.getUID()); - JSONArray array = new JSONArray(); - // 获取当前人权限下的已发布流程ID集合 - Set ids = getAwsOrgPermRealtionRepositoryByUser(me, "process", true); - // 发布时间倒序 - List list = new ArrayList<>(); - for (String id : ids) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null) { - list.add(model); - } - } - Collections.sort(list, new MyComparator());// 排序 - PublishListHistory pHistory = new PublishListHistory(); - for (int i = 0; i < list.size() && i < c; i++) { - PALRepositoryModel model = list.get(i); - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("versionId", model.getVersionId()); - object.put("method", model.getMethodId()); - object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); - String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.participant.html", result); - } + /** + * RCAI模块查询 + * @param me + * @param count + * @return + */ + public String rcaimatrixDataQuery(UserContext me, String count) { + int c = Integer.parseInt(count); + if (c < 0) { + throw new AWSException("xpages配置参数错误count=" + count); + } + Map result = new HashMap(); + result.put("sid", me.getSessionId()); + result.put("uid", me.getUID()); + // 获取当前人的所有角色 + String userId = me.getUID(); + Set roleIds = new HashSet<>(); + RoleModel role = me.getRoleModel(); + roleIds.add(role.getId()); + // 兼职角色 + List userMapModels = UserMapCache.getMapListOfUser(userId); + if (!isEmpty(userMapModels)) { + for (UserMapModel usermap : userMapModels) { + roleIds.add(usermap.getRoleId()); + } + } + // 获取当前人权限下的已发布流程ID集合 + Set ids = getAwsOrgPermRealtionRepositoryByUser(me, "process", true); + List list = new ArrayList<>(); + for (String id : ids) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(id); + if (model != null) { + list.add(model); + } + } + // 按照发布时间/名称排序 + Collections.sort(list, new Comparator() { + @Override + public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { + Timestamp time1 = o1.getPublishDate(); + Timestamp time2 = o2.getPublishDate(); + if (time1 != null && time2 != null) { + if (!time1.equals(time2)) { + return time2.compareTo(time1); + } + } + return o1.getName().compareTo(o2.getName()); + } + }); + JSONArray data = new JSONArray(); + int index = 0; + // 获取流程的任务 + for (PALRepositoryModel model : list) { + if (index >= c) { + break; + } + String repositoryId = model.getId(); + String dutyUser = model.getDutyUser(); + String dutyUserName = ""; + if (!UtilString.isEmpty(dutyUser)) { + UserModel userModel = SDK.getORGAPI().getUser(dutyUser); + if (userModel != null) { + dutyUserName = userModel.getUserName(); + } + } + String name = model.getName(); + // 节点集合 + List> shapeList = CoeDesignerUtil.getShapeMessageJson2(repositoryId); + // 排序 + OutputWordUtil.orderByNumber(shapeList); + for (Map shape : shapeList) { + JSONObject trObj = new JSONObject();// 每一行数据 + trObj.put("duty_r", ""); + trObj.put("counselor_c", ""); + trObj.put("approval_a", ""); + trObj.put("notify_i", ""); + Set relation = new HashSet<>(); + JSONObject dataAttributes = (JSONObject)shape.get("attributes"); + if (dataAttributes != null) { + JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); + Map shapeModelMap = OutputWordUtil.getShapeRelationMap(repositoryId, (String) shape.get("id")); + boolean flag = false; + for (int i = 0; i < dataAttributesJsonArray.size(); i++) { + String values = ""; + JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); + // 获取awsorg类型等属性 + if (dataAttribute != null && dataAttribute.containsKey("type") && "awsorg".equals(dataAttribute.getString("type"))) { + String key = dataAttribute.getString("key"); + String attributeValue = dataAttribute.getString("value"); + StringBuilder keyValue = new StringBuilder(); + if (key != null) { + if (attributeValue != null && attributeValue.length() != 0) { + attributeValue = attributeValue.replace("[", "").replace("]", "").replace("\"", ""); + String[] keyValues = OutputWordUtil.removeRepeat(attributeValue, ",").split(","); + for (String keyId : keyValues) { + if (!"".equals(keyId) && shapeModelMap.containsKey(keyId)) { + String text = shapeModelMap.get(keyId); + JSONObject object = JSONObject.parseObject(text); + String type = object.getString("type"); + if ("department".equals(type)) {// 部门 + DepartmentModel deptModel = SDK.getORGAPI().getDepartmentById(keyId); + if (deptModel != null) { + keyValue.append(OutputWordUtil.specialCharTransfer(deptModel.getName())).append(","); + } + } + if ("user".equals(type)) {// 人员 + UserModel userModel = SDK.getORGAPI().getUser(keyId); + if (userModel != null) { + if (userModel.getUID().equals(me.getUID())) { + relation.add(dataAttribute.getString("key")); + } + keyValue.append(OutputWordUtil.specialCharTransfer(userModel.getUserName())).append(","); + } + } + if ("role".equals(type)) {// 角色 + RoleModel roleModel = SDK.getORGAPI().getRoleById(keyId); + if (roleModel != null) { + if (roleIds.contains(roleModel.getId())) { + relation.add(dataAttribute.getString("key")); + } + keyValue.append(OutputWordUtil.specialCharTransfer(roleModel.getName())).append(","); + } + } + } + } + } + } + if (keyValue.length() > 0) { + values = keyValue.toString().substring(0, keyValue.length() - 1); + if ("duty_r".equals(dataAttribute.getString("key"))) {// R 责任者 + flag = true; + trObj.put("duty_r", values); + } else if ("counselor_c".equals(dataAttribute.getString("key"))) {// C 咨询者 + flag = true; + trObj.put("counselor_c", values); + } else if ("approval_a".equals(dataAttribute.getString("key"))) {// A 审批者 + flag = true; + trObj.put("approval_a", values); + } else if ("notify_i".equals(dataAttribute.getString("key"))) {// I 知会者 + flag = true; + trObj.put("notify_i", values); + } + } + } + } + if (!flag) { + continue; + } + trObj.put("id", repositoryId);// 流程ID + trObj.put("name", name);// 流程名称 + trObj.put("shapeId", (String) shape.get("id"));// 节点ID + trObj.put("shapeName", shape.get("text").toString());// 任务 + trObj.put("shapeDesc", (OutputWordUtil.specialCharTransfer((String)dataAttributes.get("shapeDesc"))));// 任务描述 + trObj.put("dutyUser", dutyUserName);// 责任人 + trObj.put("relation", ""); + StringBuilder sb = new StringBuilder(); + if (relation.contains("duty_r")) { + sb.append("duty_r").append(","); + } + if (relation.contains("counselor_c")) { + sb.append("counselor_c").append(","); + } + if (relation.contains("approval_a")) { + sb.append("approval_a").append(","); + } + if (relation.contains("notify_i")) { + sb.append("notify_i").append(","); + } + trObj.put("relation", sb.toString()); + data.add(trObj); + index++; + if (index >= c) { + break; + } + } + } + } + result.put("data", data); + return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.rcaimatrix.html", result); + } + - /** - * 查询“我负责的“流程 - * @param me - * @param count - * @return - */ - public String responsibleDataQuery(UserContext me, String count) { - int c = Integer.parseInt(count); - if (c < 0) { - throw new AWSException("xpages配置参数错误count=" + count); - } - Map result = new HashMap(); - result.put("sid", me.getSessionId()); - result.put("uid", me.getUID()); - JSONArray array = new JSONArray(); - // 获取责任人是当前人的已发布流程ID集合 - Set ids = getPermRepositoryByDutyPerson(me, "process", true); - List list = new ArrayList<>(); - for (String id : ids) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null) { - list.add(model); - } - } - Collections.sort(list, new MyComparator());// 排序 - PublishListHistory pHistory = new PublishListHistory(); - for (int i = 0; i < list.size() && i < c; i++) { - PALRepositoryModel model = list.get(i); - JSONObject object = new JSONObject(); - object.put("id", model.getId()); - object.put("name", model.getName()); - object.put("versionId", model.getVersionId()); - object.put("method", model.getMethodId()); - object.put("date", model.getPublishDate() == null ? "" : model.getPublishDate()); - String taskId = pHistory.getLastPublishTaskIdByModelId(model.getId()); - object.put("taskId", taskId == null ? "" : taskId); - array.add(object); - } - result.put("data", array); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.responsible.html", result); - } + /** + * 得到流程资产库的数据和组织单元的数据 + * + * @return + */ + public String getCoeWorkSpaceAndOrgInfo() { + ResponseObject ro = ResponseObject.newOkResponse(); + //workspaces:资产库信息;//units:组织单元信息 + JSONObject data = new JSONObject(); + //可用的资产库信息 + List workspaceList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getCoeWorkSpaceModelRecodesNoPage(); + JSONArray workspaces = new JSONArray(); + if(workspaceList!=null && workspaceList.size()>0) { + for(CoeWorkSpaceModel workspace : workspaceList) { + JSONObject obj = new JSONObject(); + obj.put("id", workspace.getUUId()); + obj.put("name", workspace.getWsName()); + workspaces.add(obj); + } + } + data.put("workspaces", workspaces); + //组织单元信息 + List companyList = SDK.getORGAPI().getCompanys(); + JSONArray companys = new JSONArray(); + if(companyList!=null && companyList.size()>0) { + for(CompanyModel company : companyList) { + JSONObject obj = new JSONObject(); + obj.put("id", company.getId()); + obj.put("name", company.getNameI18N()); + companys.add(obj); + } + } + data.put("companys", companys); + ro.put("data",data); + return ro.toString(); + } - /** - * 岗位职责模块查询 - * @param me - * @param count - * @return - */ - public String postresponsibilityDataQuery(UserContext me, String count) { - int c = Integer.parseInt(count); - if (c < 0) { - throw new AWSException("xpages配置参数错误count=" + count); - } - Map result = new HashMap(); - result.put("sid", me.getSessionId()); - result.put("uid", me.getUID()); - - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.postresponsibility.html", result); - } - - /** - * RCAI模块查询 - * @param me - * @param count - * @return - */ - public String rcaimatrixDataQuery(UserContext me, String count) { - int c = Integer.parseInt(count); - if (c < 0) { - throw new AWSException("xpages配置参数错误count=" + count); - } - Map result = new HashMap(); - result.put("sid", me.getSessionId()); - result.put("uid", me.getUID()); - // 获取当前人的所有角色 - String userId = me.getUID(); - Set roleIds = new HashSet<>(); - RoleModel role = me.getRoleModel(); - roleIds.add(role.getId()); - // 兼职角色 - List userMapModels = UserMapCache.getMapListOfUser(userId); - if (!isEmpty(userMapModels)) { - for (UserMapModel usermap : userMapModels) { - roleIds.add(usermap.getRoleId()); - } - } - // 获取当前人权限下的已发布流程ID集合 - Set ids = getAwsOrgPermRealtionRepositoryByUser(me, "process", true); - List list = new ArrayList<>(); - for (String id : ids) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(id); - if (model != null) { - list.add(model); - } - } - // 按照发布时间/名称排序 - Collections.sort(list, new Comparator() { - @Override - public int compare(PALRepositoryModel o1, PALRepositoryModel o2) { - Timestamp time1 = o1.getPublishDate(); - Timestamp time2 = o2.getPublishDate(); - if (time1 != null && time2 != null) { - if (!time1.equals(time2)) { - return time2.compareTo(time1); - } - } - return o1.getName().compareTo(o2.getName()); - } - }); - JSONArray data = new JSONArray(); - int index = 0; - // 获取流程的任务 - for (PALRepositoryModel model : list) { - if (index >= c) { - break; - } - String repositoryId = model.getId(); - String dutyUser = model.getDutyUser(); - String dutyUserName = ""; - if (!UtilString.isEmpty(dutyUser)) { - UserModel userModel = SDK.getORGAPI().getUser(dutyUser); - if (userModel != null) { - dutyUserName = userModel.getUserName(); - } - } - String name = model.getName(); - // 节点集合 - List> shapeList = CoeDesignerUtil.getShapeMessageJson2(repositoryId); - // 排序 - OutputWordUtil.orderByNumber(shapeList); - for (Map shape : shapeList) { - JSONObject trObj = new JSONObject();// 每一行数据 - trObj.put("duty_r", ""); - trObj.put("counselor_c", ""); - trObj.put("approval_a", ""); - trObj.put("notify_i", ""); - Set relation = new HashSet<>(); - JSONObject dataAttributes = (JSONObject)shape.get("attributes"); - if (dataAttributes != null) { - JSONArray dataAttributesJsonArray = dataAttributes.getJSONArray("attributesJsonArray"); - Map shapeModelMap = OutputWordUtil.getShapeRelationMap(repositoryId, (String) shape.get("id")); - boolean flag = false; - for (int i = 0; i < dataAttributesJsonArray.size(); i++) { - String values = ""; - JSONObject dataAttribute = dataAttributesJsonArray.getJSONObject(i); - // 获取awsorg类型等属性 - if (dataAttribute != null && dataAttribute.containsKey("type") && "awsorg".equals(dataAttribute.getString("type"))) { - String key = dataAttribute.getString("key"); - String attributeValue = dataAttribute.getString("value"); - StringBuilder keyValue = new StringBuilder(); - if (key != null) { - if (attributeValue != null && attributeValue.length() != 0) { - attributeValue = attributeValue.replace("[", "").replace("]", "").replace("\"", ""); - String[] keyValues = OutputWordUtil.removeRepeat(attributeValue, ",").split(","); - for (String keyId : keyValues) { - if (!"".equals(keyId) && shapeModelMap.containsKey(keyId)) { - String text = shapeModelMap.get(keyId); - JSONObject object = JSONObject.parseObject(text); - String type = object.getString("type"); - if ("department".equals(type)) {// 部门 - DepartmentModel deptModel = SDK.getORGAPI().getDepartmentById(keyId); - if (deptModel != null) { - keyValue.append(OutputWordUtil.specialCharTransfer(deptModel.getName())).append(","); - } - } - if ("user".equals(type)) {// 人员 - UserModel userModel = SDK.getORGAPI().getUser(keyId); - if (userModel != null) { - if (userModel.getUID().equals(me.getUID())) { - relation.add(dataAttribute.getString("key")); - } - keyValue.append(OutputWordUtil.specialCharTransfer(userModel.getUserName())).append(","); - } - } - if ("role".equals(type)) {// 角色 - RoleModel roleModel = SDK.getORGAPI().getRoleById(keyId); - if (roleModel != null) { - if (roleIds.contains(roleModel.getId())) { - relation.add(dataAttribute.getString("key")); - } - keyValue.append(OutputWordUtil.specialCharTransfer(roleModel.getName())).append(","); - } - } - } - } - } - } - if (keyValue.length() > 0) { - values = keyValue.toString().substring(0, keyValue.length() - 1); - if ("duty_r".equals(dataAttribute.getString("key"))) {// R 责任者 - flag = true; - trObj.put("duty_r", values); - } else if ("counselor_c".equals(dataAttribute.getString("key"))) {// C 咨询者 - flag = true; - trObj.put("counselor_c", values); - } else if ("approval_a".equals(dataAttribute.getString("key"))) {// A 审批者 - flag = true; - trObj.put("approval_a", values); - } else if ("notify_i".equals(dataAttribute.getString("key"))) {// I 知会者 - flag = true; - trObj.put("notify_i", values); - } - } - } - } - if (!flag) { - continue; - } - trObj.put("id", repositoryId);// 流程ID - trObj.put("name", name);// 流程名称 - trObj.put("shapeId", (String) shape.get("id"));// 节点ID - trObj.put("shapeName", shape.get("text").toString());// 任务 - trObj.put("shapeDesc", (OutputWordUtil.specialCharTransfer((String)dataAttributes.get("shapeDesc"))));// 任务描述 - trObj.put("dutyUser", dutyUserName);// 责任人 - trObj.put("relation", ""); - StringBuilder sb = new StringBuilder(); - if (relation.contains("duty_r")) { - sb.append("duty_r").append(","); - } - if (relation.contains("counselor_c")) { - sb.append("counselor_c").append(","); - } - if (relation.contains("approval_a")) { - sb.append("approval_a").append(","); - } - if (relation.contains("notify_i")) { - sb.append("notify_i").append(","); - } - trObj.put("relation", sb.toString()); - data.add(trObj); - index++; - if (index >= c) { - break; - } - } - } - } - result.put("data", data); - return HtmlPageTemplate.merge(PublisherConf.APPID, "publish.client.xpages.rcaimatrix.html", result); - } - - - /** - * 得到流程资产库的数据和组织单元的数据 - * - * @return - */ - public String getCoeWorkSpaceAndOrgInfo() { - ResponseObject ro = ResponseObject.newOkResponse(); - //workspaces:资产库信息;//units:组织单元信息 - JSONObject data = new JSONObject(); - //可用的资产库信息 - List workspaceList = CoeWorkSpaceDaoFactory.createCoeWorkSpace().getCoeWorkSpaceModelRecodesNoPage(); - JSONArray workspaces = new JSONArray(); - if(workspaceList!=null && workspaceList.size()>0) { - for(CoeWorkSpaceModel workspace : workspaceList) { - JSONObject obj = new JSONObject(); - obj.put("id", workspace.getUUId()); - obj.put("name", workspace.getWsName()); - workspaces.add(obj); - } - } - data.put("workspaces", workspaces); - //组织单元信息 - List companyList = SDK.getORGAPI().getCompanys(); - JSONArray companys = new JSONArray(); - if(companyList!=null && companyList.size()>0) { - for(CompanyModel company : companyList) { - JSONObject obj = new JSONObject(); - obj.put("id", company.getId()); - obj.put("name", company.getNameI18N()); - companys.add(obj); - } - } - data.put("companys", companys); - ro.put("data",data); - return ro.toString(); - } - - public String openPage(UserContext me, String uuid, String taskId) { - PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); - if (model != null && "process".equals(model.getMethodCategory()) && UtilString.isEmpty(taskId)) { - taskId = new PublishListHistory().getLastPublishTaskIdByModelId(uuid); - } - return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, taskId); - } + public String openPage(UserContext me, String uuid, String taskId) { + PALRepositoryModel model = PALRepositoryCache.getCache().get(uuid); + if (model != null && "process".equals(model.getMethodCategory()) && UtilString.isEmpty(taskId)) { + taskId = new PublishListHistory().getLastPublishTaskIdByModelId(uuid); + } + return PALRepositoryQueryAPIManager.getInstance().getPublishPortalHtml(me, uuid, taskId); + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/conf/PublisherConf.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/conf/PublisherConf.java index d65c5af7..7eb765a6 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/conf/PublisherConf.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/conf/PublisherConf.java @@ -5,231 +5,231 @@ import com.actionsoft.sdk.local.SDK; import com.alibaba.fastjson.JSONArray; public final class PublisherConf { - public static final String APPID = "com.actionsoft.apps.coe.pal.publisher"; + public static final String APPID = "com.actionsoft.apps.coe.pal.publisher"; + + public static final String RELATION_SEARCH_ID = "com.actionsoft.apps.coe.pal.relationsearch"; + public static final String RELATION_SEARCH_NAME = "关联查询"; + + public static final String PORTAL_TREE_ICON_FOLDER = "../apps/com.actionsoft.apps.coe.pal.publisher/img/tree-folder.png"; + public static final String PORTAL_TREE_ICON_FOLDER1 = "../apps/com.actionsoft.apps.coe.pal.publisher/img/tree-folder1.png"; + + public static String PUBLISH_PORTAL_VERSION = "v1"; + + public static String XPAGES_ID = ""; + + public static JSONArray PORTAL_TABS = null; + + /** + * 页底信息,如客户流程管理部联系信息 + * + * @return + */ + public static String getFotter() { + String value = SDK.getAppAPI().getProperty(APPID, "fotter"); + if (UtilString.isEmpty(value)) { + value = "炎黄盈动"; + } + return value; + } + + public static void setFotter(String fotter) { + fotter = fotter == null ? "" : fotter; + SDK.getAppAPI().setProperty(APPID, "fotter", fotter); + } - public static final String RELATION_SEARCH_ID = "com.actionsoft.apps.coe.pal.relationsearch"; - public static final String RELATION_SEARCH_NAME = "关联查询"; + /** + * 门户标题 + * + * @return + */ + public static String getTitle() { + String value = SDK.getAppAPI().getProperty(APPID, "title"); + if (UtilString.isEmpty(value)) { + value = "CoE Process Portal"; + } + return value; + } + + public static void setTitle(String title) { + title = title == null ? "" : title; + SDK.getAppAPI().setProperty(APPID, "title", title); + } - public static final String PORTAL_TREE_ICON_FOLDER = "../apps/com.actionsoft.apps.coe.pal.publisher/img/tree-folder.png"; - public static final String PORTAL_TREE_ICON_FOLDER1 = "../apps/com.actionsoft.apps.coe.pal.publisher/img/tree-folder1.png"; + /** + * 流程发布流程版本Id + * + * @return + */ + public static String getPublishProcessId() { + String value = SDK.getAppAPI().getProperty(APPID, "publishProcessId"); + return value; + } - public static String PUBLISH_PORTAL_VERSION = "v1"; + /** + * 发布门户的浏览者是否整合AWS用户 + * + * @return 整合返回true + */ + public static boolean isIntegrationAWSUser() { + String value = SDK.getAppAPI().getProperty(APPID, "isIntegrationAWSUser"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } - public static String XPAGES_ID = ""; + /** + * 如果门户未整合AWS用户,此处配置来自外部系统访问门户的统一访客账户。该账户是AWS平台合法的账户 + * + * @return + */ + public static String getGuest() { + String value = SDK.getAppAPI().getProperty(APPID, "guest"); + return value; + } - public static JSONArray PORTAL_TABS = null; + /** + * 发布门户的内容允许复制 + * + * @return 允许返回true + */ + public static boolean isCopy() { + String value = SDK.getAppAPI().getProperty(APPID, "isCopy"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } + + public static void setCopy(String isCopy) { + if (isCopy != null && isCopy.trim().equalsIgnoreCase("true")) { + isCopy = "true"; + } else { + isCopy = "false"; + } + SDK.getAppAPI().setProperty(APPID, "isCopy", isCopy); + } - /** - * 页底信息,如客户流程管理部联系信息 - * - * @return - */ - public static String getFotter() { - String value = SDK.getAppAPI().getProperty(APPID, "fotter"); - if (UtilString.isEmpty(value)) { - value = "炎黄盈动"; - } - return value; - } + /** + * 发布门户的内容允许打印 + * + * @return 允许返回true + */ + public static boolean isPrint() { + String value = SDK.getAppAPI().getProperty(APPID, "isPrint"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } + + public static void setPrint(String isPrint) { + if (isPrint != null && isPrint.trim().equalsIgnoreCase("true")) { + isPrint = "true"; + } else { + isPrint = "false"; + } + SDK.getAppAPI().setProperty(APPID, "isPrint", isPrint); + } - public static void setFotter(String fotter) { - fotter = fotter == null ? "" : fotter; - SDK.getAppAPI().setProperty(APPID, "fotter", fotter); - } + /** + * 发布门户的内容允许留言 + * + * @return 允许返回true + */ + public static boolean isComment() { + String value = SDK.getAppAPI().getProperty(APPID, "isComment"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } + + public static void setComment(String isComment) { + if (isComment != null && isComment.trim().equalsIgnoreCase("true")) { + isComment = "true"; + } else { + isComment = "false"; + } + SDK.getAppAPI().setProperty(APPID, "isComment", isComment); + } - /** - * 门户标题 - * - * @return - */ - public static String getTitle() { - String value = SDK.getAppAPI().getProperty(APPID, "title"); - if (UtilString.isEmpty(value)) { - value = "CoE Process Portal"; - } - return value; - } + /** + * 发布门户的内容允许查看属性 + * + * @return 允许返回true + */ + public static boolean isViewAttribute() { + String value = SDK.getAppAPI().getProperty(APPID, "isViewAttribute"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } + + public static void setViewAttribute(String isViewAttribute) { + if (isViewAttribute != null && isViewAttribute.trim().equalsIgnoreCase("true")) { + isViewAttribute = "true"; + } else { + isViewAttribute = "false"; + } + SDK.getAppAPI().setProperty(APPID, "isViewAttribute", isViewAttribute); + } - public static void setTitle(String title) { - title = title == null ? "" : title; - SDK.getAppAPI().setProperty(APPID, "title", title); - } - - /** - * 流程发布流程版本Id - * - * @return - */ - public static String getPublishProcessId() { - String value = SDK.getAppAPI().getProperty(APPID, "publishProcessId"); - return value; - } - - /** - * 发布门户的浏览者是否整合AWS用户 - * - * @return 整合返回true - */ - public static boolean isIntegrationAWSUser() { - String value = SDK.getAppAPI().getProperty(APPID, "isIntegrationAWSUser"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - /** - * 如果门户未整合AWS用户,此处配置来自外部系统访问门户的统一访客账户。该账户是AWS平台合法的账户 - * - * @return - */ - public static String getGuest() { - String value = SDK.getAppAPI().getProperty(APPID, "guest"); - return value; - } - - /** - * 发布门户的内容允许复制 - * - * @return 允许返回true - */ - public static boolean isCopy() { - String value = SDK.getAppAPI().getProperty(APPID, "isCopy"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - public static void setCopy(String isCopy) { - if (isCopy != null && isCopy.trim().equalsIgnoreCase("true")) { - isCopy = "true"; - } else { - isCopy = "false"; - } - SDK.getAppAPI().setProperty(APPID, "isCopy", isCopy); - } - - /** - * 发布门户的内容允许打印 - * - * @return 允许返回true - */ - public static boolean isPrint() { - String value = SDK.getAppAPI().getProperty(APPID, "isPrint"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - public static void setPrint(String isPrint) { - if (isPrint != null && isPrint.trim().equalsIgnoreCase("true")) { - isPrint = "true"; - } else { - isPrint = "false"; - } - SDK.getAppAPI().setProperty(APPID, "isPrint", isPrint); - } - - /** - * 发布门户的内容允许留言 - * - * @return 允许返回true - */ - public static boolean isComment() { - String value = SDK.getAppAPI().getProperty(APPID, "isComment"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - public static void setComment(String isComment) { - if (isComment != null && isComment.trim().equalsIgnoreCase("true")) { - isComment = "true"; - } else { - isComment = "false"; - } - SDK.getAppAPI().setProperty(APPID, "isComment", isComment); - } - - /** - * 发布门户的内容允许查看属性 - * - * @return 允许返回true - */ - public static boolean isViewAttribute() { - String value = SDK.getAppAPI().getProperty(APPID, "isViewAttribute"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - public static void setViewAttribute(String isViewAttribute) { - if (isViewAttribute != null && isViewAttribute.trim().equalsIgnoreCase("true")) { - isViewAttribute = "true"; - } else { - isViewAttribute = "false"; - } - SDK.getAppAPI().setProperty(APPID, "isViewAttribute", isViewAttribute); - } - - /** - * 发布门户的内容允许查看历史发布记录 - * - * @return 允许返回true - */ - public static boolean isViewHistory() { - String value = SDK.getAppAPI().getProperty(APPID, "isViewHistory"); - return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; - } - - public static void setViewHistory(String isViewHistory) { - if (isViewHistory != null && isViewHistory.trim().equalsIgnoreCase("true")) { - isViewHistory = "true"; - } else { - isViewHistory = "false"; - } - SDK.getAppAPI().setProperty(APPID, "isViewHistory", isViewHistory); - } - - /** - * 流程管理门户xpage - * @param type common:常用流程;frequency:高频流程;systemMap:系统地图;processMap:流程地图;notification:发布动态 - * @return - */ - public static String getXpagesContent(String type) { - StringBuffer content = new StringBuffer(); - switch (type) { - case "common": - content.append(""); - break; - case "frequency": - content.append(""); - break; - case "systemMap": - content.append(""); - break; - case "dataMap": - content.append(""); - break; - case "controlMap": - content.append(""); - break; - case "orgMap": - content.append(""); - break; - case "processMap": - content.append(""); - break; - case "notification": - content.append(""); - break; - case "banner":// 横幅轮播图 - content.append(""); - break; - case "participant":// 我参与的 - content.append(""); - break; - case "responsible":// 我负责的 - content.append(""); - break; - case "postresponsibility":// 岗位职责 - content.append(""); - break; - case "rcaimatrix":// rcai矩阵 - content.append(""); - break; - default: - break; - } - return content.toString(); - } + /** + * 发布门户的内容允许查看历史发布记录 + * + * @return 允许返回true + */ + public static boolean isViewHistory() { + String value = SDK.getAppAPI().getProperty(APPID, "isViewHistory"); + return (value != null && value.trim().equalsIgnoreCase("true")) ? true : false; + } + + public static void setViewHistory(String isViewHistory) { + if (isViewHistory != null && isViewHistory.trim().equalsIgnoreCase("true")) { + isViewHistory = "true"; + } else { + isViewHistory = "false"; + } + SDK.getAppAPI().setProperty(APPID, "isViewHistory", isViewHistory); + } + + /** + * 流程管理门户xpage + * @param type common:常用流程;frequency:高频流程;systemMap:系统地图;processMap:流程地图;notification:发布动态 + * @return + */ + public static String getXpagesContent(String type) { + StringBuffer content = new StringBuffer(); + switch (type) { + case "common": + content.append(""); + break; + case "frequency": + content.append(""); + break; + case "systemMap": + content.append(""); + break; + case "dataMap": + content.append(""); + break; + case "controlMap": + content.append(""); + break; + case "orgMap": + content.append(""); + break; + case "processMap": + content.append(""); + break; + case "notification": + content.append(""); + break; + case "banner":// 横幅轮播图 + content.append(""); + break; + case "participant":// 我参与的 + content.append(""); + break; + case "responsible":// 我负责的 + content.append(""); + break; + case "postresponsibility":// 岗位职责 + content.append(""); + break; + case "rcaimatrix":// rcai矩阵 + content.append(""); + break; + default: + break; + } + return content.toString(); + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppInstallListener.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppInstallListener.java index 2e3ccce6..e7ea1cb9 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppInstallListener.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppInstallListener.java @@ -17,51 +17,51 @@ import com.actionsoft.sdk.local.api.AppAPI; public class AppInstallListener implements AppListener { - @SuppressWarnings("resource") - @Override - public void after(AppContext app) { - // 流程管理门户xpages文件同步到xpages应用中 - try { - String path = AppsConst.APPS_ROOT + AppsConst.FOLDER_INSTALL + File.separator + app.getId() + File.separator + "xpages" + File.separator; - File fileDir = new File(path); - if (fileDir.exists()) { - File [] files = fileDir.listFiles(); - for (File file : files) { - InputStream input = null; - ByteArrayOutputStream arrayOutputStream = null; - input = new FileInputStream(file); - arrayOutputStream = new ByteArrayOutputStream(); - byte [] buf = new byte[1024]; - int len = 0; - while ((len = input.read(buf)) != -1) { - arrayOutputStream.write(buf, 0, len); - } - byte [] bytedata = arrayOutputStream.toByteArray(); - String content = new String(Base64.encode(bytedata)); - // 调用App - String sourceAppId = app.getId(); - // aslp服务地址 - String aslp = "aslp://com.actionsoft.apps.addons.xpages/createTemplateByContent"; - // 参数定义列表 - Map params = new HashMap<>(); - //内容,必填 - params.put("content", content); - //0,覆盖 1不覆盖,非必填 - params.put("overWriteFlag", "0"); - AppAPI appAPI = SDK.getAppAPI(); - //根据一个xpages文件的内容创建一个xpages模板记录 - appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); - } - } - } catch (Exception e) { - e.printStackTrace(); - throw new AWSException("流程管理门户xpages文件解析错误"); - } - } + @SuppressWarnings("resource") + @Override + public void after(AppContext app) { + // 流程管理门户xpages文件同步到xpages应用中 + try { + String path = AppsConst.APPS_ROOT + AppsConst.FOLDER_INSTALL + File.separator + app.getId() + File.separator + "xpages" + File.separator; + File fileDir = new File(path); + if (fileDir.exists()) { + File [] files = fileDir.listFiles(); + for (File file : files) { + InputStream input = null; + ByteArrayOutputStream arrayOutputStream = null; + input = new FileInputStream(file); + arrayOutputStream = new ByteArrayOutputStream(); + byte [] buf = new byte[1024]; + int len = 0; + while ((len = input.read(buf)) != -1) { + arrayOutputStream.write(buf, 0, len); + } + byte [] bytedata = arrayOutputStream.toByteArray(); + String content = new String(Base64.encode(bytedata)); + // 调用App + String sourceAppId = app.getId(); + // aslp服务地址 + String aslp = "aslp://com.actionsoft.apps.addons.xpages/createTemplateByContent"; + // 参数定义列表 + Map params = new HashMap<>(); + //内容,必填 + params.put("content", content); + //0,覆盖 1不覆盖,非必填 + params.put("overWriteFlag", "0"); + AppAPI appAPI = SDK.getAppAPI(); + //根据一个xpages文件的内容创建一个xpages模板记录 + appAPI.callASLP(appAPI.getAppContext(sourceAppId), aslp, params); + } + } + } catch (Exception e) { + e.printStackTrace(); + throw new AWSException("流程管理门户xpages文件解析错误"); + } + } - @Override - public boolean before(AppContext arg0) { - return true; - } + @Override + public boolean before(AppContext arg0) { + return true; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppStartListener.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppStartListener.java index 8a1298d6..3cd15cf0 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppStartListener.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/AppStartListener.java @@ -10,35 +10,35 @@ import com.alibaba.fastjson.JSONArray; public class AppStartListener implements AppListener{ - @Override - public void after(AppContext arg0) { - // 初始化门户版本 - String value = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalVersion"); - PublisherConf.PUBLISH_PORTAL_VERSION = value; - if (value.equals("v3")) { - // 初始化门户配置 - String xpagesId = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalTemplateId_xpages"); - if ("".equals(xpagesId.trim())) { - throw new AWSException("PAL门户默认xpages模版配置参数不允许为空"); - } - PublisherConf.XPAGES_ID = xpagesId; - String portalTabs = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalTabs"); - if (!"".equals(portalTabs.trim())) { - try { - JSONArray array = JSON.parseArray(portalTabs.trim()); - PublisherConf.PORTAL_TABS = array; - } catch (Exception e) { - throw new AWSException("PAL门户Tab标签配置参数解析出错,请检查参数格式是否正确"); - } - } else { - PublisherConf.PORTAL_TABS = new JSONArray(); - } - } - } + @Override + public void after(AppContext arg0) { + // 初始化门户版本 + String value = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalVersion"); + PublisherConf.PUBLISH_PORTAL_VERSION = value; + if (value.equals("v3")) { + // 初始化门户配置 + String xpagesId = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalTemplateId_xpages"); + if ("".equals(xpagesId.trim())) { + throw new AWSException("PAL门户默认xpages模版配置参数不允许为空"); + } + PublisherConf.XPAGES_ID = xpagesId; + String portalTabs = SDK.getAppAPI().getProperty(PublisherConf.APPID, "portalTabs"); + if (!"".equals(portalTabs.trim())) { + try { + JSONArray array = JSON.parseArray(portalTabs.trim()); + PublisherConf.PORTAL_TABS = array; + } catch (Exception e) { + throw new AWSException("PAL门户Tab标签配置参数解析出错,请检查参数格式是否正确"); + } + } else { + PublisherConf.PORTAL_TABS = new JSONArray(); + } + } + } - @Override - public boolean before(AppContext arg0) { - return true; - } + @Override + public boolean before(AppContext arg0) { + return true; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishInstanceAfterReactivateLIstener.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishInstanceAfterReactivateLIstener.java index cfd68976..fc3e34dc 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishInstanceAfterReactivateLIstener.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/PublishInstanceAfterReactivateLIstener.java @@ -23,222 +23,222 @@ import com.actionsoft.bpms.util.DBSql; import com.actionsoft.sdk.local.SDK; public class PublishInstanceAfterReactivateLIstener extends ExecuteListener{ + + @Override + public String getDescription() { + return "流程复活后进行相关数据还原处理"; + } - @Override - public String getDescription() { - return "流程复活后进行相关数据还原处理"; - } + @Override + public String getProvider() { + return "aws-coe"; + } - @Override - public String getProvider() { - return "aws-coe"; - } + @Override + public String getVersion() { + return "V6.3"; + } + + @Override + public void execute(ProcessExecutionContext ctx) throws Exception { + String processInstId = ctx.getProcessInstance().getId(); + ProcessInstance processInstance = ctx.getProcessInstance(); + SDK.getLogAPI().consoleInfo("-----------执行流程复活后事件-------------"); + SDK.getLogAPI().consoleInfo("流程实例标题:" + processInstance.getTitle() + "[processInstId=" + processInstId + "]"); + // 获取相关的流程数据 + + List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list(); + List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list(); + List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list(); + List pList = new ArrayList<>(); + if (bolistN != null) { + for (BO boN : bolistN) { + String publishFileId = boN.get("PUBLISHFILEID").toString(); + PALRepositoryModel palModel = PALRepositoryCache.getCache().get(publishFileId); + if (palModel != null && palModel.isPublish()) {// 若当前为非已发布状态,则不进行处理 + // 若当前流程model.getPalRepositoryId()除此次发布以外存在发布过、变更过、废止过,则退回至停用状态,否则退回至设计状态 + // List allPublishData = listDao.query("PALREPOSITORYID = ?", publishFileId).list(); + List allPublishData = DBSql.getMaps("SELECT ID FROM SYS_COE_PAL_PUBLISH_LIST WHERE PALREPOSITORYID = ?", new Object[] {publishFileId}); + if (allPublishData != null) { + boolean isPublish = false; + boolean isStop = false; + boolean isApproval = false; + if (allPublishData.size() > 1) { + // 退回至停用状态 + isStop = true; + } else { + // 退回至设计状态 + } + createResultMap(palModel.getName(), palModel.getId(), isPublish, isStop, isApproval, pList); + } + } - @Override - public String getVersion() { - return "V6.3"; - } + } + } + if (bolistC != null) { + for (BO boC : bolistC) { + String changefileId = boC.get("CHANGEFILEID").toString();// 变更文件id + String changedFileIdNew = boC.get("CHANGEDFILEIDNEW").toString();// 变更后文件id + PALRepositoryModel changeModel = PALRepositoryCache.getCache().get(changefileId); + PALRepositoryModel changeNewModel = PALRepositoryCache.getCache().get(changedFileIdNew); + // 符合该条件可进行复活,状态值不符合则暂时不处理 + if (changeModel != null && changeNewModel != null && changeModel.isStop() && changeNewModel.isPublish()) { + // changeModel退回至已发布状态 + boolean isPublish = true; + boolean isStop = false; + boolean isApproval = false; + createResultMap(changeModel.getName(), changefileId, isPublish, isStop, isApproval, pList); + // List allchangeData = listDao.query("PALREPOSITORYID = ?", changedFileIdNew).list(); + List allchangeData = DBSql.getMaps("SELECT ID FROM SYS_COE_PAL_PUBLISH_LIST WHERE PALREPOSITORYID = ?", new Object[] {changedFileIdNew}); + if (allchangeData != null) { + isPublish = false; + isStop = false; + isApproval = false; + if (allchangeData.size() > 1) { + // changeNewModel退回至停用状态 + isStop = true; + } else { + // changeNewModel退回至设计状态 + } + createResultMap(changeNewModel.getName(), changedFileIdNew, isPublish, isStop, isApproval, pList); + + } + } + } + } + + if (bolistS != null) { + for (BO boS : bolistS) { + String stopFileId = boS.get("STOPFILEID").toString(); + PALRepositoryModel stopModel = PALRepositoryCache.getCache().get(stopFileId); + // 已停用且该流程版本下所有流程没有在发布状态的进行退回,保证退回之后该流程所有版本中只有一条为已发布状态 + if (stopModel != null && stopModel.isStop()) { + List stopList = PALRepositoryCache.getByVersionId(stopModel.getVersionId()); + boolean flag = false; + for (PALRepositoryModel model : stopList) { + if (model.isPublish()) { + flag = true; + break; + } + } + if (!flag) { + // 退回至已发布状态 + boolean isPublish = true; + boolean isStop = false; + boolean isApproval = false; + createResultMap(stopModel.getName(), stopFileId, isPublish, isStop, isApproval, pList); + } + } + } + } + if (pList.size() > 0) { + restoreData(pList, processInstId); + + } + } - @Override - public void execute(ProcessExecutionContext ctx) throws Exception { - String processInstId = ctx.getProcessInstance().getId(); - ProcessInstance processInstance = ctx.getProcessInstance(); - SDK.getLogAPI().consoleInfo("-----------执行流程复活后事件-------------"); - SDK.getLogAPI().consoleInfo("流程实例标题:" + processInstance.getTitle() + "[processInstId=" + processInstId + "]"); - // 获取相关的流程数据 + /** + * 还原数据 + * @param pList + * @param processInstId + */ + private void restoreData(List pList, String processInstId) { + // 批量处理回退数据 + boolean flag = batchHandleRepositoryData(pList); + int r = 0; + if (flag) { + // 删除SYS_COE_PAL_PUBLISH和SYS_COE_PAL_PUBLISH_LIST表数据 + PublishHistory dao = new PublishHistory();// 发布结果主表 + PublishHistoryModel history = dao.queryBy("PROCESSINSTID = ?", processInstId); + if (history != null) { + r = dao.delete(history.getId()); + } + SDK.getLogAPI().consoleInfo("流程状态还原,变更数据[" + pList.size() + "]条"); + for (PALRepositoryModel model : pList) { + SDK.getLogAPI().consoleInfo("流程名称:" + model.getName() + "[id=" + model.getId() + ",isPublish=" + model.isPublish() + ",isStop=" + model.isStop() + "]"); + } + if (r > 0) { + SDK.getLogAPI().consoleInfo("删除发布结果数据成功[processInstId=" + processInstId + "]"); + } + } + } + + /** + * 流程数据库状态还原 + * @param pList + * @return + */ + private boolean batchHandleRepositoryData(List pList) { + boolean completeSuccess = false; + Connection conn = DBSql.open(); + PreparedStatement ps = null; + java.sql.ResultSet rset = null; + Timestamp nowTime = new Timestamp(System.currentTimeMillis()); + try { + conn.setAutoCommit(false); + String sql = "UPDATE " + PALRepositoryModelImpl.DATABASE_ENTITY + " SET " + + PALRepositoryModelImpl.FIELD_PL_ISPUBLISH + " =?, " + + PALRepositoryModelImpl.FIELD_PL_ISSTOP + "= ?," + + PALRepositoryModelImpl.FIELD_PL_MODIFYDATE + " = ? WHERE " + + PALRepositoryModelImpl.FIELD_UUID + "=?"; + ps = conn.prepareStatement(sql); + for (int i = 0; i < pList.size(); i++) { + String id = pList.get(i).getId(); + int isPublish = pList.get(i).isPublish() ? 1 : 0; + int isStop = pList.get(i).isStop() ? 1 : 0; + ps.setInt(1, isPublish); + ps.setInt(2, isStop); + ps.setTimestamp(3, nowTime); + ps.setString(4, id); + ps.addBatch(); + } + int[] results = ps.executeBatch(); + for (int i = 0; i < results.length; i++) { + if ((results[i] >= 0) || (results[i] == PreparedStatement.SUCCESS_NO_INFO)) { + completeSuccess = true; + } + } + if (completeSuccess) { + conn.commit(); + PALRepository dao = new PALRepository(); + for (PALRepositoryModel model : pList) { + PALRepositoryModel model2 = dao.getInstance(model.getId()); + if (model2 != null) { + PALRepositoryCache.getCache().put(model2.getId(), model2); + } + } + } else { + conn.rollback(); + PALRepositoryCache.getCache().reload(); + } + } catch (SQLException e) { + try { + conn.rollback(); + } catch (SQLException e1) { + e1.printStackTrace(); + } + e.printStackTrace(); + } finally { + DBSql.close(conn, ps, rset); + } + return completeSuccess; + } - List bolistN = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_N).bindId(processInstId).list(); - List bolistC = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_C).bindId(processInstId).list(); - List bolistS = SDK.getBOAPI().query(PublisherConstant.BOSUBTABLE_S).bindId(processInstId).list(); - List pList = new ArrayList<>(); - if (bolistN != null) { - for (BO boN : bolistN) { - String publishFileId = boN.get("PUBLISHFILEID").toString(); - PALRepositoryModel palModel = PALRepositoryCache.getCache().get(publishFileId); - if (palModel != null && palModel.isPublish()) {// 若当前为非已发布状态,则不进行处理 - // 若当前流程model.getPalRepositoryId()除此次发布以外存在发布过、变更过、废止过,则退回至停用状态,否则退回至设计状态 - // List allPublishData = listDao.query("PALREPOSITORYID = ?", publishFileId).list(); - List allPublishData = DBSql.getMaps("SELECT ID FROM SYS_COE_PAL_PUBLISH_LIST WHERE PALREPOSITORYID = ?", new Object[] {publishFileId}); - if (allPublishData != null) { - boolean isPublish = false; - boolean isStop = false; - boolean isApproval = false; - if (allPublishData.size() > 1) { - // 退回至停用状态 - isStop = true; - } else { - // 退回至设计状态 - } - createResultMap(palModel.getName(), palModel.getId(), isPublish, isStop, isApproval, pList); - } - } - - } - } - if (bolistC != null) { - for (BO boC : bolistC) { - String changefileId = boC.get("CHANGEFILEID").toString();// 变更文件id - String changedFileIdNew = boC.get("CHANGEDFILEIDNEW").toString();// 变更后文件id - PALRepositoryModel changeModel = PALRepositoryCache.getCache().get(changefileId); - PALRepositoryModel changeNewModel = PALRepositoryCache.getCache().get(changedFileIdNew); - // 符合该条件可进行复活,状态值不符合则暂时不处理 - if (changeModel != null && changeNewModel != null && changeModel.isStop() && changeNewModel.isPublish()) { - // changeModel退回至已发布状态 - boolean isPublish = true; - boolean isStop = false; - boolean isApproval = false; - createResultMap(changeModel.getName(), changefileId, isPublish, isStop, isApproval, pList); - // List allchangeData = listDao.query("PALREPOSITORYID = ?", changedFileIdNew).list(); - List allchangeData = DBSql.getMaps("SELECT ID FROM SYS_COE_PAL_PUBLISH_LIST WHERE PALREPOSITORYID = ?", new Object[] {changedFileIdNew}); - if (allchangeData != null) { - isPublish = false; - isStop = false; - isApproval = false; - if (allchangeData.size() > 1) { - // changeNewModel退回至停用状态 - isStop = true; - } else { - // changeNewModel退回至设计状态 - } - createResultMap(changeNewModel.getName(), changedFileIdNew, isPublish, isStop, isApproval, pList); - - } - } - } - } - - if (bolistS != null) { - for (BO boS : bolistS) { - String stopFileId = boS.get("STOPFILEID").toString(); - PALRepositoryModel stopModel = PALRepositoryCache.getCache().get(stopFileId); - // 已停用且该流程版本下所有流程没有在发布状态的进行退回,保证退回之后该流程所有版本中只有一条为已发布状态 - if (stopModel != null && stopModel.isStop()) { - List stopList = PALRepositoryCache.getByVersionId(stopModel.getVersionId()); - boolean flag = false; - for (PALRepositoryModel model : stopList) { - if (model.isPublish()) { - flag = true; - break; - } - } - if (!flag) { - // 退回至已发布状态 - boolean isPublish = true; - boolean isStop = false; - boolean isApproval = false; - createResultMap(stopModel.getName(), stopFileId, isPublish, isStop, isApproval, pList); - } - } - } - } - if (pList.size() > 0) { - restoreData(pList, processInstId); - - } - } - - /** - * 还原数据 - * @param pList - * @param processInstId - */ - private void restoreData(List pList, String processInstId) { - // 批量处理回退数据 - boolean flag = batchHandleRepositoryData(pList); - int r = 0; - if (flag) { - // 删除SYS_COE_PAL_PUBLISH和SYS_COE_PAL_PUBLISH_LIST表数据 - PublishHistory dao = new PublishHistory();// 发布结果主表 - PublishHistoryModel history = dao.queryBy("PROCESSINSTID = ?", processInstId); - if (history != null) { - r = dao.delete(history.getId()); - } - SDK.getLogAPI().consoleInfo("流程状态还原,变更数据[" + pList.size() + "]条"); - for (PALRepositoryModel model : pList) { - SDK.getLogAPI().consoleInfo("流程名称:" + model.getName() + "[id=" + model.getId() + ",isPublish=" + model.isPublish() + ",isStop=" + model.isStop() + "]"); - } - if (r > 0) { - SDK.getLogAPI().consoleInfo("删除发布结果数据成功[processInstId=" + processInstId + "]"); - } - } - } - - /** - * 流程数据库状态还原 - * @param pList - * @return - */ - private boolean batchHandleRepositoryData(List pList) { - boolean completeSuccess = false; - Connection conn = DBSql.open(); - PreparedStatement ps = null; - java.sql.ResultSet rset = null; - Timestamp nowTime = new Timestamp(System.currentTimeMillis()); - try { - conn.setAutoCommit(false); - String sql = "UPDATE " + PALRepositoryModelImpl.DATABASE_ENTITY + " SET " - + PALRepositoryModelImpl.FIELD_PL_ISPUBLISH + " =?, " - + PALRepositoryModelImpl.FIELD_PL_ISSTOP + "= ?," - + PALRepositoryModelImpl.FIELD_PL_MODIFYDATE + " = ? WHERE " - + PALRepositoryModelImpl.FIELD_UUID + "=?"; - ps = conn.prepareStatement(sql); - for (int i = 0; i < pList.size(); i++) { - String id = pList.get(i).getId(); - int isPublish = pList.get(i).isPublish() ? 1 : 0; - int isStop = pList.get(i).isStop() ? 1 : 0; - ps.setInt(1, isPublish); - ps.setInt(2, isStop); - ps.setTimestamp(3, nowTime); - ps.setString(4, id); - ps.addBatch(); - } - int[] results = ps.executeBatch(); - for (int i = 0; i < results.length; i++) { - if ((results[i] >= 0) || (results[i] == PreparedStatement.SUCCESS_NO_INFO)) { - completeSuccess = true; - } - } - if (completeSuccess) { - conn.commit(); - PALRepository dao = new PALRepository(); - for (PALRepositoryModel model : pList) { - PALRepositoryModel model2 = dao.getInstance(model.getId()); - if (model2 != null) { - PALRepositoryCache.getCache().put(model2.getId(), model2); - } - } - } else { - conn.rollback(); - PALRepositoryCache.getCache().reload(); - } - } catch (SQLException e) { - try { - conn.rollback(); - } catch (SQLException e1) { - e1.printStackTrace(); - } - e.printStackTrace(); - } finally { - DBSql.close(conn, ps, rset); - } - return completeSuccess; - } - - /** - * 结果集,用于批量处理数据源 - * @param id - * @param isPublish - * @param isStop - * @param isApproval - */ - private void createResultMap(String name, String id, boolean isPublish, boolean isStop, boolean isApproval, List pList) { - PALRepositoryModelImpl modelImpl = new PALRepositoryModelImpl(); - modelImpl.setId(id); - modelImpl.setName(name); - modelImpl.setPublish(isPublish); - modelImpl.setStop(isStop); - // modelImpl.setApproval(isApproval);// 不处理 - pList.add(modelImpl); - } + /** + * 结果集,用于批量处理数据源 + * @param id + * @param isPublish + * @param isStop + * @param isApproval + */ + private void createResultMap(String name, String id, boolean isPublish, boolean isStop, boolean isApproval, List pList) { + PALRepositoryModelImpl modelImpl = new PALRepositoryModelImpl(); + modelImpl.setId(id); + modelImpl.setName(name); + modelImpl.setPublish(isPublish); + modelImpl.setStop(isStop); + // modelImpl.setApproval(isApproval);// 不处理 + pList.add(modelImpl); + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormGridFilterListener.java b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormGridFilterListener.java index c7d2a3a8..024945b7 100644 --- a/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormGridFilterListener.java +++ b/com.actionsoft.apps.coe.pal.publisher/src/com/actionsoft/apps/coe/pal/publisher/event/SubFormGridFilterListener.java @@ -12,60 +12,60 @@ import com.actionsoft.bpms.form.design.model.FormItemModel; public class SubFormGridFilterListener extends FormGridFilterListener { - @Override - public FormGridRowLookAndFeel acceptRowData(ProcessExecutionContext context, List boItemList, BO boData) { - String tableName = context.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BONAME); - if (tableName.equals("BO_ACT_COE_PUBLISH_N")) { - //创建一个对象 - FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); - String fileName = boData.getString("PUBLISHFILENAME"); - if (fileName != null) { - boData.set("PUBLISHFILENAME", "" + fileName + "");// 重新设定一个字段的值 - } + @Override + public FormGridRowLookAndFeel acceptRowData(ProcessExecutionContext context, List boItemList, BO boData) { + String tableName = context.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BONAME); + if (tableName.equals("BO_ACT_COE_PUBLISH_N")) { + //创建一个对象 + FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); + String fileName = boData.getString("PUBLISHFILENAME"); + if (fileName != null) { + boData.set("PUBLISHFILENAME", "" + fileName + "");// 重新设定一个字段的值 + } + + boData.set("字段子表字段名", "|"); - boData.set("字段子表字段名", "|"); + //处理好之后,将该对象返回 + return diyLookAndFeel; + } else if (tableName.equals("BO_ACT_COE_PUBLISH_C")) { + //创建一个对象 + FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); + String fileName1 = boData.getString("CHANGEFILENAME"); + if (fileName1 != null) { + boData.set("CHANGEFILENAME", "" + fileName1 + "");// 重新设定一个字段的值 + } + String fileName2 = boData.getString("CHANGEDFILENAMENEW"); + if (fileName2 != null) { + boData.set("CHANGEDFILENAMENEW", "" + fileName2 + "");// 重新设定一个字段的值 + } + + boData.set("字段子表字段名", "|"); - //处理好之后,将该对象返回 - return diyLookAndFeel; - } else if (tableName.equals("BO_ACT_COE_PUBLISH_C")) { - //创建一个对象 - FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); - String fileName1 = boData.getString("CHANGEFILENAME"); - if (fileName1 != null) { - boData.set("CHANGEFILENAME", "" + fileName1 + "");// 重新设定一个字段的值 - } - String fileName2 = boData.getString("CHANGEDFILENAMENEW"); - if (fileName2 != null) { - boData.set("CHANGEDFILENAMENEW", "" + fileName2 + "");// 重新设定一个字段的值 - } + //处理好之后,将该对象返回 + return diyLookAndFeel; + } else if (tableName.equals("BO_ACT_COE_PUBLISH_S")) { + //创建一个对象 + FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); + String fileName = boData.getString("STOPFILENAME"); + if (fileName != null) { + boData.set("STOPFILENAME", "" + fileName + "");// 重新设定一个字段的值 + } + boData.set("字段子表字段名", "|"); - boData.set("字段子表字段名", "|"); + //处理好之后,将该对象返回 + return diyLookAndFeel; + } + return null; + } - //处理好之后,将该对象返回 - return diyLookAndFeel; - } else if (tableName.equals("BO_ACT_COE_PUBLISH_S")) { - //创建一个对象 - FormGridRowLookAndFeel diyLookAndFeel = new FormGridRowLookAndFeel(); - String fileName = boData.getString("STOPFILENAME"); - if (fileName != null) { - boData.set("STOPFILENAME", "" + fileName + "");// 重新设定一个字段的值 - } - boData.set("字段子表字段名", "|"); + @Override + public String getCustomeTableHeaderHtml(ProcessExecutionContext arg0, FormItemModel arg1, List arg2) { + return null; + } - //处理好之后,将该对象返回 - return diyLookAndFeel; - } - return null; - } - - @Override - public String getCustomeTableHeaderHtml(ProcessExecutionContext arg0, FormItemModel arg1, List arg2) { - return null; - } - - @Override - public String orderByStatement(ProcessExecutionContext arg0) { - return null; - } + @Override + public String orderByStatement(ProcessExecutionContext arg0) { + return null; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.history.html b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.history.html index 6fad99e6..254f0b08 100644 --- a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.history.html +++ b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.history.html @@ -6,8 +6,8 @@ demo + var url = window.location.href; + var portalUrl = url.substring(0, url.indexOf('?')); diff --git a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.html b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.html index 69550502..048728c7 100644 --- a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.html +++ b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.html @@ -1,6 +1,6 @@ - + Publisher Home @@ -9,222 +9,222 @@ - - + + - + - - -
- -
-
- - - - -
- - - - - - - - - - - - -
序号 - - 标题来自日期
-
-
-
-
- - - - -
- - - - - - - - - - - -
序号标题来自日期
-
-
-
-
- - -
-
-
+ + +
+ +
+
+ + + + +
+ + + + + + + + + + + + +
序号 + + 标题来自日期
+
+
+
+
+ + + + +
+ + + + + + + + + + + +
序号标题来自日期
+
+
+
+
+ + +
+
+
+ + +
+
+ + + + + +
+
+ + + + + - -
-
- - - - - -
-
- - - - - + + + + $(function(){ + title = "<#title>"; + + $(".network_tabs").find("a[tit]").on("click", function(){ + var appId = $(this).attr("tit"); + $(this).siblings().removeClass("active"); + $(this).addClass("active"); + $("#content").find("div[tit]").hide(); + $("#content").find("div[tit='"+$(this).attr("tit")+"']").show(); + + if (appId == "todo") { + loadOutputData1(0, 10, initPage1); + } else if (appId == "done") { + loadOutputData2(0, 10, initPage2); + } else if (appId == "history") { + //loadOutputData3(0, 10, initPage3); + loadHistoryRecord(); + } + }); + + loadOutputData1(0, 10, initPage1); + + $("#select_all").check().on("ifChanged", function(){ + var isChecked = $(this).prop("checked"); + if (isChecked) { + $("#tbody1 .awsui-checkbox").check("option", "checked", true); + } else { + $("#tbody1 .awsui-checkbox").check("option", "checked", false); + } + }) + + $(window).trigger('resize'); + }) + + $(window).resize(function(){ + var totalWidth = $('#content').width() - 40; + $("[class*=width_]").each(function(){ + var className = $(this).attr("class"); + var percent = parseInt(className.substr(6, 2)); + $(this).css({"width" : totalWidth*percent/100}); + }); + }) + \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.newPage.html b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.newPage.html index b19aef7c..5d474a0f 100644 --- a/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.newPage.html +++ b/com.actionsoft.apps.coe.pal.publisher/template/page/publish.home.newPage.html @@ -1,6 +1,6 @@ com.actionsoft.apps.coe.pal.publisher
\ No newline at end of file + const axiosBaseUrl = "./"; + const production = true;
\ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js index f2649dc4..9c12492a 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.process.publish.radio.js @@ -10,29 +10,29 @@ var searchType; var varDutyDept = "责任部门"; var varDutyUser = "责任人"; $(document).ready(function(){ - // $('#alertMsg').css('background', '#fff'); - $('#OPTIONTYPE_0').closest('td').width('10%'); - $('#OPTIONTYPE_1').closest('td').width('10%'); - initParam(); - initHtml(); - initContentData(); - // listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉 + // $('#alertMsg').css('background', '#fff'); + $('#OPTIONTYPE_0').closest('td').width('10%'); + $('#OPTIONTYPE_1').closest('td').width('10%'); + initParam(); + initHtml(); + initContentData(); + // listenCloseEvent();// 关闭窗口执行,关闭窗口/刷新都会造成流程实例被删除,注释掉 }) var resizeWaiter = false; $(window).resize(function() { - if(!resizeWaiter){ + if(!resizeWaiter){ setTimeout(function(){ - resizeWaiter = true; - if (!$("#publisher_new_tr").is(':hidden')) { - initWidth(true, 'new'); - } - if (!$("#publisher_change_tr").is(':hidden')) { - initWidth(true, 'change'); - } - if (!$("#publisher_stop_tr").is(':hidden')) { - initWidth(true, 'stop'); - } + resizeWaiter = true; + if (!$("#publisher_new_tr").is(':hidden')) { + initWidth(true, 'new'); + } + if (!$("#publisher_change_tr").is(':hidden')) { + initWidth(true, 'change'); + } + if (!$("#publisher_stop_tr").is(':hidden')) { + initWidth(true, 'stop'); + } resizeWaiter = false; }, 500); } @@ -40,180 +40,180 @@ $(window).resize(function() { // 初始化自定义内容,不能写到html 文件中,表单会被平台自动调整的不成样子 function initHtml() { - var dialogHtml = ''; - dialogHtml += ''; - $('body').append(dialogHtml); - - $('#publisher_new_div').html('
'); - $('#publisher_change_div').html('
'); - $('#publisher_stop_div').html('
'); - - var newHtml = ''; - newHtml += ''; - newHtml += '
'; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += ''; - newHtml += '
'; - newHtml += '
'; - newHtml += ''; - newHtml += '
'; - newHtml += '
'; - newHtml += '
流程手册
'; - newHtml += '
'; - - var changeHtml = ''; - changeHtml += ''; - changeHtml += '
'; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += ''; - changeHtml += '
'; - changeHtml += '
'; - changeHtml += ''; - changeHtml += '
'; - changeHtml += '
'; - changeHtml += '' - changeHtml += '' - changeHtml += '
流程手册
'; - changeHtml += '
'; - - var stopHtml = ''; - stopHtml += ''; - stopHtml += '
'; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += ''; - stopHtml += '
'; - stopHtml += '
'; - stopHtml += ''; - stopHtml += '
'; - stopHtml += '
'; - stopHtml += '
流程手册
'; - stopHtml += '
'; - - $('#contentDiv1').append(newHtml); - $('#contentDiv2').append(changeHtml); - $('#contentDiv3').append(stopHtml); + var dialogHtml = ''; + dialogHtml += ''; + $('body').append(dialogHtml); + + $('#publisher_new_div').html('
'); + $('#publisher_change_div').html('
'); + $('#publisher_stop_div').html('
'); + + var newHtml = ''; + newHtml += ''; + newHtml += '
'; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += ''; + newHtml += '
'; + newHtml += '
'; + newHtml += ''; + newHtml += '
'; + newHtml += '
'; + newHtml += '
流程手册
'; + newHtml += '
'; + + var changeHtml = ''; + changeHtml += ''; + changeHtml += '
'; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += ''; + changeHtml += '
'; + changeHtml += '
'; + changeHtml += ''; + changeHtml += '
'; + changeHtml += '
'; + changeHtml += '' + changeHtml += '' + changeHtml += '
流程手册
'; + changeHtml += '
'; + + var stopHtml = ''; + stopHtml += ''; + stopHtml += '
'; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += ''; + stopHtml += '
'; + stopHtml += '
'; + stopHtml += ''; + stopHtml += '
'; + stopHtml += '
'; + stopHtml += '
流程手册
'; + stopHtml += '
'; + + $('#contentDiv1').append(newHtml); + $('#contentDiv2').append(changeHtml); + $('#contentDiv3').append(stopHtml); } // 初始化 function initParam() { - teamId = $("#TEAMID").val(); - sid = $("#sid").val(); - wsId = $("#WSID").val(); - processInstId = $("#processInstId").val(); + teamId = $("#TEAMID").val(); + sid = $("#sid").val(); + wsId = $("#WSID").val(); + processInstId = $("#processInstId").val(); } // 初始化内容数据 function initContentData() { - var param = { - cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query', - processInstId: processInstId, - wsId : wsId, - sid: sid + var param = { + cmd: 'com.actionsoft.apps.coe.pal.publisher_data_query', + processInstId: processInstId, + wsId : wsId, + sid: sid }; - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - data : param, - success : function(r) { - var isEnd = r.data.isEnd; - var proNumber = r.data.proNumber; - if (proNumber) { - editPerm = proNumber; - } - closeFormPage = r.data.closeFormPage; - var newData = r.data.newData; - var changeData = r.data.changeData; - var stopData = r.data.stopData; - var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png'; - var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png'; - if (!$.isEmptyObject(newData)) { - $('#OPTIONTYPE_0').prev('img').attr('src', checkImg); - $("#OPTIONTYPE_0").check("option","checked", true); - dealPublishCheck(true, 'new');// 显示 - // 更新数据 - initPublishData(newData, 'new', isEnd, proNumber); - } else { - $("#OPTIONTYPE_0").check("option","checked", false); - $('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg); - } - if (!$.isEmptyObject(changeData)) { - $('#OPTIONTYPE_1').prev('img').attr('src', checkImg); - $("#OPTIONTYPE_1").check("option","checked", true); - dealPublishCheck(true, 'change'); - initPublishData(changeData, 'change', isEnd, proNumber); - } else { - $("#OPTIONTYPE_1").check("option","checked", false); - $('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg); - } - if (!$.isEmptyObject(stopData)) { - $('#OPTIONTYPE_2').prev('img').attr('src', checkImg); - $("#OPTIONTYPE_2").check("option","checked", true); - dealPublishCheck(true, 'stop'); - initPublishData(stopData, 'stop', isEnd, proNumber); - } else { - $("#OPTIONTYPE_2").check("option","checked", false); - $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg); - } - } - - }); + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + success : function(r) { + var isEnd = r.data.isEnd; + var proNumber = r.data.proNumber; + if (proNumber) { + editPerm = proNumber; + } + closeFormPage = r.data.closeFormPage; + var newData = r.data.newData; + var changeData = r.data.changeData; + var stopData = r.data.stopData; + var checkImg = '../apps/_bpm.portal/img/icheck_checkbox_check.png'; + var uncheckImg = '../apps/_bpm.portal/img/icheck_checkbox_uncheck.png'; + if (!$.isEmptyObject(newData)) { + $('#OPTIONTYPE_0').prev('img').attr('src', checkImg); + $("#OPTIONTYPE_0").check("option","checked", true); + dealPublishCheck(true, 'new');// 显示 + // 更新数据 + initPublishData(newData, 'new', isEnd, proNumber); + } else { + $("#OPTIONTYPE_0").check("option","checked", false); + $('#OPTIONTYPE_0').prev('img').attr('src', uncheckImg); + } + if (!$.isEmptyObject(changeData)) { + $('#OPTIONTYPE_1').prev('img').attr('src', checkImg); + $("#OPTIONTYPE_1").check("option","checked", true); + dealPublishCheck(true, 'change'); + initPublishData(changeData, 'change', isEnd, proNumber); + } else { + $("#OPTIONTYPE_1").check("option","checked", false); + $('#OPTIONTYPE_1').prev('img').attr('src', uncheckImg); + } + if (!$.isEmptyObject(stopData)) { + $('#OPTIONTYPE_2').prev('img').attr('src', checkImg); + $("#OPTIONTYPE_2").check("option","checked", true); + dealPublishCheck(true, 'stop'); + initPublishData(stopData, 'stop', isEnd, proNumber); + } else { + $("#OPTIONTYPE_2").check("option","checked", false); + $('#OPTIONTYPE_2').prev('img').attr('src', uncheckImg); + } + } + + }); } var changeData; @@ -227,795 +227,795 @@ var changeOption; * @returns */ function initPublishData(data, type, isEnd, proNumber) { - if (type == 'new') { - var fileName = data.publishFileName + ' V' + data.fileVersion + '.0'; - var aHtml = '' + fileName + ''; - $('#publisher_new_file_name').children('span.file_name').html(aHtml); - $('#publisher_new_file_id').val(data.publishFileId); - if (data.taskId != undefined && data.taskId != '') { - var reportName = fileName + "-流程手册"; - var reportHtml = '' + reportName + ''; - $('#publisher_new_report_name').html(reportHtml); - } else { - $('#publisher_new_report_name').html('无流程手册'); - } - $('#publisher_new_report_id').text(data.taskId); - $('#publisher_new_desc').val(data.publishDesc); - if (!proNumber) { - $('#publisher_new').find('input').attr("disabled", true); - $('#publisher_new').find('textarea').attr("disabled", true); - $('#publish_new_file_query').prop('onclick', ""); - } - } - if (type == 'change') { - changeData = data; - // 变更文件处理 - var sourceFileName = data.changeFileName + ' V' + data.fileVersion + '.0'; - $('#publisher_change_source_file_name').children('span.file_name').html(sourceFileName); - $('#publisher_change_source_file_id').val(data.changeFileId); - - // 变更目标文件处理 - var targetFileName = ""; - if (data.changedFileNameNew != undefined && data.changedFileNameNew != '') { - targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion + '.0'; - } - var targetId = ""; - if (data.changedFileIdNew != undefined && data.changedFileIdNew != '') { - targetId = data.changedFileIdNew; - } - $('#publisher_change_target_file_id').val(targetId); - var taskId = ""; - if (data.taskId != undefined && data.taskId != '') { - taskId = data.taskId; - var reportName = targetFileName + "-流程手册"; - var reportHtml = '' + reportName + ''; - $('#publisher_change_report_name').html(reportHtml); - } else { - $('#publisher_change_report_name').html('无流程手册'); - } - $('#publisher_change_report_id').text(data.taskId); - - // 下选框处理 - if (!proNumber) { - var tempHtml = '' + targetFileName + ''; - $('#select').html(tempHtml); - } else { - $('#select').html(''); - if (data.targetFiles.length > 0) { - var opt1 = { - data : [] - }; - var flag = false; - for (var i = 0; i < data.targetFiles.length; i++) { - var temp = data.targetFiles[i]; - var name = temp.text + ' V' + temp.version + '.0'; - var obj = {id:temp.id, text:name}; - opt1.data.push(obj); - if (targetId == temp.id) { - flag = true; - } - } - changeOption = opt1; - $("#publisher_change_target_file").select2(opt1); - if (flag) { - $("#publisher_change_target_file").val(targetId).trigger("change"); - } else { - // 没有选择的版本时默认第一个为选中,取当前选择的生成流程手册 - initChangedData(changeData, changeOption); - } - // select改变事件 - $('#publisher_change_target_file').on("change", function (e) { - initChangedData(changeData, changeOption);// 初始化变更文件 - }); - } else { - // 无数据,定义为空的select2 - var opt1 = {data : []}; - $("#publisher_change_target_file").select2(opt1); - $('#publisher_change_source_file_id').val(''); - } - $('.select2').width('100%'); - } - // 描述处理 - $('#publisher_change_desc').val(data.changedDesc); - if (!proNumber) { - $('#publisher_change').find('input').attr("disabled", true); - $('#publisher_change').find('textarea').attr("disabled", true); - $('#publish_change_file_query').prop('onclick', ""); - } - } - if (type == 'stop') { - var fileName = data.stopFileName + ' V' + data.fileVersion + '.0'; - var aHtml = '' + fileName + ''; - $('#publisher_stop_file_name').children('span.file_name').html(aHtml); - $('#publisher_stop_file_id').val(data.stopFileId); - if (data.taskId != undefined && data.taskId != '') { - var reportName = fileName + "-流程手册"; - var reportHtml = '' + reportName + ''; - $('#publisher_stop_report_name').html(reportHtml); - } else { - $('#publisher_stop_report_name').html('无流程手册'); - } - $('#publisher_stop_report_id').text(data.taskId); - $('#publisher_stop_desc').val(data.stopDesc); - if (!proNumber) { - $('#publisher_stop').find('input').attr("disabled", true); - $('#publisher_stop').find('textarea').attr("disabled", true); - $('#publish_stop_file_query').prop('onclick', ""); - } - } + if (type == 'new') { + var fileName = data.publishFileName + ' V' + data.fileVersion + '.0'; + var aHtml = '' + fileName + ''; + $('#publisher_new_file_name').children('span.file_name').html(aHtml); + $('#publisher_new_file_id').val(data.publishFileId); + if (data.taskId != undefined && data.taskId != '') { + var reportName = fileName + "-流程手册"; + var reportHtml = '' + reportName + ''; + $('#publisher_new_report_name').html(reportHtml); + } else { + $('#publisher_new_report_name').html('无流程手册'); + } + $('#publisher_new_report_id').text(data.taskId); + $('#publisher_new_desc').val(data.publishDesc); + if (!proNumber) { + $('#publisher_new').find('input').attr("disabled", true); + $('#publisher_new').find('textarea').attr("disabled", true); + $('#publish_new_file_query').prop('onclick', ""); + } + } + if (type == 'change') { + changeData = data; + // 变更文件处理 + var sourceFileName = data.changeFileName + ' V' + data.fileVersion + '.0'; + $('#publisher_change_source_file_name').children('span.file_name').html(sourceFileName); + $('#publisher_change_source_file_id').val(data.changeFileId); + + // 变更目标文件处理 + var targetFileName = ""; + if (data.changedFileNameNew != undefined && data.changedFileNameNew != '') { + targetFileName = data.changedFileNameNew + ' V' + data.targetFileVersion + '.0'; + } + var targetId = ""; + if (data.changedFileIdNew != undefined && data.changedFileIdNew != '') { + targetId = data.changedFileIdNew; + } + $('#publisher_change_target_file_id').val(targetId); + var taskId = ""; + if (data.taskId != undefined && data.taskId != '') { + taskId = data.taskId; + var reportName = targetFileName + "-流程手册"; + var reportHtml = '' + reportName + ''; + $('#publisher_change_report_name').html(reportHtml); + } else { + $('#publisher_change_report_name').html('无流程手册'); + } + $('#publisher_change_report_id').text(data.taskId); + + // 下选框处理 + if (!proNumber) { + var tempHtml = '' + targetFileName + ''; + $('#select').html(tempHtml); + } else { + $('#select').html(''); + if (data.targetFiles.length > 0) { + var opt1 = { + data : [] + }; + var flag = false; + for (var i = 0; i < data.targetFiles.length; i++) { + var temp = data.targetFiles[i]; + var name = temp.text + ' V' + temp.version + '.0'; + var obj = {id:temp.id, text:name}; + opt1.data.push(obj); + if (targetId == temp.id) { + flag = true; + } + } + changeOption = opt1; + $("#publisher_change_target_file").select2(opt1); + if (flag) { + $("#publisher_change_target_file").val(targetId).trigger("change"); + } else { + // 没有选择的版本时默认第一个为选中,取当前选择的生成流程手册 + initChangedData(changeData, changeOption); + } + // select改变事件 + $('#publisher_change_target_file').on("change", function (e) { + initChangedData(changeData, changeOption);// 初始化变更文件 + }); + } else { + // 无数据,定义为空的select2 + var opt1 = {data : []}; + $("#publisher_change_target_file").select2(opt1); + $('#publisher_change_source_file_id').val(''); + } + $('.select2').width('100%'); + } + // 描述处理 + $('#publisher_change_desc').val(data.changedDesc); + if (!proNumber) { + $('#publisher_change').find('input').attr("disabled", true); + $('#publisher_change').find('textarea').attr("disabled", true); + $('#publish_change_file_query').prop('onclick', ""); + } + } + if (type == 'stop') { + var fileName = data.stopFileName + ' V' + data.fileVersion + '.0'; + var aHtml = '' + fileName + ''; + $('#publisher_stop_file_name').children('span.file_name').html(aHtml); + $('#publisher_stop_file_id').val(data.stopFileId); + if (data.taskId != undefined && data.taskId != '') { + var reportName = fileName + "-流程手册"; + var reportHtml = '' + reportName + ''; + $('#publisher_stop_report_name').html(reportHtml); + } else { + $('#publisher_stop_report_name').html('无流程手册'); + } + $('#publisher_stop_report_id').text(data.taskId); + $('#publisher_stop_desc').val(data.stopDesc); + if (!proNumber) { + $('#publisher_stop').find('input').attr("disabled", true); + $('#publisher_stop').find('textarea').attr("disabled", true); + $('#publish_stop_file_query').prop('onclick', ""); + } + } } // select2改变事件 function initChangedData(data, opt1) { - var selectedId = $("#publisher_change_target_file").val(); - $('#publisher_change_target_file_id').val(selectedId); - var selectedTaskId = ""; - selectedTaskId = createReport(data.category, data.methodId, selectedId, selectedTaskId); - if (selectedTaskId != '') { - var targetFileName2 = ""; - for(var i = 0; i < opt1.data.length; i++) { - if (opt1.data[i].id == selectedId) { - targetFileName2 = opt1.data[i].text; - break; - } - } - var reportName2 = targetFileName2 + "-流程手册"; - var reportHtml2 = '' + reportName2 + ''; - $('#publisher_change_report_name').html(reportHtml2); - } else { - $('#publisher_change_report_name').html('无流程手册'); - } - $('#publisher_change_report_id').text(selectedTaskId); - + var selectedId = $("#publisher_change_target_file").val(); + $('#publisher_change_target_file_id').val(selectedId); + var selectedTaskId = ""; + selectedTaskId = createReport(data.category, data.methodId, selectedId, selectedTaskId); + if (selectedTaskId != '') { + var targetFileName2 = ""; + for(var i = 0; i < opt1.data.length; i++) { + if (opt1.data[i].id == selectedId) { + targetFileName2 = opt1.data[i].text; + break; + } + } + var reportName2 = targetFileName2 + "-流程手册"; + var reportHtml2 = '' + reportName2 + ''; + $('#publisher_change_report_name').html(reportHtml2); + } else { + $('#publisher_change_report_name').html('无流程手册'); + } + $('#publisher_change_report_id').text(selectedTaskId); + } // 打开流程文件查看页面 function openPortalPage(uuid, taskId) { - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", - uuid : uuid - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - data : param, - success : function(r) { - if (r.result == 'ok') { - window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows - } else { - $.simpleAlert(r.msg); - } - } - }); + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_repository_method_check", + uuid : uuid + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + success : function(r) { + if (r.result == 'ok') { + window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_publish_file_open&uuid=" + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows + } else { + $.simpleAlert(r.msg); + } + } + }); } // 打开流程选择dialog function openQueryDataDialog(type) { - searchType = type; - $('#treeDataDiv').html('
'); - $('#searchData').html(''); - $("#loadImg").loading({ - description:"加载中", - size:'large', - color:'#000' - }); - $('.awsui-loading').css('position', 'relative'); - $('.awsui-loading').css('top', '60px'); - $("#loading-demo-basic").loading(); - $("#treeDialog").dialog({ + searchType = type; + $('#treeDataDiv').html('
'); + $('#searchData').html(''); + $("#loadImg").loading({ + description:"加载中", + size:'large', + color:'#000' + }); + $('.awsui-loading').css('position', 'relative'); + $('.awsui-loading').css('top', '60px'); + $("#loading-demo-basic").loading(); + $("#treeDialog").dialog({ buttons:[ {text:'确定',cls:"blue",handler:function(){ - if (type == 'new') { - getNewPublishResult(type); - } else if( type == 'change'){ - getChangeResult(type); - } else {// stop - getStopResult(type); - } - }}, + if (type == 'new') { + getNewPublishResult(type); + } else if( type == 'change'){ + getChangeResult(type); + } else {// stop + getStopResult(type); + } + }}, {text:'关闭',handler:function(){ - closeDialog();// 关闭窗口 - }} - ], - onClose:function(){ - $('#autoSearchProcessDiv').empty(); - $('#autoSearchProcessDiv').hide(); - $('#treeDataDiv').empty(); - $('#searchData').empty(); - } + closeDialog();// 关闭窗口 + }} + ], + onClose:function(){ + $('#autoSearchProcessDiv').empty(); + $('#autoSearchProcessDiv').hide(); + $('#treeDataDiv').empty(); + $('#searchData').empty(); + } }); - if (type == 'new') { - initPublishSearch(type);// 绑定搜索事件 - getNotPublishTreeData(type); - } else {// stop - initPublishSearch(type);// 绑定搜索事件 - getPublishedTreeData(type); - } + if (type == 'new') { + initPublishSearch(type);// 绑定搜索事件 + getNotPublishTreeData(type); + } else {// stop + initPublishSearch(type);// 绑定搜索事件 + getPublishedTreeData(type); + } } // 获取未发布文件数据结构 function getNotPublishTreeData(type) { - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag : true - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - data : param, - success : function(r) { - var data = r.data.data; + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag : true + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + success : function(r) { + var data = r.data.data; var setting = { - checkbox: false, - checkInherit: false, - event : { - beforeExpand : loadNewData - }, - dataModel : { - data: data - } + checkbox: false, + checkInherit: false, + event : { + beforeExpand : loadNewData + }, + dataModel : { + data: data + } }; $("#treeDataDiv").empty(); $('#treeDataDiv').html('
    '); initTree = awsui.tree.init($("#tree"), setting); - } - }); + } + }); } //加载type为new的树节点 function loadNewData(treeNode) { - // 如果是父节点并且存在子节点执行加载 - if (treeNode) { - var pid; - if (typeof(treeNode) == "string") { - pid = treeNode; - } else { - pid = treeNode.id; - } - var dataModel = { - url : "./w?sid=" + jQuery("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid - + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, - method : "POST", - dataType : "json" + // 如果是父节点并且存在子节点执行加载 + if (treeNode) { + var pid; + if (typeof(treeNode) == "string") { + pid = treeNode; + } else { + pid = treeNode.id; + } + var dataModel = { + url : "./w?sid=" + jQuery("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query&flag=" + false + "&pid=" + pid + + "&wsId=" + wsId + "&type=" + "new" + "&teamId=" + teamId, + method : "POST", + dataType : "json" + } + initTree.refreshNode({ + id : pid, + dataModel : dataModel + }); + var data = initTree.getChildrenByPid(pid); + var newData = []; + for (var i=0;i'; + } else if (hasDutyDept) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyUser) { + var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } + newData.push(data[i]); + //initTree.refreshNodeById(data[i]); } initTree.refreshNode({ - id : pid, - dataModel : dataModel + id : pid, + data : newData }); - var data = initTree.getChildrenByPid(pid); - var newData = []; - for (var i=0;i'; - } else if (hasDutyDept) { - var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; - data[i].name += '   ' + tempText + ''; - } else if (hasDutyUser) { - var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; - data[i].name += '   ' + tempText + ''; - } - newData.push(data[i]); - //initTree.refreshNodeById(data[i]); - } - initTree.refreshNode({ - id : pid, - data : newData - }); - } + } } // 发布类型结果数据回填 function getNewPublishResult(type) { - var node = initTree.getSelectedNode(); - // 校验 - if (node == undefined) { - $.simpleAlert("请选择资产库文件节点"); - return; - } - if (node.nocheck) { - $.simpleAlert("请选择未发布文件"); - return; - } - // 锁定按钮 - disabledAll(); - $.simpleAlert('正在加载', 'loading'); - var taskId = ""; - // 创建流程手册 - taskId = createReport(node.category, node.method, node.id, taskId); - var data = { - category : node.category, - fileVersion : node.version, - methodId : node.method, - publishDesc : "", - publishFileId : node.id, - // publishFileName : node.name, - publishFileName : node.tempName, - taskId : taskId - } - clearData(type);// 清空 - closeDialog();// 关闭窗口 - initPublishData(data, type, false, true);// 回填值 + var node = initTree.getSelectedNode(); + // 校验 + if (node == undefined) { + $.simpleAlert("请选择资产库文件节点"); + return; + } + if (node.nocheck) { + $.simpleAlert("请选择未发布文件"); + return; + } + // 锁定按钮 + disabledAll(); + $.simpleAlert('正在加载', 'loading'); + var taskId = ""; + // 创建流程手册 + taskId = createReport(node.category, node.method, node.id, taskId); + var data = { + category : node.category, + fileVersion : node.version, + methodId : node.method, + publishDesc : "", + publishFileId : node.id, + // publishFileName : node.name, + publishFileName : node.tempName, + taskId : taskId + } + clearData(type);// 清空 + closeDialog();// 关闭窗口 + initPublishData(data, type, false, true);// 回填值 } //获取已发布文件数据结构 function getPublishedTreeData(type) { - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", - teamId: teamId, - wsId: wsId, - type: type, - flag : true - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - data : param, - success : function(r) { - var data = r.data.data; - var setting = { - checkbox: false, - checkInherit: false, - dataModel : { - data: data - } + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query", + teamId: teamId, + wsId: wsId, + type: type, + flag : true + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + success : function(r) { + var data = r.data.data; + var setting = { + checkbox: false, + checkInherit: false, + dataModel : { + data: data + } }; for (var i=0;i'; - } else if (hasDutyDept) { - var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; - data[i].name += '   ' + tempText + ''; - } else if (hasDutyUser) { - var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; - data[i].name += '   ' + tempText + ''; - } + // 流程名称连接责任部门和责任人 + data[i].tempName = data[i].name; + var hasDutyDept = false; + var hasDutyUser = false; + if (data[i].dutyDeptName != undefined && data[i].dutyDeptName != '') { + hasDutyDept = true; + } + if (data[i].dutyUserName != undefined && data[i].dutyUserName != '') { + hasDutyUser = true; + } + if (hasDutyDept && hasDutyUser) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ' ' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyDept) { + var tempText = '[' + varDutyDept + ':' + data[i].dutyDeptName + ']'; + data[i].name += '   ' + tempText + ''; + } else if (hasDutyUser) { + var tempText = '[' + varDutyUser + ':' + data[i].dutyUserName + ']'; + data[i].name += '   ' + tempText + ''; + } } $("#treeDataDiv").empty(); $('#treeDataDiv').html('
      '); initTree = awsui.tree.init($("#tree"), setting); - } - }); + } + }); } //变更类型结果数据回填 function getChangeResult(type) { - var node = initTree.getSelectedNode(); - // 校验 - if (node == undefined) { - $.simpleAlert("请选择资产库文件节点"); - return; - } - if (node.nocheck) { - $.simpleAlert("请选择已发布文件"); - return; - } - if (node.method == "default") { - $.simpleAlert("不允许选择该类型节点"); - return; - } - // 锁定按钮 - disabledAll(); - $.simpleAlert('正在加载', 'loading'); - var notPublishData = []; - // 查询其他未版本 - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query", - teamId: teamId, - wsId: wsId, - uuid: node.id - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - async : false, - data : param, - success : function(r) { - notPublishData = r.data.data; - } - }); - var changeFileNewId = ""; - var changeFileNewName = ""; - var changeFileNewVersion = 1; - var data = { - category : node.category, - changeFileId : node.id, - // changeFileName : node.name, - changeFileName : node.tempName, - changedDesc : "", - changedFileIdNew : changeFileNewId, - changedFileNameNew : changeFileNewName, - fileVersion : node.version, - methodId : node.method, - targetCategory: node.category, - targetFileVersion: changeFileNewVersion, - targetFiles: notPublishData, - targetMethodId: node.method - } - clearData(type);// 清空 - closeDialog();// 关闭窗口 - initPublishData(data, type, false, true);// 回填值 + var node = initTree.getSelectedNode(); + // 校验 + if (node == undefined) { + $.simpleAlert("请选择资产库文件节点"); + return; + } + if (node.nocheck) { + $.simpleAlert("请选择已发布文件"); + return; + } + if (node.method == "default") { + $.simpleAlert("不允许选择该类型节点"); + return; + } + // 锁定按钮 + disabledAll(); + $.simpleAlert('正在加载', 'loading'); + var notPublishData = []; + // 查询其他未版本 + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_not_publish_version_query", + teamId: teamId, + wsId: wsId, + uuid: node.id + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + async : false, + data : param, + success : function(r) { + notPublishData = r.data.data; + } + }); + var changeFileNewId = ""; + var changeFileNewName = ""; + var changeFileNewVersion = 1; + var data = { + category : node.category, + changeFileId : node.id, + // changeFileName : node.name, + changeFileName : node.tempName, + changedDesc : "", + changedFileIdNew : changeFileNewId, + changedFileNameNew : changeFileNewName, + fileVersion : node.version, + methodId : node.method, + targetCategory: node.category, + targetFileVersion: changeFileNewVersion, + targetFiles: notPublishData, + targetMethodId: node.method + } + clearData(type);// 清空 + closeDialog();// 关闭窗口 + initPublishData(data, type, false, true);// 回填值 } //停用类型结果数据回填 function getStopResult(type) { - var node = initTree.getSelectedNode(); - // 校验 - if (node == undefined) { - $.simpleAlert("请选择资产库文件节点"); - return; - } - if (node.nocheck) { - $.simpleAlert("请选择已发布文件"); - return; - } - // 锁定按钮 - disabledAll(); - $.simpleAlert('正在加载', 'loading'); - var taskId = ""; - if (node.category == 'process' && node.method != "process.evc" && node.method != 'default') { - // 获取流程手册id - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query", - teamId: teamId, - wsId: wsId, - uuid: node.id - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - async : false, - data : param, - success : function(r) { - taskId = r.data.taskId; - } - }); - } - var data = { - category : node.category, - fileVersion : node.version, - methodId : node.method, - stopDesc : "", - stopFileId : node.id, - // stopFileName : node.name, - stopFileName : node.tempName, - taskId : taskId - } - clearData(type);// 清空 - closeDialog();// 关闭窗口 - initPublishData(data, type, false, true);// 回填值 + var node = initTree.getSelectedNode(); + // 校验 + if (node == undefined) { + $.simpleAlert("请选择资产库文件节点"); + return; + } + if (node.nocheck) { + $.simpleAlert("请选择已发布文件"); + return; + } + // 锁定按钮 + disabledAll(); + $.simpleAlert('正在加载', 'loading'); + var taskId = ""; + if (node.category == 'process' && node.method != "process.evc" && node.method != 'default') { + // 获取流程手册id + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_query", + teamId: teamId, + wsId: wsId, + uuid: node.id + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + async : false, + data : param, + success : function(r) { + taskId = r.data.taskId; + } + }); + } + var data = { + category : node.category, + fileVersion : node.version, + methodId : node.method, + stopDesc : "", + stopFileId : node.id, + // stopFileName : node.name, + stopFileName : node.tempName, + taskId : taskId + } + clearData(type);// 清空 + closeDialog();// 关闭窗口 + initPublishData(data, type, false, true);// 回填值 } // 创建流程手册 function createReport(category, method, uuid, taskId) { - if (category == 'process' && method != "process.evc" && method != 'default') { - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create", - teamId: teamId, - wsId: wsId, - uuid: uuid - } - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - async : false, - data : param, - success : function(r) { - if (r.result == 'ok') { - taskId = r.data.taskId; - } - } - }); - } - return taskId; + if (category == 'process' && method != "process.evc" && method != 'default') { + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_output_pr_report_create", + teamId: teamId, + wsId: wsId, + uuid: uuid + } + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + async : false, + data : param, + success : function(r) { + if (r.result == 'ok') { + taskId = r.data.taskId; + } + } + }); + } + return taskId; } // 清空树结构 function clearTreeData() { - initTree = {}; + initTree = {}; } // 禁用按钮 function disabledAll() { - $('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled":"disabled"}); + $('#treeDialog').find("div.dialog-button-wrap").find('button:first').attr({"disabled":"disabled"}); } // 关闭模态窗 function closeDialog() { - $("#treeDialog").dialog("close"); + $("#treeDialog").dialog("close"); } // 打开流程手册 function openReportFile(taskId) { - $.simpleAlert("文件正在处理", "loading"); - awsui.ajax.request({ + $.simpleAlert("文件正在处理", "loading"); + awsui.ajax.request({ type: "POST", url: "./jd?sid=" + sid + "&cmd=com.actionsoft.apps.coe.pal.publisher_publish_output_file_open", data: {taskId: taskId}, ok: function(msg) { - $.simpleAlert("close"); - var url = msg.data.url; - if (msg.data.noSupport) { - window.location.href = url; - } else { - window.open(url); - } + $.simpleAlert("close"); + var url = msg.data.url; + if (msg.data.noSupport) { + window.location.href = url; + } else { + window.open(url); + } }, err: function(msg) { - $.simpleAlert("close"); + $.simpleAlert("close"); } }); } // 点击checkbox function onCheckboxClickEvent(boItemName, $checkbox, val) { - var isCheck = !$checkbox.closest('div').hasClass('checked'); - if (val == '流程文件发布') { - dealPublishCheck(isCheck, 'new'); - } else if (val == '流程文件版本更新') { - dealPublishCheck(isCheck, 'change'); - } else if (val == '流程文件废止') { - dealPublishCheck(isCheck, 'stop'); - } + var isCheck = !$checkbox.closest('div').hasClass('checked'); + if (val == '流程文件发布') { + dealPublishCheck(isCheck, 'new'); + } else if (val == '流程文件版本更新') { + dealPublishCheck(isCheck, 'change'); + } else if (val == '流程文件废止') { + dealPublishCheck(isCheck, 'stop'); + } } // 主体内容显示与隐藏 function dealPublishCheck(isCheck, type) { - if (type == 'new') { - clearData(type); //清空 - isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); - } else if (type == 'change') { - clearData(type); - isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide(); - } else if (type == 'stop') { - clearData(type); - isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide(); - } - // input宽度设定 - initWidth(isCheck, type); + if (type == 'new') { + clearData(type); //清空 + isCheck ? $('#publisher_new_tr').show() : $('#publisher_new_tr').hide(); + } else if (type == 'change') { + clearData(type); + isCheck ? $('#publisher_change_tr').show() : $('#publisher_change_tr').hide(); + } else if (type == 'stop') { + clearData(type); + isCheck ? $('#publisher_stop_tr').show() : $('#publisher_stop_tr').hide(); + } + // input宽度设定 + initWidth(isCheck, type); } // 初始化宽度 function initWidth(isCheck, type) { - if (type == 'new' && isCheck) { - $('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width()); - $('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20); - $('#publisher_new_desc').width('86%'); - } - if (type == 'change' && isCheck) { - $('#publisher_change_source_file_name').width($('#publisher_change_source_file_name').closest('td').width()); - $('#publisher_change_source_file_name').children('span.file_name').width($('#publisher_change_source_file_name').width() - 20); - $('.select2').width('100%'); - $('#publisher_change_desc').width('86%'); - } - if (type == 'stop' && isCheck) { - $('#publisher_stop_file_name').width($('#publisher_stop_file_name').closest('td').width()); - $('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20); - $('#publisher_stop_desc').width('86%'); - } + if (type == 'new' && isCheck) { + $('#publisher_new_file_name').width($('#publisher_new_file_name').closest('td').width()); + $('#publisher_new_file_name').children('span.file_name').width($('#publisher_new_file_name').width() - 20); + $('#publisher_new_desc').width('86%'); + } + if (type == 'change' && isCheck) { + $('#publisher_change_source_file_name').width($('#publisher_change_source_file_name').closest('td').width()); + $('#publisher_change_source_file_name').children('span.file_name').width($('#publisher_change_source_file_name').width() - 20); + $('.select2').width('100%'); + $('#publisher_change_desc').width('86%'); + } + if (type == 'stop' && isCheck) { + $('#publisher_stop_file_name').width($('#publisher_stop_file_name').closest('td').width()); + $('#publisher_stop_file_name').children('span.file_name').width($('#publisher_stop_file_name').width() - 20); + $('#publisher_stop_desc').width('86%'); + } } // 清空对应模块数据 function clearData(type) { - if (type == 'new') { - $('#publisher_new_file_name').children('span.file_name').text('点击右侧按钮选择文件'); - $('#publisher_new_file_id').val(''); - $('#publisher_new_report_name').text('无流程手册'); - $('#publisher_new_report_id').text(''); - $('#publisher_new_desc').val(''); - } else if (type == 'change') { - $('#publisher_change_source_file_name').children('span.file_name').text('点击右侧按钮选择文件'); - $('#publisher_change_source_file_id').val(''); - $('#publisher_change_target_file').empty(); - $('#publisher_change_target_file_id').val(''); - $('#publisher_change_report_name').text('无流程手册'); - $('#publisher_change_report_id').text(''); - $('#publisher_change_desc').val(''); - $('#select').html(''); - var opt1 = {data : []}; - $("#publisher_change_target_file").select2(opt1); - } else if (type == 'stop') { - $('#publisher_stop_file_name').children('span.file_name').text('点击右侧按钮选择文件'); - $('#publisher_stop_file_id').val(''); - $('#publisher_stop_report_name').text('无流程手册'); - $('#publisher_stop_report_id').text(''); - $('#publisher_stop_desc').val(''); - } + if (type == 'new') { + $('#publisher_new_file_name').children('span.file_name').text('点击右侧按钮选择文件'); + $('#publisher_new_file_id').val(''); + $('#publisher_new_report_name').text('无流程手册'); + $('#publisher_new_report_id').text(''); + $('#publisher_new_desc').val(''); + } else if (type == 'change') { + $('#publisher_change_source_file_name').children('span.file_name').text('点击右侧按钮选择文件'); + $('#publisher_change_source_file_id').val(''); + $('#publisher_change_target_file').empty(); + $('#publisher_change_target_file_id').val(''); + $('#publisher_change_report_name').text('无流程手册'); + $('#publisher_change_report_id').text(''); + $('#publisher_change_desc').val(''); + $('#select').html(''); + var opt1 = {data : []}; + $("#publisher_change_target_file").select2(opt1); + } else if (type == 'stop') { + $('#publisher_stop_file_name').children('span.file_name').text('点击右侧按钮选择文件'); + $('#publisher_stop_file_id').val(''); + $('#publisher_stop_report_name').text('无流程手册'); + $('#publisher_stop_report_id').text(''); + $('#publisher_stop_desc').val(''); + } } // 点击办理时的校验+保存字表 function formSave(isTransact){ - if (!editPerm) {// 只读状态不处理 - return true; - } - if(isTransact) {// 点击办理进行校验 - if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none'){ - $.simpleAlert('发布内容不能为空', 'info'); - return false; - } - if (!($("#publisher_new_tr").css('display') == 'none')) { - if ($('#publisher_new_file_id').val() == '') { - $.simpleAlert('发布文件不能为空', 'info'); - return false; - } - } - if (!($("#publisher_change_tr").css('display') == 'none')) { - if ($('#publisher_change_target_file_id').val() == '') { - $.simpleAlert('变更后的文件不能为空', 'info'); - return false; - } - } - if (!($("#publisher_stop_tr").css('display') == 'none')) { - if ($('#publisher_stop_file_id').val() == '') { - $.simpleAlert('停用文件不能为空', 'info'); - return false; - } - } - if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) { - if ($('#publisher_change_source_file_id').val() == $('#publisher_stop_file_id').val()) { - $.simpleAlert('变更文件与停用的发布文件不能相同', 'info'); - return false; - } - } - } - // 保存到子表中 - //发布 - var publishNewFileId = $('#publisher_new_file_id').val(); - var publishNewTaskId = $('#publisher_new_report_id').text(); - var publishNewDesc = $('#publisher_new_desc').val(); - // 变更 - var publishChangeFileId = $('#publisher_change_source_file_id').val(); - var publishChangeTargetFileId = $('#publisher_change_target_file_id').val(); - var publishChangeTaskId = $('#publisher_change_report_id').text(); - var publishChangeDesc = $('#publisher_change_desc').val(); - // 停用 - var publishStopFileId = $('#publisher_stop_file_id').val(); - var publishStopTaskId = $('#publisher_stop_report_id').text(); - var publishStopDesc = $('#publisher_stop_desc').val(); + if (!editPerm) {// 只读状态不处理 + return true; + } + if(isTransact) {// 点击办理进行校验 + if ($("#publisher_new_tr").css('display') == 'none' && $("#publisher_change_tr").css('display') == 'none' && $("#publisher_stop_tr").css('display') == 'none'){ + $.simpleAlert('发布内容不能为空', 'info'); + return false; + } + if (!($("#publisher_new_tr").css('display') == 'none')) { + if ($('#publisher_new_file_id').val() == '') { + $.simpleAlert('发布文件不能为空', 'info'); + return false; + } + } + if (!($("#publisher_change_tr").css('display') == 'none')) { + if ($('#publisher_change_target_file_id').val() == '') { + $.simpleAlert('变更后的文件不能为空', 'info'); + return false; + } + } + if (!($("#publisher_stop_tr").css('display') == 'none')) { + if ($('#publisher_stop_file_id').val() == '') { + $.simpleAlert('停用文件不能为空', 'info'); + return false; + } + } + if (!($("#publisher_change_tr").css('display') == 'none') && !($("#publisher_stop_tr").css('display') == 'none')) { + if ($('#publisher_change_source_file_id').val() == $('#publisher_stop_file_id').val()) { + $.simpleAlert('变更文件与停用的发布文件不能相同', 'info'); + return false; + } + } + } + // 保存到子表中 + //发布 + var publishNewFileId = $('#publisher_new_file_id').val(); + var publishNewTaskId = $('#publisher_new_report_id').text(); + var publishNewDesc = $('#publisher_new_desc').val(); + // 变更 + var publishChangeFileId = $('#publisher_change_source_file_id').val(); + var publishChangeTargetFileId = $('#publisher_change_target_file_id').val(); + var publishChangeTaskId = $('#publisher_change_report_id').text(); + var publishChangeDesc = $('#publisher_change_desc').val(); + // 停用 + var publishStopFileId = $('#publisher_stop_file_id').val(); + var publishStopTaskId = $('#publisher_stop_report_id').text(); + var publishStopDesc = $('#publisher_stop_desc').val(); + + var saveData = {}; + var newObj = { + uuid : publishNewFileId, + taskId : publishNewTaskId, + desc : publishNewDesc + }; + var changeObj = { + uuid : publishChangeFileId, + targetId : publishChangeTargetFileId, + taskId : publishChangeTaskId, + desc : publishChangeDesc + }; + var stopObj = { + uuid : publishStopFileId, + taskId : publishStopTaskId, + desc : publishStopDesc + }; + saveData.newObj = newObj; + saveData.changeObj = changeObj; + saveData.stopObj = stopObj; + var param = { + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_save_before", + teamId: teamId, + wsId: wsId, + processInstId : processInstId, + data: JSON.stringify(saveData) + } - var saveData = {}; - var newObj = { - uuid : publishNewFileId, - taskId : publishNewTaskId, - desc : publishNewDesc - }; - var changeObj = { - uuid : publishChangeFileId, - targetId : publishChangeTargetFileId, - taskId : publishChangeTaskId, - desc : publishChangeDesc - }; - var stopObj = { - uuid : publishStopFileId, - taskId : publishStopTaskId, - desc : publishStopDesc - }; - saveData.newObj = newObj; - saveData.changeObj = changeObj; - saveData.stopObj = stopObj; - var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_save_before", - teamId: teamId, - wsId: wsId, - processInstId : processInstId, - data: JSON.stringify(saveData) - } - - var flag = false; - var tempName; - $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - async : false, - data : param, - success : function(r) { - if (r.result == 'error') { - flag = true; - var data = r.data.data; - var name = data.name + ' V' + data.version + '.0'; - console.log(data); - tempName = name; - } - }, - error : function(XMLHttpRequest, textStatus, errorThrown) { - $.simpleAlert("表单信息错误,请联系管理员!", 'error'); - } - }); - if (flag) { - $.simpleAlert(tempName + "
      已经存在其他未办理完成表单中,不允许保存/办理", 'error'); - return false; - } + var flag = false; + var tempName; + $.ajax({ + url : "./jd", + type : "POST", + dataType : "JSON", + async : false, + data : param, + success : function(r) { + if (r.result == 'error') { + flag = true; + var data = r.data.data; + var name = data.name + ' V' + data.version + '.0'; + console.log(data); + tempName = name; + } + }, + error : function(XMLHttpRequest, textStatus, errorThrown) { + $.simpleAlert("表单信息错误,请联系管理员!", 'error'); + } + }); + if (flag) { + $.simpleAlert(tempName + "
      已经存在其他未办理完成表单中,不允许保存/办理", 'error'); + return false; + } } //办理完成后关闭页面 AWSFormMainAPI.customCloseFormPage(function(){ - if (closeFormPage) { - window.close(); - } else { - AWSFormUtil.refreshPage(); - } - // 父页面刷新 - opener.refreshTab(); - return true;//最后返回true + if (closeFormPage) { + window.close(); + } else { + AWSFormUtil.refreshPage(); + } + // 父页面刷新 + opener.refreshTab(); + return true;//最后返回true }); /********************************快速搜索start***************************************/ // 绑定事件 function initPublishSearch(type) { - $("#processName").buttonedit({ - onClick: function(e){ - searchProcess(type); - } - }); - $("#processName").bind("keypress",function(event){ - if(event.keyCode == "13"){ - searchProcess(type); - } - }); + $("#processName").buttonedit({ + onClick: function(e){ + searchProcess(type); + } + }); + $("#processName").bind("keypress",function(event){ + if(event.keyCode == "13"){ + searchProcess(type); + } + }); $("#autoSearchProcessDiv").off("mouseenter").on("mouseenter", function () { - $('#autoSearchProcessDiv').show(); + $('#autoSearchProcessDiv').show(); }).off("autoSearchProcessDiv").on("mouseleave", function () { - $('#autoSearchProcessDiv').hide(); + $('#autoSearchProcessDiv').hide(); }); } // 搜索 function searchProcess(type) { - $("#autoSearchProcessDiv").empty().hide(); - if ($("#processName").val() == "" || $("#processName").val().trim() == "") { - return; - } - var name = $("#processName").val().trim().toLowerCase(); + $("#autoSearchProcessDiv").empty().hide(); + if ($("#processName").val() == "" || $("#processName").val().trim() == "") { + return; + } + var name = $("#processName").val().trim().toLowerCase(); var html = ''; - //先向后台请求完整tree数据 - if (type == 'new') { - var data = getAllTreeData(); + //先向后台请求完整tree数据 + if (type == 'new') { + var data = getAllTreeData(); for (var i = 0; i < data.length; i++) { var text = data[i].name; if (text.indexOf(name) > -1) { @@ -1030,47 +1030,47 @@ function searchProcess(type) { html += ''; } } - } else { - $('span.tree-items-title').each(function() { - var text = $(this).text().toLowerCase(); - if (text.indexOf(name) > -1) {// found - var id = $(this).attr('id').substring(10); - if (id.length <= 36) { - var node = initTree.getNodeById(id); - var path = getFilePath(node, text); - html += '
      '; - html += ''; - html += '
      ' + path + '
      '; - html += '
      '; - html += '
      '; - html += '
      '; - } - } + } else { + $('span.tree-items-title').each(function() { + var text = $(this).text().toLowerCase(); + if (text.indexOf(name) > -1) {// found + var id = $(this).attr('id').substring(10); + if (id.length <= 36) { + var node = initTree.getNodeById(id); + var path = getFilePath(node, text); + html += '
      '; + html += ''; + html += '
      ' + path + '
      '; + html += '
      '; + html += '
      '; + html += '
      '; + } + } }); - } - if (html.length > 0) { - $("#autoSearchProcessDiv").html(html).show(); - // $("#processName").val(''); - } + } + if (html.length > 0) { + $("#autoSearchProcessDiv").html(html).show(); + // $("#processName").val(''); + } } function getAllTreeData() { var param = { - sid : sid, - cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query_search", - teamId: teamId, + sid : sid, + cmd : "com.actionsoft.apps.coe.pal.publisher_publish_tree_data_query_search", + teamId: teamId, wsId: wsId } var data; $.ajax({ - url : "./jd", - type : "POST", - dataType : "JSON", - data : param, - async : false, - success : function(d) { + url : "./jd", + type : "POST", + dataType : "JSON", + data : param, + async : false, + success : function(d) { data = d; - } + } }); return data; } @@ -1079,68 +1079,68 @@ function getSearchTreeNodePath(node, text, data, isPid) { var name = text; var pids = node.pid; do { - var p = undefined; - for (var i = 0; i < data.length; i++) { - if (data[i].id == node.pid) { - p = data[i]; - break; - } - } - if (p == undefined) { - if (node.pid == "process") { - name = "流程>" + name; - } - if (node.pid == "org") { + var p = undefined; + for (var i = 0; i < data.length; i++) { + if (data[i].id == node.pid) { + p = data[i]; + break; + } + } + if (p == undefined) { + if (node.pid == "process") { + name = "流程>" + name; + } + if (node.pid == "org") { name = "组织>" + name; } - if (node.pid == "data") { + if (node.pid == "data") { name = "数据>" + name; } - if (node.pid == "itsystem") { + if (node.pid == "itsystem") { name = "IT系统>" + name; } if (node.pid == "control") { name = "控制>" + name; } - break; - } - name = p.name + ">" + name; - pids = p.pid + "." + pids; - node = p; + break; + } + name = p.name + ">" + name; + pids = p.pid + "." + pids; + node = p; } while(true); if (isPid == 2) { return pids; } else { - return name; + return name; } } function getFilePath(node, text) { - var name = text; - do { - var p = initTree.getParentNodeById(node.id); - if (p == undefined) { - break; - } - name = p.name + ">" + name; - node = p; - } while(true); - return name; + var name = text; + do { + var p = initTree.getParentNodeById(node.id); + if (p == undefined) { + break; + } + name = p.name + ">" + name; + node = p; + } while(true); + return name; } function auto_move(obj) { - obj.css({"color": "white", "background-image" : "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"}); + obj.css({"color": "white", "background-image" : "url(../apps/com.actionsoft.apps.coe.pal.publisher/img/link.png)"}); } function auto_out(obj) { - obj.css({"color": "black", "background-image" : "none"}); + obj.css({"color": "black", "background-image" : "none"}); } function auto_click(obj, type) { - var plId = obj.find("span").attr("plId"); - var type = obj.find("span").data("type"); - var dom = initTree.getNodeDomById(plId) - if (type == 'new') { + var plId = obj.find("span").attr("plId"); + var type = obj.find("span").data("type"); + var dom = initTree.getNodeDomById(plId) + if (type == 'new') { //预先去加载initTree var pids = obj.find("span").data("pids"); var pidList = pids.split('.'); @@ -1149,75 +1149,75 @@ function auto_click(obj, type) { dom = initTree.getNodeDomById(pidList[i]); initTree.expandNodes(dom, true, true, true); } - } else { - initTree.expandNodes(dom, true, true, true); - } - // 偏移至可见区域 - var ele = document.getElementById('tree_span_' + plId); - $('#tree').scrollTop(ele.offsetTop); - initTree.cancelSelectNode() - initTree.selectNode(plId); - $("#autoSearchProcessDiv").empty().hide(); + } else { + initTree.expandNodes(dom, true, true, true); + } + // 偏移至可见区域 + var ele = document.getElementById('tree_span_' + plId); + $('#tree').scrollTop(ele.offsetTop); + initTree.cancelSelectNode() + initTree.selectNode(plId); + $("#autoSearchProcessDiv").empty().hide(); } /********************************快速搜索end***************************************/ function listenCloseEvent() { - window.onbeforeunload = function(){ - // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例 - awsui.ajax.request({ - type: "POST", - url: "./jd", - async: false, - data: { - sid: sid, - cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query", - processInstId: processInstId - }, - success : function(r) { - if (r.result == "ok") { - if (r.data.saveStatus == '1') { - return "未保存,关闭之后不会保存该表单!"; - } - } - } - }); - } - - //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件 - window.onunload = function(){ - // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例 - awsui.ajax.request({ - type: "POST", - url: "./jd", - async: false, - data: { - sid: sid, - cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query", - processInstId: processInstId - }, - success : function(r) { - if (r.result == "ok") { - if (r.data.saveStatus == '1') { - // 删除该流程实例,并刷新主页面 - awsui.ajax.request({ - type: "POST", - url: "./jd", - async: false, - data: { - sid: sid, - cmd: "com.actionsoft.apps.coe.pal.publisher_remove", - processInstIds: processInstId - }, - success : function(r) { - if (r.result == "ok") { - // 父页面刷新 - opener.refreshTab(); - } - } - }); - } - } - } - }); - } + window.onbeforeunload = function(){ + // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例 + awsui.ajax.request({ + type: "POST", + url: "./jd", + async: false, + data: { + sid: sid, + cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query", + processInstId: processInstId + }, + success : function(r) { + if (r.result == "ok") { + if (r.data.saveStatus == '1') { + return "未保存,关闭之后不会保存该表单!"; + } + } + } + }); + } + + //在弹出“是否离开”的提示框后,选择离开,则触发onunload事件 + window.onunload = function(){ + // 查询bo表数据,是否保存过,未保存过离开页面则删除该实例 + awsui.ajax.request({ + type: "POST", + url: "./jd", + async: false, + data: { + sid: sid, + cmd: "com.actionsoft.apps.coe.pal.publisher_save_status_query", + processInstId: processInstId + }, + success : function(r) { + if (r.result == "ok") { + if (r.data.saveStatus == '1') { + // 删除该流程实例,并刷新主页面 + awsui.ajax.request({ + type: "POST", + url: "./jd", + async: false, + data: { + sid: sid, + cmd: "com.actionsoft.apps.coe.pal.publisher_remove", + processInstIds: processInstId + }, + success : function(r) { + if (r.result == "ok") { + // 父页面刷新 + opener.refreshTab(); + } + } + }); + } + } + } + }); + } } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.processlevel.main.autoajax.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.processlevel.main.autoajax.js index 1289e298..14e52253 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.processlevel.main.autoajax.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.pal.processlevel.main.autoajax.js @@ -9,208 +9,208 @@ var wing_event_keyCode; var autoIndex; var autoLenght; $.fn.myAutoInput = function(url) { - autoURL=url; - var obj = $(this); - obj.keyup(function(event){ - //alert(event.keyCode); - wing_event_keyCode=event.keyCode; - autoVal=this.value; - autoInputObj=obj; - var auto = document.getElementById('autoDiv'); - if (wing_event_keyCode == 40 && auto.style.display == 'block') { - $("#autoDiv"+autoIndex).css("backgroundImage","url('')"); - $("#autoDiv"+autoIndex).css("color","black"); - $("#autoDiv"+autoIndex).css("fontWeight","normal"); - if(autoIndex>=autoLenght-1) - { - $("#autoDiv0").get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - $("#autoDiv0").css("color","white"); - //$("#autoDiv0").css("fontWeight","bold"); - autoIndex=0; - }else - { - autoIndex++; - $("#autoDiv"+(autoIndex)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - $("#autoDiv"+autoIndex).css("color","white"); - //$("#autoDiv"+autoIndex).css("fontWeight","bold"); - - } - //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); - return; - }else if (wing_event_keyCode == 38 && auto.style.display == 'block') { - $("#autoDiv"+autoIndex).css("backgroundImage","url('')"); - $("#autoDiv"+autoIndex).css("color","black"); - $("#autoDiv"+autoIndex).css("fontWeight","normal"); - if(autoIndex<=0) - { - $("#autoDiv"+(autoLenght-1)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - $("#autoDiv"+(autoLenght-1)).css("color","white"); - //$("#autoDiv"+(autoLenght-1)).css("fontWeight","bold"); - autoIndex=autoLenght-1; - }else - { - autoIndex--; - $("#autoDiv"+(autoIndex)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - $("#autoDiv"+autoIndex).css("color","white"); - //$("#autoDiv"+autoIndex).css("fontWeight","bold"); - } - //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); - - return; - }else if (event.keyCode == 27) {//ESC - document.getElementById('autoDiv').style.display = 'none'; - return; - }else if (event.keyCode == 13)//ENTER - { - //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); - setValue($("#autoDiv"+autoIndex).data("value"),$("#autoDiv"+autoIndex).data("name")); - document.getElementById('autoDiv').style.display = 'none'; - return ; - }else - { - autoIndex=-1; - } - //auto.style.display = 'none'; - if(wing_event_keyCode==8) - { - autoCountWait=autoCount; - } - if(autoVal!=''){ - setTimeout("autoAjaxWaitFn()",autoTime); - autoCount++; - }else{ - document.getElementById("autoDiv").style.display='none'; - } - }); - return obj; + autoURL=url; + var obj = $(this); + obj.keyup(function(event){ + //alert(event.keyCode); + wing_event_keyCode=event.keyCode; + autoVal=this.value; + autoInputObj=obj; + var auto = document.getElementById('autoDiv'); + if (wing_event_keyCode == 40 && auto.style.display == 'block') { + $("#autoDiv"+autoIndex).css("backgroundImage","url('')"); + $("#autoDiv"+autoIndex).css("color","black"); + $("#autoDiv"+autoIndex).css("fontWeight","normal"); + if(autoIndex>=autoLenght-1) + { + $("#autoDiv0").get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + $("#autoDiv0").css("color","white"); + //$("#autoDiv0").css("fontWeight","bold"); + autoIndex=0; + }else + { + autoIndex++; + $("#autoDiv"+(autoIndex)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + $("#autoDiv"+autoIndex).css("color","white"); + //$("#autoDiv"+autoIndex).css("fontWeight","bold"); + + } + //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); + return; + }else if (wing_event_keyCode == 38 && auto.style.display == 'block') { + $("#autoDiv"+autoIndex).css("backgroundImage","url('')"); + $("#autoDiv"+autoIndex).css("color","black"); + $("#autoDiv"+autoIndex).css("fontWeight","normal"); + if(autoIndex<=0) + { + $("#autoDiv"+(autoLenght-1)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + $("#autoDiv"+(autoLenght-1)).css("color","white"); + //$("#autoDiv"+(autoLenght-1)).css("fontWeight","bold"); + autoIndex=autoLenght-1; + }else + { + autoIndex--; + $("#autoDiv"+(autoIndex)).get(0).style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + $("#autoDiv"+autoIndex).css("color","white"); + //$("#autoDiv"+autoIndex).css("fontWeight","bold"); + } + //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); + + return; + }else if (event.keyCode == 27) {//ESC + document.getElementById('autoDiv').style.display = 'none'; + return; + }else if (event.keyCode == 13)//ENTER + { + //autoInputObj.get(0).value=$("#autoDiv"+autoIndex).data("value"); + setValue($("#autoDiv"+autoIndex).data("value"),$("#autoDiv"+autoIndex).data("name")); + document.getElementById('autoDiv').style.display = 'none'; + return ; + }else + { + autoIndex=-1; + } + //auto.style.display = 'none'; + if(wing_event_keyCode==8) + { + autoCountWait=autoCount; + } + if(autoVal!=''){ + setTimeout("autoAjaxWaitFn()",autoTime); + autoCount++; + }else{ + document.getElementById("autoDiv").style.display='none'; + } + }); + return obj; } function autoAjaxWaitFn() { - autoCountWait++; - if(autoCountWait!=autoCount) - { - return; - } - if (autoURL == "") { - return; - } - if (autoVal != " ") { - autoVal = autoVal.trim(); - } - if (autoVal == "") { - return; - } - $.post(autoURL, {"autoContent":autoVal,"cmd":"com.actionsoft.apps.coe.pal_processlevel_query","sid":jQuery("#sid").val(),"wsid":jQuery("#wsId").val()},autoajax, "json"); + autoCountWait++; + if(autoCountWait!=autoCount) + { + return; + } + if (autoURL == "") { + return; + } + if (autoVal != " ") { + autoVal = autoVal.trim(); + } + if (autoVal == "") { + return; + } + $.post(autoURL, {"autoContent":autoVal,"cmd":"com.actionsoft.apps.coe.pal_processlevel_query","sid":jQuery("#sid").val(),"wsid":jQuery("#wsId").val()},autoajax, "json"); } function autoajax(msg) { - $("#autoDiv").html(""); - var auto = document.getElementById('autoDiv'); - var txt = autoInputObj.get(0); - if (msg == ""){ - auto.style.display = 'none'; - return; - } - autoLenght=msg.length; - for(var i=0;i" - + icon - + "" + msg[i].ui + "" - + ""); - $("#autoDiv"+i).data("value",msg[i].value); - $("#autoDiv"+i).data("name",msg[i].name); - } - // 锟斤拷锟矫诧拷锟轿伙拷锟� - var x = autoInputObj.offset().left; - var y = autoInputObj.offset().top ; - var wing_auto=$(auto); - wing_auto.css("left",x); - wing_auto.css("top",y + txt.offsetHeight); - $("#autoDiv").css("minWidth",txt.offsetWidth); - - // 锟斤拷锟斤拷锟斤拷锟斤拷锟绞撅拷锟� - if (autoLenght == 1 && $("#autoDiv0").data("value") == txt.value) { - auto.style.display = 'none'; - } - else { - auto.style.display = 'block'; - } + $("#autoDiv").html(""); + var auto = document.getElementById('autoDiv'); + var txt = autoInputObj.get(0); + if (msg == ""){ + auto.style.display = 'none'; + return; + } + autoLenght=msg.length; + for(var i=0;i" + + icon + + "" + msg[i].ui + "" + + ""); + $("#autoDiv"+i).data("value",msg[i].value); + $("#autoDiv"+i).data("name",msg[i].name); + } + // 锟斤拷锟矫诧拷锟轿伙拷锟� + var x = autoInputObj.offset().left; + var y = autoInputObj.offset().top ; + var wing_auto=$(auto); + wing_auto.css("left",x); + wing_auto.css("top",y + txt.offsetHeight); + $("#autoDiv").css("minWidth",txt.offsetWidth); + + // 锟斤拷锟斤拷锟斤拷锟斤拷锟绞撅拷锟� + if (autoLenght == 1 && $("#autoDiv0").data("value") == txt.value) { + auto.style.display = 'none'; + } + else { + auto.style.display = 'block'; + } } $(function(){ - hwTime(); - $("body").prepend("
      "); - $("#autoDiv").keydown(function(event){ - if(event.keyCode == 8) - { - event.keyCode=27; - var obj=autoInputObj.get(0); - obj.focus(); - obj.value=obj.value.slice(0,obj.value.length); - } - if (event.keyCode == 27) { - document.getElementById('autoDiv').style.display = 'none'; - } - }); - + hwTime(); + $("body").prepend("
      "); + $("#autoDiv").keydown(function(event){ + if(event.keyCode == 8) + { + event.keyCode=27; + var obj=autoInputObj.get(0); + obj.focus(); + obj.value=obj.value.slice(0,obj.value.length); + } + if (event.keyCode == 27) { + document.getElementById('autoDiv').style.display = 'none'; + } + }); + }); function hwTime() { - //autoCountWait=autoCount; - //setTimeout("hwTime()",2000); + //autoCountWait=autoCount; + //setTimeout("hwTime()",2000); } function divEvent2() { - try{ - document.getElementById('autoDiv').style.display = 'none'; - }catch(e){ - } + try{ + document.getElementById('autoDiv').style.display = 'none'; + }catch(e){ + } } document.onclick = divEvent2; function aotu_Move(obj) { - $(".aotuDivcontenr").css({"backgroundImage":"none","color":"black","fontWeight":"normal"}); - obj.style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - autoIndex=obj.id.substring(obj.id.length-1); - obj.style.color="white"; + $(".aotuDivcontenr").css({"backgroundImage":"none","color":"black","fontWeight":"normal"}); + obj.style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + autoIndex=obj.id.substring(obj.id.length-1); + obj.style.color="white"; } function aotu_Out(obj) { - obj.style.backgroundImage=""; - obj.style.color="black"; - obj.style.fontWeight="normal"; + obj.style.backgroundImage=""; + obj.style.color="black"; + obj.style.fontWeight="normal"; } function aotu_clike(obj) { - obj = obj.parentElement; - var id=obj.id.substring(6+1,obj.id.length); - setValue($("#autoDiv"+id).data("value"),$("#autoDiv"+id).data("name")); + obj = obj.parentElement; + var id=obj.id.substring(6+1,obj.id.length); + setValue($("#autoDiv"+id).data("value"),$("#autoDiv"+id).data("name")); } function setValue(uuid,name) { - $.ajax({ - url:'./w?cmd=com.actionsoft.apps.coe.pal_processlevel_query_check&sid='+$('#sid').val()+'&uuid='+uuid, - async:false, - success:function(msg){ - if(msg!="") - { - autoInputObj.get(0).value=""; - openDesginer(msg, 0, "", "", "", false, "0"); - } - } - }) + $.ajax({ + url:'./w?cmd=com.actionsoft.apps.coe.pal_processlevel_query_check&sid='+$('#sid').val()+'&uuid='+uuid, + async:false, + success:function(msg){ + if(msg!="") + { + autoInputObj.get(0).value=""; + openDesginer(msg, 0, "", "", "", false, "0"); + } + } + }) } function open_desginer(obj){ - obj = obj.parentElement; - var id = obj.id.substring(6+1,obj.id.length); - repositoryTree.selectNode($("#autoDiv"+id).data("value"),true); - openDesginer($("#autoDiv"+id).data("value"), '0',$("#autoDiv"+id).data("name"),'', '',''); + obj = obj.parentElement; + var id = obj.id.substring(6+1,obj.id.length); + repositoryTree.selectNode($("#autoDiv"+id).data("value"),true); + openDesginer($("#autoDiv"+id).data("value"), '0',$("#autoDiv"+id).data("name"),'', '',''); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.add.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.add.js index ade3af50..630ee579 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.add.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.add.js @@ -1,23 +1,23 @@ $(document) .ready( - function() { - setTimeout(function() { - setting.dataModel = { - data : data - }; - checkTree = awsui.tree.init($("#tree"), setting); - }, 100); - } + function() { + setTimeout(function() { + setting.dataModel = { + data : data + }; + checkTree = awsui.tree.init($("#tree"), setting); + }, 100); + } ); var CoEProcessPublishAdd = { - saveRowData : function() { - //alert(parent.document.querySelector("#pageFrame").contentWindow.CoEProcessPublish.getTeamId()); - } + saveRowData : function() { + //alert(parent.document.querySelector("#pageFrame").contentWindow.CoEProcessPublish.getTeamId()); + } }; var setting = { - checkbox : true, - checkInherit : false/*, + checkbox : true, + checkInherit : false/*, event : { onClick : onClick, // beforeExpand : loadData, @@ -28,42 +28,42 @@ var setting = { }; var checkTree; function loadData(treeNode) { - var url = "./w?sid=" - + parent.sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_relation_json_data&methodType=" - + parent.OutputReportWizard.treeNodeObj.relationMethodScope - + "&wsid=" + parent.wsid + "&pid=" + treeNode.id + "&teamId="; - var dataModel = { - url : url, - method : "POST", - dataType : "json" - } - checkTree.refreshNode({ - id : treeNode.id, - dataModel : dataModel - }); + var url = "./w?sid=" + + parent.sid + + "&cmd=com.actionsoft.apps.coe.pal_outputreport_pal_file_relation_json_data&methodType=" + + parent.OutputReportWizard.treeNodeObj.relationMethodScope + + "&wsid=" + parent.wsid + "&pid=" + treeNode.id + "&teamId="; + var dataModel = { + url : url, + method : "POST", + dataType : "json" + } + checkTree.refreshNode({ + id : treeNode.id, + dataModel : dataModel + }); } function getCheckedNode() { - return checkTree.getCheckedNodes(); + return checkTree.getCheckedNodes(); } // 设置被选中的checkbox function checkedNodeById() { - var checkedIds = parent.OutputReportWizard.treeRelationNodeIds; - if (checkedIds != "") { - checkedIds = checkedIds.split(","); - for (var i = 0; i < checkedIds.length; i++) { - if (checkedIds[i] == "") { - continue; - } - var resourceId = checkedIds[i]; - var checkboxObj = $("input[type=checkbox][value=" + resourceId - + "]"); - if (checkboxObj != undefined) { - checkboxObj.prop("checked", true); - } + var checkedIds = parent.OutputReportWizard.treeRelationNodeIds; + if (checkedIds != "") { + checkedIds = checkedIds.split(","); + for (var i = 0; i < checkedIds.length; i++) { + if (checkedIds[i] == "") { + continue; + } + var resourceId = checkedIds[i]; + var checkboxObj = $("input[type=checkbox][value=" + resourceId + + "]"); + if (checkboxObj != undefined) { + checkboxObj.prop("checked", true); + } - } - } + } + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.js index df0ac0ba..58583892 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/coe.process.publish.js @@ -1,360 +1,360 @@ $(document) .ready(function() { - setTimeout(function() { - CoEProcessPublish.loadPublishAddData();//载入新发布的流程 - }, 100); - setTimeout(function() { - CoEProcessPublish.loadPublishChangeData();//载入变更的流程 - }, 300); - setTimeout(function() { - CoEProcessPublish.loadPublishStopData();//载入停用的流程 - }, 500); + setTimeout(function() { + CoEProcessPublish.loadPublishAddData();//载入新发布的流程 + }, 100); + setTimeout(function() { + CoEProcessPublish.loadPublishChangeData();//载入变更的流程 + }, 300); + setTimeout(function() { + CoEProcessPublish.loadPublishStopData();//载入停用的流程 + }, 500); }); var CoEProcessPublish = { - getTeamId : function() { - return $("#teamId").val(); - }, - getWsid : function() { - return $("#teamId").val(); - }, - getSid : function() { - return $("#sid").val(); - }, - openRowDataAdd : function() { - var obj = $("#grid1Content").find("input[type=checkbox][group]"); - var group = obj.attr("group"); - var url = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_publisher_add_home&wsid=" + $("#wsId").val() - + "&teamId=" + $("#teamId").val(); - createDlg = FrmDialog.open({ - width : 500, - height : 420, - title : "新增发布流程", - url : url, - id : "createDialog", - buttons : [ { - text : "确定", - cls : "blue", - handler : function() { - var dialogFrm = createDlg.win(); - var nodes = dialogFrm.getCheckedNode(); - CoEProcessPublish.publishAddContent(nodes); - CoEProcessPublish.savePublishAddData(nodes); - FrmDialog.close(); - } - }, { - text : "取消", - handler : function() { - FrmDialog.close(); - } - } ] - }); - }, - openRowDataChange : function() { - var obj = $("#grid1Content").find("input[type=checkbox][group]"); - var group = obj.attr("group"); - var url = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_publisher_change_home&wsid=" + $("#wsId").val() - + "&teamId=" + $("#teamId").val(); - createDlg = FrmDialog.open({ - width : 500, - height : 420, - title : "变更申请", - url : url, - id : "createDialog", - buttons : [ { - text : "确定", - cls : "blue", - handler : function() { - var dialogFrm = createDlg.win(); - var nodes = dialogFrm.getCheckedNode(); - CoEProcessPublish.savePublishChangeData(nodes); - FrmDialog.close(); - } - }, { - text : "取消", - handler : function() { - FrmDialog.close(); - } - } ] - }); - }, - openRowDataStop : function() { - var obj = $("#grid1Content").find("input[type=checkbox][group]"); - var group = obj.attr("group"); - var url = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_publisher_stop_home&wsid=" + $("#wsId").val() - + "&teamId=" + $("#teamId").val(); - createDlg = FrmDialog.open({ - width : 500, - height : 420, - title : "停用申请", - url : url, - id : "createDialog", - buttons : [ { - text : "确定", - cls : "blue", - handler : function() { - var dialogFrm = createDlg.win(); - var nodes = dialogFrm.getCheckedNode(); - CoEProcessPublish.savePublishStopData(nodes); - FrmDialog.close(); - } - }, { - text : "取消", - handler : function() { - FrmDialog.close(); - } - } ] - }); - }, - savePublishAddData : function(nodes) { - if (nodes == undefined || nodes.length == 0) - return; - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_add_save_data"; - var formItemDefId = $("#grid1Content").find("table[id^=GridContent]").attr("id"); - formItemDefId = formItemDefId.substring(12, formItemDefId.length); - var params = { - processInstId : $("#processInstId").val(), - openState : $("#openState").val(), - currentPage : $("#currentPage").val(), - formData : JSON.stringify(nodes), - formItemDefId : formItemDefId, - isCreate : true, - taskInstId: $("#taskInstId").val() - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - window.top.$.simpleAlert(msg.msg, "ok", 2000); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - }, - savePublishChangeData : function(nodes) { - if (nodes == undefined || nodes.length == 0) - return; - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_change_save_data"; - var formItemDefId = $("#changePublishTab2").find("table[id^=GridContent]").attr("id"); - formItemDefId = formItemDefId.substring(12, formItemDefId.length); - var params = { - processInstId : $("#processInstId").val(), - openState : $("#openState").val(), - currentPage : $("#currentPage").val(), - formData : JSON.stringify(nodes), - formItemDefId : formItemDefId, - isCreate : true, - taskInstId: $("#taskInstId").val() - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - window.top.$.simpleAlert(msg.msg, "ok", 2000); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - }, - savePublishStopData : function(nodes) { - if (nodes == undefined || nodes.length == 0) - return; - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_stop_save_data"; - var formItemDefId = $("#stopPublishTab3").find("table[id^=GridContent]").attr("id"); - formItemDefId = formItemDefId.substring(12, formItemDefId.length); - var params = { - processInstId : $("#processInstId").val(), - openState : $("#openState").val(), - currentPage : $("#currentPage").val(), - formData : JSON.stringify(nodes), - formItemDefId : formItemDefId, - isCreate : true, - taskInstId: $("#taskInstId").val() - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - window.top.$.simpleAlert(msg.msg, "ok", 2000); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - }, - publishAddContent : function(nodes) { - $("#coePublisAddBody").empty(); - var order = 0; - for (var index = 0; index < nodes.length; index++) { - var nodeObj = nodes[index]; - if (nodeObj.id.length > 16) { - order++; - var hrefUrl = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" - + nodeObj.id + "&openType=0&openAppType=1"; - var content = '' - + order - + '' - + nodeObj.fileType - + '' - + nodeObj.name - + '' - + nodeObj.fileVersion - + ''; - $("#coePublisAddBody").append(content); - } - } - }, - loadPublishAddContent : function(jsonArr) { - $("#coePublisAddBody").empty(); - var order = 0; - var content=""; - for (var index = 0; index < jsonArr.length; index++) { - var nodeObj = jsonArr[index]; - if (nodeObj.ID.length > 16) { - order++; - var hrefUrl = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" - + nodeObj.PUBLISHFILEID + "&openType=0&openAppType=1"; - content += '' - + order - + '' - + nodeObj.PUBLISTHTYPE - + '' - + nodeObj.PUBLISHFILENAME - + '' - + nodeObj.PUBLISHVERSION - + ''; - //alert(content) - } - } - $("#coePublisAddBody").append(content); - }, - loadPublishChangeContent : function(jsonArr) { - $("#coePublisChangeBody").empty(); - var order = 0; - var content=""; - for (var index = 0; index < jsonArr.length; index++) { - var nodeObj = jsonArr[index]; - if (nodeObj.ID.length > 16) { - order++; - var hrefUrl = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" - + nodeObj.CHANGEFILEID + "&openType=0&openAppType=1"; - content += '' - + order - + '' - + nodeObj.CHANGETYPE - + '' - + nodeObj.CHANGEFILENAME - + '' - + nodeObj.CHANGEDVERSION - + ''; - //alert(content) - } - } - $("#coePublisChangeBody").append(content); - }, - loadPublishStopContent : function(jsonArr) { - $("#coePublisStopBody").empty(); - var order = 0; - var content=""; - for (var index = 0; index < jsonArr.length; index++) { - var nodeObj = jsonArr[index]; - if (nodeObj.ID.length > 16) { - order++; - var hrefUrl = "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" - + nodeObj.STOPFILEID + "&openType=0&openAppType=1"; - content += '' - + order - + '' - + nodeObj.STOPTYPE - + '' - + nodeObj.STOPFILENAME - + '' - + nodeObj.STOPVERSION - + ''; - //alert(content) - } - } - $("#coePublisStopBody").append(content); - }, - loadPublishAddData:function (){ - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_add_show_data"; - var params = { - processInstId : $("#processInstId").val(), - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - CoEProcessPublish.loadPublishAddContent(msg.data); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - }, - loadPublishChangeData:function (){ - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_change_show_data"; - var params = { - processInstId : $("#processInstId").val(), - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - // CoEProcessPublish.loadPublishAddContent(msg.data); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - }, - loadPublishStopData:function (){ - var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_stop_show_data"; - var params = { - processInstId : $("#processInstId").val(), - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - //CoEProcessPublish.loadPublishAddContent(msg.data); - } else { - window.top.$.simpleAlert("保存失败", "info", 2000); - } - } - }); - } + getTeamId : function() { + return $("#teamId").val(); + }, + getWsid : function() { + return $("#teamId").val(); + }, + getSid : function() { + return $("#sid").val(); + }, + openRowDataAdd : function() { + var obj = $("#grid1Content").find("input[type=checkbox][group]"); + var group = obj.attr("group"); + var url = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_publisher_add_home&wsid=" + $("#wsId").val() + + "&teamId=" + $("#teamId").val(); + createDlg = FrmDialog.open({ + width : 500, + height : 420, + title : "新增发布流程", + url : url, + id : "createDialog", + buttons : [ { + text : "确定", + cls : "blue", + handler : function() { + var dialogFrm = createDlg.win(); + var nodes = dialogFrm.getCheckedNode(); + CoEProcessPublish.publishAddContent(nodes); + CoEProcessPublish.savePublishAddData(nodes); + FrmDialog.close(); + } + }, { + text : "取消", + handler : function() { + FrmDialog.close(); + } + } ] + }); + }, + openRowDataChange : function() { + var obj = $("#grid1Content").find("input[type=checkbox][group]"); + var group = obj.attr("group"); + var url = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_publisher_change_home&wsid=" + $("#wsId").val() + + "&teamId=" + $("#teamId").val(); + createDlg = FrmDialog.open({ + width : 500, + height : 420, + title : "变更申请", + url : url, + id : "createDialog", + buttons : [ { + text : "确定", + cls : "blue", + handler : function() { + var dialogFrm = createDlg.win(); + var nodes = dialogFrm.getCheckedNode(); + CoEProcessPublish.savePublishChangeData(nodes); + FrmDialog.close(); + } + }, { + text : "取消", + handler : function() { + FrmDialog.close(); + } + } ] + }); + }, + openRowDataStop : function() { + var obj = $("#grid1Content").find("input[type=checkbox][group]"); + var group = obj.attr("group"); + var url = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_publisher_stop_home&wsid=" + $("#wsId").val() + + "&teamId=" + $("#teamId").val(); + createDlg = FrmDialog.open({ + width : 500, + height : 420, + title : "停用申请", + url : url, + id : "createDialog", + buttons : [ { + text : "确定", + cls : "blue", + handler : function() { + var dialogFrm = createDlg.win(); + var nodes = dialogFrm.getCheckedNode(); + CoEProcessPublish.savePublishStopData(nodes); + FrmDialog.close(); + } + }, { + text : "取消", + handler : function() { + FrmDialog.close(); + } + } ] + }); + }, + savePublishAddData : function(nodes) { + if (nodes == undefined || nodes.length == 0) + return; + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_add_save_data"; + var formItemDefId = $("#grid1Content").find("table[id^=GridContent]").attr("id"); + formItemDefId = formItemDefId.substring(12, formItemDefId.length); + var params = { + processInstId : $("#processInstId").val(), + openState : $("#openState").val(), + currentPage : $("#currentPage").val(), + formData : JSON.stringify(nodes), + formItemDefId : formItemDefId, + isCreate : true, + taskInstId: $("#taskInstId").val() + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + window.top.$.simpleAlert(msg.msg, "ok", 2000); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + }, + savePublishChangeData : function(nodes) { + if (nodes == undefined || nodes.length == 0) + return; + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_change_save_data"; + var formItemDefId = $("#changePublishTab2").find("table[id^=GridContent]").attr("id"); + formItemDefId = formItemDefId.substring(12, formItemDefId.length); + var params = { + processInstId : $("#processInstId").val(), + openState : $("#openState").val(), + currentPage : $("#currentPage").val(), + formData : JSON.stringify(nodes), + formItemDefId : formItemDefId, + isCreate : true, + taskInstId: $("#taskInstId").val() + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + window.top.$.simpleAlert(msg.msg, "ok", 2000); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + }, + savePublishStopData : function(nodes) { + if (nodes == undefined || nodes.length == 0) + return; + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_stop_save_data"; + var formItemDefId = $("#stopPublishTab3").find("table[id^=GridContent]").attr("id"); + formItemDefId = formItemDefId.substring(12, formItemDefId.length); + var params = { + processInstId : $("#processInstId").val(), + openState : $("#openState").val(), + currentPage : $("#currentPage").val(), + formData : JSON.stringify(nodes), + formItemDefId : formItemDefId, + isCreate : true, + taskInstId: $("#taskInstId").val() + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + window.top.$.simpleAlert(msg.msg, "ok", 2000); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + }, + publishAddContent : function(nodes) { + $("#coePublisAddBody").empty(); + var order = 0; + for (var index = 0; index < nodes.length; index++) { + var nodeObj = nodes[index]; + if (nodeObj.id.length > 16) { + order++; + var hrefUrl = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" + + nodeObj.id + "&openType=0&openAppType=1"; + var content = '' + + order + + '' + + nodeObj.fileType + + '' + + nodeObj.name + + '' + + nodeObj.fileVersion + + ''; + $("#coePublisAddBody").append(content); + } + } + }, + loadPublishAddContent : function(jsonArr) { + $("#coePublisAddBody").empty(); + var order = 0; + var content=""; + for (var index = 0; index < jsonArr.length; index++) { + var nodeObj = jsonArr[index]; + if (nodeObj.ID.length > 16) { + order++; + var hrefUrl = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" + + nodeObj.PUBLISHFILEID + "&openType=0&openAppType=1"; + content += '' + + order + + '' + + nodeObj.PUBLISTHTYPE + + '' + + nodeObj.PUBLISHFILENAME + + '' + + nodeObj.PUBLISHVERSION + + ''; + //alert(content) + } + } + $("#coePublisAddBody").append(content); + }, + loadPublishChangeContent : function(jsonArr) { + $("#coePublisChangeBody").empty(); + var order = 0; + var content=""; + for (var index = 0; index < jsonArr.length; index++) { + var nodeObj = jsonArr[index]; + if (nodeObj.ID.length > 16) { + order++; + var hrefUrl = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" + + nodeObj.CHANGEFILEID + "&openType=0&openAppType=1"; + content += '' + + order + + '' + + nodeObj.CHANGETYPE + + '' + + nodeObj.CHANGEFILENAME + + '' + + nodeObj.CHANGEDVERSION + + ''; + //alert(content) + } + } + $("#coePublisChangeBody").append(content); + }, + loadPublishStopContent : function(jsonArr) { + $("#coePublisStopBody").empty(); + var order = 0; + var content=""; + for (var index = 0; index < jsonArr.length; index++) { + var nodeObj = jsonArr[index]; + if (nodeObj.ID.length > 16) { + order++; + var hrefUrl = "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" + + nodeObj.STOPFILEID + "&openType=0&openAppType=1"; + content += '' + + order + + '' + + nodeObj.STOPTYPE + + '' + + nodeObj.STOPFILENAME + + '' + + nodeObj.STOPVERSION + + ''; + //alert(content) + } + } + $("#coePublisStopBody").append(content); + }, + loadPublishAddData:function (){ + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_add_show_data"; + var params = { + processInstId : $("#processInstId").val(), + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + CoEProcessPublish.loadPublishAddContent(msg.data); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + }, + loadPublishChangeData:function (){ + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_change_show_data"; + var params = { + processInstId : $("#processInstId").val(), + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + // CoEProcessPublish.loadPublishAddContent(msg.data); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + }, + loadPublishStopData:function (){ + var url = "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal_publish_stop_show_data"; + var params = { + processInstId : $("#processInstId").val(), + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + //CoEProcessPublish.loadPublishAddContent(msg.data); + } else { + window.top.$.simpleAlert("保存失败", "info", 2000); + } + } + }); + } }; \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.js index 89e49d18..6487e726 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.js @@ -2,135 +2,135 @@ var repositoryTree; var navtab; $(document).ready(function(){ - initTree(); - - navtab = awsui.tabs.init($("#awsui-tabs"),{ - contentPanel:$("#awsui-tabs-content"), - height:30, - noborder:true - }); - var setting = { - item : { - index : "main-index", - title : "发布历史" - }, - contextMenu : false, - close : false - }; - navtab.addTab(setting); + initTree(); + + navtab = awsui.tabs.init($("#awsui-tabs"),{ + contentPanel:$("#awsui-tabs-content"), + height:30, + noborder:true + }); + var setting = { + item : { + index : "main-index", + title : "发布历史" + }, + contextMenu : false, + close : false + }; + navtab.addTab(setting); }); function initTree() { - $("#tree").empty(); - - var setting = getSetting(); - setting.dataModel = { - data:wsTreeData - }; - repositoryTree = awsui.tree.init($("#tree"), setting); + $("#tree").empty(); + + var setting = getSetting(); + setting.dataModel = { + data:wsTreeData + }; + repositoryTree = awsui.tree.init($("#tree"), setting); } function getSetting() { - var setting = { - dblClickToExpand:true, - autoHeight:true, - event : { - onClick : clickNode, - beforeExpand : loadData - } - }; - - return setting; + var setting = { + dblClickToExpand:true, + autoHeight:true, + event : { + onClick : clickNode, + beforeExpand : loadData + } + }; + + return setting; } function loadData(treeNode) { - if (treeNode.ws && !repositoryTree.existsChildren(treeNode.id)) { - $.ajax({ - type : "POST", - url : "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_treedata&wsId=" + treeNode.id - + "&roleId=" + $("#roleId").val() + "&wsName=" + treeNode.wsName, - success : function(msg) { - var data = eval('(' + msg + ')').msg; - if (data != null && data.length != 0) { - repositoryTree.buildTree(data); - - var obj = $("a[tbindex=" + treeNode.id + "]"); - repositoryTree.expandNode(obj); - repositoryTree.changeRootIcon(obj); - } - } - }); - } + if (treeNode.ws && !repositoryTree.existsChildren(treeNode.id)) { + $.ajax({ + type : "POST", + url : "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_treedata&wsId=" + treeNode.id + + "&roleId=" + $("#roleId").val() + "&wsName=" + treeNode.wsName, + success : function(msg) { + var data = eval('(' + msg + ')').msg; + if (data != null && data.length != 0) { + repositoryTree.buildTree(data); + + var obj = $("a[tbindex=" + treeNode.id + "]"); + repositoryTree.expandNode(obj); + repositoryTree.changeRootIcon(obj); + } + } + }); + } } function clickNode(treeNode){ - if (treeNode.method && treeNode.method != "default") { - var obj = { - id : treeNode.id, - title : treeNode.name, - processDefId : treeNode.processDefId - } - openTab(obj); - } + if (treeNode.method && treeNode.method != "default") { + var obj = { + id : treeNode.id, + title : treeNode.name, + processDefId : treeNode.processDefId + } + openTab(obj); + } } function openTab(obj) { - var id = obj.id; - var title = obj.title; - var processDefId = obj.processDefId; - var url = "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" - + "&uuid=" + id + "&openType=0&processDefId=" + processDefId + "&openAppType=1&dockDisplay=" + dockDisplay; - var setting = { - item : { - index : id, - title : title - }, - contextMenu : true, - contextMenuTarget : "contextMenu1", - close : true - }; - if (navtab.existsTab(id)) { - navtab.focusTab(id); - } else { - var html = $("").appendTo(navtab.tabContentPanel); - navtab.addTab(setting); - - $.ajax({ - type : "POST", - url : "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, - success : function(msg) { - } - }); - } + var id = obj.id; + var title = obj.title; + var processDefId = obj.processDefId; + var url = "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" + + "&uuid=" + id + "&openType=0&processDefId=" + processDefId + "&openAppType=1&dockDisplay=" + dockDisplay; + var setting = { + item : { + index : id, + title : title + }, + contextMenu : true, + contextMenuTarget : "contextMenu1", + close : true + }; + if (navtab.existsTab(id)) { + navtab.focusTab(id); + } else { + var html = $("").appendTo(navtab.tabContentPanel); + navtab.addTab(setting); + + $.ajax({ + type : "POST", + url : "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, + success : function(msg) { + } + }); + } } /**********************************************查询***********************************************/ function auto_Move(obj) { - obj = obj[0]; - $(".aotuDivcontenr").css({"backgroundImage":"none","color":"black","fontWeight":"normal"}); - obj.style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; - autoIndex=obj.id.substring(obj.id.length-1); - obj.style.color="white"; + obj = obj[0]; + $(".aotuDivcontenr").css({"backgroundImage":"none","color":"black","fontWeight":"normal"}); + obj.style.backgroundImage="url('../apps/com.actionsoft.apps.coe.pal/img/pl/link.png')"; + autoIndex=obj.id.substring(obj.id.length-1); + obj.style.color="white"; } function auto_Out(obj) { - obj = obj[0]; - obj.style.backgroundImage=""; - obj.style.color="black"; - obj.style.fontWeight="normal"; + obj = obj[0]; + obj.style.backgroundImage=""; + obj.style.color="black"; + obj.style.fontWeight="normal"; } function auto_Clike(obj) { - var obj = { - id : obj.attr("plId"), - title : obj.attr("plName"), - url : "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" - + "&uuid=" + obj.attr("plId") + "&openType=0&openAppType=1" - } - openTab(obj); + var obj = { + id : obj.attr("plId"), + title : obj.attr("plName"), + url : "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" + + "&uuid=" + obj.attr("plId") + "&openType=0&openAppType=1" + } + openTab(obj); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.main.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.main.js index b5fe4940..c9e7e44d 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.main.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.main.js @@ -3,68 +3,68 @@ var count=20; var times=1; var loaded = true; function addData(){ - var top = $("#main_add").offset().top; - if(loaded && ($(window).scrollTop() + $(window).height() >= top)){ - $("#more_info").show().html("数据加载中..."); - setTimeout(function(){ - $.ajax({ - type: "POST", - url: "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_main_more&time=" + times, - success: function(msg){ - var data = eval('(' + msg + ')').msg; - if(data.length == 0){ - $("#more_info").show().text("没有更多数据"); - loaded=false; - setTimeout(function(){$("#more_info").hide()}, 2000); - }else if(data.length > 0){ - addEffect(data); - times++; - $("#more_info").show().html("下拉加载更多..."); - } + var top = $("#main_add").offset().top; + if(loaded && ($(window).scrollTop() + $(window).height() >= top)){ + $("#more_info").show().html("数据加载中..."); + setTimeout(function(){ + $.ajax({ + type: "POST", + url: "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_main_more&time=" + times, + success: function(msg){ + var data = eval('(' + msg + ')').msg; + if(data.length == 0){ + $("#more_info").show().text("没有更多数据"); + loaded=false; + setTimeout(function(){$("#more_info").hide()}, 2000); + }else if(data.length > 0){ + addEffect(data); + times++; + $("#more_info").show().html("下拉加载更多..."); } - }); - }, 500); - } + } + }); + }, 500); + } } - + function addEffect(data) { - var html = ""; - for (var i in data) { - var obj = data[i]; - if (obj.year != year) { - $("#main_div").append(""); - year = obj.year; - } - html += "
    • "; - if (obj.pid != pid) { - html += "

      " + obj.date + "

      "; - pid = obj.pid; - } else { - html += "

       

      "; - } - html += "

      " + obj.intro + "

      " - + "

       

      " - + "
      " - + "
      " - + " " - + "
      " - + "
      " + obj.desc + "
      " - + "
      " - + "
    • "; - } - $("#main_div ul:last").append(html); + var html = ""; + for (var i in data) { + var obj = data[i]; + if (obj.year != year) { + $("#main_div").append(""); + year = obj.year; + } + html += "
    • "; + if (obj.pid != pid) { + html += "

      " + obj.date + "

      "; + pid = obj.pid; + } else { + html += "

       

      "; + } + html += "

      " + obj.intro + "

      " + + "

       

      " + + "
      " + + "
      " + + " " + + "
      " + + "
      " + obj.desc + "
      " + + "
      " + + "
    • "; + } + $("#main_div ul:last").append(html); } //点击流程缩略图,打开tab function clickImage(id) { - var treeNode = parent.repositoryTree.getNodeById(id); - if(treeNode != undefined) { - var obj = { - id : treeNode.id, - title : treeNode.name, - processDefId : treeNode.processDefId - } - parent.openTab(obj); - } + var treeNode = parent.repositoryTree.getNodeById(id); + if(treeNode != undefined) { + var obj = { + id : treeNode.id, + title : treeNode.name, + processDefId : treeNode.processDefId + } + parent.openTab(obj); + } } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.search.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.search.js index f8642769..d6c1111e 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.search.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.search.js @@ -1,250 +1,250 @@ $(function () { - String.prototype.replaceAll = function(oldStr, newStr) { - return this.replace(new RegExp(oldStr,"gm"),newStr); - } - initWs(); - tabAttr.initTab(); - $(window).trigger('resize'); - tabAttr.clickTab(); + String.prototype.replaceAll = function(oldStr, newStr) { + return this.replace(new RegExp(oldStr,"gm"),newStr); + } + initWs(); + tabAttr.initTab(); + $(window).trigger('resize'); + tabAttr.clickTab(); // 检索关键词 $('#searchText').off('keypress').on('keypress', function (e) { if (e.which === 13) { - $('#search').click(); + $('#search').click(); } }); $('body').click(function(e) { var target = $(e.target); if(!target.is('#changeWsDialog *')) { - if ( $('#changeWsDialog').is(':visible') ) { - $('#changeWsDialog').hide(); - } + if ( $('#changeWsDialog').is(':visible') ) { + $('#changeWsDialog').hide(); + } } }); }); $(window).resize(function(){ - initMain(); - var totalWidth = $(window).width(); - $("#main-body [class*=width_]").each(function(){ - var className = $(this).attr("class"); - var percent = parseInt(className.substr(6, 2)); - $(this).css({"width" : (totalWidth*percent/100) - 34}); - }); + initMain(); + var totalWidth = $(window).width(); + $("#main-body [class*=width_]").each(function(){ + var className = $(this).attr("class"); + var percent = parseInt(className.substr(6, 2)); + $(this).css({"width" : (totalWidth*percent/100) - 34}); + }); }) function initMain() { - $('#main').width($(window).width()); - $('#main').height($(window).height() - $('.head-wrap').outerHeight(true) - $('.dimension-meta-bar').outerHeight(true)); - $('#main-body').height($('#main').height() - $('#main-head').height()); - $('#main-body-body').height($('#main-body').height() - $('#main-body-head').height()); + $('#main').width($(window).width()); + $('#main').height($(window).height() - $('.head-wrap').outerHeight(true) - $('.dimension-meta-bar').outerHeight(true)); + $('#main-body').height($('#main').height() - $('#main-head').height()); + $('#main-body-body').height($('#main-body').height() - $('#main-body-head').height()); } //分页设置 var page = { - pageSetting : { - pageLimit : 20, // 每页条数 - start:0//起始条数 - }, - initPageSetting : function () { - page.pageSetting.start = 0; - } + pageSetting : { + pageLimit : 20, // 每页条数 + start:0//起始条数 + }, + initPageSetting : function () { + page.pageSetting.start = 0; + } } function initWs() { $("#wsChangeArea").off("mouseenter").on("mouseenter", function () { - $('#changeWsDialog').show(); + $('#changeWsDialog').show(); }).off("mouseleave").on("mouseleave", function () { - $('#changeWsDialog').hide(); + $('#changeWsDialog').hide(); }); - var html = "
    • "; + var html = "
    • "; if (ws.length > 0) { - $('#wsId').val(ws[0].id); - $('#wsNameDiv').text(ws[0].text); - for (var i = 0; i < ws.length; i++) { - html += '
        ' + ws[i].text + '
      '; - if(ws[i].initDisplay == "1") { //initDisplay:是否是初始化的流程资产库"0"-不是;"1"-是 - $('#wsId').val(ws[i].id); - $('#wsNameDiv').text(ws[i].text); - } - } + $('#wsId').val(ws[0].id); + $('#wsNameDiv').text(ws[0].text); + for (var i = 0; i < ws.length; i++) { + html += '
        ' + ws[i].text + '
      '; + if(ws[i].initDisplay == "1") { //initDisplay:是否是初始化的流程资产库"0"-不是;"1"-是 + $('#wsId').val(ws[i].id); + $('#wsNameDiv').text(ws[i].text); + } + } } - html += "
    • "; - $('#changeWsDialog').html(html); + html += ""; + $('#changeWsDialog').html(html); } function changeWs(obj) { - $('#wsNameDiv').text($(obj).attr('name')); - $('#changeWsDialog').hide(); - if($('#wsId').val() == $(obj).attr('data-id')) return; - $('#wsId').val($(obj).attr('data-id')); - search(); + $('#wsNameDiv').text($(obj).attr('name')); + $('#changeWsDialog').hide(); + if($('#wsId').val() == $(obj).attr('data-id')) return; + $('#wsId').val($(obj).attr('data-id')); + search(); } function initHtml() { - $('#innerTable').empty(); - // $('#noAnyOne').hide(); - $('#noContent').hide(); - $('#noSearch').hide(); - $('#data-more').show(); - $('#moreDataButton').show(); - $('#noDataAlert').hide(); + $('#innerTable').empty(); + // $('#noAnyOne').hide(); + $('#noContent').hide(); + $('#noSearch').hide(); + $('#data-more').show(); + $('#moreDataButton').show(); + $('#noDataAlert').hide(); } // 搜索 function search() { - initHtml(); - tabAttr.searchText = $('#searchText').val(); - page.initPageSetting(); - var searchWsId = $('#wsId').val(); - if (searchWsId == '') { - $('#data-more').children().hide(); - // $('#noAnyOne').show(); - $('#noContent').show(); - $('#noSearch').hide(); - $.simpleAlert('没有相应的资产库权限,无法搜索相关数据', 'info'); - return; - } - var param = { - searchText : tabAttr.searchText, - searchType : tabAttr.current, - searchWsId : searchWsId, - start : page.pageSetting.start, - pageLimit : page.pageSetting.pageLimit - } - getMoreData(param); + initHtml(); + tabAttr.searchText = $('#searchText').val(); + page.initPageSetting(); + var searchWsId = $('#wsId').val(); + if (searchWsId == '') { + $('#data-more').children().hide(); + // $('#noAnyOne').show(); + $('#noContent').show(); + $('#noSearch').hide(); + $.simpleAlert('没有相应的资产库权限,无法搜索相关数据', 'info'); + return; + } + var param = { + searchText : tabAttr.searchText, + searchType : tabAttr.current, + searchWsId : searchWsId, + start : page.pageSetting.start, + pageLimit : page.pageSetting.pageLimit + } + getMoreData(param); } // 获取数据 function getMoreData(param) { - if (param == undefined) { - var searchWsId = $('#wsId').val(); - param = { - searchText : tabAttr.searchText, - searchType : tabAttr.current, - searchWsId : searchWsId, - start : page.pageSetting.start, - pageLimit : page.pageSetting.pageLimit - } - } - $.simpleAlert('正在加载数据', 'loading'); - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search_data&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - var count = r.data.count; - var data = r.data.data; - var start = page.pageSetting.start + 1; - var html = ""; - for(var i = 0; i < data.length; i++) { - data[i].name = '' + data[i].name + ''; - data[i].name = tabAttr.searchText.trim() == "" ? data[i].name : data[i].name.replaceAll(tabAttr.searchText.trim(), '
      ' + tabAttr.searchText.trim() + '
      '); - html += ''; - html += '' + (start++) + ''; - html += ''; - html += ''; - if (data[i].isPublish == 0) {// 未发布 - html += '' + data[i].name + ''; - } else { - html += '' + data[i].name + ''; - } - html += '
      '; - html += '' + data[i].path + ''; - html += ''; + if (param == undefined) { + var searchWsId = $('#wsId').val(); + param = { + searchText : tabAttr.searchText, + searchType : tabAttr.current, + searchWsId : searchWsId, + start : page.pageSetting.start, + pageLimit : page.pageSetting.pageLimit + } + } + $.simpleAlert('正在加载数据', 'loading'); + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search_data&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + var count = r.data.count; + var data = r.data.data; + var start = page.pageSetting.start + 1; + var html = ""; + for(var i = 0; i < data.length; i++) { + data[i].name = '' + data[i].name + ''; + data[i].name = tabAttr.searchText.trim() == "" ? data[i].name : data[i].name.replaceAll(tabAttr.searchText.trim(), '
      ' + tabAttr.searchText.trim() + '
      '); + html += ''; + html += '' + (start++) + ''; + html += ''; + html += ''; + if (data[i].isPublish == 0) {// 未发布 + html += '' + data[i].name + ''; + } else { + html += '' + data[i].name + ''; + } + html += '
      '; + html += '' + data[i].path + ''; + html += ''; // html += ''; // html += '' + data[i].user + '
      ' + data[i].dept + ''; - html += '' + data[i].user + '
      '; - html += '' + data[i].dept + ''; - html += ''; - html += '' + transferDateFormat(data[i].date) + ''; - html += 'V' + data[i].version + '.0'; - var desc = data[i].desc; - if(desc == '') { - desc = "无"; - } - html += '' + desc + ''; - html += ''; - } - if (data.length != 0) { - $('#innerTable').append(html); - $(window).trigger('resize'); - } - page.pageSetting.start = page.pageSetting.start + data.length; - if (count == 0) {// 最后一页 - $('#data-more').children().hide(); - if(page.pageSetting.start == 0) {// 没有数据 - if(tabAttr.searchText.trim() == '') { - $('#noSearch').hide(); - $('#noContent').show(); - } else { - $('#noContent').hide(); - $('#noSearch').show(); - } - // $('#noAnyOne').show(); - } else { - $('#noDataAlert').show(); - } - } else { - if (count < page.pageSetting.pageLimit) { - $('#data-more').children().hide(); - $('#noDataAlert').show(); - } - // $.simpleAlert('加载成功', 'ok'); - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) + html += '' + data[i].user + '
      '; + html += '' + data[i].dept + ''; + html += ''; + html += '' + transferDateFormat(data[i].date) + ''; + html += 'V' + data[i].version + '.0'; + var desc = data[i].desc; + if(desc == '') { + desc = "无"; + } + html += '' + desc + ''; + html += ''; + } + if (data.length != 0) { + $('#innerTable').append(html); + $(window).trigger('resize'); + } + page.pageSetting.start = page.pageSetting.start + data.length; + if (count == 0) {// 最后一页 + $('#data-more').children().hide(); + if(page.pageSetting.start == 0) {// 没有数据 + if(tabAttr.searchText.trim() == '') { + $('#noSearch').hide(); + $('#noContent').show(); + } else { + $('#noContent').hide(); + $('#noSearch').show(); + } + // $('#noAnyOne').show(); + } else { + $('#noDataAlert').show(); + } + } else { + if (count < page.pageSetting.pageLimit) { + $('#data-more').children().hide(); + $('#noDataAlert').show(); + } + // $.simpleAlert('加载成功', 'ok'); + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) } // 页签栏 var tabAttr = { - current : 'all', - searchText : '', - initTab : function() { - tabAttr.current = type; - tabAttr.searchText = text; - $('#searchText').val(tabAttr.searchText); - var html = ''; - for(var i = 0; i < scope.length; i++) { - var curr = scope[i]; - if (curr.type == 'all') { - html += '
      '; - html += ''+ curr.name +''; - html += '
      '; - } else { - html += '
      '; - html += curr.name; - html += '
      '; - } - } - - $('#tab').html(html); - }, - clickTab : function(obj) { - // 背景色重置 - $('#tab').find('div[name=first]').removeClass('select-first'); - $('#tab').find('div[name=other]').removeClass('select-other'); - $('#tab').find('div[name=first]').addClass('unselect-first'); - $('#tab').find('div[name=other]').addClass('unselect-other'); - if (obj) { - // 设置当前tab - tabAttr.current = $(obj).attr('id'); - } - if (tabAttr.current == 'all') { - $('#' + tabAttr.current).removeClass('unselect-first'); - $('#' + tabAttr.current).addClass('select-first'); - } else { - $('#' + tabAttr.current).removeClass('unselect-other'); - $('#' + tabAttr.current).addClass('select-other'); - } - search(); - } + current : 'all', + searchText : '', + initTab : function() { + tabAttr.current = type; + tabAttr.searchText = text; + $('#searchText').val(tabAttr.searchText); + var html = ''; + for(var i = 0; i < scope.length; i++) { + var curr = scope[i]; + if (curr.type == 'all') { + html += '
      '; + html += ''+ curr.name +''; + html += '
      '; + } else { + html += '
      '; + html += curr.name; + html += '
      '; + } + } + + $('#tab').html(html); + }, + clickTab : function(obj) { + // 背景色重置 + $('#tab').find('div[name=first]').removeClass('select-first'); + $('#tab').find('div[name=other]').removeClass('select-other'); + $('#tab').find('div[name=first]').addClass('unselect-first'); + $('#tab').find('div[name=other]').addClass('unselect-other'); + if (obj) { + // 设置当前tab + tabAttr.current = $(obj).attr('id'); + } + if (tabAttr.current == 'all') { + $('#' + tabAttr.current).removeClass('unselect-first'); + $('#' + tabAttr.current).addClass('select-first'); + } else { + $('#' + tabAttr.current).removeClass('unselect-other'); + $('#' + tabAttr.current).addClass('select-other'); + } + search(); + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index.js index 86533fb0..7681f7f2 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index.js @@ -2,560 +2,560 @@ var repositoryTree; var navtab; $(document).ready(function(){ - if (wsTreeData.length > 0) { - initTree(); - } else { - $("#tree").html("没有可查看的流程"); - } + if (wsTreeData.length > 0) { + initTree(); + } else { + $("#tree").html("没有可查看的流程"); + } - $("#userName, #userName_icon").unbind("click").bind("click", function(){ - $("#appviewport2-top-right-dialog").slideToggle("fast"); - $(".content-icons").toggleClass("up_black"); - }); - $(document).off("click.close").on("click.close", function(e){ + $("#userName, #userName_icon").unbind("click").bind("click", function(){ + $("#appviewport2-top-right-dialog").slideToggle("fast"); + $(".content-icons").toggleClass("up_black"); + }); + $(document).off("click.close").on("click.close", function(e){ $('#appviewport2-top-right-dialog').hide(); $("#userName_icon.content-icons").removeClass("up_black"); }); $('#appviewport2-top-right-dialog, #userName, #userName_icon').click(function(e1){ e1.stopPropagation(); // 阻止事件冒泡 }); - + $("#select_type span").on("click", function(){ - searchPublishList($(this)); + searchPublishList($(this)); }) - + //设置默认参数 $("#isComment").customSelect("<#isComment>"); $("#isPrint").customSelect("<#isPrint>"); $("#isViewAttribute").customSelect("<#isViewAttribute>"); $("#isViewHistory").customSelect("<#isViewHistory>"); - - // 强制修改密码 - if (forceChangePwd) { - modifyPwd(); - } - // 如果不允许修改密码 - if (!isSecurityPwdChange) { - $('#updatePwd').remove(); - } - - //app设置 + + // 强制修改密码 + if (forceChangePwd) { + modifyPwd(); + } + // 如果不允许修改密码 + if (!isSecurityPwdChange) { + $('#updatePwd').remove(); + } + + //app设置 $("#relationSearch").off("click").on("click", function(){ - var $this = $(this); - $("#tree .current").removeClass("current"); - $("div.active").removeClass("active"); - $this.addClass("active"); - var id = $this.attr("appId"); - var title = $this.attr("name"); - var cmd = id.replace(/\_/g, ".") + $this.attr("cmd"); - var src = "./w?sid=" + $("#sid").val() + "&cmd=" + cmd + "&wsIds=" + wsIds + "&modelIds=" + modelIds; - openAppTab(id, title, src); + var $this = $(this); + $("#tree .current").removeClass("current"); + $("div.active").removeClass("active"); + $this.addClass("active"); + var id = $this.attr("appId"); + var title = $this.attr("name"); + var cmd = id.replace(/\_/g, ".") + $this.attr("cmd"); + var src = "./w?sid=" + $("#sid").val() + "&cmd=" + cmd + "&wsIds=" + wsIds + "&modelIds=" + modelIds; + openAppTab(id, title, src); }) }); function initTree() { - $("#tree").empty(); - - var setting = getSetting(); - setting.dataModel = { - data:wsTreeData - }; - repositoryTree = awsui.tree.init($("#tree"), setting); + $("#tree").empty(); + + var setting = getSetting(); + setting.dataModel = { + data:wsTreeData + }; + repositoryTree = awsui.tree.init($("#tree"), setting); } function getSetting() { - var setting = { - dblClickToExpand:true, - autoHeight:true, - event : { - onClick : clickNode - } - }; - - return setting; + var setting = { + dblClickToExpand:true, + autoHeight:true, + event : { + onClick : clickNode + } + }; + + return setting; } function clickNode(treeNode){ - if (!$("#home_iframe").is(":visible")) { - $("#main_publish_content").css({"position": "relative"}); - $("#mainPublishList").css({"position": "absolute", "width": "90%"}); - $("#mainPublishList").animate({ - width: "0px", - height: "0px", - top: "-50px", - right: "0px" - }, 1000, function(){ - $("#mainPublishList").hide(); - $("#home_iframe").show(); - }) - } - - var ids = ""; - var childrenNodeIds; - if (treeNode.pid == null) { - childrenNodeIds = repositoryTree.getChildrenByPid(treeNode.id); - if (childrenNodeIds != undefined && childrenNodeIds.length > 0) { - for (var i in childrenNodeIds) { - ids += childrenNodeIds[i].id + ","; - } - } - } else { - childrenNodeIds = repositoryTree.getNodeIdsByPid(treeNode.id); - if (childrenNodeIds != undefined && childrenNodeIds.length > 0) { - for (var i in childrenNodeIds) { - ids += childrenNodeIds[i] + ","; - } - } - } - - if (ids.length > 0) { - ids = ids.substring(0, ids.length-1); - } - palIds = ids; - if (window.frames["home_iframe"].contentWindow) { - window.frames["home_iframe"].contentWindow.clickNodeToSearch(ids); - } else if (window.frames["home_iframe"].window) { - window.frames["home_iframe"].window.clickNodeToSearch(ids); - } + if (!$("#home_iframe").is(":visible")) { + $("#main_publish_content").css({"position": "relative"}); + $("#mainPublishList").css({"position": "absolute", "width": "90%"}); + $("#mainPublishList").animate({ + width: "0px", + height: "0px", + top: "-50px", + right: "0px" + }, 1000, function(){ + $("#mainPublishList").hide(); + $("#home_iframe").show(); + }) + } + + var ids = ""; + var childrenNodeIds; + if (treeNode.pid == null) { + childrenNodeIds = repositoryTree.getChildrenByPid(treeNode.id); + if (childrenNodeIds != undefined && childrenNodeIds.length > 0) { + for (var i in childrenNodeIds) { + ids += childrenNodeIds[i].id + ","; + } + } + } else { + childrenNodeIds = repositoryTree.getNodeIdsByPid(treeNode.id); + if (childrenNodeIds != undefined && childrenNodeIds.length > 0) { + for (var i in childrenNodeIds) { + ids += childrenNodeIds[i] + ","; + } + } + } + + if (ids.length > 0) { + ids = ids.substring(0, ids.length-1); + } + palIds = ids; + if (window.frames["home_iframe"].contentWindow) { + window.frames["home_iframe"].contentWindow.clickNodeToSearch(ids); + } else if (window.frames["home_iframe"].window) { + window.frames["home_iframe"].window.clickNodeToSearch(ids); + } } //获取路径 function getNavigation() { - var navigation = ""; - var selectNode = repositoryTree.getSelectedNode(); - if (selectNode != undefined && selectNode != null) { - navigation = "" + selectNode.name + "" + " > " + navigation; - var parentNode = repositoryTree.getParentNodeById(selectNode.id); - while (parentNode != undefined && parentNode != null) { - navigation = "" + parentNode.name + "" + " > " + navigation; - parentNode = repositoryTree.getParentNodeById(parentNode.id); - } - } - if (navigation != "") { - navigation = navigation.substring(0, navigation.length - 3); - } - return navigation; + var navigation = ""; + var selectNode = repositoryTree.getSelectedNode(); + if (selectNode != undefined && selectNode != null) { + navigation = "" + selectNode.name + "" + " > " + navigation; + var parentNode = repositoryTree.getParentNodeById(selectNode.id); + while (parentNode != undefined && parentNode != null) { + navigation = "" + parentNode.name + "" + " > " + navigation; + parentNode = repositoryTree.getParentNodeById(parentNode.id); + } + } + if (navigation != "") { + navigation = navigation.substring(0, navigation.length - 3); + } + return navigation; } //点击导航 function clickNavigation(nodeId) { - repositoryTree.selectNode(nodeId, true); - var node = repositoryTree.getNodeById(nodeId); - clickNode(node); + repositoryTree.selectNode(nodeId, true); + var node = repositoryTree.getNodeById(nodeId); + clickNode(node); } function openTab(obj) { - var id = obj.id; - var title = obj.title; - var processDefId = obj.processDefId; - var url = "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" - + "&uuid=" + id + "&openType=0&processDefId=" + processDefId + "&openAppType=1&dockDisplay=" + dockDisplay + "&filePerms=" + modelIds; - var setting = { - item : { - index : id, - title : title - }, - contextMenu : true, - contextMenuTarget : "contextMenu1", - close : true - }; - if (navtab.existsTab(id)) { - navtab.focusTab(id); - } else { - var html = $("").appendTo(navtab.tabContentPanel); - navtab.addTab(setting); - - $.ajax({ - type : "POST", - url : "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, - success : function(msg) { - } - }); - } + var id = obj.id; + var title = obj.title; + var processDefId = obj.processDefId; + var url = "./w?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer" + + "&uuid=" + id + "&openType=0&processDefId=" + processDefId + "&openAppType=1&dockDisplay=" + dockDisplay + "&filePerms=" + modelIds; + var setting = { + item : { + index : id, + title : title + }, + contextMenu : true, + contextMenuTarget : "contextMenu1", + close : true + }; + if (navtab.existsTab(id)) { + navtab.focusTab(id); + } else { + var html = $("").appendTo(navtab.tabContentPanel); + navtab.addTab(setting); + + $.ajax({ + type : "POST", + url : "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, + success : function(msg) { + } + }); + } } //打开app的tab function openAppTab(id, title, src) { - var setting = { - item : { - index : id, - title : title - }, - contextMenu : true, - contextMenuTarget : "contextMenu1", - close : true - }; - if (navtab.existsTab(id)) { - navtab.focusTab(id); - } else { - var html = $("").appendTo(navtab.tabContentPanel); - navtab.addTab(setting); - } + var setting = { + item : { + index : id, + title : title + }, + contextMenu : true, + contextMenuTarget : "contextMenu1", + close : true + }; + if (navtab.existsTab(id)) { + navtab.focusTab(id); + } else { + var html = $("").appendTo(navtab.tabContentPanel); + navtab.addTab(setting); + } } /********************************************显示发布历史*****************************************************/ function searchPublishList(obj) { - $("#select_type span").removeClass("current"); - obj.addClass("current"); - var publishType = obj.attr("publishType"); - if (publishType == undefined) { - publishType = ""; - } - $.ajax({ - type : "POST", - url : "./jd?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_publish_list", - data: { - start: 0, - type: publishType - }, - success : function(msg) { - var datas = msg.data.results; - var html = ""; - var pid = ""; - for (var i in datas) { - if (pid != datas[i].pid) { - pid = datas[i].pid; - if (html != "") { - html += ' ' - + ''; - } - var color = "green"; - var publishType = "新发布"; - if (datas[i].type == "N") { - color = "green"; - publishType = "新发布"; - } else if (datas[i].type == "C") { - color = "blue"; - publishType = "变更"; - } else if (datas[i].type == "S") { - color = "red"; - publishType = "停用"; - } - html += '
      ' - + '
      ' + datas[i].date + '
      ' - + '
      ' + datas[i].pDesc + '
      ' - + '
      '; - } - - var color = "green"; - var publishType = "新发布"; - if (datas[i].type == "N") { - color = "green"; - publishType = "新发布"; - } else if (datas[i].type == "C") { - color = "blue"; - publishType = "变更"; - } else if (datas[i].type == "S") { - color = "red"; - publishType = "停用"; - } - var onclick = ""; - var cursorStyle = ""; - if (modelIds.indexOf(datas[i].repositoryId) > -1) { - onclick = 'openTab({id:\'' + datas[i].repositoryId + '\', title:\'' + datas[i].repositoryName + '\'})'; - cursorStyle = "cursor: pointer;"; - } - html += '
      ' - + ' ' - + ' ' - + '
      '; - - } - if (html != "") { - html += '
      ' - + '
      '; - } - $("#publish_history_list").html(html); - } - }); + $("#select_type span").removeClass("current"); + obj.addClass("current"); + var publishType = obj.attr("publishType"); + if (publishType == undefined) { + publishType = ""; + } + $.ajax({ + type : "POST", + url : "./jd?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_publish_list", + data: { + start: 0, + type: publishType + }, + success : function(msg) { + var datas = msg.data.results; + var html = ""; + var pid = ""; + for (var i in datas) { + if (pid != datas[i].pid) { + pid = datas[i].pid; + if (html != "") { + html += ' ' + + ''; + } + var color = "green"; + var publishType = "新发布"; + if (datas[i].type == "N") { + color = "green"; + publishType = "新发布"; + } else if (datas[i].type == "C") { + color = "blue"; + publishType = "变更"; + } else if (datas[i].type == "S") { + color = "red"; + publishType = "停用"; + } + html += '
      ' + + '
      ' + datas[i].date + '
      ' + + '
      ' + datas[i].pDesc + '
      ' + + '
      '; + } + + var color = "green"; + var publishType = "新发布"; + if (datas[i].type == "N") { + color = "green"; + publishType = "新发布"; + } else if (datas[i].type == "C") { + color = "blue"; + publishType = "变更"; + } else if (datas[i].type == "S") { + color = "red"; + publishType = "停用"; + } + var onclick = ""; + var cursorStyle = ""; + if (modelIds.indexOf(datas[i].repositoryId) > -1) { + onclick = 'openTab({id:\'' + datas[i].repositoryId + '\', title:\'' + datas[i].repositoryName + '\'})'; + cursorStyle = "cursor: pointer;"; + } + html += '
      ' + + ' ' + + ' ' + + '
      '; + + } + if (html != "") { + html += '
      ' + + '
      '; + } + $("#publish_history_list").html(html); + } + }); } function showPublishList() { - if ($("#publish_history").is(":hidden")) { - var height = $("#publish_history").height(); - $("#publish_history_list").css({"height": (height - 78) + "px"}); - $("#publish_history").show(); - - if ($("#publish_history_list").text().length == 0) { - searchPublishList($("#publish_list_all")); - } - } else { - $("#publish_history").hide(); - } + if ($("#publish_history").is(":hidden")) { + var height = $("#publish_history").height(); + $("#publish_history_list").css({"height": (height - 78) + "px"}); + $("#publish_history").show(); + + if ($("#publish_history_list").text().length == 0) { + searchPublishList($("#publish_list_all")); + } + } else { + $("#publish_history").hide(); + } } /********************************************门户其他操作*****************************************************/ //修改密码 function modifyPwd() { - $("#userName").click(); - $("#modify_dialog").dialog({ - width: 500, - title: "修改登录口令", - buttons: [ - {text:'确定',cls:"blue",handler:function(){ - var oldPassword = $('#oldPassword').val(); - var password = $('#password').val(); - var confirmPassword = $('#confirmPassword').val(); - - if (oldPassword.trim() == "") { - $.simpleAlert("[旧口令]不允许为空", "info"); - return; - } - if (password.trim() == "") { - $.simpleAlert("[新口令]不允许为空", "info"); - return; - } - if (confirmPassword.trim() == "") { - $.simpleAlert("[确认口令]不允许为空", "info"); - return; - } - if (oldPassword == password) { - $.simpleAlert("新口令不能和旧口令相同", "info"); - return false; - } - if (password != confirmPassword) { - $.simpleAlert("新口令和确认口令不一致", "info"); - return; - } - if (password.indexOf(" ") > -1) { - $.simpleAlert("[新口令]不能包含空格", "info", 2000); - return false; - } - if (confirmPassword.indexOf(" ") > -1) { - $.simpleAlert("[确认口令]不能包含空格", "info", 2000); - return false; - } - if (Loginpassword.validateUpdateLoginpassword(password, "[新口令]")) { - return false; - } - var params={}; - params.sid=$("input[name='sid']").val(); - params.cmd="CLIENT_P_PERSON_CONFIG_PW_ISRIGHT"; - params.oldpwd=oldPassword; - $.ajax({ - type: "POST", - url: "./w", - data: params, - success: function(msg){ - if(msg== '-1'){ - $.simpleAlert("旧口令输入错误,请重新输入", "error", 2000); - return false; - } - - var maxLength = securityMaxPwdLength; - if (length2(oldPassword) > maxLength||length2(password) > maxLength || length2(confirmPassword) > maxLength) { - $.simpleAlert("口令长度不能超过" + maxLength + "位", "info", 2000); - return false; - } - //增加口令长度判断,默认情况下关闭 - if (!checkPasswordLength(password, confirmPassword)) { - return false; - } - //增加口令复杂度校验,默认情况下关闭 - if (!checkPasswordSecurity('password')) { - return false; - } - var params={}; - params.sid=$("input[name='sid']").val(); - params.cmd="CLIENT_P_PERSON_CONFIG_PW_SAVE"; - params.oldpwd=oldPassword; - params.newpwd=password; - $.ajax({ - type: "POST", - url: "./w", - data: params, - success: function(msg){ - if(awsui.decode(msg)){ - var r=awsui.decode(msg); - $.simpleAlert(r.msg, r.result, 2000, {callback:function(){ - if(r.result == 'ok'){ - $("#modify_dialog").dialog("close"); - } - }}); - } - } - }); - } - }); - - } - }, - - {text:'关闭',handler:function(){ - $("#modify_dialog").dialog('close'); - } - } - ] - }); + $("#userName").click(); + $("#modify_dialog").dialog({ + width: 500, + title: "修改登录口令", + buttons: [ + {text:'确定',cls:"blue",handler:function(){ + var oldPassword = $('#oldPassword').val(); + var password = $('#password').val(); + var confirmPassword = $('#confirmPassword').val(); + + if (oldPassword.trim() == "") { + $.simpleAlert("[旧口令]不允许为空", "info"); + return; + } + if (password.trim() == "") { + $.simpleAlert("[新口令]不允许为空", "info"); + return; + } + if (confirmPassword.trim() == "") { + $.simpleAlert("[确认口令]不允许为空", "info"); + return; + } + if (oldPassword == password) { + $.simpleAlert("新口令不能和旧口令相同", "info"); + return false; + } + if (password != confirmPassword) { + $.simpleAlert("新口令和确认口令不一致", "info"); + return; + } + if (password.indexOf(" ") > -1) { + $.simpleAlert("[新口令]不能包含空格", "info", 2000); + return false; + } + if (confirmPassword.indexOf(" ") > -1) { + $.simpleAlert("[确认口令]不能包含空格", "info", 2000); + return false; + } + if (Loginpassword.validateUpdateLoginpassword(password, "[新口令]")) { + return false; + } + var params={}; + params.sid=$("input[name='sid']").val(); + params.cmd="CLIENT_P_PERSON_CONFIG_PW_ISRIGHT"; + params.oldpwd=oldPassword; + $.ajax({ + type: "POST", + url: "./w", + data: params, + success: function(msg){ + if(msg== '-1'){ + $.simpleAlert("旧口令输入错误,请重新输入", "error", 2000); + return false; + } + + var maxLength = securityMaxPwdLength; + if (length2(oldPassword) > maxLength||length2(password) > maxLength || length2(confirmPassword) > maxLength) { + $.simpleAlert("口令长度不能超过" + maxLength + "位", "info", 2000); + return false; + } + //增加口令长度判断,默认情况下关闭 + if (!checkPasswordLength(password, confirmPassword)) { + return false; + } + //增加口令复杂度校验,默认情况下关闭 + if (!checkPasswordSecurity('password')) { + return false; + } + var params={}; + params.sid=$("input[name='sid']").val(); + params.cmd="CLIENT_P_PERSON_CONFIG_PW_SAVE"; + params.oldpwd=oldPassword; + params.newpwd=password; + $.ajax({ + type: "POST", + url: "./w", + data: params, + success: function(msg){ + if(awsui.decode(msg)){ + var r=awsui.decode(msg); + $.simpleAlert(r.msg, r.result, 2000, {callback:function(){ + if(r.result == 'ok'){ + $("#modify_dialog").dialog("close"); + } + }}); + } + } + }); + } + }); + + } + }, + + {text:'关闭',handler:function(){ + $("#modify_dialog").dialog('close'); + } + } + ] + }); } //切换到CoE function entryCoE() { - var params = {}; - params.cmd = 'CLIENT_USER_BPMCLIENT_SID'; - params.type = 'COE'; - params.sid = $("#sid").val(); - document.frm.cmd.value = "com.actionsoft.apps.coe.pal_user_home_page"; - var newSid; - awsui.ajax.request({ - type : "POST", - url : "./jd", - async : false, - dataType : "json", - data : params, - success : function(data) { - newSid = data.data.sid; - if (newSid == undefined) { - $.simpleAlert("获取SID不正确", "info"); - return; - } - document.frm.sid.value = newSid; - document.frm.target = "_self"; - document.frm.submit(); - } - }); + var params = {}; + params.cmd = 'CLIENT_USER_BPMCLIENT_SID'; + params.type = 'COE'; + params.sid = $("#sid").val(); + document.frm.cmd.value = "com.actionsoft.apps.coe.pal_user_home_page"; + var newSid; + awsui.ajax.request({ + type : "POST", + url : "./jd", + async : false, + dataType : "json", + data : params, + success : function(data) { + newSid = data.data.sid; + if (newSid == undefined) { + $.simpleAlert("获取SID不正确", "info"); + return; + } + document.frm.sid.value = newSid; + document.frm.target = "_self"; + document.frm.submit(); + } + }); } //参数设置 function setting() { - $("#userName").click(); - awsui.ajax.request({ - url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting_data", - method : "POST", - ok : function(r) { - var data = r.data; - $("#isComment").customSelect(data.isComment); - $("#isPrint").customSelect(data.isPrint); - $("#isViewAttribute").customSelect(data.isViewAttribute); - $("#isViewHistory").customSelect(data.isViewHistory); - $("#title").val(data.title); - $("#fotter").val(data.fotter); - - $("#setting_dialog").dialog({ - width: 500, - title: "设置参数", - buttons: [ - {text:'确定',cls:"blue",handler:function(){ - //门户标题 - var title = $("#title").val(); - if (title == "") { - $.simpleAlert("[门户标题]不允许为空"); - return; - } - if (strlen(title) > 20) { - $.simpleAlert("[门户标题]长度不允许超过20个字符"); - return; - } - //页底信息 - var fotter = $("#fotter").val(); - if (fotter == "") { - $.simpleAlert("[页底信息]不允许为空"); - return; - } - if (strlen(fotter) > 40) { - $.simpleAlert("[页底信息]长度不允许超过40个字符"); - return; - } - //允许留言 - var isComment = $("#isComment").val().trim(); - if (isComment == "") { - $.simpleAlert("[允许留言]不允许为空"); - return; - } - if (isComment != "true" && isComment != "false") { - $.simpleAlert("[允许留言]应该为'true'或'false'"); - return; - } - //允许打印 - var isPrint = $("#isPrint").val().trim(); - if (isPrint == "") { - $.simpleAlert("[允许打印]不允许为空"); - return; - } - if (isPrint != "true" && isPrint != "false") { - $.simpleAlert("[允许打印]应该为'true'或'false'"); - return; - } - //允许查看属性 - var isViewAttribute = $("#isViewAttribute").val().trim(); - if (isViewAttribute == "") { - $.simpleAlert("[允许查看属性]不允许为空"); - return; - } - if (isViewAttribute != "true" && isViewAttribute != "false") { - $.simpleAlert("[允许查看属性]应该为'true'或'false'"); - return; - } - //允许查看发布历史 - var isViewHistory = $("#isViewHistory").val().trim(); - if (isViewHistory == "") { - $.simpleAlert("[允许查看发布历史]不允许为空"); - return; - } - if (isViewHistory != "true" && isViewHistory != "false") { - $.simpleAlert("[允许查看发布历史]应该为'true'或'false'"); - return; - } - $.ajax({ - type: "POST", - url: "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting", - data: { - title: title, - fotter: fotter, - isComment: isComment, - isPrint: isPrint, - isViewAttribute: isViewAttribute, - isViewHistory: isViewHistory - }, - success: function(msg) { - if (msg.result == "ok") { - $.simpleAlert("修改成功", "ok", {callback:function(){ - $("#setting_dialog").dialog('close'); - location.reload(); - } - }); - } else { - $.simpleAlert(msg.msg, msg.result); - } - } - }) - - } - }, - - {text:'关闭',handler:function(){ - $("#setting_dialog").dialog('close'); - } - } - ] - }); - }, - err:function(r){ - } - }); - + $("#userName").click(); + awsui.ajax.request({ + url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting_data", + method : "POST", + ok : function(r) { + var data = r.data; + $("#isComment").customSelect(data.isComment); + $("#isPrint").customSelect(data.isPrint); + $("#isViewAttribute").customSelect(data.isViewAttribute); + $("#isViewHistory").customSelect(data.isViewHistory); + $("#title").val(data.title); + $("#fotter").val(data.fotter); + + $("#setting_dialog").dialog({ + width: 500, + title: "设置参数", + buttons: [ + {text:'确定',cls:"blue",handler:function(){ + //门户标题 + var title = $("#title").val(); + if (title == "") { + $.simpleAlert("[门户标题]不允许为空"); + return; + } + if (strlen(title) > 20) { + $.simpleAlert("[门户标题]长度不允许超过20个字符"); + return; + } + //页底信息 + var fotter = $("#fotter").val(); + if (fotter == "") { + $.simpleAlert("[页底信息]不允许为空"); + return; + } + if (strlen(fotter) > 40) { + $.simpleAlert("[页底信息]长度不允许超过40个字符"); + return; + } + //允许留言 + var isComment = $("#isComment").val().trim(); + if (isComment == "") { + $.simpleAlert("[允许留言]不允许为空"); + return; + } + if (isComment != "true" && isComment != "false") { + $.simpleAlert("[允许留言]应该为'true'或'false'"); + return; + } + //允许打印 + var isPrint = $("#isPrint").val().trim(); + if (isPrint == "") { + $.simpleAlert("[允许打印]不允许为空"); + return; + } + if (isPrint != "true" && isPrint != "false") { + $.simpleAlert("[允许打印]应该为'true'或'false'"); + return; + } + //允许查看属性 + var isViewAttribute = $("#isViewAttribute").val().trim(); + if (isViewAttribute == "") { + $.simpleAlert("[允许查看属性]不允许为空"); + return; + } + if (isViewAttribute != "true" && isViewAttribute != "false") { + $.simpleAlert("[允许查看属性]应该为'true'或'false'"); + return; + } + //允许查看发布历史 + var isViewHistory = $("#isViewHistory").val().trim(); + if (isViewHistory == "") { + $.simpleAlert("[允许查看发布历史]不允许为空"); + return; + } + if (isViewHistory != "true" && isViewHistory != "false") { + $.simpleAlert("[允许查看发布历史]应该为'true'或'false'"); + return; + } + $.ajax({ + type: "POST", + url: "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting", + data: { + title: title, + fotter: fotter, + isComment: isComment, + isPrint: isPrint, + isViewAttribute: isViewAttribute, + isViewHistory: isViewHistory + }, + success: function(msg) { + if (msg.result == "ok") { + $.simpleAlert("修改成功", "ok", {callback:function(){ + $("#setting_dialog").dialog('close'); + location.reload(); + } + }); + } else { + $.simpleAlert(msg.msg, msg.result); + } + } + }) + + } + }, + + {text:'关闭',handler:function(){ + $("#setting_dialog").dialog('close'); + } + } + ] + }); + }, + err:function(r){ + } + }); + } //退出 function logout() { - $("#userName").click(); - var sid = $("#sid").val(); - $.confirm({'title': "提示", - content: '确认离开系统吗?', - onConfirm: function() { - window.location.href = "./w?sid="+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_logout'; - window.history = -1; - } - }); + $("#userName").click(); + var sid = $("#sid").val(); + $.confirm({'title': "提示", + content: '确认离开系统吗?', + onConfirm: function() { + window.location.href = "./w?sid="+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_logout'; + window.history = -1; + } + }); } //判断字符长度 @@ -563,7 +563,7 @@ function strlen(str) { var len = 0; for (var i = 0; i < str.length; i++) { var c = str.charCodeAt(i); - //单字节加1 + //单字节加1 if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { len++; } @@ -575,114 +575,114 @@ function strlen(str) { } function changeTabTitle(id, TabTitle, uuid) { - navtab.changeIndex(id, uuid); - navtab.setTitle(uuid, TabTitle); + navtab.changeIndex(id, uuid); + navtab.setTitle(uuid, TabTitle); } function openTabCustom(id, url, title) { - var setting = { - item : { - index : id, - title : title - }, - close : true - }; - if (navtab.existsTab(id)) { - navtab.focusTab(id); - } else { - var html = $("").appendTo(navtab.tabContentPanel); - navtab.addTab(setting); - } + var setting = { + item : { + index : id, + title : title + }, + close : true + }; + if (navtab.existsTab(id)) { + navtab.focusTab(id); + } else { + var html = $("").appendTo(navtab.tabContentPanel); + navtab.addTab(setting); + } } //安全验证 function checkPasswordSecurity(id) { - if (jQuery("#complexity").val() == "false"||jQuery("#complexity").val()==undefined) { - return true; - }//不进行验证 - var val = jQuery("input[name=" + id + "]").val(); - //必须是数字和大小写字母 - if (val.match("^[A-Za-z0-9]+$")) {//val.match("^[A-Za-z0-9]+$").length > 0 - //必须包含数字和大小写字母 - if (val.match("[A-Z]+") && val.match("[a-z]+") && val.match("[0-9]+")) { - return true; - } else { - $.simpleAlert("安全级别过低请使用大小写字母和数字", "error", 2000); - return false; - } - } else { - $.simpleAlert("请使用大小写字母和数字不能包含其他特殊字符", "error", 2000); - - return false; - } + if (jQuery("#complexity").val() == "false"||jQuery("#complexity").val()==undefined) { + return true; + }//不进行验证 + var val = jQuery("input[name=" + id + "]").val(); + //必须是数字和大小写字母 + if (val.match("^[A-Za-z0-9]+$")) {//val.match("^[A-Za-z0-9]+$").length > 0 + //必须包含数字和大小写字母 + if (val.match("[A-Z]+") && val.match("[a-z]+") && val.match("[0-9]+")) { + return true; + } else { + $.simpleAlert("安全级别过低请使用大小写字母和数字", "error", 2000); + return false; + } + } else { + $.simpleAlert("请使用大小写字母和数字不能包含其他特殊字符", "error", 2000); + + return false; + } } //判断口令长度 function checkPasswordLength(pwd1, pwd2) { - var minLength = jQuery("#minLength").val(); - if (length2(pwd1) < minLength || length2(pwd2) < minLength) { - $.simpleAlert("口令长度不能少于" + minLength + "位", "error", 2000); - return false; - } else { - return true; - } + var minLength = jQuery("#minLength").val(); + if (length2(pwd1) < minLength || length2(pwd2) < minLength) { + $.simpleAlert("口令长度不能少于" + minLength + "位", "error", 2000); + return false; + } else { + return true; + } } //判断口令的复杂程度 function checkPasswordStrength(pwd1) { - var len = pwd1.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length; - /*len值: - 1: 密码有一种组合 - 2: 密码有两种组合 - 3: 密码有三种组合 - 4: 密码有四种组合 - 四种组合指 数字,小写字母,大写字母,其它字符 - */ - if (len < 3) {//此处3可修改为上面列表中的值,判断强度等级 - $.simpleAlert("密码的强度较弱请使用大小写英文字母数字和特殊字符的组合", "error", 2000); - return true; - } else { - return false; - } + var len = pwd1.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length; + /*len值: + 1: 密码有一种组合 + 2: 密码有两种组合 + 3: 密码有三种组合 + 4: 密码有四种组合 + 四种组合指 数字,小写字母,大写字母,其它字符 + */ + if (len < 3) {//此处3可修改为上面列表中的值,判断强度等级 + $.simpleAlert("密码的强度较弱请使用大小写英文字母数字和特殊字符的组合", "error", 2000); + return true; + } else { + return false; + } } -//判断一个串实际长度(1个中文2个单位) + //判断一个串实际长度(1个中文2个单位) function length2(txtValue){ - if (txtValue!=null) { - if (txtValue.indexOf('.')!=-1) { - txtValue = txtValue.substring(1,txtValue.indexOf('.')); - txtValue = txtValue.split(",").join(""); - } - } - var cArr = txtValue.match(/[^\x00-\xff]/ig); - return txtValue.length + (cArr == null ? 0 : cArr.length); + if (txtValue!=null) { + if (txtValue.indexOf('.')!=-1) { + txtValue = txtValue.substring(1,txtValue.indexOf('.')); + txtValue = txtValue.split(",").join(""); + } + } + var cArr = txtValue.match(/[^\x00-\xff]/ig); + return txtValue.length + (cArr == null ? 0 : cArr.length); } $(window).resize(function(){ - //设置tree外层div高度,以设置滚动条 - var width = $("#appviewport2-top-right").width(); - if (version == "v1") { - $("#tree").parent().height($(window).height() - 50); - } else if (version == "v2") { - $("#tree").parent().height($(window).height() - 115); - $("#orgTree").parent().height($(window).height() - 115); - } - - //设置tab宽度 - if ($("#show_left").is(":hidden")) { - $("#awsui-tabs").css({"width": $(window).width() - 65 - width, "display": "inline-block", "float": "left"}); - } else { - $("#awsui-tabs").css({"width": $(window).width() - 273 - width, "display": "inline-block", "float": "left"}); - } - //设置tab宽度 - if ($("#extend_tabs")) { - var tab_width = $("#title").width() - $("#awsui-tabs1").width() - $("#setting_div").width() - 50; - $("#extend_tabs").width(tab_width); - } - //右侧消息栏高度 - var height = $("#publish_history").height(); - $("#publish_history_list").css({"height": (height - 78) + "px"}); + //设置tree外层div高度,以设置滚动条 + var width = $("#appviewport2-top-right").width(); + if (version == "v1") { + $("#tree").parent().height($(window).height() - 50); + } else if (version == "v2") { + $("#tree").parent().height($(window).height() - 115); + $("#orgTree").parent().height($(window).height() - 115); + } + + //设置tab宽度 + if ($("#show_left").is(":hidden")) { + $("#awsui-tabs").css({"width": $(window).width() - 65 - width, "display": "inline-block", "float": "left"}); + } else { + $("#awsui-tabs").css({"width": $(window).width() - 273 - width, "display": "inline-block", "float": "left"}); + } + //设置tab宽度 + if ($("#extend_tabs")) { + var tab_width = $("#title").width() - $("#awsui-tabs1").width() - $("#setting_div").width() - 50; + $("#extend_tabs").width(tab_width); + } + //右侧消息栏高度 + var height = $("#publish_history").height(); + $("#publish_history_list").css({"height": (height - 78) + "px"}); }) \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index1.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index1.js index d58747a4..a8cacbe7 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index1.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index1.js @@ -2,153 +2,153 @@ var orgTree; //标准化体系资产库树 var tab2Inited = false; //tab2是否已经初始化 function loadMainPublishListData(obj) { - $("#main_type_select span").removeClass("current"); - obj.addClass("current"); - var publishType = obj.attr("publishType"); - if (publishType == undefined) { - publishType = ""; - } - $.ajax({ - type : "POST", - url : "./jd?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_publish_list", - data: { - start: 0, - type: publishType - }, - success : function(msg) { - var datas = msg.data.results; - var html = ""; - var pid = ""; - for (var i in datas) { - if (pid != datas[i].pid) { - pid = datas[i].pid; - if (html != "") { - html += ' ' - + ''; - } - var color = "green"; - var publishType = "新发布"; - if (datas[i].type == "N") { - color = "green"; - publishType = "新发布"; - } else if (datas[i].type == "C") { - color = "blue"; - publishType = "变更"; - } else if (datas[i].type == "S") { - color = "red"; - publishType = "停用"; - } - html += '
      ' - + '
      ' + datas[i].date + '
      ' - + '
      ' + datas[i].pDesc + '
      ' - + '
      '; - } - - var color = "green"; - var publishType = "新发布"; - if (datas[i].type == "N") { - color = "green"; - publishType = "新发布"; - } else if (datas[i].type == "C") { - color = "blue"; - publishType = "变更"; - } else if (datas[i].type == "S") { - color = "red"; - publishType = "停用"; - } - var onclick = ""; - var cursorStyle = ""; - if (modelIds.indexOf(datas[i].repositoryId) > -1) { - if (datas[i].method == "default") { - onclick = 'javascript:$.simpleAlert(\'不支持文件目录打开\',\'info\');'; - } else { - onclick = 'openTab({id:\'' + datas[i].repositoryId + '\', title:\'' + datas[i].repositoryName + '\'})'; - } - cursorStyle = "cursor: pointer;"; - } - html += '
        ' - + '
      • ' - + ' ' + datas[i].repositoryName + datas[i].repositoryVersion + '' + publishType + '' - + '
      • ' - + '
      '; - - } - if (html != "") { - html += '
      ' - + '
      '; - } - $("#main_publish_content").html(html); - } - }); + $("#main_type_select span").removeClass("current"); + obj.addClass("current"); + var publishType = obj.attr("publishType"); + if (publishType == undefined) { + publishType = ""; + } + $.ajax({ + type : "POST", + url : "./jd?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_publish_list", + data: { + start: 0, + type: publishType + }, + success : function(msg) { + var datas = msg.data.results; + var html = ""; + var pid = ""; + for (var i in datas) { + if (pid != datas[i].pid) { + pid = datas[i].pid; + if (html != "") { + html += ' ' + + ''; + } + var color = "green"; + var publishType = "新发布"; + if (datas[i].type == "N") { + color = "green"; + publishType = "新发布"; + } else if (datas[i].type == "C") { + color = "blue"; + publishType = "变更"; + } else if (datas[i].type == "S") { + color = "red"; + publishType = "停用"; + } + html += '
      ' + + '
      ' + datas[i].date + '
      ' + + '
      ' + datas[i].pDesc + '
      ' + + '
      '; + } + + var color = "green"; + var publishType = "新发布"; + if (datas[i].type == "N") { + color = "green"; + publishType = "新发布"; + } else if (datas[i].type == "C") { + color = "blue"; + publishType = "变更"; + } else if (datas[i].type == "S") { + color = "red"; + publishType = "停用"; + } + var onclick = ""; + var cursorStyle = ""; + if (modelIds.indexOf(datas[i].repositoryId) > -1) { + if (datas[i].method == "default") { + onclick = 'javascript:$.simpleAlert(\'不支持文件目录打开\',\'info\');'; + } else { + onclick = 'openTab({id:\'' + datas[i].repositoryId + '\', title:\'' + datas[i].repositoryName + '\'})'; + } + cursorStyle = "cursor: pointer;"; + } + html += '
        ' + + '
      • ' + + ' ' + datas[i].repositoryName + datas[i].repositoryVersion + '' + publishType + '' + + '
      • ' + + '
      '; + + } + if (html != "") { + html += '
      ' + + '
      '; + } + $("#main_publish_content").html(html); + } + }); } function openTab(obj) { - $("#content").hide(); - $("#extend_content").show(); - var dockOption = dockDisplay.replace(/"/g, '"'); - var id = obj.id; - var title = obj.title; - var processDefId = obj.processDefId; - var url = './w?sid=' + encodeURIComponent($('#sid').val()) + '&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer' - + '&uuid=' + id + '&openType=0&processDefId=' + processDefId + '&openAppType=1&dockDisplay=' + dockOption; - var setting = { - item : { - index : id, - title : title - }, - contextMenu : true, - contextMenuTarget : "contextMenu1", - close : true - }; - if (navtab.existsTab(id)) { - navtab.focusTab(id); - } else { - var html = $("").appendTo(navtab.tabContentPanel); - - var formHtml = '
      ' - + ' ' - + '
      '; - - document.getElementById(id).contentWindow.document.write(formHtml); - - document.getElementById(id).contentWindow.document.getElementById('postData_form').submit(); - - navtab.addTab(setting); - - $.ajax({ - type : "POST", - url : "./w?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, - success : function(msg) { - } - }); - } + $("#content").hide(); + $("#extend_content").show(); + var dockOption = dockDisplay.replace(/"/g, '"'); + var id = obj.id; + var title = obj.title; + var processDefId = obj.processDefId; + var url = './w?sid=' + encodeURIComponent($('#sid').val()) + '&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer_viewer' + + '&uuid=' + id + '&openType=0&processDefId=' + processDefId + '&openAppType=1&dockDisplay=' + dockOption; + var setting = { + item : { + index : id, + title : title + }, + contextMenu : true, + contextMenuTarget : "contextMenu1", + close : true + }; + if (navtab.existsTab(id)) { + navtab.focusTab(id); + } else { + var html = $("").appendTo(navtab.tabContentPanel); + + var formHtml = '
      ' + + ' ' + + '
      '; + + document.getElementById(id).contentWindow.document.write(formHtml); + + document.getElementById(id).contentWindow.document.getElementById('postData_form').submit(); + + navtab.addTab(setting); + + $.ajax({ + type : "POST", + url : "./w?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_update_viewcount&repositoryId=" + id, + success : function(msg) { + } + }); + } } function openDesginerFromAttr(uuid, openType, plName, appId, processVersionId, - isOpenDialog, shapeId) { - var obj = { - id: uuid, - title: plName, - processDefId: processVersionId - } - openTab(obj); + isOpenDialog, shapeId) { + var obj = { + id: uuid, + title: plName, + processDefId: processVersionId + } + openTab(obj); } //点击主标题 function clickMainTab() { - $("#extend_tabs .awsui-tabs-items.current").removeClass("current"); - $('#extend_content').hide(); - $('#content').show(); + $("#extend_tabs .awsui-tabs-items.current").removeClass("current"); + $('#extend_content').hide(); + $('#content').show(); } //初始化标准化体系tab中的内容 function initTab2(tab, newTabId) { - if (newTabId == "tab2" && !tab2Inited) { - $("#tab2_iframe").attr("src", "./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_org_relation_page"); - - tab2Inited = true; - } + if (newTabId == "tab2" && !tab2Inited) { + $("#tab2_iframe").attr("src", "./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_org_relation_page"); + + tab2Inited = true; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index2.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index2.js index 5ea8f27e..ea1e1f08 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index2.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.index2.js @@ -4,335 +4,335 @@ var navtab; $(document).ready(function(){ $("#user").off("mouseenter").on("mouseenter", function () { - $("#appviewport2-top-right-dialog").slideToggle("fast"); - $(".content-icons").toggleClass("up_black"); + $("#appviewport2-top-right-dialog").slideToggle("fast"); + $(".content-icons").toggleClass("up_black"); }).off("mouseleave").on("mouseleave", function () { - $('#appviewport2-top-right-dialog').hide(); - $("#userName_icon.content-icons").removeClass("up_black"); + $('#appviewport2-top-right-dialog').hide(); + $("#userName_icon.content-icons").removeClass("up_black"); }); - + $('#appviewport2-top-right-dialog, #userName, #userName_icon').click(function(e1){ e1.stopPropagation(); // 阻止事件冒泡 }); - + $("#select_type span").on("click", function(){ - searchPublishList($(this)); + searchPublishList($(this)); }) - - // 检索关键词 + + // 检索关键词 $('#searchText').off('keypress').on('keypress', function (e) { if (e.which === 13) { - $('#search').click(); + $('#search').click(); } }); - - // 强制修改密码 - if (forceChangePwd) { - modifyPwd(); - } - // 如果不允许修改密码 - if (!isSecurityPwdChange) { - $('#updatePwd').remove(); - } - initWs(); + + // 强制修改密码 + if (forceChangePwd) { + modifyPwd(); + } + // 如果不允许修改密码 + if (!isSecurityPwdChange) { + $('#updatePwd').remove(); + } + initWs(); }); // 初始化资产库 function initWs() { - $("#wsChangeArea").off("mouseenter").on("mouseenter", function () { - $('#changeWsDialog').show(); - }).off("mouseleave").on("mouseleave", function () { - $('#changeWsDialog').hide(); - }); - var html = "
    • "; - if (ws.length > 0) { - $('#wsId').val(ws[0].id); - $('#wsNameDiv').text(ws[0].text); - for (var i = 0; i < ws.length; i++) { - html += '
        ' + ws[i].text + '
      '; - if(ws[i].initDisplay == "1") { //initDisplay:是否是初始化的流程资产库"0"-不是;"1"-是 - $('#wsId').val(ws[i].id); - $('#wsNameDiv').text(ws[i].text); - } - } - } - html += "
    • "; - $('#changeWsDialog').html(html); + $("#wsChangeArea").off("mouseenter").on("mouseenter", function () { + $('#changeWsDialog').show(); + }).off("mouseleave").on("mouseleave", function () { + $('#changeWsDialog').hide(); + }); + var html = "
    • "; + if (ws.length > 0) { + $('#wsId').val(ws[0].id); + $('#wsNameDiv').text(ws[0].text); + for (var i = 0; i < ws.length; i++) { + html += '
        ' + ws[i].text + '
      '; + if(ws[i].initDisplay == "1") { //initDisplay:是否是初始化的流程资产库"0"-不是;"1"-是 + $('#wsId').val(ws[i].id); + $('#wsNameDiv').text(ws[i].text); + } + } + } + html += "
    • "; + $('#changeWsDialog').html(html); } function changeWs(obj) { - $('#wsNameDiv').text($(obj).attr('name')); - $('#changeWsDialog').hide(); - if($('#wsId').val() == $(obj).attr('data-id')) return; - $('#wsId').val($(obj).attr('data-id')); - var activeTab = $('#tabs').children('a.active').attr('tit'); - onchange('', activeTab); + $('#wsNameDiv').text($(obj).attr('name')); + $('#changeWsDialog').hide(); + if($('#wsId').val() == $(obj).attr('data-id')) return; + $('#wsId').val($(obj).attr('data-id')); + var activeTab = $('#tabs').children('a.active').attr('tit'); + onchange('', activeTab); } /********************************************门户其他操作*****************************************************/ //修改密码 function modifyPwd() { - $('#modify_dialog').find('input').val(''); - $("#userName").click(); - $("#modify_dialog").dialog({ - width: 610, - title: "修改登录口令", - closable: false, - buttons: [ - {text:'确定',cls:"blue",handler:function(){ - var oldPassword = $('#oldPassword').val(); - var password = $('#password').val(); - var confirmPassword = $('#confirmPassword').val(); - - if (oldPassword.trim() == "") { - $.simpleAlert("[旧口令]不允许为空", "info"); - return; - } - if (password.trim() == "") { - $.simpleAlert("[新口令]不允许为空", "info"); - return; - } - if (confirmPassword.trim() == "") { - $.simpleAlert("[确认口令]不允许为空", "info"); - return; - } - if (oldPassword == password) { - $.simpleAlert("新口令不能和旧口令相同", "info"); - return false; - } - if (password != confirmPassword) { - $.simpleAlert("新口令和确认口令不一致", "info"); - return; - } - if (password.indexOf(" ") > -1) { - $.simpleAlert("[新口令]不能包含空格", "info", 2000); - return false; - } - if (confirmPassword.indexOf(" ") > -1) { - $.simpleAlert("[确认口令]不能包含空格", "info", 2000); - return false; - } - if (Loginpassword.validateUpdateLoginpassword(password, "[新口令]")) { - return false; - } - var params={}; - params.sid=$("input[name='sid']").val(); - params.cmd="CLIENT_P_PERSON_CONFIG_PW_ISRIGHT"; - params.oldpwd=oldPassword; - $.ajax({ - type: "POST", - url: "./w", - data: params, - success: function(msg){ - if(msg== '-1'){ - $.simpleAlert("旧口令输入错误,请重新输入", "error", 2000); - return false; - } - - var maxLength = securityMaxPwdLength; - if (length2(oldPassword) > maxLength||length2(password) > maxLength || length2(confirmPassword) > maxLength) { - $.simpleAlert("口令长度不能超过" + maxLength + "位", "info", 2000); - return false; - } - //增加口令长度判断,默认情况下关闭 - if (!checkPasswordLength(password, confirmPassword)) { - return false; - } - //增加口令复杂度校验,默认情况下关闭 - if (!checkPasswordSecurity('password')) { - return false; - } - var params={}; - params.sid=$("input[name='sid']").val(); - params.cmd="CLIENT_P_PERSON_CONFIG_PW_SAVE"; - params.oldpwd=oldPassword; - params.newpwd=password; - $.ajax({ - type: "POST", - url: "./w", - data: params, - success: function(msg){ - if(awsui.decode(msg)){ - var r=awsui.decode(msg); - $.simpleAlert(r.msg, r.result, 2000, {callback:function(){ - if(r.result == 'ok'){ - $("#modify_dialog").dialog("close"); - } - }}); - } - } - }); - } - }); - } - }, - {text:'关闭',handler:function(){ - $("#modify_dialog").dialog('close'); - } - } - ] - }); + $('#modify_dialog').find('input').val(''); + $("#userName").click(); + $("#modify_dialog").dialog({ + width: 610, + title: "修改登录口令", + closable: false, + buttons: [ + {text:'确定',cls:"blue",handler:function(){ + var oldPassword = $('#oldPassword').val(); + var password = $('#password').val(); + var confirmPassword = $('#confirmPassword').val(); + + if (oldPassword.trim() == "") { + $.simpleAlert("[旧口令]不允许为空", "info"); + return; + } + if (password.trim() == "") { + $.simpleAlert("[新口令]不允许为空", "info"); + return; + } + if (confirmPassword.trim() == "") { + $.simpleAlert("[确认口令]不允许为空", "info"); + return; + } + if (oldPassword == password) { + $.simpleAlert("新口令不能和旧口令相同", "info"); + return false; + } + if (password != confirmPassword) { + $.simpleAlert("新口令和确认口令不一致", "info"); + return; + } + if (password.indexOf(" ") > -1) { + $.simpleAlert("[新口令]不能包含空格", "info", 2000); + return false; + } + if (confirmPassword.indexOf(" ") > -1) { + $.simpleAlert("[确认口令]不能包含空格", "info", 2000); + return false; + } + if (Loginpassword.validateUpdateLoginpassword(password, "[新口令]")) { + return false; + } + var params={}; + params.sid=$("input[name='sid']").val(); + params.cmd="CLIENT_P_PERSON_CONFIG_PW_ISRIGHT"; + params.oldpwd=oldPassword; + $.ajax({ + type: "POST", + url: "./w", + data: params, + success: function(msg){ + if(msg== '-1'){ + $.simpleAlert("旧口令输入错误,请重新输入", "error", 2000); + return false; + } + + var maxLength = securityMaxPwdLength; + if (length2(oldPassword) > maxLength||length2(password) > maxLength || length2(confirmPassword) > maxLength) { + $.simpleAlert("口令长度不能超过" + maxLength + "位", "info", 2000); + return false; + } + //增加口令长度判断,默认情况下关闭 + if (!checkPasswordLength(password, confirmPassword)) { + return false; + } + //增加口令复杂度校验,默认情况下关闭 + if (!checkPasswordSecurity('password')) { + return false; + } + var params={}; + params.sid=$("input[name='sid']").val(); + params.cmd="CLIENT_P_PERSON_CONFIG_PW_SAVE"; + params.oldpwd=oldPassword; + params.newpwd=password; + $.ajax({ + type: "POST", + url: "./w", + data: params, + success: function(msg){ + if(awsui.decode(msg)){ + var r=awsui.decode(msg); + $.simpleAlert(r.msg, r.result, 2000, {callback:function(){ + if(r.result == 'ok'){ + $("#modify_dialog").dialog("close"); + } + }}); + } + } + }); + } + }); + } + }, + {text:'关闭',handler:function(){ + $("#modify_dialog").dialog('close'); + } + } + ] + }); } //切换到CoE function entryCoE() { - var params = {}; - params.cmd = 'CLIENT_USER_BPMCLIENT_SID'; - params.type = 'COE'; - params.sid = $("#sid").val(); - document.frm.cmd.value = "com.actionsoft.apps.coe.pal_user_home_page"; - var newSid; - awsui.ajax.request({ - type : "POST", - url : "./jd", - async : false, - dataType : "json", - data : params, - success : function(data) { - newSid = data.data.sid; - if (newSid == undefined) { - $.simpleAlert("获取SID不正确", "info"); - return; - } - document.frm.sid.value = newSid; - document.frm.target = "_self"; - document.frm.submit(); - } - }); + var params = {}; + params.cmd = 'CLIENT_USER_BPMCLIENT_SID'; + params.type = 'COE'; + params.sid = $("#sid").val(); + document.frm.cmd.value = "com.actionsoft.apps.coe.pal_user_home_page"; + var newSid; + awsui.ajax.request({ + type : "POST", + url : "./jd", + async : false, + dataType : "json", + data : params, + success : function(data) { + newSid = data.data.sid; + if (newSid == undefined) { + $.simpleAlert("获取SID不正确", "info"); + return; + } + document.frm.sid.value = newSid; + document.frm.target = "_self"; + document.frm.submit(); + } + }); } //参数设置 function setting() { - $("#userName").click(); - awsui.ajax.request({ - url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting_data", - method : "POST", - ok : function(r) { - var data = r.data; - $("#isComment").customSelect(data.isComment); - $("#isPrint").customSelect(data.isPrint); - $("#isViewAttribute").customSelect(data.isViewAttribute); - $("#isViewHistory").customSelect(data.isViewHistory); - $("#title").val(data.title); - $("#fotter").val(data.fotter); - - $("#setting_dialog").dialog({ - width: 500, - title: "设置参数", - buttons: [ - {text:'确定',cls:"blue",handler:function(){ - //门户标题 - var title = $("#title").val(); - if (title == "") { - $.simpleAlert("[门户标题]不允许为空"); - return; - } - if (strlen(title) > 20) { - $.simpleAlert("[门户标题]长度不允许超过20个字符"); - return; - } - //页底信息 - var fotter = $("#fotter").val(); - if (fotter == "") { - $.simpleAlert("[页底信息]不允许为空"); - return; - } - if (strlen(fotter) > 40) { - $.simpleAlert("[页底信息]长度不允许超过40个字符"); - return; - } - //允许留言 - var isComment = $("#isComment").val().trim(); - if (isComment == "") { - $.simpleAlert("[允许留言]不允许为空"); - return; - } - if (isComment != "true" && isComment != "false") { - $.simpleAlert("[允许留言]应该为'true'或'false'"); - return; - } - //允许打印 - var isPrint = $("#isPrint").val().trim(); - if (isPrint == "") { - $.simpleAlert("[允许打印]不允许为空"); - return; - } - if (isPrint != "true" && isPrint != "false") { - $.simpleAlert("[允许打印]应该为'true'或'false'"); - return; - } - //允许查看属性 - var isViewAttribute = $("#isViewAttribute").val().trim(); - if (isViewAttribute == "") { - $.simpleAlert("[允许查看属性]不允许为空"); - return; - } - if (isViewAttribute != "true" && isViewAttribute != "false") { - $.simpleAlert("[允许查看属性]应该为'true'或'false'"); - return; - } - //允许查看发布历史 - var isViewHistory = $("#isViewHistory").val().trim(); - if (isViewHistory == "") { - $.simpleAlert("[允许查看发布历史]不允许为空"); - return; - } - if (isViewHistory != "true" && isViewHistory != "false") { - $.simpleAlert("[允许查看发布历史]应该为'true'或'false'"); - return; - } - $.ajax({ - type: "POST", - url: "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting", - data: { - title: title, - fotter: fotter, - isComment: isComment, - isPrint: isPrint, - isViewAttribute: isViewAttribute, - isViewHistory: isViewHistory - }, - success: function(msg) { - if (msg.result == "ok") { - $.simpleAlert("修改成功", "ok", {callback:function(){ - $("#setting_dialog").dialog('close'); - location.reload(); - } - }); - } else { - $.simpleAlert(msg.msg, msg.result); - } - } - }) - - } - }, - - {text:'关闭',handler:function(){ - $("#setting_dialog").dialog('close'); - } - } - ] - }); - }, - err:function(r){ - } - }); - + $("#userName").click(); + awsui.ajax.request({ + url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting_data", + method : "POST", + ok : function(r) { + var data = r.data; + $("#isComment").customSelect(data.isComment); + $("#isPrint").customSelect(data.isPrint); + $("#isViewAttribute").customSelect(data.isViewAttribute); + $("#isViewHistory").customSelect(data.isViewHistory); + $("#title").val(data.title); + $("#fotter").val(data.fotter); + + $("#setting_dialog").dialog({ + width: 500, + title: "设置参数", + buttons: [ + {text:'确定',cls:"blue",handler:function(){ + //门户标题 + var title = $("#title").val(); + if (title == "") { + $.simpleAlert("[门户标题]不允许为空"); + return; + } + if (strlen(title) > 20) { + $.simpleAlert("[门户标题]长度不允许超过20个字符"); + return; + } + //页底信息 + var fotter = $("#fotter").val(); + if (fotter == "") { + $.simpleAlert("[页底信息]不允许为空"); + return; + } + if (strlen(fotter) > 40) { + $.simpleAlert("[页底信息]长度不允许超过40个字符"); + return; + } + //允许留言 + var isComment = $("#isComment").val().trim(); + if (isComment == "") { + $.simpleAlert("[允许留言]不允许为空"); + return; + } + if (isComment != "true" && isComment != "false") { + $.simpleAlert("[允许留言]应该为'true'或'false'"); + return; + } + //允许打印 + var isPrint = $("#isPrint").val().trim(); + if (isPrint == "") { + $.simpleAlert("[允许打印]不允许为空"); + return; + } + if (isPrint != "true" && isPrint != "false") { + $.simpleAlert("[允许打印]应该为'true'或'false'"); + return; + } + //允许查看属性 + var isViewAttribute = $("#isViewAttribute").val().trim(); + if (isViewAttribute == "") { + $.simpleAlert("[允许查看属性]不允许为空"); + return; + } + if (isViewAttribute != "true" && isViewAttribute != "false") { + $.simpleAlert("[允许查看属性]应该为'true'或'false'"); + return; + } + //允许查看发布历史 + var isViewHistory = $("#isViewHistory").val().trim(); + if (isViewHistory == "") { + $.simpleAlert("[允许查看发布历史]不允许为空"); + return; + } + if (isViewHistory != "true" && isViewHistory != "false") { + $.simpleAlert("[允许查看发布历史]应该为'true'或'false'"); + return; + } + $.ajax({ + type: "POST", + url: "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_setting", + data: { + title: title, + fotter: fotter, + isComment: isComment, + isPrint: isPrint, + isViewAttribute: isViewAttribute, + isViewHistory: isViewHistory + }, + success: function(msg) { + if (msg.result == "ok") { + $.simpleAlert("修改成功", "ok", {callback:function(){ + $("#setting_dialog").dialog('close'); + location.reload(); + } + }); + } else { + $.simpleAlert(msg.msg, msg.result); + } + } + }) + + } + }, + + {text:'关闭',handler:function(){ + $("#setting_dialog").dialog('close'); + } + } + ] + }); + }, + err:function(r){ + } + }); + } //退出 function logout() { - $("#userName").click(); - var sid = $("#sid").val(); - $.confirm({'title': "提示", - content: '确认离开系统吗?', - onConfirm: function() { - window.location.href = "./w?sid="+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_logout'; - window.history = -1; - } - }); + $("#userName").click(); + var sid = $("#sid").val(); + $.confirm({'title': "提示", + content: '确认离开系统吗?', + onConfirm: function() { + window.location.href = "./w?sid="+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_logout'; + window.history = -1; + } + }); } //判断字符长度 @@ -340,7 +340,7 @@ function strlen(str) { var len = 0; for (var i = 0; i < str.length; i++) { var c = str.charCodeAt(i); - //单字节加1 + //单字节加1 if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) { len++; } @@ -353,63 +353,63 @@ function strlen(str) { //安全验证 function checkPasswordSecurity(id) { - if (jQuery("#complexity").val() == "false"||jQuery("#complexity").val()==undefined) { - return true; - }//不进行验证 - var val = jQuery("input[name=" + id + "]").val(); - //必须是数字和大小写字母 - if (val.match("^[A-Za-z0-9]+$")) {//val.match("^[A-Za-z0-9]+$").length > 0 - //必须包含数字和大小写字母 - if (val.match("[A-Z]+") && val.match("[a-z]+") && val.match("[0-9]+")) { - return true; - } else { - $.simpleAlert("安全级别过低请使用大小写字母和数字", "error", 2000); - return false; - } - } else { - $.simpleAlert("请使用大小写字母和数字不能包含其他特殊字符", "error", 2000); - - return false; - } + if (jQuery("#complexity").val() == "false"||jQuery("#complexity").val()==undefined) { + return true; + }//不进行验证 + var val = jQuery("input[name=" + id + "]").val(); + //必须是数字和大小写字母 + if (val.match("^[A-Za-z0-9]+$")) {//val.match("^[A-Za-z0-9]+$").length > 0 + //必须包含数字和大小写字母 + if (val.match("[A-Z]+") && val.match("[a-z]+") && val.match("[0-9]+")) { + return true; + } else { + $.simpleAlert("安全级别过低请使用大小写字母和数字", "error", 2000); + return false; + } + } else { + $.simpleAlert("请使用大小写字母和数字不能包含其他特殊字符", "error", 2000); + + return false; + } } //判断口令长度 function checkPasswordLength(pwd1, pwd2) { - var minLength = jQuery("#minLength").val(); - if (length2(pwd1) < minLength || length2(pwd2) < minLength) { - $.simpleAlert("口令长度不能少于" + minLength + "位", "error", 2000); - return false; - } else { - return true; - } + var minLength = jQuery("#minLength").val(); + if (length2(pwd1) < minLength || length2(pwd2) < minLength) { + $.simpleAlert("口令长度不能少于" + minLength + "位", "error", 2000); + return false; + } else { + return true; + } } //判断口令的复杂程度 function checkPasswordStrength(pwd1) { - var len = pwd1.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length; - /*len值: - 1: 密码有一种组合 - 2: 密码有两种组合 - 3: 密码有三种组合 - 4: 密码有四种组合 - 四种组合指 数字,小写字母,大写字母,其它字符 - */ - if (len < 3) {//此处3可修改为上面列表中的值,判断强度等级 - $.simpleAlert("密码的强度较弱请使用大小写英文字母数字和特殊字符的组合", "error", 2000); - return true; - } else { - return false; - } + var len = pwd1.match(/[a-z](?![^a-z]*[a-z])|[A-Z](?![^A-Z]*[A-Z])|\d(?![^\d]*\d)|[^a-zA-Z\d](?![a-zA-Z\d]*[^a-zA-Z\d])/g).length; + /*len值: + 1: 密码有一种组合 + 2: 密码有两种组合 + 3: 密码有三种组合 + 4: 密码有四种组合 + 四种组合指 数字,小写字母,大写字母,其它字符 + */ + if (len < 3) {//此处3可修改为上面列表中的值,判断强度等级 + $.simpleAlert("密码的强度较弱请使用大小写英文字母数字和特殊字符的组合", "error", 2000); + return true; + } else { + return false; + } } -//判断一个串实际长度(1个中文2个单位) + //判断一个串实际长度(1个中文2个单位) function length2(txtValue){ - if (txtValue!=null) { - if (txtValue.indexOf('.')!=-1) { - txtValue = txtValue.substring(1,txtValue.indexOf('.')); - txtValue = txtValue.split(",").join(""); - } - } - var cArr = txtValue.match(/[^\x00-\xff]/ig); - return txtValue.length + (cArr == null ? 0 : cArr.length); + if (txtValue!=null) { + if (txtValue.indexOf('.')!=-1) { + txtValue = txtValue.substring(1,txtValue.indexOf('.')); + txtValue = txtValue.split(",").join(""); + } + } + var cArr = txtValue.match(/[^\x00-\xff]/ig); + return txtValue.length + (cArr == null ? 0 : cArr.length); } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.main.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.main.js index fa7175ee..d66eecf7 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.main.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.main.js @@ -1,218 +1,218 @@ //修改展示方式 function changeShowStyle(obj){ - $("#show_style_icon span").removeClass("current"); - obj.addClass("current"); - if (obj.attr("iconType") == "tile") { - $("#content_tile").show(); - $("#content_list").hide(); - } else { - $("#content_tile").hide(); - $("#content_list").show(); - } + $("#show_style_icon span").removeClass("current"); + obj.addClass("current"); + if (obj.attr("iconType") == "tile") { + $("#content_tile").show(); + $("#content_list").hide(); + } else { + $("#content_tile").hide(); + $("#content_list").show(); + } } //查询数据 function search(palIds) { - var filter = {}; - var plrdValue = ""; - var plrpValue = ""; - var publishdateValue = ""; - $("#filter-content #plrd li.selected").each(function(){ - plrdValue += $(this).attr("filterValue") + ","; - }) - $("#filter-content #plrp li.selected").each(function(){ - plrpValue += $(this).attr("filterValue") + ","; - }) - $("#filter-content #publishdate li.selected").each(function(){ - publishdateValue += $(this).attr("filterValue") + ","; - }) - if (plrdValue.length > 0) { - filter.plrd = plrdValue.substring(0, plrdValue.length - 1); - } - if (plrpValue.length > 0) { - filter.plrp = plrpValue.substring(0, plrpValue.length - 1); - } - if (publishdateValue.length > 0) { - filter.publishdate = publishdateValue.substring(0, publishdateValue.length - 1); - } - - var params = { - palIds: palIds, - filter: json2String(filter), - order: $('#order_select').val(), - name: $('#palName').val() - } - awsui.ajax.request({ - url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search", - method : "POST", - data : params, - ok : function(msg) { - write(msg.data.result); - }, - err:function(r){ - } - }); + var filter = {}; + var plrdValue = ""; + var plrpValue = ""; + var publishdateValue = ""; + $("#filter-content #plrd li.selected").each(function(){ + plrdValue += $(this).attr("filterValue") + ","; + }) + $("#filter-content #plrp li.selected").each(function(){ + plrpValue += $(this).attr("filterValue") + ","; + }) + $("#filter-content #publishdate li.selected").each(function(){ + publishdateValue += $(this).attr("filterValue") + ","; + }) + if (plrdValue.length > 0) { + filter.plrd = plrdValue.substring(0, plrdValue.length - 1); + } + if (plrpValue.length > 0) { + filter.plrp = plrpValue.substring(0, plrpValue.length - 1); + } + if (publishdateValue.length > 0) { + filter.publishdate = publishdateValue.substring(0, publishdateValue.length - 1); + } + + var params = { + palIds: palIds, + filter: json2String(filter), + order: $('#order_select').val(), + name: $('#palName').val() + } + awsui.ajax.request({ + url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search", + method : "POST", + data : params, + ok : function(msg) { + write(msg.data.result); + }, + err:function(r){ + } + }); } //生成搜索结果html function write(data) { - var html = ""; - var html_list = ""; - for (var i in data) { - var style = ""; - var click = ""; - var dbclick=""; - if (data[i].methodId == "default") { - style = "cursor: default;"; - dbclick="dbClickModelLi($(this))"; - } else { - click = "clickModelLi($(this))"; - style = "cursor: pointer;"; - if (data[i].isActive == false) { - click = "clickDisActiveLi(); return false;"; - } - } - html += "
    • " - + "
      " - + " " - + "
    • "; - - var image = ""; - if (data[i].methodId == "default") { - image = "../apps/com.actionsoft.apps.coe.pal.publisher/img/folder.png"; - } else { - image = "../apps/com.actionsoft.apps.coe.pal.publisher/img/file.png"; - } - html_list += "" - + " " + data[i].name + "" - + " " + data[i].publishDate + "" - + " " + data[i].version + "" - + " " + data[i].plrd + "" - + " " + data[i].plrp + "" - + ""; - } - $("#content_tile ul").html(html); - $("#content_table tbody").html(html_list); - + var html = ""; + var html_list = ""; + for (var i in data) { + var style = ""; + var click = ""; + var dbclick=""; + if (data[i].methodId == "default") { + style = "cursor: default;"; + dbclick="dbClickModelLi($(this))"; + } else { + click = "clickModelLi($(this))"; + style = "cursor: pointer;"; + if (data[i].isActive == false) { + click = "clickDisActiveLi(); return false;"; + } + } + html += "
    • " + + "
      " + + " " + + "
    • "; + + var image = ""; + if (data[i].methodId == "default") { + image = "../apps/com.actionsoft.apps.coe.pal.publisher/img/folder.png"; + } else { + image = "../apps/com.actionsoft.apps.coe.pal.publisher/img/file.png"; + } + html_list += "" + + " " + data[i].name + "" + + " " + data[i].publishDate + "" + + " " + data[i].version + "" + + " " + data[i].plrd + "" + + " " + data[i].plrp + "" + + ""; + } + $("#content_tile ul").html(html); + $("#content_table tbody").html(html_list); + } function clickNodeToSearch(ids) { - var navigation = parent.getNavigation(); - $("#navigation").html(navigation); - $("#navigation a").on("click", function(){ - var nodeId = $(this).attr("nodeId"); - parent.clickNavigation(nodeId); - }); - - var palIds = parent.palIds; - if (ids != undefined) { - palIds = ids; - } - search(palIds); + var navigation = parent.getNavigation(); + $("#navigation").html(navigation); + $("#navigation a").on("click", function(){ + var nodeId = $(this).attr("nodeId"); + parent.clickNavigation(nodeId); + }); + + var palIds = parent.palIds; + if (ids != undefined) { + palIds = ids; + } + search(palIds); } function clickSearchButton() { - var selectedTreeNode = parent.repositoryTree.getSelectedNode(); - var navigation = "搜索:所有文件" + selectedTreeNode.name + ""; - $("#navigation").html(navigation); - $("#navigation span").on("click", function(){ - $("#navigation span").removeClass("current"); - $(this).addClass("current"); - clickSearchType4search(); - }); - clickSearchType4search(); + var selectedTreeNode = parent.repositoryTree.getSelectedNode(); + var navigation = "搜索:所有文件" + selectedTreeNode.name + ""; + $("#navigation").html(navigation); + $("#navigation span").on("click", function(){ + $("#navigation span").removeClass("current"); + $(this).addClass("current"); + clickSearchType4search(); + }); + clickSearchType4search(); } function clickSearchType4search(){ - var nodeId = $("#navigation span.current").attr("nodeId"); - var palIds = ''; - if (nodeId != "-1") { - palIds = parent.palIds; - } else { - var datas = parent.wsTreeData; - for (var i in datas) { - palIds += datas[i].id + ","; - } - if (palIds.length > 0) { - palIds = palIds.substring(0, palIds.length-1); - } - } - search(palIds); + var nodeId = $("#navigation span.current").attr("nodeId"); + var palIds = ''; + if (nodeId != "-1") { + palIds = parent.palIds; + } else { + var datas = parent.wsTreeData; + for (var i in datas) { + palIds += datas[i].id + ","; + } + if (palIds.length > 0) { + palIds = palIds.substring(0, palIds.length-1); + } + } + search(palIds); } function initPlrdAndPlrp(obj, datas) { - var html = ""; - for (var i in datas) { - html += "
    • " + datas[i].name + "
    • "; - } - obj.html(html); + var html = ""; + for (var i in datas) { + html += "
    • " + datas[i].name + "
    • "; + } + obj.html(html); } function selectFilter(obj) { - if (obj.parent().parent().attr("id") == "publishdate") { - if (obj.hasClass("selected")) { - $("#publishdate li").removeClass("selected"); - } else { - $("#publishdate li").removeClass("selected"); - obj.addClass("selected"); - } - } else { - obj.toggleClass("selected"); - } + if (obj.parent().parent().attr("id") == "publishdate") { + if (obj.hasClass("selected")) { + $("#publishdate li").removeClass("selected"); + } else { + $("#publishdate li").removeClass("selected"); + obj.addClass("selected"); + } + } else { + obj.toggleClass("selected"); + } } //点击模型文件图标 function clickModelLi(obj) { - if (obj.attr("methodId") == "default") { - return; - } - var data = { - id: obj.attr("id"), - processDefId: obj.attr("processDefId"), - methodId: obj.attr("methodId"), - title: obj.attr("processName") - } - parent.openTab(data); + if (obj.attr("methodId") == "default") { + return; + } + var data = { + id: obj.attr("id"), + processDefId: obj.attr("processDefId"), + methodId: obj.attr("methodId"), + title: obj.attr("processName") + } + parent.openTab(data); } function clickDisActiveLi() { - $.simpleAlert('该应用未安装或已暂停'); + $.simpleAlert('该应用未安装或已暂停'); } function dbClickModelLi(obj) { - parent.clickNavigation(obj.attr("id")); + parent.clickNavigation(obj.attr("id")); } function json2String(obj) { - var THIS = this; - switch (typeof(obj)) { - case 'string': - return '"' + obj.replace(/(["\\])/g, '\\$1') + '"'; - case 'array': - return '[' + obj.map(THIS.json2String).join(',') + ']'; - case 'object': - if (obj instanceof Array || Object.prototype.toString.call(obj) === '[object Array]') { - var strArr = []; - var len = obj.length; - for (var i = 0; i < len; i++) { - strArr.push(THIS.json2String(obj[i])); - } - return '[' + strArr.join(',') + ']'; - } else if (obj == null) { - return 'null'; + var THIS = this; + switch (typeof(obj)) { + case 'string': + return '"' + obj.replace(/(["\\])/g, '\\$1') + '"'; + case 'array': + return '[' + obj.map(THIS.json2String).join(',') + ']'; + case 'object': + if (obj instanceof Array || Object.prototype.toString.call(obj) === '[object Array]') { + var strArr = []; + var len = obj.length; + for (var i = 0; i < len; i++) { + strArr.push(THIS.json2String(obj[i])); + } + return '[' + strArr.join(',') + ']'; + } else if (obj == null) { + return 'null'; - } else { - var string = []; - for (var property in obj) string.push(THIS.json2String(property) + ':' + THIS.json2String(obj[property])); - return '{' + string.join(',') + '}'; - } - case 'number': - return obj; - case 'boolean': - return obj; - case false: - return obj; - case 'function': - return obj.toString(); - } + } else { + var string = []; + for (var property in obj) string.push(THIS.json2String(property) + ':' + THIS.json2String(obj[property])); + return '{' + string.join(',') + '}'; + } + case 'number': + return obj; + case 'boolean': + return obj; + case false: + return obj; + case 'function': + return obj.toString(); + } } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.js index b3dcc585..6dfc28f6 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.js @@ -1,87 +1,87 @@ $(function(){ - initWs(); - initOrg(); - if (type == 'ws') { - $('#tabs').find('a[tit=tab1]').click(); - $('#ws').show(); - } - if (type == 'org') { - $('#tabs').find('a[tit=tab2]').click(); - $('#org').show(); - } - loadData(type); + initWs(); + initOrg(); + if (type == 'ws') { + $('#tabs').find('a[tit=tab1]').click(); + $('#ws').show(); + } + if (type == 'org') { + $('#tabs').find('a[tit=tab2]').click(); + $('#org').show(); + } + loadData(type); }) /**************资产库切换*******************/ function initWs() { $("#wsChangeArea").off("mouseenter").on("mouseenter", function () { - $('#changeWsDialog').show(); + $('#changeWsDialog').show(); }).off("mouseleave").on("mouseleave", function () { - $('#changeWsDialog').hide(); + $('#changeWsDialog').hide(); }); - var html = "
    • "; - var wsName = ''; - for (var i = 0; i < ws.length; i++) { - html += '
        ' + ws[i].text + '
      '; - if (ws[i].id == wsId) { - wsName = ws[i].text; - } - } - html += "
    • "; - if (ws.length > 0) { - $('#wsId').val(wsId); - $('#wsNameDiv').text(wsName); - } - $('#changeWsDialog').html(html); + var html = "
    • "; + var wsName = ''; + for (var i = 0; i < ws.length; i++) { + html += '
        ' + ws[i].text + '
      '; + if (ws[i].id == wsId) { + wsName = ws[i].text; + } + } + html += "
    • "; + if (ws.length > 0) { + $('#wsId').val(wsId); + $('#wsNameDiv').text(wsName); + } + $('#changeWsDialog').html(html); } function changeWs(obj) { - $('#wsNameDiv').text($(obj).attr('name')); - $('#changeWsDialog').hide(); - if(wsId == $(obj).attr('data-id')) return; - wsId = $(obj).attr('data-id'); - loadData(type); + $('#wsNameDiv').text($(obj).attr('name')); + $('#changeWsDialog').hide(); + if(wsId == $(obj).attr('data-id')) return; + wsId = $(obj).attr('data-id'); + loadData(type); } /**************组织单位切换*******************/ function initOrg() { $("#orgChangeArea").off("mouseenter").on("mouseenter", function () { - $('#changeOrgDialog').show(); + $('#changeOrgDialog').show(); }).off("mouseleave").on("mouseleave", function () { - $('#changeOrgDialog').hide(); + $('#changeOrgDialog').hide(); }); - var html = "
    • "; - var orgName = ''; - for (var i = 0; i < org.length; i++) { - html += '
        ' + org[i].text + '
      '; - if (org[i].id == orgId) { - orgName = org[i].text; - } - } - html += "
    • "; - if (org.length > 0) { - $('#orgId').val(orgId); - $('#orgNameDiv').text(orgName); - } - $('#changeOrgDialog').html(html); + var html = "
    • "; + var orgName = ''; + for (var i = 0; i < org.length; i++) { + html += '
        ' + org[i].text + '
      '; + if (org[i].id == orgId) { + orgName = org[i].text; + } + } + html += "
    • "; + if (org.length > 0) { + $('#orgId').val(orgId); + $('#orgNameDiv').text(orgName); + } + $('#changeOrgDialog').html(html); } function changeOrg(obj) { - $('#orgNameDiv').text($(obj).attr('name')); - $('#changeOrgDialog').hide(); - if(orgId == $(obj).attr('data-id')) return; - orgId = $(obj).attr('data-id'); - loadData(type); + $('#orgNameDiv').text($(obj).attr('name')); + $('#changeOrgDialog').hide(); + if(orgId == $(obj).attr('data-id')) return; + orgId = $(obj).attr('data-id'); + loadData(type); } // 加载页面数据 function loadData(type) { - if (type == 'ws') { - $('#main-frm').attr('src', './w?sid='+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_ws_page&wsId=' + wsId); - } - if (type == 'org') { - $('#main-frm2').attr('src', './w?sid='+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_org_page&orgId=' + orgId); - } + if (type == 'ws') { + $('#main-frm').attr('src', './w?sid='+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_ws_page&wsId=' + wsId); + } + if (type == 'org') { + $('#main-frm2').attr('src', './w?sid='+sid+'&cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_org_page&orgId=' + orgId); + } } // tab切换 @@ -90,32 +90,32 @@ function onbeforechange(tab, contentTabId, newTabId) { // tab切换 function onchange(tab, newTabId) { - $('#ws').hide(); - $('#org').hide(); - if (newTabId == 'tab1') { - type = 'ws'; - $('#org').hide(); - $('#ws').show(); - } - if (newTabId == 'tab2') { - type = 'org'; - $('#ws').hide(); - $('#org').show(); - } - loadData(type); + $('#ws').hide(); + $('#org').hide(); + if (newTabId == 'tab1') { + type = 'ws'; + $('#org').hide(); + $('#ws').show(); + } + if (newTabId == 'tab2') { + type = 'org'; + $('#ws').hide(); + $('#org').show(); + } + loadData(type); } // 查询 function search() { - // 所有类型,搜索框内容,当前类型, - var text = $('#searchText').val().trim(); - var type = 'processmap'; - var templateId = '30267ab3-aeb6-4371-88e0-ecc13cef94a6'; + // 所有类型,搜索框内容,当前类型, + var text = $('#searchText').val().trim(); + var type = 'processmap'; + var templateId = '30267ab3-aeb6-4371-88e0-ecc13cef94a6'; text = encodeURI(text); - window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search_page&sid=" + sid + "&type=" + type + "&templateId=" + templateId + "&text=" + text, "_blank"); + window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_search_page&sid=" + sid + "&type=" + type + "&templateId=" + templateId + "&text=" + text, "_blank"); } function hideWsAndOrgList(){ - $('#changeWsDialog').hide(); + $('#changeWsDialog').hide(); $('#changeOrgDialog').hide(); } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.org.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.org.js index f4705177..dace450c 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.org.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.org.js @@ -4,28 +4,28 @@ var rowCountArr = [0]; var buttonWidth = 170; // 初始化数据 function initData() { - first = firstLevelData; - secend = secendLevelData; - // $('body').empty(); - var html = ''; - for(var i = 0; i < first.length; i++) { - // 一级流程 - html += '
      '; - html += '
      '; - html += ''; - var childData = secend[first[i].id]; - if (!(childData == undefined || childData.length == 0)) { - html += ''; - } - html += '
      '; - html += '
      '; - html +='
      '; - html += '
      '; - } - if (html.length > 0) { - $('body').append(html); - initSecendLevelData(); - } + first = firstLevelData; + secend = secendLevelData; + // $('body').empty(); + var html = ''; + for(var i = 0; i < first.length; i++) { + // 一级流程 + html += '
      '; + html += '
      '; + html += ''; + var childData = secend[first[i].id]; + if (!(childData == undefined || childData.length == 0)) { + html += ''; + } + html += '
      '; + html += '
      '; + html +='
      '; + html += '
      '; + } + if (html.length > 0) { + $('body').append(html); + initSecendLevelData(); + } if ($.browser.isIE && $.browser.isIE10) { $(".row-left").css("display","inline-block").css("float","left"); $(".row-right").css("display","inline-block").css("float","left"); @@ -44,55 +44,55 @@ function initData() { // 初始化二级数据 function initSecendLevelData() { - var width = $('.row-right').first().width(); - var count = parseInt(width / buttonWidth);// 每行元素个数 - for(var i = 0; i < first.length; i++) { - var id = 'row-right-' + first[i].id; - var childData = secend[first[i].id]; - if (childData == undefined || childData.length == 0) continue; - var rowCount = Math.ceil(childData.length / count);// 元素行数 - // if (rowCount > 1) { - if (true) { - rowCountArr.push(count); - } else { - rowCountArr.push(childData.length); - } - var content = ''; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < childData.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(childData[k].child) { - content += ''; - } else { - content += ''; - } - if(childData[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(childData[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - if (content.length > 0) { - $('#' + id).html(content); - } - } + var width = $('.row-right').first().width(); + var count = parseInt(width / buttonWidth);// 每行元素个数 + for(var i = 0; i < first.length; i++) { + var id = 'row-right-' + first[i].id; + var childData = secend[first[i].id]; + if (childData == undefined || childData.length == 0) continue; + var rowCount = Math.ceil(childData.length / count);// 元素行数 + // if (rowCount > 1) { + if (true) { + rowCountArr.push(count); + } else { + rowCountArr.push(childData.length); + } + var content = ''; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < childData.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(childData[k].child) { + content += ''; + } else { + content += ''; + } + if(childData[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(childData[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + if (content.length > 0) { + $('#' + id).html(content); + } + } } // 双击打开右侧权限流程(责任部门) function openDetail(id) { - isdb = true; - $.openSidebar({ + isdb = true; + $.openSidebar({ url : "./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_org_dept_dialog_page&deptId=" + id + "&sid=" + encodeURIComponent(sid),// 根据责任人查找流程对应 title : "流程列表", closeText : "收起", @@ -107,28 +107,28 @@ function openDetail(id) { } function checked(obj, level, click) { - // 清除已选中 - var c = ''; - if (level == 2) { - c = 'row-right'; - } else if (level == 3) { - c = 'button-wrap-child'; - } else { - c = 'button-wrap-child-child'; - } - $(obj).closest('div[class=' + c + ']').find('span').removeClass('is-active-span'); - $(obj).closest('div[class=' + c + ']').find('div').removeClass('is-active-verticalbar'); - $(obj).closest('div[class=' + c + ']').find('button').removeClass('is-active'); - $(obj).closest('div[class=' + c + ']').find('span').removeClass('icon-is-active'); - $(obj).closest('div[class=' + c + ']').css('background','#fff'); - if (click) { - // 设置点击状态 - var $parent = $(obj).closest('span'); - $parent.addClass('is-active-span'); - $(obj).addClass('is-active'); - $parent.find('div.verticalbar').addClass('is-active-verticalbar'); - $parent.find('span:last').addClass('icon-is-active'); - } + // 清除已选中 + var c = ''; + if (level == 2) { + c = 'row-right'; + } else if (level == 3) { + c = 'button-wrap-child'; + } else { + c = 'button-wrap-child-child'; + } + $(obj).closest('div[class=' + c + ']').find('span').removeClass('is-active-span'); + $(obj).closest('div[class=' + c + ']').find('div').removeClass('is-active-verticalbar'); + $(obj).closest('div[class=' + c + ']').find('button').removeClass('is-active'); + $(obj).closest('div[class=' + c + ']').find('span').removeClass('icon-is-active'); + $(obj).closest('div[class=' + c + ']').css('background','#fff'); + if (click) { + // 设置点击状态 + var $parent = $(obj).closest('span'); + $parent.addClass('is-active-span'); + $(obj).addClass('is-active'); + $parent.find('div.verticalbar').addClass('is-active-verticalbar'); + $parent.find('span:last').addClass('icon-is-active'); + } } /* @@ -136,187 +136,187 @@ function checked(obj, level, click) { * return true:当前已点击 false:当前未点击 * */ function isClick(obj) { - if($(obj).hasClass('is-active')) { - return true; - } - return false; + if($(obj).hasClass('is-active')) { + return true; + } + return false; } // 展开第三级流程 function expandSecendLevel(obj, level) { - // 判断当前是否为已展开状态,展开则关闭 - if(isClick(obj)) { - var $root = $(obj).closest('div[class=row-right-row]'); - $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); - checked(obj, level, false); - return; - } - checked(obj, level, true); - var id = $(obj).attr('data-id'); - var param = { - id : id, - orgId : orgId - } - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_org_expand&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - var third = r.data.data; - if (third.length == 0) { - $.simpleAlert('没有子部门数据'); - } - var $root = $(obj).closest('div[class=row-right-row]'); - // 计算width - var max = 0; - for(var i = 0; i < rowCountArr.length; i++) { - if (max < parseInt(rowCountArr[i])) max = parseInt(rowCountArr[i]); - } - var divWidth = (max * buttonWidth) - 11; - var width = divWidth - 22; - // var width = $root.width() - 20; - var count = parseInt(width / buttonWidth);// 每行元素个数 - // 计算每行数据量 - // 计算行数 - var rowCount = Math.ceil(third.length / count);// 元素行数 - var content = ''; - var tempHeader = '
      '; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < third.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(third[k].child) { - content += ''; - } else { - content += ''; - } - if(third[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(third[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - var tempEnd = '
      '; - $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); - if (content.length > 0) { - $root.append(tempHeader + content + tempEnd); - $root.children('div:last').css('background', '#fbfbfb'); - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) + // 判断当前是否为已展开状态,展开则关闭 + if(isClick(obj)) { + var $root = $(obj).closest('div[class=row-right-row]'); + $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); + checked(obj, level, false); + return; + } + checked(obj, level, true); + var id = $(obj).attr('data-id'); + var param = { + id : id, + orgId : orgId + } + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_org_expand&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + var third = r.data.data; + if (third.length == 0) { + $.simpleAlert('没有子部门数据'); + } + var $root = $(obj).closest('div[class=row-right-row]'); + // 计算width + var max = 0; + for(var i = 0; i < rowCountArr.length; i++) { + if (max < parseInt(rowCountArr[i])) max = parseInt(rowCountArr[i]); + } + var divWidth = (max * buttonWidth) - 11; + var width = divWidth - 22; + // var width = $root.width() - 20; + var count = parseInt(width / buttonWidth);// 每行元素个数 + // 计算每行数据量 + // 计算行数 + var rowCount = Math.ceil(third.length / count);// 元素行数 + var content = ''; + var tempHeader = '
      '; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < third.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(third[k].child) { + content += ''; + } else { + content += ''; + } + if(third[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(third[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + var tempEnd = '
      '; + $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); + if (content.length > 0) { + $root.append(tempHeader + content + tempEnd); + $root.children('div:last').css('background', '#fbfbfb'); + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) } function expandMoreLevel(obj, level) { - var c = 'button-wrap-child'; - if (level > 3) { - c = 'button-wrap-child-child'; - } - // 判断当前是否为已展开状态,展开则关闭 - if(isClick(obj)) { - var $root = $(obj).closest('div[class=' + c + ']'); - $root.find('div[class=button-wrap-child-child]').remove(); - checked(obj, level, false); - return; - } - checked(obj, level, true); - var id = $(obj).attr('data-id'); - var param = { - id : id, - orgId : orgId - } - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_org_expand&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - var third = r.data.data; - if (third.length == 0) { - $.simpleAlert('没有子部门数据'); - } - - var $root = $(obj).closest('div[class=' + c + ']'); - // 计算width - var width = $root.width(); - var count = parseInt(width / buttonWidth);// 每行元素个数 - // 计算每行数据量 - // 计算行数 - var rowCount = Math.ceil(third.length / count);// 元素行数 - var content = ''; - var tempHeader = '
      '; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < third.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(third[k].child) { - content += ''; - } else { - content += ''; - } - if(third[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(third[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - var tempEnd = '
      '; - // $(obj).closest('div[class=temp]').children('div[class=button-wrap-child-child]').remove(); - $root.find('div[class=button-wrap-child-child]').remove(); - if (content.length > 0) { - $(obj).closest('div[class=temp]').append(tempHeader + content + tempEnd); - $(obj).closest('div[class=temp]').children('div:last').css('background', '#fbfbfb'); - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) + var c = 'button-wrap-child'; + if (level > 3) { + c = 'button-wrap-child-child'; + } + // 判断当前是否为已展开状态,展开则关闭 + if(isClick(obj)) { + var $root = $(obj).closest('div[class=' + c + ']'); + $root.find('div[class=button-wrap-child-child]').remove(); + checked(obj, level, false); + return; + } + checked(obj, level, true); + var id = $(obj).attr('data-id'); + var param = { + id : id, + orgId : orgId + } + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_org_expand&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + var third = r.data.data; + if (third.length == 0) { + $.simpleAlert('没有子部门数据'); + } + + var $root = $(obj).closest('div[class=' + c + ']'); + // 计算width + var width = $root.width(); + var count = parseInt(width / buttonWidth);// 每行元素个数 + // 计算每行数据量 + // 计算行数 + var rowCount = Math.ceil(third.length / count);// 元素行数 + var content = ''; + var tempHeader = '
      '; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < third.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(third[k].child) { + content += ''; + } else { + content += ''; + } + if(third[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(third[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + var tempEnd = '
      '; + // $(obj).closest('div[class=temp]').children('div[class=button-wrap-child-child]').remove(); + $root.find('div[class=button-wrap-child-child]').remove(); + if (content.length > 0) { + $(obj).closest('div[class=temp]').append(tempHeader + content + tempEnd); + $(obj).closest('div[class=temp]').children('div:last').css('background', '#fbfbfb'); + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) } //双击/单击处理 var isdb;// 是否双击 function clickSet(obj, level) { - isdb = false; - window.setTimeout(function() { - if (isdb) return; - if (level >= 3) { - expandMoreLevel(obj, level);// 单击 - } else { - expandSecendLevel(obj, level);// 单击 - } - }, 300); + isdb = false; + window.setTimeout(function() { + if (isdb) return; + if (level >= 3) { + expandMoreLevel(obj, level);// 单击 + } else { + expandSecendLevel(obj, level);// 单击 + } + }, 300); } function clickSpanSet(obj, level) { - clickSet($(obj).closest('span.row-right-row-span').find('button.row-right-button')[0],level); + clickSet($(obj).closest('span.row-right-row-span').find('button.row-right-button')[0],level); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.ws.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.ws.js index 651f8b28..b942cd4e 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.ws.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.client.sso.processmap.ws.js @@ -4,28 +4,28 @@ var rowCountArr = [0]; var buttonWidth = 170; // 初始化数据 function initData() { - first = firstLevelData; - secend = secendLevelData; - // $('body').empty(); - var html = ''; - for(var i = 0; i < first.length; i++) { - // 一级流程 - html += '
      '; - html += '
      '; - html += ''; - var childData = secend[first[i].versionId]; - if (!(childData == undefined || childData.length == 0)) { - html += ''; - } - html += '
      '; - html += '
      '; - html +='
      '; - html += '
      '; - } - if (html.length > 0) { - $('body').append(html); - initSecendLevelData(); - } + first = firstLevelData; + secend = secendLevelData; + // $('body').empty(); + var html = ''; + for(var i = 0; i < first.length; i++) { + // 一级流程 + html += '
      '; + html += '
      '; + html += ''; + var childData = secend[first[i].versionId]; + if (!(childData == undefined || childData.length == 0)) { + html += ''; + } + html += '
      '; + html += '
      '; + html +='
      '; + html += '
      '; + } + if (html.length > 0) { + $('body').append(html); + initSecendLevelData(); + } if ($.browser.isIE && $.browser.isIE10) { $(".row-left").css("float","left"); $(".row-right").css("float","left"); @@ -41,108 +41,108 @@ function initData() { // 初始化二级数据 function initSecendLevelData() { - var width = $('.row-right').first().width(); - var count = parseInt(width / buttonWidth);// 每行元素个数 - for(var i = 0; i < first.length; i++) { - var id = 'row-right-' + first[i].id; - var childData = secend[first[i].versionId]; - if (childData == undefined || childData.length == 0) continue; - var rowCount = Math.ceil(childData.length / count);// 元素行数 - // if (rowCount > 1) { - if (true) { - rowCountArr.push(count); - } else { - rowCountArr.push(childData.length); - } - var content = ''; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < childData.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(childData[k].child) { - content += ''; - } else { - content += ''; - } - if(childData[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(childData[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - if (content.length > 0) { - $('#' + id).html(content); - } - } + var width = $('.row-right').first().width(); + var count = parseInt(width / buttonWidth);// 每行元素个数 + for(var i = 0; i < first.length; i++) { + var id = 'row-right-' + first[i].id; + var childData = secend[first[i].versionId]; + if (childData == undefined || childData.length == 0) continue; + var rowCount = Math.ceil(childData.length / count);// 元素行数 + // if (rowCount > 1) { + if (true) { + rowCountArr.push(count); + } else { + rowCountArr.push(childData.length); + } + var content = ''; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < childData.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(childData[k].child) { + content += ''; + } else { + content += ''; + } + if(childData[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(childData[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + if (content.length > 0) { + $('#' + id).html(content); + } + } } // 打开流程 function openDetail(id) { - isdb = true; - var param = { - id : id, - wsId : wsId - } - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_check_open&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - if (r.data.status == 'noPerm') { - $.simpleAlert('没有文件的访问权限', 'info'); - } else if (r.data.status == 'typeError') { - $.simpleAlert('流程未发布,无法访问', 'info'); - } else if (r.data.status == 'notPublish') { - $.simpleAlert('流程未发布,无法访问', 'info'); - } else { - window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_page&uuid=" + id + "&sid=" + encodeURIComponent(sid));// open Windows - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) - - + isdb = true; + var param = { + id : id, + wsId : wsId + } + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_check_open&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + if (r.data.status == 'noPerm') { + $.simpleAlert('没有文件的访问权限', 'info'); + } else if (r.data.status == 'typeError') { + $.simpleAlert('流程未发布,无法访问', 'info'); + } else if (r.data.status == 'notPublish') { + $.simpleAlert('流程未发布,无法访问', 'info'); + } else { + window.open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_page&uuid=" + id + "&sid=" + encodeURIComponent(sid));// open Windows + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) + + } function checked(obj, level, click) { - // 清除已选中 - var c = ''; - if (level == 2) { - c = 'row-right'; - } else if (level == 3) { - c = 'button-wrap-child'; - } else { - c = 'button-wrap-child-child'; - } - $(obj).closest('div[class=' + c + ']').find('span').removeClass('is-active-span'); - $(obj).closest('div[class=' + c + ']').find('div').removeClass('is-active-verticalbar'); - $(obj).closest('div[class=' + c + ']').find('button').removeClass('is-active'); - $(obj).closest('div[class=' + c + ']').find('span').removeClass('icon-is-active'); - $(obj).closest('div[class=' + c + ']').css('background','#fff'); - if (click) { - // 设置点击状态 - var $parent = $(obj).closest('span'); - $parent.addClass('is-active-span'); - $(obj).addClass('is-active'); - $parent.find('div.verticalbar').addClass('is-active-verticalbar'); - $parent.find('span:last').addClass('icon-is-active'); - } + // 清除已选中 + var c = ''; + if (level == 2) { + c = 'row-right'; + } else if (level == 3) { + c = 'button-wrap-child'; + } else { + c = 'button-wrap-child-child'; + } + $(obj).closest('div[class=' + c + ']').find('span').removeClass('is-active-span'); + $(obj).closest('div[class=' + c + ']').find('div').removeClass('is-active-verticalbar'); + $(obj).closest('div[class=' + c + ']').find('button').removeClass('is-active'); + $(obj).closest('div[class=' + c + ']').find('span').removeClass('icon-is-active'); + $(obj).closest('div[class=' + c + ']').css('background','#fff'); + if (click) { + // 设置点击状态 + var $parent = $(obj).closest('span'); + $parent.addClass('is-active-span'); + $(obj).addClass('is-active'); + $parent.find('div.verticalbar').addClass('is-active-verticalbar'); + $parent.find('span:last').addClass('icon-is-active'); + } } /* @@ -150,186 +150,186 @@ function checked(obj, level, click) { * return true:当前已点击 false:当前未点击 * */ function isClick(obj) { - if($(obj).hasClass('is-active')) { - return true; - } - return false; + if($(obj).hasClass('is-active')) { + return true; + } + return false; } // 点开第二级展开第三级流程 function expandSecendLevel(obj, level) { - // 判断当前是否为已展开状态,展开则关闭 - if(isClick(obj)) { - var $root = $(obj).closest('div[class=row-right-row]'); - $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); - checked(obj, level, false); - return; - } - checked(obj, level, true); - var id = $(obj).attr('data-id'); - var param = { - id : id, - wsId : wsId - } - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_expand&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - var third = r.data.data; - if (third.length == 0) { - $.simpleAlert('没有子流程数据'); - } - var $root = $(obj).closest('div[class=row-right-row]'); - // 计算width - var max = 0; - for(var i = 0; i < rowCountArr.length; i++) { - if (max < parseInt(rowCountArr[i])) max = parseInt(rowCountArr[i]); - } - var divWidth = (max * buttonWidth) - 11; - var width = divWidth - 22; - // var width = $root.width() - 20; - var count = parseInt(width / buttonWidth);// 每行元素个数 - // 计算每行数据量 - // 计算行数 - var rowCount = Math.ceil(third.length / count);// 元素行数 - var content = ''; - var tempHeader = '
      '; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < third.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(third[k].child) { - content += ''; - } else { - content += ''; - } - if(third[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(third[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - var tempEnd = '
      '; - $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); - if (content.length > 0) { - $root.append(tempHeader + content + tempEnd); - $root.children('div:last').css('background', '#fbfbfb'); - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) + // 判断当前是否为已展开状态,展开则关闭 + if(isClick(obj)) { + var $root = $(obj).closest('div[class=row-right-row]'); + $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); + checked(obj, level, false); + return; + } + checked(obj, level, true); + var id = $(obj).attr('data-id'); + var param = { + id : id, + wsId : wsId + } + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_expand&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + var third = r.data.data; + if (third.length == 0) { + $.simpleAlert('没有子流程数据'); + } + var $root = $(obj).closest('div[class=row-right-row]'); + // 计算width + var max = 0; + for(var i = 0; i < rowCountArr.length; i++) { + if (max < parseInt(rowCountArr[i])) max = parseInt(rowCountArr[i]); + } + var divWidth = (max * buttonWidth) - 11; + var width = divWidth - 22; + // var width = $root.width() - 20; + var count = parseInt(width / buttonWidth);// 每行元素个数 + // 计算每行数据量 + // 计算行数 + var rowCount = Math.ceil(third.length / count);// 元素行数 + var content = ''; + var tempHeader = '
      '; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < third.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(third[k].child) { + content += ''; + } else { + content += ''; + } + if(third[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(third[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + var tempEnd = '
      '; + $root.closest('div[class=row-right]').find('div[class=button-wrap-child]').remove(); + if (content.length > 0) { + $root.append(tempHeader + content + tempEnd); + $root.children('div:last').css('background', '#fbfbfb'); + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) } function expandMoreLevel(obj, level) { - var c = 'button-wrap-child'; - if (level > 3) { - c = 'button-wrap-child-child'; - } - // 判断当前是否为已展开状态,展开则关闭 - if(isClick(obj)) { - var $root = $(obj).closest('div[class=' + c + ']'); - $root.find('div[class=button-wrap-child-child]').remove(); - checked(obj, level, false); - return; - } - checked(obj, level, true); - var id = $(obj).attr('data-id'); - var param = { - id : id, - wsId : wsId - } - // 获取更多数据 - $.ajax({ - type : "POST", - url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_expand&sid=" + encodeURIComponent(sid), - dataType : "JSON", - data : param, - success : function(r) { - $.simpleAlert('close'); - if (r.result == 'ok') { - var third = r.data.data; - if (third.length == 0) { - $.simpleAlert('没有子流程数据'); - } - var $root = $(obj).closest('div[class=' + c + ']'); - // 计算width - var width = $root.width(); - var count = parseInt(width / buttonWidth);// 每行元素个数 - // 计算每行数据量 - // 计算行数 - var rowCount = Math.ceil(third.length / count);// 元素行数 - var content = ''; - var tempHeader = '
      '; - for(var j = 0; j < rowCount; j++) { - content += '
      '; - for (var k = j * count,m = 0; k < third.length; k++) { - m++; - if(m > count) break; - content += '
      '; - if(third[k].child) { - content += ''; - } else { - content += ''; - } - if(third[k].child) {// 有子流程 - content += ''; - } else {// 无子流程 - content += ''; - } - content += '
      '; - if(third[k].child) {// 有子流程 - content += ''; - } - content += '
      '; - content += '
      '; - } - content += '
      '; - } - var tempEnd = '
      '; - // $(obj).closest('div[class=temp]').children('div[class=button-wrap-child-child]').remove(); - $root.find('div[class=button-wrap-child-child]').remove(); - if (content.length > 0) { - $(obj).closest('div[class=temp]').append(tempHeader + content + tempEnd); - $(obj).closest('div[class=temp]').children('div:last').css('background', '#fbfbfb'); - } - } else { - $.simpleAlert('加载失败', 'error'); - } - } - }) + var c = 'button-wrap-child'; + if (level > 3) { + c = 'button-wrap-child-child'; + } + // 判断当前是否为已展开状态,展开则关闭 + if(isClick(obj)) { + var $root = $(obj).closest('div[class=' + c + ']'); + $root.find('div[class=button-wrap-child-child]').remove(); + checked(obj, level, false); + return; + } + checked(obj, level, true); + var id = $(obj).attr('data-id'); + var param = { + id : id, + wsId : wsId + } + // 获取更多数据 + $.ajax({ + type : "POST", + url : "./jd?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_processmap_ws_expand&sid=" + encodeURIComponent(sid), + dataType : "JSON", + data : param, + success : function(r) { + $.simpleAlert('close'); + if (r.result == 'ok') { + var third = r.data.data; + if (third.length == 0) { + $.simpleAlert('没有子流程数据'); + } + var $root = $(obj).closest('div[class=' + c + ']'); + // 计算width + var width = $root.width(); + var count = parseInt(width / buttonWidth);// 每行元素个数 + // 计算每行数据量 + // 计算行数 + var rowCount = Math.ceil(third.length / count);// 元素行数 + var content = ''; + var tempHeader = '
      '; + for(var j = 0; j < rowCount; j++) { + content += '
      '; + for (var k = j * count,m = 0; k < third.length; k++) { + m++; + if(m > count) break; + content += '
      '; + if(third[k].child) { + content += ''; + } else { + content += ''; + } + if(third[k].child) {// 有子流程 + content += ''; + } else {// 无子流程 + content += ''; + } + content += '
      '; + if(third[k].child) {// 有子流程 + content += ''; + } + content += '
      '; + content += '
      '; + } + content += '
      '; + } + var tempEnd = '
      '; + // $(obj).closest('div[class=temp]').children('div[class=button-wrap-child-child]').remove(); + $root.find('div[class=button-wrap-child-child]').remove(); + if (content.length > 0) { + $(obj).closest('div[class=temp]').append(tempHeader + content + tempEnd); + $(obj).closest('div[class=temp]').children('div:last').css('background', '#fbfbfb'); + } + } else { + $.simpleAlert('加载失败', 'error'); + } + } + }) } //双击/单击处理 var isdb;// 是否双击 function clickSet(obj, level) { - isdb = false; - window.setTimeout(function() { - if (isdb) return; - if (level >= 3) { - expandMoreLevel(obj, level);// 单击 - } else { - expandSecendLevel(obj, level);// 单击 - } - }, 300); + isdb = false; + window.setTimeout(function() { + if (isdb) return; + if (level >= 3) { + expandMoreLevel(obj, level);// 单击 + } else { + expandSecendLevel(obj, level);// 单击 + } + }, 300); } function clickSpanSet(obj, level) { - clickSet($(obj).closest('span.row-right-row-span').find('button.row-right-button')[0],level); + clickSet($(obj).closest('span.row-right-row-span').find('button.row-right-button')[0],level); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.home.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.home.js index b6b6d28b..c0876af3 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.home.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.home.js @@ -1,71 +1,71 @@ function toAddPublish2() { - $("#title").val(title); - $("#nav, #content").hide(); - $("#add_div").show(); + $("#title").val(title); + $("#nav, #content").hide(); + $("#add_div").show(); } // 新增 function toAddPublish() { - $("#title").val(title); - addPublishInstance(); + $("#title").val(title); + addPublishInstance(); } function giveUp() { - $("#add_div").hide(); - $("#nav, #content").show(); - $("#title").val(title); + $("#add_div").hide(); + $("#nav, #content").show(); + $("#title").val(title); } function addPublishInstance() { - var title = $("#title").val(); - if (title == "") { - window.top.$.simpleAlert("[标题]不允许为空"); - return; - } - if (title.length > 120) { - window.top.$.simpleAlert("[标题]长度不允许超过120"); - return; - } - - var params = { - title : $("#title").val(), - wsId: $("#wsId").val(), - teamId: $("#teamId").val(), - teamName: $("#teamName").val() - }; - awsui.ajax.request({ - url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_save", - data : params, - type : "post", - ok : function(msg) { - $("#nav, #content").show(); - $("#add_div").hide(); - if (msg.result == "ok") { - var data = msg.data.data; - openPublishInstance(data.processInstId, data.taskInstId); - $("#add_div").hide(); - $("#nav, #content").show(); - $("#title").val("流程发布"); - refreshProcessList(); - } else { - window.top.$.simpleAlert("保存失败", "error", 2000); - } - }, - err : function(r) { - } - }); + var title = $("#title").val(); + if (title == "") { + window.top.$.simpleAlert("[标题]不允许为空"); + return; + } + if (title.length > 120) { + window.top.$.simpleAlert("[标题]长度不允许超过120"); + return; + } + + var params = { + title : $("#title").val(), + wsId: $("#wsId").val(), + teamId: $("#teamId").val(), + teamName: $("#teamName").val() + }; + awsui.ajax.request({ + url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_save", + data : params, + type : "post", + ok : function(msg) { + $("#nav, #content").show(); + $("#add_div").hide(); + if (msg.result == "ok") { + var data = msg.data.data; + openPublishInstance(data.processInstId, data.taskInstId); + $("#add_div").hide(); + $("#nav, #content").show(); + $("#title").val("流程发布"); + refreshProcessList(); + } else { + window.top.$.simpleAlert("保存失败", "error", 2000); + } + }, + err : function(r) { + } + }); } function openPublishInstance(processInstId, taskInstId, openState) { - if (openState == undefined) { - openState = ""; - } - $('#processInstId').val(processInstId); - $('#taskInstId').val(taskInstId); - $('#openState').val(openState); - $("#openNewPage").submit();// 摒弃window.open方式 - -// var url = "./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_handle" + if (openState == undefined) { + openState = ""; + } + $('#processInstId').val(processInstId); + $('#taskInstId').val(taskInstId); + $('#openState').val(openState); + $("#openNewPage").submit();// 摒弃window.open方式 + +// var url = "./w?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_handle" // + "&processInstId=" + processInstId + "&taskInstId=" + taskInstId + "&openState=" + openState; // window.open(url, "newwindow","top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no,status=no,width="+ (screen.availWidth - 10) +",height="+ (screen.availHeight-50)); } @@ -73,238 +73,238 @@ function openPublishInstance(processInstId, taskInstId, openState) { //选中checkbox function selectTrCheckBox(obj) { - var checked = false; - $("#tbody1 .awsui-checkbox").each(function(){ - if ($(this).prop("checked")) { - checked = true; - return false; - } - }); - if (checked) { - $("#removePulishInstance").show(); - } else { - $("#removePulishInstance").hide(); - } + var checked = false; + $("#tbody1 .awsui-checkbox").each(function(){ + if ($(this).prop("checked")) { + checked = true; + return false; + } + }); + if (checked) { + $("#removePulishInstance").show(); + } else { + $("#removePulishInstance").hide(); + } } //删除task function removePublishInstance() { - var processInstIds = ""; - $("#tbody1 .awsui-checkbox").each(function(){ - if ($(this).prop("checked")) { - processInstIds += $(this).val() + ","; - } - }) - - if (processInstIds == "") { - $.simpleAlert("请选择要删除的任务"); - return; - } - - var options = { - title : "提示", - content : "确定删除吗?", - model : false, - onConfirm : function() { - var params = { - processInstIds: processInstIds - } - $.ajax({ - url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_remove", - data : params, - type : "post", - success : function(msg) { - if (msg.result == "ok") { - window.top.$.simpleAlert("删除成功", "ok", 2000); - } else { - var errNum = msg.data.errNum; - var errProcessInstTitles = msg.msg; - window.top.$.simpleAlert("任务[" + errProcessInstTitles + "]删除失败", "error"); - } - var successNum = msg.data.successNum; - totalData1 = totalData1 - successNum; - if (totalData1 <= currentpage1 * pageLimit) { - if (currentpage1 > 0) { - currentpage1 = currentpage1 - 1; - } - } - refreshProcessList(); - $("#removePulishInstance").hide(); - } - }); - } - } - window.top.$.confirm(options);; + var processInstIds = ""; + $("#tbody1 .awsui-checkbox").each(function(){ + if ($(this).prop("checked")) { + processInstIds += $(this).val() + ","; + } + }) + + if (processInstIds == "") { + $.simpleAlert("请选择要删除的任务"); + return; + } + + var options = { + title : "提示", + content : "确定删除吗?", + model : false, + onConfirm : function() { + var params = { + processInstIds: processInstIds + } + $.ajax({ + url : "./jd?sid=" + $("#sid").val() + "&cmd=com.actionsoft.apps.coe.pal.publisher_remove", + data : params, + type : "post", + success : function(msg) { + if (msg.result == "ok") { + window.top.$.simpleAlert("删除成功", "ok", 2000); + } else { + var errNum = msg.data.errNum; + var errProcessInstTitles = msg.msg; + window.top.$.simpleAlert("任务[" + errProcessInstTitles + "]删除失败", "error"); + } + var successNum = msg.data.successNum; + totalData1 = totalData1 - successNum; + if (totalData1 <= currentpage1 * pageLimit) { + if (currentpage1 > 0) { + currentpage1 = currentpage1 - 1; + } + } + refreshProcessList(); + $("#removePulishInstance").hide(); + } + }); + } + } + window.top.$.confirm(options);; } //刷新页面,用于流程办理关闭时调用 function refreshProcessList() { - var tit = $(".network_tabs").find("a[tit][class=active]").attr("tit"); - if (tit == "todo") { - loadOutputData1(currentpage1, pageLimit, initPage1); + var tit = $(".network_tabs").find("a[tit][class=active]").attr("tit"); + if (tit == "todo") { + loadOutputData1(currentpage1, pageLimit, initPage1); } else if (tit == "done") { - loadOutputData2(currentpage2, pageLimit, initPage2); + loadOutputData2(currentpage2, pageLimit, initPage2); } else if (tit == "history") { - loadOutputData3(currentpage3, pageLimit, initPage3); + loadOutputData3(currentpage3, pageLimit, initPage3); } - - $("#select_all").check().on("ifChanged", function(){ - var isChecked = $(this).prop("checked"); - if (isChecked) { - $("#tbody1 .awsui-checkbox").check("option", "checked", true); - } else { - $("#tbody1 .awsui-checkbox").check("option", "checked", false); - } - }) + + $("#select_all").check().on("ifChanged", function(){ + var isChecked = $(this).prop("checked"); + if (isChecked) { + $("#tbody1 .awsui-checkbox").check("option", "checked", true); + } else { + $("#tbody1 .awsui-checkbox").check("option", "checked", false); + } + }) } /*************************************************分页 begin******************************************************/ function initPage1() { - $("#Pagination1").pagination(totalData1, { + $("#Pagination1").pagination(totalData1, { pageLimit:pageLimit, - showItem:showItem, - currentPage:currentpage1, - ellipseCount:0, - prevText:"上一页", - nextText:"下一页", - ellipseText:"...", - showIfSinglePage:false, - loadFirstPage:false, - showDisplay:true, - callback:function(pageNum, start){ - currentpage1 = pageNum - 1; - loadOutputData1(pageNum - 1, showItem); - } - }); + showItem:showItem, + currentPage:currentpage1, + ellipseCount:0, + prevText:"上一页", + nextText:"下一页", + ellipseText:"...", + showIfSinglePage:false, + loadFirstPage:false, + showDisplay:true, + callback:function(pageNum, start){ + currentpage1 = pageNum - 1; + loadOutputData1(pageNum - 1, showItem); + } + }); } function loadOutputData1(pageNum, size, callback) { - var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_tasklist"; - var params = { - start : pageNum, - size : size - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - $("#tbody1").empty().html(msg.data.html); - $(window).trigger('resize'); - totalData1 = msg.data.totalSize; - $(".awsui-checkbox").check(); - $(".awsui-checkbox").on("ifChanged", function(){ - selectTrCheckBox($(this)); - }); - if (parent.window.setHeight) { - parent.window.setHeight(); - } - if (callback) { - callback(); - } - - $("#select_all").check().on("ifChanged", function(){ - var isChecked = $(this).prop("checked"); - if (isChecked) { - $("#tbody1 .awsui-checkbox").check("option", "checked", true); - } else { - $("#tbody1 .awsui-checkbox").check("option", "checked", false); - } - }) - } - }); + var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_tasklist"; + var params = { + start : pageNum, + size : size + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + $("#tbody1").empty().html(msg.data.html); + $(window).trigger('resize'); + totalData1 = msg.data.totalSize; + $(".awsui-checkbox").check(); + $(".awsui-checkbox").on("ifChanged", function(){ + selectTrCheckBox($(this)); + }); + if (parent.window.setHeight) { + parent.window.setHeight(); + } + if (callback) { + callback(); + } + + $("#select_all").check().on("ifChanged", function(){ + var isChecked = $(this).prop("checked"); + if (isChecked) { + $("#tbody1 .awsui-checkbox").check("option", "checked", true); + } else { + $("#tbody1 .awsui-checkbox").check("option", "checked", false); + } + }) + } + }); } function initPage2() { - $("#Pagination2").pagination(totalData2, { - pageLimit:pageLimit, - showItem:showItem, - currentPage:currentpage2, - ellipseCount:0, - prevText:"上一页", - nextText:"下一页", - ellipseText:"...", - showIfSinglePage:false, - loadFirstPage:false, - showDisplay:true, - display:"显示 {0} 到 {1} 条, 共 {2} 条", - callback:function(pageNum, start){ - currentpage2 = pageNum - 1; - loadOutputData2(pageNum - 1, showItem); - } + $("#Pagination2").pagination(totalData2, { + pageLimit:pageLimit, + showItem:showItem, + currentPage:currentpage2, + ellipseCount:0, + prevText:"上一页", + nextText:"下一页", + ellipseText:"...", + showIfSinglePage:false, + loadFirstPage:false, + showDisplay:true, + display:"显示 {0} 到 {1} 条, 共 {2} 条", + callback:function(pageNum, start){ + currentpage2 = pageNum - 1; + loadOutputData2(pageNum - 1, showItem); + } }); } function loadOutputData2(start, size, callback) { - var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_historytasklist"; - pageNumber = start; - var params = { - start : start, - size : size - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - $("#tbody2").empty().html(msg.data.html); - $(window).trigger('resize'); - totalData2 = msg.data.totalSize; - if (parent.window.setHeight) { - parent.window.setHeight(); - } - if (callback) { - callback(); - } - } - }); + var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_historytasklist"; + pageNumber = start; + var params = { + start : start, + size : size + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + $("#tbody2").empty().html(msg.data.html); + $(window).trigger('resize'); + totalData2 = msg.data.totalSize; + if (parent.window.setHeight) { + parent.window.setHeight(); + } + if (callback) { + callback(); + } + } + }); } function initPage3() { - $("#Pagination3").pagination(totalData3, { - pageLimit:pageLimit, - showItem:showItem, - currentPage:currentpage3, - ellipseCount:0, - prevText:"上一页", - nextText:"下一页", - ellipseText:"...", - showIfSinglePage:false, - loadFirstPage:false, - showDisplay:true, - display:"显示 {0} 到 {1} 条, 共 {2} 条", - callback:function(pageNum, start){ - currentpage3 = pageNum - 1; - loadOutputData3(pageNum - 1, showItem); - } - }); + $("#Pagination3").pagination(totalData3, { + pageLimit:pageLimit, + showItem:showItem, + currentPage:currentpage3, + ellipseCount:0, + prevText:"上一页", + nextText:"下一页", + ellipseText:"...", + showIfSinglePage:false, + loadFirstPage:false, + showDisplay:true, + display:"显示 {0} 到 {1} 条, 共 {2} 条", + callback:function(pageNum, start){ + currentpage3 = pageNum - 1; + loadOutputData3(pageNum - 1, showItem); + } + }); } function loadOutputData3(start, size, callback) { - var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_processlist"; - pageNumber = start; - var params = { - start : start, - size : size - }; - $.ajax({ - url : url, - async : false, - data : params, - type : "post", - success : function(msg) { - $("#tbody3").empty().html(msg.data.html); - $(window).trigger('resize'); - totalData3 = msg.data.totalSize; - if (parent.window.setHeight) { - parent.window.setHeight(); - } - if (callback) { - callback(); - } - } - }); + var url = "./jd?sid=" + encodeURIComponent($("#sid").val()) + "&cmd=com.actionsoft.apps.coe.pal.publisher_processlist"; + pageNumber = start; + var params = { + start : start, + size : size + }; + $.ajax({ + url : url, + async : false, + data : params, + type : "post", + success : function(msg) { + $("#tbody3").empty().html(msg.data.html); + $(window).trigger('resize'); + totalData3 = msg.data.totalSize; + if (parent.window.setHeight) { + parent.window.setHeight(); + } + if (callback) { + callback(); + } + } + }); } function loadHistoryRecord() { @@ -314,11 +314,11 @@ function loadHistoryRecord() { /*************************************************分页 end******************************************************/ function refreshTab() { - $('#nav').children('a').each(function() { - if ($(this).hasClass('active')) { - $(this).click(); - return false; - } - }) + $('#nav').children('a').each(function() { + if ($(this).hasClass('active')) { + $(this).click(); + return false; + } + }) } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.manage.home.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.manage.home.js index 9d5f3f7b..46cd84ed 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.manage.home.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.manage.home.js @@ -10,81 +10,81 @@ var drpSourceParentId; var isOpenMainIfranme = false; var repositoryTree; $(document).ready(function() { - initTree(); - repositoryTree.expandNode($("a[tbindex=process]"), true); + initTree(); + repositoryTree.expandNode($("a[tbindex=process]"), true); }); // 新建层次 打开对话框v2 function createProcessLevelv2(wd, wsid, parentid, plLevel, div_class) { - var title = "新建文件"; - var url = "./w?sid=" + encodeURIComponent($('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_create_v2&wsid=" + wsid + "&id=" - + parentid; - if (parentid == 0) { - window.top.$.simpleAlert(请先选择根下相应节点, "info", 2000); - } else { - if (parentid.length == 36) { - var buttons = [ - { - text : '确定', - cls : "blue", - handler : function() { - var processType = FrmDialog.win().processType; - if (processType == "default") { - saveProcessLevel(window); - var node = repositoryTree.getSelectedNode(); - setPlParentIDAndProcessLevel(node); - refresh(); - } else { - $.ajax({ - url : './jd?cmd=com.actionsoft.apps.coe.pal_processlevel_create_save&sid=' + encodeURIComponent($('#sid').val()) - + '&wsid=' + wsid - + '&plLevel=' + (parseInt(plLevel) + 1) - + '&plParentId=' + parentid - + '&category=' + FrmDialog.win().selectCategoryValue - + '&container=' + FrmDialog.win().selectContainer - + '&t=' + Math.random(), - success : function(msg) { - if (typeof(msg) == "string") { - msg = eval('(' + msg + ')').msg; - } else { - msg = msg.msg; - } + var title = "新建文件"; + var url = "./w?sid=" + encodeURIComponent($('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_create_v2&wsid=" + wsid + "&id=" + + parentid; + if (parentid == 0) { + window.top.$.simpleAlert(请先选择根下相应节点, "info", 2000); + } else { + if (parentid.length == 36) { + var buttons = [ + { + text : '确定', + cls : "blue", + handler : function() { + var processType = FrmDialog.win().processType; + if (processType == "default") { + saveProcessLevel(window); + var node = repositoryTree.getSelectedNode(); + setPlParentIDAndProcessLevel(node); + refresh(); + } else { + $.ajax({ + url : './jd?cmd=com.actionsoft.apps.coe.pal_processlevel_create_save&sid=' + encodeURIComponent($('#sid').val()) + + '&wsid=' + wsid + + '&plLevel=' + (parseInt(plLevel) + 1) + + '&plParentId=' + parentid + + '&category=' + FrmDialog.win().selectCategoryValue + + '&container=' + FrmDialog.win().selectContainer + + '&t=' + Math.random(), + success : function(msg) { + if (typeof(msg) == "string") { + msg = eval('(' + msg + ')').msg; + } else { + msg = msg.msg; + } + + var url = "./w?sid=" + + encodeURIComponent($('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" + + msg + + "&openType=0&perms=w,d,v&filePerms=-"; + $("#disignerIframe").attr("src", url).attr("uuid", msg); + FrmDialog.close(); + setTimeout( + function() { + var node = repositoryTree.getSelectedNode(); + setPlParentIDAndProcessLevel(node); + refresh(); + }, 500); - var url = "./w?sid=" - + encodeURIComponent($('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_pl_repository_designer&uuid=" - + msg - + "&openType=0&perms=w,d,v&filePerms=-"; - $("#disignerIframe").attr("src", url).attr("uuid", msg); - FrmDialog.close(); - setTimeout( - function() { - var node = repositoryTree.getSelectedNode(); - setPlParentIDAndProcessLevel(node); - refresh(); - }, 500); - - } - }) - } - } - }, { - text : '关闭', - handler : function() { - FrmDialog.close(); - } - } ] - var dlg=FrmDialog.open({ - title:title, - height:465, - url:url, - buttons: buttons - }); - } else { - window.top.$.simpleAlert("该节点上不可以新建流程"); - } - } + } + }) + } + } + }, { + text : '关闭', + handler : function() { + FrmDialog.close(); + } + } ] + var dlg=FrmDialog.open({ + title:title, + height:465, + url:url, + buttons: buttons + }); + } else { + window.top.$.simpleAlert("该节点上不可以新建流程"); + } + } } @@ -92,135 +92,135 @@ function createProcessLevelv2(wd, wsid, parentid, plLevel, div_class) { * 功能:去除字符串中所有空格 传参:需要处理的字符串 返回值:去除空格后的字符串 */ function trimSpaces(Str) { - var ResultStr = ""; - Temp = Str.split(/\s/); - for (i = 0; i < Temp.length; i++) { - ResultStr += Temp[i]; - } - return ResultStr; + var ResultStr = ""; + Temp = Str.split(/\s/); + for (i = 0; i < Temp.length; i++) { + ResultStr += Temp[i]; + } + return ResultStr; } // 流程规划 function saveProcessLevel(wd) { - var returnProcessJson = eval("(" - + window.top.getAwsDialogWindow().returnProcessJson() + ")"); - // alert(returnProcessJson); - var defaultMessageJson = window.top.getAwsDialogWindow().defaultMessageJson; - // alert(defaultMessageJson.plParentId); - var id = returnProcessJson.id; - var wsId = returnProcessJson.wsId; - var plNo = trimSpaces(returnProcessJson.plNo); - var plName = returnProcessJson.plName; - var plLevel = returnProcessJson.plLevel; - plLevel = parseInt(plLevel) + 1; - var plParentId = returnProcessJson.plParentId; - var plDesc = returnProcessJson.plDesc; - var plOrderIndex = returnProcessJson.plOrderIndex; - var plIsBottomLevel = returnProcessJson.plIsBottomLevel; - var plRDId = returnProcessJson.plRDId; - var plRP = returnProcessJson.plRP; - /* - * if (plRP == "") { window.top.$.simpleAlert("[责任人]不允许为空"); return; } - */ - var plM = returnProcessJson.plM; - var plExecType = returnProcessJson.plExecType; - var systemName = returnProcessJson.systemName; - var plAwsPid = returnProcessJson.plAwsPid; - var oldPlAwsPid = returnProcessJson.oldPlAwsPid; - var plDiagramUrl = returnProcessJson.plDiagramUrl; - var plColor = returnProcessJson.plColor; - var plSecurityR = returnProcessJson.plSecurityR; - var plSecurityW = returnProcessJson.plSecurityW; - var oldplSecurityW = returnProcessJson.oldplSecurityW; - var oldplSecurityR = returnProcessJson.oldplSecurityR; - var methodId = returnProcessJson.methodId; - var plDutyDept = returnProcessJson.plDutyDept; - var plDutyPerson = returnProcessJson.plDutyPerson; + var returnProcessJson = eval("(" + + window.top.getAwsDialogWindow().returnProcessJson() + ")"); + // alert(returnProcessJson); + var defaultMessageJson = window.top.getAwsDialogWindow().defaultMessageJson; + // alert(defaultMessageJson.plParentId); + var id = returnProcessJson.id; + var wsId = returnProcessJson.wsId; + var plNo = trimSpaces(returnProcessJson.plNo); + var plName = returnProcessJson.plName; + var plLevel = returnProcessJson.plLevel; + plLevel = parseInt(plLevel) + 1; + var plParentId = returnProcessJson.plParentId; + var plDesc = returnProcessJson.plDesc; + var plOrderIndex = returnProcessJson.plOrderIndex; + var plIsBottomLevel = returnProcessJson.plIsBottomLevel; + var plRDId = returnProcessJson.plRDId; + var plRP = returnProcessJson.plRP; + /* + * if (plRP == "") { window.top.$.simpleAlert("[责任人]不允许为空"); return; } + */ + var plM = returnProcessJson.plM; + var plExecType = returnProcessJson.plExecType; + var systemName = returnProcessJson.systemName; + var plAwsPid = returnProcessJson.plAwsPid; + var oldPlAwsPid = returnProcessJson.oldPlAwsPid; + var plDiagramUrl = returnProcessJson.plDiagramUrl; + var plColor = returnProcessJson.plColor; + var plSecurityR = returnProcessJson.plSecurityR; + var plSecurityW = returnProcessJson.plSecurityW; + var oldplSecurityW = returnProcessJson.oldplSecurityW; + var oldplSecurityR = returnProcessJson.oldplSecurityR; + var methodId = returnProcessJson.methodId; + var plDutyDept = returnProcessJson.plDutyDept; + var plDutyPerson = returnProcessJson.plDutyPerson; - if (plName == "") { - window.top.$.simpleAlert("[" + 名称 + "]" + 不允许为空); - return false; - } - if (plName.length > 120) { - window.top.$.simpleAlert("[" + 名称 + "]" + "不允许超过120个字符"); - return false; - } - if (plDesc.length > 1900) { - window.top.$.simpleAlert("[描述]不允许超过2000个字符"); - return false; - } - if (plNo.length >= 36) { - window.top.$.simpleAlert(编号长度不允许超过36个字符); - return false; - } - if (!/^[0-9]*$/.test(plNo)) { - $.simpleAlert("编号只允许为数字类型", "info", 2000); - } - if (methodId == "") { - window.top.$.simpleAlert("对不起,没有找到相应的建模方法"); - return false; - } - if (plIsBottomLevel == -1) { - window.top.$.simpleAlert("[" + 层次 + "]" + 不允许为空); - return false; - } + if (plName == "") { + window.top.$.simpleAlert("[" + 名称 + "]" + 不允许为空); + return false; + } + if (plName.length > 120) { + window.top.$.simpleAlert("[" + 名称 + "]" + "不允许超过120个字符"); + return false; + } + if (plDesc.length > 1900) { + window.top.$.simpleAlert("[描述]不允许超过2000个字符"); + return false; + } + if (plNo.length >= 36) { + window.top.$.simpleAlert(编号长度不允许超过36个字符); + return false; + } + if (!/^[0-9]*$/.test(plNo)) { + $.simpleAlert("编号只允许为数字类型", "info", 2000); + } + if (methodId == "") { + window.top.$.simpleAlert("对不起,没有找到相应的建模方法"); + return false; + } + if (plIsBottomLevel == -1) { + window.top.$.simpleAlert("[" + 层次 + "]" + 不允许为空); + return false; + } - if (plM == -1) { - window.top.$.simpleAlert("[" + 里程碑 + "]" + 不允许为空); - return false; - } + if (plM == -1) { + window.top.$.simpleAlert("[" + 里程碑 + "]" + 不允许为空); + return false; + } - if (plExecType == -1) { - window.top.$.simpleAlert("[" + 执行方式 + "]" + 不允许为空); - return false; - } + if (plExecType == -1) { + window.top.$.simpleAlert("[" + 执行方式 + "]" + 不允许为空); + return false; + } - var params = { - id : id, - wsid : wsId, - plLevel : plLevel, - plParentId : plParentId, - plOrderIndex : plOrderIndex, - plIsBottomLevel : plIsBottomLevel, - plExecType : plExecType, - plNo : plNo, - plName : plName.trim(), - plDesc : plDesc, - plRd : plRDId, - plRp : plRP, - plM : plM, - plSystemName : systemName, - plAwsPid : plAwsPid, - oldPlAwsPid : oldPlAwsPid, - plDiagramUrl : plDiagramUrl, - plColor : plColor, - plSecurityW : plSecurityW, - oldplSecurityW : oldplSecurityW, - plSecurityR : plSecurityR, - oldplSecurityR : oldplSecurityR, - methodId : methodId, - plDutyDept : plDutyDept, - plDutyPerson : plDutyPerson - }; - jQuery.ajax({ - type : "POST", - url : "./jd?sid=" + encodeURIComponent(jQuery('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_save", - data : params, - success : function(msg) { - if (typeof(msg) == "string") { - msg = eval('(' + msg + ')'); - } - msg = msg.msg; - if (msg.indexOf("-1") == -1) { - parent.$("#iflowlist").get(0).contentWindow.refresh(); - window.top.$.simpleAlert("新建成功", "ok", 2000); - window.top.closeAwsDialog(); - } else { - window.top.$.simpleAlert("保存流程层级失败请稍后重试"); - } - } - }); - return true; + var params = { + id : id, + wsid : wsId, + plLevel : plLevel, + plParentId : plParentId, + plOrderIndex : plOrderIndex, + plIsBottomLevel : plIsBottomLevel, + plExecType : plExecType, + plNo : plNo, + plName : plName.trim(), + plDesc : plDesc, + plRd : plRDId, + plRp : plRP, + plM : plM, + plSystemName : systemName, + plAwsPid : plAwsPid, + oldPlAwsPid : oldPlAwsPid, + plDiagramUrl : plDiagramUrl, + plColor : plColor, + plSecurityW : plSecurityW, + oldplSecurityW : oldplSecurityW, + plSecurityR : plSecurityR, + oldplSecurityR : oldplSecurityR, + methodId : methodId, + plDutyDept : plDutyDept, + plDutyPerson : plDutyPerson + }; + jQuery.ajax({ + type : "POST", + url : "./jd?sid=" + encodeURIComponent(jQuery('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_save", + data : params, + success : function(msg) { + if (typeof(msg) == "string") { + msg = eval('(' + msg + ')'); + } + msg = msg.msg; + if (msg.indexOf("-1") == -1) { + parent.$("#iflowlist").get(0).contentWindow.refresh(); + window.top.$.simpleAlert("新建成功", "ok", 2000); + window.top.closeAwsDialog(); + } else { + window.top.$.simpleAlert("保存流程层级失败请稍后重试"); + } + } + }); + return true; } // ------------------------ function zTreeBeforeAsync(treeId, treeNode) { @@ -228,14 +228,14 @@ function zTreeBeforeAsync(treeId, treeNode) { } function getParam() { - var wsId = jQuery("#wsId").val(); - var sessionId = jQuery("#sid").val(); - var param = { - sid : sessionId, - cmd : "com.actionsoft.apps.coe.pal_processlevel_treejson", - wsid : wsId - }; - return param; + var wsId = jQuery("#wsId").val(); + var sessionId = jQuery("#sid").val(); + var param = { + sid : sessionId, + cmd : "com.actionsoft.apps.coe.pal_processlevel_treejson", + wsid : wsId + }; + return param; } function setOrderIndexByOutGoing(outgoing, uuid, orderIndex) { @@ -247,266 +247,266 @@ function setOrderIndexByArray(array, uuid, orderIndex) { } function initTree() { - $("#repositoryTree").empty(); - var wsId = $("#wsId").val(); - if (wsId) { - var setting = getSetings(); - repositoryTree = awsui.tree.init($("#repositoryTree"), setting); - $("#repositoryTree").css("height", "auto"); - } else { - window.top.$.simpleAlert("请选择流程资产", "info", 2000); - } - if (repositoryTree.getSelectedNode() == undefined) { - repositoryTree.selectNode(repositoryTree.config.data[0].id, true); - } + $("#repositoryTree").empty(); + var wsId = $("#wsId").val(); + if (wsId) { + var setting = getSetings(); + repositoryTree = awsui.tree.init($("#repositoryTree"), setting); + $("#repositoryTree").css("height", "auto"); + } else { + window.top.$.simpleAlert("请选择流程资产", "info", 2000); + } + if (repositoryTree.getSelectedNode() == undefined) { + repositoryTree.selectNode(repositoryTree.config.data[0].id, true); + } } function getSetings() { - var setting = { - sort : true, - dblClickToExpand : true, - event : { - beforeDrag : beforeDrag, - beforeDrop : beforeDrop, - onDrop : onDrop, - onClick : clickNode, - beforeExpand : loadData, - afterLoad : afterLoad - }, - edit : { - enable : true, - showRemoveBtn : false, - showRenameBtn : false, - drag : { - prev : true, - next : true, - inner : true - } - }, - async : { - enable : true, - type : "post", - url : "./w", - autoParam : [ "id=pid" ], - otherParam : getParam() - }, - data : { - keep : { - parent : true - } - } - }; - setting.contextMenu = { - items : [ - { - text : "复制", - tit : "copy", - method : function(obj) { - var node = repositoryTree.getSelectedNode(); - setPlParentIDAndProcessLevel(node); - copeFileNode = node; - $(setting.contextMenu.target).menu("close"); - } - }, - { - text : "粘贴", - tit : "paste", - method : function(obj) { - if (copeFileNode == null) { - window.top.$.simpleAlert("请先复制文件", "info", 2000); - $(setting.contextMenu.target).menu("close"); - return; - } - var node = repositoryTree.getSelectedNode(); - if (node.plCategory != copeFileNode.plCategory) { - window.top.$.simpleAlert("对不起,不能跨文件类型粘贴", "info", - 2000); - $(setting.contextMenu.target).menu("close"); - return; - } - setPlParentIDAndProcessLevel(node); - $.ajax({ - url : './w?cmd=com.actionsoft.apps.coe.pal_processlevel_copy&sid=' - + encodeURIComponent($('#sid').val()) - + '&sourceUUID=' + copeFileNode.id - + '&targetUUID=' + node.id, - async : false, - success : function(msg) { - if (typeof(msg) == "string") { - msg = eval('(' + msg + ')').data; - } - refresh(); - if (msg.success == "true") { - window.top.$.simpleAlert(msg.message, "ok", 2000); - } else { - window.top.$.simpleAlert(msg.message, "error"); - } - } - }) - $(setting.contextMenu.target).menu("close"); - } - },{ - text : "新增", - tit : "create", - method : function(obj) { - var node = repositoryTree.getSelectedNode(); - createProcessLevelv2(window,$("#wsId").val(),node.id,node.plLevel, ''); - $(setting.contextMenu.target).menu("close"); - } - },{ - text : "删除", - tit : "remove", - method : function(obj) { - $(setting.contextMenu.target).menu("close"); - var node = repositoryTree.getSelectedNode(); - deleteProcessLevel(window, node.name, node.id, node.pid); - } - } - - ], - target : "#contextMenu" - }; - - setting.dataModel = { - data : data - }; - return setting; + var setting = { + sort : true, + dblClickToExpand : true, + event : { + beforeDrag : beforeDrag, + beforeDrop : beforeDrop, + onDrop : onDrop, + onClick : clickNode, + beforeExpand : loadData, + afterLoad : afterLoad + }, + edit : { + enable : true, + showRemoveBtn : false, + showRenameBtn : false, + drag : { + prev : true, + next : true, + inner : true + } + }, + async : { + enable : true, + type : "post", + url : "./w", + autoParam : [ "id=pid" ], + otherParam : getParam() + }, + data : { + keep : { + parent : true + } + } + }; + setting.contextMenu = { + items : [ + { + text : "复制", + tit : "copy", + method : function(obj) { + var node = repositoryTree.getSelectedNode(); + setPlParentIDAndProcessLevel(node); + copeFileNode = node; + $(setting.contextMenu.target).menu("close"); + } + }, + { + text : "粘贴", + tit : "paste", + method : function(obj) { + if (copeFileNode == null) { + window.top.$.simpleAlert("请先复制文件", "info", 2000); + $(setting.contextMenu.target).menu("close"); + return; + } + var node = repositoryTree.getSelectedNode(); + if (node.plCategory != copeFileNode.plCategory) { + window.top.$.simpleAlert("对不起,不能跨文件类型粘贴", "info", + 2000); + $(setting.contextMenu.target).menu("close"); + return; + } + setPlParentIDAndProcessLevel(node); + $.ajax({ + url : './w?cmd=com.actionsoft.apps.coe.pal_processlevel_copy&sid=' + + encodeURIComponent($('#sid').val()) + + '&sourceUUID=' + copeFileNode.id + + '&targetUUID=' + node.id, + async : false, + success : function(msg) { + if (typeof(msg) == "string") { + msg = eval('(' + msg + ')').data; + } + refresh(); + if (msg.success == "true") { + window.top.$.simpleAlert(msg.message, "ok", 2000); + } else { + window.top.$.simpleAlert(msg.message, "error"); + } + } + }) + $(setting.contextMenu.target).menu("close"); + } + },{ + text : "新增", + tit : "create", + method : function(obj) { + var node = repositoryTree.getSelectedNode(); + createProcessLevelv2(window,$("#wsId").val(),node.id,node.plLevel, ''); + $(setting.contextMenu.target).menu("close"); + } + },{ + text : "删除", + tit : "remove", + method : function(obj) { + $(setting.contextMenu.target).menu("close"); + var node = repositoryTree.getSelectedNode(); + deleteProcessLevel(window, node.name, node.id, node.pid); + } + } + + ], + target : "#contextMenu" + }; + + setting.dataModel = { + data : data + }; + return setting; } function loadData(treeNode) { - // 如果是父节点并且存在子节点执行加载 - if (treeNode && treeNode.id.length == 36) { - var dataModel = { - url : "./w?sid=" + jQuery("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_treejson&pid=" + treeNode.id - + "&wsid=" + jQuery("#wsId").val(), - method : "POST", - dataType : "json" - } - repositoryTree.refreshNode({ - id : treeNode.id, - dataModel : dataModel - }); - } + // 如果是父节点并且存在子节点执行加载 + if (treeNode && treeNode.id.length == 36) { + var dataModel = { + url : "./w?sid=" + jQuery("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_treejson&pid=" + treeNode.id + + "&wsid=" + jQuery("#wsId").val(), + method : "POST", + dataType : "json" + } + repositoryTree.refreshNode({ + id : treeNode.id, + dataModel : dataModel + }); + } } function afterLoad() { - $("a[tabindex=process]").trigger("click.nodeClick"); + $("a[tabindex=process]").trigger("click.nodeClick"); } // 拖拽前事件 function beforeDrag(treeNode) { - return true; + return true; } // 移动节点前现将所有的 orderindex计入一个集合 function putOrdexIndexs(treeNode) { - var nodes = repositoryTree.getChildrenByPid(treeNode.pid); - for (var i = 0; i < nodes.length; i++) { - orderIndexs[i] = nodes[i].plOrdexIndex; - } + var nodes = repositoryTree.getChildrenByPid(treeNode.pid); + for (var i = 0; i < nodes.length; i++) { + orderIndexs[i] = nodes[i].plOrdexIndex; + } } var dragType = ""; function beforeDrop(target, source) { - if (target.plCategory != source.plCategory) { - window.top.$.simpleAlert("不允许跨文件类型移动", "info", 2000); - return false; - } - if (repositoryTree.moveObj.find("span:first").hasClass("inner")) { - dragType = "inner"; //插入target内部 - } else { - dragType = "insert"; //插入target后面 - } - return true; + if (target.plCategory != source.plCategory) { + window.top.$.simpleAlert("不允许跨文件类型移动", "info", 2000); + return false; + } + if (repositoryTree.moveObj.find("span:first").hasClass("inner")) { + dragType = "inner"; //插入target内部 + } else { + dragType = "insert"; //插入target后面 + } + return true; } function onDrop(target, source, position) { - if(dragType == 'inner' && target.id == source.pid) { - $.simpleAlert('不允许移动到'+ source.name +'自身的父节点内部', 'error'); - return; - } - // 添加特殊情况处理sunlh - var flag = true; - if(dragType == 'insert') { - // 若目标文件为展开状态,增加是放入目标文件的后面或者放入目标文件的内部第一个的判断 - var targetId = target.id; - if($('#tree_ul_' + targetId).length > 0) { //存在加载好的子节点 - if(!$('#tree_ul_' + targetId).is(':hidden')) { // 子节点已展开 - flag = false; - $('#moveDialog').dialog({ - title : '移动选项', - buttons: [ - {text:'确定',cls:"blue",handler:function(){ - if($('#moveInnerFirst').prop('checked')) { - var firstChildId = $('#tree_ul_' + targetId).find('li:first').attr('li_index'); - var targetNode = repositoryTree.getNodeById(firstChildId); - moveTreeNode(targetNode, source, 'above'); - } - if($('#moveInsertBelow').prop('checked')) { - moveTreeNode(target, source, position); - } - $('#moveDialog').dialog('close'); - }}, - {text:'取消',handler:function(){$('#moveDialog').dialog('close');return;}} - ], - onClose: function() { - $('#moveInnerFirst').check('option','checked', true); - } - }); - } - } - } - if(flag) { - moveTreeNode(target, source, position); - } + if(dragType == 'inner' && target.id == source.pid) { + $.simpleAlert('不允许移动到'+ source.name +'自身的父节点内部', 'error'); + return; + } + // 添加特殊情况处理sunlh + var flag = true; + if(dragType == 'insert') { + // 若目标文件为展开状态,增加是放入目标文件的后面或者放入目标文件的内部第一个的判断 + var targetId = target.id; + if($('#tree_ul_' + targetId).length > 0) { //存在加载好的子节点 + if(!$('#tree_ul_' + targetId).is(':hidden')) { // 子节点已展开 + flag = false; + $('#moveDialog').dialog({ + title : '移动选项', + buttons: [ + {text:'确定',cls:"blue",handler:function(){ + if($('#moveInnerFirst').prop('checked')) { + var firstChildId = $('#tree_ul_' + targetId).find('li:first').attr('li_index'); + var targetNode = repositoryTree.getNodeById(firstChildId); + moveTreeNode(targetNode, source, 'above'); + } + if($('#moveInsertBelow').prop('checked')) { + moveTreeNode(target, source, position); + } + $('#moveDialog').dialog('close'); + }}, + {text:'取消',handler:function(){$('#moveDialog').dialog('close');return;}} + ], + onClose: function() { + $('#moveInnerFirst').check('option','checked', true); + } + }); + } + } + } + if(flag) { + moveTreeNode(target, source, position); + } } // 拖动树节点 function moveTreeNode(target, source, position) { - var sourceParentNode = repositoryTree.getNodeById(source.pid); - var targetParentNode = repositoryTree.getNodeById(target.pid); - if (targetParentNode == undefined) { - targetParentNode = repositoryTree.getNodeById(target.id); - } - var msg = ""; - if(dragType == 'inner') {// 放入里面,默认最后的位置 - msg = "确认将" + source.name + "放入" + target.name + "里面?"; - } - if(dragType == 'insert') {// 放入文件之间 - if(position == 'below') {// 放入target下面 - msg = "确认将" + source.name + "放入" + target.name + "的后面(同级)?"; - } - if(position == 'above') {// 放入target上面 - msg = "确认将" + source.name + "放入" + target.name + "的前面(同级)?"; - } - } - var options = { - title : "提示", - content:msg, - onConfirm: function(){ - // 拖拽成功后 - awsui.ajax.request({ - url : "./jd", - method : "POST", - data : { - sid: $("#sid").val(), - cmd: "com.actionsoft.apps.coe.pal_update_index_or_pid", - sourceId: source.id, - targetId: target.id, - type: dragType, - position: position - }, - ok : function(r) { - //initTree(); - doLoad(sourceParentNode); - doLoad(targetParentNode); - dragType = ""; - }, - err:function(r){ - } - }); - }, - onCancel : function(){ - return true; - } - }; - $.confirm(options); + var sourceParentNode = repositoryTree.getNodeById(source.pid); + var targetParentNode = repositoryTree.getNodeById(target.pid); + if (targetParentNode == undefined) { + targetParentNode = repositoryTree.getNodeById(target.id); + } + var msg = ""; + if(dragType == 'inner') {// 放入里面,默认最后的位置 + msg = "确认将" + source.name + "放入" + target.name + "里面?"; + } + if(dragType == 'insert') {// 放入文件之间 + if(position == 'below') {// 放入target下面 + msg = "确认将" + source.name + "放入" + target.name + "的后面(同级)?"; + } + if(position == 'above') {// 放入target上面 + msg = "确认将" + source.name + "放入" + target.name + "的前面(同级)?"; + } + } + var options = { + title : "提示", + content:msg, + onConfirm: function(){ + // 拖拽成功后 + awsui.ajax.request({ + url : "./jd", + method : "POST", + data : { + sid: $("#sid").val(), + cmd: "com.actionsoft.apps.coe.pal_update_index_or_pid", + sourceId: source.id, + targetId: target.id, + type: dragType, + position: position + }, + ok : function(r) { + //initTree(); + doLoad(sourceParentNode); + doLoad(targetParentNode); + dragType = ""; + }, + err:function(r){ + } + }); + }, + onCancel : function(){ + return true; + } + }; + $.confirm(options); } /*var dragType = ""; function beforeDrop(target, source) { @@ -545,7 +545,7 @@ function onDrop(target, source, position) { }, ok : function(r) { //initTree(); - + doLoad(sourceParentNode); doLoad(targetParentNode); }, @@ -561,302 +561,302 @@ function onDrop(target, source, position) { }*/ // 同级移动返回更新后的orderIndex function getNewOrderIndexStr(parentNode) { - var str = ""; - var nodes = repositoryTree.getChildrenByPid(parentNode.id); - ; - for (var i = 0; i < nodes.length; i++) { - nodes[i].plOrdexIndex = orderIndexs[i]; - } - for (var i = 0; i < nodes.length; i++) { - if (i == 0) { - str += nodes[i].id + "|" + nodes[i].plOrdexIndex; - } else { - str += "," + nodes[i].id + "|" + nodes[i].plOrdexIndex; - } - } - // console.log(str); - return str; + var str = ""; + var nodes = repositoryTree.getChildrenByPid(parentNode.id); + ; + for (var i = 0; i < nodes.length; i++) { + nodes[i].plOrdexIndex = orderIndexs[i]; + } + for (var i = 0; i < nodes.length; i++) { + if (i == 0) { + str += nodes[i].id + "|" + nodes[i].plOrdexIndex; + } else { + str += "," + nodes[i].id + "|" + nodes[i].plOrdexIndex; + } + } + // console.log(str); + return str; } // 跨级移动更新pid function getNewPid(treeNodes, afterId) { - var pids = ""; - for (var i = 0; i < treeNodes.length; i++) { - if (i == 0) { - pids += treeNodes[i].id; - } else { - pids += "|" + treeNodes[i].id; - } - } - pids += "," + afterId; - return pids; + var pids = ""; + for (var i = 0; i < treeNodes.length; i++) { + if (i == 0) { + pids += treeNodes[i].id; + } else { + pids += "|" + treeNodes[i].id; + } + } + pids += "," + afterId; + return pids; } // 异步设置orderindex function updateOrderIndex(str, target, source) { - var param = { - orderIndexs : str - } - jQuery.ajax({ - type : "POST", - url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_setploaderindex", - data : param, - success : function(msg) { - if (msg == "-1") { - window.top.$.simpleAlert("拖动失败请稍候重试", "info", 2000); - } else { - window.setTimeout(function() { - refreshNode(source.pid); - }, 300); - window.setTimeout(function() { - refreshNode(target.id); - }, 300); - } - } - }); + var param = { + orderIndexs : str + } + jQuery.ajax({ + type : "POST", + url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_setploaderindex", + data : param, + success : function(msg) { + if (msg == "-1") { + window.top.$.simpleAlert("拖动失败请稍候重试", "info", 2000); + } else { + window.setTimeout(function() { + refreshNode(source.pid); + }, 300); + window.setTimeout(function() { + refreshNode(target.id); + }, 300); + } + } + }); } function updatePid(str, target, source) { - var param = { - pids : str - } - jQuery.ajax({ - type : "POST", - url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_setplid", - data : param, - success : function(msg) { - if (msg == "-1") { - window.top.$.simpleAlert("拖动失败请稍候重试", "info", 2000); - } else { - window.setTimeout(function() { - refreshNode(source.pid); - }, 300); - window.setTimeout(function() { - refreshNode(target.id); - }, 300); - } - } - }); + var param = { + pids : str + } + jQuery.ajax({ + type : "POST", + url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_setplid", + data : param, + success : function(msg) { + if (msg == "-1") { + window.top.$.simpleAlert("拖动失败请稍候重试", "info", 2000); + } else { + window.setTimeout(function() { + refreshNode(source.pid); + }, 300); + window.setTimeout(function() { + refreshNode(target.id); + }, 300); + } + } + }); } function clickNode(treeNode) { - if (treeNode.id.length == 36) { - openDesginer(treeNode.id, 0, treeNode.name, "", treeNode.versionId, false, "0"); - } + if (treeNode.id.length == 36) { + openDesginer(treeNode.id, 0, treeNode.name, "", treeNode.versionId, false, "0"); + } } function openDesginer(uuid, openType, plName, appId, processVersionId, - isOpenDialog, collaboration) { - if(collaboration == undefined || collaboration == null) { - collaboration = "0"; - } - var params = { - sid : encodeURIComponent(jQuery('#sid').val()), - cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer", - uuid : uuid, - openType : openType, - processDefId : processVersionId, - collaboration : collaboration, - teamId : "", - perms: "w,d,v", - filePerms: "-" - }, url, options; - if (typeof (isOpenDialog) == "boolean" && isOpenDialog) {// 打开与bpmn关联的多个版本 - params = { - sid : encodeURIComponent(jQuery('#sid').val()), - cmd : "com.actionsoft.apps.coe.pal_pl_repository_version", - uuid : uuid, - appId : appId, - processVersionId : processVersionId - }; - url = "./w?" + connectParams(params); - options = { - buttons : [ // 按钮组 - { - text : '关闭', - handler : function() { - window.top.closeAwsDialog(); - } - } ] - } - window.top.openAwsDialog(url, plName, 770, 415, options); - return; - } - url = "./w?" + connectParams(params); - $("#disignerIframe").attr("src", url).attr("uuid", uuid); + isOpenDialog, collaboration) { + if(collaboration == undefined || collaboration == null) { + collaboration = "0"; + } + var params = { + sid : encodeURIComponent(jQuery('#sid').val()), + cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer", + uuid : uuid, + openType : openType, + processDefId : processVersionId, + collaboration : collaboration, + teamId : "", + perms: "w,d,v", + filePerms: "-" + }, url, options; + if (typeof (isOpenDialog) == "boolean" && isOpenDialog) {// 打开与bpmn关联的多个版本 + params = { + sid : encodeURIComponent(jQuery('#sid').val()), + cmd : "com.actionsoft.apps.coe.pal_pl_repository_version", + uuid : uuid, + appId : appId, + processVersionId : processVersionId + }; + url = "./w?" + connectParams(params); + options = { + buttons : [ // 按钮组 + { + text : '关闭', + handler : function() { + window.top.closeAwsDialog(); + } + } ] + } + window.top.openAwsDialog(url, plName, 770, 415, options); + return; + } + url = "./w?" + connectParams(params); + $("#disignerIframe").attr("src", url).attr("uuid", uuid); } function openDesginerFromAttr(uuid, openType, plName, appId, processVersionId, - isOpenDialog, shapeId) { - var params = { - sid : encodeURIComponent(jQuery('#sid').val()), - cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer_open_shape_page", - uuid : uuid, - openType : openType, - processDefId : processVersionId, - shapeId : shapeId, - teamId : "" - }; - var url = "./w?" + connectParams(params); - $("#disignerIframe").attr("src", url).attr("uuid", uuid); + isOpenDialog, shapeId) { + var params = { + sid : encodeURIComponent(jQuery('#sid').val()), + cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer_open_shape_page", + uuid : uuid, + openType : openType, + processDefId : processVersionId, + shapeId : shapeId, + teamId : "" + }; + var url = "./w?" + connectParams(params); + $("#disignerIframe").attr("src", url).attr("uuid", uuid); } function connectParams(params) { - var connParms = ""; - if (typeof (params) == "object") { - for ( var i in params) { - connParms += i + "=" + params[i] + "&"; - } - } + var connParms = ""; + if (typeof (params) == "object") { + for ( var i in params) { + connParms += i + "=" + params[i] + "&"; + } + } - return connParms.substring(0, connParms.length - 1); + return connParms.substring(0, connParms.length - 1); } function closeTabById(index) { - awsTabs.closeTab(index, null); + awsTabs.closeTab(index, null); } // 异步节点加载成功后回调 function onAsyncSuccess(event, treeId, treeNode, msg) { - var zTree = jQuery.fn.zTree.getZTreeObj("processLevelTree"); - setTimeout(function() { - if (treeNode) { - if (treeNode.level < 1) { // 展开到指定层级 - if (treeNode.children && treeNode.children.length > 0) { - expandNodes(zTree, treeNode.children); - } - } - } - }, 500); // 加载下级节点 + var zTree = jQuery.fn.zTree.getZTreeObj("processLevelTree"); + setTimeout(function() { + if (treeNode) { + if (treeNode.level < 1) { // 展开到指定层级 + if (treeNode.children && treeNode.children.length > 0) { + expandNodes(zTree, treeNode.children); + } + } + } + }, 500); // 加载下级节点 } function getNodeIndex(nodes, treeNode) { - var index = 0; - if (nodes && treeNode) { - for (var i = 0; nodes.length; i++) { - if (treeNode.id == nodes[i].id) { - index = i + 1; - break; - } - } - } - return index; + var index = 0; + if (nodes && treeNode) { + for (var i = 0; nodes.length; i++) { + if (treeNode.id == nodes[i].id) { + index = i + 1; + break; + } + } + } + return index; } function setPlParentIDAndProcessLevel(treeNode) { - if (!treeNode.isParent) { - treeNode.isParent = true; - } - plParentid = treeNode.id; - processLevel = treeNode.plLevel; - isLeaf = treeNode.isParent; + if (!treeNode.isParent) { + treeNode.isParent = true; + } + plParentid = treeNode.id; + processLevel = treeNode.plLevel; + isLeaf = treeNode.isParent; } // 展开所有节点 function expandNodes(zTree, nodes) { - if (!nodes) - return; - for (var i = 0, l = nodes.length; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent) { - expandNodes(nodes[i].children); - } - } + if (!nodes) + return; + for (var i = 0, l = nodes.length; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent) { + expandNodes(nodes[i].children); + } + } } // 自动展开两级节点 function expandNodesFirst(zTree, nodes) { - if (!nodes) - return; - for (var i = 0, l = 1; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent && nodes[i].zAsync) { - expandNodesFirst(nodes[i].children); - } - } + if (!nodes) + return; + for (var i = 0, l = 1; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent && nodes[i].zAsync) { + expandNodesFirst(nodes[i].children); + } + } } // 自动展开n级节点 function expandNodesN(zTree, nodes, n) { - if (!nodes) - return; - for (var i = 0, l = n; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent) { - expandNodesN(zTree, nodes[i].children, n); - } - } + if (!nodes) + return; + for (var i = 0, l = n; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent) { + expandNodesN(zTree, nodes[i].children, n); + } + } } // 刷新指定节点 function refreshNode(id) { - if (!id) { - id = plParentid; - } - var node = repositoryTree.getNodeById(id); - if (node == null) { - } else { - loadData(node); - if (repositoryTree.existsChildren(id)) { - node.open = true; - } else { - delete node.open; - } - doLoad(node, "reload"); - } + if (!id) { + id = plParentid; + } + var node = repositoryTree.getNodeById(id); + if (node == null) { + } else { + loadData(node); + if (repositoryTree.existsChildren(id)) { + node.open = true; + } else { + delete node.open; + } + doLoad(node, "reload"); + } } // 刷新树 function refresh(id) { - refreshNode(id); + refreshNode(id); } function doLoad(treeNode, type) { - var dataModel = { - url : "./jd?sid=" + $("#sid").val() - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_treejson&pid=" + treeNode.id - + "&wsid=" + $("#wsId").val(), - method : "POST", - dataType : "json" - } - repositoryTree.refreshNode({ - id : treeNode.id, - dataModel : dataModel - }); + var dataModel = { + url : "./jd?sid=" + $("#sid").val() + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_treejson&pid=" + treeNode.id + + "&wsid=" + $("#wsId").val(), + method : "POST", + dataType : "json" + } + repositoryTree.refreshNode({ + id : treeNode.id, + dataModel : dataModel + }); } function deleteProcessLevel(wd, name, id, pid) { - var options = { - title : "提示", - content : "确定删除流程" + "[" + name + "]" + "吗?", - model : false, - onConfirm : function() { - $.simpleAlert("正在处理", "loading"); - var wsId = jQuery("#wsId").val(); - var params = { - wsid : wsId, - pid : id - }; - jQuery.ajax({ - type : "POST", - url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) - + "&cmd=com.actionsoft.apps.coe.pal_processlevel_tree_remove", - data : params, - success : function(msg) { - $.simpleAlert("close"); - msg = eval('(' + msg + ')').msg; - if (msg == "1") { - $.simpleAlert("删除成功", "ok", 2000); - refreshNode(pid); - if ($("#disignerIframe").attr("uuid") == id) { - $("#disignerIframe").attr("uuid", "").attr("src", ""); - } - } else { - $.simpleAlert("删除失败请稍后重试", "info", 2000); - } - } - }); - } - }; - window.top.$.confirm(options); + var options = { + title : "提示", + content : "确定删除流程" + "[" + name + "]" + "吗?", + model : false, + onConfirm : function() { + $.simpleAlert("正在处理", "loading"); + var wsId = jQuery("#wsId").val(); + var params = { + wsid : wsId, + pid : id + }; + jQuery.ajax({ + type : "POST", + url : "./w?sid=" + encodeURIComponent(jQuery('#sid').val()) + + "&cmd=com.actionsoft.apps.coe.pal_processlevel_tree_remove", + data : params, + success : function(msg) { + $.simpleAlert("close"); + msg = eval('(' + msg + ')').msg; + if (msg == "1") { + $.simpleAlert("删除成功", "ok", 2000); + refreshNode(pid); + if ($("#disignerIframe").attr("uuid") == id) { + $("#disignerIframe").attr("uuid", "").attr("src", ""); + } + } else { + $.simpleAlert("删除失败请稍后重试", "info", 2000); + } + } + }); + } + }; + window.top.$.confirm(options); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.search.home.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.search.home.js index e27a826f..4f18b3a5 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.search.home.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.search.home.js @@ -10,140 +10,140 @@ var drpSourceParentId; var isOpenMainIfranme = false; var repositoryTree; $(document).ready(function() { - initTree(); - repositoryTree.expandNode($("a[tbindex=process]"), true); - $("a[tbindex=process]").click(); + initTree(); + repositoryTree.expandNode($("a[tbindex=process]"), true); + $("a[tbindex=process]").click(); }); function initTree() { - $("#repositoryTree").empty(); - var wsId = $("#wsId").val(); - if (wsId) { - var setting = getSetings(); - repositoryTree = awsui.tree.init($("#repositoryTree"), setting); - $("#repositoryTree").css("height", "auto"); - } else { - window.top.$.simpleAlert("请选择流程资产", "info", 2000); - } - if (repositoryTree.getSelectedNode() == undefined) { - repositoryTree.selectNode(repositoryTree.config.data[0].id, true); - } + $("#repositoryTree").empty(); + var wsId = $("#wsId").val(); + if (wsId) { + var setting = getSetings(); + repositoryTree = awsui.tree.init($("#repositoryTree"), setting); + $("#repositoryTree").css("height", "auto"); + } else { + window.top.$.simpleAlert("请选择流程资产", "info", 2000); + } + if (repositoryTree.getSelectedNode() == undefined) { + repositoryTree.selectNode(repositoryTree.config.data[0].id, true); + } } function getSetings() { - var setting = { - sort : true, - dblClickToExpand : true, - event : { - onClick : clickNode - }, - data : { - keep : { - parent : true - } - } - }; - - - setting.dataModel = { - data : data - }; - return setting; + var setting = { + sort : true, + dblClickToExpand : true, + event : { + onClick : clickNode + }, + data : { + keep : { + parent : true + } + } + }; + + + setting.dataModel = { + data : data + }; + return setting; } function clickNode(treeNode) { - if (treeNode.id.length == 36) { - openDesginer(treeNode.id, 0, treeNode.name, "", treeNode.versionId, false, "1"); - } else { - if (processRootId != "") { - openDesginer(processRootId, 0, treeNode.name, "", "", false, "1"); - } - } + if (treeNode.id.length == 36) { + openDesginer(treeNode.id, 0, treeNode.name, "", treeNode.versionId, false, "1"); + } else { + if (processRootId != "") { + openDesginer(processRootId, 0, treeNode.name, "", "", false, "1"); + } + } } function openDesginer(uuid, openType, plName, appId, processVersionId, - isOpenDialog, collaboration) { - if(collaboration == undefined || collaboration == null) { - collaboration = "0"; - } - var params = { - sid : encodeURIComponent(jQuery('#sid').val()), - cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer_viewer", - uuid : uuid, - openType : openType, - processDefId : processVersionId, - collaboration : collaboration, - teamId : "", - perms: "v", - filePerms: filePerms - }, url, options; - if (typeof (isOpenDialog) == "boolean" && isOpenDialog) {// 打开与bpmn关联的多个版本 - params = { - sid : encodeURIComponent(jQuery('#sid').val()), - cmd : "com.actionsoft.apps.coe.pal_pl_repository_version", - uuid : uuid, - appId : appId, - processVersionId : processVersionId - }; - url = "./w?" + connectParams(params); - options = { - buttons : [ // 按钮组 - { - text : '关闭', - handler : function() { - window.top.closeAwsDialog(); - } - } ] - } - window.top.openAwsDialog(url, plName, 770, 415, options); - return; - } - url = "./w?" + connectParams(params); - $("#disignerIframe").attr("src", url).attr("uuid", uuid); + isOpenDialog, collaboration) { + if(collaboration == undefined || collaboration == null) { + collaboration = "0"; + } + var params = { + sid : encodeURIComponent(jQuery('#sid').val()), + cmd : "com.actionsoft.apps.coe.pal_pl_repository_designer_viewer", + uuid : uuid, + openType : openType, + processDefId : processVersionId, + collaboration : collaboration, + teamId : "", + perms: "v", + filePerms: filePerms + }, url, options; + if (typeof (isOpenDialog) == "boolean" && isOpenDialog) {// 打开与bpmn关联的多个版本 + params = { + sid : encodeURIComponent(jQuery('#sid').val()), + cmd : "com.actionsoft.apps.coe.pal_pl_repository_version", + uuid : uuid, + appId : appId, + processVersionId : processVersionId + }; + url = "./w?" + connectParams(params); + options = { + buttons : [ // 按钮组 + { + text : '关闭', + handler : function() { + window.top.closeAwsDialog(); + } + } ] + } + window.top.openAwsDialog(url, plName, 770, 415, options); + return; + } + url = "./w?" + connectParams(params); + $("#disignerIframe").attr("src", url).attr("uuid", uuid); } function connectParams(params) { - var connParms = ""; - if (typeof (params) == "object") { - for ( var i in params) { - connParms += i + "=" + params[i] + "&"; - } - } + var connParms = ""; + if (typeof (params) == "object") { + for ( var i in params) { + connParms += i + "=" + params[i] + "&"; + } + } - return connParms.substring(0, connParms.length - 1); + return connParms.substring(0, connParms.length - 1); } // 展开所有节点 function expandNodes(zTree, nodes) { - if (!nodes) - return; - for (var i = 0, l = nodes.length; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent) { - expandNodes(nodes[i].children); - } - } + if (!nodes) + return; + for (var i = 0, l = nodes.length; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent) { + expandNodes(nodes[i].children); + } + } } // 自动展开两级节点 function expandNodesFirst(zTree, nodes) { - if (!nodes) - return; - for (var i = 0, l = 1; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent && nodes[i].zAsync) { - expandNodesFirst(nodes[i].children); - } - } + if (!nodes) + return; + for (var i = 0, l = 1; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent && nodes[i].zAsync) { + expandNodesFirst(nodes[i].children); + } + } } // 自动展开n级节点 function expandNodesN(zTree, nodes, n) { - if (!nodes) - return; - for (var i = 0, l = n; i < l; i++) { - zTree.expandNode(nodes[i], true, false, false); - if (nodes[i].isParent) { - expandNodesN(zTree, nodes[i].children, n); - } - } + if (!nodes) + return; + for (var i = 0, l = n; i < l; i++) { + zTree.expandNode(nodes[i], true, false, false); + if (nodes[i].isParent) { + expandNodesN(zTree, nodes[i].children, n); + } + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.banner.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.banner.js index f910a9b8..eb4a5345 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.banner.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.banner.js @@ -1,17 +1,17 @@ $(document).ready(function(){ - renderBannerXPagesConfigPage(); + renderBannerXPagesConfigPage(); }); function renderBannerXPagesConfigPage(){ - var contentStr="
      "; - //contentStr+="

      流程发布门户-轮播图

      "; + var contentStr="
      "; + //contentStr+="

      流程发布门户-轮播图

      "; contentStr+="
      轮播图
      "; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_banner_msg"; - //$(".xpagesContent").empty(); - $(".xpagePublishBanner-wrap").find(".xpagesContent").val(url); + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_banner_msg"; + //$(".xpagesContent").empty(); + $(".xpagePublishBanner-wrap").find(".xpagesContent").val(url); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.common.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.common.js index 49551c3a..2ead5786 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.common.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.common.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; //contentStr+="

      流程发布门户-常用流程

      "; contentStr+="
      设置显示个数
      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_common_msg&count="+count; - //$(".xpagesContent").empty(); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_common_msg&count="+count; + //$(".xpagesContent").empty(); $(".xpagePublishCommon-wrap").find(".xpagesContent").val(url); - }else{ + }else{ $(".xpagePublishCommon-wrap").find(".xpagesContent").val(""); - //$(".xpagesContent").empty(); - } - }); + //$(".xpagesContent").empty(); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.controlmap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.controlmap.js index a3c9eb77..095b8e3a 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.controlmap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.controlmap.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; //contentStr+="

      流程发布门户-控制地图

      "; contentStr+="
      设置显示个数
      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 @@ -19,17 +19,17 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_control_msg&count="+count; - //$(".xpagesContent").empty(); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_control_msg&count="+count; + //$(".xpagesContent").empty(); $(".xpagePublishControlMap-wrap").find(".xpagesContent").val(url); - }else{ + }else{ $(".xpagePublishControlMap-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.datamap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.datamap.js index 6caac7c9..c217f554 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.datamap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.datamap.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-数据地图

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_data_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_data_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishDataMap-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishDataMap-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.frequency.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.frequency.js index 3570bde9..64495dd6 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.frequency.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.frequency.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-高频流程

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_frequency_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_frequency_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishFrequency-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishFrequency-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.general.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.general.js index 923a0a98..86e32c9d 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.general.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.general.js @@ -1,53 +1,53 @@ var liHeight = 21; function openPortal(sid, uuid, taskId) { - // if (taskId == "") { - if (true) { - window - .open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_page&uuid=" - + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows - } else { - // 打开流程手册 - $.simpleAlert('正在打开', 'loading'); - $.ajax({ - type : "POST", - url : "./jd?sid=" + sid - + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview", - data : { - taskId : taskId - }, - success : function(msg) { - if (msg.result == "ok") { - $.simpleAlert("close"); - if (msg['data']) { - var url = msg['data']['url']; - console.log(url); - window.open(url); - } - } else { - $.simpleAlert("close"); - $.simpleAlert(msg['msg'], 'info'); - } - } - }); - } + // if (taskId == "") { + if (true) { + window + .open("./w?cmd=com.actionsoft.apps.coe.pal.publisher_client_sso_page&uuid=" + + uuid + "&sid=" + sid + "&taskId=" + taskId);// open Windows + } else { + // 打开流程手册 + $.simpleAlert('正在打开', 'loading'); + $.ajax({ + type : "POST", + url : "./jd?sid=" + sid + + "&cmd=com.actionsoft.apps.coe.pal_outputreport_output_process_preview", + data : { + taskId : taskId + }, + success : function(msg) { + if (msg.result == "ok") { + $.simpleAlert("close"); + if (msg['data']) { + var url = msg['data']['url']; + console.log(url); + window.open(url); + } + } else { + $.simpleAlert("close"); + $.simpleAlert(msg['msg'], 'info'); + } + } + }); + } } -//对json进行降序排序函数 +//对json进行降序排序函数 var colId="date" -var desc = function(x,y) -{ - return (x[colId] < y[colId]) ? 1 : -1 -} -//对json进行升序排序函数 -var asc = function(x,y) -{ - return (x[colId] > y[colId]) ? 1 : -1 -} + var desc = function(x,y) + { + return (x[colId] < y[colId]) ? 1 : -1 + } +//对json进行升序排序函数 +var asc = function(x,y) +{ + return (x[colId] > y[colId]) ? 1 : -1 +} // JSON按照时间排序 function sortByDate(arr) { - arr.sort(desc); - return arr; + arr.sort(desc); + return arr; } /** @@ -60,25 +60,25 @@ var day = hour * 24; var halfamonth = day * 15; var month = day * 30; function transferDateFormat(dateTimeStamp) { - if (dateTimeStamp == '') { - return ""; - } - var publishDate = new Date() - publishDate.setTime(dateTimeStamp); - var now = new Date(); - if (now.getFullYear() - publishDate.getFullYear() >= 1) {// 非今年发布 - return publishDate.Format("yyyy年M月"); - } else if (now.getTime() - dateTimeStamp <= minute) {// 一分钟内,刚刚 - return "刚刚"; - } else if (now.getTime() - dateTimeStamp <= hour) { - return parseInt((now.getTime() - dateTimeStamp)/minute) + '分钟前'; - } else if (now.getTime() - dateTimeStamp <= (now.getHours())*hour +1) { - return parseInt((now.getTime() - dateTimeStamp)/hour) + '小时前'; - } else if (now.getTime() - dateTimeStamp <= day + (now.getHours())*hour) {// 昨天 - return "昨天" + publishDate.Format("HH") + "点"; - } else { - return publishDate.Format("M月d日"); - } + if (dateTimeStamp == '') { + return ""; + } + var publishDate = new Date() + publishDate.setTime(dateTimeStamp); + var now = new Date(); + if (now.getFullYear() - publishDate.getFullYear() >= 1) {// 非今年发布 + return publishDate.Format("yyyy年M月"); + } else if (now.getTime() - dateTimeStamp <= minute) {// 一分钟内,刚刚 + return "刚刚"; + } else if (now.getTime() - dateTimeStamp <= hour) { + return parseInt((now.getTime() - dateTimeStamp)/minute) + '分钟前'; + } else if (now.getTime() - dateTimeStamp <= (now.getHours())*hour +1) { + return parseInt((now.getTime() - dateTimeStamp)/hour) + '小时前'; + } else if (now.getTime() - dateTimeStamp <= day + (now.getHours())*hour) {// 昨天 + return "昨天" + publishDate.Format("HH") + "点"; + } else { + return publishDate.Format("M月d日"); + } } //  对Date的扩展,将 Date 转化为指定格式的String @@ -89,23 +89,23 @@ function transferDateFormat(dateTimeStamp) { //  (new Date()).Format("yyyy-M-d h:m:s.S")      ==> 2006-7-2 8:9:4.18  Date.prototype.Format = function(fmt) { - var o = { - "M+" : this.getMonth() + 1, - "d+" : this.getDate(), - "H+" : this.getHours(), - "m+" : this.getMinutes(), - "s+" : this.getSeconds(), - "S+" : this.getMilliseconds() - }; - if (/(y+)/.test(fmt)) { - fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "") - .substr(4 - RegExp.$1.length)); - } - for ( var k in o) { - if (new RegExp("(" + k + ")").test(fmt)) { - fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) - : (("00" + o[k]).substr(String(o[k]).length))); - } - } - return fmt; + var o = { + "M+" : this.getMonth() + 1, + "d+" : this.getDate(), + "H+" : this.getHours(), + "m+" : this.getMinutes(), + "s+" : this.getSeconds(), + "S+" : this.getMilliseconds() + }; + if (/(y+)/.test(fmt)) { + fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "") + .substr(4 - RegExp.$1.length)); + } + for ( var k in o) { + if (new RegExp("(" + k + ")").test(fmt)) { + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) + : (("00" + o[k]).substr(String(o[k]).length))); + } + } + return fmt; } \ No newline at end of file diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.notification.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.notification.js index f58384cd..e0638e9a 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.notification.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.notification.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-发布动态

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_notification_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_notification_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishNotification-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishNotification-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.orgmap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.orgmap.js index b6b11649..5be785ef 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.orgmap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.orgmap.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-组织地图

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,17 +17,17 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_tcount").blur(function(){ - var count = $('#commonxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_org_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#commonxpage_tcount").blur(function(){ + var count = $('#commonxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_org_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishOrgMap-wrap").find(".xpagesContent").val(url); - }else{ + }else{ $(".xpagePublishOrgMap-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.participant.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.participant.js index e630e610..d61833bd 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.participant.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.participant.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - var contentStr="
      "; + var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-我参与的

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#systemxpage_tcount").blur(function(){ - var count = $('#systemxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_participant_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#systemxpage_tcount").blur(function(){ + var count = $('#systemxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_participant_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishParticipant-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishParticipant-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.postresponsibility.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.postresponsibility.js index 42eb7699..4b56b70b 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.postresponsibility.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.postresponsibility.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-岗位职责

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#systemxpage_tcount").blur(function(){ - var count = $('#systemxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_postresponsibility_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#systemxpage_tcount").blur(function(){ + var count = $('#systemxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_postresponsibility_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishPostresponsibility-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishPostresponsibility-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.processmap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.processmap.js index c0316c90..ff0fd770 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.processmap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.processmap.js @@ -1,19 +1,19 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ - getProcessMapData(); - /* + getProcessMapData(); + /* var contentStr="
      "; contentStr+="
      请输入默认显示的资产库Id
      "; - //contentStr+="

      流程发布门户-流程地图

      "; - contentStr+=""; - contentStr+="
      "; + //contentStr+="

      流程发布门户-流程地图

      "; + contentStr+=""; + contentStr+="
      "; contentStr+="
      请输入默认组织的单元Id
      "; - contentStr+=""; - contentStr+=""; + contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -25,68 +25,68 @@ function renderCommonXPagesConfigPage(){ } - $("#commonxpage_wsId, #commonxpage_orgId").blur(function(){ - var wsId = $('#commonxpage_wsId').val(); - var orgId = $('#commonxpage_orgId').val(); - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_processmap_msg&wsId="+wsId + "&orgId=" + orgId; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#commonxpage_wsId, #commonxpage_orgId").blur(function(){ + var wsId = $('#commonxpage_wsId').val(); + var orgId = $('#commonxpage_orgId').val(); + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_processmap_msg&wsId="+wsId + "&orgId=" + orgId; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(url); - }); - */ + }); + */ } function getProcessMapData() { - var params = {}; - var url = './jd?sid=' + sid + '&cmd=com.actionsoft.apps.publisher_workspace_and_org_msg'; - awsui.ajax.post(url, params, function (responseObject) { - if (responseObject['result'] == 'ok') { - var wsList = responseObject["data"]["data"]['workspaces']; - var orgList = responseObject["data"]["data"]['companys']; - var contentStr = "
      "; - contentStr += "
      请选择默认显示的资产库
      "; - contentStr += ""; - contentStr += "
      请选择默认组织
      "; - contentStr += ""; - contentStr += ""; - contentStr += "
      "; - $(".cwapp-right").append(contentStr); - var cwUrl = getCwUrl();//获取之前的存储的url链接 - if (cwUrl != null && cwUrl != undefined && cwUrl != "") { - //$(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(cwUrl); - var wsId = getParamString(cwUrl, "wsId"); - var orgId = getParamString(cwUrl, "orgId"); - if (wsId != "" && orgId != null) { - $('.publisher-wh-select').val(wsId); - $('.publisher-org-select').val(orgId); - } - } - $(".publisher-org-select").change(function () { - var orgId = $('.publisher-org-select option:selected').val(); - var wsId = $('.publisher-wh-select option:selected').val(); - if (orgId != "" && wsId != "") { - var url = "./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_processmap_msg&wsId=" + wsId + "&orgId=" + orgId; - $(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(url); - } else { - $(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(""); - } - }); - } else { - $.simpleAlert(responseObject['msg'], responseObject['result']); - } - }, 'json'); + var params = {}; + var url = './jd?sid=' + sid + '&cmd=com.actionsoft.apps.publisher_workspace_and_org_msg'; + awsui.ajax.post(url, params, function (responseObject) { + if (responseObject['result'] == 'ok') { + var wsList = responseObject["data"]["data"]['workspaces']; + var orgList = responseObject["data"]["data"]['companys']; + var contentStr = "
      "; + contentStr += "
      请选择默认显示的资产库
      "; + contentStr += ""; + contentStr += "
      请选择默认组织
      "; + contentStr += ""; + contentStr += ""; + contentStr += "
      "; + $(".cwapp-right").append(contentStr); + var cwUrl = getCwUrl();//获取之前的存储的url链接 + if (cwUrl != null && cwUrl != undefined && cwUrl != "") { + //$(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(cwUrl); + var wsId = getParamString(cwUrl, "wsId"); + var orgId = getParamString(cwUrl, "orgId"); + if (wsId != "" && orgId != null) { + $('.publisher-wh-select').val(wsId); + $('.publisher-org-select').val(orgId); + } + } + $(".publisher-org-select").change(function () { + var orgId = $('.publisher-org-select option:selected').val(); + var wsId = $('.publisher-wh-select option:selected').val(); + if (orgId != "" && wsId != "") { + var url = "./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_processmap_msg&wsId=" + wsId + "&orgId=" + orgId; + $(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(url); + } else { + $(".xpagePublishProcessMap-wrap").find(".xpagesContent").val(""); + } + }); + } else { + $.simpleAlert(responseObject['msg'], responseObject['result']); + } + }, 'json'); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.rcaimatrix.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.rcaimatrix.js index e178acf0..d695bd31 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.rcaimatrix.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.rcaimatrix.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-RCAI矩阵

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#systemxpage_tcount").blur(function(){ - var count = $('#systemxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_rcaimatrix_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#systemxpage_tcount").blur(function(){ + var count = $('#systemxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_rcaimatrix_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishRcaimatrix-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishRcaimatrix-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.responsible.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.responsible.js index 3a7a9c81..3f3791a2 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.responsible.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.responsible.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-我负责的

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#systemxpage_tcount").blur(function(){ - var count = $('#systemxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_responsible_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#systemxpage_tcount").blur(function(){ + var count = $('#systemxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_responsible_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishResponsible-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishResponsible-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.systemmap.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.systemmap.js index 84e9b766..35391e17 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.systemmap.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/js/publish.xpages.systemmap.js @@ -1,14 +1,14 @@ $(document).ready(function(){ - renderCommonXPagesConfigPage(); + renderCommonXPagesConfigPage(); }); function renderCommonXPagesConfigPage(){ var contentStr="
      "; contentStr+="
      设置显示个数
      "; //contentStr+="

      流程发布门户-系统地图

      "; contentStr+=""; - contentStr+=""; + contentStr+=""; contentStr+="
      "; - $(".cwapp-right").append(contentStr); + $(".cwapp-right").append(contentStr); var cwUrl = getCwUrl();//获取之前的存储的url链接 if(cwUrl!=null && cwUrl!=undefined && cwUrl!=""){ @@ -17,18 +17,18 @@ function renderCommonXPagesConfigPage(){ } - $("#systemxpage_tcount").blur(function(){ - var count = $('#systemxpage_tcount').val(); - if(count!=""){ - var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_system_msg&count="+count; - //$(".xpagesContent").empty(); - //$(".xpagesContent").append(url); + $("#systemxpage_tcount").blur(function(){ + var count = $('#systemxpage_tcount').val(); + if(count!=""){ + var url="./w?sid=@sid&cmd=com.actionsoft.apps.publisher_xpages_system_msg&count="+count; + //$(".xpagesContent").empty(); + //$(".xpagesContent").append(url); $(".xpagePublishSystemMap-wrap").find(".xpagesContent").val(url); - }else{ - //$(".xpagesContent").empty(); + }else{ + //$(".xpagesContent").empty(); $(".xpagePublishSystemMap-wrap").find(".xpagesContent").val(""); - } - }); + } + }); } function getParamString(url,name) { diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/css/flexslider.css b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/css/flexslider.css index 7ce304d9..d3cca959 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/css/flexslider.css +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/css/flexslider.css @@ -13,131 +13,131 @@ * FONT-FACE * ====================================================================================================================*/ @font-face { - font-family: 'flexslider-icon'; - src: url('fonts/flexslider-icon.eot'); - src: url('fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('fonts/flexslider-icon.woff') format('woff'), url('fonts/flexslider-icon.ttf') format('truetype'), url('fonts/flexslider-icon.svg#flexslider-icon') format('svg'); - font-weight: normal; - font-style: normal; + font-family: 'flexslider-icon'; + src: url('fonts/flexslider-icon.eot'); + src: url('fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('fonts/flexslider-icon.woff') format('woff'), url('fonts/flexslider-icon.ttf') format('truetype'), url('fonts/flexslider-icon.svg#flexslider-icon') format('svg'); + font-weight: normal; + font-style: normal; } /* ==================================================================================================================== * RESETS * ====================================================================================================================*/ .flex-container a:hover, .flex-slider a:hover { - outline: none; + outline: none; } .slides, .slides > li, .flex-control-nav, .flex-direction-nav { - margin: 0; - padding: 0; - list-style: none; + margin: 0; + padding: 0; + list-style: none; } .flex-pauseplay span { - text-transform: capitalize; + text-transform: capitalize; } /* ==================================================================================================================== * BASE STYLES * ====================================================================================================================*/ .flexslider { - margin: 0; - padding: 0; + margin: 0; + padding: 0; } .flexslider .slides > li { - display: none; - -webkit-backface-visibility: hidden; + display: none; + -webkit-backface-visibility: hidden; } .flexslider .slides img { - width: 100%; - display: block; + width: 100%; + display: block; } .flexslider .slides:after { - content: "\0020"; - display: block; - clear: both; - visibility: hidden; - line-height: 0; - height: 0; + content: "\0020"; + display: block; + clear: both; + visibility: hidden; + line-height: 0; + height: 0; } html[xmlns] .flexslider .slides { - display: block; + display: block; } * html .flexslider .slides { - height: 1%; + height: 1%; } .no-js .flexslider .slides > li:first-child { - display: block; + display: block; } /* ==================================================================================================================== * DEFAULT THEME * ====================================================================================================================*/ .flexslider { - /* margin: 0 0 60px; */ - margin: 0; - background: #fff; - border: 0px solid #fff; - position: relative; - zoom: 1; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - -webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); - -moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); - -o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); - box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + /* margin: 0 0 60px; */ + margin: 0; + background: #fff; + border: 0px solid #fff; + position: relative; + zoom: 1; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + -webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + -moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + -o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); + box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2); } .flexslider .slides { - zoom: 1; + zoom: 1; } .flexslider .slides img { - height:auto; - -moz-user-select: none; + height:auto; + -moz-user-select: none; } .flex-viewport { - max-height: 2000px; - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -ms-transition: all 1s ease; - -o-transition: all 1s ease; - transition: all 1s ease; + max-height: 2000px; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -ms-transition: all 1s ease; + -o-transition: all 1s ease; + transition: all 1s ease; } .loading .flex-viewport { - max-height: 300px; + max-height: 300px; } @-moz-document url-prefix() { - .loading .flex-viewport { - max-height: none; - } + .loading .flex-viewport { + max-height: none; + } } .carousel li { - margin-right: 5px; + margin-right: 5px; } .flex-direction-nav { - *height: 0; + *height: 0; } .flex-direction-nav a { - width: 32px; - height: 35px; - margin: -50px 0 0; - display: block; - background: url('../images/ad_ctr1.png') no-repeat 0 0; - position: absolute; - top: 50%; - z-index: 10; - cursor: pointer; - text-indent: -9999px; - opacity: 0; - filter: alpha(opacity=0); - -webkit-transition: all .3s ease; + width: 32px; + height: 35px; + margin: -50px 0 0; + display: block; + background: url('../images/ad_ctr1.png') no-repeat 0 0; + position: absolute; + top: 50%; + z-index: 10; + cursor: pointer; + text-indent: -9999px; + opacity: 0; + filter: alpha(opacity=0); + -webkit-transition: all .3s ease; } .flex-direction-nav .flex-next { - background-position: -32px 0px; - right: 0; + background-position: -32px 0px; + right: 0; } .flex-direction-nav .flex-prev { - background-position: 2px 0px; - left: 0; + background-position: 2px 0px; + left: 0; } /* .flex-direction-nav a { text-decoration: none; @@ -178,128 +178,128 @@ html[xmlns] .flexslider .slides { text-align: right; } */ .flexslider:hover .flex-direction-nav .flex-prev { - opacity: 0.7; - left: 10px; + opacity: 0.7; + left: 10px; } .flexslider:hover .flex-direction-nav .flex-prev:hover { - opacity: 1; + opacity: 1; } .flexslider:hover .flex-direction-nav .flex-next { - opacity: 0.7; - right: 10px; + opacity: 0.7; + right: 10px; } .flexslider:hover .flex-direction-nav .flex-next:hover { - opacity: 1; + opacity: 1; } .flex-direction-nav .flex-disabled { - opacity: 0!important; - filter: alpha(opacity=0); - cursor: default; - z-index: -1; + opacity: 0!important; + filter: alpha(opacity=0); + cursor: default; + z-index: -1; } .flex-pauseplay a { - display: block; - width: 20px; - height: 20px; - position: absolute; - bottom: 5px; - left: 10px; - opacity: 0.8; - z-index: 10; - overflow: hidden; - cursor: pointer; - color: #000; + display: block; + width: 20px; + height: 20px; + position: absolute; + bottom: 5px; + left: 10px; + opacity: 0.8; + z-index: 10; + overflow: hidden; + cursor: pointer; + color: #000; } .flex-pauseplay a:before { - font-family: "flexslider-icon"; - font-size: 20px; - display: inline-block; - content: '\f004'; + font-family: "flexslider-icon"; + font-size: 20px; + display: inline-block; + content: '\f004'; } .flex-pauseplay a:hover { - opacity: 1; + opacity: 1; } .flex-pauseplay a.flex-play:before { - content: '\f003'; + content: '\f003'; } .flex-control-nav { - width: 100%; - position: absolute; - bottom: -40px; - text-align: center; - z-index: 999; + width: 100%; + position: absolute; + bottom: -40px; + text-align: center; + z-index: 999; } .flex-control-nav li { - margin: 0 6px; - display: inline-block; - zoom: 1; - *display: inline; + margin: 0 6px; + display: inline-block; + zoom: 1; + *display: inline; } .flex-control-paging li a { - width: 11px; - height: 11px; - display: block; - background: #666; - background: rgba(0, 0, 0, 0.5); - cursor: pointer; - text-indent: -9999px; - -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); - -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); - -o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); - box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); - -webkit-border-radius: 20px; - -moz-border-radius: 20px; - border-radius: 20px; + width: 11px; + height: 11px; + display: block; + background: #666; + background: rgba(0, 0, 0, 0.5); + cursor: pointer; + text-indent: -9999px; + -webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3); + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + border-radius: 20px; } .flex-control-paging li a:hover { - background: #333; - background: rgba(0, 0, 0, 0.7); + background: #333; + background: rgba(0, 0, 0, 0.7); } .flex-control-paging li a.flex-active { - background: #000; - background: rgba(0, 0, 0, 0.9); - cursor: default; + background: #000; + background: rgba(0, 0, 0, 0.9); + cursor: default; } .flex-control-thumbs { - margin: 5px 0 0; - position: static; - overflow: hidden; + margin: 5px 0 0; + position: static; + overflow: hidden; } .flex-control-thumbs li { - width: 25%; - float: left; - margin: 0; + width: 25%; + float: left; + margin: 0; } .flex-control-thumbs img { - width: 100%; - height: auto; - display: block; - opacity: .7; - cursor: pointer; - -moz-user-select: none; - -webkit-transition: all 1s ease; - -moz-transition: all 1s ease; - -ms-transition: all 1s ease; - -o-transition: all 1s ease; - transition: all 1s ease; + width: 100%; + height: auto; + display: block; + opacity: .7; + cursor: pointer; + -moz-user-select: none; + -webkit-transition: all 1s ease; + -moz-transition: all 1s ease; + -ms-transition: all 1s ease; + -o-transition: all 1s ease; + transition: all 1s ease; } .flex-control-thumbs img:hover { - opacity: 1; + opacity: 1; } .flex-control-thumbs .flex-active { - opacity: 1; - cursor: default; + opacity: 1; + cursor: default; } /* ==================================================================================================================== * RESPONSIVE * ====================================================================================================================*/ @media screen and (max-width: 860px) { - .flex-direction-nav .flex-prev { - opacity: 1; - left: 10px; - } - .flex-direction-nav .flex-next { - opacity: 1; - right: 10px; - } + .flex-direction-nav .flex-prev { + opacity: 1; + left: 10px; + } + .flex-direction-nav .flex-next { + opacity: 1; + right: 10px; + } } diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/js/jquery.flexslider.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/js/jquery.flexslider.js index 0b3c649e..b51d5dd1 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/js/jquery.flexslider.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/lib/flexslider/js/jquery.flexslider.js @@ -6,1227 +6,1227 @@ ; (function ($) { - var focused = true; + var focused = true; - //FlexSlider: Object Instance - $.flexslider = function(el, options) { - var slider = $(el); + //FlexSlider: Object Instance + $.flexslider = function(el, options) { + var slider = $(el); - // making variables public + // making variables public - //if rtl value was not passed and html is in rtl..enable it by default. - if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){ - options.rtl=true; + //if rtl value was not passed and html is in rtl..enable it by default. + if(typeof options.rtl=='undefined' && $('html').attr('dir')=='rtl'){ + options.rtl=true; + } + slider.vars = $.extend({}, $.flexslider.defaults, options); + + var namespace = slider.vars.namespace, + msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, + touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, + // deprecating this idea, as devices are being released with both of these events + eventType = "click touchend MSPointerUp keyup", + watchedEvent = "", + watchedEventClearTimer, + vertical = slider.vars.direction === "vertical", + reverse = slider.vars.reverse, + carousel = (slider.vars.itemWidth > 0), + fade = slider.vars.animation === "fade", + asNav = slider.vars.asNavFor !== "", + methods = {}; + + // Store a reference to the slider object + $.data(el, "flexslider", slider); + + // Private slider methods + methods = { + init: function() { + slider.animating = false; + // Get current slide and make sure it is a number + slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 ); + if ( isNaN( slider.currentSlide ) ) { slider.currentSlide = 0; } + slider.animatingTo = slider.currentSlide; + slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last); + slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' ')); + slider.slides = $(slider.vars.selector, slider); + slider.container = $(slider.containerSelector, slider); + slider.count = slider.slides.length; + // SYNC: + slider.syncExists = $(slider.vars.sync).length > 0; + // SLIDE: + if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; } + slider.prop = (vertical) ? "top" : ( slider.vars.rtl ? "marginRight" : "marginLeft" ); + slider.args = {}; + // SLIDESHOW: + slider.manualPause = false; + slider.stopped = false; + //PAUSE WHEN INVISIBLE + slider.started = false; + slider.startTimeout = null; + // TOUCH/USECSS: + slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() { + var obj = document.createElement('div'), + props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; + for (var i in props) { + if ( obj.style[ props[i] ] !== undefined ) { + slider.pfx = props[i].replace('Perspective','').toLowerCase(); + slider.prop = "-" + slider.pfx + "-transform"; + return true; + } + } + return false; + }()); + slider.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + slider.ensureAnimationEnd = ''; + // CONTROLSCONTAINER: + if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer); + // MANUAL: + if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls); + + // CUSTOM DIRECTION NAV: + if (slider.vars.customDirectionNav !== "") slider.customDirectionNav = $(slider.vars.customDirectionNav).length === 2 && $(slider.vars.customDirectionNav); + + // RANDOMIZE: + if (slider.vars.randomize) { + slider.slides.sort(function() { return (Math.round(Math.random())-0.5); }); + slider.container.empty().append(slider.slides); } - slider.vars = $.extend({}, $.flexslider.defaults, options); - var namespace = slider.vars.namespace, - msGesture = window.navigator && window.navigator.msPointerEnabled && window.MSGesture, - touch = (( "ontouchstart" in window ) || msGesture || window.DocumentTouch && document instanceof DocumentTouch) && slider.vars.touch, - // deprecating this idea, as devices are being released with both of these events - eventType = "click touchend MSPointerUp keyup", - watchedEvent = "", - watchedEventClearTimer, - vertical = slider.vars.direction === "vertical", - reverse = slider.vars.reverse, - carousel = (slider.vars.itemWidth > 0), - fade = slider.vars.animation === "fade", - asNav = slider.vars.asNavFor !== "", - methods = {}; + slider.doMath(); - // Store a reference to the slider object - $.data(el, "flexslider", slider); + // INIT + slider.setup("init"); - // Private slider methods - methods = { - init: function() { - slider.animating = false; - // Get current slide and make sure it is a number - slider.currentSlide = parseInt( ( slider.vars.startAt ? slider.vars.startAt : 0), 10 ); - if ( isNaN( slider.currentSlide ) ) { slider.currentSlide = 0; } - slider.animatingTo = slider.currentSlide; - slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last); - slider.containerSelector = slider.vars.selector.substr(0,slider.vars.selector.search(' ')); - slider.slides = $(slider.vars.selector, slider); - slider.container = $(slider.containerSelector, slider); - slider.count = slider.slides.length; - // SYNC: - slider.syncExists = $(slider.vars.sync).length > 0; - // SLIDE: - if (slider.vars.animation === "slide") { slider.vars.animation = "swing"; } - slider.prop = (vertical) ? "top" : ( slider.vars.rtl ? "marginRight" : "marginLeft" ); - slider.args = {}; - // SLIDESHOW: - slider.manualPause = false; - slider.stopped = false; - //PAUSE WHEN INVISIBLE - slider.started = false; - slider.startTimeout = null; - // TOUCH/USECSS: - slider.transitions = !slider.vars.video && !fade && slider.vars.useCSS && (function() { - var obj = document.createElement('div'), - props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective']; - for (var i in props) { - if ( obj.style[ props[i] ] !== undefined ) { - slider.pfx = props[i].replace('Perspective','').toLowerCase(); - slider.prop = "-" + slider.pfx + "-transform"; - return true; - } - } - return false; - }()); - slider.isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; - slider.ensureAnimationEnd = ''; - // CONTROLSCONTAINER: - if (slider.vars.controlsContainer !== "") slider.controlsContainer = $(slider.vars.controlsContainer).length > 0 && $(slider.vars.controlsContainer); - // MANUAL: - if (slider.vars.manualControls !== "") slider.manualControls = $(slider.vars.manualControls).length > 0 && $(slider.vars.manualControls); + // CONTROLNAV: + if (slider.vars.controlNav) { methods.controlNav.setup(); } - // CUSTOM DIRECTION NAV: - if (slider.vars.customDirectionNav !== "") slider.customDirectionNav = $(slider.vars.customDirectionNav).length === 2 && $(slider.vars.customDirectionNav); + // DIRECTIONNAV: + if (slider.vars.directionNav) { methods.directionNav.setup(); } - // RANDOMIZE: - if (slider.vars.randomize) { - slider.slides.sort(function() { return (Math.round(Math.random())-0.5); }); - slider.container.empty().append(slider.slides); - } - - slider.doMath(); - - // INIT - slider.setup("init"); - - // CONTROLNAV: - if (slider.vars.controlNav) { methods.controlNav.setup(); } - - // DIRECTIONNAV: - if (slider.vars.directionNav) { methods.directionNav.setup(); } - - // KEYBOARD: - if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) { - $(document).bind('keyup', function(event) { - var keycode = event.keyCode; - if (!slider.animating && (keycode === 39 || keycode === 37)) { - var target = (slider.vars.rtl? - ((keycode === 37) ? slider.getTarget('next') : - (keycode === 39) ? slider.getTarget('prev') : false) - : - ((keycode === 39) ? slider.getTarget('next') : - (keycode === 37) ? slider.getTarget('prev') : false) + // KEYBOARD: + if (slider.vars.keyboard && ($(slider.containerSelector).length === 1 || slider.vars.multipleKeyboard)) { + $(document).bind('keyup', function(event) { + var keycode = event.keyCode; + if (!slider.animating && (keycode === 39 || keycode === 37)) { + var target = (slider.vars.rtl? + ((keycode === 37) ? slider.getTarget('next') : + (keycode === 39) ? slider.getTarget('prev') : false) + : + ((keycode === 39) ? slider.getTarget('next') : + (keycode === 37) ? slider.getTarget('prev') : false) ) - ; - slider.flexAnimate(target, slider.vars.pauseOnAction); - } - }); - } - // MOUSEWHEEL: - if (slider.vars.mousewheel) { - slider.bind('mousewheel', function(event, delta, deltaX, deltaY) { - event.preventDefault(); - var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev'); - slider.flexAnimate(target, slider.vars.pauseOnAction); - }); - } - - // PAUSEPLAY - if (slider.vars.pausePlay) { methods.pausePlay.setup(); } - - //PAUSE WHEN INVISIBLE - if (slider.vars.slideshow && slider.vars.pauseInvisible) { methods.pauseInvisible.init(); } - - // SLIDSESHOW - if (slider.vars.slideshow) { - if (slider.vars.pauseOnHover) { - slider.hover(function() { - if (!slider.manualPlay && !slider.manualPause) { slider.pause(); } - }, function() { - if (!slider.manualPause && !slider.manualPlay && !slider.stopped) { slider.play(); } - }); - } - // initialize animation - //If we're visible, or we don't use PageVisibility API - if(!slider.vars.pauseInvisible || !methods.pauseInvisible.isHidden()) { - (slider.vars.initDelay > 0) ? slider.startTimeout = setTimeout(slider.play, slider.vars.initDelay) : slider.play(); - } - } - - // ASNAV: - if (asNav) { methods.asNav.setup(); } - - // TOUCH - if (touch && slider.vars.touch) { methods.touch(); } - - // FADE&&SMOOTHHEIGHT || SLIDE: - if (!fade || (fade && slider.vars.smoothHeight)) { $(window).bind("resize orientationchange focus", methods.resize); } - - slider.find("img").attr("draggable", "false"); - - // API: start() Callback - setTimeout(function(){ - slider.vars.start(slider); - }, 200); - }, - asNav: { - setup: function() { - slider.asNav = true; - slider.animatingTo = Math.floor(slider.currentSlide/slider.move); - slider.currentItem = slider.currentSlide; - slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide"); - if(!msGesture){ - slider.slides.on(eventType, function(e){ - e.preventDefault(); - var $slide = $(this), - target = $slide.index(); - var posFromX; - if(slider.vars.rtl){ - posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container - } - else - { - posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container - } - if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) { - slider.flexAnimate(slider.getTarget("prev"), true); - } else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) { - slider.direction = (slider.currentItem < target) ? "next" : "prev"; - slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); - } - }); - }else{ - el._slider = slider; - slider.slides.each(function (){ - var that = this; - that._gesture = new MSGesture(); - that._gesture.target = that; - that.addEventListener("MSPointerDown", function (e){ - e.preventDefault(); - if(e.currentTarget._gesture) { - e.currentTarget._gesture.addPointer(e.pointerId); - } - }, false); - that.addEventListener("MSGestureTap", function (e){ - e.preventDefault(); - var $slide = $(this), - target = $slide.index(); - if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) { - slider.direction = (slider.currentItem < target) ? "next" : "prev"; - slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); - } - }); - }); - } - } - }, - controlNav: { - setup: function() { - if (!slider.manualControls) { - methods.controlNav.setupPaging(); - } else { // MANUALCONTROLS: - methods.controlNav.setupManual(); - } - }, - setupPaging: function() { - var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging', - j = 1, - item, - slide; - - slider.controlNavScaffold = $('
        '); - - if (slider.pagingCount > 1) { - for (var i = 0; i < slider.pagingCount; i++) { - slide = slider.slides.eq(i); - if ( undefined === slide.attr( 'data-thumb-alt' ) ) { slide.attr( 'data-thumb-alt', '' ); } - var altText = ( '' !== slide.attr( 'data-thumb-alt' ) ) ? altText = ' alt="' + slide.attr( 'data-thumb-alt' ) + '"' : ''; - item = (slider.vars.controlNav === "thumbnails") ? '' : '' + j + ''; - if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) { - var captn = slide.attr( 'data-thumbcaption' ); - if ( '' !== captn && undefined !== captn ) { item += '' + captn + ''; } - } - slider.controlNavScaffold.append('
      1. ' + item + '
      2. '); - j++; - } - } - - // CONTROLSCONTAINER: - (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold); - methods.controlNav.set(); - - methods.controlNav.active(); - - slider.controlNavScaffold.delegate('a, img', eventType, function(event) { - event.preventDefault(); - - if (watchedEvent === "" || watchedEvent === event.type) { - var $this = $(this), - target = slider.controlNav.index($this); - - if (!$this.hasClass(namespace + 'active')) { - slider.direction = (target > slider.currentSlide) ? "next" : "prev"; - slider.flexAnimate(target, slider.vars.pauseOnAction); - } - } - - // setup flags to prevent event duplication - if (watchedEvent === "") { - watchedEvent = event.type; - } - methods.setToClearWatchedEvent(); - - }); - }, - setupManual: function() { - slider.controlNav = slider.manualControls; - methods.controlNav.active(); - - slider.controlNav.bind(eventType, function(event) { - event.preventDefault(); - - if (watchedEvent === "" || watchedEvent === event.type) { - var $this = $(this), - target = slider.controlNav.index($this); - - if (!$this.hasClass(namespace + 'active')) { - (target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev"; - slider.flexAnimate(target, slider.vars.pauseOnAction); - } - } - - // setup flags to prevent event duplication - if (watchedEvent === "") { - watchedEvent = event.type; - } - methods.setToClearWatchedEvent(); - }); - }, - set: function() { - var selector = (slider.vars.controlNav === "thumbnails") ? 'img' : 'a'; - slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider); - }, - active: function() { - slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active"); - }, - update: function(action, pos) { - if (slider.pagingCount > 1 && action === "add") { - slider.controlNavScaffold.append($('
      3. ' + slider.count + '
      4. ')); - } else if (slider.pagingCount === 1) { - slider.controlNavScaffold.find('li').remove(); - } else { - slider.controlNav.eq(pos).closest('li').remove(); - } - methods.controlNav.set(); - (slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active(); - } - }, - directionNav: { - setup: function() { - var directionNavScaffold = $(''); - - // CUSTOM DIRECTION NAV: - if (slider.customDirectionNav) { - slider.directionNav = slider.customDirectionNav; - // CONTROLSCONTAINER: - } else if (slider.controlsContainer) { - $(slider.controlsContainer).append(directionNavScaffold); - slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer); - } else { - slider.append(directionNavScaffold); - slider.directionNav = $('.' + namespace + 'direction-nav li a', slider); - } - - methods.directionNav.update(); - - slider.directionNav.bind(eventType, function(event) { - event.preventDefault(); - var target; - - if (watchedEvent === "" || watchedEvent === event.type) { - target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev'); - slider.flexAnimate(target, slider.vars.pauseOnAction); - } - - // setup flags to prevent event duplication - if (watchedEvent === "") { - watchedEvent = event.type; - } - methods.setToClearWatchedEvent(); - }); - }, - update: function() { - var disabledClass = namespace + 'disabled'; - if (slider.pagingCount === 1) { - slider.directionNav.addClass(disabledClass).attr('tabindex', '-1'); - } else if (!slider.vars.animationLoop) { - if (slider.animatingTo === 0) { - slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass).attr('tabindex', '-1'); - } else if (slider.animatingTo === slider.last) { - slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass).attr('tabindex', '-1'); - } else { - slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); - } - } else { - slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); - } - } - }, - pausePlay: { - setup: function() { - var pausePlayScaffold = $('
        '); - - // CONTROLSCONTAINER: - if (slider.controlsContainer) { - slider.controlsContainer.append(pausePlayScaffold); - slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer); - } else { - slider.append(pausePlayScaffold); - slider.pausePlay = $('.' + namespace + 'pauseplay a', slider); - } - - methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play'); - - slider.pausePlay.bind(eventType, function(event) { - event.preventDefault(); - - if (watchedEvent === "" || watchedEvent === event.type) { - if ($(this).hasClass(namespace + 'pause')) { - slider.manualPause = true; - slider.manualPlay = false; - slider.pause(); - } else { - slider.manualPause = false; - slider.manualPlay = true; - slider.play(); - } - } - - // setup flags to prevent event duplication - if (watchedEvent === "") { - watchedEvent = event.type; - } - methods.setToClearWatchedEvent(); - }); - }, - update: function(state) { - (state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').html(slider.vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').html(slider.vars.pauseText); - } - }, - touch: function() { - var startX, - startY, - offset, - cwidth, - dx, - startT, - onTouchStart, - onTouchMove, - onTouchEnd, - scrolling = false, - localX = 0, - localY = 0, - accDx = 0; - - if(!msGesture){ - onTouchStart = function(e) { - if (slider.animating) { - e.preventDefault(); - } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) { - slider.pause(); - // CAROUSEL: - cwidth = (vertical) ? slider.h : slider. w; - startT = Number(new Date()); - // CAROUSEL: - - // Local vars for X and Y points. - localX = e.touches[0].pageX; - localY = e.touches[0].pageY; - - offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : - (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : - (carousel && slider.currentSlide === slider.last) ? slider.limit : - (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : - (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; - startX = (vertical) ? localY : localX; - startY = (vertical) ? localX : localY; - el.addEventListener('touchmove', onTouchMove, false); - el.addEventListener('touchend', onTouchEnd, false); - } - }; - - onTouchMove = function(e) { - // Local vars for X and Y points. - - localX = e.touches[0].pageX; - localY = e.touches[0].pageY; - - dx = (vertical) ? startX - localY : (slider.vars.rtl?-1:1)*(startX - localX); - scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY)); - var fxms = 500; - - if ( ! scrolling || Number( new Date() ) - startT > fxms ) { - e.preventDefault(); - if (!fade && slider.transitions) { - if (!slider.vars.animationLoop) { - dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1); - } - slider.setProps(offset + dx, "setTouch"); - } - } - }; - - onTouchEnd = function(e) { - // finish the touch by undoing the touch session - el.removeEventListener('touchmove', onTouchMove, false); - - if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { - var updateDx = (reverse) ? -dx : dx, - target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); - - if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { - slider.flexAnimate(target, slider.vars.pauseOnAction); - } else { - if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); } - } - } - el.removeEventListener('touchend', onTouchEnd, false); - - startX = null; - startY = null; - dx = null; - offset = null; - }; - - el.addEventListener('touchstart', onTouchStart, false); - }else{ - el.style.msTouchAction = "none"; - el._gesture = new MSGesture(); - el._gesture.target = el; - el.addEventListener("MSPointerDown", onMSPointerDown, false); - el._slider = slider; - el.addEventListener("MSGestureChange", onMSGestureChange, false); - el.addEventListener("MSGestureEnd", onMSGestureEnd, false); - - function onMSPointerDown(e){ - e.stopPropagation(); - if (slider.animating) { - e.preventDefault(); - }else{ - slider.pause(); - el._gesture.addPointer(e.pointerId); - accDx = 0; - cwidth = (vertical) ? slider.h : slider. w; - startT = Number(new Date()); - // CAROUSEL: - - offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : - (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : - (carousel && slider.currentSlide === slider.last) ? slider.limit : - (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : - (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; - } - } - - function onMSGestureChange(e) { - e.stopPropagation(); - var slider = e.target._slider; - if(!slider){ - return; - } - var transX = -e.translationX, - transY = -e.translationY; - - //Accumulate translations. - accDx = accDx + ((vertical) ? transY : transX); - dx = (slider.vars.rtl?-1:1)*accDx; - scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY)); - - if(e.detail === e.MSGESTURE_FLAG_INERTIA){ - setImmediate(function (){ - el._gesture.stop(); - }); - - return; - } - - if (!scrolling || Number(new Date()) - startT > 500) { - e.preventDefault(); - if (!fade && slider.transitions) { - if (!slider.vars.animationLoop) { - dx = accDx / ((slider.currentSlide === 0 && accDx < 0 || slider.currentSlide === slider.last && accDx > 0) ? (Math.abs(accDx) / cwidth + 2) : 1); - } - slider.setProps(offset + dx, "setTouch"); - } - } - } - - function onMSGestureEnd(e) { - e.stopPropagation(); - var slider = e.target._slider; - if(!slider){ - return; - } - if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { - var updateDx = (reverse) ? -dx : dx, - target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); - - if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { - slider.flexAnimate(target, slider.vars.pauseOnAction); - } else { - if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); } - } - } - - startX = null; - startY = null; - dx = null; - offset = null; - accDx = 0; - } - } - }, - resize: function() { - if (!slider.animating && slider.is(':visible')) { - if (!carousel) { slider.doMath(); } - - if (fade) { - // SMOOTH HEIGHT: - methods.smoothHeight(); - } else if (carousel) { //CAROUSEL: - slider.slides.width(slider.computedW); - slider.update(slider.pagingCount); - slider.setProps(); - } - else if (vertical) { //VERTICAL: - slider.viewport.height(slider.h); - slider.setProps(slider.h, "setTotal"); - } else { - // SMOOTH HEIGHT: - if (slider.vars.smoothHeight) { methods.smoothHeight(); } - slider.newSlides.width(slider.computedW); - slider.setProps(slider.computedW, "setTotal"); - } - } - }, - smoothHeight: function(dur) { - if (!vertical || fade) { - var $obj = (fade) ? slider : slider.viewport; - (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).innerHeight()}, dur) : $obj.innerHeight(slider.slides.eq(slider.animatingTo).innerHeight()); - } - }, - sync: function(action) { - var $obj = $(slider.vars.sync).data("flexslider"), - target = slider.animatingTo; - - switch (action) { - case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break; - case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break; - case "pause": $obj.pause(); break; - } - }, - uniqueID: function($clone) { - // Append _clone to current level and children elements with id attributes - $clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() { - var $this = $(this); - $this.attr( 'id', $this.attr( 'id' ) + '_clone' ); - }); - return $clone; - }, - pauseInvisible: { - visProp: null, - init: function() { - var visProp = methods.pauseInvisible.getHiddenProp(); - if (visProp) { - var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange'; - document.addEventListener(evtname, function() { - if (methods.pauseInvisible.isHidden()) { - if(slider.startTimeout) { - clearTimeout(slider.startTimeout); //If clock is ticking, stop timer and prevent from starting while invisible - } else { - slider.pause(); //Or just pause - } - } - else { - if(slider.started) { - slider.play(); //Initiated before, just play - } else { - if (slider.vars.initDelay > 0) { - setTimeout(slider.play, slider.vars.initDelay); - } else { - slider.play(); //Didn't init before: simply init or wait for it - } - } - } - }); - } - }, - isHidden: function() { - var prop = methods.pauseInvisible.getHiddenProp(); - if (!prop) { - return false; - } - return document[prop]; - }, - getHiddenProp: function() { - var prefixes = ['webkit','moz','ms','o']; - // if 'hidden' is natively supported just return it - if ('hidden' in document) { - return 'hidden'; - } - // otherwise loop over all the known prefixes until we find one - for ( var i = 0; i < prefixes.length; i++ ) { - if ((prefixes[i] + 'Hidden') in document) { - return prefixes[i] + 'Hidden'; - } - } - // otherwise it's not supported - return null; - } - }, - setToClearWatchedEvent: function() { - clearTimeout(watchedEventClearTimer); - watchedEventClearTimer = setTimeout(function() { - watchedEvent = ""; - }, 3000); + ; + slider.flexAnimate(target, slider.vars.pauseOnAction); } - }; + }); + } + // MOUSEWHEEL: + if (slider.vars.mousewheel) { + slider.bind('mousewheel', function(event, delta, deltaX, deltaY) { + event.preventDefault(); + var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev'); + slider.flexAnimate(target, slider.vars.pauseOnAction); + }); + } - // public methods - slider.flexAnimate = function(target, pause, override, withSync, fromNav) { - if (!slider.vars.animationLoop && target !== slider.currentSlide) { + // PAUSEPLAY + if (slider.vars.pausePlay) { methods.pausePlay.setup(); } + + //PAUSE WHEN INVISIBLE + if (slider.vars.slideshow && slider.vars.pauseInvisible) { methods.pauseInvisible.init(); } + + // SLIDSESHOW + if (slider.vars.slideshow) { + if (slider.vars.pauseOnHover) { + slider.hover(function() { + if (!slider.manualPlay && !slider.manualPause) { slider.pause(); } + }, function() { + if (!slider.manualPause && !slider.manualPlay && !slider.stopped) { slider.play(); } + }); + } + // initialize animation + //If we're visible, or we don't use PageVisibility API + if(!slider.vars.pauseInvisible || !methods.pauseInvisible.isHidden()) { + (slider.vars.initDelay > 0) ? slider.startTimeout = setTimeout(slider.play, slider.vars.initDelay) : slider.play(); + } + } + + // ASNAV: + if (asNav) { methods.asNav.setup(); } + + // TOUCH + if (touch && slider.vars.touch) { methods.touch(); } + + // FADE&&SMOOTHHEIGHT || SLIDE: + if (!fade || (fade && slider.vars.smoothHeight)) { $(window).bind("resize orientationchange focus", methods.resize); } + + slider.find("img").attr("draggable", "false"); + + // API: start() Callback + setTimeout(function(){ + slider.vars.start(slider); + }, 200); + }, + asNav: { + setup: function() { + slider.asNav = true; + slider.animatingTo = Math.floor(slider.currentSlide/slider.move); + slider.currentItem = slider.currentSlide; + slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide"); + if(!msGesture){ + slider.slides.on(eventType, function(e){ + e.preventDefault(); + var $slide = $(this), + target = $slide.index(); + var posFromX; + if(slider.vars.rtl){ + posFromX = -1*($slide.offset().right - $(slider).scrollLeft()); // Find position of slide relative to right of slider container + } + else + { + posFromX = $slide.offset().left - $(slider).scrollLeft(); // Find position of slide relative to left of slider container + } + if( posFromX <= 0 && $slide.hasClass( namespace + 'active-slide' ) ) { + slider.flexAnimate(slider.getTarget("prev"), true); + } else if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass(namespace + "active-slide")) { + slider.direction = (slider.currentItem < target) ? "next" : "prev"; + slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); + } + }); + }else{ + el._slider = slider; + slider.slides.each(function (){ + var that = this; + that._gesture = new MSGesture(); + that._gesture.target = that; + that.addEventListener("MSPointerDown", function (e){ + e.preventDefault(); + if(e.currentTarget._gesture) { + e.currentTarget._gesture.addPointer(e.pointerId); + } + }, false); + that.addEventListener("MSGestureTap", function (e){ + e.preventDefault(); + var $slide = $(this), + target = $slide.index(); + if (!$(slider.vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) { + slider.direction = (slider.currentItem < target) ? "next" : "prev"; + slider.flexAnimate(target, slider.vars.pauseOnAction, false, true, true); + } + }); + }); + } + } + }, + controlNav: { + setup: function() { + if (!slider.manualControls) { + methods.controlNav.setupPaging(); + } else { // MANUALCONTROLS: + methods.controlNav.setupManual(); + } + }, + setupPaging: function() { + var type = (slider.vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging', + j = 1, + item, + slide; + + slider.controlNavScaffold = $('
          '); + + if (slider.pagingCount > 1) { + for (var i = 0; i < slider.pagingCount; i++) { + slide = slider.slides.eq(i); + if ( undefined === slide.attr( 'data-thumb-alt' ) ) { slide.attr( 'data-thumb-alt', '' ); } + var altText = ( '' !== slide.attr( 'data-thumb-alt' ) ) ? altText = ' alt="' + slide.attr( 'data-thumb-alt' ) + '"' : ''; + item = (slider.vars.controlNav === "thumbnails") ? '' : '' + j + ''; + if ( 'thumbnails' === slider.vars.controlNav && true === slider.vars.thumbCaptions ) { + var captn = slide.attr( 'data-thumbcaption' ); + if ( '' !== captn && undefined !== captn ) { item += '' + captn + ''; } + } + slider.controlNavScaffold.append('
        1. ' + item + '
        2. '); + j++; + } + } + + // CONTROLSCONTAINER: + (slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold); + methods.controlNav.set(); + + methods.controlNav.active(); + + slider.controlNavScaffold.delegate('a, img', eventType, function(event) { + event.preventDefault(); + + if (watchedEvent === "" || watchedEvent === event.type) { + var $this = $(this), + target = slider.controlNav.index($this); + + if (!$this.hasClass(namespace + 'active')) { slider.direction = (target > slider.currentSlide) ? "next" : "prev"; + slider.flexAnimate(target, slider.vars.pauseOnAction); + } } - if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev"; - - if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) { - if (asNav && withSync) { - var master = $(slider.vars.asNavFor).data('flexslider'); - slider.atEnd = target === 0 || target === slider.count - 1; - master.flexAnimate(target, true, false, true, fromNav); - slider.direction = (slider.currentItem < target) ? "next" : "prev"; - master.direction = slider.direction; - - if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) { - slider.currentItem = target; - slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); - target = Math.floor(target/slider.visible); - } else { - slider.currentItem = target; - slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); - return false; - } - } - - slider.animating = true; - slider.animatingTo = target; - - // SLIDESHOW: - if (pause) { slider.pause(); } - - // API: before() animation Callback - slider.vars.before(slider); - - // SYNC: - if (slider.syncExists && !fromNav) { methods.sync("animate"); } - - // CONTROLNAV - if (slider.vars.controlNav) { methods.controlNav.active(); } - - // !CAROUSEL: - // CANDIDATE: slide active class (for add/remove slide) - if (!carousel) { slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); } - - // INFINITE LOOP: - // CANDIDATE: atEnd - slider.atEnd = target === 0 || target === slider.last; - - // DIRECTIONNAV: - if (slider.vars.directionNav) { methods.directionNav.update(); } - - if (target === slider.last) { - // API: end() of cycle Callback - slider.vars.end(slider); - // SLIDESHOW && !INFINITE LOOP: - if (!slider.vars.animationLoop) { slider.pause(); } - } - - // SLIDE: - if (!fade) { - var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW, - margin, slideString, calcNext; - - // INFINITE LOOP / REVERSE: - if (carousel) { - margin = slider.vars.itemMargin; - calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo; - slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext; - } else if (slider.currentSlide === 0 && target === slider.count - 1 && slider.vars.animationLoop && slider.direction !== "next") { - slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0; - } else if (slider.currentSlide === slider.last && target === 0 && slider.vars.animationLoop && slider.direction !== "prev") { - slideString = (reverse) ? 0 : (slider.count + 1) * dimension; - } else { - slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension; - } - slider.setProps(slideString, "", slider.vars.animationSpeed); - if (slider.transitions) { - if (!slider.vars.animationLoop || !slider.atEnd) { - slider.animating = false; - slider.currentSlide = slider.animatingTo; - } - - // Unbind previous transitionEnd events and re-bind new transitionEnd event - slider.container.unbind("webkitTransitionEnd transitionend"); - slider.container.bind("webkitTransitionEnd transitionend", function() { - clearTimeout(slider.ensureAnimationEnd); - slider.wrapup(dimension); - }); - - // Insurance for the ever-so-fickle transitionEnd event - clearTimeout(slider.ensureAnimationEnd); - slider.ensureAnimationEnd = setTimeout(function() { - slider.wrapup(dimension); - }, slider.vars.animationSpeed + 100); - - } else { - slider.container.animate(slider.args, slider.vars.animationSpeed, slider.vars.easing, function(){ - slider.wrapup(dimension); - }); - } - } else { // FADE: - if (!touch) { - slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); - slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); - } else { - slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); - slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); - slider.wrapup(dimension); - } - } - // SMOOTH HEIGHT: - if (slider.vars.smoothHeight) { methods.smoothHeight(slider.vars.animationSpeed); } + // setup flags to prevent event duplication + if (watchedEvent === "") { + watchedEvent = event.type; } - }; - slider.wrapup = function(dimension) { - // SLIDE: - if (!fade && !carousel) { - if (slider.currentSlide === 0 && slider.animatingTo === slider.last && slider.vars.animationLoop) { - slider.setProps(dimension, "jumpEnd"); - } else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && slider.vars.animationLoop) { - slider.setProps(dimension, "jumpStart"); - } - } - slider.animating = false; - slider.currentSlide = slider.animatingTo; - // API: after() animation Callback - slider.vars.after(slider); - }; + methods.setToClearWatchedEvent(); - // SLIDESHOW: - slider.animateSlides = function() { - if (!slider.animating && focused ) { slider.flexAnimate(slider.getTarget("next")); } - }; - // SLIDESHOW: - slider.pause = function() { - clearInterval(slider.animatedSlides); - slider.animatedSlides = null; - slider.playing = false; - // PAUSEPLAY: - if (slider.vars.pausePlay) { methods.pausePlay.update("play"); } - // SYNC: - if (slider.syncExists) { methods.sync("pause"); } - }; - // SLIDESHOW: - slider.play = function() { - if (slider.playing) { clearInterval(slider.animatedSlides); } - slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed); - slider.started = slider.playing = true; - // PAUSEPLAY: - if (slider.vars.pausePlay) { methods.pausePlay.update("pause"); } - // SYNC: - if (slider.syncExists) { methods.sync("play"); } - }; - // STOP: - slider.stop = function () { - slider.pause(); - slider.stopped = true; - }; - slider.canAdvance = function(target, fromNav) { - // ASNAV: - var last = (asNav) ? slider.pagingCount - 1 : slider.last; - return (fromNav) ? true : - (asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true : - (asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false : - (target === slider.currentSlide && !asNav) ? false : - (slider.vars.animationLoop) ? true : - (slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false : - (slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false : - true; - }; - slider.getTarget = function(dir) { - slider.direction = dir; - if (dir === "next") { - return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1; + }); + }, + setupManual: function() { + slider.controlNav = slider.manualControls; + methods.controlNav.active(); + + slider.controlNav.bind(eventType, function(event) { + event.preventDefault(); + + if (watchedEvent === "" || watchedEvent === event.type) { + var $this = $(this), + target = slider.controlNav.index($this); + + if (!$this.hasClass(namespace + 'active')) { + (target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev"; + slider.flexAnimate(target, slider.vars.pauseOnAction); + } + } + + // setup flags to prevent event duplication + if (watchedEvent === "") { + watchedEvent = event.type; + } + methods.setToClearWatchedEvent(); + }); + }, + set: function() { + var selector = (slider.vars.controlNav === "thumbnails") ? 'img' : 'a'; + slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider); + }, + active: function() { + slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active"); + }, + update: function(action, pos) { + if (slider.pagingCount > 1 && action === "add") { + slider.controlNavScaffold.append($('
        3. ' + slider.count + '
        4. ')); + } else if (slider.pagingCount === 1) { + slider.controlNavScaffold.find('li').remove(); + } else { + slider.controlNav.eq(pos).closest('li').remove(); + } + methods.controlNav.set(); + (slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active(); + } + }, + directionNav: { + setup: function() { + var directionNavScaffold = $(''); + + // CUSTOM DIRECTION NAV: + if (slider.customDirectionNav) { + slider.directionNav = slider.customDirectionNav; + // CONTROLSCONTAINER: + } else if (slider.controlsContainer) { + $(slider.controlsContainer).append(directionNavScaffold); + slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer); + } else { + slider.append(directionNavScaffold); + slider.directionNav = $('.' + namespace + 'direction-nav li a', slider); + } + + methods.directionNav.update(); + + slider.directionNav.bind(eventType, function(event) { + event.preventDefault(); + var target; + + if (watchedEvent === "" || watchedEvent === event.type) { + target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev'); + slider.flexAnimate(target, slider.vars.pauseOnAction); + } + + // setup flags to prevent event duplication + if (watchedEvent === "") { + watchedEvent = event.type; + } + methods.setToClearWatchedEvent(); + }); + }, + update: function() { + var disabledClass = namespace + 'disabled'; + if (slider.pagingCount === 1) { + slider.directionNav.addClass(disabledClass).attr('tabindex', '-1'); + } else if (!slider.vars.animationLoop) { + if (slider.animatingTo === 0) { + slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass).attr('tabindex', '-1'); + } else if (slider.animatingTo === slider.last) { + slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass).attr('tabindex', '-1'); } else { - return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1; + slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); } - }; + } else { + slider.directionNav.removeClass(disabledClass).removeAttr('tabindex'); + } + } + }, + pausePlay: { + setup: function() { + var pausePlayScaffold = $('
          '); + + // CONTROLSCONTAINER: + if (slider.controlsContainer) { + slider.controlsContainer.append(pausePlayScaffold); + slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer); + } else { + slider.append(pausePlayScaffold); + slider.pausePlay = $('.' + namespace + 'pauseplay a', slider); + } + + methods.pausePlay.update((slider.vars.slideshow) ? namespace + 'pause' : namespace + 'play'); + + slider.pausePlay.bind(eventType, function(event) { + event.preventDefault(); + + if (watchedEvent === "" || watchedEvent === event.type) { + if ($(this).hasClass(namespace + 'pause')) { + slider.manualPause = true; + slider.manualPlay = false; + slider.pause(); + } else { + slider.manualPause = false; + slider.manualPlay = true; + slider.play(); + } + } + + // setup flags to prevent event duplication + if (watchedEvent === "") { + watchedEvent = event.type; + } + methods.setToClearWatchedEvent(); + }); + }, + update: function(state) { + (state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').html(slider.vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').html(slider.vars.pauseText); + } + }, + touch: function() { + var startX, + startY, + offset, + cwidth, + dx, + startT, + onTouchStart, + onTouchMove, + onTouchEnd, + scrolling = false, + localX = 0, + localY = 0, + accDx = 0; + + if(!msGesture){ + onTouchStart = function(e) { + if (slider.animating) { + e.preventDefault(); + } else if ( ( window.navigator.msPointerEnabled ) || e.touches.length === 1 ) { + slider.pause(); + // CAROUSEL: + cwidth = (vertical) ? slider.h : slider. w; + startT = Number(new Date()); + // CAROUSEL: + + // Local vars for X and Y points. + localX = e.touches[0].pageX; + localY = e.touches[0].pageY; + + offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : + (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : + (carousel && slider.currentSlide === slider.last) ? slider.limit : + (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : + (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; + startX = (vertical) ? localY : localX; + startY = (vertical) ? localX : localY; + el.addEventListener('touchmove', onTouchMove, false); + el.addEventListener('touchend', onTouchEnd, false); + } + }; + + onTouchMove = function(e) { + // Local vars for X and Y points. + + localX = e.touches[0].pageX; + localY = e.touches[0].pageY; + + dx = (vertical) ? startX - localY : (slider.vars.rtl?-1:1)*(startX - localX); + scrolling = (vertical) ? (Math.abs(dx) < Math.abs(localX - startY)) : (Math.abs(dx) < Math.abs(localY - startY)); + var fxms = 500; + + if ( ! scrolling || Number( new Date() ) - startT > fxms ) { + e.preventDefault(); + if (!fade && slider.transitions) { + if (!slider.vars.animationLoop) { + dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1); + } + slider.setProps(offset + dx, "setTouch"); + } + } + }; + + onTouchEnd = function(e) { + // finish the touch by undoing the touch session + el.removeEventListener('touchmove', onTouchMove, false); + + if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { + var updateDx = (reverse) ? -dx : dx, + target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); + + if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { + slider.flexAnimate(target, slider.vars.pauseOnAction); + } else { + if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); } + } + } + el.removeEventListener('touchend', onTouchEnd, false); + + startX = null; + startY = null; + dx = null; + offset = null; + }; + + el.addEventListener('touchstart', onTouchStart, false); + }else{ + el.style.msTouchAction = "none"; + el._gesture = new MSGesture(); + el._gesture.target = el; + el.addEventListener("MSPointerDown", onMSPointerDown, false); + el._slider = slider; + el.addEventListener("MSGestureChange", onMSGestureChange, false); + el.addEventListener("MSGestureEnd", onMSGestureEnd, false); + + function onMSPointerDown(e){ + e.stopPropagation(); + if (slider.animating) { + e.preventDefault(); + }else{ + slider.pause(); + el._gesture.addPointer(e.pointerId); + accDx = 0; + cwidth = (vertical) ? slider.h : slider. w; + startT = Number(new Date()); + // CAROUSEL: + + offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 : + (carousel && reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : + (carousel && slider.currentSlide === slider.last) ? slider.limit : + (carousel) ? ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.currentSlide : + (reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth; + } + } + + function onMSGestureChange(e) { + e.stopPropagation(); + var slider = e.target._slider; + if(!slider){ + return; + } + var transX = -e.translationX, + transY = -e.translationY; + + //Accumulate translations. + accDx = accDx + ((vertical) ? transY : transX); + dx = (slider.vars.rtl?-1:1)*accDx; + scrolling = (vertical) ? (Math.abs(accDx) < Math.abs(-transX)) : (Math.abs(accDx) < Math.abs(-transY)); + + if(e.detail === e.MSGESTURE_FLAG_INERTIA){ + setImmediate(function (){ + el._gesture.stop(); + }); + + return; + } + + if (!scrolling || Number(new Date()) - startT > 500) { + e.preventDefault(); + if (!fade && slider.transitions) { + if (!slider.vars.animationLoop) { + dx = accDx / ((slider.currentSlide === 0 && accDx < 0 || slider.currentSlide === slider.last && accDx > 0) ? (Math.abs(accDx) / cwidth + 2) : 1); + } + slider.setProps(offset + dx, "setTouch"); + } + } + } + + function onMSGestureEnd(e) { + e.stopPropagation(); + var slider = e.target._slider; + if(!slider){ + return; + } + if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) { + var updateDx = (reverse) ? -dx : dx, + target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev'); + + if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) { + slider.flexAnimate(target, slider.vars.pauseOnAction); + } else { + if (!fade) { slider.flexAnimate(slider.currentSlide, slider.vars.pauseOnAction, true); } + } + } + + startX = null; + startY = null; + dx = null; + offset = null; + accDx = 0; + } + } + }, + resize: function() { + if (!slider.animating && slider.is(':visible')) { + if (!carousel) { slider.doMath(); } + + if (fade) { + // SMOOTH HEIGHT: + methods.smoothHeight(); + } else if (carousel) { //CAROUSEL: + slider.slides.width(slider.computedW); + slider.update(slider.pagingCount); + slider.setProps(); + } + else if (vertical) { //VERTICAL: + slider.viewport.height(slider.h); + slider.setProps(slider.h, "setTotal"); + } else { + // SMOOTH HEIGHT: + if (slider.vars.smoothHeight) { methods.smoothHeight(); } + slider.newSlides.width(slider.computedW); + slider.setProps(slider.computedW, "setTotal"); + } + } + }, + smoothHeight: function(dur) { + if (!vertical || fade) { + var $obj = (fade) ? slider : slider.viewport; + (dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).innerHeight()}, dur) : $obj.innerHeight(slider.slides.eq(slider.animatingTo).innerHeight()); + } + }, + sync: function(action) { + var $obj = $(slider.vars.sync).data("flexslider"), + target = slider.animatingTo; + + switch (action) { + case "animate": $obj.flexAnimate(target, slider.vars.pauseOnAction, false, true); break; + case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break; + case "pause": $obj.pause(); break; + } + }, + uniqueID: function($clone) { + // Append _clone to current level and children elements with id attributes + $clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() { + var $this = $(this); + $this.attr( 'id', $this.attr( 'id' ) + '_clone' ); + }); + return $clone; + }, + pauseInvisible: { + visProp: null, + init: function() { + var visProp = methods.pauseInvisible.getHiddenProp(); + if (visProp) { + var evtname = visProp.replace(/[H|h]idden/,'') + 'visibilitychange'; + document.addEventListener(evtname, function() { + if (methods.pauseInvisible.isHidden()) { + if(slider.startTimeout) { + clearTimeout(slider.startTimeout); //If clock is ticking, stop timer and prevent from starting while invisible + } else { + slider.pause(); //Or just pause + } + } + else { + if(slider.started) { + slider.play(); //Initiated before, just play + } else { + if (slider.vars.initDelay > 0) { + setTimeout(slider.play, slider.vars.initDelay); + } else { + slider.play(); //Didn't init before: simply init or wait for it + } + } + } + }); + } + }, + isHidden: function() { + var prop = methods.pauseInvisible.getHiddenProp(); + if (!prop) { + return false; + } + return document[prop]; + }, + getHiddenProp: function() { + var prefixes = ['webkit','moz','ms','o']; + // if 'hidden' is natively supported just return it + if ('hidden' in document) { + return 'hidden'; + } + // otherwise loop over all the known prefixes until we find one + for ( var i = 0; i < prefixes.length; i++ ) { + if ((prefixes[i] + 'Hidden') in document) { + return prefixes[i] + 'Hidden'; + } + } + // otherwise it's not supported + return null; + } + }, + setToClearWatchedEvent: function() { + clearTimeout(watchedEventClearTimer); + watchedEventClearTimer = setTimeout(function() { + watchedEvent = ""; + }, 3000); + } + }; + + // public methods + slider.flexAnimate = function(target, pause, override, withSync, fromNav) { + if (!slider.vars.animationLoop && target !== slider.currentSlide) { + slider.direction = (target > slider.currentSlide) ? "next" : "prev"; + } + + if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev"; + + if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) { + if (asNav && withSync) { + var master = $(slider.vars.asNavFor).data('flexslider'); + slider.atEnd = target === 0 || target === slider.count - 1; + master.flexAnimate(target, true, false, true, fromNav); + slider.direction = (slider.currentItem < target) ? "next" : "prev"; + master.direction = slider.direction; + + if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) { + slider.currentItem = target; + slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); + target = Math.floor(target/slider.visible); + } else { + slider.currentItem = target; + slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide"); + return false; + } + } + + slider.animating = true; + slider.animatingTo = target; + + // SLIDESHOW: + if (pause) { slider.pause(); } + + // API: before() animation Callback + slider.vars.before(slider); + + // SYNC: + if (slider.syncExists && !fromNav) { methods.sync("animate"); } + + // CONTROLNAV + if (slider.vars.controlNav) { methods.controlNav.active(); } + + // !CAROUSEL: + // CANDIDATE: slide active class (for add/remove slide) + if (!carousel) { slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide'); } + + // INFINITE LOOP: + // CANDIDATE: atEnd + slider.atEnd = target === 0 || target === slider.last; + + // DIRECTIONNAV: + if (slider.vars.directionNav) { methods.directionNav.update(); } + + if (target === slider.last) { + // API: end() of cycle Callback + slider.vars.end(slider); + // SLIDESHOW && !INFINITE LOOP: + if (!slider.vars.animationLoop) { slider.pause(); } + } // SLIDE: - slider.setProps = function(pos, special, dur) { - var target = (function() { - var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo, - posCalc = (function() { - if (carousel) { - return (special === "setTouch") ? pos : - (reverse && slider.animatingTo === slider.last) ? 0 : - (reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : - (slider.animatingTo === slider.last) ? slider.limit : posCheck; - } else { - switch (special) { - case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos; - case "setTouch": return (reverse) ? pos : pos; - case "jumpEnd": return (reverse) ? pos : slider.count * pos; - case "jumpStart": return (reverse) ? slider.count * pos : pos; - default: return pos; - } - } - }()); + if (!fade) { + var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW, + margin, slideString, calcNext; - return (posCalc * ((slider.vars.rtl)?1:-1)) + "px"; + // INFINITE LOOP / REVERSE: + if (carousel) { + margin = slider.vars.itemMargin; + calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo; + slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext; + } else if (slider.currentSlide === 0 && target === slider.count - 1 && slider.vars.animationLoop && slider.direction !== "next") { + slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0; + } else if (slider.currentSlide === slider.last && target === 0 && slider.vars.animationLoop && slider.direction !== "prev") { + slideString = (reverse) ? 0 : (slider.count + 1) * dimension; + } else { + slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension; + } + slider.setProps(slideString, "", slider.vars.animationSpeed); + if (slider.transitions) { + if (!slider.vars.animationLoop || !slider.atEnd) { + slider.animating = false; + slider.currentSlide = slider.animatingTo; + } + + // Unbind previous transitionEnd events and re-bind new transitionEnd event + slider.container.unbind("webkitTransitionEnd transitionend"); + slider.container.bind("webkitTransitionEnd transitionend", function() { + clearTimeout(slider.ensureAnimationEnd); + slider.wrapup(dimension); + }); + + // Insurance for the ever-so-fickle transitionEnd event + clearTimeout(slider.ensureAnimationEnd); + slider.ensureAnimationEnd = setTimeout(function() { + slider.wrapup(dimension); + }, slider.vars.animationSpeed + 100); + + } else { + slider.container.animate(slider.args, slider.vars.animationSpeed, slider.vars.easing, function(){ + slider.wrapup(dimension); + }); + } + } else { // FADE: + if (!touch) { + slider.slides.eq(slider.currentSlide).css({"zIndex": 1}).animate({"opacity": 0}, slider.vars.animationSpeed, slider.vars.easing); + slider.slides.eq(target).css({"zIndex": 2}).animate({"opacity": 1}, slider.vars.animationSpeed, slider.vars.easing, slider.wrapup); + } else { + slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 }); + slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 }); + slider.wrapup(dimension); + } + } + // SMOOTH HEIGHT: + if (slider.vars.smoothHeight) { methods.smoothHeight(slider.vars.animationSpeed); } + } + }; + slider.wrapup = function(dimension) { + // SLIDE: + if (!fade && !carousel) { + if (slider.currentSlide === 0 && slider.animatingTo === slider.last && slider.vars.animationLoop) { + slider.setProps(dimension, "jumpEnd"); + } else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && slider.vars.animationLoop) { + slider.setProps(dimension, "jumpStart"); + } + } + slider.animating = false; + slider.currentSlide = slider.animatingTo; + // API: after() animation Callback + slider.vars.after(slider); + }; + + // SLIDESHOW: + slider.animateSlides = function() { + if (!slider.animating && focused ) { slider.flexAnimate(slider.getTarget("next")); } + }; + // SLIDESHOW: + slider.pause = function() { + clearInterval(slider.animatedSlides); + slider.animatedSlides = null; + slider.playing = false; + // PAUSEPLAY: + if (slider.vars.pausePlay) { methods.pausePlay.update("play"); } + // SYNC: + if (slider.syncExists) { methods.sync("pause"); } + }; + // SLIDESHOW: + slider.play = function() { + if (slider.playing) { clearInterval(slider.animatedSlides); } + slider.animatedSlides = slider.animatedSlides || setInterval(slider.animateSlides, slider.vars.slideshowSpeed); + slider.started = slider.playing = true; + // PAUSEPLAY: + if (slider.vars.pausePlay) { methods.pausePlay.update("pause"); } + // SYNC: + if (slider.syncExists) { methods.sync("play"); } + }; + // STOP: + slider.stop = function () { + slider.pause(); + slider.stopped = true; + }; + slider.canAdvance = function(target, fromNav) { + // ASNAV: + var last = (asNav) ? slider.pagingCount - 1 : slider.last; + return (fromNav) ? true : + (asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true : + (asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false : + (target === slider.currentSlide && !asNav) ? false : + (slider.vars.animationLoop) ? true : + (slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false : + (slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false : + true; + }; + slider.getTarget = function(dir) { + slider.direction = dir; + if (dir === "next") { + return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1; + } else { + return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1; + } + }; + + // SLIDE: + slider.setProps = function(pos, special, dur) { + var target = (function() { + var posCheck = (pos) ? pos : ((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo, + posCalc = (function() { + if (carousel) { + return (special === "setTouch") ? pos : + (reverse && slider.animatingTo === slider.last) ? 0 : + (reverse) ? slider.limit - (((slider.itemW + slider.vars.itemMargin) * slider.move) * slider.animatingTo) : + (slider.animatingTo === slider.last) ? slider.limit : posCheck; + } else { + switch (special) { + case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos; + case "setTouch": return (reverse) ? pos : pos; + case "jumpEnd": return (reverse) ? pos : slider.count * pos; + case "jumpStart": return (reverse) ? slider.count * pos : pos; + default: return pos; + } + } }()); - if (slider.transitions) { - if (slider.isFirefox) { - target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + (parseInt(target)+'px') + ",0,0)"; - } else { - target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + ((slider.vars.rtl?-1:1)*parseInt(target)+'px') + ",0,0)"; - } - dur = (dur !== undefined) ? (dur/1000) + "s" : "0s"; - slider.container.css("-" + slider.pfx + "-transition-duration", dur); - slider.container.css("transition-duration", dur); - } + return (posCalc * ((slider.vars.rtl)?1:-1)) + "px"; + }()); - slider.args[slider.prop] = target; - if (slider.transitions || dur === undefined) { slider.container.css(slider.args); } - - slider.container.css('transform',target); - }; - - slider.setup = function(type) { - // SLIDE: - if (!fade) { - var sliderOffset, arr; - - if (type === "init") { - slider.viewport = $('
          ').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container); - // INFINITE LOOP: - slider.cloneCount = 0; - slider.cloneOffset = 0; - // REVERSE: - if (reverse) { - arr = $.makeArray(slider.slides).reverse(); - slider.slides = $(arr); - slider.container.empty().append(slider.slides); - } - } - // INFINITE LOOP && !CAROUSEL: - if (slider.vars.animationLoop && !carousel) { - slider.cloneCount = 2; - slider.cloneOffset = 1; - // clear out old clones - if (type !== "init") { slider.container.find('.clone').remove(); } - slider.container.append(methods.uniqueID(slider.slides.first().clone().addClass('clone')).attr('aria-hidden', 'true')) - .prepend(methods.uniqueID(slider.slides.last().clone().addClass('clone')).attr('aria-hidden', 'true')); - } - slider.newSlides = $(slider.vars.selector, slider); - - sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset; - // VERTICAL: - if (vertical && !carousel) { - slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%"); - setTimeout(function(){ - slider.newSlides.css({"display": "block"}); - slider.doMath(); - slider.viewport.height(slider.h); - slider.setProps(sliderOffset * slider.h, "init"); - }, (type === "init") ? 100 : 0); - } else { - slider.container.width((slider.count + slider.cloneCount) * 200 + "%"); - slider.setProps(sliderOffset * slider.computedW, "init"); - setTimeout(function(){ - slider.doMath(); - if(slider.vars.rtl){ - if (slider.isFirefox) { - slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "right", "display": "block"}); - } else { - slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"}); - } - - } - else{ - slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"}); - } - // SMOOTH HEIGHT: - if (slider.vars.smoothHeight) { methods.smoothHeight(); } - }, (type === "init") ? 100 : 0); - } - } else { // FADE: - if(slider.vars.rtl){ - slider.slides.css({"width": "100%", "float": 'right', "marginLeft": "-100%", "position": "relative"}); - } - else{ - slider.slides.css({"width": "100%", "float": 'left', "marginRight": "-100%", "position": "relative"}); - } - if (type === "init") { - if (!touch) { - //slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing); - if (slider.vars.fadeFirstSlide == false) { - slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).css({"opacity": 1}); - } else { - slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); - } - } else { - slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2}); - } - } - // SMOOTH HEIGHT: - if (slider.vars.smoothHeight) { methods.smoothHeight(); } - } - // !CAROUSEL: - // CANDIDATE: active slide - if (!carousel) { slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); } - - //FlexSlider: init() Callback - slider.vars.init(slider); - }; - - slider.doMath = function() { - var slide = slider.slides.first(), - slideMargin = slider.vars.itemMargin, - minItems = slider.vars.minItems, - maxItems = slider.vars.maxItems; - - slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width(); - if (slider.isFirefox) { slider.w = slider.width(); } - slider.h = slide.height(); - slider.boxPadding = slide.outerWidth() - slide.width(); - - // CAROUSEL: - if (carousel) { - slider.itemT = slider.vars.itemWidth + slideMargin; - slider.itemM = slideMargin; - slider.minW = (minItems) ? minItems * slider.itemT : slider.w; - slider.maxW = (maxItems) ? (maxItems * slider.itemT) - slideMargin : slider.w; - slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * (minItems - 1)))/minItems : - (slider.maxW < slider.w) ? (slider.w - (slideMargin * (maxItems - 1)))/maxItems : - (slider.vars.itemWidth > slider.w) ? slider.w : slider.vars.itemWidth; - - slider.visible = Math.floor(slider.w/(slider.itemW)); - slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible; - slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1); - slider.last = slider.pagingCount - 1; - slider.limit = (slider.pagingCount === 1) ? 0 : - (slider.vars.itemWidth > slider.w) ? (slider.itemW * (slider.count - 1)) + (slideMargin * (slider.count - 1)) : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin; - } else { - slider.itemW = slider.w; - slider.itemM = slideMargin; - slider.pagingCount = slider.count; - slider.last = slider.count - 1; - } - slider.computedW = slider.itemW - slider.boxPadding; - slider.computedM = slider.itemM; - }; - - slider.update = function(pos, action) { - slider.doMath(); - - // update currentSlide and slider.animatingTo if necessary - if (!carousel) { - if (pos < slider.currentSlide) { - slider.currentSlide += 1; - } else if (pos <= slider.currentSlide && pos !== 0) { - slider.currentSlide -= 1; - } - slider.animatingTo = slider.currentSlide; - } - - // update controlNav - if (slider.vars.controlNav && !slider.manualControls) { - if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) { - methods.controlNav.update("add"); - } else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) { - if (carousel && slider.currentSlide > slider.last) { - slider.currentSlide -= 1; - slider.animatingTo -= 1; - } - methods.controlNav.update("remove", slider.last); - } - } - // update directionNav - if (slider.vars.directionNav) { methods.directionNav.update(); } - - }; - - slider.addSlide = function(obj, pos) { - var $obj = $(obj); - - slider.count += 1; - slider.last = slider.count - 1; - - // append new slide - if (vertical && reverse) { - (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj); - } else { - (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj); - } - - // update currentSlide, animatingTo, controlNav, and directionNav - slider.update(pos, "add"); - - // update slider.slides - slider.slides = $(slider.vars.selector + ':not(.clone)', slider); - // re-setup the slider to accomdate new slide - slider.setup(); - - //FlexSlider: added() Callback - slider.vars.added(slider); - }; - slider.removeSlide = function(obj) { - var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj; - - // update count - slider.count -= 1; - slider.last = slider.count - 1; - - // remove slide - if (isNaN(obj)) { - $(obj, slider.slides).remove(); - } else { - (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove(); - } - - // update currentSlide, animatingTo, controlNav, and directionNav - slider.doMath(); - slider.update(pos, "remove"); - - // update slider.slides - slider.slides = $(slider.vars.selector + ':not(.clone)', slider); - // re-setup the slider to accomdate new slide - slider.setup(); - - // FlexSlider: removed() Callback - slider.vars.removed(slider); - }; - - //FlexSlider: Initialize - methods.init(); - }; - - // Ensure the slider isn't focussed if the window loses focus. - $( window ).blur( function ( e ) { - focused = false; - }).focus( function ( e ) { - focused = true; - }); - - //FlexSlider: Default Settings - $.flexslider.defaults = { - namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin - selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril - animation: "fade", //String: Select your animation type, "fade" or "slide" - easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! - direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" - reverse: false, //{NEW} Boolean: Reverse the animation direction - animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end - smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode - startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) - slideshow: true, //Boolean: Animate slider automatically - slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds - animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds - initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds - randomize: false, //Boolean: Randomize slide order - fadeFirstSlide: true, //Boolean: Fade in the first slide when animation type is "fade" - thumbCaptions: false, //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav. - - // Usability features - pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. - pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering - pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage. - useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available - touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices - video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches - - // Primary Controls - controlNav: true, //Boolean: Create navigation for paging control of each slide? Note: Leave true for manualControls usage - directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) - prevText: "Previous", //String: Set the text for the "previous" directionNav item - nextText: "Next", //String: Set the text for the "next" directionNav item - - // Secondary Navigation - keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys - multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present. - mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel - pausePlay: false, //Boolean: Create pause/play dynamic element - pauseText: "Pause", //String: Set the text for the "pause" pausePlay item - playText: "Play", //String: Set the text for the "play" pausePlay item - - // Special properties - controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found. - manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. - customDirectionNav: "", //{NEW} jQuery Object/Selector: Custom prev / next button. Must be two jQuery elements. In order to make the events work they have to have the classes "prev" and "next" (plus namespace) - sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care. - asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider - - // Carousel Options - itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding. - itemMargin: 0, //{NEW} Integer: Margin between carousel items. - minItems: 1, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this. - maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit. - move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items. - allowOneSlide: true, //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide - - // Browser Specific - isFirefox: false, // {NEW} Boolean: Set to true when Firefox is the browser used. - - // Callback API - start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide - before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation - after: function(){}, //Callback: function(slider) - Fires after each slider animation completes - end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) - added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added - removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed - init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup - rtl: false //{NEW} Boolean: Whether or not to enable RTL mode - }; - - //FlexSlider: Plugin Function - $.fn.flexslider = function(options) { - if (options === undefined) { options = {}; } - - if (typeof options === "object") { - return this.each(function() { - var $this = $(this), - selector = (options.selector) ? options.selector : ".slides > li", - $slides = $this.find(selector); - - if ( ( $slides.length === 1 && options.allowOneSlide === false ) || $slides.length === 0 ) { - $slides.fadeIn(400); - if (options.start) { options.start($this); } - } else if ($this.data('flexslider') === undefined) { - new $.flexslider(this, options); - } - }); + if (slider.transitions) { + if (slider.isFirefox) { + target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + (parseInt(target)+'px') + ",0,0)"; } else { - // Helper strings to quickly perform functions on the slider - var $slider = $(this).data('flexslider'); - switch (options) { - case "play": $slider.play(); break; - case "pause": $slider.pause(); break; - case "stop": $slider.stop(); break; - case "next": $slider.flexAnimate($slider.getTarget("next"), true); break; - case "prev": - case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break; - default: if (typeof options === "number") { $slider.flexAnimate(options, true); } - } + target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + ((slider.vars.rtl?-1:1)*parseInt(target)+'px') + ",0,0)"; } + dur = (dur !== undefined) ? (dur/1000) + "s" : "0s"; + slider.container.css("-" + slider.pfx + "-transition-duration", dur); + slider.container.css("transition-duration", dur); + } + + slider.args[slider.prop] = target; + if (slider.transitions || dur === undefined) { slider.container.css(slider.args); } + + slider.container.css('transform',target); }; + + slider.setup = function(type) { + // SLIDE: + if (!fade) { + var sliderOffset, arr; + + if (type === "init") { + slider.viewport = $('
          ').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container); + // INFINITE LOOP: + slider.cloneCount = 0; + slider.cloneOffset = 0; + // REVERSE: + if (reverse) { + arr = $.makeArray(slider.slides).reverse(); + slider.slides = $(arr); + slider.container.empty().append(slider.slides); + } + } + // INFINITE LOOP && !CAROUSEL: + if (slider.vars.animationLoop && !carousel) { + slider.cloneCount = 2; + slider.cloneOffset = 1; + // clear out old clones + if (type !== "init") { slider.container.find('.clone').remove(); } + slider.container.append(methods.uniqueID(slider.slides.first().clone().addClass('clone')).attr('aria-hidden', 'true')) + .prepend(methods.uniqueID(slider.slides.last().clone().addClass('clone')).attr('aria-hidden', 'true')); + } + slider.newSlides = $(slider.vars.selector, slider); + + sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset; + // VERTICAL: + if (vertical && !carousel) { + slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%"); + setTimeout(function(){ + slider.newSlides.css({"display": "block"}); + slider.doMath(); + slider.viewport.height(slider.h); + slider.setProps(sliderOffset * slider.h, "init"); + }, (type === "init") ? 100 : 0); + } else { + slider.container.width((slider.count + slider.cloneCount) * 200 + "%"); + slider.setProps(sliderOffset * slider.computedW, "init"); + setTimeout(function(){ + slider.doMath(); + if(slider.vars.rtl){ + if (slider.isFirefox) { + slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "right", "display": "block"}); + } else { + slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"}); + } + + } + else{ + slider.newSlides.css({"width": slider.computedW, "marginRight" : slider.computedM, "float": "left", "display": "block"}); + } + // SMOOTH HEIGHT: + if (slider.vars.smoothHeight) { methods.smoothHeight(); } + }, (type === "init") ? 100 : 0); + } + } else { // FADE: + if(slider.vars.rtl){ + slider.slides.css({"width": "100%", "float": 'right', "marginLeft": "-100%", "position": "relative"}); + } + else{ + slider.slides.css({"width": "100%", "float": 'left', "marginRight": "-100%", "position": "relative"}); + } + if (type === "init") { + if (!touch) { + //slider.slides.eq(slider.currentSlide).fadeIn(slider.vars.animationSpeed, slider.vars.easing); + if (slider.vars.fadeFirstSlide == false) { + slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).css({"opacity": 1}); + } else { + slider.slides.css({ "opacity": 0, "display": "block", "zIndex": 1 }).eq(slider.currentSlide).css({"zIndex": 2}).animate({"opacity": 1},slider.vars.animationSpeed,slider.vars.easing); + } + } else { + slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + slider.vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2}); + } + } + // SMOOTH HEIGHT: + if (slider.vars.smoothHeight) { methods.smoothHeight(); } + } + // !CAROUSEL: + // CANDIDATE: active slide + if (!carousel) { slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide"); } + + //FlexSlider: init() Callback + slider.vars.init(slider); + }; + + slider.doMath = function() { + var slide = slider.slides.first(), + slideMargin = slider.vars.itemMargin, + minItems = slider.vars.minItems, + maxItems = slider.vars.maxItems; + + slider.w = (slider.viewport===undefined) ? slider.width() : slider.viewport.width(); + if (slider.isFirefox) { slider.w = slider.width(); } + slider.h = slide.height(); + slider.boxPadding = slide.outerWidth() - slide.width(); + + // CAROUSEL: + if (carousel) { + slider.itemT = slider.vars.itemWidth + slideMargin; + slider.itemM = slideMargin; + slider.minW = (minItems) ? minItems * slider.itemT : slider.w; + slider.maxW = (maxItems) ? (maxItems * slider.itemT) - slideMargin : slider.w; + slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * (minItems - 1)))/minItems : + (slider.maxW < slider.w) ? (slider.w - (slideMargin * (maxItems - 1)))/maxItems : + (slider.vars.itemWidth > slider.w) ? slider.w : slider.vars.itemWidth; + + slider.visible = Math.floor(slider.w/(slider.itemW)); + slider.move = (slider.vars.move > 0 && slider.vars.move < slider.visible ) ? slider.vars.move : slider.visible; + slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1); + slider.last = slider.pagingCount - 1; + slider.limit = (slider.pagingCount === 1) ? 0 : + (slider.vars.itemWidth > slider.w) ? (slider.itemW * (slider.count - 1)) + (slideMargin * (slider.count - 1)) : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin; + } else { + slider.itemW = slider.w; + slider.itemM = slideMargin; + slider.pagingCount = slider.count; + slider.last = slider.count - 1; + } + slider.computedW = slider.itemW - slider.boxPadding; + slider.computedM = slider.itemM; + }; + + slider.update = function(pos, action) { + slider.doMath(); + + // update currentSlide and slider.animatingTo if necessary + if (!carousel) { + if (pos < slider.currentSlide) { + slider.currentSlide += 1; + } else if (pos <= slider.currentSlide && pos !== 0) { + slider.currentSlide -= 1; + } + slider.animatingTo = slider.currentSlide; + } + + // update controlNav + if (slider.vars.controlNav && !slider.manualControls) { + if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) { + methods.controlNav.update("add"); + } else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) { + if (carousel && slider.currentSlide > slider.last) { + slider.currentSlide -= 1; + slider.animatingTo -= 1; + } + methods.controlNav.update("remove", slider.last); + } + } + // update directionNav + if (slider.vars.directionNav) { methods.directionNav.update(); } + + }; + + slider.addSlide = function(obj, pos) { + var $obj = $(obj); + + slider.count += 1; + slider.last = slider.count - 1; + + // append new slide + if (vertical && reverse) { + (pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj); + } else { + (pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj); + } + + // update currentSlide, animatingTo, controlNav, and directionNav + slider.update(pos, "add"); + + // update slider.slides + slider.slides = $(slider.vars.selector + ':not(.clone)', slider); + // re-setup the slider to accomdate new slide + slider.setup(); + + //FlexSlider: added() Callback + slider.vars.added(slider); + }; + slider.removeSlide = function(obj) { + var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj; + + // update count + slider.count -= 1; + slider.last = slider.count - 1; + + // remove slide + if (isNaN(obj)) { + $(obj, slider.slides).remove(); + } else { + (vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove(); + } + + // update currentSlide, animatingTo, controlNav, and directionNav + slider.doMath(); + slider.update(pos, "remove"); + + // update slider.slides + slider.slides = $(slider.vars.selector + ':not(.clone)', slider); + // re-setup the slider to accomdate new slide + slider.setup(); + + // FlexSlider: removed() Callback + slider.vars.removed(slider); + }; + + //FlexSlider: Initialize + methods.init(); + }; + + // Ensure the slider isn't focussed if the window loses focus. + $( window ).blur( function ( e ) { + focused = false; + }).focus( function ( e ) { + focused = true; + }); + + //FlexSlider: Default Settings + $.flexslider.defaults = { + namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin + selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril + animation: "fade", //String: Select your animation type, "fade" or "slide" + easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported! + direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical" + reverse: false, //{NEW} Boolean: Reverse the animation direction + animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end + smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode + startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide) + slideshow: true, //Boolean: Animate slider automatically + slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds + animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds + initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds + randomize: false, //Boolean: Randomize slide order + fadeFirstSlide: true, //Boolean: Fade in the first slide when animation type is "fade" + thumbCaptions: false, //Boolean: Whether or not to put captions on thumbnails when using the "thumbnails" controlNav. + + // Usability features + pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended. + pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering + pauseInvisible: true, //{NEW} Boolean: Pause the slideshow when tab is invisible, resume when visible. Provides better UX, lower CPU usage. + useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available + touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices + video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches + + // Primary Controls + controlNav: true, //Boolean: Create navigation for paging control of each slide? Note: Leave true for manualControls usage + directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false) + prevText: "Previous", //String: Set the text for the "previous" directionNav item + nextText: "Next", //String: Set the text for the "next" directionNav item + + // Secondary Navigation + keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys + multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present. + mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel + pausePlay: false, //Boolean: Create pause/play dynamic element + pauseText: "Pause", //String: Set the text for the "pause" pausePlay item + playText: "Play", //String: Set the text for the "play" pausePlay item + + // Special properties + controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found. + manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs. + customDirectionNav: "", //{NEW} jQuery Object/Selector: Custom prev / next button. Must be two jQuery elements. In order to make the events work they have to have the classes "prev" and "next" (plus namespace) + sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care. + asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider + + // Carousel Options + itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding. + itemMargin: 0, //{NEW} Integer: Margin between carousel items. + minItems: 1, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this. + maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit. + move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items. + allowOneSlide: true, //{NEW} Boolean: Whether or not to allow a slider comprised of a single slide + + // Browser Specific + isFirefox: false, // {NEW} Boolean: Set to true when Firefox is the browser used. + + // Callback API + start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide + before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation + after: function(){}, //Callback: function(slider) - Fires after each slider animation completes + end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous) + added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added + removed: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is removed + init: function() {}, //{NEW} Callback: function(slider) - Fires after the slider is initially setup + rtl: false //{NEW} Boolean: Whether or not to enable RTL mode + }; + + //FlexSlider: Plugin Function + $.fn.flexslider = function(options) { + if (options === undefined) { options = {}; } + + if (typeof options === "object") { + return this.each(function() { + var $this = $(this), + selector = (options.selector) ? options.selector : ".slides > li", + $slides = $this.find(selector); + + if ( ( $slides.length === 1 && options.allowOneSlide === false ) || $slides.length === 0 ) { + $slides.fadeIn(400); + if (options.start) { options.start($this); } + } else if ($this.data('flexslider') === undefined) { + new $.flexslider(this, options); + } + }); + } else { + // Helper strings to quickly perform functions on the slider + var $slider = $(this).data('flexslider'); + switch (options) { + case "play": $slider.play(); break; + case "pause": $slider.pause(); break; + case "stop": $slider.stop(); break; + case "next": $slider.flexAnimate($slider.getTarget("next"), true); break; + case "prev": + case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break; + default: if (typeof options === "number") { $slider.flexAnimate(options, true); } + } + } + }; })(jQuery); diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.0096ef98.svg b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.0096ef98.svg index 6cc81067..c1f5adda 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.0096ef98.svg +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.0096ef98.svg @@ -4,38 +4,38 @@ 2013-9-30: Created. --> - - Created by iconfont - - + +Created by iconfont + + - - - + + + + + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.ce1b01d3.ce1b01d3.svg b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.ce1b01d3.ce1b01d3.svg index f378f763..c8bbdca4 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.ce1b01d3.ce1b01d3.svg +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/img/iconfont.ce1b01d3.ce1b01d3.svg @@ -4,2444 +4,2444 @@ 2013-9-30: Created. --> - - Created by iconfont - - + +Created by iconfont + + - - - + + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/js/app.1bf9b24e.js b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/js/app.1bf9b24e.js index 092fa04b..a3a63fb8 100644 --- a/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/js/app.1bf9b24e.js +++ b/com.actionsoft.apps.coe.pal.publisher/web/com.actionsoft.apps.coe.pal.publisher/main/js/app.1bf9b24e.js @@ -1,21 +1,21 @@ (function(e){function t(t){for(var i,r,s=t[0],l=t[1],c=t[2],u=0,d=[];u=500?alert("服务繁忙请稍后再试"):t>=400&&alert(e.response.data.message),console.dir(e),Promise.reject(e)}));var s=function(e){return r()({method:"get",url:e.url,params:e.params})},l=function(e){var t={method:"post",url:e.url,data:e.data};return t.data.sid=o["a"].state.sessionId,t.data=a(t.data),r()(t)},c=function(e){var t={authentication:o["a"].state.sessionId,sourceAppId:e.sourceAppId,aslp:e.aslp};Object.assign(t,e.params);var n={method:"post",url:e.portalUrl,params:t};return n.data=a(n.data),r()(n)};t["a"]={get:s,post:l,aslp:c}},"183b":function(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__,_regeneratorRuntime=__webpack_require__("a34a");function _typeof2(e){return _typeof2="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof2(e)}(function(e,t){"object"===_typeof2(exports)&&"object"===_typeof2(module)?module.exports=t(__webpack_require__("2b0e")):(__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_FACTORY__=t,__WEBPACK_AMD_DEFINE_RESULT__="function"===typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))})("undefined"!==typeof self&&self,(function(__WEBPACK_EXTERNAL_MODULE__8bbf__){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===_typeof2(e)&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="fb15")}({"00ee":function(e,t,n){var i=n("b622"),r=i("toStringTag"),o={};o[r]="z",e.exports="[object z]"===String(o)},"0109":function(e,t,n){},"0204":function(e,t,n){},"02f0":function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";e.defineMode("shell",(function(){var t={};function n(e,n){for(var i=0;i1&&e.eat("$");var n=e.next();return/['"({]/.test(n)?(t.tokens[0]=s(n,"("==n?"quote":"{"==n?"def":"string"),d(e,t)):(/\d/.test(n)||e.eatWhile(/\w/),t.tokens.shift(),"def")};function u(e){return function(t,n){return t.sol()&&t.string==e&&n.tokens.shift(),t.skipToEnd(),"string-2"}}function d(e,t){return(t.tokens[0]||a)(e,t)}return{startState:function(){return{tokens:[]}},token:function(e,t){return d(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}})),e.defineMIME("text/x-sh","shell"),e.defineMIME("application/x-sh","shell")}))},"0366":function(e,t,n){var i=n("1c0b");e.exports=function(e,t,n){if(i(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}}},"03d6":function(e,t,n){var i=n("9c0e"),r=n("6ca1"),o=n("39ad")(!1),a=n("5a94")("IE_PROTO");e.exports=function(e,t){var n,s=r(e),l=0,c=[];for(n in s)n!=a&&i(s,n)&&c.push(n);while(t.length>l)i(s,n=t[l++])&&(~o(c,n)||c.push(n));return c}},"051b":function(e,t,n){var i=n("1a14"),r=n("10db");e.exports=n("0bad")?function(e,t,n){return i.f(e,t,r(1,n))}:function(e,t,n){return e[t]=n,e}},"057f":function(e,t,n){var i=n("fc6a"),r=n("241c").f,o={}.toString,a="object"==("undefined"===typeof window?"undefined":_typeof2(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return r(e)}catch(t){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):r(i(e))}},"05d3":function(e,t,n){"use strict";var i=n("4a35"),r=n.n(i);r.a},"05f5":function(e,t,n){var i=n("7a41"),r=n("ef08").document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},"06c5":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n("a630"),n("fb6a"),n("b0c0"),n("d3b7"),n("25f0"),n("3ca3");var i=n("6b75");function r(e,t){if(e){if("string"===typeof e)return Object(i["a"])(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(i["a"])(e,t):void 0}}},"06cf":function(e,t,n){var i=n("83ab"),r=n("d1e7"),o=n("5c6c"),a=n("fc6a"),s=n("c04e"),l=n("5135"),c=n("0cfb"),u=Object.getOwnPropertyDescriptor;t.f=i?u:function(e,t){if(e=a(e),t=s(t,!0),c)try{return u(e,t)}catch(n){}if(l(e,t))return o(!r.f.call(e,t),e[t])}},"072d":function(e,t,n){"use strict";var i=n("0bad"),r=n("9876"),o=n("fed5"),a=n("1917"),s=n("0983"),l=n("9fbb"),c=Object.assign;e.exports=!c||n("4b8b")((function(){var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=c({},e)[n]||Object.keys(c({},t)).join("")!=i}))?function(e,t){var n=s(e),c=arguments.length,u=1,d=o.f,h=a.f;while(c>u){var f,p=l(arguments[u++]),m=d?r(p).concat(d(p)):r(p),g=m.length,v=0;while(g>v)f=m[v++],i&&!h.call(p,f)||(n[f]=p[f])}return n}:c},"07ac":function(e,t,n){var i=n("23e7"),r=n("6f53").values;i({target:"Object",stat:!0},{values:function(e){return r(e)}})},"07ea":function(e,t,n){"use strict";var i=n("3d56"),r=n.n(i);r.a},"095f":function(e,t,n){},"0983":function(e,t,n){var i=n("c901");e.exports=function(e){return Object(i(e))}},"0a06":function(e,t,n){"use strict";var i=n("c532"),r=n("30b5"),o=n("f6b4"),a=n("5270"),s=n("4a7b");function l(e){this.defaults=e,this.interceptors={request:new o,response:new o}}l.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=s(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[a,void 0],n=Promise.resolve(e);this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));while(t.length)n=n.then(t.shift(),t.shift());return n},l.prototype.getUri=function(e){return e=s(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},i.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),i.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(t,n,i){return this.request(s(i||{},{method:e,url:t,data:n}))}})),e.exports=l},"0ade":function(e,t,n){"use strict";var i=n("1c97"),r=n.n(i);r.a},"0ae2":function(e,t,n){var i=n("9876"),r=n("fed5"),o=n("1917");e.exports=function(e){var t=i(e),n=r.f;if(n){var a,s=n(e),l=o.f,c=0;while(s.length>c)l.call(e,a=s[c++])&&t.push(a)}return t}},"0b25":function(e,t,n){var i=n("a691"),r=n("50c4");e.exports=function(e){if(void 0===e)return 0;var t=i(e),n=r(t);if(t!==n)throw RangeError("Wrong length or index");return n}},"0b40":function(e,t,n){},"0b51":function(e,t,n){},"0b99":function(e,t,n){"use strict";var i=n("19fa")(!0);n("393a")(String,"String",(function(e){this._t=String(e),this._i=0}),(function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=i(t,n),this._i+=e.length,{value:e,done:!1})}))},"0bad":function(e,t,n){e.exports=!n("4b8b")((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"0c47":function(e,t,n){var i=n("da84"),r=n("d44e");r(i.JSON,"JSON",!0)},"0cfb":function(e,t,n){var i=n("83ab"),r=n("d039"),o=n("cc12");e.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},"0d3b":function(e,t,n){var i=n("d039"),r=n("b622"),o=n("c430"),a=r("iterator");e.exports=!i((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t["delete"]("b"),n+=i+e})),o&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},"0d5e":function d5e(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("c975"),core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_array_index_of__WEBPACK_IMPORTED_MODULE_0__),core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("a15b"),core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(core_js_modules_es_array_join__WEBPACK_IMPORTED_MODULE_1__),core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("cca6"),core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("d3b7"),core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_object_to_string__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("e6cf"),core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_promise__WEBPACK_IMPORTED_MODULE_4__),axios__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("bc3a"),axios__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_5__),qs__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("4328"),qs__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_6__),_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("d2d7");function _toChangeData(e){var t=[];for(var n in e)t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t.join("&")}function checkCMD(params){var cmd=params.data.cmd;if("CLIENT_USER_LOGIN"!==cmd&&"CONSOLE_ADMIN_LOGIN"!==cmd&&"CLIENT_MOBILE_USER_LOGIN"!==cmd&&"COE_USER_LOGIN"!==cmd&&"com.actionsoft.apps.coe.pal_user_login"!==cmd&&"undefined"===typeof params.data.sid){var projectSetting="undefined"==typeof settingParam?window.settingParam:eval("settingParam");params.data.sid=projectSetting.sessionId}}axios__WEBPACK_IMPORTED_MODULE_5___default.a.defaults.baseURL="undefined"==typeof axiosBaseUrl?"./":eval("axiosBaseUrl"),axios__WEBPACK_IMPORTED_MODULE_5___default.a.defaults.headers={"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},axios__WEBPACK_IMPORTED_MODULE_5___default.a.interceptors.request.use((function(e){return"get"===e.method?e.paramsSerializer=function(e){return qs__WEBPACK_IMPORTED_MODULE_6___default.a.stringify(e,{arrayFormat:"repeat"})}:"post"===e.method&&(e.params={}),e}),(function(e){if(null==e.response)throw e;var t=e.response.data;return t.msg.indexOf("用户会话已失效")>-1?Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"warning",message:t.desc?t.desc:t.msg,duration:2e3,onClose:function(){setTimeout((function(){void 0==top.homePageId?top.window.location.href="../":top.window.location.href="../console"}),2e3)}}):t.msg.indexOf("模型受管,操作被拒绝")>-1?Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"error",message:t.desc?t.desc:t.msg,onClose:function(){window.location.reload()}}):Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"error",message:t.desc?t.desc:t.msg}),Promise.reject(e)})),axios__WEBPACK_IMPORTED_MODULE_5___default.a.interceptors.response.use((function(e){if(!1!==e.config.alert&&("error"==e.data.result||"warning"==e.data.result)){var t={type:e.data.result,showClose:"error"==e.data.result,duration:"error"==e.data.result?0:2e3,message:e.data.desc?e.data.desc:e.data.msg};e.data.msg.indexOf("模型受管,操作被拒绝")>-1&&(t["onClose"]=function(){window.location.reload()}),Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])(t)}return e.data}),(function(e){if(null==e.response)throw e;var t=e.response.data;return t.msg.indexOf("用户会话已失效")>-1?Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"warning",message:t.desc?t.desc:t.msg,duration:1e3,onClose:function(){setTimeout((function(){void 0==top.homePageId?top.window.location.href="../":top.window.location.href="../console"}),2e3)}}):t.msg.indexOf("模型受管,操作被拒绝")>-1?Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"error",message:t.desc?t.desc:t.msg,onClose:function(){window.location.reload()}}):Object(_packages_message_index_js__WEBPACK_IMPORTED_MODULE_7__["a"])({type:"error",message:t.desc?t.desc:t.msg}),Promise.reject(e)})),__webpack_exports__["a"]={get:function(e){var t={method:"get",url:e.url,params:e.data};return checkCMD(e),axios__WEBPACK_IMPORTED_MODULE_5___default()(t)},post:function(e){var t={method:"post",url:e.url,data:e.data};return checkCMD(e),t.data=_toChangeData(t.data),axios__WEBPACK_IMPORTED_MODULE_5___default()(t)},aslp:function(e){var t={cmd:"API_CALL_ASLP",sourceAppId:"",aslp:""};"undefined"!==typeof e.data.sid&&(t.authentication=e.data.sid),Object.assign(t,e.data);var n={method:"post",url:e.url,data:t};return n.data=_toChangeData(n.data),axios__WEBPACK_IMPORTED_MODULE_5___default()(n)}}},"0df6":function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"0e15":function(e,t,n){var i=n("597f");e.exports=function(e,t,n){return void 0===n?i(e,t,!1):i(e,n,!1!==t)}},"0fae":function(e,t,n){},1054:function(e,t,n){},1098:function(e,t,n){"use strict";t.__esModule=!0;var i=n("17ed"),r=l(i),o=n("f893"),a=l(o),s="function"===typeof a.default&&"symbol"===_typeof2(r.default)?function(e){return _typeof2(e)}:function(e){return e&&"function"===typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":_typeof2(e)};function l(e){return e&&e.__esModule?e:{default:e}}t.default="function"===typeof a.default&&"symbol"===s(r.default)?function(e){return"undefined"===typeof e?"undefined":s(e)}:function(e){return e&&"function"===typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":"undefined"===typeof e?"undefined":s(e)}},"10db":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},1138:function(e,t,n){},1148:function(e,t,n){"use strict";var i=n("a691"),r=n("1d80");e.exports="".repeat||function(e){var t=String(r(this)),n="",o=i(e);if(o<0||o==1/0)throw RangeError("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n}},1276:function(e,t,n){"use strict";var i=n("d784"),r=n("44e7"),o=n("825a"),a=n("1d80"),s=n("4840"),l=n("8aa5"),c=n("50c4"),u=n("14c3"),d=n("9263"),h=n("d039"),f=[].push,p=Math.min,m=4294967295,g=!h((function(){return!RegExp(m,"y")}));i("split",2,(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=String(a(this)),o=void 0===n?m:n>>>0;if(0===o)return[];if(void 0===e)return[i];if(!r(e))return t.call(i,e,o);var s,l,c,u=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),p=0,g=new RegExp(e.source,h+"g");while(s=d.call(g,i)){if(l=g.lastIndex,l>p&&(u.push(i.slice(p,s.index)),s.length>1&&s.index=o))break;g.lastIndex===s.index&&g.lastIndex++}return p===i.length?!c&&g.test("")||u.push(""):u.push(i.slice(p)),u.length>o?u.slice(0,o):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=a(this),o=void 0==t?void 0:t[e];return void 0!==o?o.call(t,r,n):i.call(String(r),t,n)},function(e,r){var a=n(i,e,this,r,i!==t);if(a.done)return a.value;var d=o(e),h=String(this),f=s(d,RegExp),v=d.unicode,b=(d.ignoreCase?"i":"")+(d.multiline?"m":"")+(d.unicode?"u":"")+(g?"y":"g"),y=new f(g?d:"^(?:"+d.source+")",b),w=void 0===r?m:r>>>0;if(0===w)return[];if(0===h.length)return null===u(y,h)?[h]:[];var x=0,_=0,k=[];while(_1?arguments[1]:void 0)}})},"145e":function(e,t,n){"use strict";var i=n("7b0b"),r=n("23cb"),o=n("50c4"),a=Math.min;e.exports=[].copyWithin||function(e,t){var n=i(this),s=o(n.length),l=r(e,s),c=r(t,s),u=arguments.length>2?arguments[2]:void 0,d=a((void 0===u?s:r(u,s))-c,s-l),h=1;c0)c in n?n[l]=n[c]:delete n[l],l+=h,c+=h;return n}},"14b4":function(e,t,n){},"14c3":function(e,t,n){var i=n("c6b6"),r=n("9263");e.exports=function(e,t){var n=e.exec;if("function"===typeof n){var o=n.call(e,t);if("object"!==_typeof2(o))throw TypeError("RegExp exec method returned something other than an Object or null");return o}if("RegExp"!==i(e))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(e,t)}},"14e9":function(e,t,n){n("a4d3"),n("e01a"),n("944a"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("d3b7");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=127)}({127:function(e,t,n){"use strict";n.r(t);var i=n(16),r=n(39),o=n.n(r),a=n(3),s=n(2),l={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};function c(e){var t=e.move,n=e.size,i=e.bar,r={},o="translate"+i.axis+"("+t+"%)";return r[i.size]=n,r.transform=o,r.msTransform=o,r.webkitTransform=o,r}var u={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return l[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(e){var t=this.size,n=this.move,i=this.bar;return e("div",{class:["el-scrollbar__bar","is-"+i.key],on:{mousedown:this.clickTrackHandler}},[e("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:c({size:t,move:n,bar:i})})])},methods:{clickThumbHandler:function(e){e.ctrlKey||2===e.button||(this.startDrag(e),this[this.bar.axis]=e.currentTarget[this.bar.offset]-(e[this.bar.client]-e.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(e){var t=Math.abs(e.target.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),n=this.$refs.thumb[this.bar.offset]/2,i=100*(t-n)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=i*this.wrap[this.bar.scrollSize]/100},startDrag:function(e){e.stopImmediatePropagation(),this.cursorDown=!0,Object(s["on"])(document,"mousemove",this.mouseMoveDocumentHandler),Object(s["on"])(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(e){if(!1!==this.cursorDown){var t=this[this.bar.axis];if(t){var n=-1*(this.$el.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),i=this.$refs.thumb[this.bar.offset]-t,r=100*(n-i)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=r*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(e){this.cursorDown=!1,this[this.bar.axis]=0,Object(s["off"])(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(s["off"])(document,"mouseup",this.mouseUpDocumentHandler)}},d={name:"ElScrollbar",components:{Bar:u},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(e){var t=o()(),n=this.wrapStyle;if(t){var i="-"+t+"px",r="margin-bottom: "+i+"; margin-right: "+i+";";Array.isArray(this.wrapStyle)?(n=Object(a["toObject"])(this.wrapStyle),n.marginRight=n.marginBottom=i):"string"===typeof this.wrapStyle?n+=r:n=r}var s=e(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),l=e("div",{ref:"wrap",style:n,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",t?"":"el-scrollbar__wrap--hidden-default"]},[[s]]),c=void 0;return c=this.native?[e("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:n},[[s]])]:[l,e(u,{attrs:{move:this.moveX,size:this.sizeWidth}}),e(u,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})],e("div",{class:"el-scrollbar"},c)},methods:{handleScroll:function(){var e=this.wrap;this.moveY=100*e.scrollTop/e.clientHeight,this.moveX=100*e.scrollLeft/e.clientWidth},update:function(){var e=void 0,t=void 0,n=this.wrap;n&&(e=100*n.clientHeight/n.scrollHeight,t=100*n.clientWidth/n.scrollWidth,this.sizeHeight=e<100?e+"%":"",this.sizeWidth=t<100?t+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(i["addResizeListener"])(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(i["removeResizeListener"])(this.$refs.resize,this.update)},install:function(e){e.component(d.name,d)}};t["default"]=d},16:function(e,t){e.exports=n("4010")},2:function(e,t){e.exports=n("5924")},3:function(e,t){e.exports=n("8122")},39:function(e,t){e.exports=n("e62d")}})},"155a":function(e,t,n){},"159b":function(e,t,n){var i=n("da84"),r=n("fdbc"),o=n("17c2"),a=n("9112");for(var s in r){var l=i[s],c=l&&l.prototype;if(c&&c.forEach!==o)try{a(c,"forEach",o)}catch(u){c.forEach=o}}},1609:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},"170b":function(e,t,n){"use strict";var i=n("ebb5"),r=n("50c4"),o=n("23cb"),a=n("4840"),s=i.aTypedArray,l=i.exportTypedArrayMethod;l("subarray",(function(e,t){var n=s(this),i=n.length,l=o(e,i);return new(a(n,n.constructor))(n.buffer,n.byteOffset+l*n.BYTES_PER_ELEMENT,r((void 0===t?i:o(t,i))-l))}))},"17c2":function(e,t,n){"use strict";var i=n("b727").forEach,r=n("a640"),o=n("ae40"),a=r("forEach"),s=o("forEach");e.exports=a&&s?[].forEach:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}},"17ed":function(e,t,n){e.exports={default:n("511f"),__esModule:!0}},"182d":function(e,t,n){var i=n("f8cd");e.exports=function(e,t){var n=i(e);if(n%t)throw RangeError("Wrong offset");return n}},1836:function(e,t,n){var i=n("6ca1"),r=n("6438").f,o={}.toString,a="object"==("undefined"===typeof window?"undefined":_typeof2(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(e){try{return r(e)}catch(t){return a.slice()}};e.exports.f=function(e){return a&&"[object Window]"==o.call(e)?s(e):r(i(e))}},1850:function(e,t,n){(function(e){var i,r,o;n("ac1f"),n("466d");var a=n("7037");(function(s){"object"==a(t)&&"object"==a(e)?s(n("f3a7")):(r=[n("f3a7")],i=s,o="function"===typeof i?i.apply(t,r):i,void 0===o||(e.exports=o))})((function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,i={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function r(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var a=e.getLineHandle(t.line),l=t.ch-1,c=o&&o.afterCursor;null==c&&(c=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=r(o),d=!c&&l>=0&&u.test(a.text.charAt(l))&&i[a.text.charAt(l)]||u.test(a.text.charAt(l+1))&&i[a.text.charAt(++l)];if(!d)return null;var h=">"==d.charAt(1)?1:-1;if(o&&o.strict&&h>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(n(t.line,l+1)),p=s(e,n(t.line,l+(h>0?1:0)),h,f||null,o);return null==p?null:{from:n(t.line,l),to:p&&p.pos,match:p&&p.ch==d.charAt(0),forward:h>0}}function s(e,t,o,a,s){for(var l=s&&s.maxScanLineLength||1e4,c=s&&s.maxScanLines||1e3,u=[],d=r(s),h=o>0?Math.min(t.line+c,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-c),f=t.line;f!=h;f+=o){var p=e.getLine(f);if(p){var m=o>0?0:p.length-1,g=o>0?p.length:-1;if(!(p.length>l))for(f==t.line&&(m=t.ch-(o<0?1:0));m!=g;m+=o){var v=p.charAt(m);if(d.test(v)&&(void 0===a||e.getTokenTypeAt(n(f,m+1))==a)){var b=i[v];if(b&&">"==b.charAt(1)==o>0)u.push(v);else{if(!u.length)return{pos:n(f,m),ch:v};u.pop()}}}}}return f-o!=(o>0?e.lastLine():e.firstLine())&&null}function l(e,i,r){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c=c?e?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}}},"1a14":function(e,t,n){var i=n("77e9"),r=n("faf5"),o=n("3397"),a=Object.defineProperty;t.f=n("0bad")?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return a(e,t,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},"1b63":function(e,t,n){(function(e){e(n("56b3"),n("7b00"))})((function(e){"use strict";e.defineMode("sass",(function(t){var n=e.mimeModes["text/css"],i=n.propertyKeywords||{},r=n.colorKeywords||{},o=n.valueKeywords||{},a=n.fontProperties||{};function s(e){return new RegExp("^"+e.join("|"))}var l,c=["true","false","null","auto"],u=new RegExp("^"+c.join("|")),d=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],h=s(d),f=/^::?[a-zA-Z_][\w\-]*/;function p(e){return!e.peek()||e.match(/\s+$/,!1)}function m(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=x,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=v(e.next()),"string"):(t.tokenizer=v(")",!1),"string")}function g(e,t){return function(n,i){return n.sol()&&n.indentation()<=e?(i.tokenizer=x,x(n,i)):(t&&n.skipTo("*/")?(n.next(),n.next(),i.tokenizer=x):n.skipToEnd(),"comment")}}function v(e,t){function n(i,r){var o=i.next(),a=i.peek(),s=i.string.charAt(i.pos-2),l="\\"!==o&&a===e||o===e&&"\\"!==s;return l?(o!==e&&t&&i.next(),p(i)&&(r.cursorHalf=0),r.tokenizer=x,"string"):"#"===o&&"{"===a?(r.tokenizer=b(n),i.next(),"operator"):"string"}return null==t&&(t=!0),n}function b(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):x(t,n)}}function y(e){if(0==e.indentCount){e.indentCount++;var n=e.scopes[0].offset,i=n+t.indentUnit;e.scopes.unshift({offset:i})}}function w(e){1!=e.scopes.length&&e.scopes.shift()}function x(e,t){var n=e.peek();if(e.match("/*"))return t.tokenizer=g(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=g(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=b(x),"operator";if('"'===n||"'"===n)return e.next(),t.tokenizer=v(n),"string";if(t.cursorHalf){if("#"===n&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return p(e)&&(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return p(e)&&(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return p(e)&&(t.cursorHalf=0),"unit";if(e.match(u))return p(e)&&(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=m,p(e)&&(t.cursorHalf=0),"atom";if("$"===n)return e.next(),e.eatWhile(/[\w-]/),p(e)&&(t.cursorHalf=0),"variable-2";if("!"===n)return e.next(),t.cursorHalf=0,e.match(/^[\w]+/)?"keyword":"operator";if(e.match(h))return p(e)&&(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return p(e)&&(t.cursorHalf=0),l=e.current().toLowerCase(),o.hasOwnProperty(l)?"atom":r.hasOwnProperty(l)?"keyword":i.hasOwnProperty(l)?(t.prevProp=e.current().toLowerCase(),"property"):"tag";if(p(e))return t.cursorHalf=0,null}else{if("-"===n&&e.match(/^-\w+-/))return"meta";if("."===n){if(e.next(),e.match(/^[\w-]+/))return y(t),"qualifier";if("#"===e.peek())return y(t),"tag"}if("#"===n){if(e.next(),e.match(/^[\w-]+/))return y(t),"builtin";if("#"===e.peek())return y(t),"tag"}if("$"===n)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(u))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=m,"atom";if("="===n&&e.match(/^=[\w-]+/))return y(t),"meta";if("+"===n&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===n&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||w(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return y(t),"def";if("@"===n)return e.next(),e.eatWhile(/[\w-]/),"def";if(e.eatWhile(/[\w-]/)){if(e.match(/ *: *[\w-\+\$#!\("']/,!1)){l=e.current().toLowerCase();var s=t.prevProp+"-"+l;return i.hasOwnProperty(s)?"property":i.hasOwnProperty(l)?(t.prevProp=l,"property"):a.hasOwnProperty(l)?"property":"tag"}return e.match(/ *:/,!1)?(y(t),t.cursorHalf=1,t.prevProp=e.current().toLowerCase(),"property"):(e.match(/ *,/,!1)||y(t),"tag")}if(":"===n)return e.match(f)?"variable-3":(e.next(),t.cursorHalf=1,"operator")}return e.match(h)?"operator":(e.next(),null)}function _(e,n){e.sol()&&(n.indentCount=0);var i=n.tokenizer(e,n),r=e.current();if("@return"!==r&&"}"!==r||w(n),null!==i){for(var o=e.pos-r.length,a=o+t.indentUnit*n.indentCount,s=[],l=0;l=51||!i((function(){var t=[],n=t.constructor={};return n[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},"202b":function(e,t,n){},"219c":function(e,t,n){"use strict";var i=n("ebb5"),r=i.aTypedArray,o=i.exportTypedArrayMethod,a=[].sort;o("sort",(function(e){return a.call(r(this),e)}))},"21cc":function(e,t,n){"use strict";var i=n("b233"),r=n.n(i);r.a},2266:function(e,t,n){var i=n("825a"),r=n("e95a"),o=n("50c4"),a=n("0366"),s=n("35a1"),l=n("9bdd"),c=function(e,t){this.stopped=e,this.result=t},u=e.exports=function(e,t,n,u,d){var h,f,p,m,g,v,b,y=a(t,n,u?2:1);if(d)h=e;else{if(f=s(e),"function"!=typeof f)throw TypeError("Target is not iterable");if(r(f)){for(p=0,m=o(e.length);m>p;p++)if(g=u?y(i(b=e[p])[0],b[1]):y(e[p]),g&&g instanceof c)return g;return new c(!1)}h=f.call(e)}v=h.next;while(!(b=v.call(h)).done)if(g=l(h,y,b.value,u),"object"==_typeof2(g)&&g&&g instanceof c)return g;return new c(!1)};u.stop=function(e){return new c(!0,e)}},"22c0":function(e,t,n){"use strict";var i=n("8b00"),r=n.n(i);r.a},2366:function(e,t){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);function r(e,t){var i=t||0,r=n;return[r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],"-",r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]],r[e[i++]]].join("")}e.exports=r},"23cb":function(e,t,n){var i=n("a691"),r=Math.max,o=Math.min;e.exports=function(e,t){var n=i(e);return n<0?r(n+t,0):o(n,t)}},"23dc":function(e,t,n){var i=n("d44e");i(Math,"Math",!0)},"23e7":function(e,t,n){var i=n("da84"),r=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),l=n("e893"),c=n("94ca");e.exports=function(e,t){var n,u,d,h,f,p,m=e.target,g=e.global,v=e.stat;if(u=g?i:v?i[m]||s(m,{}):(i[m]||{}).prototype,u)for(d in t){if(f=t[d],e.noTargetGet?(p=r(u,d),h=p&&p.value):h=u[d],n=c(g?d:m+(v?".":"#")+d,e.forced),!n&&void 0!==h){if(_typeof2(f)===_typeof2(h))continue;l(f,h)}(e.sham||h&&h.sham)&&o(f,"sham",!0),a(u,d,f,e)}}},"241c":function(e,t,n){var i=n("ca84"),r=n("7839"),o=r.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,o)}},2444:function(e,t,n){"use strict";(function(t){var i=n("c532"),r=n("c8af"),o={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!i.isUndefined(e)&&i.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function s(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t))&&(e=n("b50d")),e}var l={adapter:s(),transformRequest:[function(e,t){return r(t,"Accept"),r(t,"Content-Type"),i.isFormData(e)||i.isArrayBuffer(e)||i.isBuffer(e)||i.isStream(e)||i.isFile(e)||i.isBlob(e)?e:i.isArrayBufferView(e)?e.buffer:i.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):i.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(e){l.headers[e]={}})),i.forEach(["post","put","patch"],(function(e){l.headers[e]=i.merge(o)})),e.exports=l}).call(this,n("4362"))},2532:function(e,t,n){"use strict";var i=n("23e7"),r=n("5a34"),o=n("1d80"),a=n("ab13");i({target:"String",proto:!0,forced:!a("includes")},{includes:function(e){return!!~String(o(this)).indexOf(r(e),arguments.length>1?arguments[1]:void 0)}})},"25a1":function(e,t,n){"use strict";var i=n("ebb5"),r=n("d58f").right,o=i.aTypedArray,a=i.exportTypedArrayMethod;a("reduceRight",(function(e){return r(o(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}))},"25f0":function(e,t,n){"use strict";var i=n("6eeb"),r=n("825a"),o=n("d039"),a=n("ad6d"),s="toString",l=RegExp.prototype,c=l[s],u=o((function(){return"/a/b"!=c.call({source:"a",flags:"b"})})),d=c.name!=s;(u||d)&&i(RegExp.prototype,s,(function(){var e=r(this),t=String(e.source),n=e.flags,i=String(void 0===n&&e instanceof RegExp&&!("flags"in l)?a.call(e):n);return"/"+t+"/"+i}),{unsafe:!0})},2626:function(e,t,n){"use strict";var i=n("d066"),r=n("9bf2"),o=n("b622"),a=n("83ab"),s=o("species");e.exports=function(e){var t=i(e),n=r.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},2638:function(e,t,n){"use strict";function i(){return i=Object.assign||function(e){for(var t,n=1;no)u[o]=n[o++];return u}),u)},"299c":function(e,t,n){n("a4d3"),n("e01a"),n("944a"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("d3b7"),n("ac1f"),n("5319");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=131)}({131:function(e,t,n){"use strict";n.r(t);var i=n(5),r=n.n(i),o=n(17),a=n.n(o),s=n(2),l=n(3),c=n(7),u=n.n(c),d={name:"ElTooltip",mixins:[r.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(l["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new u.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=a()(200,(function(){return e.handleClosePopper()})))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var i=n.data=n.data||{};return i.staticClass=this.addTooltipClass(i.staticClass),n},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(s["on"])(this.referenceElm,"mouseenter",this.show),Object(s["on"])(this.referenceElm,"mouseleave",this.hide),Object(s["on"])(this.referenceElm,"focus",(function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()})),Object(s["on"])(this.referenceElm,"blur",this.handleBlur),Object(s["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(s["addClass"])(this.referenceElm,"focusing"):Object(s["removeClass"])(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?"el-tooltip "+e.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.showPopper=!0}),this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,n=0;nl&&(e.scrollTop=a-e.clientHeight)}else e.scrollTop=0}},"2a95":function(e,t,n){"use strict";(function(e){function n(){return n=Object.assign||function(e){for(var t=1;t=o)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(n){return"[Circular]"}break;default:return e}}));return a}return r}function p(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}function m(e,t){return void 0===e||null===e||!("array"!==t||!Array.isArray(e)||e.length)||!(!p(t)||"string"!==typeof e||e)}function g(e,t,n){var i=[],r=0,o=e.length;function a(e){i.push.apply(i,e),r++,r===o&&n(i)}e.forEach((function(e){t(e,a)}))}function v(e,t,n){var i=0,r=e.length;function o(a){if(a&&a.length)n(a);else{var s=i;i+=1,s()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},O={integer:function(e){return O.number(e)&&parseInt(e,10)===e},float:function(e){return O.number(e)&&!O.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(t){return!1}},date:function(e){return"function"===typeof e.getTime&&"function"===typeof e.getMonth&&"function"===typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"===typeof e},object:function(e){return"object"===_typeof2(e)&&!O.array(e)},method:function(e){return"function"===typeof e},email:function(e){return"string"===typeof e&&!!e.match(S.email)&&e.length<255},url:function(e){return"string"===typeof e&&!!e.match(S.url)},hex:function(e){return"string"===typeof e&&!!e.match(S.hex)}};function T(e,t,n,i,r){if(e.required&&void 0===t)k(e,t,n,i,r);else{var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=e.type;o.indexOf(a)>-1?O[a](t)||i.push(f(r.messages.types[a],e.fullField,e.type)):a&&_typeof2(t)!==e.type&&i.push(f(r.messages.types[a],e.fullField,e.type))}}function E(e,t,n,i,r){var o="number"===typeof e.len,a="number"===typeof e.min,s="number"===typeof e.max,l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=t,u=null,d="number"===typeof t,h="string"===typeof t,p=Array.isArray(t);if(d?u="number":h?u="string":p&&(u="array"),!u)return!1;p&&(c=t.length),h&&(c=t.replace(l,"_").length),o?c!==e.len&&i.push(f(r.messages[u].len,e.fullField,e.len)):a&&!s&&ce.max?i.push(f(r.messages[u].max,e.fullField,e.max)):a&&s&&(ce.max)&&i.push(f(r.messages[u].range,e.fullField,e.min,e.max))}var D="enum";function M(e,t,n,i,r){e[D]=Array.isArray(e[D])?e[D]:[],-1===e[D].indexOf(t)&&i.push(f(r.messages[D],e.fullField,e[D].join(", ")))}function A(e,t,n,i,r){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(f(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"===typeof e.pattern){var o=new RegExp(e.pattern);o.test(t)||i.push(f(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}var N={required:k,whitespace:C,type:T,range:E,enum:M,pattern:A};function I(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t,"string")&&!e.required)return n();N.required(e,t,i,o,r,"string"),m(t,"string")||(N.type(e,t,i,o,r),N.range(e,t,i,o,r),N.pattern(e,t,i,o,r),!0===e.whitespace&&N.whitespace(e,t,i,o,r))}n(o)}function L(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&N.type(e,t,i,o,r)}n(o)}function P(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(""===t&&(t=void 0),m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&(N.type(e,t,i,o,r),N.range(e,t,i,o,r))}n(o)}function $(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&N.type(e,t,i,o,r)}n(o)}function F(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),m(t)||N.type(e,t,i,o,r)}n(o)}function j(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&(N.type(e,t,i,o,r),N.range(e,t,i,o,r))}n(o)}function z(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&(N.type(e,t,i,o,r),N.range(e,t,i,o,r))}n(o)}function B(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t,"array")&&!e.required)return n();N.required(e,t,i,o,r,"array"),m(t,"array")||(N.type(e,t,i,o,r),N.range(e,t,i,o,r))}n(o)}function R(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&N.type(e,t,i,o,r)}n(o)}var V="enum";function H(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r),void 0!==t&&N[V](e,t,i,o,r)}n(o)}function W(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t,"string")&&!e.required)return n();N.required(e,t,i,o,r),m(t,"string")||N.pattern(e,t,i,o,r)}n(o)}function q(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t,"date")&&!e.required)return n();var s;N.required(e,t,i,o,r),m(t,"date")||(s=t instanceof Date?t:new Date(t),N.type(e,s,i,o,r),s&&N.range(e,s.getTime(),i,o,r))}n(o)}function U(e,t,n,i,r){var o=[],a=Array.isArray(t)?"array":_typeof2(t);N.required(e,t,i,o,r,a),n(o)}function K(e,t,n,i,r){var o=e.type,a=[],s=e.required||!e.required&&i.hasOwnProperty(e.field);if(s){if(m(t,o)&&!e.required)return n();N.required(e,t,i,a,r,o),m(t,o)||N.type(e,t,i,a,r)}n(a)}function G(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(m(t)&&!e.required)return n();N.required(e,t,i,o,r)}n(o)}var Y={string:I,method:L,number:P,boolean:$,regexp:F,integer:j,float:z,array:B,object:R,enum:H,pattern:W,date:q,url:K,hex:K,email:K,required:U,any:G};function X(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Z=X();function Q(e){this.rules=null,this._messages=Z,this.define(e)}Q.prototype={messages:function(e){return e&&(this._messages=_(X(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==_typeof2(e)||Array.isArray(e))throw new Error("Rules must be an object");var t,n;for(t in this.rules={},e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e,t,i){var r=this;void 0===t&&(t={}),void 0===i&&(i=function(){});var o,a,s=e,l=t,c=i;if("function"===typeof l&&(c=l,l={}),!this.rules||0===Object.keys(this.rules).length)return c&&c(),Promise.resolve();function u(e){var t,n=[],i={};function r(e){var t;Array.isArray(e)?n=(t=n).concat.apply(t,e):n.push(e)}for(t=0;t4)return e;for(n=[],i=0;i1&&"0"==r.charAt(0)&&(o=I.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)a=0;else{if(!(10==o?P:8==o?L:$).test(r))return e;a=parseInt(r,o)}n.push(a)}for(i=0;i=S(256,5-t))return null}else if(a>255)return null;for(s=n.pop(),i=0;i6)return;i=0;while(h()){if(r=null,i>0){if(!("."==h()&&i<4))return;d++}if(!N.test(h()))return;while(N.test(h())){if(o=parseInt(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;d++}l[c]=256*l[c]+r,i++,2!=i&&4!=i||c++}if(4!=i)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;l[c++]=t}else{if(null!==u)return;d++,c++,u=c}}if(null!==u){a=c-u,c=7;while(0!=c&&a>0)s=l[c],l[c--]=l[u+a-1],l[u+--a]=s}else if(8!=c)return;return l},W=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t},q=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=C(e/256);return t.join(".")}if("object"==_typeof2(e)){for(t="",i=W(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},U={},K=h({},U,{" ":1,'"':1,"<":1,">":1,"`":1}),G=h({},K,{"#":1,"?":1,"{":1,"}":1}),Y=h({},G,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),X=function(e,t){var n=p(e,0);return n>32&&n<127&&!d(t,e)?e:encodeURIComponent(e)},Z={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Q=function(e){return d(Z,e.scheme)},J=function(e){return""!=e.username||""!=e.password},ee=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},te=function(e,t){var n;return 2==e.length&&M.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},ne=function(e){var t;return e.length>1&&te(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},ie=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&te(t[0],!0)||t.pop()},re=function(e){return"."===e||"%2e"===e.toLowerCase()},oe=function(e){return e=e.toLowerCase(),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},ae={},se={},le={},ce={},ue={},de={},he={},fe={},pe={},me={},ge={},ve={},be={},ye={},we={},xe={},_e={},ke={},Ce={},Se={},Oe={},Te=function(e,t,n,r){var o,a,s,l,c=n||ae,u=0,h="",p=!1,m=!1,g=!1;n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(z,"")),t=t.replace(B,""),o=f(t);while(u<=o.length){switch(a=o[u],c){case ae:if(!a||!M.test(a)){if(n)return T;c=le;continue}h+=a.toLowerCase(),c=se;break;case se:if(a&&(A.test(a)||"+"==a||"-"==a||"."==a))h+=a.toLowerCase();else{if(":"!=a){if(n)return T;h="",c=le,u=0;continue}if(n&&(Q(e)!=d(Z,h)||"file"==h&&(J(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=h,n)return void(Q(e)&&Z[e.scheme]==e.port&&(e.port=null));h="","file"==e.scheme?c=ye:Q(e)&&r&&r.scheme==e.scheme?c=ce:Q(e)?c=fe:"/"==o[u+1]?(c=ue,u++):(e.cannotBeABaseURL=!0,e.path.push(""),c=Ce)}break;case le:if(!r||r.cannotBeABaseURL&&"#"!=a)return T;if(r.cannotBeABaseURL&&"#"==a){e.scheme=r.scheme,e.path=r.path.slice(),e.query=r.query,e.fragment="",e.cannotBeABaseURL=!0,c=Oe;break}c="file"==r.scheme?ye:de;continue;case ce:if("/"!=a||"/"!=o[u+1]){c=de;continue}c=pe,u++;break;case ue:if("/"==a){c=me;break}c=ke;continue;case de:if(e.scheme=r.scheme,a==i)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query;else if("/"==a||"\\"==a&&Q(e))c=he;else if("?"==a)e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query="",c=Se;else{if("#"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.path.pop(),c=ke;continue}e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=Oe}break;case he:if(!Q(e)||"/"!=a&&"\\"!=a){if("/"!=a){e.username=r.username,e.password=r.password,e.host=r.host,e.port=r.port,c=ke;continue}c=me}else c=pe;break;case fe:if(c=pe,"/"!=a||"/"!=h.charAt(u+1))continue;u++;break;case pe:if("/"!=a&&"\\"!=a){c=me;continue}break;case me:if("@"==a){p&&(h="%40"+h),p=!0,s=f(h);for(var v=0;v65535)return D;e.port=Q(e)&&w===Z[e.scheme]?null:w,h=""}if(n)return;c=_e;continue}return D}h+=a;break;case ye:if(e.scheme="file","/"==a||"\\"==a)c=we;else{if(!r||"file"!=r.scheme){c=ke;continue}if(a==i)e.host=r.host,e.path=r.path.slice(),e.query=r.query;else if("?"==a)e.host=r.host,e.path=r.path.slice(),e.query="",c=Se;else{if("#"!=a){ne(o.slice(u).join(""))||(e.host=r.host,e.path=r.path.slice(),ie(e)),c=ke;continue}e.host=r.host,e.path=r.path.slice(),e.query=r.query,e.fragment="",c=Oe}}break;case we:if("/"==a||"\\"==a){c=xe;break}r&&"file"==r.scheme&&!ne(o.slice(u).join(""))&&(te(r.path[0],!0)?e.path.push(r.path[0]):e.host=r.host),c=ke;continue;case xe:if(a==i||"/"==a||"\\"==a||"?"==a||"#"==a){if(!n&&te(h))c=ke;else if(""==h){if(e.host="",n)return;c=_e}else{if(l=R(e,h),l)return l;if("localhost"==e.host&&(e.host=""),n)return;h="",c=_e}continue}h+=a;break;case _e:if(Q(e)){if(c=ke,"/"!=a&&"\\"!=a)continue}else if(n||"?"!=a)if(n||"#"!=a){if(a!=i&&(c=ke,"/"!=a))continue}else e.fragment="",c=Oe;else e.query="",c=Se;break;case ke:if(a==i||"/"==a||"\\"==a&&Q(e)||!n&&("?"==a||"#"==a)){if(oe(h)?(ie(e),"/"==a||"\\"==a&&Q(e)||e.path.push("")):re(h)?"/"==a||"\\"==a&&Q(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&te(h)&&(e.host&&(e.host=""),h=h.charAt(0)+":"),e.path.push(h)),h="","file"==e.scheme&&(a==i||"?"==a||"#"==a))while(e.path.length>1&&""===e.path[0])e.path.shift();"?"==a?(e.query="",c=Se):"#"==a&&(e.fragment="",c=Oe)}else h+=X(a,G);break;case Ce:"?"==a?(e.query="",c=Se):"#"==a?(e.fragment="",c=Oe):a!=i&&(e.path[0]+=X(a,U));break;case Se:n||"#"!=a?a!=i&&("'"==a&&Q(e)?e.query+="%27":e.query+="#"==a?"%23":X(a,U)):(e.fragment="",c=Oe);break;case Oe:a!=i&&(e.fragment+=X(a,K));break}u++}},Ee=function e(t){var n,i,r=u(this,e,"URL"),a=arguments.length>1?arguments[1]:void 0,s=String(t),l=_(r,{type:"URL"});if(void 0!==a)if(a instanceof e)n=k(a);else if(i=Te(n={},String(a)),i)throw TypeError(i);if(i=Te(l,s,null,n),i)throw TypeError(i);var c=l.searchParams=new w,d=x(c);d.updateSearchParams(l.query),d.updateURL=function(){l.query=String(c)||null},o||(r.href=Me.call(r),r.origin=Ae.call(r),r.protocol=Ne.call(r),r.username=Ie.call(r),r.password=Le.call(r),r.host=Pe.call(r),r.hostname=$e.call(r),r.port=Fe.call(r),r.pathname=je.call(r),r.search=ze.call(r),r.searchParams=Be.call(r),r.hash=Re.call(r))},De=Ee.prototype,Me=function(){var e=k(this),t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,a=e.path,s=e.query,l=e.fragment,c=t+":";return null!==r?(c+="//",J(e)&&(c+=n+(i?":"+i:"")+"@"),c+=q(r),null!==o&&(c+=":"+o)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?a[0]:a.length?"/"+a.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},Ae=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(i){return"null"}return"file"!=t&&Q(e)?t+"://"+q(e.host)+(null!==n?":"+n:""):"null"},Ne=function(){return k(this).scheme+":"},Ie=function(){return k(this).username},Le=function(){return k(this).password},Pe=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?q(t):q(t)+":"+n},$e=function(){var e=k(this).host;return null===e?"":q(e)},Fe=function(){var e=k(this).port;return null===e?"":String(e)},je=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},ze=function(){var e=k(this).query;return e?"?"+e:""},Be=function(){return k(this).searchParams},Re=function(){var e=k(this).fragment;return e?"#"+e:""},Ve=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(o&&l(De,{href:Ve(Me,(function(e){var t=k(this),n=String(e),i=Te(t,n);if(i)throw TypeError(i);x(t.searchParams).updateSearchParams(t.query)})),origin:Ve(Ae),protocol:Ve(Ne,(function(e){var t=k(this);Te(t,String(e)+":",ae)})),username:Ve(Ie,(function(e){var t=k(this),n=f(String(e));if(!ee(t)){t.username="";for(var i=0;in)t.push(arguments[n++]);return w[++y]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},i(y),y},m=function(e){delete w[e]},"process"==l(g)?i=function(e){g.nextTick(k(e))}:b&&b.now?i=function(e){b.now(k(e))}:v&&!h?(r=new v,o=r.port2,r.port1.onmessage=C,i=c(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(S)||"file:"===f.protocol?i=x in d("script")?function(e){u.appendChild(d("script"))[x]=function(){u.removeChild(this),_(e)}}:function(e){setTimeout(k(e),0)}:(i=S,a.addEventListener("message",C,!1))),e.exports={set:p,clear:m}},"2d00":function(e,t,n){var i,r,o=n("da84"),a=n("342f"),s=o.process,l=s&&s.versions,c=l&&l.v8;c?(i=c.split("."),r=i[0]+i[1]):a&&(i=a.match(/Edge\/(\d+)/),(!i||i[1]>=74)&&(i=a.match(/Chrome\/(\d+)/),i&&(r=i[1]))),e.exports=r&&+r},"2d83":function(e,t,n){"use strict";var i=n("387f");e.exports=function(e,t,n,r,o){var a=new Error(e);return i(a,t,n,r,o)}},"2e67":function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},"2f9a":function(e,t){e.exports=function(){}},"301c":function(e,t,n){n("e198")("asyncIterator")},"30b5":function(e,t,n){"use strict";var i=n("c532");function r(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var o;if(n)o=n(t);else if(i.isURLSearchParams(t))o=t.toString();else{var a=[];i.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(i.isArray(e)?t+="[]":e=[e],i.forEach(e,(function(e){i.isDate(e)?e=e.toISOString():i.isObject(e)&&(e=JSON.stringify(e)),a.push(r(t)+"="+r(e))})))})),o=a.join("&")}if(o){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}},3106:function(e,t,n){"use strict";var i=n("c2a2"),r=n.n(i);r.a},3280:function(e,t,n){"use strict";var i=n("ebb5"),r=n("e58c"),o=i.aTypedArray,a=i.exportTypedArrayMethod;a("lastIndexOf",(function(e){return r.apply(o(this),arguments)}))},3397:function(e,t,n){var i=n("7a41");e.exports=function(e,t){if(!i(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!i(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!i(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")}},3410:function(e,t,n){var i=n("23e7"),r=n("d039"),o=n("7b0b"),a=n("e163"),s=n("e177"),l=r((function(){a(1)}));i({target:"Object",stat:!0,forced:l,sham:!s},{getPrototypeOf:function(e){return a(o(e))}})},"342f":function(e,t,n){var i=n("d066");e.exports=i("navigator","userAgent")||""},"35a1":function(e,t,n){var i=n("f5df"),r=n("3f8c"),o=n("b622"),a=o("iterator");e.exports=function(e){if(void 0!=e)return e[a]||e["@@iterator"]||r[i(e)]}},"37bc":function(e,t,n){"use strict";var i=n("60cf"),r=n.n(i);r.a},"37e8":function(e,t,n){var i=n("83ab"),r=n("9bf2"),o=n("825a"),a=n("df75");e.exports=i?Object.defineProperties:function(e,t){o(e);var n,i=a(t),s=i.length,l=0;while(s>l)r.f(e,n=i[l++],t[n]);return e}},"387f":function(e,t,n){"use strict";e.exports=function(e,t,n,i,r){return e.config=t,n&&(e.code=n),e.request=i,e.response=r,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},"391a":function(e,t,n){},"391f":function(e,t,n){},3934:function(e,t,n){"use strict";var i=n("c532");e.exports=i.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var i=e;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=i.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return function(){return!0}}()},"393a":function(e,t,n){"use strict";var i=n("e444"),r=n("512c"),o=n("ba01"),a=n("051b"),s=n("8a0d"),l=n("26dd"),c=n("92f0"),u=n("ce7a"),d=n("cc15")("iterator"),h=!([].keys&&"next"in[].keys()),f="@@iterator",p="keys",m="values",g=function(){return this};e.exports=function(e,t,n,v,b,y,w){l(n,t,v);var x,_,k,C=function(e){if(!h&&e in E)return E[e];switch(e){case p:return function(){return new n(this,e)};case m:return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",O=b==m,T=!1,E=e.prototype,D=E[d]||E[f]||b&&E[b],M=D||C(b),A=b?O?C("entries"):M:void 0,N="Array"==t&&E.entries||D;if(N&&(k=u(N.call(new e)),k!==Object.prototype&&k.next&&(c(k,S,!0),i||"function"==typeof k[d]||a(k,d,g))),O&&D&&D.name!==m&&(T=!0,M=function(){return D.call(this)}),i&&!w||!h&&!T&&E[d]||a(E,d,M),s[t]=M,s[S]=g,b)if(x={values:O?M:C(m),keys:y?M:C(p),entries:A},w)for(_ in x)_ in E||o(E,_,x[_]);else r(r.P+r.F*(h||T),t,x);return x}},"39ad":function(e,t,n){var i=n("6ca1"),r=n("d16a"),o=n("9d11");e.exports=function(e){return function(t,n,a){var s,l=i(t),c=r(l.length),u=o(a,c);if(e&&n!=n){while(c>u)if(s=l[u++],s!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}}},"3a7b":function(e,t,n){"use strict";var i=n("ebb5"),r=n("b727").findIndex,o=i.aTypedArray,a=i.exportTypedArrayMethod;a("findIndex",(function(e){return r(o(this),e,arguments.length>1?arguments[1]:void 0)}))},"3bbe":function(e,t,n){var i=n("861d");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"3c47":function(e,t,n){(function(e){var i,r,o;n("c975"),n("a15b"),n("fb6a"),n("b0c0"),n("d3b7"),n("4d63"),n("ac1f"),n("25f0"),n("466d"),n("5319"),n("1276");var a=n("7037");(function(s){"object"==a(t)&&"object"==a(e)?s(n("f3a7"),n("79ef")):(r=[n("f3a7"),n("79ef")],i=s,o="function"===typeof i?i.apply(t,r):i,void 0===o||(e.exports=o))})((function(e){"use strict";var t,n,i,r,o={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},s=e.Pos,l=e.cmpPos;function c(e){return"[object Array]"==Object.prototype.toString.call(e)}function u(t){var n=t.doc.modeOption;return"awsAt"===n&&(n="awsAt"),e.resolveMode(n).keywords}function d(t){var n=t.doc.modeOption;return"sql"===n&&(n="text/x-sql"),e.resolveMode(n).identifierQuote||"`"}function h(e){return"string"==typeof e?e:e.text}function f(e,t){return c(t)&&(t={columns:t}),t.text||(t.text=e),t}function p(e){var t={};if(c(e))for(var n=e.length-1;n>=0;n--){var i=e[n];t[h(i).toUpperCase()]=f(h(i),i)}else if(e)for(var r in e)t[r.toUpperCase()]=f(r,e[r]);return t}function m(e){return t[e.toUpperCase()]}function g(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function v(e,t){var n=e.length,i=h(t).substr(0,n);return e.toUpperCase()===i.toUpperCase()}function b(e,t,n,i){if(n)for(var r in n)if(n.hasOwnProperty(r)){var o=n[r];o&&v(t,r)&&(-1===r.indexOf("@")?e.push(i(o.name,null,o.id)):e.push(i(o.key+" - "+o.title,null,o.key)))}}function y(e){"."==e.charAt(0)&&(e=e.substr(1));for(var t=e.split(r+r),n=0;n0)&&l(p,u[g])<=0){d={start:f,end:u[g]};break}f=u[g]}if(d.start){var v=n.getRange(d.start,d.end,!1);for(g=0;gv.ch&&(w.end=v.ch,w.string=w.string.slice(0,v.ch-w.start)),w.string.match(/^[.`"\w@]\w*$/)?(g=w.string,h=w.start,f=w.end):(h=f=v.ch,g=""),0!==g.length)return"."==g.charAt(0)||g.charAt(0)==r?h=x(v,w,y,e):(b(y,g,n,(function(e){return{text:e,className:"CodeMirror-hint-table CodeMirror-hint-default-table"}})),b(y,g,t,(function(e){return"object"===a(e)?e.className="CodeMirror-hint-table":e={text:e,className:"CodeMirror-hint-table"},e})),c||b(y,g,i,(function(e,t,n){return{text:e,className:"CodeMirror-hint-keyword",desc:t,key:n}}))),{list:y,from:s(v.line,h),to:s(v.line,f)}}))}))}).call(this,n("62e4")(e))},"3c4e":function(e,t,n){"use strict";var i=function(e){return r(e)&&!o(e)};function r(e){return!!e&&"object"===_typeof2(e)}function o(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||l(e)}var a="function"===typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103;function l(e){return e.$$typeof===s}function c(e){return Array.isArray(e)?[]:{}}function u(e,t){var n=t&&!0===t.clone;return n&&i(e)?f(c(e),e,t):e}function d(e,t,n){var r=e.slice();return t.forEach((function(t,o){"undefined"===typeof r[o]?r[o]=u(t,n):i(t)?r[o]=f(e[o],t,n):-1===e.indexOf(t)&&r.push(u(t,n))})),r}function h(e,t,n){var r={};return i(e)&&Object.keys(e).forEach((function(t){r[t]=u(e[t],n)})),Object.keys(t).forEach((function(o){i(t[o])&&e[o]?r[o]=f(e[o],t[o],n):r[o]=u(t[o],n)})),r}function f(e,t,n){var i=Array.isArray(t),r=Array.isArray(e),o=n||{arrayMerge:d},a=i===r;if(a){if(i){var s=o.arrayMerge||d;return s(e,t,n)}return h(e,t,n)}return u(t,n)}f.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return f(e,n,t)}))};var p=f;e.exports=p},"3c5d":function(e,t,n){"use strict";var i=n("ebb5"),r=n("50c4"),o=n("182d"),a=n("7b0b"),s=n("d039"),l=i.aTypedArray,c=i.exportTypedArrayMethod,u=s((function(){new Int8Array(1).set({})}));c("set",(function(e){l(this);var t=o(arguments.length>1?arguments[1]:void 0,1),n=this.length,i=a(e),s=r(i.length),c=0;if(s+t>n)throw RangeError("Wrong length");while(c=n.length?{value:void 0,done:!0}:(e=i(n,r),t.index+=e.length,{value:e,done:!1})}))},"3d56":function(e,t,n){},"3f6b":function(e,t,n){e.exports={default:n("b9c7"),__esModule:!0}},"3f8c":function(e,t){e.exports={}},"3fcc":function(e,t,n){"use strict";var i=n("ebb5"),r=n("b727").map,o=n("4840"),a=i.aTypedArray,s=i.aTypedArrayConstructor,l=i.exportTypedArrayMethod;l("map",(function(e){return r(a(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(s(o(e,e.constructor)))(t)}))}))},4010:function(e,t,n){"use strict";n("a4d3"),n("e01a"),n("d28b"),n("4160"),n("c975"),n("e260"),n("a434"),n("d3b7"),n("3ca3"),n("159b"),n("ddb0"),t.__esModule=!0,t.removeResizeListener=t.addResizeListener=void 0;var i=n("6dd8"),r=o(i);function o(e){return e&&e.__esModule?e:{default:e}}var a="undefined"===typeof window,s=function(e){var t=e,n=Array.isArray(t),i=0;for(t=n?t:t[Symbol.iterator]();;){var r;if(n){if(i>=t.length)break;r=t[i++]}else{if(i=t.next(),i.done)break;r=i.value}var o=r,a=o.target.__resizeListeners__||[];a.length&&a.forEach((function(e){e()}))}};t.addResizeListener=function(e,t){a||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new r.default(s),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},t.removeResizeListener=function(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||e.__ro__.disconnect())}},"408a":function(e,t,n){var i=n("c6b6");e.exports=function(e){if("number"!=typeof e&&"Number"!=i(e))throw TypeError("Incorrect invocation");return+e}},4127:function(e,t,n){"use strict";var i=n("d233"),r=n("b313"),o={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},a=Date.prototype.toISOString,s={delimiter:"&",encode:!0,encoder:i.encode,encodeValuesOnly:!1,serializeDate:function(e){return a.call(e)},skipNulls:!1,strictNullHandling:!1},l=function e(t,n,r,o,a,l,c,u,d,h,f,p){var m=t;if("function"===typeof c)m=c(n,m);else if(m instanceof Date)m=h(m);else if(null===m){if(o)return l&&!p?l(n,s.encoder):n;m=""}if("string"===typeof m||"number"===typeof m||"boolean"===typeof m||i.isBuffer(m)){if(l){var g=p?n:l(n,s.encoder);return[f(g)+"="+f(l(m,s.encoder))]}return[f(n)+"="+f(String(m))]}var v,b=[];if("undefined"===typeof m)return b;if(Array.isArray(c))v=c;else{var y=Object.keys(m);v=u?y.sort(u):y}for(var w=0;w0?T+O:""}},4160:function(e,t,n){"use strict";var i=n("23e7"),r=n("17c2");i({target:"Array",proto:!0,forced:[].forEach!=r},{forEach:r})},"417f":function(e,t,n){"use strict";n("4160"),n("a434"),t.__esModule=!0;var i=n("8bbf"),r=a(i),o=n("5924");function a(e){return e&&e.__esModule?e:{default:e}}var s=[],l="@@clickoutsideContext",c=void 0,u=0;function d(e,t,n){return function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(n&&n.context&&i.target&&r.target)||e.contains(i.target)||e.contains(r.target)||e===i.target||n.context.popperElm&&(n.context.popperElm.contains(i.target)||n.context.popperElm.contains(r.target))||(t.expression&&e[l].methodName&&n.context[e[l].methodName]?n.context[e[l].methodName]():e[l].bindingFn&&e[l].bindingFn())}}!r.default.prototype.$isServer&&(0,o.on)(document,"mousedown",(function(e){return c=e})),!r.default.prototype.$isServer&&(0,o.on)(document,"mouseup",(function(e){s.forEach((function(t){return t[l].documentHandler(e,c)}))})),t.default={bind:function(e,t,n){s.push(e);var i=u++;e[l]={id:i,documentHandler:d(e,t,n),methodName:t.expression,bindingFn:t.value}},update:function(e,t,n){e[l].documentHandler=d(e,t,n),e[l].methodName=t.expression,e[l].bindingFn=t.value},unbind:function(e){for(var t=s.length,n=0;n1?arguments[1]:void 0)}})},"466d":function(e,t,n){"use strict";var i=n("d784"),r=n("825a"),o=n("50c4"),a=n("1d80"),s=n("8aa5"),l=n("14c3");i("match",1,(function(e,t,n){return[function(t){var n=a(this),i=void 0==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var a=r(e),c=String(this);if(!a.global)return l(a,c);var u=a.unicode;a.lastIndex=0;var d,h=[],f=0;while(null!==(d=l(a,c))){var p=String(d[0]);h[f]=p,""===p&&(a.lastIndex=s(c,o(a.lastIndex),u)),f++}return 0===f?null:h}]}))},"467f":function(e,t,n){"use strict";var i=n("2d83");e.exports=function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(i("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},4726:function(e,t,n){n("a4d3"),n("e01a"),n("944a"),n("99af"),n("a623"),n("4de4"),n("4160"),n("c975"),n("e260"),n("a15b"),n("d81d"),n("13d5"),n("fb6a"),n("45fc"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("cca6"),n("d3b7"),n("ac1f"),n("1276"),n("159b"),n("ddb0");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=59)}({0:function(e,t,n){"use strict";function i(e,t,n,i,r,o,a,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},14:function(e,t){e.exports=n("14e9")},18:function(e,t){e.exports=n("dcdc")},21:function(e,t){e.exports=n("d397")},26:function(e,t){e.exports=n("92fa")},3:function(e,t){e.exports=n("8122")},31:function(e,t){e.exports=n("2a5e")},32:function(e,t){e.exports=n("e452")},51:function(e,t){e.exports=n("f494")},59:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["el-cascader-panel",e.border&&"is-bordered"],on:{keydown:e.handleKeyDown}},e._l(e.menus,(function(e,t){return n("cascader-menu",{key:t,ref:"menu",refInFor:!0,attrs:{index:t,nodes:e}})})),1)},r=[];i._withStripped=!0;var o,a,s=n(26),l=n.n(s),c=n(14),u=n.n(c),d=n(18),h=n.n(d),f=n(51),p=n.n(f),m=n(3),g=function(e){return e.stopPropagation()},v={inject:["panel"],components:{ElCheckbox:h.a,ElRadio:p.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var e=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some((function(t){return e.isInPath(t)}))},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var e=this,t=this.panel,n=this.node,i=this.isDisabled,r=this.config,o=r.multiple,a=r.checkStrictly;!a&&i||n.loading||(r.lazy&&!n.loaded?t.lazyLoad(n,(function(){var t=e.isLeaf;if(t||e.handleExpand(),o){var i=!!t&&n.checked;e.handleMultiCheckChange(i)}})):t.handleExpand(n))},handleCheckChange:function(){var e=this.panel,t=this.value,n=this.node;e.handleCheckChange(t),e.handleExpand(n)},handleMultiCheckChange:function(e){this.node.doCheck(e),this.panel.calculateMultiCheckedValue()},isInPath:function(e){var t=this.node,n=e[t.level-1]||{};return n.uid===t.uid},renderPrefix:function(e){var t=this.isLeaf,n=this.isChecked,i=this.config,r=i.checkStrictly,o=i.multiple;return o?this.renderCheckbox(e):r?this.renderRadio(e):t&&n?this.renderCheckIcon(e):null},renderPostfix:function(e){var t=this.node,n=this.isLeaf;return t.loading?this.renderLoadingIcon(e):n?null:this.renderExpandIcon(e)},renderCheckbox:function(e){var t=this.node,n=this.config,i=this.isDisabled,r={on:{change:this.handleMultiCheckChange},nativeOn:{}};return n.checkStrictly&&(r.nativeOn.click=g),e("el-checkbox",l()([{attrs:{value:t.checked,indeterminate:t.indeterminate,disabled:i}},r]))},renderRadio:function(e){var t=this.checkedValue,n=this.value,i=this.isDisabled;return Object(m["isEqual"])(n,t)&&(n=t),e("el-radio",{attrs:{value:t,label:n,disabled:i},on:{change:this.handleCheckChange},nativeOn:{click:g}},[e("span")])},renderCheckIcon:function(e){return e("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(e){return e("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(e){return e("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(e){var t=this.panel,n=this.node,i=t.renderLabelFn,r=i?i({node:n,data:n.data}):null;return e("span",{class:"el-cascader-node__label"},[r||n.label])}},render:function(e){var t=this,n=this.inActivePath,i=this.inCheckedPath,r=this.isChecked,o=this.isLeaf,a=this.isDisabled,s=this.config,c=this.nodeId,u=s.expandTrigger,d=s.checkStrictly,h=s.multiple,f=!d&&a,p={on:{}};return"click"===u?p.on.click=this.handleExpand:(p.on.mouseenter=function(e){t.handleExpand(),t.$emit("expand",e)},p.on.focus=function(e){t.handleExpand(),t.$emit("expand",e)}),!o||a||d||h||(p.on.click=this.handleCheckChange),e("li",l()([{attrs:{role:"menuitem",id:c,"aria-expanded":n,tabindex:f?null:-1},class:{"el-cascader-node":!0,"is-selectable":d,"in-active-path":n,"in-checked-path":i,"is-active":r,"is-disabled":f}},p]),[this.renderPrefix(e),this.renderContent(e),this.renderPostfix(e)])}},b=v,y=n(0),w=Object(y["a"])(b,o,a,!1,null,null,null);w.options.__file="packages/cascader-panel/src/cascader-node.vue";var x,_,k=w.exports,C=n(6),S=n.n(C),O={name:"ElCascaderMenu",mixins:[S.a],inject:["panel"],components:{ElScrollbar:u.a,CascaderNode:k},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(m["generateId"])()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(e){this.activeNode=e.target},handleMouseMove:function(e){var t=this.activeNode,n=this.hoverTimer,i=this.$refs.hoverZone;if(t&&i)if(t.contains(e.target)){clearTimeout(n);var r=this.$el.getBoundingClientRect(),o=r.left,a=e.clientX-o,s=this.$el,l=s.offsetWidth,c=s.offsetHeight,u=t.offsetTop,d=u+t.offsetHeight;i.innerHTML='\n \n \n '}else n||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,n=this.panel.isHoverMenu,i={on:{}};n&&(i.on.expand=this.handleExpand);var r=this.nodes.map((function(n,r){var o=n.hasChildren;return e("cascader-node",l()([{key:n.uid,attrs:{node:n,"node-id":t+"-"+r,"aria-haspopup":o,"aria-owns":o?t:null}},i]))}));return[].concat(r,[n?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,n=this.menuId,i={nativeOn:{}};return this.panel.isHoverMenu&&(i.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",l()([{attrs:{tag:"ul",role:"menu",id:n,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},i]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},T=O,E=Object(y["a"])(T,x,_,!1,null,null,null);E.options.__file="packages/cascader-panel/src/cascader-menu.vue";var D=E.exports,M=n(21),A=function(){function e(e,t){for(var n=0;n1?t-1:0),i=1;i1?i-1:0),o=1;o0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),n=this.isSameNode(e,t);this.doCheck(n)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},A(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,n=this.config,i=n.disabled,r=n.checkStrictly;return e[i]||!r&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,n=this.hasChildren,i=this.children,r=this.config,o=r.lazy,a=r.leaf;if(o){var s=Object(M["isDef"])(e[a])?e[a]:!!t&&!i.length;return this.hasChildren=!s,s}return!n}}]),e}(),P=L;function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var F=function e(t,n){return t.reduce((function(t,i){return i.isLeaf?t.push(i):(!n&&t.push(i),t=t.concat(e(i.children,n))),t}),[])},j=function(){function e(t,n){$(this,e),this.config=n,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(m["coerceTruthyValueToArray"])(e),this.nodes=e.map((function(e){return new P(e,t.config)})),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var n=new P(e,this.config,t),i=t?t.children:this.nodes;i.push(n)},e.prototype.appendNodes=function(e,t){var n=this;e=Object(m["coerceTruthyValueToArray"])(e),e.forEach((function(e){return n.appendNode(e,t)}))},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e?this.leafNodes:this.flattedNodes;return t?n:F(this.nodes,e)},e.prototype.getNodeByValue=function(e){if(e){var t=this.getFlattedNodes(!1,!this.config.lazy).filter((function(t){return Object(m["valueEquals"])(t.path,e)||t.value===e}));return t&&t.length?t[0]:null}return null},e}(),z=j,B=n(9),R=n.n(B),V=n(32),H=n.n(V),W=n(31),q=n.n(W),U=Object.assign||function(e){for(var t=1;t0){var l=n.store.getNodeByValue(o);l.data[s]||n.lazyLoad(l,(function(){n.handleExpand(l)})),n.loadCount===n.checkedValue.length&&n.$parent.computePresentText()}}t&&t(i)};i.lazyLoad(e,r)},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map((function(e){return e.getValueByOption()}))},scrollIntoView:function(){if(!this.$isServer){var e=this.$refs.menu||[];e.forEach((function(e){var t=e.$el;if(t){var n=t.querySelector(".el-scrollbar__wrap"),i=t.querySelector(".el-cascader-node.is-active")||t.querySelector(".el-cascader-node.in-active-path");q()(n,i)}}))}},getNodeByValue:function(e){return this.store.getNodeByValue(e)},getFlattedNodes:function(e){var t=!this.config.lazy;return this.store.getFlattedNodes(e,t)},getCheckedNodes:function(e){var t=this.checkedValue,n=this.multiple;if(n){var i=this.getFlattedNodes(e);return i.filter((function(e){return e.checked}))}return Object(m["isEmpty"])(t)?[]:[this.getNodeByValue(t)]},clearCheckedNodes:function(){var e=this.config,t=this.leafOnly,n=e.multiple,i=e.emitPath;n?(this.getCheckedNodes(t).filter((function(e){return!e.isDisabled})).forEach((function(e){return e.doCheck(!1)})),this.calculateMultiCheckedValue()):this.checkedValue=i?[]:null}}},te=ee,ne=Object(y["a"])(te,i,r,!1,null,null,null);ne.options.__file="packages/cascader-panel/src/cascader-panel.vue";var ie=ne.exports;ie.install=function(e){e.component(ie.name,ie)},t["default"]=ie},6:function(e,t){e.exports=n("6b7c")},9:function(e,t){e.exports=n("7f4d")}})},4840:function(e,t,n){var i=n("825a"),r=n("1c0b"),o=n("b622"),a=o("species");e.exports=function(e,t){var n,o=i(e).constructor;return void 0===o||void 0==(n=i(o)[a])?t:r(n)}},4897:function(e,t,n){"use strict";n("3410"),n("ac1f"),n("1276"),t.__esModule=!0,t.i18n=t.use=t.t=void 0;var i=n("f0d9"),r=d(i),o=n("8bbf"),a=d(o),s=n("3c4e"),l=d(s),c=n("9d7e"),u=d(c);function d(e){return e&&e.__esModule?e:{default:e}}var h=(0,u.default)(a.default),f=r.default,p=!1,m=function(){var e=Object.getPrototypeOf(this||a.default).$t;if("function"===typeof e&&a.default.locale)return p||(p=!0,a.default.locale(a.default.config.lang,(0,l.default)(f,a.default.locale(a.default.config.lang)||{},{clone:!0}))),e.apply(this,arguments)},g=t.t=function(e,t){var n=m.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var i=e.split("."),r=f,o=0,a=i.length;o0){var i=t[t.length-1];if(i.id===e){if(i.modalClass){var r=i.modalClass.trim().split(/\s+/);r.forEach((function(e){return(0,o.removeClass)(n,e)}))}t.pop(),t.length>0&&(n.style.zIndex=t[t.length-1].zIndex)}else for(var a=t.length-1;a>=0;a--)if(t[a].id===e){t.splice(a,1);break}}0===t.length&&(this.modalFade&&(0,o.addClass)(n,"v-modal-leave"),setTimeout((function(){0===t.length&&(n.parentNode&&n.parentNode.removeChild(n),n.style.display="none",h.modalDom=void 0),(0,o.removeClass)(n,"v-modal-leave")}),200))}};Object.defineProperty(h,"zIndex",{configurable:!0,get:function(){return l||(c=c||(r.default.prototype.$ELEMENT||{}).zIndex||2e3,l=!0),c},set:function(e){c=e}});var f=function(){if(!r.default.prototype.$isServer&&h.modalStack.length>0){var e=h.modalStack[h.modalStack.length-1];if(!e)return;var t=h.getInstance(e.id);return t}};r.default.prototype.$isServer||window.addEventListener("keydown",(function(e){if(27===e.keyCode){var t=f();t&&t.closeOnPressEscape&&(t.handleClose?t.handleClose():t.handleAction?t.handleAction("cancel"):t.close())}})),t.default=h},"4b8b":function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},"4ba6":function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";function t(e,t,n,i,r,o){this.indented=e,this.column=t,this.type=n,this.info=i,this.align=r,this.prev=o}function n(e,n,i,r){var o=e.indented;return e.context&&"statement"==e.context.type&&"statement"!=i&&(o=e.context.indented),e.context=new t(o,n,i,r,null,e.context)}function i(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function r(e,t,n){return"variable"==t.prevToken||"type"==t.prevToken||!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),i=0;i!?|\/]/,D=l.isIdentifierChar||/[\w\$_\xa1-\uffff]/,M=l.isReservedIdentifier||!1;function A(e,t){var n=e.next();if(w[n]){var i=w[n](e,t);if(!1!==i)return i}if('"'==n||"'"==n)return t.tokenize=N(n),t.tokenize(e,t);if(O.test(n)){if(e.backUp(1),e.match(T))return"number";e.next()}if(S.test(n))return c=n,null;if("/"==n){if(e.eat("*"))return t.tokenize=I,I(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(E.test(n)){while(!e.match(/^\/[\/*]/,!1)&&e.eat(E));return"operator"}if(e.eatWhile(D),C)while(e.match(C))e.eatWhile(D);var r=e.current();return s(p,r)?(s(v,r)&&(c="newstatement"),s(b,r)&&(u=!0),"keyword"):s(m,r)?"type":s(g,r)||M&&M(r)?(s(v,r)&&(c="newstatement"),"builtin"):s(y,r)?"atom":"variable"}function N(e){return function(t,n){var i,r=!1,o=!1;while(null!=(i=t.next())){if(i==e&&!r){o=!0;break}r=!r&&"\\"==i}return(o||!r&&!x)&&(n.tokenize=null),"string"}}function I(e,t){var n,i=!1;while(n=e.next()){if("/"==n&&i){t.tokenize=null;break}i="*"==n}return"comment"}function L(e,t){l.typeFirstDefinitions&&e.eol()&&o(t.context)&&(t.typeAtEndOfLine=r(e,t,e.pos))}return{startState:function(e){return{tokenize:null,context:new t((e||0)-d,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return L(e,t),null;c=u=null;var s=(t.tokenize||A)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),";"==c||":"==c||","==c&&e.match(/^\s*(?:\/\/.*)?$/,!1))while("statement"==t.context.type)i(t);else if("{"==c)n(t,e.column(),"}");else if("["==c)n(t,e.column(),"]");else if("("==c)n(t,e.column(),")");else if("}"==c){while("statement"==a.type)a=i(t);"}"==a.type&&(a=i(t));while("statement"==a.type)a=i(t)}else c==a.type?i(t):_&&(("}"==a.type||"top"==a.type)&&";"!=c||"statement"==a.type&&"newstatement"==c)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&r(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),w.token){var d=w.token(e,t,s);void 0!==d&&(s=d)}return"def"==s&&!1===l.styleDefs&&(s="variable"),t.startOfLine=!1,t.prevToken=u?"def":s||c,L(e,t),s},indent:function(t,n){if(t.tokenize!=A&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var i=t.context,r=n&&n.charAt(0),o=r==i.type;if("statement"==i.type&&"}"==r&&(i=i.prev),l.dontIndentStatements)while("statement"==i.type&&l.dontIndentStatements.test(i.info))i=i.prev;if(w.indent){var a=w.indent(t,i,n,d);if("number"==typeof a)return a}var s=i.prev&&"switch"==i.prev.info;if(l.allmanIndentation&&/[{(]/.test(r)){while("top"!=i.type&&"}"!=i.type)i=i.prev;return i.indented}return"statement"==i.type?i.indented+("{"==r?0:h):!i.align||f&&")"==i.type?")"!=i.type||o?i.indented+(o?0:d)+(o||!s||/^(?:case|default)\b/.test(n)?0:d):i.indented+h:i.column+(o?0:1)},electricInput:k?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}}));var l="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",c="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",u="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",d="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",h=a("int long char short double float unsigned signed void bool"),f=a("SEL instancetype id Class Protocol BOOL");function p(e){return s(h,e)||/.+_t$/.test(e)}function m(e){return p(e)||s(f,e)}var g="case do else for if switch while struct enum union",v="struct enum union";function b(e,t){if(!t.startOfLine)return!1;for(var n,i=null;n=e.peek();){if("\\"==n&&e.match(/^.$/)){i=b;break}if("/"==n&&e.match(/^\/[\/\*]/,!1))break;e.next()}return t.tokenize=i,"meta"}function y(e,t){return"type"==t.prevToken&&"type"}function w(e){return!(!e||e.length<2)&&"_"==e[0]&&("_"==e[1]||e[1]!==e[1].toLowerCase())}function x(e){return e.eatWhile(/[\w\.']/),"number"}function _(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var n=e.match(/"([^\s\\()]{0,16})\(/);return!!n&&(t.cpp11RawStringDelim=n[1],t.tokenize=S,S(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function k(e){var t=/(\w+)::~?(\w+)$/.exec(e);return t&&t[1]==t[2]}function C(e,t){var n;while(null!=(n=e.next()))if('"'==n&&!e.eat('"')){t.tokenize=null;break}return"string"}function S(e,t){var n=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),i=e.match(new RegExp(".*?\\)"+n+'"'));return i?t.tokenize=null:e.skipToEnd(),"string"}function O(t,n){"string"==typeof t&&(t=[t]);var i=[];function r(e){if(e)for(var t in e)e.hasOwnProperty(t)&&i.push(t)}r(n.keywords),r(n.types),r(n.builtin),r(n.atoms),i.length&&(n.helperType=t[0],e.registerHelper("hintWords",t[0],i));for(var o=0;o!?|\/#:@]/,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=T,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var i=n.context;return!("}"!=i.type||!i.align||!e.eat(">"))&&(n.context=new t(i.indented,i.column,i.type,i.info,null,i.prev),"operator")},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=E(1),t.tokenize(e,t))}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}}),O("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object interface fun"),atoms:a("true false null this"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},"*":function(e,t){return"."==t.prevToken?"variable":"operator"},'"':function(e,t){return t.tokenize=D(e.match('""')),t.tokenize(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=E(1),t.tokenize(e,t))},indent:function(e,t,n,i){var r=n&&n.charAt(0);return"}"!=e.prevToken&&")"!=e.prevToken||""!=n?"operator"==e.prevToken&&"}"!=n&&"}"!=e.context.type||"variable"==e.prevToken&&"."==r||("}"==e.prevToken||")"==e.prevToken)&&"."==r?2*i+t.indented:t.align&&"}"==t.type?t.indented+(e.context.type==(n||"").charAt(0)?0:i):void 0:e.indented}},modeProps:{closeBrackets:{triples:'"'}}}),O(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":b},modeProps:{fold:["brace","include"]}}),O("text/x-nesc",{name:"clike",keywords:a(l+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:p,blockKeywords:a(g),atoms:a("null true false"),hooks:{"#":b},modeProps:{fold:["brace","include"]}}),O("text/x-objectivec",{name:"clike",keywords:a(l+" "+u),types:m,builtin:a(d),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:a(v+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:w,hooks:{"#":b,"*":y},modeProps:{fold:["brace","include"]}}),O("text/x-objectivec++",{name:"clike",keywords:a(l+" "+u+" "+c),types:m,builtin:a(d),blockKeywords:a(g+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:a(v+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:a("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:w,hooks:{"#":b,"*":y,u:_,U:_,L:_,R:_,0:x,1:x,2:x,3:x,4:x,5:x,6:x,7:x,8:x,9:x,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&k(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),O("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:p,blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":b},modeProps:{fold:["brace","include"]}});var M=null;function A(e){return function(t,n){var i,r=!1,o=!1;while(!t.eol()){if(!r&&t.match('"')&&("single"==e||t.match('""'))){o=!0;break}if(!r&&t.match("``")){M=A(e),o=!0;break}i=t.next(),r="single"==e&&!r&&"\\"==i}return o&&(n.tokenize=null),"string"}}O("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=A(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!M||!e.match("`"))&&(t.tokenize=M,M=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"type"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}))},"4c25":function(e,t,n){},"4cb2":function(e,t,n){"use strict";n.r(t),n("99af"),n("4160"),n("c975"),n("e260"),n("d81d"),n("a434"),n("b64b"),n("d3b7"),n("4d63"),n("ac1f"),n("25f0"),n("159b"),n("ddb0");var i=n("41b2"),r=n.n(i),o=n("1098"),a=n.n(o),s=(n("a623"),n("fb6a"),n("a9e3"),n("5319"),/%[sdj%]/g),l=function(){};function c(){for(var e=arguments.length,t=Array(e),n=0;n=o)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(n){return"[Circular]"}break;default:return e}})),l=t[i];i()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i}),k={integer:function(e){return k.number(e)&&parseInt(e,10)===e},float:function(e){return k.number(e)&&!k.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(t){return!1}},date:function(e){return"function"===typeof e.getTime&&"function"===typeof e.getMonth&&"function"===typeof e.getYear},number:function(e){return!isNaN(e)&&"number"===typeof e},object:function(e){return"object"===("undefined"===typeof e?"undefined":a()(e))&&!k.array(e)},method:function(e){return"function"===typeof e},email:function(e){return"string"===typeof e&&!!e.match(_.email)&&e.length<255},url:function(e){return"string"===typeof e&&!!e.match(_.url)},hex:function(e){return"string"===typeof e&&!!e.match(_.hex)}};function C(e,t,n,i,r){if(e.required&&void 0===t)y(e,t,n,i,r);else{var o=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=e.type;o.indexOf(s)>-1?k[s](t)||i.push(c(r.messages.types[s],e.fullField,e.type)):s&&("undefined"===typeof t?"undefined":a()(t))!==e.type&&i.push(c(r.messages.types[s],e.fullField,e.type))}}var S=C;function O(e,t,n,i,r){var o="number"===typeof e.len,a="number"===typeof e.min,s="number"===typeof e.max,l=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,u=t,d=null,h="number"===typeof t,f="string"===typeof t,p=Array.isArray(t);if(h?d="number":f?d="string":p&&(d="array"),!d)return!1;p&&(u=t.length),f&&(u=t.replace(l,"_").length),o?u!==e.len&&i.push(c(r.messages[d].len,e.fullField,e.len)):a&&!s&&ue.max?i.push(c(r.messages[d].max,e.fullField,e.max)):a&&s&&(ue.max)&&i.push(c(r.messages[d].range,e.fullField,e.min,e.max))}var T=O,E=(n("a15b"),"enum");function D(e,t,n,i,r){e[E]=Array.isArray(e[E])?e[E]:[],-1===e[E].indexOf(t)&&i.push(c(r.messages[E],e.fullField,e[E].join(", ")))}var M=D;function A(e,t,n,i,r){if(e.pattern)if(e.pattern instanceof RegExp)e.pattern.lastIndex=0,e.pattern.test(t)||i.push(c(r.messages.pattern.mismatch,e.fullField,t,e.pattern));else if("string"===typeof e.pattern){var o=new RegExp(e.pattern);o.test(t)||i.push(c(r.messages.pattern.mismatch,e.fullField,t,e.pattern))}}var N=A,I={required:y,whitespace:x,type:S,range:T,enum:M,pattern:N};function L(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t,"string")&&!e.required)return n();I.required(e,t,i,o,r,"string"),d(t,"string")||(I.type(e,t,i,o,r),I.range(e,t,i,o,r),I.pattern(e,t,i,o,r),!0===e.whitespace&&I.whitespace(e,t,i,o,r))}n(o)}var P=L;function $(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&I.type(e,t,i,o,r)}n(o)}var F=$;function j(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&(I.type(e,t,i,o,r),I.range(e,t,i,o,r))}n(o)}var z=j;function B(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&I.type(e,t,i,o,r)}n(o)}var R=B;function V(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),d(t)||I.type(e,t,i,o,r)}n(o)}var H=V;function W(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&(I.type(e,t,i,o,r),I.range(e,t,i,o,r))}n(o)}var q=W;function U(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&(I.type(e,t,i,o,r),I.range(e,t,i,o,r))}n(o)}var K=U;function G(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t,"array")&&!e.required)return n();I.required(e,t,i,o,r,"array"),d(t,"array")||(I.type(e,t,i,o,r),I.range(e,t,i,o,r))}n(o)}var Y=G;function X(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),void 0!==t&&I.type(e,t,i,o,r)}n(o)}var Z=X,Q="enum";function J(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();I.required(e,t,i,o,r),t&&I[Q](e,t,i,o,r)}n(o)}var ee=J;function te(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t,"string")&&!e.required)return n();I.required(e,t,i,o,r),d(t,"string")||I.pattern(e,t,i,o,r)}n(o)}var ne=te;function ie(e,t,n,i,r){var o=[],a=e.required||!e.required&&i.hasOwnProperty(e.field);if(a){if(d(t)&&!e.required)return n();if(I.required(e,t,i,o,r),!d(t)){var s=void 0;s="number"===typeof t?new Date(t):t,I.type(e,s,i,o,r),s&&I.range(e,s.getTime(),i,o,r)}}n(o)}var re=ie;function oe(e,t,n,i,r){var o=[],s=Array.isArray(t)?"array":"undefined"===typeof t?"undefined":a()(t);I.required(e,t,i,o,r,s),n(o)}var ae=oe;function se(e,t,n,i,r){var o=e.type,a=[],s=e.required||!e.required&&i.hasOwnProperty(e.field);if(s){if(d(t,o)&&!e.required)return n();I.required(e,t,i,a,r,o),d(t,o)||I.type(e,t,i,a,r)}n(a)}var le=se,ce={string:P,method:F,number:z,boolean:R,regexp:H,integer:q,float:K,array:Y,object:Z,enum:ee,pattern:ne,date:re,url:le,hex:le,email:le,required:ae};function ue(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var de=ue();function he(e){this.rules=null,this._messages=de,this.define(e)}he.prototype={messages:function(e){return e&&(this._messages=v(ue(),e)),this._messages},define:function(e){if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!==("undefined"===typeof e?"undefined":a()(e))||Array.isArray(e))throw new Error("Rules must be an object");this.rules={};var t=void 0,n=void 0;for(t in e)e.hasOwnProperty(t)&&(n=e[t],this.rules[t]=Array.isArray(n)?n:[n])},validate:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments[2],o=e,s=n,u=i;if("function"===typeof s&&(u=s,s={}),this.rules&&0!==Object.keys(this.rules).length){if(s.messages){var d=this.messages();d===de&&(d=ue()),v(d,s.messages),s.messages=d}else s.messages=this.messages();var h=void 0,f=void 0,p={},b=s.keys||Object.keys(this.rules);b.forEach((function(n){h=t.rules[n],f=o[n],h.forEach((function(i){var a=i;"function"===typeof a.transform&&(o===e&&(o=r()({},o)),f=o[n]=a.transform(f)),a="function"===typeof a?{validator:a}:r()({},a),a.validator=t.getValidationMethod(a),a.field=n,a.fullField=a.fullField||n,a.type=t.getType(a),a.validator&&(p[n]=p[n]||[],p[n].push({rule:a,value:f,source:o,field:n}))}))}));var y={};m(p,s,(function(e,t){var n=e.rule,i=("object"===n.type||"array"===n.type)&&("object"===a()(n.fields)||"object"===a()(n.defaultField));function o(e,t){return r()({},t,{fullField:n.fullField+"."+e})}function u(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],u=a;if(Array.isArray(u)||(u=[u]),u.length&&l("async-validator:",u),u.length&&n.message&&(u=[].concat(n.message)),u=u.map(g(n)),s.first&&u.length)return y[n.field]=1,t(u);if(i){if(n.required&&!e.value)return u=n.message?[].concat(n.message).map(g(n)):s.error?[s.error(n,c(s.messages.required,n.field))]:[],t(u);var d={};if(n.defaultField)for(var h in e.value)e.value.hasOwnProperty(h)&&(d[h]=n.defaultField);for(var f in d=r()({},d,e.rule.fields),d)if(d.hasOwnProperty(f)){var p=Array.isArray(d[f])?d[f]:[d[f]];d[f]=p.map(o.bind(null,f))}var m=new he(d);m.messages(s.messages),e.rule.options&&(e.rule.options.messages=s.messages,e.rule.options.error=s.error),m.validate(e.value,e.rule.options||s,(function(e){t(e&&e.length?u.concat(e):e)}))}else t(u)}i=i&&(n.required||!n.required&&e.value),n.field=e.field;var d=n.validator(n,e.value,u,e.source,s);d&&d.then&&d.then((function(){return u()}),(function(e){return u(e)}))}),(function(e){w(e)}))}else u&&u();function w(e){var t=void 0,n=void 0,i=[],r={};function o(e){Array.isArray(e)?i=i.concat.apply(i,e):i.push(e)}for(t=0;t-1,i&&(n=n.replace(/y/g,"")));var l=a(_?new b(t,n):b(t,n),r?this:y,e);return k&&i&&p(l,{sticky:i}),l},O=function(e){e in S||s(S,e,{configurable:!0,get:function(){return b[e]},set:function(t){b[e]=t}})},T=l(b),E=0;while(T.length>E)O(T[E++]);y.constructor=S,S.prototype=y,h(r,"RegExp",S)}m("RegExp")},"4d64":function(e,t,n){var i=n("fc6a"),r=n("50c4"),o=n("23cb"),a=function(e){return function(t,n,a){var s,l=i(t),c=r(l.length),u=o(a,c);if(e&&n!=n){while(c>u)if(s=l[u++],s!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},"4d88":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},"4de4":function(e,t,n){"use strict";var i=n("23e7"),r=n("b727").filter,o=n("1dde"),a=n("ae40"),s=o("filter"),l=a("filter");i({target:"Array",proto:!0,forced:!s||!l},{filter:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,t,n){"use strict";var i=n("0366"),r=n("7b0b"),o=n("9bdd"),a=n("e95a"),s=n("50c4"),l=n("8418"),c=n("35a1");e.exports=function(e){var t,n,u,d,h,f,p=r(e),m="function"==typeof this?this:Array,g=arguments.length,v=g>1?arguments[1]:void 0,b=void 0!==v,y=c(p),w=0;if(b&&(v=i(v,g>2?arguments[2]:void 0,2)),void 0==y||m==Array&&a(y))for(t=s(p.length),n=new m(t);t>w;w++)f=b?v(p[w],w):p[w],l(n,w,f);else for(d=y.call(p),h=d.next,n=new m;!(u=h.call(d)).done;w++)f=b?o(d,v,[u.value,w],!0):u.value,l(n,w,f);return n.length=w,n}},"4e4b":function(e,t,n){n("a4d3"),n("e01a"),n("d28b"),n("944a"),n("99af"),n("a623"),n("4de4"),n("4160"),n("c975"),n("e260"),n("d81d"),n("fb6a"),n("45fc"),n("a434"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("d3b7"),n("4d63"),n("ac1f"),n("25f0"),n("3ca3"),n("159b"),n("ddb0");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=61)}([function(e,t,n){"use strict";function i(e,t,n,i,r,o,a,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},,,function(e,t){e.exports=n("8122")},function(e,t){e.exports=n("d010")},function(e,t){e.exports=n("e974")},function(e,t){e.exports=n("6b7c")},,,,function(e,t){e.exports=n("f3ad")},,function(e,t){e.exports=n("417f")},,function(e,t){e.exports=n("14e9")},,function(e,t){e.exports=n("4010")},function(e,t){e.exports=n("0e15")},,function(e,t){e.exports=n("4897")},,function(e,t){e.exports=n("d397")},function(e,t){e.exports=n("12f2")},,,,,,,,,function(e,t){e.exports=n("2a5e")},,,function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[n("span",[e._v(e._s(e.currentLabel))])])],2)},o=[];r._withStripped=!0;var a=n(4),s=n.n(a),l=n(3),c="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},u={mixins:[s.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var n=this.select,i=n.remote,r=n.valueKey;if(!this.created&&!i){if(r&&"object"===("undefined"===typeof e?"undefined":c(e))&&"object"===("undefined"===typeof t?"undefined":c(t))&&e[r]===t[r])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var n=this.select.valueKey;return Object(l["getValueByPath"])(e,n)===Object(l["getValueByPath"])(t,n)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var n=this.select.valueKey;return e&&e.some((function(e){return Object(l["getValueByPath"])(e,n)===Object(l["getValueByPath"])(t,n)}))}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(l["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var e=this.select,t=e.selected,n=e.multiple,i=n?t:[t],r=this.select.cachedOptions.indexOf(this),o=i.indexOf(this);r>-1&&o<0&&this.select.cachedOptions.splice(r,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},d=u,h=n(0),f=Object(h["a"])(d,r,o,!1,null,null,null);f.options.__file="packages/select/src/option.vue",t["a"]=f.exports},,,,function(e,t){e.exports=n("8bbc")},,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?n("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?n("span",[n("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?n("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[n("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():n("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,(function(t){return n("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(n){e.deleteTag(n,t)}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])})),1),e.filterable?n("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.navigateOptions("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.deletePrevTag(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),n("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,tabindex:e.multiple&&e.filterable?"-1":null},on:{focus:e.handleFocus,blur:e.handleBlur},nativeOn:{keyup:function(t){return e.debouncedOnInputChange(t)},keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],paste:function(t){return e.debouncedOnInputChange(t)},mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?n("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),n("template",{slot:"suffix"},[n("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?n("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[n("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?n("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):n("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},r=[];i._withStripped=!0;var o=n(4),a=n.n(o),s=n(22),l=n.n(s),c=n(6),u=n.n(c),d=n(10),h=n.n(d),f=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},p=[];f._withStripped=!0;var m=n(5),g=n.n(m),v={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[g.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",(function(){e.$parent.visible&&e.updatePopper()})),this.$on("destroyPopper",this.destroyPopper)}},b=v,y=n(0),w=Object(y["a"])(b,f,p,!1,null,null,null);w.options.__file="packages/select/src/select-dropdown.vue";var x=w.exports,_=n(34),k=n(38),C=n.n(k),S=n(14),O=n.n(S),T=n(17),E=n.n(T),D=n(12),M=n.n(D),A=n(16),N=n(19),I=n(31),L=n.n(I),P=n(3),$={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter((function(e){return e.visible})).every((function(e){return e.disabled}))}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach((function(e){e.hover=t.hoverOption===e}))}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var n=this.options[this.hoverIndex];!0!==n.disabled&&!0!==n.groupDisabled&&n.visible||this.navigateOptions(e),this.$nextTick((function(){return t.scrollToOption(t.hoverOption)}))}}else this.visible=!0}}},F=n(21),j={mixins:[a.a,u.a,l()("reference"),$],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(P["isIE"])()&&!Object(P["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter((function(e){return!e.created})).some((function(t){return t.currentLabel===e.query}));return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"}},components:{ElInput:h.a,ElSelectMenu:x,ElOption:_["a"],ElTag:C.a,ElScrollbar:O.a},directives:{Clickoutside:M.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,default:function(){return Object(N["t"])("el.select.placeholder")}},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick((function(){e.resetInputHeight()}))},placeholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(P["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick((function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)})),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick((function(){e.broadcast("ElSelectDropdown","updatePopper")})),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(e){var t=this,n=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.$nextTick((function(e){return t.handleQueryChange(n)}));else{var i=n[n.length-1]||"";this.isOnComposition=!Object(F["isKorean"])(i)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick((function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")})),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick((function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()})),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var n=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");L()(n,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick((function(){return e.scrollToOption(e.selected)}))},emitChange:function(e){Object(P["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,n="[object object]"===Object.prototype.toString.call(e).toLowerCase(),i="[object null]"===Object.prototype.toString.call(e).toLowerCase(),r="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),o=this.cachedOptions.length-1;o>=0;o--){var a=this.cachedOptions[o],s=n?Object(P["getValueByPath"])(a.value,this.valueKey)===Object(P["getValueByPath"])(e,this.valueKey):a.value===e;if(s){t=a;break}}if(t)return t;var l=n||i||r?"":e,c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var n=[];Array.isArray(this.value)&&this.value.forEach((function(t){n.push(e.getOption(t))})),this.selected=n,this.$nextTick((function(){e.resetInputHeight()}))},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.filterable&&(this.menuVisibleOnFocus=!0)),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout((function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)}),50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick((function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,n=[].filter.call(t,(function(e){return"INPUT"===e.tagName}))[0],i=e.$refs.tags,r=e.initialInputHeight||40;n.style.height=0===e.selected.length?r+"px":Math.max(i?i.clientHeight+(i.clientHeight>r?6:0):0,r)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}}))},resetHoverIndex:function(){var e=this;setTimeout((function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map((function(t){return e.options.indexOf(t)}))):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)}),300)},handleOptionSelect:function(e,t){var n=this;if(this.multiple){var i=(this.value||[]).slice(),r=this.getValueIndex(i,e.value);r>-1?i.splice(r,1):(this.multipleLimit<=0||i.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(n){var i=this.valueKey,r=-1;return e.some((function(e,n){return Object(P["getValueByPath"])(e,i)===Object(P["getValueByPath"])(t,i)&&(r=n,!0)})),r}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var n=this.selected.indexOf(t);if(n>-1&&!this.selectDisabled){var i=this.value.slice();i.splice(n,1),this.$emit("input",i),this.emitChange(i),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var n=0;n!==this.options.length;++n){var i=this.options[n];if(this.query){if(!i.disabled&&!i.groupDisabled&&i.visible){this.hoverIndex=n;break}}else if(i.itemSelected){this.hoverIndex=n;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(P["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.placeholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=E()(this.debounce,(function(){e.onInputChange()})),this.debouncedQueryChange=E()(this.debounce,(function(t){e.handleQueryChange(t.target.value)})),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(A["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var n={medium:36,small:32,mini:28},i=t.$el.querySelector("input");this.initialInputHeight=i.getBoundingClientRect().height||n[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick((function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)})),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(A["removeResizeListener"])(this.$el,this.handleResize)}},z=j,B=Object(y["a"])(z,i,r,!1,null,null,null);B.options.__file="packages/select/src/select.vue";var R=B.exports;R.install=function(e){e.component(R.name,R)},t["default"]=R}])},"4e71":function(e,t,n){n("e198")("observable")},"4ebc":function(e,t,n){var i=n("4d88");e.exports=Array.isArray||function(e){return"Array"==i(e)}},"50c4":function(e,t,n){var i=n("a691"),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},"511f":function(e,t,n){n("0b99"),n("658f"),e.exports=n("fcd4").f("iterator")},5128:function(e,t,n){"use strict";n("a9e3"),t.__esModule=!0,t.PopupManager=void 0;var i=n("8bbf"),r=h(i),o=n("7f4d"),a=h(o),s=n("4b26"),l=h(s),c=n("e62d"),u=h(c),d=n("5924");function h(e){return e&&e.__esModule?e:{default:e}}var f=1,p=void 0;t.default={props:{visible:{type:Boolean,default:!1},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},beforeMount:function(){this._popupId="popup-"+f++,l.default.register(this._popupId,this)},beforeDestroy:function(){l.default.deregister(this._popupId),l.default.closeModal(this._popupId),this.restoreBodyStyle()},data:function(){return{opened:!1,bodyPaddingRight:null,computedBodyPaddingRight:0,withoutHiddenClass:!0,rendered:!1}},watch:{visible:function(e){var t=this;if(e){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,r.default.nextTick((function(){t.open()})))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var n=(0,a.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var i=Number(n.openDelay);i>0?this._openTimer=setTimeout((function(){t._openTimer=null,t.doOpen(n)}),i):this.doOpen(n)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=this.$el,n=e.modal,i=e.zIndex;if(i&&(l.default.zIndex=i),n&&(this._closing&&(l.default.closeModal(this._popupId),this._closing=!1),l.default.openModal(this._popupId,l.default.nextZIndex(),this.modalAppendToBody?void 0:t,e.modalClass,e.modalFade),e.lockScroll)){this.withoutHiddenClass=!(0,d.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,d.getStyle)(document.body,"paddingRight"),10)),p=(0,u.default)();var r=document.documentElement.clientHeight0&&(r||"scroll"===o)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+p+"px"),(0,d.addClass)(document.body,"el-popup-parent--hidden")}"static"===getComputedStyle(t).position&&(t.style.position="absolute"),t.style.zIndex=l.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var e=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var t=Number(this.closeDelay);t>0?this._closeTimer=setTimeout((function(){e._closeTimer=null,e.doClose()}),t):this.doClose()}},doClose:function(){this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose()},doAfterClose:function(){l.default.closeModal(this._popupId),this._closing=!1},restoreBodyStyle:function(){this.modal&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.bodyPaddingRight,(0,d.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},t.PopupManager=l.default},"512c":function(e,t,n){var i=n("ef08"),r=n("5524"),o=n("9c0c"),a=n("051b"),s=n("9c0e"),l="prototype",c=function e(t,n,c){var u,d,h,f=t&e.F,p=t&e.G,m=t&e.S,g=t&e.P,v=t&e.B,b=t&e.W,y=p?r:r[n]||(r[n]={}),w=y[l],x=p?i:m?i[n]:(i[n]||{})[l];for(u in p&&(c=n),c)d=!f&&x&&void 0!==x[u],d&&s(y,u)||(h=d?x[u]:c[u],y[u]=p&&"function"!=typeof x[u]?c[u]:v&&d?o(h,i):b&&x[u]==h?function(e){var t=function(t,n,i){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,i)}return e.apply(this,arguments)};return t[l]=e[l],t}(h):g&&"function"==typeof h?o(Function.call,h):h,g&&((y.virtual||(y.virtual={}))[u]=h,t&e.R&&w&&!w[u]&&a(w,u,h)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,e.exports=c},5135:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},5270:function(e,t,n){"use strict";var i=n("c532"),r=n("c401"),o=n("2e67"),a=n("2444");function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){s(e),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),i.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]}));var t=e.adapter||a.adapter;return t(e).then((function(t){return s(e),t.data=r(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(s(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},5319:function(e,t,n){"use strict";var i=n("d784"),r=n("825a"),o=n("7b0b"),a=n("50c4"),s=n("a691"),l=n("1d80"),c=n("8aa5"),u=n("14c3"),d=Math.max,h=Math.min,f=Math.floor,p=/\$([$&'`]|\d\d?|<[^>]*>)/g,m=/\$([$&'`]|\d\d?)/g,g=function(e){return void 0===e?e:String(e)};i("replace",2,(function(e,t,n,i){var v=i.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,b=i.REPLACE_KEEPS_$0,y=v?"$":"$0";return[function(n,i){var r=l(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,r,i):t.call(String(r),n,i)},function(e,i){if(!v&&b||"string"===typeof i&&-1===i.indexOf(y)){var o=n(t,e,this,i);if(o.done)return o.value}var l=r(e),f=String(this),p="function"===typeof i;p||(i=String(i));var m=l.global;if(m){var x=l.unicode;l.lastIndex=0}var _=[];while(1){var k=u(l,f);if(null===k)break;if(_.push(k),!m)break;var C=String(k[0]);""===C&&(l.lastIndex=c(f,a(l.lastIndex),x))}for(var S="",O=0,T=0;T<_.length;T++){k=_[T];for(var E=String(k[0]),D=d(h(s(k.index),f.length),0),M=[],A=1;A=O&&(S+=f.slice(O,D)+L,O=D+E.length)}return S+f.slice(O)}];function w(e,n,i,r,a,s){var l=i+e.length,c=r.length,u=m;return void 0!==a&&(a=o(a),u=p),t.call(s,u,(function(t,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,i);case"'":return n.slice(l);case"<":s=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return t;if(u>c){var d=f(u/10);return 0===d?t:d<=c?void 0===r[d-1]?o.charAt(1):r[d-1]+o.charAt(1):t}s=r[u-1]}return void 0===s?"":s}))}}))},"53ca":function(e,t,n){"use strict";function i(e){return i="function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?function(e){return _typeof2(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)},i(e)}n.d(t,"a",(function(){return i})),n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0")},"545f":function(e,t,n){"use strict";var i=n("dda2"),r=n.n(i);r.a},5488:function(e,t,n){"use strict";t.__esModule=!0;var i=n("5924");function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(){r(this,e)}return e.prototype.beforeEnter=function(e){(0,i.addClass)(e,"collapse-transition"),e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.style.height="0",e.style.paddingTop=0,e.style.paddingBottom=0},e.prototype.enter=function(e){e.dataset.oldOverflow=e.style.overflow,0!==e.scrollHeight?(e.style.height=e.scrollHeight+"px",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom):(e.style.height="",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom),e.style.overflow="hidden"},e.prototype.afterEnter=function(e){(0,i.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow},e.prototype.beforeLeave=function(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},e.prototype.leave=function(e){0!==e.scrollHeight&&((0,i.addClass)(e,"collapse-transition"),e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0)},e.prototype.afterLeave=function(e){(0,i.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom},e}();t.default={name:"ElCollapseTransition",functional:!0,render:function(e,t){var n=t.children,i={on:new o};return e("transition",i,n)}}},5524:function(e,t){var n=e.exports={version:"2.6.11"};"number"==typeof __e&&(__e=n)},5692:function(e,t,n){var i=n("c430"),r=n("c6cd");(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:i?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56b3":function(e,t,n){(function(t,n){e.exports=n()})(0,(function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),r=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||r||o,s=a&&(i?document.documentMode||6:+(o||r)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=m||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),x=d&&e.match(/Version\/(\d*\.\d*)/);x&&(x=Number(x[1])),x&&x>=15&&(d=!1,l=!0);var _=b&&(c||d&&(null==x||x<12.11)),k=n||a&&s>=9;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,O=function(e,t){var n=e.className,i=C(t).exec(n);if(i){var r=n.slice(i.index+i[0].length);e.className=n.slice(0,i.index)+(r?i[1]+r:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function E(e,t){return T(e).appendChild(t)}function D(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?P=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(P=function(e){try{e.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=$(this.onTimeout,this)};function B(e,t){for(var n=0;n=t)return i+Math.min(a,t-r);if(r+=o-i,r+=n-r%n,i=o+1,r>=t)return i}}var K=[""];function G(e){while(K.length<=e)K.push(Y(K)+" ");return K[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],i=0;i"€"&&(e.toUpperCase()!=e.toLowerCase()||ee.test(e))}function ne(e,t){return t?!!(t.source.indexOf("\\w")>-1&&te(e))||t.test(e):te(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function oe(e){return e.charCodeAt(0)>=768&&re.test(e)}function ae(e,t,n){while((n<0?t>0:tn?-1:1;;){if(t==n)return t;var r=(t+n)/2,o=i<0?Math.ceil(r):Math.floor(r);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+i}}function le(e,t,n,i){if(!e)return i(t,n,"ltr",0);for(var r=!1,o=0;ot||t==n&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),r=!0)}r||i(t,n,"ltr")}var ce=null;function ue(e,t,n){var i;ce=null;for(var r=0;rt)return r;o.to==t&&(o.from!=o.to&&"before"==n?i=r:ce=r),o.from==t&&(o.from!=o.to&&"before"!=n?i=r:ce=r)}return null!=i?i:ce}var de=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,r=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(e,t,n){this.level=e,this.from=t,this.to=n}return function(e,t){var c="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!i.test(e))return!1;for(var u=e.length,d=[],h=0;h-1&&(i[t]=r.slice(0,o).concat(r.slice(o+1)))}}}function ve(e,t){var n=me(e,t);if(n.length)for(var i=Array.prototype.slice.call(arguments,2),r=0;r0}function xe(e){e.prototype.on=function(e,t){pe(this,e,t)},e.prototype.off=function(e,t){ge(this,e,t)}}function _e(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ke(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Ce(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Se(e){_e(e),ke(e)}function Oe(e){return e.target||e.srcElement}function Te(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Ee,De,Me=function(){if(a&&s<9)return!1;var e=D("div");return"draggable"in e||"dragDrop"in e}();function Ae(e){if(null==Ee){var t=D("span","​");E(e,D("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Ee=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Ee?D("span","​"):D("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ne(e){if(null!=De)return De;var t=E(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),i=S(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(De=i.right-n.right<3)}var Ie=3!="\n\nb".split(/\n/).length?function(e){var t=0,n=[],i=e.length;while(t<=i){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var o=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Le=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe=function(){var e=D("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),$e=null;function Fe(e){if(null!=$e)return $e;var t=E(e,D("span","x")),n=t.getBoundingClientRect(),i=S(t,0,1).getBoundingClientRect();return $e=Math.abs(n.left-i.left)>1}var je={},ze={};function Be(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),je[e]=t}function Re(e,t){ze[e]=t}function Ve(e){if("string"==typeof e&&ze.hasOwnProperty(e))e=ze[e];else if(e&&"string"==typeof e.name&&ze.hasOwnProperty(e.name)){var t=ze[e.name];"string"==typeof t&&(t={name:t}),e=J(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function He(e,t){t=Ve(t);var n=je[t.name];if(!n)return He(e,"text/plain");var i=n(e,t);if(We.hasOwnProperty(t.name)){var r=We[t.name];for(var o in r)r.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=r[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var We={};function qe(e,t){var n=We.hasOwnProperty(e)?We[e]:We[e]={};F(t,n)}function Ue(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n}function Ke(e,t){var n;while(e.innerMode){if(n=e.innerMode(t),!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function Ge(e,t,n){return!e.startState||e.startState(t,n)}var Ye=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xe(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var i=0;;++i){var r=n.children[i],o=r.chunkSize();if(t=e.first&&tn?rt(n,Xe(e,n).text.length):ht(t,Xe(e,t.line).text.length)}function ht(e,t){var n=e.ch;return null==n||n>t?rt(e.line,t):n<0?rt(e.line,0):e}function ft(e,t){for(var n=[],i=0;i=this.string.length},Ye.prototype.sol=function(){return this.pos==this.lineStart},Ye.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ye.prototype.next=function(){if(this.post},Ye.prototype.eatSpace=function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},Ye.prototype.skipToEnd=function(){this.pos=this.string.length},Ye.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ye.prototype.backUp=function(e){this.pos-=e},Ye.prototype.column=function(){return this.lastColumnPos0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(r(o)==r(e))return!1!==t&&(this.pos+=e.length),!0},Ye.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ye.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ye.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ye.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var pt=function(e,t){this.state=e,this.lookAhead=t},mt=function(e,t,n,i){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function gt(e,t,n,i){var r=[e.state.modeGen],o={};St(e,t.text,e.doc.mode,n,(function(e,t){return r.push(e,t)}),o,i);for(var a=n.state,s=function(i){n.baseTokens=r;var s=e.state.overlays[i],l=1,c=0;n.state=!0,St(e,t.text,s.mode,n,(function(e,t){var n=l;while(ce&&r.splice(l,1,e,r[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Ue(e.doc.mode,i.state),o=gt(e,t,i);r&&(i.state=r),t.stateAfter=i.save(!r),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function bt(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return new mt(i,!0,t);var o=Ot(e,t,n),a=o>i.first&&Xe(i,o-1).stateAfter,s=a?mt.fromSaved(i,a,o):new mt(i,Ge(i.mode),o);return i.iter(o,t,(function(n){yt(e,n.text,s);var i=s.line;n.stateAfter=i==t-1||i%5==0||i>=r.viewFrom&&it.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}mt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mt.prototype.baseToken=function(e){if(!this.baseTokens)return null;while(this.baseTokens[this.baseTokenPos]<=e)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mt.fromSaved=function(e,t,n){return t instanceof pt?new mt(e,Ue(e.mode,t.state),n,t.lookAhead):new mt(e,Ue(e.mode,t),n)},mt.prototype.save=function(e){var t=!1!==e?Ue(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pt(t,this.maxLookAhead):t};var _t=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function kt(e,t,n,i){var r,o=e.doc,a=o.mode;t=dt(o,t);var s,l=Xe(o,t.line),c=bt(e,t.line,n),u=new Ye(l.text,e.options.tabSize,c);i&&(s=[]);while((i||u.pose.options.maxHighlightLength?(s=!1,a&&yt(e,t,i,d.pos),d.pos=t.length,l=null):l=Ct(xt(n,d,i.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||u!=l){while(ca;--s){if(s<=o.first)return o.first;var l=Xe(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof pt?c.lookAhead:0)<=o.modeFrontier))return s;var u=j(l.text,null,e.options.tabSize);(null==r||i>u)&&(r=s-1,i=u)}return r}function Tt(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;i--){var r=Xe(e,i).stateAfter;if(r&&(!(r instanceof pt)||i+r.lookAhead=t:o.to>t);(i||(i=[])).push(new Nt(a,o.from,l?null:o.to))}}return i}function Ft(e,t,n){var i;if(e)for(var r=0;r=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var w=0;w0)){var u=[l,1],d=ot(c.from,s.from),h=ot(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-3}}return r}function Rt(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!n||qt(n,o.marker)<0)&&(n=o.marker)}return n}function Xt(e,t,n,i,r){var o=Xe(e,t),a=Dt&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ot(c.to,n)>=0:ot(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&r.inclusiveLeft?ot(c.from,i)<=0:ot(c.from,i)<0)))return!0}}}function Zt(e){var t;while(t=Kt(e))e=t.find(-1,!0).line;return e}function Qt(e){var t;while(t=Gt(e))e=t.find(1,!0).line;return e}function Jt(e){var t,n;while(t=Gt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function en(e,t){var n=Xe(e,t),i=Zt(n);return n==i?t:et(i)}function tn(e,t){if(t>e.lastLine())return t;var n,i=Xe(e,t);if(!nn(e,i))return t;while(n=Gt(i))i=n.find(1,!0).line;return et(i)+1}function nn(e,t){var n=Dt&&t.markedSpans;if(n)for(var i=void 0,r=0;rt.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var ln=function(e,t,n){this.text=e,Vt(this,t),this.height=n?n(this):1};function cn(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Rt(e),Vt(e,n);var r=i?i(e):1;r!=e.height&&Je(e,r)}function un(e){e.parent=null,Rt(e)}ln.prototype.lineNo=function(){return et(this)},xe(ln);var dn={},hn={};function fn(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?hn:dn;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function pn(e,t){var n=M("span",null,null,l?"padding-right: .1px":null),i={pre:M("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var o=r?t.rest[r-1]:t.line,a=void 0;i.pos=0,i.addToken=gn,Ne(e.display.measure)&&(a=he(o,e.doc.direction))&&(i.addToken=bn(i.addToken,a)),i.map=[];var s=t!=e.display.externalMeasured&&et(o);wn(o,i,vt(e,o,s)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=L(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=L(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ae(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(l){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return ve(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=L(i.pre.className,i.textClass||"")),i}function mn(e){var t=D("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function gn(e,t,n,i,r,o,l){if(t){var c,u=e.splitSpaces?vn(t,e.trailingSpace):t,d=e.cm.state.specialChars,h=!1;if(d.test(t)){c=document.createDocumentFragment();var f=0;while(1){d.lastIndex=f;var p=d.exec(t),m=p?p.index-f:t.length-f;if(m){var g=document.createTextNode(u.slice(f,f+m));a&&s<9?c.appendChild(D("span",[g])):c.appendChild(g),e.map.push(e.pos,e.pos+m,g),e.col+=m,e.pos+=m}if(!p)break;f+=m+1;var v=void 0;if("\t"==p[0]){var b=e.cm.options.tabSize,y=b-e.col%b;v=c.appendChild(D("span",G(y),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=y}else"\r"==p[0]||"\n"==p[0]?(v=c.appendChild(D("span","\r"==p[0]?"␍":"␤","cm-invalidchar")),v.setAttribute("cm-text",p[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(p[0]),v.setAttribute("cm-text",p[0]),a&&s<9?c.appendChild(D("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(h=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),n||i||r||h||o||l){var w=n||"";i&&(w+=i),r&&(w+=r);var x=D("span",[c],w,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&x.setAttribute(_,l[_]);return e.content.appendChild(x)}e.content.appendChild(c)}}function vn(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,i="",r=0;rc&&d.from<=c)break;if(d.to>=u)return e(n,i,r,o,a,s,l);e(n,i.slice(0,d.to-c),r,o,null,s,l),o=null,i=i.slice(d.to-c),c=d.to}}}function yn(e,t,n,i){var r=!i&&n.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!i&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",n.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t,e.trailingSpace=!1}function wn(e,t,n){var i=e.markedSpans,r=e.text,o=0;if(i)for(var a,s,l,c,u,d,h,f=r.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",h=null,d=null,v=1/0;for(var b=[],y=void 0,w=0;wp||_.collapsed&&x.to==p&&x.from==p)){if(null!=x.to&&x.to!=p&&v>x.to&&(v=x.to,c=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&x.from==p&&(u+=" "+_.startStyle),_.endStyle&&x.to==v&&(y||(y=[])).push(_.endStyle,x.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||qt(d.marker,_)<0)&&(d=x)}else x.from>p&&v>x.from&&(v=x.from)}if(y)for(var C=0;C=f)break;var O=Math.min(f,v);while(1){if(g){var T=p+g.length;if(!d){var E=T>O?g.slice(0,O-p):g;t.addToken(t,E,a?a+l:l,u,p+E.length==v?c:"",s,h)}if(T>=O){g=g.slice(O-p),p=O;break}p=T,u=""}g=r.slice(o,o=n[m++]),a=fn(n[m++],t.cm.options)}}else for(var D=1;D2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Zn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;in)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qn(e,t){t=Zt(t);var n=et(t),i=e.display.externalMeasured=new xn(e.doc,t,n);i.lineN=n;var r=i.built=pn(e,i);return i.text=r.pre,E(e.display.lineMeasure,r.pre),i}function Jn(e,t,n,i){return ni(e,ti(e,t),n,i)}function ei(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=l-s,r=o-1,t>=l&&(a="right")),null!=r){if(i=e[c+2],s==l&&n==(i.insertLeft?"left":"right")&&(a=n),"left"==n&&0==r)while(c&&e[c-2]==e[c-3]&&e[c-1].insertLeft)i=e[2+(c-=3)],a="left";if("right"==n&&r==l-s)while(c=0;r--)if((n=e[r]).left!=n.right)break;return n}function si(e,t,n,i){var r,o=oi(t.map,n,i),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){while(c&&oe(t.line.text.charAt(o.coverStart+c)))--c;while(o.coverStart+u0&&(d=i="right"),r=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==i?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!r||!r.left&&!r.right)){var p=l.parentNode.getClientRects()[0];r=p?{left:p.left,right:p.left+Di(e.display),top:p.top,bottom:p.bottom}:ri}for(var m=r.top-t.rect.top,g=r.bottom-t.rect.top,v=(m+g)/2,b=t.view.measure.heights,y=0;y=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var i=s[t],r=1==i.level;return a(n?e-1:e,r!=n)}var d=ue(s,l,c),h=ce,f=u(l,d,"before"==c);return null!=h&&(f.other=u(l,h,"before"!=c)),f}function yi(e,t){var n=0;t=dt(e.doc,t),e.options.lineWrapping||(n=Di(e.display)*t.ch);var i=Xe(e.doc,t.line),r=on(i)+Wn(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function wi(e,t,n,i,r){var o=rt(e,t,n);return o.xRel=r,i&&(o.outside=i),o}function xi(e,t,n){var i=e.doc;if(n+=e.display.viewOffset,n<0)return wi(i.first,0,null,-1,-1);var r=tt(i,n),o=i.first+i.size-1;if(r>o)return wi(i.first+i.size-1,Xe(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Xe(i,r);;){var s=Si(e,a,r,t,n),l=Yt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==r)return c;a=Xe(i,r=c.line)}}function _i(e,t,n,i){i-=pi(t);var r=t.text.length,o=se((function(t){return ni(e,n,t-1).bottom<=i}),r,0);return r=se((function(t){return ni(e,n,t).top>i}),o,r),{begin:o,end:r}}function ki(e,t,n,i){n||(n=ti(e,t));var r=mi(e,t,ni(e,n,i),"line").top;return _i(e,t,n,r)}function Ci(e,t,n,i){return!(e.bottom<=n)&&(e.top>n||(i?e.left:e.right)>t)}function Si(e,t,n,i,r){r-=on(t);var o=ti(e,t),a=pi(t),s=0,l=t.text.length,c=!0,u=he(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?Ti:Oi)(e,t,n,o,u,i,r);c=1!=d.level,s=c?d.from:d.to-1,l=c?d.to:d.from-1}var h,f,p=null,m=null,g=se((function(t){var n=ni(e,o,t);return n.top+=a,n.bottom+=a,!!Ci(n,i,r,!1)&&(n.top<=r&&n.left<=i&&(p=t,m=n),!0)}),s,l),v=!1;if(m){var b=i-m.left=w.bottom?1:0}return g=ae(t.text,g,1),wi(n,g,f,v,i-h)}function Oi(e,t,n,i,r,o,a){var s=se((function(s){var l=r[s],c=1!=l.level;return Ci(bi(e,rt(n,c?l.to:l.from,c?"before":"after"),"line",t,i),o,a,!0)}),0,r.length-1),l=r[s];if(s>0){var c=1!=l.level,u=bi(e,rt(n,c?l.from:l.to,c?"after":"before"),"line",t,i);Ci(u,o,a,!0)&&u.top>a&&(l=r[s-1])}return l}function Ti(e,t,n,i,r,o,a){var s=_i(e,t,i,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,h=0;h=c||f.to<=l)){var p=1!=f.level,m=ni(e,i,p?Math.min(c,f.to)-1:Math.max(l,f.from)).right,g=mg)&&(u=f,d=g)}}return u||(u=r[r.length-1]),u.fromc&&(u={from:u.from,to:c,level:u.level}),u}function Ei(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ii){ii=D("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ii.appendChild(document.createTextNode("x")),ii.appendChild(D("br"));ii.appendChild(document.createTextNode("x"))}E(e.measure,ii);var n=ii.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function Di(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=D("span","xxxxxxxxxx"),n=D("pre",[t],"CodeMirror-line-like");E(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Mi(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+r,i[s]=o.clientWidth}return{fixedPos:Ai(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function Ai(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ni(e){var t=Ei(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Di(e.display)-3);return function(r){if(nn(e.doc,r))return 0;var o=0;if(r.widgets)for(var a=0;a0&&(l=Xe(e.doc,c.line).text).length==c.ch){var u=j(l,l.length,e.options.tabSize)-l.length;c=rt(c.line,Math.max(0,Math.round((o-Un(e.display).left)/Di(e.display))-u))}return c}function Pi(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,i=0;it)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Dt&&en(e.doc,t)r.viewFrom?ji(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)ji(e);else if(t<=r.viewFrom){var o=zi(e,n,n+i,1);o?(r.view=r.view.slice(o.index),r.viewFrom=o.lineN,r.viewTo+=i):ji(e)}else if(n>=r.viewTo){var a=zi(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):ji(e)}else{var s=zi(e,t,t,-1),l=zi(e,n,n+i,1);s&&l?(r.view=r.view.slice(0,s.index).concat(_n(e,s.lineN,l.lineN)).concat(r.view.slice(l.index)),r.viewTo+=i):ji(e)}var c=r.externalMeasured;c&&(n=r.lineN&&t=i.viewTo)){var o=i.view[Pi(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==B(a,n)&&a.push(n)}}}function ji(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function zi(e,t,n,i){var r,o=Pi(e,t),a=e.display.view;if(!Dt||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;r=s+a[o].size-t,o++}else r=s-t;t+=r,n+=r}while(en(e.doc,n)!=n){if(o==(i<0?0:a.length-1))return null;n+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:n}}function Bi(e,t,n){var i=e.display,r=i.view;0==r.length||t>=i.viewTo||n<=i.viewFrom?(i.view=_n(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=_n(e,t,i.viewFrom).concat(i.view):i.viewFromn&&(i.view=i.view.slice(0,Pi(e,n)))),i.viewTo=n}function Ri(e){for(var t=e.display.view,n=0,i=0;i=e.display.viewTo||s.to().line0?t.blinker=setInterval((function(){e.hasFocus()||Zi(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Gi(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Xi(e))}function Yi(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Zi(e))}),100)}function Xi(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ve(e,"focus",e,t),e.state.focused=!0,I(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),Ki(e))}function Zi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ve(e,"blur",e,t),e.state.focused=!1,O(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Qi(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i.005||h<-.005)&&(Je(r.line,l),Ji(r.line),r.rest))for(var f=0;fe.display.sizerWidth){var p=Math.ceil(c/Di(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=r.line,e.display.maxLineChanged=!0)}}}}function Ji(e){if(e.widgets)for(var t=0;t=a&&(o=tt(t,on(Xe(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function tr(e,t){if(!be(e,"scrollCursorIntoView")){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!p){var o=D("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Wn(e.display))+"px;\n height: "+(t.bottom-t.top+Kn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(r),e.display.lineSpace.removeChild(o)}}}function nr(e,t,n,i){var r;null==i&&(i=0),e.options.lineWrapping||t!=n||(t=t.ch?rt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t,n="before"==t.sticky?rt(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=bi(e,t),l=n&&n!=t?bi(e,n):s;r={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i};var c=rr(e,r),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(dr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(fr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return r}function ir(e,t){var n=rr(e,t);null!=n.scrollTop&&dr(e,n.scrollTop),null!=n.scrollLeft&&fr(e,n.scrollLeft)}function rr(e,t){var n=e.display,i=Ei(e.display);t.top<0&&(t.top=0);var r=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=Yn(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+qn(n),l=t.tops-i;if(t.topr+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=r&&(a.scrollTop=u)}var d=e.options.fixedGutter?0:n.gutters.offsetWidth,h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Gn(e)-n.gutters.offsetWidth,p=t.right-t.left>f;return p&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+h-3&&(a.scrollLeft=t.right+(p?0:10)-f),a}function or(e,t){null!=t&&(cr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function ar(e){cr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function sr(e,t,n){null==t&&null==n||cr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function lr(e,t){cr(e),e.curOp.scrollToPos=t}function cr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=yi(e,t.from),i=yi(e,t.to);ur(e,n,i,t.margin)}}function ur(e,t,n,i){var r=rr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-i,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+i});sr(e,r.scrollLeft,r.scrollTop)}function dr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||Vr(e,{top:t}),hr(e,t,!0),n&&Vr(e),Lr(e,100))}function hr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function fr(e,t,n,i){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!i||(e.doc.scrollLeft=t,Ur(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function pr(e){var t=e.display,n=t.gutters.offsetWidth,i=Math.round(e.doc.height+qn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:i,scrollHeight:i+Kn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var mr=function(e,t,n){this.cm=n;var i=this.vert=D("div",[D("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=D("div",[D("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");i.tabIndex=r.tabIndex=-1,e(i),e(r),pe(i,"scroll",(function(){i.clientHeight&&t(i.scrollTop,"vertical")})),pe(r,"scroll",(function(){r.clientWidth&&t(r.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?i+"px":"0";var r=e.viewHeight-(t?i:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==i&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?i:0,bottom:t?i:0}},mr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mr.prototype.zeroWidthHack=function(){var e=b&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mr.prototype.enableZeroWidthBar=function(e,t,n){function i(){var r=e.getBoundingClientRect(),o="vert"==n?document.elementFromPoint(r.right-1,(r.top+r.bottom)/2):document.elementFromPoint((r.right+r.left)/2,r.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,i)}e.style.pointerEvents="auto",t.set(1e3,i)},mr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var gr=function(){};function vr(e,t){t||(t=pr(e));var n=e.display.barWidth,i=e.display.barHeight;br(e,t);for(var r=0;r<4&&n!=e.display.barWidth||i!=e.display.barHeight;r++)n!=e.display.barWidth&&e.options.lineWrapping&&Qi(e),br(e,pr(e)),n=e.display.barWidth,i=e.display.barHeight}function br(e,t){var n=e.display,i=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=i.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=i.bottom)+"px",n.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=i.bottom+"px",n.scrollbarFiller.style.width=i.right+"px"):n.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}gr.prototype.update=function(){return{bottom:0,right:0}},gr.prototype.setScrollLeft=function(){},gr.prototype.setScrollTop=function(){},gr.prototype.clear=function(){};var yr={native:mr,null:gr};function wr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new yr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?fr(e,t):dr(e,t)}),e),e.display.scrollbars.addClass&&I(e.display.wrapper,e.display.scrollbars.addClass)}var xr=0;function _r(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++xr},Cn(e.curOp)}function kr(e){var t=e.curOp;t&&On(t,(function(e){for(var t=0;t=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new $r(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Or(e){e.updatedDisplay=e.mustUpdate&&Br(e.cm,e.update)}function Tr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Qi(t),e.barMeasure=pr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Jn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Kn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Gn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Er(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,i=bt(e,t.highlightFrontier),r=[];t.iter(i.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(i.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ue(t.mode,i.state):null,l=gt(e,o,i,!0);s&&(i.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),h=0;!d&&hn)return Lr(e,e.options.workDelay),!0})),t.highlightFrontier=i.line,t.modeFrontier=Math.max(t.modeFrontier,i.line),r.length&&Mr(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ri(e))return!1;Kr(e)&&(ji(e),t.dims=Mi(e));var r=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(r,n.viewTo)),Dt&&(o=en(e.doc,o),a=tn(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Bi(e,o,a),n.viewOffset=on(Xe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ri(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=jr(e);return l>4&&(n.lineDiv.style.display="none"),Hr(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,zr(c),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Lr(e,400)),n.updateLineNumbers=null,!0}function Rr(e,t){for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Gn(e))i&&(t.visible=er(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+qn(e.display)-Yn(e),n.top)}),t.visible=er(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!Br(e,t))break;Qi(e);var r=pr(e);Vi(e),vr(e,r),qr(e,r),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Vr(e,t){var n=new $r(e,t);if(Br(e,n)){Qi(e),Rr(e,n);var i=pr(e);Vi(e),vr(e,i),qr(e,i),n.finish()}}function Hr(e,t,n){var i=e.display,r=e.options.lineNumbers,o=i.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=i.view,u=i.viewFrom,d=0;d-1&&(f=!1),Mn(e,h,u,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(it(e.options,u)))),a=h.node.nextSibling}else{var p=jn(e,h,u,n);o.insertBefore(p,a)}u+=h.size}while(a)a=s(a)}function Wr(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function qr(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Kn(e)+"px"}function Ur(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=Ai(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,o=i+"px",a=0;as.clientWidth,u=s.scrollHeight>s.clientHeight;if(r&&c||o&&u){if(o&&b&&l)e:for(var h=t.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&ot(e,i.to())<=0)return n}return-1};var ro=function(e,t){this.anchor=e,this.head=t};function oo(e,t,n){var i=e&&e.options.selectionsMayTouch,r=t[n];t.sort((function(e,t){return ot(e.from(),t.from())})),n=B(t,r);for(var o=1;o0:l>=0){var c=ct(s.from(),a.from()),u=lt(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new ro(d?u:c,d?c:u))}}return new io(t,n)}function ao(e,t){return new io([new ro(e,t||e)],0)}function so(e){return e.text?rt(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function lo(e,t){if(ot(e,t.from)<0)return e;if(ot(e,t.to)<=0)return so(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=so(t).ch-t.to.ch),rt(n,i)}function co(e,t){for(var n=[],i=0;i1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}En(e,"change",e,t)}function vo(e,t,n){function i(e,r,o){if(e.linked)for(var a=0;a1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Y(e.done)):void 0}function So(e,t,n,i){var r=e.history;r.undone.length=0;var o,a,s=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&r.lastModTime>s-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=Co(r,r.lastOp==i)))a=Y(o.changes),0==ot(t.from,t.to)&&0==ot(t.from,a.to)?a.to=so(t):o.changes.push(_o(e,t));else{var l=Y(r.done);l&&l.ranges||Eo(e.sel,r.done),o={changes:[_o(e,t)],generation:r.generation},r.done.push(o);while(r.done.length>r.undoDepth)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=s,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,a||ve(e,"historyAdded")}function Oo(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function To(e,t,n,i){var r=e.history,o=i&&i.origin;n==r.lastSelOp||o&&r.lastSelOrigin==o&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==o||Oo(e,o,Y(r.done),t))?r.done[r.done.length-1]=t:Eo(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=o,r.lastSelOp=n,i&&!1!==i.clearRedo&&ko(r.undone)}function Eo(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Do(e,t,n,i){var r=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function Mo(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[d]=c[d],delete c[d])}}}return i}function Lo(e,t,n,i){if(i){var r=e.anchor;if(n){var o=ot(t,r)<0;o!=ot(n,r)<0?(r=t,t=n):o!=ot(t,n)<0&&(t=n)}return new ro(r,t)}return new ro(n||t,t)}function Po(e,t,n,i,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),Ro(e,new io([Lo(e.sel.primary(),t,n,r)],0),i)}function $o(e,t,n){for(var i=[],r=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(r&&(ve(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(i<0?1:-1),h=void 0;if((i<0?u:c)&&(d=Go(e,d,-i,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(h=ot(d,n))&&(i<0?h<0:h>0))return Uo(e,d,t,i,r)}var f=l.find(i<0?-1:1);return(i<0?c:u)&&(f=Go(e,f,i,f.line==t.line?o:null)),f?Uo(e,f,t,i,r):null}}return t}function Ko(e,t,n,i,r){var o=i||1,a=Uo(e,t,n,o,r)||!r&&Uo(e,t,n,o,!0)||Uo(e,t,n,-o,r)||!r&&Uo(e,t,n,-o,!0);return a||(e.cantEdit=!0,rt(e.first,0))}function Go(e,t,n,i){return n<0&&0==t.ch?t.line>e.first?dt(e,rt(t.line-1)):null:n>0&&t.ch==(i||Xe(e,t.line)).text.length?t.line=0;--r)Qo(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text,origin:t.origin});else Qo(e,t)}}function Qo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ot(t.from,t.to)){var n=co(e,t);So(e,t,n,e.cm?e.cm.curOp.id:NaN),ta(e,t,n,jt(e,t));var i=[];vo(e,(function(e,n){n||-1!=B(i,e.history)||(aa(e.history,t),i.push(e.history)),ta(e,t,null,jt(e,t))}))}}function Jo(e,t,n){var i=e.cm&&e.cm.state.suppressEdits;if(!i||n){for(var r,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--f){var p=h(f);if(p)return p.v}}}}function ea(e,t){if(0!=t&&(e.first+=t,e.sel=new io(X(e.sel.ranges,(function(e){return new ro(rt(e.anchor.line+t,e.anchor.ch),rt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){$i(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;ie.lastLine())){if(t.from.lineo&&(t={from:t.from,to:rt(o,Xe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),n||(n=co(e,t)),e.cm?na(e.cm,t,i):go(e,t,i),Vo(e,n,H),e.cantEdit&&Ko(e,rt(e.firstLine(),0))&&(e.cantEdit=!1)}}function na(e,t,n){var i=e.doc,r=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=et(Zt(Xe(i,o.line))),i.iter(l,a.line+1,(function(e){if(e==r.maxLine)return s=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ye(e),go(i,t,n,Ni(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,(function(e){var t=an(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),Tt(i,o.line),Lr(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?$i(e):o.line!=a.line||1!=t.text.length||mo(e.doc,t)?$i(e,o.line,a.line+1,c):Fi(e,o.line,"text");var u=we(e,"changes"),d=we(e,"change");if(d||u){var h={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};d&&En(e,"change",e,h),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function ia(e,t,n,i,r){var o;i||(i=n),ot(i,n)<0&&(o=[i,n],n=o[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),Zo(e,{from:n,to:i,text:t,origin:r})}function ra(e,t,n,i){n1||!(this.children[0]instanceof la))){var s=[];this.collapse(s),this.children=[new la(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=r.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=M("span",[o.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xt(e,t.line,t,n,o)||t.line!=n.line&&Xt(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");At()}o.addToHistory&&So(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,(function(e){c&&o.collapsed&&!c.options.lineWrapping&&Zt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&Je(e,0),Pt(e,new Nt(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){nn(e,t)&&Je(t,0)})),o.clearOnEnter&&pe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Mt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++fa,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)$i(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Fi(c,u,"text");o.atomic&&Wo(c.doc),En(c,"markerAdded",c,o)}return o}pa.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&_r(e),we(this,"clear")){var n=this.find();n&&En(this,"clear",n.from,n.to)}for(var i=null,r=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&$i(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Wo(e.doc)),e&&En(e,"markerCleared",e,this,i,r),t&&kr(e),this.parent&&this.parent.clear()}},pa.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r=0;l--)Zo(this,i[l]);s?Bo(this,s):this.cm&&ar(this.cm)})),undo:Ir((function(){Jo(this,"undo")})),redo:Ir((function(){Jo(this,"redo")})),undoSelection:Ir((function(){Jo(this,"undo",!0)})),redoSelection:Ir((function(){Jo(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,n){e=dt(this,e),t=dt(this,t);var i=[],r=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&r!=e.line||null!=l.from&&r==t.line&&l.from>=t.ch||n&&!n(l.marker)||i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;ie)return t=e,!0;e-=o,++n})),dt(this,rt(n,t))},indexFromPos:function(e){e=dt(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var d=e.dataTransfer.getData("Text");if(d){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Vo(t.doc,ao(n,n)),h)for(var f=0;f=0;t--)ia(e.doc,"",i[t].from,i[t].to,"+delete");ar(e)}))}function Ua(e,t,n){var i=ae(e.text,t+n,n);return i<0||i>e.text.length?null:i}function Ka(e,t,n){var i=Ua(e,t.ch,n);return null==i?null:new rt(t.line,i,n<0?"after":"before")}function Ga(e,t,n,i,r){if(e){"rtl"==t.doc.direction&&(r=-r);var o=he(n,t.doc.direction);if(o){var a,s=r<0?Y(o):o[0],l=r<0==(1==s.level),c=l?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var u=ti(t,n);a=r<0?n.text.length-1:0;var d=ni(t,u,a).top;a=se((function(e){return ni(t,u,e).top==d}),r<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=Ua(n,a,1))}else a=r<0?s.to:s.from;return new rt(i,a,c)}}return new rt(i,r<0?n.text.length:0,r<0?"before":"after")}function Ya(e,t,n,i){var r=he(t,e.doc.direction);if(!r)return Ka(t,n,i);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ue(r,n.ch,n.sticky),a=r[o];if("ltr"==e.doc.direction&&a.level%2==0&&(i>0?a.to>n.ch:a.from=a.from&&h>=u.begin)){var f=d?"before":"after";return new rt(n.line,h,f)}}var p=function(e,t,i){for(var o=function(e,t){return t?new rt(n.line,l(e,1),"before"):new rt(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?i.begin:l(i.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||i>0&&g==t.text.length||(m=p(i>0?0:r.length-1,i,c(g)),!m)?null:m}Fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Fa["default"]=b?Fa.macDefault:Fa.pcDefault;var Xa={selectAll:Yo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),H)},killLine:function(e){return qa(e,(function(t){if(t.empty()){var n=Xe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)r=new rt(r.line,r.ch+1),e.replaceRange(o.charAt(r.ch-1)+o.charAt(r.ch-2),rt(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var a=Xe(e.doc,r.line-1).text;a&&(r=new rt(r.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),rt(r.line-1,a.length-1),r,"+transpose"))}n.push(new ro(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){return Mr(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var i=0;i-1&&(ot((r=s.ranges[r]).from(),t)<0||t.xRel>0)&&(ot(r.to(),t)>0||t.xRel<0)?xs(e,i,t,o):ks(e,i,t,o)}function xs(e,t,n,i){var r=e.display,o=!1,c=Ar(e,(function(t){l&&(r.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Yi(e)),ge(r.wrapper.ownerDocument,"mouseup",c),ge(r.wrapper.ownerDocument,"mousemove",u),ge(r.scroller,"dragstart",d),ge(r.scroller,"drop",c),o||(_e(t),i.addNew||Po(e.doc,n,null,null,i.extend),l&&!h||a&&9==s?setTimeout((function(){r.wrapper.ownerDocument.body.focus({preventScroll:!0}),r.input.focus()}),20):r.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(r.scroller.draggable=!0),e.state.draggingText=c,c.copy=!i.moveOnDrag,pe(r.wrapper.ownerDocument,"mouseup",c),pe(r.wrapper.ownerDocument,"mousemove",u),pe(r.scroller,"dragstart",d),pe(r.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout((function(){return r.input.focus()}),20),r.scroller.dragDrop&&r.scroller.dragDrop()}function _s(e,t,n){if("char"==n)return new ro(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new ro(rt(t.line,0),dt(e.doc,rt(t.line+1,0)));var i=n(e,t);return new ro(i.from,i.to)}function ks(e,t,n,i){a&&Yi(e);var r=e.display,o=e.doc;_e(t);var s,l,c=o.sel,u=c.ranges;if(i.addNew&&!i.extend?(l=o.sel.contains(n),s=l>-1?u[l]:new ro(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==i.unit)i.addNew||(s=new ro(n,n)),n=Li(e,t,!0,!0),l=-1;else{var d=_s(e,n,i.unit);s=i.extend?Lo(s,d.anchor,d.head,i.extend):d}i.addNew?-1==l?(l=u.length,Ro(o,oo(e,u.concat([s]),l),{scroll:!1,origin:"*mouse"})):u.length>1&&u[l].empty()&&"char"==i.unit&&!i.extend?(Ro(o,oo(e,u.slice(0,l).concat(u.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Fo(o,l,s,W):(l=0,Ro(o,new io([s],0),W),c=o.sel);var h=n;function f(t){if(0!=ot(h,t))if(h=t,"rectangle"==i.unit){for(var r=[],a=e.options.tabSize,u=j(Xe(o,n.line).text,n.ch,a),d=j(Xe(o,t.line).text,t.ch,a),f=Math.min(u,d),p=Math.max(u,d),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=Xe(o,m).text,b=U(v,f,a);f==p?r.push(new ro(rt(m,b),rt(m,b))):v.length>b&&r.push(new ro(rt(m,b),rt(m,U(v,p,a))))}r.length||r.push(new ro(n,n)),Ro(o,oo(e,c.ranges.slice(0,l).concat(r),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=s,x=_s(e,t,i.unit),_=w.anchor;ot(x.anchor,_)>0?(y=x.head,_=ct(w.from(),x.anchor)):(y=x.anchor,_=lt(w.to(),x.head));var k=c.ranges.slice(0);k[l]=Cs(e,new ro(dt(o,_),y)),Ro(o,oo(e,k,l),W)}}var p=r.wrapper.getBoundingClientRect(),m=0;function g(t){var n=++m,a=Li(e,t,!0,"rectangle"==i.unit);if(a)if(0!=ot(a,h)){e.curOp.focus=N(),f(a);var s=er(r,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Ar(e,(function(){m==n&&(r.scroller.scrollTop+=l,g(t))})),50)}}function v(t){e.state.selectingText=!1,m=1/0,t&&(_e(t),r.input.focus()),ge(r.wrapper.ownerDocument,"mousemove",b),ge(r.wrapper.ownerDocument,"mouseup",y),o.history.lastSelOrigin=null}var b=Ar(e,(function(e){0!==e.buttons&&Te(e)?g(e):v(e)})),y=Ar(e,v);e.state.selectingText=y,pe(r.wrapper.ownerDocument,"mousemove",b),pe(r.wrapper.ownerDocument,"mouseup",y)}function Cs(e,t){var n=t.anchor,i=t.head,r=Xe(e.doc,n.line);if(0==ot(n,i)&&n.sticky==i.sticky)return t;var o=he(r);if(!o)return t;var a=ue(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(i.line!=n.line)l=(i.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ue(o,i.ch,i.sticky),d=u-a||(i.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var h=o[c+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,m=f?"after":"before";return n.ch==p&&n.sticky==m?t:new ro(new rt(n.line,p,m),i)}function Ss(e,t,n,i){var r,o;if(t.touches)r=t.touches[0].clientX,o=t.touches[0].clientY;else try{r=t.clientX,o=t.clientY}catch(h){return!1}if(r>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&_e(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!we(e,n))return Ce(t);o-=s.top-a.viewOffset;for(var l=0;l=r){var u=tt(e.doc,o),d=e.display.gutterSpecs[l];return ve(e,n,e,u,d.className,t),Ce(t)}}}function Os(e,t){return Ss(e,t,"gutterClick",!0)}function Ts(e,t){Hn(e.display,t)||Es(e,t)||be(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function Es(e,t){return!!we(e,"gutterContextMenu")&&Ss(e,t,"gutterContextMenu",!1)}function Ds(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),di(e)}ms.prototype.compare=function(e,t,n){return this.time+ps>e&&0==ot(t,this.pos)&&n==this.button};var Ms={toString:function(){return"CodeMirror.Init"}},As={},Ns={};function Is(e){var t=e.optionHandlers;function n(n,i,r,o){e.defaults[n]=i,r&&(t[n]=o?function(e,t,n){n!=Ms&&r(e,t,n)}:r)}e.defineOption=n,e.Init=Ms,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,fo(e)}),!0),n("indentUnit",2,fo,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){po(e),di(e),$i(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],i=e.doc.first;e.doc.iter((function(e){for(var r=0;;){var o=e.text.indexOf(t,r);if(-1==o)break;r=o+t.length,n.push(rt(i,o))}i++}));for(var r=n.length-1;r>=0;r--)ia(e.doc,t,n[r],rt(n[r].line,n[r].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=Ms&&e.refresh()})),n("specialCharPlaceholder",mn,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){Ds(e),Xr(e)}),!0),n("keyMap","default",(function(e,t,n){var i=Wa(t),r=n!=Ms&&Wa(n);r&&r.detach&&r.detach(e,i),i.attach&&i.attach(e,r||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ps,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=Gr(t,e.options.lineNumbers),Xr(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?Ai(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return vr(e)}),!0),n("scrollbarStyle","native",(function(e){wr(e),vr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=Gr(e.options.gutters,t),Xr(e)}),!0),n("firstLineNumber",1,Xr,!0),n("lineNumberFormatter",(function(e){return e}),Xr,!0),n("showCursorWhenSelecting",!1,Vi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(Zi(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,Ls),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Vi,!0),n("singleCursorHeightPerLine",!0,Vi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,po,!0),n("addModeClass",!1,po,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,po,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}function Ls(e,t,n){var i=n&&n!=Ms;if(!t!=!i){var r=e.display.dragFunctions,o=t?pe:ge;o(e.display.scroller,"dragstart",r.start),o(e.display.scroller,"dragenter",r.enter),o(e.display.scroller,"dragover",r.over),o(e.display.scroller,"dragleave",r.leave),o(e.display.scroller,"drop",r.drop)}}function Ps(e){e.options.lineWrapping?(I(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(O(e.display.wrapper,"CodeMirror-wrap"),sn(e)),Ii(e),$i(e),di(e),setTimeout((function(){return vr(e)}),100)}function $s(e,t){var n=this;if(!(this instanceof $s))return new $s(e,t);this.options=t=t?F(t):{},F(As,t,!1);var i=t.value;"string"==typeof i?i=new _a(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var r=new $s.inputStyles[t.inputStyle](this),o=this.display=new Zr(e,i,r,t);for(var c in o.wrapper.CodeMirror=this,Ds(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new z,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Fs(this),Ma(),_r(this),this.curOp.forceUpdate=!0,bo(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xi(n)}),20):Zi(this),Ns)Ns.hasOwnProperty(c)&&Ns[c](this,t[c],Ms);Kr(this),t.finishInit&&t.finishInit(this);for(var u=0;u400}pe(t.scroller,"touchstart",(function(r){if(!be(e,r)&&!o(r)&&!Os(e,r)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-i.end<=300?i:null},1==r.touches.length&&(t.activeTouch.left=r.touches[0].pageX,t.activeTouch.top=r.touches[0].pageY)}})),pe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),pe(t.scroller,"touchend",(function(n){var i=t.activeTouch;if(i&&!Hn(t,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!i.prev||l(i,i.prev)?new ro(a,a):!i.prev.prev||l(i,i.prev.prev)?e.findWordAt(a):new ro(rt(a.line,0),dt(e.doc,rt(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),_e(n)}r()})),pe(t.scroller,"touchcancel",r),pe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(dr(e,t.scroller.scrollTop),fr(e,t.scroller.scrollLeft,!0),ve(e,"scroll",e))})),pe(t.scroller,"mousewheel",(function(t){return no(e,t)})),pe(t.scroller,"DOMMouseScroll",(function(t){return no(e,t)})),pe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){be(e,t)||Se(t)},over:function(t){be(e,t)||(Oa(e,t),Se(t))},start:function(t){return Sa(e,t)},drop:Ar(e,Ca),leave:function(t){be(e,t)||Ta(e)}};var c=t.input.getField();pe(c,"keyup",(function(t){return us.call(e,t)})),pe(c,"keydown",Ar(e,ls)),pe(c,"keypress",Ar(e,ds)),pe(c,"focus",(function(t){return Xi(e,t)})),pe(c,"blur",(function(t){return Zi(e,t)}))}$s.defaults=As,$s.optionHandlers=Ns;var js=[];function zs(e,t,n,i){var r,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?r=bt(e,t).state:n="prev");var a=e.options.tabSize,s=Xe(o,t),l=j(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(r,s.text.slice(u.length),s.text),c==V||c>150)){if(!i)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?j(Xe(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var f=Math.floor(c/a);f;--f)h+=a,d+="\t";if(ha,l=Ie(t),c=null;if(s&&i.ranges.length>1)if(Bs&&Bs.text.join("\n")==t){if(i.ranges.length%Bs.text.length==0){c=[];for(var u=0;u=0;h--){var f=i.ranges[h],p=f.from(),m=f.to();f.empty()&&(n&&n>0?p=rt(p.line,p.ch-n):e.state.overwrite&&!s?m=rt(m.line,Math.min(Xe(o,m.line).text.length,m.ch+Y(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=m=rt(p.line,0)));var g={from:p,to:m,text:c?c[h%c.length]:l,origin:r||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};Zo(e.doc,g),En(e,"inputRead",e,g)}t&&!s&&Ws(e,t),ar(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Hs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Mr(t,(function(){return Vs(t,n,0,null,"paste")})),!0}function Ws(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,i=n.ranges.length-1;i>=0;i--){var r=n.ranges[i];if(!(r.head.ch>100||i&&n.ranges[i-1].head.line==r.head.line)){var o=e.getModeAt(r.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=zs(e,r.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xe(e.doc,r.head.line).text.slice(0,r.head.ch))&&(a=zs(e,r.head.line,"smart"));a&&En(e,"electricInput",e,r.head.line)}}}function qs(e){for(var t=[],n=[],i=0;in&&(zs(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&ar(this));else{var o=r.from(),a=r.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Fo(this.doc,i,new ro(o,c[i].to()),H)}}})),getTokenAt:function(e,t){return kt(this,e,t)},getLineTokens:function(e,t){return kt(this,rt(e),t,!0)},getTokenTypeAt:function(e){e=dt(this.doc,e);var t,n=vt(this,Xe(this.doc,e.line)),i=0,r=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=i+r>>1;if((a?n[2*a-1]:0)>=o)r=a;else{if(!(n[2*a+1]o&&(e=o,r=!0),i=Xe(this.doc,e)}else i=e;return mi(this,i,{top:0,left:0},t||"page",n||r).top+(r?this.doc.height-on(i):0)},defaultTextHeight:function(){return Ei(this.display)},defaultCharWidth:function(){return Di(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,i,r){var o=this.display;e=bi(this,dt(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==i)a=e.top;else if("above"==i||"near"==i){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==i||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==r?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&ir(this,{left:s,top:a,right:s+t.offsetWidth,bottom:a+t.offsetHeight})},triggerOnKeyDown:Nr(ls),triggerOnKeyPress:Nr(ds),triggerOnKeyUp:us,triggerOnMouseDown:Nr(vs),execCommand:function(e){if(Xa.hasOwnProperty(e))return Xa[e].call(null,this)},triggerElectric:Nr((function(e){Ws(this,e)})),findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var o=dt(this.doc,e),a=0;a0&&s(n.charAt(i-1)))--i;while(r.5||this.options.lineWrapping)&&Ii(this),ve(this,"refresh",this)})),swapDoc:Nr((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,e),di(this),this.display.input.reset(),sr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,En(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},xe(e),e.registerHelper=function(t,i,r){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][i]=r},e.registerGlobalHelper=function(t,i,r,o){e.registerHelper(t,i,o),n[t]._global.push({pred:r,val:o})}}function Ys(e,t,n,i,r){var o=t,a=n,s=Xe(e,t.line),l=r&&"rtl"==e.direction?-n:n;function c(){var n=t.line+l;return!(n=e.first+e.size)&&(t=new rt(n,t.ch,t.sticky),s=Xe(e,n))}function u(o){var a;if("codepoint"==i){var u=s.text.charCodeAt(t.ch+(i>0?0:-1));a=isNaN(u)?null:new rt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(u>=55296&&u<56320?2:1))),-n)}else a=r?Ya(e.cm,s,t,n):Ka(s,t,n);if(null==a){if(o||!c())return!1;t=Ga(r,e.cm,s,t.line,l)}else t=a;return!0}if("char"==i||"codepoint"==i)u();else if("column"==i)u(!0);else if("word"==i||"group"==i)for(var d=null,h="group"==i,f=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;;p=!1){if(n<0&&!u(!p))break;var m=s.text.charAt(t.ch)||"\n",g=ne(m,f)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(!h||p||g||(g="s"),d&&d!=g){n<0&&(n=1,u(),t.sticky="after");break}if(g&&(d=g),n>0&&!u(!p))break}var v=Ko(e,t,o,a,!0);return at(o,v)&&(v.hitSide=!0),v}function Xs(e,t,n,i){var r,o,a=e.doc,s=t.left;if("page"==i){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*Ei(e.display),3);r=(n>0?t.bottom:t.top)+n*c}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;;){if(o=xi(e,s,r),!o.outside)break;if(n<0?r<=0:r>=a.height){o.hitSide=!0;break}r+=5*n}return o}var Zs=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(e,t){var n=ei(e,t.line);if(!n||n.hidden)return null;var i=Xe(e.doc,t.line),r=Zn(n,i,t.line),o=he(i,e.doc.direction),a="left";if(o){var s=ue(o,t.ch);a=s%2?"right":"left"}var l=oi(r.map,t.ch,a);return l.offset="right"==l.collapse?l.end:l.start,l}function Js(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function el(e,t){return t&&(e.bad=!0),e}function tl(e,t,n,i,r){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(e){return function(t){return t.id==e}}function u(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(e){e&&(u(),o+=e)}function h(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void d(n);var o,f=t.getAttribute("cm-marker");if(f){var p=e.findMarks(rt(i,0),rt(r+1,0),c(+f));return void(p.length&&(o=p[0].find(0))&&d(Ze(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;m&&u();for(var g=0;g=t.display.viewTo||o.line=t.display.viewFrom&&Qs(t,r)||{node:l[0].measure.map[2],offset:0},u=o.linei.firstLine()&&(a=rt(a.line-1,Xe(i.doc,a.line-1).length)),s.ch==Xe(i.doc,s.line).text.length&&s.liner.viewTo-1)return!1;a.line==r.viewFrom||0==(e=Pi(i,a.line))?(t=et(r.view[0].line),n=r.view[0].node):(t=et(r.view[e].line),n=r.view[e-1].node.nextSibling);var l,c,u=Pi(i,s.line);if(u==r.view.length-1?(l=r.viewTo-1,c=r.lineDiv.lastChild):(l=et(r.view[u+1].line)-1,c=r.view[u+1].node.previousSibling),!n)return!1;var d=i.doc.splitLines(tl(i,n,c,t,l)),h=Ze(i.doc,rt(t,0),rt(l,Xe(i.doc,l).text.length));while(d.length>1&&h.length>1)if(Y(d)==Y(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),t++}var f=0,p=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);while(fa.ch&&b.charCodeAt(b.length-p-1)==y.charCodeAt(y.length-p-1))f--,p++;d[d.length-1]=b.slice(0,b.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var x=rt(t,f),_=rt(l,h.length?Y(h).length-p:0);return d.length>1||d[0]||ot(x,_)?(ia(i.doc,d,x,_,"+input"),!0):void 0},Zs.prototype.ensurePolled=function(){this.forceCompositionEnd()},Zs.prototype.reset=function(){this.forceCompositionEnd()},Zs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Zs.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Zs.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Mr(this.cm,(function(){return $i(e.cm)}))},Zs.prototype.setUneditable=function(e){e.contentEditable="false"},Zs.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ar(this.cm,Vs)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Zs.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Zs.prototype.onContextMenu=function(){},Zs.prototype.resetPosition=function(){},Zs.prototype.needsContentAttribute=!0;var rl=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function ol(e,t){if(t=t?F(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=N();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function i(){e.value=s.getValue()}var r;if(e.form&&(pe(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var o=e.form;r=o.submit;try{var a=o.submit=function(){i(),o.submit=r,o.submit(),o.submit=a}}catch(l){}}t.finishInit=function(n){n.save=i,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,i(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(ge(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=r))}},e.style.display="none";var s=$s((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s}function al(e){e.off=ge,e.on=pe,e.wheelEventPixels=to,e.Doc=_a,e.splitLines=Ie,e.countColumn=j,e.findColumn=U,e.isWordChar=te,e.Pass=V,e.signal=ve,e.Line=ln,e.changeEnd=so,e.scrollbarModel=yr,e.Pos=rt,e.cmpPos=ot,e.modes=je,e.mimeModes=ze,e.resolveMode=Ve,e.getMode=He,e.modeExtensions=We,e.extendMode=qe,e.copyState=Ue,e.startState=Ge,e.innerMode=Ke,e.commands=Xa,e.keyMap=Fa,e.keyName=Ha,e.isModifierKey=Ra,e.lookupKey=Ba,e.normalizeKeyMap=za,e.StringStream=Ye,e.SharedTextMarker=ga,e.TextMarker=pa,e.LineWidget=ua,e.e_preventDefault=_e,e.e_stopPropagation=ke,e.e_stop=Se,e.addClass=I,e.contains=A,e.rmClass=O,e.keyNames=Ia}rl.prototype.init=function(e){var t=this,n=this,i=this.cm;this.createField(e);var r=this.textarea;function o(e){if(!be(i,e)){if(i.somethingSelected())Rs({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=qs(i);Rs({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,H):(n.prevInput="",r.value=t.text.join("\n"),P(r))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(r.style.width="0px"),pe(r,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),pe(r,"paste",(function(e){be(i,e)||Hs(e,i)||(i.state.pasteIncoming=+new Date,n.fastPoll())})),pe(r,"cut",o),pe(r,"copy",o),pe(e.scroller,"paste",(function(t){if(!Hn(e,t)&&!be(i,t)){if(!r.dispatchEvent)return i.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,r.dispatchEvent(o)}})),pe(e.lineSpace,"selectstart",(function(t){Hn(e,t)||_e(t)})),pe(r,"compositionstart",(function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}})),pe(r,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},rl.prototype.createField=function(e){this.wrapper=Ks(),this.textarea=this.wrapper.firstChild},rl.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},rl.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,i=Hi(e);if(e.options.moveInputWithCursor){var r=bi(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+a.top-o.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+a.left-o.left))}return i},rl.prototype.showSelection=function(e){var t=this.cm,n=t.display;E(n.cursorDiv,e.cursors),E(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},rl.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&P(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},rl.prototype.getField=function(){return this.textarea},rl.prototype.supportsTouch=function(){return!1},rl.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||N()!=this.textarea))try{this.textarea.focus()}catch(e){}},rl.prototype.blur=function(){this.textarea.blur()},rl.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rl.prototype.receivedFocus=function(){this.slowPoll()},rl.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},rl.prototype.fastPoll=function(){var e=!1,t=this;function n(){var i=t.poll();i||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}t.pollingFast=!0,t.polling.set(20,n)},rl.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||Le(n)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var r=n.value;if(r==i&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===r||b&&/[\uf700-\uf7ff]/.test(r))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}var l=0,c=Math.min(i.length,r.length);while(l1e3||r.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=r,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},rl.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rl.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},rl.prototype.onContextMenu=function(e){var t=this,n=t.cm,i=n.display,r=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Li(n,e),c=i.scroller.scrollTop;if(o&&!d){var u=n.options.resetSelectionOnContextMenu;u&&-1==n.doc.sel.contains(o)&&Ar(n,Ro)(n.doc,ao(o),H);var h,f=r.style.cssText,p=t.wrapper.style.cssText,m=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",r.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-m.top-5)+"px; left: "+(e.clientX-m.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(h=window.scrollY),i.input.focus(),l&&window.scrollTo(null,h),i.input.reset(),n.somethingSelected()||(r.value=t.prevInput=" "),t.contextMenuPending=b,i.selForContextMenu=n.doc.sel,clearTimeout(i.detectingSelectAll),a&&s>=9&&v(),k){Se(e);var g=function e(){ge(window,"mouseup",e),setTimeout(b,20)};pe(window,"mouseup",g)}else setTimeout(b,50)}function v(){if(null!=r.selectionStart){var e=n.somethingSelected(),o="​"+(e?r.value:"");r.value="⇚",r.value=o,t.prevInput=e?"":"​",r.selectionStart=1,r.selectionEnd=o.length,i.selForContextMenu=n.doc.sel}}function b(){if(t.contextMenuPending==b&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,r.style.cssText=f,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=c),null!=r.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function o(){i.selForContextMenu==n.doc.sel&&0==r.selectionStart&&r.selectionEnd>0&&"​"==t.prevInput?Ar(n,Yo)(n):e++<10?i.detectingSelectAll=setTimeout(o,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(o,200)}}},rl.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},rl.prototype.setUneditable=function(){},rl.prototype.needsContentAttribute=!1,Is($s),Gs($s);var sl="iter insert remove copy getEditor constructor".split(" ");for(var ll in _a.prototype)_a.prototype.hasOwnProperty(ll)&&B(sl,ll)<0&&($s.prototype[ll]=function(e){return function(){return e.apply(this.doc,arguments)}}(_a.prototype[ll]));return xe(_a),$s.inputStyles={textarea:rl,contenteditable:Zs},$s.defineMode=function(e){$s.defaults.mode||"null"==e||($s.defaults.mode=e),Be.apply(this,arguments)},$s.defineMIME=Re,$s.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),$s.defineMIME("text/plain","null"),$s.defineExtension=function(e,t){$s.prototype[e]=t},$s.defineDocExtension=function(e,t){_a.prototype[e]=t},$s.fromTextArea=ol,al($s),$s.version="5.58.3",$s}))},"56ef":function(e,t,n){var i=n("d066"),r=n("241c"),o=n("7418"),a=n("825a");e.exports=i("Reflect","ownKeys")||function(e){var t=r.f(a(e)),n=o.f;return n?t.concat(n(e)):t}},"576e":function(e,t,n){},5899:function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(e,t,n){var i=n("1d80"),r=n("5899"),o="["+r+"]",a=RegExp("^"+o+o+"*"),s=RegExp(o+o+"*$"),l=function(e){return function(t){var n=String(i(t));return 1&e&&(n=n.replace(a,"")),2&e&&(n=n.replace(s,"")),n}};e.exports={start:l(1),end:l(2),trim:l(3)}},5924:function(e,t,n){"use strict";n("a4d3"),n("e01a"),n("d28b"),n("4de4"),n("caad"),n("c975"),n("e260"),n("a9e3"),n("d3b7"),n("ac1f"),n("2532"),n("3ca3"),n("466d"),n("5319"),n("1276"),n("ddb0");var i=n("7037");t.__esModule=!0,t.isInContainer=t.getScrollContainer=t.isScroll=t.getStyle=t.once=t.off=t.on=void 0;var r="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};t.hasClass=g,t.addClass=v,t.removeClass=b,t.setStyle=w;var o=n("8bbf"),a=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var l=a.default.prototype.$isServer,c=/([\:\-\_]+(.))/g,u=/^moz([A-Z])/,d=l?0:Number(document.documentMode),h=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},f=function(e){return e.replace(c,(function(e,t,n,i){return i?n.toUpperCase():n})).replace(u,"Moz$1")},p=t.on=function(){return!l&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)}}(),m=t.off=function(){return!l&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)}}();function g(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function v(e,t){if(e){for(var n=e.className,i=(t||"").split(" "),r=0,o=i.length;ri.top&&n.right>i.left&&n.lefte?c():!0!==t&&(r=setTimeout(i?u:c,void 0===i?e-s:e))}return"boolean"!==typeof t&&(i=n,n=t,t=void 0),a}},"5a34":function(e,t,n){var i=n("44e7");e.exports=function(e){if(i(e))throw TypeError("The method doesn't accept regular expressions");return e}},"5a43":function(e,t){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);nn.indentOf||n.innerModeForLine&&!t.sol()||i)return n.innerMode?(n.innerState||(n.innerState=n.innerMode.startState?e.startState(n.innerMode,t.indentation()):{}),t.hideFirstChars(n.indentOf+2,(function(){return n.innerMode.token(t,n.innerState)||!0}))):(t.skipToEnd(),n.indentToken);t.sol()&&(n.indentOf=1/0,n.indentToken=null,n.innerMode=null,n.innerState=null)}function G(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function Y(){return new l}function X(e){return e.copy()}function Z(e,t){var n=K(e,t)||G(e,t)||p(e,t)||C(e,t)||M(e,t)||j(e,t)||c(e,t)||u(e,t)||T(e,t)||d(e)||h(e)||f(e,t)||m(e,t)||g(e,t)||v(e)||b(e,t)||y(e,t)||w(e,t)||x(e,t)||_(e,t)||k(e,t)||S(e,t)||O(e,t)||E(e,t)||D(e,t)||A(e,t)||N(e,t)||I(e,t)||L(e,t)||P(e)||$(e)||F(e,t)||z(e,t)||B(e)||H(e,t)||R(e,t)||V(e)||W(e,t)||q(e);return!0===n?null:n}return l.prototype.copy=function(){var t=new l;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(s,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:Y,copyState:X,token:Z}}),"javascript","css","htmlmixed"),e.defineMIME("text/x-pug","pug"),e.defineMIME("text/x-jade","pug")}))},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5c96":function(e,t,n){n("a4d3"),n("e01a"),n("d28b"),n("944a"),n("99af"),n("a623"),n("cb29"),n("4de4"),n("7db0"),n("4160"),n("caad"),n("c975"),n("e260"),n("a15b"),n("d81d"),n("13d5"),n("fb6a"),n("45fc"),n("a434"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("9129"),n("c35a"),n("b680"),n("cca6"),n("dca8"),n("b64b"),n("d3b7"),n("07ac"),n("e6cf"),n("4d63"),n("ac1f"),n("25f0"),n("2532"),n("3ca3"),n("466d"),n("5319"),n("1276"),n("498a"),n("c7cd"),n("9911"),n("c96a"),n("159b"),n("ddb0"),n("2b3d");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=45)}([function(e,t){e.exports=n("d940")},function(e,t){e.exports=n("5924")},function(e,t){e.exports=n("8122")},function(e,t){e.exports=n("d010")},function(e,t){e.exports=n("6b7c")},function(e,t){e.exports=n("e974")},function(e,t){e.exports=n("8bbf")},function(e,t){e.exports=n("7f4d")},function(e,t){e.exports=n("f3ad")},function(e,t){e.exports=n("2bb5")},function(e,t){e.exports=n("417f")},function(e,t){e.exports=n("4897")},function(e,t){e.exports=n("eedf")},function(e,t){e.exports=n("4010")},function(e,t){e.exports=n("5128")},function(e,t){e.exports=n("0e15")},function(e,t){e.exports=n("dcdc")},function(e,t){e.exports=n("14e9")},function(e,t){e.exports=n("a742")},function(e,t){e.exports=n("d397")},function(e,t){e.exports=n("d7d1")},function(e,t){e.exports=n("5488")},function(e,t){e.exports=n("12f2")},function(e,t){e.exports=n("41f8")},function(e,t){e.exports=n("92fa")},function(e,t){e.exports=n("597f")},function(e,t){e.exports=n("299c")},function(e,t){e.exports=n("2a5e")},function(e,t){e.exports=n("e452")},function(e,t){e.exports=n("845f")},function(e,t){e.exports=n("8bbc")},function(e,t){e.exports=n("e62d")},function(e,t){e.exports=n("7fc1")},function(e,t){e.exports=n("c56a")},function(e,t){e.exports=n("c284")},function(e,t){e.exports=n("9619")},function(e,t){e.exports=n("4e4b")},function(e,t){e.exports=n("e772")},function(e,t){e.exports=n("c098")},function(e,t){e.exports=n("722f")},function(e,t){e.exports=n("4cb2")},function(e,t){e.exports=n("e450")},function(e,t){e.exports=n("4726")},function(e,t){e.exports=n("f494")},function(e,t){e.exports=n("6ac9")},function(e,t,n){e.exports=n(46)},function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{staticClass:"el-pager",on:{click:e.onPagerClick}},[e.pageCount>0?n("li",{staticClass:"number",class:{active:1===e.currentPage,disabled:e.disabled}},[e._v("1")]):e._e(),e.showPrevMore?n("li",{staticClass:"el-icon more btn-quickprev",class:[e.quickprevIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("left")},mouseleave:function(t){e.quickprevIconClass="el-icon-more"}}}):e._e(),e._l(e.pagers,(function(t){return n("li",{key:t,staticClass:"number",class:{active:e.currentPage===t,disabled:e.disabled}},[e._v(e._s(t))])})),e.showNextMore?n("li",{staticClass:"el-icon more btn-quicknext",class:[e.quicknextIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("right")},mouseleave:function(t){e.quicknextIconClass="el-icon-more"}}}):e._e(),e.pageCount>1?n("li",{staticClass:"number",class:{active:e.currentPage===e.pageCount,disabled:e.disabled}},[e._v(e._s(e.pageCount))]):e._e()],2)},o=[];r._withStripped=!0;var a={name:"ElPager",props:{currentPage:Number,pageCount:Number,pagerCount:Number,disabled:Boolean},watch:{showPrevMore:function(e){e||(this.quickprevIconClass="el-icon-more")},showNextMore:function(e){e||(this.quicknextIconClass="el-icon-more")}},methods:{onPagerClick:function(e){var t=e.target;if("UL"!==t.tagName&&!this.disabled){var n=Number(e.target.textContent),i=this.pageCount,r=this.currentPage,o=this.pagerCount-2;-1!==t.className.indexOf("more")&&(-1!==t.className.indexOf("quickprev")?n=r-o:-1!==t.className.indexOf("quicknext")&&(n=r+o)),isNaN(n)||(n<1&&(n=1),n>i&&(n=i)),n!==r&&this.$emit("change",n)}},onMouseenter:function(e){this.disabled||("left"===e?this.quickprevIconClass="el-icon-d-arrow-left":this.quicknextIconClass="el-icon-d-arrow-right")}},computed:{pagers:function(){var e=this.pagerCount,t=(e-1)/2,n=Number(this.currentPage),i=Number(this.pageCount),r=!1,o=!1;i>e&&(n>e-t&&(r=!0),n4&&e<22&&e%2===1},default:7},currentPage:{type:Number,default:1},layout:{default:"prev, pager, next, jumper, ->, total"},pageSizes:{type:Array,default:function(){return[10,20,30,40,50,100]}},popperClass:String,prevText:String,nextText:String,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean},data:function(){return{internalCurrentPage:1,internalPageSize:0,lastEmittedPage:-1,userChangePageSize:!1}},render:function(e){var t=this.layout;if(!t)return null;if(this.hideOnSinglePage&&(!this.internalPageCount||1===this.internalPageCount))return null;var n=e("div",{class:["el-pagination",{"is-background":this.background,"el-pagination--small":this.small}]}),i={prev:e("prev"),jumper:e("jumper"),pager:e("pager",{attrs:{currentPage:this.internalCurrentPage,pageCount:this.internalPageCount,pagerCount:this.pagerCount,disabled:this.disabled},on:{change:this.handleCurrentChange}}),next:e("next"),sizes:e("sizes",{attrs:{pageSizes:this.pageSizes}}),slot:e("slot",[this.$slots.default?this.$slots.default:""]),total:e("total")},r=t.split(",").map((function(e){return e.trim()})),o=e("div",{class:"el-pagination__rightwrapper"}),a=!1;return n.children=n.children||[],o.children=o.children||[],r.forEach((function(e){"->"!==e?a?o.children.push(i[e]):n.children.push(i[e]):a=!0})),a&&n.children.unshift(o),n},components:{Prev:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage<=1},class:"btn-prev",on:{click:this.$parent.prev}},[this.$parent.prevText?e("span",[this.$parent.prevText]):e("i",{class:"el-icon el-icon-arrow-left"})])}},Next:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage===this.$parent.internalPageCount||0===this.$parent.internalPageCount},class:"btn-next",on:{click:this.$parent.next}},[this.$parent.nextText?e("span",[this.$parent.nextText]):e("i",{class:"el-icon el-icon-arrow-right"})])}},Sizes:{mixins:[b.a],props:{pageSizes:Array},watch:{pageSizes:{immediate:!0,handler:function(e,t){Object(y["valueEquals"])(e,t)||Array.isArray(e)&&(this.$parent.internalPageSize=e.indexOf(this.$parent.pageSize)>-1?this.$parent.pageSize:this.pageSizes[0])}}},render:function(e){var t=this;return e("span",{class:"el-pagination__sizes"},[e("el-select",{attrs:{value:this.$parent.internalPageSize,popperClass:this.$parent.popperClass||"",size:"mini",disabled:this.$parent.disabled},on:{input:this.handleChange}},[this.pageSizes.map((function(n){return e("el-option",{attrs:{value:n,label:n+t.t("el.pagination.pagesize")}})}))])])},components:{ElSelect:h.a,ElOption:p.a},methods:{handleChange:function(e){e!==this.$parent.internalPageSize&&(this.$parent.internalPageSize=e=parseInt(e,10),this.$parent.userChangePageSize=!0,this.$parent.$emit("update:pageSize",e),this.$parent.$emit("size-change",e))}}},Jumper:{mixins:[b.a],components:{ElInput:g.a},data:function(){return{userInput:null}},watch:{"$parent.internalCurrentPage":function(){this.userInput=null}},methods:{handleKeyup:function(e){var t=e.keyCode,n=e.target;13===t&&this.handleChange(n.value)},handleInput:function(e){this.userInput=e},handleChange:function(e){this.$parent.internalCurrentPage=this.$parent.getValidCurrentPage(e),this.$parent.emitChange(),this.userInput=null}},render:function(e){return e("span",{class:"el-pagination__jump"},[this.t("el.pagination.goto"),e("el-input",{class:"el-pagination__editor is-in-pagination",attrs:{min:1,max:this.$parent.internalPageCount,value:null!==this.userInput?this.userInput:this.$parent.internalCurrentPage,type:"number",disabled:this.$parent.disabled},nativeOn:{keyup:this.handleKeyup},on:{input:this.handleInput,change:this.handleChange}}),this.t("el.pagination.pageClassifier")])}},Total:{mixins:[b.a],render:function(e){return"number"===typeof this.$parent.total?e("span",{class:"el-pagination__total"},[this.t("el.pagination.total",{total:this.$parent.total})]):""}},Pager:u},methods:{handleCurrentChange:function(e){this.internalCurrentPage=this.getValidCurrentPage(e),this.userChangePageSize=!0,this.emitChange()},prev:function(){if(!this.disabled){var e=this.internalCurrentPage-1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("prev-click",this.internalCurrentPage),this.emitChange()}},next:function(){if(!this.disabled){var e=this.internalCurrentPage+1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("next-click",this.internalCurrentPage),this.emitChange()}},getValidCurrentPage:function(e){e=parseInt(e,10);var t="number"===typeof this.internalPageCount,n=void 0;return t?e<1?n=1:e>this.internalPageCount&&(n=this.internalPageCount):(isNaN(e)||e<1)&&(n=1),(void 0===n&&isNaN(e)||0===n)&&(n=1),void 0===n?e:n},emitChange:function(){var e=this;this.$nextTick((function(){(e.internalCurrentPage!==e.lastEmittedPage||e.userChangePageSize)&&(e.$emit("current-change",e.internalCurrentPage),e.lastEmittedPage=e.internalCurrentPage,e.userChangePageSize=!1)}))}},computed:{internalPageCount:function(){return"number"===typeof this.total?Math.max(1,Math.ceil(this.total/this.internalPageSize)):"number"===typeof this.pageCount?Math.max(1,this.pageCount):null}},watch:{currentPage:{immediate:!0,handler:function(e){this.internalCurrentPage=this.getValidCurrentPage(e)}},pageSize:{immediate:!0,handler:function(e){this.internalPageSize=isNaN(e)?10:e}},internalCurrentPage:{immediate:!0,handler:function(e){this.$emit("update:currentPage",e),this.lastEmittedPage=-1}},internalPageCount:function(e){var t=this.internalCurrentPage;e>0&&0===t?this.internalCurrentPage=1:t>e&&(this.internalCurrentPage=0===e?1:e,this.userChangePageSize&&this.emitChange()),this.userChangePageSize=!1}},install:function(e){e.component(w.name,w)}},x=w,_=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"dialog-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-dialog__wrapper",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[n("div",{key:e.key,ref:"dialog",class:["el-dialog",{"is-fullscreen":e.fullscreen,"el-dialog--center":e.center},e.customClass],style:e.style,attrs:{role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"}},[n("div",{staticClass:"el-dialog__header"},[e._t("title",[n("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]),e.showClose?n("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:e.handleClose}},[n("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2),e.rendered?n("div",{staticClass:"el-dialog__body"},[e._t("default")],2):e._e(),e.$slots.footer?n("div",{staticClass:"el-dialog__footer"},[e._t("footer")],2):e._e()])])])},k=[];_._withStripped=!0;var C=n(14),S=n.n(C),O=n(9),T=n.n(O),E=n(3),D=n.n(E),M={name:"ElDialog",mixins:[S.a,D.a,T.a],props:{title:{type:String,default:""},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},width:String,fullscreen:Boolean,customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:Function,center:{type:Boolean,default:!1},destroyOnClose:Boolean},data:function(){return{closed:!1,key:0}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick((function(){t.$refs.dialog.scrollTop=0})),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"),this.destroyOnClose&&this.$nextTick((function(){t.key++})))}},computed:{style:function(){var e={};return this.fullscreen||(e.marginTop=this.top,this.width&&(e.width=this.width)),e}},methods:{getMigratingConfig:function(){return{props:{size:"size is removed."}}},handleWrapperClick:function(){this.closeOnClickModal&&this.handleClose()},handleClose:function(){"function"===typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper:function(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},A=M,N=l(A,_,k,!1,null,null,null);N.options.__file="packages/dialog/src/component.vue";var I=N.exports;I.install=function(e){e.component(I.name,I)};var L=I,P=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.close,expression:"close"}],staticClass:"el-autocomplete",attrs:{"aria-haspopup":"listbox",role:"combobox","aria-expanded":e.suggestionVisible,"aria-owns":e.id}},[n("el-input",e._b({ref:"input",on:{input:e.handleInput,change:e.handleChange,focus:e.handleFocus,blur:e.handleBlur,clear:e.handleClear},nativeOn:{keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex-1)},function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex+1)},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleKeyEnter(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab")?null:e.close(t)}]}},"el-input",[e.$props,e.$attrs],!1),[e.$slots.prepend?n("template",{slot:"prepend"},[e._t("prepend")],2):e._e(),e.$slots.append?n("template",{slot:"append"},[e._t("append")],2):e._e(),e.$slots.prefix?n("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),e.$slots.suffix?n("template",{slot:"suffix"},[e._t("suffix")],2):e._e()],2),n("el-autocomplete-suggestions",{ref:"suggestions",class:[e.popperClass?e.popperClass:""],attrs:{"visible-arrow":"","popper-options":e.popperOptions,"append-to-body":e.popperAppendToBody,placement:e.placement,id:e.id}},e._l(e.suggestions,(function(t,i){return n("li",{key:i,class:{highlighted:e.highlightedIndex===i},attrs:{id:e.id+"-item-"+i,role:"option","aria-selected":e.highlightedIndex===i},on:{click:function(n){e.select(t)}}},[e._t("default",[e._v("\n "+e._s(t[e.valueKey])+"\n ")],{item:t})],2)})),0)],1)},$=[];P._withStripped=!0;var F=n(15),j=n.n(F),z=n(10),B=n.n(z),R=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-autocomplete-suggestion el-popper",class:{"is-loading":!e.parent.hideLoading&&e.parent.loading},style:{width:e.dropdownWidth},attrs:{role:"region"}},[n("el-scrollbar",{attrs:{tag:"ul","wrap-class":"el-autocomplete-suggestion__wrap","view-class":"el-autocomplete-suggestion__list"}},[!e.parent.hideLoading&&e.parent.loading?n("li",[n("i",{staticClass:"el-icon-loading"})]):e._t("default")],2)],1)])},V=[];R._withStripped=!0;var H=n(5),W=n.n(H),q=n(17),U=n.n(q),K={components:{ElScrollbar:U.a},mixins:[W.a,D.a],componentName:"ElAutocompleteSuggestions",data:function(){return{parent:this.$parent,dropdownWidth:""}},props:{options:{default:function(){return{gpuAcceleration:!1}}},id:String},methods:{select:function(e){this.dispatch("ElAutocomplete","item-click",e)}},updated:function(){var e=this;this.$nextTick((function(t){e.popperJS&&e.updatePopper()}))},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$refs.input.$refs.input||this.$parent.$refs.input.$refs.textarea,this.referenceList=this.$el.querySelector(".el-autocomplete-suggestion__list"),this.referenceList.setAttribute("role","listbox"),this.referenceList.setAttribute("id",this.id)},created:function(){var e=this;this.$on("visible",(function(t,n){e.dropdownWidth=n+"px",e.showPopper=t}))}},G=K,Y=l(G,R,V,!1,null,null,null);Y.options.__file="packages/autocomplete/src/autocomplete-suggestions.vue";var X=Y.exports,Z=n(22),Q=n.n(Z),J={name:"ElAutocomplete",mixins:[D.a,Q()("input"),T.a],inheritAttrs:!1,componentName:"ElAutocomplete",components:{ElInput:g.a,ElAutocompleteSuggestions:X},directives:{Clickoutside:B.a},props:{valueKey:{type:String,default:"value"},popperClass:String,popperOptions:Object,placeholder:String,clearable:{type:Boolean,default:!1},disabled:Boolean,name:String,size:String,value:String,maxlength:Number,minlength:Number,autofocus:Boolean,fetchSuggestions:Function,triggerOnFocus:{type:Boolean,default:!0},customItem:String,selectWhenUnmatched:{type:Boolean,default:!1},prefixIcon:String,suffixIcon:String,label:String,debounce:{type:Number,default:300},placement:{type:String,default:"bottom-start"},hideLoading:Boolean,popperAppendToBody:{type:Boolean,default:!0},highlightFirstItem:{type:Boolean,default:!1}},data:function(){return{activated:!1,suggestions:[],loading:!1,highlightedIndex:-1,suggestionDisabled:!1}},computed:{suggestionVisible:function(){var e=this.suggestions,t=Array.isArray(e)&&e.length>0;return(t||this.loading)&&this.activated},id:function(){return"el-autocomplete-"+Object(y["generateId"])()}},watch:{suggestionVisible:function(e){var t=this.getInput();t&&this.broadcast("ElAutocompleteSuggestions","visible",[e,t.offsetWidth])}},methods:{getMigratingConfig:function(){return{props:{"custom-item":"custom-item is removed, use scoped slot instead.",props:"props is removed, use value-key instead."}}},getData:function(e){var t=this;this.suggestionDisabled||(this.loading=!0,this.fetchSuggestions(e,(function(e){t.loading=!1,t.suggestionDisabled||(Array.isArray(e)?(t.suggestions=e,t.highlightedIndex=t.highlightFirstItem?0:-1):console.error("[Element Error][Autocomplete]autocomplete suggestions must be an array"))})))},handleInput:function(e){if(this.$emit("input",e),this.suggestionDisabled=!1,!this.triggerOnFocus&&!e)return this.suggestionDisabled=!0,void(this.suggestions=[]);this.debouncedGetData(e)},handleChange:function(e){this.$emit("change",e)},handleFocus:function(e){this.activated=!0,this.$emit("focus",e),this.triggerOnFocus&&this.debouncedGetData(this.value)},handleBlur:function(e){this.$emit("blur",e)},handleClear:function(){this.activated=!1,this.$emit("clear")},close:function(e){this.activated=!1},handleKeyEnter:function(e){var t=this;this.suggestionVisible&&this.highlightedIndex>=0&&this.highlightedIndex=this.suggestions.length&&(e=this.suggestions.length-1);var t=this.$refs.suggestions.$el.querySelector(".el-autocomplete-suggestion__wrap"),n=t.querySelectorAll(".el-autocomplete-suggestion__list li"),i=n[e],r=t.scrollTop,o=i.offsetTop;o+i.scrollHeight>r+t.clientHeight&&(t.scrollTop+=i.scrollHeight),o=0&&this.resetTabindex(this.triggerElm),clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.visible=!1}),"click"===this.trigger?0:this.hideTimeout))},handleClick:function(){this.triggerElm.disabled||(this.visible?this.hide():this.show())},handleTriggerKeyDown:function(e){var t=e.keyCode;[38,40].indexOf(t)>-1?(this.removeTabindex(),this.resetTabindex(this.menuItems[0]),this.menuItems[0].focus(),e.preventDefault(),e.stopPropagation()):13===t?this.handleClick():[9,27].indexOf(t)>-1&&this.hide()},handleItemKeyDown:function(e){var t=e.keyCode,n=e.target,i=this.menuItemsArray.indexOf(n),r=this.menuItemsArray.length-1,o=void 0;[38,40].indexOf(t)>-1?(o=38===t?0!==i?i-1:0:i-1&&(this.hide(),this.triggerElmFocus())},resetTabindex:function(e){this.removeTabindex(),e.setAttribute("tabindex","0")},removeTabindex:function(){this.triggerElm.setAttribute("tabindex","-1"),this.menuItemsArray.forEach((function(e){e.setAttribute("tabindex","-1")}))},initAria:function(){this.dropdownElm.setAttribute("id",this.listId),this.triggerElm.setAttribute("aria-haspopup","list"),this.triggerElm.setAttribute("aria-controls",this.listId),this.splitButton||(this.triggerElm.setAttribute("role","button"),this.triggerElm.setAttribute("tabindex",this.tabindex),this.triggerElm.setAttribute("class",(this.triggerElm.getAttribute("class")||"")+" el-dropdown-selfdefine"))},initEvent:function(){var e=this,t=this.trigger,n=this.show,i=this.hide,r=this.handleClick,o=this.splitButton,a=this.handleTriggerKeyDown,s=this.handleItemKeyDown;this.triggerElm=o?this.$refs.trigger.$el:this.$slots.default[0].elm;var l=this.dropdownElm;this.triggerElm.addEventListener("keydown",a),l.addEventListener("keydown",s,!0),o||(this.triggerElm.addEventListener("focus",(function(){e.focusing=!0})),this.triggerElm.addEventListener("blur",(function(){e.focusing=!1})),this.triggerElm.addEventListener("click",(function(){e.focusing=!1}))),"hover"===t?(this.triggerElm.addEventListener("mouseenter",n),this.triggerElm.addEventListener("mouseleave",i),l.addEventListener("mouseenter",n),l.addEventListener("mouseleave",i)):"click"===t&&this.triggerElm.addEventListener("click",r)},handleMenuItemClick:function(e,t){this.hideOnClick&&(this.visible=!1),this.$emit("command",e,t)},triggerElmFocus:function(){this.triggerElm.focus&&this.triggerElm.focus()},initDomOperation:function(){this.dropdownElm=this.popperElm,this.menuItems=this.dropdownElm.querySelectorAll("[tabindex='-1']"),this.menuItemsArray=[].slice.call(this.menuItems),this.initEvent(),this.initAria()}},render:function(e){var t=this,n=this.hide,i=this.splitButton,r=this.type,o=this.dropdownSize,a=function(e){t.$emit("click",e),n()},s=i?e("el-button-group",[e("el-button",{attrs:{type:r,size:o},nativeOn:{click:a}},[this.$slots.default]),e("el-button",{ref:"trigger",attrs:{type:r,size:o},class:"el-dropdown__caret-button"},[e("i",{class:"el-dropdown__icon el-icon-arrow-down"})])]):this.$slots.default;return e("div",{class:"el-dropdown",directives:[{name:"clickoutside",value:n}]},[s,this.$slots.dropdown])}},de=ue,he=l(de,ie,re,!1,null,null,null);he.options.__file="packages/dropdown/src/dropdown.vue";var fe=he.exports;fe.install=function(e){e.component(fe.name,fe)};var pe=fe,me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[n("ul",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-dropdown-menu el-popper",class:[e.size&&"el-dropdown-menu--"+e.size]},[e._t("default")],2)])},ge=[];me._withStripped=!0;var ve={name:"ElDropdownMenu",componentName:"ElDropdownMenu",mixins:[W.a],props:{visibleArrow:{type:Boolean,default:!0},arrowOffset:{type:Number,default:0}},data:function(){return{size:this.dropdown.dropdownSize}},inject:["dropdown"],created:function(){var e=this;this.$on("updatePopper",(function(){e.showPopper&&e.updatePopper()})),this.$on("visible",(function(t){e.showPopper=t}))},mounted:function(){this.dropdown.popperElm=this.popperElm=this.$el,this.referenceElm=this.dropdown.$el,this.dropdown.initDomOperation()},watch:{"dropdown.placement":{immediate:!0,handler:function(e){this.currentPlacement=e}}}},be=ve,ye=l(be,me,ge,!1,null,null,null);ye.options.__file="packages/dropdown/src/dropdown-menu.vue";var we=ye.exports;we.install=function(e){e.component(we.name,we)};var xe=we,_e=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"el-dropdown-menu__item",class:{"is-disabled":e.disabled,"el-dropdown-menu__item--divided":e.divided},attrs:{"aria-disabled":e.disabled,tabindex:e.disabled?null:-1},on:{click:e.handleClick}},[e.icon?n("i",{class:e.icon}):e._e(),e._t("default")],2)},ke=[];_e._withStripped=!0;var Ce={name:"ElDropdownItem",mixins:[D.a],props:{command:{},disabled:Boolean,divided:Boolean,icon:String},methods:{handleClick:function(e){this.dispatch("ElDropdown","menu-item-click",[this.command,this])}}},Se=Ce,Oe=l(Se,_e,ke,!1,null,null,null);Oe.options.__file="packages/dropdown/src/dropdown-item.vue";var Te=Oe.exports;Te.install=function(e){e.component(Te.name,Te)};var Ee=Te,De=De||{};De.Utils=De.Utils||{},De.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var n=e.childNodes[t];if(De.Utils.attemptFocus(n)||De.Utils.focusLastDescendant(n))return!0}return!1},De.Utils.attemptFocus=function(e){if(!De.Utils.isFocusable(e))return!1;De.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return De.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},De.Utils.isFocusable=function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},De.Utils.triggerEvent=function(e,t){var n=void 0;n=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var i=document.createEvent(n),r=arguments.length,o=Array(r>2?r-2:0),a=2;a=0;t--)e.splice(t,0,e[t]);e=e.join("")}return/^[0-9a-fA-F]{6}$/.test(e)?{red:parseInt(e.slice(0,2),16),green:parseInt(e.slice(2,4),16),blue:parseInt(e.slice(4,6),16)}:{red:255,green:255,blue:255}},mixColor:function(e,t){var n=this.getColorChannels(e),i=n.red,r=n.green,o=n.blue;return t>0?(i*=1-t,r*=1-t,o*=1-t):(i+=(255-i)*t,r+=(255-r)*t,o+=(255-o)*t),"rgb("+Math.round(i)+", "+Math.round(r)+", "+Math.round(o)+")"},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},openMenu:function(e,t){var n=this.openedMenus;-1===n.indexOf(e)&&(this.uniqueOpened&&(this.openedMenus=n.filter((function(e){return-1!==t.indexOf(e)}))),this.openedMenus.push(e))},closeMenu:function(e){var t=this.openedMenus.indexOf(e);-1!==t&&this.openedMenus.splice(t,1)},handleSubmenuClick:function(e){var t=e.index,n=e.indexPath,i=-1!==this.openedMenus.indexOf(t);i?(this.closeMenu(t),this.$emit("close",t,n)):(this.openMenu(t,n),this.$emit("open",t,n))},handleItemClick:function(e){var t=this,n=e.index,i=e.indexPath,r=this.activeIndex,o=null!==e.index;o&&(this.activeIndex=e.index),this.$emit("select",n,i,e),("horizontal"===this.mode||this.collapse)&&(this.openedMenus=[]),this.router&&o&&this.routeToItem(e,(function(e){if(t.activeIndex=r,e){if("NavigationDuplicated"===e.name)return;console.error(e)}}))},initOpenedMenu:function(){var e=this,t=this.activeIndex,n=this.items[t];if(n&&"horizontal"!==this.mode&&!this.collapse){var i=n.indexPath;i.forEach((function(t){var n=e.submenus[t];n&&e.openMenu(t,n.indexPath)}))}},routeToItem:function(e,t){var n=e.route||e.index;try{this.$router.push(n,(function(){}),t)}catch(i){console.error(i)}},open:function(e){var t=this,n=this.submenus[e.toString()].indexPath;n.forEach((function(e){return t.openMenu(e,n)}))},close:function(e){this.closeMenu(e)}},mounted:function(){this.initOpenedMenu(),this.$on("item-click",this.handleItemClick),this.$on("submenu-click",this.handleSubmenuClick),"horizontal"===this.mode&&new je(this.$el),this.$watch("items",this.updateActiveIndex)}},Re=Be,Ve=l(Re,$e,Fe,!1,null,null,null);Ve.options.__file="packages/menu/src/menu.vue";var He=Ve.exports;He.install=function(e){e.component(He.name,He)};var We,qe,Ue=He,Ke=n(21),Ge=n.n(Ke),Ye={inject:["rootMenu"],computed:{indexPath:function(){var e=[this.index],t=this.$parent;while("ElMenu"!==t.$options.componentName)t.index&&e.unshift(t.index),t=t.$parent;return e},parentMenu:function(){var e=this.$parent;while(e&&-1===["ElMenu","ElSubmenu"].indexOf(e.$options.componentName))e=e.$parent;return e},paddingStyle:function(){if("vertical"!==this.rootMenu.mode)return{};var e=20,t=this.$parent;if(this.rootMenu.collapse)e=20;else while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return{paddingLeft:e+"px"}}}},Xe={props:{transformOrigin:{type:[Boolean,String],default:!1},offset:W.a.props.offset,boundariesPadding:W.a.props.boundariesPadding,popperOptions:W.a.props.popperOptions},data:W.a.data,methods:W.a.methods,beforeDestroy:W.a.beforeDestroy,deactivated:W.a.deactivated},Ze={name:"ElSubmenu",componentName:"ElSubmenu",mixins:[Ye,D.a,Xe],components:{ElCollapseTransition:Ge.a},props:{index:{type:String,required:!0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},popperClass:String,disabled:Boolean,popperAppendToBody:{type:Boolean,default:void 0}},data:function(){return{popperJS:null,timeout:null,items:{},submenus:{},mouseInChild:!1}},watch:{opened:function(e){var t=this;this.isMenuPopup&&this.$nextTick((function(e){t.updatePopper()}))}},computed:{appendToBody:function(){return void 0===this.popperAppendToBody?this.isFirstLevel:this.popperAppendToBody},menuTransitionName:function(){return this.rootMenu.collapse?"el-zoom-in-left":"el-zoom-in-top"},opened:function(){return this.rootMenu.openedMenus.indexOf(this.index)>-1},active:function(){var e=!1,t=this.submenus,n=this.items;return Object.keys(n).forEach((function(t){n[t].active&&(e=!0)})),Object.keys(t).forEach((function(n){t[n].active&&(e=!0)})),e},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},isMenuPopup:function(){return this.rootMenu.isMenuPopup},titleStyle:function(){return"horizontal"!==this.mode?{color:this.textColor}:{borderBottomColor:this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent",color:this.active?this.activeTextColor:this.textColor}},isFirstLevel:function(){var e=!0,t=this.$parent;while(t&&t!==this.rootMenu){if(["ElSubmenu","ElMenuItemGroup"].indexOf(t.$options.componentName)>-1){e=!1;break}t=t.$parent}return e}},methods:{handleCollapseToggle:function(e){e?this.initPopper():this.doDestroy()},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},handleClick:function(){var e=this.rootMenu,t=this.disabled;"hover"===e.menuTrigger&&"horizontal"===e.mode||e.collapse&&"vertical"===e.mode||t||this.dispatch("ElMenu","submenu-click",this)},handleMouseenter:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.showTimeout;if("ActiveXObject"in window||"focus"!==e.type||e.relatedTarget){var i=this.rootMenu,r=this.disabled;"click"===i.menuTrigger&&"horizontal"===i.mode||!i.collapse&&"vertical"===i.mode||r||(this.dispatch("ElSubmenu","mouse-enter-child"),clearTimeout(this.timeout),this.timeout=setTimeout((function(){t.rootMenu.openMenu(t.index,t.indexPath)}),n),this.appendToBody&&this.$parent.$el.dispatchEvent(new MouseEvent("mouseenter")))}},handleMouseleave:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.rootMenu;"click"===n.menuTrigger&&"horizontal"===n.mode||!n.collapse&&"vertical"===n.mode||(this.dispatch("ElSubmenu","mouse-leave-child"),clearTimeout(this.timeout),this.timeout=setTimeout((function(){!e.mouseInChild&&e.rootMenu.closeMenu(e.index)}),this.hideTimeout),this.appendToBody&&t&&"ElSubmenu"===this.$parent.$options.name&&this.$parent.handleMouseleave(!0))},handleTitleMouseenter:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.hoverBackground)}},handleTitleMouseleave:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.backgroundColor||"")}},updatePlacement:function(){this.currentPlacement="horizontal"===this.mode&&this.isFirstLevel?"bottom-start":"right-start"},initPopper:function(){this.referenceElm=this.$el,this.popperElm=this.$refs.menu,this.updatePlacement()}},created:function(){var e=this;this.$on("toggle-collapse",this.handleCollapseToggle),this.$on("mouse-enter-child",(function(){e.mouseInChild=!0,clearTimeout(e.timeout)})),this.$on("mouse-leave-child",(function(){e.mouseInChild=!1,clearTimeout(e.timeout)}))},mounted:function(){this.parentMenu.addSubmenu(this),this.rootMenu.addSubmenu(this),this.initPopper()},beforeDestroy:function(){this.parentMenu.removeSubmenu(this),this.rootMenu.removeSubmenu(this)},render:function(e){var t=this,n=this.active,i=this.opened,r=this.paddingStyle,o=this.titleStyle,a=this.backgroundColor,s=this.rootMenu,l=this.currentPlacement,c=this.menuTransitionName,u=this.mode,d=this.disabled,h=this.popperClass,f=this.$slots,p=this.isFirstLevel,m=e("transition",{attrs:{name:c}},[e("div",{ref:"menu",directives:[{name:"show",value:i}],class:["el-menu--"+u,h],on:{mouseenter:function(e){return t.handleMouseenter(e,100)},mouseleave:function(){return t.handleMouseleave(!0)},focus:function(e){return t.handleMouseenter(e,100)}}},[e("ul",{attrs:{role:"menu"},class:["el-menu el-menu--popup","el-menu--popup-"+l],style:{backgroundColor:s.backgroundColor||""}},[f.default])])]),g=e("el-collapse-transition",[e("ul",{attrs:{role:"menu"},class:"el-menu el-menu--inline",directives:[{name:"show",value:i}],style:{backgroundColor:s.backgroundColor||""}},[f.default])]),v="horizontal"===s.mode&&p||"vertical"===s.mode&&!s.collapse?"el-icon-arrow-down":"el-icon-arrow-right";return e("li",{class:{"el-submenu":!0,"is-active":n,"is-opened":i,"is-disabled":d},attrs:{role:"menuitem","aria-haspopup":"true","aria-expanded":i},on:{mouseenter:this.handleMouseenter,mouseleave:function(){return t.handleMouseleave(!1)},focus:this.handleMouseenter}},[e("div",{class:"el-submenu__title",ref:"submenu-title",on:{click:this.handleClick,mouseenter:this.handleTitleMouseenter,mouseleave:this.handleTitleMouseleave},style:[r,o,{backgroundColor:a}]},[f.title,e("i",{class:["el-submenu__icon-arrow",v]})]),this.isMenuPopup?m:g])}},Qe=Ze,Je=l(Qe,We,qe,!1,null,null,null);Je.options.__file="packages/menu/src/submenu.vue";var et=Je.exports;et.install=function(e){e.component(et.name,et)};var tt=et,nt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"el-menu-item",class:{"is-active":e.active,"is-disabled":e.disabled},style:[e.paddingStyle,e.itemStyle,{backgroundColor:e.backgroundColor}],attrs:{role:"menuitem",tabindex:"-1"},on:{click:e.handleClick,mouseenter:e.onMouseEnter,focus:e.onMouseEnter,blur:e.onMouseLeave,mouseleave:e.onMouseLeave}},["ElMenu"===e.parentMenu.$options.componentName&&e.rootMenu.collapse&&e.$slots.title?n("el-tooltip",{attrs:{effect:"dark",placement:"right"}},[n("div",{attrs:{slot:"content"},slot:"content"},[e._t("title")],2),n("div",{staticStyle:{position:"absolute",left:"0",top:"0",height:"100%",width:"100%",display:"inline-block","box-sizing":"border-box",padding:"0 20px"}},[e._t("default")],2)]):[e._t("default"),e._t("title")]],2)},it=[];nt._withStripped=!0;var rt=n(26),ot=n.n(rt),at={name:"ElMenuItem",componentName:"ElMenuItem",mixins:[Ye,D.a],components:{ElTooltip:ot.a},props:{index:{default:null,validator:function(e){return"string"===typeof e||null===e}},route:[String,Object],disabled:Boolean},computed:{active:function(){return this.index===this.rootMenu.activeIndex},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},itemStyle:function(){var e={color:this.active?this.activeTextColor:this.textColor};return"horizontal"!==this.mode||this.isNested||(e.borderBottomColor=this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent"),e},isNested:function(){return this.parentMenu!==this.rootMenu}},methods:{onMouseEnter:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.hoverBackground)},onMouseLeave:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.backgroundColor)},handleClick:function(){this.disabled||(this.dispatch("ElMenu","item-click",this),this.$emit("click",this))}},mounted:function(){this.parentMenu.addItem(this),this.rootMenu.addItem(this)},beforeDestroy:function(){this.parentMenu.removeItem(this),this.rootMenu.removeItem(this)}},st=at,lt=l(st,nt,it,!1,null,null,null);lt.options.__file="packages/menu/src/menu-item.vue";var ct=lt.exports;ct.install=function(e){e.component(ct.name,ct)};var ut=ct,dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"el-menu-item-group"},[n("div",{staticClass:"el-menu-item-group__title",style:{paddingLeft:e.levelPadding+"px"}},[e.$slots.title?e._t("title"):[e._v(e._s(e.title))]],2),n("ul",[e._t("default")],2)])},ht=[];dt._withStripped=!0;var ft={name:"ElMenuItemGroup",componentName:"ElMenuItemGroup",inject:["rootMenu"],props:{title:{type:String}},data:function(){return{paddingLeft:20}},computed:{levelPadding:function(){var e=20,t=this.$parent;if(this.rootMenu.collapse)return 20;while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return e}}},pt=ft,mt=l(pt,dt,ht,!1,null,null,null);mt.options.__file="packages/menu/src/menu-item-group.vue";var gt=mt.exports;gt.install=function(e){e.component(gt.name,gt)};var vt=gt,bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.inputDisabled,"is-exceed":e.inputExceed,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?n("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),"textarea"!==e.type?n("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$attrs,!1)):e._e(),e.$slots.prefix||e.prefixIcon?n("span",{staticClass:"el-input__prefix"},[e._t("prefix"),e.prefixIcon?n("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.getSuffixVisible()?n("span",{staticClass:"el-input__suffix"},[n("span",{staticClass:"el-input__suffix-inner"},[e.showClear&&e.showPwdVisible&&e.isWordLimitVisible?e._e():[e._t("suffix"),e.suffixIcon?n("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()],e.showClear?n("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{mousedown:function(e){e.preventDefault()},click:e.clear}}):e._e(),e.showPwdVisible?n("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:e.handlePasswordVisible}}):e._e(),e.isWordLimitVisible?n("span",{staticClass:"el-input__count"},[n("span",{staticClass:"el-input__count-inner"},[e._v("\n "+e._s(e.textLength)+"/"+e._s(e.upperLimit)+"\n ")])]):e._e()],2),e.validateState?n("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?n("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:n("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionupdate:e.handleCompositionUpdate,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$attrs,!1)),e.isWordLimitVisible&&"textarea"===e.type?n("span",{staticClass:"el-input__count"},[e._v(e._s(e.textLength)+"/"+e._s(e.upperLimit))]):e._e()],2)},yt=[];bt._withStripped=!0;var wt=void 0,xt="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",_t=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function kt(e){var t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),i=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),r=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),o=_t.map((function(e){return e+":"+t.getPropertyValue(e)})).join(";");return{contextStyle:o,paddingSize:i,borderSize:r,boxSizing:n}}function Ct(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;wt||(wt=document.createElement("textarea"),document.body.appendChild(wt));var i=kt(e),r=i.paddingSize,o=i.borderSize,a=i.boxSizing,s=i.contextStyle;wt.setAttribute("style",s+";"+xt),wt.value=e.value||e.placeholder||"";var l=wt.scrollHeight,c={};"border-box"===a?l+=o:"content-box"===a&&(l-=r),wt.value="";var u=wt.scrollHeight-r;if(null!==t){var d=u*t;"border-box"===a&&(d=d+r+o),l=Math.max(d,l),c.minHeight=d+"px"}if(null!==n){var h=u*n;"border-box"===a&&(h=h+r+o),l=Math.min(h,l)}return c.height=l+"px",wt.parentNode&&wt.parentNode.removeChild(wt),wt=null,c}var St=n(7),Ot=n.n(St),Tt=n(19),Et={name:"ElInput",componentName:"ElInput",mixins:[D.a,T.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return Ot()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"===typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(e){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var e=this;this.$nextTick((function(){e.setNativeInputValue(),e.resizeTextarea(),e.updateIconOffset()}))}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize,t=this.type;if("textarea"===t)if(e){var n=e.minRows,i=e.maxRows;this.textareaCalcStyle=Ct(this.$refs.textarea,n,i)}else this.textareaCalcStyle={minHeight:Ct(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var e=this.getInput();e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionUpdate:function(e){var t=e.target.value,n=t[t.length-1]||"";this.isComposing=!Object(Tt["isKorean"])(n)},handleCompositionEnd:function(e){this.isComposing&&(this.isComposing=!1,this.handleInput(e))},handleInput:function(e){this.isComposing||e.target.value!==this.nativeInputValue&&(this.$emit("input",e.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(e){this.$emit("change",e.target.value)},calcIconOffset:function(e){var t=[].slice.call(this.$el.querySelectorAll(".el-input__"+e)||[]);if(t.length){for(var n=null,i=0;i=0&&e===parseInt(e,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(e){var t=void 0===e?e:Number(e);if(void 0!==t){if(isNaN(t))return;if(this.stepStrictly){var n=this.getPrecision(this.step),i=Math.pow(10,n);t=Math.round(t/this.step)*i*this.step/i}void 0!==this.precision&&(t=this.toPrecision(t,this.precision))}t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),this.currentValue=t,this.userInput=null,this.$emit("input",t)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var e=this.value,t=this.step,n=this.getPrecision,i=this.precision,r=n(t);return void 0!==i?(r>i&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),i):Math.max(n(e),r)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||!!(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var e=this.currentValue;if("number"===typeof e){if(this.stepStrictly){var t=this.getPrecision(this.step),n=Math.pow(10,t);e=Math.round(e/this.step)*n*this.step/n}void 0!==this.precision&&(e=e.toFixed(this.precision))}return e}},methods:{toPrecision:function(e,t){return void 0===t&&(t=this.numPrecision),parseFloat(Math.round(e*Math.pow(10,t))/Math.pow(10,t))},getPrecision:function(e){if(void 0===e)return 0;var t=e.toString(),n=t.indexOf("."),i=0;return-1!==n&&(i=t.length-n-1),i},_increase:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*e+n*t)/n)},_decrease:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var n=Math.pow(10,this.numPrecision);return this.toPrecision((n*e-n*t)/n)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var e=this.value||0,t=this._increase(e,this.step);this.setCurrentValue(t)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var e=this.value||0,t=this._decrease(e,this.step);this.setCurrentValue(t)}},handleBlur:function(e){this.$emit("blur",e)},handleFocus:function(e){this.$emit("focus",e)},setCurrentValue:function(e){var t=this.currentValue;"number"===typeof e&&void 0!==this.precision&&(e=this.toPrecision(e,this.precision)),e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),t!==e&&(this.userInput=null,this.$emit("input",e),this.$emit("change",e,t),this.currentValue=e)},handleInput:function(e){this.userInput=e},handleInputChange:function(e){var t=""===e?void 0:Number(e);isNaN(t)&&""!==e||this.setCurrentValue(t),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var e=this.$refs.input.$refs.input;e.setAttribute("role","spinbutton"),e.setAttribute("aria-valuemax",this.max),e.setAttribute("aria-valuemin",this.min),e.setAttribute("aria-valuenow",this.currentValue),e.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){if(this.$refs&&this.$refs.input){var e=this.$refs.input.$refs.input;e.setAttribute("aria-valuenow",this.currentValue)}}},Ft=$t,jt=l(Ft,It,Lt,!1,null,null,null);jt.options.__file="packages/input-number/src/input-number.vue";var zt=jt.exports;zt.install=function(e){e.component(zt.name,zt)};var Bt=zt,Rt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"el-radio",class:[e.border&&e.radioSize?"el-radio--"+e.radioSize:"",{"is-disabled":e.isDisabled},{"is-focus":e.focus},{"is-bordered":e.border},{"is-checked":e.model===e.label}],attrs:{role:"radio","aria-checked":e.model===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.model=e.isDisabled?e.model:e.label}}},[n("span",{staticClass:"el-radio__input",class:{"is-disabled":e.isDisabled,"is-checked":e.model===e.label}},[n("span",{staticClass:"el-radio__inner"}),n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],ref:"radio",staticClass:"el-radio__original",attrs:{type:"radio","aria-hidden":"true",name:e.name,disabled:e.isDisabled,tabindex:"-1"},domProps:{value:e.label,checked:e._q(e.model,e.label)},on:{focus:function(t){e.focus=!0},blur:function(t){e.focus=!1},change:[function(t){e.model=e.label},e.handleChange]}})]),n("span",{staticClass:"el-radio__label",on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},Vt=[];Rt._withStripped=!0;var Ht={name:"ElRadio",mixins:[D.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElRadio",props:{value:{},label:{},disabled:Boolean,name:String,border:Boolean,size:String},data:function(){return{focus:!1}},computed:{isGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return this._radioGroup=e,!0;e=e.$parent}return!1},model:{get:function(){return this.isGroup?this._radioGroup.value:this.value},set:function(e){this.isGroup?this.dispatch("ElRadioGroup","input",[e]):this.$emit("input",e),this.$refs.radio&&(this.$refs.radio.checked=this.model===this.label)}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._radioGroup.radioGroupSize||e},isDisabled:function(){return this.isGroup?this._radioGroup.disabled||this.disabled||(this.elForm||{}).disabled:this.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this.isGroup&&this.model!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick((function(){e.$emit("change",e.model),e.isGroup&&e.dispatch("ElRadioGroup","handleChange",e.model)}))}}},Wt=Ht,qt=l(Wt,Rt,Vt,!1,null,null,null);qt.options.__file="packages/radio/src/radio.vue";var Ut=qt.exports;Ut.install=function(e){e.component(Ut.name,Ut)};var Kt=Ut,Gt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(e._elTag,{tag:"component",staticClass:"el-radio-group",attrs:{role:"radiogroup"},on:{keydown:e.handleKeydown}},[e._t("default")],2)},Yt=[];Gt._withStripped=!0;var Xt=Object.freeze({LEFT:37,UP:38,RIGHT:39,DOWN:40}),Zt={name:"ElRadioGroup",componentName:"ElRadioGroup",inject:{elFormItem:{default:""}},mixins:[D.a],props:{value:{},size:String,fill:String,textColor:String,disabled:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},_elTag:function(){return(this.$vnode.data||{}).tag||"div"},radioGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},created:function(){var e=this;this.$on("handleChange",(function(t){e.$emit("change",t)}))},mounted:function(){var e=this.$el.querySelectorAll("[type=radio]"),t=this.$el.querySelectorAll("[role=radio]")[0];![].some.call(e,(function(e){return e.checked}))&&t&&(t.tabIndex=0)},methods:{handleKeydown:function(e){var t=e.target,n="INPUT"===t.nodeName?"[type=radio]":"[role=radio]",i=this.$el.querySelectorAll(n),r=i.length,o=[].indexOf.call(i,t),a=this.$el.querySelectorAll("[role=radio]");switch(e.keyCode){case Xt.LEFT:case Xt.UP:e.stopPropagation(),e.preventDefault(),0===o?(a[r-1].click(),a[r-1].focus()):(a[o-1].click(),a[o-1].focus());break;case Xt.RIGHT:case Xt.DOWN:o===r-1?(e.stopPropagation(),e.preventDefault(),a[0].click(),a[0].focus()):(a[o+1].click(),a[o+1].focus());break;default:break}}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[this.value])}}},Qt=Zt,Jt=l(Qt,Gt,Yt,!1,null,null,null);Jt.options.__file="packages/radio/src/radio-group.vue";var en=Jt.exports;en.install=function(e){e.component(en.name,en)};var tn=en,nn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"el-radio-button",class:[e.size?"el-radio-button--"+e.size:"",{"is-active":e.value===e.label},{"is-disabled":e.isDisabled},{"is-focus":e.focus}],attrs:{role:"radio","aria-checked":e.value===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.value=e.isDisabled?e.value:e.label}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"el-radio-button__orig-radio",attrs:{type:"radio",name:e.name,disabled:e.isDisabled,tabindex:"-1"},domProps:{value:e.label,checked:e._q(e.value,e.label)},on:{change:[function(t){e.value=e.label},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),n("span",{staticClass:"el-radio-button__inner",style:e.value===e.label?e.activeStyle:null,on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},rn=[];nn._withStripped=!0;var on={name:"ElRadioButton",mixins:[D.a],inject:{elForm:{default:""},elFormItem:{default:""}},props:{label:{},disabled:Boolean,name:String},data:function(){return{focus:!1}},computed:{value:{get:function(){return this._radioGroup.value},set:function(e){this._radioGroup.$emit("input",e)}},_radioGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return e;e=e.$parent}return!1},activeStyle:function(){return{backgroundColor:this._radioGroup.fill||"",borderColor:this._radioGroup.fill||"",boxShadow:this._radioGroup.fill?"-1px 0 0 0 "+this._radioGroup.fill:"",color:this._radioGroup.textColor||""}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._radioGroup.radioGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isDisabled:function(){return this.disabled||this._radioGroup.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this._radioGroup&&this.value!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick((function(){e.dispatch("ElRadioGroup","handleChange",e.value)}))}}},an=on,sn=l(an,nn,rn,!1,null,null,null);sn.options.__file="packages/radio/src/radio-button.vue";var ln=sn.exports;ln.install=function(e){e.component(ln.name,ln)};var cn=ln,un=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"el-checkbox",class:[e.border&&e.checkboxSize?"el-checkbox--"+e.checkboxSize:"",{"is-disabled":e.isDisabled},{"is-bordered":e.border},{"is-checked":e.isChecked}],attrs:{id:e.id}},[n("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{tabindex:!!e.indeterminate&&0,role:!!e.indeterminate&&"checkbox","aria-checked":!!e.indeterminate&&"mixed"}},[n("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var n=e.model,i=t.target,r=i.checked?e.trueLabel:e.falseLabel;if(Array.isArray(n)){var o=null,a=e._i(n,o);i.checked?a<0&&(e.model=n.concat([o])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=r},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",disabled:e.isDisabled,name:e.name},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var n=e.model,i=t.target,r=!!i.checked;if(Array.isArray(n)){var o=e.label,a=e._i(n,o);i.checked?a<0&&(e.model=n.concat([o])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=r},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?n("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},dn=[];un._withStripped=!0;var hn={name:"ElCheckbox",mixins:[D.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):(this.$emit("input",e),this.selfModel=e)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return this._checkboxGroup=e,!0;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,n=e.min;return!(!t&&!n)&&this.model.length>=t&&!this.isChecked||this.model.length<=n&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||e}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var n=void 0;n=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,e),this.$nextTick((function(){t.isGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])}))}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}}},fn=hn,pn=l(fn,un,dn,!1,null,null,null);pn.options.__file="packages/checkbox/src/checkbox.vue";var mn=pn.exports;mn.install=function(e){e.component(mn.name,mn)};var gn=mn,vn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("label",{staticClass:"el-checkbox-button",class:[e.size?"el-checkbox-button--"+e.size:"",{"is-disabled":e.isDisabled},{"is-checked":e.isChecked},{"is-focus":e.focus}],attrs:{role:"checkbox","aria-checked":e.isChecked,"aria-disabled":e.isDisabled}},[e.trueLabel||e.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var n=e.model,i=t.target,r=i.checked?e.trueLabel:e.falseLabel;if(Array.isArray(n)){var o=null,a=e._i(n,o);i.checked?a<0&&(e.model=n.concat([o])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=r},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var n=e.model,i=t.target,r=!!i.checked;if(Array.isArray(n)){var o=e.label,a=e._i(n,o);i.checked?a<0&&(e.model=n.concat([o])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=r},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),e.$slots.default||e.label?n("span",{staticClass:"el-checkbox-button__inner",style:e.isChecked?e.activeStyle:null},[e._t("default",[e._v(e._s(e.label))])],2):e._e()])},bn=[];vn._withStripped=!0;var yn={name:"ElCheckboxButton",mixins:[D.a],inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},props:{value:{},label:{},disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number]},computed:{model:{get:function(){return this._checkboxGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this._checkboxGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):void 0!==this.value?this.$emit("input",e):this.selfModel=e}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},_checkboxGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return e;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},activeStyle:function(){return{backgroundColor:this._checkboxGroup.fill||"",borderColor:this._checkboxGroup.fill||"",color:this._checkboxGroup.textColor||"","box-shadow":"-1px 0 0 0 "+this._checkboxGroup.fill}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._checkboxGroup.checkboxGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,n=e.min;return!(!t&&!n)&&this.model.length>=t&&!this.isChecked||this.model.length<=n&&this.isChecked},isDisabled:function(){return this._checkboxGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled}},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var n=void 0;n=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,e),this.$nextTick((function(){t._checkboxGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])}))}}},created:function(){this.checked&&this.addToStore()}},wn=yn,xn=l(wn,vn,bn,!1,null,null,null);xn.options.__file="packages/checkbox/src/checkbox-button.vue";var _n=xn.exports;_n.install=function(e){e.component(_n.name,_n)};var kn=_n,Cn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-checkbox-group",attrs:{role:"group","aria-label":"checkbox-group"}},[e._t("default")],2)},Sn=[];Cn._withStripped=!0;var On={name:"ElCheckboxGroup",componentName:"ElCheckboxGroup",mixins:[D.a],inject:{elFormItem:{default:""}},props:{value:{},disabled:Boolean,min:Number,max:Number,size:String,fill:String,textColor:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[e])}}},Tn=On,En=l(Tn,Cn,Sn,!1,null,null,null);En.options.__file="packages/checkbox/src/checkbox-group.vue";var Dn=En.exports;Dn.install=function(e){e.component(Dn.name,Dn)};var Mn=Dn,An=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-switch",class:{"is-disabled":e.switchDisabled,"is-checked":e.checked},attrs:{role:"switch","aria-checked":e.checked,"aria-disabled":e.switchDisabled},on:{click:function(t){return t.preventDefault(),e.switchValue(t)}}},[n("input",{ref:"input",staticClass:"el-switch__input",attrs:{type:"checkbox",id:e.id,name:e.name,"true-value":e.activeValue,"false-value":e.inactiveValue,disabled:e.switchDisabled},on:{change:e.handleChange,keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.switchValue(t)}}}),e.inactiveIconClass||e.inactiveText?n("span",{class:["el-switch__label","el-switch__label--left",e.checked?"":"is-active"]},[e.inactiveIconClass?n("i",{class:[e.inactiveIconClass]}):e._e(),!e.inactiveIconClass&&e.inactiveText?n("span",{attrs:{"aria-hidden":e.checked}},[e._v(e._s(e.inactiveText))]):e._e()]):e._e(),n("span",{ref:"core",staticClass:"el-switch__core",style:{width:e.coreWidth+"px"}}),e.activeIconClass||e.activeText?n("span",{class:["el-switch__label","el-switch__label--right",e.checked?"is-active":""]},[e.activeIconClass?n("i",{class:[e.activeIconClass]}):e._e(),!e.activeIconClass&&e.activeText?n("span",{attrs:{"aria-hidden":!e.checked}},[e._v(e._s(e.activeText))]):e._e()]):e._e()])},Nn=[];An._withStripped=!0;var In={name:"ElSwitch",mixins:[Q()("input"),T.a,D.a],inject:{elForm:{default:""}},props:{value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeIconClass:{type:String,default:""},inactiveIconClass:{type:String,default:""},activeText:String,inactiveText:String,activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String},data:function(){return{coreWidth:this.width}},created:function(){~[this.activeValue,this.inactiveValue].indexOf(this.value)||this.$emit("input",this.inactiveValue)},computed:{checked:function(){return this.value===this.activeValue},switchDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{checked:function(){this.$refs.input.checked=this.checked,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[this.value])}},methods:{handleChange:function(e){var t=this,n=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",n),this.$emit("change",n),this.$nextTick((function(){t.$refs.input.checked=t.checked}))},setBackgroundColor:function(){var e=this.checked?this.activeColor:this.inactiveColor;this.$refs.core.style.borderColor=e,this.$refs.core.style.backgroundColor=e},switchValue:function(){!this.switchDisabled&&this.handleChange()},getMigratingConfig:function(){return{props:{"on-color":"on-color is renamed to active-color.","off-color":"off-color is renamed to inactive-color.","on-text":"on-text is renamed to active-text.","off-text":"off-text is renamed to inactive-text.","on-value":"on-value is renamed to active-value.","off-value":"off-value is renamed to inactive-value.","on-icon-class":"on-icon-class is renamed to active-icon-class.","off-icon-class":"off-icon-class is renamed to inactive-icon-class."}}}},mounted:function(){this.coreWidth=this.width||40,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.$refs.input.checked=this.checked}},Ln=In,Pn=l(Ln,An,Nn,!1,null,null,null);Pn.options.__file="packages/switch/src/component.vue";var $n=Pn.exports;$n.install=function(e){e.component($n.name,$n)};var Fn=$n,jn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?n("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?n("span",[n("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?n("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[n("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():n("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,(function(t){return n("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(n){e.deleteTag(n,t)}}},[n("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])})),1),e.filterable?n("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.navigateOptions("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.deletePrevTag(t)},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),n("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1,tabindex:e.multiple&&e.filterable?"-1":null},on:{focus:e.handleFocus,blur:e.handleBlur},nativeOn:{keyup:function(t){return e.debouncedOnInputChange(t)},keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("prev")},function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.selectOption(t))},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],paste:function(t){return e.debouncedOnInputChange(t)},mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?n("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),n("template",{slot:"suffix"},[n("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?n("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[n("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?n("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):n("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},zn=[];jn._withStripped=!0;var Bn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},Rn=[];Bn._withStripped=!0;var Vn={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[W.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",(function(){e.$parent.visible&&e.updatePopper()})),this.$on("destroyPopper",this.destroyPopper)}},Hn=Vn,Wn=l(Hn,Bn,Rn,!1,null,null,null);Wn.options.__file="packages/select/src/select-dropdown.vue";var qn=Wn.exports,Un=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[n("span",[e._v(e._s(e.currentLabel))])])],2)},Kn=[];Un._withStripped=!0;var Gn="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},Yn={mixins:[D.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var n=this.select,i=n.remote,r=n.valueKey;if(!this.created&&!i){if(r&&"object"===("undefined"===typeof e?"undefined":Gn(e))&&"object"===("undefined"===typeof t?"undefined":Gn(t))&&e[r]===t[r])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var n=this.select.valueKey;return Object(y["getValueByPath"])(e,n)===Object(y["getValueByPath"])(t,n)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var n=this.select.valueKey;return e&&e.some((function(e){return Object(y["getValueByPath"])(e,n)===Object(y["getValueByPath"])(t,n)}))}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(y["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){var e=this.select,t=e.selected,n=e.multiple,i=n?t:[t],r=this.select.cachedOptions.indexOf(this),o=i.indexOf(this);r>-1&&o<0&&this.select.cachedOptions.splice(r,1),this.select.onOptionDestroy(this.select.options.indexOf(this))}},Xn=Yn,Zn=l(Xn,Un,Kn,!1,null,null,null);Zn.options.__file="packages/select/src/option.vue";var Qn=Zn.exports,Jn=n(30),ei=n.n(Jn),ti=n(13),ni=n(11),ii=n.n(ni),ri=n(27),oi=n.n(ri),ai={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter((function(e){return e.visible})).every((function(e){return e.disabled}))}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach((function(e){e.hover=t.hoverOption===e}))}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var n=this.options[this.hoverIndex];!0!==n.disabled&&!0!==n.groupDisabled&&n.visible||this.navigateOptions(e),this.$nextTick((function(){return t.scrollToOption(t.hoverOption)}))}}else this.visible=!0}}},si={mixins:[D.a,b.a,Q()("reference"),ai],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(y["isIE"])()&&!Object(y["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter((function(e){return!e.created})).some((function(t){return t.currentLabel===e.query}));return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"}},components:{ElInput:g.a,ElSelectMenu:qn,ElOption:Qn,ElTag:ei.a,ElScrollbar:U.a},directives:{Clickoutside:B.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,default:function(){return Object(ni["t"])("el.select.placeholder")}},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick((function(){e.resetInputHeight()}))},placeholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(y["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick((function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)})),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick((function(){e.broadcast("ElSelectDropdown","updatePopper")})),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(e){var t=this,n=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.$nextTick((function(e){return t.handleQueryChange(n)}));else{var i=n[n.length-1]||"";this.isOnComposition=!Object(Tt["isKorean"])(i)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick((function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")})),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick((function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()})),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var n=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");oi()(n,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick((function(){return e.scrollToOption(e.selected)}))},emitChange:function(e){Object(y["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,n="[object object]"===Object.prototype.toString.call(e).toLowerCase(),i="[object null]"===Object.prototype.toString.call(e).toLowerCase(),r="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),o=this.cachedOptions.length-1;o>=0;o--){var a=this.cachedOptions[o],s=n?Object(y["getValueByPath"])(a.value,this.valueKey)===Object(y["getValueByPath"])(e,this.valueKey):a.value===e;if(s){t=a;break}}if(t)return t;var l=n||i||r?"":e,c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var n=[];Array.isArray(this.value)&&this.value.forEach((function(t){n.push(e.getOption(t))})),this.selected=n,this.$nextTick((function(){e.resetInputHeight()}))},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.filterable&&(this.menuVisibleOnFocus=!0)),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout((function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)}),50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick((function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,n=[].filter.call(t,(function(e){return"INPUT"===e.tagName}))[0],i=e.$refs.tags,r=e.initialInputHeight||40;n.style.height=0===e.selected.length?r+"px":Math.max(i?i.clientHeight+(i.clientHeight>r?6:0):0,r)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}}))},resetHoverIndex:function(){var e=this;setTimeout((function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map((function(t){return e.options.indexOf(t)}))):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)}),300)},handleOptionSelect:function(e,t){var n=this;if(this.multiple){var i=(this.value||[]).slice(),r=this.getValueIndex(i,e.value);r>-1?i.splice(r,1):(this.multipleLimit<=0||i.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],n="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(n){var i=this.valueKey,r=-1;return e.some((function(e,n){return Object(y["getValueByPath"])(e,i)===Object(y["getValueByPath"])(t,i)&&(r=n,!0)})),r}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var n=this.selected.indexOf(t);if(n>-1&&!this.selectDisabled){var i=this.value.slice();i.splice(n,1),this.$emit("input",i),this.emitChange(i),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var n=0;n!==this.options.length;++n){var i=this.options[n];if(this.query){if(!i.disabled&&!i.groupDisabled&&i.visible){this.hoverIndex=n;break}}else if(i.itemSelected){this.hoverIndex=n;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(y["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.placeholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=j()(this.debounce,(function(){e.onInputChange()})),this.debouncedQueryChange=j()(this.debounce,(function(t){e.handleQueryChange(t.target.value)})),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(ti["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var n={medium:36,small:32,mini:28},i=t.$el.querySelector("input");this.initialInputHeight=i.getBoundingClientRect().height||n[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick((function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)})),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(ti["removeResizeListener"])(this.$el,this.handleResize)}},li=si,ci=l(li,jn,zn,!1,null,null,null);ci.options.__file="packages/select/src/select.vue";var ui=ci.exports;ui.install=function(e){e.component(ui.name,ui)};var di=ui;Qn.install=function(e){e.component(Qn.name,Qn)};var hi=Qn,fi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-group__wrap"},[n("li",{staticClass:"el-select-group__title"},[e._v(e._s(e.label))]),n("li",[n("ul",{staticClass:"el-select-group"},[e._t("default")],2)])])},pi=[];fi._withStripped=!0;var mi={mixins:[D.a],name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},data:function(){return{visible:!0}},watch:{disabled:function(e){this.broadcast("ElOption","handleGroupDisabled",e)}},methods:{queryChange:function(){this.visible=this.$children&&Array.isArray(this.$children)&&this.$children.some((function(e){return!0===e.visible}))}},created:function(){this.$on("queryChange",this.queryChange)},mounted:function(){this.disabled&&this.broadcast("ElOption","handleGroupDisabled",this.disabled)}},gi=mi,vi=l(gi,fi,pi,!1,null,null,null);vi.options.__file="packages/select/src/option-group.vue";var bi=vi.exports;bi.install=function(e){e.component(bi.name,bi)};var yi=bi,wi=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("button",{staticClass:"el-button",class:[e.type?"el-button--"+e.type:"",e.buttonSize?"el-button--"+e.buttonSize:"",{"is-disabled":e.buttonDisabled,"is-loading":e.loading,"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle}],attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?n("i",{staticClass:"el-icon-loading"}):e._e(),e.icon&&!e.loading?n("i",{class:e.icon}):e._e(),e.$slots.default?n("span",[e._t("default")],2):e._e()])},xi=[];wi._withStripped=!0;var _i={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},ki=_i,Ci=l(ki,wi,xi,!1,null,null,null);Ci.options.__file="packages/button/src/button.vue";var Si=Ci.exports;Si.install=function(e){e.component(Si.name,Si)};var Oi=Si,Ti=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-button-group"},[e._t("default")],2)},Ei=[];Ti._withStripped=!0;var Di={name:"ElButtonGroup"},Mi=Di,Ai=l(Mi,Ti,Ei,!1,null,null,null);Ai.options.__file="packages/button/src/button-group.vue";var Ni=Ai.exports;Ni.install=function(e){e.component(Ni.name,Ni)};var Ii=Ni,Li=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-table",class:[{"el-table--fit":e.fit,"el-table--striped":e.stripe,"el-table--border":e.border||e.isGroup,"el-table--hidden":e.isHidden,"el-table--group":e.isGroup,"el-table--fluid-height":e.maxHeight,"el-table--scrollable-x":e.layout.scrollX,"el-table--scrollable-y":e.layout.scrollY,"el-table--enable-row-hover":!e.store.states.isComplex,"el-table--enable-row-transition":0!==(e.store.states.data||[]).length&&(e.store.states.data||[]).length<100},e.tableSize?"el-table--"+e.tableSize:""],on:{mouseleave:function(t){e.handleMouseLeave(t)}}},[n("div",{ref:"hiddenColumns",staticClass:"hidden-columns"},[e._t("default")],2),e.showHeader?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[n("table-header",{ref:"tableHeader",style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"default-sort":e.defaultSort}})],1):e._e(),n("div",{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[e.layout.scrollX?"is-scrolling-"+e.scrollPosition:"is-scrolling-none"],style:[e.bodyHeight]},[n("table-body",{style:{width:e.bodyWidth},attrs:{context:e.context,store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}}),e.data&&0!==e.data.length?e._e():n("div",{ref:"emptyBlock",staticClass:"el-table__empty-block",style:e.emptyBlockStyle},[n("span",{staticClass:"el-table__empty-text"},[e._t("empty",[e._v(e._s(e.emptyText||e.t("el.table.emptyText")))])],2)]),e.$slots.append?n("div",{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[e._t("append")],2):e._e()],1),e.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"},{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"footerWrapper",staticClass:"el-table__footer-wrapper"},[n("table-footer",{style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,"default-sort":e.defaultSort}})],1):e._e(),e.fixedColumns.length>0?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"fixedWrapper",staticClass:"el-table__fixed",style:[{width:e.layout.fixedWidth?e.layout.fixedWidth+"px":""},e.fixedHeight]},[e.showHeader?n("div",{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"fixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,store:e.store}})],1):e._e(),n("div",{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[n("table-body",{style:{width:e.bodyWidth},attrs:{fixed:"left",store:e.store,stripe:e.stripe,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"row-style":e.rowStyle}}),e.$slots.append?n("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"fixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[n("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"rightFixedWrapper",staticClass:"el-table__fixed-right",style:[{width:e.layout.rightFixedWidth?e.layout.rightFixedWidth+"px":"",right:e.layout.scrollY?(e.border?e.layout.gutterWidth:e.layout.gutterWidth||0)+"px":""},e.fixedHeight]},[e.showHeader?n("div",{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"rightFixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,store:e.store}})],1):e._e(),n("div",{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[n("table-body",{style:{width:e.bodyWidth},attrs:{fixed:"right",store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}}),e.$slots.append?n("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?n("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"rightFixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[n("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?n("div",{ref:"rightFixedPatch",staticClass:"el-table__fixed-right-patch",style:{width:e.layout.scrollY?e.layout.gutterWidth+"px":"0",height:e.layout.headerHeight+"px"}}):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:e.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])},Pi=[];Li._withStripped=!0;var $i=n(16),Fi=n.n($i),ji=n(35),zi=n(38),Bi=n.n(zi),Ri="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Vi=function(e,t){e&&e.addEventListener&&e.addEventListener(Ri?"DOMMouseScroll":"mousewheel",(function(e){var n=Bi()(e);t&&t.apply(this,[e,n])}))},Hi={bind:function(e,t){Vi(e,t.value)}},Wi=n(6),qi=n.n(Wi),Ui="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},Ki=function(e){var t=e.target;while(t&&"HTML"!==t.tagName.toUpperCase()){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},Gi=function(e){return null!==e&&"object"===("undefined"===typeof e?"undefined":Ui(e))},Yi=function(e,t,n,i,r){if(!t&&!i&&(!r||Array.isArray(r)&&!r.length))return e;n="string"===typeof n?"descending"===n?-1:1:n&&n<0?-1:1;var o=i?null:function(n,i){return r?(Array.isArray(r)||(r=[r]),r.map((function(t){return"string"===typeof t?Object(y["getValueByPath"])(n,t):t(n,i,e)}))):("$key"!==t&&Gi(n)&&"$value"in n&&(n=n.$value),[Gi(n)?Object(y["getValueByPath"])(n,t):n])},a=function(e,t){if(i)return i(e.value,t.value);for(var n=0,r=e.key.length;nt.key[n])return 1}return 0};return e.map((function(e,t){return{value:e,index:t,key:o?o(e,t):null}})).sort((function(e,t){var i=a(e,t);return i||(i=e.index-t.index),i*n})).map((function(e){return e.value}))},Xi=function(e,t){var n=null;return e.columns.forEach((function(e){e.id===t&&(n=e)})),n},Zi=function(e,t){for(var n=null,i=0;i2&&void 0!==arguments[2]?arguments[2]:"children",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",r=function(e){return!(Array.isArray(e)&&e.length)};function o(e,a,s){t(e,a,s),a.forEach((function(e){if(e[i])t(e,null,s+1);else{var a=e[n];r(a)||o(e,a,s+1)}}))}e.forEach((function(e){if(e[i])t(e,null,0);else{var a=e[n];r(a)||o(e,a,0)}}))}var cr={data:function(){return{states:{defaultExpandAll:!1,expandRows:[]}}},methods:{updateExpandRows:function(){var e=this.states,t=e.data,n=void 0===t?[]:t,i=e.rowKey,r=e.defaultExpandAll,o=e.expandRows;if(r)this.states.expandRows=n.slice();else if(i){var a=er(o,i);this.states.expandRows=n.reduce((function(e,t){var n=Ji(t,i),r=a[n];return r&&e.push(t),e}),[])}else this.states.expandRows=[]},toggleRowExpansion:function(e,t){var n=sr(this.states.expandRows,e,t);n&&(this.table.$emit("expand-change",e,this.states.expandRows.slice()),this.scheduleLayout())},setExpandRowKeys:function(e){this.assertRowKey();var t=this.states,n=t.data,i=t.rowKey,r=er(n,i);this.states.expandRows=e.reduce((function(e,t){var n=r[t];return n&&e.push(n.row),e}),[])},isRowExpanded:function(e){var t=this.states,n=t.expandRows,i=void 0===n?[]:n,r=t.rowKey;if(r){var o=er(i,r);return!!o[Ji(e,r)]}return-1!==i.indexOf(e)}}},ur={data:function(){return{states:{_currentRowKey:null,currentRow:null}}},methods:{setCurrentRowKey:function(e){this.assertRowKey(),this.states._currentRowKey=e,this.setCurrentRowByKey(e)},restoreCurrentRowKey:function(){this.states._currentRowKey=null},setCurrentRowByKey:function(e){var t=this.states,n=t.data,i=void 0===n?[]:n,r=t.rowKey,o=null;r&&(o=Object(y["arrayFind"])(i,(function(t){return Ji(t,r)===e}))),t.currentRow=o},updateCurrentRow:function(e){var t=this.states,n=this.table,i=t.currentRow;if(e&&e!==i)return t.currentRow=e,void n.$emit("current-change",e,i);!e&&i&&(t.currentRow=null,n.$emit("current-change",null,i))},updateCurrentRowData:function(){var e=this.states,t=this.table,n=e.rowKey,i=e._currentRowKey,r=e.data||[],o=e.currentRow;if(-1===r.indexOf(o)&&o){if(n){var a=Ji(o,n);this.setCurrentRowByKey(a)}else e.currentRow=null;null===e.currentRow&&t.$emit("current-change",null,o)}else i&&(this.setCurrentRowByKey(i),this.restoreCurrentRowKey())}}},dr=Object.assign||function(e){for(var t=1;t0&&t[0]&&"selection"===t[0].type&&!t[0].fixed&&(t[0].fixed=!0,e.fixedColumns.unshift(t[0]));var n=t.filter((function(e){return!e.fixed}));e.originColumns=[].concat(e.fixedColumns).concat(n).concat(e.rightFixedColumns);var i=pr(n),r=pr(e.fixedColumns),o=pr(e.rightFixedColumns);e.leafColumnsLength=i.length,e.fixedLeafColumnsLength=r.length,e.rightFixedLeafColumnsLength=o.length,e.columns=[].concat(r).concat(i).concat(o),e.isComplex=e.fixedColumns.length>0||e.rightFixedColumns.length>0},scheduleLayout:function(e){e&&this.updateColumns(),this.table.debouncedUpdateLayout()},isSelected:function(e){var t=this.states.selection,n=void 0===t?[]:t;return n.indexOf(e)>-1},clearSelection:function(){var e=this.states;e.isAllSelected=!1;var t=e.selection;t.length&&(e.selection=[],this.table.$emit("selection-change",[]))},cleanSelection:function(){var e=this.states,t=e.data,n=e.rowKey,i=e.selection,r=void 0;if(n){r=[];var o=er(i,n),a=er(t,n);for(var s in o)o.hasOwnProperty(s)&&!a[s]&&r.push(o[s].row)}else r=i.filter((function(e){return-1===t.indexOf(e)}));if(r.length){var l=i.filter((function(e){return-1===r.indexOf(e)}));e.selection=l,this.table.$emit("selection-change",l.slice())}},toggleRowSelection:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=sr(this.states.selection,e,t);if(i){var r=(this.states.selection||[]).slice();n&&this.table.$emit("select",r,e),this.table.$emit("selection-change",r)}},_toggleAllSelection:function(){var e=this.states,t=e.data,n=void 0===t?[]:t,i=e.selection,r=e.selectOnIndeterminate?!e.isAllSelected:!(e.isAllSelected||i.length);e.isAllSelected=r;var o=!1;n.forEach((function(t,n){e.selectable?e.selectable.call(null,t,n)&&sr(i,t,r)&&(o=!0):sr(i,t,r)&&(o=!0)})),o&&this.table.$emit("selection-change",i?i.slice():[]),this.table.$emit("select-all",i)},updateSelectionByRowKey:function(){var e=this.states,t=e.selection,n=e.rowKey,i=e.data,r=er(t,n);i.forEach((function(e){var i=Ji(e,n),o=r[i];o&&(t[o.index]=e)}))},updateAllSelected:function(){var e=this.states,t=e.selection,n=e.rowKey,i=e.selectable,r=e.data||[];if(0!==r.length){var o=void 0;n&&(o=er(t,n));for(var a=function(e){return o?!!o[Ji(e,n)]:-1!==t.indexOf(e)},s=!0,l=0,c=0,u=r.length;c1?n-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new Error("Table is required.");var n=new gr;return n.table=e,n.toggleAllSelection=j()(10,n._toggleAllSelection),Object.keys(t).forEach((function(e){n.states[e]=t[e]})),n}function br(e){var t={};return Object.keys(e).forEach((function(n){var i=e[n],r=void 0;"string"===typeof i?r=function(){return this.store.states[i]}:"function"===typeof i?r=function(){return i.call(this,this.store.states)}:console.error("invalid value type"),r&&(t[n]=r)})),t}var yr=n(31),wr=n.n(yr);function xr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _r=function(){function e(t){for(var n in xr(this,e),this.observers=[],this.table=null,this.store=null,this.columns=null,this.fit=!0,this.showHeader=!0,this.height=null,this.scrollX=!1,this.scrollY=!1,this.bodyWidth=null,this.fixedWidth=null,this.rightFixedWidth=null,this.tableHeight=null,this.headerHeight=44,this.appendHeight=0,this.footerHeight=44,this.viewportHeight=null,this.bodyHeight=null,this.fixedBodyHeight=null,this.gutterWidth=wr()(),t)t.hasOwnProperty(n)&&(this[n]=t[n]);if(!this.table)throw new Error("table is required for Table Layout");if(!this.store)throw new Error("store is required for Table Layout")}return e.prototype.updateScrollY=function(){var e=this.height;if(null===e)return!1;var t=this.table.bodyWrapper;if(this.table.$el&&t){var n=t.querySelector(".el-table__body"),i=this.scrollY,r=n.offsetHeight>this.bodyHeight;return this.scrollY=r,i!==r}return!1},e.prototype.setHeight=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"height";if(!qi.a.prototype.$isServer){var i=this.table.$el;if(e=or(e),this.height=e,!i&&(e||0===e))return qi.a.nextTick((function(){return t.setHeight(e,n)}));"number"===typeof e?(i.style[n]=e+"px",this.updateElsHeight()):"string"===typeof e&&(i.style[n]=e,this.updateElsHeight())}},e.prototype.setMaxHeight=function(e){this.setHeight(e,"max-height")},e.prototype.getFlattenColumns=function(){var e=[],t=this.table.columns;return t.forEach((function(t){t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)})),e},e.prototype.updateElsHeight=function(){var e=this;if(!this.table.$ready)return qi.a.nextTick((function(){return e.updateElsHeight()}));var t=this.table.$refs,n=t.headerWrapper,i=t.appendWrapper,r=t.footerWrapper;if(this.appendHeight=i?i.offsetHeight:0,!this.showHeader||n){var o=n?n.querySelector(".el-table__header tr"):null,a=this.headerDisplayNone(o),s=this.headerHeight=this.showHeader?n.offsetHeight:0;if(this.showHeader&&!a&&n.offsetWidth>0&&(this.table.columns||[]).length>0&&s<2)return qi.a.nextTick((function(){return e.updateElsHeight()}));var l=this.tableHeight=this.table.$el.clientHeight,c=this.footerHeight=r?r.offsetHeight:0;null!==this.height&&(this.bodyHeight=l-s-c+(r?1:0)),this.fixedBodyHeight=this.scrollX?this.bodyHeight-this.gutterWidth:this.bodyHeight;var u=!(this.store.states.data&&this.store.states.data.length);this.viewportHeight=this.scrollX?l-(u?0:this.gutterWidth):l,this.updateScrollY(),this.notifyObservers("scrollable")}},e.prototype.headerDisplayNone=function(e){if(!e)return!0;var t=e;while("DIV"!==t.tagName){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1},e.prototype.updateColumnsWidth=function(){if(!qi.a.prototype.$isServer){var e=this.fit,t=this.table.$el.clientWidth,n=0,i=this.getFlattenColumns(),r=i.filter((function(e){return"number"!==typeof e.width}));if(i.forEach((function(e){"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)})),r.length>0&&e){i.forEach((function(e){n+=e.width||e.minWidth||80}));var o=this.scrollY?this.gutterWidth:0;if(n<=t-o){this.scrollX=!1;var a=t-o-n;if(1===r.length)r[0].realWidth=(r[0].minWidth||80)+a;else{var s=r.reduce((function(e,t){return e+(t.minWidth||80)}),0),l=a/s,c=0;r.forEach((function(e,t){if(0!==t){var n=Math.floor((e.minWidth||80)*l);c+=n,e.realWidth=(e.minWidth||80)+n}})),r[0].realWidth=(r[0].minWidth||80)+a-c}}else this.scrollX=!0,r.forEach((function(e){e.realWidth=e.minWidth}));this.bodyWidth=Math.max(n,t),this.table.resizeState.width=this.bodyWidth}else i.forEach((function(e){e.width||e.minWidth?e.realWidth=e.width||e.minWidth:e.realWidth=80,n+=e.realWidth})),this.scrollX=n>t,this.bodyWidth=n;var u=this.store.states.fixedColumns;if(u.length>0){var d=0;u.forEach((function(e){d+=e.realWidth||e.width})),this.fixedWidth=d}var h=this.store.states.rightFixedColumns;if(h.length>0){var f=0;h.forEach((function(e){f+=e.realWidth||e.width})),this.rightFixedWidth=f}this.notifyObservers("columns")}},e.prototype.addObserver=function(e){this.observers.push(e)},e.prototype.removeObserver=function(e){var t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)},e.prototype.notifyObservers=function(e){var t=this,n=this.observers;n.forEach((function(n){switch(e){case"columns":n.onColumnsChange(t);break;case"scrollable":n.onScrollableChange(t);break;default:throw new Error("Table Layout don't have event "+e+".")}}))},e}(),kr=_r,Cr={created:function(){this.tableLayout.addObserver(this)},destroyed:function(){this.tableLayout.removeObserver(this)},computed:{tableLayout:function(){var e=this.layout;if(!e&&this.table&&(e=this.table.layout),!e)throw new Error("Can not find table layout.");return e}},mounted:function(){this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout)},updated:function(){this.__updated__||(this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout),this.__updated__=!0)},methods:{onColumnsChange:function(e){var t=this.$el.querySelectorAll("colgroup > col");if(t.length){var n=e.getFlattenColumns(),i={};n.forEach((function(e){i[e.id]=e}));for(var r=0,o=t.length;r col[name=gutter]"),n=0,i=t.length;n=this.leftFixedLeafCount:"right"===this.fixed?e=this.columnsCount-this.rightFixedLeafCount},getSpan:function(e,t,n,i){var r=1,o=1,a=this.table.spanMethod;if("function"===typeof a){var s=a({row:e,column:t,rowIndex:n,columnIndex:i});Array.isArray(s)?(r=s[0],o=s[1]):"object"===("undefined"===typeof s?"undefined":Sr(s))&&(r=s.rowspan,o=s.colspan)}return{rowspan:r,colspan:o}},getRowStyle:function(e,t){var n=this.table.rowStyle;return"function"===typeof n?n.call(null,{row:e,rowIndex:t}):n||null},getRowClass:function(e,t){var n=["el-table__row"];this.table.highlightCurrentRow&&e===this.store.states.currentRow&&n.push("current-row"),this.stripe&&t%2===1&&n.push("el-table__row--striped");var i=this.table.rowClassName;return"string"===typeof i?n.push(i):"function"===typeof i&&n.push(i.call(null,{row:e,rowIndex:t})),this.store.states.expandRows.indexOf(e)>-1&&n.push("expanded"),n},getCellStyle:function(e,t,n,i){var r=this.table.cellStyle;return"function"===typeof r?r.call(null,{rowIndex:e,columnIndex:t,row:n,column:i}):r},getCellClass:function(e,t,n,i){var r=[i.id,i.align,i.className];this.isColumnHidden(t)&&r.push("is-hidden");var o=this.table.cellClassName;return"string"===typeof o?r.push(o):"function"===typeof o&&r.push(o.call(null,{rowIndex:e,columnIndex:t,row:n,column:i})),r.join(" ")},getColspanRealWidth:function(e,t,n){if(t<1)return e[n].realWidth;var i=e.map((function(e){var t=e.realWidth;return t})).slice(n,n+t);return i.reduce((function(e,t){return e+t}),-1)},handleCellMouseEnter:function(e,t){var n=this.table,i=Ki(e);if(i){var r=Qi(n,i),o=n.hoverState={cell:i,column:r,row:t};n.$emit("cell-mouse-enter",o.row,o.column,o.cell,e)}var a=e.target.querySelector(".cell");if(Object(ze["hasClass"])(a,"el-tooltip")&&a.childNodes.length){var s=document.createRange();s.setStart(a,0),s.setEnd(a,a.childNodes.length);var l=s.getBoundingClientRect().width,c=(parseInt(Object(ze["getStyle"])(a,"paddingLeft"),10)||0)+(parseInt(Object(ze["getStyle"])(a,"paddingRight"),10)||0);if((l+c>a.offsetWidth||a.scrollWidth>a.offsetWidth)&&this.$refs.tooltip){var u=this.$refs.tooltip;this.tooltipContent=i.innerText||i.textContent,u.referenceElm=i,u.$refs.popper&&(u.$refs.popper.style.display="none"),u.doDestroy(),u.setExpectedState(!0),this.activateTooltip(u)}}},handleCellMouseLeave:function(e){var t=this.$refs.tooltip;t&&(t.setExpectedState(!1),t.handleClosePopper());var n=Ki(e);if(n){var i=this.table.hoverState||{};this.table.$emit("cell-mouse-leave",i.row,i.column,i.cell,e)}},handleMouseEnter:j()(30,(function(e){this.store.commit("setHoverRow",e)})),handleMouseLeave:j()(30,(function(){this.store.commit("setHoverRow",null)})),handleContextMenu:function(e,t){this.handleEvent(e,t,"contextmenu")},handleDoubleClick:function(e,t){this.handleEvent(e,t,"dblclick")},handleClick:function(e,t){this.store.commit("setCurrentRow",t),this.handleEvent(e,t,"click")},handleEvent:function(e,t,n){var i=this.table,r=Ki(e),o=void 0;r&&(o=Qi(i,r),o&&i.$emit("cell-"+n,t,o,r,e)),i.$emit("row-"+n,t,o,e)},rowRender:function(e,t,n){var i=this,r=this.$createElement,o=this.treeIndent,a=this.columns,s=this.firstDefaultColumnIndex,l=a.map((function(e,t){return i.isColumnHidden(t)})),c=this.getRowClass(e,t),u=!0;n&&(c.push("el-table__row--level-"+n.level),u=n.display);var d=u?null:{display:"none"};return r("tr",{style:[d,this.getRowStyle(e,t)],class:c,key:this.getKeyOfRow(e,t),on:{dblclick:function(t){return i.handleDoubleClick(t,e)},click:function(t){return i.handleClick(t,e)},contextmenu:function(t){return i.handleContextMenu(t,e)},mouseenter:function(e){return i.handleMouseEnter(t)},mouseleave:this.handleMouseLeave}},[a.map((function(c,u){var d=i.getSpan(e,c,t,u),h=d.rowspan,f=d.colspan;if(!h||!f)return null;var p=Or({},c);p.realWidth=i.getColspanRealWidth(a,f,u);var m={store:i.store,_self:i.context||i.table.$vnode.context,column:p,row:e,$index:t};return u===s&&n&&(m.treeNode={indent:n.level*o,level:n.level},"boolean"===typeof n.expanded&&(m.treeNode.expanded=n.expanded,"loading"in n&&(m.treeNode.loading=n.loading),"noLazyChildren"in n&&(m.treeNode.noLazyChildren=n.noLazyChildren))),r("td",{style:i.getCellStyle(t,u,e,c),class:i.getCellClass(t,u,e,c),attrs:{rowspan:h,colspan:f},on:{mouseenter:function(t){return i.handleCellMouseEnter(t,e)},mouseleave:i.handleCellMouseLeave}},[c.renderCell.call(i._renderProxy,i.$createElement,m,l[u])])}))])},wrappedRowRender:function(e,t){var n=this,i=this.$createElement,r=this.store,o=r.isRowExpanded,a=r.assertRowKey,s=r.states,l=s.treeData,c=s.lazyTreeNodeMap,u=s.childrenColumnName,d=s.rowKey;if(this.hasExpandColumn&&o(e)){var h=this.table.renderExpanded,f=this.rowRender(e,t);return h?[[f,i("tr",{key:"expanded-row__"+f.key},[i("td",{attrs:{colspan:this.columnsCount},class:"el-table__expanded-cell"},[h(this.$createElement,{row:e,$index:t,store:this.store})])])]]:(console.error("[Element Error]renderExpanded is required."),f)}if(Object.keys(l).length){a();var p=Ji(e,d),m=l[p],g=null;m&&(g={expanded:m.expanded,level:m.level,display:!0},"boolean"===typeof m.lazy&&("boolean"===typeof m.loaded&&m.loaded&&(g.noLazyChildren=!(m.children&&m.children.length)),g.loading=m.loading));var v=[this.rowRender(e,t,g)];if(m){var b=0,y=function e(i,r){i&&i.length&&r&&i.forEach((function(i){var o={display:r.display&&r.expanded,level:r.level+1},a=Ji(i,d);if(void 0===a||null===a)throw new Error("for nested data item, row-key is required.");if(m=Or({},l[a]),m&&(o.expanded=m.expanded,m.level=m.level||o.level,m.display=!(!m.expanded||!o.display),"boolean"===typeof m.lazy&&("boolean"===typeof m.loaded&&m.loaded&&(o.noLazyChildren=!(m.children&&m.children.length)),o.loading=m.loading)),b++,v.push(n.rowRender(i,t+b,o)),m){var s=c[a]||i[u];e(s,m)}}))};m.display=!0;var w=c[p]||e[u];y(w,m)}return v}return this.rowRender(e,t)}}},Er=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"}},[e.multiple?n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[n("div",{staticClass:"el-table-filter__content"},[n("el-scrollbar",{attrs:{"wrap-class":"el-table-filter__wrap"}},[n("el-checkbox-group",{staticClass:"el-table-filter__checkbox-group",model:{value:e.filteredValue,callback:function(t){e.filteredValue=t},expression:"filteredValue"}},e._l(e.filters,(function(t){return n("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.text))])})),1)],1)],1),n("div",{staticClass:"el-table-filter__bottom"},[n("button",{class:{"is-disabled":0===e.filteredValue.length},attrs:{disabled:0===e.filteredValue.length},on:{click:e.handleConfirm}},[e._v(e._s(e.t("el.table.confirmFilter")))]),n("button",{on:{click:e.handleReset}},[e._v(e._s(e.t("el.table.resetFilter")))])])]):n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[n("ul",{staticClass:"el-table-filter__list"},[n("li",{staticClass:"el-table-filter__list-item",class:{"is-active":void 0===e.filterValue||null===e.filterValue},on:{click:function(t){e.handleSelect(null)}}},[e._v(e._s(e.t("el.table.clearFilter")))]),e._l(e.filters,(function(t){return n("li",{key:t.value,staticClass:"el-table-filter__list-item",class:{"is-active":e.isActive(t)},attrs:{label:t.value},on:{click:function(n){e.handleSelect(t.value)}}},[e._v(e._s(t.text))])}))],2)])])},Dr=[];Er._withStripped=!0;var Mr=[];!qi.a.prototype.$isServer&&document.addEventListener("click",(function(e){Mr.forEach((function(t){var n=e.target;t&&t.$el&&(n===t.$el||t.$el.contains(n)||t.handleOutsideClick&&t.handleOutsideClick(e))}))}));var Ar={open:function(e){e&&Mr.push(e)},close:function(e){var t=Mr.indexOf(e);-1!==t&&Mr.splice(e,1)}},Nr=n(32),Ir=n.n(Nr),Lr={name:"ElTableFilterPanel",mixins:[W.a,b.a],directives:{Clickoutside:B.a},components:{ElCheckbox:Fi.a,ElCheckboxGroup:Ir.a,ElScrollbar:U.a},props:{placement:{type:String,default:"bottom-end"}},methods:{isActive:function(e){return e.value===this.filterValue},handleOutsideClick:function(){var e=this;setTimeout((function(){e.showPopper=!1}),16)},handleConfirm:function(){this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleReset:function(){this.filteredValue=[],this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleSelect:function(e){this.filterValue=e,"undefined"!==typeof e&&null!==e?this.confirmFilter(this.filteredValue):this.confirmFilter([]),this.handleOutsideClick()},confirmFilter:function(e){this.table.store.commit("filterChange",{column:this.column,values:e}),this.table.store.updateAllSelected()}},data:function(){return{table:null,cell:null,column:null}},computed:{filters:function(){return this.column&&this.column.filters},filterValue:{get:function(){return(this.column.filteredValue||[])[0]},set:function(e){this.filteredValue&&("undefined"!==typeof e&&null!==e?this.filteredValue.splice(0,1,e):this.filteredValue.splice(0,1))}},filteredValue:{get:function(){return this.column&&this.column.filteredValue||[]},set:function(e){this.column&&(this.column.filteredValue=e)}},multiple:function(){return!this.column||this.column.filterMultiple}},mounted:function(){var e=this;this.popperElm=this.$el,this.referenceElm=this.cell,this.table.bodyWrapper.addEventListener("scroll",(function(){e.updatePopper()})),this.$watch("showPopper",(function(t){e.column&&(e.column.filterOpened=t),t?Ar.open(e):Ar.close(e)}))},watch:{showPopper:function(e){!0===e&&parseInt(this.popperJS._popper.style.zIndex,10)1;return r&&(this.$parent.isGroup=!0),e("table",{class:"el-table__header",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[e("colgroup",[this.columns.map((function(t){return e("col",{attrs:{name:t.id},key:t.id})})),this.hasGutter?e("col",{attrs:{name:"gutter"}}):""]),e("thead",{class:[{"is-group":r,"has-gutter":this.hasGutter}]},[this._l(i,(function(n,i){return e("tr",{style:t.getHeaderRowStyle(i),class:t.getHeaderRowClass(i)},[n.map((function(r,o){return e("th",{attrs:{colspan:r.colSpan,rowspan:r.rowSpan},on:{mousemove:function(e){return t.handleMouseMove(e,r)},mouseout:t.handleMouseOut,mousedown:function(e){return t.handleMouseDown(e,r)},click:function(e){return t.handleHeaderClick(e,r)},contextmenu:function(e){return t.handleHeaderContextMenu(e,r)}},style:t.getHeaderCellStyle(i,o,n,r),class:t.getHeaderCellClass(i,o,n,r),key:r.id},[e("div",{class:["cell",r.filteredValue&&r.filteredValue.length>0?"highlight":"",r.labelClassName]},[r.renderHeader?r.renderHeader.call(t._renderProxy,e,{column:r,$index:o,store:t.store,_self:t.$parent.$vnode.context}):r.label,r.sortable?e("span",{class:"caret-wrapper",on:{click:function(e){return t.handleSortClick(e,r)}}},[e("i",{class:"sort-caret ascending",on:{click:function(e){return t.handleSortClick(e,r,"ascending")}}}),e("i",{class:"sort-caret descending",on:{click:function(e){return t.handleSortClick(e,r,"descending")}}})]):"",r.filterable?e("span",{class:"el-table__column-filter-trigger",on:{click:function(e){return t.handleFilterClick(e,r)}}},[e("i",{class:["el-icon-arrow-down",r.filterOpened?"el-icon-arrow-up":""]})]):""])])})),t.hasGutter?e("th",{class:"gutter"}):""])}))])])},props:{fixed:String,store:{required:!0},border:Boolean,defaultSort:{type:Object,default:function(){return{prop:"",order:""}}}},components:{ElCheckbox:Fi.a},computed:jr({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},br({columns:"columns",isAllSelected:"isAllSelected",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(e){return e.columns.length},leftFixedCount:function(e){return e.fixedColumns.length},rightFixedCount:function(e){return e.rightFixedColumns.length}})),created:function(){this.filterPanels={}},mounted:function(){var e=this;this.$nextTick((function(){var t=e.defaultSort,n=t.prop,i=t.order,r=!0;e.store.commit("sort",{prop:n,order:i,init:r})}))},beforeDestroy:function(){var e=this.filterPanels;for(var t in e)e.hasOwnProperty(t)&&e[t]&&e[t].$destroy(!0)},methods:{isCellHidden:function(e,t){for(var n=0,i=0;i=this.leftFixedLeafCount:"right"===this.fixed?n=this.columnsCount-this.rightFixedLeafCount},getHeaderRowStyle:function(e){var t=this.table.headerRowStyle;return"function"===typeof t?t.call(null,{rowIndex:e}):t},getHeaderRowClass:function(e){var t=[],n=this.table.headerRowClassName;return"string"===typeof n?t.push(n):"function"===typeof n&&t.push(n.call(null,{rowIndex:e})),t.join(" ")},getHeaderCellStyle:function(e,t,n,i){var r=this.table.headerCellStyle;return"function"===typeof r?r.call(null,{rowIndex:e,columnIndex:t,row:n,column:i}):r},getHeaderCellClass:function(e,t,n,i){var r=[i.id,i.order,i.headerAlign,i.className,i.labelClassName];0===e&&this.isCellHidden(t,n)&&r.push("is-hidden"),i.children||r.push("is-leaf"),i.sortable&&r.push("is-sortable");var o=this.table.headerCellClassName;return"string"===typeof o?r.push(o):"function"===typeof o&&r.push(o.call(null,{rowIndex:e,columnIndex:t,row:n,column:i})),r.join(" ")},toggleAllSelection:function(e){e.stopPropagation(),this.store.commit("toggleAllSelection")},handleFilterClick:function(e,t){e.stopPropagation();var n=e.target,i="TH"===n.tagName?n:n.parentNode;if(!Object(ze["hasClass"])(i,"noclick")){i=i.querySelector(".el-table__column-filter-trigger")||i;var r=this.$parent,o=this.filterPanels[t.id];o&&t.filterOpened?o.showPopper=!1:(o||(o=new qi.a(Fr),this.filterPanels[t.id]=o,t.filterPlacement&&(o.placement=t.filterPlacement),o.table=r,o.cell=i,o.column=t,!this.$isServer&&o.$mount(document.createElement("div"))),setTimeout((function(){o.showPopper=!0}),16))}},handleHeaderClick:function(e,t){!t.filters&&t.sortable?this.handleSortClick(e,t):t.filterable&&!t.sortable&&this.handleFilterClick(e,t),this.$parent.$emit("header-click",t,e)},handleHeaderContextMenu:function(e,t){this.$parent.$emit("header-contextmenu",t,e)},handleMouseDown:function(e,t){var n=this;if(!this.$isServer&&!(t.children&&t.children.length>0)&&this.draggingColumn&&this.border){this.dragging=!0,this.$parent.resizeProxyVisible=!0;var i=this.$parent,r=i.$el,o=r.getBoundingClientRect().left,a=this.$el.querySelector("th."+t.id),s=a.getBoundingClientRect(),l=s.left-o+30;Object(ze["addClass"])(a,"noclick"),this.dragState={startMouseLeft:e.clientX,startLeft:s.right-o,startColumnLeft:s.left-o,tableLeft:o};var c=i.$refs.resizeProxy;c.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(e){var t=e.clientX-n.dragState.startMouseLeft,i=n.dragState.startLeft+t;c.style.left=Math.max(l,i)+"px"},d=function r(){if(n.dragging){var o=n.dragState,s=o.startColumnLeft,l=o.startLeft,d=parseInt(c.style.left,10),h=d-s;t.width=t.realWidth=h,i.$emit("header-dragend",t.width,l-s,t,e),n.store.scheduleLayout(),document.body.style.cursor="",n.dragging=!1,n.draggingColumn=null,n.dragState={},i.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",r),document.onselectstart=null,document.ondragstart=null,setTimeout((function(){Object(ze["removeClass"])(a,"noclick")}),0)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",d)}},handleMouseMove:function(e,t){if(!(t.children&&t.children.length>0)){var n=e.target;while(n&&"TH"!==n.tagName)n=n.parentNode;if(t&&t.resizable&&!this.dragging&&this.border){var i=n.getBoundingClientRect(),r=document.body.style;i.width>12&&i.right-e.pageX<8?(r.cursor="col-resize",Object(ze["hasClass"])(n,"is-sortable")&&(n.style.cursor="col-resize"),this.draggingColumn=t):this.dragging||(r.cursor="",Object(ze["hasClass"])(n,"is-sortable")&&(n.style.cursor="pointer"),this.draggingColumn=null)}}},handleMouseOut:function(){this.$isServer||(document.body.style.cursor="")},toggleOrder:function(e){var t=e.order,n=e.sortOrders;if(""===t)return n[0];var i=n.indexOf(t||null);return n[i>n.length-2?0:i+1]},handleSortClick:function(e,t,n){e.stopPropagation();var i=t.order===n?null:n||this.toggleOrder(t),r=e.target;while(r&&"TH"!==r.tagName)r=r.parentNode;if(r&&"TH"===r.tagName&&Object(ze["hasClass"])(r,"noclick"))Object(ze["removeClass"])(r,"noclick");else if(t.sortable){var o=this.store.states,a=o.sortProp,s=void 0,l=o.sortingColumn;(l!==t||l===t&&null===l.order)&&(l&&(l.order=null),o.sortingColumn=t,a=t.property),s=t.order=i||null,o.sortProp=a,o.sortOrder=s,this.store.commit("changeSortCondition")}}},data:function(){return{draggingColumn:null,dragging:!1,dragState:{}}}},Vr=Object.assign||function(e){for(var t=1;t=this.leftFixedLeafCount;if("right"===this.fixed){for(var i=0,r=0;r=this.columnsCount-this.rightFixedCount},getRowClasses:function(e,t){var n=[e.id,e.align,e.labelClassName];return e.className&&n.push(e.className),this.isCellHidden(t,this.columns,e)&&n.push("is-hidden"),e.children||n.push("is-leaf"),n}}},Wr=Object.assign||function(e){for(var t=1;t0){var i=n.scrollTop;t.pixelY<0&&0!==i&&e.preventDefault(),t.pixelY>0&&n.scrollHeight-n.clientHeight>i&&e.preventDefault(),n.scrollTop+=Math.ceil(t.pixelY/5)}else n.scrollLeft+=Math.ceil(t.pixelX/5)},handleHeaderFooterMousewheel:function(e,t){var n=t.pixelX,i=t.pixelY;Math.abs(n)>=Math.abs(i)&&(this.bodyWrapper.scrollLeft+=t.pixelX/5)},syncPostion:Object(ji["throttle"])(20,(function(){var e=this.bodyWrapper,t=e.scrollLeft,n=e.scrollTop,i=e.offsetWidth,r=e.scrollWidth,o=this.$refs,a=o.headerWrapper,s=o.footerWrapper,l=o.fixedBodyWrapper,c=o.rightFixedBodyWrapper;a&&(a.scrollLeft=t),s&&(s.scrollLeft=t),l&&(l.scrollTop=n),c&&(c.scrollTop=n);var u=r-i-1;this.scrollPosition=t>=u?"right":0===t?"left":"middle"})),bindEvents:function(){this.bodyWrapper.addEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(ti["addResizeListener"])(this.$el,this.resizeListener)},unbindEvents:function(){this.bodyWrapper.removeEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(ti["removeResizeListener"])(this.$el,this.resizeListener)},resizeListener:function(){if(this.$ready){var e=!1,t=this.$el,n=this.resizeState,i=n.width,r=n.height,o=t.offsetWidth;i!==o&&(e=!0);var a=t.offsetHeight;(this.height||this.shouldUpdateHeight)&&r!==a&&(e=!0),e&&(this.resizeState.width=o,this.resizeState.height=a,this.doLayout())}},doLayout:function(){this.shouldUpdateHeight&&this.layout.updateElsHeight(),this.layout.updateColumnsWidth()},sort:function(e,t){this.store.commit("sort",{prop:e,order:t})},toggleAllSelection:function(){this.store.commit("toggleAllSelection")}},computed:Wr({tableSize:function(){return this.size||(this.$ELEMENT||{}).size},bodyWrapper:function(){return this.$refs.bodyWrapper},shouldUpdateHeight:function(){return this.height||this.maxHeight||this.fixedColumns.length>0||this.rightFixedColumns.length>0},bodyWidth:function(){var e=this.layout,t=e.bodyWidth,n=e.scrollY,i=e.gutterWidth;return t?t-(n?i:0)+"px":""},bodyHeight:function(){var e=this.layout,t=e.headerHeight,n=void 0===t?0:t,i=e.bodyHeight,r=e.footerHeight,o=void 0===r?0:r;if(this.height)return{height:i?i+"px":""};if(this.maxHeight){var a=or(this.maxHeight);if("number"===typeof a)return{"max-height":a-o-(this.showHeader?n:0)+"px"}}return{}},fixedBodyHeight:function(){if(this.height)return{height:this.layout.fixedBodyHeight?this.layout.fixedBodyHeight+"px":""};if(this.maxHeight){var e=or(this.maxHeight);if("number"===typeof e)return e=this.layout.scrollX?e-this.layout.gutterWidth:e,this.showHeader&&(e-=this.layout.headerHeight),e-=this.layout.footerHeight,{"max-height":e+"px"}}return{}},fixedHeight:function(){return this.maxHeight?this.showSummary?{bottom:0}:{bottom:this.layout.scrollX&&this.data.length?this.layout.gutterWidth+"px":""}:this.showSummary?{height:this.layout.tableHeight?this.layout.tableHeight+"px":""}:{height:this.layout.viewportHeight?this.layout.viewportHeight+"px":""}},emptyBlockStyle:function(){if(this.data&&this.data.length)return null;var e="100%";return this.layout.appendHeight&&(e="calc(100% - "+this.layout.appendHeight+"px)"),{width:this.bodyWidth,height:e}}},br({selection:"selection",columns:"columns",tableData:"data",fixedColumns:"fixedColumns",rightFixedColumns:"rightFixedColumns"})),watch:{height:{immediate:!0,handler:function(e){this.layout.setHeight(e)}},maxHeight:{immediate:!0,handler:function(e){this.layout.setMaxHeight(e)}},currentRowKey:{immediate:!0,handler:function(e){this.rowKey&&this.store.setCurrentRowKey(e)}},data:{immediate:!0,handler:function(e){this.store.commit("setData",e)}},expandRowKeys:{immediate:!0,handler:function(e){e&&this.store.setExpandRowKeysAdapter(e)}}},created:function(){var e=this;this.tableId="el-table_"+qr++,this.debouncedUpdateLayout=Object(ji["debounce"])(50,(function(){return e.doLayout()}))},mounted:function(){var e=this;this.bindEvents(),this.store.updateColumns(),this.doLayout(),this.resizeState={width:this.$el.offsetWidth,height:this.$el.offsetHeight},this.store.states.columns.forEach((function(t){t.filteredValue&&t.filteredValue.length&&e.store.commit("filterChange",{column:t,values:t.filteredValue,silent:!0})})),this.$ready=!0},destroyed:function(){this.unbindEvents()},data:function(){var e=this.treeProps,t=e.hasChildren,n=void 0===t?"hasChildren":t,i=e.children,r=void 0===i?"children":i;this.store=vr(this,{rowKey:this.rowKey,defaultExpandAll:this.defaultExpandAll,selectOnIndeterminate:this.selectOnIndeterminate,indent:this.indent,lazy:this.lazy,lazyColumnIdentifier:n,childrenColumnName:r});var o=new kr({store:this.store,table:this,fit:this.fit,showHeader:this.showHeader});return{layout:o,isHidden:!1,renderExpanded:null,resizeProxyVisible:!1,resizeState:{width:null,height:null},isGroup:!1,scrollPosition:"left"}}},Kr=Ur,Gr=l(Kr,Li,Pi,!1,null,null,null);Gr.options.__file="packages/table/src/table.vue";var Yr=Gr.exports;Yr.install=function(e){e.component(Yr.name,Yr)};var Xr=Yr,Zr={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:"",className:"el-table-column--selection"},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Qr={selection:{renderHeader:function(e,t){var n=t.store;return e("el-checkbox",{attrs:{disabled:n.states.data&&0===n.states.data.length,indeterminate:n.states.selection.length>0&&!this.isAllSelected,value:this.isAllSelected},nativeOn:{click:this.toggleAllSelection}})},renderCell:function(e,t){var n=t.row,i=t.column,r=t.store,o=t.$index;return e("el-checkbox",{nativeOn:{click:function(e){return e.stopPropagation()}},attrs:{value:r.isSelected(n),disabled:!!i.selectable&&!i.selectable.call(null,n,o)},on:{input:function(){r.commit("rowSelectedChanged",n)}}})},sortable:!1,resizable:!1},index:{renderHeader:function(e,t){var n=t.column;return n.label||"#"},renderCell:function(e,t){var n=t.$index,i=t.column,r=n+1,o=i.index;return"number"===typeof o?r=n+o:"function"===typeof o&&(r=o(n)),e("div",[r])},sortable:!1},expand:{renderHeader:function(e,t){var n=t.column;return n.label||""},renderCell:function(e,t){var n=t.row,i=t.store,r=["el-table__expand-icon"];i.states.expandRows.indexOf(n)>-1&&r.push("el-table__expand-icon--expanded");var o=function(e){e.stopPropagation(),i.toggleRowExpansion(n)};return e("div",{class:r,on:{click:o}},[e("i",{class:"el-icon el-icon-arrow-right"})])},sortable:!1,resizable:!1,className:"el-table__expand-column"}};function Jr(e,t){var n=t.row,i=t.column,r=t.$index,o=i.property,a=o&&Object(y["getPropByPath"])(n,o).v;return i&&i.formatter?i.formatter(n,i,a,r):a}function eo(e,t){var n=t.row,i=t.treeNode,r=t.store;if(!i)return null;var o=[],a=function(e){e.stopPropagation(),r.loadOrToggle(n)};if(i.indent&&o.push(e("span",{class:"el-table__indent",style:{"padding-left":i.indent+"px"}})),"boolean"!==typeof i.expanded||i.noLazyChildren)o.push(e("span",{class:"el-table__placeholder"}));else{var s=["el-table__expand-icon",i.expanded?"el-table__expand-icon--expanded":""],l=["el-icon-arrow-right"];i.loading&&(l=["el-icon-loading"]),o.push(e("div",{class:s,on:{click:a}},[e("i",{class:l})]))}return o}var to=Object.assign||function(e){for(var t=1;t-1}))}}},data:function(){return{isSubColumn:!1,columns:[]}},computed:{owner:function(){var e=this.$parent;while(e&&!e.tableId)e=e.$parent;return e},columnOrTableParent:function(){var e=this.$parent;while(e&&!e.tableId&&!e.columnId)e=e.$parent;return e},realWidth:function(){return ir(this.width)},realMinWidth:function(){return rr(this.minWidth)},realAlign:function(){return this.align?"is-"+this.align:null},realHeaderAlign:function(){return this.headerAlign?"is-"+this.headerAlign:this.realAlign}},methods:{getPropsData:function(){for(var e=this,t=arguments.length,n=Array(t),i=0;i3&&void 0!==arguments[3]?arguments[3]:"-";if(!e)return null;var r=(go[n]||go["default"]).parser,o=t||co[n];return r(e,o,i)},yo=function(e,t,n){if(!e)return null;var i=(go[n]||go["default"]).formatter,r=t||co[n];return i(e,r)},wo=function(e,t){var n=function(e,t){var n=e instanceof Date,i=t instanceof Date;return n&&i?e.getTime()===t.getTime():!n&&!i&&e===t},i=e instanceof Array,r=t instanceof Array;return i&&r?e.length===t.length&&e.every((function(e,i){return n(e,t[i])})):!i&&!r&&n(e,t)},xo=function(e){return"string"===typeof e||e instanceof String},_o=function(e){return null===e||void 0===e||xo(e)||Array.isArray(e)&&2===e.length&&e.every(xo)},ko={mixins:[D.a,lo],inject:{elForm:{default:""},elFormItem:{default:""}},props:{size:String,format:String,valueFormat:String,readonly:Boolean,placeholder:String,startPlaceholder:String,endPlaceholder:String,prefixIcon:String,clearIcon:{type:String,default:"el-icon-circle-close"},name:{default:"",validator:_o},disabled:Boolean,clearable:{type:Boolean,default:!0},id:{default:"",validator:_o},popperClass:String,editable:{type:Boolean,default:!0},align:{type:String,default:"left"},value:{},defaultValue:{},defaultTime:{},rangeSeparator:{default:"-"},pickerOptions:{},unlinkPanels:Boolean,validateEvent:{type:Boolean,default:!0}},components:{ElInput:g.a},directives:{Clickoutside:B.a},data:function(){return{pickerVisible:!1,showClose:!1,userInput:null,valueOnOpen:null,unwatchPickerOptions:null}},watch:{pickerVisible:function(e){this.readonly||this.pickerDisabled||(e?(this.showPicker(),this.valueOnOpen=Array.isArray(this.value)?[].concat(this.value):this.value):(this.hidePicker(),this.emitChange(this.value),this.userInput=null,this.validateEvent&&this.dispatch("ElFormItem","el.form.blur"),this.$emit("blur",this),this.blur()))},parsedValue:{immediate:!0,handler:function(e){this.picker&&(this.picker.value=e)}},defaultValue:function(e){this.picker&&(this.picker.defaultValue=e)},value:function(e,t){wo(e,t)||this.pickerVisible||!this.validateEvent||this.dispatch("ElFormItem","el.form.change",e)}},computed:{ranged:function(){return this.type.indexOf("range")>-1},reference:function(){var e=this.$refs.reference;return e.$el||e},refInput:function(){return this.reference?[].slice.call(this.reference.querySelectorAll("input")):[]},valueIsEmpty:function(){var e=this.value;if(Array.isArray(e)){for(var t=0,n=e.length;t0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.userInput=null,e.pickerVisible=e.picker.visible=n,e.emitInput(t),e.picker.resetView&&e.picker.resetView()})),this.picker.$on("select-range",(function(t,n,i){0!==e.refInput.length&&(i&&"min"!==i?"max"===i&&(e.refInput[1].setSelectionRange(t,n),e.refInput[1].focus()):(e.refInput[0].setSelectionRange(t,n),e.refInput[0].focus()))}))},unmountPicker:function(){this.picker&&(this.picker.$destroy(),this.picker.$off(),"function"===typeof this.unwatchPickerOptions&&this.unwatchPickerOptions(),this.picker.$el.parentNode.removeChild(this.picker.$el))},emitChange:function(e){wo(e,this.valueOnOpen)||(this.$emit("change",e),this.valueOnOpen=e,this.validateEvent&&this.dispatch("ElFormItem","el.form.change",e))},emitInput:function(e){var t=this.formatToValue(e);wo(this.value,t)||this.$emit("input",t)},isValidValue:function(e){return this.picker||this.mountPicker(),!this.picker.isValidValue||e&&this.picker.isValidValue(e)}}},Co=ko,So=l(Co,oo,ao,!1,null,null,null);So.options.__file="packages/date-picker/src/picker.vue";var Oo=So.exports,To=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-enter":e.handleEnter,"after-leave":e.handleLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,i){return n("button",{key:i,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),n("div",{staticClass:"el-picker-panel__body"},[e.showTime?n("div",{staticClass:"el-date-picker__time-header"},[n("span",{staticClass:"el-date-picker__editor-wrap"},[n("el-input",{attrs:{placeholder:e.t("el.datepicker.selectDate"),value:e.visibleDate,size:"small"},on:{input:function(t){return e.userInputDate=t},change:e.handleVisibleDateChange}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleTimePickClose,expression:"handleTimePickClose"}],staticClass:"el-date-picker__editor-wrap"},[n("el-input",{ref:"input",attrs:{placeholder:e.t("el.datepicker.selectTime"),value:e.visibleTime,size:"small"},on:{focus:function(t){e.timePickerVisible=!0},input:function(t){return e.userInputTime=t},change:e.handleVisibleTimeChange}}),n("time-picker",{ref:"timepicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.timePickerVisible},on:{pick:e.handleTimePick,mounted:e.proxyTimePickerDataProperties}})],1)]):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:"time"!==e.currentView,expression:"currentView !== 'time'"}],staticClass:"el-date-picker__header",class:{"el-date-picker__header--bordered":"year"===e.currentView||"month"===e.currentView}},[n("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevYear")},on:{click:e.prevYear}}),n("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevMonth")},on:{click:e.prevMonth}}),n("span",{staticClass:"el-date-picker__header-label",attrs:{role:"button"},on:{click:e.showYearPicker}},[e._v(e._s(e.yearLabel))]),n("span",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-date-picker__header-label",class:{active:"month"===e.currentView},attrs:{role:"button"},on:{click:e.showMonthPicker}},[e._v(e._s(e.t("el.datepicker.month"+(e.month+1))))]),n("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextYear")},on:{click:e.nextYear}}),n("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextMonth")},on:{click:e.nextMonth}})]),n("div",{staticClass:"el-picker-panel__content"},[n("date-table",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],attrs:{"selection-mode":e.selectionMode,"first-day-of-week":e.firstDayOfWeek,value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"cell-class-name":e.cellClassName,"disabled-date":e.disabledDate},on:{pick:e.handleDatePick}}),n("year-table",{directives:[{name:"show",rawName:"v-show",value:"year"===e.currentView,expression:"currentView === 'year'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleYearPick}}),n("month-table",{directives:[{name:"show",rawName:"v-show",value:"month"===e.currentView,expression:"currentView === 'month'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleMonthPick}})],1)])],2),n("div",{directives:[{name:"show",rawName:"v-show",value:e.footerVisible&&"date"===e.currentView,expression:"footerVisible && currentView === 'date'"}],staticClass:"el-picker-panel__footer"},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:"dates"!==e.selectionMode,expression:"selectionMode !== 'dates'"}],staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.changeToNow}},[e._v("\n "+e._s(e.t("el.datepicker.now"))+"\n ")]),n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini"},on:{click:e.confirm}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1)])])},Eo=[];To._withStripped=!0;var Do=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-panel el-popper",class:e.popperClass},[n("div",{staticClass:"el-time-panel__content",class:{"has-seconds":e.showSeconds}},[n("time-spinner",{ref:"spinner",attrs:{"arrow-control":e.useArrow,"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,date:e.date},on:{change:e.handleChange,"select-range":e.setSelectionRange}})],1),n("div",{staticClass:"el-time-panel__footer"},[n("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:e.handleCancel}},[e._v(e._s(e.t("el.datepicker.cancel")))]),n("button",{staticClass:"el-time-panel__btn",class:{confirm:!e.disabled},attrs:{type:"button"},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Mo=[];Do._withStripped=!0;var Ao=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-time-spinner",class:{"has-seconds":e.showSeconds}},[e.arrowControl?e._e():[n("el-scrollbar",{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("hours")},mousemove:function(t){e.adjustCurrentSpinner("hours")}}},e._l(e.hoursList,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:i===e.hours,disabled:t},on:{click:function(n){e.handleClick("hours",{value:i,disabled:t})}}},[e._v(e._s(("0"+(e.amPmMode?i%12||12:i)).slice(-2))+e._s(e.amPm(i)))])})),0),n("el-scrollbar",{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("minutes")},mousemove:function(t){e.adjustCurrentSpinner("minutes")}}},e._l(e.minutesList,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:i===e.minutes,disabled:!t},on:{click:function(t){e.handleClick("minutes",{value:i,disabled:!1})}}},[e._v(e._s(("0"+i).slice(-2)))])})),0),n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.showSeconds,expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("seconds")},mousemove:function(t){e.adjustCurrentSpinner("seconds")}}},e._l(60,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:i===e.seconds},on:{click:function(t){e.handleClick("seconds",{value:i,disabled:!1})}}},[e._v(e._s(("0"+i).slice(-2)))])})),0)],e.arrowControl?[n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("hours")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"hours",staticClass:"el-time-spinner__list"},e._l(e.arrowHourList,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:t===e.hours,disabled:e.hoursList[t]}},[e._v(e._s(void 0===t?"":("0"+(e.amPmMode?t%12||12:t)).slice(-2)+e.amPm(t)))])})),0)]),n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("minutes")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"minutes",staticClass:"el-time-spinner__list"},e._l(e.arrowMinuteList,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:t===e.minutes}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])})),0)]),e.showSeconds?n("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("seconds")}}},[n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),n("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),n("ul",{ref:"seconds",staticClass:"el-time-spinner__list"},e._l(e.arrowSecondList,(function(t,i){return n("li",{key:i,staticClass:"el-time-spinner__item",class:{active:t===e.seconds}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])})),0)]):e._e()]:e._e()],2)},No=[];Ao._withStripped=!0;var Io={components:{ElScrollbar:U.a},directives:{repeatClick:Pt},props:{date:{},defaultValue:{},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:String,default:""}},computed:{hours:function(){return this.date.getHours()},minutes:function(){return this.date.getMinutes()},seconds:function(){return this.date.getSeconds()},hoursList:function(){return Object(so["getRangeHours"])(this.selectableRange)},minutesList:function(){return Object(so["getRangeMinutes"])(this.selectableRange,this.hours)},arrowHourList:function(){var e=this.hours;return[e>0?e-1:void 0,e,e<23?e+1:void 0]},arrowMinuteList:function(){var e=this.minutes;return[e>0?e-1:void 0,e,e<59?e+1:void 0]},arrowSecondList:function(){var e=this.seconds;return[e>0?e-1:void 0,e,e<59?e+1:void 0]}},data:function(){return{selectableRange:[],currentScrollbar:null}},mounted:function(){var e=this;this.$nextTick((function(){!e.arrowControl&&e.bindScrollEvent()}))},methods:{increase:function(){this.scrollDown(1)},decrease:function(){this.scrollDown(-1)},modifyDateField:function(e,t){switch(e){case"hours":this.$emit("change",Object(so["modifyTime"])(this.date,t,this.minutes,this.seconds));break;case"minutes":this.$emit("change",Object(so["modifyTime"])(this.date,this.hours,t,this.seconds));break;case"seconds":this.$emit("change",Object(so["modifyTime"])(this.date,this.hours,this.minutes,t));break}},handleClick:function(e,t){var n=t.value,i=t.disabled;i||(this.modifyDateField(e,n),this.emitSelectRange(e),this.adjustSpinner(e,n))},emitSelectRange:function(e){"hours"===e?this.$emit("select-range",0,2):"minutes"===e?this.$emit("select-range",3,5):"seconds"===e&&this.$emit("select-range",6,8),this.currentScrollbar=e},bindScrollEvent:function(){var e=this,t=function(t){e.$refs[t].wrap.onscroll=function(n){e.handleScroll(t,n)}};t("hours"),t("minutes"),t("seconds")},handleScroll:function(e){var t=Math.min(Math.round((this.$refs[e].wrap.scrollTop-(.5*this.scrollBarHeight(e)-10)/this.typeItemHeight(e)+3)/this.typeItemHeight(e)),"hours"===e?23:59);this.modifyDateField(e,t)},adjustSpinners:function(){this.adjustSpinner("hours",this.hours),this.adjustSpinner("minutes",this.minutes),this.adjustSpinner("seconds",this.seconds)},adjustCurrentSpinner:function(e){this.adjustSpinner(e,this[e])},adjustSpinner:function(e,t){if(!this.arrowControl){var n=this.$refs[e].wrap;n&&(n.scrollTop=Math.max(0,t*this.typeItemHeight(e)))}},scrollDown:function(e){var t=this;this.currentScrollbar||this.emitSelectRange("hours");var n=this.currentScrollbar,i=this.hoursList,r=this[n];if("hours"===this.currentScrollbar){var o=Math.abs(e);e=e>0?1:-1;var a=i.length;while(a--&&o)r=(r+e+i.length)%i.length,i[r]||o--;if(i[r])return}else r=(r+e+60)%60;this.modifyDateField(n,r),this.adjustSpinner(n,r),this.$nextTick((function(){return t.emitSelectRange(t.currentScrollbar)}))},amPm:function(e){var t="a"===this.amPmMode.toLowerCase();if(!t)return"";var n="A"===this.amPmMode,i=e<12?" am":" pm";return n&&(i=i.toUpperCase()),i},typeItemHeight:function(e){return this.$refs[e].$el.querySelector("li").offsetHeight},scrollBarHeight:function(e){return this.$refs[e].$el.offsetHeight}}},Lo=Io,Po=l(Lo,Ao,No,!1,null,null,null);Po.options.__file="packages/date-picker/src/basic/time-spinner.vue";var $o=Po.exports,Fo={mixins:[b.a],components:{TimeSpinner:$o},props:{visible:Boolean,timeArrowControl:Boolean},watch:{visible:function(e){var t=this;e?(this.oldValue=this.value,this.$nextTick((function(){return t.$refs.spinner.emitSelectRange("hours")}))):this.needInitAdjust=!0},value:function(e){var t=this,n=void 0;e instanceof Date?n=Object(so["limitTimeRange"])(e,this.selectableRange,this.format):e||(n=this.defaultValue?new Date(this.defaultValue):new Date),this.date=n,this.visible&&this.needInitAdjust&&(this.$nextTick((function(e){return t.adjustSpinners()})),this.needInitAdjust=!1)},selectableRange:function(e){this.$refs.spinner.selectableRange=e},defaultValue:function(e){Object(so["isDate"])(this.value)||(this.date=e?new Date(e):new Date)}},data:function(){return{popperClass:"",format:"HH:mm:ss",value:"",defaultValue:null,date:new Date,oldValue:new Date,selectableRange:[],selectionRange:[0,2],disabled:!1,arrowControl:!1,needInitAdjust:!0}},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},useArrow:function(){return this.arrowControl||this.timeArrowControl||!1},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},methods:{handleCancel:function(){this.$emit("pick",this.oldValue,!1)},handleChange:function(e){this.visible&&(this.date=Object(so["clearMilliseconds"])(e),this.isValidValue(this.date)&&this.$emit("pick",this.date,!0))},setSelectionRange:function(e,t){this.$emit("select-range",e,t),this.selectionRange=[e,t]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(!t){var n=Object(so["clearMilliseconds"])(Object(so["limitTimeRange"])(this.date,this.selectableRange,this.format));this.$emit("pick",n,e,t)}},handleKeydown:function(e){var t=e.keyCode,n={38:-1,40:1,37:-1,39:1};if(37===t||39===t){var i=n[t];return this.changeSelectionRange(i),void e.preventDefault()}if(38===t||40===t){var r=n[t];return this.$refs.spinner.scrollDown(r),void e.preventDefault()}},isValidValue:function(e){return Object(so["timeWithinRange"])(e,this.selectableRange,this.format)},adjustSpinners:function(){return this.$refs.spinner.adjustSpinners()},changeSelectionRange:function(e){var t=[0,3].concat(this.showSeconds?[6]:[]),n=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),i=t.indexOf(this.selectionRange[0]),r=(i+e+t.length)%t.length;this.$refs.spinner.emitSelectRange(n[r])}},mounted:function(){var e=this;this.$nextTick((function(){return e.handleConfirm(!0,!0)})),this.$emit("mounted")}},jo=Fo,zo=l(jo,Do,Mo,!1,null,null,null);zo.options.__file="packages/date-picker/src/panel/time.vue";var Bo=zo.exports,Ro=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("table",{staticClass:"el-year-table",on:{click:e.handleYearTableClick}},[n("tbody",[n("tr",[n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+0)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+1)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+1))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+2)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+2))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+3)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+3))])])]),n("tr",[n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+4)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+4))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+5)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+5))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+6)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+6))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+7)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+7))])])]),n("tr",[n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+8)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+8))])]),n("td",{staticClass:"available",class:e.getCellStyle(e.startYear+9)},[n("a",{staticClass:"cell"},[e._v(e._s(e.startYear+9))])]),n("td"),n("td")])])])},Vo=[];Ro._withStripped=!0;var Ho=function(e){var t=Object(so["getDayCountOfYear"])(e),n=new Date(e,0,1);return Object(so["range"])(t).map((function(e){return Object(so["nextDate"])(n,e)}))},Wo={props:{disabledDate:{},value:{},defaultValue:{validator:function(e){return null===e||e instanceof Date&&Object(so["isDate"])(e)}},date:{}},computed:{startYear:function(){return 10*Math.floor(this.date.getFullYear()/10)}},methods:{getCellStyle:function(e){var t={},n=new Date;return t.disabled="function"===typeof this.disabledDate&&Ho(e).every(this.disabledDate),t.current=Object(y["arrayFindIndex"])(Object(y["coerceTruthyValueToArray"])(this.value),(function(t){return t.getFullYear()===e}))>=0,t.today=n.getFullYear()===e,t.default=this.defaultValue&&this.defaultValue.getFullYear()===e,t},handleYearTableClick:function(e){var t=e.target;if("A"===t.tagName){if(Object(ze["hasClass"])(t.parentNode,"disabled"))return;var n=t.textContent||t.innerText;this.$emit("pick",Number(n))}}}},qo=Wo,Uo=l(qo,Ro,Vo,!1,null,null,null);Uo.options.__file="packages/date-picker/src/basic/year-table.vue";var Ko=Uo.exports,Go=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("table",{staticClass:"el-month-table",on:{click:e.handleMonthTableClick,mousemove:e.handleMouseMove}},[n("tbody",e._l(e.rows,(function(t,i){return n("tr",{key:i},e._l(t,(function(t,i){return n("td",{key:i,class:e.getCellStyle(t)},[n("div",[n("a",{staticClass:"cell"},[e._v(e._s(e.t("el.datepicker.months."+e.months[t.text])))])])])})),0)})),0)])},Yo=[];Go._withStripped=!0;var Xo=function(e,t){var n=Object(so["getDayCountOfMonth"])(e,t),i=new Date(e,t,1);return Object(so["range"])(n).map((function(e){return Object(so["nextDate"])(i,e)}))},Zo=function(e){return new Date(e.getFullYear(),e.getMonth())},Qo=function(e){return"number"===typeof e||"string"===typeof e?Zo(new Date(e)).getTime():e instanceof Date?Zo(e).getTime():NaN},Jo={props:{disabledDate:{},value:{},selectionMode:{default:"month"},minDate:{},maxDate:{},defaultValue:{validator:function(e){return null===e||Object(so["isDate"])(e)||Array.isArray(e)&&e.every(so["isDate"])}},date:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},mixins:[b.a],watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){Qo(e)!==Qo(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){Qo(e)!==Qo(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{months:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],tableRows:[[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var n=new Date(t);return this.date.getFullYear()===n.getFullYear()&&Number(e.text)===n.getMonth()},getCellStyle:function(e){var t=this,n={},i=this.date.getFullYear(),r=new Date,o=e.text,a=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[];return n.disabled="function"===typeof this.disabledDate&&Xo(i,o).every(this.disabledDate),n.current=Object(y["arrayFindIndex"])(Object(y["coerceTruthyValueToArray"])(this.value),(function(e){return e.getFullYear()===i&&e.getMonth()===o}))>=0,n.today=r.getFullYear()===i&&r.getMonth()===o,n.default=a.some((function(n){return t.cellMatchesDate(e,n)})),e.inRange&&(n["in-range"]=!0,e.start&&(n["start-date"]=!0),e.end&&(n["end-date"]=!0)),n},getMonthOfCell:function(e){var t=this.date.getFullYear();return new Date(t,e,1)},markRange:function(e,t){e=Qo(e),t=Qo(t)||e;var n=[Math.min(e,t),Math.max(e,t)];e=n[0],t=n[1];for(var i=this.rows,r=0,o=i.length;r=e&&d<=t,c.start=e&&d===e,c.end=t&&d===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var n=t.parentNode.rowIndex,i=t.cellIndex;this.rows[n][i].disabled||n===this.lastRow&&i===this.lastColumn||(this.lastRow=n,this.lastColumn=i,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getMonthOfCell(4*n+i)}}))}}},handleMonthTableClick:function(e){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName&&!Object(ze["hasClass"])(t,"disabled")){var n=t.cellIndex,i=t.parentNode.rowIndex,r=4*i+n,o=this.getMonthOfCell(r);"range"===this.selectionMode?this.rangeState.selecting?(o>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:o}):this.$emit("pick",{minDate:o,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:o,maxDate:null}),this.rangeState.selecting=!0):this.$emit("pick",r)}}},computed:{rows:function(){for(var e=this,t=this.tableRows,n=this.disabledDate,i=[],r=Qo(new Date),o=0;o<3;o++)for(var a=t[o],s=function(t){var s=a[t];s||(s={row:o,column:t,type:"normal",inRange:!1,start:!1,end:!1}),s.type="normal";var l=4*o+t,c=new Date(e.date.getFullYear(),l).getTime();s.inRange=c>=Qo(e.minDate)&&c<=Qo(e.maxDate),s.start=e.minDate&&c===Qo(e.minDate),s.end=e.maxDate&&c===Qo(e.maxDate);var u=c===r;u&&(s.type="today"),s.text=l;var d=new Date(c);s.disabled="function"===typeof n&&n(d),s.selected=Object(y["arrayFind"])(i,(function(e){return e.getTime()===d.getTime()})),e.$set(a,t,s)},l=0;l<4;l++)s(l);return t}}},ea=Jo,ta=l(ea,Go,Yo,!1,null,null,null);ta.options.__file="packages/date-picker/src/basic/month-table.vue";var na=ta.exports,ia=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("table",{staticClass:"el-date-table",class:{"is-week-mode":"week"===e.selectionMode},attrs:{cellspacing:"0",cellpadding:"0"},on:{click:e.handleClick,mousemove:e.handleMouseMove}},[n("tbody",[n("tr",[e.showWeekNumber?n("th",[e._v(e._s(e.t("el.datepicker.week")))]):e._e(),e._l(e.WEEKS,(function(t,i){return n("th",{key:i},[e._v(e._s(e.t("el.datepicker.weeks."+t)))])}))],2),e._l(e.rows,(function(t,i){return n("tr",{key:i,staticClass:"el-date-table__row",class:{current:e.isWeekActive(t[1])}},e._l(t,(function(t,i){return n("td",{key:i,class:e.getCellClasses(t)},[n("div",[n("span",[e._v("\n "+e._s(t.text)+"\n ")])])])})),0)}))],2)])},ra=[];ia._withStripped=!0;var oa=["sun","mon","tue","wed","thu","fri","sat"],aa=function(e){return"number"===typeof e||"string"===typeof e?Object(so["clearTime"])(new Date(e)).getTime():e instanceof Date?Object(so["clearTime"])(e).getTime():NaN},sa=function(e,t){var n="function"===typeof t?Object(y["arrayFindIndex"])(e,t):e.indexOf(t);return n>=0?[].concat(e.slice(0,n),e.slice(n+1)):e},la={mixins:[b.a],props:{firstDayOfWeek:{default:7,type:Number,validator:function(e){return e>=1&&e<=7}},value:{},defaultValue:{validator:function(e){return null===e||Object(so["isDate"])(e)||Array.isArray(e)&&e.every(so["isDate"])}},date:{},selectionMode:{default:"day"},showWeekNumber:{type:Boolean,default:!1},disabledDate:{},cellClassName:{},minDate:{},maxDate:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},computed:{offsetDay:function(){var e=this.firstDayOfWeek;return e>3?7-e:-e},WEEKS:function(){var e=this.firstDayOfWeek;return oa.concat(oa).slice(e,e+7)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},startDate:function(){return Object(so["getStartDateOfMonth"])(this.year,this.month)},rows:function(){var e=this,t=new Date(this.year,this.month,1),n=Object(so["getFirstDayOfMonth"])(t),i=Object(so["getDayCountOfMonth"])(t.getFullYear(),t.getMonth()),r=Object(so["getDayCountOfMonth"])(t.getFullYear(),0===t.getMonth()?11:t.getMonth()-1);n=0===n?7:n;for(var o=this.offsetDay,a=this.tableRows,s=1,l=this.startDate,c=this.disabledDate,u=this.cellClassName,d="dates"===this.selectionMode?Object(y["coerceTruthyValueToArray"])(this.value):[],h=aa(new Date),f=0;f<6;f++){var p=a[f];this.showWeekNumber&&(p[0]||(p[0]={type:"week",text:Object(so["getWeekNumber"])(Object(so["nextDate"])(l,7*f+1))}));for(var m=function(t){var a=p[e.showWeekNumber?t+1:t];a||(a={row:f,column:t,type:"normal",inRange:!1,start:!1,end:!1}),a.type="normal";var m=7*f+t,g=Object(so["nextDate"])(l,m-o).getTime();a.inRange=g>=aa(e.minDate)&&g<=aa(e.maxDate),a.start=e.minDate&&g===aa(e.minDate),a.end=e.maxDate&&g===aa(e.maxDate);var v=g===h;if(v&&(a.type="today"),f>=0&&f<=1){var b=n+o<0?7+n+o:n+o;t+7*f>=b?a.text=s++:(a.text=r-(b-t%7)+1+7*f,a.type="prev-month")}else s<=i?a.text=s++:(a.text=s++-i,a.type="next-month");var w=new Date(g);a.disabled="function"===typeof c&&c(w),a.selected=Object(y["arrayFind"])(d,(function(e){return e.getTime()===w.getTime()})),a.customClass="function"===typeof u&&u(w),e.$set(p,e.showWeekNumber?t+1:t,a)},g=0;g<7;g++)m(g);if("week"===this.selectionMode){var v=this.showWeekNumber?1:0,b=this.showWeekNumber?7:6,w=this.isWeekActive(p[v+1]);p[v].inRange=w,p[v].start=w,p[b].inRange=w,p[b].end=w}}return a}},watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){aa(e)!==aa(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){aa(e)!==aa(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{tableRows:[[],[],[],[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var n=new Date(t);return this.year===n.getFullYear()&&this.month===n.getMonth()&&Number(e.text)===n.getDate()},getCellClasses:function(e){var t=this,n=this.selectionMode,i=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[],r=[];return"normal"!==e.type&&"today"!==e.type||e.disabled?r.push(e.type):(r.push("available"),"today"===e.type&&r.push("today")),"normal"===e.type&&i.some((function(n){return t.cellMatchesDate(e,n)}))&&r.push("default"),"day"!==n||"normal"!==e.type&&"today"!==e.type||!this.cellMatchesDate(e,this.value)||r.push("current"),!e.inRange||"normal"!==e.type&&"today"!==e.type&&"week"!==this.selectionMode||(r.push("in-range"),e.start&&r.push("start-date"),e.end&&r.push("end-date")),e.disabled&&r.push("disabled"),e.selected&&r.push("selected"),e.customClass&&r.push(e.customClass),r.join(" ")},getDateOfCell:function(e,t){var n=7*e+(t-(this.showWeekNumber?1:0))-this.offsetDay;return Object(so["nextDate"])(this.startDate,n)},isWeekActive:function(e){if("week"!==this.selectionMode)return!1;var t=new Date(this.year,this.month,1),n=t.getFullYear(),i=t.getMonth();if("prev-month"===e.type&&(t.setMonth(0===i?11:i-1),t.setFullYear(0===i?n-1:n)),"next-month"===e.type&&(t.setMonth(11===i?0:i+1),t.setFullYear(11===i?n+1:n)),t.setDate(parseInt(e.text,10)),Object(so["isDate"])(this.value)){var r=(this.value.getDay()-this.firstDayOfWeek+7)%7-1,o=Object(so["prevDate"])(this.value,r);return o.getTime()===t.getTime()}return!1},markRange:function(e,t){e=aa(e),t=aa(t)||e;var n=[Math.min(e,t),Math.max(e,t)];e=n[0],t=n[1];for(var i=this.startDate,r=this.rows,o=0,a=r.length;o=e&&h<=t,u.start=e&&h===e,u.end=t&&h===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var n=t.parentNode.rowIndex-1,i=t.cellIndex;this.rows[n][i].disabled||n===this.lastRow&&i===this.lastColumn||(this.lastRow=n,this.lastColumn=i,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getDateOfCell(n,i)}}))}}},handleClick:function(e){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var n=t.parentNode.rowIndex-1,i="week"===this.selectionMode?1:t.cellIndex,r=this.rows[n][i];if(!r.disabled&&"week"!==r.type){var o=this.getDateOfCell(n,i);if("range"===this.selectionMode)this.rangeState.selecting?(o>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:o}):this.$emit("pick",{minDate:o,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:o,maxDate:null}),this.rangeState.selecting=!0);else if("day"===this.selectionMode)this.$emit("pick",o);else if("week"===this.selectionMode){var a=Object(so["getWeekNumber"])(o),s=o.getFullYear()+"w"+a;this.$emit("pick",{year:o.getFullYear(),week:a,value:s,date:o})}else if("dates"===this.selectionMode){var l=this.value||[],c=r.selected?sa(l,(function(e){return e.getTime()===o.getTime()})):[].concat(l,[o]);this.$emit("pick",c)}}}}}},ca=la,ua=l(ca,ia,ra,!1,null,null,null);ua.options.__file="packages/date-picker/src/basic/date-table.vue";var da=ua.exports,ha={mixins:[b.a],directives:{Clickoutside:B.a},watch:{showTime:function(e){var t=this;e&&this.$nextTick((function(e){var n=t.$refs.input.$el;n&&(t.pickerWidth=n.getBoundingClientRect().width+10)}))},value:function(e){"dates"===this.selectionMode&&this.value||(Object(so["isDate"])(e)?this.date=new Date(e):this.date=this.getDefaultValue())},defaultValue:function(e){Object(so["isDate"])(this.value)||(this.date=e?new Date(e):new Date)},timePickerVisible:function(e){var t=this;e&&this.$nextTick((function(){return t.$refs.timepicker.adjustSpinners()}))},selectionMode:function(e){"month"===e?"year"===this.currentView&&"month"===this.currentView||(this.currentView="month"):"dates"===e&&(this.currentView="date")}},methods:{proxyTimePickerDataProperties:function(){var e=this,t=function(t){e.$refs.timepicker.format=t},n=function(t){e.$refs.timepicker.value=t},i=function(t){e.$refs.timepicker.date=t},r=function(t){e.$refs.timepicker.selectableRange=t};this.$watch("value",n),this.$watch("date",i),this.$watch("selectableRange",r),t(this.timeFormat),n(this.value),i(this.date),r(this.selectableRange)},handleClear:function(){this.date=this.getDefaultValue(),this.$emit("pick",null)},emit:function(e){for(var t=this,n=arguments.length,i=Array(n>1?n-1:0),r=1;r0)||Object(so["timeWithinRange"])(e,this.selectableRange,this.format||"HH:mm:ss")}},components:{TimePicker:Bo,YearTable:Ko,MonthTable:na,DateTable:da,ElInput:g.a,ElButton:se.a},data:function(){return{popperClass:"",date:new Date,value:"",defaultValue:null,defaultTime:null,showTime:!1,selectionMode:"day",shortcuts:"",visible:!1,currentView:"date",disabledDate:"",cellClassName:"",selectableRange:[],firstDayOfWeek:7,showWeekNumber:!1,timePickerVisible:!1,format:"",arrowControl:!1,userInputDate:null,userInputTime:null}},computed:{year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},week:function(){return Object(so["getWeekNumber"])(this.date)},monthDate:function(){return this.date.getDate()},footerVisible:function(){return this.showTime||"dates"===this.selectionMode},visibleTime:function(){return null!==this.userInputTime?this.userInputTime:Object(so["formatDate"])(this.value||this.defaultValue,this.timeFormat)},visibleDate:function(){return null!==this.userInputDate?this.userInputDate:Object(so["formatDate"])(this.value||this.defaultValue,this.dateFormat)},yearLabel:function(){var e=this.t("el.datepicker.year");if("year"===this.currentView){var t=10*Math.floor(this.year/10);return e?t+" "+e+" - "+(t+9)+" "+e:t+" - "+(t+9)}return this.year+" "+e},timeFormat:function(){return this.format?Object(so["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(so["extractDateFormat"])(this.format):"yyyy-MM-dd"}}},fa=ha,pa=l(fa,To,Eo,!1,null,null,null);pa.options.__file="packages/date-picker/src/panel/date.vue";var ma=pa.exports,ga=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,i){return n("button",{key:i,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),n("div",{staticClass:"el-picker-panel__body"},[e.showTime?n("div",{staticClass:"el-date-range-picker__time-header"},[n("span",{staticClass:"el-date-range-picker__editors-wrap"},[n("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{ref:"minInput",staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startDate"),value:e.minVisibleDate},on:{input:function(t){return e.handleDateInput(t,"min")},change:function(t){return e.handleDateChange(t,"min")}}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMinTimeClose,expression:"handleMinTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startTime"),value:e.minVisibleTime},on:{focus:function(t){e.minTimePickerVisible=!0},input:function(t){return e.handleTimeInput(t,"min")},change:function(t){return e.handleTimeChange(t,"min")}}}),n("time-picker",{ref:"minTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.minTimePickerVisible},on:{pick:e.handleMinTimePick,mounted:function(t){e.$refs.minTimePicker.format=e.timeFormat}}})],1)]),n("span",{staticClass:"el-icon-arrow-right"}),n("span",{staticClass:"el-date-range-picker__editors-wrap is-right"},[n("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endDate"),value:e.maxVisibleDate,readonly:!e.minDate},on:{input:function(t){return e.handleDateInput(t,"max")},change:function(t){return e.handleDateChange(t,"max")}}})],1),n("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMaxTimeClose,expression:"handleMaxTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[n("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endTime"),value:e.maxVisibleTime,readonly:!e.minDate},on:{focus:function(t){e.minDate&&(e.maxTimePickerVisible=!0)},input:function(t){return e.handleTimeInput(t,"max")},change:function(t){return e.handleTimeChange(t,"max")}}}),n("time-picker",{ref:"maxTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.maxTimePickerVisible},on:{pick:e.handleMaxTimePick,mounted:function(t){e.$refs.maxTimePicker.format=e.timeFormat}}})],1)])]):e._e(),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[n("div",{staticClass:"el-date-range-picker__header"},[n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevMonth}}),e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.leftNextMonth}}):e._e(),n("div",[e._v(e._s(e.leftLabel))])]),n("date-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"cell-class-name":e.cellClassName,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[n("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.rightPrevMonth}}):e._e(),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",attrs:{type:"button"},on:{click:e.rightNextMonth}}),n("div",[e._v(e._s(e.rightLabel))])]),n("date-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"cell-class-name":e.cellClassName,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2),e.showTime?n("div",{staticClass:"el-picker-panel__footer"},[n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.handleClear}},[e._v("\n "+e._s(e.t("el.datepicker.clear"))+"\n ")]),n("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm(!1)}}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1):e._e()])])},va=[];ga._withStripped=!0;var ba=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(so["nextDate"])(new Date(e),1)]:[new Date,Object(so["nextDate"])(new Date,1)]},ya={mixins:[b.a],directives:{Clickoutside:B.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.leftDate.getMonth()+1))},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.rightDate.getMonth()+1))},leftYear:function(){return this.leftDate.getFullYear()},leftMonth:function(){return this.leftDate.getMonth()},leftMonthDate:function(){return this.leftDate.getDate()},rightYear:function(){return this.rightDate.getFullYear()},rightMonth:function(){return this.rightDate.getMonth()},rightMonthDate:function(){return this.rightDate.getDate()},minVisibleDate:function(){return null!==this.dateUserInput.min?this.dateUserInput.min:this.minDate?Object(so["formatDate"])(this.minDate,this.dateFormat):""},maxVisibleDate:function(){return null!==this.dateUserInput.max?this.dateUserInput.max:this.maxDate||this.minDate?Object(so["formatDate"])(this.maxDate||this.minDate,this.dateFormat):""},minVisibleTime:function(){return null!==this.timeUserInput.min?this.timeUserInput.min:this.minDate?Object(so["formatDate"])(this.minDate,this.timeFormat):""},maxVisibleTime:function(){return null!==this.timeUserInput.max?this.timeUserInput.max:this.maxDate||this.minDate?Object(so["formatDate"])(this.maxDate||this.minDate,this.timeFormat):""},timeFormat:function(){return this.format?Object(so["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(so["extractDateFormat"])(this.format):"yyyy-MM-dd"},enableMonthArrow:function(){var e=(this.leftMonth+1)%12,t=this.leftMonth+1>=12?1:0;return this.unlinkPanels&&new Date(this.leftYear+t,e)=12}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(so["nextMonth"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},showTime:!1,shortcuts:"",visible:"",disabledDate:"",cellClassName:"",firstDayOfWeek:7,minTimePickerVisible:!1,maxTimePickerVisible:!1,format:"",arrowControl:!1,unlinkPanels:!1,dateUserInput:{min:null,max:null},timeUserInput:{min:null,max:null}}},watch:{minDate:function(e){var t=this;this.dateUserInput.min=null,this.timeUserInput.min=null,this.$nextTick((function(){if(t.$refs.maxTimePicker&&t.maxDate&&t.maxDatethis.maxDate&&(this.maxDate=this.minDate)):(this.maxDate=Object(so["modifyDate"])(this.maxDate,n.getFullYear(),n.getMonth(),n.getDate()),this.maxDatethis.maxDate&&(this.maxDate=this.minDate),this.$refs.minTimePicker.value=this.minDate,this.minTimePickerVisible=!1):(this.maxDate=Object(so["modifyTime"])(this.maxDate,n.getHours(),n.getMinutes(),n.getSeconds()),this.maxDate1&&void 0!==arguments[1])||arguments[1],i=this.defaultTime||[],r=Object(so["modifyWithTimeString"])(e.minDate,i[0]),o=Object(so["modifyWithTimeString"])(e.maxDate,i[1]);this.maxDate===o&&this.minDate===r||(this.onPick&&this.onPick(e),this.maxDate=o,this.minDate=r,setTimeout((function(){t.maxDate=o,t.minDate=r}),10),n&&!this.showTime&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},handleMinTimePick:function(e,t,n){this.minDate=this.minDate||new Date,e&&(this.minDate=Object(so["modifyTime"])(this.minDate,e.getHours(),e.getMinutes(),e.getSeconds())),n||(this.minTimePickerVisible=t),(!this.maxDate||this.maxDate&&this.maxDate.getTime()this.maxDate.getTime()&&(this.minDate=new Date(this.maxDate))},handleMaxTimeClose:function(){this.maxTimePickerVisible=!1},leftPrevYear:function(){this.leftDate=Object(so["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(so["nextMonth"])(this.leftDate))},leftPrevMonth:function(){this.leftDate=Object(so["prevMonth"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(so["nextMonth"])(this.leftDate))},rightNextYear:function(){this.unlinkPanels?this.rightDate=Object(so["nextYear"])(this.rightDate):(this.leftDate=Object(so["nextYear"])(this.leftDate),this.rightDate=Object(so["nextMonth"])(this.leftDate))},rightNextMonth:function(){this.unlinkPanels?this.rightDate=Object(so["nextMonth"])(this.rightDate):(this.leftDate=Object(so["nextMonth"])(this.leftDate),this.rightDate=Object(so["nextMonth"])(this.leftDate))},leftNextYear:function(){this.leftDate=Object(so["nextYear"])(this.leftDate)},leftNextMonth:function(){this.leftDate=Object(so["nextMonth"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(so["prevYear"])(this.rightDate)},rightPrevMonth:function(){this.rightDate=Object(so["prevMonth"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(so["isDate"])(e[0])&&Object(so["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate&&null==this.maxDate&&(this.rangeState.selecting=!1),this.minDate=this.value&&Object(so["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(so["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{TimePicker:Bo,DateTable:da,ElInput:g.a,ElButton:se.a}},wa=ya,xa=l(wa,ga,va,!1,null,null,null);xa.options.__file="packages/date-picker/src/panel/date-range.vue";var _a=xa.exports,ka=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts},e.popperClass]},[n("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?n("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,(function(t,i){return n("button",{key:i,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(n){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])})),0):e._e(),n("div",{staticClass:"el-picker-panel__body"},[n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[n("div",{staticClass:"el-date-range-picker__header"},[n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),n("div",[e._v(e._s(e.leftLabel))])]),n("month-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),n("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[n("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),n("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),n("div",[e._v(e._s(e.rightLabel))])]),n("month-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2)])])},Ca=[];ka._withStripped=!0;var Sa=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(so["nextMonth"])(new Date(e))]:[new Date,Object(so["nextMonth"])(new Date)]},Oa={mixins:[b.a],directives:{Clickoutside:B.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")},leftYear:function(){return this.leftDate.getFullYear()},rightYear:function(){return this.rightDate.getFullYear()===this.leftDate.getFullYear()?this.leftDate.getFullYear()+1:this.rightDate.getFullYear()},enableYearArrow:function(){return this.unlinkPanels&&this.rightYear>this.leftYear+1}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(so["nextYear"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},shortcuts:"",visible:"",disabledDate:"",format:"",arrowControl:!1,unlinkPanels:!1}},watch:{value:function(e){if(e){if(Array.isArray(e))if(this.minDate=Object(so["isDate"])(e[0])?new Date(e[0]):null,this.maxDate=Object(so["isDate"])(e[1])?new Date(e[1]):null,this.minDate)if(this.leftDate=this.minDate,this.unlinkPanels&&this.maxDate){var t=this.minDate.getFullYear(),n=this.maxDate.getFullYear();this.rightDate=t===n?Object(so["nextYear"])(this.maxDate):this.maxDate}else this.rightDate=Object(so["nextYear"])(this.leftDate);else this.leftDate=Sa(this.defaultValue)[0],this.rightDate=Object(so["nextYear"])(this.leftDate)}else this.minDate=null,this.maxDate=null},defaultValue:function(e){if(!Array.isArray(this.value)){var t=Sa(e),n=t[0],i=t[1];this.leftDate=n,this.rightDate=e&&e[1]&&n.getFullYear()!==i.getFullYear()&&this.unlinkPanels?i:Object(so["nextYear"])(this.leftDate)}}},methods:{handleClear:function(){this.minDate=null,this.maxDate=null,this.leftDate=Sa(this.defaultValue)[0],this.rightDate=Object(so["nextYear"])(this.leftDate),this.$emit("pick",null)},handleChangeRange:function(e){this.minDate=e.minDate,this.maxDate=e.maxDate,this.rangeState=e.rangeState},handleRangePick:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.defaultTime||[],r=Object(so["modifyWithTimeString"])(e.minDate,i[0]),o=Object(so["modifyWithTimeString"])(e.maxDate,i[1]);this.maxDate===o&&this.minDate===r||(this.onPick&&this.onPick(e),this.maxDate=o,this.minDate=r,setTimeout((function(){t.maxDate=o,t.minDate=r}),10),n&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},leftPrevYear:function(){this.leftDate=Object(so["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(so["prevYear"])(this.rightDate))},rightNextYear:function(){this.unlinkPanels||(this.leftDate=Object(so["nextYear"])(this.leftDate)),this.rightDate=Object(so["nextYear"])(this.rightDate)},leftNextYear:function(){this.leftDate=Object(so["nextYear"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(so["prevYear"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(so["isDate"])(e[0])&&Object(so["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate=this.value&&Object(so["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(so["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{MonthTable:na,ElInput:g.a,ElButton:se.a}},Ta=Oa,Ea=l(Ta,ka,Ca,!1,null,null,null);Ea.options.__file="packages/date-picker/src/panel/month-range.vue";var Da=Ea.exports,Ma=function(e){return"daterange"===e||"datetimerange"===e?_a:"monthrange"===e?Da:ma},Aa={mixins:[Oo],name:"ElDatePicker",props:{type:{type:String,default:"date"},timeArrowControl:Boolean},watch:{type:function(e){this.picker?(this.unmountPicker(),this.panel=Ma(e),this.mountPicker()):this.panel=Ma(e)}},created:function(){this.panel=Ma(this.type)},install:function(e){e.component(Aa.name,Aa)}},Na=Aa,Ia=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":function(t){e.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"popper",staticClass:"el-picker-panel time-select el-popper",class:e.popperClass,style:{width:e.width+"px"}},[n("el-scrollbar",{attrs:{noresize:"","wrap-class":"el-picker-panel__content"}},e._l(e.items,(function(t){return n("div",{key:t.value,staticClass:"time-select-item",class:{selected:e.value===t.value,disabled:t.disabled,default:t.value===e.defaultValue},attrs:{disabled:t.disabled},on:{click:function(n){e.handleClick(t)}}},[e._v(e._s(t.value))])})),0)],1)])},La=[];Ia._withStripped=!0;var Pa=function(e){var t=(e||"").split(":");if(t.length>=2){var n=parseInt(t[0],10),i=parseInt(t[1],10);return{hours:n,minutes:i}}return null},$a=function(e,t){var n=Pa(e),i=Pa(t),r=n.minutes+60*n.hours,o=i.minutes+60*i.hours;return r===o?0:r>o?1:-1},Fa=function(e){return(e.hours<10?"0"+e.hours:e.hours)+":"+(e.minutes<10?"0"+e.minutes:e.minutes)},ja=function(e,t){var n=Pa(e),i=Pa(t),r={hours:n.hours,minutes:n.minutes};return r.minutes+=i.minutes,r.hours+=i.hours,r.hours+=Math.floor(r.minutes/60),r.minutes=r.minutes%60,Fa(r)},za={components:{ElScrollbar:U.a},watch:{value:function(e){var t=this;e&&this.$nextTick((function(){return t.scrollToOption()}))}},methods:{handleClick:function(e){e.disabled||this.$emit("pick",e.value)},handleClear:function(){this.$emit("pick",null)},scrollToOption:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".selected",t=this.$refs.popper.querySelector(".el-picker-panel__content");oi()(t,t.querySelector(e))},handleMenuEnter:function(){var e=this,t=-1!==this.items.map((function(e){return e.value})).indexOf(this.value),n=-1!==this.items.map((function(e){return e.value})).indexOf(this.defaultValue),i=(t?".selected":n&&".default")||".time-select-item:not(.disabled)";this.$nextTick((function(){return e.scrollToOption(i)}))},scrollDown:function(e){var t=this.items,n=t.length,i=t.length,r=t.map((function(e){return e.value})).indexOf(this.value);while(i--)if(r=(r+e+n)%n,!t[r].disabled)return void this.$emit("pick",t[r].value,!0)},isValidValue:function(e){return-1!==this.items.filter((function(e){return!e.disabled})).map((function(e){return e.value})).indexOf(e)},handleKeydown:function(e){var t=e.keyCode;if(38===t||40===t){var n={40:1,38:-1},i=n[t.toString()];return this.scrollDown(i),void e.stopPropagation()}}},data:function(){return{popperClass:"",start:"09:00",end:"18:00",step:"00:30",value:"",defaultValue:"",visible:!1,minTime:"",maxTime:"",width:0}},computed:{items:function(){var e=this.start,t=this.end,n=this.step,i=[];if(e&&t&&n){var r=e;while($a(r,t)<=0)i.push({value:r,disabled:$a(r,this.minTime||"-1:-1")<=0||$a(r,this.maxTime||"100:100")>=0}),r=ja(r,n)}return i}}},Ba=za,Ra=l(Ba,Ia,La,!1,null,null,null);Ra.options.__file="packages/date-picker/src/panel/time-select.vue";var Va=Ra.exports,Ha={mixins:[Oo],name:"ElTimeSelect",componentName:"ElTimeSelect",props:{type:{type:String,default:"time-select"}},beforeCreate:function(){this.panel=Va},install:function(e){e.component(Ha.name,Ha)}},Wa=Ha,qa=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-range-picker el-picker-panel el-popper",class:e.popperClass},[n("div",{staticClass:"el-time-range-picker__content"},[n("div",{staticClass:"el-time-range-picker__cell"},[n("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.startTime")))]),n("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[n("time-spinner",{ref:"minSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.minDate},on:{change:e.handleMinChange,"select-range":e.setMinSelectionRange}})],1)]),n("div",{staticClass:"el-time-range-picker__cell"},[n("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.endTime")))]),n("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[n("time-spinner",{ref:"maxSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.maxDate},on:{change:e.handleMaxChange,"select-range":e.setMaxSelectionRange}})],1)])]),n("div",{staticClass:"el-time-panel__footer"},[n("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:function(t){e.handleCancel()}}},[e._v(e._s(e.t("el.datepicker.cancel")))]),n("button",{staticClass:"el-time-panel__btn confirm",attrs:{type:"button",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Ua=[];qa._withStripped=!0;var Ka=Object(so["parseDate"])("00:00:00","HH:mm:ss"),Ga=Object(so["parseDate"])("23:59:59","HH:mm:ss"),Ya=function(e){return Object(so["modifyDate"])(Ka,e.getFullYear(),e.getMonth(),e.getDate())},Xa=function(e){return Object(so["modifyDate"])(Ga,e.getFullYear(),e.getMonth(),e.getDate())},Za=function(e,t){return new Date(Math.min(e.getTime()+t,Xa(e).getTime()))},Qa={mixins:[b.a],components:{TimeSpinner:$o},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},offset:function(){return this.showSeconds?11:8},spinner:function(){return this.selectionRange[0]this.maxDate.getTime()},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},data:function(){return{popperClass:"",minDate:new Date,maxDate:new Date,value:[],oldValue:[new Date,new Date],defaultValue:null,format:"HH:mm:ss",visible:!1,selectionRange:[0,2],arrowControl:!1}},watch:{value:function(e){Array.isArray(e)?(this.minDate=new Date(e[0]),this.maxDate=new Date(e[1])):Array.isArray(this.defaultValue)?(this.minDate=new Date(this.defaultValue[0]),this.maxDate=new Date(this.defaultValue[1])):this.defaultValue?(this.minDate=new Date(this.defaultValue),this.maxDate=Za(new Date(this.defaultValue),36e5)):(this.minDate=new Date,this.maxDate=Za(new Date,36e5))},visible:function(e){var t=this;e&&(this.oldValue=this.value,this.$nextTick((function(){return t.$refs.minSpinner.emitSelectRange("hours")})))}},methods:{handleClear:function(){this.$emit("pick",null)},handleCancel:function(){this.$emit("pick",this.oldValue)},handleMinChange:function(e){this.minDate=Object(so["clearMilliseconds"])(e),this.handleChange()},handleMaxChange:function(e){this.maxDate=Object(so["clearMilliseconds"])(e),this.handleChange()},handleChange:function(){this.isValidValue([this.minDate,this.maxDate])&&(this.$refs.minSpinner.selectableRange=[[Ya(this.minDate),this.maxDate]],this.$refs.maxSpinner.selectableRange=[[this.minDate,Xa(this.maxDate)]],this.$emit("pick",[this.minDate,this.maxDate],!0))},setMinSelectionRange:function(e,t){this.$emit("select-range",e,t,"min"),this.selectionRange=[e,t]},setMaxSelectionRange:function(e,t){this.$emit("select-range",e,t,"max"),this.selectionRange=[e+this.offset,t+this.offset]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$refs.minSpinner.selectableRange,n=this.$refs.maxSpinner.selectableRange;this.minDate=Object(so["limitTimeRange"])(this.minDate,t,this.format),this.maxDate=Object(so["limitTimeRange"])(this.maxDate,n,this.format),this.$emit("pick",[this.minDate,this.maxDate],e)},adjustSpinners:function(){this.$refs.minSpinner.adjustSpinners(),this.$refs.maxSpinner.adjustSpinners()},changeSelectionRange:function(e){var t=this.showSeconds?[0,3,6,11,14,17]:[0,3,8,11],n=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),i=t.indexOf(this.selectionRange[0]),r=(i+e+t.length)%t.length,o=t.length/2;r-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(y["generateId"])()}},watch:{showPopper:function(e){this.disabled||(e?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var e=this,t=this.referenceElm=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),t&&(Object(ze["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),n.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(ze["on"])(t,"focusin",(function(){e.handleFocus();var n=t.__vue__;n&&"function"===typeof n.focus&&n.focus()})),Object(ze["on"])(n,"focusin",this.handleFocus),Object(ze["on"])(t,"focusout",this.handleBlur),Object(ze["on"])(n,"focusout",this.handleBlur)),Object(ze["on"])(t,"keydown",this.handleKeydown),Object(ze["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(ze["on"])(t,"click",this.doToggle),Object(ze["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(ze["on"])(t,"mouseenter",this.handleMouseEnter),Object(ze["on"])(n,"mouseenter",this.handleMouseEnter),Object(ze["on"])(t,"mouseleave",this.handleMouseLeave),Object(ze["on"])(n,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),t.querySelector("input, textarea")?(Object(ze["on"])(t,"focusin",this.doShow),Object(ze["on"])(t,"focusout",this.doClose)):(Object(ze["on"])(t,"mousedown",this.doShow),Object(ze["on"])(t,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(ze["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(ze["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(ze["removeClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout((function(){e.showPopper=!0}),this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout((function(){e.showPopper=!1}),this.closeDelay):this.showPopper=!1},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&n&&!n.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(ze["off"])(e,"click",this.doToggle),Object(ze["off"])(e,"mouseup",this.doClose),Object(ze["off"])(e,"mousedown",this.doShow),Object(ze["off"])(e,"focusin",this.doShow),Object(ze["off"])(e,"focusout",this.doClose),Object(ze["off"])(e,"mousedown",this.doShow),Object(ze["off"])(e,"mouseup",this.doClose),Object(ze["off"])(e,"mouseleave",this.handleMouseLeave),Object(ze["off"])(e,"mouseenter",this.handleMouseEnter),Object(ze["off"])(document,"click",this.handleDocumentClick)}},ss=as,ls=l(ss,rs,os,!1,null,null,null);ls.options.__file="packages/popover/src/main.vue";var cs=ls.exports,us=function(e,t,n){var i=t.expression?t.value:t.arg,r=n.context.$refs[i];r&&(Array.isArray(r)?r[0].$refs.reference=e:r.$refs.reference=e)},ds={bind:function(e,t,n){us(e,t,n)},inserted:function(e,t,n){us(e,t,n)}};qi.a.directive("popover",ds),cs.install=function(e){e.directive("popover",ds),e.component(cs.name,cs)},cs.directive=ds;var hs=cs,fs={name:"ElTooltip",mixins:[W.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(y["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new qi.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=j()(200,(function(){return e.handleClosePopper()})))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var i=n.data=n.data||{};return i.staticClass=this.addTooltipClass(i.staticClass),n},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(ze["on"])(this.referenceElm,"mouseenter",this.show),Object(ze["on"])(this.referenceElm,"mouseleave",this.hide),Object(ze["on"])(this.referenceElm,"focus",(function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()})),Object(ze["on"])(this.referenceElm,"blur",this.handleBlur),Object(ze["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(ze["addClass"])(this.referenceElm,"focusing"):Object(ze["removeClass"])(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?"el-tooltip "+e.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.showPopper=!0}),this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,n=0;n0){Ds=As.shift();var t=Ds.options;for(var n in t)t.hasOwnProperty(n)&&(Ms[n]=t[n]);void 0===t.callback&&(Ms.callback=Ns);var i=Ms.callback;Ms.callback=function(t,n){i(t,n),e()},Object(Ss["isVNode"])(Ms.message)?(Ms.$slots.default=[Ms.message],Ms.message=null):delete Ms.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach((function(e){void 0===Ms[e]&&(Ms[e]=!0)})),document.body.appendChild(Ms.$el),qi.a.nextTick((function(){Ms.visible=!0}))}},Ps=function e(t,n){if(!qi.a.prototype.$isServer){if("string"===typeof t||Object(Ss["isVNode"])(t)?(t={message:t},"string"===typeof arguments[1]&&(t.title=arguments[1])):t.callback&&!n&&(n=t.callback),"undefined"!==typeof Promise)return new Promise((function(i,r){As.push({options:Ot()({},Ts,e.defaults,t),callback:n,resolve:i,reject:r}),Ls()}));As.push({options:Ot()({},Ts,e.defaults,t),callback:n}),Ls()}};Ps.setDefaults=function(e){Ps.defaults=e},Ps.alert=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":Os(t))?(n=t,t=""):void 0===t&&(t=""),Ps(Ot()({title:t,message:e,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},n))},Ps.confirm=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":Os(t))?(n=t,t=""):void 0===t&&(t=""),Ps(Ot()({title:t,message:e,$type:"confirm",showCancelButton:!0},n))},Ps.prompt=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":Os(t))?(n=t,t=""):void 0===t&&(t=""),Ps(Ot()({title:t,message:e,showCancelButton:!0,showInput:!0,$type:"prompt"},n))},Ps.close=function(){Ms.doClose(),Ms.visible=!1,As=[],Ds=null};var $s=Ps,Fs=$s,js=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-breadcrumb",attrs:{"aria-label":"Breadcrumb",role:"navigation"}},[e._t("default")],2)},zs=[];js._withStripped=!0;var Bs={name:"ElBreadcrumb",props:{separator:{type:String,default:"/"},separatorClass:{type:String,default:""}},provide:function(){return{elBreadcrumb:this}},mounted:function(){var e=this.$el.querySelectorAll(".el-breadcrumb__item");e.length&&e[e.length-1].setAttribute("aria-current","page")}},Rs=Bs,Vs=l(Rs,js,zs,!1,null,null,null);Vs.options.__file="packages/breadcrumb/src/breadcrumb.vue";var Hs=Vs.exports;Hs.install=function(e){e.component(Hs.name,Hs)};var Ws=Hs,qs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"el-breadcrumb__item"},[n("span",{ref:"link",class:["el-breadcrumb__inner",e.to?"is-link":""],attrs:{role:"link"}},[e._t("default")],2),e.separatorClass?n("i",{staticClass:"el-breadcrumb__separator",class:e.separatorClass}):n("span",{staticClass:"el-breadcrumb__separator",attrs:{role:"presentation"}},[e._v(e._s(e.separator))])])},Us=[];qs._withStripped=!0;var Ks={name:"ElBreadcrumbItem",props:{to:{},replace:Boolean},data:function(){return{separator:"",separatorClass:""}},inject:["elBreadcrumb"],mounted:function(){var e=this;this.separator=this.elBreadcrumb.separator,this.separatorClass=this.elBreadcrumb.separatorClass;var t=this.$refs.link;t.setAttribute("role","link"),t.addEventListener("click",(function(t){var n=e.to,i=e.$router;n&&i&&(e.replace?i.replace(n):i.push(n))}))}},Gs=Ks,Ys=l(Gs,qs,Us,!1,null,null,null);Ys.options.__file="packages/breadcrumb/src/breadcrumb-item.vue";var Xs=Ys.exports;Xs.install=function(e){e.component(Xs.name,Xs)};var Zs=Xs,Qs=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("form",{staticClass:"el-form",class:[e.labelPosition?"el-form--label-"+e.labelPosition:"",{"el-form--inline":e.inline}]},[e._t("default")],2)},Js=[];Qs._withStripped=!0;var el={name:"ElForm",componentName:"ElForm",provide:function(){return{elForm:this}},props:{model:Object,rules:Object,labelPosition:String,labelWidth:String,labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String,disabled:Boolean,validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1}},watch:{rules:function(){this.fields.forEach((function(e){e.removeValidateEvents(),e.addValidateEvents()})),this.validateOnRuleChange&&this.validate((function(){}))}},computed:{autoLabelWidth:function(){if(!this.potentialLabelWidthArr.length)return 0;var e=Math.max.apply(Math,this.potentialLabelWidthArr);return e?e+"px":""}},data:function(){return{fields:[],potentialLabelWidthArr:[]}},created:function(){var e=this;this.$on("el.form.addField",(function(t){t&&e.fields.push(t)})),this.$on("el.form.removeField",(function(t){t.prop&&e.fields.splice(e.fields.indexOf(t),1)}))},methods:{resetFields:function(){this.model?this.fields.forEach((function(e){e.resetField()})):console.warn("[Element Warn][Form]model is required for resetFields to work.")},clearValidate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length?"string"===typeof e?this.fields.filter((function(t){return e===t.prop})):this.fields.filter((function(t){return e.indexOf(t.prop)>-1})):this.fields;t.forEach((function(e){e.clearValidate()}))},validate:function(e){var t=this;if(this.model){var n=void 0;"function"!==typeof e&&window.Promise&&(n=new window.Promise((function(t,n){e=function(e){e?t(e):n(e)}})));var i=!0,r=0;0===this.fields.length&&e&&e(!0);var o={};return this.fields.forEach((function(n){n.validate("",(function(n,a){n&&(i=!1),o=Ot()({},o,a),"function"===typeof e&&++r===t.fields.length&&e(i,o)}))})),n||void 0}console.warn("[Element Warn][Form]model is required for validate to work!")},validateField:function(e,t){e=[].concat(e);var n=this.fields.filter((function(t){return-1!==e.indexOf(t.prop)}));n.length?n.forEach((function(e){e.validate("",t)})):console.warn("[Element Warn]please pass correct props!")},getLabelWidthIndex:function(e){var t=this.potentialLabelWidthArr.indexOf(e);if(-1===t)throw new Error("[ElementForm]unpected width ",e);return t},registerLabelWidth:function(e,t){if(e&&t){var n=this.getLabelWidthIndex(t);this.potentialLabelWidthArr.splice(n,1,e)}else e&&this.potentialLabelWidthArr.push(e)},deregisterLabelWidth:function(e){var t=this.getLabelWidthIndex(e);this.potentialLabelWidthArr.splice(t,1)}}},tl=el,nl=l(tl,Qs,Js,!1,null,null,null);nl.options.__file="packages/form/src/form.vue";var il=nl.exports;il.install=function(e){e.component(il.name,il)};var rl=il,ol=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-form-item",class:[{"el-form-item--feedback":e.elForm&&e.elForm.statusIcon,"is-error":"error"===e.validateState,"is-validating":"validating"===e.validateState,"is-success":"success"===e.validateState,"is-required":e.isRequired||e.required,"is-no-asterisk":e.elForm&&e.elForm.hideRequiredAsterisk},e.sizeClass?"el-form-item--"+e.sizeClass:""]},[n("label-wrap",{attrs:{"is-auto-width":e.labelStyle&&"auto"===e.labelStyle.width,"update-all":"auto"===e.form.labelWidth}},[e.label||e.$slots.label?n("label",{staticClass:"el-form-item__label",style:e.labelStyle,attrs:{for:e.labelFor}},[e._t("label",[e._v(e._s(e.label+e.form.labelSuffix))])],2):e._e()]),n("div",{staticClass:"el-form-item__content",style:e.contentStyle},[e._t("default"),n("transition",{attrs:{name:"el-zoom-in-top"}},["error"===e.validateState&&e.showMessage&&e.form.showMessage?e._t("error",[n("div",{staticClass:"el-form-item__error",class:{"el-form-item__error--inline":"boolean"===typeof e.inlineMessage?e.inlineMessage:e.elForm&&e.elForm.inlineMessage||!1}},[e._v("\n "+e._s(e.validateMessage)+"\n ")])],{error:e.validateMessage}):e._e()],2)],2)],1)},al=[];ol._withStripped=!0;var sl,ll,cl=n(40),ul=n.n(cl),dl={props:{isAutoWidth:Boolean,updateAll:Boolean},inject:["elForm","elFormItem"],render:function(){var e=arguments[0],t=this.$slots.default;if(!t)return null;if(this.isAutoWidth){var n=this.elForm.autoLabelWidth,i={};if(n&&"auto"!==n){var r=parseInt(n,10)-this.computedWidth;r&&(i.marginLeft=r+"px")}return e("div",{class:"el-form-item__label-wrap",style:i},[t])}return t[0]},methods:{getLabelWidth:function(){if(this.$el&&this.$el.firstElementChild){var e=window.getComputedStyle(this.$el.firstElementChild).width;return Math.ceil(parseFloat(e))}return 0},updateLabelWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update";this.$slots.default&&this.isAutoWidth&&this.$el.firstElementChild&&("update"===e?this.computedWidth=this.getLabelWidth():"remove"===e&&this.elForm.deregisterLabelWidth(this.computedWidth))}},watch:{computedWidth:function(e,t){this.updateAll&&(this.elForm.registerLabelWidth(e,t),this.elFormItem.updateComputedLabelWidth(e))}},data:function(){return{computedWidth:0}},mounted:function(){this.updateLabelWidth("update")},updated:function(){this.updateLabelWidth("update")},beforeDestroy:function(){this.updateLabelWidth("remove")}},hl=dl,fl=l(hl,sl,ll,!1,null,null,null);fl.options.__file="packages/form/src/label-wrap.vue";var pl=fl.exports,ml={name:"ElFormItem",componentName:"ElFormItem",mixins:[D.a],provide:function(){return{elFormItem:this}},inject:["elForm"],props:{label:String,labelWidth:String,prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:String},components:{LabelWrap:pl},watch:{error:{immediate:!0,handler:function(e){this.validateMessage=e,this.validateState=e?"error":""}},validateStatus:function(e){this.validateState=e}},computed:{labelFor:function(){return this.for||this.prop},labelStyle:function(){var e={};if("top"===this.form.labelPosition)return e;var t=this.labelWidth||this.form.labelWidth;return t&&(e.width=t),e},contentStyle:function(){var e={},t=this.label;if("top"===this.form.labelPosition||this.form.inline)return e;if(!t&&!this.labelWidth&&this.isNested)return e;var n=this.labelWidth||this.form.labelWidth;return"auto"===n?"auto"===this.labelWidth?e.marginLeft=this.computedLabelWidth:"auto"===this.form.labelWidth&&(e.marginLeft=this.elForm.autoLabelWidth):e.marginLeft=n,e},form:function(){var e=this.$parent,t=e.$options.componentName;while("ElForm"!==t)"ElFormItem"===t&&(this.isNested=!0),e=e.$parent,t=e.$options.componentName;return e},fieldValue:function(){var e=this.form.model;if(e&&this.prop){var t=this.prop;return-1!==t.indexOf(":")&&(t=t.replace(/:/,".")),Object(y["getPropByPath"])(e,t,!0).v}},isRequired:function(){var e=this.getRules(),t=!1;return e&&e.length&&e.every((function(e){return!e.required||(t=!0,!1)})),t},_formSize:function(){return this.elForm.size},elFormItemSize:function(){return this.size||this._formSize},sizeClass:function(){return this.elFormItemSize||(this.$ELEMENT||{}).size}},data:function(){return{validateState:"",validateMessage:"",validateDisabled:!1,validator:{},isNested:!1,computedLabelWidth:""}},methods:{validate:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y["noop"];this.validateDisabled=!1;var i=this.getFilteredRule(e);if((!i||0===i.length)&&void 0===this.required)return n(),!0;this.validateState="validating";var r={};i&&i.length>0&&i.forEach((function(e){delete e.trigger})),r[this.prop]=i;var o=new ul.a(r),a={};a[this.prop]=this.fieldValue,o.validate(a,{firstFields:!0},(function(e,i){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",n(t.validateMessage,i),t.elForm&&t.elForm.$emit("validate",t.prop,!e,t.validateMessage||null)}))},clearValidate:function(){this.validateState="",this.validateMessage="",this.validateDisabled=!1},resetField:function(){var e=this;this.validateState="",this.validateMessage="";var t=this.form.model,n=this.fieldValue,i=this.prop;-1!==i.indexOf(":")&&(i=i.replace(/:/,"."));var r=Object(y["getPropByPath"])(t,i,!0);this.validateDisabled=!0,Array.isArray(n)?r.o[r.k]=[].concat(this.initialValue):r.o[r.k]=this.initialValue,this.$nextTick((function(){e.validateDisabled=!1})),this.broadcast("ElTimeSelect","fieldReset",this.initialValue)},getRules:function(){var e=this.form.rules,t=this.rules,n=void 0!==this.required?{required:!!this.required}:[],i=Object(y["getPropByPath"])(e,this.prop||"");return e=e?i.o[this.prop||""]||i.v:[],[].concat(t||e||[]).concat(n)},getFilteredRule:function(e){var t=this.getRules();return t.filter((function(t){return!t.trigger||""===e||(Array.isArray(t.trigger)?t.trigger.indexOf(e)>-1:t.trigger===e)})).map((function(e){return Ot()({},e)}))},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")},updateComputedLabelWidth:function(e){this.computedLabelWidth=e?e+"px":""},addValidateEvents:function(){var e=this.getRules();(e.length||void 0!==this.required)&&(this.$on("el.form.blur",this.onFieldBlur),this.$on("el.form.change",this.onFieldChange))},removeValidateEvents:function(){this.$off()}},mounted:function(){if(this.prop){this.dispatch("ElForm","el.form.addField",[this]);var e=this.fieldValue;Array.isArray(e)&&(e=[].concat(e)),Object.defineProperty(this,"initialValue",{value:e}),this.addValidateEvents()}},beforeDestroy:function(){this.dispatch("ElForm","el.form.removeField",[this])}},gl=ml,vl=l(gl,ol,al,!1,null,null,null);vl.options.__file="packages/form/src/form-item.vue";var bl=vl.exports;bl.install=function(e){e.component(bl.name,bl)};var yl=bl,wl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-tabs__active-bar",class:"is-"+e.rootTabs.tabPosition,style:e.barStyle})},xl=[];wl._withStripped=!0;var _l={name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get:function(){var e=this,t={},n=0,i=0,r=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",o="width"===r?"x":"y",a=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,(function(e){return e.toUpperCase()}))};this.tabs.every((function(t,o){var s=Object(y["arrayFind"])(e.$parent.$refs.tabs||[],(function(e){return e.id.replace("tab-","")===t.paneName}));if(!s)return!1;if(t.active){i=s["client"+a(r)];var l=window.getComputedStyle(s);return"width"===r&&e.tabs.length>1&&(i-=parseFloat(l.paddingLeft)+parseFloat(l.paddingRight)),"width"===r&&(n+=parseFloat(l.paddingLeft)),!1}return n+=s["client"+a(r)],!0}));var s="translate"+a(o)+"("+n+"px)";return t[r]=i+"px",t.transform=s,t.msTransform=s,t.webkitTransform=s,t}}}},kl=_l,Cl=l(kl,wl,xl,!1,null,null,null);Cl.options.__file="packages/tabs/src/tab-bar.vue";var Sl=Cl.exports;function Ol(){}var Tl,El,Dl=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,(function(e){return e.toUpperCase()}))},Ml={name:"TabNav",components:{TabBar:Sl},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:Ol},onTabRemove:{type:Function,default:Ol},type:String,stretch:Boolean},data:function(){return{scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}},computed:{navStyle:function(){var e=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y";return{transform:"translate"+e+"(-"+this.navOffset+"px)"}},sizeName:function(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev:function(){var e=this.$refs.navScroll["offset"+Dl(this.sizeName)],t=this.navOffset;if(t){var n=t>e?t-e:0;this.navOffset=n}},scrollNext:function(){var e=this.$refs.nav["offset"+Dl(this.sizeName)],t=this.$refs.navScroll["offset"+Dl(this.sizeName)],n=this.navOffset;if(!(e-n<=t)){var i=e-n>2*t?n+t:e-t;this.navOffset=i}},scrollToActiveTab:function(){if(this.scrollable){var e=this.$refs.nav,t=this.$el.querySelector(".is-active");if(t){var n=this.$refs.navScroll,i=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition),r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),a=i?e.offsetWidth-o.width:e.offsetHeight-o.height,s=this.navOffset,l=s;i?(r.lefto.right&&(l=s+r.right-o.right)):(r.topo.bottom&&(l=s+(r.bottom-o.bottom))),l=Math.max(l,0),this.navOffset=Math.min(l,a)}}},update:function(){if(this.$refs.nav){var e=this.sizeName,t=this.$refs.nav["offset"+Dl(e)],n=this.$refs.navScroll["offset"+Dl(e)],i=this.navOffset;if(n0&&(this.navOffset=0)}},changeTab:function(e){var t=e.keyCode,n=void 0,i=void 0,r=void 0;-1!==[37,38,39,40].indexOf(t)&&(r=e.currentTarget.querySelectorAll("[role=tab]"),i=Array.prototype.indexOf.call(r,e.target),n=37===t||38===t?0===i?r.length-1:i-1:i0&&void 0!==arguments[0]&&arguments[0];if(this.$slots.default){var n=this.$slots.default.filter((function(e){return e.tag&&e.componentOptions&&"ElTabPane"===e.componentOptions.Ctor.options.name})),i=n.map((function(e){var t=e.componentInstance;return t})),r=!(i.length===this.panes.length&&i.every((function(t,n){return t===e.panes[n]})));(t||r)&&(this.panes=i)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick:function(e,t,n){e.disabled||(this.setCurrentName(t),this.$emit("tab-click",e,n))},handleTabRemove:function(e,t){e.disabled||(t.stopPropagation(),this.$emit("edit",e.name,"remove"),this.$emit("tab-remove",e.name))},handleTabAdd:function(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName:function(e){var t=this,n=function(){t.currentName=e,t.$emit("input",e)};if(this.currentName!==e&&this.beforeLeave){var i=this.beforeLeave(e,this.currentName);i&&i.then?i.then((function(){n(),t.$refs.nav&&t.$refs.nav.removeFocus()}),(function(){})):!1!==i&&n()}else n()}},render:function(e){var t,n=this.type,i=this.handleTabClick,r=this.handleTabRemove,o=this.handleTabAdd,a=this.currentName,s=this.panes,l=this.editable,c=this.addable,u=this.tabPosition,d=this.stretch,h=l||c?e("span",{class:"el-tabs__new-tab",on:{click:o,keydown:function(e){13===e.keyCode&&o()}},attrs:{tabindex:"0"}},[e("i",{class:"el-icon-plus"})]):null,f={props:{currentName:a,onTabClick:i,onTabRemove:r,editable:l,type:n,panes:s,stretch:d},ref:"nav"},p=e("div",{class:["el-tabs__header","is-"+u]},[h,e("tab-nav",f)]),m=e("div",{class:"el-tabs__content"},[this.$slots.default]);return e("div",{class:(t={"el-tabs":!0,"el-tabs--card":"card"===n},t["el-tabs--"+u]=!0,t["el-tabs--border-card"]="border-card"===n,t)},["bottom"!==u?[p,m]:[m,p]])},created:function(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted:function(){this.calcPaneInstances()},updated:function(){this.calcPaneInstances()}},Fl=$l,jl=l(Fl,Il,Ll,!1,null,null,null);jl.options.__file="packages/tabs/src/tabs.vue";var zl=jl.exports;zl.install=function(e){e.component(zl.name,zl)};var Bl=zl,Rl=function(){var e=this,t=e.$createElement,n=e._self._c||t;return!e.lazy||e.loaded||e.active?n("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!e.active,id:"pane-"+e.paneName,"aria-labelledby":"tab-"+e.paneName}},[e._t("default")],2):e._e()},Vl=[];Rl._withStripped=!0;var Hl={name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:function(){return{index:null,loaded:!1}},computed:{isClosable:function(){return this.closable||this.$parent.closable},active:function(){var e=this.$parent.currentName===(this.name||this.index);return e&&(this.loaded=!0),e},paneName:function(){return this.name||this.index}},updated:function(){this.$parent.$emit("tab-nav-update")}},Wl=Hl,ql=l(Wl,Rl,Vl,!1,null,null,null);ql.options.__file="packages/tabs/src/tab-pane.vue";var Ul=ql.exports;Ul.install=function(e){e.component(Ul.name,Ul)};var Kl,Gl,Yl=Ul,Xl={name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String,effect:{type:String,default:"light",validator:function(e){return-1!==["dark","light","plain"].indexOf(e)}}},methods:{handleClose:function(e){e.stopPropagation(),this.$emit("close",e)},handleClick:function(e){this.$emit("click",e)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}},render:function(e){var t=this.type,n=this.tagSize,i=this.hit,r=this.effect,o=["el-tag",t?"el-tag--"+t:"",n?"el-tag--"+n:"",r?"el-tag--"+r:"",i&&"is-hit"],a=e("span",{class:o,style:{backgroundColor:this.color},on:{click:this.handleClick}},[this.$slots.default,this.closable&&e("i",{class:"el-tag__close el-icon-close",on:{click:this.handleClose}})]);return this.disableTransitions?a:e("transition",{attrs:{name:"el-zoom-in-center"}},[a])}},Zl=Xl,Ql=l(Zl,Kl,Gl,!1,null,null,null);Ql.options.__file="packages/tag/src/tag.vue";var Jl=Ql.exports;Jl.install=function(e){e.component(Jl.name,Jl)};var ec=Jl,tc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-tree",class:{"el-tree--highlight-current":e.highlightCurrent,"is-dragging":!!e.dragState.draggingNode,"is-drop-not-allow":!e.dragState.allowDrop,"is-drop-inner":"inner"===e.dragState.dropType},attrs:{role:"tree"}},[e._l(e.root.childNodes,(function(t){return n("el-tree-node",{key:e.getNodeKey(t),attrs:{node:t,props:e.props,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent},on:{"node-expand":e.handleNodeExpand}})})),e.isEmpty?n("div",{staticClass:"el-tree__empty-block"},[n("span",{staticClass:"el-tree__empty-text"},[e._v(e._s(e.emptyText))])]):e._e(),n("div",{directives:[{name:"show",rawName:"v-show",value:e.dragState.showDropIndicator,expression:"dragState.showDropIndicator"}],ref:"dropIndicator",staticClass:"el-tree__drop-indicator"})],2)},nc=[];tc._withStripped=!0;var ic="$treeNodeId",rc=function(e,t){t&&!t[ic]&&Object.defineProperty(t,ic,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},oc=function(e,t){return e?t[e]:t[ic]},ac=function(e,t){var n=e;while(n&&"BODY"!==n.tagName){if(n.__vue__&&n.__vue__.$options.name===t)return n.__vue__;n=n.parentNode}return null},sc=function(){function e(e,t){for(var n=0;n0&&i.lazy&&i.defaultExpandAll&&this.expand(),Array.isArray(this.data)||rc(this,this.data),this.data){var a=i.defaultExpandedKeys,s=i.key;s&&a&&-1!==a.indexOf(this.key)&&this.expand(null,i.autoExpandParent),s&&void 0!==i.currentNodeKey&&this.key===i.currentNodeKey&&(i.currentNode=this,i.currentNode.isCurrent=!0),i.lazy&&i._initDefaultCheckedNode(this),this.updateLeafState()}}return e.prototype.setData=function(e){Array.isArray(e)||rc(this,e),this.data=e,this.childNodes=[];var t=void 0;t=0===this.level&&this.data instanceof Array?this.data:dc(this,"children")||[];for(var n=0,i=t.length;n1&&void 0!==arguments[1])||arguments[1],n=function n(i){for(var r=i.childNodes||[],o=!1,a=0,s=r.length;a-1&&t.splice(n,1);var i=this.childNodes.indexOf(e);i>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(i,1)),this.updateLeafState()},e.prototype.removeChildByData=function(e){for(var t=null,n=0;n0)i.expanded=!0,i=i.parent}n.expanded=!0,e&&e()};this.shouldLoadData()?this.loadData((function(e){e instanceof Array&&(n.checked?n.setChecked(!0,!0):n.store.checkStrictly||uc(n),i())})):i()},e.prototype.doCreateChildren=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach((function(e){t.insertChild(Ot()({data:e},n),void 0,!0)}))},e.prototype.collapse=function(){this.expanded=!1},e.prototype.shouldLoadData=function(){return!0===this.store.lazy&&this.store.load&&!this.loaded},e.prototype.updateLeafState=function(){if(!0!==this.store.lazy||!0===this.loaded||"undefined"===typeof this.isLeafByUser){var e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}else this.isLeaf=this.isLeafByUser},e.prototype.setChecked=function(e,t,n,i){var r=this;if(this.indeterminate="half"===e,this.checked=!0===e,!this.store.checkStrictly){if(!this.shouldLoadData()||this.store.checkDescendants){var o=cc(this.childNodes),a=o.all,s=o.allWithoutDisable;this.isLeaf||a||!s||(this.checked=!1,e=!1);var l=function(){if(t){for(var n=r.childNodes,o=0,a=n.length;o0&&void 0!==arguments[0]&&arguments[0];if(0===this.level)return this.data;var t=this.data;if(!t)return null;var n=this.store.props,i="children";return n&&(i=n.children||"children"),void 0===t[i]&&(t[i]=null),e&&!t[i]&&(t[i]=[]),t[i]},e.prototype.updateChildren=function(){var e=this,t=this.getChildren()||[],n=this.childNodes.map((function(e){return e.data})),i={},r=[];t.forEach((function(e,t){var o=e[ic],a=!!o&&Object(y["arrayFindIndex"])(n,(function(e){return e[ic]===o}))>=0;a?i[o]={index:t,data:e}:r.push({index:t,data:e})})),this.store.lazy||n.forEach((function(t){i[t[ic]]||e.removeChildByData(t)})),r.forEach((function(t){var n=t.index,i=t.data;e.insertChild({data:i},n)})),this.updateLeafState()},e.prototype.loadData=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(n).length)e&&e.call(this);else{this.loading=!0;var i=function(i){t.loaded=!0,t.loading=!1,t.childNodes=[],t.doCreateChildren(i,n),t.updateLeafState(),e&&e.call(t,i)};this.store.load(this,i)}},sc(e,[{key:"label",get:function(){return dc(this,"label")}},{key:"key",get:function(){var e=this.store.key;return this.data?this.data[e]:null}},{key:"disabled",get:function(){return dc(this,"disabled")}},{key:"nextSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}},{key:"previousSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}}]),e}(),pc=fc,mc="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};function gc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var vc=function(){function e(t){var n=this;for(var i in gc(this,e),this.currentNode=null,this.currentNodeKey=null,t)t.hasOwnProperty(i)&&(this[i]=t[i]);if(this.nodesMap={},this.root=new pc({data:this.data,store:this}),this.lazy&&this.load){var r=this.load;r(this.root,(function(e){n.root.doCreateChildren(e),n._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}return e.prototype.filter=function(e){var t=this.filterNodeMethod,n=this.lazy,i=function i(r){var o=r.root?r.root.childNodes:r.childNodes;if(o.forEach((function(n){n.visible=t.call(n,e,n.data,n),i(n)})),!r.visible&&o.length){var a=!0;a=!o.some((function(e){return e.visible})),r.root?r.root.visible=!1===a:r.visible=!1===a}e&&(!r.visible||r.isLeaf||n||r.expand())};i(this)},e.prototype.setData=function(e){var t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()},e.prototype.getNode=function(e){if(e instanceof pc)return e;var t="object"!==("undefined"===typeof e?"undefined":mc(e))?e:oc(this.key,e);return this.nodesMap[t]||null},e.prototype.insertBefore=function(e,t){var n=this.getNode(t);n.parent.insertBefore({data:e},n)},e.prototype.insertAfter=function(e,t){var n=this.getNode(t);n.parent.insertAfter({data:e},n)},e.prototype.remove=function(e){var t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))},e.prototype.append=function(e,t){var n=t?this.getNode(t):this.root;n&&n.insertChild({data:e})},e.prototype._initDefaultCheckedNodes=function(){var e=this,t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach((function(t){var i=n[t];i&&i.setChecked(!0,!e.checkStrictly)}))},e.prototype._initDefaultCheckedNode=function(e){var t=this.defaultCheckedKeys||[];-1!==t.indexOf(e.key)&&e.setChecked(!0,!this.checkStrictly)},e.prototype.setDefaultCheckedKey=function(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())},e.prototype.registerNode=function(e){var t=this.key;if(t&&e&&e.data){var n=e.key;void 0!==n&&(this.nodesMap[e.key]=e)}},e.prototype.deregisterNode=function(e){var t=this,n=this.key;n&&e&&e.data&&(e.childNodes.forEach((function(e){t.deregisterNode(e)})),delete this.nodesMap[e.key])},e.prototype.getCheckedNodes=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=function i(r){var o=r.root?r.root.childNodes:r.childNodes;o.forEach((function(r){(r.checked||t&&r.indeterminate)&&(!e||e&&r.isLeaf)&&n.push(r.data),i(r)}))};return i(this),n},e.prototype.getCheckedKeys=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCheckedNodes(t).map((function(t){return(t||{})[e.key]}))},e.prototype.getHalfCheckedNodes=function(){var e=[],t=function t(n){var i=n.root?n.root.childNodes:n.childNodes;i.forEach((function(n){n.indeterminate&&e.push(n.data),t(n)}))};return t(this),e},e.prototype.getHalfCheckedKeys=function(){var e=this;return this.getHalfCheckedNodes().map((function(t){return(t||{})[e.key]}))},e.prototype._getAllNodes=function(){var e=[],t=this.nodesMap;for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e},e.prototype.updateChildren=function(e,t){var n=this.nodesMap[e];if(n){for(var i=n.childNodes,r=i.length-1;r>=0;r--){var o=i[r];this.remove(o.data)}for(var a=0,s=t.length;a1&&void 0!==arguments[1]&&arguments[1],n=arguments[2],i=this._getAllNodes().sort((function(e,t){return t.level-e.level})),r=Object.create(null),o=Object.keys(n);i.forEach((function(e){return e.setChecked(!1,!1)}));for(var a=0,s=i.length;a-1;if(u){var d=l.parent;while(d&&d.level>0)r[d.data[e]]=!0,d=d.parent;l.isLeaf||this.checkStrictly?l.setChecked(!0,!1):(l.setChecked(!0,!0),t&&function(){l.setChecked(!1,!1);var e=function e(t){var n=t.childNodes;n.forEach((function(t){t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(l)}())}else l.checked&&!r[c]&&l.setChecked(!1,!1)}},e.prototype.setCheckedNodes=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.key,i={};e.forEach((function(e){i[(e||{})[n]]=!0})),this._setCheckedKeys(n,t,i)},e.prototype.setCheckedKeys=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.defaultCheckedKeys=e;var n=this.key,i={};e.forEach((function(e){i[e]=!0})),this._setCheckedKeys(n,t,i)},e.prototype.setDefaultExpandedKeys=function(e){var t=this;e=e||[],this.defaultExpandedKeys=e,e.forEach((function(e){var n=t.getNode(e);n&&n.expand(null,t.autoExpandParent)}))},e.prototype.setChecked=function(e,t,n){var i=this.getNode(e);i&&i.setChecked(!!t,n)},e.prototype.getCurrentNode=function(){return this.currentNode},e.prototype.setCurrentNode=function(e){var t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0},e.prototype.setUserCurrentNode=function(e){var t=e[this.key],n=this.nodesMap[t];this.setCurrentNode(n)},e.prototype.setCurrentNodeKey=function(e){if(null===e||void 0===e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);var t=this.getNode(e);t&&this.setCurrentNode(t)},e}(),bc=vc,yc=function(){var e=this,t=this,n=t.$createElement,i=t._self._c||n;return i("div",{directives:[{name:"show",rawName:"v-show",value:t.node.visible,expression:"node.visible"}],ref:"node",staticClass:"el-tree-node",class:{"is-expanded":t.expanded,"is-current":t.node.isCurrent,"is-hidden":!t.node.visible,"is-focusable":!t.node.disabled,"is-checked":!t.node.disabled&&t.node.checked},attrs:{role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.draggable},on:{click:function(e){return e.stopPropagation(),t.handleClick(e)},contextmenu:function(t){return e.handleContextMenu(t)},dragstart:function(e){return e.stopPropagation(),t.handleDragStart(e)},dragover:function(e){return e.stopPropagation(),t.handleDragOver(e)},dragend:function(e){return e.stopPropagation(),t.handleDragEnd(e)},drop:function(e){return e.stopPropagation(),t.handleDrop(e)}}},[i("div",{staticClass:"el-tree-node__content",style:{"padding-left":(t.node.level-1)*t.tree.indent+"px"}},[i("span",{class:[{"is-leaf":t.node.isLeaf,expanded:!t.node.isLeaf&&t.expanded},"el-tree-node__expand-icon",t.tree.iconClass?t.tree.iconClass:"el-icon-caret-right"],on:{click:function(e){return e.stopPropagation(),t.handleExpandIconClick(e)}}}),t.showCheckbox?i("el-checkbox",{attrs:{indeterminate:t.node.indeterminate,disabled:!!t.node.disabled},on:{change:t.handleCheckChange},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:t.node.checked,callback:function(e){t.$set(t.node,"checked",e)},expression:"node.checked"}}):t._e(),t.node.loading?i("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):t._e(),i("node-content",{attrs:{node:t.node}})],1),i("el-collapse-transition",[!t.renderAfterExpand||t.childNodeRendered?i("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"el-tree-node__children",attrs:{role:"group","aria-expanded":t.expanded}},t._l(t.node.childNodes,(function(e){return i("el-tree-node",{key:t.getNodeKey(e),attrs:{"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:e},on:{"node-expand":t.handleChildNodeExpand}})})),1):t._e()])],1)},wc=[];yc._withStripped=!0;var xc={name:"ElTreeNode",componentName:"ElTreeNode",mixins:[D.a],props:{node:{default:function(){return{}}},props:{},renderContent:Function,renderAfterExpand:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1}},components:{ElCollapseTransition:Ge.a,ElCheckbox:Fi.a,NodeContent:{props:{node:{required:!0}},render:function(e){var t=this.$parent,n=t.tree,i=this.node,r=i.data,o=i.store;return t.renderContent?t.renderContent.call(t._renderProxy,e,{_self:n.$vnode.context,node:i,data:r,store:o}):n.$scopedSlots.default?n.$scopedSlots.default({node:i,data:r}):e("span",{class:"el-tree-node__label"},[i.label])}}},data:function(){return{tree:null,expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null}},watch:{"node.indeterminate":function(e){this.handleSelectChange(this.node.checked,e)},"node.checked":function(e){this.handleSelectChange(e,this.node.indeterminate)},"node.expanded":function(e){var t=this;this.$nextTick((function(){return t.expanded=e})),e&&(this.childNodeRendered=!0)}},methods:{getNodeKey:function(e){return oc(this.tree.nodeKey,e.data)},handleSelectChange:function(e,t){this.oldChecked!==e&&this.oldIndeterminate!==t&&this.tree.$emit("check-change",this.node.data,e,t),this.oldChecked=e,this.indeterminate=t},handleClick:function(){var e=this.tree.store;e.setCurrentNode(this.node),this.tree.$emit("current-change",e.currentNode?e.currentNode.data:null,e.currentNode),this.tree.currentNode=this,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&this.handleCheckChange(null,{target:{checked:!this.node.checked}}),this.tree.$emit("node-click",this.node.data,this.node,this)},handleContextMenu:function(e){this.tree._events["node-contextmenu"]&&this.tree._events["node-contextmenu"].length>0&&(e.stopPropagation(),e.preventDefault()),this.tree.$emit("node-contextmenu",e,this.node.data,this.node,this)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node.data,this.node,this),this.node.collapse()):(this.node.expand(),this.$emit("node-expand",this.node.data,this.node,this)))},handleCheckChange:function(e,t){var n=this;this.node.setChecked(t.target.checked,!this.tree.checkStrictly),this.$nextTick((function(){var e=n.tree.store;n.tree.$emit("check",n.node.data,{checkedNodes:e.getCheckedNodes(),checkedKeys:e.getCheckedKeys(),halfCheckedNodes:e.getHalfCheckedNodes(),halfCheckedKeys:e.getHalfCheckedKeys()})}))},handleChildNodeExpand:function(e,t,n){this.broadcast("ElTreeNode","tree-node-expand",t),this.tree.$emit("node-expand",e,t,n)},handleDragStart:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-start",e,this)},handleDragOver:function(e){this.tree.draggable&&(this.tree.$emit("tree-node-drag-over",e,this),e.preventDefault())},handleDrop:function(e){e.preventDefault()},handleDragEnd:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-end",e,this)}},created:function(){var e=this,t=this.$parent;t.isTree?this.tree=t:this.tree=t.tree;var n=this.tree;n||console.warn("Can not find node's tree.");var i=n.props||{},r=i["children"]||"children";this.$watch("node.data."+r,(function(){e.node.updateChildren()})),this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0),this.tree.accordion&&this.$on("tree-node-expand",(function(t){e.node!==t&&e.node.collapse()}))}},_c=xc,kc=l(_c,yc,wc,!1,null,null,null);kc.options.__file="packages/tree/src/tree-node.vue";var Cc=kc.exports,Sc={name:"ElTree",mixins:[D.a],components:{ElTreeNode:Cc},data:function(){return{store:null,root:null,currentNode:null,treeItems:null,checkboxItems:[],dragState:{showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0}}},props:{data:{type:Array},emptyText:{type:String,default:function(){return Object(ni["t"])("el.tree.emptyText")}},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{default:function(){return{children:"children",label:"label",disabled:"disabled"}}},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},iconClass:String},computed:{children:{set:function(e){this.data=e},get:function(){return this.data}},treeItemArray:function(){return Array.prototype.slice.call(this.treeItems)},isEmpty:function(){var e=this.root.childNodes;return!e||0===e.length||e.every((function(e){var t=e.visible;return!t}))}},watch:{defaultCheckedKeys:function(e){this.store.setDefaultCheckedKey(e)},defaultExpandedKeys:function(e){this.store.defaultExpandedKeys=e,this.store.setDefaultExpandedKeys(e)},data:function(e){this.store.setData(e)},checkboxItems:function(e){Array.prototype.forEach.call(e,(function(e){e.setAttribute("tabindex",-1)}))},checkStrictly:function(e){this.store.checkStrictly=e}},methods:{filter:function(e){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(e)},getNodeKey:function(e){return oc(this.nodeKey,e.data)},getNodePath:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");var t=this.store.getNode(e);if(!t)return[];var n=[t.data],i=t.parent;while(i&&i!==this.root)n.push(i.data),i=i.parent;return n.reverse()},getCheckedNodes:function(e,t){return this.store.getCheckedNodes(e,t)},getCheckedKeys:function(e){return this.store.getCheckedKeys(e)},getCurrentNode:function(){var e=this.store.getCurrentNode();return e?e.data:null},getCurrentKey:function(){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");var e=this.getCurrentNode();return e?e[this.nodeKey]:null},setCheckedNodes:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");this.store.setCheckedNodes(e,t)},setCheckedKeys:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(e,t)},setChecked:function(e,t,n){this.store.setChecked(e,t,n)},getHalfCheckedNodes:function(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys:function(){return this.store.getHalfCheckedKeys()},setCurrentNode:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(e)},setCurrentKey:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(e)},getNode:function(e){return this.store.getNode(e)},remove:function(e){this.store.remove(e)},append:function(e,t){this.store.append(e,t)},insertBefore:function(e,t){this.store.insertBefore(e,t)},insertAfter:function(e,t){this.store.insertAfter(e,t)},handleNodeExpand:function(e,t,n){this.broadcast("ElTreeNode","tree-node-expand",t),this.$emit("node-expand",e,t,n)},updateKeyChildren:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(e,t)},initTabIndex:function(){this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]");var e=this.$el.querySelectorAll(".is-checked[role=treeitem]");e.length?e[0].setAttribute("tabindex",0):this.treeItems[0]&&this.treeItems[0].setAttribute("tabindex",0)},handleKeydown:function(e){var t=e.target;if(-1!==t.className.indexOf("el-tree-node")){var n=e.keyCode;this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]");var i=this.treeItemArray.indexOf(t),r=void 0;[38,40].indexOf(n)>-1&&(e.preventDefault(),r=38===n?0!==i?i-1:0:i-1&&(e.preventDefault(),t.click());var o=t.querySelector('[type="checkbox"]');[13,32].indexOf(n)>-1&&o&&(e.preventDefault(),o.click())}}},created:function(){var e=this;this.isTree=!0,this.store=new bc({key:this.nodeKey,data:this.data,lazy:this.lazy,props:this.props,load:this.load,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly,checkDescendants:this.checkDescendants,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod}),this.root=this.store.root;var t=this.dragState;this.$on("tree-node-drag-start",(function(n,i){if("function"===typeof e.allowDrag&&!e.allowDrag(i.node))return n.preventDefault(),!1;n.dataTransfer.effectAllowed="move";try{n.dataTransfer.setData("text/plain","")}catch(r){}t.draggingNode=i,e.$emit("node-drag-start",i.node,n)})),this.$on("tree-node-drag-over",(function(n,i){var r=ac(n.target,"ElTreeNode"),o=t.dropNode;o&&o!==r&&Object(ze["removeClass"])(o.$el,"is-drop-inner");var a=t.draggingNode;if(a&&r){var s=!0,l=!0,c=!0,u=!0;"function"===typeof e.allowDrop&&(s=e.allowDrop(a.node,r.node,"prev"),u=l=e.allowDrop(a.node,r.node,"inner"),c=e.allowDrop(a.node,r.node,"next")),n.dataTransfer.dropEffect=l?"move":"none",(s||l||c)&&o!==r&&(o&&e.$emit("node-drag-leave",a.node,o.node,n),e.$emit("node-drag-enter",a.node,r.node,n)),(s||l||c)&&(t.dropNode=r),r.node.nextSibling===a.node&&(c=!1),r.node.previousSibling===a.node&&(s=!1),r.node.contains(a.node,!1)&&(l=!1),(a.node===r.node||a.node.contains(r.node))&&(s=!1,l=!1,c=!1);var d=r.$el.getBoundingClientRect(),h=e.$el.getBoundingClientRect(),f=void 0,p=s?l?.25:c?.45:1:-1,m=c?l?.75:s?.55:0:1,g=-9999,v=n.clientY-d.top;f=vd.height*m?"after":l?"inner":"none";var b=r.$el.querySelector(".el-tree-node__expand-icon").getBoundingClientRect(),y=e.$refs.dropIndicator;"before"===f?g=b.top-h.top:"after"===f&&(g=b.bottom-h.top),y.style.top=g+"px",y.style.left=b.right-h.left+"px","inner"===f?Object(ze["addClass"])(r.$el,"is-drop-inner"):Object(ze["removeClass"])(r.$el,"is-drop-inner"),t.showDropIndicator="before"===f||"after"===f,t.allowDrop=t.showDropIndicator||u,t.dropType=f,e.$emit("node-drag-over",a.node,r.node,n)}})),this.$on("tree-node-drag-end",(function(n){var i=t.draggingNode,r=t.dropType,o=t.dropNode;if(n.preventDefault(),n.dataTransfer.dropEffect="move",i&&o){var a={data:i.node.data};"none"!==r&&i.node.remove(),"before"===r?o.node.parent.insertBefore(a,o.node):"after"===r?o.node.parent.insertAfter(a,o.node):"inner"===r&&o.node.insertChild(a),"none"!==r&&e.store.registerNode(a),Object(ze["removeClass"])(o.$el,"is-drop-inner"),e.$emit("node-drag-end",i.node,o.node,r,n),"none"!==r&&e.$emit("node-drop",i.node,o.node,r,n)}i&&!o&&e.$emit("node-drag-end",i.node,null,r,n),t.showDropIndicator=!1,t.draggingNode=null,t.dropNode=null,t.allowDrop=!0}))},mounted:function(){this.initTabIndex(),this.$el.addEventListener("keydown",this.handleKeydown)},updated:function(){this.treeItems=this.$el.querySelectorAll("[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]")}},Oc=Sc,Tc=l(Oc,tc,nc,!1,null,null,null);Tc.options.__file="packages/tree/src/tree.vue";var Ec=Tc.exports;Ec.install=function(e){e.component(Ec.name,Ec)};var Dc=Ec,Mc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-alert-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-alert",class:[e.typeClass,e.center?"is-center":"","is-"+e.effect],attrs:{role:"alert"}},[e.showIcon?n("i",{staticClass:"el-alert__icon",class:[e.iconClass,e.isBigIcon]}):e._e(),n("div",{staticClass:"el-alert__content"},[e.title||e.$slots.title?n("span",{staticClass:"el-alert__title",class:[e.isBoldTitle]},[e._t("title",[e._v(e._s(e.title))])],2):e._e(),e.$slots.default&&!e.description?n("p",{staticClass:"el-alert__description"},[e._t("default")],2):e._e(),e.description&&!e.$slots.default?n("p",{staticClass:"el-alert__description"},[e._v(e._s(e.description))]):e._e(),n("i",{directives:[{name:"show",rawName:"v-show",value:e.closable,expression:"closable"}],staticClass:"el-alert__closebtn",class:{"is-customed":""!==e.closeText,"el-icon-close":""===e.closeText},on:{click:function(t){e.close()}}},[e._v(e._s(e.closeText))])])])])},Ac=[];Mc._withStripped=!0;var Nc={success:"el-icon-success",warning:"el-icon-warning",error:"el-icon-error"},Ic={name:"ElAlert",props:{title:{type:String,default:""},description:{type:String,default:""},type:{type:String,default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,default:"light",validator:function(e){return-1!==["light","dark"].indexOf(e)}}},data:function(){return{visible:!0}},methods:{close:function(){this.visible=!1,this.$emit("close")}},computed:{typeClass:function(){return"el-alert--"+this.type},iconClass:function(){return Nc[this.type]||"el-icon-info"},isBigIcon:function(){return this.description||this.$slots.default?"is-big":""},isBoldTitle:function(){return this.description||this.$slots.default?"is-bold":""}}},Lc=Ic,Pc=l(Lc,Mc,Ac,!1,null,null,null);Pc.options.__file="packages/alert/src/main.vue";var $c=Pc.exports;$c.install=function(e){e.component($c.name,$c)};var Fc=$c,jc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-notification-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-notification",e.customClass,e.horizontalClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:function(t){e.clearTimer()},mouseleave:function(t){e.startTimer()},click:e.click}},[e.type||e.iconClass?n("i",{staticClass:"el-notification__icon",class:[e.typeClass,e.iconClass]}):e._e(),n("div",{staticClass:"el-notification__group",class:{"is-with-icon":e.typeClass||e.iconClass}},[n("h2",{staticClass:"el-notification__title",domProps:{textContent:e._s(e.title)}}),n("div",{directives:[{name:"show",rawName:"v-show",value:e.message,expression:"message"}],staticClass:"el-notification__content"},[e._t("default",[e.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:e._s(e.message)}}):n("p",[e._v(e._s(e.message))])])],2),e.showClose?n("div",{staticClass:"el-notification__closeBtn el-icon-close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}}):e._e()])])])},zc=[];jc._withStripped=!0;var Bc={success:"success",info:"info",warning:"warning",error:"error"},Rc={data:function(){return{visible:!1,title:"",message:"",duration:4500,type:"",showClose:!0,customClass:"",iconClass:"",onClose:null,onClick:null,closed:!1,verticalOffset:0,timer:null,dangerouslyUseHTMLString:!1,position:"top-right"}},computed:{typeClass:function(){return this.type&&Bc[this.type]?"el-icon-"+Bc[this.type]:""},horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},positionStyle:function(){var e;return e={},e[this.verticalProperty]=this.verticalOffset+"px",e}},watch:{closed:function(e){e&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},click:function(){"function"===typeof this.onClick&&this.onClick()},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose()},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration))},keydown:function(e){46===e.keyCode||8===e.keyCode?this.clearTimer():27===e.keyCode?this.closed||this.close():this.startTimer()}},mounted:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration)),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},Vc=Rc,Hc=l(Vc,jc,zc,!1,null,null,null);Hc.options.__file="packages/notification/src/main.vue";var Wc=Hc.exports,qc=qi.a.extend(Wc),Uc=void 0,Kc=[],Gc=1,Yc=function e(t){if(!qi.a.prototype.$isServer){t=Ot()({},t);var n=t.onClose,i="notification_"+Gc++,r=t.position||"top-right";t.onClose=function(){e.close(i,n)},Uc=new qc({data:t}),Object(Ss["isVNode"])(t.message)&&(Uc.$slots.default=[t.message],t.message="REPLACED_BY_VNODE"),Uc.id=i,Uc.$mount(),document.body.appendChild(Uc.$el),Uc.visible=!0,Uc.dom=Uc.$el,Uc.dom.style.zIndex=C["PopupManager"].nextZIndex();var o=t.offset||0;return Kc.filter((function(e){return e.position===r})).forEach((function(e){o+=e.$el.offsetHeight+16})),o+=16,Uc.verticalOffset=o,Kc.push(Uc),Uc}};["success","warning","info","error"].forEach((function(e){Yc[e]=function(t){return("string"===typeof t||Object(Ss["isVNode"])(t))&&(t={message:t}),t.type=e,Yc(t)}})),Yc.close=function(e,t){var n=-1,i=Kc.length,r=Kc.filter((function(t,i){return t.id===e&&(n=i,!0)}))[0];if(r&&("function"===typeof t&&t(r),Kc.splice(n,1),!(i<=1)))for(var o=r.position,a=r.dom.offsetHeight,s=n;s=0;e--)Kc[e].close()};var Xc=Yc,Zc=Xc,Qc=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-slider",class:{"is-vertical":e.vertical,"el-slider--with-input":e.showInput},attrs:{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-orientation":e.vertical?"vertical":"horizontal","aria-disabled":e.sliderDisabled}},[e.showInput&&!e.range?n("el-input-number",{ref:"input",staticClass:"el-slider__input",attrs:{step:e.step,disabled:e.sliderDisabled,controls:e.showInputControls,min:e.min,max:e.max,debounce:e.debounce,size:e.inputSize},on:{change:e.emitChange},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}):e._e(),n("div",{ref:"slider",staticClass:"el-slider__runway",class:{"show-input":e.showInput,disabled:e.sliderDisabled},style:e.runwayStyle,on:{click:e.onSliderClick}},[n("div",{staticClass:"el-slider__bar",style:e.barStyle}),n("slider-button",{ref:"button1",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}),e.range?n("slider-button",{ref:"button2",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.secondValue,callback:function(t){e.secondValue=t},expression:"secondValue"}}):e._e(),e._l(e.stops,(function(t,i){return e.showStops?n("div",{key:i,staticClass:"el-slider__stop",style:e.getStopStyle(t)}):e._e()})),e.markList.length>0?[n("div",e._l(e.markList,(function(t,i){return n("div",{key:i,staticClass:"el-slider__stop el-slider__marks-stop",style:e.getStopStyle(t.position)})})),0),n("div",{staticClass:"el-slider__marks"},e._l(e.markList,(function(t,i){return n("slider-marker",{key:i,style:e.getStopStyle(t.position),attrs:{mark:t.mark}})})),1)]:e._e()],2)],1)},Jc=[];Qc._withStripped=!0;var eu=n(41),tu=n.n(eu),nu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{ref:"button",staticClass:"el-slider__button-wrapper",class:{hover:e.hovering,dragging:e.dragging},style:e.wrapperStyle,attrs:{tabindex:"0"},on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave,mousedown:e.onButtonDown,touchstart:e.onButtonDown,focus:e.handleMouseEnter,blur:e.handleMouseLeave,keydown:[function(t){return!("button"in t)&&e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])||"button"in t&&0!==t.button?null:e.onLeftKeyDown(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])||"button"in t&&2!==t.button?null:e.onRightKeyDown(t)},function(t){return!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.preventDefault(),e.onLeftKeyDown(t))},function(t){return!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.preventDefault(),e.onRightKeyDown(t))}]}},[n("el-tooltip",{ref:"tooltip",attrs:{placement:"top","popper-class":e.tooltipClass,disabled:!e.showTooltip}},[n("span",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.formatValue))]),n("div",{staticClass:"el-slider__button",class:{hover:e.hovering,dragging:e.dragging}})])],1)},iu=[];nu._withStripped=!0;var ru={name:"ElSliderButton",components:{ElTooltip:ot.a},props:{value:{type:Number,default:0},vertical:{type:Boolean,default:!1},tooltipClass:String},data:function(){return{hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:null,oldValue:this.value}},computed:{disabled:function(){return this.$parent.sliderDisabled},max:function(){return this.$parent.max},min:function(){return this.$parent.min},step:function(){return this.$parent.step},showTooltip:function(){return this.$parent.showTooltip},precision:function(){return this.$parent.precision},currentPosition:function(){return(this.value-this.min)/(this.max-this.min)*100+"%"},enableFormat:function(){return this.$parent.formatTooltip instanceof Function},formatValue:function(){return this.enableFormat&&this.$parent.formatTooltip(this.value)||this.value},wrapperStyle:function(){return this.vertical?{bottom:this.currentPosition}:{left:this.currentPosition}}},watch:{dragging:function(e){this.$parent.dragging=e}},methods:{displayTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!0)},hideTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!1)},handleMouseEnter:function(){this.hovering=!0,this.displayTooltip()},handleMouseLeave:function(){this.hovering=!1,this.hideTooltip()},onButtonDown:function(e){this.disabled||(e.preventDefault(),this.onDragStart(e),window.addEventListener("mousemove",this.onDragging),window.addEventListener("touchmove",this.onDragging),window.addEventListener("mouseup",this.onDragEnd),window.addEventListener("touchend",this.onDragEnd),window.addEventListener("contextmenu",this.onDragEnd))},onLeftKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)-this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onRightKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)+this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onDragStart:function(e){this.dragging=!0,this.isClick=!0,"touchstart"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?this.startY=e.clientY:this.startX=e.clientX,this.startPosition=parseFloat(this.currentPosition),this.newPosition=this.startPosition},onDragging:function(e){if(this.dragging){this.isClick=!1,this.displayTooltip(),this.$parent.resetSize();var t=0;"touchmove"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?(this.currentY=e.clientY,t=(this.startY-this.currentY)/this.$parent.sliderSize*100):(this.currentX=e.clientX,t=(this.currentX-this.startX)/this.$parent.sliderSize*100),this.newPosition=this.startPosition+t,this.setPosition(this.newPosition)}},onDragEnd:function(){var e=this;this.dragging&&(setTimeout((function(){e.dragging=!1,e.hideTooltip(),e.isClick||(e.setPosition(e.newPosition),e.$parent.emitChange())}),0),window.removeEventListener("mousemove",this.onDragging),window.removeEventListener("touchmove",this.onDragging),window.removeEventListener("mouseup",this.onDragEnd),window.removeEventListener("touchend",this.onDragEnd),window.removeEventListener("contextmenu",this.onDragEnd))},setPosition:function(e){var t=this;if(null!==e&&!isNaN(e)){e<0?e=0:e>100&&(e=100);var n=100/((this.max-this.min)/this.step),i=Math.round(e/n),r=i*n*(this.max-this.min)*.01+this.min;r=parseFloat(r.toFixed(this.precision)),this.$emit("input",r),this.$nextTick((function(){t.displayTooltip(),t.$refs.tooltip&&t.$refs.tooltip.updatePopper()})),this.dragging||this.value===this.oldValue||(this.oldValue=this.value)}}}},ou=ru,au=l(ou,nu,iu,!1,null,null,null);au.options.__file="packages/slider/src/button.vue";var su=au.exports,lu={name:"ElMarker",props:{mark:{type:[String,Object]}},render:function(){var e=arguments[0],t="string"===typeof this.mark?this.mark:this.mark.label;return e("div",{class:"el-slider__marks-text",style:this.mark.style||{}},[t])}},cu={name:"ElSlider",mixins:[D.a],inject:{elForm:{default:""}},props:{min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},value:{type:[Number,Array],default:0},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},inputSize:{type:String,default:"small"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:Function,disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{type:String},debounce:{type:Number,default:300},label:{type:String},tooltipClass:String,marks:Object},components:{ElInputNumber:tu.a,SliderButton:su,SliderMarker:lu},data:function(){return{firstValue:null,secondValue:null,oldValue:null,dragging:!1,sliderSize:1}},watch:{value:function(e,t){this.dragging||Array.isArray(e)&&Array.isArray(t)&&e.every((function(e,n){return e===t[n]}))||this.setValues()},dragging:function(e){e||this.setValues()},firstValue:function(e){this.range?this.$emit("input",[this.minValue,this.maxValue]):this.$emit("input",e)},secondValue:function(){this.range&&this.$emit("input",[this.minValue,this.maxValue])},min:function(){this.setValues()},max:function(){this.setValues()}},methods:{valueChanged:function(){var e=this;return this.range?![this.minValue,this.maxValue].every((function(t,n){return t===e.oldValue[n]})):this.value!==this.oldValue},setValues:function(){if(this.min>this.max)console.error("[Element Error][Slider]min should not be greater than max.");else{var e=this.value;this.range&&Array.isArray(e)?e[1]this.max?this.$emit("input",[this.max,this.max]):e[0]this.max?this.$emit("input",[e[0],this.max]):(this.firstValue=e[0],this.secondValue=e[1],this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",[this.minValue,this.maxValue]),this.oldValue=e.slice())):this.range||"number"!==typeof e||isNaN(e)||(ethis.max?this.$emit("input",this.max):(this.firstValue=e,this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",e),this.oldValue=e)))}},setPosition:function(e){var t=this.min+e*(this.max-this.min)/100;if(this.range){var n=void 0;n=Math.abs(this.minValue-t)this.secondValue?"button1":"button2",this.$refs[n].setPosition(e)}else this.$refs.button1.setPosition(e)},onSliderClick:function(e){if(!this.sliderDisabled&&!this.dragging){if(this.resetSize(),this.vertical){var t=this.$refs.slider.getBoundingClientRect().bottom;this.setPosition((t-e.clientY)/this.sliderSize*100)}else{var n=this.$refs.slider.getBoundingClientRect().left;this.setPosition((e.clientX-n)/this.sliderSize*100)}this.emitChange()}},resetSize:function(){this.$refs.slider&&(this.sliderSize=this.$refs.slider["client"+(this.vertical?"Height":"Width")])},emitChange:function(){var e=this;this.$nextTick((function(){e.$emit("change",e.range?[e.minValue,e.maxValue]:e.value)}))},getStopStyle:function(e){return this.vertical?{bottom:e+"%"}:{left:e+"%"}}},computed:{stops:function(){var e=this;if(!this.showStops||this.min>this.max)return[];if(0===this.step)return[];for(var t=(this.max-this.min)/this.step,n=100*this.step/(this.max-this.min),i=[],r=1;r100*(e.maxValue-e.min)/(e.max-e.min)})):i.filter((function(t){return t>100*(e.firstValue-e.min)/(e.max-e.min)}))},markList:function(){var e=this;if(!this.marks)return[];var t=Object.keys(this.marks);return t.map(parseFloat).sort((function(e,t){return e-t})).filter((function(t){return t<=e.max&&t>=e.min})).map((function(t){return{point:t,position:100*(t-e.min)/(e.max-e.min),mark:e.marks[t]}}))},minValue:function(){return Math.min(this.firstValue,this.secondValue)},maxValue:function(){return Math.max(this.firstValue,this.secondValue)},barSize:function(){return this.range?100*(this.maxValue-this.minValue)/(this.max-this.min)+"%":100*(this.firstValue-this.min)/(this.max-this.min)+"%"},barStart:function(){return this.range?100*(this.minValue-this.min)/(this.max-this.min)+"%":"0%"},precision:function(){var e=[this.min,this.max,this.step].map((function(e){var t=(""+e).split(".")[1];return t?t.length:0}));return Math.max.apply(null,e)},runwayStyle:function(){return this.vertical?{height:this.height}:{}},barStyle:function(){return this.vertical?{height:this.barSize,bottom:this.barStart}:{width:this.barSize,left:this.barStart}},sliderDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},mounted:function(){var e=void 0;this.range?(Array.isArray(this.value)?(this.firstValue=Math.max(this.min,this.value[0]),this.secondValue=Math.min(this.max,this.value[1])):(this.firstValue=this.min,this.secondValue=this.max),this.oldValue=[this.firstValue,this.secondValue],e=this.firstValue+"-"+this.secondValue):("number"!==typeof this.value||isNaN(this.value)?this.firstValue=this.min:this.firstValue=Math.min(this.max,Math.max(this.min,this.value)),this.oldValue=this.firstValue,e=this.firstValue),this.$el.setAttribute("aria-valuetext",e),this.$el.setAttribute("aria-label",this.label?this.label:"slider between "+this.min+" and "+this.max),this.resetSize(),window.addEventListener("resize",this.resetSize)},beforeDestroy:function(){window.removeEventListener("resize",this.resetSize)}},uu=cu,du=l(uu,Qc,Jc,!1,null,null,null);du.options.__file="packages/slider/src/main.vue";var hu=du.exports;hu.install=function(e){e.component(hu.name,hu)};var fu=hu,pu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":e.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-loading-mask",class:[e.customClass,{"is-fullscreen":e.fullscreen}],style:{backgroundColor:e.background||""}},[n("div",{staticClass:"el-loading-spinner"},[e.spinner?n("i",{class:e.spinner}):n("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[n("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),e.text?n("p",{staticClass:"el-loading-text"},[e._v(e._s(e.text))]):e._e()])])])},mu=[];pu._withStripped=!0;var gu={data:function(){return{text:null,spinner:null,background:null,fullscreen:!0,visible:!1,customClass:""}},methods:{handleAfterLeave:function(){this.$emit("after-leave")},setText:function(e){this.text=e}}},vu=gu,bu=l(vu,pu,mu,!1,null,null,null);bu.options.__file="packages/loading/src/loading.vue";var yu=bu.exports,wu=n(33),xu=n.n(wu),_u=qi.a.extend(yu),ku={install:function(e){if(!e.prototype.$isServer){var t=function(t,i){i.value?e.nextTick((function(){i.modifiers.fullscreen?(t.originalPosition=Object(ze["getStyle"])(document.body,"position"),t.originalOverflow=Object(ze["getStyle"])(document.body,"overflow"),t.maskStyle.zIndex=C["PopupManager"].nextZIndex(),Object(ze["addClass"])(t.mask,"is-fullscreen"),n(document.body,t,i)):(Object(ze["removeClass"])(t.mask,"is-fullscreen"),i.modifiers.body?(t.originalPosition=Object(ze["getStyle"])(document.body,"position"),["top","left"].forEach((function(e){var n="top"===e?"scrollTop":"scrollLeft";t.maskStyle[e]=t.getBoundingClientRect()[e]+document.body[n]+document.documentElement[n]-parseInt(Object(ze["getStyle"])(document.body,"margin-"+e),10)+"px"})),["height","width"].forEach((function(e){t.maskStyle[e]=t.getBoundingClientRect()[e]+"px"})),n(document.body,t,i)):(t.originalPosition=Object(ze["getStyle"])(t,"position"),n(t,t,i)))})):(xu()(t.instance,(function(e){if(t.instance.hiding){t.domVisible=!1;var n=i.modifiers.fullscreen||i.modifiers.body?document.body:t;Object(ze["removeClass"])(n,"el-loading-parent--relative"),Object(ze["removeClass"])(n,"el-loading-parent--hidden"),t.instance.hiding=!1}}),300,!0),t.instance.visible=!1,t.instance.hiding=!0)},n=function(t,n,i){n.domVisible||"none"===Object(ze["getStyle"])(n,"display")||"hidden"===Object(ze["getStyle"])(n,"visibility")?n.domVisible&&!0===n.instance.hiding&&(n.instance.visible=!0,n.instance.hiding=!1):(Object.keys(n.maskStyle).forEach((function(e){n.mask.style[e]=n.maskStyle[e]})),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(ze["addClass"])(t,"el-loading-parent--relative"),i.modifiers.fullscreen&&i.modifiers.lock&&Object(ze["addClass"])(t,"el-loading-parent--hidden"),n.domVisible=!0,t.appendChild(n.mask),e.nextTick((function(){n.instance.hiding?n.instance.$emit("after-leave"):n.instance.visible=!0})),n.domInserted=!0)};e.directive("loading",{bind:function(e,n,i){var r=e.getAttribute("element-loading-text"),o=e.getAttribute("element-loading-spinner"),a=e.getAttribute("element-loading-background"),s=e.getAttribute("element-loading-custom-class"),l=i.context,c=new _u({el:document.createElement("div"),data:{text:l&&l[r]||r,spinner:l&&l[o]||o,background:l&&l[a]||a,customClass:l&&l[s]||s,fullscreen:!!n.modifiers.fullscreen}});e.instance=c,e.mask=c.$el,e.maskStyle={},n.value&&t(e,n)},update:function(e,n){e.instance.setText(e.getAttribute("element-loading-text")),n.oldValue!==n.value&&t(e,n)},unbind:function(e,n){e.domInserted&&(e.mask&&e.mask.parentNode&&e.mask.parentNode.removeChild(e.mask),t(e,{value:!1,modifiers:n.modifiers})),e.instance&&e.instance.$destroy()}})}}},Cu=ku,Su=qi.a.extend(yu),Ou={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},Tu=void 0;Su.prototype.originalPosition="",Su.prototype.originalOverflow="",Su.prototype.close=function(){var e=this;this.fullscreen&&(Tu=void 0),xu()(this,(function(t){var n=e.fullscreen||e.body?document.body:e.target;Object(ze["removeClass"])(n,"el-loading-parent--relative"),Object(ze["removeClass"])(n,"el-loading-parent--hidden"),e.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),e.$destroy()}),300),this.visible=!1};var Eu=function(e,t,n){var i={};e.fullscreen?(n.originalPosition=Object(ze["getStyle"])(document.body,"position"),n.originalOverflow=Object(ze["getStyle"])(document.body,"overflow"),i.zIndex=C["PopupManager"].nextZIndex()):e.body?(n.originalPosition=Object(ze["getStyle"])(document.body,"position"),["top","left"].forEach((function(t){var n="top"===t?"scrollTop":"scrollLeft";i[t]=e.target.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]+"px"})),["height","width"].forEach((function(t){i[t]=e.target.getBoundingClientRect()[t]+"px"}))):n.originalPosition=Object(ze["getStyle"])(t,"position"),Object.keys(i).forEach((function(e){n.$el.style[e]=i[e]}))},Du=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!qi.a.prototype.$isServer){if(e=Ot()({},Ou,e),"string"===typeof e.target&&(e.target=document.querySelector(e.target)),e.target=e.target||document.body,e.target!==document.body?e.fullscreen=!1:e.body=!0,e.fullscreen&&Tu)return Tu;var t=e.body?document.body:e.target,n=new Su({el:document.createElement("div"),data:e});return Eu(e,t,n),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(ze["addClass"])(t,"el-loading-parent--relative"),e.fullscreen&&e.lock&&Object(ze["addClass"])(t,"el-loading-parent--hidden"),t.appendChild(n.$el),qi.a.nextTick((function(){n.visible=!0})),e.fullscreen&&(Tu=n),n}},Mu=Du,Au={install:function(e){e.use(Cu),e.prototype.$loading=Mu},directive:Cu,service:Mu},Nu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("i",{class:"el-icon-"+e.name})},Iu=[];Nu._withStripped=!0;var Lu={name:"ElIcon",props:{name:String}},Pu=Lu,$u=l(Pu,Nu,Iu,!1,null,null,null);$u.options.__file="packages/icon/src/icon.vue";var Fu=$u.exports;Fu.install=function(e){e.component(Fu.name,Fu)};var ju=Fu,zu={name:"ElRow",componentName:"ElRow",props:{tag:{type:String,default:"div"},gutter:Number,type:String,justify:{type:String,default:"start"},align:{type:String,default:"top"}},computed:{style:function(){var e={};return this.gutter&&(e.marginLeft="-"+this.gutter/2+"px",e.marginRight=e.marginLeft),e}},render:function(e){return e(this.tag,{class:["el-row","start"!==this.justify?"is-justify-"+this.justify:"","top"!==this.align?"is-align-"+this.align:"",{"el-row--flex":"flex"===this.type}],style:this.style},this.$slots.default)},install:function(e){e.component(zu.name,zu)}},Bu=zu,Ru="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},Vu={name:"ElCol",props:{span:{type:Number,default:24},tag:{type:String,default:"div"},offset:Number,pull:Number,push:Number,xs:[Number,Object],sm:[Number,Object],md:[Number,Object],lg:[Number,Object],xl:[Number,Object]},computed:{gutter:function(){var e=this.$parent;while(e&&"ElRow"!==e.$options.componentName)e=e.$parent;return e?e.gutter:0}},render:function(e){var t=this,n=[],i={};return this.gutter&&(i.paddingLeft=this.gutter/2+"px",i.paddingRight=i.paddingLeft),["span","offset","pull","push"].forEach((function(e){(t[e]||0===t[e])&&n.push("span"!==e?"el-col-"+e+"-"+t[e]:"el-col-"+t[e])})),["xs","sm","md","lg","xl"].forEach((function(e){if("number"===typeof t[e])n.push("el-col-"+e+"-"+t[e]);else if("object"===Ru(t[e])){var i=t[e];Object.keys(i).forEach((function(t){n.push("span"!==t?"el-col-"+e+"-"+t+"-"+i[t]:"el-col-"+e+"-"+i[t])}))}})),e(this.tag,{class:["el-col",n],style:i},this.$slots.default)},install:function(e){e.component(Vu.name,Vu)}},Hu=Vu,Wu=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition-group",{class:["el-upload-list","el-upload-list--"+e.listType,{"is-disabled":e.disabled}],attrs:{tag:"ul",name:"el-list"}},e._l(e.files,(function(t){return n("li",{key:t.uid,class:["el-upload-list__item","is-"+t.status,e.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(n){if(!("button"in n)&&e._k(n.keyCode,"delete",[8,46],n.key,["Backspace","Delete","Del"]))return null;!e.disabled&&e.$emit("remove",t)},focus:function(t){e.focusing=!0},blur:function(t){e.focusing=!1},click:function(t){e.focusing=!1}}},[e._t("default",["uploading"!==t.status&&["picture-card","picture"].indexOf(e.listType)>-1?n("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:t.url,alt:""}}):e._e(),n("a",{staticClass:"el-upload-list__item-name",on:{click:function(n){e.handleClick(t)}}},[n("i",{staticClass:"el-icon-document"}),e._v(e._s(t.name)+"\n ")]),n("label",{staticClass:"el-upload-list__item-status-label"},[n("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===e.listType,"el-icon-check":["picture-card","picture"].indexOf(e.listType)>-1}})]),e.disabled?e._e():n("i",{staticClass:"el-icon-close",on:{click:function(n){e.$emit("remove",t)}}}),e.disabled?e._e():n("i",{staticClass:"el-icon-close-tip"},[e._v(e._s(e.t("el.upload.deleteTip")))]),"uploading"===t.status?n("el-progress",{attrs:{type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:e.parsePercentage(t.percentage)}}):e._e(),"picture-card"===e.listType?n("span",{staticClass:"el-upload-list__item-actions"},[e.handlePreview&&"picture-card"===e.listType?n("span",{staticClass:"el-upload-list__item-preview",on:{click:function(n){e.handlePreview(t)}}},[n("i",{staticClass:"el-icon-zoom-in"})]):e._e(),e.disabled?e._e():n("span",{staticClass:"el-upload-list__item-delete",on:{click:function(n){e.$emit("remove",t)}}},[n("i",{staticClass:"el-icon-delete"})])]):e._e()],{file:t})],2)})),0)},qu=[];Wu._withStripped=!0;var Uu=n(34),Ku=n.n(Uu),Gu={name:"ElUploadList",mixins:[b.a],data:function(){return{focusing:!1}},components:{ElProgress:Ku.a},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(e){return parseInt(e,10)},handleClick:function(e){this.handlePreview&&this.handlePreview(e)}}},Yu=Gu,Xu=l(Yu,Wu,qu,!1,null,null,null);Xu.options.__file="packages/upload/src/upload-list.vue";var Zu=Xu.exports,Qu=n(24),Ju=n.n(Qu);function ed(e,t,n){var i=void 0;i=n.response?""+(n.response.error||n.response):n.responseText?""+n.responseText:"fail to post "+e+" "+n.status;var r=new Error(i);return r.status=n.status,r.method="post",r.url=e,r}function td(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(n){return t}}function nd(e){if("undefined"!==typeof XMLHttpRequest){var t=new XMLHttpRequest,n=e.action;t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var i=new FormData;e.data&&Object.keys(e.data).forEach((function(t){i.append(t,e.data[t])})),i.append(e.filename,e.file,e.file.name),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300)return e.onError(ed(n,e,t));e.onSuccess(td(t))},t.open("post",n,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};for(var o in r)r.hasOwnProperty(o)&&null!==r[o]&&t.setRequestHeader(o,r[o]);return t.send(i),t}}var id=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-upload-dragger",class:{"is-dragover":e.dragover},on:{drop:function(t){return t.preventDefault(),e.onDrop(t)},dragover:function(t){return t.preventDefault(),e.onDragover(t)},dragleave:function(t){t.preventDefault(),e.dragover=!1}}},[e._t("default")],2)},rd=[];id._withStripped=!0;var od={name:"ElUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(e){if(!this.disabled&&this.uploader){var t=this.uploader.accept;this.dragover=!1,t?this.$emit("file",[].slice.call(e.dataTransfer.files).filter((function(e){var n=e.type,i=e.name,r=i.indexOf(".")>-1?"."+i.split(".").pop():"",o=n.replace(/\/.*$/,"");return t.split(",").map((function(e){return e.trim()})).filter((function(e){return e})).some((function(e){return/\..+$/.test(e)?r===e:/\/\*$/.test(e)?o===e.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(e)&&n===e}))}))):this.$emit("file",e.dataTransfer.files)}}}},ad=od,sd=l(ad,id,rd,!1,null,null,null);sd.options.__file="packages/upload/src/upload-dragger.vue";var ld,cd,ud=sd.exports,dd={inject:["uploader"],components:{UploadDragger:ud},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:nd},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},methods:{isImage:function(e){return-1!==e.indexOf("image")},handleChange:function(e){var t=e.target.files;t&&this.uploadFiles(t)},uploadFiles:function(e){var t=this;if(this.limit&&this.fileList.length+e.length>this.limit)this.onExceed&&this.onExceed(e,this.fileList);else{var n=Array.prototype.slice.call(e);this.multiple||(n=n.slice(0,1)),0!==n.length&&n.forEach((function(e){t.onStart(e),t.autoUpload&&t.upload(e)}))}},upload:function(e){var t=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(e);var n=this.beforeUpload(e);n&&n.then?n.then((function(n){var i=Object.prototype.toString.call(n);if("[object File]"===i||"[object Blob]"===i){for(var r in"[object Blob]"===i&&(n=new File([n],e.name,{type:e.type})),e)e.hasOwnProperty(r)&&(n[r]=e[r]);t.post(n)}else t.post(e)}),(function(){t.onRemove(null,e)})):!1!==n?this.post(e):this.onRemove(null,e)},abort:function(e){var t=this.reqs;if(e){var n=e;e.uid&&(n=e.uid),t[n]&&t[n].abort()}else Object.keys(t).forEach((function(e){t[e]&&t[e].abort(),delete t[e]}))},post:function(e){var t=this,n=e.uid,i={headers:this.headers,withCredentials:this.withCredentials,file:e,data:this.data,filename:this.name,action:this.action,onProgress:function(n){t.onProgress(n,e)},onSuccess:function(i){t.onSuccess(i,e),delete t.reqs[n]},onError:function(i){t.onError(i,e),delete t.reqs[n]}},r=this.httpRequest(i);this.reqs[n]=r,r&&r.then&&r.then(i.onSuccess,i.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(e){e.target===e.currentTarget&&(13!==e.keyCode&&32!==e.keyCode||this.handleClick())}},render:function(e){var t=this.handleClick,n=this.drag,i=this.name,r=this.handleChange,o=this.multiple,a=this.accept,s=this.listType,l=this.uploadFiles,c=this.disabled,u=this.handleKeydown,d={class:{"el-upload":!0},on:{click:t,keydown:u}};return d.class["el-upload--"+s]=!0,e("div",Ju()([d,{attrs:{tabindex:"0"}}]),[n?e("upload-dragger",{attrs:{disabled:c},on:{file:l}},[this.$slots.default]):this.$slots.default,e("input",{class:"el-upload__input",attrs:{type:"file",name:i,multiple:o,accept:a},ref:"input",on:{change:r}})])}},hd=dd,fd=l(hd,ld,cd,!1,null,null,null);fd.options.__file="packages/upload/src/upload.vue";var pd=fd.exports;function md(){}var gd,vd,bd={name:"ElUpload",mixins:[T.a],components:{ElProgress:Ku.a,UploadList:Zu,Upload:pd},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:md},onChange:{type:Function,default:md},onPreview:{type:Function},onSuccess:{type:Function,default:md},onProgress:{type:Function,default:md},onError:{type:Function,default:md},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:md}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(e){"picture-card"!==e&&"picture"!==e||(this.uploadFiles=this.uploadFiles.map((function(e){if(!e.url&&e.raw)try{e.url=URL.createObjectURL(e.raw)}catch(t){console.error("[Element Error][Upload]",t)}return e})))},fileList:{immediate:!0,handler:function(e){var t=this;this.uploadFiles=e.map((function(e){return e.uid=e.uid||Date.now()+t.tempIndex++,e.status=e.status||"success",e}))}}},methods:{handleStart:function(e){e.uid=Date.now()+this.tempIndex++;var t={status:"ready",name:e.name,size:e.size,percentage:0,uid:e.uid,raw:e};if("picture-card"===this.listType||"picture"===this.listType)try{t.url=URL.createObjectURL(e)}catch(n){return void console.error("[Element Error][Upload]",n)}this.uploadFiles.push(t),this.onChange(t,this.uploadFiles)},handleProgress:function(e,t){var n=this.getFile(t);this.onProgress(e,n,this.uploadFiles),n.status="uploading",n.percentage=e.percent||0},handleSuccess:function(e,t){var n=this.getFile(t);n&&(n.status="success",n.response=e,this.onSuccess(e,n,this.uploadFiles),this.onChange(n,this.uploadFiles))},handleError:function(e,t){var n=this.getFile(t),i=this.uploadFiles;n.status="fail",i.splice(i.indexOf(n),1),this.onError(e,n,this.uploadFiles),this.onChange(n,this.uploadFiles)},handleRemove:function(e,t){var n=this;t&&(e=this.getFile(t));var i=function(){n.abort(e);var t=n.uploadFiles;t.splice(t.indexOf(e),1),n.onRemove(e,t)};if(this.beforeRemove){if("function"===typeof this.beforeRemove){var r=this.beforeRemove(e,this.uploadFiles);r&&r.then?r.then((function(){i()}),md):!1!==r&&i()}}else i()},getFile:function(e){var t=this.uploadFiles,n=void 0;return t.every((function(t){return n=e.uid===t.uid?t:null,!n})),n},abort:function(e){this.$refs["upload-inner"].abort(e)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var e=this;this.uploadFiles.filter((function(e){return"ready"===e.status})).forEach((function(t){e.$refs["upload-inner"].upload(t.raw)}))},getMigratingConfig:function(){return{props:{"default-file-list":"default-file-list is renamed to file-list.","show-upload-list":"show-upload-list is renamed to show-file-list.","thumbnail-mode":"thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan"}}}},beforeDestroy:function(){this.uploadFiles.forEach((function(e){e.url&&0===e.url.indexOf("blob:")&&URL.revokeObjectURL(e.url)}))},render:function(e){var t=this,n=void 0;this.showFileList&&(n=e(Zu,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}},[function(e){if(t.$scopedSlots.file)return t.$scopedSlots.file({file:e.file})}]));var i={props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,"with-credentials":this.withCredentials,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"},r=this.$slots.trigger||this.$slots.default,o=e("upload",i,[r]);return e("div",["picture-card"===this.listType?n:"",this.$slots.trigger?[o,this.$slots.default]:o,this.$slots.tip,"picture-card"!==this.listType?n:""])}},yd=bd,wd=l(yd,gd,vd,!1,null,null,null);wd.options.__file="packages/upload/src/index.vue";var xd=wd.exports;xd.install=function(e){e.component(xd.name,xd)};var _d=xd,kd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-progress",class:["el-progress--"+e.type,e.status?"is-"+e.status:"",{"el-progress--without-text":!e.showText,"el-progress--text-inside":e.textInside}],attrs:{role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===e.type?n("div",{staticClass:"el-progress-bar"},[n("div",{staticClass:"el-progress-bar__outer",style:{height:e.strokeWidth+"px"}},[n("div",{staticClass:"el-progress-bar__inner",style:e.barStyle},[e.showText&&e.textInside?n("div",{staticClass:"el-progress-bar__innerText"},[e._v(e._s(e.content))]):e._e()])])]):n("div",{staticClass:"el-progress-circle",style:{height:e.width+"px",width:e.width+"px"}},[n("svg",{attrs:{viewBox:"0 0 100 100"}},[n("path",{staticClass:"el-progress-circle__track",style:e.trailPathStyle,attrs:{d:e.trackPath,stroke:"#e5e9f2","stroke-width":e.relativeStrokeWidth,fill:"none"}}),n("path",{staticClass:"el-progress-circle__path",style:e.circlePathStyle,attrs:{d:e.trackPath,stroke:e.stroke,fill:"none","stroke-linecap":e.strokeLinecap,"stroke-width":e.percentage?e.relativeStrokeWidth:0}})])]),e.showText&&!e.textInside?n("div",{staticClass:"el-progress__text",style:{fontSize:e.progressTextSize+"px"}},[e.status?n("i",{class:e.iconClass}):[e._v(e._s(e.content))]],2):e._e()])},Cd=[];kd._withStripped=!0;var Sd={name:"ElProgress",props:{type:{type:String,default:"line",validator:function(e){return["line","circle","dashboard"].indexOf(e)>-1}},percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},status:{type:String,validator:function(e){return["success","exception","warning"].indexOf(e)>-1}},strokeWidth:{type:Number,default:6},strokeLinecap:{type:String,default:"round"},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var e=this.radius,t="dashboard"===this.type;return"\n M 50 50\n m 0 "+(t?"":"-")+e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"-":"")+2*e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"":"-")+2*e+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){var e=-1*this.perimeter*(1-this.rate)/2;return e+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var e=void 0;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"===typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(e){return"function"===typeof this.color?this.color(e):"string"===typeof this.color?this.color:this.getLevelColor(e)},getLevelColor:function(e){for(var t=this.getColorArray().sort((function(e,t){return e.percentage-t.percentage})),n=0;ne)return t[n].color;return t[t.length-1].color},getColorArray:function(){var e=this.color,t=100/e.length;return e.map((function(e,n){return"string"===typeof e?{color:e,progress:(n+1)*t}:e}))}}},Od=Sd,Td=l(Od,kd,Cd,!1,null,null,null);Td.options.__file="packages/progress/src/progress.vue";var Ed=Td.exports;Ed.install=function(e){e.component(Ed.name,Ed)};var Dd=Ed,Md=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",{staticClass:"el-spinner"},[n("svg",{staticClass:"el-spinner-inner",style:{width:e.radius/2+"px",height:e.radius/2+"px"},attrs:{viewBox:"0 0 50 50"}},[n("circle",{staticClass:"path",attrs:{cx:"25",cy:"25",r:"20",fill:"none",stroke:e.strokeColor,"stroke-width":e.strokeWidth}})])])},Ad=[];Md._withStripped=!0;var Nd={name:"ElSpinner",props:{type:String,radius:{type:Number,default:100},strokeWidth:{type:Number,default:5},strokeColor:{type:String,default:"#efefef"}}},Id=Nd,Ld=l(Id,Md,Ad,!1,null,null,null);Ld.options.__file="packages/spinner/src/spinner.vue";var Pd=Ld.exports;Pd.install=function(e){e.component(Pd.name,Pd)};var $d=Pd,Fd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-message-fade"},on:{"after-leave":e.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-message",e.type&&!e.iconClass?"el-message--"+e.type:"",e.center?"is-center":"",e.showClose?"is-closable":"",e.customClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:e.clearTimer,mouseleave:e.startTimer}},[e.iconClass?n("i",{class:e.iconClass}):n("i",{class:e.typeClass}),e._t("default",[e.dangerouslyUseHTMLString?n("p",{staticClass:"el-message__content",domProps:{innerHTML:e._s(e.message)}}):n("p",{staticClass:"el-message__content"},[e._v(e._s(e.message))])]),e.showClose?n("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:e.close}}):e._e()],2)])},jd=[];Fd._withStripped=!0;var zd={success:"success",info:"info",warning:"warning",error:"error"},Bd={data:function(){return{visible:!1,message:"",duration:3e3,type:"info",iconClass:"",customClass:"",onClose:null,showClose:!1,closed:!1,verticalOffset:20,timer:null,dangerouslyUseHTMLString:!1,center:!1}},computed:{typeClass:function(){return this.type&&!this.iconClass?"el-message__icon el-icon-"+zd[this.type]:""},positionStyle:function(){return{top:this.verticalOffset+"px"}}},watch:{closed:function(e){e&&(this.visible=!1)}},methods:{handleAfterLeave:function(){this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose(this)},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout((function(){e.closed||e.close()}),this.duration))},keydown:function(e){27===e.keyCode&&(this.closed||this.close())}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},Rd=Bd,Vd=l(Rd,Fd,jd,!1,null,null,null);Vd.options.__file="packages/message/src/main.vue";var Hd=Vd.exports,Wd=qi.a.extend(Hd),qd=void 0,Ud=[],Kd=1,Gd=function e(t){if(!qi.a.prototype.$isServer){t=t||{},"string"===typeof t&&(t={message:t});var n=t.onClose,i="message_"+Kd++;t.onClose=function(){e.close(i,n)},qd=new Wd({data:t}),qd.id=i,Object(Ss["isVNode"])(qd.message)&&(qd.$slots.default=[qd.message],qd.message=null),qd.$mount(),document.body.appendChild(qd.$el);var r=t.offset||20;return Ud.forEach((function(e){r+=e.$el.offsetHeight+16})),qd.verticalOffset=r,qd.visible=!0,qd.$el.style.zIndex=C["PopupManager"].nextZIndex(),Ud.push(qd),qd}};["success","warning","info","error"].forEach((function(e){Gd[e]=function(t){return"string"===typeof t&&(t={message:t}),t.type=e,Gd(t)}})),Gd.close=function(e,t){for(var n=Ud.length,i=-1,r=void 0,o=0;oUd.length-1))for(var a=i;a=0;e--)Ud[e].close()};var Yd=Gd,Xd=Yd,Zd=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-badge"},[e._t("default"),n("transition",{attrs:{name:"el-zoom-in-center"}},[n("sup",{directives:[{name:"show",rawName:"v-show",value:!e.hidden&&(e.content||0===e.content||e.isDot),expression:"!hidden && (content || content === 0 || isDot)"}],staticClass:"el-badge__content",class:["el-badge__content--"+e.type,{"is-fixed":e.$slots.default,"is-dot":e.isDot}],domProps:{textContent:e._s(e.content)}})])],2)},Qd=[];Zd._withStripped=!0;var Jd={name:"ElBadge",props:{value:[String,Number],max:Number,isDot:Boolean,hidden:Boolean,type:{type:String,validator:function(e){return["primary","success","warning","info","danger"].indexOf(e)>-1}}},computed:{content:function(){if(!this.isDot){var e=this.value,t=this.max;return"number"===typeof e&&"number"===typeof t&&t0&&e-1this.value,n=this.allowHalf&&this.pointerAtLeftHalf&&e-.5<=this.currentValue&&e>this.currentValue;return t||n},getIconStyle:function(e){var t=this.rateDisabled?this.disabledVoidColor:this.voidColor;return{color:e<=this.currentValue?this.activeColor:t}},selectValue:function(e){this.rateDisabled||(this.allowHalf&&this.pointerAtLeftHalf?(this.$emit("input",this.currentValue),this.$emit("change",this.currentValue)):(this.$emit("input",e),this.$emit("change",e)))},handleKey:function(e){if(!this.rateDisabled){var t=this.currentValue,n=e.keyCode;38===n||39===n?(this.allowHalf?t+=.5:t+=1,e.stopPropagation(),e.preventDefault()):37!==n&&40!==n||(this.allowHalf?t-=.5:t-=1,e.stopPropagation(),e.preventDefault()),t=t<0?0:t,t=t>this.max?this.max:t,this.$emit("input",t),this.$emit("change",t)}},setCurrentValue:function(e,t){if(!this.rateDisabled){if(this.allowHalf){var n=t.target;Object(ze["hasClass"])(n,"el-rate__item")&&(n=n.querySelector(".el-rate__icon")),Object(ze["hasClass"])(n,"el-rate__decimal")&&(n=n.parentNode),this.pointerAtLeftHalf=2*t.offsetX<=n.clientWidth,this.currentValue=this.pointerAtLeftHalf?e-.5:e}else this.currentValue=e;this.hoverIndex=e}},resetCurrentValue:function(){this.rateDisabled||(this.allowHalf&&(this.pointerAtLeftHalf=this.value!==Math.floor(this.value)),this.currentValue=this.value,this.hoverIndex=-1)}},created:function(){this.value||this.$emit("input",0)}},mh=ph,gh=l(mh,dh,hh,!1,null,null,null);gh.options.__file="packages/rate/src/main.vue";var vh=gh.exports;vh.install=function(e){e.component(vh.name,vh)};var bh=vh,yh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-steps",class:[!e.simple&&"el-steps--"+e.direction,e.simple&&"el-steps--simple"]},[e._t("default")],2)},wh=[];yh._withStripped=!0;var xh={name:"ElSteps",mixins:[T.a],props:{space:[Number,String],active:Number,direction:{type:String,default:"horizontal"},alignCenter:Boolean,simple:Boolean,finishStatus:{type:String,default:"finish"},processStatus:{type:String,default:"process"}},data:function(){return{steps:[],stepOffset:0}},methods:{getMigratingConfig:function(){return{props:{center:"center is removed."}}}},watch:{active:function(e,t){this.$emit("change",e,t)},steps:function(e){e.forEach((function(e,t){e.index=t}))}}},_h=xh,kh=l(_h,yh,wh,!1,null,null,null);kh.options.__file="packages/steps/src/steps.vue";var Ch=kh.exports;Ch.install=function(e){e.component(Ch.name,Ch)};var Sh=Ch,Oh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-step",class:[!e.isSimple&&"is-"+e.$parent.direction,e.isSimple&&"is-simple",e.isLast&&!e.space&&!e.isCenter&&"is-flex",e.isCenter&&!e.isVertical&&!e.isSimple&&"is-center"],style:e.style},[n("div",{staticClass:"el-step__head",class:"is-"+e.currentStatus},[n("div",{staticClass:"el-step__line",style:e.isLast?"":{marginRight:e.$parent.stepOffset+"px"}},[n("i",{staticClass:"el-step__line-inner",style:e.lineStyle})]),n("div",{staticClass:"el-step__icon",class:"is-"+(e.icon?"icon":"text")},["success"!==e.currentStatus&&"error"!==e.currentStatus?e._t("icon",[e.icon?n("i",{staticClass:"el-step__icon-inner",class:[e.icon]}):e._e(),e.icon||e.isSimple?e._e():n("div",{staticClass:"el-step__icon-inner"},[e._v(e._s(e.index+1))])]):n("i",{staticClass:"el-step__icon-inner is-status",class:["el-icon-"+("success"===e.currentStatus?"check":"close")]})],2)]),n("div",{staticClass:"el-step__main"},[n("div",{ref:"title",staticClass:"el-step__title",class:["is-"+e.currentStatus]},[e._t("title",[e._v(e._s(e.title))])],2),e.isSimple?n("div",{staticClass:"el-step__arrow"}):n("div",{staticClass:"el-step__description",class:["is-"+e.currentStatus]},[e._t("description",[e._v(e._s(e.description))])],2)])])},Th=[];Oh._withStripped=!0;var Eh={name:"ElStep",props:{title:String,icon:String,description:String,status:String},data:function(){return{index:-1,lineStyle:{},internalStatus:""}},beforeCreate:function(){this.$parent.steps.push(this)},beforeDestroy:function(){var e=this.$parent.steps,t=e.indexOf(this);t>=0&&e.splice(t,1)},computed:{currentStatus:function(){return this.status||this.internalStatus},prevStatus:function(){var e=this.$parent.steps[this.index-1];return e?e.currentStatus:"wait"},isCenter:function(){return this.$parent.alignCenter},isVertical:function(){return"vertical"===this.$parent.direction},isSimple:function(){return this.$parent.simple},isLast:function(){var e=this.$parent;return e.steps[e.steps.length-1]===this},stepsCount:function(){return this.$parent.steps.length},space:function(){var e=this.isSimple,t=this.$parent.space;return e?"":t},style:function(){var e={},t=this.$parent,n=t.steps.length,i="number"===typeof this.space?this.space+"px":this.space?this.space:100/(n-(this.isCenter?0:1))+"%";return e.flexBasis=i,this.isVertical||(this.isLast?e.maxWidth=100/this.stepsCount+"%":e.marginRight=-this.$parent.stepOffset+"px"),e}},methods:{updateStatus:function(e){var t=this.$parent.$children[this.index-1];e>this.index?this.internalStatus=this.$parent.finishStatus:e===this.index&&"error"!==this.prevStatus?this.internalStatus=this.$parent.processStatus:this.internalStatus="wait",t&&t.calcProgress(this.internalStatus)},calcProgress:function(e){var t=100,n={};n.transitionDelay=150*this.index+"ms",e===this.$parent.processStatus?(this.currentStatus,t=0):"wait"===e&&(t=0,n.transitionDelay=-150*this.index+"ms"),n.borderWidth=t&&!this.isSimple?"1px":0,"vertical"===this.$parent.direction?n.height=t+"%":n.width=t+"%",this.lineStyle=n}},mounted:function(){var e=this,t=this.$watch("index",(function(n){e.$watch("$parent.active",e.updateStatus,{immediate:!0}),e.$watch("$parent.processStatus",(function(){var t=e.$parent.active;e.updateStatus(t)}),{immediate:!0}),t()}))}},Dh=Eh,Mh=l(Dh,Oh,Th,!1,null,null,null);Mh.options.__file="packages/steps/src/step.vue";var Ah=Mh.exports;Ah.install=function(e){e.component(Ah.name,Ah)};var Nh=Ah,Ih=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.carouselClasses,on:{mouseenter:function(t){return t.stopPropagation(),e.handleMouseEnter(t)},mouseleave:function(t){return t.stopPropagation(),e.handleMouseLeave(t)}}},[n("div",{staticClass:"el-carousel__container",style:{height:e.height}},[e.arrowDisplay?n("transition",{attrs:{name:"carousel-arrow-left"}},[n("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex>0),expression:"(arrow === 'always' || hover) && (loop || activeIndex > 0)"}],staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{type:"button"},on:{mouseenter:function(t){e.handleButtonEnter("left")},mouseleave:e.handleButtonLeave,click:function(t){t.stopPropagation(),e.throttledArrowClick(e.activeIndex-1)}}},[n("i",{staticClass:"el-icon-arrow-left"})])]):e._e(),e.arrowDisplay?n("transition",{attrs:{name:"carousel-arrow-right"}},[n("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex0}))},carouselClasses:function(){var e=["el-carousel","el-carousel--"+this.direction];return"card"===this.type&&e.push("el-carousel--card"),e},indicatorsClasses:function(){var e=["el-carousel__indicators","el-carousel__indicators--"+this.direction];return this.hasLabel&&e.push("el-carousel__indicators--labels"),"outside"!==this.indicatorPosition&&"card"!==this.type||e.push("el-carousel__indicators--outside"),e}},watch:{items:function(e){e.length>0&&this.setActiveItem(this.initialIndex)},activeIndex:function(e,t){this.resetItemPosition(t),t>-1&&this.$emit("change",e,t)},autoplay:function(e){e?this.startTimer():this.pauseTimer()},loop:function(){this.setActiveItem(this.activeIndex)}},methods:{handleMouseEnter:function(){this.hover=!0,this.pauseTimer()},handleMouseLeave:function(){this.hover=!1,this.startTimer()},itemInStage:function(e,t){var n=this.items.length;return t===n-1&&e.inStage&&this.items[0].active||e.inStage&&this.items[t+1]&&this.items[t+1].active?"left":!!(0===t&&e.inStage&&this.items[n-1].active||e.inStage&&this.items[t-1]&&this.items[t-1].active)&&"right"},handleButtonEnter:function(e){var t=this;"vertical"!==this.direction&&this.items.forEach((function(n,i){e===t.itemInStage(n,i)&&(n.hover=!0)}))},handleButtonLeave:function(){"vertical"!==this.direction&&this.items.forEach((function(e){e.hover=!1}))},updateItems:function(){this.items=this.$children.filter((function(e){return"ElCarouselItem"===e.$options.name}))},resetItemPosition:function(e){var t=this;this.items.forEach((function(n,i){n.translateItem(i,t.activeIndex,e)}))},playSlides:function(){this.activeIndex0&&(e=this.items.indexOf(t[0]))}if(e=Number(e),isNaN(e)||e!==Math.floor(e))console.warn("[Element Warn][Carousel]index must be an integer.");else{var n=this.items.length,i=this.activeIndex;this.activeIndex=e<0?this.loop?n-1:0:e>=n?this.loop?0:n-1:e,i===this.activeIndex&&this.resetItemPosition(i)}},prev:function(){this.setActiveItem(this.activeIndex-1)},next:function(){this.setActiveItem(this.activeIndex+1)},handleIndicatorClick:function(e){this.activeIndex=e},handleIndicatorHover:function(e){"hover"===this.trigger&&e!==this.activeIndex&&(this.activeIndex=e)}},created:function(){var e=this;this.throttledArrowClick=$h()(300,!0,(function(t){e.setActiveItem(t)})),this.throttledIndicatorHover=$h()(300,(function(t){e.handleIndicatorHover(t)}))},mounted:function(){var e=this;this.updateItems(),this.$nextTick((function(){Object(ti["addResizeListener"])(e.$el,e.resetItemPosition),e.initialIndex=0&&(e.activeIndex=e.initialIndex),e.startTimer()}))},beforeDestroy:function(){this.$el&&Object(ti["removeResizeListener"])(this.$el,this.resetItemPosition),this.pauseTimer()}},jh=Fh,zh=l(jh,Ih,Lh,!1,null,null,null);zh.options.__file="packages/carousel/src/main.vue";var Bh=zh.exports;Bh.install=function(e){e.component(Bh.name,Bh)};var Rh=Bh,Vh={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};function Hh(e){var t=e.move,n=e.size,i=e.bar,r={},o="translate"+i.axis+"("+t+"%)";return r[i.size]=n,r.transform=o,r.msTransform=o,r.webkitTransform=o,r}var Wh={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return Vh[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(e){var t=this.size,n=this.move,i=this.bar;return e("div",{class:["el-scrollbar__bar","is-"+i.key],on:{mousedown:this.clickTrackHandler}},[e("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:Hh({size:t,move:n,bar:i})})])},methods:{clickThumbHandler:function(e){e.ctrlKey||2===e.button||(this.startDrag(e),this[this.bar.axis]=e.currentTarget[this.bar.offset]-(e[this.bar.client]-e.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(e){var t=Math.abs(e.target.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),n=this.$refs.thumb[this.bar.offset]/2,i=100*(t-n)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=i*this.wrap[this.bar.scrollSize]/100},startDrag:function(e){e.stopImmediatePropagation(),this.cursorDown=!0,Object(ze["on"])(document,"mousemove",this.mouseMoveDocumentHandler),Object(ze["on"])(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(e){if(!1!==this.cursorDown){var t=this[this.bar.axis];if(t){var n=-1*(this.$el.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),i=this.$refs.thumb[this.bar.offset]-t,r=100*(n-i)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=r*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(e){this.cursorDown=!1,this[this.bar.axis]=0,Object(ze["off"])(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(ze["off"])(document,"mouseup",this.mouseUpDocumentHandler)}},qh={name:"ElScrollbar",components:{Bar:Wh},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(e){var t=wr()(),n=this.wrapStyle;if(t){var i="-"+t+"px",r="margin-bottom: "+i+"; margin-right: "+i+";";Array.isArray(this.wrapStyle)?(n=Object(y["toObject"])(this.wrapStyle),n.marginRight=n.marginBottom=i):"string"===typeof this.wrapStyle?n+=r:n=r}var o=e(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),a=e("div",{ref:"wrap",style:n,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",t?"":"el-scrollbar__wrap--hidden-default"]},[[o]]),s=void 0;return s=this.native?[e("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:n},[[o]])]:[a,e(Wh,{attrs:{move:this.moveX,size:this.sizeWidth}}),e(Wh,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})],e("div",{class:"el-scrollbar"},s)},methods:{handleScroll:function(){var e=this.wrap;this.moveY=100*e.scrollTop/e.clientHeight,this.moveX=100*e.scrollLeft/e.clientWidth},update:function(){var e=void 0,t=void 0,n=this.wrap;n&&(e=100*n.clientHeight/n.scrollHeight,t=100*n.clientWidth/n.scrollWidth,this.sizeHeight=e<100?e+"%":"",this.sizeWidth=t<100?t+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(ti["addResizeListener"])(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(ti["removeResizeListener"])(this.$refs.resize,this.update)},install:function(e){e.component(qh.name,qh)}},Uh=qh,Kh=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"show",rawName:"v-show",value:e.ready,expression:"ready"}],staticClass:"el-carousel__item",class:{"is-active":e.active,"el-carousel__item--card":"card"===e.$parent.type,"is-in-stage":e.inStage,"is-hover":e.hover,"is-animating":e.animating},style:e.itemStyle,on:{click:e.handleItemClick}},["card"===e.$parent.type?n("div",{directives:[{name:"show",rawName:"v-show",value:!e.active,expression:"!active"}],staticClass:"el-carousel__mask"}):e._e(),e._t("default")],2)},Gh=[];Kh._withStripped=!0;var Yh=.83,Xh={name:"ElCarouselItem",props:{name:String,label:{type:[String,Number],default:""}},data:function(){return{hover:!1,translate:0,scale:1,active:!1,ready:!1,inStage:!1,animating:!1}},methods:{processIndex:function(e,t,n){return 0===t&&e===n-1?-1:t===n-1&&0===e?n:e=n/2?n+1:e>t+1&&e-t>=n/2?-2:e},calcCardTranslate:function(e,t){var n=this.$parent.$el.offsetWidth;return this.inStage?n*((2-Yh)*(e-t)+1)/4:e2&&this.$parent.loop&&(e=this.processIndex(e,t,o)),"card"===i)"vertical"===r&&console.warn("[Element Warn][Carousel]vertical direction is not supported in card mode"),this.inStage=Math.round(Math.abs(e-t))<=1,this.active=e===t,this.translate=this.calcCardTranslate(e,t),this.scale=this.active?1:Yh;else{this.active=e===t;var a="vertical"===r;this.translate=this.calcTranslate(e,t,a)}this.ready=!0},handleItemClick:function(){var e=this.$parent;if(e&&"card"===e.type){var t=e.items.indexOf(this);e.setActiveItem(t)}}},computed:{parentDirection:function(){return this.$parent.direction},itemStyle:function(){var e="vertical"===this.parentDirection?"translateY":"translateX",t=e+"("+this.translate+"px) scale("+this.scale+")",n={transform:t};return Object(y["autoprefixer"])(n)}},created:function(){this.$parent&&this.$parent.updateItems()},destroyed:function(){this.$parent&&this.$parent.updateItems()}},Zh=Xh,Qh=l(Zh,Kh,Gh,!1,null,null,null);Qh.options.__file="packages/carousel/src/item.vue";var Jh=Qh.exports;Jh.install=function(e){e.component(Jh.name,Jh)};var ef=Jh,tf=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-collapse",attrs:{role:"tablist","aria-multiselectable":"true"}},[e._t("default")],2)},nf=[];tf._withStripped=!0;var rf={name:"ElCollapse",componentName:"ElCollapse",props:{accordion:Boolean,value:{type:[Array,String,Number],default:function(){return[]}}},data:function(){return{activeNames:[].concat(this.value)}},provide:function(){return{collapse:this}},watch:{value:function(e){this.activeNames=[].concat(e)}},methods:{setActiveNames:function(e){e=[].concat(e);var t=this.accordion?e[0]:e;this.activeNames=e,this.$emit("input",t),this.$emit("change",t)},handleItemClick:function(e){if(this.accordion)this.setActiveNames(!this.activeNames[0]&&0!==this.activeNames[0]||this.activeNames[0]!==e.name?e.name:"");else{var t=this.activeNames.slice(0),n=t.indexOf(e.name);n>-1?t.splice(n,1):t.push(e.name),this.setActiveNames(t)}}},created:function(){this.$on("item-click",this.handleItemClick)}},of=rf,af=l(of,tf,nf,!1,null,null,null);af.options.__file="packages/collapse/src/collapse.vue";var sf=af.exports;sf.install=function(e){e.component(sf.name,sf)};var lf=sf,cf=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-collapse-item",class:{"is-active":e.isActive,"is-disabled":e.disabled}},[n("div",{attrs:{role:"tab","aria-expanded":e.isActive,"aria-controls":"el-collapse-content-"+e.id,"aria-describedby":"el-collapse-content-"+e.id}},[n("div",{staticClass:"el-collapse-item__header",class:{focusing:e.focusing,"is-active":e.isActive},attrs:{role:"button",id:"el-collapse-head-"+e.id,tabindex:e.disabled?void 0:0},on:{click:e.handleHeaderClick,keyup:function(t){return!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.stopPropagation(),e.handleEnterClick(t))},focus:e.handleFocus,blur:function(t){e.focusing=!1}}},[e._t("title",[e._v(e._s(e.title))]),n("i",{staticClass:"el-collapse-item__arrow el-icon-arrow-right",class:{"is-active":e.isActive}})],2)]),n("el-collapse-transition",[n("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"el-collapse-item__wrap",attrs:{role:"tabpanel","aria-hidden":!e.isActive,"aria-labelledby":"el-collapse-head-"+e.id,id:"el-collapse-content-"+e.id}},[n("div",{staticClass:"el-collapse-item__content"},[e._t("default")],2)])])],1)},uf=[];cf._withStripped=!0;var df={name:"ElCollapseItem",componentName:"ElCollapseItem",mixins:[D.a],components:{ElCollapseTransition:Ge.a},data:function(){return{contentWrapStyle:{height:"auto",display:"block"},contentHeight:0,focusing:!1,isClick:!1,id:Object(y["generateId"])()}},inject:["collapse"],props:{title:String,name:{type:[String,Number],default:function(){return this._uid}},disabled:Boolean},computed:{isActive:function(){return this.collapse.activeNames.indexOf(this.name)>-1}},methods:{handleFocus:function(){var e=this;setTimeout((function(){e.isClick?e.isClick=!1:e.focusing=!0}),50)},handleHeaderClick:function(){this.disabled||(this.dispatch("ElCollapse","item-click",this),this.focusing=!1,this.isClick=!0)},handleEnterClick:function(){this.dispatch("ElCollapse","item-click",this)}}},hf=df,ff=l(hf,cf,uf,!1,null,null,null);ff.options.__file="packages/collapse/src/collapse-item.vue";var pf=ff.exports;pf.install=function(e){e.component(pf.name,pf)};var mf=pf,gf=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:function(){return e.toggleDropDownVisible(!1)},expression:"() => toggleDropDownVisible(false)"}],ref:"reference",class:["el-cascader",e.realSize&&"el-cascader--"+e.realSize,{"is-disabled":e.isDisabled}],on:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1},click:function(){return e.toggleDropDownVisible(!e.readonly||void 0)},keydown:e.handleKeyDown}},[n("el-input",{ref:"input",class:{"is-focus":e.dropDownVisible},attrs:{size:e.realSize,placeholder:e.placeholder,readonly:e.readonly,disabled:e.isDisabled,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur,input:e.handleInput},model:{value:e.multiple?e.presentText:e.inputValue,callback:function(t){e.multiple?e.presentText:e.inputValue=t},expression:"multiple ? presentText : inputValue"}},[n("template",{slot:"suffix"},[e.clearBtnVisible?n("i",{key:"clear",staticClass:"el-input__icon el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.handleClear(t)}}}):n("i",{key:"arrow-down",class:["el-input__icon","el-icon-arrow-down",e.dropDownVisible&&"is-reverse"],on:{click:function(t){t.stopPropagation(),e.toggleDropDownVisible()}}})])],2),e.multiple?n("div",{staticClass:"el-cascader__tags"},[e._l(e.presentTags,(function(t,i){return n("el-tag",{key:t.key,attrs:{type:"info",size:e.tagSize,hit:t.hitState,closable:t.closable,"disable-transitions":""},on:{close:function(t){e.deleteTag(i)}}},[n("span",[e._v(e._s(t.text))])])})),e.filterable&&!e.isDisabled?n("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.inputValue,expression:"inputValue",modifiers:{trim:!0}}],staticClass:"el-cascader__search-input",attrs:{type:"text",placeholder:e.presentTags.length?"":e.placeholder},domProps:{value:e.inputValue},on:{input:[function(t){t.target.composing||(e.inputValue=t.target.value.trim())},function(t){return e.handleInput(e.inputValue,t)}],click:function(t){t.stopPropagation(),e.toggleDropDownVisible(!0)},keydown:function(t){return!("button"in t)&&e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?null:e.handleDelete(t)},blur:function(t){e.$forceUpdate()}}}):e._e()],2):e._e(),n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.handleDropdownLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.dropDownVisible,expression:"dropDownVisible"}],ref:"popper",class:["el-popper","el-cascader__dropdown",e.popperClass]},[n("el-cascader-panel",{directives:[{name:"show",rawName:"v-show",value:!e.filtering,expression:"!filtering"}],ref:"panel",attrs:{options:e.options,props:e.config,border:!1,"render-label":e.$scopedSlots.default},on:{"expand-change":e.handleExpandChange,close:function(t){e.toggleDropDownVisible(!1)}},model:{value:e.checkedValue,callback:function(t){e.checkedValue=t},expression:"checkedValue"}}),e.filterable?n("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.filtering,expression:"filtering"}],ref:"suggestionPanel",staticClass:"el-cascader__suggestion-panel",attrs:{tag:"ul","view-class":"el-cascader__suggestion-list"},nativeOn:{keydown:function(t){return e.handleSuggestionKeyDown(t)}}},[e.suggestions.length?e._l(e.suggestions,(function(t,i){return n("li",{key:t.uid,class:["el-cascader__suggestion-item",t.checked&&"is-checked"],attrs:{tabindex:-1},on:{click:function(t){e.handleSuggestionClick(i)}}},[n("span",[e._v(e._s(t.text))]),t.checked?n("i",{staticClass:"el-icon-check"}):e._e()])})):e._t("empty",[n("li",{staticClass:"el-cascader__empty-text"},[e._v(e._s(e.t("el.cascader.noMatch")))])])],2):e._e()],1)])],1)},vf=[];gf._withStripped=!0;var bf=n(42),yf=n.n(bf),wf=n(28),xf=n.n(wf),_f=xf.a.keys,kf={expandTrigger:{newProp:"expandTrigger",type:String},changeOnSelect:{newProp:"checkStrictly",type:Boolean},hoverThreshold:{newProp:"hoverThreshold",type:Number}},Cf={props:{placement:{type:String,default:"bottom-start"},appendToBody:W.a.props.appendToBody,visibleArrow:{type:Boolean,default:!0},arrowOffset:W.a.props.arrowOffset,offset:W.a.props.offset,boundariesPadding:W.a.props.boundariesPadding,popperOptions:W.a.props.popperOptions},methods:W.a.methods,data:W.a.data,beforeDestroy:W.a.beforeDestroy},Sf={medium:36,small:32,mini:28},Of={name:"ElCascader",directives:{Clickoutside:B.a},mixins:[Cf,D.a,b.a,T.a],inject:{elForm:{default:""},elFormItem:{default:""}},components:{ElInput:g.a,ElTag:ei.a,ElScrollbar:U.a,ElCascaderPanel:yf.a},props:{value:{},options:Array,props:Object,size:String,placeholder:{type:String,default:function(){return Object(ni["t"])("el.cascader.placeholder")}},disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:Function,separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,debounce:{type:Number,default:300},beforeFilter:{type:Function,default:function(){return function(){}}},popperClass:String},data:function(){return{dropDownVisible:!1,checkedValue:this.value||null,inputHover:!1,inputValue:null,presentText:null,presentTags:[],checkedNodes:[],filtering:!1,suggestions:[],inputInitialHeight:0,pressDeleteCount:0}},computed:{realSize:function(){var e=(this.elFormItem||{}).elFormItemSize;return this.size||e||(this.$ELEMENT||{}).size},tagSize:function(){return["small","mini"].indexOf(this.realSize)>-1?"mini":"small"},isDisabled:function(){return this.disabled||(this.elForm||{}).disabled},config:function(){var e=this.props||{},t=this.$attrs;return Object.keys(kf).forEach((function(n){var i=kf[n],r=i.newProp,o=i.type,a=t[n]||t[Object(y["kebabCase"])(n)];Object(Tt["isDef"])(n)&&!Object(Tt["isDef"])(e[r])&&(o===Boolean&&""===a&&(a=!0),e[r]=a)})),e},multiple:function(){return this.config.multiple},leafOnly:function(){return!this.config.checkStrictly},readonly:function(){return!this.filterable||this.multiple},clearBtnVisible:function(){return!(!this.clearable||this.isDisabled||this.filtering||!this.inputHover)&&(this.multiple?!!this.checkedNodes.filter((function(e){return!e.isDisabled})).length:!!this.presentText)},panel:function(){return this.$refs.panel}},watch:{disabled:function(){this.computePresentContent()},value:function(e){Object(y["isEqual"])(e,this.checkedValue)||(this.checkedValue=e,this.computePresentContent())},checkedValue:function(e){var t=this.value,n=this.dropDownVisible,i=this.config,r=i.checkStrictly,o=i.multiple;Object(y["isEqual"])(e,t)&&!Object(fh["isUndefined"])(t)||(this.computePresentContent(),o||r||!n||this.toggleDropDownVisible(!1),this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",[e]))},options:{handler:function(){this.$nextTick(this.computePresentContent)},deep:!0},presentText:function(e){this.inputValue=e},presentTags:function(e,t){this.multiple&&(e.length||t.length)&&this.$nextTick(this.updateStyle)},filtering:function(e){this.$nextTick(this.updatePopper)}},mounted:function(){var e=this,t=this.$refs.input;t&&t.$el&&(this.inputInitialHeight=t.$el.offsetHeight||Sf[this.realSize]||40),Object(y["isEmpty"])(this.value)||this.computePresentContent(),this.filterHandler=j()(this.debounce,(function(){var t=e.inputValue;if(t){var n=e.beforeFilter(t);n&&n.then?n.then(e.getSuggestions):!1!==n?e.getSuggestions():e.filtering=!1}else e.filtering=!1})),Object(ti["addResizeListener"])(this.$el,this.updateStyle)},beforeDestroy:function(){Object(ti["removeResizeListener"])(this.$el,this.updateStyle)},methods:{getMigratingConfig:function(){return{props:{"expand-trigger":"expand-trigger is removed, use `props.expandTrigger` instead.","change-on-select":"change-on-select is removed, use `props.checkStrictly` instead.","hover-threshold":"hover-threshold is removed, use `props.hoverThreshold` instead"},events:{"active-item-change":"active-item-change is renamed to expand-change"}}},toggleDropDownVisible:function(e){var t=this;if(!this.isDisabled){var n=this.dropDownVisible,i=this.$refs.input;e=Object(Tt["isDef"])(e)?e:!n,e!==n&&(this.dropDownVisible=e,e&&this.$nextTick((function(){t.updatePopper(),t.panel.scrollIntoView()})),i.$refs.input.setAttribute("aria-expanded",e),this.$emit("visible-change",e))}},handleDropdownLeave:function(){this.filtering=!1,this.inputValue=this.presentText},handleKeyDown:function(e){switch(e.keyCode){case _f.enter:this.toggleDropDownVisible();break;case _f.down:this.toggleDropDownVisible(!0),this.focusFirstNode(),e.preventDefault();break;case _f.esc:case _f.tab:this.toggleDropDownVisible(!1);break}},handleFocus:function(e){this.$emit("focus",e)},handleBlur:function(e){this.$emit("blur",e)},handleInput:function(e,t){!this.dropDownVisible&&this.toggleDropDownVisible(!0),t&&t.isComposing||(e?this.filterHandler():this.filtering=!1)},handleClear:function(){this.presentText="",this.panel.clearCheckedNodes()},handleExpandChange:function(e){this.$nextTick(this.updatePopper.bind(this)),this.$emit("expand-change",e),this.$emit("active-item-change",e)},focusFirstNode:function(){var e=this;this.$nextTick((function(){var t=e.filtering,n=e.$refs,i=n.popper,r=n.suggestionPanel,o=null;if(t&&r)o=r.$el.querySelector(".el-cascader__suggestion-item");else{var a=i.querySelector(".el-cascader-menu");o=a.querySelector('.el-cascader-node[tabindex="-1"]')}o&&(o.focus(),!t&&o.click())}))},computePresentContent:function(){var e=this;this.$nextTick((function(){e.config.multiple?(e.computePresentTags(),e.presentText=e.presentTags.length?" ":null):e.computePresentText()}))},computePresentText:function(){var e=this.checkedValue,t=this.config;if(!Object(y["isEmpty"])(e)){var n=this.panel.getNodeByValue(e);if(n&&(t.checkStrictly||n.isLeaf))return void(this.presentText=n.getText(this.showAllLevels,this.separator))}this.presentText=null},computePresentTags:function(){var e=this.isDisabled,t=this.leafOnly,n=this.showAllLevels,i=this.separator,r=this.collapseTags,o=this.getCheckedNodes(t),a=[],s=function(t){return{node:t,key:t.uid,text:t.getText(n,i),hitState:!1,closable:!e&&!t.isDisabled}};if(o.length){var l=o[0],c=o.slice(1),u=c.length;a.push(s(l)),u&&(r?a.push({key:-1,text:"+ "+u,closable:!1}):c.forEach((function(e){return a.push(s(e))})))}this.checkedNodes=o,this.presentTags=a},getSuggestions:function(){var e=this,t=this.filterMethod;Object(fh["isFunction"])(t)||(t=function(e,t){return e.text.includes(t)});var n=this.panel.getFlattedNodes(this.leafOnly).filter((function(n){return!n.isDisabled&&(n.text=n.getText(e.showAllLevels,e.separator)||"",t(n,e.inputValue))}));this.multiple?this.presentTags.forEach((function(e){e.hitState=!1})):n.forEach((function(t){t.checked=Object(y["isEqual"])(e.checkedValue,t.getValueByOption())})),this.filtering=!0,this.suggestions=n,this.$nextTick(this.updatePopper)},handleSuggestionKeyDown:function(e){var t=e.keyCode,n=e.target;switch(t){case _f.enter:n.click();break;case _f.up:var i=n.previousElementSibling;i&&i.focus();break;case _f.down:var r=n.nextElementSibling;r&&r.focus();break;case _f.esc:case _f.tab:this.toggleDropDownVisible(!1);break}},handleDelete:function(){var e=this.inputValue,t=this.pressDeleteCount,n=this.presentTags,i=n.length-1,r=n[i];this.pressDeleteCount=e?0:t+1,r&&this.pressDeleteCount&&(r.hitState?this.deleteTag(i):r.hitState=!0)},handleSuggestionClick:function(e){var t=this.multiple,n=this.suggestions[e];if(t){var i=n.checked;n.doCheck(!i),this.panel.calculateMultiCheckedValue()}else this.checkedValue=n.getValueByOption(),this.toggleDropDownVisible(!1)},deleteTag:function(e){var t=this.checkedValue,n=t[e];this.checkedValue=t.filter((function(t,n){return n!==e})),this.$emit("remove-tag",n)},updateStyle:function(){var e=this.$el,t=this.inputInitialHeight;if(!this.$isServer&&e){var n=this.$refs.suggestionPanel,i=e.querySelector(".el-input__inner");if(i){var r=e.querySelector(".el-cascader__tags"),o=null;if(n&&(o=n.$el)){var a=o.querySelector(".el-cascader__suggestion-list");a.style.minWidth=i.offsetWidth+"px"}if(r){var s=r.offsetHeight,l=Math.max(s+6,t)+"px";i.style.height=l,this.updatePopper()}}}},getCheckedNodes:function(e){return this.panel.getCheckedNodes(e)}}},Tf=Of,Ef=l(Tf,gf,vf,!1,null,null,null);Ef.options.__file="packages/cascader/src/cascader.vue";var Df=Ef.exports;Df.install=function(e){e.component(Df.name,Df)};var Mf=Df,Af=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.hide,expression:"hide"}],class:["el-color-picker",e.colorDisabled?"is-disabled":"",e.colorSize?"el-color-picker--"+e.colorSize:""]},[e.colorDisabled?n("div",{staticClass:"el-color-picker__mask"}):e._e(),n("div",{staticClass:"el-color-picker__trigger",on:{click:e.handleTrigger}},[n("span",{staticClass:"el-color-picker__color",class:{"is-alpha":e.showAlpha}},[n("span",{staticClass:"el-color-picker__color-inner",style:{backgroundColor:e.displayedColor}}),e.value||e.showPanelColor?e._e():n("span",{staticClass:"el-color-picker__empty el-icon-close"})]),n("span",{directives:[{name:"show",rawName:"v-show",value:e.value||e.showPanelColor,expression:"value || showPanelColor"}],staticClass:"el-color-picker__icon el-icon-arrow-down"})]),n("picker-dropdown",{ref:"dropdown",class:["el-color-picker__panel",e.popperClass||""],attrs:{color:e.color,"show-alpha":e.showAlpha,predefine:e.predefine},on:{pick:e.confirmValue,clear:e.clearValue},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}})],1)},Nf=[];Af._withStripped=!0;var If="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)};function Lf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Pf=function(e,t,n){return[e,t*n/((e=(2-t)*n)<1?e:2-e)||0,e/2]},$f=function(e){return"string"===typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)},Ff=function(e){return"string"===typeof e&&-1!==e.indexOf("%")},jf=function(e,t){$f(e)&&(e="100%");var n=Ff(e);return e=Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)},zf={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Bf=function(e){var t=e.r,n=e.g,i=e.b,r=function(e){e=Math.min(Math.round(e),255);var t=Math.floor(e/16),n=e%16;return""+(zf[t]||t)+(zf[n]||n)};return isNaN(t)||isNaN(n)||isNaN(i)?"":"#"+r(t)+r(n)+r(i)},Rf={A:10,B:11,C:12,D:13,E:14,F:15},Vf=function(e){return 2===e.length?16*(Rf[e[0].toUpperCase()]||+e[0])+(Rf[e[1].toUpperCase()]||+e[1]):Rf[e[1].toUpperCase()]||+e[1]},Hf=function(e,t,n){t/=100,n/=100;var i=t,r=Math.max(n,.01),o=void 0,a=void 0;return n*=2,t*=n<=1?n:2-n,i*=r<=1?r:2-r,a=(n+t)/2,o=0===n?2*i/(r+i):2*t/(n+t),{h:e,s:100*o,v:100*a}},Wf=function(e,t,n){e=jf(e,255),t=jf(t,255),n=jf(n,255);var i=Math.max(e,t,n),r=Math.min(e,t,n),o=void 0,a=void 0,s=i,l=i-r;if(a=0===i?0:l/i,i===r)o=0;else{switch(i){case e:o=(t-n)/l+(t2?parseFloat(e):parseInt(e,10)}));if(4===i.length?this._alpha=Math.floor(100*parseFloat(i[3])):3===i.length&&(this._alpha=100),i.length>=3){var r=Hf(i[0],i[1],i[2]),o=r.h,a=r.s,s=r.v;n(o,a,s)}}else if(-1!==e.indexOf("hsv")){var l=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter((function(e){return""!==e})).map((function(e,t){return t>2?parseFloat(e):parseInt(e,10)}));4===l.length?this._alpha=Math.floor(100*parseFloat(l[3])):3===l.length&&(this._alpha=100),l.length>=3&&n(l[0],l[1],l[2])}else if(-1!==e.indexOf("rgb")){var c=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter((function(e){return""!==e})).map((function(e,t){return t>2?parseFloat(e):parseInt(e,10)}));if(4===c.length?this._alpha=Math.floor(100*parseFloat(c[3])):3===c.length&&(this._alpha=100),c.length>=3){var u=Wf(c[0],c[1],c[2]),d=u.h,h=u.s,f=u.v;n(d,h,f)}}else if(-1!==e.indexOf("#")){var p=e.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(p))return;var m=void 0,g=void 0,v=void 0;3===p.length?(m=Vf(p[0]+p[0]),g=Vf(p[1]+p[1]),v=Vf(p[2]+p[2])):6!==p.length&&8!==p.length||(m=Vf(p.substring(0,2)),g=Vf(p.substring(2,4)),v=Vf(p.substring(4,6))),8===p.length?this._alpha=Math.floor(Vf(p.substring(6))/255*100):3!==p.length&&6!==p.length||(this._alpha=100);var b=Wf(m,g,v),y=b.h,w=b.s,x=b.v;n(y,w,x)}},e.prototype.compare=function(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1},e.prototype.doOnChange=function(){var e=this._hue,t=this._saturation,n=this._value,i=this._alpha,r=this.format;if(this.enableAlpha)switch(r){case"hsl":var o=Pf(e,t/100,n/100);this.value="hsla("+e+", "+Math.round(100*o[1])+"%, "+Math.round(100*o[2])+"%, "+i/100+")";break;case"hsv":this.value="hsva("+e+", "+Math.round(t)+"%, "+Math.round(n)+"%, "+i/100+")";break;default:var a=qf(e,t,n),s=a.r,l=a.g,c=a.b;this.value="rgba("+s+", "+l+", "+c+", "+i/100+")"}else switch(r){case"hsl":var u=Pf(e,t/100,n/100);this.value="hsl("+e+", "+Math.round(100*u[1])+"%, "+Math.round(100*u[2])+"%)";break;case"hsv":this.value="hsv("+e+", "+Math.round(t)+"%, "+Math.round(n)+"%)";break;case"rgb":var d=qf(e,t,n),h=d.r,f=d.g,p=d.b;this.value="rgb("+h+", "+f+", "+p+")";break;default:this.value=Bf(qf(e,t,n))}},e}(),Kf=Uf,Gf=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-color-dropdown"},[n("div",{staticClass:"el-color-dropdown__main-wrapper"},[n("hue-slider",{ref:"hue",staticStyle:{float:"right"},attrs:{color:e.color,vertical:""}}),n("sv-panel",{ref:"sl",attrs:{color:e.color}})],1),e.showAlpha?n("alpha-slider",{ref:"alpha",attrs:{color:e.color}}):e._e(),e.predefine?n("predefine",{attrs:{color:e.color,colors:e.predefine}}):e._e(),n("div",{staticClass:"el-color-dropdown__btns"},[n("span",{staticClass:"el-color-dropdown__value"},[n("el-input",{attrs:{"validate-event":!1,size:"mini"},on:{blur:e.handleConfirm},nativeOn:{keyup:function(t){return!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleConfirm(t)}},model:{value:e.customInput,callback:function(t){e.customInput=t},expression:"customInput"}})],1),n("el-button",{staticClass:"el-color-dropdown__link-btn",attrs:{size:"mini",type:"text"},on:{click:function(t){e.$emit("clear")}}},[e._v("\n "+e._s(e.t("el.colorpicker.clear"))+"\n ")]),n("el-button",{staticClass:"el-color-dropdown__btn",attrs:{plain:"",size:"mini"},on:{click:e.confirmValue}},[e._v("\n "+e._s(e.t("el.colorpicker.confirm"))+"\n ")])],1)],1)])},Yf=[];Gf._withStripped=!0;var Xf=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-color-svpanel",style:{backgroundColor:e.background}},[n("div",{staticClass:"el-color-svpanel__white"}),n("div",{staticClass:"el-color-svpanel__black"}),n("div",{staticClass:"el-color-svpanel__cursor",style:{top:e.cursorTop+"px",left:e.cursorLeft+"px"}},[n("div")])])},Zf=[];Xf._withStripped=!0;var Qf=!1,Jf=function(e,t){if(!qi.a.prototype.$isServer){var n=function(e){t.drag&&t.drag(e)},i=function e(i){document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,Qf=!1,t.end&&t.end(i)};e.addEventListener("mousedown",(function(e){Qf||(document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},document.addEventListener("mousemove",n),document.addEventListener("mouseup",i),Qf=!0,t.start&&t.start(e))}))}},ep={name:"el-sl-panel",props:{color:{required:!0}},computed:{colorValue:function(){var e=this.color.get("hue"),t=this.color.get("value");return{hue:e,value:t}}},watch:{colorValue:function(){this.update()}},methods:{update:function(){var e=this.color.get("saturation"),t=this.color.get("value"),n=this.$el,i=n.clientWidth,r=n.clientHeight;this.cursorLeft=e*i/100,this.cursorTop=(100-t)*r/100,this.background="hsl("+this.color.get("hue")+", 100%, 50%)"},handleDrag:function(e){var t=this.$el,n=t.getBoundingClientRect(),i=e.clientX-n.left,r=e.clientY-n.top;i=Math.max(0,i),i=Math.min(i,n.width),r=Math.max(0,r),r=Math.min(r,n.height),this.cursorLeft=i,this.cursorTop=r,this.color.set({saturation:i/n.width*100,value:100-r/n.height*100})}},mounted:function(){var e=this;Jf(this.$el,{drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}}),this.update()},data:function(){return{cursorTop:0,cursorLeft:0,background:"hsl(0, 100%, 50%)"}}},tp=ep,np=l(tp,Xf,Zf,!1,null,null,null);np.options.__file="packages/color-picker/src/components/sv-panel.vue";var ip=np.exports,rp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-color-hue-slider",class:{"is-vertical":e.vertical}},[n("div",{ref:"bar",staticClass:"el-color-hue-slider__bar",on:{click:e.handleClick}}),n("div",{ref:"thumb",staticClass:"el-color-hue-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},op=[];rp._withStripped=!0;var ap={name:"el-color-hue-slider",props:{color:{required:!0},vertical:Boolean},data:function(){return{thumbLeft:0,thumbTop:0}},computed:{hueValue:function(){var e=this.color.get("hue");return e}},watch:{hueValue:function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,n=e.target;n!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),n=this.$refs.thumb,i=void 0;if(this.vertical){var r=e.clientY-t.top;r=Math.min(r,t.height-n.offsetHeight/2),r=Math.max(n.offsetHeight/2,r),i=Math.round((r-n.offsetHeight/2)/(t.height-n.offsetHeight)*360)}else{var o=e.clientX-t.left;o=Math.min(o,t.width-n.offsetWidth/2),o=Math.max(n.offsetWidth/2,o),i=Math.round((o-n.offsetWidth/2)/(t.width-n.offsetWidth)*360)}this.color.set("hue",i)},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var n=this.$refs.thumb;return Math.round(t*(e.offsetWidth-n.offsetWidth/2)/360)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var n=this.$refs.thumb;return Math.round(t*(e.offsetHeight-n.offsetHeight/2)/360)},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop()}},mounted:function(){var e=this,t=this.$refs,n=t.bar,i=t.thumb,r={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};Jf(n,r),Jf(i,r),this.update()}},sp=ap,lp=l(sp,rp,op,!1,null,null,null);lp.options.__file="packages/color-picker/src/components/hue-slider.vue";var cp=lp.exports,up=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-color-alpha-slider",class:{"is-vertical":e.vertical}},[n("div",{ref:"bar",staticClass:"el-color-alpha-slider__bar",style:{background:e.background},on:{click:e.handleClick}}),n("div",{ref:"thumb",staticClass:"el-color-alpha-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},dp=[];up._withStripped=!0;var hp={name:"el-color-alpha-slider",props:{color:{required:!0},vertical:Boolean},watch:{"color._alpha":function(){this.update()},"color.value":function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,n=e.target;n!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),n=this.$refs.thumb;if(this.vertical){var i=e.clientY-t.top;i=Math.max(n.offsetHeight/2,i),i=Math.min(i,t.height-n.offsetHeight/2),this.color.set("alpha",Math.round((i-n.offsetHeight/2)/(t.height-n.offsetHeight)*100))}else{var r=e.clientX-t.left;r=Math.max(n.offsetWidth/2,r),r=Math.min(r,t.width-n.offsetWidth/2),this.color.set("alpha",Math.round((r-n.offsetWidth/2)/(t.width-n.offsetWidth)*100))}},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var n=this.$refs.thumb;return Math.round(t*(e.offsetWidth-n.offsetWidth/2)/100)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var n=this.$refs.thumb;return Math.round(t*(e.offsetHeight-n.offsetHeight/2)/100)},getBackground:function(){if(this.color&&this.color.value){var e=this.color.toRgb(),t=e.r,n=e.g,i=e.b;return"linear-gradient(to right, rgba("+t+", "+n+", "+i+", 0) 0%, rgba("+t+", "+n+", "+i+", 1) 100%)"}return null},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop(),this.background=this.getBackground()}},data:function(){return{thumbLeft:0,thumbTop:0,background:null}},mounted:function(){var e=this,t=this.$refs,n=t.bar,i=t.thumb,r={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};Jf(n,r),Jf(i,r),this.update()}},fp=hp,pp=l(fp,up,dp,!1,null,null,null);pp.options.__file="packages/color-picker/src/components/alpha-slider.vue";var mp=pp.exports,gp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-color-predefine"},[n("div",{staticClass:"el-color-predefine__colors"},e._l(e.rgbaColors,(function(t,i){return n("div",{key:e.colors[i],staticClass:"el-color-predefine__color-selector",class:{selected:t.selected,"is-alpha":t._alpha<100},on:{click:function(t){e.handleSelect(i)}}},[n("div",{style:{"background-color":t.value}})])})),0)])},vp=[];gp._withStripped=!0;var bp={props:{colors:{type:Array,required:!0},color:{required:!0}},data:function(){return{rgbaColors:this.parseColors(this.colors,this.color)}},methods:{handleSelect:function(e){this.color.fromString(this.colors[e])},parseColors:function(e,t){return e.map((function(e){var n=new Kf;return n.enableAlpha=!0,n.format="rgba",n.fromString(e),n.selected=n.value===t.value,n}))}},watch:{"$parent.currentColor":function(e){var t=new Kf;t.fromString(e),this.rgbaColors.forEach((function(e){e.selected=t.compare(e)}))},colors:function(e){this.rgbaColors=this.parseColors(e,this.color)},color:function(e){this.rgbaColors=this.parseColors(this.colors,e)}}},yp=bp,wp=l(yp,gp,vp,!1,null,null,null);wp.options.__file="packages/color-picker/src/components/predefine.vue";var xp=wp.exports,_p={name:"el-color-picker-dropdown",mixins:[W.a,b.a],components:{SvPanel:ip,HueSlider:cp,AlphaSlider:mp,ElInput:g.a,ElButton:se.a,Predefine:xp},props:{color:{required:!0},showAlpha:Boolean,predefine:Array},data:function(){return{customInput:""}},computed:{currentColor:function(){var e=this.$parent;return e.value||e.showPanelColor?e.color.value:""}},methods:{confirmValue:function(){this.$emit("pick")},handleConfirm:function(){this.color.fromString(this.customInput)}},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$el},watch:{showPopper:function(e){var t=this;!0===e&&this.$nextTick((function(){var e=t.$refs,n=e.sl,i=e.hue,r=e.alpha;n&&n.update(),i&&i.update(),r&&r.update()}))},currentColor:{immediate:!0,handler:function(e){this.customInput=e}}}},kp=_p,Cp=l(kp,Gf,Yf,!1,null,null,null);Cp.options.__file="packages/color-picker/src/components/picker-dropdown.vue";var Sp=Cp.exports,Op={name:"ElColorPicker",mixins:[D.a],props:{value:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:String,popperClass:String,predefine:Array},inject:{elForm:{default:""},elFormItem:{default:""}},directives:{Clickoutside:B.a},computed:{displayedColor:function(){return this.value||this.showPanelColor?this.displayedRgb(this.color,this.showAlpha):"transparent"},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},colorSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},colorDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:function(e){e?e&&e!==this.color.value&&this.color.fromString(e):this.showPanelColor=!1},color:{deep:!0,handler:function(){this.showPanelColor=!0}},displayedColor:function(e){if(this.showPicker){var t=new Kf({enableAlpha:this.showAlpha,format:this.colorFormat});t.fromString(this.value);var n=this.displayedRgb(t,this.showAlpha);e!==n&&this.$emit("active-change",e)}}},methods:{handleTrigger:function(){this.colorDisabled||(this.showPicker=!this.showPicker)},confirmValue:function(){var e=this.color.value;this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",e),this.showPicker=!1},clearValue:function(){this.$emit("input",null),this.$emit("change",null),null!==this.value&&this.dispatch("ElFormItem","el.form.change",null),this.showPanelColor=!1,this.showPicker=!1,this.resetColor()},hide:function(){this.showPicker=!1,this.resetColor()},resetColor:function(){var e=this;this.$nextTick((function(t){e.value?e.color.fromString(e.value):e.showPanelColor=!1}))},displayedRgb:function(e,t){if(!(e instanceof Kf))throw Error("color should be instance of Color Class");var n=e.toRgb(),i=n.r,r=n.g,o=n.b;return t?"rgba("+i+", "+r+", "+o+", "+e.get("alpha")/100+")":"rgb("+i+", "+r+", "+o+")"}},mounted:function(){var e=this.value;e&&this.color.fromString(e),this.popperElm=this.$refs.dropdown.$el},data:function(){var e=new Kf({enableAlpha:this.showAlpha,format:this.colorFormat});return{color:e,showPicker:!1,showPanelColor:!1}},components:{PickerDropdown:Sp}},Tp=Op,Ep=l(Tp,Af,Nf,!1,null,null,null);Ep.options.__file="packages/color-picker/src/main.vue";var Dp=Ep.exports;Dp.install=function(e){e.component(Dp.name,Dp)};var Mp=Dp,Ap=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-transfer"},[n("transfer-panel",e._b({ref:"leftPanel",attrs:{data:e.sourceData,title:e.titles[0]||e.t("el.transfer.titles.0"),"default-checked":e.leftDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onSourceCheckedChange}},"transfer-panel",e.$props,!1),[e._t("left-footer")],2),n("div",{staticClass:"el-transfer__buttons"},[n("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.rightChecked.length},nativeOn:{click:function(t){return e.addToLeft(t)}}},[n("i",{staticClass:"el-icon-arrow-left"}),void 0!==e.buttonTexts[0]?n("span",[e._v(e._s(e.buttonTexts[0]))]):e._e()]),n("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.leftChecked.length},nativeOn:{click:function(t){return e.addToRight(t)}}},[void 0!==e.buttonTexts[1]?n("span",[e._v(e._s(e.buttonTexts[1]))]):e._e(),n("i",{staticClass:"el-icon-arrow-right"})])],1),n("transfer-panel",e._b({ref:"rightPanel",attrs:{data:e.targetData,title:e.titles[1]||e.t("el.transfer.titles.1"),"default-checked":e.rightDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onTargetCheckedChange}},"transfer-panel",e.$props,!1),[e._t("right-footer")],2)],1)},Np=[];Ap._withStripped=!0;var Ip=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-transfer-panel"},[n("p",{staticClass:"el-transfer-panel__header"},[n("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleAllCheckedChange},model:{value:e.allChecked,callback:function(t){e.allChecked=t},expression:"allChecked"}},[e._v("\n "+e._s(e.title)+"\n "),n("span",[e._v(e._s(e.checkedSummary))])])],1),n("div",{class:["el-transfer-panel__body",e.hasFooter?"is-with-footer":""]},[e.filterable?n("el-input",{staticClass:"el-transfer-panel__filter",attrs:{size:"small",placeholder:e.placeholder},nativeOn:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1}},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}},[n("i",{class:["el-input__icon","el-icon-"+e.inputIcon],attrs:{slot:"prefix"},on:{click:e.clearQuery},slot:"prefix"})]):e._e(),n("el-checkbox-group",{directives:[{name:"show",rawName:"v-show",value:!e.hasNoMatch&&e.data.length>0,expression:"!hasNoMatch && data.length > 0"}],staticClass:"el-transfer-panel__list",class:{"is-filterable":e.filterable},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},e._l(e.filteredData,(function(t){return n("el-checkbox",{key:t[e.keyProp],staticClass:"el-transfer-panel__item",attrs:{label:t[e.keyProp],disabled:t[e.disabledProp]}},[n("option-content",{attrs:{option:t}})],1)})),1),n("p",{directives:[{name:"show",rawName:"v-show",value:e.hasNoMatch,expression:"hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noMatch")))]),n("p",{directives:[{name:"show",rawName:"v-show",value:0===e.data.length&&!e.hasNoMatch,expression:"data.length === 0 && !hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noData")))])],1),e.hasFooter?n("p",{staticClass:"el-transfer-panel__footer"},[e._t("default")],2):e._e()])},Lp=[];Ip._withStripped=!0;var Pp={mixins:[b.a],name:"ElTransferPanel",componentName:"ElTransferPanel",components:{ElCheckboxGroup:Ir.a,ElCheckbox:Fi.a,ElInput:g.a,OptionContent:{props:{option:Object},render:function(e){var t=function e(t){return"ElTransferPanel"===t.$options.componentName?t:t.$parent?e(t.$parent):t},n=t(this),i=n.$parent||n;return n.renderContent?n.renderContent(e,this.option):i.$scopedSlots.default?i.$scopedSlots.default({option:this.option}):e("span",[this.option[n.labelProp]||this.option[n.keyProp]])}}},props:{data:{type:Array,default:function(){return[]}},renderContent:Function,placeholder:String,title:String,filterable:Boolean,format:Object,filterMethod:Function,defaultChecked:Array,props:Object},data:function(){return{checked:[],allChecked:!1,query:"",inputHover:!1,checkChangeByUser:!0}},watch:{checked:function(e,t){if(this.updateAllChecked(),this.checkChangeByUser){var n=e.concat(t).filter((function(n){return-1===e.indexOf(n)||-1===t.indexOf(n)}));this.$emit("checked-change",e,n)}else this.$emit("checked-change",e),this.checkChangeByUser=!0},data:function(){var e=this,t=[],n=this.filteredData.map((function(t){return t[e.keyProp]}));this.checked.forEach((function(e){n.indexOf(e)>-1&&t.push(e)})),this.checkChangeByUser=!1,this.checked=t},checkableData:function(){this.updateAllChecked()},defaultChecked:{immediate:!0,handler:function(e,t){var n=this;if(!t||e.length!==t.length||!e.every((function(e){return t.indexOf(e)>-1}))){var i=[],r=this.checkableData.map((function(e){return e[n.keyProp]}));e.forEach((function(e){r.indexOf(e)>-1&&i.push(e)})),this.checkChangeByUser=!1,this.checked=i}}}},computed:{filteredData:function(){var e=this;return this.data.filter((function(t){if("function"===typeof e.filterMethod)return e.filterMethod(e.query,t);var n=t[e.labelProp]||t[e.keyProp].toString();return n.toLowerCase().indexOf(e.query.toLowerCase())>-1}))},checkableData:function(){var e=this;return this.filteredData.filter((function(t){return!t[e.disabledProp]}))},checkedSummary:function(){var e=this.checked.length,t=this.data.length,n=this.format,i=n.noChecked,r=n.hasChecked;return i&&r?e>0?r.replace(/\${checked}/g,e).replace(/\${total}/g,t):i.replace(/\${total}/g,t):e+"/"+t},isIndeterminate:function(){var e=this.checked.length;return e>0&&e0&&0===this.filteredData.length},inputIcon:function(){return this.query.length>0&&this.inputHover?"circle-close":"search"},labelProp:function(){return this.props.label||"label"},keyProp:function(){return this.props.key||"key"},disabledProp:function(){return this.props.disabled||"disabled"},hasFooter:function(){return!!this.$slots.default}},methods:{updateAllChecked:function(){var e=this,t=this.checkableData.map((function(t){return t[e.keyProp]}));this.allChecked=t.length>0&&t.every((function(t){return e.checked.indexOf(t)>-1}))},handleAllCheckedChange:function(e){var t=this;this.checked=e?this.checkableData.map((function(e){return e[t.keyProp]})):[]},clearQuery:function(){"circle-close"===this.inputIcon&&(this.query="")}}},$p=Pp,Fp=l($p,Ip,Lp,!1,null,null,null);Fp.options.__file="packages/transfer/src/transfer-panel.vue";var jp=Fp.exports,zp={name:"ElTransfer",mixins:[D.a,b.a,T.a],components:{TransferPanel:jp,ElButton:se.a},props:{data:{type:Array,default:function(){return[]}},titles:{type:Array,default:function(){return[]}},buttonTexts:{type:Array,default:function(){return[]}},filterPlaceholder:{type:String,default:""},filterMethod:Function,leftDefaultChecked:{type:Array,default:function(){return[]}},rightDefaultChecked:{type:Array,default:function(){return[]}},renderContent:Function,value:{type:Array,default:function(){return[]}},format:{type:Object,default:function(){return{}}},filterable:Boolean,props:{type:Object,default:function(){return{label:"label",key:"key",disabled:"disabled"}}},targetOrder:{type:String,default:"original"}},data:function(){return{leftChecked:[],rightChecked:[]}},computed:{dataObj:function(){var e=this.props.key;return this.data.reduce((function(t,n){return(t[n[e]]=n)&&t}),{})},sourceData:function(){var e=this;return this.data.filter((function(t){return-1===e.value.indexOf(t[e.props.key])}))},targetData:function(){var e=this;return"original"===this.targetOrder?this.data.filter((function(t){return e.value.indexOf(t[e.props.key])>-1})):this.value.reduce((function(t,n){var i=e.dataObj[n];return i&&t.push(i),t}),[])},hasButtonTexts:function(){return 2===this.buttonTexts.length}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}},methods:{getMigratingConfig:function(){return{props:{"footer-format":"footer-format is renamed to format."}}},onSourceCheckedChange:function(e,t){this.leftChecked=e,void 0!==t&&this.$emit("left-check-change",e,t)},onTargetCheckedChange:function(e,t){this.rightChecked=e,void 0!==t&&this.$emit("right-check-change",e,t)},addToLeft:function(){var e=this.value.slice();this.rightChecked.forEach((function(t){var n=e.indexOf(t);n>-1&&e.splice(n,1)})),this.$emit("input",e),this.$emit("change",e,"left",this.rightChecked)},addToRight:function(){var e=this,t=this.value.slice(),n=[],i=this.props.key;this.data.forEach((function(t){var r=t[i];e.leftChecked.indexOf(r)>-1&&-1===e.value.indexOf(r)&&n.push(r)})),t="unshift"===this.targetOrder?n.concat(t):t.concat(n),this.$emit("input",t),this.$emit("change",t,"right",this.leftChecked)},clearQuery:function(e){"left"===e?this.$refs.leftPanel.query="":"right"===e&&(this.$refs.rightPanel.query="")}}},Bp=zp,Rp=l(Bp,Ap,Np,!1,null,null,null);Rp.options.__file="packages/transfer/src/main.vue";var Vp=Rp.exports;Vp.install=function(e){e.component(Vp.name,Vp)};var Hp=Vp,Wp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"el-container",class:{"is-vertical":e.isVertical}},[e._t("default")],2)},qp=[];Wp._withStripped=!0;var Up={name:"ElContainer",componentName:"ElContainer",props:{direction:String},computed:{isVertical:function(){return"vertical"===this.direction||"horizontal"!==this.direction&&!(!this.$slots||!this.$slots.default)&&this.$slots.default.some((function(e){var t=e.componentOptions&&e.componentOptions.tag;return"el-header"===t||"el-footer"===t}))}}},Kp=Up,Gp=l(Kp,Wp,qp,!1,null,null,null);Gp.options.__file="packages/container/src/main.vue";var Yp=Gp.exports;Yp.install=function(e){e.component(Yp.name,Yp)};var Xp=Yp,Zp=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("header",{staticClass:"el-header",style:{height:e.height}},[e._t("default")],2)},Qp=[];Zp._withStripped=!0;var Jp={name:"ElHeader",componentName:"ElHeader",props:{height:{type:String,default:"60px"}}},em=Jp,tm=l(em,Zp,Qp,!1,null,null,null);tm.options.__file="packages/header/src/main.vue";var nm=tm.exports;nm.install=function(e){e.component(nm.name,nm)};var im=nm,rm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("aside",{staticClass:"el-aside",style:{width:e.width}},[e._t("default")],2)},om=[];rm._withStripped=!0;var am={name:"ElAside",componentName:"ElAside",props:{width:{type:String,default:"300px"}}},sm=am,lm=l(sm,rm,om,!1,null,null,null);lm.options.__file="packages/aside/src/main.vue";var cm=lm.exports;cm.install=function(e){e.component(cm.name,cm)};var um=cm,dm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("main",{staticClass:"el-main"},[e._t("default")],2)},hm=[];dm._withStripped=!0;var fm={name:"ElMain",componentName:"ElMain"},pm=fm,mm=l(pm,dm,hm,!1,null,null,null);mm.options.__file="packages/main/src/main.vue";var gm=mm.exports;gm.install=function(e){e.component(gm.name,gm)};var vm=gm,bm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("footer",{staticClass:"el-footer",style:{height:e.height}},[e._t("default")],2)},ym=[];bm._withStripped=!0;var wm={name:"ElFooter",componentName:"ElFooter",props:{height:{type:String,default:"60px"}}},xm=wm,_m=l(xm,bm,ym,!1,null,null,null);_m.options.__file="packages/footer/src/main.vue";var km=_m.exports;km.install=function(e){e.component(km.name,km)};var Cm,Sm,Om=km,Tm={name:"ElTimeline",props:{reverse:{type:Boolean,default:!1}},provide:function(){return{timeline:this}},render:function(){var e=arguments[0],t=this.reverse,n={"el-timeline":!0,"is-reverse":t},i=this.$slots.default||[];return t&&(i=i.reverse()),e("ul",{class:n},[i])}},Em=Tm,Dm=l(Em,Cm,Sm,!1,null,null,null);Dm.options.__file="packages/timeline/src/main.vue";var Mm=Dm.exports;Mm.install=function(e){e.component(Mm.name,Mm)};var Am=Mm,Nm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("li",{staticClass:"el-timeline-item"},[n("div",{staticClass:"el-timeline-item__tail"}),e.$slots.dot?e._e():n("div",{staticClass:"el-timeline-item__node",class:["el-timeline-item__node--"+(e.size||""),"el-timeline-item__node--"+(e.type||"")],style:{backgroundColor:e.color}},[e.icon?n("i",{staticClass:"el-timeline-item__icon",class:e.icon}):e._e()]),e.$slots.dot?n("div",{staticClass:"el-timeline-item__dot"},[e._t("dot")],2):e._e(),n("div",{staticClass:"el-timeline-item__wrapper"},[e.hideTimestamp||"top"!==e.placement?e._e():n("div",{staticClass:"el-timeline-item__timestamp is-top"},[e._v("\n "+e._s(e.timestamp)+"\n ")]),n("div",{staticClass:"el-timeline-item__content"},[e._t("default")],2),e.hideTimestamp||"bottom"!==e.placement?e._e():n("div",{staticClass:"el-timeline-item__timestamp is-bottom"},[e._v("\n "+e._s(e.timestamp)+"\n ")])])])},Im=[];Nm._withStripped=!0;var Lm={name:"ElTimelineItem",inject:["timeline"],props:{timestamp:String,hideTimestamp:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},type:String,color:String,size:{type:String,default:"normal"},icon:String}},Pm=Lm,$m=l(Pm,Nm,Im,!1,null,null,null);$m.options.__file="packages/timeline/src/item.vue";var Fm=$m.exports;Fm.install=function(e){e.component(Fm.name,Fm)};var jm=Fm,zm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("a",e._b({class:["el-link",e.type?"el-link--"+e.type:"",e.disabled&&"is-disabled",e.underline&&!e.disabled&&"is-underline"],attrs:{href:e.disabled?null:e.href},on:{click:e.handleClick}},"a",e.$attrs,!1),[e.icon?n("i",{class:e.icon}):e._e(),e.$slots.default?n("span",{staticClass:"el-link--inner"},[e._t("default")],2):e._e(),e.$slots.icon?[e.$slots.icon?e._t("icon"):e._e()]:e._e()],2)},Bm=[];zm._withStripped=!0;var Rm={name:"ElLink",props:{type:{type:String,default:"default"},underline:{type:Boolean,default:!0},disabled:Boolean,href:String,icon:String},methods:{handleClick:function(e){this.disabled||this.href||this.$emit("click",e)}}},Vm=Rm,Hm=l(Vm,zm,Bm,!1,null,null,null);Hm.options.__file="packages/link/src/main.vue";var Wm=Hm.exports;Wm.install=function(e){e.component(Wm.name,Wm)};var qm=Wm,Um=function(e,t){var n=t._c;return n("div",t._g(t._b({class:[t.data.staticClass,"el-divider","el-divider--"+t.props.direction]},"div",t.data.attrs,!1),t.listeners),[t.slots().default&&"vertical"!==t.props.direction?n("div",{class:["el-divider__text","is-"+t.props.contentPosition]},[t._t("default")],2):t._e()])},Km=[];Um._withStripped=!0;var Gm={name:"ElDivider",props:{direction:{type:String,default:"horizontal",validator:function(e){return-1!==["horizontal","vertical"].indexOf(e)}},contentPosition:{type:String,default:"center",validator:function(e){return-1!==["left","center","right"].indexOf(e)}}}},Ym=Gm,Xm=l(Ym,Um,Km,!0,null,null,null);Xm.options.__file="packages/divider/src/main.vue";var Zm=Xm.exports;Zm.install=function(e){e.component(Zm.name,Zm)};var Qm=Zm,Jm=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-image"},[e.loading?e._t("placeholder",[n("div",{staticClass:"el-image__placeholder"})]):e.error?e._t("error",[n("div",{staticClass:"el-image__error"},[e._v(e._s(e.t("el.image.error")))])]):n("img",e._g(e._b({staticClass:"el-image__inner",class:{"el-image__inner--center":e.alignCenter,"el-image__preview":e.preview},style:e.imageStyle,attrs:{src:e.src},on:{click:e.clickHandler}},"img",e.$attrs,!1),e.$listeners)),e.preview?[e.showViewer?n("image-viewer",{attrs:{"z-index":e.zIndex,"initial-index":e.imageIndex,"on-close":e.closeViewer,"url-list":e.previewSrcList}}):e._e()]:e._e()],2)},eg=[];Jm._withStripped=!0;var tg=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"viewer-fade"}},[n("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.zIndex},attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-image-viewer__mask"}),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:e.hide}},[n("i",{staticClass:"el-icon-circle-close"})]),e.isSingle?e._e():[n("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[n("i",{staticClass:"el-icon-arrow-left"})]),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[n("i",{staticClass:"el-icon-arrow-right"})])],n("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[n("div",{staticClass:"el-image-viewer__actions__inner"},[n("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){e.handleActions("zoomOut")}}}),n("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){e.handleActions("zoomIn")}}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{class:e.mode.icon,on:{click:e.toggleMode}}),n("i",{staticClass:"el-image-viewer__actions__divider"}),n("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){e.handleActions("anticlocelise")}}}),n("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){e.handleActions("clocelise")}}})])]),n("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(t,i){return i===e.index?n("img",{key:t,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},ng=[];tg._withStripped=!0;var ig=Object.assign||function(e){for(var t=1;t0?e.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):e.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})})),Object(ze["on"])(document,"keydown",this._keyDownHandler),Object(ze["on"])(document,og,this._mouseWheelHandler)},deviceSupportUninstall:function(){Object(ze["off"])(document,"keydown",this._keyDownHandler),Object(ze["off"])(document,og,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad:function(e){this.loading=!1},handleImgError:function(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown:function(e){var t=this;if(!this.loading&&0===e.button){var n=this.transform,i=n.offsetX,r=n.offsetY,o=e.pageX,a=e.pageY;this._dragHandler=Object(y["rafThrottle"])((function(e){t.transform.offsetX=i+e.pageX-o,t.transform.offsetY=r+e.pageY-a})),Object(ze["on"])(document,"mousemove",this._dragHandler),Object(ze["on"])(document,"mouseup",(function(e){Object(ze["off"])(document,"mousemove",t._dragHandler)})),e.preventDefault()}},reset:function(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode:function(){if(!this.loading){var e=Object.keys(rg),t=Object.values(rg),n=t.indexOf(this.mode),i=(n+1)%e.length;this.mode=rg[e[i]],this.reset()}},prev:function(){if(!this.isFirst||this.infinite){var e=this.urlList.length;this.index=(this.index-1+e)%e}},next:function(){if(!this.isLast||this.infinite){var e=this.urlList.length;this.index=(this.index+1)%e}},handleActions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.loading){var n=ig({zoomRate:.2,rotateDeg:90,enableTransition:!0},t),i=n.zoomRate,r=n.rotateDeg,o=n.enableTransition,a=this.transform;switch(e){case"zoomOut":a.scale>.2&&(a.scale=parseFloat((a.scale-i).toFixed(3)));break;case"zoomIn":a.scale=parseFloat((a.scale+i).toFixed(3));break;case"clocelise":a.deg+=r;break;case"anticlocelise":a.deg-=r;break}a.enableTransition=o}}},mounted:function(){this.deviceSupportInstall(),this.$refs["el-image-viewer__wrapper"].focus()}},sg=ag,lg=l(sg,tg,ng,!1,null,null,null);lg.options.__file="packages/image/src/image-viewer.vue";var cg=lg.exports,ug=function(){return void 0!==document.documentElement.style.objectFit},dg={NONE:"none",CONTAIN:"contain",COVER:"cover",FILL:"fill",SCALE_DOWN:"scale-down"},hg="",fg={name:"ElImage",mixins:[b.a],inheritAttrs:!1,components:{ImageViewer:cg},props:{src:String,fit:String,lazy:Boolean,scrollContainer:{},previewSrcList:{type:Array,default:function(){return[]}},zIndex:{type:Number,default:2e3}},data:function(){return{loading:!0,error:!1,show:!this.lazy,imageWidth:0,imageHeight:0,showViewer:!1}},computed:{imageStyle:function(){var e=this.fit;return!this.$isServer&&e?ug()?{"object-fit":e}:this.getImageStyle(e):{}},alignCenter:function(){return!this.$isServer&&!ug()&&this.fit!==dg.FILL},preview:function(){var e=this.previewSrcList;return Array.isArray(e)&&e.length>0},imageIndex:function(){var e=0,t=this.previewSrcList.indexOf(this.src);return t>=0&&(e=t),e}},watch:{src:function(e){this.show&&this.loadImage()},show:function(e){e&&this.loadImage()}},mounted:function(){this.lazy?this.addLazyLoadListener():this.loadImage()},beforeDestroy:function(){this.lazy&&this.removeLazyLoadListener()},methods:{loadImage:function(){var e=this;if(!this.$isServer){this.loading=!0,this.error=!1;var t=new Image;t.onload=function(n){return e.handleLoad(n,t)},t.onerror=this.handleError.bind(this),Object.keys(this.$attrs).forEach((function(n){var i=e.$attrs[n];t.setAttribute(n,i)})),t.src=this.src}},handleLoad:function(e,t){this.imageWidth=t.width,this.imageHeight=t.height,this.loading=!1,this.error=!1},handleError:function(e){this.loading=!1,this.error=!0,this.$emit("error",e)},handleLazyLoad:function(){Object(ze["isInContainer"])(this.$el,this._scrollContainer)&&(this.show=!0,this.removeLazyLoadListener())},addLazyLoadListener:function(){if(!this.$isServer){var e=this.scrollContainer,t=null;t=Object(fh["isHtmlElement"])(e)?e:Object(fh["isString"])(e)?document.querySelector(e):Object(ze["getScrollContainer"])(this.$el),t&&(this._scrollContainer=t,this._lazyLoadHandler=$h()(200,this.handleLazyLoad),Object(ze["on"])(t,"scroll",this._lazyLoadHandler),this.handleLazyLoad())}},removeLazyLoadListener:function(){var e=this._scrollContainer,t=this._lazyLoadHandler;!this.$isServer&&e&&t&&(Object(ze["off"])(e,"scroll",t),this._scrollContainer=null,this._lazyLoadHandler=null)},getImageStyle:function(e){var t=this.imageWidth,n=this.imageHeight,i=this.$el,r=i.clientWidth,o=i.clientHeight;if(!t||!n||!r||!o)return{};var a=t/n<1;if(e===dg.SCALE_DOWN){var s=tr)return console.warn("[ElementCalendar]end time should be greater than start time"),[];if(Object(so["validateRangeInOneMonth"])(i,r))return[[i,r]];var o=[],a=new Date(i.getFullYear(),i.getMonth()+1,1),s=this.toDate(a.getTime()-Mg);if(!Object(so["validateRangeInOneMonth"])(a,r))return console.warn("[ElementCalendar]start time and end time interval must not exceed two months"),[];o.push([i,s]);var l=this.realFirstDayOfWeek,c=a.getDay(),u=0;return c!==l&&(0===l?u=7-c:(u=l-c,u=u>0?u:7+u)),a=this.toDate(a.getTime()+u*Mg),a.getDate()6?0:Math.floor(this.firstDayOfWeek)}},data:function(){return{selectedDay:"",now:new Date}}},Ng=Ag,Ig=l(Ng,bg,yg,!1,null,null,null);Ig.options.__file="packages/calendar/src/main.vue";var Lg=Ig.exports;Lg.install=function(e){e.component(Lg.name,Lg)};var Pg=Lg,$g=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-fade-in"}},[e.visible?n("div",{staticClass:"el-backtop",style:{right:e.styleRight,bottom:e.styleBottom},on:{click:function(t){return t.stopPropagation(),e.handleClick(t)}}},[e._t("default",[n("el-icon",{attrs:{name:"caret-top"}})])],2):e._e()])},Fg=[];$g._withStripped=!0;var jg=function(e){return Math.pow(e,3)},zg=function(e){return e<.5?jg(2*e)/2:1-jg(2*(1-e))/2},Bg={name:"ElBacktop",props:{visibilityHeight:{type:Number,default:200},target:[String],right:{type:Number,default:40},bottom:{type:Number,default:40}},data:function(){return{el:null,container:null,visible:!1}},computed:{styleBottom:function(){return this.bottom+"px"},styleRight:function(){return this.right+"px"}},mounted:function(){this.init(),this.throttledScrollHandler=$h()(300,this.onScroll),this.container.addEventListener("scroll",this.throttledScrollHandler)},methods:{init:function(){if(this.container=document,this.el=document.documentElement,this.target){if(this.el=document.querySelector(this.target),!this.el)throw new Error("target is not existed: "+this.target);this.container=this.el}},onScroll:function(){var e=this.el.scrollTop;this.visible=e>=this.visibilityHeight},handleClick:function(e){this.scrollToTop(),this.$emit("click",e)},scrollToTop:function(){var e=this.el,t=Date.now(),n=e.scrollTop,i=window.requestAnimationFrame||function(e){return setTimeout(e,16)},r=function r(){var o=(Date.now()-t)/500;o<1?(e.scrollTop=n*(1-zg(o)),i(r)):e.scrollTop=0};i(r)}},beforeDestroy:function(){this.container.removeEventListener("scroll",this.throttledScrollHandler)}},Rg=Bg,Vg=l(Rg,$g,Fg,!1,null,null,null);Vg.options.__file="packages/backtop/src/main.vue";var Hg=Vg.exports;Hg.install=function(e){e.component(Hg.name,Hg)};var Wg=Hg,qg=function(e,t){if(e===window&&(e=document.documentElement),1!==e.nodeType)return[];var n=window.getComputedStyle(e,null);return t?n[t]:n},Ug=function(e){return Object.keys(e||{}).map((function(t){return[t,e[t]]}))},Kg=function(e,t){return e===window||e===document?document.documentElement[t]:e[t]},Gg=function(e){return Kg(e,"offsetHeight")},Yg=function(e){return Kg(e,"clientHeight")},Xg="ElInfiniteScroll",Zg={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},Qg=function(e,t){return Object(fh["isHtmlElement"])(e)?Ug(Zg).reduce((function(n,i){var r=i[0],o=i[1],a=o.type,s=o.default,l=e.getAttribute("infinite-scroll-"+r);switch(l=Object(fh["isUndefined"])(t[l])?l:t[l],a){case Number:l=Number(l),l=Number.isNaN(l)?s:l;break;case Boolean:l=Object(fh["isDefined"])(l)?"false"!==l&&Boolean(l):s;break;default:l=a(l)}return n[r]=l,n}),{}):{}},Jg=function(e){return e.getBoundingClientRect().top},ev=function(e){var t=this[Xg],n=t.el,i=t.vm,r=t.container,o=t.observer,a=Qg(n,i),s=a.distance,l=a.disabled;if(!l){var c=r.getBoundingClientRect();if(c.width||c.height){var u=!1;if(r===n){var d=r.scrollTop+Yg(r);u=r.scrollHeight-d<=s}else{var h=Gg(n)+Jg(n)-Jg(r),f=Gg(r),p=Number.parseFloat(qg(r,"borderBottomWidth"));u=h-f+p<=s}u&&Object(fh["isFunction"])(e)?e.call(i):o&&(o.disconnect(),this[Xg].observer=null)}}},tv={name:"InfiniteScroll",inserted:function(e,t,n){var i=t.value,r=n.context,o=Object(ze["getScrollContainer"])(e,!0),a=Qg(e,r),s=a.delay,l=a.immediate,c=j()(s,ev.bind(e,i));if(e[Xg]={el:e,vm:r,container:o,onScroll:c},o&&(o.addEventListener("scroll",c),l)){var u=e[Xg].observer=new MutationObserver(c);u.observe(o,{childList:!0,subtree:!0}),c()}},unbind:function(e){var t=e[Xg],n=t.container,i=t.onScroll;n&&n.removeEventListener("scroll",i)},install:function(e){e.directive(tv.name,tv)}},nv=tv,iv=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-page-header"},[n("div",{staticClass:"el-page-header__left",on:{click:function(t){e.$emit("back")}}},[n("i",{staticClass:"el-icon-back"}),n("div",{staticClass:"el-page-header__title"},[e._t("title",[e._v(e._s(e.title))])],2)]),n("div",{staticClass:"el-page-header__content"},[e._t("content",[e._v(e._s(e.content))])],2)])},rv=[];iv._withStripped=!0;var ov={name:"ElPageHeader",props:{title:{type:String,default:function(){return Object(ni["t"])("el.pageHeader.title")}},content:String}},av=ov,sv=l(av,iv,rv,!1,null,null,null);sv.options.__file="packages/page-header/src/main.vue";var lv=sv.exports;lv.install=function(e){e.component(lv.name,lv)};var cv=lv,uv=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:["el-cascader-panel",e.border&&"is-bordered"],on:{keydown:e.handleKeyDown}},e._l(e.menus,(function(e,t){return n("cascader-menu",{key:t,ref:"menu",refInFor:!0,attrs:{index:t,nodes:e}})})),1)},dv=[];uv._withStripped=!0;var hv,fv,pv=n(43),mv=n.n(pv),gv=function(e){return e.stopPropagation()},vv={inject:["panel"],components:{ElCheckbox:Fi.a,ElRadio:mv.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var e=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some((function(t){return e.isInPath(t)}))},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var e=this,t=this.panel,n=this.node,i=this.isDisabled,r=this.config,o=r.multiple,a=r.checkStrictly;!a&&i||n.loading||(r.lazy&&!n.loaded?t.lazyLoad(n,(function(){var t=e.isLeaf;if(t||e.handleExpand(),o){var i=!!t&&n.checked;e.handleMultiCheckChange(i)}})):t.handleExpand(n))},handleCheckChange:function(){var e=this.panel,t=this.value,n=this.node;e.handleCheckChange(t),e.handleExpand(n)},handleMultiCheckChange:function(e){this.node.doCheck(e),this.panel.calculateMultiCheckedValue()},isInPath:function(e){var t=this.node,n=e[t.level-1]||{};return n.uid===t.uid},renderPrefix:function(e){var t=this.isLeaf,n=this.isChecked,i=this.config,r=i.checkStrictly,o=i.multiple;return o?this.renderCheckbox(e):r?this.renderRadio(e):t&&n?this.renderCheckIcon(e):null},renderPostfix:function(e){var t=this.node,n=this.isLeaf;return t.loading?this.renderLoadingIcon(e):n?null:this.renderExpandIcon(e)},renderCheckbox:function(e){var t=this.node,n=this.config,i=this.isDisabled,r={on:{change:this.handleMultiCheckChange},nativeOn:{}};return n.checkStrictly&&(r.nativeOn.click=gv),e("el-checkbox",Ju()([{attrs:{value:t.checked,indeterminate:t.indeterminate,disabled:i}},r]))},renderRadio:function(e){var t=this.checkedValue,n=this.value,i=this.isDisabled;return Object(y["isEqual"])(n,t)&&(n=t),e("el-radio",{attrs:{value:t,label:n,disabled:i},on:{change:this.handleCheckChange},nativeOn:{click:gv}},[e("span")])},renderCheckIcon:function(e){return e("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(e){return e("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(e){return e("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(e){var t=this.panel,n=this.node,i=t.renderLabelFn,r=i?i({node:n,data:n.data}):null;return e("span",{class:"el-cascader-node__label"},[r||n.label])}},render:function(e){var t=this,n=this.inActivePath,i=this.inCheckedPath,r=this.isChecked,o=this.isLeaf,a=this.isDisabled,s=this.config,l=this.nodeId,c=s.expandTrigger,u=s.checkStrictly,d=s.multiple,h=!u&&a,f={on:{}};return"click"===c?f.on.click=this.handleExpand:(f.on.mouseenter=function(e){t.handleExpand(),t.$emit("expand",e)},f.on.focus=function(e){t.handleExpand(),t.$emit("expand",e)}),!o||a||u||d||(f.on.click=this.handleCheckChange),e("li",Ju()([{attrs:{role:"menuitem",id:l,"aria-expanded":n,tabindex:h?null:-1},class:{"el-cascader-node":!0,"is-selectable":u,"in-active-path":n,"in-checked-path":i,"is-active":r,"is-disabled":h}},f]),[this.renderPrefix(e),this.renderContent(e),this.renderPostfix(e)])}},bv=vv,yv=l(bv,hv,fv,!1,null,null,null);yv.options.__file="packages/cascader-panel/src/cascader-node.vue";var wv,xv,_v=yv.exports,kv={name:"ElCascaderMenu",mixins:[b.a],inject:["panel"],components:{ElScrollbar:U.a,CascaderNode:_v},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(y["generateId"])()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(e){this.activeNode=e.target},handleMouseMove:function(e){var t=this.activeNode,n=this.hoverTimer,i=this.$refs.hoverZone;if(t&&i)if(t.contains(e.target)){clearTimeout(n);var r=this.$el.getBoundingClientRect(),o=r.left,a=e.clientX-o,s=this.$el,l=s.offsetWidth,c=s.offsetHeight,u=t.offsetTop,d=u+t.offsetHeight;i.innerHTML='\n \n \n '}else n||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,n=this.panel.isHoverMenu,i={on:{}};n&&(i.on.expand=this.handleExpand);var r=this.nodes.map((function(n,r){var o=n.hasChildren;return e("cascader-node",Ju()([{key:n.uid,attrs:{node:n,"node-id":t+"-"+r,"aria-haspopup":o,"aria-owns":o?t:null}},i]))}));return[].concat(r,[n?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,n=this.menuId,i={nativeOn:{}};return this.panel.isHoverMenu&&(i.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",Ju()([{attrs:{tag:"ul",role:"menu",id:n,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},i]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},Cv=kv,Sv=l(Cv,wv,xv,!1,null,null,null);Sv.options.__file="packages/cascader-panel/src/cascader-menu.vue";var Ov=Sv.exports,Tv=function(){function e(e,t){for(var n=0;n1?t-1:0),i=1;i1?i-1:0),o=1;o0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),n=this.isSameNode(e,t);this.doCheck(n)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},Tv(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,n=this.config,i=n.disabled,r=n.checkStrictly;return e[i]||!r&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,n=this.hasChildren,i=this.children,r=this.config,o=r.lazy,a=r.leaf;if(o){var s=Object(Tt["isDef"])(e[a])?e[a]:!!t&&!i.length;return this.hasChildren=!s,s}return!n}}]),e}(),Av=Mv;function Nv(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Iv=function e(t,n){return t.reduce((function(t,i){return i.isLeaf?t.push(i):(!n&&t.push(i),t=t.concat(e(i.children,n))),t}),[])},Lv=function(){function e(t,n){Nv(this,e),this.config=n,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(y["coerceTruthyValueToArray"])(e),this.nodes=e.map((function(e){return new Av(e,t.config)})),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var n=new Av(e,this.config,t),i=t?t.children:this.nodes;i.push(n)},e.prototype.appendNodes=function(e,t){var n=this;e=Object(y["coerceTruthyValueToArray"])(e),e.forEach((function(e){return n.appendNode(e,t)}))},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e?this.leafNodes:this.flattedNodes;return t?n:Iv(this.nodes,e)},e.prototype.getNodeByValue=function(e){if(e){var t=this.getFlattedNodes(!1,!this.config.lazy).filter((function(t){return Object(y["valueEquals"])(t.path,e)||t.value===e}));return t&&t.length?t[0]:null}return null},e}(),Pv=Lv,$v=Object.assign||function(e){for(var t=1;t0){var l=n.store.getNodeByValue(o);l.data[s]||n.lazyLoad(l,(function(){n.handleExpand(l)})),n.loadCount===n.checkedValue.length&&n.$parent.computePresentText()}}t&&t(i)};i.lazyLoad(e,r)},calculateMultiCheckedValue:function(){this.checkedValue=this.getCheckedNodes(this.leafOnly).map((function(e){return e.getValueByOption()}))},scrollIntoView:function(){if(!this.$isServer){var e=this.$refs.menu||[];e.forEach((function(e){var t=e.$el;if(t){var n=t.querySelector(".el-scrollbar__wrap"),i=t.querySelector(".el-cascader-node.is-active")||t.querySelector(".el-cascader-node.in-active-path");oi()(n,i)}}))}},getNodeByValue:function(e){return this.store.getNodeByValue(e)},getFlattedNodes:function(e){var t=!this.config.lazy;return this.store.getFlattedNodes(e,t)},getCheckedNodes:function(e){var t=this.checkedValue,n=this.multiple;if(n){var i=this.getFlattedNodes(e);return i.filter((function(e){return e.checked}))}return Object(y["isEmpty"])(t)?[]:[this.getNodeByValue(t)]},clearCheckedNodes:function(){var e=this.config,t=this.leafOnly,n=e.multiple,i=e.emitPath;n?(this.getCheckedNodes(t).filter((function(e){return!e.isDisabled})).forEach((function(e){return e.doCheck(!1)})),this.calculateMultiCheckedValue()):this.checkedValue=i?[]:null}}},qv=Wv,Uv=l(qv,uv,dv,!1,null,null,null);Uv.options.__file="packages/cascader-panel/src/cascader-panel.vue";var Kv=Uv.exports;Kv.install=function(e){e.component(Kv.name,Kv)};var Gv,Yv,Xv=Kv,Zv={name:"ElAvatar",props:{size:{type:[Number,String],validator:function(e){return"string"===typeof e?["large","medium","small"].includes(e):"number"===typeof e}},shape:{type:String,default:"circle",validator:function(e){return["circle","square"].includes(e)}},icon:String,src:String,alt:String,srcSet:String,error:Function,fit:{type:String,default:"cover"}},data:function(){return{isImageExist:!0}},computed:{avatarClass:function(){var e=this.size,t=this.icon,n=this.shape,i=["el-avatar"];return e&&"string"===typeof e&&i.push("el-avatar--"+e),t&&i.push("el-avatar--icon"),n&&i.push("el-avatar--"+n),i.join(" ")}},methods:{handleError:function(){var e=this.error,t=e?e():void 0;!1!==t&&(this.isImageExist=!1)},renderAvatar:function(){var e=this.$createElement,t=this.icon,n=this.src,i=this.alt,r=this.isImageExist,o=this.srcSet,a=this.fit;return r&&n?e("img",{attrs:{src:n,alt:i,srcSet:o},on:{error:this.handleError},style:{"object-fit":a}}):t?e("i",{class:t}):this.$slots.default}},render:function(){var e=arguments[0],t=this.avatarClass,n=this.size,i="number"===typeof n?{height:n+"px",width:n+"px",lineHeight:n+"px"}:{};return e("span",{class:t,style:i},[this.renderAvatar()])}},Qv=Zv,Jv=l(Qv,Gv,Yv,!1,null,null,null);Jv.options.__file="packages/avatar/src/main.vue";var eb=Jv.exports;eb.install=function(e){e.component(eb.name,eb)};var tb=eb,nb=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-drawer-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-drawer__wrapper",attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-drawer__container",class:e.visible&&"el-drawer__open",attrs:{role:"document",tabindex:"-1"},on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[n("div",{ref:"drawer",staticClass:"el-drawer",class:[e.direction,e.customClass],style:e.isHorizontal?"width: "+e.size:"height: "+e.size,attrs:{"aria-modal":"true","aria-labelledby":"el-drawer__title","aria-label":e.title,role:"dialog",tabindex:"-1"}},[e.withHeader?n("header",{staticClass:"el-drawer__header",attrs:{id:"el-drawer__title"}},[e._t("title",[n("span",{attrs:{role:"heading",tabindex:"0",title:e.title}},[e._v(e._s(e.title))])]),e.showClose?n("button",{staticClass:"el-drawer__close-btn",attrs:{"aria-label":"close "+(e.title||"drawer"),type:"button"},on:{click:e.closeDrawer}},[n("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2):e._e(),e.rendered?n("section",{staticClass:"el-drawer__body"},[e._t("default")],2):e._e()])])])])},ib=[];nb._withStripped=!0;var rb={name:"ElDrawer",mixins:[S.a,D.a],props:{appendToBody:{type:Boolean,default:!1},beforeClose:{type:Function},customClass:{type:String,default:""},closeOnPressEscape:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!1},modal:{type:Boolean,default:!0},direction:{type:String,default:"rtl",validator:function(e){return-1!==["ltr","rtl","ttb","btt"].indexOf(e)}},modalAppendToBody:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},size:{type:String,default:"30%"},title:{type:String,default:""},visible:{type:Boolean},wrapperClosable:{type:Boolean,default:!0},withHeader:{type:Boolean,default:!0}},computed:{isHorizontal:function(){return"rtl"===this.direction||"ltr"===this.direction}},data:function(){return{closed:!1,prevActiveElement:null}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.appendToBody&&document.body.appendChild(this.$el),this.prevActiveElement=document.activeElement,this.$nextTick((function(){xf.a.focusFirstDescendant(t.$refs.drawer)}))):(this.closed||this.$emit("close"),this.$nextTick((function(){t.prevActiveElement&&t.prevActiveElement.focus()})))}},methods:{afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),!0===this.destroyOnClose&&(this.rendered=!1),this.closed=!0)},handleWrapperClick:function(){this.wrapperClosable&&this.closeDrawer()},closeDrawer:function(){"function"===typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},handleClose:function(){this.closeDrawer()}},mounted:function(){this.visible&&(this.rendered=!0,this.open())},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},ob=rb,ab=l(ob,nb,ib,!1,null,null,null);ab.options.__file="packages/drawer/src/main.vue";var sb=ab.exports;sb.install=function(e){e.component(sb.name,sb)};var lb=sb,cb=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-popover",e._b({attrs:{trigger:"click"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},"el-popover",e.$attrs,!1),[n("div",{staticClass:"el-popconfirm"},[n("p",{staticClass:"el-popconfirm__main"},[e.hideIcon?e._e():n("i",{staticClass:"el-popconfirm__icon",class:e.icon,style:{color:e.iconColor}}),e._v("\n "+e._s(e.title)+"\n ")]),n("div",{staticClass:"el-popconfirm__action"},[n("el-button",{attrs:{size:"mini",type:e.cancelButtonType},on:{click:e.cancel}},[e._v("\n "+e._s(e.cancelButtonText)+"\n ")]),n("el-button",{attrs:{size:"mini",type:e.confirmButtonType},on:{click:e.confirm}},[e._v("\n "+e._s(e.confirmButtonText)+"\n ")])],1)]),e._t("reference",null,{slot:"reference"})],2)},ub=[];cb._withStripped=!0;var db=n(44),hb=n.n(db),fb={name:"ElPopconfirm",props:{title:{type:String},confirmButtonText:{type:String,default:Object(ni["t"])("el.popconfirm.confirmButtonText")},cancelButtonText:{type:String,default:Object(ni["t"])("el.popconfirm.cancelButtonText")},confirmButtonType:{type:String,default:"primary"},cancelButtonType:{type:String,default:"text"},icon:{type:String,default:"el-icon-question"},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1}},components:{ElPopover:hb.a,ElButton:se.a},data:function(){return{visible:!1}},methods:{confirm:function(){this.visible=!1,this.$emit("onConfirm")},cancel:function(){this.visible=!1,this.$emit("onCancel")}}},pb=fb,mb=l(pb,cb,ub,!1,null,null,null);mb.options.__file="packages/popconfirm/src/main.vue";var gb=mb.exports;gb.install=function(e){e.component(gb.name,gb)};var vb=gb,bb=[x,L,oe,pe,xe,Ee,Ue,tt,ut,vt,Nt,Bt,Kt,tn,cn,gn,kn,Mn,Fn,di,hi,yi,Oi,Ii,Xr,ro,Na,Wa,is,hs,ps,Ws,Zs,rl,yl,Bl,Yl,ec,Dc,Fc,fu,ju,Bu,Hu,_d,Dd,$d,ih,uh,bh,Sh,Nh,Rh,Uh,ef,lf,mf,Mf,Mp,Hp,Xp,im,um,vm,Om,Am,jm,qm,Qm,vg,Pg,Wg,cv,Xv,tb,lb,vb,Ge.a],yb=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ii.a.use(t.locale),ii.a.i18n(t.i18n),bb.forEach((function(t){e.component(t.name,t)})),e.use(nv),e.use(Au.directive),e.prototype.$ELEMENT={size:t.size||"",zIndex:t.zIndex||2e3},e.prototype.$loading=Au.service,e.prototype.$msgbox=Fs,e.prototype.$alert=Fs.alert,e.prototype.$confirm=Fs.confirm,e.prototype.$prompt=Fs.prompt,e.prototype.$notify=Zc,e.prototype.$message=Xd};"undefined"!==typeof window&&window.Vue&&yb(window.Vue),t["default"]={version:"2.13.2",locale:ii.a.use,i18n:ii.a.i18n,install:yb,CollapseTransition:Ge.a,Loading:Au,Pagination:x,Dialog:L,Autocomplete:oe,Dropdown:pe,DropdownMenu:xe,DropdownItem:Ee,Menu:Ue,Submenu:tt,MenuItem:ut,MenuItemGroup:vt,Input:Nt,InputNumber:Bt,Radio:Kt,RadioGroup:tn,RadioButton:cn,Checkbox:gn,CheckboxButton:kn,CheckboxGroup:Mn,Switch:Fn,Select:di,Option:hi,OptionGroup:yi,Button:Oi,ButtonGroup:Ii,Table:Xr,TableColumn:ro,DatePicker:Na,TimeSelect:Wa,TimePicker:is,Popover:hs,Tooltip:ps,MessageBox:Fs,Breadcrumb:Ws,BreadcrumbItem:Zs,Form:rl,FormItem:yl,Tabs:Bl,TabPane:Yl,Tag:ec,Tree:Dc,Alert:Fc,Notification:Zc,Slider:fu,Icon:ju,Row:Bu,Col:Hu,Upload:_d,Progress:Dd,Spinner:$d,Message:Xd,Badge:ih,Card:uh,Rate:bh,Steps:Sh,Step:Nh,Carousel:Rh,Scrollbar:Uh,CarouselItem:ef,Collapse:lf,CollapseItem:mf,Cascader:Mf,ColorPicker:Mp,Transfer:Hp,Container:Xp,Header:im,Aside:um,Main:vm,Footer:Om,Timeline:Am,TimelineItem:jm,Link:qm,Divider:Qm,Image:vg,Calendar:Pg,Backtop:Wg,InfiniteScroll:nv,PageHeader:cv,CascaderPanel:Xv,Avatar:tb,Drawer:lb,Popconfirm:vb}}])["default"]},"5cc6":function(e,t,n){var i=n("74e8");i("Uint8",(function(e){return function(t,n,i){return e(this,t,n,i)}}))},"5f96":function(e,t,n){"use strict";var i=n("ebb5"),r=i.aTypedArray,o=i.exportTypedArrayMethod,a=[].join;o("join",(function(e){return a.apply(r(this),arguments)}))},"5fb2":function(e,t,n){"use strict";var i=2147483647,r=36,o=1,a=26,s=38,l=700,c=72,u=128,d="-",h=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,p="Overflow: input needs wider integers to process",m=r-o,g=Math.floor,v=String.fromCharCode,b=function(e){var t=[],n=0,i=e.length;while(n=55296&&r<=56319&&n>1,e+=g(e/t);e>m*a>>1;i+=r)e=g(e/m);return g(i+(m+1)*e/(e+s))},x=function(e){var t=[];e=b(e);var n,s,l=e.length,h=u,f=0,m=c;for(n=0;n=h&&sg((i-f)/C))throw RangeError(p);for(f+=(k-h)*C,h=k,n=0;ni)throw RangeError(p);if(s==h){for(var S=f,O=r;;O+=r){var T=O<=m?o:O>=m+a?a:O-m;if(Su){var f,p=c(arguments[u++]),m=d?o(p).concat(d(p)):o(p),g=m.length,v=0;while(g>v)f=m[v++],i&&!h.call(p,f)||(n[f]=p[f])}return n}:u},6167:function(e,t,n){"use strict";var i,r;n("a4d3"),n("e01a"),n("d28b"),n("4de4"),n("4160"),n("c975"),n("e260"),n("d81d"),n("fb6a"),n("cca6"),n("e439"),n("b64b"),n("d3b7"),n("ac1f"),n("25f0"),n("3ca3"),n("5319"),n("1276"),n("159b"),n("ddb0");var o=n("7037");"function"===typeof Symbol&&o(Symbol.iterator),function(o,a){i=a,r="function"===typeof i?i.call(t,n,t,e):i,void 0===r||(e.exports=r)}(0,(function(){var e=window,t={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",arrowOffset:0,modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};function n(e,n,i){this._reference=e.jquery?e[0]:e,this.state={};var r="undefined"===typeof n||null===n,o=n&&"[object Object]"===Object.prototype.toString.call(n);return this._popper=r||o?this.parse(o?n:{}):n.jquery?n[0]:n,this._options=Object.assign({},t,i),this._options.modifiers=this._options.modifiers.map(function(e){if(-1===this._options.modifiersIgnored.indexOf(e))return"applyStyle"===e&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[e]||e}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),d(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function i(t){var n=t.style.display,i=t.style.visibility;t.style.display="block",t.style.visibility="hidden",t.offsetWidth;var r=e.getComputedStyle(t),o=parseFloat(r.marginTop)+parseFloat(r.marginBottom),a=parseFloat(r.marginLeft)+parseFloat(r.marginRight),s={width:t.offsetWidth+a,height:t.offsetHeight+o};return t.style.display=n,t.style.visibility=i,s}function r(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,(function(e){return t[e]}))}function o(e){var t=Object.assign({},e);return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function a(e,t){var n,i=0;for(n in e){if(e[n]===t)return i;i++}return null}function s(t,n){var i=e.getComputedStyle(t,null);return i[n]}function l(t){var n=t.offsetParent;return n!==e.document.body&&n?n:e.document.documentElement}function c(t){var n=t.parentNode;return n?n===e.document?e.document.body.scrollTop||e.document.body.scrollLeft?e.document.body:e.document.documentElement:-1!==["scroll","auto"].indexOf(s(n,"overflow"))||-1!==["scroll","auto"].indexOf(s(n,"overflow-x"))||-1!==["scroll","auto"].indexOf(s(n,"overflow-y"))?n:c(t.parentNode):t}function u(t){return t!==e.document.body&&("fixed"===s(t,"position")||(t.parentNode?u(t.parentNode):t))}function d(e,t){function n(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}Object.keys(t).forEach((function(i){var r="";-1!==["width","height","top","right","bottom","left"].indexOf(i)&&n(t[i])&&(r="px"),e.style[i]=t[i]+r}))}function h(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function f(e){var t={width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function p(e){var t=e.getBoundingClientRect(),n=-1!=navigator.userAgent.indexOf("MSIE"),i=n&&"HTML"===e.tagName?-e.scrollTop:t.top;return{left:t.left,top:i,right:t.right,bottom:t.bottom,width:t.right-t.left,height:t.bottom-i}}function m(e,t,n){var i=p(e),r=p(t);if(n){var o=c(t);r.top+=o.scrollTop,r.bottom+=o.scrollTop,r.left+=o.scrollLeft,r.right+=o.scrollLeft}var a={top:i.top-r.top,left:i.left-r.left,bottom:i.top-r.top+i.height,right:i.left-r.left+i.width,width:i.width,height:i.height};return a}function g(t){for(var n=["","ms","webkit","moz","o"],i=0;i1&&console.warn("WARNING: the given `parent` query("+t.parent+") matched more than one element, the first one will be used"),0===a.length)throw"ERROR: the given `parent` doesn't exists!";a=a[0]}return a.length>1&&a instanceof Element===!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),a=a[0]),a.appendChild(r),r;function s(e,t){t.forEach((function(t){e.classList.add(t)}))}function l(e,t){t.forEach((function(t){e.setAttribute(t.split(":")[0],t.split(":")[1]||"")}))}},n.prototype._getPosition=function(e,t){var n=l(t);if(this._options.forceAbsolute)return"absolute";var i=u(t,n);return i?"fixed":"absolute"},n.prototype._getOffsets=function(e,t,n){n=n.split("-")[0];var r={};r.position=this.state.position;var o="fixed"===r.position,a=m(t,l(e),o),s=i(e);return-1!==["right","left"].indexOf(n)?(r.top=a.top+a.height/2-s.height/2,r.left="left"===n?a.left-s.width:a.right):(r.left=a.left+a.width/2-s.width/2,r.top="top"===n?a.top-s.height:a.bottom),r.width=s.width,r.height=s.height,{popper:r,reference:a}},n.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),e.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var t=c(this._reference);t!==e.document.body&&t!==e.document.documentElement||(t=e),t.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=t}},n.prototype._removeEventListeners=function(){e.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement&&this.state.scrollTarget&&(this.state.scrollTarget.removeEventListener("scroll",this.state.updateBound),this.state.scrollTarget=null),this.state.updateBound=null},n.prototype._getBoundaries=function(t,n,i){var r,o,a={};if("window"===i){var s=e.document.body,u=e.document.documentElement;o=Math.max(s.scrollHeight,s.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),r=Math.max(s.scrollWidth,s.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),a={top:0,right:r,bottom:o,left:0}}else if("viewport"===i){var d=l(this._popper),h=c(this._popper),p=f(d),m=function(e){return e==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},g=function(e){return e==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):e.scrollLeft},v="fixed"===t.offsets.popper.position?0:m(h),b="fixed"===t.offsets.popper.position?0:g(h);a={top:0-(p.top-v),right:e.document.documentElement.clientWidth-(p.left-b),bottom:e.document.documentElement.clientHeight-(p.top-v),left:0-(p.left-b)}}else a=l(this._popper)===i?{top:0,left:0,right:i.clientWidth,bottom:i.clientHeight}:f(i);return a.left+=n,a.right-=n,a.top=a.top+n,a.bottom=a.bottom-n,a},n.prototype.runModifiers=function(e,t,n){var i=t.slice();return void 0!==n&&(i=this._options.modifiers.slice(0,a(this._options.modifiers,n))),i.forEach(function(t){h(t)&&(e=t.call(this,e))}.bind(this)),e},n.prototype.isModifierRequired=function(e,t){var n=a(this._options.modifiers,e);return!!this._options.modifiers.slice(0,n).filter((function(e){return e===t})).length},n.prototype.modifiers={},n.prototype.modifiers.applyStyle=function(e){var t,n={position:e.offsets.popper.position},i=Math.round(e.offsets.popper.left),r=Math.round(e.offsets.popper.top);return this._options.gpuAcceleration&&(t=g("transform"))?(n[t]="translate3d("+i+"px, "+r+"px, 0)",n.top=0,n.left=0):(n.left=i,n.top=r),Object.assign(n,e.styles),d(this._popper,n),this._popper.setAttribute("x-placement",e.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&e.offsets.arrow&&d(e.arrowElement,e.offsets.arrow),e},n.prototype.modifiers.shift=function(e){var t=e.placement,n=t.split("-")[0],i=t.split("-")[1];if(i){var r=e.offsets.reference,a=o(e.offsets.popper),s={y:{start:{top:r.top},end:{top:r.top+r.height-a.height}},x:{start:{left:r.left},end:{left:r.left+r.width-a.width}}},l=-1!==["bottom","top"].indexOf(n)?"x":"y";e.offsets.popper=Object.assign(a,s[l][i])}return e},n.prototype.modifiers.preventOverflow=function(e){var t=this._options.preventOverflowOrder,n=o(e.offsets.popper),i={left:function(){var t=n.left;return n.lefte.boundaries.right&&(t=Math.min(n.left,e.boundaries.right-n.width)),{left:t}},top:function(){var t=n.top;return n.tope.boundaries.bottom&&(t=Math.min(n.top,e.boundaries.bottom-n.height)),{top:t}}};return t.forEach((function(t){e.offsets.popper=Object.assign(n,i[t]())})),e},n.prototype.modifiers.keepTogether=function(e){var t=o(e.offsets.popper),n=e.offsets.reference,i=Math.floor;return t.righti(n.right)&&(e.offsets.popper.left=i(n.right)),t.bottomi(n.bottom)&&(e.offsets.popper.top=i(n.bottom)),e},n.prototype.modifiers.flip=function(e){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),e;if(e.flipped&&e.placement===e._originalPlacement)return e;var t=e.placement.split("-")[0],n=r(t),i=e.placement.split("-")[1]||"",a=[];return a="flip"===this._options.flipBehavior?[t,n]:this._options.flipBehavior,a.forEach(function(s,l){if(t===s&&a.length!==l+1){t=e.placement.split("-")[0],n=r(t);var c=o(e.offsets.popper),u=-1!==["right","bottom"].indexOf(t);(u&&Math.floor(e.offsets.reference[t])>Math.floor(c[n])||!u&&Math.floor(e.offsets.reference[t])s[f]&&(e.offsets.popper[d]+=l[d]+p-s[f]);var m=l[d]+(n||l[u]/2-p/2),g=m-s[d];return g=Math.max(Math.min(s[u]-p-8,g),8),r[d]=g,r[h]="",e.offsets.arrow=r,e.arrowElement=t,e},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n>8&255]},j=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},z=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},B=function(e){return L(e,23,4)},R=function(e){return L(e,52,8)},V=function(e,t){v(e[S],t,{get:function(){return x(this)[t]}})},H=function(e,t,n,i){var r=h(n),o=x(e);if(r+t>o.byteLength)throw I(T);var a=x(o.buffer).bytes,s=r+o.byteOffset,l=a.slice(s,s+t);return i?l:l.reverse()},W=function(e,t,n,i,r,o){var a=h(n),s=x(e);if(a+t>s.byteLength)throw I(T);for(var l=x(s.buffer).bytes,c=a+s.byteOffset,u=i(+r),d=0;dG;)(q=K[G++])in D||a(D,q,E[q]);U.constructor=D}m&&p(A)!==N&&m(A,N);var Y=new M(new D(2)),X=A.setInt8;Y.setInt8(0,2147483648),Y.setInt8(1,2147483649),!Y.getInt8(0)&&Y.getInt8(1)||s(A,{setInt8:function(e,t){X.call(this,e,t<<24>>24)},setUint8:function(e,t){X.call(this,e,t<<24>>24)}},{unsafe:!0})}else D=function(e){c(this,D,k);var t=h(e);_(this,{bytes:b.call(new Array(t),0),byteLength:t}),r||(this.byteLength=t)},M=function(e,t,n){c(this,M,C),c(e,D,C);var i=x(e).byteLength,o=u(t);if(o<0||o>i)throw I("Wrong offset");if(n=void 0===n?i-o:d(n),o+n>i)throw I(O);_(this,{buffer:e,byteLength:n,byteOffset:o}),r||(this.buffer=e,this.byteLength=n,this.byteOffset=o)},r&&(V(D,"byteLength"),V(M,"buffer"),V(M,"byteLength"),V(M,"byteOffset")),s(M[S],{getInt8:function(e){return H(this,1,e)[0]<<24>>24},getUint8:function(e){return H(this,1,e)[0]},getInt16:function(e){var t=H(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=H(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return z(H(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return z(H(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return P(H(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return P(H(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){W(this,1,e,$,t)},setUint8:function(e,t){W(this,1,e,$,t)},setInt16:function(e,t){W(this,2,e,F,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){W(this,2,e,F,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){W(this,4,e,j,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){W(this,4,e,j,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){W(this,4,e,B,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){W(this,8,e,R,t,arguments.length>2?arguments[2]:void 0)}});y(D,k),y(M,C),e.exports={ArrayBuffer:D,DataView:M}},"62e4":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},6325:function(e,t,n){"use strict";var i=n("43b2"),r=n.n(i);r.a},6374:function(e,t,n){n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0");var i=n("6613");function r(e){if("undefined"===typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=i(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,a=!0,s=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r["return"]||r["return"]()}finally{if(s)throw o}}}}e.exports=r},"63c1":function(e,t,n){},6438:function(e,t,n){var i=n("03d6"),r=n("9742").concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return i(e,r)}},"646a":function(e,t,n){"use strict";var i=n("391a"),r=n.n(i);r.a},6495:function(e,t,n){"use strict";var i=n("1054"),r=n.n(i);r.a},"649e":function(e,t,n){"use strict";var i=n("ebb5"),r=n("b727").some,o=i.aTypedArray,a=i.exportTypedArrayMethod;a("some",(function(e){return r(o(this),e,arguments.length>1?arguments[1]:void 0)}))},6547:function(e,t,n){var i=n("a691"),r=n("1d80"),o=function(e){return function(t,n){var o,a,s=String(r(t)),l=i(n),c=s.length;return l<0||l>=c?e?"":void 0:(o=s.charCodeAt(l),o<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536)}};e.exports={codeAt:o(!1),charAt:o(!0)}},"658f":function(e,t,n){n("6858");for(var i=n("ef08"),r=n("051b"),o=n("8a0d"),a=n("cc15")("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),l=0;l=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},"693d":function(e,t,n){"use strict";var i=n("ef08"),r=n("9c0e"),o=n("0bad"),a=n("512c"),s=n("ba01"),l=n("e34a").KEY,c=n("4b8b"),u=n("b367"),d=n("92f0"),h=n("8b1a"),f=n("cc15"),p=n("fcd4"),m=n("e198"),g=n("0ae2"),v=n("4ebc"),b=n("77e9"),y=n("7a41"),w=n("0983"),x=n("6ca1"),_=n("3397"),k=n("10db"),C=n("6f4f"),S=n("1836"),O=n("4d20"),T=n("fed5"),E=n("1a14"),D=n("9876"),M=O.f,A=E.f,N=S.f,I=i.Symbol,L=i.JSON,P=L&&L.stringify,$="prototype",F=f("_hidden"),j=f("toPrimitive"),z={}.propertyIsEnumerable,B=u("symbol-registry"),R=u("symbols"),V=u("op-symbols"),H=Object[$],W="function"==typeof I&&!!T.f,q=i.QObject,U=!q||!q[$]||!q[$].findChild,K=o&&c((function(){return 7!=C(A({},"a",{get:function(){return A(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=M(H,t);i&&delete H[t],A(e,t,n),i&&e!==H&&A(H,t,i)}:A,G=function(e){var t=R[e]=C(I[$]);return t._k=e,t},Y=W&&"symbol"==_typeof2(I.iterator)?function(e){return"symbol"==_typeof2(e)}:function(e){return e instanceof I},X=function e(t,n,i){return t===H&&e(V,n,i),b(t),n=_(n,!0),b(i),r(R,n)?(i.enumerable?(r(t,F)&&t[F][n]&&(t[F][n]=!1),i=C(i,{enumerable:k(0,!1)})):(r(t,F)||A(t,F,k(1,{})),t[F][n]=!0),K(t,n,i)):A(t,n,i)},Z=function(e,t){b(e);var n,i=g(t=x(t)),r=0,o=i.length;while(o>r)X(e,n=i[r++],t[n]);return e},Q=function(e,t){return void 0===t?C(e):Z(C(e),t)},J=function(e){var t=z.call(this,e=_(e,!0));return!(this===H&&r(R,e)&&!r(V,e))&&(!(t||!r(this,e)||!r(R,e)||r(this,F)&&this[F][e])||t)},ee=function(e,t){if(e=x(e),t=_(t,!0),e!==H||!r(R,t)||r(V,t)){var n=M(e,t);return!n||!r(R,t)||r(e,F)&&e[F][t]||(n.enumerable=!0),n}},te=function(e){var t,n=N(x(e)),i=[],o=0;while(n.length>o)r(R,t=n[o++])||t==F||t==l||i.push(t);return i},ne=function(e){var t,n=e===H,i=N(n?V:x(e)),o=[],a=0;while(i.length>a)!r(R,t=i[a++])||n&&!r(H,t)||o.push(R[t]);return o};W||(I=function(){if(this instanceof I)throw TypeError("Symbol is not a constructor!");var e=h(arguments.length>0?arguments[0]:void 0),t=function t(n){this===H&&t.call(V,n),r(this,F)&&r(this[F],e)&&(this[F][e]=!1),K(this,e,k(1,n))};return o&&U&&K(H,e,{configurable:!0,set:t}),G(e)},s(I[$],"toString",(function(){return this._k})),O.f=ee,E.f=X,n("6438").f=S.f=te,n("1917").f=J,T.f=ne,o&&!n("e444")&&s(H,"propertyIsEnumerable",J,!0),p.f=function(e){return G(f(e))}),a(a.G+a.W+a.F*!W,{Symbol:I});for(var ie="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),re=0;ie.length>re;)f(ie[re++]);for(var oe=D(f.store),ae=0;oe.length>ae;)m(oe[ae++]);a(a.S+a.F*!W,"Symbol",{for:function(e){return r(B,e+="")?B[e]:B[e]=I(e)},keyFor:function(e){if(!Y(e))throw TypeError(e+" is not a symbol!");for(var t in B)if(B[t]===e)return t},useSetter:function(){U=!0},useSimple:function(){U=!1}}),a(a.S+a.F*!W,"Object",{create:Q,defineProperty:X,defineProperties:Z,getOwnPropertyDescriptor:ee,getOwnPropertyNames:te,getOwnPropertySymbols:ne});var se=c((function(){T.f(1)}));a(a.S+a.F*se,"Object",{getOwnPropertySymbols:function(e){return T.f(w(e))}}),L&&a(a.S+a.F*(!W||c((function(){var e=I();return"[null]"!=P([e])||"{}"!=P({a:e})||"{}"!=P(Object(e))}))),"JSON",{stringify:function(e){var t,n,i=[e],r=1;while(arguments.length>r)i.push(arguments[r++]);if(n=t=i[1],(y(t)||void 0!==e)&&!Y(e))return v(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!Y(t))return t}),i[1]=t,P.apply(L,i)}}),I[$][j]||n("051b")(I[$],j,I[$].valueOf),d(I,"Symbol"),d(Math,"Math",!0),d(i.JSON,"JSON",!0)},"693d8":function(e,t,n){(function(e){"use strict";e(n("56b3"),n("9eb9"),n("d5e0"),n("f9d4"),n("a0bd"),n("7b00"),n("1b63"),n("76d2"),n("5bef"),n("e1de"))})((function(e){var t={script:[["lang",/coffee(script)?/,"coffeescript"],["type",/^(?:text|application)\/(?:x-)?coffee(?:script)?$/,"coffeescript"],["lang",/^babel$/,"javascript"],["type",/^text\/babel$/,"javascript"],["type",/^text\/ecmascript-\d+$/,"javascript"]],style:[["lang",/^stylus$/i,"stylus"],["lang",/^sass$/i,"sass"],["lang",/^less$/i,"text/x-less"],["lang",/^scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?styl(us)?$/i,"stylus"],["type",/^text\/sass/i,"sass"],["type",/^(text\/)?(x-)?scss$/i,"text/x-scss"],["type",/^(text\/)?(x-)?less$/i,"text/x-less"]],template:[["lang",/^vue-template$/i,"vue"],["lang",/^pug$/i,"pug"],["lang",/^handlebars$/i,"handlebars"],["type",/^(text\/)?(x-)?pug$/i,"pug"],["type",/^text\/x-handlebars-template$/i,"handlebars"],[null,null,"vue-template"]]};e.defineMode("vue-template",(function(t,n){var i={token:function(e){if(e.match(/^\{\{.*?\}\}/))return"meta mustache";while(e.next()&&!e.match("{{",!1));return null}};return e.overlayMode(e.getMode(t,n.backdrop||"text/html"),i)})),e.defineMode("vue",(function(n){return e.getMode(n,{name:"htmlmixed",tags:t})}),"htmlmixed","xml","javascript","coffeescript","css","sass","stylus","pug","handlebars"),e.defineMIME("script/x-vue","vue"),e.defineMIME("text/x-vue","vue")}))},"69d2":function(e,t,n){"use strict";var i=n("155a"),r=n.n(i);r.a},"69f3":function(e,t,n){var i,r,o,a=n("7f9a"),s=n("da84"),l=n("861d"),c=n("9112"),u=n("5135"),d=n("f772"),h=n("d012"),f=s.WeakMap,p=function(e){return o(e)?r(e):i(e,{})},m=function(e){return function(t){var n;if(!l(t)||(n=r(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(a){var g=new f,v=g.get,b=g.has,y=g.set;i=function(e,t){return y.call(g,e,t),t},r=function(e){return v.call(g,e)||{}},o=function(e){return b.call(g,e)}}else{var w=d("state");h[w]=!0,i=function(e,t){return c(e,w,t),t},r=function(e){return u(e,w)?e[w]:{}},o=function(e){return u(e,w)}}e.exports={set:i,get:r,has:o,enforce:p,getterFor:m}},"6a70":function(e,t,n){},"6ac9":function(e,t,n){n("a4d3"),n("e01a"),n("944a"),n("99af"),n("c975"),n("b0c0"),n("0c47"),n("23dc"),n("a9e3"),n("d3b7");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=74)}({0:function(e,t,n){"use strict";function i(e,t,n,i,r,o,a,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},2:function(e,t){e.exports=n("5924")},3:function(e,t){e.exports=n("8122")},5:function(e,t){e.exports=n("e974")},7:function(e,t){e.exports=n("8bbf")},74:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("transition",{attrs:{name:e.transition},on:{"after-enter":e.handleAfterEnter,"after-leave":e.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.disabled&&e.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[e.popperClass,e.content&&"el-popover--plain"],style:{width:e.width+"px"},attrs:{role:"tooltip",id:e.tooltipId,"aria-hidden":e.disabled||!e.showPopper?"true":"false"}},[e.title?n("div",{staticClass:"el-popover__title",domProps:{textContent:e._s(e.title)}}):e._e(),e._t("default",[e._v(e._s(e.content))])],2)]),e._t("reference")],2)},r=[];i._withStripped=!0;var o=n(5),a=n.n(o),s=n(2),l=n(3),c={name:"ElPopover",mixins:[a.a],props:{trigger:{type:String,default:"click",validator:function(e){return["click","focus","hover","manual"].indexOf(e)>-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(l["generateId"])()}},watch:{showPopper:function(e){this.disabled||(e?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var e=this,t=this.referenceElm=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),t&&(Object(s["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),n.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(s["on"])(t,"focusin",(function(){e.handleFocus();var n=t.__vue__;n&&"function"===typeof n.focus&&n.focus()})),Object(s["on"])(n,"focusin",this.handleFocus),Object(s["on"])(t,"focusout",this.handleBlur),Object(s["on"])(n,"focusout",this.handleBlur)),Object(s["on"])(t,"keydown",this.handleKeydown),Object(s["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(s["on"])(t,"click",this.doToggle),Object(s["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(s["on"])(t,"mouseenter",this.handleMouseEnter),Object(s["on"])(n,"mouseenter",this.handleMouseEnter),Object(s["on"])(t,"mouseleave",this.handleMouseLeave),Object(s["on"])(n,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),t.querySelector("input, textarea")?(Object(s["on"])(t,"focusin",this.doShow),Object(s["on"])(t,"focusout",this.doClose)):(Object(s["on"])(t,"mousedown",this.doShow),Object(s["on"])(t,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(s["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(s["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(s["removeClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout((function(){e.showPopper=!0}),this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this.closeDelay?this._timer=setTimeout((function(){e.showPopper=!1}),this.closeDelay):this.showPopper=!1},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&n&&!n.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(s["off"])(e,"click",this.doToggle),Object(s["off"])(e,"mouseup",this.doClose),Object(s["off"])(e,"mousedown",this.doShow),Object(s["off"])(e,"focusin",this.doShow),Object(s["off"])(e,"focusout",this.doClose),Object(s["off"])(e,"mousedown",this.doShow),Object(s["off"])(e,"mouseup",this.doClose),Object(s["off"])(e,"mouseleave",this.handleMouseLeave),Object(s["off"])(e,"mouseenter",this.handleMouseEnter),Object(s["off"])(document,"click",this.handleDocumentClick)}},u=c,d=n(0),h=Object(d["a"])(u,i,r,!1,null,null,null);h.options.__file="packages/popover/src/main.vue";var f=h.exports,p=function(e,t,n){var i=t.expression?t.value:t.arg,r=n.context.$refs[i];r&&(Array.isArray(r)?r[0].$refs.reference=e:r.$refs.reference=e)},m={bind:function(e,t,n){p(e,t,n)},inserted:function(e,t,n){p(e,t,n)}},g=n(7),v=n.n(g);v.a.directive("popover",m),f.install=function(e){e.directive("popover",m),e.component(f.name,f)},f.directive=m,t["default"]=f}})},"6b03":function(e,t,n){"use strict";var i=n("efed"),r=n.n(i);r.a},"6b4b":function(e,t,n){"use strict";var i=n("0b40"),r=n.n(i);r.a},"6b75":function(e,t,n){"use strict";function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0},e.prototype.connect_=function(){i&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),u?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){i&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,i=c.some((function(e){return!!~n.indexOf(e)}));i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),h=function(e,t){for(var n=0,i=Object.keys(t);n0},e}(),E="undefined"!==typeof WeakMap?new WeakMap:new n,D=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=d.getInstance(),i=new T(t,n,this);E.set(this,i)}return e}();["observe","unobserve","disconnect"].forEach((function(e){D.prototype[e]=function(){var t;return(t=E.get(this))[e].apply(t,arguments)}}));var M=function(){return"undefined"!==typeof r.ResizeObserver?r.ResizeObserver:D}();t["default"]=M}.call(this,n("c8ba"))},"6eeb":function(e,t,n){var i=n("da84"),r=n("9112"),o=n("5135"),a=n("ce4e"),s=n("8925"),l=n("69f3"),c=l.get,u=l.enforce,d=String(String).split("String");(e.exports=function(e,t,n,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||o(n,"name")||r(n,"name",t),u(n).source=d.join("string"==typeof t?t:"")),e!==i?(l?!h&&e[t]&&(c=!0):delete e[t],c?e[t]=n:r(e,t,n)):c?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},"6f4f":function(e,t,n){var i=n("77e9"),r=n("85e7"),o=n("9742"),a=n("5a94")("IE_PROTO"),s=function(){},l="prototype",c=function(){var e,t=n("05f5")("iframe"),i=o.length,r="<",a=">";t.style.display="none",n("9141").appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(r+"script"+a+"document.F=Object"+r+"/script"+a),e.close(),c=e.F;while(i--)delete c[l][o[i]];return c()};e.exports=Object.create||function(e,t){var n;return null!==e?(s[l]=i(e),n=new s,s[l]=null,n[a]=e):n=c(),void 0===t?n:r(n,t)}},"6f53":function(e,t,n){var i=n("83ab"),r=n("df75"),o=n("fc6a"),a=n("d1e7").f,s=function(e){return function(t){var n,s=o(t),l=r(s),c=l.length,u=0,d=[];while(c>u)n=l[u++],i&&!a.call(s,n)||d.push(e?[n,s[n]]:s[n]);return d}};e.exports={entries:s(!0),values:s(!1)}},"6fb9":function(e,t,n){},7037:function(e,t,n){function i(t){return"function"===typeof Symbol&&"symbol"===_typeof2(Symbol.iterator)?e.exports=i=function(e){return _typeof2(e)}:e.exports=i=function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":_typeof2(e)},i(t)}n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0"),e.exports=i},7156:function(e,t,n){var i=n("861d"),r=n("d2bb");e.exports=function(e,t,n){var o,a;return r&&"function"==typeof(o=t.constructor)&&o!==n&&i(a=o.prototype)&&a!==n.prototype&&r(e,a),e}},"722f":function(e,t,n){"use strict";n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("d3b7"),n("3ca3"),n("ddb0");var i=n("7037");t.__esModule=!0;var r="function"===typeof Symbol&&"symbol"===i(Symbol.iterator)?function(e){return i(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":i(e)},o=n("e452"),a=s(o);function s(e){return e&&e.__esModule?e:{default:e}}var l,c=c||{};c.Dialog=function(e,t,n){var i=this;if(this.dialogNode=e,null===this.dialogNode||"dialog"!==this.dialogNode.getAttribute("role"))throw new Error("Dialog() requires a DOM element with ARIA role of dialog.");"string"===typeof t?this.focusAfterClosed=document.getElementById(t):"object"===("undefined"===typeof t?"undefined":r(t))?this.focusAfterClosed=t:this.focusAfterClosed=null,"string"===typeof n?this.focusFirst=document.getElementById(n):"object"===("undefined"===typeof n?"undefined":r(n))?this.focusFirst=n:this.focusFirst=null,this.focusFirst?this.focusFirst.focus():a.default.focusFirstDescendant(this.dialogNode),this.lastFocus=document.activeElement,l=function(e){i.trapFocus(e)},this.addListeners()},c.Dialog.prototype.addListeners=function(){document.addEventListener("focus",l,!0)},c.Dialog.prototype.removeListeners=function(){document.removeEventListener("focus",l,!0)},c.Dialog.prototype.closeDialog=function(){var e=this;this.removeListeners(),this.focusAfterClosed&&setTimeout((function(){e.focusAfterClosed.focus()}))},c.Dialog.prototype.trapFocus=function(e){a.default.IgnoreUtilFocusChanges||(this.dialogNode.contains(e.target)?this.lastFocus=e.target:(a.default.focusFirstDescendant(this.dialogNode),this.lastFocus===document.activeElement&&a.default.focusLastDescendant(this.dialogNode),this.lastFocus=document.activeElement))},t.default=c.Dialog},"72cd":function(e,t,n){"use strict";var i=n("c861"),r=n.n(i);r.a},"72f7":function(e,t,n){"use strict";var i=n("ebb5").exportTypedArrayMethod,r=n("d039"),o=n("da84"),a=o.Uint8Array,s=a&&a.prototype||{},l=[].toString,c=[].join;r((function(){l.call({})}))&&(l=function(){return c.call(this)});var u=s.toString!=l;i("toString",l,u)},"735e":function(e,t,n){"use strict";var i=n("ebb5"),r=n("81d5"),o=i.aTypedArray,a=i.exportTypedArrayMethod;a("fill",(function(e){return r.apply(o(this),arguments)}))},7418:function(e,t){t.f=Object.getOwnPropertySymbols},"746f":function(e,t,n){var i=n("428f"),r=n("5135"),o=n("e538"),a=n("9bf2").f;e.exports=function(e){var t=i.Symbol||(i.Symbol={});r(t,e)||a(t,e,{value:o.f(e)})}},"74d3":function d3(module,__webpack_exports__,__webpack_require__){"use strict";var core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("cca6"),core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(core_js_modules_es_object_assign__WEBPACK_IMPORTED_MODULE_0__),_plugins_codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("1850"),_plugins_codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_plugins_codemirror_addon_edit_matchbrackets__WEBPACK_IMPORTED_MODULE_1__),_plugins_codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("9bc9"),_plugins_codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(_plugins_codemirror_addon_hint_show_hint_css__WEBPACK_IMPORTED_MODULE_2__),_plugins_codemirror_addon_hint_show_hint__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("addb"),_plugins_codemirror_addon_hint_show_hint__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_plugins_codemirror_addon_hint_show_hint__WEBPACK_IMPORTED_MODULE_3__),_plugins_codemirror_plugs_aws_formula_addon_hint_aws_at_hint__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("3c47"),_plugins_codemirror_plugs_aws_formula_addon_hint_aws_at_hint__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(_plugins_codemirror_plugs_aws_formula_addon_hint_aws_at_hint__WEBPACK_IMPORTED_MODULE_4__),_plugins_codemirror_plugs_aws_formula_mode_awsat_aws_at__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("79ef"),_plugins_codemirror_plugs_aws_formula_mode_awsat_aws_at__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(_plugins_codemirror_plugs_aws_formula_mode_awsat_aws_at__WEBPACK_IMPORTED_MODULE_5__),_plugins_codemirror_plugs_aws_formula_awsui_formula_util__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("82bb"),_plugins_codemirror_plugs_aws_formula_awsui_formula_util__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_plugins_codemirror_plugs_aws_formula_awsui_formula_util__WEBPACK_IMPORTED_MODULE_6__),_plugins_codemirror_plugs_aws_formula_theme_aws_formula_css__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("8ce5"),_plugins_codemirror_plugs_aws_formula_theme_aws_formula_css__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_plugins_codemirror_plugs_aws_formula_theme_aws_formula_css__WEBPACK_IMPORTED_MODULE_7__);window.formulaLabelMap={},__webpack_exports__["a"]={name:"AwsuiFormula",componentName:"AwsuiCodemirror",props:{content:{type:String,default:""},option:{type:Object},value:{type:String},placeholder:{type:String,default:"请输入内容"}},data:function(){return{options:{height:"28px",theme:"aws-formula",foldGutter:!0,singleCursorHeightPerLine:!1,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,mode:{name:"awsAt"},defaultTable:[1,2,3],autofocus:!1,lineWrapping:!0},iframeOption:{url:this.getPath(),data:{sid:this.getSid(),cmd:"CLIENT_M_FORMULA_EDITOR_MAIN_PAGE",contextData:""}},currentContent:this.value,otherInstanceVue:null,dialogVisible:!1,cm:null,width:"850px",height:window.top!==window&&window.height>550?.6*window.height+"px":"550px"}},watch:{content:{handler:function(){""!==this.content&&(this.currentContent=this.content)},immediate:!0},currentContent:function(e){this.$emit("input",e)},value:{handler:function(){this.currentContent!=this.value&&(this.currentContent=this.value,this.onCmReady())},immediate:!0}},methods:{onCmReady:function(e){var t=this;if(this.cm=null!=e?e:this.cm,null!=this.cm){var n=this.getOpt();!0===this.option.readonly&&this.cm.setOption("readOnly","nocursor"),this.cm.setSize(null,this.option.height),this.cm.setOption("isSupportReturn",!1);var i={url:"jd",data:{sid:this.getSid(),contextData:JSON.stringify(n.contextData),content:JSON.stringify(this.currentContent),cmd:"CLIENT_M_FORMULA_EDITOR_PARSE_CONTENT"}};this.awsuiaxios.post(i).then((function(e){if("ok"===e.result&&void 0!==e.data.formulaLabelMapCache){var i=e.data.formulaLabelMapCache;if(null!=i){var r=Object.assign({},window.formulaLabelMap,i);window.formulaLabelMap=r,window.initFormulaEditor(t.currentContent,t.cm,n.type)}}})).catch((function(e){console.log(e)}))}},refresh:function(){this.onCmReady()},getSid:function getSid(){var sid=this.option.sid;return void 0===sid&&(sid="undefined"!=typeof settingParam?eval("settingParam")["sessionId"]:null!=window.settingParam?window.settingParam.sessionId:this.option.sid),sid},getPath:function getPath(){return eval("axiosBaseUrl")+"w"},getOpt:function(){var e=Object.assign({},this.options,this.option);return e.defaultValue=this.currentContent,e},openDialog:function(e,t){var n=this,i=e;if(null==i&&(i=this.getOpt(),i.contextData.defaultValue=this.currentContent),!0!==this.option.disabled&&!0!==this.option.readonly){if(this.otherInstanceVue=null==t?this:t,null!=window.atOnce&&window.atOnce!==this)return i.contextData.defaultValue=this.currentContent,void window.atOnce.openDialog(i,this);void 0!==i.contextData&&(this.iframeOption.data.contextData=JSON.stringify(i.contextData)),!0!==this.option.readonly&&!0!==this.option.disabled&&(this.dialogVisible=!0),n.$nextTick((function(){n.width=window.top!==window&&window.width>850?.7*window.width+"px":"850px"}))}},dialogConfirm:function(e){null==e?this.otherInstanceVue&&(this.otherInstanceVue.dialogConfirm(this.getValue()),this.otherInstanceVue.onCmReady(),this.otherInstanceVue=null,this.dialogVisible=!1):this.currentContent=e},getValue:function(){return this.$refs.awsuiDialog.getWin().getVal()},dialogCancel:function(){this.dialogVisible=!1}},mounted:function(){window.atOnce||(window.atOnce=this)},destroyed:function(){window.atOnce=null},computed:{dialogOnce:function(){return null==window.atOnce}}}},"74e8":function(e,t,n){"use strict";var i=n("23e7"),r=n("da84"),o=n("83ab"),a=n("8aa7"),s=n("ebb5"),l=n("621a"),c=n("19aa"),u=n("5c6c"),d=n("9112"),h=n("50c4"),f=n("0b25"),p=n("182d"),m=n("c04e"),g=n("5135"),v=n("f5df"),b=n("861d"),y=n("7c73"),w=n("d2bb"),x=n("241c").f,_=n("a078"),k=n("b727").forEach,C=n("2626"),S=n("9bf2"),O=n("06cf"),T=n("69f3"),E=n("7156"),D=T.get,M=T.set,A=S.f,N=O.f,I=Math.round,L=r.RangeError,P=l.ArrayBuffer,$=l.DataView,F=s.NATIVE_ARRAY_BUFFER_VIEWS,j=s.TYPED_ARRAY_TAG,z=s.TypedArray,B=s.TypedArrayPrototype,R=s.aTypedArrayConstructor,V=s.isTypedArray,H="BYTES_PER_ELEMENT",W="Wrong length",q=function(e,t){var n=0,i=t.length,r=new(R(e))(i);while(i>n)r[n]=t[n++];return r},U=function(e,t){A(e,t,{get:function(){return D(this)[t]}})},K=function(e){var t;return e instanceof P||"ArrayBuffer"==(t=v(e))||"SharedArrayBuffer"==t},G=function(e,t){return V(e)&&"symbol"!=_typeof2(t)&&t in e&&String(+t)==String(t)},Y=function(e,t){return G(e,t=m(t,!0))?u(2,e[t]):N(e,t)},X=function(e,t,n){return!(G(e,t=m(t,!0))&&b(n)&&g(n,"value"))||g(n,"get")||g(n,"set")||n.configurable||g(n,"writable")&&!n.writable||g(n,"enumerable")&&!n.enumerable?A(e,t,n):(e[t]=n.value,e)};o?(F||(O.f=Y,S.f=X,U(B,"buffer"),U(B,"byteOffset"),U(B,"byteLength"),U(B,"length")),i({target:"Object",stat:!0,forced:!F},{getOwnPropertyDescriptor:Y,defineProperty:X}),e.exports=function(e,t,n){var o=e.match(/\d+$/)[0]/8,s=e+(n?"Clamped":"")+"Array",l="get"+e,u="set"+e,m=r[s],g=m,v=g&&g.prototype,S={},O=function(e,t){var n=D(e);return n.view[l](t*o+n.byteOffset,!0)},T=function(e,t,i){var r=D(e);n&&(i=(i=I(i))<0?0:i>255?255:255&i),r.view[u](t*o+r.byteOffset,i,!0)},N=function(e,t){A(e,t,{get:function(){return O(this,t)},set:function(e){return T(this,t,e)},enumerable:!0})};F?a&&(g=t((function(e,t,n,i){return c(e,g,s),E(function(){return b(t)?K(t)?void 0!==i?new m(t,p(n,o),i):void 0!==n?new m(t,p(n,o)):new m(t):V(t)?q(g,t):_.call(g,t):new m(f(t))}(),e,g)})),w&&w(g,z),k(x(m),(function(e){e in g||d(g,e,m[e])})),g.prototype=v):(g=t((function(e,t,n,i){c(e,g,s);var r,a,l,u=0,d=0;if(b(t)){if(!K(t))return V(t)?q(g,t):_.call(g,t);r=t,d=p(n,o);var m=t.byteLength;if(void 0===i){if(m%o)throw L(W);if(a=m-d,a<0)throw L(W)}else if(a=h(i)*o,a+d>m)throw L(W);l=a/o}else l=f(t),a=l*o,r=new P(a);M(e,{buffer:r,byteOffset:d,byteLength:a,length:l,view:new $(r)});while(u2&&u.token&&"string"!=typeof u.token){i.pending=[];for(var f=2;f-1)return e.Pass;var a=i.indent.length-1,s=t[i.state];e:for(;;){for(var c=0;c]=?|\?:|\~)/,L=m(u),P=g(d),$=new RegExp(/^\-(moz|ms|o|webkit)-/i),F=g(h),j="",z={};while(x.length|~|\/)?\s*[\w-]*([a-z0-9-]|\*|\/\*)(\(|,)?)/),t.context.line.firstWord=j?j[0].replace(/^\s*/,""):"",t.context.line.indent=e.indentation(),f=e.peek(),e.match("//"))return e.skipToEnd(),["comment","comment"];if(e.match("/*"))return t.tokenize=R,R(e,t);if('"'==f||"'"==f)return e.next(),t.tokenize=V(f),t.tokenize(e,t);if("@"==f)return e.next(),e.eatWhile(/[\w\\-]/),["def",e.current()];if("#"==f){if(e.next(),e.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b(?!-)/i))return["atom","atom"];if(e.match(/^[a-z][\w-]*/i))return["builtin","hash"]}return e.match($)?["meta","vendor-prefixes"]:e.match(/^-?[0-9]?\.?[0-9]/)?(e.eatWhile(/[a-z%]/i),["number","unit"]):"!"==f?(e.next(),[e.match(/^(important|optional)/i)?"keyword":"operator","important"]):"."==f&&e.match(/^\.[a-z][\w-]*/i)?["qualifier","qualifier"]:e.match(D)?("("==e.peek()&&(t.tokenize=H),["property","word"]):e.match(/^[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","mixin"]):e.match(/^(\+|-)[a-z][\w-]*\(/i)?(e.backUp(1),["keyword","block-mixin"]):e.string.match(/^\s*&/)&&e.match(/^[-_]+[a-z][\w-]*/)?["qualifier","qualifier"]:e.match(/^(\/|&)(-|_|:|\.|#|[a-z])/)?(e.backUp(1),["variable-3","reference"]):e.match(/^&{1}\s*$/)?["variable-3","reference"]:e.match(L)?["operator","operator"]:e.match(/^\$?[-_]*[a-z0-9]+[\w-]*/i)?e.match(/^(\.|\[)[\w-\'\"\]]+/i,!1)&&!Y(e.current())?(e.match(/\./),["variable-2","variable-name"]):["variable-2","word"]:e.match(I)?["operator",e.current()]:/[:;,{}\[\]\(\)]/.test(f)?(e.next(),[null,f]):(e.next(),[null,null])}function R(e,t){var n,i=!1;while(null!=(n=e.next())){if(i&&"/"==n){t.tokenize=null;break}i="*"==n}return["comment","comment"]}function V(e){return function(t,n){var i,r=!1;while(null!=(i=t.next())){if(i==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==i}return(i==e||!r&&")"!=e)&&(n.tokenize=null),["string","string"]}}function H(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=V(")"),[null,"("]}function W(e,t,n,i){this.type=e,this.indent=t,this.prev=n,this.line=i||{firstWord:"",indent:0}}function q(e,t,n,i){return i=i>=0?i:w,e.context=new W(n,t.indentation()+i,e.context),n}function U(e,t){var n=e.context.indent-w;return t=t||!1,e.context=e.context.prev,t&&(e.context.indent=n),e.context.type}function K(e,t,n){return z[n.context.type](e,t,n)}function G(e,t,n,i){for(var r=i||1;r>0;r--)n.context=n.context.prev;return K(e,t,n)}function Y(e){return e.toLowerCase()in _}function X(e){return e=e.toLowerCase(),e in C||e in N}function Z(e){return e.toLowerCase()in P}function Q(e){return e.toLowerCase().match($)}function J(e){var t=e.toLowerCase(),n="variable-2";return Y(e)?n="tag":Z(e)?n="block-keyword":X(e)?n="property":t in O||t in F?n="atom":"return"==t||t in T?n="keyword":e.match(/^[A-Z]/)&&(n="string"),n}function ee(e,t){return re(t)&&("{"==e||"]"==e||"hash"==e||"qualifier"==e)||"block-mixin"==e}function te(e,t){return"{"==e&&t.match(/^\s*\$?[\w-]+/i,!1)}function ne(e,t){return":"==e&&t.match(/^[a-z-]+/,!1)}function ie(e){return e.sol()||e.string.match(new RegExp("^\\s*"+v(e.current())))}function re(e){return e.eol()||e.match(/^\s*$/,!1)}function oe(e){var t=/^\s*[-_]*[a-z0-9]+[\w-]*/i,n="string"==typeof e?e.match(t):e.string.match(t);return n?n[0].replace(/^\s*/,""):""}return z.block=function(e,t,n){if("comment"==e&&ie(t)||","==e&&re(t)||"mixin"==e)return q(n,t,"block",0);if(te(e,t))return q(n,t,"interpolation");if(re(t)&&"]"==e&&!/^\s*(\.|#|:|\[|\*|&)/.test(t.string)&&!Y(oe(t)))return q(n,t,"block",0);if(ee(e,t))return q(n,t,"block");if("}"==e&&re(t))return q(n,t,"block",0);if("variable-name"==e)return t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/)||Z(oe(t))?q(n,t,"variableName"):q(n,t,"variableName",0);if("="==e)return re(t)||Z(oe(t))?q(n,t,"block"):q(n,t,"block",0);if("*"==e&&(re(t)||t.match(/\s*(,|\.|#|\[|:|{)/,!1)))return y="tag",q(n,t,"block");if(ne(e,t))return q(n,t,"pseudo");if(/@(font-face|media|supports|(-moz-)?document)/.test(e))return q(n,t,re(t)?"block":"atBlock");if(/@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return q(n,t,"keyframes");if(/@extends?/.test(e))return q(n,t,"extend",0);if(e&&"@"==e.charAt(0))return t.indentation()>0&&X(t.current().slice(1))?(y="variable-2","block"):/(@import|@require|@charset)/.test(e)?q(n,t,"block",0):q(n,t,"block");if("reference"==e&&re(t))return q(n,t,"block");if("("==e)return q(n,t,"parens");if("vendor-prefixes"==e)return q(n,t,"vendorPrefixes");if("word"==e){var i=t.current();if(y=J(i),"property"==y)return ie(t)?q(n,t,"block",0):(y="atom","block");if("tag"==y){if(/embed|menu|pre|progress|sub|table/.test(i)&&X(oe(t)))return y="atom","block";if(t.string.match(new RegExp("\\[\\s*"+i+"|"+i+"\\s*\\]")))return y="atom","block";if(k.test(i)&&(ie(t)&&t.string.match(/=/)||!ie(t)&&!t.string.match(/^(\s*\.|#|\&|\[|\/|>|\*)/)&&!Y(oe(t))))return y="variable-2",Z(oe(t))?"block":q(n,t,"block",0);if(re(t))return q(n,t,"block")}if("block-keyword"==y)return y="keyword",t.current(/(if|unless)/)&&!ie(t)?"block":q(n,t,"block");if("return"==i)return q(n,t,"block",0);if("variable-2"==y&&t.string.match(/^\s?\$[\w-\.\[\]\'\"]+$/))return q(n,t,"block")}return n.context.type},z.parens=function(e,t,n){if("("==e)return q(n,t,"parens");if(")"==e)return"parens"==n.context.prev.type?U(n):t.string.match(/^[a-z][\w-]*\(/i)&&re(t)||Z(oe(t))||/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(oe(t))||!t.string.match(/^-?[a-z][\w-\.\[\]\'\"]*\s*=/)&&Y(oe(t))?q(n,t,"block"):t.string.match(/^[\$-]?[a-z][\w-\.\[\]\'\"]*\s*=/)||t.string.match(/^\s*(\(|\)|[0-9])/)||t.string.match(/^\s+[a-z][\w-]*\(/i)||t.string.match(/^\s+[\$-]?[a-z]/i)?q(n,t,"block",0):re(t)?q(n,t,"block"):q(n,t,"block",0);if(e&&"@"==e.charAt(0)&&X(t.current().slice(1))&&(y="variable-2"),"word"==e){var i=t.current();y=J(i),"tag"==y&&k.test(i)&&(y="variable-2"),"property"!=y&&"to"!=i||(y="atom")}return"variable-name"==e?q(n,t,"variableName"):ne(e,t)?q(n,t,"pseudo"):n.context.type},z.vendorPrefixes=function(e,t,n){return"word"==e?(y="property",q(n,t,"block",0)):U(n)},z.pseudo=function(e,t,n){return X(oe(t.string))?G(e,t,n):(t.match(/^[a-z-]+/),y="variable-3",re(t)?q(n,t,"block"):U(n))},z.atBlock=function(e,t,n){if("("==e)return q(n,t,"atBlock_parens");if(ee(e,t))return q(n,t,"block");if(te(e,t))return q(n,t,"interpolation");if("word"==e){var i=t.current().toLowerCase();if(y=/^(only|not|and|or)$/.test(i)?"keyword":E.hasOwnProperty(i)?"tag":A.hasOwnProperty(i)?"attribute":M.hasOwnProperty(i)?"property":S.hasOwnProperty(i)?"string-2":J(t.current()),"tag"==y&&re(t))return q(n,t,"block")}return"operator"==e&&/^(not|and|or)$/.test(t.current())&&(y="keyword"),n.context.type},z.atBlock_parens=function(e,t,n){if("{"==e||"}"==e)return n.context.type;if(")"==e)return re(t)?q(n,t,"block"):q(n,t,"atBlock");if("word"==e){var i=t.current().toLowerCase();return y=J(i),/^(max|min)/.test(i)&&(y="property"),"tag"==y&&(y=k.test(i)?"variable-2":"atom"),n.context.type}return z.atBlock(e,t,n)},z.keyframes=function(e,t,n){return"0"==t.indentation()&&("}"==e&&ie(t)||"]"==e||"hash"==e||"qualifier"==e||Y(t.current()))?G(e,t,n):"{"==e?q(n,t,"keyframes"):"}"==e?ie(t)?U(n,!0):q(n,t,"keyframes"):"unit"==e&&/^[0-9]+\%$/.test(t.current())?q(n,t,"keyframes"):"word"==e&&(y=J(t.current()),"block-keyword"==y)?(y="keyword",q(n,t,"keyframes")):/@(font-face|media|supports|(-moz-)?document)/.test(e)?q(n,t,re(t)?"block":"atBlock"):"mixin"==e?q(n,t,"block",0):n.context.type},z.interpolation=function(e,t,n){return"{"==e&&U(n)&&q(n,t,"block"),"}"==e?t.string.match(/^\s*(\.|#|:|\[|\*|&|>|~|\+|\/)/i)||t.string.match(/^\s*[a-z]/i)&&Y(oe(t))?q(n,t,"block"):!t.string.match(/^(\{|\s*\&)/)||t.match(/\s*[\w-]/,!1)?q(n,t,"block",0):q(n,t,"block"):"variable-name"==e?q(n,t,"variableName",0):("word"==e&&(y=J(t.current()),"tag"==y&&(y="atom")),n.context.type)},z.extend=function(e,t,n){return"["==e||"="==e?"extend":"]"==e?U(n):"word"==e?(y=J(t.current()),"extend"):U(n)},z.variableName=function(e,t,n){return"string"==e||"["==e||"]"==e||t.current().match(/^(\.|\$)/)?(t.current().match(/^\.[\w-]+/i)&&(y="variable-2"),"variableName"):G(e,t,n)},{startState:function(e){return{tokenize:null,state:"block",context:new W("block",e||0,null)}},token:function(e,t){return!t.tokenize&&e.eatSpace()?null:(p=(t.tokenize||B)(e,t),p&&"object"==_typeof2(p)&&(b=p[1],p=p[0]),y=p,t.state=z[t.state](b,e,t),y)},indent:function(e,t,n){var i=e.context,r=t&&t.charAt(0),o=i.indent,a=oe(t),s=n.match(/^\s*/)[0].replace(/\t/g,x).length,l=e.context.prev?e.context.prev.line.firstWord:"",c=e.context.prev?e.context.prev.line.indent:s;return i.prev&&("}"==r&&("block"==i.type||"atBlock"==i.type||"keyframes"==i.type)||")"==r&&("parens"==i.type||"atBlock_parens"==i.type)||"{"==r&&"at"==i.type)?o=i.indent-w:/(\})/.test(r)||(/@|\$|\d/.test(r)||/^\{/.test(t)||/^\s*\/(\/|\*)/.test(t)||/^\s*\/\*/.test(l)||/^\s*[\w-\.\[\]\'\"]+\s*(\?|:|\+)?=/i.test(t)||/^(\+|-)?[a-z][\w-]*\(/i.test(t)||/^return/.test(t)||Z(a)?o=s:/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(r)||Y(a)?o=/\,\s*$/.test(l)?c:/^\s+/.test(n)&&(/(\.|#|:|\[|\*|&|>|~|\+|\/)/.test(l)||Y(l))?s<=c?c:c+w:s:/,\s*$/.test(n)||!Q(a)&&!X(a)||(o=Z(l)?s<=c?c:c+w:/^\{/.test(l)?s<=c?s:c+w:Q(l)||X(l)?s>=c?c:s:/^(\.|#|:|\[|\*|&|@|\+|\-|>|~|\/)/.test(l)||/=\s*$/.test(l)||Y(l)||/^\$[\w-\.\[\]\'\"]/.test(l)?c+w:s)),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"indent"}}));var t=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","bgsound","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","var","video"],n=["domain","regexp","url-prefix","url"],i=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],r=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],o=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode","font-smoothing","osx-font-smoothing"],a=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],s=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],l=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],c=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small","bicubic","optimizespeed","grayscale","row","row-reverse","wrap","wrap-reverse","column-reverse","flex-start","flex-end","space-between","space-around","unset"],u=["in","and","or","not","is not","is a","is","isnt","defined","if unless"],d=["for","if","else","unless","from","to"],h=["null","true","false","href","title","type","not-allowed","readonly","disabled"],f=["@font-face","@keyframes","@media","@viewport","@page","@host","@supports","@block","@css"],p=t.concat(n,i,r,o,a,l,c,s,u,d,h,f);function m(e){return e=e.sort((function(e,t){return t>e})),new RegExp("^(("+e.join(")|(")+"))\\b")}function g(e){for(var t={},n=0;n>1,g=23===t?r(2,-24)-r(2,-77):0,v=e<0||0===e&&1/e<0?1:0,b=0;for(e=i(e),e!=e||e===n?(u=e!=e?1:0,c=p):(c=o(a(e)/s),e*(d=r(2,-c))<1&&(c--,d*=2),e+=c+m>=1?g/d:g*r(2,1-m),e*d>=2&&(c++,d/=2),c+m>=p?(u=0,c=p):c+m>=1?(u=(e*d-1)*r(2,t),c+=m):(u=e*r(2,m-1)*r(2,t),c=0));t>=8;h[b++]=255&u,u/=256,t-=8);for(c=c<0;h[b++]=255&c,c/=256,f-=8);return h[--b]|=128*v,h},c=function(e,t){var i,o=e.length,a=8*o-t-1,s=(1<>1,c=a-7,u=o-1,d=e[u--],h=127&d;for(d>>=7;c>0;h=256*h+e[u],u--,c-=8);for(i=h&(1<<-c)-1,h>>=-c,c+=t;c>0;i=256*i+e[u],u--,c-=8);if(0===h)h=1-l;else{if(h===s)return i?NaN:d?-n:n;i+=r(2,t),h-=l}return(d?-1:1)*i*r(2,h-t)};e.exports={pack:l,unpack:c}},"77e9":function(e,t,n){var i=n("7a41");e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"79ef":function ef(module,exports,__webpack_require__){(function(module){var __WEBPACK_AMD_DEFINE_FACTORY__,__WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;__webpack_require__("c975"),__webpack_require__("ac1f"),__webpack_require__("466d"),__webpack_require__("5319"),__webpack_require__("1276");var _typeof=__webpack_require__("7037");(function(e){"object"==_typeof(exports)&&"object"==_typeof(module)?e(__webpack_require__("f3a7")):(__WEBPACK_AMD_DEFINE_ARRAY__=[__webpack_require__("f3a7")],__WEBPACK_AMD_DEFINE_FACTORY__=e,__WEBPACK_AMD_DEFINE_RESULT__="function"===typeof __WEBPACK_AMD_DEFINE_FACTORY__?__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__):__WEBPACK_AMD_DEFINE_FACTORY__,void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))})((function(CodeMirror){"use strict";CodeMirror.defineMode("atformula",(function(e,t){t.client;var n=t.atoms||{false:!0,true:!0,null:!0},i=t.builtin||{},r=t.keywords||{},o=t.atKeywords||{},a=(t.operatorChars,t.support||{}),s=(t.hooks,t.dateSQL||{date:!0,time:!0,timestamp:!0}),l=(t.backslashStringEscapes,t.brackets||/^[\{}\(\)\[\]]/),c=t.punctuation||/^[;.,:]/,u=t.bokeys||{};function d(e,t){var d=e.next();if(a.hexNumber&&("0"==d&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==d||"X"==d)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(l.test(d))return e.eatWhile(l),"bracket";if(c.test(d))return e.eatWhile(c),"punctuation";e.eatWhile(/^[_\w\d]/);var h=e.current();return s.hasOwnProperty(h)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":n.hasOwnProperty(h)?"atom":i.hasOwnProperty(h)?"builtin":r.hasOwnProperty(h)||o.hasOwnProperty(h)?"keyword":u.hasOwnProperty(h)?"param":"test"}function h(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function f(e){e.indent=e.context.indent,e.context=e.context.prev}return{startState:function(){return{tokenize:d,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==d&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var i=e.current();return"("==i?h(e,t,")"):"["==i?h(e,t,"]"):t.context&&t.context.type==i&&f(t),n},indent:function(t,n){var i=t.context;if(!i)return CodeMirror.Pass;var r=n.charAt(0)==i.type;return i.align?i.col+(r?0:1):i.indent+(r?0:e.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:a.commentSlashSlash?"//":a.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}})),function(){var defaultAtExpressKeywords="@AWS5SessionId() @AWS5WebURL(*url) @TaskSameHuman(*nextUserTaskDefId,isPerformer,taskInstId) @abs(*num) @activityDefDurationTime(taskInstId) @activityDefExt(taskInstId) @activityDefId(taskInstId) @activityDefName(taskInstId) @activityDefNo(taskInstId) @activityDefWarningTime(taskInstId) @and(*logical1,*logical2,logical3,logical4,logical5) @ascii(*str) @boItemPropVal(*boName,*fieldName,*prop) @calc(*expression) @char(*ascii) @clientIp @companyExt1(contextType,contextId) @companyExt2(contextType,contextId) @companyExt3(contextType,contextId) @companyExt4(contextType,contextId) @companyExt5(contextType,contextId) @companyId(contextType,contextId) @companyName(contextType,contextId) @companyNo(contextType,contextId) @companyType(contextType,contextId) @date() @date2Chinese(*date) @dateAdd(*datepart,*number,*date) @datetime() @dayOfMonth(date) @dayOfYear(date) @decode(*str) @departmentExt1(contextType,contextId) @departmentExt2(contextType,contextId) @departmentExt3(contextType,contextId) @departmentExt4(contextType,contextId) @departmentExt5(contextType,contextId) @departmentId(contextType,contextId) @departmentManager(isIgnoreMe,contextType,contextId) @departmentName(contextType,contextId) @departmentNo(contextType,contextId) @departmentPathId(contextType,contextId) @departmentPathName(contextType,contextId) @departmentType(contextType,contextId) @departmentZone(contextType,contextId) @deviceType() @dictValue(*dictKey,*itemNo,fieldName) @encode(*str) @equals(*str1,*str2) @execJXPath(*jxpath) @execJavaBean(*appId,*className,param) @form(*boName,*fieldName,processInstId) @formDefId() @formItemDefId() @formTheme @getAppName(appId) @getDWCondition(*fieldName,*fieldValue) @getHistoryTaskNum(@uid) @getJgdwType @getMyCreateTaskNum(@uid) @getProperty(*name,appId) @getTodoTaskNum(@uid) @gridAvg(*boName,*fieldName,sqlClause,processInstId) @gridCount(*boName,sqlClause,processInstId) @gridFirst(*boName,*fieldName,sqlClause,processInstId) @gridLast(*boName,*fieldName,sqlClause,processInstId) @gridMax(*boName,*fieldName,sqlClause,processInstId) @gridMin(*boName,*fieldName,sqlClause,processInstId) @gridSum(*boName,*fieldName,sqlClause,processInstId) @hour(datetime) @i18n(*key,*appId,lang) @if(*logical,*valueTrue,*valueFalse) @in(*str1,*str2,str3,str4,str5) @indexOf(*str1,*str2) @isActive(*appId) @isDepartmentManager(contextType,contextId) @isLeapYear(date) @isProcessEnd(contextType,contextId) @isSubProcess(contextType,contextId) @isTaskEnd(taskInstId) @lang() @lastIndexOf(*str1,*str2) @len(*str) @lessThan(*num1,*num2) @loadFile(*appId,*fileName) @lower(*str) @lpad(*str,*len,padStr) @max(*num1,*num2,num3,num4,num5) @md5(*str) @min(*num1,*num2,num3,num4,num5) @minute(datetime) @mod(*num1,*num2) @month(date) @monthBegin(date) @monthEnd(date) @nextDate(date) @nullValue(*str1,*str2) @numAdd(*num1,*num2,num3,num4,num5) @numDiv(*num1,*num2,scale) @numMul(*num1,*num2) @numSub(*num1,*num2,num3,num4,num5) @or(*logical1,*logical2,logical3,logical4,logical5) @parentForm(*boName,*parentBoName,*parentFieldName) @phonetic(*str) @portalUrl() @preDate(date) @processBusinessKey(contextType,contextId) @processComment(*activityId,*policy,contextType,contextId) @processCostTime(contextType,contextId) @processCreateTime(contextType,contextId) @processCreateUser(contextType,contextId) @processDefAppId(contextType,contextId) @processDefDurationTime(contextType,contextId) @processDefGroupId(contextType,contextId) @processDefGroupName(contextType,contextId) @processDefId(contextType,contextId) @processDefName(contextType,contextId) @processDefVersionId(contextType,contextId) @processDefWarningTime(contextType,contextId) @processEndTime(contextType,contextId) @processExpireTime(contextType,contextId) @processExt1(contextType,contextId) @processExt2(contextType,contextId) @processExt3(contextType,contextId) @processExt4(contextType,contextId) @processExt5(contextType,contextId) @processExt6(contextType,contextId) @processExt7(contextType,contextId) @processExt8(contextType,contextId) @processId(businessKey) @processParentId(contextType,contextId) @processParentTaskId(contextType,contextId) @processStartTime(contextType,contextId) @processStatus(contextType,contextId) @processTitle(contextType,contextId) @processVar(*varName,contextType,contextId) @quarter(date) @quarterBegin(date) @quarterEnd(date) @replace(*str,*oldStr,*newStr) @rmb(*num) @roleExt1(contextType,contextId) @roleExt2(contextType,contextId) @roleExt3(contextType,contextId) @roleExt4(contextType,contextId) @roleExt5(contextType,contextId) @roleName(contextType,contextId) @roleNameKey(contextType,contextId) @roleNoUsers(*no,delimiter) @roleUsers(*roleId,delimiter) @round(*num,scale) @rpad(*str,*len,padStr) @second(datetime) @sequence(varName,padLen,padStr) @sequenceMonth(varName,padLen,padStr) @sequenceYear(varName,padLen,padStr) @serverInstance() @serverProperty(*name) @sha256(*str,*password) @sid() @sqlClauseOfManager(*fieldName,isSubDepartment) @sqlSet(*sql,separator,cc) @sqlValue(*sql,cc) @strAdd(str1,str2) @substring(*str,begin,end) @sysProperty(name) @taskBeginTime(taskInstId) @taskCostTime(taskInstId) @taskDueTime(taskInstId) @taskEndTime(taskInstId) @taskExpireTime(taskInstId) @taskExt1(taskInstId) @taskExt2(taskInstId) @taskExt3(taskInstId) @taskExt4(taskInstId) @taskExt5(taskInstId) @taskExt6(taskInstId) @taskExt7(taskInstId) @taskExt8(taskInstId) @taskHumanType(taskInstId) @taskId() @taskOwner(taskInstId) @taskPreHumanTaskId(taskInstId) @taskPreTaskId(taskInstId) @taskPriority(taskInstId) @taskReadTime(taskInstId) @taskStatus(taskInstId) @taskTarget(taskInstId) @taskTitle(taskInstId) @teamUsers(*teamId,delimiter) @time(datetime) @timestemp() @trim(*str) @uid(uidAliasName,delimiter) @upper(*str) @urlDecode(*str) @urlEncode(*str,charset) @user(key,uidAliasName,delimiter) @userEmail(uidAliasName,delimiter) @userExt1(uidAliasName,delimiter) @userExt2(uidAliasName,delimiter) @userExt3(uidAliasName,delimiter) @userExt4(uidAliasName,delimiter) @userExt5(uidAliasName,delimiter) @userManager(uidAliasName,type,delimiter,includeSelf) @userMobile(uidAliasName,delimiter) @userName(uidAliasName,delimiter) @userNo(uidAliasName,delimiter) @userPhoto(uidAliasName) @userPositionLayer(uidAliasName,delimiter) @userPositionName(uidAliasName,delimiter) @userPositionNo(uidAliasName,delimiter) @userTel(uidAliasName,delimiter) @userUniqueId(uidAliasName,delimiter) @uuid() @weekDay(date) @weekOfYear(date) @year(date) ",keywords="SUM MAX MIN AVG COUNT ",atParams="",isSeverKeys=!1,exPressData="undefined"!==typeof window.atExpressKeywords?window:window.settingParam&&"undefined"!==typeof window.settingParam.atExpressKeywords?window.settingParam:"undefined"!==typeof settingParam?eval("settingParam"):null;null!=exPressData&&null!=exPressData.atExpressKeywords?(defaultAtExpressKeywords=exPressData.atExpressKeywords,isSeverKeys=!0):keywords+=defaultAtExpressKeywords.replace(/\(.*?\)/g,""),""!==atParams&&null!=exPressData&&null!=exPressData.atExpressParams&&(atParams=exPressData.atExpressParams);var boKeywords="";function set(e){for(var t={},n=e.split(" "),i=0;i-1&&(keywords+=boKeywords[r].id.split(".")[1]+" ");return e}null!=exPressData&&null!=exPressData.boExpressKeywords&&(boKeywords=exPressData.boExpressKeywords),CodeMirror.defineMIME("awsAt",{name:"atformula",keywords:getKeyWords(),atKeywords:set(keywords),atoms:set("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,bokeys:set(atParams)})}()}))}).call(this,__webpack_require__("62e4")(module))},"7a41":function(e,t){e.exports=function(e){return"object"===_typeof2(e)?null!==e:"function"===typeof e}},"7a77":function(e,t,n){"use strict";function i(e){this.message=e}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,e.exports=i},"7aac":function(e,t,n){"use strict";var i=n("c532");e.exports=i.isStandardBrowserEnv()?function(){return{write:function(e,t,n,r,o,a){var s=[];s.push(e+"="+encodeURIComponent(t)),i.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),i.isString(r)&&s.push("path="+r),i.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7b00":function(e,t,n){(function(e){e(n("56b3"))})((function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?_(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?_("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?_(null,n):e.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(e.current().toLowerCase())&&(t.tokenize=S),_("variable callee","variable")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),_("property","word")):_(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),_("number","unit")):e.match(/^-[\w\\\-]*/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?_("variable-2","variable-definition"):_("variable-2","variable")):e.match(/^\w+-/)?_("meta","meta"):void 0}function C(e){return function(t,n){var i,r=!1;while(null!=(i=t.next())){if(i==e&&!r){")"==e&&t.backUp(1);break}r=!r&&"\\"==i}return(i==e||!r&&")"!=e)&&(n.tokenize=null),_("string","string")}}function S(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=C(")"),_(null,"(")}function O(e,t,n){this.type=e,this.indent=t,this.prev=n}function T(e,t,n,i){return e.context=new O(n,t.indentation()+(!1===i?0:a),e.context),n}function E(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function D(e,t,n){return N[n.context.type](e,t,n)}function M(e,t,n,i){for(var r=i||1;r>0;r--)n.context=n.context.prev;return D(e,t,n)}function A(e){var t=e.current().toLowerCase();o=v.hasOwnProperty(t)?"atom":g.hasOwnProperty(t)?"keyword":"variable"}var N={top:function(e,t,n){if("{"==e)return T(n,t,"block");if("}"==e&&n.context.prev)return E(n);if(w&&/@component/i.test(e))return T(n,t,"atComponentBlock");if(/^@(-moz-)?document$/i.test(e))return T(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(e))return T(n,t,"atBlock");if(/^@(font-face|counter-style)/i.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return T(n,t,"at");if("hash"==e)o="builtin";else if("word"==e)o="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return T(n,t,"interpolation");if(":"==e)return"pseudo";if(b&&"("==e)return T(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var i=t.current().toLowerCase();return h.hasOwnProperty(i)?(o="property","maybeprop"):f.hasOwnProperty(i)?(o=x?"string-2":"property","maybeprop"):b?(o=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(o+=" error","maybeprop")}return"meta"==e?"block":b||"hash"!=e&&"qualifier"!=e?N.top(e,t,n):(o="error","block")},maybeprop:function(e,t,n){return":"==e?T(n,t,"prop"):D(e,t,n)},prop:function(e,t,n){if(";"==e)return E(n);if("{"==e&&b)return T(n,t,"propBlock");if("}"==e||"{"==e)return M(e,t,n);if("("==e)return T(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)A(t);else if("interpolation"==e)return T(n,t,"interpolation")}else o+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?E(n):"word"==e?(o="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?M(e,t,n):")"==e?E(n):"("==e?T(n,t,"parens"):"interpolation"==e?T(n,t,"interpolation"):("word"==e&&A(t),"parens")},pseudo:function(e,t,n){return"meta"==e?"pseudo":"word"==e?(o="variable-3",n.context.type):D(e,t,n)},documentTypes:function(e,t,n){return"word"==e&&l.hasOwnProperty(t.current())?(o="tag",n.context.type):N.atBlock(e,t,n)},atBlock:function(e,t,n){if("("==e)return T(n,t,"atBlock_parens");if("}"==e||";"==e)return M(e,t,n);if("{"==e)return E(n)&&T(n,t,b?"block":"top");if("interpolation"==e)return T(n,t,"interpolation");if("word"==e){var i=t.current().toLowerCase();o="only"==i||"not"==i||"and"==i||"or"==i?"keyword":c.hasOwnProperty(i)?"attribute":u.hasOwnProperty(i)?"property":d.hasOwnProperty(i)?"keyword":h.hasOwnProperty(i)?"property":f.hasOwnProperty(i)?x?"string-2":"property":v.hasOwnProperty(i)?"atom":g.hasOwnProperty(i)?"keyword":"error"}return n.context.type},atComponentBlock:function(e,t,n){return"}"==e?M(e,t,n):"{"==e?E(n)&&T(n,t,b?"block":"top",!1):("word"==e&&(o="error"),n.context.type)},atBlock_parens:function(e,t,n){return")"==e?E(n):"{"==e||"}"==e?M(e,t,n,2):N.atBlock(e,t,n)},restricted_atBlock_before:function(e,t,n){return"{"==e?T(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(o="variable","restricted_atBlock_before"):D(e,t,n)},restricted_atBlock:function(e,t,n){return"}"==e?(n.stateArg=null,E(n)):"word"==e?(o="@font-face"==n.stateArg&&!p.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!m.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},keyframes:function(e,t,n){return"word"==e?(o="variable","keyframes"):"{"==e?T(n,t,"top"):D(e,t,n)},at:function(e,t,n){return";"==e?E(n):"{"==e||"}"==e?M(e,t,n):("word"==e?o="tag":"hash"==e&&(o="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?E(n):"{"==e||";"==e?M(e,t,n):("word"==e?o="variable":"variable"!=e&&"("!=e&&")"!=e&&(o="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:i?"block":"top",stateArg:null,context:new O(i?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||k)(e,t);return n&&"object"==_typeof2(n)&&(r=n[1],n=n[0]),o=n,"comment"!=r&&(t.state=N[t.state](r,e,t)),o},indent:function(e,t){var n=e.context,i=t&&t.charAt(0),r=n.indent;return"prop"!=n.type||"}"!=i&&")"!=i||(n=n.prev),n.prev&&("}"!=i||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=i||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=i||"at"!=n.type&&"atBlock"!=n.type)||(r=Math.max(0,n.indent-a)):(n=n.prev,r=n.indent)),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:y,fold:"brace"}}));var n=["domain","regexp","url","url-prefix"],i=t(n),r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],o=t(r),a=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover","prefers-color-scheme"],s=t(a),l=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light"],c=t(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","paint-order","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),h=["border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],f=t(h),p=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(p),g=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=t(g),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],y=t(b),w=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","manipulation","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],x=t(w),_=n.concat(r).concat(a).concat(l).concat(u).concat(h).concat(b).concat(w);function k(e,t){var n,i=!1;while(null!=(n=e.next())){if(i&&"/"==n){t.tokenize=null;break}i="*"==n}return["comment","comment"]}e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:m,counterDescriptors:v,colorKeywords:y,valueKeywords:x,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:x,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/,!1)&&[null,null]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:o,mediaFeatures:s,mediaValueKeywords:c,propertyKeywords:d,nonStandardPropertyKeywords:f,colorKeywords:y,valueKeywords:x,fontProperties:m,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=k,k(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:o,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:f,fontProperties:m,counterDescriptors:v,colorKeywords:y,valueKeywords:x,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=k,k(e,t))}},name:"css",helperType:"gss"})}))},"7b0b":function(e,t,n){var i=n("1d80");e.exports=function(e){return Object(i(e))}},"7b3e":function(e,t,n){"use strict";var i,r=n("a3de"); - /** - * Checks if an event is supported in the current execution environment. - * - * NOTE: This will not work correctly for non-generic events such as `change`, - * `reset`, `load`, `error`, and `select`. - * - * Borrows from Modernizr. - * - * @param {string} eventNameSuffix Event name, e.g. "click". - * @param {?boolean} capture Check if the capture phase is supported. - * @return {boolean} True if the event is supported. - * @internal - * @license Modernizr 3.0.0pre (Custom Build) | MIT - */function o(e,t){if(!r.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,o=n in document;if(!o){var a=document.createElement("div");a.setAttribute(n,"return;"),o="function"===typeof a[n]}return!o&&i&&"wheel"===e&&(o=document.implementation.hasFeature("Events.wheel","3.0")),o}r.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=o},"7c73":function(e,t,n){var i,r=n("825a"),o=n("37e8"),a=n("7839"),s=n("d012"),l=n("1be4"),c=n("cc12"),u=n("f772"),d=">",h="<",f="prototype",p="script",m=u("IE_PROTO"),g=function(){},v=function(e){return h+p+d+e+h+"/"+p+d},b=function(e){e.write(v("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){var e,t=c("iframe"),n="java"+p+":";return t.style.display="none",l.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(v("document.F=Object")),e.close(),e.F},w=function(){try{i=document.domain&&new ActiveXObject("htmlfile")}catch(t){}w=i?b(i):y();var e=a.length;while(e--)delete w[f][a[e]];return w()};s[m]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(g[f]=r(e),n=new g,g[f]=null,n[m]=e):n=w(),void 0===t?n:o(n,t)}},"7db0":function(e,t,n){"use strict";var i=n("23e7"),r=n("b727").find,o=n("44d2"),a=n("ae40"),s="find",l=!0,c=a(s);s in[]&&Array(1)[s]((function(){l=!1})),i({target:"Array",proto:!0,forced:l||!c},{find:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}}),o(s)},"7dd0":function(e,t,n){"use strict";var i=n("23e7"),r=n("9ed3"),o=n("e163"),a=n("d2bb"),s=n("d44e"),l=n("9112"),c=n("6eeb"),u=n("b622"),d=n("c430"),h=n("3f8c"),f=n("ae93"),p=f.IteratorPrototype,m=f.BUGGY_SAFARI_ITERATORS,g=u("iterator"),v="keys",b="values",y="entries",w=function(){return this};e.exports=function(e,t,n,u,f,x,_){r(n,t,u);var k,C,S,O=function(e){if(e===f&&A)return A;if(!m&&e in D)return D[e];switch(e){case v:return function(){return new n(this,e)};case b:return function(){return new n(this,e)};case y:return function(){return new n(this,e)}}return function(){return new n(this)}},T=t+" Iterator",E=!1,D=e.prototype,M=D[g]||D["@@iterator"]||f&&D[f],A=!m&&M||O(f),N="Array"==t&&D.entries||M;if(N&&(k=o(N.call(new e)),p!==Object.prototype&&k.next&&(d||o(k)===p||(a?a(k,p):"function"!=typeof k[g]&&l(k,g,w)),s(k,T,!0,!0),d&&(h[T]=w))),f==b&&M&&M.name!==b&&(E=!0,A=function(){return M.call(this)}),d&&!_||D[g]===A||l(D,g,A),h[t]=A,f)if(C={values:O(b),keys:x?A:O(v),entries:O(y)},_)for(S in C)(m||E||!(S in D))&&c(D,S,C[S]);else i({target:t,proto:!0,forced:m||E},C);return C}},"7e12":function(e,t,n){var i=n("da84"),r=n("58a8").trim,o=n("5899"),a=i.parseFloat,s=1/a(o+"-0")!==-1/0;e.exports=s?function(e){var t=r(String(e)),n=a(t);return 0===n&&"-"==t.charAt(0)?-0:n}:a},"7f4d":function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){for(var t=1,n=arguments.length;t0&&void 0!==arguments[0]?arguments[0]:"";return String(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")};var m=t.arrayFindIndex=function(e,t){for(var n=0;n!==e.length;++n)if(t(e[n]))return n;return-1},g=(t.arrayFind=function(e,t){var n=m(e,t);return-1!==n?e[n]:void 0},t.coerceTruthyValueToArray=function(e){return Array.isArray(e)?e:e?[e]:[]},t.isIE=function(){return!a.default.prototype.$isServer&&!isNaN(Number(document.documentMode))},t.isEdge=function(){return!a.default.prototype.$isServer&&navigator.userAgent.indexOf("Edge")>-1},t.isFirefox=function(){return!a.default.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)},t.autoprefixer=function(e){if("object"!==("undefined"===typeof e?"undefined":r(e)))return e;var t=["transform","transition","animation"],n=["ms-","webkit-"];return t.forEach((function(t){var i=e[t];t&&i&&n.forEach((function(n){e[n+t]=i}))})),e},t.kebabCase=function(e){var t=/([^-])([A-Z])/g;return e.replace(t,"$1-$2").replace(t,"$1-$2").toLowerCase()},t.capitalize=function(e){return(0,s.isString)(e)?e.charAt(0).toUpperCase()+e.slice(1):e},t.looseEqual=function(e,t){var n=(0,s.isObject)(e),i=(0,s.isObject)(t);return n&&i?JSON.stringify(e)===JSON.stringify(t):!n&&!i&&String(e)===String(t)}),v=t.arrayEquals=function(e,t){if(e=e||[],t=t||[],e.length!==t.length)return!1;for(var n=0;n1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:r(l,n);while(c>s)t[s++]=e;return t}},"820c":function(e,t,n){"use strict";var i=n("391f"),r=n.n(i);r.a},"825a":function(e,t,n){var i=n("861d");e.exports=function(e){if(!i(e))throw TypeError(String(e)+" is not an object");return e}},"82bb":function(e,t,n){n("4de4"),n("c975"),n("a15b"),n("ac1f"),n("466d"),n("5319"),n("1276");var i=n("6374"),r=n("7037");function o(e,t,n){var i=document.createElement("span");return i.setAttribute("awsui-qtip","text:'"+e+"'"),i.setAttribute("class","CodeMirror-widget cm-field-"+n),i.setAttribute("data-field",e),i.innerHTML=''+t+"",i}function a(e,t){t.markText(e.from,e.to,{handleMouseEvents:!0,atomic:!0,replacedWith:o(e.field,e.label,e.invalid)}),window.CodeMirror.signal(t.doc.cm,"endCompletion",t.doc.cm)}function s(e,t){if(Array.isArray(e))for(var n=0,i=e.length;n-1||window.navigator.userAgent.indexOf("Trident")>-1))return e.split(t).filter(Boolean);var n=function(){var n=[],r=e.match(t);if(0==r.length)n.push(e);else{var o,a=e,s=i(r);try{var l=function(){var e=o.value;a.replace(e,(function(t,i,r){i>0&&n.push(r.substring(0,i)),n.push(e),a=r.substring(i+t.length)}))};for(s.s();!(o=s.n()).done;)l()}catch(c){s.e(c)}finally{s.f()}a.length>0&&n.push(a)}return{v:n}}();return"object"===r(n)?n.v:void 0}window.initFormulaEditor=function(e,t){var n=[],i=[];if(e){var r=[e];s(r,(function(e,r){var o="",a=c(r);s(a,(function(n,r){if(!l(r)){var a,s,c="BOITEMNAME";if(/^(@form\([0-9a-zA-Z._]+,[0-9a-zA-Z._]+\))/.test(r)){if(s=r.replace("@form(","").replace(")","").replace(",","."),window.formulaLabelMap&&(a=window.formulaLabelMap[s]),l(a))return void(o+=r)}else if(/^(%_[0-9a-zA-Z._]+_%)/.test(r)){if(s=r.replace("%_","").replace("_%",""),window.formulaLabelMap&&(a=window.formulaLabelMap[s]),l(a))return void(o+=r);c="common_field"}else if(/^\\,/.test(r))a=",";else if(/^\\\(/.test(r))a="(";else if(/^\\\)/.test(r))a=")";else if(/^\\\\/.test(r))a="\\";else if(/^(\$\[[0-9a-zA-Z._]+\])/.test(r)){s=r.replace("$[","").replace("]","");var u=t.getOption("contextData");if("undefined"!=typeof u&&"undefined"!=typeof u.data&&Array.isArray(u.data))for(var d=u.data,h=0;h-1){var p=f.replace("$_BO_","");if(null!=p&&null!=window.formulaLabelMap[p]&&null!=window.formulaLabelMap[p][s]){a=window.formulaLabelMap[p][s];break}}}if("undefined"==typeof a&&window.formulaLabelMap&&(a=window.formulaLabelMap[s]),l(a))return void(o+=r);a="$["+a+"]",c="source"}else if(/^(#\[[0-9a-zA-Z._]+\])/.test(r)){s=r.replace("#[","").replace("]","");var m=t.getOption("contextData");if("undefined"!=typeof m&&"undefined"!=typeof m.data&&Array.isArray(m.data))for(var g=m.data,v=0;v-1){var y=b.replace("#_BO_","");if(null!=y&&null!=window.formulaLabelMap[y]&&null!=window.formulaLabelMap[y][s]){a=window.formulaLabelMap[y][s];break}}}if("undefined"==typeof a&&(s=r.replace("#[","").replace("]",""),window.formulaLabelMap&&(a=window.formulaLabelMap[s])),l(a))return void(o+=r);a="#["+a+"]",c="target"}else if(/^([0-9a-zA-Z._]+,[0-9a-zA-Z._]+)/.test(r)){if(s=r.replace(",","."),window.formulaLabelMap&&(a=window.formulaLabelMap[s]),l(a))return void(o+=r);c="BOITEMNAME_PARAM"}else if(/^(@processVar\([\u4e00-\u9fa5_a-zA-Z0-9]+\))/.test(r)){if(a=r.replace("@processVar(","").replace(")",""),l(a))return void(o+=r);c="common_field"}else if(/^(@env\([\u4e00-\u9fa5_a-zA-Z0-9]+[\,(ext1|ext2|ext3)]*\))/.test(r)){if(a=r.replace("@env(","").replace(")",""),l(a))return void(o+=r);c="ccVar"}else{if(!/^(@[uid|companyId|departmentId|roleId|teamId]+\([0-9,A-z._-]+\))/.test(r))return void(o+=r);if(s=r,window.formulaLabelMap&&(a=window.formulaLabelMap[s]),l(a))return void(o+=r);r.indexOf("uid")>-1?c="User":r.indexOf("companyId")>-1?c="Company":r.indexOf("departmentId")>-1?c="Department":r.indexOf("roleId")>-1?c="Role":r.indexOf("teamId")>-1&&(c="Team")}var w=window.CodeMirror.Pos(e,o.length);o+=r,v=window.CodeMirror.Pos(e,o.length),i.push({from:w,to:v,field:r,invalid:c,label:a})}})),n.push(o)}))}t.setValue(n.join("\n")),s(i,(function(e,n){a(n,t)}))}},"82f8":function(e,t,n){"use strict";var i=n("ebb5"),r=n("4d64").includes,o=i.aTypedArray,a=i.exportTypedArrayMethod;a("includes",(function(e){return r(o(this),e,arguments.length>1?arguments[1]:void 0)}))},"83ab":function(e,t,n){var i=n("d039");e.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(e,t,n){"use strict";var i=n("d925"),r=n("e683");e.exports=function(e,t){return e&&!i(t)?r(e,t):t}},8418:function(e,t,n){"use strict";var i=n("c04e"),r=n("9bf2"),o=n("5c6c");e.exports=function(e,t,n){var a=i(t);a in e?r.f(e,a,o(0,n)):e[a]=n}},"841c":function(e,t,n){"use strict";var i=n("d784"),r=n("825a"),o=n("1d80"),a=n("129f"),s=n("14c3");i("search",1,(function(e,t,n){return[function(t){var n=o(this),i=void 0==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,e,this);if(i.done)return i.value;var o=r(e),l=String(this),c=o.lastIndex;a(c,0)||(o.lastIndex=0);var u=s(o,l);return a(o.lastIndex,c)||(o.lastIndex=c),null===u?-1:u.index}]}))},"845f":function(e,t,n){n("a4d3"),n("e01a"),n("944a"),n("99af"),n("b0c0"),n("0c47"),n("23dc"),n("d3b7");var i=n("7037");e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===i(e)&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=99)}({0:function(e,t,n){"use strict";function i(e,t,n,i,r,o,a,s){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):r&&(l=s?function(){r.call(this,this.$root.$options.shadowRoot)}:r),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return i}))},99:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-button-group"},[e._t("default")],2)},r=[];i._withStripped=!0;var o={name:"ElButtonGroup"},a=o,s=n(0),l=Object(s["a"])(a,i,r,!1,null,null,null);l.options.__file="packages/button/src/button-group.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)},t["default"]=c}})},"857a":function(e,t,n){var i=n("1d80"),r=/"/g;e.exports=function(e,t,n,o){var a=String(i(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(o).replace(r,""")+'"'),s+">"+a+""}},"85e7":function(e,t,n){var i=n("1a14"),r=n("77e9"),o=n("9876");e.exports=n("0bad")?Object.defineProperties:function(e,t){r(e);var n,a=o(t),s=a.length,l=0;while(s>l)i.f(e,n=a[l++],t[n]);return e}},"861d":function(e,t){e.exports=function(e){return"object"===_typeof2(e)?null!==e:"function"===typeof e}},8773:function(e,t,n){"use strict";var i=n("0b51"),r=n.n(i);r.a},"87d4":function(e,t,n){},8875:function(e,t,n){var i,r,o;(function(n,a){r=[],i=a,o="function"===typeof i?i.apply(t,r):i,void 0===o||(e.exports=o)})("undefined"!==typeof self&&self,(function(){function e(){if(document.currentScript)return document.currentScript;try{throw new Error}catch(d){var e,t,n,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,r=/@([^@]*):(\d+):(\d+)\s*$/gi,o=i.exec(d.stack)||r.exec(d.stack),a=o&&o[1]||!1,s=o&&o[2]||!1,l=document.location.href.replace(document.location.hash,""),c=document.getElementsByTagName("script");a===l&&(e=document.documentElement.outerHTML,t=new RegExp("(?:[^\\n]+?\\n){0,"+(s-2)+"}[^<]*