整体table 查询 重置 样式修改

This commit is contained in:
lSun 2026-01-27 14:09:35 +08:00
parent e8451ed736
commit 875aaf6def
8 changed files with 111 additions and 83 deletions

View File

@ -260,7 +260,7 @@
<div class="menu-warp" @mouseleave="handleBoxLeave">
<div class="menu-list">
<div class="list-box" v-for="(item, i) in currentMenu.children || []" :key="i" v-if="!item.hidden">
<div class="menu-title-top" v-if="currentMenu && currentMenu.meta">
<div class="menu-title-top" style="height: 30px;" v-if="currentMenu && currentMenu.meta">
<div class="title-tip"></div>
<span class="title-text">{{ item.meta.title }}</span>
</div>
@ -326,7 +326,7 @@
<div v-else class="menu-title" @click="goRoute(child)">
<div class="children-title-tip"></div>
<span style="color: #095a4d">{{ child.meta.title }}</span>
<span style="color: #095a4d">{{ child.meta.title }}</span>
<span class="menu-star" :class="{noCollect:child.isCollect==0,isCollect:child.isCollect==1}">
<img src="@/assets/images/star.png" style="width: 10px; height: 9px" @click.prevent.stop="handleCollection(child)"/>
</span>
@ -355,7 +355,7 @@
<div>
<img src="../../assets/images/noData.png" style="width: 170px;height: 170px;" alt="">
<div style="width: 100%;text-align: center;font-size: 18px;color: #999;">暂无数据</div>
</div>
</div>
</div>
</div>
</div>
@ -370,7 +370,7 @@
<div>
<img src="../../assets/images/noData.png" style="width: 170px;height: 170px;" alt="">
<div style="width: 100%;text-align: center;font-size: 18px;color: #999;">暂无数据</div>
</div>
</div>
</div>
</div>
</div> -->
@ -487,7 +487,7 @@ export default {
},
},
changCollectStatus() {
return
return
},
},
created() {
@ -522,7 +522,7 @@ export default {
this.zhinengList = []
}
console.log(res)
} catch (error) {
} catch (error) {
console.error(error)
}
},
@ -662,28 +662,28 @@ export default {
async handleCollection(route) {
console.log("route2",route)
if(route.isCollect==0){
try {
try {
let param = {
menuId:route.id
}
const res = await addMenuCollect(param)
if (res.code === 200) {
this.$message.success('菜单收藏成功')
this.$message.success('菜单收藏成功')
this.$nextTick(()=>{
this.changCollection(this.menuList,route.id,1)
})
})
this.$forceUpdate()
this.showMenuBox = false
} else {
this.$message.error(res.msg || '菜单收藏失败')
this.$message.error(res.msg || '菜单收藏失败')
this.changCollection(this.menuList,route.id,0)
}
}
} catch (error) {
this.$message.error('菜单收藏失败:' + (error.message || '未知错误'))
console.error(error)
}
}else if(route.isCollect==1){
try {
try {
let param = {
menuId:route.id
}
@ -699,7 +699,7 @@ export default {
} else {
this.$message.error(res.msg || '取消收藏失败')
this.changCollection(this.menuList,route.id,1)
}
}
} catch (error) {
this.$message.error('取消收藏失败:' + (error.message || '未知错误'))
console.error(error)
@ -708,7 +708,7 @@ export default {
},
changCollection(array,targetId,status){
for (let obj of array) {
if (obj.id === targetId) {
if (obj.id === targetId) {
this.$set(obj,"isCollect",status)
obj.isCollect=status;
}
@ -744,7 +744,7 @@ export default {
::v-deep.el-drawer.rtl{
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
}
}
.myCollect-box{
width: 100%;height: 100%;background: #FAFAFA;overflow-y: auto;
@ -755,7 +755,7 @@ export default {
.myCollect-box-zhineng{
padding: 16px;
margin-bottom: 10px;
background-color: #fff;
background-color: #fff;
}
.myCollect-box-zhineng-title{
font-size: 18px;
@ -888,7 +888,7 @@ export default {
.right-menu-item {
display: inline-block;
padding: 0 13px;
padding: 0 16px;
height: 100%;
font-size: 18px;
color: #bfbfbf; /* 纯黑色,比#262626更黑 */
@ -986,6 +986,8 @@ export default {
display: flex;
align-items: center;
cursor: pointer;
margin: 5px 0;
height: 27px;
//
&:hover {

View File

@ -361,15 +361,15 @@
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getDeviceList"
:columns="columns2" style="margin-left: 20px;margin-right: 20px;"
:columns="columns2"
></right-toolbar>
<el-dropdown size="mini" style="float: right;" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-dropdown size="mini" style="float: right;margin-right: 10px;" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-button plain size="mini" class="el-dropdown-link">
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleDownloadPage">导出当前页</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <span>
@ -1261,7 +1261,7 @@ export default {
//
handleCommand(command) {
switch (command) {
switch (command) {
case 'handleDownloadAll':
this.exportData()
break

View File

@ -263,15 +263,15 @@ export default {
},
//
handleAdd() {
this.$router.push({ path: '/business/warehouse/details',query: { isEdit: false } })
this.$router.push({ path: '/all/business/warehouse/details',query: { isEdit: false } })
},
//
handleView(row) {
this.$router.push({ path: '/business/warehouse/details', query: { id: row.id, isView: true } })
this.$router.push({ path: '/all/business/warehouse/details', query: { id: row.id, isView: true } })
},
//
handleEdit(row) {
this.$router.push({ path: '/business/warehouse/details', query: { id: row.id, isEdit: true } })
this.$router.push({ path: '/all/business/warehouse/details', query: { id: row.id, isEdit: true } })
},
//
handleDelete(row) {

View File

@ -86,57 +86,48 @@
><svg-icon icon-class="download"/> 导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
<el-col :span="1.5">
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
:columns="columns"
></right-toolbar>
</el-col>
</el-row>
</div>
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="supplierId" height="546px" stripe>
<!-- <el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> -->
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="厂家ID" align="center" prop="supplierId" width="100" sortable/> -->
<el-table-column label="统一社会信用代码" align="center" prop="supplierCode" sortable width="220"/>
<el-table-column label="厂家名称" align="center" prop="supplierName" sortable/>
<el-table-column label="联系人" align="center" prop="contactPerson" sortable/>
<el-table-column label="联系电话" align="center" prop="contactPhone" sortable/>
<el-table-column label="厂家地址" align="center" prop="address" sortable show-overflow-tooltip/>
<el-table-column label="资质/执照编号" align="center" prop="qualification" sortable/>
<el-table-column label="状态" align="center" prop="status" width="100">
<template slot-scope="{ row }">
<el-tag size="small" type="success" v-if="row.status === 1">启用</el-tag>
<el-tag size="small" type="info" v-else>停用</el-tag>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" sortable/>
<el-table-column label="创建时间" align="center" prop="createTime" sortable/>
<el-table-column label="更新时间" align="center" prop="updateTime" sortable/>
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
type="text"
@click="handleUpdate(scope.row)"
>
编辑
</el-button>
<el-button
type="text"
@click="handleDelete(scope.row)"
style="color: #FF5129;"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table v-loading="loading" :data="houseList" ref="multipleTable" row-key="supplierId" height="546px" stripe>
<el-table-column label="序号" align="center" width="80" type="index">
<template slot-scope="scope">
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
</template>
</el-table-column>
<!-- 修正统一社会信用代码列的判断条件 -->
<!-- 动态渲染列核心修改 -->
<el-table-column
v-for="(item, index) in columns"
:key="index"
:label="item.label"
:prop="item.prop"
:width="item.width"
:align="item.align || 'center'"
v-if="item.visible"
>
<!-- 状态列自定义渲染如果有 -->
<template v-slot="{ row }" v-if="item.prop === 'status'">
<el-tag size="small" type="success" v-if="row.status === 1">启用</el-tag>
<el-tag size="small" type="danger" v-else>停用</el-tag>
</template>
</el-table-column>
<!-- 优化操作列强制显示去掉v-if或改为v-if="true" -->
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="text" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" style="color: #FF5129;">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
@ -417,6 +408,22 @@
//
url: process.env.VUE_APP_BASE_API + '/file/upload'
},
// keyproplabel
columns: [
{ key: 1, label: '统一社会信用代码', prop: 'supplierCode', visible: true, width: 220 },
{ key: 2, label: '厂家名称', prop: 'supplierName', visible: true, width: 150 },
{ key: 3, label: '联系人', prop: 'contactPerson', visible: true, width: 120 },
{ key: 4, label: '联系电话', prop: 'contactPhone', visible: true, width: 120 },
{ key: 5, label: '厂家地址', prop: 'address', visible: true, width: 200 },
{ key: 6, label: '资质/执照编号', prop: 'qualification', visible: true, width: 180 },
{ key: 7, label: '状态', prop: 'status', visible: true, width: 100 },
{ key: 8, label: '备注', prop: 'remark', visible: true, width: 150 },
{ key: 9, label: '创建时间', prop: 'createTime', visible: true, width: 180 },
{ key: 10, label: '更新时间', prop: 'updateTime', visible: true, width: 180 }
],
columns2: [],
};
},
computed: {
@ -428,6 +435,7 @@
},
created() {
this.getList();
this.columns2 = [...this.columns];
},
methods: {
//fileList raw
@ -825,6 +833,24 @@
this.getList();
},
//
handleFieldChange(checkedKeys) {
this.checkedFields = checkedKeys;
//
// localStorage.setItem('supplierTableFields', JSON.stringify(checkedKeys));
},
//
initTableFields() {
const savedFields = localStorage.getItem('supplierTableFields');
if (savedFields) {
this.checkedFields = JSON.parse(savedFields);
} else {
this.checkedFields = this.tableFields.filter(item => item.checked).map(item => item.key);
}
}
}
};
</script>

View File

@ -22,7 +22,7 @@
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="20" style="text-align: right;">
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
</el-col>

View File

@ -219,7 +219,7 @@ export default {
handleAdd() {
this.$router
.push({
path: '/stockManagement/entryApply/apply',
path: '/all/stockManagement/entryApply/apply',
query: { isAddVisible: false, isApprovalVisible: false }
})
.then(() => {
@ -230,7 +230,7 @@ export default {
handleEdit(row) {
this.$router
.push({
path: '/stockManagement/entryApply/apply',
path: '/all/stockManagement/entryApply/apply',
query: {
id: row.id,
orderId: row.orderId,

View File

@ -101,13 +101,13 @@
<!-- <el-button style="background-color:#fff;border: 1px solid #d9d9d9;color:rgba(0,0,0,.65)" type="primary" size="mini" @click="handleExport">
<svg-icon icon-class="download"/> 导出
</el-button> -->
<el-dropdown size="mini" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-dropdown size="mini" style="margin-right: 10px;" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-button plain size="mini" class="el-dropdown-link">
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleDownloadPage">导出当前页</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
@ -661,7 +661,7 @@ export default {
//
handleCommand(command) {
switch (command) {
switch (command) {
case 'handleDownloadAll':
this.handleExport()
break

View File

@ -113,13 +113,13 @@
<!-- <el-button style="background-color:#fff;border: 1px solid #d9d9d9;color:rgba(0,0,0,.65)" type="primary" size="mini" @click="handleExport">
<svg-icon icon-class="download"/> 导出
</el-button> -->
<el-dropdown size="mini" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-dropdown size="mini" style="margin-right: 10px;" placement="bottom-start" trigger="click" @visible-change="handleVisibleChange" @command="(command) => handleCommand(command)">
<el-button plain size="mini" class="el-dropdown-link">
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
导出 <i class="el-icon-arrow-up el-icon--right" :class="{ 'rotate': isDropdownOpen }"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="handleDownloadPage">导出当前页</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
<el-dropdown-item command="handleDownloadAll">导出全部</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"/>
@ -589,7 +589,7 @@ export default {
// },
//
handleCommand(command) {
switch (command) {
switch (command) {
case 'handleDownloadAll':
this.handleExport()
break