mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-09 10:56:46 +08:00
致灰
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
|
||||
<a-button @click="() => handleOper(record,'withdraw',record.recommendStatus)"
|
||||
type="link"
|
||||
:class="aa()>=3? `${record.recommendStatus==0?'grey':''}`:''"
|
||||
:class="aa()>=3? `${record.recommendStatus!==1?'grey':''}`:''"
|
||||
>
|
||||
{{ status[record.recommendStatus] }}
|
||||
</a-button>
|
||||
@@ -95,6 +95,7 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<!-- <a-alert message="Success Text" type="success" v-if="aa().length>=3"/> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -150,13 +151,16 @@ export default defineComponent({
|
||||
const handleMsg = {
|
||||
withdraw1: "课程已被推荐,点击可以取消推荐",
|
||||
withdraw: "课程未被推荐,点击可以设为推荐",
|
||||
withdraw3: "课程未被推荐,点击可以设为推荐",
|
||||
};
|
||||
//点击按钮
|
||||
function handleOper(record, type, status = '') {
|
||||
const aa = computed(()=>{
|
||||
return state.recommendStatu
|
||||
})
|
||||
if(aa.value>=3){
|
||||
if(record.recommendStatus==0){
|
||||
if(record.recommendStatus!==1){
|
||||
alert('最多三个')
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -168,8 +172,6 @@ export default defineComponent({
|
||||
withdraw: async () => {
|
||||
try {
|
||||
await recommend({ courseId: record.id });
|
||||
console.log('record.11111',record.recommendStatus)
|
||||
|
||||
getTableDate();
|
||||
} catch (error) {
|
||||
message.info("推送失败!");
|
||||
@@ -369,8 +371,18 @@ export default defineComponent({
|
||||
const removeClick = removeData.filter(function(value,index){
|
||||
return value.recommendStatus==1
|
||||
})
|
||||
console.log('removeClick的长度',removeClick.length)
|
||||
// console.log('removeClick的长度',removeClick.length)
|
||||
state.recommendStatu = removeClick.length
|
||||
// watch(() => state.recommendStatu,(value) => {
|
||||
// const removeData = state.tableData1
|
||||
// const removeClick = removeData.filter(function(value,index){
|
||||
// return value.recommendStatus==1
|
||||
// })
|
||||
// console.log('removeClick的长度111111111111',removeClick.length)
|
||||
// state.recommendStatu = removeClick.length
|
||||
// getTableDate()
|
||||
// console.log(value,'新值');
|
||||
// })
|
||||
};
|
||||
const aa = computed(()=>{
|
||||
return ()=>{
|
||||
@@ -378,6 +390,13 @@ export default defineComponent({
|
||||
}
|
||||
})
|
||||
watch(() => state.recommendStatu,(value) => {
|
||||
const removeData = state.tableData1
|
||||
const removeClick = removeData.filter(function(value,index){
|
||||
return value.recommendStatus==1
|
||||
})
|
||||
console.log('removeClick的长度111111111111',removeClick.length)
|
||||
state.recommendStatu = removeClick.length
|
||||
getTableDate()
|
||||
console.log(value,'新值');
|
||||
})
|
||||
getTableDate();
|
||||
|
||||
Reference in New Issue
Block a user