字典列表
This commit is contained in:
+6
-6
@@ -81,7 +81,7 @@ public class SysCategoryController {
|
||||
return result;
|
||||
}
|
||||
|
||||
@RequiresPermissions("sys:category:list")
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/childList")
|
||||
public Result<List<SysCategory>> queryPageList(SysCategory sysCategory,HttpServletRequest req) {
|
||||
Result<List<SysCategory>> result = new Result<List<SysCategory>>();
|
||||
@@ -113,7 +113,7 @@ public class SysCategoryController {
|
||||
* @param sysCategory
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:add")
|
||||
// @RequiresPermissions("sys:category:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SysCategory> add(@RequestBody SysCategory sysCategory) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
@@ -132,7 +132,7 @@ public class SysCategoryController {
|
||||
* @param sysCategory
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:edit")
|
||||
// @RequiresPermissions("sys:category:edit")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<SysCategory> edit(@RequestBody SysCategory sysCategory) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
@@ -151,7 +151,7 @@ public class SysCategoryController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<SysCategory> delete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
@@ -171,7 +171,7 @@ public class SysCategoryController {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:del")
|
||||
// @RequiresPermissions("sys:category:del")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<SysCategory> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
@@ -189,7 +189,7 @@ public class SysCategoryController {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:category:list")
|
||||
// @RequiresPermissions("sys:category:list")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<SysCategory> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
Result<SysCategory> result = new Result<SysCategory>();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||
<a-input class="box-input" v-model="formInline[item.db_field_name]"
|
||||
:disabled="disabled"
|
||||
:placeholder="item.placeholder"/>
|
||||
:placeholder="$t('PleaseEnter')+item.db_field_txt"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
|
||||
@@ -228,9 +228,9 @@
|
||||
},
|
||||
//下载
|
||||
actionDown(val){
|
||||
// console.log()
|
||||
// downloadFile('/sys/common/download', val.fileName, { id: val.id })
|
||||
downloadFile(val.docRealFile)
|
||||
// downloadFile('/sys/common/download', val.docRealName, { id: val.attId })
|
||||
// downloadFile(val.docRealFile)
|
||||
window.open(val.docRealFile)
|
||||
},
|
||||
//删除
|
||||
actionDelete(record){
|
||||
|
||||
@@ -46,40 +46,7 @@
|
||||
selectedKeys: [],
|
||||
expandedKeys: [],
|
||||
autoExpandParent: true,
|
||||
treeData: [
|
||||
{
|
||||
title: '车身结构',
|
||||
key: '0-0',
|
||||
children: [
|
||||
{
|
||||
title: '车身',
|
||||
key: '0-0-0',
|
||||
children: [
|
||||
{ title: '前窗', key: '0-0-0-0' },
|
||||
{ title: '挡风', key: '0-0-0-1' },
|
||||
{ title: '车门', key: '0-0-0-2' },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '底盘',
|
||||
key: '0-0-1',
|
||||
},
|
||||
{
|
||||
title: '车机系统',
|
||||
key: '0-0-2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '软件中心',
|
||||
key: '0-1',
|
||||
children: [
|
||||
{ title: '软件一', key: '0-1-0-0' },
|
||||
{ title: '软件二', key: '0-1-0-1' },
|
||||
{ title: '软件三', key: '0-1-0-2' },
|
||||
],
|
||||
},
|
||||
],
|
||||
treeData: [],
|
||||
dataList:[],
|
||||
searchValue:''
|
||||
}
|
||||
@@ -106,7 +73,7 @@
|
||||
if(res.success){
|
||||
let data=res.result
|
||||
this.treeData=this.addAttr(data)
|
||||
console.log('treeData',this.treeData)
|
||||
// console.log('treeData',this.treeData)
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- <a-button type="primary" @click="showModal">新增</a-button>-->
|
||||
<a-modal class="area-module" v-model="newVisible" :title="$t('add')" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
|
||||
<a-modal class="area-module" v-model="newVisible" :title="title" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
|
||||
<a-form-model
|
||||
class="tag-module"
|
||||
ref="ruleForm"
|
||||
@@ -99,6 +99,7 @@
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
title:this.$t('add'),
|
||||
queryParams:{
|
||||
pageNo:1,
|
||||
pageSize:10
|
||||
@@ -197,6 +198,7 @@
|
||||
|
||||
},
|
||||
showModal() {
|
||||
this.title=this.$t('add')
|
||||
this.newVisible = true;
|
||||
},
|
||||
//新增
|
||||
@@ -265,6 +267,7 @@
|
||||
},
|
||||
//编辑按钮
|
||||
editArea(val){
|
||||
this.title=this.$t('edit')
|
||||
this.newVisible = true;
|
||||
let params={
|
||||
id:val
|
||||
|
||||
@@ -17,16 +17,16 @@
|
||||
<a-icon type="plus" />
|
||||
{{$t('add')}}
|
||||
</div>
|
||||
<div class="operator-text" @click="batDelete">
|
||||
<div class="operator-text" v-if="dictVal=='tree'" @click="batDelete">
|
||||
<a-icon type="delete" />
|
||||
{{$t('BatchDelete')}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="dic-list-table">
|
||||
<list-table v-if="dictVal=='list'&&dataFlag" :tableData="tableData" @editDict="editDict" @deleteDict="deleteDict" :total="total"></list-table>
|
||||
<tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record" @editDict="editTreeDict" @ok="ok" :total="total"></tree-table>
|
||||
<tree-table v-if="dictVal=='tree'&&dataFlag" :tabletreeData="tabletreeData" :record="record" @editDict="editTreeDict" @selectedKeys="selectedKeys" @ok="ok" :total="total"></tree-table>
|
||||
</div>
|
||||
<a-modal class="dict-module" v-model="newVisible" :title="titleDict" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
|
||||
<a-modal class="dict-module" v-model="newVisible" :title="title" ok-text="保存" cancel-text="取消" @ok="hideModal" @cancel="cancelModel" v-if="newVisible">
|
||||
<a-form-model
|
||||
v-if="newVisible"
|
||||
class="dic-form-module"
|
||||
@@ -89,7 +89,7 @@
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
titleDict:'新增',
|
||||
title:this.$t('add'),
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 18 },
|
||||
queryParams:{
|
||||
@@ -158,7 +158,8 @@
|
||||
parentVisible:false,
|
||||
dataFlag:false,
|
||||
total:0,
|
||||
isEdit:false
|
||||
isEdit:false,
|
||||
selectedIds:[], //树形选中的id
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -194,6 +195,7 @@
|
||||
})
|
||||
}else if(this.dictVal=='tree'){
|
||||
getAction(`sys/category/queryBySysDictId`,{
|
||||
...this.queryParams,
|
||||
id:this.record.id,
|
||||
isTagDict:1
|
||||
}).then(res=>{
|
||||
@@ -249,8 +251,10 @@
|
||||
},
|
||||
//新增
|
||||
dicAdd(){
|
||||
this.title=this.$t('add')
|
||||
this.isEdit=false
|
||||
this.newVisible=true;
|
||||
this.form={}
|
||||
if(this.dictVal=='list'){
|
||||
this.parentVisible=false
|
||||
|
||||
@@ -280,6 +284,7 @@
|
||||
postAction(`sys/dictItem/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
@@ -308,6 +313,7 @@
|
||||
postAction(`sys/category/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(res.message)
|
||||
this.form={}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
} else {
|
||||
@@ -323,6 +329,7 @@
|
||||
},
|
||||
//列表编辑
|
||||
editDict(rec,val){
|
||||
this.title=this.$t('edit')
|
||||
this.isEdit=true
|
||||
this.form={...rec}
|
||||
this.newVisible=val
|
||||
@@ -330,6 +337,7 @@
|
||||
},
|
||||
//树状编辑
|
||||
editTreeDict(val,form){
|
||||
this.title=this.$t('edit')
|
||||
this.isEdit=true
|
||||
this.form={...form}
|
||||
this.newVisible=val
|
||||
@@ -356,14 +364,37 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
handleChange(){
|
||||
|
||||
},
|
||||
//树形选中行
|
||||
selectedKeys(val){
|
||||
this.selectedIds=val
|
||||
},
|
||||
//批量删除
|
||||
batDelete(){
|
||||
let params={
|
||||
|
||||
ids:this.selectedIds.join(',')
|
||||
}
|
||||
if(this.selectedIds && this.selectedIds.length>0){
|
||||
this.$confirm({
|
||||
title: this.$t('ConfirmDelete'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
deleteAction(`sys/category/deleteBatch`, params).then(res => {
|
||||
if(res.success){
|
||||
this.loadData()
|
||||
this.$message.success(res.message)
|
||||
}else{
|
||||
this.$message.warning((res.message))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
deleteAction(`sys/category/deleteBatch`,params).then(res=>{
|
||||
|
||||
})
|
||||
},
|
||||
ok(){
|
||||
this.loadData()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="new-tag-drawer">
|
||||
<onl-cgform-tag-form ref="realForm" @ok="submitCallback" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal> </onl-cgform-tag-form>
|
||||
<onl-cgform-tag-form ref="realForm" @ok="submitCallback" :isTagContent="isTagContent" :editData="editData" :editId=editId :submitEdit="submitEdit" :disabled="disableSubmit" normal v-if="drawerVisible"> </onl-cgform-tag-form>
|
||||
|
||||
<div class="drawer-footer">
|
||||
<a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">{{$t('preservation')}}</a-button>
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
:data-source="tabData"
|
||||
:pagination="false"
|
||||
:loading="loading"
|
||||
:row-selection="{selectedRowKeys: selectedRowKeys, onSelectAll: onSelectAll, onSelect: onSelect}"
|
||||
:rowClassName='setRowClassName'
|
||||
:row-selection="{selectedRowKeys: selectedRowKeys,onChange: onSelectChange, onSelectAll: onSelectAll, onSelect: onSelect, }"
|
||||
>
|
||||
<template slot="action" slot-scope="text, record">
|
||||
<a class="action-edit" href="javascript:;" @click="actionEdit(record)">编辑</a>
|
||||
@@ -34,27 +35,21 @@
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: '英文名称',
|
||||
dataIndex: 'enName',
|
||||
key: 'enName',
|
||||
width: '12%',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
dataIndex: 'description',
|
||||
width: '30%',
|
||||
key: 'description',
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
dataIndex: 'action',
|
||||
scopedSlots: {customRender: 'action'},
|
||||
align: "center",
|
||||
width: 170
|
||||
}
|
||||
],
|
||||
@@ -78,7 +73,7 @@
|
||||
let data = this.toTree(treeData)
|
||||
this.tabData=data
|
||||
this.loading=false
|
||||
console.log('treedata',data)
|
||||
// console.log('treedata',data)
|
||||
// this.dataFlag=true
|
||||
})
|
||||
},
|
||||
@@ -91,7 +86,6 @@
|
||||
// 将数据存储为 以 id 为 KEY 的 map 索引数据列
|
||||
let map = {};
|
||||
config.forEach((item) => {
|
||||
// 树 的label
|
||||
item.label = item.name;
|
||||
item.key=item.id;
|
||||
map[item.id] = item;
|
||||
@@ -132,6 +126,15 @@
|
||||
actionEdit(val){
|
||||
this.$emit('editDict',true,val)
|
||||
},
|
||||
//设置行属性
|
||||
setRowClassName(record){
|
||||
if(record.pid != 0){
|
||||
return 'rowStyle'
|
||||
}
|
||||
},
|
||||
onSelectChange(keys){
|
||||
// console.log('keys',keys,this.selectedRowKeys)
|
||||
},
|
||||
onSelectAll(selected) {
|
||||
if (selected) {
|
||||
const tabData = this.tabData;
|
||||
@@ -164,6 +167,8 @@
|
||||
setParentUncheck(key);
|
||||
}
|
||||
this.selectedRowKeys = Array.from(set);
|
||||
// console.log('keyssssss',this.selectedRowKeys)
|
||||
this.$emit('selectedKeys',this.selectedRowKeys)
|
||||
// 设置父级选择
|
||||
function setParentCheck(key) {
|
||||
let parent = getParent(key);
|
||||
@@ -219,6 +224,7 @@
|
||||
set.add(v.key);
|
||||
v.children && setChildCheck(v.children);
|
||||
});
|
||||
|
||||
}
|
||||
// 设置child取消
|
||||
function setChildUncheck(list) {
|
||||
@@ -245,4 +251,11 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style lang="less">
|
||||
.rowStyle{
|
||||
background-color:#fafafa;
|
||||
}
|
||||
</style>
|
||||
@@ -23,7 +23,7 @@
|
||||
{{$t('add')}}
|
||||
</div>
|
||||
</div>
|
||||
<a-modal class="show-content" v-model="contentVisible" :visible="contentVisible" :title="$t('add')" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="contentVisible">
|
||||
<a-modal class="show-content" v-model="contentVisible" :visible="contentVisible" :title="title" :ok-text="$t('preservation')" :cancel-text="$t('cancel')" @ok="hideModal" @cancel="cancelModel" v-if="contentVisible">
|
||||
<a-form-model
|
||||
class="tag-content"
|
||||
ref="ruleForm"
|
||||
@@ -99,6 +99,7 @@
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
title: this.$t('add'),
|
||||
total:0,
|
||||
queryParams:{
|
||||
pageNo:1,
|
||||
@@ -199,12 +200,12 @@
|
||||
this.loadData()
|
||||
},
|
||||
handleAdd(){
|
||||
this.title=this.$t('add')
|
||||
this.isEdit=1
|
||||
this.contentVisible=true
|
||||
this.form={}
|
||||
},
|
||||
hideModal(){
|
||||
|
||||
let params={
|
||||
...this.form,
|
||||
}
|
||||
@@ -272,11 +273,12 @@
|
||||
})
|
||||
},
|
||||
onSelectChange(selectedRowKeys) {
|
||||
console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
// console.log('selectedRowKeys changed: ', selectedRowKeys);
|
||||
this.selectedRowKeys = selectedRowKeys;
|
||||
},
|
||||
//编辑
|
||||
actionEdit(val){
|
||||
this.title=this.$t('edit')
|
||||
this.isEdit=0
|
||||
this.form={...val}
|
||||
this.contentVisible=true
|
||||
@@ -285,7 +287,7 @@
|
||||
handleDicPop(record){
|
||||
this.record=record
|
||||
if(record.attributeType=='1'){
|
||||
console.log('attribu',record.attributeType,record.attributeType=='1')
|
||||
// console.log('attribu',record.attributeType,record.attributeType=='1')
|
||||
// this.typeVisible[record.id]=false
|
||||
this.dictVal='list'
|
||||
this.dicVisible=true
|
||||
@@ -297,8 +299,8 @@
|
||||
}
|
||||
},
|
||||
afterDicVisibleChange(val) {
|
||||
console.log('dicVisible',this.dicVisible)
|
||||
console.log('visible', val);
|
||||
// console.log('dicVisible',this.dicVisible)
|
||||
// console.log('visible', val);
|
||||
},
|
||||
//字典列表关闭
|
||||
onDicClose() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template>
|
||||
<div class="tag-item">
|
||||
|
||||
<div class="table-page-search-wrapper">
|
||||
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
||||
<a-row :gutter="24">
|
||||
@@ -253,6 +252,7 @@
|
||||
...this.queryParam,
|
||||
isModel:1
|
||||
}
|
||||
console.log('params',params)
|
||||
if(val==1){
|
||||
params.isModel=1
|
||||
}else if(val==0){
|
||||
@@ -355,6 +355,7 @@
|
||||
// console.log('val',val)
|
||||
},
|
||||
handleAddPop(val){
|
||||
this.editData={}
|
||||
this.drawerVisible=true
|
||||
this.titleTag=this.$t('NewLabelItem')
|
||||
this.submitEdit='add'
|
||||
|
||||
Reference in New Issue
Block a user