代码重提交

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">
<div v-has="'furnitureCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a> <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">
<div v-has="'instrumentCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a> <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">
<div v-has="'intangibleCollege:operate'" style="display: inline-block;">
<a @click="handleEdit(record)">编辑</a> <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 {

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>
@ -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,40 +48,20 @@
</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-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 @click="handlePerssion(record.id)">授权</a>
</a-menu-item> <a-divider type="vertical" />
<a-menu-item>
<a @click="handleEdit(record)">编辑</a> <a @click="handleEdit(record)">编辑</a>
</a-menu-item> <a-divider type="vertical" />
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)"> <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete1(record.id)">
<a>删除</a> <a>删除</a>
</a-popconfirm> </a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
</span> </span>
</a-table> </a-table>
</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>
@ -139,24 +120,15 @@
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
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"> <span slot="action" slot-scope="text, record">
<a @click="handleEdit2(record)">编辑</a> <a @click="handleEdit2(record)">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a-dropdown> <a-dropdown>
<a class="ant-dropdown-link"> <a class="ant-dropdown-link">
更多 <a-icon type="down"/> 更多 <a-icon type="down" />
</a> </a>
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item> <a-menu-item>
@ -178,16 +150,16 @@
</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: {
@ -244,8 +216,8 @@
selectedRowKeys2: [], selectedRowKeys2: [],
selectionRows1: [], selectionRows1: [],
selectionRows2: [], selectionRows2: [],
test:{}, test: {},
rightcolval:0, rightcolval: 0,
columns: columns:
[ [
{ {
@ -261,7 +233,7 @@
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
align:"center", align: "center",
sorter: true, sorter: true,
customRender: (text) => { customRender: (text) => {
return moment(text).format('YYYY-MM-DD') return moment(text).format('YYYY-MM-DD')
@ -318,7 +290,7 @@
} }
}, },
computed: { computed: {
importExcelUrl: function() { importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
}, },
leftColMd() { leftColMd() {
@ -369,23 +341,23 @@
getQueryField2() { getQueryField2() {
//TODO //TODO
var str = 'id,' var str = 'id,'
this.columns2.forEach(function(value) { this.columns2.forEach(function (value) {
str += ',' + value.dataIndex str += ',' + value.dataIndex
}) })
return str return str
}, },
handleEdit2: function(record) { handleEdit2: function (record) {
this.$refs.modalForm2.title = '编辑' this.$refs.modalForm2.title = '编辑'
this.$refs.modalForm2.roleDisabled = true this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.edit(record) this.$refs.modalForm2.edit(record)
}, },
handleAdd2: function() { handleAdd2: function () {
if (this.currentRoleId == '') { if (this.currentRoleId == '') {
this.$message.error('请选择一个角色!') this.$message.error('请选择一个角色!')
} else { } else {
this.$refs.modalForm2.roleDisabled = true this.$refs.modalForm2.roleDisabled = true
this.$refs.modalForm2.title = '新增' this.$refs.modalForm2.title = '新增'
this.$refs.modalForm2.edit({activitiSync:'1',userIdentity:1,selectedroles:this.currentRoleId}) this.$refs.modalForm2.edit({ activitiSync: '1', userIdentity: 1, selectedroles: this.currentRoleId })
} }
}, },
modalFormOk2() { modalFormOk2() {
@ -415,12 +387,12 @@
}) })
}, },
handleDelete1: function(id) { handleDelete1: function (id) {
this.handleDelete(id) this.handleDelete(id)
this.dataSource2 = [] this.dataSource2 = []
this.currentRoleId = '' this.currentRoleId = ''
}, },
handleDelete2: function(id) { handleDelete2: function (id) {
if (!this.url.delete2) { if (!this.url.delete2) {
this.$message.error('请设置url.delete2属性!') this.$message.error('请设置url.delete2属性!')
return return
@ -435,7 +407,7 @@
} }
}) })
}, },
batchDel2: function() { batchDel2: function () {
if (!this.url.deleteBatch2) { if (!this.url.deleteBatch2) {
this.$message.error('请设置url.deleteBatch2属性!') this.$message.error('请设置url.deleteBatch2属性!')
@ -454,7 +426,7 @@
this.$confirm({ this.$confirm({
title: '确认取消关联', title: '确认取消关联',
content: '是否删除选中数据?', content: '是否删除选中数据?',
onOk: function() { onOk: function () {
deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => { deleteAction(that.url.deleteBatch2, { roleId: that.currentRoleId, userIds: ids }).then((res) => {
if (res.success) { if (res.success) {
that.$message.success(res.message) that.$message.success(res.message)
@ -526,20 +498,21 @@
this.ipagination2 = pagination this.ipagination2 = pagination
this.loadData2() this.loadData2()
}, },
hideUserList(){ hideUserList() {
//this.rightcolval = 0 //this.rightcolval = 0
this.selectedRowKeys1 = [] this.selectedRowKeys1 = []
}, },
handlePerssion(roleId){ handlePerssion(roleId) {
this.$refs.modalUserRole.show(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按钮间距 */
.ant-btn {
margin-left: 8px 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"
v-model="model.selectedroles"
:options="rolesOptions"
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" 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"
v-model="model.departIds"
:options="nextDepartOptions"
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">
<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,46 +126,46 @@
</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 () { data() {
return { return {
departDisabled: false, // departDisabled: false, //
roleDisabled: false, // roleDisabled: false, //
modalWidth:800, modalWidth: 800,
drawerWidth:700, drawerWidth: 700,
modaltoggleFlag:true, modaltoggleFlag: true,
confirmDirty: false, confirmDirty: false,
userId:"", //id userId: "", //id
disableSubmit:false, disableSubmit: false,
dateFormat:"YYYY-MM-DD", dateFormat: "YYYY-MM-DD",
validatorRules:{ validatorRules: {
username:[{required: true, message: '请输入用户账号!'}, username: [{ required: true, message: '请输入用户账号!' },
{validator: this.validateUsername,}], { validator: this.validateUsername, }],
password: [{required: true,pattern:/^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,message: '密码由8位数字、大小写字母和特殊符号组成!'}, password: [{ required: true, pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, message: '密码由8位数字、大小写字母和特殊符号组成!' },
{validator: this.validateToNextPassword,trigger: 'change'}], { validator: this.validateToNextPassword, trigger: 'change' }],
confirmpassword: [{required: true, message: '请重新输入登录密码!',}, confirmpassword: [{ required: true, message: '请重新输入登录密码!', },
{ validator: this.compareToFirstPassword,}], { validator: this.compareToFirstPassword, }],
realname:[{ required: true, message: '请输入用户名称!' }], realname: [{ required: true, message: '请输入用户名称!' }],
phone: [{required: true, message: '请输入手机号!'}, {validator: this.validatePhone}], phone: [{ required: true, message: '请输入手机号!' }, { validator: this.validatePhone }],
email: [{validator: this.validateEmail}], email: [{ validator: this.validateEmail }],
roles:{}, roles: {},
workNo:[ { required: true, message: '请输入工号' }, workNo: [{ required: true, message: '请输入工号' },
{ validator: this.validateWorkNo }], { validator: this.validateWorkNo }],
telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },] telephone: [{ pattern: /^0\d{2,3}-[1-9]\d{6,7}$/, message: '请输入正确的座机号码' },]
}, },
departIdShow:false, departIdShow: false,
title:"操作", title: "操作",
visible: false, visible: false,
model: {}, model: {},
labelCol: { labelCol: {
@ -187,116 +176,116 @@
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 16 }, sm: { span: 16 },
}, },
uploadLoading:false, uploadLoading: false,
confirmLoading: false, confirmLoading: false,
headers:{}, headers: {},
url: { url: {
fileUpload: window._CONFIG['domianURL']+"/sys/common/upload", fileUpload: window._CONFIG['domianURL'] + "/sys/common/upload",
userWithDepart: "/sys/user/userDepartList", // url userWithDepart: "/sys/user/userDepartList", // url
userId:"/sys/user/generateUserId", // url userId: "/sys/user/generateUserId", // url
syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",// syncUserByUserName: "/act/process/extActProcess/doSyncUserByUserName",//
queryTenantList: '/sys/tenant/queryList' queryTenantList: '/sys/tenant/queryList'
}, },
tenantsOptions: [], tenantsOptions: [],
rolesOptions:[], rolesOptions: [],
nextDepartOptions:[], nextDepartOptions: [],
} }
}, },
created () { created() {
const token = Vue.ls.get(ACCESS_TOKEN); const token = Vue.ls.get(ACCESS_TOKEN);
this.headers = {"X-Access-Token":token} this.headers = { "X-Access-Token": token }
this.initRoleList() this.initRoleList()
this.initTenantList() this.initTenantList()
}, },
computed:{ computed: {
uploadAction:function () { uploadAction: function () {
return this.url.fileUpload; return this.url.fileUpload;
} }
}, },
methods: { methods: {
add () { add() {
this.refresh(); this.refresh();
this.edit({activitiSync:'1',userIdentity:1}); this.edit({ activitiSync: '1', userIdentity: 1 });
}, },
edit (record) { edit(record) {
let that = this; let that = this;
that.visible = true; that.visible = true;
// //
this.resetScreenSize(); this.resetScreenSize();
that.userId = record.id; that.userId = record.id;
that.model = Object.assign({},{selectedroles:'',selecteddeparts:''}, record); that.model = Object.assign({}, { selectedroles: '', selecteddeparts: '' }, record);
// //
if(this.model.userIdentity==2){ if (this.model.userIdentity == 2) {
this.departIdShow=true; this.departIdShow = true;
}else{ } else {
this.departIdShow=false; this.departIdShow = false;
} }
if(record.hasOwnProperty("id")){ if (record.hasOwnProperty("id")) {
that.getUserRoles(record.id); that.getUserRoles(record.id);
that.getUserDeparts(record.id); that.getUserDeparts(record.id);
} }
console.log('that.model=',that.model) console.log('that.model=', that.model)
}, },
isDisabledAuth(code){ isDisabledAuth(code) {
return disabledAuthFilter(code); return disabledAuthFilter(code);
}, },
// //
toggleScreen(){ toggleScreen() {
if(this.modaltoggleFlag){ if (this.modaltoggleFlag) {
this.modalWidth = window.innerWidth; this.modalWidth = window.innerWidth;
}else{ } else {
this.modalWidth = 800; this.modalWidth = 800;
} }
this.modaltoggleFlag = !this.modaltoggleFlag; this.modaltoggleFlag = !this.modaltoggleFlag;
}, },
// , // ,
resetScreenSize(){ resetScreenSize() {
let screenWidth = document.body.clientWidth; let screenWidth = document.body.clientWidth;
if(screenWidth < 500){ if (screenWidth < 500) {
this.drawerWidth = screenWidth; this.drawerWidth = screenWidth;
}else{ } else {
this.drawerWidth = 700; this.drawerWidth = 700;
} }
}, },
// //
initTenantList(){ initTenantList() {
getAction(this.url.queryTenantList).then(res=>{ getAction(this.url.queryTenantList).then(res => {
if(res.success){ if (res.success) {
this.tenantsOptions = res.result.map((item,index,arr)=>{ this.tenantsOptions = res.result.map((item, index, arr) => {
let c = {label:item.name, value: item.id+""} let c = { label: item.name, value: item.id + "" }
return c; return c;
}) })
console.log('this.tenantsOptions: ',this.tenantsOptions) console.log('this.tenantsOptions: ', this.tenantsOptions)
} }
}) })
}, },
// //
initRoleList(){ initRoleList() {
queryall().then((res)=>{ queryall().then((res) => {
if(res.success){ if (res.success) {
this.rolesOptions = res.result.map((item,index,arr)=>{ this.rolesOptions = res.result.map((item, index, arr) => {
let c = {label:item.roleName, value:item.id} let c = { label: item.roleName, value: item.id }
return c; return c;
}) })
console.log('this.rolesOptions: ',this.rolesOptions) console.log('this.rolesOptions: ', this.rolesOptions)
} }
}); });
}, },
getUserRoles(userid){ getUserRoles(userid) {
queryUserRole({userid:userid}).then((res)=>{ queryUserRole({ userid: userid }).then((res) => {
if(res.success){ if (res.success) {
this.model.selectedroles = res.result.join(","); this.model.selectedroles = res.result.join(",");
console.log('that.model.selectedroles=',this.model.selectedroles) console.log('that.model.selectedroles=', this.model.selectedroles)
} }
}); });
}, },
getUserDeparts(userid){ getUserDeparts(userid) {
let that = this; let that = this;
getAction(that.url.userWithDepart,{userId:userid}).then((res)=>{ getAction(that.url.userWithDepart, { userId: userid }).then((res) => {
if(res.success){ if (res.success) {
let departOptions=[]; let departOptions = [];
let selectDepartKeys=[] let selectDepartKeys = []
for (let i = 0; i < res.result.length; i++) { for (let i = 0; i < res.result.length; i++) {
selectDepartKeys.push(res.result[i].key); selectDepartKeys.push(res.result[i].key);
// //
@ -306,70 +295,70 @@
}) })
} }
that.model.selecteddeparts = selectDepartKeys.join(",") that.model.selecteddeparts = selectDepartKeys.join(",")
that.nextDepartOptions=departOptions; that.nextDepartOptions = departOptions;
console.log('that.nextDepartOptions=',that.nextDepartOptions) console.log('that.nextDepartOptions=', that.nextDepartOptions)
} }
}) })
}, },
backDepartInfo(info) { backDepartInfo(info) {
this.model.departIds = this.model.selecteddeparts; this.model.departIds = this.model.selecteddeparts;
this.nextDepartOptions = info.map((item,index,arr)=>{ this.nextDepartOptions = info.map((item, index, arr) => {
let c = {label:item.text, value: item.value+""} let c = { label: item.text, value: item.value + "" }
return c; return c;
}) })
}, },
refresh () { refresh() {
this.userId="" this.userId = ""
this.nextDepartOptions=[]; this.nextDepartOptions = [];
this.departIdShow=false; this.departIdShow = false;
}, },
close () { close() {
this.$emit('close'); this.$emit('close');
this.visible = false; this.visible = false;
this.disableSubmit = false; this.disableSubmit = false;
this.nextDepartOptions=[]; this.nextDepartOptions = [];
this.departIdShow=false; this.departIdShow = false;
this.$refs.form.resetFields(); this.$refs.form.resetFields();
}, },
moment, moment,
handleSubmit () { handleSubmit() {
const that = this; const that = this;
// //
this.$refs.form.validate(valid => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
that.confirmLoading = true; that.confirmLoading = true;
//departIds, //departIds,
if(this.model.userIdentity!==2){ if (this.model.userIdentity !== 2) {
this.model.departIds=""; this.model.departIds = "";
} }
let obj; let obj;
if(!this.model.id){ if (!this.model.id) {
this.model.id = this.userId; this.model.id = this.userId;
obj=addUser(this.model); obj = addUser(this.model);
}else{ } else {
obj=editUser(this.model); obj = editUser(this.model);
} }
obj.then((res)=>{ obj.then((res) => {
if(res.success){ if (res.success) {
that.$message.success(res.message); that.$message.success(res.message);
that.$emit('ok'); that.$emit('ok');
}else{ } else {
that.$message.warning(res.message); that.$message.warning(res.message);
} }
}).finally(() => { }).finally(() => {
that.confirmLoading = false; that.confirmLoading = false;
that.close(); that.close();
}) })
}else{ } else {
return false; return false;
} }
}) })
}, },
handleCancel () { handleCancel() {
this.close() this.close()
}, },
validateToNextPassword (rule, value, callback) { validateToNextPassword(rule, value, callback) {
const confirmpassword=this.model.confirmpassword; const confirmpassword = this.model.confirmpassword;
if (value && confirmpassword && value !== confirmpassword) { if (value && confirmpassword && value !== confirmpassword) {
callback('两次输入的密码不一样!'); callback('两次输入的密码不一样!');
} }
@ -378,18 +367,18 @@
} }
callback(); callback();
}, },
compareToFirstPassword (rule, value, callback) { compareToFirstPassword(rule, value, callback) {
if (value && value !== this.model.password) { if (value && value !== this.model.password) {
callback('两次输入的密码不一样!'); callback('两次输入的密码不一样!');
} else { } else {
callback() callback()
} }
}, },
validatePhone(rule, value, callback){ validatePhone(rule, value, callback) {
if(!value){ if (!value) {
callback() callback()
}else{ } else {
if(new RegExp(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/).test(value)){ if (new RegExp(/^1[3|4|5|6|7|8|9][0-9]\d{8}$/).test(value)) {
var params = { var params = {
tableName: 'sys_user', tableName: 'sys_user',
fieldName: 'phone', fieldName: 'phone',
@ -403,16 +392,16 @@
callback("手机号已存在!") callback("手机号已存在!")
} }
}) })
}else{ } else {
callback("请输入正确格式的手机号码!"); callback("请输入正确格式的手机号码!");
} }
} }
}, },
validateEmail(rule, value, callback){ validateEmail(rule, value, callback) {
if(!value){ if (!value) {
callback() callback()
}else{ } 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)){ 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 = { var params = {
tableName: 'sys_user', tableName: 'sys_user',
fieldName: 'email', fieldName: 'email',
@ -427,12 +416,12 @@
callback("邮箱已存在!") callback("邮箱已存在!")
} }
}) })
}else{ } else {
callback("请输入正确格式的邮箱!") callback("请输入正确格式的邮箱!")
} }
} }
}, },
validateUsername(rule, value, callback){ validateUsername(rule, value, callback) {
var params = { var params = {
tableName: 'sys_user', tableName: 'sys_user',
fieldName: 'username', fieldName: 'username',
@ -447,7 +436,7 @@
} }
}) })
}, },
validateWorkNo(rule, value, callback){ validateWorkNo(rule, value, callback) {
var params = { var params = {
tableName: 'sys_user', tableName: 'sys_user',
fieldName: 'work_no', fieldName: 'work_no',
@ -466,46 +455,47 @@
const value = e.target.value; const value = e.target.value;
this.confirmDirty = this.confirmDirty || !!value this.confirmDirty = this.confirmDirty || !!value
}, },
beforeUpload: function(file){ beforeUpload: function (file) {
var fileType = file.type; var fileType = file.type;
if(fileType.indexOf('image')<0){ if (fileType.indexOf('image') < 0) {
this.$message.warning('请上传图片'); this.$message.warning('请上传图片');
return false; return false;
} }
//TODO //TODO
}, },
identityChange(e){ identityChange(e) {
if(e.target.value===1){ if (e.target.value === 1) {
this.departIdShow=false; this.departIdShow = false;
}else{ } else {
this.departIdShow=true; 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 {
.ant-upload-select-picture-card i {
font-size: 49px; font-size: 49px;
color: #999; color: #999;
} }
.ant-upload-select-picture-card .ant-upload-text { .ant-upload-select-picture-card .ant-upload-text {
margin-top: 8px; margin-top: 8px;
color: #666; color: #666;
} }
.ant-table-tbody .ant-table-row td{ .ant-table-tbody .ant-table-row td {
padding-top:10px; padding-top: 10px;
padding-bottom:10px; padding-bottom: 10px;
} }
.drawer-bootom-button { .drawer-bootom-button {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
@ -515,11 +505,10 @@
left: 0; left: 0;
background: #fff; background: #fff;
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
/*【JTC-502】 添加用户两个滚动条*/ /*【JTC-502】 添加用户两个滚动条*/
/deep/ .ant-drawer-body { /deep/ .ant-drawer-body {
padding-bottom: 53px; padding-bottom: 53px;
} }
</style> </style>