mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-09 13:24:38 +00:00
edit func of channel share
This commit is contained in:
parent
10f74db5a5
commit
c5fea2c79e
1 changed files with 40 additions and 10 deletions
|
@ -67,8 +67,9 @@
|
||||||
<br>
|
<br>
|
||||||
{{ item.desc }}
|
{{ item.desc }}
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 40%; margin: auto; text-align: center;">
|
<div style="width: 50%; margin: auto; text-align: center;">
|
||||||
<t-tag>{{ item.create_time_text }}</t-tag>
|
<t-tag>{{ item.create_time_text }}</t-tag>
|
||||||
|
<t-link theme="primary" hover="color" @click="onET(item.id)">编辑</t-link>
|
||||||
<t-link theme="primary" hover="color" @click="onDT(item.id)">删除</t-link>
|
<t-link theme="primary" hover="color" @click="onDT(item.id)">删除</t-link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -147,6 +148,7 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
|
id: 0,
|
||||||
title: '',
|
title: '',
|
||||||
desc: '',
|
desc: '',
|
||||||
firmware: []
|
firmware: []
|
||||||
|
@ -176,6 +178,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const showUpload = () => {
|
const showUpload = () => {
|
||||||
|
formData.id = 0
|
||||||
formData.title = ''
|
formData.title = ''
|
||||||
formData.desc = ''
|
formData.desc = ''
|
||||||
formData.firmware = []
|
formData.firmware = []
|
||||||
|
@ -190,6 +193,7 @@
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(formData.id === 0){
|
||||||
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
|
await axios.post("https://k5ws.vicicode.cn/api/channel/add?server=1", {
|
||||||
'title': formData.title,
|
'title': formData.title,
|
||||||
'desc': formData.desc,
|
'desc': formData.desc,
|
||||||
|
@ -199,10 +203,36 @@
|
||||||
'ba-user-token': userStore.accountId
|
'ba-user-token': userStore.accountId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
await axios.post("https://k5ws.vicicode.cn/api/channel/edit?server=1", {
|
||||||
|
'id': formData.id,
|
||||||
|
'title': formData.title,
|
||||||
|
'desc': formData.desc,
|
||||||
|
'data': formData.firmware[0].url ?? formData.firmware[0].response.data.file.url
|
||||||
|
}, {
|
||||||
|
headers: {
|
||||||
|
'ba-user-token': userStore.accountId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
state.showUpload = false;
|
state.showUpload = false;
|
||||||
showPanel()
|
showPanel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onET = async (id: any) => {
|
||||||
|
formData.id = id
|
||||||
|
formData.title = state.myList.filter((e: any)=>e.id == id)[0].title
|
||||||
|
formData.desc = state.myList.filter((e: any)=>e.id == id)[0].desc
|
||||||
|
formData.firmware = [
|
||||||
|
{
|
||||||
|
name: state.myList.filter((e: any)=>e.id == id)[0].title,
|
||||||
|
status: 'success',
|
||||||
|
url: state.myList.filter((e: any)=>e.id == id)[0].file
|
||||||
|
}
|
||||||
|
]
|
||||||
|
state.showUpload = true
|
||||||
|
}
|
||||||
|
|
||||||
const onDT = async (id: any) => {
|
const onDT = async (id: any) => {
|
||||||
await axios.post("https://k5ws.vicicode.cn/api/channel/del?server=1", {
|
await axios.post("https://k5ws.vicicode.cn/api/channel/del?server=1", {
|
||||||
'id': id,
|
'id': id,
|
||||||
|
|
Loading…
Reference in a new issue