代码提交

This commit is contained in:
jiang 2025-12-24 18:41:30 +08:00
parent 91ac49e120
commit 0be9ab90c9
5 changed files with 231 additions and 9 deletions

View File

@ -37,6 +37,15 @@ export function getLeaseDevListApi(query) {
} }
export function getCategoryListApi(query) {
return request({
url: '/material-mall/comprehensive/getCategoryList',
method: 'get',
params: query
})
}

View File

@ -131,7 +131,7 @@
<span v-if="scope.row.manageType==0">{{ scope.row.num }}</span> <span v-if="scope.row.manageType==0">{{ scope.row.num }}</span>
<el-input-number v-if="scope.row.manageType==1" :disabled="routerParams.isView" <el-input-number v-if="scope.row.manageType==1" :disabled="routerParams.isView"
v-model="scope.row.num" v-model="scope.row.num"
:min="0" :max="scope.row.num" :default-value="0" style="width: 120px" :min="0" :max="scope.row.useNum" :default-value="0" style="width: 120px"
@change="applyNumChange(scope.row)" @change="applyNumChange(scope.row)"
/> />
</template> </template>
@ -642,7 +642,6 @@ export default {
this.$message.error(res.msg || '操作失败') this.$message.error(res.msg || '操作失败')
} }
} catch (error) { } catch (error) {
this.$message.error('提交申请时发生错误')
console.log('🚀 ~ error:', error) console.log('🚀 ~ error:', error)
} finally { } finally {
this.isLoading = false this.isLoading = false

View File

@ -329,7 +329,7 @@ export default {
// ID // ID
if (this.currentRowId !== null) { if (this.currentRowId !== null) {
// //
const targetRow = this.tableList.find(item => item.keyId === this.currentRowId) const targetRow = this.tableList.find(item => item.id === this.currentRowId)
if (targetRow) { if (targetRow) {
// bmFileInfos // bmFileInfos
if (!targetRow.bmFileInfos) { if (!targetRow.bmFileInfos) {
@ -358,8 +358,8 @@ export default {
// ID // ID
beforeFileUpload(row) { beforeFileUpload(row) {
this.currentRowId = row.keyId this.currentRowId = row.id
console.log('记录当前行ID:', row.keyId) console.log('记录当前行ID:', row.id)
}, },
// //

View File

@ -0,0 +1,209 @@
<template>
<div class="app-container">
<!-- 搜索表单 -->
<el-form
ref="searchFormRef"
:model="searchParams"
:inline="true"
label-width="auto"
size="small"
>
<el-card class="search-box">
<el-row style="height: 32px">
<el-col :span="4">
<el-form-item prop="keyWord">
<el-input
v-model="searchParams.keyWord"
placeholder="请输入"
clearable
@keyup.enter.native="handleQuery"
maxlength="20"
style="width: 220px"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
</el-col>
</el-row>
</el-card>
</el-form>
<!-- 主内容卡片 -->
<el-card class="content-box">
<!-- 地址列表表格 -->
<el-table
:data="addressList"
border
stripe
height="400"
show-overflow-tooltip
>
<el-table-column
label="类目"
align="center"
prop="equipmentName"
min-width="200"
>
<template slot-scope="scope">
<!-- 关键 v-html 渲染带 HTML 标签的高亮文本 -->
<span v-html="highlightKeyword(scope.row.highlightEquipmentName)"></span>
</template>
</el-table-column>
<el-table-column
label="类型"
align="center"
prop="devType"
width="400"
>
</el-table-column>
</el-table>
<!-- 分页组件 -->
</el-card>
</div>
</template>
<script>
import { getCategoryListApi } from '@/api/search/equipment'
export default {
name: 'Category',
data() {
return {
//
addressList: [],
//
searchParams: {
keyWord: ''
}
}
},
methods: {
handleQuery() {
this.initData()
},
async initData() {
await getCategoryListApi(this.searchParams).then((response) => {
this.addressList = response.data
})
},
resetQuery() {
this.resetForm('searchFormRef')
this.addressList = []
},
highlightKeyword(str) {
if (!str) return '';
return str.replace(/\{\{(.*?)}}/g, '<span style="color:red; font-weight:600;">$1</span>');
},
}
}
</script>
<style lang="scss" scoped>
.app-container {
height: 100%;
.search-box {
margin-bottom: 20px;
border-radius: 8px;
padding: 0;
::v-deep .el-card__body {
padding: 20px !important;
}
}
.content-box {
border-radius: 8px;
height: calc(100vh - 225px);
display: flex;
flex-direction: column;
::v-deep .el-card__body {
display: flex;
flex-direction: column;
height: 100%;
padding: 20px;
}
.action-bar {
margin-bottom: 16px;
text-align: right;
flex-shrink: 0;
}
.pagination-wrapper {
flex-shrink: 0;
padding-top: 6px;
margin-top: auto;
::v-deep .pagination-container {
padding: 0 20px;
}
}
}
.danger-text {
color: #F56C6C;
&:hover {
color: #f78989;
}
}
}
//
::v-deep .el-table {
flex: 1;
min-height: 0;
&.el-table--striped {
.el-table__body {
tr.el-table__row--striped {
td {
background-color: #F6FBFA !important;
}
}
}
}
.el-table__header {
background: #E9F0EE;
th {
background: #E9F0EE !important;
color: #606266;
font-weight: 600;
height: 50px;
}
}
&.el-table--striped {
.el-table__body {
tr.el-table__row:hover > td.el-table__cell {
background-color: #CCF1E9 !important;
}
}
}
}
//
::v-deep .el-pagination {
&.is-background {
.el-pager {
li.is-active {
background-color: #3cb4a6;
}
}
}
}
//
.dialog-footer {
text-align: center;
}
</style>

View File

@ -71,7 +71,7 @@
<!-- 数据列表 --> <!-- 数据列表 -->
<el-card class="content-box"> <el-card class="content-box">
<el-row style="margin-bottom: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 10px;"> <el-row style=" display: flex; justify-content: flex-end; align-items: center; gap: 10px;">
<el-button <el-button
type="warning" type="warning"
plain plain
@ -112,7 +112,7 @@
<el-table-column align="center" label="序号" type="index" width="80"/> <el-table-column align="center" label="序号" type="index" width="80"/>
<el-table-column align="center" prop="pro_name" label="项目名称"/> <el-table-column align="center" prop="pro_name" show-overflow-tooltip label="项目名称" />
<el-table-column align="center" prop="pro_code" label="项目编号"> <el-table-column align="center" prop="pro_code" label="项目编号">
@ -1006,7 +1006,12 @@ export default {
} }
} }
.app-container{
overflow-y:unset;
}
.app-container-content { .app-container-content {
height: calc(100vh - 120px);
::v-deep .el-dialog { ::v-deep .el-dialog {
display: flex !important; display: flex !important;
flex-direction: column !important; flex-direction: column !important;
@ -1015,11 +1020,11 @@ export default {
top: 50% !important; top: 50% !important;
left: 50% !important; left: 50% !important;
transform: translate(-50%, -50%) !important; transform: translate(-50%, -50%) !important;
max-height: 100vh !important; height: calc(100vh - 120px);
.el-dialog__body { .el-dialog__body {
flex: 1; flex: 1;
overflow-y: scroll !important;
padding: 20px 40px; padding: 20px 40px;
} }