This commit is contained in:
木瓜一块八 2025-08-20 14:26:14 +08:00
parent 97d54661f0
commit 415ae87cbc
4 changed files with 95 additions and 20 deletions

View File

@ -14,7 +14,8 @@ export default {
return { return {
role:{ role:{
role_type:'customer', role_type:'customer',
audit_status:'approved' audit_status:'approved,rejected',
type:'user'
} }
} }
}, },

View File

@ -22,12 +22,18 @@
</div> </div>
<div class="table-box"> <div class="table-box">
<div style="margin-bottom: 10px;"> <div style="margin-bottom: 10px;">
<el-radio-group v-if="role.type == 'app'" v-model="searchData.radioType" class="radio-group" <el-radio-group v-if="role.type == 'user'" v-model="searchData.radioType" class="radio-group"
size="mini" @change="handleRadioChange"> size="mini" @change="handleRadioChange">
<el-radio-button v-for="item in radioOptions" :key="item.value" :label="item.value"> <el-radio-button v-for="item in radioOptions" :key="item.value" :label="item.value">
{{ item.label }} {{ item.label }}
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
<el-radio-group v-if="role.type == 'app'" v-model="searchData.radioType" class="radio-group"
size="mini" @change="handleRadioChange">
<el-radio-button v-for="item in userMap" :key="item.value" :label="item.value">
{{ item.label }}
</el-radio-button>
</el-radio-group>
<!-- <el-button style="margin-left: 10px;" size="mini" @click="openAddDialog"> <!-- <el-button style="margin-left: 10px;" size="mini" @click="openAddDialog">
<i class="el-icon-plus"></i> 添加{{ searchData.radioType === '1' || searchData.radioType === '3' ? <i class="el-icon-plus"></i> 添加{{ searchData.radioType === '1' || searchData.radioType === '3' ?
'需求' : '商品' }} '需求' : '商品' }}
@ -39,7 +45,7 @@
<el-table size="large" border height="calc(100vh - 210px)" v-loading="loading" :data="tableData" <el-table size="large" border height="calc(100vh - 210px)" v-loading="loading" :data="tableData"
style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..." style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)"> element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
<el-table-column prop="date" label="图片" width="180"> <el-table-column v-if="searchData.radioType!='1'&&searchData.radioType!='3'" prop="date" label="图片" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<el-image v-if="scope.row.img" :src="scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png'" <el-image v-if="scope.row.img" :src="scope.row.img || 'https://www.kaiyuancloud.cn/idfile?path=logo_ncmatch.png'"
style="width: 80px; height: 60px;border: 1px solid #ccc;border-radius: 6px;" style="width: 80px; height: 60px;border: 1px solid #ccc;border-radius: 6px;"
@ -86,11 +92,11 @@
<el-button v-if="role.role_type == 'customer'" type="text" size="large" <el-button v-if="role.role_type == 'customer'" type="text" size="large"
@click="openDetail(scope.row, 2)">审核</el-button> @click="openDetail(scope.row, 2)">审核</el-button>
<el-button <el-button
:disabled="scope.row.audit_status=='rejected'||scope.row.audit_status === 'approved' && scope.row.listing_status === 'listing'" :disabled="scope.row.audit_status !== 'approved' || scope.row.listing_status === 'listing'"
@click="grounding(scope.row, 'listing')" type="text" style="color: #67C23A;" @click="grounding(scope.row, 'listing')" type="text" style="color: #67C23A;"
size="large">上架</el-button> size="large">上架</el-button>
<el-button <el-button
:disabled="scope.row.audit_status=='rejected'||scope.row.audit_status === 'approved' && scope.row.listing_status === 'delisting'" :disabled="scope.row.audit_status !== 'approved' || scope.row.listing_status === 'delisting'"
@click="grounding(scope.row, 'delisting')" type="text" size="large">下架</el-button> @click="grounding(scope.row, 'delisting')" type="text" size="large">下架</el-button>
<el-button type="text" size="large" @click="exportData(scope.row)">导出</el-button> <el-button type="text" size="large" @click="exportData(scope.row)">导出</el-button>
<el-popconfirm v-if="role.role_type == 'customer'" title="确定删除该条目吗?" <el-popconfirm v-if="role.role_type == 'customer'" title="确定删除该条目吗?"
@ -160,6 +166,20 @@ export default {
current_page: 1, current_page: 1,
page_size: 8, page_size: 8,
}, },
userMap: [
{
label: '用户需求',
value: '1',
publish_type: '2',
manager_self: null,
},
{
label: '用户商品',
value: '2',
publish_type: '1',
manager_self: null,
},
],
radioMap: { radioMap: {
'1': { '1': {
label: '用户需求', label: '用户需求',
@ -246,7 +266,15 @@ export default {
this.searchData.audit_status = this.role.audit_status; this.searchData.audit_status = this.role.audit_status;
} }
if (this.role && this.role.publish_type) { if (this.role && this.role.publish_type) {
if (this.role.type === 'app') {
this.searchData.publish_type = this.role.publish_type; this.searchData.publish_type = this.role.publish_type;
} else if (this.role.type === 'user') {
const selectedItem = this.userMap.find(item => item.value === this.role.publish_type);
if (selectedItem) {
this.searchData.publish_type = selectedItem.publish_type;
this.searchData.manager_self = selectedItem.manager_self;
}
}
} }
this.getTableData(); this.getTableData();
}, },
@ -321,8 +349,22 @@ export default {
this.sendProductData = item; this.sendProductData = item;
}, },
handleRadioChange(value) { handleRadioChange(value) {
//
if (this.role.type === 'user') {
// user
const selectedItem = this.userMap.find(item => item.value === value);
if (selectedItem) {
this.searchData.publish_type = selectedItem.publish_type;
this.searchData.manager_self = selectedItem.manager_self;
}
} else {
// app 使 radioMap
if (this.radioMap[value]) {
this.searchData.publish_type = this.radioMap[value].publish_type; this.searchData.publish_type = this.radioMap[value].publish_type;
this.searchData.manager_self = this.radioMap[value].manager_self; this.searchData.manager_self = this.radioMap[value].manager_self;
}
}
// //
this.searchData.current_page = 1; this.searchData.current_page = 1;
this.getTableData(); this.getTableData();
@ -403,7 +445,12 @@ export default {
this.loading = true; this.loading = true;
if(to_excel==='1'){ if(to_excel==='1'){
this.searchData.to_excel=to_excel this.searchData.to_excel=to_excel
reqSearchByMangement({url_link:window.location.href,to_excel:to_excel,publish_type:this.searchData.publish_type}).then(res => { reqSearchByMangement({
url_link: window.location.href,
to_excel: to_excel,
publish_type: this.searchData.publish_type,
manager_self: this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null
}).then(res => {
console.log(res); console.log(res);
if (res.status) { if (res.status) {
// Workbook // Workbook
@ -420,7 +467,34 @@ export default {
this.loading = false; this.loading = false;
}) })
}else{ }else{
reqSearchByMangement(this.searchData).then(res => { // manager_self
let manager_self = null;
let publish_type = null;
if (this.role.type === 'user') {
const selectedItem = this.userMap.find(item => item.value === this.searchData.radioType);
if (selectedItem) {
publish_type = selectedItem.publish_type;
manager_self = this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null;
}
} else if (this.role.type === 'app') {
if (this.radioMap[this.searchData.radioType]) {
publish_type = this.radioMap[this.searchData.radioType].publish_type;
manager_self = this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null;
}
}
//
const requestData = {
...this.searchData,
publish_type: publish_type,
manager_self: manager_self
};
console.log('请求参数:', requestData);
requestData.manager_self=this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null
requestData.publish_type = this.searchData.radioType=='1'||this.searchData.radioType=='3'?'2':'1'
reqSearchByMangement(requestData).then(res => {
console.log(res); console.log(res);
if (res.status) { if (res.status) {
this.tableData = res.data.product_list; this.tableData = res.data.product_list;

View File

@ -19,7 +19,7 @@ export default {
} }
}, },
created(){ created(){
this.initData() // this.initData()
}, },
} }
</script> </script>

View File

@ -274,11 +274,11 @@ export default Vue.extend({
<span class="leftText"> <span class="leftText">
NCMatch &nbsp;&nbsp; NCMatch &nbsp;&nbsp;
</span> </span>
<span class="rightText" style="margin-left: 10px;"> 您身边的AI管家</span> <span class="rightText" style="margin-left: 10px;"> 算力供需对接平台</span>
</span> </span>
<!-- <span class="description">支持模型训练推理和数据处理灵活配置助您高效释放AI潜能</span>--> <!-- <span class="description">支持模型训练推理和数据处理灵活配置助您高效释放AI潜能</span>-->
<ul style="margin-top: 50px" class="tagUl"> <ul style="margin-top: 50px" class="tagUl">
<li> AI </li> <li>海量资源 <span style="display: inline-block;margin: 0 15px;"></span> 物美价廉</li>
</ul> </ul>
</div> </div>
</div> </div>