From d6415079c02480915471893c67d857e43a3a7214 Mon Sep 17 00:00:00 2001 From: MEMA <957397192@qq.com> Date: Thu, 23 May 2024 00:07:32 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E2=9C=A8=20=E5=B7=A5=E5=85=B7=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/views/canteen/toolLink/editToolLink.vue | 35 +++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.env.development b/.env.development index 86a6939..d84944b 100644 --- a/.env.development +++ b/.env.development @@ -9,4 +9,4 @@ VUE_APP_BASE_API = '/api/v1' # TARGET_API = 'https://server.ceobecanteen.top' # 测试服 TARGET_API = 'https://server-dev.ceobecanteen.top' -# TARGET_API = 'https://kitchen-dev.ceobecanteen.top' \ No newline at end of file +# TARGET_API = 'http://kitchen-dev.ceobecanteen.top' \ No newline at end of file diff --git a/src/views/canteen/toolLink/editToolLink.vue b/src/views/canteen/toolLink/editToolLink.vue index 3b99e33..547fa5c 100644 --- a/src/views/canteen/toolLink/editToolLink.vue +++ b/src/views/canteen/toolLink/editToolLink.vue @@ -29,6 +29,29 @@ @blur="changeEmptyToNull" /> + + + + + + + + + + + Date: Sun, 8 Sep 2024 01:55:01 +0800 Subject: [PATCH 02/11] =?UTF-8?q?=F0=9F=93=A6=20=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=93=BE=E6=8E=A5=E6=A8=A1=E5=9D=97=EF=BC=8C?= =?UTF-8?q?=E6=9C=AA=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/toolLink.js | 23 +- src/views/canteen/toolLink/editToolLink.vue | 324 +++++++++++++++----- src/views/canteen/toolLink/index.vue | 8 +- vue.config.js | 2 +- 4 files changed, 279 insertions(+), 78 deletions(-) diff --git a/mock/toolLink.js b/mock/toolLink.js index 384d3ca..dc6f6b5 100644 --- a/mock/toolLink.js +++ b/mock/toolLink.js @@ -15,11 +15,26 @@ module.exports = [ platformTable[i] = Mock.mock({ id: i, - nickname: "name"+i, - avatar: "platform"+i, - jump_url: "url"+i, + icon_url: "platform"+i, + links: [], min_request_interval:minTime, - "has_datasource|1": true + "has_datasource|1": true, + localized_name: { + zh_CN: "name"+i, + en_US: "name"+i + }, + localized_description: { + zh_CN: "description"+i, + en_US: "description"+i + }, + localized_slogan: { + zh_CN: "slogan"+i, + en_US: "slogan"+i + }, + localized_tags: { + zh_CN: ["tags"+i], + en_US: ["tags"+i] + } }); } let data = { diff --git a/src/views/canteen/toolLink/editToolLink.vue b/src/views/canteen/toolLink/editToolLink.vue index 547fa5c..87d63ef 100644 --- a/src/views/canteen/toolLink/editToolLink.vue +++ b/src/views/canteen/toolLink/editToolLink.vue @@ -14,30 +14,33 @@ label-position="right" label-width="120px" :rules="toolLinkRules" > - - + + - + + + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { - this.$message({ - showClose: true, - message: "创建成功", - type: "success", - }); - this.showDraw = false; - this.init(); - }).catch(() =>{ - this.$message({ - showClose: true, - message: "创建失败", - type: "error", + let allPass = true; + this.$refs["toolLinkForm"].validate((valid) => { + if (!valid) { + allPass = false; + return; + } + }); + if (allPass) + this.$store + .dispatch("toolLink/createToolLink",this.toolLinkData) + .then(() => { + this.$message({ + showClose: true, + message: "创建成功", + type: "success", + }); + this.showDraw = false; + this.init(); + }).catch(() =>{ + this.$message({ + showClose: true, + message: "创建失败", + type: "error", + }); + }).finally(()=>{ + this.$emit("uploadDone"); }); - }).finally(()=>{ - this.$emit("uploadDone"); - }); }, updateData() { - this.$store - .dispatch("toolLink/updateToolLink",this.toolLinkData) - .then(() => { - this.$message({ - showClose: true, - message: "修改成功", - type: "success", - }); - this.showDraw = false; - this.init(); - }).catch(() =>{ - this.$message({ - showClose: true, - message: "修改失败", - type: "error", + let allPass = true; + this.$refs["toolLinkForm"].validate((valid) => { + if (!valid) { + allPass = false; + return; + } + }); + if (allPass) + this.$store + .dispatch("toolLink/updateToolLink",this.toolLinkData) + .then(() => { + this.$message({ + showClose: true, + message: "修改成功", + type: "success", + }); + this.showDraw = false; + this.init(); + }).catch(() =>{ + this.$message({ + showClose: true, + message: "修改失败", + type: "error", + }); + }).finally(()=>{ + this.$emit("uploadDone"); }); - }).finally(()=>{ - this.$emit("uploadDone"); - }); }, // 更改跳转链接空为null changeEmptyToNull() { if (this.toolLinkData.jump_url.trim() == '') { this.toolLinkData.jump_url = null; } + }, + addLink() { + this.toolLinkData.links.push(this.initLinks()); + }, + removeLink(index) { + this.toolLinkData.links.splice(index, 1); } } }; @@ -222,4 +378,30 @@ export default { .pl-24 { padding-left: 24px; } + +.add-icon { + cursor: pointer; + font-size: 18px; + + &:hover { + color: #FFBA4B; + } +} + +.collapse-header { + display: flex; + justify-content: space-between; + margin-right: 10px; + width: 100%; +} + +.btn-add { + color: white; + background-color: #67C23A; +} + +.btn-delete { + color: white; + background-color: #F56C6C; +} \ No newline at end of file diff --git a/src/views/canteen/toolLink/index.vue b/src/views/canteen/toolLink/index.vue index 7ac6374..a125335 100644 --- a/src/views/canteen/toolLink/index.vue +++ b/src/views/canteen/toolLink/index.vue @@ -36,11 +36,15 @@ style="width: 100%" > + mock/login // detail: https://cli.vuejs.org/config/#devserver-proxy From 36403d5afb0c4b7f8c2f79804341b99a0e66ee85 Mon Sep 17 00:00:00 2001 From: MEMA <957397192@qq.com> Date: Thu, 19 Sep 2024 01:18:25 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=F0=9F=93=A6=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E9=93=BE=E6=8E=A5=E6=A8=A1=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +-- src/const/toolLinkConfig.js | 1 + src/views/canteen/toolLink/editToolLink.vue | 36 +++------------------ 3 files changed, 7 insertions(+), 34 deletions(-) create mode 100644 src/const/toolLinkConfig.js diff --git a/.env.development b/.env.development index d84944b..e5a5517 100644 --- a/.env.development +++ b/.env.development @@ -8,5 +8,5 @@ VUE_APP_BASE_API = '/api/v1' # 正式服 # TARGET_API = 'https://server.ceobecanteen.top' # 测试服 -TARGET_API = 'https://server-dev.ceobecanteen.top' -# TARGET_API = 'http://kitchen-dev.ceobecanteen.top' \ No newline at end of file +# TARGET_API = 'https://server-dev.ceobecanteen.top' +TARGET_API = 'http://kitchen-dev.ceobecanteen.top' \ No newline at end of file diff --git a/src/const/toolLinkConfig.js b/src/const/toolLinkConfig.js new file mode 100644 index 0000000..f01bf0e --- /dev/null +++ b/src/const/toolLinkConfig.js @@ -0,0 +1 @@ +export const REGION = [ 'CHINA_MAINLAND', 'EXCEPT_CHINA_MAINLAND' ]; \ No newline at end of file diff --git a/src/views/canteen/toolLink/editToolLink.vue b/src/views/canteen/toolLink/editToolLink.vue index 87d63ef..83dc61a 100644 --- a/src/views/canteen/toolLink/editToolLink.vue +++ b/src/views/canteen/toolLink/editToolLink.vue @@ -38,7 +38,7 @@ - + - - - - - - - - - - - @@ -155,6 +136,7 @@