Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
78baba37
提交
78baba37
authored
3月 01, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成商品首页分类导航栏
上级
ea4b401a
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
735 行增加
和
29 行删除
+735
-29
TbCfClassificationController.java
...com/platform/controller/TbCfClassificationController.java
+109
-0
TbCfClassificationDao.java
...src/main/java/com/platform/dao/TbCfClassificationDao.java
+13
-0
TbCfClassificationEntity.java
...in/java/com/platform/entity/TbCfClassificationEntity.java
+119
-0
WebContentFilter.java
...n/src/main/java/com/platform/filter/WebContentFilter.java
+35
-0
TbCfClassificationService.java
.../java/com/platform/service/TbCfClassificationService.java
+71
-0
TbCfClassificationServiceImpl.java
.../platform/service/impl/TbCfClassificationServiceImpl.java
+59
-0
TbCfClassificationDao.xml
...main/resources/com/platform/dao/TbCfClassificationDao.xml
+101
-0
tbcfclassification.html
.../src/main/webapp/WEB-INF/page/sys/tbcfclassification.html
+72
-0
web.xml
platform-admin/src/main/webapp/WEB-INF/web.xml
+9
-29
tbcfclassification.js
platform-admin/src/main/webapp/js/sys/tbcfclassification.js
+147
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfClassificationController.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
controller
;
import
com.platform.entity.TbCfClassificationEntity
;
import
com.platform.service.TbCfClassificationService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
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.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* 首页分类导航Controller
*
* @author lipengjun
* @date 2020-03-01 14:05:19
*/
@Controller
@RequestMapping
(
"tbcfclassification"
)
public
class
TbCfClassificationController
{
@Autowired
private
TbCfClassificationService
tbCfClassificationService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"tbcfclassification:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
TbCfClassificationEntity
>
tbCfClassificationList
=
tbCfClassificationService
.
queryList
(
query
);
int
total
=
tbCfClassificationService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCfClassificationList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"tbcfclassification:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
TbCfClassificationEntity
tbCfClassification
=
tbCfClassificationService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"tbCfClassification"
,
tbCfClassification
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"tbcfclassification:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TbCfClassificationEntity
tbCfClassification
)
{
tbCfClassificationService
.
save
(
tbCfClassification
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"tbcfclassification:update"
)
@ResponseBody
public
R
update
(
@RequestBody
TbCfClassificationEntity
tbCfClassification
)
{
tbCfClassificationService
.
update
(
tbCfClassification
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"tbcfclassification:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
tbCfClassificationService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
TbCfClassificationEntity
>
list
=
tbCfClassificationService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfClassificationDao.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfClassificationEntity
;
/**
* 首页分类导航Dao
*
* @author lipengjun
* @date 2020-03-01 14:05:19
*/
public
interface
TbCfClassificationDao
extends
BaseDao
<
TbCfClassificationEntity
>
{
}
platform-admin/src/main/java/com/platform/entity/TbCfClassificationEntity.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 首页分类导航实体
* 表名 tb_cf_classification
*
* @author lipengjun
* @date 2020-03-01 14:05:19
*/
public
class
TbCfClassificationEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 首页分类导航ID
*/
private
String
id
;
/**
* 一级分类ID
*/
private
String
goodtypeId
;
/**
* 标题
*/
private
String
classTitle
;
/**
* 图片
*/
private
String
picture
;
/**
* 排序
*/
private
Integer
sort
;
/**
* 是否展示
*/
private
String
isShow
;
/**
* 设置:首页分类导航ID
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:首页分类导航ID
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:一级分类ID
*/
public
void
setGoodtypeId
(
String
goodtypeId
)
{
this
.
goodtypeId
=
goodtypeId
;
}
/**
* 获取:一级分类ID
*/
public
String
getGoodtypeId
()
{
return
goodtypeId
;
}
/**
* 设置:标题
*/
public
void
setClassTitle
(
String
classTitle
)
{
this
.
classTitle
=
classTitle
;
}
/**
* 获取:标题
*/
public
String
getClassTitle
()
{
return
classTitle
;
}
/**
* 设置:图片
*/
public
void
setPicture
(
String
picture
)
{
this
.
picture
=
picture
;
}
/**
* 获取:图片
*/
public
String
getPicture
()
{
return
picture
;
}
/**
* 设置:排序
*/
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
/**
* 获取:排序
*/
public
Integer
getSort
()
{
return
sort
;
}
/**
* 设置:是否展示
*/
public
void
setIsShow
(
String
isShow
)
{
this
.
isShow
=
isShow
;
}
/**
* 获取:是否展示
*/
public
String
getIsShow
()
{
return
isShow
;
}
}
platform-admin/src/main/java/com/platform/filter/WebContentFilter.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
filter
;
import
javax.servlet.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.logging.LogRecord
;
/**
* @Auther: wudepeng
* @Date: 2020/02/26
* @Description:
*/
public
class
WebContentFilter
implements
Filter
{
@Override
public
void
init
(
FilterConfig
filterConfig
)
throws
ServletException
{
}
@Override
public
void
doFilter
(
ServletRequest
servletRequest
,
ServletResponse
servletResponse
,
FilterChain
filterChain
)
throws
IOException
,
ServletException
{
HttpServletResponse
httpServletResponse
=(
HttpServletResponse
)
servletResponse
;
httpServletResponse
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
httpServletResponse
.
setHeader
(
"Access-Control-Allow-Headers"
,
"Authentication"
);
filterChain
.
doFilter
(
servletRequest
,
httpServletResponse
);
}
@Override
public
void
destroy
()
{
}
}
platform-admin/src/main/java/com/platform/service/TbCfClassificationService.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfClassificationEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* 首页分类导航Service接口
*
* @author lipengjun
* @date 2020-03-01 14:05:19
*/
public
interface
TbCfClassificationService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCfClassificationEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TbCfClassificationEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param tbCfClassification 实体
* @return 保存条数
*/
int
save
(
TbCfClassificationEntity
tbCfClassification
);
/**
* 根据主键更新实体
*
* @param tbCfClassification 实体
* @return 更新条数
*/
int
update
(
TbCfClassificationEntity
tbCfClassification
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfClassificationServiceImpl.java
0 → 100644
浏览文件 @
78baba37
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.TbCfClassificationDao
;
import
com.platform.entity.TbCfClassificationEntity
;
import
com.platform.service.TbCfClassificationService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
/**
* 首页分类导航Service实现类
*
* @author lipengjun
* @date 2020-03-01 14:05:19
*/
@Service
(
"tbCfClassificationService"
)
public
class
TbCfClassificationServiceImpl
implements
TbCfClassificationService
{
@Autowired
private
TbCfClassificationDao
tbCfClassificationDao
;
@Override
public
TbCfClassificationEntity
queryObject
(
String
id
)
{
return
tbCfClassificationDao
.
queryObject
(
id
);
}
@Override
public
List
<
TbCfClassificationEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCfClassificationDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
tbCfClassificationDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TbCfClassificationEntity
tbCfClassification
)
{
tbCfClassification
.
setId
(
IdUtil
.
createIdbyUUID
());
return
tbCfClassificationDao
.
save
(
tbCfClassification
);
}
@Override
public
int
update
(
TbCfClassificationEntity
tbCfClassification
)
{
return
tbCfClassificationDao
.
update
(
tbCfClassification
);
}
@Override
public
int
delete
(
String
id
)
{
return
tbCfClassificationDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
tbCfClassificationDao
.
deleteBatch
(
ids
);
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfClassificationDao.xml
0 → 100644
浏览文件 @
78baba37
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.platform.dao.TbCfClassificationDao"
>
<resultMap
type=
"com.platform.entity.TbCfClassificationEntity"
id=
"tbCfClassificationMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"goodtypeId"
column=
"goodtype_id"
/>
<result
property=
"classTitle"
column=
"class_title"
/>
<result
property=
"picture"
column=
"picture"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"isShow"
column=
"is_show"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCfClassificationEntity"
>
select
`id`,
`goodtype_id`,
`class_title`,
`picture`,
`sort`,
`is_show`
from tb_cf_classification
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfClassificationEntity"
>
select
`id`,
`goodtype_id`,
`class_title`,
`picture`,
`sort`,
`is_show`
from tb_cf_classification
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_classification
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCfClassificationEntity"
>
insert into tb_cf_classification(
`id`,
`goodtype_id`,
`class_title`,
`picture`,
`sort`,
`is_show`)
values(
#{id},
#{goodtypeId},
#{classTitle},
#{picture},
#{sort},
#{isShow})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCfClassificationEntity"
>
update tb_cf_classification
<set>
<if
test=
"goodtypeId != null"
>
`goodtype_id` = #{goodtypeId},
</if>
<if
test=
"classTitle != null"
>
`class_title` = #{classTitle},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"sort != null"
>
`sort` = #{sort},
</if>
<if
test=
"isShow != null"
>
`is_show` = #{isShow}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_cf_classification where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_cf_classification where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfclassification.html
0 → 100644
浏览文件 @
78baba37
<!DOCTYPE html>
<html
xmlns:v-bind=
"http://www.w3.org/1999/xhtml"
>
<head>
<title>
首页分类导航
</title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("tbcfclassification:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("tbcfclassification:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("tbcfclassification:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"tbCfClassification"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"标题"
prop=
"classTitle"
>
<i-input
v-model=
"tbCfClassification.classTitle"
placeholder=
"标题"
/>
</Form-item>
<!--<Form-item label="商品一级分类" prop="goodtypeId">
<i-input v-model="tbCfClassification.goodtypeId" placeholder="商品一级分类"/>
</Form-item>-->
<Form-item
label=
"商品一级分类"
prop=
"goodtypeId"
>
<i-select
placeholder=
"请选择"
v-model=
"tbCfClassification.goodtypeId"
>
<i-option
v-for=
"(el,i) in Goodstype"
:key=
'i'
:value=
"el.goodstypeId"
>
{{el.goodstypeTitle}}
</i-option>
</i-select>
</Form-item>
<Form-item
label=
"图片"
prop=
"picture"
>
<img
v-bind:src=
"tbCfClassification.picture"
v-show=
"!!tbCfClassification.picture"
/>
<input
type=
"file"
placeholder=
"图片"
@
change=
"tirggerFile($event)"
/>
</Form-item>
<Form-item
label=
"排序"
prop=
"sort"
>
<i-input
v-model=
"tbCfClassification.sort"
placeholder=
"排序"
/>
</Form-item>
<Form-item
label=
"是否展示"
prop=
"isShow"
>
<i-input
v-model=
"tbCfClassification.isShow"
placeholder=
"是否展示"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/tbcfclassification.js?_${date.systemTime}"
></script>
</body>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/web.xml
浏览文件 @
78baba37
...
@@ -82,36 +82,7 @@
...
@@ -82,36 +82,7 @@
<filter-name>
xssFilter
</filter-name>
<filter-name>
xssFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
</filter-mapping>
<filter>
<description>
跨域过滤器
</description>
<filter-name>
CORS
</filter-name>
<filter-class>
com.thetransactioncompany.cors.CORSFilter
</filter-class>
<init-param>
<param-name>
cors.allowOrigin
</param-name>
<param-value>
*
</param-value>
</init-param>
<init-param>
<param-name>
cors.supportedMethods
</param-name>
<param-value>
GET, POST, HEAD, PUT, DELETE
</param-value>
</init-param>
<init-param>
<param-name>
cors.supportedHeaders
</param-name>
<param-value>
Accept, Origin, X-Requested-With, Content-Type, Last-Modified
</param-value>
</init-param>
<init-param>
<param-name>
cors.exposedHeaders
</param-name>
<param-value>
Set-Cookie
</param-value>
</init-param>
<init-param>
<param-name>
cors.supportsCredentials
</param-name>
<param-value>
true
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
CORS
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<servlet>
<servlet>
<servlet-name>
dispatcher
</servlet-name>
<servlet-name>
dispatcher
</servlet-name>
<servlet-class>
<servlet-class>
...
@@ -134,6 +105,15 @@
...
@@ -134,6 +105,15 @@
<servlet-name>
DruidStatView
</servlet-name>
<servlet-name>
DruidStatView
</servlet-name>
<url-pattern>
/druid/*
</url-pattern>
<url-pattern>
/druid/*
</url-pattern>
</servlet-mapping>
</servlet-mapping>
<!-- 跨域 -->
<filter>
<filter-name>
ContentFilter
</filter-name>
<filter-class>
com.platform.filter.WebContentFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>
ContentFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<error-page>
<error-page>
...
...
platform-admin/src/main/webapp/js/sys/tbcfclassification.js
0 → 100644
浏览文件 @
78baba37
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../tbcfclassification/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
/*{label: '一级分类ID', name: 'goodtypeId', index: 'goodtype_id', width: 80},*/
{
label
:
'标题'
,
name
:
'classTitle'
,
index
:
'class_title'
,
width
:
80
},
{
label
:
'图片'
,
name
:
'picture'
,
index
:
'picture'
,
width
:
80
,
formatter
:
imageFormat
},
{
label
:
'排序'
,
name
:
'sort'
,
index
:
'sort'
,
width
:
80
},
{
label
:
'是否展示'
,
name
:
'isShow'
,
index
:
'is_show'
,
width
:
80
}]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
changeGoodstype
:
null
,
Goodstype
:
null
,
tbCfClassification
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
tbCfClassification
=
{};
},
update
:
function
(
event
)
{
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
id
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
tbCfClassification
.
id
==
null
?
"../tbcfclassification/save"
:
"../tbcfclassification/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
tbCfClassification
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
ids
=
getSelectedRows
(
"#jqGrid"
);
if
(
ids
==
null
)
{
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../tbcfclassification/delete"
,
params
:
JSON
.
stringify
(
ids
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
id
)
{
Ajax
.
request
({
url
:
"../tbcfclassification/info/"
+
id
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
tbCfClassification
=
r
.
tbCfClassification
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
},
tirggerFile
:
function
(
event
)
{
var
file
=
event
.
target
.
files
[
0
];
var
formData
=
new
FormData
();
formData
.
append
(
"file"
,
file
);
$
.
ajax
({
url
:
"../api/upload/image/"
,
type
:
"POST"
,
data
:
formData
,
cache
:
false
,
//不设置缓存
processData
:
false
,
// 不处理数据
contentType
:
false
,
// 不设置内容类型
success
:
function
(
result
)
{
result
=
JSON
.
parse
(
result
);
//console.log(result)
if
(
result
.
errno
==
0
)
{
//成功
vm
.
tbCfClassification
.
picture
=
result
.
data
;
vm
.
$forceUpdate
();
}
else
{
iview
.
Message
.
error
(
result
.
errmsg
);
}
}
});
}
},
created
()
{
$
.
get
(
'../tbcfgoodstype/queryAll'
,
res
=>
{
this
.
Goodstype
=
res
.
list
;
console
.
log
(
'一级分类'
,
this
.
Goodstype
)
})
}
});
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论