master
parent
a53557fec5
commit
62081d00ff
@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-input v-model="select.name" placeholder="请输入目录名称"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="editCatalog('add')">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :isPage="false" rowKey="id"
|
||||
:table-item="table_item">
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' label="操作" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small" @click="editCatalog('child',scope.row.id,scope.row.name)">子目录</el-button>
|
||||
<el-button type="primary" size="small" @click="editCatalog('editor',scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-catalog ref="addCatalog" @refresh="getList"></add-catalog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addCatalog from './components/addCatalog.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addCatalog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'catalogs',
|
||||
page: 1,
|
||||
page_size: 999,
|
||||
|
||||
},
|
||||
list: [],
|
||||
table_item: [{
|
||||
prop: 'name',
|
||||
label: '目录名称',
|
||||
align: 'left',
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
editCatalog(type, id,pName) {
|
||||
if (type == 'editor') {
|
||||
this.$refs.addCatalog.id = id
|
||||
}
|
||||
if(type=='child'){
|
||||
this.$refs.addCatalog.setPid(id,pName)
|
||||
}
|
||||
this.$refs.addCatalog.type = type
|
||||
this.$refs.addCatalog.isShow = true
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
sort_type:'ASC',
|
||||
sort_name:'sort',
|
||||
table_name: this.select.table_name,
|
||||
filter: [{
|
||||
"key": "name",
|
||||
"op": "like",
|
||||
"value": this.select.name
|
||||
}],
|
||||
})
|
||||
if(res.data.length>0){
|
||||
this.list = this.base.buildTree(res.data)
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-input v-model="select.name" placeholder="请输入名称"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="editIndex('add')">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' label="操作" width="240" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <el-button type="primary" size="small" @click="editIndex('child',scope.row.id,scope.row.name)">子目录</el-button> -->
|
||||
<el-button type="primary" size="small" @click="editIndex('editor',scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-index ref="addIndex" @refresh="getList"></add-index>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addIndex from './components/addIndex.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addIndex
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'organizes',
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
},
|
||||
total:0,
|
||||
list: [],
|
||||
table_item: [{
|
||||
type:'index',
|
||||
width:50
|
||||
},{
|
||||
prop: 'name',
|
||||
label: '组织名称',
|
||||
align: 'left',
|
||||
},{
|
||||
prop: 'originize_type_name',
|
||||
label: '组织类型',
|
||||
align: 'left',
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
editIndex(type, id,pName) {
|
||||
if (type == 'editor') {
|
||||
this.$refs.addIndex.id = id
|
||||
}
|
||||
this.$refs.addIndex.type = type
|
||||
this.$refs.addIndex.isShow = true
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
table_name: this.select.table_name,
|
||||
filter: [{
|
||||
"key": "name",
|
||||
"op": "like",
|
||||
"value": this.select.name
|
||||
}],
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div ref="lxHeader">
|
||||
<lx-header icon="md-apps" :text="$route.meta.title" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
||||
<div slot="content">
|
||||
<div class="searchwrap" style="display: flex;align-items: center;">
|
||||
<div>
|
||||
<el-input v-model="select.name" placeholder="请输入名称"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="select.page=1,getList()">查询</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" size="small" @click="editType('add')">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</lx-header>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<xy-table :list="list" :total="total" @pageIndexChange="pageIndexChange" @pageSizeChange="pageSizeChange"
|
||||
:table-item="table_item">
|
||||
<template v-slot:btns>
|
||||
<el-table-column align='center' label="操作" width="280" header-align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" size="small" @click="editCatalog(scope.row.id)">目录授权</el-button>
|
||||
<el-button type="primary" size="small" @click="editType('editor',scope.row.id)">编辑</el-button>
|
||||
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
|
||||
<el-button type="danger" size="small" slot="reference">删除</el-button>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
</xy-table>
|
||||
</div>
|
||||
|
||||
<add-type ref="addType" @refresh="getList"></add-type>
|
||||
<bind-catalog ref="bindCatalog" @refresh="getList"></bind-catalog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import addType from './components/addType.vue';
|
||||
import bindCatalog from './components/bindCatalog.vue';
|
||||
import {
|
||||
index,
|
||||
destroy
|
||||
} from "@/api/system/baseForm.js"
|
||||
export default {
|
||||
components: {
|
||||
addType,
|
||||
bindCatalog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
select: {
|
||||
name: '',
|
||||
table_name: 'organize_types',
|
||||
page: 1,
|
||||
page_size: 10,
|
||||
},
|
||||
total: 0,
|
||||
list: [],
|
||||
table_item: [{
|
||||
type: 'index',
|
||||
width: 50
|
||||
}, {
|
||||
prop: 'name',
|
||||
label: '组织类型名称',
|
||||
align: 'left',
|
||||
width: 240
|
||||
}, {
|
||||
prop: 'description',
|
||||
label: '描述',
|
||||
align: 'left'
|
||||
}]
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
editType(type, id, pName) {
|
||||
if (type == 'editor') {
|
||||
this.$refs.addType.id = id
|
||||
}
|
||||
this.$refs.addType.type = type
|
||||
this.$refs.addType.isShow = true
|
||||
},
|
||||
editCatalog(id) {
|
||||
this.$refs.bindCatalog.id = id
|
||||
this.$refs.bindCatalog.isShow = true
|
||||
},
|
||||
pageIndexChange(e) {
|
||||
this.select.page = e
|
||||
this.getList()
|
||||
},
|
||||
pageSizeChange(e) {
|
||||
this.select.page_size = e
|
||||
this.select.page = 1
|
||||
this.getList()
|
||||
},
|
||||
async getList() {
|
||||
const res = await index({
|
||||
page_size: this.select.page_size,
|
||||
page: this.select.page,
|
||||
table_name: this.select.table_name,
|
||||
filter: [{
|
||||
"key": "name",
|
||||
"op": "like",
|
||||
"value": this.select.name
|
||||
}],
|
||||
})
|
||||
this.list = res.data
|
||||
this.total = res.total
|
||||
},
|
||||
deleteList(id) {
|
||||
var that = this;
|
||||
destroy({
|
||||
id: id,
|
||||
table_name: this.select.table_name
|
||||
}).then(response => {
|
||||
this.$Message.success('操作成功');
|
||||
this.getList()
|
||||
}).catch(error => {
|
||||
console.log(error)
|
||||
reject(error)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.searchwrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
&>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 10px;
|
||||
|
||||
span {
|
||||
min-width: 70px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue