This commit is contained in:
aoli.qu 2022-02-24 12:10:57 +08:00
parent fb6aecd22c
commit 205d81017e
10 changed files with 45 additions and 38 deletions

View File

@ -73,7 +73,7 @@ export default {
}, },
// //
fileSize:{ fileSize:{
type:Number, type:[Number, String],
default:500 default:500
}, },
}, },

View File

@ -10,7 +10,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData()}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -42,7 +42,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData()}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>

View File

@ -3,7 +3,7 @@
<a-tabs default-active-key="1" @change="tabsCallback"> <a-tabs default-active-key="1" @change="tabsCallback">
<a-tab-pane key="1" tab="单位部门信息"> <a-tab-pane key="1" tab="单位部门信息">
<div class="table-operator"> <div class="table-operator">
<a-button @click="$refs.orgForm.add(1)" icon="plus" type="primary" v-if="hasPerm('sys:org:add')">新增机构</a-button> <a-button @click="$refs.orgForm.add(1)" icon="plus" type="primary" v-if="hasPerm('sys:org:edit')">新增机构</a-button>
</div> </div>
<s-table <s-table
@ -17,8 +17,8 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a v-if="hasPerm('sys:org:edit')" @click="$refs.orgForm.edit(record)">编辑</a> <a v-if="hasPerm('sys:org:edit')" @click="$refs.orgForm.edit(record)">编辑</a>
<a-divider type="vertical" v-if="hasPerm('sys:org:edit') & hasPerm('sys:org:delete')"/> <a-divider type="vertical" v-if="hasPerm('sys:org:edit') & hasPerm('sys:org:del')"/>
<a-popconfirm v-if="hasPerm('sys:org:delete')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)"> <a-popconfirm v-if="hasPerm('sys:org:del')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
@ -27,7 +27,7 @@
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="项目工程信息" > <a-tab-pane key="2" tab="项目工程信息" >
<div class="table-operator"> <div class="table-operator">
<a-button @click="$refs.orgForm.add(2)" icon="plus" type="primary" v-if="hasPerm('sys:org:add')">新增项目</a-button> <a-button @click="$refs.orgForm.add(2)" icon="plus" type="primary" v-if="hasPerm('sys:org:edit')">新增项目</a-button>
</div> </div>
<s-table <s-table
@ -41,8 +41,8 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a v-if="hasPerm('sys:org:edit')" @click="$refs.orgForm.edit(record)">编辑</a> <a v-if="hasPerm('sys:org:edit')" @click="$refs.orgForm.edit(record)">编辑</a>
<a-divider type="vertical" v-if="hasPerm('sys:org:edit') & hasPerm('sys:org:delete')"/> <a-divider type="vertical" v-if="hasPerm('sys:org:edit') & hasPerm('sys:org:del')"/>
<a-popconfirm v-if="hasPerm('sys:org:delete')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)"> <a-popconfirm v-if="hasPerm('sys:org:del')" placement="topRight" title="确认删除?" @confirm="() => sysOrgDelete(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
@ -143,6 +143,7 @@
}) })
}, },
handleOk () { handleOk () {
console.log("handleok---orgList")
if (this.orgType === 1) { if (this.orgType === 1) {
this.$refs.table1.refresh() this.$refs.table1.refresh()
} else { } else {

View File

@ -40,7 +40,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData()}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -48,7 +48,7 @@
</a-card> </a-card>
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-operator"> <div class="table-operator">
<a-button @click="addPerson" icon="plus" type="primary" v-if="hasPerm('person:add')">新增人员</a-button> <a-button @click="addPerson" icon="plus" type="primary" v-if="hasPerm('person:edit')">新增人员</a-button>
<template v-if="orgType === 1"> <template v-if="orgType === 1">
<a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button> <a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button>

View File

@ -11,7 +11,7 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button @click="() => {queryParam = {}, this.loadData()}">重置</a-button> <a-button @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>

View File

@ -77,9 +77,10 @@
this.visible = true this.visible = true
}, },
edit(obj) { edit(obj) {
var _obj = obj
this.modalTitle = '修改角色' this.modalTitle = '修改角色'
this.visible = true this.visible = true
this.form = obj this.form = _obj
}, },
onSubmit(e) { onSubmit(e) {
this.$refs.ruleForm.validate(valid => { this.$refs.ruleForm.validate(valid => {
@ -88,6 +89,8 @@
roleEdit(this.form).then(res => { roleEdit(this.form).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.$message.success('编辑成功') this.$message.success('编辑成功')
this.$emit('ok')
this.onCancel() this.onCancel()
} else { } else {
this.$message.error('编辑失败:' + res.msg) this.$message.error('编辑失败:' + res.msg)
@ -110,6 +113,7 @@
}, },
onCancel() { onCancel() {
this.$refs.ruleForm.resetFields() this.$refs.ruleForm.resetFields()
this.form = {}
this.visible = false this.visible = false
} }
} }

View File

@ -11,16 +11,16 @@
</a-col> </a-col>
<a-col :md="8" :sm="24"> <a-col :md="8" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button @click="() => {queryParam = {}, this.loadData()}">重置</a-button> <a-button @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
<div class="table-operator"> <div class="table-operator">
<a-button type="primary" icon="plus" @click="$refs.roleForm.add()">新增角色</a-button> <a-button type="primary" icon="plus" v-if="hasPerm('sys:role:add')" @click="$refs.roleForm.add()">新增角色</a-button>
</div> </div>
<s-table <s-table
ref="table" ref="table"
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
@ -28,17 +28,17 @@
:data="loadData" :data="loadData"
> >
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<a @click="$refs.roleForm.edit(record)">编辑</a> <a @click="$refs.roleForm.edit(record)" v-if="hasPerm('sys:role:edit')">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
更多 <a-icon type="down" /> 更多 <a-icon type="down" />
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item v-if="hasPerm('sys:role:grantMenu')">
<a @click="$refs.roleMenuForm.roleMenu(record)">授权菜单</a> <a @click="$refs.roleMenuForm.roleMenu(record)">授权菜单</a>
</a-menu-item> </a-menu-item>
<a-menu-item> <a-menu-item v-if="hasPerm('sys:role:del')">
<a-popconfirm placement="topRight" title="确认删除?" @confirm="() => handleDel(record)"> <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => handleDel(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
@ -83,12 +83,6 @@ export default {
{ {
title: '排序', title: '排序',
dataIndex: 'sort' dataIndex: 'sort'
},
{
title: '操作',
dataIndex: 'action',
width: '150px',
scopedSlots: { customRender: 'action' }
} }
], ],
loadData: parameter => { loadData: parameter => {
@ -99,7 +93,15 @@ export default {
} }
}, },
created () { created () {
// //
if (this.hasPerm('sys:role:edit') || this.hasPerm('sys:role:grantMenu')) {
this.columns.push({
title: '操作',
width: '150px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
})
}
}, },
methods: { methods: {
handleDel (record) { handleDel (record) {

View File

@ -91,9 +91,9 @@
_this.menuTreeData = res.data _this.menuTreeData = res.data
_this.getLeastChilds(res.data) _this.getLeastChilds(res.data)
// //
_this.menuTreeData.forEach(item => { // _this.menuTreeData.forEach(item => {
_this.expandedKeys.push(item.id) // _this.expandedKeys.push(item.id)
}) // })
_this.expandedMenuKeys(_this.roleEntity) _this.expandedMenuKeys(_this.roleEntity)
} }

View File

@ -51,13 +51,13 @@
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col>
<a-col :md="12" :sm="24"> <!-- <a-col :md="12" :sm="24">
<a-form :form="form"> <a-form :form="form">
<a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback> <a-form-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-date-picker placeholder="请选择生日" @change="onChange" style="width: 100%" v-decorator="['birthday']" /> <a-date-picker placeholder="请选择生日" @change="onChange" style="width: 100%" v-decorator="['birthday']" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-col> </a-col> -->
</a-row> </a-row>
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="12" :sm="24"> <a-col :md="12" :sm="24">

View File

@ -5,13 +5,13 @@
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="用户名称" > <a-form-item label="账号" >
<a-input v-model="queryParam.name" placeholder="请输入用户名称"/> <a-input v-model="queryParam.userName" placeholder="请输入账号"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="账号" > <a-form-item label="姓名" >
<a-input v-model="queryParam.userName" placeholder="请输入账号"/> <a-input v-model="queryParam.name" placeholder="请输入姓名"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
@ -21,7 +21,7 @@
</a-col> </a-col>
<a-col :md="4" :sm="24"> <a-col :md="4" :sm="24">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, $refs.table.refresh(true)}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
@ -61,7 +61,7 @@
<a-menu-item v-if="hasPerm('sys:user:grantRole')"> <a-menu-item v-if="hasPerm('sys:user:grantRole')">
<a @click="$refs.userRoleForm.userRole(record)">授权角色</a> <a @click="$refs.userRoleForm.userRole(record)">授权角色</a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="hasPerm('sys:user:delete')"> <a-menu-item v-if="hasPerm('sys:user:del')">
<a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)"> <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => singleDelete(record)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>