From b8cfa4b26d2dbf99cd2bf441dacd636bb338e850 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Wed, 17 Jan 2024 10:19:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=90=AFf12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/codemirror.vue | 158 +++++++++++++++++++++++++++++++++- src/styles/theme/theme9.scss | 8 +- 2 files changed, 159 insertions(+), 7 deletions(-) diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index d029023..b99fbdc 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -9,6 +9,9 @@
+ 我的代码 导入 + + + + + + + + + + + + + + + + 关闭 + + + + + + + + + + + + 导入代码 + +
@@ -246,7 +333,18 @@ export default { id: 1, name: '内置模型' }, - ] + ], + + codeVisible: false, + codeList: [], + multipleSelection: [], + keyword: '', + page: 1, + pageSize: 10, + total: 0, + + showVisible: false, + showActive: 'code', }; }, components: { @@ -612,7 +710,56 @@ export default { document.onmouseup = null } } - } + }, + + + // 我的代码 + myCode () { + this.codeVisible = true + }, + // 批量删除 + delAll () { + if (this.multipleSelection.length) { + const newArr = this.multipleSelection + const delList = newArr.map(item => { + return `ids=${item.id}` + }) + this.$confirm(`此批量删除操作不可逆,是否确认删除?`, '提示', { + type: 'warning' + }).then(() => { + this.$post(`${this.api.batchDeletion}?${delList.join('&')}`).then(res => { + this.$refs.table.clearSelection() + this.$message.success('删除成功') + this.getData() + }).catch(res => { }) + }).catch(() => { }) + } else { + this.$message.error('请先选择数据 !') + } + }, + // 删除 + del (row) { + this.$confirm('此删除操作不可逆,是否确认删除选中项?', '提示', { + type: 'warning' + }).then(() => { + this.$post(`${this.api.batchDeletion}?ids=${row.id}`).then(res => { + this.$message.success('删除成功') + this.getData() + }).catch(res => { }) + }).catch(() => { }) + }, + handleCurrentChange (val) { + this.page = val + this.getData() + }, + handleSelectionChange (val) { + this.multipleSelection = val + }, + + // 导入代码 + showSubmit () { + + }, } }; @@ -690,7 +837,7 @@ export default { } .del { width: 40px; - margin-right: 10px; + margin: 0 10px; line-height: 40px; color: #fff; text-align: center; @@ -829,4 +976,9 @@ export default { max-height: 400px; overflow: auto; } +/deep/.code-dia { + .el-dialog__body { + padding: 0 20px; + } +} \ No newline at end of file diff --git a/src/styles/theme/theme9.scss b/src/styles/theme/theme9.scss index 83dbd87..56090b1 100644 --- a/src/styles/theme/theme9.scss +++ b/src/styles/theme/theme9.scss @@ -16,10 +16,10 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; background: url(../../assets/images/system/9/header.png) 0 0/100% 100% no-repeat; } -.el-tabs__item.is-active { - color: #fff !important; - background-color: $--color-primary; -} +// .el-tabs__item.is-active { +// color: #fff !important; +// background-color: $--color-primary; +// } .select .el-select__caret:before { background-color: $--color-primary; }