123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <template>
- <div class="container normal-panel">
- <!-- 表格搜索 -->
- <div class="flex-align-center search-panel" style="margin-bottom: 16px">
- <div class="flex-align-center">
- <p>搜索:</p>
- <el-input prefix-icon="el-icon-search" style="width:200px" placeholder="账号,系统名称,联系电话" v-model="param.content.where.condition" class="input-with-select" size="small" @clear="listData('search')" @keyup.native.enter="listData('search')" clearable></el-input>
- </div>
- <div class="flex-align-center" style="margin-left: 30px">
- <p>状态:</p>
- <el-select
- style="width: 120px"
- size="small"
- v-model="status"
- placeholder="请选择"
- @change="listData('search')"
- >
- <el-option
- v-for="item in select"
- :label="item.remarks"
- :value="item.value"
- :key="item.index"
- ></el-option>
- </el-select>
- </div>
- <div class="flex-align-center" style="margin-left: 30px">
- <p style="width:70px">用户类型:</p>
- <el-select
- style="width: 120px"
- size="small"
- v-model="userType"
- placeholder="请选择"
- @change="listData('search')"
- clearable
- >
- <el-option
- v-for="item in userTypeArr"
- :label="item.remarks"
- :value="item.value"
- :key="item.rowindex"
- ></el-option>
- </el-select>
- </div>
- </div>
- <!-- 表格主题 -->
- <tableLayout
- :layout="tablecols"
- :data="list"
- :opwidth="200"
- :custom="true"
- :height="tableHieght"
- >
- <template v-slot:customcol="scope">
- <p v-if="scope.column.columnname === 'status'">
- <span
- :style="
- scope.column.data.status === 'ACTIVE'
- ? 'color:#52C41A'
- : 'color:#FF3B30'
- "
- >{{
- scope.column.data.status === "ACTIVE"
- ? "启用"
- : scope.column.data.status === "INACTIVE"
- ? "停用"
- : "其他"
- }}</span
- >
- </p>
- <p v-else>{{ scope.column.data[scope.column.columnname] }}</p>
- </template>
- <template v-slot:opreation="scope">
- <slot name="detail" :data="scope.data"></slot>
- <slot name="edit" :data="scope.data"></slot>
- <slot name="use" :data="scope.data"></slot>
- <!-- <el-button size="mini" type="text" @click="onDelete(scope)">删 除</el-button> -->
- <slot name="del" :data="scope.data"></slot>
- </template>
- </tableLayout>
- <div style="margin-top: 16px; text-align: right">
- <el-pagination
- background
- small
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-size="param.content.pageSize"
- layout="total, prev, pager, next, jumper"
- :total="total"
- >
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import tableLayout from "../../../components/dynamic-table";
- export default {
- components: {
- tableLayout,
- },
- data() {
- return {
- param: {
- classname: "webmanage.users.users",
- method: "query_userList",
- content: {
- pageNumber: 1,
- pageSize: 20,
- where: {
- condition: "",
- status: "",
- },
- },
- },
- status: "ALL",
- select: [],
- tablecols: [],
- list: [],
- total: 0,
- currentPage: 0,
- value: "",
- userType: '',
- userTypeArr: ''
- };
- },
- methods: {
- listData(issearch) {
- issearch === "search" ? (this.param.content.pageNumber = 1) : "";
- this.param.content.where.usertype = this.userType
- this.param.content.where.status =
- this.status === "ALL" ? "" : this.status;
- this.$api.requested(this.param).then((res) => {
- this.list = res.data;
- this.total = res.total;
- console.log(this.total);
- this.currentPage = res.pageNumber;
- });
- },
- //获取用户类型
- async getRoleData() {
- let param = {
- "accesstoken": "4a6559d45d2a4c6e0ebac2c803344106",
- "classname": "sysmanage.develop.optiontype.optiontype",
- "method": "optiontypeselect",
- "content": {
- "pageNumber": 1,
- "pageSize": 20,
- "typename": "usertype",
- "parameter": {
- }
- }
- }
- let res = await this.$api.requested(param)
- res.data.unshift({
- remarks:'全部',
- rowindex:100,
- value: ''
- })
- this.userTypeArr = res.data
- },
- async userstatus() {
- let param = {
- classname: "sysmanage.develop.optiontype.optiontype",
- method: "optiontypeselect",
- content: {
- pageNumber: 1,
- pageSize: 20,
- typename: "userstatus",
- parameter: {},
- },
- };
- const res = await this.$api.requested(param);
- this.select = res.data;
- console.log(this.select);
-
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.param.content.pageSize = val;
- this.listData();
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.param.content.pageNumber = val;
- this.listData();
- },
- handleSelectionChange(selecttion) {
- this.$emit("handleSelectionChange", selecttion);
- },
- },
- created() {
- this.getRoleData()
- },
- mounted() {
- this.listData();
- this.userstatus();
- this.tablecols = this.tool.tabelCol(
- this.$route.name
- ).accountTable.tablecols;
- },
- };
- </script>
- <style>
- .el-input-group__append,
- .el-input-group__prepend {
- background-color: #4f7bfd;
- color: #fff;
- border: 1px solid #4f7bfd;
- cursor: pointer;
- }
- </style>
- <style scoped>
- .search-panel p {
- flex: 1 0 auto;
- width: 40px;
- font-size: 14px;
- }
- </style>
|