123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <template>
- <div class="app-container">
- <!-- 筛选start -->
- <div class="filter-container mb-10">
- <div class="left">
- <div>
- <span class="" style="margin-right: 30px">用户管理列表</span>
- <el-button icon="el-icon-plus" type="success" @click="addItem()"
- >新增</el-button
- >
- </div>
- <div style="margin-top: 20px">
- <div class="filter-item" >
- 姓名:
- <el-input
- v-model="userName"
- placeholder="请输入内容"
- style="width: 180px"
- ></el-input>
- </div>
- <div class="filter-item" >
- 手机号:
- <el-input
- v-model="phone"
- placeholder="请输入内容"
- style="width: 180px"
- ></el-input>
- </div>
- <div class="filter-item">
- 所属企业:
- <el-select
- v-model="region"
- placeholder="请选择"
- style="width: 150px"
- >
- <el-option label="企业一" value="1"></el-option>
- <el-option label="企业二" value="2"></el-option>
- </el-select>
- </div>
- <div class="filter-item">
- 角色:
- <el-select
- v-model="role"
- placeholder="请选择"
- style="width: 200px"
- >
- <el-option label="角色1" value="1"></el-option>
- <el-option label="角色2" value="2"></el-option>
- </el-select>
- </div>
- <el-button type="primary" icon="el-icon-search" class="search-button"
- >查询</el-button
- >
- </div>
- </div>
- <div class="right">
- <el-button type="primary">导出</el-button>
- </div>
- </div>
- <!-- 筛选end -->
- <!-- 表格start -->
- <el-table
- :data="tableData"
- border
- stripe
- :header-cell-style="headClass"
- >
- <el-table-column prop="xh" label="序号" width="70">
- </el-table-column>
- <el-table-column prop="userName" label="姓名" width="">
- </el-table-column>
- <el-table-column prop="sex" label="性别" width="">
- </el-table-column>
- <el-table-column prop="contact" label="联系方式" width="">
- </el-table-column>
- <el-table-column prop="password" label="密码" width="">
- </el-table-column>
- <el-table-column prop="ownerCompany" label="所属企业" width="">
- </el-table-column>
- <el-table-column prop="role" label="角色" width="">
- </el-table-column>
- <el-table-column fixed="right" label="操作" width="180">
- <template #default="scope">
- <el-button
- @click="checkItem(scope.$index, scope.row)"
- type="text"
- size="small"
- class="delete-text"
- >查看</el-button
- >
- <el-button
- type="text"
- size="small"
- @click.prevent="editRow(scope.row)"
- >编辑</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <!-- 表格end -->
- <!-- 分页start -->
- <div class="paginationBlock">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage4"
- :page-sizes="[100, 200, 300, 400]"
- :page-size="100"
- layout="total, sizes, prev, pager, next, jumper"
- :total="400"
- >
- </el-pagination>
- </div>
- <!-- 分页end -->
- <!--弹框组件开始-----------------------start-->
- <dialog-component
- :dialogTitle="dialogTitle"
- :itemInfo="tableItem"
- @closeDialog="closeDialog"
- :flag="showDialog"
- ></dialog-component>
- <!--弹框组件开始-----------------------end-->
- </div>
- </template>
- <script>
- import { defineComponent, ref,reactive} from 'vue'
- import DialogComponent from "./dialogComponent";
- export default defineComponent({
- components: { DialogComponent},
- setup() {
- const userName = ref('')
- const phone = ref('')
- const region = ref('')
- const role = ref('')
- const currentPage4 = ref(4)
- const dialogTitle = ref('')
- const showDialog = ref(false)
- const tableData = ref([
- {
- xh: "1",
- userName: "张三",
- sex: "男",
- contact: "12345678989 ",
- password: "123456",
- role: "维保 ",
- ownerCompany: "伍继",
- },
- {
- xh: "1",
- userName: "张三",
- sex: "男",
- contact: "12345678989 ",
- password: "123456",
- ownerCompany: "伍继",
- role: "维保 ",
- }
- ])
- const handleSizeChange=(val)=> {
- console.log(`每页 ${val} 条`);
- }
- const handleCurrentChange=(val)=> {
- console.log(`当前页: ${val}`);
- }
- // // 表头样式设置
- const headClass=()=> {
- return "background:#FAFAFA;";
- }
- const tableItem = reactive([])
- // 添加操作
- const addItem=()=> {
- tableItem.value = {
- id: "",
- stationName: "",
- xh: "",
- userName: "",
- siteList: [],
- done: "",
- guaZai: "",
- checked: true,
- };
- dialogTitle.value = "新增";
- showDialog.value = true;
- }
- // 查看
- const checkItem=(row)=> {
- console.log(row)
- tableItem.value = row
- dialogTitle.value = '查看'
- showDialog.value = true
- }
- // 编辑操作
- const editRow = (row) => {
- console.log(row)
- tableItem.value = row
- dialogTitle.value = '编辑'
- showDialog.value = true
- }
- // 关闭操作
- const closeDialog = () => {
- showDialog.value = false
- }
- return {
- userName,
- phone,
- region,
- role,
- tableItem,
- currentPage4,
- dialogTitle,
- showDialog,
- tableData,
- handleSizeChange,
- handleCurrentChange,
- headClass,
- checkItem,
- addItem,
- editRow,
- closeDialog,
- }
- },
- })
- </script>
- <style lang="scss" scoped>
- </style>
|