Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
ac217e7c
Commit
ac217e7c
authored
Dec 03, 2019
by
sgjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签升级
parent
b03361cd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
604 additions
and
493 deletions
+604
-493
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+10
-15
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+328
-29
SearchAction.java
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
+0
-426
ContentBean.java
src/main/java/net/mingsoft/cms/bean/ContentBean.java
+26
-0
IContentBiz.java
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
+11
-0
CategoryBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
+28
-10
ContentBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
+22
-1
ICategoryDao.xml
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
+1
-1
IContentDao.java
src/main/java/net/mingsoft/cms/dao/IContentDao.java
+27
-1
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+138
-0
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+11
-9
tree.js
src/main/webapp/static/plugins/tree-select/tree.js
+2
-1
No files found.
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
ac217e7c
...
...
@@ -31,7 +31,9 @@ import javax.servlet.http.HttpServletResponse;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
...
@@ -48,8 +50,6 @@ import net.mingsoft.basic.action.BaseAction;
import
net.mingsoft.basic.biz.IModelBiz
;
import
net.mingsoft.basic.entity.AppEntity
;
import
net.mingsoft.cms.bean.ColumnArticleIdBean
;
import
net.mingsoft.cms.biz.IArticleBiz
;
import
net.mingsoft.cms.constant.ModelCode
;
import
net.mingsoft.cms.util.CmsParserUtil
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IContentModelFieldBiz
;
...
...
@@ -76,7 +76,7 @@ public class GeneraterAction extends BaseAction {
* 文章管理业务层
*/
@Autowired
private
I
ArticleBiz
article
Biz
;
private
I
ContentBiz
content
Biz
;
/**
* 栏目管理业务层
...
...
@@ -99,11 +99,6 @@ public class GeneraterAction extends BaseAction {
@Autowired
protected
IContentModelFieldBiz
fieldBiz
;
/**
* 自定义模型业务层
*/
@Autowired
protected
IContentModelBiz
contentBiz
;
/**
* 更新主页
...
...
@@ -151,7 +146,7 @@ public class GeneraterAction extends BaseAction {
*
* @param request
* @param response
* @param
column
Id
* @param
Category
Id
*/
@RequestMapping
(
"/{CategoryId}/genernateColumn"
)
@RequiresPermissions
(
"cms:generate:column"
)
...
...
@@ -172,7 +167,7 @@ public class GeneraterAction extends BaseAction {
categoryEntity
.
setAppId
(
app
.
getAppId
());
columns
=
categoryBiz
.
query
(
categoryEntity
);
}
List
<
Co
lumnArticleId
Bean
>
articleIdList
=
null
;
List
<
Co
ntent
Bean
>
articleIdList
=
null
;
try
{
// 1、设置模板文件夹路径
// 获取栏目列表模版
...
...
@@ -181,7 +176,7 @@ public class GeneraterAction extends BaseAction {
if
(!
FileUtil
.
exist
(
ParserUtil
.
buildTempletPath
(
column
.
getCategoryUrl
())))
{
continue
;
}
articleIdList
=
articleBiz
.
queryIdsByCategoryIdForParser
(
Integer
.
parseInt
(
column
.
getCategoryId
()
),
null
,
null
);
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
column
.
getId
(
),
null
,
null
);
// 判断列表类型
switch
(
column
.
getCategoryType
())
{
//TODO 暂时先用字符串代替
...
...
@@ -190,7 +185,7 @@ public class GeneraterAction extends BaseAction {
break
;
case
"2"
:
// 单页
if
(
articleIdList
.
size
()==
0
){
Co
lumnArticleIdBean
columnArticleIdBean
=
new
ColumnArticleId
Bean
();
Co
ntentBean
columnArticleIdBean
=
new
Content
Bean
();
CopyOptions
copyOptions
=
CopyOptions
.
create
();
copyOptions
.
setIgnoreError
(
true
);
BeanUtil
.
copyProperties
(
column
,
columnArticleIdBean
,
copyOptions
);
...
...
@@ -217,13 +212,13 @@ public class GeneraterAction extends BaseAction {
@RequestMapping
(
"/{columnId}/generateArticle"
)
@RequiresPermissions
(
"cms:generate:article"
)
@ResponseBody
public
void
generateArticle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
int
columnId
)
{
public
void
generateArticle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
columnId
)
{
String
dateTime
=
request
.
getParameter
(
"dateTime"
);
// 网站风格物理路径
List
<
Co
lumnArticleId
Bean
>
articleIdList
=
null
;
List
<
Co
ntent
Bean
>
articleIdList
=
null
;
try
{
// 查出所有文章(根据选择栏目)包括子栏目
articleIdList
=
article
Biz
.
queryIdsByCategoryIdForParser
(
columnId
,
dateTime
,
null
);
articleIdList
=
content
Biz
.
queryIdsByCategoryIdForParser
(
columnId
,
dateTime
,
null
);
// 有符合条件的新闻就更新
if
(
articleIdList
.
size
()
>
0
)
{
CmsParserUtil
.
generateBasic
(
articleIdList
);
...
...
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
ac217e7c
...
...
@@ -21,41 +21,39 @@
package
net
.
mingsoft
.
cms
.
action
.
web
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.io.UnsupportedEncodingException
;
import
java.util.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.io.FileUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.alibaba.fastjson.JSONArray
;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.basic.util.SpringUtil
;
import
net.mingsoft.cms.constant.e.ColumnTypeEnum
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.IContentBiz
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IModelBiz
;
import
net.mingsoft.mdiy.entity.ContentModelEntity
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
net.mingsoft.mdiy.parser.TagParser
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.PageUtil
;
import
freemarker.core.ParseException
;
import
freemarker.template.MalformedTemplateNameException
;
import
freemarker.template.TemplateNotFoundException
;
import
net.mingsoft.basic.biz.IColumnBiz
;
import
net.mingsoft.basic.entity.ColumnEntity
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.bean.ColumnArticleIdBean
;
import
net.mingsoft.cms.biz.IArticleBiz
;
import
net.mingsoft.cms.entity.ArticleEntity
;
import
net.mingsoft.cms.util.CmsParserUtil
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.biz.IPageBiz
;
...
...
@@ -82,15 +80,26 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
* 文章管理业务处理层
*/
@Autowired
private
I
ArticleBiz
article
Biz
;
private
I
ContentBiz
content
Biz
;
/**
* 栏目业务层
*/
@Autowired
private
IC
olumnBiz
column
Biz
;
private
IC
ategoryBiz
category
Biz
;
/**
* 搜索标签;
*/
public
static
final
String
SEARCH
=
"search"
;
/**
* 自定义模型
*/
@Autowired
private
IModelBiz
modelBiz
;
// 如商城就为:/mall/{key}.do
/**
* 前段会员中心所有页面都可以使用该方法 请求地址例如: /{diy}.do,例如登陆界面,与注册界面都可以使用
...
...
@@ -158,9 +167,6 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
* 动态列表页
* @param req
* @param resp
* @param pageNumber 设置列表当前页
* @param typeid 栏目编号
* @param size 显示条数
*/
@GetMapping
(
"/list.do"
)
public
void
list
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
...
...
@@ -170,7 +176,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
//获取文章总数
List
<
Co
lumnArticleIdBean
>
columnArticles
=
articleBiz
.
queryIdsByCategoryIdForParser
(
typeId
,
null
,
null
);
List
<
Co
ntentBean
>
columnArticles
=
contentBiz
.
queryIdsByCategoryIdForParser
(
String
.
valueOf
(
typeId
)
,
null
,
null
);
//判断栏目下是否有文章
if
(
columnArticles
.
size
()==
0
){
this
.
outJson
(
resp
,
false
);
...
...
@@ -216,7 +222,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
@GetMapping
(
"/view.do"
)
public
void
view
(
String
orderby
,
String
order
,
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
//参数文章编号
ArticleEntity
article
=
(
ArticleEntity
)
article
Biz
.
getEntity
(
BasicUtil
.
getInt
(
ParserUtil
.
ID
));
ContentEntity
article
=
(
ContentEntity
)
content
Biz
.
getEntity
(
BasicUtil
.
getInt
(
ParserUtil
.
ID
));
if
(
ObjectUtil
.
isNull
(
article
)){
this
.
outJson
(
resp
,
null
,
false
,
getResString
(
"err.empty"
,
this
.
getResString
(
"id"
)));
return
;
...
...
@@ -230,7 +236,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
PageBean
page
=
new
PageBean
();
//根据文章编号查询栏目详情模版
C
olumnEntity
column
=
(
ColumnEntity
)
columnBiz
.
getEntity
(
article
.
getBasicCategoryId
(
));
C
ategoryEntity
column
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
article
.
getContentCategoryId
()
));
//解析后的内容
String
content
=
""
;
Map
map
=
BasicUtil
.
assemblyRequestMap
();
...
...
@@ -240,13 +246,13 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
map
.
put
(
ParserUtil
.
MODEL_NAME
,
"mcms"
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
map
.
put
(
ParserUtil
.
PAGE
,
page
);
map
.
put
(
ParserUtil
.
ID
,
article
.
get
ArticleID
());
List
<
Co
lumnArticleIdBean
>
articleIdList
=
articleBiz
.
queryIdsByCategoryIdForParser
(
column
.
getCategory
CategoryId
(),
null
,
null
,
orderby
,
order
);
map
.
put
(
ParserUtil
.
ID
,
article
.
get
Id
());
List
<
Co
ntentBean
>
articleIdList
=
contentBiz
.
queryIdsByCategoryIdForParser
(
column
.
get
CategoryId
(),
null
,
null
,
orderby
,
order
);
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
ContentModelEntity
contentModel
=
null
;
for
(
int
artId
=
0
;
artId
<
articleIdList
.
size
();)
{
//如果不是当前文章则跳过
if
(
articleIdList
.
get
(
artId
).
getArticleId
()
!=
article
.
getArticleID
(
)){
if
(
articleIdList
.
get
(
artId
).
getArticleId
()
!=
Integer
.
parseInt
(
article
.
getId
()
)){
artId
++;
continue
;
}
...
...
@@ -272,7 +278,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
// 第一篇文章没有上一篇
if
(
artId
>
0
)
{
Co
lumnArticleId
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
Co
ntent
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
page
.
setPreId
(
preCaBean
.
getArticleId
());
...
...
@@ -280,7 +286,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
// 最后一篇文章没有下一篇
if
(
artId
+
1
<
articleIdList
.
size
())
{
Co
lumnArticleId
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
Co
ntent
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
page
.
setNextId
(
nextCaBean
.
getArticleId
());
...
...
@@ -290,7 +296,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
try
{
//根据模板路径,参数生成
content
=
CmsParserUtil
.
generate
(
column
.
getC
olumn
Url
(),
map
,
isMobileDevice
(
req
));
content
=
CmsParserUtil
.
generate
(
column
.
getC
ategoryList
Url
(),
map
,
isMobileDevice
(
req
));
}
catch
(
TemplateNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
MalformedTemplateNameException
e
)
{
...
...
@@ -302,4 +308,296 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
}
this
.
outString
(
resp
,
content
);
}
/**
* 实现前端页面的文章搜索
*
* @param request
* 搜索id
* @param response
*/
@RequestMapping
(
value
=
"search"
)
@ResponseBody
public
void
search
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 读取请求字段
Map
<
String
,
String
[]>
field
=
request
.
getParameterMap
();
Map
<
String
,
String
>
basicField
=
getMapByProperties
(
net
.
mingsoft
.
mdiy
.
constant
.
Const
.
BASIC_FIELD
);
// 文章字段集合
Map
<
String
,
Object
>
articleFieldName
=
new
HashMap
<
String
,
Object
>();
// 自定义字段集合
Map
<
String
,
String
>
diyFieldName
=
new
HashMap
<
String
,
String
>();
CategoryEntity
column
=
null
;
// 当前栏目
ModelEntity
contentModel
=
null
;
// 栏目对应模型
List
<
DiyModelMap
>
fieldValueList
=
new
ArrayList
<
DiyModelMap
>();
// 栏目对应字段的值
int
typeId
=
0
;
String
categoryIds
=
BasicUtil
.
getString
(
"categoryId"
);
//当传递了栏目编号,但不是栏目集合
if
(!
StringUtil
.
isBlank
(
categoryIds
)
&&
!
categoryIds
.
contains
(
","
)){
typeId
=
Integer
.
parseInt
(
categoryIds
);
}
//记录自定义模型字段名
List
filedStr
=
new
ArrayList
<>();
//根据栏目确定自定义模型
if
(
typeId
>
0
){
column
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
typeId
+
""
));
// 获取表单类型的id
if
(
column
!=
null
&&
ObjectUtil
.
isNotNull
(
column
.
getMdiyModelId
()))
{
contentModel
=
(
ModelEntity
)
modelBiz
.
getEntity
(
Integer
.
parseInt
(
column
.
getMdiyModelId
()));
if
(
contentModel
!=
null
)
{
Map
<
String
,
String
>
fieldMap
=
contentModel
.
getFieldMap
();
for
(
String
s
:
fieldMap
.
keySet
())
{
filedStr
.
add
(
fieldMap
.
get
(
s
));
}
map
.
put
(
ParserUtil
.
TABLE_NAME
,
contentModel
.
getModelTableName
());
}
}
map
.
put
(
ParserUtil
.
COLUMN
,
column
);
//设置栏目编号
// map.put(ParserUtil.TYPE_ID, typeId);
}
// 遍历取字段集合
if
(
field
!=
null
)
{
for
(
Map
.
Entry
<
String
,
String
[]>
entry
:
field
.
entrySet
())
{
if
(
entry
!=
null
)
{
String
value
=
entry
.
getValue
()[
0
];
// 处理由get方法请求中文乱码问题
if
(
ObjectUtil
.
isNull
(
value
))
{
continue
;
}
if
(
request
.
getMethod
().
equals
(
RequestMethod
.
GET
))
{
// 如果是get方法需要将请求地址参数转吗
try
{
value
=
new
String
(
value
.
getBytes
(
"ISO-8859-1"
),
Const
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
// 若为文章字段,则保存至文章字段集合;否则保存至自定义字段集合
if
(
ObjectUtil
.
isNotNull
(
basicField
.
get
(
entry
.
getKey
()))
&&
ObjectUtil
.
isNotNull
(
value
))
{
articleFieldName
.
put
(
entry
.
getKey
(),
value
);
}
else
{
if
(!
StringUtil
.
isBlank
(
value
))
{
diyFieldName
.
put
(
entry
.
getKey
(),
value
);
//判断请求中的是否是自定义模型中的字段
if
(
filedStr
.
contains
(
entry
.
getKey
())){
//设置自定义模型字段和值
DiyModelMap
diyMap
=
new
DiyModelMap
();
diyMap
.
setKey
(
entry
.
getKey
());
diyMap
.
setValue
(
value
);
fieldValueList
.
add
(
diyMap
);
}
}
}
}
}
}
//添加自定义模型的字段和值
if
(
fieldValueList
.
size
()>
0
){
map
.
put
(
"diyModel"
,
fieldValueList
);
}
//组织where查询条件
Map
whereMap
=
ObjectUtil
.
isNotNull
(
contentModel
)?
this
.
searchMap
(
articleFieldName
,
diyFieldName
,
JSONArray
.
parseArray
(
contentModel
.
getModelField
())):
new
HashMap
();
// 获取符合条件的文章总数
int
count
=
contentBiz
.
getSearchCount
(
contentModel
,
whereMap
,
BasicUtil
.
getAppId
(),
categoryIds
);
//设置分页类
PageBean
page
=
new
PageBean
();
//读取模板的分页数量
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
try
{
size
=
TagParser
.
getPageSize
(
ParserUtil
.
read
(
ParserUtil
.
SEARCH
+
ParserUtil
.
HTM_SUFFIX
,
false
));
}
catch
(
TemplateNotFoundException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
MalformedTemplateNameException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
ParseException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
int
total
=
PageUtil
.
totalPage
(
count
,
size
);
int
pageNo
=
BasicUtil
.
getInt
(
ParserUtil
.
PAGE_NO
,
1
);
if
(
pageNo
>=
total
&&
total
!=
0
)
{
pageNo
=
total
;
}
//获取总数
page
.
setTotal
(
total
);
//设置页面显示数量
page
.
setSize
(
size
);
//设置列表当前页
page
.
setPageNo
(
pageNo
);
String
str
=
ParserUtil
.
PAGE_NO
+
","
+
ParserUtil
.
SIZE
;
//设置分页的统一链接
String
url
=
BasicUtil
.
getUrl
()+
request
.
getServletPath
()
+
"?"
+
BasicUtil
.
assemblyRequestUrlParams
(
str
.
split
(
","
));
String
pageNoStr
=
"&"
+
ParserUtil
.
SIZE
+
"="
+
size
+
"&"
+
ParserUtil
.
PAGE_NO
+
"="
;
//下一页
String
nextUrl
=
url
+
pageNoStr
+((
pageNo
+
1
>
total
)?
total:
pageNo
+
1
);
//首页
String
indexUrl
=
url
+
pageNoStr
+
1
;
//尾页
String
lastUrl
=
url
+
pageNoStr
+
total
;
//上一页 当前页为1时,上一页就是1
String
preUrl
=
url
+
pageNoStr
+
((
pageNo
==
1
)
?
1
:
pageNo
-
1
);
page
.
setIndexUrl
(
indexUrl
);
page
.
setNextUrl
(
nextUrl
);
page
.
setPreUrl
(
preUrl
);
page
.
setLastUrl
(
lastUrl
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
Map
<
String
,
Object
>
searchMap
=
BasicUtil
.
assemblyRequestMap
();
searchMap
.
put
(
ParserUtil
.
PAGE_NO
,
pageNo
);
map
.
put
(
SEARCH
,
searchMap
);
map
.
put
(
ParserUtil
.
PAGE
,
page
);
//动态解析
map
.
put
(
ParserUtil
.
IS_DO
,
false
);
//设置动态请求的模块路径
map
.
put
(
ParserUtil
.
MODEL_NAME
,
"mcms"
);
//解析后的内容
String
content
=
""
;
try
{
//根据模板路径,参数生成
content
=
CmsParserUtil
.
generate
(
ParserUtil
.
SEARCH
+
ParserUtil
.
HTM_SUFFIX
,
map
,
isMobileDevice
(
request
));
}
catch
(
TemplateNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
MalformedTemplateNameException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
this
.
outString
(
response
,
content
);
}
/**
* 动态组织查询where条件 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段
* list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值
*
* @param articleField
* 文章字段
* @param diyFieldName
* 动态字段
* @param fields
* 模型对应的字段类型
* @return
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
private
Map
<
String
,
List
>
searchMap
(
Map
<
String
,
Object
>
articleField
,
Map
<
String
,
String
>
diyFieldName
,
List
fields
)
{
Map
<
String
,
List
>
map
=
new
HashMap
<
String
,
List
>();
// 遍历文章中的字段
for
(
Iterator
iter
=
articleField
.
keySet
().
iterator
();
iter
.
hasNext
();)
{
String
key
=
iter
.
next
().
toString
();
String
fieldValue
=
articleField
.
get
(
key
).
toString
();
List
list
=
new
ArrayList
();
List
listValue
=
new
ArrayList
();
// 是否为自定义字段
list
.
add
(
false
);
// 是否是数字类型,true:不是
list
.
add
(
true
);
// 是否是模糊查询3
list
.
add
(
true
);
// 字段值
listValue
.
add
(
articleField
.
get
(
key
));
list
.
add
(
listValue
);
map
.
put
(
key
,
list
);
}
// 遍历字段自定义字段
for
(
Iterator
iter
=
diyFieldName
.
keySet
().
iterator
();
iter
.
hasNext
();)
{
String
key
=
iter
.
next
().
toString
();
String
fieldValue
=
diyFieldName
.
get
(
key
);
// 获取字段实体
Map
field
=
get
(
key
,
fields
);
if
(
field
!=
null
)
{
List
list
=
new
ArrayList
();
// 是否为自定义字段0
list
.
add
(
0
,
true
);
List
listValue
=
new
ArrayList
();
// 字段的值
if
(
"int"
.
equals
(
field
.
get
(
"javaType"
)
)
||
"float"
.
equals
(
field
.
get
(
"javaType"
)
)||
"Double"
.
equals
(
field
.
get
(
"javaType"
))
)
{
// 判断是否为区间查询
if
(
diyFieldName
.
get
(
key
).
toString
().
indexOf
(
"-"
)
>
0
)
{
String
[]
values
=
fieldValue
.
toString
().
split
(
"-"
);
// 是否是数字类型,false:是
list
.
add
(
false
);
// 是否是区间比较 false:是
list
.
add
(
false
);
// 字段值1
listValue
.
add
(
values
[
0
]);
listValue
.
add
(
values
[
1
]);
}
else
{
// 是否是数字类型,false:是2
list
.
add
(
false
);
// 是否是区间比较 true:不是3
list
.
add
(
true
);
// 字段值 1
listValue
.
add
(
fieldValue
);
}
}
else
{
// 是否是数字类型,true:不是2
list
.
add
(
true
);
list
.
add
(
false
);
// 字段值 1
listValue
.
add
(
fieldValue
);
}
list
.
add
(
listValue
);
map
.
put
(
key
,
list
);
}
}
return
map
;
}
private
Map
get
(
String
key
,
List
<
Map
>
fields
)
{
for
(
Map
field
:
fields
)
{
if
(
key
.
equals
(
field
.
get
(
"key"
))){
return
field
;
}
}
return
null
;
}
/**
* 存储自定义模型字段和接口参数
* @author 铭飞开源团队
* @date 2019年3月5日
*/
public
class
DiyModelMap
{
String
key
;
Object
value
;
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
deleted
100644 → 0
View file @
b03361cd
/**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package
net
.
mingsoft
.
cms
.
action
.
web
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.PageUtil
;
import
freemarker.core.ParseException
;
import
freemarker.template.MalformedTemplateNameException
;
import
freemarker.template.TemplateNotFoundException
;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.basic.action.BaseAction
;
import
net.mingsoft.basic.biz.ICategoryBiz
;
import
net.mingsoft.basic.biz.IColumnBiz
;
import
net.mingsoft.basic.biz.IModelBiz
;
import
net.mingsoft.basic.entity.ColumnEntity
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.StringUtil
;
import
net.mingsoft.cms.biz.IArticleBiz
;
import
net.mingsoft.cms.util.CmsParserUtil
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IContentModelFieldBiz
;
import
net.mingsoft.mdiy.biz.ISearchBiz
;
import
net.mingsoft.mdiy.entity.ContentModelEntity
;
import
net.mingsoft.mdiy.entity.ContentModelFieldEntity
;
import
net.mingsoft.mdiy.entity.SearchEntity
;
import
net.mingsoft.mdiy.parser.TagParser
;
import
net.mingsoft.mdiy.util.ParserUtil
;
/**
* 根据搜索结果动态解析模版内容
* @author 铭飞开源团队-Administrator
* @date 2018年12月18日
*/
@Controller
(
value
=
"webSearchAction"
)
@RequestMapping
(
"/cms"
)
public
class
SearchAction
extends
BaseAction
{
/**
* 搜索标签;
*/
public
static
final
String
SEARCH
=
"search"
;
/**
* 搜索的标题;
*/
public
static
final
String
BASIC_TITLE
=
"basic_title"
;
/**
* 注入文章业务层
*/
@Autowired
private
IArticleBiz
articleBiz
;
/**
* 注入搜索业务层
*/
@Autowired
private
ISearchBiz
searchBiz
;
/**
* 注入栏目业务层
*/
@Autowired
private
IColumnBiz
columnBiz
;
/**
* 内容模型业务层
*/
@Autowired
private
IContentModelBiz
contentModelBiz
;
/**
* 内容字段业务层
*/
@Autowired
private
IContentModelFieldBiz
fieldBiz
;
/**
* 注入分类业务层
*/
@Autowired
private
ICategoryBiz
categoryBiz
;
/**
* 模块管理biz
*/
@Autowired
private
IModelBiz
modelBiz
;
/**
* 实现前端页面的文章搜索
*
* @param request
* @param searchId
* 搜索id
* @param response
*/
@RequestMapping
(
value
=
"/{searchId}/search"
)
@ResponseBody
public
void
search
(
HttpServletRequest
request
,
@PathVariable
int
searchId
,
HttpServletResponse
response
)
{
SearchEntity
_search
=
new
SearchEntity
();
_search
.
setAppId
(
BasicUtil
.
getAppId
());
_search
.
setSearchId
(
searchId
);
// 获取对应搜索模型
SearchEntity
search
=
(
SearchEntity
)
searchBiz
.
getEntity
(
_search
);
//判断当前搜索是否有模板文件
if
(
ObjectUtil
.
isNull
(
search
))
{
this
.
outJson
(
response
,
false
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 读取请求字段
Map
<
String
,
String
[]>
field
=
request
.
getParameterMap
();
Map
<
String
,
String
>
basicField
=
getMapByProperties
(
net
.
mingsoft
.
mdiy
.
constant
.
Const
.
BASIC_FIELD
);
// 文章字段集合
Map
<
String
,
Object
>
articleFieldName
=
new
HashMap
<
String
,
Object
>();
// 自定义字段集合
Map
<
String
,
String
>
diyFieldName
=
new
HashMap
<
String
,
String
>();
ColumnEntity
column
=
null
;
// 当前栏目
ContentModelEntity
contentModel
=
null
;
// 栏目对应模型
List
<
ContentModelFieldEntity
>
fieldList
=
new
ArrayList
<
ContentModelFieldEntity
>();
// 栏目对应字段
List
<
DiyModelMap
>
fieldValueList
=
new
ArrayList
<
DiyModelMap
>();
// 栏目对应字段的值
int
typeId
=
0
;
String
categoryIds
=
BasicUtil
.
getString
(
"categoryId"
);
//当传递了栏目编号,但不是栏目集合
if
(!
StringUtil
.
isBlank
(
categoryIds
)
&&
!
categoryIds
.
contains
(
","
)){
typeId
=
Integer
.
parseInt
(
categoryIds
);
}
//记录自定义模型字段名
List
filedStr
=
new
ArrayList
<>();
//根据栏目确定自定义模型
if
(
typeId
>
0
){
column
=
(
ColumnEntity
)
columnBiz
.
getEntity
(
Integer
.
parseInt
(
typeId
+
""
));
// 获取表单类型的id
if
(
column
!=
null
)
{
contentModel
=
(
ContentModelEntity
)
contentModelBiz
.
getEntity
(
column
.
getColumnContentModelId
());
if
(
contentModel
!=
null
)
{
fieldList
=
fieldBiz
.
queryListByCmid
(
contentModel
.
getCmId
());
for
(
ContentModelFieldEntity
cmField
:
fieldList
)
{
filedStr
.
add
(
cmField
.
getFieldFieldName
());
}
map
.
put
(
ParserUtil
.
TABLE_NAME
,
contentModel
.
getCmTableName
());
}
}
map
.
put
(
ParserUtil
.
COLUMN
,
column
);
//设置栏目编号
// map.put(ParserUtil.TYPE_ID, typeId);
}
// 遍历取字段集合
if
(
field
!=
null
)
{
for
(
Entry
<
String
,
String
[]>
entry
:
field
.
entrySet
())
{
if
(
entry
!=
null
)
{
String
value
=
entry
.
getValue
()[
0
];
// 处理由get方法请求中文乱码问题
if
(
ObjectUtil
.
isNull
(
value
))
{
continue
;
}
if
(
request
.
getMethod
().
equals
(
RequestMethod
.
GET
))
{
// 如果是get方法需要将请求地址参数转吗
try
{
value
=
new
String
(
value
.
getBytes
(
"ISO-8859-1"
),
Const
.
UTF8
);
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
// 若为文章字段,则保存至文章字段集合;否则保存至自定义字段集合
if
(
ObjectUtil
.
isNotNull
(
basicField
.
get
(
entry
.
getKey
()))
&&
ObjectUtil
.
isNotNull
(
value
))
{
articleFieldName
.
put
(
entry
.
getKey
(),
value
);
}
else
{
if
(!
StringUtil
.
isBlank
(
value
))
{
diyFieldName
.
put
(
entry
.
getKey
(),
value
);
//判断请求中的是否是自定义模型中的字段
if
(
filedStr
.
contains
(
entry
.
getKey
())){
//设置自定义模型字段和值
DiyModelMap
diyMap
=
new
DiyModelMap
();
diyMap
.
setKey
(
entry
.
getKey
());
diyMap
.
setValue
(
value
);
fieldValueList
.
add
(
diyMap
);
}
}
}
}
}
}
//添加自定义模型的字段和值
if
(
fieldValueList
.
size
()>
0
){
map
.
put
(
"diyModel"
,
fieldValueList
);
}
//组织where查询条件
Map
whereMap
=
this
.
searchMap
(
articleFieldName
,
diyFieldName
,
fieldList
);
// 获取符合条件的文章总数
int
count
=
articleBiz
.
getSearchCount
(
contentModel
,
whereMap
,
BasicUtil
.
getAppId
(),
categoryIds
);
//设置分页类
PageBean
page
=
new
PageBean
();
//读取模板的分页数量
int
size
=
BasicUtil
.
getInt
(
ParserUtil
.
SIZE
,
10
);
try
{
size
=
TagParser
.
getPageSize
(
ParserUtil
.
read
(
search
.
getSearchTemplets
(),
false
));
}
catch
(
TemplateNotFoundException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
MalformedTemplateNameException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
ParseException
e1
)
{
e1
.
printStackTrace
();
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
}
int
total
=
PageUtil
.
totalPage
(
count
,
size
);
int
pageNo
=
BasicUtil
.
getInt
(
ParserUtil
.
PAGE_NO
,
1
);
if
(
pageNo
>=
total
&&
total
!=
0
)
{
pageNo
=
total
;
}
//获取总数
page
.
setTotal
(
total
);
//设置页面显示数量
page
.
setSize
(
size
);
//设置列表当前页
page
.
setPageNo
(
pageNo
);
String
str
=
ParserUtil
.
PAGE_NO
+
","
+
ParserUtil
.
SIZE
;
//设置分页的统一链接
String
url
=
BasicUtil
.
getUrl
()+
request
.
getServletPath
()
+
"?"
+
BasicUtil
.
assemblyRequestUrlParams
(
str
.
split
(
","
));
String
pageNoStr
=
"&"
+
ParserUtil
.
SIZE
+
"="
+
size
+
"&"
+
ParserUtil
.
PAGE_NO
+
"="
;
//下一页
String
nextUrl
=
url
+
pageNoStr
+((
pageNo
+
1
>
total
)?
total:
pageNo
+
1
);
//首页
String
indexUrl
=
url
+
pageNoStr
+
1
;
//尾页
String
lastUrl
=
url
+
pageNoStr
+
total
;
//上一页 当前页为1时,上一页就是1
String
preUrl
=
url
+
pageNoStr
+
((
pageNo
==
1
)
?
1
:
pageNo
-
1
);
page
.
setIndexUrl
(
indexUrl
);
page
.
setNextUrl
(
nextUrl
);
page
.
setPreUrl
(
preUrl
);
page
.
setLastUrl
(
lastUrl
);
map
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
Map
<
String
,
Object
>
searchMap
=
BasicUtil
.
assemblyRequestMap
();
searchMap
.
put
(
ParserUtil
.
PAGE_NO
,
pageNo
);
map
.
put
(
SEARCH
,
searchMap
);
map
.
put
(
ParserUtil
.
PAGE
,
page
);
//动态解析
map
.
put
(
ParserUtil
.
IS_DO
,
false
);
//设置动态请求的模块路径
map
.
put
(
ParserUtil
.
MODEL_NAME
,
"mcms"
);
//解析后的内容
String
content
=
""
;
try
{
//根据模板路径,参数生成
content
=
CmsParserUtil
.
generate
(
search
.
getSearchTemplets
(),
map
,
isMobileDevice
(
request
));
}
catch
(
TemplateNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
MalformedTemplateNameException
e
)
{
e
.
printStackTrace
();
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
this
.
outString
(
response
,
content
);
}
/**
* 动态组织查询where条件 获取查询条件的Map key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段
* list[1]:是否为整形 list[2]:是否是等值查询 list[3]:字段的值
*
* @param articleField
* 文章字段
* @param diyFieldName
* 动态字段
* @param fields
* 模型对应的字段类型
* @return
*/
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
private
Map
<
String
,
List
>
searchMap
(
Map
<
String
,
Object
>
articleField
,
Map
<
String
,
String
>
diyFieldName
,
List
fields
)
{
Map
<
String
,
List
>
map
=
new
HashMap
<
String
,
List
>();
// 遍历文章中的字段
for
(
Iterator
iter
=
articleField
.
keySet
().
iterator
();
iter
.
hasNext
();)
{
String
key
=
iter
.
next
().
toString
();
String
fieldValue
=
articleField
.
get
(
key
).
toString
();
List
list
=
new
ArrayList
();
List
listValue
=
new
ArrayList
();
// 是否为自定义字段
list
.
add
(
false
);
// 是否是数字类型,true:不是
list
.
add
(
true
);
// 是否是模糊查询3
list
.
add
(
true
);
// 字段值
listValue
.
add
(
articleField
.
get
(
key
));
list
.
add
(
listValue
);
map
.
put
(
key
,
list
);
}
// 遍历字段自定义字段
for
(
Iterator
iter
=
diyFieldName
.
keySet
().
iterator
();
iter
.
hasNext
();)
{
String
key
=
iter
.
next
().
toString
();
String
fieldValue
=
diyFieldName
.
get
(
key
);
// 获取字段实体
ContentModelFieldEntity
field
=
this
.
get
(
key
,
fields
);
if
(
field
!=
null
)
{
List
list
=
new
ArrayList
();
// 是否为自定义字段0
list
.
add
(
0
,
true
);
List
listValue
=
new
ArrayList
();
// 字段的值
if
(
field
.
getFieldType
()
==
IContentModelFieldBiz
.
INT
||
field
.
getFieldType
()
==
IContentModelFieldBiz
.
FLOAT
)
{
// 判断是否为区间查询
if
(
diyFieldName
.
get
(
key
).
toString
().
indexOf
(
"-"
)
>
0
)
{
String
[]
values
=
fieldValue
.
toString
().
split
(
"-"
);
// 是否是数字类型,false:是
list
.
add
(
false
);
// 是否是区间比较 false:是
list
.
add
(
false
);
// 字段值1
listValue
.
add
(
values
[
0
]);
listValue
.
add
(
values
[
1
]);
}
else
{
// 是否是数字类型,false:是2
list
.
add
(
false
);
// 是否是区间比较 true:不是3
list
.
add
(
true
);
// 字段值 1
listValue
.
add
(
fieldValue
);
}
}
else
{
// 是否是数字类型,true:不是2
list
.
add
(
true
);
list
.
add
(
false
);
// 字段值 1
listValue
.
add
(
fieldValue
);
}
list
.
add
(
listValue
);
map
.
put
(
key
,
list
);
}
}
return
map
;
}
/**
* 根据字段名称获取字段类型
*
* @param columnName
* 字段名称
* @return 字段实体
*/
private
ContentModelFieldEntity
get
(
String
columnName
,
List
<
ContentModelFieldEntity
>
fields
)
{
if
(
fields
==
null
)
{
return
null
;
}
for
(
ContentModelFieldEntity
field
:
fields
)
{
if
(
field
.
getFieldFieldName
().
equals
(
columnName
))
{
return
field
;
}
}
return
null
;
}
/**
* 存储自定义模型字段和接口参数
* @author 铭飞开源团队
* @date 2019年3月5日
*/
public
class
DiyModelMap
{
String
key
;
Object
value
;
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
Object
getValue
()
{
return
value
;
}
public
void
setValue
(
Object
value
)
{
this
.
value
=
value
;
}
}
}
src/main/java/net/mingsoft/cms/bean/ContentBean.java
0 → 100644
View file @
ac217e7c
package
net
.
mingsoft
.
cms
.
bean
;
import
net.mingsoft.cms.entity.CategoryEntity
;
/**
* 文章实体
* @author 铭飞开发团队
* 创建日期:2019-11-28 15:12:32<br/>
* 历史修订:<br/>
*/
public
class
ContentBean
extends
CategoryEntity
{
/**
* 文章编号
*/
private
int
articleId
;
public
int
getArticleId
()
{
return
articleId
;
}
public
void
setArticleId
(
int
articleId
)
{
this
.
articleId
=
articleId
;
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/biz/IContentBiz.java
View file @
ac217e7c
package
net
.
mingsoft
.
cms
.
biz
;
import
net.mingsoft.base.biz.IBaseBiz
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -11,4 +16,9 @@ import net.mingsoft.base.biz.IBaseBiz;
*/
public
interface
IContentBiz
extends
IBaseBiz
{
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
);
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
);
int
getSearchCount
(
ModelEntity
contentModel
,
Map
whereMap
,
int
appId
,
String
categoryIds
);
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
View file @
ac217e7c
...
...
@@ -21,6 +21,7 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技
package
net
.
mingsoft
.
cms
.
biz
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
net.mingsoft.base.entity.BaseEntity
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -28,6 +29,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
net.mingsoft.base.biz.impl.BaseBizImpl
;
import
net.mingsoft.base.dao.IBaseDao
;
import
java.io.File
;
import
java.util.*
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
...
...
@@ -69,24 +72,38 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz {
if
(
StringUtils
.
isNotEmpty
(
categoryEntity
.
getCategoryId
())&&
Integer
.
parseInt
(
categoryEntity
.
getCategoryId
())>
0
)
{
CategoryEntity
category
=
(
CategoryEntity
)
categoryDao
.
getEntity
(
Integer
.
parseInt
(
categoryEntity
.
getCategoryId
()));
if
(
StringUtils
.
isEmpty
(
category
.
getCategoryParentId
()))
{
categoryEntity
.
setCategoryParentId
(
category
Entity
.
getCategory
Id
());
categoryEntity
.
setCategoryParentId
(
category
.
get
Id
());
}
else
{
categoryEntity
.
setCategoryParentId
(
category
.
getCategoryParentId
()+
","
+
category
Entity
.
getCategoryParen
tId
());
categoryEntity
.
setCategoryParentId
(
category
.
getCategoryParentId
()+
","
+
category
.
ge
tId
());
}
}
else
{
categoryEntity
.
setCategoryParentId
(
null
);
}
String
path
=
ObjectUtil
.
isNotNull
(
categoryEntity
.
getCategoryParentId
())?
categoryEntity
.
getCategoryParentId
():
""
;
categoryEntity
.
setCategoryPath
(
"/"
+
path
.
replaceAll
(
","
,
"/"
)+
"/"
+
categoryEntity
.
getId
());
}
private
void
setChildParentId
(
CategoryEntity
categoryEntity
)
{
CategoryEntity
category
=
new
CategoryEntity
();
category
.
setCategoryId
(
categoryEntity
.
getId
());
List
<
CategoryEntity
>
list
=
categoryDao
.
query
(
category
);
list
.
forEach
(
x
->{
if
(
StringUtils
.
isEmpty
(
categoryEntity
.
getCategoryParentId
()))
{
x
.
setCategoryParentId
(
categoryEntity
.
getId
());
}
else
{
x
.
setCategoryParentId
(
categoryEntity
.
getCategoryParentId
()+
","
+
categoryEntity
.
getId
());
}
String
path
=
ObjectUtil
.
isNotNull
(
x
.
getCategoryParentId
())?
x
.
getCategoryParentId
():
""
;
x
.
setCategoryPath
(
"/"
+
path
.
replaceAll
(
","
,
"/"
)+
"/"
+
x
.
getId
());
super
.
updateEntity
(
x
);
setChildParentId
(
x
);
});
}
@Override
public
void
updateEntity
(
CategoryEntity
entity
)
{
List
<
CategoryEntity
>
categoryEntities
=
queryChilds
(
entity
);
setParentId
(
entity
);
super
.
updateEntity
(
entity
);
categoryEntities
.
forEach
(
x
->{
setParentId
(
x
);
if
(!
x
.
getId
().
equals
(
entity
.
getId
())){
super
.
updateEntity
(
x
);
}
});
setChildParentId
(
entity
);
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
View file @
ac217e7c
...
...
@@ -21,6 +21,9 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技
package
net
.
mingsoft
.
cms
.
biz
.
impl
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
net.mingsoft.base.biz.impl.BaseBizImpl
;
...
...
@@ -48,5 +51,22 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz {
protected
IBaseDao
getDao
()
{
// TODO Auto-generated method stub
return
contentDao
;
}
}
@Override
public
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
)
{
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
null
,
null
);
}
@Override
public
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
String
categoryId
,
String
beginTime
,
String
endTime
,
String
orderBy
,
String
order
)
{
return
this
.
contentDao
.
queryIdsByCategoryIdForParser
(
categoryId
,
BasicUtil
.
getAppId
(),
beginTime
,
endTime
,
orderBy
,
order
);
}
@Override
public
int
getSearchCount
(
ModelEntity
contentModel
,
Map
whereMap
,
int
appId
,
String
categoryIds
)
{
if
(
contentModel
!=
null
)
{
return
contentDao
.
getSearchCount
(
contentModel
.
getModelTableName
(),
whereMap
,
appId
,
categoryIds
);
}
return
contentDao
.
getSearchCount
(
null
,
whereMap
,
appId
,
categoryIds
);
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
View file @
ac217e7c
...
...
@@ -91,6 +91,7 @@
<set>
<if
test=
"categoryTitle != null and categoryTitle != ''"
>
category_title=#{categoryTitle},
</if>
category_id=#{categoryId},
category_parent_id=#{categoryParentId},
<if
test=
"categoryType != null and categoryType != ''"
>
category_type=#{categoryType},
</if>
<if
test=
"categorySort != null"
>
category_sort=#{categorySort},
</if>
<if
test=
"categoryListUrl != null and categoryListUrl != ''"
>
category_list_url=#{categoryListUrl},
</if>
...
...
@@ -106,7 +107,6 @@
<if
test=
"dictId != null"
>
dict_id=#{dictId},
</if>
<if
test=
"categoryFlag != null and categoryFlag != ''"
>
category_flag=#{categoryFlag},
</if>
<if
test=
"categoryPath != null and categoryPath != ''"
>
category_path=#{categoryPath},
</if>
<if
test=
"categoryParentId != null and categoryParentId != ''"
>
category_parent_id=#{categoryParentId},
</if>
<if
test=
"createBy > 0"
>
create_by=#{createBy},
</if>
<if
test=
"createDate != null"
>
create_date=#{createDate},
</if>
<if
test=
"updateBy > 0"
>
update_by=#{updateBy},
</if>
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.java
View file @
ac217e7c
...
...
@@ -2,7 +2,9 @@ package net.mingsoft.cms.dao;
import
net.mingsoft.base.dao.IBaseDao
;
import
java.util.*
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
net.mingsoft.cms.bean.ContentBean
;
import
org.apache.ibatis.annotations.Param
;
/**
* 文章持久层
...
...
@@ -11,4 +13,27 @@ import net.mingsoft.cms.entity.ContentEntity;
* 历史修订:<br/>
*/
public
interface
IContentDao
extends
IBaseDao
{
/**
* 查询文章编号集合
* @param categoryId 栏目编号
* @param appId 站点编号
* @param beginTime 开始时间
* @param endTime 结束时间
* @return
*/
public
List
<
ContentBean
>
queryIdsByCategoryIdForParser
(
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"appId"
)
int
appId
,
@Param
(
"beginTime"
)
String
beginTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"orderBy"
)
String
orderBy
,
@Param
(
"order"
)
String
order
);
/**
* 根据查询文章实体总数
*
* @param tableName
* :自定义生成的表名
* @param map
* key:字段名 value:List 字段的各种判断值 list[0]:是否为自定义字段 list[1]:是否为整形
* list[2]:是否是等值查询 list[3]:字段的值
* @return 文章实体总数
*/
int
getSearchCount
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"map"
)
Map
<
String
,
List
>
map
,
@Param
(
"websiteId"
)
int
websiteId
,
@Param
(
"ids"
)
String
ids
);
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
ac217e7c
...
...
@@ -26,6 +26,34 @@
<result
column=
"del"
property=
"del"
/>
<!--删除标记 -->
</resultMap>
<resultMap
id=
"resultBean"
type=
"net.mingsoft.cms.bean.ContentBean"
>
<id
column=
"id"
property=
"id"
/>
<!--编号 -->
<id
column=
"article_Id"
property=
"articleId"
/>
<!--编号 -->
<result
column=
"category_title"
property=
"categoryTitle"
/>
<!--栏目管理名称 -->
<result
column=
"category_id"
property=
"categoryId"
/>
<!--所属栏目 -->
<result
column=
"category_type"
property=
"categoryType"
/>
<!--栏目管理属性 -->
<result
column=
"category_sort"
property=
"categorySort"
/>
<!--自定义顺序 -->
<result
column=
"category_list_url"
property=
"categoryListUrl"
/>
<!--列表模板 -->
<result
column=
"category_url"
property=
"categoryUrl"
/>
<!--内容模板 -->
<result
column=
"category_keyword"
property=
"categoryKeyword"
/>
<!--栏目管理关键字 -->
<result
column=
"category_descrip"
property=
"categoryDescrip"
/>
<!--栏目管理描述 -->
<result
column=
"category_img"
property=
"categoryImg"
/>
<!--缩略图 -->
<result
column=
"category_diy_url"
property=
"categoryDiyUrl"
/>
<!--自定义链接 -->
<result
column=
"mdiy_model_id"
property=
"mdiyModelId"
/>
<!--栏目管理的内容模型id -->
<result
column=
"category_datetime"
property=
"categoryDatetime"
/>
<!--类别发布时间 -->
<result
column=
"category_manager_id"
property=
"categoryManagerId"
/>
<!--发布用户id -->
<result
column=
"app_id"
property=
"appId"
/>
<!--应用编号 -->
<result
column=
"dict_id"
property=
"dictId"
/>
<!--字典对应编号 -->
<result
column=
"category_flag"
property=
"categoryFlag"
/>
<!--栏目属性 -->
<result
column=
"category_path"
property=
"categoryPath"
/>
<!--栏目路径 -->
<result
column=
"category_parent_id"
property=
"categoryParentId"
/>
<!--父类型编号 -->
<result
column=
"create_by"
property=
"createBy"
/>
<!--创建人 -->
<result
column=
"create_date"
property=
"createDate"
/>
<!--创建时间 -->
<result
column=
"update_by"
property=
"updateBy"
/>
<!--修改人 -->
<result
column=
"update_date"
property=
"updateDate"
/>
<!--修改时间 -->
<result
column=
"del"
property=
"del"
/>
<!--删除标记 -->
</resultMap>
<!--保存-->
<insert
id=
"saveEntity"
useGeneratedKeys=
"true"
keyProperty=
"id"
parameterType=
"net.mingsoft.cms.entity.ContentEntity"
>
...
...
@@ -184,4 +212,113 @@
order by id desc
</select>
<sql
id=
"queryWhereCategoryId"
databaseId=
"mysql"
>
find_in_set('${categoryId}',CATEGORY_PARENT_ID)
</sql>
<sql
id=
"queryWhereCategoryId"
databaseId=
"oracle"
>
instr(','||'${categoryId}'||',', ','||CATEGORY_PARENT_ID||',')>0
</sql>
<sql
id=
"queryWhereCategoryId"
databaseId=
"sqlServer"
>
CHARINDEX(','+'${categoryId}'+',' , ','+CATEGORY_PARENT_ID +',')>0
</sql>
<!-- 根据站点编号、开始、结束时间和栏目编号查询文章编号集合 -->
<select
id=
"queryIdsByCategoryIdForParser"
resultMap=
"resultBean"
>
select
cms_content.id article_id,c.*
FROM cms_content
LEFT JOIN cms_category c ON content_category_id = c.id
where
<if
test=
"appId > 0"
>
cms_content.app_id = #{appId}
</if>
<!-- 查询子栏目数据 -->
<if
test=
"categoryId > 0"
>
and (content_category_id=#{categoryId} or content_category_id in
(select id FROM cms_category where
<include
refid=
"queryWhereCategoryId"
></include>
))
</if>
<if
test=
"beginTime!=null and beginTime!=''"
>
and content_updatetime
>
= #{beginTime}
</if>
<if
test=
"endTime!=null and endTime!=''"
>
and content_updatetime
>
= #{endTime}
</if>
<if
test=
"orderBy!=null and order!=null and orderBy!='' and order!=''"
>
ORDER BY `${orderBy}` ${order}
</if>
</select>
<select
id=
"getSearchCount"
resultType=
"int"
>
select count(*) from
cms_content a
left join cms_category c
ON a.content_category_id
= c.id
<if
test=
"tableName!=null and tableName!=''"
>
left join ${tableName} d on d.link_id=a.id
</if>
where a.app_id = #{websiteId}
<if
test=
"ids!=null and ids!=''"
>
and FIND_IN_SET(content_category_id,'${ids}')
</if>
<foreach
item=
"item"
index=
"key"
collection=
"map"
open=
""
separator=
""
close=
""
>
<if
test=
" item[0] == false"
>
and ${key}
</if>
<if
test=
"item[0]== true"
>
and d.${key}
</if>
<!-- 数字类型的查找 item[1]:字段是否为数字类型false:数字 -->
<if
test=
"item[1] == false"
>
<!--item[2]: 是采用等值还是区间查询。false:区间 itme[3][0]第一个值item[3][1]的二个值 -->
<if
test=
"item[2] == true"
>
=
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
#{val}
</foreach>
</if>
<if
test=
"item[2] == false"
>
between
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
separator=
"and"
>
#{val}
</foreach>
</if>
</if>
<!-- 字符型数据的查找 item[1]:字段是否为数字类型true:字符串 -->
<if
test=
"item[1] == true"
>
<!--item[2]: 是采用模糊查询。false:不采用模糊 -->
<if
test=
"item[2] == true"
>
<include
refid=
"queryLike"
></include>
</if>
<if
test=
"item[2] == false"
>
=
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
#{val}
</foreach>
</if>
</if>
</foreach>
</select>
<!-- 根据字段条件查找文章实体开始 -->
<sql
id=
"queryLike"
databaseId=
"mysql"
>
like CONCAT("%",
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
,"%")
</sql>
<sql
id=
"queryLike"
databaseId=
"oracle"
>
like '%'||
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
||'%'
</sql>
<sql
id=
"queryLike"
databaseId=
"sqlServer"
>
like '%'+
<foreach
item=
"val"
index=
"index"
collection=
"item[3]"
>
<if
test=
"index==0"
>
#{val}
</if>
</foreach>
+'%'
</sql>
</mapper>
\ No newline at end of file
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
ac217e7c
...
...
@@ -21,10 +21,12 @@ import net.mingsoft.basic.entity.ColumnEntity;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.SpringUtil
;
import
net.mingsoft.cms.bean.ColumnArticleIdBean
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.cms.constant.e.ColumnTypeEnum
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.mdiy.bean.PageBean
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IModelBiz
;
import
net.mingsoft.mdiy.biz.impl.ModelBizImpl
;
import
net.mingsoft.mdiy.entity.ContentModelEntity
;
import
net.mingsoft.mdiy.entity.ModelEntity
;
...
...
@@ -192,11 +194,11 @@ public class CmsParserUtil extends ParserUtil {
* @throws MalformedTemplateNameException
* @throws TemplateNotFoundException
*/
public
static
void
generateBasic
(
List
<
Co
lumnArticleIdBean
>
articleIdList
)
public
static
void
generateBasic
(
List
<
Co
ntentBean
>
articleIdList
)
throws
TemplateNotFoundException
,
MalformedTemplateNameException
,
ParseException
,
IOException
{
Map
<
Object
,
Object
>
contentModelMap
=
new
HashMap
<
Object
,
Object
>();
Content
ModelEntity
contentModel
=
null
;
ModelEntity
contentModel
=
null
;
String
writePath
=
null
;
// 记录已经生成了文章编号
List
<
Integer
>
generateIds
=
new
ArrayList
<>();
...
...
@@ -237,29 +239,29 @@ public class CmsParserUtil extends ParserUtil {
if
(
StringUtils
.
isNotBlank
(
columnContentModelId
))
{
// 通过当前栏目的模型编号获取,自定义模型表名
if
(
contentModelMap
.
containsKey
(
columnContentModelId
))
{
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
get
Cm
TableName
());
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
get
Model
TableName
());
}
else
{
// 通过栏目模型编号获取自定义模型实体
contentModel
=
(
ContentModelEntity
)
SpringUtil
.
getBean
(
IContent
ModelBiz
.
class
)
contentModel
=
(
ModelEntity
)
SpringUtil
.
getBean
(
I
ModelBiz
.
class
)
.
getEntity
(
Integer
.
parseInt
(
columnContentModelId
));
// 将自定义模型编号设置为key值
contentModelMap
.
put
(
columnContentModelId
,
contentModel
.
get
Cm
TableName
());
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
get
Cm
TableName
());
contentModelMap
.
put
(
columnContentModelId
,
contentModel
.
get
Model
TableName
());
parserParams
.
put
(
TABLE_NAME
,
contentModel
.
get
Model
TableName
());
}
}
parserParams
.
put
(
ID
,
articleId
);
// 第一篇文章没有上一篇
if
(
artId
>
0
)
{
Co
lumnArticleId
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
Co
ntent
Bean
preCaBean
=
articleIdList
.
get
(
artId
-
1
);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
if
(
articleColumnPath
.
contains
(
preCaBean
.
getCategoryId
()+
""
)){
page
.
setPreId
(
preCaBean
.
getArticleId
());
}
}
// 最后一篇文章没有下一篇
if
(
artId
+
1
<
articleIdList
.
size
())
{
Co
lumnArticleId
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
Co
ntent
Bean
nextCaBean
=
articleIdList
.
get
(
artId
+
1
);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if
(
articleColumnPath
.
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
page
.
setNextId
(
nextCaBean
.
getArticleId
());
...
...
src/main/webapp/static/plugins/tree-select/tree.js
View file @
ac217e7c
!
function
(
e
,
t
){
"object"
==
typeof
exports
&&
"object"
==
typeof
module
?
module
.
exports
=
t
():
"function"
==
typeof
define
&&
define
.
amd
?
define
([],
t
):
"object"
==
typeof
exports
?
exports
.
treeSelect
=
t
():
e
.
treeSelect
=
t
()}(
"undefined"
!=
typeof
self
?
self
:
this
,
function
(){
return
function
(
e
){
var
t
=
{};
function
n
(
r
){
if
(
t
[
r
])
return
t
[
r
].
exports
;
var
o
=
t
[
r
]
=
{
i
:
r
,
l
:
!
1
,
exports
:{}};
return
e
[
r
].
call
(
o
.
exports
,
o
,
o
.
exports
,
n
),
o
.
l
=!
0
,
o
.
exports
}
return
n
.
m
=
e
,
n
.
c
=
t
,
n
.
d
=
function
(
e
,
t
,
r
){
n
.
o
(
e
,
t
)
||
Object
.
defineProperty
(
e
,
t
,{
configurable
:
!
1
,
enumerable
:
!
0
,
get
:
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
=
""
,
n
(
n
.
s
=
7
)}([
function
(
e
,
t
,
n
){
e
.
exports
=!
n
(
6
)(
function
(){
return
7
!=
Object
.
defineProperty
({},
"a"
,{
get
:
function
(){
return
7
}}).
a
})},
function
(
e
,
t
){
e
.
exports
=
function
(
e
){
return
"object"
==
typeof
e
?
null
!==
e
:
"function"
==
typeof
e
}},
function
(
e
,
t
,
n
){
"use strict"
;
Object
.
defineProperty
(
t
,
"__esModule"
,{
value
:
!
0
});
var
r
,
o
=
n
(
14
),
i
=
(
r
=
o
)
&&
r
.
__esModule
?
r
:{
default
:
r
};
t
.
default
=
(
0
,
i
.
default
)({
template
:
"#tree-select"
,
name
:
"el-tree-select"
,
props
:{
props
:{
type
:
Object
,
default
:
function
(){
return
{
value
:
"id"
,
label
:
"title"
,
children
:
"children"
}}},
options
:{
type
:
Array
,
default
:
function
(){
return
[]}},
value
:{
type
:
Number
,
default
:
function
(){
return
null
}},
clearable
:{
type
:
Boolean
,
default
:
function
(){
return
!
0
}},
accordion
:{
type
:
Boolean
,
default
:
function
(){
return
!
1
}}},
watch
:{
value
:
function
(
e
,
t
){
this
.
valueId
=
e
,
this
.
initHandle
()},
options
:{
handler
:
function
(
e
,
t
){
console
.
log
(
this
.
valueId
,
e
),
this
.
initHandle
()},
immediate
:
!
0
,
deep
:
!
0
}},
data
:
function
(){
return
{
valueId
:
this
.
value
,
valueTitle
:
""
,
defaultExpandedKey
:[]}},
mounted
:
function
(){
this
.
initHandle
()},
methods
:{
initHandle
:
function
(){
if
(
this
.
valueId
){
if
(
!
this
.
$refs
.
selectTree
.
getNode
(
this
.
valueId
))
return
;
this
.
valueTitle
=
this
.
$refs
.
selectTree
.
getNode
(
this
.
valueId
).
data
[
this
.
props
.
label
],
this
.
$refs
.
selectTree
.
setCurrentKey
(
this
.
valueId
),
this
.
defaultExpandedKey
=
[
this
.
valueId
]}
this
.
initScroll
()},
initScroll
:
function
(){
this
.
$nextTick
(
function
(){
var
e
=
document
.
querySelectorAll
(
".el-scrollbar .el-select-dropdown__wrap"
)[
0
],
t
=
document
.
querySelectorAll
(
".el-scrollbar .el-scrollbar__bar"
);
e
.
style
.
cssText
=
"margin: 0px; max-height: none; overflow: hidden;"
,
t
.
forEach
(
function
(
e
){
return
e
.
style
.
width
=
0
})})},
handleNodeClick
:
function
(
e
){
this
.
$emit
(
"input"
,
e
[
this
.
props
.
value
]),
this
.
$emit
(
"change"
,{
node
:
e
,
dom
:
this
.
$refs
.
tsSselect
}),
this
.
$refs
.
tsSselect
.
blur
(),
this
.
defaultExpandedKey
=
[]},
clearHandle
:
function
(){
this
.
valueTitle
=
""
,
this
.
valueId
=
null
,
this
.
defaultExpandedKey
=
[],
this
.
clearSelected
(),
this
.
$emit
(
"input"
,
null
),
this
.
$emit
(
"change"
,
null
)},
clearSelected
:
function
(){
document
.
querySelectorAll
(
"#tree-option .el-tree-node"
).
forEach
(
function
(
e
){
return
e
.
classList
.
remove
(
"is-current"
)})}}},
"watch"
,{
value
:
function
(){
this
.
valueId
=
this
.
value
,
0
===
this
.
value
&&
(
this
.
valueTitle
=
"顶级菜单"
),
this
.
initHandle
()}})},
function
(
e
,
t
){
var
n
=
e
.
exports
=
"undefined"
!=
typeof
window
&&
window
.
Math
==
Math
?
window
:
"undefined"
!=
typeof
self
&&
self
.
Math
==
Math
?
self
:
Function
(
"return this"
)();
"number"
==
typeof
__g
&&
(
__g
=
n
)},
function
(
e
,
t
){
var
n
=
e
.
exports
=
{
version
:
"2.5.7"
};
"number"
==
typeof
__e
&&
(
__e
=
n
)},
function
(
e
,
t
,
n
){
var
r
=
n
(
22
),
o
=
n
(
23
),
i
=
n
(
25
),
a
=
Object
.
defineProperty
;
t
.
f
=
n
(
0
)?
Object
.
defineProperty
:
function
(
e
,
t
,
n
){
if
(
r
(
e
),
t
=
i
(
t
,
!
0
),
r
(
n
),
o
)
try
{
return
a
(
e
,
t
,
n
)}
catch
(
e
){}
if
(
"get"
in
n
||
"set"
in
n
)
throw
TypeError
(
"Accessors not supported!"
);
return
"value"
in
n
&&
(
e
[
t
]
=
n
.
value
),
e
}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
){
try
{
return
!!
e
()}
catch
(
e
){
return
!
0
}}},
function
(
e
,
t
,
n
){
"use strict"
;
Object
.
defineProperty
(
t
,
"__esModule"
,{
value
:
!
0
});
var
r
=
n
(
2
),
o
=
n
.
n
(
r
);
for
(
var
i
in
r
)
"default"
!==
i
&&
function
(
e
){
n
.
d
(
t
,
e
,
function
(){
return
r
[
e
]})}(
i
);
var
a
=
n
(
28
),
u
=!
1
;
var
l
=
function
(
e
){
u
||
n
(
8
)},
c
=
n
(
13
)(
o
.
a
,
a
.
a
,
!
1
,
l
,
"data-v-24dbbcae"
,
null
);
c
.
options
.
__file
=
"src/components/tree.vue"
,
t
.
default
=
c
.
exports
},
function
(
e
,
t
,
n
){
var
r
=
n
(
9
);
"string"
==
typeof
r
&&
(
r
=
[[
e
.
i
,
r
,
""
]]),
r
.
locals
&&
(
e
.
exports
=
r
.
locals
);
n
(
11
)(
"682353eb"
,
r
,
!
1
,{})},
function
(
e
,
t
,
n
){(
e
.
exports
=
n
(
10
)(
void
0
)).
push
([
e
.
i
,
"
\n
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item[data-v-24dbbcae] {
\
r
\n
height: auto;
\
r
\n
max-height: 274px;
\
r
\n
padding: 0;
\
r
\n
overflow: hidden;
\
r
\n
overflow-y: auto;
\n
}
\n
.el-select-dropdown__item.selected[data-v-24dbbcae] {
\
r
\n
font-weight: normal;
\n
}
\n
ul li[data-v-24dbbcae] .el-tree .el-tree-node__content {
\
r
\n
height: auto;
\
r
\n
padding: 0 20px;
\n
}
\n
.el-tree-node__label[data-v-24dbbcae] {
\
r
\n
font-weight: normal;
\n
}
\n
.el-tree[data-v-24dbbcae] .is-current .el-tree-node__label {
\
r
\n
color: #409eff;
\
r
\n
font-weight: 700;
\n
}
\n
.el-tree[data-v-24dbbcae] .is-current .el-tree-node__children .el-tree-node__label {
\
r
\n
color: #606266;
\
r
\n
font-weight: normal;
\n
}
\
r
\n
"
,
""
])},
function
(
e
,
t
){
e
.
exports
=
function
(
e
){
var
t
=
[];
return
t
.
toString
=
function
(){
return
this
.
map
(
function
(
t
){
var
n
=
function
(
e
,
t
){
var
n
=
e
[
1
]
||
""
,
r
=
e
[
3
];
if
(
!
r
)
return
n
;
if
(
t
){
var
o
=
(
a
=
r
,
"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"
+
new
Buffer
(
JSON
.
stringify
(
a
)).
toString
(
"base64"
)
+
" */"
),
i
=
r
.
sources
.
map
(
function
(
e
){
return
"/*# sourceURL="
+
r
.
sourceRoot
+
e
+
" */"
});
return
[
n
].
concat
(
i
).
concat
([
o
]).
join
(
"
\n
"
)}
var
a
;
return
[
n
].
join
(
"
\n
"
)}(
t
,
e
);
return
t
[
2
]?
"@media "
+
t
[
2
]
+
"{"
+
n
+
"}"
:
n
}).
join
(
""
)},
t
.
i
=
function
(
e
,
n
){
"string"
==
typeof
e
&&
(
e
=
[[
null
,
e
,
""
]]);
for
(
var
r
=
{},
o
=
0
;
o
<
this
.
length
;
o
++
){
var
i
=
this
[
o
][
0
];
"number"
==
typeof
i
&&
(
r
[
i
]
=!
0
)}
for
(
o
=
0
;
o
<
e
.
length
;
o
++
){
var
a
=
e
[
o
];
"number"
==
typeof
a
[
0
]
&&
r
[
a
[
0
]]
||
(
n
&&!
a
[
2
]?
a
[
2
]
=
n
:
n
&&
(
a
[
2
]
=
"("
+
a
[
2
]
+
") and ("
+
n
+
")"
),
t
.
push
(
a
))}},
t
}},
function
(
e
,
t
,
n
){
var
r
=
"undefined"
!=
typeof
document
;
if
(
"undefined"
!=
typeof
DEBUG
&&
DEBUG
&&!
r
)
throw
new
Error
(
"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
);
var
o
=
n
(
12
),
i
=
{},
a
=
r
&&
(
document
.
head
||
document
.
getElementsByTagName
(
"head"
)[
0
]),
u
=
null
,
l
=
0
,
c
=!
1
,
s
=
function
(){},
f
=
null
,
d
=
"data-vue-ssr-id"
,
p
=
"undefined"
!=
typeof
navigator
&&
/msie
[
6-9
]\b
/
.
test
(
navigator
.
userAgent
.
toLowerCase
());
function
h
(
e
){
for
(
var
t
=
0
;
t
<
e
.
length
;
t
++
){
var
n
=
e
[
t
],
r
=
i
[
n
.
id
];
if
(
r
){
r
.
refs
++
;
for
(
var
o
=
0
;
o
<
r
.
parts
.
length
;
o
++
)
r
.
parts
[
o
](
n
.
parts
[
o
]);
for
(;
o
<
n
.
parts
.
length
;
o
++
)
r
.
parts
.
push
(
y
(
n
.
parts
[
o
]));
r
.
parts
.
length
>
n
.
parts
.
length
&&
(
r
.
parts
.
length
=
n
.
parts
.
length
)}
else
{
var
a
=
[];
for
(
o
=
0
;
o
<
n
.
parts
.
length
;
o
++
)
a
.
push
(
y
(
n
.
parts
[
o
]));
i
[
n
.
id
]
=
{
id
:
n
.
id
,
refs
:
1
,
parts
:
a
}}}}
function
v
(){
var
e
=
document
.
createElement
(
"style"
);
return
e
.
type
=
"text/css"
,
a
.
appendChild
(
e
),
e
}
function
y
(
e
){
var
t
,
n
,
r
=
document
.
querySelector
(
"style["
+
d
+
'~="'
+
e
.
id
+
'"]'
);
if
(
r
){
if
(
c
)
return
s
;
r
.
parentNode
.
removeChild
(
r
)}
if
(
p
){
var
o
=
l
++
;
r
=
u
||
(
u
=
v
()),
t
=
_
.
bind
(
null
,
r
,
o
,
!
1
),
n
=
_
.
bind
(
null
,
r
,
o
,
!
0
)}
else
r
=
v
(),
t
=
function
(
e
,
t
){
var
n
=
t
.
css
,
r
=
t
.
media
,
o
=
t
.
sourceMap
;
r
&&
e
.
setAttribute
(
"media"
,
r
);
f
.
ssrId
&&
e
.
setAttribute
(
d
,
t
.
id
);
o
&&
(
n
+=
"
\n
/*# sourceURL="
+
o
.
sources
[
0
]
+
" */"
,
n
+=
"
\n
/*# sourceMappingURL=data:application/json;base64,"
+
btoa
(
unescape
(
encodeURIComponent
(
JSON
.
stringify
(
o
))))
+
" */"
);
if
(
e
.
styleSheet
)
e
.
styleSheet
.
cssText
=
n
;
else
{
for
(;
e
.
firstChild
;)
e
.
removeChild
(
e
.
firstChild
);
e
.
appendChild
(
document
.
createTextNode
(
n
))}}.
bind
(
null
,
r
),
n
=
function
(){
r
.
parentNode
.
removeChild
(
r
)};
return
t
(
e
),
function
(
r
){
if
(
r
){
if
(
r
.
css
===
e
.
css
&&
r
.
media
===
e
.
media
&&
r
.
sourceMap
===
e
.
sourceMap
)
return
;
t
(
e
=
r
)}
else
n
()}}
e
.
exports
=
function
(
e
,
t
,
n
,
r
){
c
=
n
,
f
=
r
||
{};
var
a
=
o
(
e
,
t
);
return
h
(
a
),
function
(
t
){
for
(
var
n
=
[],
r
=
0
;
r
<
a
.
length
;
r
++
){
var
u
=
a
[
r
];(
l
=
i
[
u
.
id
]).
refs
--
,
n
.
push
(
l
)}
t
?
h
(
a
=
o
(
e
,
t
)):
a
=
[];
for
(
r
=
0
;
r
<
n
.
length
;
r
++
){
var
l
;
if
(
0
===
(
l
=
n
[
r
]).
refs
){
for
(
var
c
=
0
;
c
<
l
.
parts
.
length
;
c
++
)
l
.
parts
[
c
]();
delete
i
[
l
.
id
]}}}};
var
b
,
m
=
(
b
=
[],
function
(
e
,
t
){
return
b
[
e
]
=
t
,
b
.
filter
(
Boolean
).
join
(
"
\n
"
)});
function
_
(
e
,
t
,
n
,
r
){
var
o
=
n
?
""
:
r
.
css
;
if
(
e
.
styleSheet
)
e
.
styleSheet
.
cssText
=
m
(
t
,
o
);
else
{
var
i
=
document
.
createTextNode
(
o
),
a
=
e
.
childNodes
;
a
[
t
]
&&
e
.
removeChild
(
a
[
t
]),
a
.
length
?
e
.
insertBefore
(
i
,
a
[
t
]):
e
.
appendChild
(
i
)}}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
,
t
){
for
(
var
n
=
[],
r
=
{},
o
=
0
;
o
<
t
.
length
;
o
++
){
var
i
=
t
[
o
],
a
=
i
[
0
],
u
=
{
id
:
e
+
":"
+
o
,
css
:
i
[
1
],
media
:
i
[
2
],
sourceMap
:
i
[
3
]};
r
[
a
]?
r
[
a
].
parts
.
push
(
u
):
n
.
push
(
r
[
a
]
=
{
id
:
a
,
parts
:[
u
]})}
return
n
}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
,
t
,
n
,
r
,
o
,
i
){
var
a
,
u
=
e
=
e
||
{},
l
=
typeof
e
.
default
;
"object"
!==
l
&&
"function"
!==
l
||
(
a
=
e
,
u
=
e
.
default
);
var
c
,
s
=
"function"
==
typeof
u
?
u
.
options
:
u
;
if
(
t
&&
(
s
.
render
=
t
.
render
,
s
.
staticRenderFns
=
t
.
staticRenderFns
,
s
.
_compiled
=!
0
),
n
&&
(
s
.
functional
=!
0
),
o
&&
(
s
.
_scopeId
=
o
),
i
?(
c
=
function
(
e
){(
e
=
e
||
this
.
$vnode
&&
this
.
$vnode
.
ssrContext
||
this
.
parent
&&
this
.
parent
.
$vnode
&&
this
.
parent
.
$vnode
.
ssrContext
)
||
"undefined"
==
typeof
__VUE_SSR_CONTEXT__
||
(
e
=
__VUE_SSR_CONTEXT__
),
r
&&
r
.
call
(
this
,
e
),
e
&&
e
.
_registeredComponents
&&
e
.
_registeredComponents
.
add
(
i
)},
s
.
_ssrRegister
=
c
):
r
&&
(
c
=
r
),
c
){
var
f
=
s
.
functional
,
d
=
f
?
s
.
render
:
s
.
beforeCreate
;
f
?(
s
.
_injectStyles
=
c
,
s
.
render
=
function
(
e
,
t
){
return
c
.
call
(
t
),
d
(
e
,
t
)}):
s
.
beforeCreate
=
d
?[].
concat
(
d
,
c
):[
c
]}
return
{
esModule
:
a
,
exports
:
u
,
options
:
s
}}},
function
(
e
,
t
,
n
){
"use strict"
;
t
.
__esModule
=!
0
;
var
r
,
o
=
n
(
15
),
i
=
(
r
=
o
)
&&
r
.
__esModule
?
r
:{
default
:
r
};
t
.
default
=
function
(
e
,
t
,
n
){
return
t
in
e
?(
0
,
i
.
default
)(
e
,
t
,{
value
:
n
,
enumerable
:
!
0
,
configurable
:
!
0
,
writable
:
!
0
}):
e
[
t
]
=
n
,
e
}},
function
(
e
,
t
,
n
){
e
.
exports
=
{
default
:
n
(
16
),
__esModule
:
!
0
}},
function
(
e
,
t
,
n
){
n
(
17
);
var
r
=
n
(
4
).
Object
;
e
.
exports
=
function
(
e
,
t
,
n
){
return
r
.
defineProperty
(
e
,
t
,
n
)}},
function
(
e
,
t
,
n
){
var
r
=
n
(
18
);
r
(
r
.
S
+
r
.
F
*!
n
(
0
),
"Object"
,{
defineProperty
:
n
(
5
).
f
})},
function
(
e
,
t
,
n
){
var
r
=
n
(
3
),
o
=
n
(
4
),
i
=
n
(
19
),
a
=
n
(
21
),
u
=
n
(
27
),
l
=
function
(
e
,
t
,
n
){
var
c
,
s
,
f
,
d
=
e
&
l
.
F
,
p
=
e
&
l
.
G
,
h
=
e
&
l
.
S
,
v
=
e
&
l
.
P
,
y
=
e
&
l
.
B
,
b
=
e
&
l
.
W
,
m
=
p
?
o
:
o
[
t
]
||
(
o
[
t
]
=
{}),
_
=
m
.
prototype
,
g
=
p
?
r
:
h
?
r
[
t
]:(
r
[
t
]
||
{}).
prototype
;
for
(
c
in
p
&&
(
n
=
t
),
n
)(
s
=!
d
&&
g
&&
void
0
!==
g
[
c
])
&&
u
(
m
,
c
)
||
(
f
=
s
?
g
[
c
]:
n
[
c
],
m
[
c
]
=
p
&&
"function"
!=
typeof
g
[
c
]?
n
[
c
]:
y
&&
s
?
i
(
f
,
r
):
b
&&
g
[
c
]
==
f
?
function
(
e
){
var
t
=
function
(
t
,
n
,
r
){
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
,
r
)}
return
e
.
apply
(
this
,
arguments
)};
return
t
.
prototype
=
e
.
prototype
,
t
}(
f
):
v
&&
"function"
==
typeof
f
?
i
(
Function
.
call
,
f
):
f
,
v
&&
((
m
.
virtual
||
(
m
.
virtual
=
{}))[
c
]
=
f
,
e
&
l
.
R
&&
_
&&!
_
[
c
]
&&
a
(
_
,
c
,
f
)))};
l
.
F
=
1
,
l
.
G
=
2
,
l
.
S
=
4
,
l
.
P
=
8
,
l
.
B
=
16
,
l
.
W
=
32
,
l
.
U
=
64
,
l
.
R
=
128
,
e
.
exports
=
l
},
function
(
e
,
t
,
n
){
var
r
=
n
(
20
);
e
.
exports
=
function
(
e
,
t
,
n
){
if
(
r
(
e
),
void
0
===
t
)
return
e
;
switch
(
n
){
case
1
:
return
function
(
n
){
return
e
.
call
(
t
,
n
)};
case
2
:
return
function
(
n
,
r
){
return
e
.
call
(
t
,
n
,
r
)};
case
3
:
return
function
(
n
,
r
,
o
){
return
e
.
call
(
t
,
n
,
r
,
o
)}}
return
function
(){
return
e
.
apply
(
t
,
arguments
)}}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
){
if
(
"function"
!=
typeof
e
)
throw
TypeError
(
e
+
" is not a function!"
);
return
e
}},
function
(
e
,
t
,
n
){
var
r
=
n
(
5
),
o
=
n
(
26
);
e
.
exports
=
n
(
0
)?
function
(
e
,
t
,
n
){
return
r
.
f
(
e
,
t
,
o
(
1
,
n
))}:
function
(
e
,
t
,
n
){
return
e
[
t
]
=
n
,
e
}},
function
(
e
,
t
,
n
){
var
r
=
n
(
1
);
e
.
exports
=
function
(
e
){
if
(
!
r
(
e
))
throw
TypeError
(
e
+
" is not an object!"
);
return
e
}},
function
(
e
,
t
,
n
){
e
.
exports
=!
n
(
0
)
&&!
n
(
6
)(
function
(){
return
7
!=
Object
.
defineProperty
(
n
(
24
)(
"div"
),
"a"
,{
get
:
function
(){
return
7
}}).
a
})},
function
(
e
,
t
,
n
){
var
r
=
n
(
1
),
o
=
n
(
3
).
document
,
i
=
r
(
o
)
&&
r
(
o
.
createElement
);
e
.
exports
=
function
(
e
){
return
i
?
o
.
createElement
(
e
):{}}},
function
(
e
,
t
,
n
){
var
r
=
n
(
1
);
e
.
exports
=
function
(
e
,
t
){
if
(
!
r
(
e
))
return
e
;
var
n
,
o
;
if
(
t
&&
"function"
==
typeof
(
n
=
e
.
toString
)
&&!
r
(
o
=
n
.
call
(
e
)))
return
o
;
if
(
"function"
==
typeof
(
n
=
e
.
valueOf
)
&&!
r
(
o
=
n
.
call
(
e
)))
return
o
;
if
(
!
t
&&
"function"
==
typeof
(
n
=
e
.
toString
)
&&!
r
(
o
=
n
.
call
(
e
)))
return
o
;
throw
TypeError
(
"Can't convert object to primitive value"
)}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
,
t
){
return
{
enumerable
:
!
(
1
&
e
),
configurable
:
!
(
2
&
e
),
writable
:
!
(
4
&
e
),
value
:
t
}}},
function
(
e
,
t
){
var
n
=
{}.
hasOwnProperty
;
e
.
exports
=
function
(
e
,
t
){
return
n
.
call
(
e
,
t
)
}},
function
(
e
,
t
,
n
){
"use strict"
;
var
r
=
function
(){
var
e
=
this
,
t
=
e
.
$createElement
,
n
=
e
.
_self
.
_c
||
t
;
return
n
(
"div"
,{
attrs
:{
id
:
"selecttree"
}},[
n
(
"el-select"
,{
ref
:
"tsSselect"
,
attrs
:{
value
:
e
.
valueTitle
,
clearable
:
e
.
clearable
},
on
:{
clear
:
e
.
clearHandle
}},[
n
(
"el-option"
,{
staticClass
:
"options"
,
attrs
:{
value
:
e
.
valueTitle
,
label
:
e
.
valueTitle
}},[
n
(
"el-tree"
,{
ref
:
"selectTree"
,
attrs
:{
id
:
"tree-option"
,
"default-expand-all"
:
""
,
"expand-on-click-node"
:
!
1
,
accordion
:
e
.
accordion
,
data
:
e
.
options
,
props
:
e
.
props
,
"node-key"
:
e
.
props
.
value
,
"default-expanded-keys"
:
e
.
defaultExpandedKey
},
on
:{
"node-click"
:
e
.
handleNodeClick
}})],
1
)],
1
)],
1
)};
r
.
_withStripped
=!
0
;
var
o
=
{
render
:
r
,
staticRenderFns
:[]};
t
.
a
=
o
}]).
default
});
!
function
(
e
,
t
){
"object"
==
typeof
exports
&&
"object"
==
typeof
module
?
module
.
exports
=
t
():
"function"
==
typeof
define
&&
define
.
amd
?
define
([],
t
):
"object"
==
typeof
exports
?
exports
.
treeSelect
=
t
():
e
.
treeSelect
=
t
()}(
"undefined"
!=
typeof
self
?
self
:
this
,
function
(){
return
function
(
e
){
var
t
=
{};
function
n
(
r
){
if
(
t
[
r
])
return
t
[
r
].
exports
;
var
o
=
t
[
r
]
=
{
i
:
r
,
l
:
!
1
,
exports
:{}};
return
e
[
r
].
call
(
o
.
exports
,
o
,
o
.
exports
,
n
),
o
.
l
=!
0
,
o
.
exports
}
return
n
.
m
=
e
,
n
.
c
=
t
,
n
.
d
=
function
(
e
,
t
,
r
){
n
.
o
(
e
,
t
)
||
Object
.
defineProperty
(
e
,
t
,{
configurable
:
!
1
,
enumerable
:
!
0
,
get
:
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
=
""
,
n
(
n
.
s
=
1
)}([
function
(
e
,
t
,
n
){
"use strict"
;
Object
.
defineProperty
(
t
,
"__esModule"
,{
value
:
!
0
}),
t
.
default
=
{
template
:
"#tree-select"
,
name
:
"el-tree-select"
,
props
:{
props
:{
type
:
Object
,
default
:
function
(){
return
{
value
:
"id"
,
label
:
"title"
,
children
:
"children"
}}},
options
:{
type
:
Array
,
default
:
function
(){
return
[]}},
value
:{
type
:
Number
,
default
:
function
(){
return
null
}},
clearable
:{
type
:
Boolean
,
default
:
function
(){
return
!
0
}},
accordion
:{
type
:
Boolean
,
default
:
function
(){
return
!
1
}}},
data
:
function
(){
return
{
valueId
:
this
.
value
,
valueTitle
:
""
,
defaultExpandedKey
:[]}},
mounted
:
function
(){
this
.
initHandle
()},
methods
:{
initHandle
:
function
(){
if
(
this
.
valueId
){
if
(
!
this
.
$refs
.
selectTree
.
getNode
(
this
.
valueId
))
return
this
.
valueTitle
=
""
,
this
.
valueId
=
null
,
this
.
defaultExpandedKey
=
[],
void
this
.
clearSelected
();
this
.
valueTitle
=
this
.
$refs
.
selectTree
.
getNode
(
this
.
valueId
).
data
[
this
.
props
.
label
],
this
.
$refs
.
selectTree
.
setCurrentKey
(
this
.
valueId
),
this
.
defaultExpandedKey
=
[
this
.
valueId
]}
this
.
initScroll
()},
initScroll
:
function
(){
this
.
$nextTick
(
function
(){
var
e
=
document
.
querySelectorAll
(
".el-scrollbar .el-select-dropdown__wrap"
)[
0
],
t
=
document
.
querySelectorAll
(
".el-scrollbar .el-scrollbar__bar"
);
e
.
style
.
cssText
=
"margin: 0px; max-height: none; overflow: hidden;"
,
t
.
forEach
(
function
(
e
){
return
e
.
style
.
width
=
0
})})},
handleNodeClick
:
function
(
e
){
this
.
$emit
(
"input"
,
e
[
this
.
props
.
value
]),
this
.
$emit
(
"change"
,{
node
:
e
,
dom
:
this
.
$refs
.
tsSselect
}),
this
.
$refs
.
tsSselect
.
blur
(),
this
.
defaultExpandedKey
=
[]},
clearHandle
:
function
(){
this
.
valueTitle
=
""
,
this
.
valueId
=
null
,
this
.
defaultExpandedKey
=
[],
this
.
clearSelected
(),
this
.
$emit
(
"input"
,
null
),
this
.
$emit
(
"change"
,
null
)},
clearSelected
:
function
(){
document
.
querySelectorAll
(
"#tree-option .el-tree-node"
).
forEach
(
function
(
e
){
return
e
.
classList
.
remove
(
"is-current"
)})}},
watch
:{
value
:
function
(){
this
.
valueId
=
this
.
value
,
this
.
initHandle
()},
options
:{
handler
:
function
(
e
,
t
){
var
n
=
this
;
this
.
valueId
=
this
.
value
,
this
.
$nextTick
(
function
(
e
){
n
.
initHandle
()})},
immediate
:
!
0
,
deep
:
!
0
}}}},
function
(
e
,
t
,
n
){
"use strict"
;
Object
.
defineProperty
(
t
,
"__esModule"
,{
value
:
!
0
});
var
r
=
n
(
0
),
o
=
n
.
n
(
r
);
for
(
var
i
in
r
)
"default"
!==
i
&&
function
(
e
){
n
.
d
(
t
,
e
,
function
(){
return
r
[
e
]})}(
i
);
var
a
=
n
(
8
),
l
=!
1
;
var
s
=
function
(
e
){
l
||
n
(
2
)},
u
=
n
(
7
)(
o
.
a
,
a
.
a
,
!
1
,
s
,
"data-v-24dbbcae"
,
null
);
u
.
options
.
__file
=
"src/components/tree.vue"
,
t
.
default
=
u
.
exports
},
function
(
e
,
t
,
n
){
var
r
=
n
(
3
);
"string"
==
typeof
r
&&
(
r
=
[[
e
.
i
,
r
,
""
]]),
r
.
locals
&&
(
e
.
exports
=
r
.
locals
);
n
(
5
)(
"682353eb"
,
r
,
!
1
,{})},
function
(
e
,
t
,
n
){(
e
.
exports
=
n
(
4
)(
void
0
)).
push
([
e
.
i
,
"
\n
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item[data-v-24dbbcae] {
\
r
\n
height: auto;
\
r
\n
max-height: 274px;
\
r
\n
padding: 0;
\
r
\n
overflow: hidden;
\
r
\n
overflow-y: auto;
\n
}
\n
.el-select-dropdown__item.selected[data-v-24dbbcae] {
\
r
\n
font-weight: normal;
\n
}
\n
ul li[data-v-24dbbcae] .el-tree .el-tree-node__content {
\
r
\n
height: auto;
\
r
\n
padding: 0 20px;
\n
}
\n
.el-tree-node__label[data-v-24dbbcae] {
\
r
\n
font-weight: normal;
\n
}
\n
.el-tree[data-v-24dbbcae] .is-current .el-tree-node__label {
\
r
\n
color: #409eff;
\
r
\n
font-weight: 700;
\n
}
\n
.el-tree[data-v-24dbbcae] .is-current .el-tree-node__children .el-tree-node__label {
\
r
\n
color: #606266;
\
r
\n
font-weight: normal;
\n
}
\
r
\n
"
,
""
])},
function
(
e
,
t
){
e
.
exports
=
function
(
e
){
var
t
=
[];
return
t
.
toString
=
function
(){
return
this
.
map
(
function
(
t
){
var
n
=
function
(
e
,
t
){
var
n
=
e
[
1
]
||
""
,
r
=
e
[
3
];
if
(
!
r
)
return
n
;
if
(
t
){
var
o
=
(
a
=
r
,
"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"
+
new
Buffer
(
JSON
.
stringify
(
a
)).
toString
(
"base64"
)
+
" */"
),
i
=
r
.
sources
.
map
(
function
(
e
){
return
"/*# sourceURL="
+
r
.
sourceRoot
+
e
+
" */"
});
return
[
n
].
concat
(
i
).
concat
([
o
]).
join
(
"
\n
"
)}
var
a
;
return
[
n
].
join
(
"
\n
"
)}(
t
,
e
);
return
t
[
2
]?
"@media "
+
t
[
2
]
+
"{"
+
n
+
"}"
:
n
}).
join
(
""
)},
t
.
i
=
function
(
e
,
n
){
"string"
==
typeof
e
&&
(
e
=
[[
null
,
e
,
""
]]);
for
(
var
r
=
{},
o
=
0
;
o
<
this
.
length
;
o
++
){
var
i
=
this
[
o
][
0
];
"number"
==
typeof
i
&&
(
r
[
i
]
=!
0
)}
for
(
o
=
0
;
o
<
e
.
length
;
o
++
){
var
a
=
e
[
o
];
"number"
==
typeof
a
[
0
]
&&
r
[
a
[
0
]]
||
(
n
&&!
a
[
2
]?
a
[
2
]
=
n
:
n
&&
(
a
[
2
]
=
"("
+
a
[
2
]
+
") and ("
+
n
+
")"
),
t
.
push
(
a
))}},
t
}},
function
(
e
,
t
,
n
){
var
r
=
"undefined"
!=
typeof
document
;
if
(
"undefined"
!=
typeof
DEBUG
&&
DEBUG
&&!
r
)
throw
new
Error
(
"vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment."
);
var
o
=
n
(
6
),
i
=
{},
a
=
r
&&
(
document
.
head
||
document
.
getElementsByTagName
(
"head"
)[
0
]),
l
=
null
,
s
=
0
,
u
=!
1
,
d
=
function
(){},
c
=
null
,
f
=
"data-vue-ssr-id"
,
p
=
"undefined"
!=
typeof
navigator
&&
/msie
[
6-9
]\b
/
.
test
(
navigator
.
userAgent
.
toLowerCase
());
function
h
(
e
){
for
(
var
t
=
0
;
t
<
e
.
length
;
t
++
){
var
n
=
e
[
t
],
r
=
i
[
n
.
id
];
if
(
r
){
r
.
refs
++
;
for
(
var
o
=
0
;
o
<
r
.
parts
.
length
;
o
++
)
r
.
parts
[
o
](
n
.
parts
[
o
]);
for
(;
o
<
n
.
parts
.
length
;
o
++
)
r
.
parts
.
push
(
m
(
n
.
parts
[
o
]));
r
.
parts
.
length
>
n
.
parts
.
length
&&
(
r
.
parts
.
length
=
n
.
parts
.
length
)}
else
{
var
a
=
[];
for
(
o
=
0
;
o
<
n
.
parts
.
length
;
o
++
)
a
.
push
(
m
(
n
.
parts
[
o
]));
i
[
n
.
id
]
=
{
id
:
n
.
id
,
refs
:
1
,
parts
:
a
}}}}
function
v
(){
var
e
=
document
.
createElement
(
"style"
);
return
e
.
type
=
"text/css"
,
a
.
appendChild
(
e
),
e
}
function
m
(
e
){
var
t
,
n
,
r
=
document
.
querySelector
(
"style["
+
f
+
'~="'
+
e
.
id
+
'"]'
);
if
(
r
){
if
(
u
)
return
d
;
r
.
parentNode
.
removeChild
(
r
)}
if
(
p
){
var
o
=
s
++
;
r
=
l
||
(
l
=
v
()),
t
=
g
.
bind
(
null
,
r
,
o
,
!
1
),
n
=
g
.
bind
(
null
,
r
,
o
,
!
0
)}
else
r
=
v
(),
t
=
function
(
e
,
t
){
var
n
=
t
.
css
,
r
=
t
.
media
,
o
=
t
.
sourceMap
;
r
&&
e
.
setAttribute
(
"media"
,
r
);
c
.
ssrId
&&
e
.
setAttribute
(
f
,
t
.
id
);
o
&&
(
n
+=
"
\n
/*# sourceURL="
+
o
.
sources
[
0
]
+
" */"
,
n
+=
"
\n
/*# sourceMappingURL=data:application/json;base64,"
+
btoa
(
unescape
(
encodeURIComponent
(
JSON
.
stringify
(
o
))))
+
" */"
);
if
(
e
.
styleSheet
)
e
.
styleSheet
.
cssText
=
n
;
else
{
for
(;
e
.
firstChild
;)
e
.
removeChild
(
e
.
firstChild
);
e
.
appendChild
(
document
.
createTextNode
(
n
))}}.
bind
(
null
,
r
),
n
=
function
(){
r
.
parentNode
.
removeChild
(
r
)};
return
t
(
e
),
function
(
r
){
if
(
r
){
if
(
r
.
css
===
e
.
css
&&
r
.
media
===
e
.
media
&&
r
.
sourceMap
===
e
.
sourceMap
)
return
;
t
(
e
=
r
)}
else
n
()}}
e
.
exports
=
function
(
e
,
t
,
n
,
r
){
u
=
n
,
c
=
r
||
{};
var
a
=
o
(
e
,
t
);
return
h
(
a
),
function
(
t
){
for
(
var
n
=
[],
r
=
0
;
r
<
a
.
length
;
r
++
){
var
l
=
a
[
r
];(
s
=
i
[
l
.
id
]).
refs
--
,
n
.
push
(
s
)}
t
?
h
(
a
=
o
(
e
,
t
)):
a
=
[];
for
(
r
=
0
;
r
<
n
.
length
;
r
++
){
var
s
;
if
(
0
===
(
s
=
n
[
r
]).
refs
){
for
(
var
u
=
0
;
u
<
s
.
parts
.
length
;
u
++
)
s
.
parts
[
u
]();
delete
i
[
s
.
id
]}}}};
var
b
,
y
=
(
b
=
[],
function
(
e
,
t
){
return
b
[
e
]
=
t
,
b
.
filter
(
Boolean
).
join
(
"
\n
"
)});
function
g
(
e
,
t
,
n
,
r
){
var
o
=
n
?
""
:
r
.
css
;
if
(
e
.
styleSheet
)
e
.
styleSheet
.
cssText
=
y
(
t
,
o
);
else
{
var
i
=
document
.
createTextNode
(
o
),
a
=
e
.
childNodes
;
a
[
t
]
&&
e
.
removeChild
(
a
[
t
]),
a
.
length
?
e
.
insertBefore
(
i
,
a
[
t
]):
e
.
appendChild
(
i
)}}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
,
t
){
for
(
var
n
=
[],
r
=
{},
o
=
0
;
o
<
t
.
length
;
o
++
){
var
i
=
t
[
o
],
a
=
i
[
0
],
l
=
{
id
:
e
+
":"
+
o
,
css
:
i
[
1
],
media
:
i
[
2
],
sourceMap
:
i
[
3
]};
r
[
a
]?
r
[
a
].
parts
.
push
(
l
):
n
.
push
(
r
[
a
]
=
{
id
:
a
,
parts
:[
l
]})}
return
n
}},
function
(
e
,
t
){
e
.
exports
=
function
(
e
,
t
,
n
,
r
,
o
,
i
){
var
a
,
l
=
e
=
e
||
{},
s
=
typeof
e
.
default
;
"object"
!==
s
&&
"function"
!==
s
||
(
a
=
e
,
l
=
e
.
default
);
var
u
,
d
=
"function"
==
typeof
l
?
l
.
options
:
l
;
if
(
t
&&
(
d
.
render
=
t
.
render
,
d
.
staticRenderFns
=
t
.
staticRenderFns
,
d
.
_compiled
=!
0
),
n
&&
(
d
.
functional
=!
0
),
o
&&
(
d
.
_scopeId
=
o
),
i
?(
u
=
function
(
e
){(
e
=
e
||
this
.
$vnode
&&
this
.
$vnode
.
ssrContext
||
this
.
parent
&&
this
.
parent
.
$vnode
&&
this
.
parent
.
$vnode
.
ssrContext
)
||
"undefined"
==
typeof
__VUE_SSR_CONTEXT__
||
(
e
=
__VUE_SSR_CONTEXT__
),
r
&&
r
.
call
(
this
,
e
),
e
&&
e
.
_registeredComponents
&&
e
.
_registeredComponents
.
add
(
i
)},
d
.
_ssrRegister
=
u
):
r
&&
(
u
=
r
),
u
){
var
c
=
d
.
functional
,
f
=
c
?
d
.
render
:
d
.
beforeCreate
;
c
?(
d
.
_injectStyles
=
u
,
d
.
render
=
function
(
e
,
t
){
return
u
.
call
(
t
),
f
(
e
,
t
)}):
d
.
beforeCreate
=
f
?[].
concat
(
f
,
u
):[
u
]}
return
{
esModule
:
a
,
exports
:
l
,
options
:
d
}
}},
function
(
e
,
t
,
n
){
"use strict"
;
var
r
=
function
(){
var
e
=
this
,
t
=
e
.
$createElement
,
n
=
e
.
_self
.
_c
||
t
;
return
n
(
"div"
,{
attrs
:{
id
:
"selecttree"
}},[
n
(
"el-select"
,{
ref
:
"tsSselect"
,
attrs
:{
value
:
e
.
valueTitle
,
clearable
:
e
.
clearable
},
on
:{
clear
:
e
.
clearHandle
}},[
n
(
"el-option"
,{
staticClass
:
"options"
,
attrs
:{
value
:
e
.
valueTitle
,
label
:
e
.
valueTitle
}},[
n
(
"el-tree"
,{
ref
:
"selectTree"
,
attrs
:{
id
:
"tree-option"
,
"default-expand-all"
:
""
,
"expand-on-click-node"
:
!
1
,
accordion
:
e
.
accordion
,
data
:
e
.
options
,
props
:
e
.
props
,
"node-key"
:
e
.
props
.
value
,
"default-expanded-keys"
:
e
.
defaultExpandedKey
},
on
:{
"node-click"
:
e
.
handleNodeClick
}})],
1
)],
1
)],
1
)};
r
.
_withStripped
=!
0
;
var
o
=
{
render
:
r
,
staticRenderFns
:[]};
t
.
a
=
o
}]).
default
});
Vue
.
component
(
'tree-select'
,
treeSelect
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment