10.17 16:57

This commit is contained in:
user 2023-10-23 15:17:08 +08:00
parent 20bc144bb3
commit 18cbb90abd
10 changed files with 88 additions and 20 deletions

View File

@ -35,5 +35,13 @@ export function selectParentById(query) {
params: query
})
}
// 根据id查询一级分类
export function deleteBYId(id) {
return request({
url: '/business/cvsGoods/detele/'+id,
method: 'delete',
})
}

View File

@ -0,0 +1,35 @@
<template>
<div>
<i class="el-icon-s-marketing" @click="goToWebsite"></i>
</div>
</template>
<script>
export default {
name: 'index',
mounted() {
// this.toggleFullscreen
},
methods:{
goToWebsite() {
window.open('http://admin.sgkjsc.cn/#/')
this.toggleFullscreen()
},
toggleFullscreen() {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen();
} else if (document.documentElement.mozRequestFullScreen) { // Firefox
document.documentElement.mozRequestFullScreen();
} else if (document.documentElement.webkitRequestFullscreen) { // Chrome, Safari and Opera
document.documentElement.webkitRequestFullscreen();
} else if (document.documentElement.msRequestFullscreen) { // IE/Edge
document.documentElement.msRequestFullscreen();
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -8,6 +8,7 @@
<div class="right-menu">
<template v-if="device!=='mobile'">
<search id="header-search" class="right-menu-item" />
<ScreenData class="right-menu-item hover-effect" style="font-size: 24px"></ScreenData>
<screenfull id="screenfull" class="right-menu-item hover-effect" />
<FuintDoc id="fuint-doc" class="right-menu-item hover-effect" />
</template>
@ -48,6 +49,7 @@ import Screenfull from '@/components/Screenfull'
import SizeSelect from '@/components/SizeSelect'
import Search from '@/components/HeaderSearch'
import FuintDoc from '@/components/Fuint/Doc'
import ScreenData from '@/components/ScreenData'
export default {
components: {
@ -57,7 +59,8 @@ export default {
Screenfull,
SizeSelect,
Search,
FuintDoc
FuintDoc,
ScreenData
},
computed: {
...mapGetters([

View File

@ -30,7 +30,7 @@
<!-- 分类列表 -->
<el-table
:data="tableData"
style="width: 100%;margin-bottom: 20px;"
style="width: 100%;margin-bottom: 20px;"
row-key="id"
border
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
@ -51,7 +51,7 @@
<el-table-column label="操作" width="180">
<template slot-scope="scope">
<el-button type="primary" @click="editeCategory(scope.row)" size="mini">编辑</el-button>
<el-button type="danger" @click="delCategory" size="mini">删除</el-button>
<el-button type="danger" @click="delCategory(scope.row.id)" size="mini">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -67,7 +67,7 @@
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item label="分类名称" prop="categoryName" style="margin-left: -8px;">
<el-input v-model="form.categoryName" style="width: 300px;"></el-input>
</el-form-item>
@ -97,7 +97,7 @@
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item label="分类名称" prop="categoryName" style="margin-left: -8px;">
<el-input v-model="editForm.categoryName" style="width: 300px;"></el-input>
</el-form-item>
@ -130,7 +130,7 @@
</template>
<script>
import { selectTree, list,insertCvsGoods,selectParentById} from "@/api/convenienceStore/goods.js";
import { selectTree, list,insertCvsGoods,deleteBYId} from "@/api/convenienceStore/goods.js";
import { runInThisContext } from "vm";
export default {
dicts:['zhzt'],
@ -138,12 +138,12 @@ export default {
return {
//
isShow:false,
//
//
editForm:{
pid:'',
categoryName:'',
status:'qy',
sorted:0,
sorted:0,
},
//
goodsOptions:[],
@ -172,7 +172,7 @@ export default {
categoryName: '',
sorted: '',
status:'',
createdTime:'',
createdTime:'',
children: []
}],
//
@ -192,7 +192,7 @@ export default {
],
},
};
},
created(){
@ -223,8 +223,10 @@ export default {
this.editDialogFormVisible = false
},
//
delCategory(){
delCategory(id){
deleteBYId(id).then(res=>{
console.log(res)
})
},
//
insertGoods(){
@ -236,7 +238,7 @@ export default {
this.dialogFormVisible = true
this.getFirstMenu();
},
//
//
getFirstMenu(){
list(this.form).then(response=>{
this.goodsOptions = response.data
@ -281,8 +283,8 @@ export default {
}
})
}
})
},
@ -341,4 +343,4 @@ export default {
margin-left: 250px;
}
</style>
</style>

View File

@ -57,6 +57,15 @@ public class CvsGoodsController extends BaseController {
CvsGoods cvsGoods = cvsGoodsService.selectParentById(id);
return getSuccessResult(cvsGoods);
}
//删除
@DeleteMapping("detele/{id}")
public ResponseObject selectDeleteId(@PathVariable Integer id)
{
cvsGoodsService.deleteByIdVo(id);
return getSuccessResult("删除成功");
}
}

View File

@ -24,7 +24,7 @@ public interface CvsGoodsMapper extends BaseMapper<CvsGoods> {
//根据id和name查找
List<CvsGoods> selectGoodsList(CvsGoods goods);
void deleteByIdVo(Integer id);
}

View File

@ -82,5 +82,7 @@
</where>
order by sorted
</select>
<delete id="deleteByIdVo">
DELETE FROM cvs_goods WHERE id=#{id}
</delete>
</mapper>

View File

@ -21,4 +21,5 @@ public interface CvsGoodsService {
List<CvsGoods> selectCvsGoodsList(CvsGoods goods);
CvsGoods selectParentById(Integer id);
void deleteByIdVo(Integer id);
}

View File

@ -41,6 +41,7 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
}
public IPage<CvsGoodsVo> selectTree(Page page, CvsGoods g){
// 查询全部数据
IPage<CvsGoodsVo> cvsGoodsPage= baseMapper.selectCvsGoodsList(page,g);//一节点
@ -109,4 +110,9 @@ public class CvsGoodsServiceImpl extends ServiceImpl<CvsGoodsMapper,CvsGoods> im
public CvsGoods selectParentById(Integer id){
return baseMapper.selectById(id);
}
// 删除
@Override
public void deleteByIdVo(Integer id){
baseMapper.deleteByIdVo(id);
}
}

View File

@ -1,5 +1,7 @@
<template>
// empty
<div>
???
</div>
</template>
<script>