refactor: eslint代码检查优化
Former-commit-id: 4c11b5d0cdd10f28148cf3d9b593f85e082cdc51
This commit is contained in:
@@ -2,54 +2,35 @@
|
||||
<div class="app-container">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="queryParams.nickName"
|
||||
placeholder="会员昵称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.nickName" placeholder="会员昵称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" :icon="Search" @click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button type="primary" :icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button :icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="memberList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table v-loading="loading" :data="memberList" border @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" />
|
||||
<el-table-column type="expand" width="120" label="会员地址">
|
||||
<template #default="scope">
|
||||
<el-table :data="scope.row.addressList" size="small" border>
|
||||
<el-table-column
|
||||
type="index"
|
||||
label="序号"
|
||||
width="100"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column type="index" label="序号" width="100" align="center" />
|
||||
<el-table-column align="center" label="收货人" prop="name" />
|
||||
<el-table-column align="center" label="联系方式" prop="mobile" />
|
||||
<el-table-column align="center" label="收货地址">
|
||||
<template #default="scope">
|
||||
{{
|
||||
scope.row.province +
|
||||
scope.row.city +
|
||||
scope.row.area +
|
||||
scope.row.address
|
||||
scope.row.city +
|
||||
scope.row.area +
|
||||
scope.row.address
|
||||
}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="邮编" prop="zipCode" />
|
||||
<el-table-column align="center" label="是否默认">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.defaulted == 1" type="success"
|
||||
>是</el-tag
|
||||
>
|
||||
<el-tag v-if="scope.row.defaulted == 1" type="success">是</el-tag>
|
||||
<el-tag v-if="scope.row.defaulted == 0" type="info">否</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -71,10 +52,7 @@
|
||||
<el-popover placement="right" :width="400" trigger="hover">
|
||||
<img :src="scope.row.avatarUrl" width="400" height="400" />
|
||||
<template #reference>
|
||||
<img
|
||||
:src="scope.row.avatarUrl"
|
||||
style="max-height: 60px; max-width: 60px"
|
||||
/>
|
||||
<img :src="scope.row.avatarUrl" style="max-height: 60px; max-width: 60px" />
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
@@ -98,23 +76,18 @@
|
||||
</el-table>
|
||||
|
||||
<!-- 分页工具条 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, onMounted, toRefs } from "vue";
|
||||
import { ElTable, ElMessage, ElMessageBox } from "element-plus";
|
||||
import { Search, Plus, Edit, Refresh, Delete } from "@element-plus/icons-vue";
|
||||
import { ElTable } from "element-plus";
|
||||
import { Search, Refresh } from "@element-plus/icons-vue";
|
||||
|
||||
import { listMemeberPages } from "@/api/ums/member";
|
||||
import { MemberQueryParam,MemberItem } from "@/types";
|
||||
import { MemberQueryParam, MemberItem } from "@/types";
|
||||
|
||||
const state = reactive({
|
||||
// 遮罩层
|
||||
@@ -128,17 +101,17 @@ const state = reactive({
|
||||
total: 0,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 10
|
||||
} as MemberQueryParam,
|
||||
memberList: [] as MemberItem[]
|
||||
});
|
||||
|
||||
const { loading, ids, single, multiple, queryParams, memberList, total } =
|
||||
const { loading, queryParams, memberList, total } =
|
||||
toRefs(state);
|
||||
|
||||
function handleQuery() {
|
||||
state.loading = true;
|
||||
listMemeberPages(state.queryParams).then(({data}) => {
|
||||
listMemeberPages(state.queryParams).then(({ data }) => {
|
||||
state.memberList = data.list;
|
||||
state.total = data.total;
|
||||
state.loading = false;
|
||||
@@ -149,7 +122,7 @@ function resetQuery() {
|
||||
state.queryParams = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
nickName: undefined,
|
||||
nickName: ''
|
||||
};
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user