|
|
@ -1,145 +1,199 @@
|
|
|
|
<#-- since 2017-01-01-->
|
|
|
|
<#-- since 2017-01-01-->
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<div id="app" v-cloak>
|
|
|
|
<el-card class="box-card">
|
|
|
|
<el-card class="box-card">
|
|
|
|
<el-form class="search" :inline="true" :model="vm" ref="vm" label-position="right" label-width="90px">
|
|
|
|
<el-tabs :value="'list'">
|
|
|
|
<el-form-item label="部门代码" prop="deptCode">
|
|
|
|
<el-tab-pane label="列表展示" name="list">
|
|
|
|
<el-input v-model="vm.deptCode" clearable size="small" placeholder="请输入部门代码"></el-input>
|
|
|
|
<span slot="label"><i class="el-icon-s-operation"></i>列表展示</span>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
|
|
|
|
|
|
<el-input v-model="vm.deptName" clearable size="small" placeholder="请输入部门名称"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="部门别名" prop="deptAlias">
|
|
|
|
|
|
|
|
<el-input v-model="vm.deptAlias" clearable size="small" placeholder="请输入部门别名"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="父部门代码" prop="supCode">
|
|
|
|
|
|
|
|
<el-input v-model="vm.supCode" clearable size="small" placeholder="请输入父部门代码"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="父部门名称" prop="supName">
|
|
|
|
|
|
|
|
<el-input v-model="vm.supName" clearable size="small" placeholder="请输入父部门名称"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="是否有效" prop="valid">
|
|
|
|
|
|
|
|
<el-radio-group v-model="vm.valid" clearable size="small">
|
|
|
|
|
|
|
|
<el-radio :label="true">是</el-radio>
|
|
|
|
|
|
|
|
<el-radio :label="false">否</el-radio>
|
|
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" icon="el-icon-search" @click="onSearch">搜索</el-button>
|
|
|
|
|
|
|
|
<el-button type="warning" size="small" icon="el-icon-refresh-left" @click="onReset('vm')">重置</el-button>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-card class="box-card">
|
|
|
|
<el-form class="search" :inline="true" :model="vm" ref="vm" label-position="right" label-width="90px">
|
|
|
|
<el-row>
|
|
|
|
<el-form-item label="部门代码" prop="deptCode">
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-input v-model="vm.deptCode" clearable size="small" placeholder="请输入部门代码"></el-input>
|
|
|
|
<el-button type="success" size="small" icon="el-icon-plus" @click="onCreate">新增</el-button>
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="部门名称" prop="deptName">
|
|
|
|
|
|
|
|
<el-input v-model="vm.deptName" clearable size="small" placeholder="请输入部门名称"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="部门别名" prop="deptAlias">
|
|
|
|
|
|
|
|
<el-input v-model="vm.deptAlias" clearable size="small" placeholder="请输入部门别名"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="上级代码" prop="supCode">
|
|
|
|
|
|
|
|
<el-input v-model="vm.supCode" clearable size="small" placeholder="请输入上级代码"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="上级名称" prop="supName">
|
|
|
|
|
|
|
|
<el-input v-model="vm.supName" clearable size="small" placeholder="请输入上级名称"></el-input>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item label="是否有效" prop="valid">
|
|
|
|
|
|
|
|
<el-radio-group v-model="vm.valid" clearable size="small">
|
|
|
|
|
|
|
|
<el-radio :label="true">是</el-radio>
|
|
|
|
|
|
|
|
<el-radio :label="false">否</el-radio>
|
|
|
|
|
|
|
|
</el-radio-group>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
|
|
|
|
<el-button type="primary" size="small" icon="el-icon-search" @click="onSearch">搜索</el-button>
|
|
|
|
|
|
|
|
<el-button type="warning" size="small" icon="el-icon-refresh-left" @click="onReset('vm')">重置</el-button>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-divider><i class="el-icon-search"></i></el-divider>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-button type="success" size="small" icon="el-icon-plus" @click="onCreate">新增</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
|
|
|
|
<el-button-group style="float: right;">
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom">
|
|
|
|
|
|
|
|
<el-button size="small" icon="el-icon-date" @click="onTemplate"></el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="Excel导入" placement="bottom">
|
|
|
|
|
|
|
|
<el-button size="small" icon="el-icon-upload2" @click="onImport"></el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="warning" size="small" icon="el-icon-download" @click="onExport">导出</el-button>
|
|
|
|
<el-tooltip effect="dark" content="批量删除" placement="bottom">
|
|
|
|
</el-col>
|
|
|
|
<el-button size="small" icon="el-icon-delete" @click="onBitchDelete"></el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="12">
|
|
|
|
<el-tooltip effect="dark" content="刷新" placement="bottom">
|
|
|
|
<el-button-group style="float: right;">
|
|
|
|
<el-button size="small" icon="el-icon-refresh" @click="onFind"></el-button>
|
|
|
|
<el-tooltip effect="dark" content="Excel模板下载" placement="bottom">
|
|
|
|
</el-tooltip>
|
|
|
|
<el-button size="small" icon="el-icon-date" @click="onTemplate"></el-button>
|
|
|
|
</el-button-group>
|
|
|
|
</el-tooltip>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="Excel导入" placement="bottom">
|
|
|
|
<el-table
|
|
|
|
<el-button size="small" icon="el-icon-upload2" @click="onImport"></el-button>
|
|
|
|
class="data"
|
|
|
|
</el-tooltip>
|
|
|
|
@selection-change="onSelectionChange"
|
|
|
|
|
|
|
|
empty-text="无数据"
|
|
|
|
|
|
|
|
:data="result"
|
|
|
|
|
|
|
|
size="mini">
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
type="selection"
|
|
|
|
|
|
|
|
width="40">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="id"
|
|
|
|
|
|
|
|
label="主键"
|
|
|
|
|
|
|
|
width="140">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptCode"
|
|
|
|
|
|
|
|
label="部门代码">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptName"
|
|
|
|
|
|
|
|
label="部门名称">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptAlias"
|
|
|
|
|
|
|
|
label="部门别名">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="supCode"
|
|
|
|
|
|
|
|
label="上级代码">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="supName"
|
|
|
|
|
|
|
|
label="上级名称">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="valid"
|
|
|
|
|
|
|
|
label="是否有效">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="createTime"
|
|
|
|
|
|
|
|
width="140"
|
|
|
|
|
|
|
|
label="创建时间">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
fixed="right"
|
|
|
|
|
|
|
|
width="120"
|
|
|
|
|
|
|
|
label="操作">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
<el-dropdown size="mini" split-button type="primary" @click="onCommand(['edit',scope.row])"
|
|
|
|
|
|
|
|
@command="onCommand">
|
|
|
|
|
|
|
|
<i class="el-icon-edit"></i>编辑
|
|
|
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
|
|
|
<el-dropdown-item :command="['delete',scope.row]" icon="el-icon-delete">删除
|
|
|
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="批量删除" placement="bottom">
|
|
|
|
<el-pagination
|
|
|
|
<el-button size="small" icon="el-icon-delete" @click="onBitchDelete"></el-button>
|
|
|
|
background
|
|
|
|
</el-tooltip>
|
|
|
|
v-if="vm.totalCount > vm.pageSize"
|
|
|
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
|
|
|
@current-change="onPage"
|
|
|
|
|
|
|
|
:current-page="vm.pageNumber"
|
|
|
|
|
|
|
|
:page-size="vm.pageSize"
|
|
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
|
|
|
:total="vm.totalCount">
|
|
|
|
|
|
|
|
</el-pagination>
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
<el-tab-pane label="树状展示" name="tree">
|
|
|
|
|
|
|
|
<span slot="label"><i class="el-icon-share"></i>树状展示</span>
|
|
|
|
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="刷新" placement="bottom">
|
|
|
|
<el-row>
|
|
|
|
<el-button size="small" icon="el-icon-refresh" @click="onFind"></el-button>
|
|
|
|
<el-col :span="12">
|
|
|
|
</el-tooltip>
|
|
|
|
<el-input v-model="treeKeyword" clearable size="mini" placeholder="请输入资源内容" @change="onChange" style="width: 200px;" ></el-input>
|
|
|
|
</el-button-group>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="12">
|
|
|
|
</el-row>
|
|
|
|
<el-button-group style="float: right;">
|
|
|
|
|
|
|
|
<el-tooltip effect="dark" content="批量删除" placement="bottom">
|
|
|
|
|
|
|
|
<el-button size="small" icon="el-icon-delete" @click="onBitchDelete"></el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
<el-tooltip effect="dark" content="刷新" placement="bottom">
|
|
|
|
class="data"
|
|
|
|
<el-button size="small" icon="el-icon-refresh" @click="onLoadTree"></el-button>
|
|
|
|
@selection-change="onSelectionChange"
|
|
|
|
</el-tooltip>
|
|
|
|
empty-text="无数据"
|
|
|
|
</el-button-group>
|
|
|
|
:data="result"
|
|
|
|
</el-col>
|
|
|
|
size="mini">
|
|
|
|
</el-row>
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
type="selection"
|
|
|
|
|
|
|
|
width="40">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="id"
|
|
|
|
|
|
|
|
label="主键"
|
|
|
|
|
|
|
|
width="140">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptCode"
|
|
|
|
|
|
|
|
label="部门代码">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptName"
|
|
|
|
|
|
|
|
label="部门名称">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="deptAlias"
|
|
|
|
|
|
|
|
label="部门别名">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="supCode"
|
|
|
|
|
|
|
|
label="父部门代码">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="supName"
|
|
|
|
|
|
|
|
label="父部门名称">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="valid"
|
|
|
|
|
|
|
|
label="是否有效">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
prop="createTime"
|
|
|
|
|
|
|
|
width="140"
|
|
|
|
|
|
|
|
label="创建时间">
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
<el-table-column
|
|
|
|
|
|
|
|
align="center"
|
|
|
|
|
|
|
|
fixed="right"
|
|
|
|
|
|
|
|
width="120"
|
|
|
|
|
|
|
|
label="操作">
|
|
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
|
|
<el-dropdown size="mini" split-button type="primary" @click="onCommand(['edit',scope.row])"
|
|
|
|
|
|
|
|
@command="onCommand">
|
|
|
|
|
|
|
|
<i class="el-icon-edit"></i>编辑
|
|
|
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
|
|
|
<el-dropdown-item :command="['delete',scope.row]" icon="el-icon-delete">删除
|
|
|
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-pagination
|
|
|
|
<el-tree
|
|
|
|
background
|
|
|
|
style="margin-top: 10px"
|
|
|
|
v-if="vm.totalCount > vm.pageSize"
|
|
|
|
:data="treeData"
|
|
|
|
style="margin-top: 10px"
|
|
|
|
show-checkbox
|
|
|
|
@current-change="onPage"
|
|
|
|
node-key="id"
|
|
|
|
:current-page="vm.pageNumber"
|
|
|
|
ref="tree"
|
|
|
|
:page-size="vm.pageSize"
|
|
|
|
default-expand-all
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
:filter-node-method="filterTree"
|
|
|
|
:total="vm.totalCount">
|
|
|
|
:expand-on-click-node="false">
|
|
|
|
</el-pagination>
|
|
|
|
<div class="tree" slot-scope="{ node, data }">
|
|
|
|
|
|
|
|
<span>{{ data.comment }}<span style="color: #409EFF">[{{data.code}}]</span></span>
|
|
|
|
|
|
|
|
<span>
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
|
|
@click="onTreeCreate(data)">
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
<el-button
|
|
|
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
size="mini"
|
|
|
|
|
|
|
|
@click="onTreeEdit(data)">
|
|
|
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</el-tree>
|
|
|
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
</el-tabs>
|
|
|
|
</el-card>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
|
|
|
|
<el-dialog class="form-dialog" :title="form.title" :visible.sync="form.dialog">
|
|
|
@ -154,11 +208,11 @@
|
|
|
|
<el-form-item label="部门别名" prop="deptAlias">
|
|
|
|
<el-form-item label="部门别名" prop="deptAlias">
|
|
|
|
<el-input v-model="form.deptAlias" clearable size="small" placeholder="请输入部门别名"></el-input>
|
|
|
|
<el-input v-model="form.deptAlias" clearable size="small" placeholder="请输入部门别名"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="父部门代码" prop="supCode">
|
|
|
|
<el-form-item label="上级代码" prop="supCode">
|
|
|
|
<el-input v-model="form.supCode" clearable size="small" placeholder="请输入父部门代码"></el-input>
|
|
|
|
<el-input v-model="form.supCode" clearable size="small" placeholder="请输入上级代码"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="父部门名称" prop="supName">
|
|
|
|
<el-form-item label="上级名称" prop="supName">
|
|
|
|
<el-input v-model="form.supName" clearable size="small" placeholder="请输入父部门名称"></el-input>
|
|
|
|
<el-input v-model="form.supName" clearable size="small" placeholder="请输入上级名称"></el-input>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
<el-form-item label="是否有效" prop="valid">
|
|
|
|
<el-form-item label="是否有效" prop="valid">
|
|
|
|
<el-radio-group v-model="form.valid" clearable size="small">
|
|
|
|
<el-radio-group v-model="form.valid" clearable size="small">
|
|
|
@ -218,10 +272,10 @@
|
|
|
|
{min: 1, max: 50, message: '部门别名长度在 1 到 50 个字符', trigger: 'blur'}
|
|
|
|
{min: 1, max: 50, message: '部门别名长度在 1 到 50 个字符', trigger: 'blur'}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
supCode: [
|
|
|
|
supCode: [
|
|
|
|
{min: 1, max: 50, message: '父部门代码长度在 1 到 50 个字符', trigger: 'blur'}
|
|
|
|
{min: 1, max: 50, message: '上级代码长度在 1 到 50 个字符', trigger: 'blur'}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
supName: [
|
|
|
|
supName: [
|
|
|
|
{min: 1, max: 100, message: '父部门名称长度在 1 到 100 个字符', trigger: 'blur'}
|
|
|
|
{min: 1, max: 100, message: '上级名称长度在 1 到 100 个字符', trigger: 'blur'}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
valid: [
|
|
|
|
valid: [
|
|
|
|
{required: true, message: '是否有效不能为空', trigger: 'blur'},
|
|
|
|
{required: true, message: '是否有效不能为空', trigger: 'blur'},
|
|
|
|