Commit 0464b366 authored by 李苏's avatar 李苏 💬

完善树接口

parent 1702f85e
<template> <template>
<div style="display: flex;"> <div style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;"> <div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :app='app' @selected='selectedTree'></TreeBase> <TreeBase :app='app' @selected='selectedTree' :dgtype='3' ></TreeBase>
</div> </div>
<div class="min_full" style="width: calc(100% - 200px)"> <div class="min_full" style="width: calc(100% - 200px)">
<!-- 查询条件--> <!-- 查询条件-->
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
doDelete, doDelete,
doExport doExport
} from "@/api/dangerManagement/enterSafetyRecords.js" } from "@/api/dangerManagement/enterSafetyRecords.js"
import {
doQuerRoot
} from "@/api/dangerManagement/yhfl.js"
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
import { import {
...@@ -97,7 +100,9 @@ ...@@ -97,7 +100,9 @@
treeTitle: '隐患分类', treeTitle: '隐患分类',
treeDefaultProps: { treeDefaultProps: {
children: 'children', children: 'children',
label: 'bmmc' label: 'name',
fatherId:'pid',
sonId:'id'
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [
...@@ -133,7 +138,7 @@ ...@@ -133,7 +138,7 @@
}, },
methods: { methods: {
selectedTree(e){ selectedTree(e){
this.queryParams.bmid=e.id||'root' this.queryParams.pid=e.id||'root'
this.$refs['TablePager'].pageQuery() this.$refs['TablePager'].pageQuery()
}, },
tybz(a) { tybz(a) {
...@@ -150,7 +155,7 @@ ...@@ -150,7 +155,7 @@
/* 删除操作*/ /* 删除操作*/
apiDelete: doDelete, apiDelete: doDelete,
/* treeQuery */ /* treeQuery */
apiTreeQuery: doQuery, apiTreeQuery: doQuerRoot,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
......
<template> <template>
<div style="display: flex;"> <div style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;"> <div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :app='app' @selected='selectedTree'></TreeBase> <TreeBase :app='app' @selected='selectedTree' :dgtype='3'></TreeBase>
</div> </div>
<div class="min_full" style="width: calc(100% - 200px)"> <div class="min_full" style="width: calc(100% - 200px)">
<!-- 查询条件--> <!-- 查询条件-->
...@@ -55,6 +55,9 @@ ...@@ -55,6 +55,9 @@
doDelete, doDelete,
doExport doExport
} from "@/api/dangerManagement/maintenanceDg.js" } from "@/api/dangerManagement/maintenanceDg.js"
import {
doQuerRoot
} from "@/api/dangerManagement/yhbzfl.js"
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
import { import {
...@@ -80,7 +83,9 @@ ...@@ -80,7 +83,9 @@
treeTitle: '隐患检查标准分类', treeTitle: '隐患检查标准分类',
treeDefaultProps: { treeDefaultProps: {
children: 'children', children: 'children',
label: 'bmmc' label: 'name',
fatherId:'pid',
sonId:'id'
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [
...@@ -100,7 +105,7 @@ ...@@ -100,7 +105,7 @@
}, },
methods: { methods: {
selectedTree(e){ selectedTree(e){
this.queryParams.bmid=e.id||'root' this.queryParams.pid=e.id||'root'
this.$refs['TablePager'].pageQuery() this.$refs['TablePager'].pageQuery()
}, },
/* 基础查询*/ /* 基础查询*/
...@@ -112,7 +117,7 @@ ...@@ -112,7 +117,7 @@
/* 删除操作*/ /* 删除操作*/
apiDelete: doDelete, apiDelete: doDelete,
/* treeQuery */ /* treeQuery */
apiTreeQuery: doQuery, apiTreeQuery: doQuerRoot,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
......
...@@ -89,6 +89,9 @@ ...@@ -89,6 +89,9 @@
doDelete, doDelete,
doExport doExport
} from "@/api/dangerManagement/enterSafetyRecords.js" } from "@/api/dangerManagement/enterSafetyRecords.js"
import {
QueryBm,
} from "common/src/api/system/dmgSystem.js";
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
import { import {
...@@ -117,7 +120,7 @@ ...@@ -117,7 +120,7 @@
}, },
/* 树的标题 */ /* 树的标题 */
treeTitle: '隐患检查标准分类', treeTitle: '单位列表',
treeDefaultProps: { treeDefaultProps: {
children: 'children', children: 'children',
label: 'bmmc' label: 'bmmc'
...@@ -174,7 +177,7 @@ ...@@ -174,7 +177,7 @@
/* 删除操作*/ /* 删除操作*/
apiDelete: doDelete, apiDelete: doDelete,
/* treeQuery */ /* treeQuery */
apiTreeQuery: doQuery, apiTreeQuery: QueryBm,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
......
<template> <template>
<div style="display: flex;"> <div style="display: flex;">
<div class="min_full" style="width: 200px;border-right: 0px;"> <div class="min_full" style="width: 200px;border-right: 0px;">
<TreeBase :app='app' @selected='selectedTree'></TreeBase> <TreeBase :app='app' @selected='selectedTree' :dgtype='3' ></TreeBase>
</div> </div>
<div class="min_full" style="width: calc(100% - 200px)"> <div class="min_full" style="width: calc(100% - 200px)">
<!-- 查询条件--> <!-- 查询条件-->
...@@ -72,6 +72,9 @@ ...@@ -72,6 +72,9 @@
doDelete, doDelete,
doExport doExport
} from "@/api/dangerManagement/enterSafetyRecords.js" } from "@/api/dangerManagement/enterSafetyRecords.js"
import {
doQuerRoot
} from "@/api/dangerManagement/yhbzfl.js"
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
import { import {
...@@ -100,7 +103,9 @@ ...@@ -100,7 +103,9 @@
treeTitle: '隐患检查标准分类', treeTitle: '隐患检查标准分类',
treeDefaultProps: { treeDefaultProps: {
children: 'children', children: 'children',
label: 'bmmc' label: 'name',
fatherId:'pid',
sonId:'id'
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
/* 表格标题对应参数*/ /* 表格标题对应参数*/
...@@ -148,7 +153,7 @@ ...@@ -148,7 +153,7 @@
/* 删除操作*/ /* 删除操作*/
apiDelete: doDelete, apiDelete: doDelete,
/* treeQuery */ /* treeQuery */
apiTreeQuery: doQuery, apiTreeQuery: doQuerRoot,
/* 初始化赋值操作*/ /* 初始化赋值操作*/
init() { init() {
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="父ID" ref="pid" prop="pid"> <el-form-item label="上层分类" ref="pid" prop="pid">
<el-input :readonly="readonly" v-model="form.pid" ></el-input> <RelSelect :hasRool='true' style="width: 100%;" src='aqgl/yhgl/yhbzfl/query' :match="{value:'id',label:'name'}" v-model='form.pid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -30,13 +30,6 @@ ...@@ -30,13 +30,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="系统版本" ref="sysversion" prop="sysversion">
<el-input :readonly="readonly" v-model="form.sysversion" ></el-input>
</el-form-item>
</el-col>
</el-row>
</el-row> </el-row>
</el-form> </el-form>
</RelDialog> </RelDialog>
...@@ -92,14 +85,10 @@ ...@@ -92,14 +85,10 @@
}, },
/* form提交时的规则,具体规则参考官网*/ /* form提交时的规则,具体规则参考官网*/
rules: { rules: {
roleid: [{ pid: [
required: true, { required: true, trigger: 'change' }
trigger: 'blur' ]
}, ],
rolename: [{
required: true,
trigger: 'blur'
}, ]
} }
} }
}, },
...@@ -112,5 +101,3 @@ ...@@ -112,5 +101,3 @@
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
...@@ -14,14 +14,10 @@ ...@@ -14,14 +14,10 @@
</div> </div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar"> <el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton> <ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton> <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app' ></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮--> <!-- 额外按钮-->
<!-- 表头设置 --> <!-- 表头设置 -->
...@@ -29,9 +25,8 @@ ...@@ -29,9 +25,8 @@
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' type='treeTable'
@getRow='getRow'> @getRow='getRow'>
</TablePager> </TablePager>
</div> </div>
</div> </div>
...@@ -61,6 +56,13 @@ ...@@ -61,6 +56,13 @@
}, },
data() { data() {
return { return {
treeDefaultProps:{
fatherId : 'pid',
sonId : 'id',
rootId : 'root',
label : 'name',
rootName :'隐患检查标准分类'
},
/*需要的额外参数 */ /*需要的额外参数 */
showDialog: false, showDialog: false,
DialogName: '', DialogName: '',
...@@ -74,8 +76,8 @@ ...@@ -74,8 +76,8 @@
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [
{label: "序号", prop: "xh", fieldType: "int"}, // {label: "序号", prop: "xh", fieldType: "int"},
{label: "父ID", prop: "pid", fieldType: "ftString",width:192}, // {label: "父ID", prop: "pid", fieldType: "ftString",width:192},
{label: "名称", prop: "name", fieldType: "ftString",width:300}, {label: "名称", prop: "name", fieldType: "ftString",width:300},
{label: "备注", prop: "bz", fieldType: "ftString",width:300}, {label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString"}, {label: "维护人", prop: "whr", fieldType: "ftString"},
...@@ -111,4 +113,3 @@ ...@@ -111,4 +113,3 @@
<style scoped> <style scoped>
</style> </style>
...@@ -11,22 +11,22 @@ ...@@ -11,22 +11,22 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="名称" ref="name" prop="name"> <el-form-item label="上层分类" ref="pid" prop="pid">
<el-input :readonly="readonly" v-model="form.name" ></el-input> <RelSelect :hasRool='true' style="width: 100%;" src='aqgl/yhgl/yhfl/query' :match="{value:'id',label:'name'}" v-model='form.pid' ></RelSelect>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" ref="bz" prop="bz"> <el-form-item label="名称" ref="name" prop="name">
<el-input :readonly="readonly" v-model="form.bz" ></el-input> <el-input :readonly="readonly" v-model="form.name" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="系统版本" ref="sysversion" prop="sysversion"> <el-form-item label="备注" ref="bz" prop="bz">
<el-input :readonly="readonly" v-model="form.sysversion" ></el-input> <el-input :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -84,19 +84,15 @@ ...@@ -84,19 +84,15 @@
}, },
/* form提交时的规则,具体规则参考官网*/ /* form提交时的规则,具体规则参考官网*/
rules: { rules: {
roleid: [{ pid: [
required: true, { required: true, trigger: 'change' }
trigger: 'blur' ]
}, ],
rolename: [{
required: true,
trigger: 'blur'
}, ]
} }
} }
}, },
methods: { methods: {
} }
} }
</script> </script>
...@@ -104,5 +100,3 @@ ...@@ -104,5 +100,3 @@
<style scoped lang="scss"> <style scoped lang="scss">
</style> </style>
...@@ -14,14 +14,10 @@ ...@@ -14,14 +14,10 @@
</div> </div>
<!-- 按钮操作--> <!-- 按钮操作-->
<el-row class="tool-bar"> <el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton> <ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton> <AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app' ></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮--> <!-- 额外按钮-->
<!-- 表头设置 --> <!-- 表头设置 -->
...@@ -29,7 +25,7 @@ ...@@ -29,7 +25,7 @@
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' type='treeTable'
@getRow='getRow'> @getRow='getRow'>
</TablePager> </TablePager>
...@@ -61,6 +57,13 @@ ...@@ -61,6 +57,13 @@
}, },
data() { data() {
return { return {
treeDefaultProps:{
fatherId : 'pid',
sonId : 'id',
rootId : 'root',
label : 'name',
rootName :'隐患检查标准分类'
},
/*需要的额外参数 */ /*需要的额外参数 */
showDialog: false, showDialog: false,
DialogName: '', DialogName: '',
...@@ -74,7 +77,7 @@ ...@@ -74,7 +77,7 @@
}, },
/* 表格标题对应参数*/ /* 表格标题对应参数*/
tableTitle: [ tableTitle: [
{label: "序号", prop: "xh", fieldType: "int"}, // {label: "序号", prop: "xh", fieldType: "int"},
{label: "名称", prop: "name", fieldType: "ftString",width:300}, {label: "名称", prop: "name", fieldType: "ftString",width:300},
{label: "备注", prop: "bz", fieldType: "ftString",width:300}, {label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString"}, {label: "维护人", prop: "whr", fieldType: "ftString"},
...@@ -110,4 +113,3 @@ ...@@ -110,4 +113,3 @@
<style scoped> <style scoped>
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment