Files
vue-learning/企业级管理系统/web/admin_system/src/views/info/StaffInfo.vue

137 lines
3.7 KiB
Vue
Raw Normal View History

2023-01-18 17:49:24 +08:00
/* eslint-disable */
2023-01-12 18:16:45 +08:00
<!--
* @Author: Kane
* @Date: 2023-01-12 14:43:46
* @LastEditors: Kane
2023-01-18 23:47:38 +08:00
* @LastEditTime: 2023-01-18 23:24:41
2023-01-12 18:16:45 +08:00
* @FilePath: \admin_system\src\views\info\StaffInfo.vue
* @Description:
*
* Copyright (c) ${2022} by Kane, All Rights Reserved.
-->
<template>
2023-01-13 15:15:57 +08:00
<div class="query_box">
2023-01-18 23:47:38 +08:00
<el-form inline width="600px">
2023-01-14 23:53:15 +08:00
<el-row :gutter="10" class="el-row">
2023-01-18 11:46:16 +08:00
<el-col :span="8">
2023-01-14 23:53:15 +08:00
<el-input v-model="query_param.staff_code" placeholder="请输入P09工号或P13账号"></el-input>
</el-col>
2023-01-18 11:46:16 +08:00
<el-col :span="4">
2023-01-14 23:53:15 +08:00
<el-button type="danger">查询</el-button>
</el-col>
2023-01-18 11:46:16 +08:00
<el-col :span="12"></el-col>
2023-01-14 23:53:15 +08:00
</el-row>
2023-01-13 18:00:27 +08:00
</el-form>
2023-01-18 23:47:38 +08:00
<el-table ref="table" :data="table_data" border width="100%" stripe>
2023-01-18 17:49:24 +08:00
<el-table-column type="selection" min-width="30" align="center"></el-table-column>
2023-01-18 23:47:38 +08:00
<el-table-column min-width="200" label="员工名称" align="left" fixed="left">
<template #default="rowdata">
<span @click="onShowStaffInfo(rowdata.row)" style="cursor:pointer;display:block;height:100%;">{{
rowdata.row.staff_name
}}</span>
</template>
</el-table-column>
<el-table-column prop="staff_code" min-width="100" label="工号" align="left"></el-table-column>
<el-table-column prop="p13uid" min-width="200" label="P13账号" align="left"></el-table-column>
<el-table-column label="操作" min-width="200" align="center" fixed="right">
<template #default>
<el-button type="warning">编辑</el-button>
<el-button type="danger">删除</el-button>
2023-01-18 17:49:24 +08:00
</template>
</el-table-column>
</el-table>
2023-01-18 00:39:30 +08:00
</div>
2023-01-12 18:16:45 +08:00
</template>
<script>
2023-01-18 17:49:24 +08:00
/* eslint-disable no-unused-vars*/
2023-01-12 18:16:45 +08:00
export default {
name: "staff-info",
2023-01-13 15:15:57 +08:00
data()
{
return {
query_param: {
staff_code: "",
},
2023-01-18 00:39:30 +08:00
table_data: [
{ staff_name: "王炜", staff_code: "588", p13uid: "wangwei-202" },
2023-01-18 17:49:24 +08:00
{ staff_name: "王炜", staff_code: "588", p13uid: "wangwei-202" },
{ staff_name: "王炜", staff_code: "588", p13uid: "wangwei-202" },
{ staff_name: "王炜", staff_code: "588", p13uid: "wangwei-202" },
{ staff_name: "王炜", staff_code: "588", p13uid: "wangwei-202" },
2023-01-18 00:39:30 +08:00
],
2023-01-13 15:15:57 +08:00
};
},
2023-01-18 17:49:24 +08:00
methods: {
onTableEdit(row)
{
},
/**
* 根据表格行index返回样式实现斑马纹
* @param row
* @param rowIndex
* @return 返回的样式名称
*/
tabRowClassName(row, rowIndex)
{
let index = rowIndex + 1;
if (index % 2 == 0)
{
return 'warning-row';
}
},
2023-01-18 23:47:38 +08:00
onShowStaffInfo(staff)
{
console.log("点击名称", staff);
},
2023-01-18 17:49:24 +08:00
},
2023-01-12 18:16:45 +08:00
};
</script>
<style scoped>
2023-01-13 15:15:57 +08:00
.el-row {
display: flex;
justify-content: center;
align-items: center;
}
2023-01-12 18:16:45 +08:00
2023-01-13 15:15:57 +08:00
.el-label {
text-align: right;
}
.query_box {
2023-01-18 11:46:16 +08:00
width: 100%;
2023-01-13 15:15:57 +08:00
background-color: #fff;
border-radius: 5px;
padding: 15px;
2023-01-18 11:46:16 +08:00
margin-bottom: 15px;
text-align: left;
2023-01-13 15:15:57 +08:00
}
2023-01-18 17:49:24 +08:00
.query_box>*+* {
margin-top: 15px;
}
2023-01-18 11:46:16 +08:00
.info_box {
background-color: #fff;
border-radius: 5px;
padding: 15px;
margin-bottom: 15px;
width: 100%;
}
2023-01-18 17:49:24 +08:00
.el-table .warning-row {
background-color: #F3F9FF;
}
2023-01-18 11:46:16 +08:00
.query_box:hover,
.info_box:hover {
2023-01-13 18:00:27 +08:00
box-shadow: 0px 0px 3px 3px #cccccc;
2023-01-13 15:15:57 +08:00
}
2023-01-18 23:47:38 +08:00
div.cell {
height: 100%;
}
2023-01-12 18:16:45 +08:00
</style>