代码重提交

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -39,17 +39,17 @@
<!-- 操作按钮区域 --> <!-- 操作按钮区域 -->
<div class="table-operator"> <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 @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" <!-- <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-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"
@change="ImportData"> @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"> <a-modal v-model="showDifference" title="数据对比" :width="1300" okText="导入" @ok="DifferenceOk">
<!-- 居中显示表格标题 --> <!-- 居中显示表格标题 -->
<div style="text-align: center; padding: 10px; background-color: #f0f0f0; <div style="text-align: center; padding: 10px; background-color: #f0f0f0;
@ -80,7 +80,7 @@
</div> </div>
</a-modal> </a-modal>
</a-upload> </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"> <a-modal v-model="historyModalVisible" title="历史数据" @ok="closeHistoryModal">
<div class="modal-content"> <div class="modal-content">
<!-- 在这里显示历史数据 --> <!-- 在这里显示历史数据 -->

View File

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

View File

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

View File

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