From b9c4027003e9157b249dfe4eced9a6f965cb51c1 Mon Sep 17 00:00:00 2001 From: ngfchl Date: Sat, 31 Dec 2022 13:00:38 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E5=A4=8D=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E4=BF=A1=E6=81=AF=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AB=99=E7=82=B9=E7=9A=84bug=202.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0=E7=AB=99=E7=82=B9=E6=97=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E7=AB=99=E7=82=B9=E5=90=8E=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=9A=84bug=203.=20=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=97=B6=E9=97=B4=E5=A1=AB=E5=86=99=204.=20?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=BE=AE=E8=B0=83=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/auto_pt/status.html | 222 ++++++++++++++++++++-------------- 1 file changed, 133 insertions(+), 89 deletions(-) diff --git a/templates/auto_pt/status.html b/templates/auto_pt/status.html index 2069fbf..1a95474 100644 --- a/templates/auto_pt/status.html +++ b/templates/auto_pt/status.html @@ -97,7 +97,7 @@ placeholder="请输入站点名称或者网址搜索"> - 添加 + 添加 @@ -489,39 +489,44 @@ - + + + + + + + + + + placeholder="选择注册日期时间"> - - - - - - - + - - - + + - + - + @@ -765,7 +770,119 @@ }); }) }, + getSiteList() { + /** + * 获取要添加的站点列表 + * @type {null} + */ + let id = this.addMySiteForm.site + if (this.addMySiteForm.id == 0) { + id = 0 + } + + axios.get( + "{% url 'get_site_list' %}" + '?id=' + id + ).then(res => { + console.log('获取数据列表成功', res.data) + {#console.log(typeof res.data.data)#} + if (res.data.code === 0) { + {#this.ptData = res.data.data#} + this.site_list = res.data.data.site_list + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }).catch(res => { + console.log('获取数据列表失败', res) + this.$message({ + type: 'warning', + message: '获取数据列表失败!' + res + }); + }) + }, + editMySite(formName) { + /** + * 修改站点信息 + * @type {null} + */ + this.$refs[formName].validate((valid) => { + if (valid) { + const options = { + method: 'POST', + headers: {'content-type': 'application/json;charset=utf-8'}, + data: this.addMySiteForm, + url: "{% url 'edit_my_site' %}" + } + + axios(options).then(res => { + console.log('获取数据列表成功', res.data) + {#console.log(typeof res.data.data)#} + if (res.data.code === 0) { + {#this.ptData = res.data.data#} + {#this.site_list = res.data.data.site_list#} + this.addMySiteForm = { + id: 0, + site: null, + sign_in: true, + hr: false, + search: true, + user_id: '', + passkey: '', + time_join: '2023-01-01 12:00:00', + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.52', + cookie: '' + } + this.showAddMySite = false + this.getData() + this.$message({ + type: 'success', + message: res.data.msg + }); + } else { + this.$message({ + type: 'warning', + message: res.data.msg + }); + } + }).catch(res => { + console.log('获取数据列表失败', res) + this.$message({ + type: 'warning', + message: '获取数据列表失败!' + res + }); + }) + } else { + this.$message({ + type: 'warning', + message: '数据验证失败!请认真填写' + }); + return false; + } + }); + }, editSite(id) { + /** + * 打开编辑页面 + * @type {null} + */ + if (id == 0) { + this.addMySiteForm = { + id: 0, + site: null, + sign_in: true, + hr: false, + search: true, + user_id: '', + passkey: '', + time_join: new Date(), + user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.52', + cookie: '' + } + this.showAddMySite = true + return + } axios.get( "{% url 'edit_my_site' %}" + '?id=' + id ).then(res => { @@ -849,79 +966,6 @@ message: '获取数据列表失败!' + res }); }) - }, - getSiteList(id) { - if (null == id) { - id = 0 - } - axios.get( - "{% url 'get_site_list' %}" + '?id=' + id - ).then(res => { - console.log('获取数据列表成功', res.data) - {#console.log(typeof res.data.data)#} - if (res.data.code === 0) { - {#this.ptData = res.data.data#} - this.site_list = res.data.data.site_list - } else { - this.$message({ - type: 'warning', - message: res.data.msg - }); - } - }).catch(res => { - console.log('获取数据列表失败', res) - this.$message({ - type: 'warning', - message: '获取数据列表失败!' + res - }); - }) - }, - editMySite(formName) { - this.$refs[formName].validate((valid) => { - if (valid) { - const options = { - method: 'POST', - headers: {'content-type': 'application/json;charset=utf-8'}, - data: this.addMySiteForm, - url: "{% url 'edit_my_site' %}" - } - - axios(options).then(res => { - console.log('获取数据列表成功', res.data) - {#console.log(typeof res.data.data)#} - if (res.data.code === 0) { - {#this.ptData = res.data.data#} - {#this.site_list = res.data.data.site_list#} - this.addMySiteForm = {} - this.showAddMySite = false - this.getData() - this.$message({ - type: 'success', - message: res.data.msg - }); - } else { - this.$message({ - type: 'warning', - message: res.data.msg - }); - } - }).catch(res => { - console.log('获取数据列表失败', res) - this.$message({ - type: 'warning', - message: '获取数据列表失败!' + res - }); - }) - } else { - this.$message({ - type: 'warning', - message: '数据验证失败!请认真填写' - }); - return false; - } - }); - - }, showAllIncrementHistory($event) { console.log($event)