系统管理页面样式

This commit is contained in:
zhaoxiao
2021-09-18 13:36:08 +08:00
parent ed25e34172
commit 87d7023dc1
12 changed files with 1647 additions and 1548 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

+176 -167
View File
@@ -1,195 +1,204 @@
<template> <template>
<a-card :bordered="false"> <div>
<!-- 查询区域 --> <page-header-title :img-for-icon="IconImg"></page-header-title>
<div class="table-page-search-wrapper"> <a-card :bordered="false">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <!-- 查询区域 -->
<a-row :gutter="24"> <div class="table-page-search-wrapper">
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-form-item label="表名"> <a-row :gutter="24">
<a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input> <a-col :xl="6" :lg="7" :md="8" :sm="24">
</a-form-item> <a-form-item label="表名">
</a-col> <a-input placeholder="请输入表名" v-model="queryParam.tableName"></a-input>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> </a-form-item>
<a-form-item label="字段名"> </a-col>
<a-input placeholder="请输入字段名" v-model="queryParam.fieldName"></a-input> <a-col :xl="6" :lg="7" :md="8" :sm="24">
</a-form-item> <a-form-item label="字段名">
</a-col> <a-input placeholder="请输入字段名" v-model="queryParam.fieldName"></a-input>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> </a-form-item>
<a-form-item label="混淆码"> </a-col>
<a-input placeholder="请输入混淆码" v-model="queryParam.confusionCode"></a-input> <a-col :xl="6" :lg="7" :md="8" :sm="24">
</a-form-item> <a-form-item label="混淆码">
</a-col> <a-input placeholder="请输入混淆码" v-model="queryParam.confusionCode"></a-input>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> </a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('混淆表')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('混淆表')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
<a-button type="primary" icon="import">导入</a-button> @change="handleImportExcel">
</a-upload> <a-button type="primary" icon="import">导入</a-button>
<!-- 高级查询区域 --> </a-upload>
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> <!-- 高级查询区域 -->
<!-- <a-menu slot="overlay">--> <!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>--> <!-- <a-menu slot="overlay">-->
<!-- </a-menu>--> <!-- <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>-->
<!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>--> <!-- </a-menu>-->
<!-- </a-dropdown>--> <!-- <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>-->
</div> <!-- </a-dropdown>-->
</div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>--> <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>-->
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
<!-- </div>--> <!-- </div>-->
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<template slot="htmlSlot" slot-scope="text"> <template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div> <div v-html="text"></div>
</template> </template>
<template slot="imgSlot" slot-scope="text"> <template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span> <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> <img v-else :src="getImgView(text)" height="25px" alt=""
</template> style="max-width:80px;font-size: 12px;font-style: italic;"/>
<template slot="fileSlot" slot-scope="text"> </template>
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span> <template slot="fileSlot" slot-scope="text">
<a-button <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
v-else <a-button
:ghost="true" v-else
type="primary" :ghost="true"
icon="download" type="primary"
size="small" icon="download"
@click="downloadFile(text)"> size="small"
下载 @click="downloadFile(text)">
</a-button> 下载
</template> </a-button>
<template slot="text" slot-scope="text"> </template>
<j-ellipsis v-if="text" :value="text" :length="20"></j-ellipsis> <template slot="text" slot-scope="text">
<span v-else></span> <j-ellipsis v-if="text" :value="text" :length="20"></j-ellipsis>
</template> <span v-else></span>
<span slot="action" slot-scope="text, record" class="action-span-cell"> </template>
<span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a @click="handleDelete(record.id)">删除</a> <a @click="handleDelete(record.id)">删除</a>
</span> </span>
</a-table> </a-table>
</div> </div>
<sys-confusion-modal ref="modalForm" @ok="modalFormOk"></sys-confusion-modal> <sys-confusion-modal ref="modalForm" @ok="modalFormOk"></sys-confusion-modal>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin' import { mixinDevice } from '@/utils/mixin'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import SysConfusionModal from './modules/SysConfusionModal' import SysConfusionModal from './modules/SysConfusionModal'
import JEllipsis from '@comp/jero/JEllipsis' import JEllipsis from '@comp/jero/JEllipsis'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'SysConfusionList', name: 'SysConfusionList',
mixins:[JeroListMixin, mixinDevice], mixins: [JeroListMixin, mixinDevice],
components: { components: {
SysConfusionModal, SysConfusionModal,
JEllipsis JEllipsis,
}, PageHeaderTitle
data () { },
return { data() {
description: '混淆表管理页面', return {
// 表头 IconImg,
columns: [ description: '混淆表管理页面',
{ // 表头
title: '序号', columns: [
dataIndex: '', {
key:'rowIndex', title: '序号',
width:60, dataIndex: '',
align:'center', key: 'rowIndex',
customRender:function (t,r,index) { width: 60,
return parseInt(index)+1 align: 'center',
} customRender: function (t, r, index) {
}, return parseInt(index) + 1
{
title:'表名',
align:'center',
dataIndex: 'tableName',
scopedSlots: { customRender: 'text' }
},
{
title:'字段名',
align:'center',
dataIndex: 'fieldName',
scopedSlots: { customRender: 'text' }
},
{
title:'混淆码',
align:'center',
dataIndex: 'confusionCode',
scopedSlots: { customRender: 'text' }
},
{
title: '操作',
dataIndex: 'action',
align:'center',
fixed:'right',
width:147,
scopedSlots: { customRender: 'action' }
} }
],
url: {
list: '/sys/confusion/page',
delete: '/sys/confusion/delete',
deleteBatch: '/sys/confusion/deleteBatch',
exportXlsUrl: '/sys/confusion/exportXls',
importExcelUrl: '/sys/confusion/importExcel',
}, },
dictOptions:{}, {
superFieldList:[], title: '表名',
} align: 'center',
}, dataIndex: 'tableName',
created() { scopedSlots: { customRender: 'text' }
},
{
title: '字段名',
align: 'center',
dataIndex: 'fieldName',
scopedSlots: { customRender: 'text' }
},
{
title: '混淆码',
align: 'center',
dataIndex: 'confusionCode',
scopedSlots: { customRender: 'text' }
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
fixed: 'right',
width: 147,
scopedSlots: { customRender: 'action' }
}
],
url: {
list: '/sys/confusion/page',
delete: '/sys/confusion/delete',
deleteBatch: '/sys/confusion/deleteBatch',
exportXlsUrl: '/sys/confusion/exportXls',
importExcelUrl: '/sys/confusion/importExcel'
},
dictOptions: {},
superFieldList: []
}
},
created() {
this.getSuperFieldList() this.getSuperFieldList()
},
computed: {
importExcelUrl: function () {
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
}
},
methods: {
initDictConfig() {
}, },
computed: { getSuperFieldList() {
importExcelUrl: function(){ let fieldList = []
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` fieldList.push({ type: 'string', value: 'confusionType', text: '混淆类型', dictCode: '' })
}, fieldList.push({ type: 'string', value: 'confusionName', text: '表名或字段名', dictCode: '' })
}, this.superFieldList = fieldList
methods: {
initDictConfig(){
},
getSuperFieldList(){
let fieldList=[]
fieldList.push({type:'string',value:'confusionType',text:'混淆类型',dictCode:''})
fieldList.push({type:'string',value:'confusionName',text:'表名或字段名',dictCode:''})
this.superFieldList = fieldList
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>
+199 -182
View File
@@ -1,179 +1,194 @@
<template xmlns:background-color="http://www.w3.org/1999/xhtml"> <template xmlns:background-color="http://www.w3.org/1999/xhtml">
<a-row :gutter="10"> <div>
<a-col :md="10" :sm="24" > <page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false" style="padding: 12px 0;"> <a-row :gutter="10">
<!-- 按钮操作区域 --> <a-col :md="10" :sm="24">
<a-row style="margin-left: 14px" class="table-operator"> <a-card :bordered="false" style="padding: 12px 0;">
<a-button @click="handleAdd(1)" type="primary">新增</a-button> <!-- 按钮操作区域 -->
<a-button @click="handleAdd(2)" type="primary">添加下级</a-button> <a-row style="margin-left: 14px" class="table-operator">
<a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button> <a-button @click="handleAdd(1)" type="primary">新增</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-button @click="handleAdd(2)" type="primary">添加下级</a-button>
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="download" @click="handleExportXls('部门信息')">导出</a-button>
</a-upload> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button> :action="importExcelUrl" @change="handleImportExcel">
<!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>--> <a-button type="primary" icon="import">导入</a-button>
</a-row> </a-upload>
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
<a-alert type="info" :showIcon="true"> <!--<a-button @click="refresh" type="default" icon="reload" :loading="loading">刷新</a-button>-->
<div slot="message"> </a-row>
当前选择<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> <div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a> <a-alert type="info" :showIcon="true">
</div> <div slot="message">
</a-alert> 当前选择<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span>
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/> <a v-if="this.currSelected.title" style="margin-left: 10px" @click="onClearSelected">取消选择</a>
<!-- --> </div>
<a-col :md="10" :sm="24"> </a-alert>
<template> <a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus"> <!-- -->
<a-col :md="10" :sm="24">
<template>
<a-dropdown :trigger="[this.dropTrigger]" @visibleChange="dropStatus">
<span style="user-select: none"> <span style="user-select: none">
<a-tree <a-tree
checkable checkable
multiple multiple
@select="onSelect" @select="onSelect"
@check="onCheck" @check="onCheck"
@rightClick="rightHandle" @rightClick="rightHandle"
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkedKeys="checkedKeys" :checkedKeys="checkedKeys"
:treeData="departTree" :treeData="departTree"
:checkStrictly="checkStrictly" :checkStrictly="checkStrictly"
:expandedKeys="iExpandedKeys" :expandedKeys="iExpandedKeys"
:autoExpandParent="autoExpandParent" :autoExpandParent="autoExpandParent"
@expand="onExpand"/> @expand="onExpand"/>
</span> </span>
<!--新增右键点击事件,和增加添加和删除功能--> <!--新增右键点击事件,和增加添加和删除功能-->
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item @click="handleAdd(3)" key="1">添加</a-menu-item> <a-menu-item @click="handleAdd(3)" key="1">添加</a-menu-item>
<a-menu-item @click="handleDelete" key="2">删除</a-menu-item> <a-menu-item @click="handleDelete" key="2">删除</a-menu-item>
<a-menu-item @click="closeDrop" key="3">取消</a-menu-item> <a-menu-item @click="closeDrop" key="3">取消</a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</template> </template>
</a-col> </a-col>
</div>
</a-card>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<div class="drawer-bootom-button">
<a-dropdown :trigger="['click']" placement="topCenter">
<a-menu slot="overlay">
<!--<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>-->
<!--<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>-->
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item>
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作
<a-icon type="up"/>
</a-button>
</a-dropdown>
</div> </div>
</a-card> <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> </a-col>
<div class="drawer-bootom-button"> <a-col :md="14" :sm="24" style="background: #fff;padding: 24px;">
<a-dropdown :trigger="['click']" placement="topCenter"> <a-tabs defaultActiveKey="1" @change="callback">
<a-menu slot="overlay"> <a-tab-pane tab="基本信息" key="1">
<!--<a-menu-item key="1" @click="switchCheckStrictly(1)">父子关联</a-menu-item>--> <a-card :bordered="false" v-if="selectedKeys.length>0">
<!--<a-menu-item key="2" @click="switchCheckStrictly(2)">取消关联</a-menu-item>--> <a-form :form="form">
<a-menu-item key="3" @click="checkALL">全部勾选</a-menu-item> <a-form-item
<a-menu-item key="4" @click="cancelCheckALL">取消全选</a-menu-item>
<a-menu-item key="5" @click="expandAll">展开所有</a-menu-item>
<a-menu-item key="6" @click="closeAll">合并所有</a-menu-item>
</a-menu>
<a-button>
树操作 <a-icon type="up" />
</a-button>
</a-dropdown>
</div>
<!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
</a-col>
<a-col :md="14" :sm="24" style="background: #fff;padding: 24px;">
<a-tabs defaultActiveKey="1" @change="callback">
<a-tab-pane tab="基本信息" key="1" >
<a-card :bordered="false" v-if="selectedKeys.length>0">
<a-form :form="form">
<a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构名称"> label="机构名称">
<a-input placeholder="请输入机构/部门名称" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="['departName', validatorRules.departName ]"/> <a-input placeholder="请输入机构/部门名称" @change="event => event.target.value = event.target.value.trim()"
</a-form-item> :maxLength="50" v-decorator="['departName', validatorRules.departName ]"/>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门"> </a-form-item>
<a-tree-select <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上级部门">
<a-tree-select
style="width:100%" style="width:100%"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="treeData" :treeData="treeData"
:disabled="disable" :disabled="disable"
v-model="model.parentId" v-model="model.parentId"
placeholder="无"> placeholder="无">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构编码"> label="机构编码">
<a-input disabled placeholder="请输入机构编码" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="['orgCode', validatorRules.orgCode ]"/> <a-input disabled placeholder="请输入机构编码"
</a-form-item> @change="event => event.target.value = event.target.value.trim()" :maxLength="50"
<a-form-item v-decorator="['orgCode', validatorRules.orgCode ]"/>
</a-form-item>
<a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="机构类型"> label="机构类型">
<template v-if="orgCategoryDisabled"> <template v-if="orgCategoryDisabled">
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="1"> <a-radio value="1">
公司 公司
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</template> </template>
<template v-else> <template v-else>
<a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型"> <a-radio-group v-decorator="['orgCategory',validatorRules.orgCategory]" placeholder="请选择机构类型">
<a-radio value="2"> <a-radio value="2">
部门 部门
</a-radio> </a-radio>
<a-radio value="3"> <a-radio value="3">
岗位 岗位
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
</template> </template>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="排序"> label="排序">
<a-input-number :min="1" :max="99999" v-decorator="[ 'departOrder',{'initialValue':0}]"/> <a-input-number :min="1" :max="99999" v-decorator="[ 'departOrder',{'initialValue':0}]"/>
</a-form-item> </a-form-item>
<a-form-item <a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="手机号"> label="手机号">
<a-input placeholder="请输入手机号" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="['mobile', validatorRules.mobile]"/> <a-input placeholder="请输入手机号" @change="event => event.target.value = event.target.value.trim()"
</a-form-item> :maxLength="50" v-decorator="['mobile', validatorRules.mobile]"/>
<a-form-item </a-form-item>
<a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="地址"> label="地址">
<a-input placeholder="请输入地址" @change="event => event.target.value = event.target.value.trim()" :maxLength="50" v-decorator="['address', {'initialValue':''}]"/> <a-input placeholder="请输入地址" @change="event => event.target.value = event.target.value.trim()"
</a-form-item> :maxLength="50" v-decorator="['address', {'initialValue':''}]"/>
<a-form-item </a-form-item>
<a-form-item
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
label="备注"> label="备注">
<a-textarea placeholder="请输入备注" @change="event => event.target.value = event.target.value.trim()" :maxLength="200" v-decorator="['memo', {'initialValue':''}]"/> <a-textarea placeholder="请输入备注" @change="event => event.target.value = event.target.value.trim()"
</a-form-item> :maxLength="200" v-decorator="['memo', {'initialValue':''}]"/>
</a-form> </a-form-item>
<div class="anty-form-btn"> </a-form>
<a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button> <div class="anty-form-btn">
<a-button @click="submitCurrForm" :disabled="disabledStatus" type="primary" htmlType="button" icon="form">保存</a-button> <a-button @click="emptyCurrForm" type="default" htmlType="button" icon="sync">重置</a-button>
</div> <a-button @click="submitCurrForm" :disabled="disabledStatus" type="primary" htmlType="button"
</a-card> icon="form">保存
<a-card v-else :bordered="false" style="height:248px !important;"> </a-button>
<a-empty> </div>
<span slot="description"> 请先选择一个部门! </span> </a-card>
</a-empty> <a-card v-else :bordered="false" style="height:248px !important;">
</a-card> <a-empty>
</a-tab-pane> <span slot="description"> 请先选择一个部门! </span>
<!-- <a-tab-pane tab="部门权限" key="2" forceRender>--> </a-empty>
<!-- <depart-auth-modules ref="departAuth"/>--> </a-card>
<!-- </a-tab-pane>--> </a-tab-pane>
<!-- <a-tab-pane tab="用户信息" key="3">--> <!-- <a-tab-pane tab="部门权限" key="2" forceRender>-->
<!-- <Dept-User-Info ref="DeptUserInfo"></Dept-User-Info>--> <!-- <depart-auth-modules ref="departAuth"/>-->
<!-- </a-tab-pane>--> <!-- </a-tab-pane>-->
</a-tabs> <!-- <a-tab-pane tab="用户信息" key="3">-->
</a-col> <!-- <Dept-User-Info ref="DeptUserInfo"></Dept-User-Info>-->
<depart-modal ref="departModal" @ok="loadTree"></depart-modal> <!-- </a-tab-pane>-->
</a-row> </a-tabs>
</a-col>
<depart-modal ref="departModal" @ok="loadTree"></depart-modal>
</a-row>
</div>
</template> </template>
<script> <script>
import DepartModal from './modules/DepartModal' import DepartModal from './modules/DepartModal'
// import DeptUserInfo from './modules/DeptUserInfo' // import DeptUserInfo from './modules/DeptUserInfo'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import {queryDepartTreeList, searchByKeywords, deleteByDepartId} from '@/api/api' import { queryDepartTreeList, searchByKeywords, deleteByDepartId } from '@/api/api'
import {httpAction,getAction} from '@/api/manage' import { httpAction, getAction } from '@/api/manage'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
// import DepartAuthModal from './modules/DepartAuthModal' // import DepartAuthModal from './modules/DepartAuthModal'
import {checkDepartName} from '@/utils/validateOnly' import { checkDepartName } from '@/utils/validateOnly'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/icon_system.png'
// 表头 // 表头
const columns = [ const columns = [
{ {
@@ -187,7 +202,7 @@ const columns = [
}, },
{ {
title: '机构编码', title: '机构编码',
dataIndex: 'orgCode', dataIndex: 'orgCode'
}, },
{ {
title: '手机号', title: '手机号',
@@ -210,7 +225,7 @@ const columns = [
title: '操作', title: '操作',
align: 'center', align: 'center',
dataIndex: 'action', dataIndex: 'action',
scopedSlots: {customRender: 'action'} scopedSlots: { customRender: 'action' }
} }
] ]
export default { export default {
@@ -219,10 +234,12 @@ export default {
components: { components: {
// DepartAuthModal, // DepartAuthModal,
DepartModal, DepartModal,
PageHeaderTitle
// DeptUserInfo // DeptUserInfo
}, },
data() { data() {
return { return {
IconImg,
iExpandedKeys: [], iExpandedKeys: [],
loading: false, loading: false,
autoExpandParent: true, autoExpandParent: true,
@@ -241,48 +258,48 @@ export default {
columns: columns, columns: columns,
disableSubmit: false, disableSubmit: false,
// 编辑提交按钮的状态 // 编辑提交按钮的状态
disabledStatus:false, disabledStatus: false,
checkedKeys: [], checkedKeys: [],
selectedKeys: [], selectedKeys: [],
autoIncr: 1, autoIncr: 1,
currSelected: {}, currSelected: {},
allTreeKeys:[], allTreeKeys: [],
checkStrictly: true, checkStrictly: true,
form: this.$form.createForm(this), form: this.$form.createForm(this),
// 当前树选中的部门id // 当前树选中的部门id
currentDepartSelectedId:'', currentDepartSelectedId: '',
labelCol: { labelCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 5} sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 16} sm: { span: 16 }
}, },
graphDatasource: { graphDatasource: {
nodes: [], nodes: [],
edges: [] edges: []
}, },
validatorRules: { validatorRules: {
departName: {rules: [{required: true,validator: this.validateDepartName}]}, departName: { rules: [{ required: true, validator: this.validateDepartName }] },
orgCode: {rules: [{required: true, message: '请输入机构编码!'}]}, orgCode: { rules: [{ required: true, message: '请输入机构编码!' }] },
orgCategory: {rules: [{required: true, message: '请输入机构类型!'}]}, orgCategory: { rules: [{ required: true, message: '请输入机构类型!' }] },
mobile: {rules: [{validator: this.validateMobile}]} mobile: { rules: [{ validator: this.validateMobile }] }
}, },
url: { url: {
delete: '/sys/sysDepart/delete', delete: '/sys/sysDepart/delete',
edit: '/sys/sysDepart/edit', edit: '/sys/sysDepart/edit',
deleteBatch: '/sys/sysDepart/deleteBatch', deleteBatch: '/sys/sysDepart/deleteBatch',
exportXlsUrl: 'sys/sysDepart/exportXls', exportXlsUrl: 'sys/sysDepart/exportXls',
importExcelUrl: 'sys/sysDepart/importExcel', importExcelUrl: 'sys/sysDepart/importExcel'
}, },
orgCategoryDisabled:false, orgCategoryDisabled: false
} }
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
} }
}, },
methods: { methods: {
@@ -365,7 +382,7 @@ export default {
title: '确认删除', title: '确认删除',
content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据,以及子节点数据吗?', content: '确定要删除所选中的 ' + this.checkedKeys.length + ' 条数据,以及子节点数据吗?',
onOk: function () { onOk: function () {
getAction(that.url.deleteBatch, {ids: ids}).then((res) => { getAction(that.url.deleteBatch, { ids: ids }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.loadTree() that.loadTree()
@@ -381,7 +398,7 @@ export default {
onSearch(value) { onSearch(value) {
let that = this let that = this
if (value) { if (value) {
searchByKeywords({keyWord: value}).then((res) => { searchByKeywords({ keyWord: value }).then((res) => {
if (res.success) { if (res.success) {
that.departTree = [] that.departTree = []
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
@@ -411,9 +428,9 @@ export default {
this.hiding = false this.hiding = false
//this.checkedKeys = checkedKeys.checked //this.checkedKeys = checkedKeys.checked
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> // <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
if(this.checkStrictly){ if (this.checkStrictly) {
this.checkedKeys = checkedKeys.checked this.checkedKeys = checkedKeys.checked
}else{ } else {
this.checkedKeys = checkedKeys this.checkedKeys = checkedKeys
} }
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> // <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
@@ -431,17 +448,17 @@ export default {
// 暂时注释(部门权限组件)没用 2021-08-24 // 暂时注释(部门权限组件)没用 2021-08-24
// this.$refs.departAuth.show(record.id); // this.$refs.departAuth.show(record.id);
// 传用户信息参数 // 传用户信息参数
if( this.$refs.DeptUserInfo !== undefined){ if (this.$refs.DeptUserInfo !== undefined) {
this.$refs.DeptUserInfo.open(record) this.$refs.DeptUserInfo.open(record)
} }
}, },
// 部门名称判断重复 // 部门名称判断重复
validateDepartName(rule, value, callback){ validateDepartName(rule, value, callback) {
checkDepartName(value,this.currentDepartSelectedId).then(res => { checkDepartName(value, this.currentDepartSelectedId).then(res => {
if(res.success){ if (res.success) {
callback() callback()
}else { } else {
callback(res.code === 500 ? '机构/部门已经存在': res) callback(res.code === 500 ? '机构/部门已经存在' : res)
} }
}) })
}, },
@@ -450,14 +467,14 @@ export default {
// 记录当前选择的部门id 作为判重参数条件 // 记录当前选择的部门id 作为判重参数条件
this.currentDepartSelectedId = record.id this.currentDepartSelectedId = record.id
if((record.orgCategory + '') === '1'){ if ((record.orgCategory + '') === '1') {
this.orgCategoryDisabled = true this.orgCategoryDisabled = true
}else{ } else {
this.orgCategoryDisabled = false this.orgCategoryDisabled = false
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form.getFieldDecorator('fax', {initialValue: ''}) this.form.getFieldDecorator('fax', { initialValue: '' })
this.form.setFieldsValue(pick(record, 'departName','orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo')) this.form.setFieldsValue(pick(record, 'departName', 'orgCategory', 'orgCode', 'departOrder', 'mobile', 'fax', 'address', 'memo'))
}) })
}, },
getCurrSelectedTitle() { getCurrSelectedTitle() {
@@ -502,10 +519,10 @@ export default {
this.$message.error(res.message) this.$message.error(res.message)
this.disabledStatus = false this.disabledStatus = false
} }
}).finally( () => { }).finally(() => {
this.disabledStatus = false this.disabledStatus = false
}) })
}else { } else {
this.disabledStatus = false this.disabledStatus = false
} }
}) })
@@ -548,15 +565,15 @@ export default {
title: '确认删除', title: '确认删除',
content: '确定要删除此部门以及子节点数据吗?', content: '确定要删除此部门以及子节点数据吗?',
onOk: function () { onOk: function () {
deleteByDepartId({id: that.rightClickSelectedKey}).then((resp) => { deleteByDepartId({ id: that.rightClickSelectedKey }).then((resp) => {
if (resp.success) { if (resp.success) {
//删除成功后,去除已选中中的数据 //删除成功后,去除已选中中的数据
that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1) that.checkedKeys.splice(that.checkedKeys.findIndex(key => key === that.rightClickSelectedKey), 1)
that.$message.success('删除成功!') that.$message.success('删除成功!')
that.loadTree() that.loadTree()
//删除后同步清空右侧基本信息内容 //删除后同步清空右侧基本信息内容
let orgCode=that.form.getFieldValue('orgCode') let orgCode = that.form.getFieldValue('orgCode')
if(orgCode && orgCode === that.rightClickSelectedOrgCode){ if (orgCode && orgCode === that.rightClickSelectedOrgCode) {
that.onClearSelected() that.onClearSelected()
} }
} else { } else {
@@ -568,7 +585,7 @@ export default {
}, },
selectDirectiveOk(record) { selectDirectiveOk(record) {
console.log('选中指令数据', record) console.log('选中指令数据', record)
this.nodeSettingForm.setFieldsValue({directiveCode: record.directiveCode}) this.nodeSettingForm.setFieldsValue({ directiveCode: record.directiveCode })
this.currSelected.sysCode = record.sysCode this.currSelected.sysCode = record.sysCode
}, },
getFlowGraphData(node) { getFlowGraphData(node) {
@@ -588,21 +605,21 @@ export default {
} }
}, },
// <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------> // <!---- author:os_chengtgen -- date:20190827 -- for:切换父子勾选模式 =======------>
expandAll () { expandAll() {
this.iExpandedKeys = this.allTreeKeys this.iExpandedKeys = this.allTreeKeys
}, },
closeAll () { closeAll() {
this.iExpandedKeys = [] this.iExpandedKeys = []
}, },
checkALL () { checkALL() {
this.checkStriccheckStrictlytly = false this.checkStriccheckStrictlytly = false
this.checkedKeys = this.allTreeKeys this.checkedKeys = this.allTreeKeys
}, },
cancelCheckALL () { cancelCheckALL() {
//this.checkedKeys = this.defaultCheckedKeys //this.checkedKeys = this.defaultCheckedKeys
this.checkedKeys = [] this.checkedKeys = []
}, },
callback(){ callback() {
// tab页切换为基本信息时候 清除表单验证 // tab页切换为基本信息时候 清除表单验证
console.log(this.form) console.log(this.form)
// if(val === '1' && this.form){ // if(val === '1' && this.form){
@@ -632,7 +649,7 @@ export default {
this.currFlowId = this.$route.params.id this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name this.currFlowName = this.$route.params.name
// this.loadTree() // this.loadTree()
}, }
} }
</script> </script>
+205 -198
View File
@@ -1,221 +1,228 @@
<template> <template>
<a-row :gutter="10"> <div>
<a-col :md="8" :sm="24"> <page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false"> <a-row :gutter="10">
<div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px"> <a-col :md="8" :sm="24">
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/> <a-card :bordered="false">
<!-- --> <div style="background: #fff;padding-left:16px;height: 100%; margin-top: 5px">
<a-input-search @search="onSearch" style="width:100%;margin-top: 10px" placeholder="请输入部门名称"/>
<!-- -->
<template v-if="userIdentity === '2' && departTree.length>0"> <template v-if="userIdentity === '2' && departTree.length>0">
<!--组织机构--> <!--组织机构-->
<a-tree <a-tree
showLine showLine
:selectedKeys="selectedKeys" :selectedKeys="selectedKeys"
:checkStrictly="true" :checkStrictly="true"
@select="onSelect" @select="onSelect"
:dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree" :treeData="departTree"
:autoExpandParent="autoExpandParent" :autoExpandParent="autoExpandParent"
:expandedKeys="iExpandedKeys" :expandedKeys="iExpandedKeys"
@expand="onExpand" @expand="onExpand"
/> />
</template> </template>
<div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0"> <div style="margin-top: 24px;" v-else-if="userIdentity === '2' && departTree.length==0">
<h3><span>您的部门下暂无有效部门信息</span></h3> <h3><span>您的部门下暂无有效部门信息</span></h3>
</div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div>
</div> </div>
<div style="margin-top: 24px;" v-else><h3>普通员工暂此权限</h3></div> </a-card>
</div> </a-col>
</a-card> <a-col :md="16" :sm="24">
</a-col> <a-card :bordered="false">
<a-col :md="16" :sm="24"> <a-tabs defaultActiveKey="2" @change="callback">
<a-card :bordered="false"> <a-tab-pane tab="基本信息" key="1" forceRender>
<a-tabs defaultActiveKey="2" @change="callback"> <Dept-Base-Info ref="DeptBaseInfo"></Dept-Base-Info>
<a-tab-pane tab="基本信息" key="1" forceRender> </a-tab-pane>
<Dept-Base-Info ref="DeptBaseInfo"></Dept-Base-Info> <a-tab-pane tab="用户信息" key="2">
</a-tab-pane> <Dept-User-Info ref="DeptUserInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"></Dept-User-Info>
<a-tab-pane tab="用户信息" key="2"> </a-tab-pane>
<Dept-User-Info ref="DeptUserInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"></Dept-User-Info> <a-tab-pane tab="部门角色" key="3" forceRender>
</a-tab-pane> <dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/>
<a-tab-pane tab="部门角色" key="3" forceRender> </a-tab-pane>
<dept-role-info ref="DeptRoleInfo" @clearSelectedDepartKeys="clearSelectedDepartKeys"/> </a-tabs>
</a-tab-pane> </a-card>
</a-tabs> </a-col>
</a-card> </a-row>
</a-col> </div>
</a-row>
</template> </template>
<script> <script>
import DeptBaseInfo from './modules/DeptBaseInfo' import DeptBaseInfo from './modules/DeptBaseInfo'
import DeptUserInfo from './modules/DeptUserInfo' import DeptUserInfo from './modules/DeptUserInfo'
import {queryMyDepartTreeList, searchByKeywords} from '@/api/api' import { queryMyDepartTreeList, searchByKeywords } from '@/api/api'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DeptRoleInfo from './modules/DeptRoleInfo' import DeptRoleInfo from './modules/DeptRoleInfo'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'DepartUserList', name: 'DepartUserList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
DeptRoleInfo, DeptRoleInfo,
DeptBaseInfo, DeptBaseInfo,
DeptUserInfo, DeptUserInfo,
PageHeaderTitle
},
data() {
return {
IconImg,
currentDeptId: '',
iExpandedKeys: [],
loading: false,
autoExpandParent: true,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
departTree: [],
rightClickSelectedKey: '',
hiding: true,
model: {},
dropTrigger: '',
depart: {},
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
form: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
graphDatasource: {
nodes: [],
edges: []
},
userIdentity: ''
}
},
methods: {
callback() {
//console.log(key)
}, },
data() { loadData() {
return { this.refresh()
currentDeptId: '',
iExpandedKeys: [],
loading: false,
autoExpandParent: true,
currFlowId: '',
currFlowName: '',
disable: true,
treeData: [],
visible: false,
departTree: [],
rightClickSelectedKey: '',
hiding: true,
model: {},
dropTrigger: '',
depart: {},
disableSubmit: false,
checkedKeys: [],
selectedKeys: [],
autoIncr: 1,
currSelected: {},
form: this.$form.createForm(this),
labelCol: {
xs: {span: 24},
sm: {span: 5}
},
wrapperCol: {
xs: {span: 24},
sm: {span: 16}
},
graphDatasource: {
nodes: [],
edges: []
},
userIdentity:'',
}
}, },
methods: { clearSelectedDepartKeys() {
callback() { this.checkedKeys = []
//console.log(key) this.selectedKeys = []
}, this.currentDeptId = ''
loadData() { this.$refs.DeptUserInfo.currentDeptId = ''
this.refresh() this.$refs.DeptRoleInfo.currentDeptId = ''
}, },
clearSelectedDepartKeys() { loadTree() {
this.checkedKeys = [] var that = this
this.selectedKeys = [] that.treeData = []
this.currentDeptId = '' that.departTree = []
this.$refs.DeptUserInfo.currentDeptId='' queryMyDepartTreeList().then((res) => {
this.$refs.DeptRoleInfo.currentDeptId='' if (res.success && res.result) {
}, for (let i = 0; i < res.result.length; i++) {
loadTree() { let temp = res.result[i]
var that = this that.treeData.push(temp)
that.treeData = [] that.departTree.push(temp)
that.departTree = [] that.setThisExpandedKeys(temp)
queryMyDepartTreeList().then((res) => { // console.log(temp.id)
if (res.success && res.result ) {
for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i]
that.treeData.push(temp)
that.departTree.push(temp)
that.setThisExpandedKeys(temp)
// console.log(temp.id)
}
this.loading = false
} }
that.userIdentity = res.message this.loading = false
}) }
}, that.userIdentity = res.message
setThisExpandedKeys(node) { })
//只展开一级目录 },
if (node.children && node.children.length > 0) { setThisExpandedKeys(node) {
this.iExpandedKeys.push(node.key) //只展开一级目录
//下方代码放开注释则默认展开所有节点 if (node.children && node.children.length > 0) {
/** this.iExpandedKeys.push(node.key)
for (let a = 0; a < node.children.length; a++) { //下方代码放开注释则默认展开所有节点
/**
for (let a = 0; a < node.children.length; a++) {
this.setThisExpandedKeys(node.children[a]) this.setThisExpandedKeys(node.children[a])
} }
*/ */
} }
}, },
refresh() { refresh() {
this.loading = true this.loading = true
this.loadTree() this.loadTree()
}, },
onExpand(expandedKeys) { onExpand(expandedKeys) {
// console.log('onExpand', expandedKeys) // console.log('onExpand', expandedKeys)
// if not set autoExpandParent to false, if children expanded, parent can not collapse. // if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys. // or, you can remove all expanded children keys.
this.iExpandedKeys = expandedKeys this.iExpandedKeys = expandedKeys
this.autoExpandParent = false this.autoExpandParent = false
}, },
onSearch(value) { onSearch(value) {
let that = this let that = this
if (value) { if (value) {
searchByKeywords({keyWord: value,myDeptSearch:'1'}).then((res) => { searchByKeywords({ keyWord: value, myDeptSearch: '1' }).then((res) => {
if (res.success) { if (res.success) {
that.departTree = [] that.departTree = []
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
let temp = res.result[i] let temp = res.result[i]
that.departTree.push(temp) that.departTree.push(temp)
}
} else {
that.$message.warning(res.message)
} }
}) } else {
} else { that.$message.warning(res.message)
that.loadTree() }
} })
} else {
that.loadTree()
}
},
onCheck(checkedKeys, e) {
let record = e.node.dataRef
// console.log('onCheck', checkedKeys, e);
this.checkedKeys = []
// if (e.checked === true) {
this.currentDeptId = record.id
this.checkedKeys.push(record.id)
this.$refs.DeptBaseInfo.open(record)
this.$refs.DeptUserInfo.open(record)
this.$refs.DeptRoleInfo.open(record)
// }
// else {
// this.checkedKeys = [];
// this.$refs.DeptBaseInfo.clearForm();
// this.$refs.DeptUserInfo.clearList();
// }
this.hiding = false
// this.checkedKeys = checkedKeys.checked
},
onSelect(selectedKeys, e) {
if (this.selectedKeys[0] !== selectedKeys[0]) {
this.selectedKeys = [selectedKeys[0]]
}
let record = e.node.dataRef
this.checkedKeys.push(record.id)
this.$refs.DeptBaseInfo.open(record)
this.$refs.DeptUserInfo.onClearSelected()
this.$refs.DeptUserInfo.open(record)
this.$refs.DeptRoleInfo.onClearSelected()
this.$refs.DeptRoleInfo.open(record)
},
}, },
created() { onCheck(checkedKeys, e) {
this.currFlowId = this.$route.params.id let record = e.node.dataRef
this.currFlowName = this.$route.params.name // console.log('onCheck', checkedKeys, e);
// this.loadTree() this.checkedKeys = []
// if (e.checked === true) {
this.currentDeptId = record.id
this.checkedKeys.push(record.id)
this.$refs.DeptBaseInfo.open(record)
this.$refs.DeptUserInfo.open(record)
this.$refs.DeptRoleInfo.open(record)
// }
// else {
// this.checkedKeys = [];
// this.$refs.DeptBaseInfo.clearForm();
// this.$refs.DeptUserInfo.clearList();
// }
this.hiding = false
// this.checkedKeys = checkedKeys.checked
}, },
onSelect(selectedKeys, e) {
if (this.selectedKeys[0] !== selectedKeys[0]) {
this.selectedKeys = [selectedKeys[0]]
}
let record = e.node.dataRef
this.checkedKeys.push(record.id)
this.$refs.DeptBaseInfo.open(record)
this.$refs.DeptUserInfo.onClearSelected()
this.$refs.DeptUserInfo.open(record)
this.$refs.DeptRoleInfo.onClearSelected()
this.$refs.DeptRoleInfo.open(record)
}
},
created() {
this.currFlowId = this.$route.params.id
this.currFlowName = this.$route.params.name
// this.loadTree()
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less' @import '~@assets/less/common.less'
</style> </style>
+197 -188
View File
@@ -1,216 +1,225 @@
<template> <template>
<a-card :bordered="false"> <div>
<page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false">
<!-- 左侧面板 --> <!-- 左侧面板 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="12"> <a-row :gutter="12">
<a-col :md="7" :sm="8"> <a-col :md="7" :sm="8">
<a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item label="字典名称" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入字典名称" v-model="queryParam.dictName"></a-input> <a-input placeholder="请输入字典名称" v-model="queryParam.dictName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="7" :sm="8"> <a-col :md="7" :sm="8">
<a-form-item label="字典编号" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}"> <a-form-item label="字典编号" :labelCol="{span: 6}" :wrapperCol="{span: 14, offset: 1}">
<a-input placeholder="请输入字典编号" v-model="queryParam.dictCode"></a-input> <a-input placeholder="请输入字典编号" v-model="queryParam.dictCode"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="7" :sm="8"> <a-col :md="7" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:dict:add'">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:dict:add'">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('字典信息')" v-has="'sys:dict:export'">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('字典信息')" v-has="'sys:dict:export'">导出
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" v-has="'sys:dict:import'" @change="handleImportExcel"> </a-button>
<a-button type="primary" icon="import">导入</a-button> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
</a-upload> :action="importExcelUrl"
<a-button type="primary" icon="sync" @click="refleshCache()">刷新缓存</a-button> v-has="'sys:dict:import'" @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-button type="primary" icon="sync" @click="refleshCache()">刷新缓存</a-button>
<a-button type="primary" icon="hdd" @click="openDeleteList">回收站</a-button> <a-button type="primary" icon="hdd" @click="openDeleteList">回收站</a-button>
</div> </div>
<a-table <a-table
ref="table" ref="table"
rowKey="id" rowKey="id"
bordered bordered
size="middle" size="middle"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" slot-scope="text, record" class="action-span-cell"> <span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="handleEdit(record)" v-has="'sys:dict:edit'"> <a @click="handleEdit(record)" v-has="'sys:dict:edit'">
<a-icon type="edit"/> <a-icon type="edit"/>
编辑 编辑
</a> </a>
<a @click="editDictItem(record)"><a-icon type="setting"/> 字典配置</a> <a @click="editDictItem(record)"><a-icon type="setting"/> 字典配置</a>
<!-- <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">--> <!-- <a-popconfirm title="确定删除吗?" @confirm="() =>handleDelete(record.id)">-->
<!-- </a-popconfirm>\--> <!-- </a-popconfirm>\-->
<a @click="handleDelete(record.id)" v-has="'sys:dict:del'">删除</a> <a @click="handleDelete(record.id)" v-has="'sys:dict:del'">删除</a>
</span> </span>
<template slot="text" slot-scope="text"> <template slot="text" slot-scope="text">
<span v-if="!text"></span> <span v-if="!text"></span>
<j-ellipsis :value="text" :length="10"></j-ellipsis> <j-ellipsis :value="text" :length="10"></j-ellipsis>
</template> </template>
</a-table> </a-table>
</div> </div>
<dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 --> <dict-modal ref="modalForm" @ok="modalFormOk"></dict-modal> <!-- 字典类型 -->
<dict-item-list ref="dictItemList"></dict-item-list> <dict-item-list ref="dictItemList"></dict-item-list>
<dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list> <dict-delete-list ref="dictDeleteList" @refresh="() =>loadData()"></dict-delete-list>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
// import { filterObj } from '@/utils/util' // import { filterObj } from '@/utils/util'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import DictModal from './modules/DictModal' import DictModal from './modules/DictModal'
import DictItemList from './DictItemList' import DictItemList from './DictItemList'
import DictDeleteList from './DictDeleteList' import DictDeleteList from './DictDeleteList'
import { getAction } from '@api/manage' import { getAction } from '@api/manage'
import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types' import { UI_CACHE_DB_DICT_DATA } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
import JEllipsis from '@comp/jero/JEllipsis' import JEllipsis from '@comp/jero/JEllipsis'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'DictList', name: 'DictList',
mixins:[JeroListMixin], mixins: [JeroListMixin],
components: {DictModal, DictItemList,DictDeleteList,JEllipsis}, components: { DictModal, DictItemList, DictDeleteList, JEllipsis, PageHeaderTitle },
data() { data() {
return { return {
description: '这是数据字典页面', IconImg,
visible: false, description: '这是数据字典页面',
// 查询条件 visible: false,
queryParam: { // 查询条件
dictCode: '', queryParam: {
dictName: '', dictCode: '',
dictName: ''
},
// 表头
columns: [
{
title: '序号',
dataIndex: '',
key: 'rowIndex',
width: 120,
align: 'center',
customRender: function (t, r, index) {
return parseInt(index) + 1
}
}, },
// 表头 {
columns: [ title: '字典名称',
{ align: 'left',
title: '序号', dataIndex: 'dictName',
dataIndex: '', scopedSlots: { customRender: 'text' }
key: 'rowIndex', },
width: 120, {
align: 'center', title: '字典编号',
customRender: function (t, r, index) { align: 'left',
return parseInt(index) + 1 dataIndex: 'dictCode',
scopedSlots: { customRender: 'text' }
},
{
title: '描述',
align: 'left',
dataIndex: 'description',
scopedSlots: { customRender: 'text' }
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
],
dict: '',
labelCol: {
xs: { span: 8 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 16 },
sm: { span: 19 }
},
url: {
list: '/sys/dict/page',
delete: '/sys/dict/delete',
exportXlsUrl: 'sys/dict/exportXls',
importExcelUrl: 'sys/dict/importExcel',
refleshCache: 'sys/dict/refleshCache',
queryAllDictItems: 'sys/dict/queryAllDictItems'
}
}
},
computed: {
importExcelUrl: function () {
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
}
},
methods: {
// getQueryParams() {
// var param = Object.assign({}, this.queryParam, this.isorter);
// param.field = this.getQueryField();
// param.pageNo = this.ipagination.current;
// param.pageSize = this.ipagination.pageSize;
// if (this.superQueryParams) {
// param['superQueryParams'] = encodeURI(this.superQueryParams)
// param['superQueryMatchType'] = this.superQueryMatchType
// }
// return filterObj(param);
// },
//取消选择
cancelDict() {
this.dict = ''
this.visible = false
this.loadData()
},
//编辑字典数据
editDictItem(record) {
this.$refs.dictItemList.edit(record)
},
// 重置字典类型搜索框的内容
// searchReset() {
// var that = this;
// that.queryParam.dictName = "";
// that.queryParam.dictCode = "";
// that.loadData(this.ipagination.current);
// },
openDeleteList() {
this.$refs.dictDeleteList.show()
},
refleshCache() {
getAction(this.url.refleshCache).then((res) => {
if (res.success) {
//重新加载缓存
getAction(this.url.queryAllDictItems).then((res) => {
if (res.success) {
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
} }
}, })
{ this.$message.success('刷新缓存完成!')
title: '字典名称', }
align: 'left', }).catch(e => {
dataIndex: 'dictName', this.$message.warn('刷新缓存失败!')
scopedSlots: { customRender: 'text' } console.log('刷新失败', e)
}, })
{ }
title: '字典编号', },
align: 'left', watch: {
dataIndex: 'dictCode', openKeys(val) {
scopedSlots: { customRender: 'text' } console.log('openKeys', val)
}, }
{
title: '描述',
align: 'left',
dataIndex: 'description',
scopedSlots: { customRender: 'text' }
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: {customRender: 'action'},
}
],
dict: '',
labelCol: {
xs: {span: 8},
sm: {span: 5},
},
wrapperCol: {
xs: {span: 16},
sm: {span: 19},
},
url: {
list: '/sys/dict/page',
delete: '/sys/dict/delete',
exportXlsUrl: 'sys/dict/exportXls',
importExcelUrl: 'sys/dict/importExcel',
refleshCache: 'sys/dict/refleshCache',
queryAllDictItems: 'sys/dict/queryAllDictItems',
},
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}
},
methods: {
// getQueryParams() {
// var param = Object.assign({}, this.queryParam, this.isorter);
// param.field = this.getQueryField();
// param.pageNo = this.ipagination.current;
// param.pageSize = this.ipagination.pageSize;
// if (this.superQueryParams) {
// param['superQueryParams'] = encodeURI(this.superQueryParams)
// param['superQueryMatchType'] = this.superQueryMatchType
// }
// return filterObj(param);
// },
//取消选择
cancelDict() {
this.dict = ''
this.visible = false
this.loadData()
},
//编辑字典数据
editDictItem(record) {
this.$refs.dictItemList.edit(record)
},
// 重置字典类型搜索框的内容
// searchReset() {
// var that = this;
// that.queryParam.dictName = "";
// that.queryParam.dictCode = "";
// that.loadData(this.ipagination.current);
// },
openDeleteList(){
this.$refs.dictDeleteList.show()
},
refleshCache(){
getAction(this.url.refleshCache).then((res) => {
if (res.success) {
//重新加载缓存
getAction(this.url.queryAllDictItems).then((res) => {
if (res.success) {
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
}
})
this.$message.success('刷新缓存完成!')
}
}).catch(e=>{
this.$message.warn('刷新缓存失败!')
console.log('刷新失败',e)
})
}
},
watch: {
openKeys(val) {
console.log('openKeys', val)
},
},
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>
+65 -58
View File
@@ -1,42 +1,44 @@
<template> <template>
<a-card :bordered="false"> <div>
<!--导航区域--> <page-header-title :img-for-icon="IconImg"></page-header-title>
<div> <a-card :bordered="false">
<a-tabs defaultActiveKey="1" @change="callback"> <!--导航区域-->
<a-tab-pane tab="登录日志" key="1"></a-tab-pane> <div>
<a-tab-pane tab="操作日志" key="2"></a-tab-pane> <a-tabs defaultActiveKey="1" @change="callback">
</a-tabs> <a-tab-pane tab="登录日志" key="1"></a-tab-pane>
</div> <a-tab-pane tab="操作日志" key="2"></a-tab-pane>
</a-tabs>
</div>
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<a-form-item label="搜索日志"> <a-form-item label="搜索日志">
<a-input placeholder="请输入搜索关键词" v-model="queryParam.keyWord"></a-input> <a-input placeholder="请输入搜索关键词" v-model="queryParam.keyWord"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="10" :sm="10"> <a-col :md="10" :sm="10">
<a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="创建时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-range-picker <a-range-picker
v-model="queryParam.createTimeRange" v-model="queryParam.createTimeRange"
format="YYYY-MM-DD" format="YYYY-MM-DD"
:placeholder="['开始时间', '结束时间']" :placeholder="['开始时间', '结束时间']"
@change="onDateChange" @change="onDateChange"
@ok="onDateOk" @ok="onDateOk"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="5" :sm="8" v-if="tabKey === '2'"> <a-col :md="5" :sm="8" v-if="tabKey === '2'">
<a-form-item label="操作类型" style="left: 10px"> <a-form-item label="操作类型" style="left: 10px">
<j-dict-select-tag v-model="queryParam.operateType" placeholder="请选择操作类型" dictCode="operate_type"/> <j-dict-select-tag v-model="queryParam.operateType" placeholder="请选择操作类型" dictCode="operate_type"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" style="left: 10px" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" <a-button type="primary" @click="searchReset" icon="reload"
@@ -44,48 +46,53 @@
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
@change="handleTableChange"> @change="handleTableChange">
<!-- <div v-show="queryParam.logType==2" slot="expandedRowRender" slot-scope="record" style="margin: 0">--> <!-- <div v-show="queryParam.logType==2" slot="expandedRowRender" slot-scope="record" style="margin: 0">-->
<!-- <div style="margin-bottom: 5px"><a-badge status="success" style="vertical-align: middle;"/><span style="vertical-align: middle;">请求方法:{{ record.method }}</span></div>--> <!-- <div style="margin-bottom: 5px"><a-badge status="success" style="vertical-align: middle;"/><span style="vertical-align: middle;">请求方法:{{ record.method }}</span></div>-->
<!-- <div><a-badge status="processing" style="vertical-align: middle;"/><span style="vertical-align: middle;">请求参数:{{ record.requestParam }}</span></div>--> <!-- <div><a-badge status="processing" style="vertical-align: middle;"/><span style="vertical-align: middle;">请求参数:{{ record.requestParam }}</span></div>-->
<!-- </div>--> <!-- </div>-->
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
<span slot="logContent" slot-scope="text, record"> <span slot="logContent" slot-scope="text, record">
<j-ellipsis :value="text" :length="40"/> <j-ellipsis :value="text" :length="40"/>
</span> </span>
</a-table> </a-table>
<!-- table区域-end --> <!-- table区域-end -->
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import { filterObj } from '@/utils/util' import { filterObj } from '@/utils/util'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import JEllipsis from '@/components/jero/JEllipsis' import JEllipsis from '@/components/jero/JEllipsis'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'LogList', name: 'LogList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
JEllipsis JEllipsis,
PageHeaderTitle
}, },
data() { data() {
return { return {
IconImg,
description: '这是日志管理页面', description: '这是日志管理页面',
// 查询条件 // 查询条件
queryParam: { queryParam: {
+150 -142
View File
@@ -1,39 +1,42 @@
<template> <template>
<a-card :bordered="false"> <div>
<page-header-title :img-for-icon="IconImg"></page-header-title>
<!-- 操作按钮区域 --> <a-card :bordered="false">
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button
@click="batchDel"
v-if="selectedRowKeys.length > 0"
ghost
type="primary"
icon="delete">批量删除
</a-button>
</div>
<!-- table区域-begin --> <!-- 操作按钮区域 -->
<div> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button
@click="batchDel"
v-if="selectedRowKeys.length > 0"
ghost
type="primary"
icon="delete">批量删除
</a-button>
</div>
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> <!-- table区域-begin -->
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{--> <div>
<!-- selectedRowKeys.length }}</a>&nbsp;&nbsp;-->
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
<!-- </div>-->
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
<a-table
:columns="columns"
bordered
:scroll="{x: 1500}"
size="middle"
:pagination="false"
:dataSource="dataSource"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@expandedRowsChange="handleExpandedRowsChange">
<span slot="action" slot-scope="text, record" class="action-span-cell"> <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择&nbsp;<a style="font-weight: 600">{{-->
<!-- selectedRowKeys.length }}</a>&nbsp;&nbsp;-->
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
<!-- </div>-->
<!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"-->
<a-table
:columns="columns"
bordered
:scroll="{x: 1500}"
size="middle"
:pagination="false"
:dataSource="dataSource"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@expandedRowsChange="handleExpandedRowsChange">
<span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-dropdown> <a-dropdown>
@@ -53,143 +56,148 @@
<a-menu-item> <a-menu-item>
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- </a-popconfirm>--> <!-- </a-popconfirm>-->
<a @click="handleDelete(record.id)">删除</a> <a @click="handleDelete(record.id)">删除</a>
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
</a-dropdown> </a-dropdown>
</span> </span>
<!-- 字符串超长截取省略号显示 --> <!-- 字符串超长截取省略号显示 -->
<span slot="url" slot-scope="text"> <span slot="url" slot-scope="text">
<j-ellipsis :value="text" :length="25"/> <j-ellipsis :value="text" :length="25"/>
</span> </span>
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
<span slot="component" slot-scope="text"> <span slot="component" slot-scope="text">
<j-ellipsis :value="text"/> <j-ellipsis :value="text"/>
</span> </span>
</a-table> </a-table>
</div> </div>
<!-- table区域-end --> <!-- table区域-end -->
<permission-modal ref="modalForm" @ok="modalFormOk"></permission-modal> <permission-modal ref="modalForm" @ok="modalFormOk"></permission-modal>
<permission-data-rule-list ref="PermissionDataRuleList" @ok="modalFormOk"></permission-data-rule-list> <permission-data-rule-list ref="PermissionDataRuleList" @ok="modalFormOk"></permission-data-rule-list>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import PermissionModal from './modules/PermissionModal' import PermissionModal from './modules/PermissionModal'
import { getPermissionList } from '@/api/api' import { getPermissionList } from '@/api/api'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import PermissionDataRuleList from './PermissionDataRuleList' import PermissionDataRuleList from './PermissionDataRuleList'
import JEllipsis from '@/components/jero/JEllipsis' import JEllipsis from '@/components/jero/JEllipsis'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
import IconImg from '@/assets/imgs/icon/icon_system.png'
const columns = [ const columns = [
{ {
title: '菜单名称', title: '菜单名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name' key: 'name'
}, { }, {
title: '菜单类型', title: '菜单类型',
dataIndex: 'menuType', dataIndex: 'menuType',
key: 'menuType', key: 'menuType',
customRender: function(text) { customRender: function (text) {
if (text == 0) { if (text == 0) {
return '菜单' return '菜单'
} else if (text == 1) { } else if (text == 1) {
return '菜单' return '菜单'
} else if (text == 2) { } else if (text == 2) {
return '按钮/权限' return '按钮/权限'
} else { } else {
return text return text
}
} }
},/*{ }
},/*{
title: '权限编码', title: '权限编码',
dataIndex: 'perms', dataIndex: 'perms',
key: 'permissionCode', key: 'permissionCode',
},*/{ },*/{
title: 'icon', title: 'icon',
dataIndex: 'icon', dataIndex: 'icon',
key: 'icon' key: 'icon'
}, },
{ {
title: '组件', title: '组件',
dataIndex: 'component', dataIndex: 'component',
key: 'component', key: 'component',
scopedSlots: { customRender: 'component' } scopedSlots: { customRender: 'component' }
}, },
{ {
title: '路径', title: '路径',
dataIndex: 'url', dataIndex: 'url',
key: 'url', key: 'url',
scopedSlots: { customRender: 'url' } scopedSlots: { customRender: 'url' }
}, },
{ {
title: '排序', title: '排序',
dataIndex: 'sortNo', dataIndex: 'sortNo',
key: 'sortNo' key: 'sortNo'
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
fixed: 'right', fixed: 'right',
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
align: 'center', align: 'center',
width: 150 width: 150
} }
] ]
export default { export default {
name: 'PermissionList', name: 'PermissionList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
PermissionDataRuleList, PermissionDataRuleList,
PermissionModal, PermissionModal,
JEllipsis JEllipsis,
}, PageHeaderTitle
data() { },
return { data() {
description: '这是菜单管理页面', return {
// 表头 IconImg,
columns: columns, description: '这是菜单管理页面',
loading: false, // 表头
// 展开的行,受控属性 columns: columns,
expandedRowKeys: [], loading: false,
url: { // 展开的行,受控属性
list: '/sys/permission/page', expandedRowKeys: [],
delete: '/sys/permission/delete', url: {
deleteBatch: '/sys/permission/deleteBatch' list: '/sys/permission/page',
} delete: '/sys/permission/delete',
deleteBatch: '/sys/permission/deleteBatch'
} }
}
},
methods: {
loadData() {
this.dataSource = []
getPermissionList().then((res) => {
if (res.success) {
console.log(res.result)
this.dataSource = res.result
}
})
}, },
methods: { // 打开数据规则编辑
loadData() { handleDataRule(record) {
this.dataSource = [] this.$refs.PermissionDataRuleList.edit(record)
getPermissionList().then((res) => { },
if (res.success) { handleAddSub(record) {
console.log(res.result) this.$refs.modalForm.title = '添加子菜单'
this.dataSource = res.result this.$refs.modalForm.localMenuType = 1
} this.$refs.modalForm.disableSubmit = false
}) this.$refs.modalForm.edit({ status: '1', permsType: '1', route: true, 'parentId': record.id })
}, },
// 打开数据规则编辑 handleExpandedRowsChange(expandedRows) {
handleDataRule(record) { this.expandedRowKeys = expandedRows
this.$refs.PermissionDataRuleList.edit(record)
},
handleAddSub(record) {
this.$refs.modalForm.title = '添加子菜单'
this.$refs.modalForm.localMenuType = 1
this.$refs.modalForm.disableSubmit = false
this.$refs.modalForm.edit({status:'1',permsType:'1',route:true,'parentId':record.id})
},
handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows
},
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>
+100 -93
View File
@@ -1,78 +1,80 @@
<template> <template>
<a-card :bordered="false"> <div>
<page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false">
<!-- 查询区域 --> <!-- 查询区域 -->
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
<a-form-item label="任务类名"> <a-form-item label="任务类名">
<a-input placeholder="请输入任务类名" v-model="queryParam.jobClassName"></a-input> <a-input placeholder="请输入任务类名" v-model="queryParam.jobClassName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
<a-form-item label="任务状态"> <a-form-item label="任务状态">
<a-select v-model="queryParam.status" placeholder="请选择状态"> <a-select v-model="queryParam.status" placeholder="请选择状态">
<a-select-option value="">全部</a-select-option> <a-select-option value="">全部</a-select-option>
<a-select-option value="0">正常</a-select-option> <a-select-option value="0">正常</a-select-option>
<a-select-option value="-1">停止</a-select-option> <a-select-option value="-1">停止</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="10"> <a-col :md="6" :sm="10">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('定时任务信息')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('定时任务信息')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel"> @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button> <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">--> <!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">--> <!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel">--> <!-- <a-menu-item key="1" @click="batchDel">-->
<!-- <a-icon type="delete"/>--> <!-- <a-icon type="delete"/>-->
<!-- 删除--> <!-- 删除-->
<!-- </a-menu-item>--> <!-- </a-menu-item>-->
<!-- </a-menu>--> <!-- </a-menu>-->
<!-- <a-button style="margin-left: 8px"> 批量操作--> <!-- <a-button style="margin-left: 8px"> 批量操作-->
<!-- <a-icon type="down"/>--> <!-- <a-icon type="down"/>-->
<!-- </a-button>--> <!-- </a-button>-->
<!-- </a-dropdown>--> <!-- </a-dropdown>-->
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<!-- <div>--> <!-- <div>-->
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">--> <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a--> <!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a-->
<!-- style="font-weight: 600">{{ selectedRowKeys.length }}</a>--> <!-- style="font-weight: 600">{{ selectedRowKeys.length }}</a>-->
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>--> <!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
<!-- </div>--> <!-- </div>-->
<a-table <a-table
ref="table" ref="table"
size="middle" size="middle"
bordered bordered
rowKey="id" rowKey="id"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
<!-- 字符串超长截取省略号显示--> <!-- 字符串超长截取省略号显示-->
<span slot="description" slot-scope="text"> <span slot="description" slot-scope="text">
@@ -83,23 +85,23 @@
</span> </span>
<span slot="action" slot-scope="text, record" class="action-span-cell"> <span slot="action" slot-scope="text, record" class="action-span-cell">
<a @click="resumeJob(record)" v-if="record.status==-1">启动</a> <a @click="resumeJob(record)" v-if="record.status==-1">启动</a>
<a @click="pauseJob(record)" v-if="record.status==0">停止</a> <a @click="pauseJob(record)" v-if="record.status==0">停止</a>
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a @click="handleDelete(record.id)">删除</a> <a @click="handleDelete(record.id)">删除</a>
<!-- <a-dropdown>--> <!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>--> <!-- <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>-->
<!-- <a-menu slot="overlay">--> <!-- <a-menu slot="overlay">-->
<!-- <a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>--> <!-- <a-menu-item><a @click="executeImmediately(record)">立即执行</a></a-menu-item>-->
<!-- <a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>--> <!-- <a-menu-item><a @click="handleEdit(record)">编辑</a></a-menu-item>-->
<!-- <a-menu-item>--> <!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">--> <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- </a-popconfirm>--> <!-- </a-popconfirm>-->
<!-- </a-menu-item>--> <!-- </a-menu-item>-->
<!-- </a-menu>--> <!-- </a-menu>-->
<!-- </a-dropdown>--> <!-- </a-dropdown>-->
</span> </span>
<!-- 状态渲染模板 --> <!-- 状态渲染模板 -->
@@ -109,28 +111,33 @@
</template> </template>
</a-table> </a-table>
<!-- table区域-end --> <!-- table区域-end -->
<!-- 表单区域 --> <!-- 表单区域 -->
<quartzJob-modal ref="modalForm" @ok="modalFormOk"></quartzJob-modal> <quartzJob-modal ref="modalForm" @ok="modalFormOk"></quartzJob-modal>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import QuartzJobModal from './modules/QuartzJobModal' import QuartzJobModal from './modules/QuartzJobModal'
import {getAction} from '@/api/manage' import { getAction } from '@/api/manage'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import JEllipsis from '@/components/jero/JEllipsis' import JEllipsis from '@/components/jero/JEllipsis'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'QuartzJobList', name: 'QuartzJobList',
mixins: [JeroListMixin], mixins: [JeroListMixin],
components: { components: {
QuartzJobModal, QuartzJobModal,
JEllipsis JEllipsis,
PageHeaderTitle
}, },
data() { data() {
return { return {
IconImg,
description: '定时任务在线管理', description: '定时任务在线管理',
// 查询条件 // 查询条件
queryParam: {}, queryParam: {},
@@ -150,7 +157,7 @@ export default {
title: '任务类名', title: '任务类名',
align: 'center', align: 'center',
dataIndex: 'jobClassName', dataIndex: 'jobClassName',
sorter: true, sorter: true
/* customRender:function (text) { /* customRender:function (text) {
return "*"+text.substring(9,text.length); return "*"+text.substring(9,text.length);
}*/ }*/
@@ -165,24 +172,24 @@ export default {
align: 'center', align: 'center',
width: 150, width: 150,
dataIndex: 'parameter', dataIndex: 'parameter',
scopedSlots: {customRender: 'parameterRender'}, scopedSlots: { customRender: 'parameterRender' }
}, },
{ {
title: '描述', title: '描述',
align: 'center', align: 'center',
width: 250, width: 250,
dataIndex: 'description', dataIndex: 'description',
scopedSlots: {customRender: 'description'}, scopedSlots: { customRender: 'description' }
}, },
{ {
title: '状态', title: '状态',
align: 'center', align: 'center',
dataIndex: 'status', dataIndex: 'status',
scopedSlots: {customRender: 'customRenderStatus'}, scopedSlots: { customRender: 'customRenderStatus' },
filterMultiple: false, filterMultiple: false,
filters: [ filters: [
{text: '已启动', value: '0'}, { text: '已启动', value: '0' },
{text: '已暂停', value: '-1'}, { text: '已暂停', value: '-1' }
] ]
}, },
{ {
@@ -190,7 +197,7 @@ export default {
dataIndex: 'action', dataIndex: 'action',
align: 'center', align: 'center',
width: 180, width: 180,
scopedSlots: {customRender: 'action'}, scopedSlots: { customRender: 'action' }
} }
], ],
url: { url: {
@@ -202,12 +209,12 @@ export default {
exportXlsUrl: 'sys/quartzJob/exportXls', exportXlsUrl: 'sys/quartzJob/exportXls',
importExcelUrl: 'sys/quartzJob/importExcel', importExcelUrl: 'sys/quartzJob/importExcel',
execute: 'sys/quartzJob/execute' execute: 'sys/quartzJob/execute'
}, }
} }
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
} }
}, },
@@ -233,7 +240,7 @@ export default {
title: '确认暂停', title: '确认暂停',
content: '是否暂停选中任务?', content: '是否暂停选中任务?',
onOk: function () { onOk: function () {
getAction(that.url.pause, {jobClassName: record.jobClassName}).then((res) => { getAction(that.url.pause, { jobClassName: record.jobClassName }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.loadData() that.loadData()
@@ -253,7 +260,7 @@ export default {
title: '确认启动', title: '确认启动',
content: '是否启动选中任务?', content: '是否启动选中任务?',
onOk: function () { onOk: function () {
getAction(that.url.resume, {jobClassName: record.jobClassName}).then((res) => { getAction(that.url.resume, { jobClassName: record.jobClassName }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.loadData() that.loadData()
@@ -272,7 +279,7 @@ export default {
title: '确认提示', title: '确认提示',
content: '是否立即执行任务?', content: '是否立即执行任务?',
onOk: function () { onOk: function () {
getAction(that.url.execute, {id: record.id}).then((res) => { getAction(that.url.execute, { id: record.id }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
that.loadData() that.loadData()
+84 -77
View File
@@ -1,32 +1,34 @@
<template> <template>
<a-card :bordered="false"> <div>
<!-- 查询区域 --> <page-header-title :img-for-icon="IconImg"></page-header-title>
<div class="table-page-search-wrapper"> <a-card :bordered="false">
<!-- 搜索区域 --> <!-- 查询区域 -->
<a-form layout="inline" @keyup.enter.native="searchQuery"> <div class="table-page-search-wrapper">
<a-row :gutter="24"> <!-- 搜索区域 -->
<a-col :md="6" :sm="12"> <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}"> <a-row :gutter="24">
<a-input placeholder="请输入角色名称" v-model="queryParam.roleName"></a-input> <a-col :md="6" :sm="12">
</a-form-item> <a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
</a-col> <a-input placeholder="请输入角色名称" v-model="queryParam.roleName"></a-input>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> </a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">
<a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search" style="margin-left: 21px">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="margin: 5px 0 10px 2px"> <div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:role:add'">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus" v-has="'sys:role:add'">新增</a-button>
<a-button @click="handleAddLowerLevel" type="primary" icon="plus">添加下级</a-button> <a-button @click="handleAddLowerLevel" type="primary" icon="plus">添加下级</a-button>
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button> <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<a-table <a-table
style="height:500px" style="height:500px"
ref="table" ref="table"
size="middle" size="middle"
@@ -45,24 +47,27 @@
<a @click="handleEdit(record)" v-has="'sys:role:edit'">编辑</a> <a @click="handleEdit(record)" v-has="'sys:role:edit'">编辑</a>
<a @click="handleDelete(record.id)" v-has="'sys:role:del'">删除</a> <a @click="handleDelete(record.id)" v-has="'sys:role:del'">删除</a>
</span> </span>
<template slot-scope="text" slot="text"> <template slot-scope="text" slot="text">
<j-ellipsis v-if="text" :length="20" :value="text"></j-ellipsis> <j-ellipsis v-if="text" :length="20" :value="text"></j-ellipsis>
<span v-else></span> <span v-else></span>
</template> </template>
</a-table> </a-table>
</div> </div>
<user-role-modal ref="modalUserRole"></user-role-modal> <user-role-modal ref="modalUserRole"></user-role-modal>
<role-modal ref="modalForm" @ok="modalFormOk" @clearSelect="onClearSelected"></role-modal> <role-modal ref="modalForm" @ok="modalFormOk" @clearSelect="onClearSelected"></role-modal>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import {postAction} from '@/api/manage' import { postAction } from '@/api/manage'
import RoleModal from './modules/RoleModal' import RoleModal from './modules/RoleModal'
import UserRoleModal from './modules/UserRoleModal' import UserRoleModal from './modules/UserRoleModal'
import JEllipsis from '@comp/jero/JEllipsis' import JEllipsis from '@comp/jero/JEllipsis'
import moment from 'moment' import moment from 'moment'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
@@ -72,58 +77,60 @@ export default {
UserRoleModal, UserRoleModal,
RoleModal, RoleModal,
JEllipsis, JEllipsis,
PageHeaderTitle
}, },
data() { data() {
return { return {
IconImg,
model1: {}, model1: {},
model2: {}, model2: {},
currentRoleId: '', currentRoleId: '',
selectedRowKeys: [], selectedRowKeys: [],
expandedRowKeys: [], expandedRowKeys: [],
columns: columns:
[ [
{ {
title: '角色编码', title: '角色编码',
align: 'center', align: 'center',
dataIndex: 'roleCode', dataIndex: 'roleCode',
width: 160, width: 160,
scopedSlots: {customRender: 'text'} scopedSlots: { customRender: 'text' }
}, },
{ {
title: '角色名称', title: '角色名称',
align: 'center', align: 'center',
dataIndex: 'roleName', dataIndex: 'roleName',
scopedSlots: {customRender: 'text'} scopedSlots: { customRender: 'text' }
}, },
{ {
title: '上级角色', title: '上级角色',
align: 'center', align: 'center',
dataIndex: 'parentName', dataIndex: 'parentName',
customRender(text) { customRender(text) {
if (text) { if (text) {
return text return text
}else { } else {
return '无' return '无'
}
} }
},
{
title: '创建时间',
dataIndex: 'createTime',
align: 'center',
sorter: true,
scopedSlots: {customRender: 'text'},
customRender: (text) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
}
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: {customRender: 'action'}
} }
], },
{
title: '创建时间',
dataIndex: 'createTime',
align: 'center',
sorter: true,
scopedSlots: { customRender: 'text' },
customRender: (text) => {
return moment(text).format('YYYY-MM-DD HH:mm:ss')
}
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
}
],
url: { url: {
list: '/sys/role/treeListPage', list: '/sys/role/treeListPage',
delete: '/sys/role/delete', delete: '/sys/role/delete',
@@ -139,7 +146,7 @@ export default {
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
} }
}, },
methods: { methods: {
@@ -207,7 +214,7 @@ export default {
}, },
handleExpandedRowsChange(expandedRows) { handleExpandedRowsChange(expandedRows) {
this.expandedRowKeys = expandedRows this.expandedRowKeys = expandedRows
}, }
} }
} }
</script> </script>
+302 -289
View File
@@ -1,336 +1,349 @@
<template> <template>
<a-card :bordered="false"> <div>
<page-header-title :img-for-icon="IconImg"></page-header-title>
<a-card :bordered="false">
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('分类字典')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('分类字典')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
<a-button type="primary" icon="import">导入</a-button> @change="handleImportExcel">
</a-upload> <a-button type="primary" icon="import">导入</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> </a-upload>
<a-menu slot="overlay"> <a-dropdown v-if="selectedRowKeys.length > 0">
<a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item> <a-menu slot="overlay">
</a-menu> <a-menu-item key="1" @click="batchDel">
<a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button> <a-icon type="delete"/>
</a-dropdown> 删除
</div> </a-menu-item>
</a-menu>
<!-- table区域-begin --> <a-button style="margin-left: 8px"> 批量操作
<div> <a-icon type="down"/>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> </a-button>
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a> </a-dropdown>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div> </div>
<a-table <!-- table区域-begin -->
ref="table" <div>
size="middle" <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
rowKey="id" <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
:columns="columns" style="font-weight: 600">{{ selectedRowKeys.length }}</a>
:dataSource="dataSource" <a style="margin-left: 24px" @click="onClearSelected">清空</a>
:pagination="ipagination" </div>
:loading="loading"
:expandedRowKeys="expandedRowKeys" <a-table
@change="handleTableChange" ref="table"
@expand="handleExpand" size="middle"
v-bind="tableProps"> rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:expandedRowKeys="expandedRowKeys"
@change="handleTableChange"
@expand="handleExpand"
v-bind="tableProps">
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
<a-divider type="vertical" /> <a-divider type="vertical"/>
<a @click="handleAddSub(record)">添加下级</a> <a @click="handleAddSub(record)">添加下级</a>
</span> </span>
</a-table> </a-table>
</div> </div>
<sysCategory-modal ref="modalForm" @ok="modalFormOk"></sysCategory-modal> <sysCategory-modal ref="modalForm" @ok="modalFormOk"></sysCategory-modal>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import { getAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { JeroListMixin } from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import SysCategoryModal from './modules/SysCategoryModal' import SysCategoryModal from './modules/SysCategoryModal'
import { deleteAction } from '@/api/manage' import { deleteAction } from '@/api/manage'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'SysCategoryList', name: 'SysCategoryList',
mixins:[JeroListMixin], mixins: [JeroListMixin],
components: { components: {
SysCategoryModal SysCategoryModal,
}, PageHeaderTitle
data () { },
return { data() {
description: '分类字典管理页面', return {
// 表头 IconImg,
columns: [ description: '分类字典管理页面',
{ // 表头
title:'分类名称', columns: [
align:'left', {
dataIndex: 'name' title: '分类名称',
}, align: 'left',
{ dataIndex: 'name'
title:'分类编码',
align:'left',
dataIndex: 'code'
},
{
title: '操作',
dataIndex: 'action',
align:'center',
scopedSlots: { customRender: 'action' },
}
],
url: {
list: '/sys/category/rootList',
childList: '/sys/category/childList',
getChildListBatch: '/sys/category/getChildListBatch',
delete: '/sys/category/delete',
deleteBatch: '/sys/category/deleteBatch',
exportXlsUrl: '/sys/category/exportXls',
importExcelUrl: 'sys/category/importExcel',
}, },
expandedRowKeys:[], {
hasChildrenField:'hasChild', title: '分类编码',
pidField:'pid', align: 'left',
dictOptions:{ dataIndex: 'code'
}, },
subExpandedKeys:[], {
} title: '操作',
}, dataIndex: 'action',
computed: { align: 'center',
importExcelUrl(){ scopedSlots: { customRender: 'action' }
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` }
],
url: {
list: '/sys/category/rootList',
childList: '/sys/category/childList',
getChildListBatch: '/sys/category/getChildListBatch',
delete: '/sys/category/delete',
deleteBatch: '/sys/category/deleteBatch',
exportXlsUrl: '/sys/category/exportXls',
importExcelUrl: 'sys/category/importExcel'
}, },
tableProps() { expandedRowKeys: [],
let _this = this hasChildrenField: 'hasChild',
return { pidField: 'pid',
// 列表项是否可选择 dictOptions: {},
rowSelection: { subExpandedKeys: []
selectedRowKeys: _this.selectedRowKeys, }
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys },
} computed: {
importExcelUrl() {
return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
},
tableProps() {
let _this = this
return {
// 列表项是否可选择
rowSelection: {
selectedRowKeys: _this.selectedRowKeys,
onChange: (selectedRowKeys) => _this.selectedRowKeys = selectedRowKeys
} }
} }
}
},
methods: {
loadData(arg) {
if (arg == 1) {
this.ipagination.current = 1
}
this.loading = true
let params = this.getQueryParams()
return new Promise(() => {
getAction(this.url.list, params).then(res => {
if (res.success) {
let result = res.result
if (Number(result.total) > 0) {
this.ipagination.total = Number(result.total)
this.dataSource = this.getDataByResult(res.result.records)
//update--begin--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
return this.loadDataByExpandedRows(this.dataSource)
//update--end--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
} else {
this.ipagination.total = 0
this.dataSource = []
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
})
}, },
methods: { getDataByResult(result) {
loadData(arg){ return result.map(item => {
if(arg==1){ //判断是否标记了带有子节点
this.ipagination.current=1 if (item[this.hasChildrenField] == '1') {
let loadChild = { id: item.id + '_loadChild', name: 'loading...', isLoading: true }
item.children = [loadChild]
} }
this.loading = true return item
let params = this.getQueryParams() })
return new Promise(() => { },
getAction(this.url.list,params).then(res=>{ handleExpand(expanded, record) {
if(res.success){ // 判断是否是展开状态
let result = res.result if (expanded) {
if(Number(result.total)>0){ this.expandedRowKeys.push(record.id)
this.ipagination.total = Number(result.total) if (record.children.length > 0 && record.children[0].isLoading === true) {
this.dataSource = this.getDataByResult(res.result.records) let params = this.getQueryParams()//查询条件
//update--begin--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息 params[this.pidField] = record.id
return this.loadDataByExpandedRows(this.dataSource) getAction(this.url.childList, params).then((res) => {
//update--end--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息 if (res.success) {
}else{ if (res.result && res.result.length > 0) {
this.ipagination.total=0 record.children = this.getDataByResult(res.result)
this.dataSource=[] this.dataSource = [...this.dataSource]
} else {
record.children = ''
record.hasChildrenField = '0'
} }
}else{ } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(()=>{
this.loading = false
}) })
}) }
}, } else {
getDataByResult(result){ let keyIndex = this.expandedRowKeys.indexOf(record.id)
return result.map(item=>{ if (keyIndex >= 0) {
//判断是否标记了带有子节点 this.expandedRowKeys.splice(keyIndex, 1)
if(item[this.hasChildrenField]=='1'){ }
let loadChild = { id: item.id+'_loadChild', name: 'loading...', isLoading: true } }
item.children = [loadChild] },
} initDictConfig() {
return item },
}) modalFormOk(formData, arr) {
}, if (!formData.id) {
handleExpand(expanded, record){ this.addOk(formData, arr)
// 判断是否是展开状态 } else {
if (expanded) { this.editOk(formData, this.dataSource)
this.expandedRowKeys.push(record.id) this.dataSource = [...this.dataSource]
if (record.children.length>0 && record.children[0].isLoading === true) { }
let params = this.getQueryParams()//查询条件 },
params[this.pidField] = record.id editOk(formData, arr) {
getAction(this.url.childList,params).then((res)=>{ if (arr && arr.length > 0) {
if(res.success){ for (let i = 0; i < arr.length; i++) {
if(res.result && res.result.length>0){ if (arr[i].id == formData.id) {
record.children = this.getDataByResult(res.result) arr[i] = formData
this.dataSource = [...this.dataSource] break
}else{ } else {
record.children='' this.editOk(formData, arr[i].children)
record.hasChildrenField='0'
}
}else{
this.$message.warning(res.message)
}
})
}
}else{
let keyIndex = this.expandedRowKeys.indexOf(record.id)
if(keyIndex>=0){
this.expandedRowKeys.splice(keyIndex, 1)
} }
} }
}, }
initDictConfig(){ },
}, async addOk(formData, arr) {
modalFormOk(formData,arr){ if (!formData[this.pidField]) {
if(!formData.id){ this.loadData()
this.addOk(formData,arr) } else {
}else{ this.expandedRowKeys = []
this.editOk(formData,this.dataSource) console.log('22222', arr)
this.dataSource=[...this.dataSource] for (let i of arr) {
await this.expandTreeNode(i)
} }
}, }
editOk(formData,arr){ },
if(arr && arr.length>0){ expandTreeNode(nodeId) {
for(let i=0;i<arr.length;i++){ return new Promise((resolve, reject) => {
if(arr[i].id==formData.id){ this.getFormDataById(nodeId, this.dataSource)
arr[i]=formData let row = this.parentFormData
break this.expandedRowKeys.push(nodeId)
}else{ let params = this.getQueryParams()//查询条件
this.editOk(formData,arr[i].children) params[this.pidField] = nodeId
} getAction(this.url.childList, params).then((res) => {
} console.log('11111', res)
} if (res.success) {
}, if (res.result && res.result.length > 0) {
async addOk(formData,arr){ row.children = this.getDataByResult(res.result)
if(!formData[this.pidField]){ this.dataSource = [...this.dataSource]
this.loadData() resolve()
}else{ } else {
this.expandedRowKeys=[] row.children = ''
console.log('22222',arr) row.hasChildrenField = '0'
for(let i of arr){
await this.expandTreeNode(i)
}
}
},
expandTreeNode(nodeId){
return new Promise((resolve,reject)=>{
this.getFormDataById(nodeId,this.dataSource)
let row = this.parentFormData
this.expandedRowKeys.push(nodeId)
let params = this.getQueryParams()//查询条件
params[this.pidField] = nodeId
getAction(this.url.childList,params).then((res)=>{
console.log('11111',res)
if(res.success){
if(res.result && res.result.length>0){
row.children = this.getDataByResult(res.result)
this.dataSource = [...this.dataSource]
resolve()
}else{
row.children=''
row.hasChildrenField='0'
reject()
}
}else{
reject() reject()
} }
})
})
},
getFormDataById(id,arr){
if(arr && arr.length>0){
for(let i=0;i<arr.length;i++){
if(arr[i].id==id){
this.parentFormData = arr[i]
}else{
this.getFormDataById(id,arr[i].children)
}
}
}
},
handleAddSub(record){
this.subExpandedKeys = []
this.getExpandKeysByPid(record.id,this.dataSource,this.dataSource)
this.$refs.modalForm.subExpandedKeys = this.subExpandedKeys
this.$refs.modalForm.title = '添加子分类'
this.$refs.modalForm.edit({'pid':record.id})
this.$refs.modalForm.disableSubmit = false
},
handleDelete: function (record) {
let that = this
deleteAction(that.url.delete, {id: record.id}).then((res) => {
if (res.success) {
//update--begin--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
that.loadData()
//update--end--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
} else { } else {
that.$message.warning(res.message) reject()
} }
}) })
}, })
// 添加子分类时获取所有父级id },
getExpandKeysByPid(pid,arr,all){ getFormDataById(id, arr) {
if(pid && arr && arr.length>0){ if (arr && arr.length > 0) {
for(let i=0;i<arr.length;i++){ for (let i = 0; i < arr.length; i++) {
if(arr[i].id==pid){ if (arr[i].id == id) {
this.subExpandedKeys.push(arr[i].id) this.parentFormData = arr[i]
this.getExpandKeysByPid(arr[i]['pid'],all,all) } else {
}else{ this.getFormDataById(id, arr[i].children)
this.getExpandKeysByPid(pid,arr[i].children,all)
}
} }
} }
}, }
// 根据已展开的行查询数据用于保存后刷新时异步加载子级的数据 },
loadDataByExpandedRows(dataList) { handleAddSub(record) {
if (this.expandedRowKeys.length > 0) { this.subExpandedKeys = []
return getAction(this.url.getChildListBatch,{ parentIds: this.expandedRowKeys.join(',') }).then(res=>{ this.getExpandKeysByPid(record.id, this.dataSource, this.dataSource)
if (res.success && res.result.records.length>0) { this.$refs.modalForm.subExpandedKeys = this.subExpandedKeys
//已展开的数据批量子节点 this.$refs.modalForm.title = '添加子分类'
let records = res.result.records this.$refs.modalForm.edit({ 'pid': record.id })
const listMap = new Map() this.$refs.modalForm.disableSubmit = false
for (let item of records) { },
let pid = item[this.pidField] handleDelete: function (record) {
if (this.expandedRowKeys.join(',').includes(pid)) { let that = this
let mapList = listMap.get(pid) deleteAction(that.url.delete, { id: record.id }).then((res) => {
if (mapList == null) { if (res.success) {
mapList = [] //update--begin--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
} that.loadData()
mapList.push(item) //update--end--autor:lvdandan-----date:20201204------forJT-31 删除成功后默认展开已展开信息
listMap.set(pid, mapList)
}
}
let childrenMap = listMap
let fn = (list) => {
if(list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else { } else {
return Promise.resolve() that.$message.warning(res.message)
} }
}, })
},
// 添加子分类时获取所有父级id
getExpandKeysByPid(pid, arr, all) {
if (pid && arr && arr.length > 0) {
for (let i = 0; i < arr.length; i++) {
if (arr[i].id == pid) {
this.subExpandedKeys.push(arr[i].id)
this.getExpandKeysByPid(arr[i]['pid'], all, all)
} else {
this.getExpandKeysByPid(pid, arr[i].children, all)
}
}
}
},
// 根据已展开的行查询数据(用于保存后刷新时异步加载子级的数据)
loadDataByExpandedRows(dataList) {
if (this.expandedRowKeys.length > 0) {
return getAction(this.url.getChildListBatch, { parentIds: this.expandedRowKeys.join(',') }).then(res => {
if (res.success && res.result.records.length > 0) {
//已展开的数据批量子节点
let records = res.result.records
const listMap = new Map()
for (let item of records) {
let pid = item[this.pidField]
if (this.expandedRowKeys.join(',').includes(pid)) {
let mapList = listMap.get(pid)
if (mapList == null) {
mapList = []
}
mapList.push(item)
listMap.set(pid, mapList)
}
}
let childrenMap = listMap
let fn = (list) => {
if (list) {
list.forEach(data => {
if (this.expandedRowKeys.includes(data.id)) {
data.children = this.getDataByResult(childrenMap.get(data.id))
fn(data.children)
}
})
}
}
fn(dataList)
}
})
} else {
return Promise.resolve()
}
} }
} }
}
</script> </script>
<style scoped> <style scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
</style> </style>
+56 -50
View File
@@ -1,66 +1,72 @@
<template> <template>
<a-card :bordered="false"> <div>
<a-form :form="form" class="form-box"> <page-header-title :img-for-icon="IconImg"></page-header-title>
<a-form-item label="频率" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-card :bordered="false">
<j-dict-select-tag <a-form :form="form" class="form-box">
v-decorator="['deptFrequency', validatorRules.deptFrequency]" <a-form-item label="频率" :labelCol="labelCol" :wrapperCol="wrapperCol">
:triggerChange="true" <j-dict-select-tag
placeholder="请选择频率" v-decorator="['deptFrequency', validatorRules.deptFrequency]"
dictCode="system_dept_frequency" :triggerChange="true"
@change="deptFrequencyChange"/> placeholder="请选择频率"
</a-form-item> dictCode="system_dept_frequency"
<a-form-item label="催款时间" :labelCol="labelCol" :wrapperCol="wrapperCol"> @change="deptFrequencyChange"/>
</a-form-item>
<a-form-item label="催款时间" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- 仅此一次年月日--> <!-- 仅此一次年月日-->
<j-date <j-date
v-if="selectDeptFrequency === '1'" v-if="selectDeptFrequency === '1'"
placeholder="请选择催款时间" placeholder="请选择催款时间"
style="width: 100%;" style="width: 100%;"
v-decorator="['deptTime', validatorRules.deptTime]" v-decorator="['deptTime', validatorRules.deptTime]"
:trigger-change="true" :trigger-change="true"
date-format="YYYY-MM-DD"/> date-format="YYYY-MM-DD"/>
<!-- 每年一次月日--> <!-- 每年一次月日-->
<div class="m-d"> <div class="m-d">
<!-- --> <!-- -->
<template v-if="selectDeptFrequency === '2'"> <template v-if="selectDeptFrequency === '2'">
<a-select <a-select
class="select-month" class="select-month"
placeholder="请选择月" placeholder="请选择月"
@change="handleChange" @change="handleChange"
v-decorator="['deptMonth', validatorRules.deptMonth]" v-decorator="['deptMonth', validatorRules.deptMonth]"
:options="monthOptions"> :options="monthOptions">
</a-select> </a-select>
</template> </template>
<!-- --> <!-- -->
<template v-if="selectDeptFrequency === '2' || selectDeptFrequency === '3'"> <template v-if="selectDeptFrequency === '2' || selectDeptFrequency === '3'">
<a-select <a-select
style="width: calc(50% - 8px)" style="width: calc(50% - 8px)"
placeholder="请选择日" placeholder="请选择日"
@change="handleChange" @change="handleChange"
v-decorator="['deptDay', validatorRules.deptDay]" v-decorator="['deptDay', validatorRules.deptDay]"
:options="dayOptions"> :options="dayOptions">
</a-select> </a-select>
</template> </template>
</div> </div>
</a-form-item> </a-form-item>
<a-form-item class="btn-form"> <a-form-item class="btn-form">
<a-button type="primary" class="btn-form-save">保存</a-button> <a-button type="primary" class="btn-form-save">保存</a-button>
<a-button class="btn-form-cancel">取消</a-button> <a-button class="btn-form-cancel">取消</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import JDate from '../../components/tools/JDate' import JDate from '../../components/tools/JDate'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
name: 'SystemDept', name: 'SystemDept',
components: { JDate }, components: { JDate, PageHeaderTitle },
data() { data() {
return { return {
IconImg,
form: this.$form.createForm(this), form: this.$form.createForm(this),
model: {}, model: {},
labelCol: { labelCol: {
+113 -104
View File
@@ -1,117 +1,123 @@
<template> <template>
<a-card :bordered="false"> <div>
<!-- 查询区域 --> <page-header-title :img-for-icon="IconImg"></page-header-title>
<div class="table-page-search-wrapper"> <a-card :bordered="false">
<a-form layout="inline" @keyup.enter.native="searchQuery"> <!-- 查询区域 -->
<a-row :gutter="24"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item label="用户账号"> <a-form-item label="用户账号">
<a-input placeholder="请输入用户账号" v-model="queryParam.username"></a-input> <a-input placeholder="请输入用户账号" v-model="queryParam.username"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item <a-form-item
label="角色类型" label="角色类型"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol"> :wrapperCol="wrapperCol">
<a-tree-select <a-tree-select
style="width:100%" style="width:100%"
:dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
:treeData="treeRoleData" :treeData="treeRoleData"
v-model="queryParam.roleId" v-model="queryParam.roleId"
placeholder="请选择角色类型" placeholder="请选择角色类型"
> >
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="12"> <a-col :md="6" :sm="12">
<a-form-item <a-form-item
label="组织机构" label="组织机构"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol"> :wrapperCol="wrapperCol">
<a-tree-select <a-tree-select
style="width:100%" style="width:100%"
:dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }" :dropdownStyle="{ maxHeight: '200px',maxWidth:'100px','overflow-x':'hidden',' overflo-y': 'auto' }"
:treeData="treeDepartData" :treeData="treeDepartData"
v-model="queryParam.departId" v-model="queryParam.departId"
placeholder="请选择组织机构"> placeholder="请选择组织机构">
</a-tree-select> </a-tree-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="8"> <a-col :md="6" :sm="8">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button> <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button> <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator" style="border-top: 5px"> <div class="table-operator" style="border-top: 5px">
<a-button @click="handleAdd" type="primary" icon="plus" v-has="'user:add'">新增</a-button> <a-button @click="handleAdd" type="primary" icon="plus" v-has="'user:add'">新增</a-button>
<a-button @click="downTemplate('用户导入模板')" type="primary" icon="download">下载模板</a-button> <a-button @click="downTemplate('用户导入模板')" type="primary" icon="download">下载模板</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel"> @change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button> <a-button type="primary" icon="import">导入</a-button>
</a-upload> </a-upload>
<a-button @click="handleExportXls('用户列表')" type="primary" icon="export">导出</a-button> <a-button @click="handleExportXls('用户列表')" type="primary" icon="export">导出</a-button>
<a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button> <a-button @click="batchDel" type="danger" icon="delete">批量删除</a-button>
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
<a-table <a-table
ref="table" ref="table"
bordered bordered
size="middle" size="middle"
rowKey="id" rowKey="id"
:scroll="{x:true}" :scroll="{x:true}"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
:pagination="ipagination" :pagination="ipagination"
:loading="loading" :loading="loading"
class="j-table-force-nowrap" class="j-table-force-nowrap"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
@change="handleTableChange"> @change="handleTableChange">
<span slot="action" class="action-span-cell" slot-scope="text, record"> <span slot="action" class="action-span-cell" slot-scope="text, record">
<!-- 1是启用 2是禁用 按钮需要反着来--> <!-- 1是启用 2是禁用 按钮需要反着来-->
<a @click="handleEnable(record)" :class="{'color-red':record.status === 1}">{{record.status === 1 ? '禁用' : '启用'}}</a> <a @click="handleEnable(record)"
:class="{'color-red':record.status === 1}">{{ record.status === 1 ? '禁用' : '启用' }}</a>
<a @click="handleEdit(record)" v-has="'user:edit'">编辑</a> <a @click="handleEdit(record)" v-has="'user:edit'">编辑</a>
<a @click="resetPassword(record)">重置密码</a> <a @click="resetPassword(record)">重置密码</a>
<a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a> <a @click="handleDelete(record.id)" v-has="'sys:user:del'">删除</a>
</span> </span>
<template slot="text" slot-scope="text"> <template slot="text" slot-scope="text">
<j-ellipsis v-if="text" :length="20" :value="text"></j-ellipsis> <j-ellipsis v-if="text" :length="20" :value="text"></j-ellipsis>
<span v-else></span> <span v-else></span>
</template> </template>
</a-table> </a-table>
</div> </div>
<!-- table区域-end --> <!-- table区域-end -->
<user-modal ref="modalForm" @ok="modalFormOk"></user-modal> <user-modal ref="modalForm" @ok="modalFormOk"></user-modal>
</a-card> </a-card>
</div>
</template> </template>
<script> <script>
import UserModal from './modules/UserModal' import UserModal from './modules/UserModal'
import {getAction, getFileAccessHttpUrl} from '@/api/manage' import { getAction, getFileAccessHttpUrl } from '@/api/manage'
import {frozenBatch} from '@api/api' import { frozenBatch } from '@api/api'
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
import {JeroListMixin} from '@/mixins/JeroListMixin' import { JeroListMixin } from '@/mixins/JeroListMixin'
import '@/assets/less/TableExpand.less' import '@/assets/less/TableExpand.less'
// import JInput from '@/components/jero/JInput' // import JInput from '@/components/jero/JInput'
import JEllipsis from '@comp/jero/JEllipsis' import JEllipsis from '@comp/jero/JEllipsis'
import {queryDepartTreeList, resetUserPassword} from '@api/api' import { queryDepartTreeList, resetUserPassword } from '@api/api'
import IconImg from '@/assets/imgs/icon/icon_system.png'
import PageHeaderTitle from '../../components/layouts/PageHeaderTitle'
export default { export default {
@@ -120,10 +126,12 @@ export default {
components: { components: {
UserModal, UserModal,
// JInput, // JInput,
JEllipsis JEllipsis,
PageHeaderTitle
}, },
data() { data() {
return { return {
IconImg,
description: '这是用户管理页面', description: '这是用户管理页面',
columns: [ columns: [
{ {
@@ -141,14 +149,14 @@ export default {
align: 'center', align: 'center',
dataIndex: 'username', dataIndex: 'username',
width: 120, width: 120,
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
{ {
title: '用户姓名', title: '用户姓名',
align: 'center', align: 'center',
width: 160, width: 160,
dataIndex: 'realname', dataIndex: 'realname',
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
// { // {
// title: "性别", // title: "性别",
@@ -162,21 +170,21 @@ export default {
align: 'center', align: 'center',
width: 160, width: 160,
dataIndex: 'phone', dataIndex: 'phone',
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
{ {
title: '角色', title: '角色',
align: 'center', align: 'center',
width: 100, width: 100,
dataIndex: 'roleName', dataIndex: 'roleName',
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
{ {
title: '组织机构', title: '组织机构',
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'departIds_dictText', dataIndex: 'departIds_dictText',
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
// { // {
// title: '生日', // title: '生日',
@@ -195,20 +203,20 @@ export default {
dataIndex: 'createTime', dataIndex: 'createTime',
align: 'center', align: 'center',
width: 170, width: 170,
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
{ {
title: '状态', title: '状态',
align: 'center', align: 'center',
width: 80, width: 80,
dataIndex: 'status_dictText', dataIndex: 'status_dictText',
scopedSlots: {customRender: 'text'}, scopedSlots: { customRender: 'text' }
}, },
{ {
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
scopedSlots: {customRender: 'action'}, scopedSlots: { customRender: 'action' },
align: 'center', align: 'center'
} }
], ],
// 组织机构 下拉数据 // 组织机构 下拉数据
@@ -216,15 +224,15 @@ export default {
// 角色类型下拉数据 // 角色类型下拉数据
treeRoleData: [], treeRoleData: [],
labelCol: { labelCol: {
xs: {span: 24}, xs: { span: 24 },
sm: {span: 5}, sm: { span: 5 }
}, },
wrapperCol: { wrapperCol: {
xs: {span: 20}, xs: { span: 20 },
sm: {span: 16}, sm: { span: 16 }
}, },
superQueryFieldList: [ superQueryFieldList: [
{type: 'input', value: 'username', text: '用户账号'} { type: 'input', value: 'username', text: '用户账号' }
], ],
url: { url: {
list: '/sys/user/pageRoleAndDepart', list: '/sys/user/pageRoleAndDepart',
@@ -242,7 +250,7 @@ export default {
}, },
computed: { computed: {
importExcelUrl() { importExcelUrl() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` return `${ window._CONFIG['domianURL'] }/${ this.url.importExcelUrl }`
} }
}, },
methods: { methods: {
@@ -281,7 +289,7 @@ export default {
* 重置密码 * 重置密码
* */ * */
resetPassword(record) { resetPassword(record) {
resetUserPassword({username: record.username}).then(res => { resetUserPassword({ username: record.username }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
} else { } else {
@@ -294,12 +302,12 @@ export default {
* */ * */
handleEnable(record) { handleEnable(record) {
let status let status
if(record.status === 1) { if (record.status === 1) {
status = 2 status = 2
}else if(record.status === 2){ } else if (record.status === 2) {
status = 1 status = 1
} }
frozenBatch({ids: record.id, status}).then(res => { frozenBatch({ ids: record.id, status }).then(res => {
if (res.success) { if (res.success) {
this.$message.success(res.message) this.$message.success(res.message)
this.loadData() this.loadData()
@@ -314,6 +322,7 @@ export default {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.color-red { .color-red {
color: red; color: red;
} }