代码重提交

This commit is contained in:
Xubx 2024-10-11 20:46:12 +08:00
parent cfaa6acf1f
commit fed3b04152
12 changed files with 878 additions and 910 deletions

View File

@ -18,7 +18,7 @@
<route-view></route-view>
</div>
<div class="footer">
<!-- <div class="footer">
<div class="links">
<a href="https://www.baidu.com" target="_blank">帮助</a>
<a href="https://www.bing.com" target="_blank">隐私</a>
@ -28,7 +28,7 @@
Copyright &copy; <a href="https://www.baidu.com" target="_blank">哈尔滨师范大学人工智能大数据实验室</a> All
right reserved
</div>
</div>
</div> -->
</div>
</div>
</template>

View File

@ -38,7 +38,7 @@
<span v-if="isDesktop()">欢迎您{{ nickname() }}</span>
</span>
<a-menu slot="overlay" class="user-dropdown-menu-wrapper">
<a-menu-item key="0">
<!-- <a-menu-item key="0">
<router-link :to="{ name: 'account-center' }">
<a-icon type="user"/>
<span>个人中心</span>
@ -53,15 +53,15 @@
<a-menu-item key="3" @click="systemSetting">
<a-icon type="tool"/>
<span>系统设置</span>
</a-menu-item>
</a-menu-item> -->
<a-menu-item key="4" @click="updatePassword">
<a-icon type="setting"/>
<span>密码修改</span>
</a-menu-item>
<a-menu-item key="5" @click="updateCurrentDepart">
<!-- <a-menu-item key="5" @click="updateCurrentDepart">
<a-icon type="cluster"/>
<span>切换部门</span>
</a-menu-item>
</a-menu-item> -->
<a-menu-item key="6" @click="clearCache">
<a-icon type="sync"/>
<span>清理缓存</span>

View File

