权限新增
This commit is contained in:
parent
ace9369dc9
commit
1e2067726c
|
|
@ -37,6 +37,15 @@ export function updateUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 重置密码
|
||||
export function resetPwd(data) {
|
||||
return request({
|
||||
url: '/system/user/resetPwd',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
export function delUser(data) {
|
||||
return request({
|
||||
|
|
@ -53,8 +62,14 @@ export function exportUser(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//模板下载
|
||||
export function userTempFile(query) {
|
||||
return request({
|
||||
url: '/system/user/userFile',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 角色下拉
|
||||
export function getSelectRole(query) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['flow:holiday:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
|
||||
|
|
@ -88,20 +89,24 @@
|
|||
<el-button
|
||||
size="mini" type="primary"
|
||||
v-if="scope.row.examineStatus==3"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-hasPermi="['flow:holiday:query']"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini" type="primary"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
@click="handleBack(scope.row)"
|
||||
>撤回</el-button>
|
||||
<el-button
|
||||
size="mini" type="danger"
|
||||
v-if="scope.row.examineStatus==2||scope.row.examineStatus==3"
|
||||
v-hasPermi="['flow:holiday:remove']"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -66,10 +66,12 @@
|
|||
<el-button
|
||||
type="primary" size="mini"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
>审核</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-hasPermi="['flow:holiday:query']"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['flow:holiday:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
|
||||
|
|
@ -90,20 +91,24 @@
|
|||
type="primary"
|
||||
v-if="scope.row.examineStatus==3"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-hasPermi="['flow:holiday:query']"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
@click="handleBack(scope.row)"
|
||||
>撤回</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
v-hasPermi="['flow:holiday:remove']"
|
||||
v-if="scope.row.examineStatus==2||scope.row.examineStatus==3"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
|
|
|
|||
|
|
@ -68,10 +68,12 @@
|
|||
<el-button
|
||||
type="primary" size="mini"
|
||||
v-if="scope.row.examineStatus==0"
|
||||
v-hasPermi="['flow:holiday:edit']"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>审核</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
v-hasPermi="['flow:holiday:query']"
|
||||
@click="handleView(scope.row)"
|
||||
>详情</el-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
v-hasPermi="['att:machine:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
|
|
@ -73,11 +73,13 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-hasPermi="['att:machine:edit']"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
v-hasPermi="['att:machine:remove']"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
|
||||
v-hasPermi="['att:group:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
|
||||
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
|
||||
|
|
@ -83,11 +83,13 @@
|
|||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-hasPermi="['att:group:edit']"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
v-hasPermi="['att:group:remove']"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
|
|
@ -548,9 +550,9 @@
|
|||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/dict/type/export', {
|
||||
...this.queryParams
|
||||
}, `type_${new Date().getTime()}.xlsx`)
|
||||
// this.download('system/dict/type/export', {
|
||||
// ...this.queryParams
|
||||
// }, `type_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,8 +31,13 @@
|
|||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:org:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:org:import']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
|
|
@ -75,17 +80,20 @@
|
|||
size="mini"
|
||||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:org:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="success"
|
||||
@click="handleAdd(scope.row)"
|
||||
v-hasPermi="['system:org:add']"
|
||||
>新增</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.parentId != 0"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:org:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -191,12 +199,37 @@
|
|||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 导入对话框 -->
|
||||
<el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
|
||||
<el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
||||
:action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
||||
:on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip text-center" slot="tip">
|
||||
<!-- <div class="el-upload__tip" slot="tip">
|
||||
<el-checkbox v-model="upload.updateSupport" /> 是否更新已经存在的数据
|
||||
</div> -->
|
||||
<span>仅允许导入xls、xlsx格式文件。</span>
|
||||
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;"
|
||||
@click="importTemplate">下载模板</el-link>
|
||||
</div>
|
||||
</el-upload>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitFileForm">确 定</el-button>
|
||||
<el-button @click="upload.open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listDept, getDept, delDept, addDept, updateDept,orgPersonSelect } from "@/api/system/dept";
|
||||
import { getPersonSelect } from "@/api/system/userInfo";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
|
|
@ -259,7 +292,22 @@ export default {
|
|||
address: [
|
||||
{ required: true, message: "位置不能为空", trigger: "blur" }
|
||||
]
|
||||
}
|
||||
},
|
||||
// 导入参数
|
||||
upload: {
|
||||
// 是否显示弹出层(导入)
|
||||
open: false,
|
||||
// 弹出层标题(导入)
|
||||
title: "",
|
||||
// 是否禁用上传
|
||||
isUploading: false,
|
||||
// 是否更新已经存在的数据
|
||||
updateSupport: 0,
|
||||
// 设置上传的请求头部
|
||||
headers: { Authorization: "Bearer " + getToken() },
|
||||
// 上传的地址
|
||||
url: process.env.VUE_APP_BASE_API + "/system/org/importData"
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -390,6 +438,32 @@ export default {
|
|||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = "数据导入";
|
||||
this.upload.open = true;
|
||||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
// this.download('system/user/importTemplate', {
|
||||
// }, `user_template_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
this.upload.isUploading = true;
|
||||
},
|
||||
// 文件上传成功处理
|
||||
handleFileSuccess(response, file, fileList) {
|
||||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@
|
|||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport"
|
||||
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:excelUpload']"
|
||||
>导入</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
|
|
@ -52,12 +52,20 @@
|
|||
size="mini"
|
||||
type="primary"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
v-hasPermi="['system:user:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
v-hasPermi="['system:user:del']"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
v-hasPermi="[' system:user:pwd']"
|
||||
@click="handleResetPwd(scope.row)"
|
||||
>重置密码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -152,7 +160,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser, getUserById, delUser, addUser, updateUser, getSelectRole, exportUser } from "@/api/system/userInfo";
|
||||
import { listUser, getUserById, delUser, addUser, updateUser, getSelectRole, exportUser,resetPwd,userTempFile } from "@/api/system/userInfo";
|
||||
import { listDept } from "@/api/system/dept";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
|
|
@ -354,10 +362,22 @@
|
|||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 重置密码按钮操作 */
|
||||
handleResetPwd(row) {
|
||||
let param={
|
||||
userId:row.userId
|
||||
}
|
||||
this.$modal.confirm('是否确认重置该用户密码?').then(function() {
|
||||
return resetPwd(param);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("重置成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
exportUser().then(res => {
|
||||
this.downloadFile({ fileName: `临时外出_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
this.downloadFile({ fileName: `用户_${new Date().getTime()}.xlsx`, fileData: res, fileType: 'application/vnd.ms-excel;charset=utf-8' })
|
||||
})
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
|
|
@ -367,8 +387,7 @@
|
|||
},
|
||||
/** 下载模板操作 */
|
||||
importTemplate() {
|
||||
// this.download('system/user/importTemplate', {
|
||||
// }, `user_template_${new Date().getTime()}.xlsx`)
|
||||
this.download('/system/user/userFile', {}, `用户模板_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(event, file, fileList) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue