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