@ -151,9 +151,6 @@ export default {
},
drawPie() {
let myChart = this.$echarts.init(document.getElementById("pie"));
let option = {
title: {
text: "领用单位资产数统计",

View File

@ -39,15 +39,16 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('家具信息表(学院)')">导出</a-button>
<a-button @click="handleAdd" v-has="'furnitureCollege:add'" type="primary" icon="plus">新增</a-button>
<a-button type="primary" v-has="'furnitureCollege:export'" icon="download"
@click="handleExportXls('家具信息表(学院)')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'furnitureCollege:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -78,7 +79,8 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'furnitureCollege:history'" icon="zoom-in"
@click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->
@ -124,13 +126,14 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<div v-has="'furnitureCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
</div>
<a @click="handleDetail(record)">详情</a>
</span>

View File

@ -39,15 +39,15 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('家具信息表')">导出</a-button>
<a-button @click="handleAdd" v-has="'furniture:add'" type="primary" icon="plus">新增</a-button>
<a-button type="primary" v-has="'furniture:export'" icon="download" @click="handleExportXls('家具信息表')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'furniture:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -78,7 +78,7 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'furniture:history'" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->

View File

@ -39,15 +39,16 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('仪器信息表(学院)')">导出</a-button>
<a-button @click="handleAdd" v-has="'instrumentCollege:add'" type="primary" icon="plus">新增</a-button>
<a-button type="primary" v-has="'instrumentCollege:export'" icon="download"
@click="handleExportXls('仪器信息表(学院)')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'instrumentCollege:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -78,7 +79,8 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'instrumentCollege:history'" icon="zoom-in"
@click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->
@ -118,13 +120,14 @@
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<div v-has="'instrumentCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
</div>
<a @click="handleDetail(record)">详情</a>
</span>
</a-table>

View File

@ -39,15 +39,15 @@
</div>
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('仪器信息表(学院)')">导出</a-button>
<a-button @click="handleAdd" v-has="'instrument:add'" type="primary" icon="plus">新增</a-button>
<a-button type="primary" v-has="'instrument:export'" icon="download" @click="handleExportXls('仪器信息表(学院)')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'instrument:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -78,7 +78,7 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'instrument:history'" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->

View File

@ -39,13 +39,14 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button @click="handleAdd" v-has="'intangibleCollege:add'" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="AddData()" type="primary" icon="plus">导数据</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('无形资产(学院)')">导出</a-button>
<a-button type="primary" v-has="'intangibleCollege:export'" icon="download"
@click="handleExportXls('无形资产(学院)')">导出</a-button>
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'intangibleCollege:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -76,7 +77,8 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'intangibleCollege:history'" icon="zoom-in"
@click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->
@ -130,13 +132,14 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
<div v-has="'intangibleCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical" />
</div>
<a @click="handleDetail(record)">详情</a>
</span>
@ -154,7 +157,7 @@ import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import RmsIntangibleCollegeModal from './modules/RmsIntangibleCollegeModal.vue'
import { getAction, postAction} from '@/api/manage'
import { getAction, postAction } from '@/api/manage'
import RmsLocationModal from '../LocationList/modules/RmsLocationModal'
import locationaTree from '../components/locationaTree'
export default {
@ -702,8 +705,8 @@ export default {
}
this.ContrastData = this.NewTempDifferentData;
},
//
showLocalData() {
//
showLocalData() {
this.ContrastData = this.NotNewRmsData;
console.log(this.ContrastData)
this.tableTitle = "本地的新增数据:";

View File

@ -39,17 +39,17 @@
<!-- 操作按钮区域 -->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button @click="handleAdd" v-has="'intangible:add'" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="AddData()" type="primary" icon="plus">导数据</a-button> -->
<a-button type="primary" icon="download" @click="handleExportXls('无形资产')">导出</a-button>
<a-button type="primary" v-has="'intangible:export'" icon="download" @click="handleExportXls('无形资产')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload> -->
<a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData">
<a-button type="primary" icon="import">导入</a-button>
<a-button type="primary" v-has="'intangible:import'" icon="import">导入</a-button>
<a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -80,7 +80,7 @@
</div>
</a-modal>
</a-upload>
<a-button type="primary" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-button type="primary" v-has="'intangible:history'" icon="zoom-in" @click="showHistoryModal">历史数据</a-button>
<a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content">
<!-- 在这里显示历史数据 -->

View File

@ -8,7 +8,7 @@
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="12" :sm="8">
<a-form-item label="角色名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-form-item label="角色名称" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
<a-input placeholder="" v-model="queryParam.roleName"></a-input>
</a-form-item>
</a-col>
@ -22,11 +22,11 @@
</a-col>
-->
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
<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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
@ -34,7 +34,8 @@
<div class="table-operator" style="margin: 5px 0 10px 2px">
<a-button @click="handleAdd" type="primary" icon="plus">新建角色</a-button>
<!--<a-button @click="handleEdit(model1)" type="primary" icon="plus">角色编辑</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"
@change="handleImportExcel">
<a-button type="primary" icon="import">导入</a-button>
</a-upload>
<a-button type="primary" icon="download" @click="handleExportXls('角色管理')">导出</a-button>
@ -47,41 +48,21 @@
</div>
<div style="margin-top: 15px">
<a-table
style="height:500px"
ref="table"
size="middle"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type:'radio'}"
<a-table style="height:500px" ref="table" size="middle" bordered rowKey="id" :columns="columns"
:dataSource="dataSource" :pagination="ipagination" :loading="loading"
:rowSelection="{ selectedRowKeys: selectedRowKeys1, onChange: onSelectChange1, type: 'radio' }"
@change="handleTableChange">
<span slot="action" slot-scope="text, record">
<a @click="handleOpen(record)">用户</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handlePerssion(record.id)">授权</a>
</a-menu-item>
<a-menu-item>
<a @click="handleEdit(record)">编辑</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<span slot="action" slot-scope="text, record">
<a @click="handleOpen(record)">用户</a>
<a-divider type="vertical" />
<a @click="handlePerssion(record.id)">授权</a>
<a-divider type="vertical" />
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</div>
<!-- 右侧的角色权限配置 -->
@ -105,12 +86,12 @@
</a-form-item>
</a-col>
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="9" :sm="24">
<a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
<a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
<a-col :md="9" :sm="24">
<a-button type="primary" @click="searchQuery2" icon="search" style="margin-left: 21px">查询</a-button>
<a-button type="primary" @click="searchReset2" icon="reload" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</span>
</a-row>
</a-form>
</div>
@ -123,12 +104,12 @@
<a-dropdown v-if="selectedRowKeys2.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1" @click="batchDel2">
<a-icon type="delete"/>
<a-icon type="delete" />
取消关联
</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
<a-icon type="down" />
</a-button>
</a-dropdown>
</div>
@ -136,37 +117,28 @@
<div>
<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">{{
selectedRowKeys2.length }}</a>
selectedRowKeys2.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected2">清空</a>
</div>
<a-table
style="height:500px"
ref="table2"
bordered
size="middle"
rowKey="id"
:columns="columns2"
:dataSource="dataSource2"
:pagination="ipagination2"
:loading="loading2"
:rowSelection="{selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2}"
@change="handleTableChange2">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit2(record)">编辑</a>
<a-divider type="vertical"/>
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定取消关联吗?" @confirm="() => handleDelete2(record.id)">
<a>取消关联</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
<a-table style="height:500px" ref="table2" bordered size="middle" rowKey="id" :columns="columns2"
:dataSource="dataSource2" :pagination="ipagination2" :loading="loading2"
:rowSelection="{ selectedRowKeys: selectedRowKeys2, onChange: onSelectChange2 }" @change="handleTableChange2">
<span slot="action" slot-scope="text, record">
<a @click="handleEdit2(record)">编辑</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">
更多 <a-icon type="down" />
</a>
<a-menu slot="overlay">
<a-menu-item>
<a-popconfirm title="确定取消关联吗?" @confirm="() => handleDelete2(record.id)">
<a>取消关联</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span>
</a-table>
</div>
<!-- 表单区域 -->
@ -178,368 +150,369 @@
</a-row>
</template>
<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
import { filterObj } from '@/utils/util'
import UserRoleModal from './modules/UserRoleModal'
import moment from 'moment'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { deleteAction, postAction, getAction } from '@/api/manage'
import SelectUserModal from './modules/SelectUserModal'
import RoleModal from './modules/RoleModal'
import UserModal from './modules/UserModal'
import { filterObj } from '@/utils/util'
import UserRoleModal from './modules/UserRoleModal'
import moment from 'moment'
export default {
name: 'RoleUserList',
mixins: [JeecgListMixin],
components: {
UserRoleModal,
SelectUserModal,
RoleModal,
UserModal,
moment
},
data() {
return {
model1: {},
model2: {},
currentRoleId: '',
queryParam1: {},
queryParam2: {},
dataSource1: [],
dataSource2: [],
ipagination1: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
export default {
name: 'RoleUserList',
mixins: [JeecgListMixin],
components: {
UserRoleModal,
SelectUserModal,
RoleModal,
UserModal,
moment
},
data() {
return {
model1: {},
model2: {},
currentRoleId: '',
queryParam1: {},
queryParam2: {},
dataSource1: [],
dataSource2: [],
ipagination1: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
ipagination2: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter1: {
column: 'createTime',
order: 'desc'
},
isorter2: {
column: 'createTime',
order: 'desc'
},
filters1: {},
filters2: {},
loading1: false,
loading2: false,
selectedRowKeys1: [],
selectedRowKeys2: [],
selectionRows1: [],
selectionRows2: [],
test: {},
rightcolval: 0,
columns:
[
{
title: '角色编码',
align: 'center',
dataIndex: 'roleCode'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
ipagination2: {
current: 1,
pageSize: 10,
pageSizeOptions: ['10', '20', '30'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' 共' + total + '条'
{
title: '角色名称',
align: 'center',
dataIndex: 'roleName'
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
isorter1: {
column: 'createTime',
order: 'desc'
},
isorter2: {
column: 'createTime',
order: 'desc'
},
filters1: {},
filters2: {},
loading1: false,
loading2: false,
selectedRowKeys1: [],
selectedRowKeys2: [],
selectionRows1: [],
selectionRows2: [],
test:{},
rightcolval:0,
columns:
[
{
title: '角色编码',
align: 'center',
dataIndex: 'roleCode'
},
{
title: '角色名称',
align: 'center',
dataIndex: 'roleName'
},
{
title: '创建时间',
dataIndex: 'createTime',
align:"center",
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')
}
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
scopedSlots: { customRender: 'action' }
{
title: '创建时间',
dataIndex: 'createTime',
align: "center",
sorter: true,
customRender: (text) => {
return moment(text).format('YYYY-MM-DD')
}
],
columns2: [{
title: '用户账号',
align: 'center',
dataIndex: 'username',
width: 120
},
{
title: '用户名称',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: '状态',
align: 'center',
width: 80,
dataIndex: 'status_dictText'
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120
}],
//
superQueryParams2: '',
//
superQueryMatchType2: 'and',
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
list2: '/sys/user/userRoleList',
addUserRole: '/sys/user/addSysUserRole',
delete2: '/sys/user/deleteUserRole',
deleteBatch2: '/sys/user/deleteUserRoleBatch',
exportXlsUrl: 'sys/role/exportXls',
importExcelUrl: 'sys/role/importExcel'
}
}
},
computed: {
importExcelUrl: function() {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
leftColMd() {
return this.selectedRowKeys1.length === 0 ? 24 : 12
},
rightColMd() {
return this.selectedRowKeys1.length === 0 ? 0 : 12
}
},
methods: {
onSelectChange2(selectedRowKeys, selectionRows) {
this.selectedRowKeys2 = selectedRowKeys
this.selectionRows2 = selectionRows
},
onClearSelected2() {
this.selectedRowKeys2 = []
this.selectionRows2 = []
},
onClearSelected1() {
this.selectedRowKeys1 = []
this.selectionRows1 = []
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.rightcolval = 1
this.selectedRowKeys1 = selectedRowKeys
this.selectionRows1 = selectionRows
this.model1 = Object.assign({}, selectionRows[0])
console.log(this.model1)
this.currentRoleId = selectedRowKeys[0]
this.loadData2()
},
onClearSelected() {
},
getQueryParams2() {
//
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
sqp['superQueryMatchType'] = this.superQueryMatchType2
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()
param.pageNo = this.ipagination2.current
param.pageSize = this.ipagination2.pageSize
return filterObj(param)
},
getQueryField2() {
//TODO
var str = 'id,'
this.columns2.forEach(function(value) {
str += ',' + value.dataIndex
})
return str
},
handleEdit2: function(record) {
this.$refs.modalForm2.title = '编辑'
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.edit(record)
},
handleAdd2: function() {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.title = '新增'
this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId})
}
},
modalFormOk2() {
// /
this.loadData2()
},
loadData2(arg) {
if (!this.url.list2) {
this.$message.error('请设置url.list2属性!')
return
}
// 1
if (arg === 1) {
this.ipagination2.current = 1
}
if (this.currentRoleId === '') return
let params = this.getQueryParams2()//
params.roleId = this.currentRoleId
this.loading2 = true
getAction(this.url.list2, params).then((res) => {
if (res.success) {
this.dataSource2 = res.result.records
this.ipagination2.total = res.result.total
scopedSlots: { customRender: 'action' }
}
this.loading2 = false
})
],
columns2: [{
title: '用户账号',
align: 'center',
dataIndex: 'username',
width: 120
},
{
title: '用户名称',
align: 'center',
width: 100,
dataIndex: 'realname'
},
{
title: '状态',
align: 'center',
width: 80,
dataIndex: 'status_dictText'
},
},
handleDelete1: function(id) {
this.handleDelete(id)
this.dataSource2 = []
this.currentRoleId = ''
},
handleDelete2: function(id) {
if (!this.url.delete2) {
this.$message.error('请设置url.delete2属性!')
return
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' },
align: 'center',
width: 120
}],
//
superQueryParams2: '',
//
superQueryMatchType2: 'and',
url: {
list: '/sys/role/list',
delete: '/sys/role/delete',
list2: '/sys/user/userRoleList',
addUserRole: '/sys/user/addSysUserRole',
delete2: '/sys/user/deleteUserRole',
deleteBatch2: '/sys/user/deleteUserRoleBatch',
exportXlsUrl: 'sys/role/exportXls',
importExcelUrl: 'sys/role/importExcel'
}
}
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
},
leftColMd() {
return this.selectedRowKeys1.length === 0 ? 24 : 12
},
rightColMd() {
return this.selectedRowKeys1.length === 0 ? 0 : 12
}
},
methods: {
onSelectChange2(selectedRowKeys, selectionRows) {
this.selectedRowKeys2 = selectedRowKeys
this.selectionRows2 = selectionRows
},
onClearSelected2() {
this.selectedRowKeys2 = []
this.selectionRows2 = []
},
onClearSelected1() {
this.selectedRowKeys1 = []
this.selectionRows1 = []
},
onSelectChange1(selectedRowKeys, selectionRows) {
this.rightcolval = 1
this.selectedRowKeys1 = selectedRowKeys
this.selectionRows1 = selectionRows
this.model1 = Object.assign({}, selectionRows[0])
console.log(this.model1)
this.currentRoleId = selectedRowKeys[0]
this.loadData2()
},
onClearSelected() {
},
getQueryParams2() {
//
let sqp = {}
if (this.superQueryParams2) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams2)
sqp['superQueryMatchType'] = this.superQueryMatchType2
}
var param = Object.assign(sqp, this.queryParam2, this.isorter2, this.filters2)
param.field = this.getQueryField2()
param.pageNo = this.ipagination2.current
param.pageSize = this.ipagination2.pageSize
return filterObj(param)
},
getQueryField2() {
//TODO
var str = 'id,'
this.columns2.forEach(function (value) {
str += ',' + value.dataIndex
})
return str
},
handleEdit2: function (record) {
this.$refs.modalForm2.title = '编辑'
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.edit(record)
},
handleAdd2: function () {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.title = '新增'
this.$refs.modalForm2.edit({ activitiSync: '1', userIdentity: 1, selectedroles: this.currentRoleId })
}
},
modalFormOk2() {
// /
this.loadData2()
},
loadData2(arg) {
if (!this.url.list2) {
this.$message.error('请设置url.list2属性!')
return
}
// 1
if (arg === 1) {
this.ipagination2.current = 1
}
if (this.currentRoleId === '') return
let params = this.getQueryParams2()//
params.roleId = this.currentRoleId
this.loading2 = true
getAction(this.url.list2, params).then((res) => {
if (res.success) {
this.dataSource2 = res.result.records
this.ipagination2.total = res.result.total
}
this.loading2 = false
})
},
handleDelete1: function (id) {
this.handleDelete(id)
this.dataSource2 = []
this.currentRoleId = ''
},
handleDelete2: function (id) {
if (!this.url.delete2) {
this.$message.error('请设置url.delete2属性!')
return
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
} else {
that.$message.warning(res.message)
}
})
},
batchDel2: function () {
if (!this.url.deleteBatch2) {
this.$message.error('请设置url.deleteBatch2属性!')
return
}
if (this.selectedRowKeys2.length <= 0) {
this.$message.warning('请选择一条记录!')
return
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys2.length; a++) {
ids += this.selectedRowKeys2[a] + ','
}
var that = this
deleteAction(that.url.delete2, { roleId: this.currentRoleId, userId: id }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
} else {
that.$message.warning(res.message)
console.log(this.currentDeptId)
this.$confirm({
title: '确认取消关联',
content: '是否删除选中数据?',
onOk: function () {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
},
batchDel2: function() {
}
},
selectOK(data) {
let params = {}
params.roleId = this.currentRoleId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
postAction(this.url.addUserRole, params).then((res) => {
if (res.success) {
this.loadData2()
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
if (!this.url.deleteBatch2) {
this.$message.error('请设置url.deleteBatch2属性!')
return
}
if (this.selectedRowKeys2.length <= 0) {
this.$message.warning('请选择一条记录!')
return
} else {
var ids = ''
for (var a = 0; a < this.selectedRowKeys2.length; a++) {
ids += this.selectedRowKeys2[a] + ','
}
var that = this
console.log(this.currentDeptId)
this.$confirm({
title: '确认取消关联',
content: '是否删除选中数据?',
onOk: function() {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) {
that.$message.success(res.message)
that.loadData2()
that.onClearSelected()
} else {
that.$message.warning(res.message)
}
})
}
})
}
},
selectOK(data) {
let params = {}
params.roleId = this.currentRoleId
params.userIdList = []
for (var a = 0; a < data.length; a++) {
params.userIdList.push(data[a])
}
console.log(params)
postAction(this.url.addUserRole, params).then((res) => {
if (res.success) {
this.loadData2()
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
},
handleAddUserRole() {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.selectUserModal.visible = true
}
},
handleOpen(record) {
this.rightcolval = 1
this.selectedRowKeys1 = [record.id]
this.model1 = Object.assign({}, record)
this.currentRoleId = record.id
this.onClearSelected2()
this.loadData2()
},
/*handleEdit: function(record) {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '编辑'
}
},*/
searchQuery2() {
this.loadData2(1)
},
searchReset2() {
this.queryParam2 = {}
this.loadData2(1)
},
handleTableChange2(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter2.column = sorter.field
this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
}
this.ipagination2 = pagination
this.loadData2()
},
hideUserList(){
//this.rightcolval = 0
this.selectedRowKeys1 = []
},
handlePerssion(roleId){
this.$refs.modalUserRole.show(roleId);
},
}
handleAddUserRole() {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.selectUserModal.visible = true
}
},
handleOpen(record) {
this.rightcolval = 1
this.selectedRowKeys1 = [record.id]
this.model1 = Object.assign({}, record)
this.currentRoleId = record.id
this.onClearSelected2()
this.loadData2()
},
/*handleEdit: function(record) {
if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!')
} else {
this.$refs.modalForm.edit(record)
this.$refs.modalForm.title = '编辑'
}
},*/
searchQuery2() {
this.loadData2(1)
},
searchReset2() {
this.queryParam2 = {}
this.loadData2(1)
},
handleTableChange2(pagination, filters, sorter) {
//
//TODO
if (Object.keys(sorter).length > 0) {
this.isorter2.column = sorter.field
this.isorter2.order = 'ascend' == sorter.order ? 'asc' : 'desc'
}
this.ipagination2 = pagination
this.loadData2()
},
hideUserList() {
//this.rightcolval = 0
this.selectedRowKeys1 = []
},
handlePerssion(roleId) {
this.$refs.modalUserRole.show(roleId);
},
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
/** Button按钮间距 */
.ant-btn {
margin-left: 8px
}
/** Button按钮间距 */
.ant-btn {
margin-left: 8px
}
</style>

View File

@ -13,7 +13,7 @@
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<!-- <a-col :md="6" :sm="8">
<a-form-item label="性别">
<a-select v-model="queryParam.sex" placeholder="请选择性别">
<a-select-option value="">请选择</a-select-option>
@ -21,15 +21,15 @@
<a-select-option value="2"></a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-col> -->
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<!-- <template v-if="toggleSearchStatus"> -->
<!-- <a-col :md="6" :sm="8">
<a-form-item label="真实名字">
<a-input placeholder="请输入真实名字" v-model="queryParam.realname"></a-input>
</a-form-item>
</a-col>
</a-col> -->
<a-col :md="6" :sm="8">
<a-form-item label="手机号码">
@ -37,7 +37,7 @@
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<!-- <a-col :md="6" :sm="8">
<a-form-item label="用户状态">
<a-select v-model="queryParam.status" placeholder="请选择">
<a-select-option value="">请选择</a-select-option>
@ -45,17 +45,17 @@
<a-select-option value="2">冻结</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
</a-col> -->
<!-- </template> -->
<a-col :md="6" :sm="8">
<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="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<a @click="handleToggleSearch" style="margin-left: 8px">
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
</a>
</a> -->
</span>
</a-col>
@ -238,19 +238,19 @@
scopedSlots: {customRender: "avatarslot"}
},
{
title: '性别',
align: "center",
width: 80,
dataIndex: 'sex_dictText',
sorter: true
},
{
title: '生日',
align: "center",
width: 100,
dataIndex: 'birthday'
},
// {
// title: '',
// align: "center",
// width: 80,
// dataIndex: 'sex_dictText',
// sorter: true
// },
// {
// title: '',
// align: "center",
// width: 100,
// dataIndex: 'birthday'
// },
{
title: '手机号码',
align: "center",
@ -263,12 +263,12 @@
width: 180,
dataIndex: 'orgCodeTxt'
},
{
title: '负责部门',
align: "center",
width: 180,
dataIndex: 'departIds_dictText'
},
// {
// title: '',
// align: "center",
// width: 180,
// dataIndex: 'departIds_dictText'
// },
{
title: '状态',
align: "center",

View File

@ -1,13 +1,6 @@
<template>
<a-drawer
:title="title"
:maskClosable="true"
:width="drawerWidth"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;">
<a-drawer :title="title" :maskClosable="true" :width="drawerWidth" placement="right" :closable="true"
@close="handleCancel" :visible="visible" style="height: 100%;">
<template slot="title">
<div style="width: 100%;">
@ -23,16 +16,16 @@
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item label="用户账号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="username">
<a-input placeholder="请输入用户账号" v-model="model.username" :readOnly="!!model.id"/>
<a-input placeholder="请输入用户账号" v-model="model.username" :readOnly="!!model.id" />
</a-form-model-item>
<template v-if="!model.id">
<a-form-model-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="password" >
<a-form-model-item label="登录密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="password">
<a-input type="password" placeholder="请输入登录密码" v-model="model.password" />
</a-form-model-item>
<a-form-model-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmpassword" >
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登录密码" v-model="model.confirmpassword"/>
<a-form-model-item label="确认密码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="confirmpassword">
<a-input type="password" @blur="handleConfirmBlur" placeholder="请重新输入登录密码" v-model="model.confirmpassword" />
</a-form-model-item>
</template>
@ -40,88 +33,84 @@
<a-input placeholder="请输入用户姓名" v-model="model.realname" />
</a-form-model-item>
<a-form-model-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo">
<!-- <a-form-model-item label="工号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workNo">
<a-input placeholder="请输入工号" v-model="model.workNo" />
</a-form-model-item>
</a-form-model-item> -->
<a-form-model-item label="手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="phone">
<a-input placeholder="请输入手机号码" v-model="model.phone" />
</a-form-model-item>
<a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-form-model-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-select-position placeholder="请选择职务" :multiple="false" v-model="model.post"/>
</a-form-model-item>
</a-form-model-item> -->
<a-form-model-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled" >
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.selectedroles"
:options="rolesOptions"
placeholder="请选择角色">
<a-form-model-item label="角色分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!roleDisabled">
<j-multi-select-tag :disabled="disableSubmit" v-model="model.selectedroles" :options="rolesOptions"
placeholder="请选择角色">
</j-multi-select-tag>
</a-form-model-item>
<!--部门分配-->
<a-form-model-item label="部门分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true" :treeOpera="true">></j-select-depart>
<j-select-depart v-model="model.selecteddeparts" :multi="true" @back="backDepartInfo" :backDepart="true"
:treeOpera="true">></j-select-depart>
</a-form-model-item>
<!--租户分配-->
<a-form-model-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<!-- <a-form-model-item label="租户分配" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.relTenantIds"
:options="tenantsOptions"
placeholder="请选择租户">
</j-multi-select-tag>
</a-form-model-item>
</a-form-model-item> -->
<a-form-model-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-form-model-item label="身份" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group v-model="model.userIdentity" @change="identityChange">
<a-radio :value="1">普通用户</a-radio>
<a-radio :value="2">上级</a-radio>
</a-radio-group>
</a-form-model-item>
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow==true">
<j-multi-select-tag
:disabled="disableSubmit"
v-model="model.departIds"
:options="nextDepartOptions"
placeholder="请选择负责部门">
</a-form-model-item> -->
<a-form-model-item label="负责部门" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="departIdShow == true">
<j-multi-select-tag :disabled="disableSubmit" v-model="model.departIds" :options="nextDepartOptions"
placeholder="请选择负责部门">
</j-multi-select-tag>
</a-form-model-item>
<a-form-model-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload class="avatar-uploader" text="上传" v-model="model.avatar" ></j-image-upload>
</a-form-model-item>
<a-form-model-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-form-model-item label="生日" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-date-picker
style="width: 100%"
placeholder="请选择生日"
v-model="model.birthday"
:format="dateFormat"
:getCalendarContainer="node => node.parentNode"/>
</a-form-model-item>
</a-form-model-item> -->
<a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<!-- <a-form-model-item label="性别" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select v-model="model.sex" placeholder="请选择性别" :getPopupContainer= "(target) => target.parentNode">
<a-select-option :value="1"></a-select-option>
<a-select-option :value="2"></a-select-option>
</a-select>
</a-form-model-item>
</a-form-model-item> --->
<a-form-model-item label="邮箱" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="email">
<a-input placeholder="请输入邮箱" v-model="model.email" />
</a-form-model-item>
<a-form-model-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone">
<a-form-model-item label="头像" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-image-upload class="avatar-uploader" text="上传" v-model="model.avatar"></j-image-upload>
</a-form-model-item>
<!-- <a-form-model-item label="座机" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="telephone">
<a-input placeholder="请输入座机" v-model="model.telephone" />
</a-form-model-item>
<a-form-model-item label="工作流引擎" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag v-model="model.activitiSync" placeholder="请选择是否同步工作流引擎" :type="'radio'" dictCode="activiti_sync"/>
</a-form-model-item>
</a-form-model-item> -->
</a-form-model>
</a-spin>
@ -137,389 +126,389 @@
</template>
<script>
import moment from 'moment'
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
import { addUser,editUser,queryUserRole,queryall } from '@/api/api'
import { disabledAuthFilter } from "@/utils/authFilter"
import { duplicateCheck } from '@/api/api'
import moment from 'moment'
import Vue from 'vue'
import { ACCESS_TOKEN } from "@/store/mutation-types"
import { getAction } from '@/api/manage'
import { addUser, editUser, queryUserRole, queryall } from '@/api/api'
import { disabledAuthFilter } from "@/utils/authFilter"
import { duplicateCheck } from '@/api/api'
export default {
name: "UserModal",
components: {
export default {
name: "UserModal",
components: {
},
data() {
return {
departDisabled: false, //
roleDisabled: false, //
modalWidth: 800,
drawerWidth: 700,
modaltoggleFlag: true,
confirmDirty: false,
userId: "", //id
disableSubmit: false,
dateFormat: "YYYY-MM-DD",
validatorRules: {
username: [{ required: true, message: '请输入用户账号!' },
{ validator: this.validateUsername, }],
password: [{ required: true, pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, message: '密码由8位数字、大小写字母和特殊符号组成!' },
{ validator: this.validateToNextPassword, trigger: 'change' }],
confirmpassword: [{ required: true, message: '请重新输入登录密码!', },
{ validator: this.compareToFirstPassword, }],
realname: [{ required: true, message: '请输入用户名称!' }],
phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }],
email: [{ validator: this.validateEmail }],
roles: {},
workNo: [{ required: true, message: '请输入工号' },
{ validator: this.validateWorkNo }],
telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },]
},
departIdShow: false,
title: "操作",
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
uploadLoading: false,
confirmLoading: false,
headers: {},
url: {
fileUpload: window._CONFIG['domianURL'] + "/sys/common/upload",
userWithDepart: "/sys/user/userDepartList", // url
userId: "/sys/user/generateUserId", // url
syncUserByUserName: "/act/process/extActProcess/doSyncUserByUserName",//
queryTenantList: '/sys/tenant/queryList'
},
tenantsOptions: [],
rolesOptions: [],
nextDepartOptions: [],
}
},
created() {
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = { "X-Access-Token": token }
this.initRoleList()
this.initTenantList()
},
computed: {
uploadAction: function () {
return this.url.fileUpload;
}
},
methods: {
add() {
this.refresh();
this.edit({ activitiSync: '1', userIdentity: 1 });
},
data () {
return {
departDisabled: false, //
roleDisabled: false, //
modalWidth:800,
drawerWidth:700,
modaltoggleFlag:true,
confirmDirty: false,
userId:"", //id
disableSubmit:false,
dateFormat:"YYYY-MM-DD",
validatorRules:{
username:[{required: true, message: '请输入用户账号!'},
{validator: this.validateUsername,}],
password: [{required: true,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message: '密码由8位数字、大小写字母和特殊符号组成!'},
{validator: this.validateToNextPassword,trigger: 'change'}],
confirmpassword: [{required: true, message: '请重新输入登录密码!',},
{ validator: this.compareToFirstPassword,}],
realname:[{ required: true, message: '请输入用户名称!' }],
phone: [{required: true, message: '请输入手机号!'}, {validator: this.validatePhone}],
email: [{validator: this.validateEmail}],
roles:{},
workNo:[ { required: true, message: '请输入工号' },
{ validator: this.validateWorkNo }],
telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },]
},
departIdShow:false,
title:"操作",
visible: false,
model: {},
labelCol: {
xs: { span: 24 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
uploadLoading:false,
confirmLoading: false,
headers:{},
url: {
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
userWithDepart: "/sys/user/userDepartList", // url
userId:"/sys/user/generateUserId", // url
syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//
queryTenantList: '/sys/tenant/queryList'
},
tenantsOptions: [],
rolesOptions:[],
nextDepartOptions:[],
edit(record) {
let that = this;
that.visible = true;
//
this.resetScreenSize();
that.userId = record.id;
that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record);
//
if (this.model.userIdentity == 2) {
this.departIdShow = true;
} else {
this.departIdShow = false;
}
if (record.hasOwnProperty("id")) {
that.getUserRoles(record.id);
that.getUserDeparts(record.id);
}
console.log('that.model=', that.model)
},
isDisabledAuth(code) {
return disabledAuthFilter(code);
},
//
toggleScreen() {
if (this.modaltoggleFlag) {
this.modalWidth = window.innerWidth;
} else {
this.modalWidth = 800;
}
this.modaltoggleFlag = !this.modaltoggleFlag;
},
// ,
resetScreenSize() {
let screenWidth = document.body.clientWidth;
if (screenWidth < 500) {
this.drawerWidth = screenWidth;
} else {
this.drawerWidth = 700;
}
},
created () {
const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token}
this.initRoleList()
this.initTenantList()
//
initTenantList() {
getAction(this.url.queryTenantList).then(res => {
if (res.success) {
this.tenantsOptions = res.result.map((item, index, arr) => {
let c = { label: item.name, value: item.id + "" }
return c;
})
console.log('this.tenantsOptions: ', this.tenantsOptions)
}
})
},
computed:{
uploadAction:function () {
return this.url.fileUpload;
}
//
initRoleList() {
queryall().then((res) => {
if (res.success) {
this.rolesOptions = res.result.map((item, index, arr) => {
let c = { label: item.roleName, value: item.id }
return c;
})
console.log('this.rolesOptions: ', this.rolesOptions)
}
});
},
methods: {
add () {
this.refresh();
this.edit({activitiSync:'1',userIdentity:1});
},
edit (record) {
let that = this;
that.visible = true;
//
this.resetScreenSize();
that.userId = record.id;
that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record);
//
if(this.model.userIdentity==2){
this.departIdShow=true;
}else{
this.departIdShow=false;
getUserRoles(userid) {
queryUserRole({ userid: userid }).then((res) => {
if (res.success) {
this.model.selectedroles = res.result.join(",");
console.log('that.model.selectedroles=', this.model.selectedroles)
}
if(record.hasOwnProperty("id")){
that.getUserRoles(record.id);
that.getUserDeparts(record.id);
}
console.log('that.model=',that.model)
},
isDisabledAuth(code){
return disabledAuthFilter(code);
},
//
toggleScreen(){
if(this.modaltoggleFlag){
this.modalWidth = window.innerWidth;
}else{
this.modalWidth = 800;
}
this.modaltoggleFlag = !this.modaltoggleFlag;
},
// ,
resetScreenSize(){
let screenWidth = document.body.clientWidth;
if(screenWidth < 500){
this.drawerWidth = screenWidth;
}else{
this.drawerWidth = 700;
}
},
//
initTenantList(){
getAction(this.url.queryTenantList).then(res=>{
if(res.success){
this.tenantsOptions = res.result.map((item,index,arr)=>{
let c = {label:item.name, value: item.id+""}
return c;
});
},
getUserDeparts(userid) {
let that = this;
getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
if (res.success) {
let departOptions = [];
let selectDepartKeys = []
for (let i = 0; i < res.result.length; i++) {
selectDepartKeys.push(res.result[i].key);
//
departOptions.push({
value: res.result[i].key,
label: res.result[i].title
})
console.log('this.tenantsOptions: ',this.tenantsOptions)
}
})
},
//
initRoleList(){
queryall().then((res)=>{
if(res.success){
this.rolesOptions = res.result.map((item,index,arr)=>{
let c = {label:item.roleName, value:item.id}
return c;
})
console.log('this.rolesOptions: ',this.rolesOptions)
}
});
},
getUserRoles(userid){
queryUserRole({userid:userid}).then((res)=>{
if(res.success){
this.model.selectedroles = res.result.join(",");
console.log('that.model.selectedroles=',this.model.selectedroles)
}
});
},
getUserDeparts(userid){
let that = this;
getAction(that.url.userWithDepart,{userId:userid}).then((res)=>{
if(res.success){
let departOptions=[];
let selectDepartKeys=[]
for (let i = 0; i < res.result.length; i++) {
selectDepartKeys.push(res.result[i].key);
//
departOptions.push({
value: res.result[i].key,
label: res.result[i].title
})
}
that.model.selecteddeparts = selectDepartKeys.join(",")
that.nextDepartOptions=departOptions;
console.log('that.nextDepartOptions=',that.nextDepartOptions)
}
})
},
backDepartInfo(info) {
this.model.departIds = this.model.selecteddeparts;
this.nextDepartOptions = info.map((item,index,arr)=>{
let c = {label:item.text, value: item.value+""}
return c;
})
},
refresh () {
this.userId=""
this.nextDepartOptions=[];
this.departIdShow=false;
},
close () {
this.$emit('close');
this.visible = false;
this.disableSubmit = false;
this.nextDepartOptions=[];
this.departIdShow=false;
this.$refs.form.resetFields();
},
moment,
handleSubmit () {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
//departIds,
if(this.model.userIdentity!==2){
this.model.departIds="";
}
let obj;
if(!this.model.id){
this.model.id = this.userId;
obj=addUser(this.model);
}else{
obj=editUser(this.model);
}
obj.then((res)=>{
if(res.success){
that.$message.success(res.message);
that.$emit('ok');
}else{
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
}else{
return false;
}
})
},
handleCancel () {
this.close()
},
validateToNextPassword (rule, value, callback) {
const confirmpassword=this.model.confirmpassword;
if (value && confirmpassword && value !== confirmpassword) {
callback('两次输入的密码不一样!');
that.model.selecteddeparts = selectDepartKeys.join(",")
that.nextDepartOptions = departOptions;
console.log('that.nextDepartOptions=', that.nextDepartOptions)
}
if (value && this.confirmDirty) {
this.$refs.form.validateField(['confirmpassword']);
}
callback();
},
compareToFirstPassword (rule, value, callback) {
if (value && value !== this.model.password) {
callback('两次输入的密码不一样!');
})
},
backDepartInfo(info) {
this.model.departIds = this.model.selecteddeparts;
this.nextDepartOptions = info.map((item, index, arr) => {
let c = { label: item.text, value: item.value + "" }
return c;
})
},
refresh() {
this.userId = ""
this.nextDepartOptions = [];
this.departIdShow = false;
},
close() {
this.$emit('close');
this.visible = false;
this.disableSubmit = false;
this.nextDepartOptions = [];
this.departIdShow = false;
this.$refs.form.resetFields();
},
moment,
handleSubmit() {
const that = this;
//
this.$refs.form.validate(valid => {
if (valid) {
that.confirmLoading = true;
//departIds,
if (this.model.userIdentity !== 2) {
this.model.departIds = "";
}
let obj;
if (!this.model.id) {
this.model.id = this.userId;
obj = addUser(this.model);
} else {
obj = editUser(this.model);
}
obj.then((res) => {
if (res.success) {
that.$message.success(res.message);
that.$emit('ok');
} else {
that.$message.warning(res.message);
}
}).finally(() => {
that.confirmLoading = false;
that.close();
})
} else {
callback()
}
},
validatePhone(rule, value, callback){
if(!value){
callback()
}else{
if(new RegExp(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/).test(value)){
var params = {
tableName: 'sys_user',
fieldName: 'phone',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("手机号已存在!")
}
})
}else{
callback("请输入正确格式的手机号码!");
}
}
},
validateEmail(rule, value, callback){
if(!value){
callback()
}else{
if(new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)){
var params = {
tableName: 'sys_user',
fieldName: 'email',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
console.log(res)
if (res.success) {
callback()
} else {
callback("邮箱已存在!")
}
})
}else{
callback("请输入正确格式的邮箱!")
}
}
},
validateUsername(rule, value, callback){
var params = {
tableName: 'sys_user',
fieldName: 'username',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("用户名已存在!")
}
})
},
validateWorkNo(rule, value, callback){
var params = {
tableName: 'sys_user',
fieldName: 'work_no',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("工号已存在!")
}
})
},
handleConfirmBlur(e) {
const value = e.target.value;
this.confirmDirty = this.confirmDirty || !!value
},
beforeUpload: function(file){
var fileType = file.type;
if(fileType.indexOf('image')<0){
this.$message.warning('请上传图片');
return false;
}
//TODO
},
identityChange(e){
if(e.target.value===1){
this.departIdShow=false;
}else{
this.departIdShow=true;
})
},
handleCancel() {
this.close()
},
validateToNextPassword(rule, value, callback) {
const confirmpassword = this.model.confirmpassword;
if (value && confirmpassword && value !== confirmpassword) {
callback('两次输入的密码不一样!');
}
if (value && this.confirmDirty) {
this.$refs.form.validateField(['confirmpassword']);
}
callback();
},
compareToFirstPassword(rule, value, callback) {
if (value && value !== this.model.password) {
callback('两次输入的密码不一样!');
} else {
callback()
}
},
validatePhone(rule, value, callback) {
if (!value) {
callback()
} else {
if (new RegExp(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/).test(value)) {
var params = {
tableName: 'sys_user',
fieldName: 'phone',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("手机号已存在!")
}
})
} else {
callback("请输入正确格式的手机号码!");
}
}
},
validateEmail(rule, value, callback) {
if (!value) {
callback()
} else {
if (new RegExp(/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/).test(value)) {
var params = {
tableName: 'sys_user',
fieldName: 'email',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
console.log(res)
if (res.success) {
callback()
} else {
callback("邮箱已存在!")
}
})
} else {
callback("请输入正确格式的邮箱!")
}
}
},
validateUsername(rule, value, callback) {
var params = {
tableName: 'sys_user',
fieldName: 'username',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("用户名已存在!")
}
})
},
validateWorkNo(rule, value, callback) {
var params = {
tableName: 'sys_user',
fieldName: 'work_no',
fieldVal: value,
dataId: this.userId
};
duplicateCheck(params).then((res) => {
if (res.success) {
callback()
} else {
callback("工号已存在!")
}
})
},
handleConfirmBlur(e) {
const value = e.target.value;
this.confirmDirty = this.confirmDirty || !!value
},
beforeUpload: function (file) {
var fileType = file.type;
if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片');
return false;
}
//TODO
},
identityChange(e) {
if (e.target.value === 1) {
this.departIdShow = false;
} else {
this.departIdShow = true;
}
}
}
}
</script>
<style scoped>
.avatar-uploader > .ant-upload {
width:104px;
height:104px;
}
.ant-upload-select-picture-card i {
font-size: 49px;
color: #999;
}
.avatar-uploader>.ant-upload {
width: 104px;
height: 104px;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
.ant-upload-select-picture-card i {
font-size: 49px;
color: #999;
}
.ant-table-tbody .ant-table-row td{
padding-top:10px;
padding-bottom:10px;
}
.ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px;
color: #666;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.ant-table-tbody .ant-table-row td {
padding-top: 10px;
padding-bottom: 10px;
}
/*【JTC-502】 添加用户两个滚动条*/
/deep/ .ant-drawer-body {
padding-bottom: 53px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
/*【JTC-502】 添加用户两个滚动条*/
/deep/ .ant-drawer-body {
padding-bottom: 53px;
}
</style>