1
This commit is contained in:
parent
7efdea0454
commit
3145584b05
@ -56,7 +56,6 @@ public class BusiCategoryController extends BaseController {
|
||||
/**
|
||||
* 获取网站栏目详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:category:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(busiCategoryService.getById(id));
|
||||
@ -65,7 +64,6 @@ public class BusiCategoryController extends BaseController {
|
||||
/**
|
||||
* 新增网站栏目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:category:add')")
|
||||
@Log(title = "网站栏目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BusiCategory busiCategory) {
|
||||
@ -75,7 +73,6 @@ public class BusiCategoryController extends BaseController {
|
||||
/**
|
||||
* 修改网站栏目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:category:edit')")
|
||||
@Log(title = "网站栏目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BusiCategory busiCategory) {
|
||||
@ -85,7 +82,6 @@ public class BusiCategoryController extends BaseController {
|
||||
/**
|
||||
* 删除网站栏目
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('busi:category:remove')")
|
||||
@Log(title = "网站栏目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
|
@ -87,6 +87,20 @@ export const constantRoutes = [
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/category',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'categoryForm',
|
||||
component: () => import('@/views/busi/category/form/categoryForm'),
|
||||
name: 'CategoryForm',
|
||||
meta: { title: '栏目信息' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -1,60 +1,98 @@
|
||||
<template>
|
||||
<!-- <!– 添加或修改网站栏目对话框 –>
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="栏目code" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入栏目code" />
|
||||
</el-form-item>
|
||||
<el-form-item label="栏目名称" prop="catgName">
|
||||
<el-input v-model="form.catgName" placeholder="请输入栏目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="栏目级别" prop="catgLevel">
|
||||
<el-input v-model="form.catgLevel" placeholder="请输入栏目级别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上级栏目id" prop="parentId">
|
||||
<el-input v-model="form.parentId" placeholder="请输入上级栏目id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="直接下级产品数" prop="prodsJunior">
|
||||
<el-input v-model="form.prodsJunior" placeholder="请输入直接下级产品数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="递归产品数" prop="prodsAll">
|
||||
<el-input v-model="form.prodsAll" placeholder="请输入递归产品数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页面title" prop="title">
|
||||
<el-input v-model="form.title" placeholder="请输入页面title" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页面keyword" prop="keyword">
|
||||
<el-input v-model="form.keyword" placeholder="请输入页面keyword" />
|
||||
</el-form-item>
|
||||
<el-form-item label="页面description" prop="description">
|
||||
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="form.sort" placeholder="请输入排序" />
|
||||
</el-form-item>
|
||||
<el-form-item label="内容html">
|
||||
<editor v-model="form.content" :min-height="192"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品上方内容html" prop="prodUp">
|
||||
<el-input v-model="form.prodUp" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产品下方内容html" prop="prodDown">
|
||||
<el-input v-model="form.prodDown" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="站点唯一编码" prop="tenantId">
|
||||
<el-input v-model="form.tenantId" placeholder="请输入站点唯一编码" />
|
||||
</el-form-item>
|
||||
<!-- 添加或修改网站栏目对话框 -->
|
||||
<div class="app-container">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目编号" prop="code">
|
||||
<el-input v-model="form.code" placeholder="请输入栏目编号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目名称" prop="catgName">
|
||||
<el-input v-model="form.catgName" placeholder="请输入栏目名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="栏目类型" prop="catgType">
|
||||
<el-select v-model="form.catgType" placeholder="请选择通告栏目类型" >
|
||||
<el-option
|
||||
v-for="dict in dict.type.category_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {addCategory} from "@/api/busi/category";
|
||||
export default {
|
||||
name: "categoryForm"
|
||||
name: "categoryForm",
|
||||
dicts: ['category_type'],
|
||||
data(){
|
||||
return{
|
||||
//弹出层标题
|
||||
title:"",
|
||||
//表单参数
|
||||
form:{
|
||||
code:"",
|
||||
catgName:"",
|
||||
catgType:"",
|
||||
},
|
||||
//表单校验规则
|
||||
rules:{
|
||||
code: [
|
||||
{ required: true, trigger: "blur", message: "请输入栏目编号" }
|
||||
],
|
||||
catgName: [
|
||||
{ required: true, trigger: "blur", message: "请输入栏目名称" }
|
||||
],
|
||||
catgType: [
|
||||
{ required: true, trigger: "blur", message: "请选择栏目类型" }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
|
||||
/**确定按钮*/
|
||||
submitForm(){
|
||||
addCategory(this.form).then((res) => {
|
||||
if (res.code == 200){
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.cancel();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**取消按钮*/
|
||||
cancel(){
|
||||
this.reset();
|
||||
//关闭当前页面
|
||||
this.$store.dispatch("tagsView/delView", this.$route);
|
||||
// 调用全局挂载的方法,关闭当前页
|
||||
this.$router.go(-1)
|
||||
},
|
||||
|
||||
/**表单重置*/
|
||||
reset(){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
@ -23,50 +22,20 @@
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['busi:category:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['busi:category:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['busi:category:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['busi:category:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="categoryList" >
|
||||
<el-table-column label="栏目名称" align="center" prop="catgName" />
|
||||
<el-table-column label="栏目级别" align="center" prop="catgLevel" />
|
||||
<el-table-column label="栏目类型" align="center" prop="catgType" />
|
||||
<el-table-column label="栏目类型" align="center" prop="catgType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.category_type" :value="scope.row.catgType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="修改时间" align="center" prop="content" />
|
||||
<el-table-column label="修改时间" align="center" prop="updateTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@ -93,8 +62,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -103,6 +70,8 @@ import { listCategory,delCategory} from "@/api/busi/category";
|
||||
|
||||
export default {
|
||||
name: "Category",
|
||||
components:{},
|
||||
dicts: ['category_type'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
@ -130,15 +99,10 @@ export default {
|
||||
this.loading = true;
|
||||
listCategory(this.queryParams).then(response => {
|
||||
console.log(response)
|
||||
// this.categoryList = response.data.records;
|
||||
this.categoryList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@ -149,10 +113,9 @@ export default {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
|
||||
this.$router.push({path:'/category/categoryForm'})
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
@ -162,7 +125,7 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除网站栏目编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除网站栏目"' + row.catgName + '"?').then(function() {
|
||||
return delCategory(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
|
Loading…
Reference in New Issue
Block a user