From 1c79dc650bc17320fe707813c15c9f87fcd8e841 Mon Sep 17 00:00:00 2001 From: hLinx <327159425@qq.com> Date: Tue, 29 Nov 2022 15:39:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=84=9A=E6=9C=AC=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=90=9C=E7=B4=A2=EF=BC=9F=E5=86=85=E5=AE=B9=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=9B=B4=E5=B8=B8=E7=94=A8=20#1337?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../script-manage/common/copy-create.vue | 2 +- .../script-manage/common/detail/index.vue | 4 +-- .../src/views/script-manage/common/edit.vue | 2 +- .../src/views/script-manage/create/index.vue | 2 +- .../src/views/script-manage/list/index.vue | 7 ++++- src/frontend/src/views/script-manage/local.js | 12 +++++-- .../src/views/script-manage/version/index.vue | 31 ++++++++++++++----- 7 files changed, 43 insertions(+), 17 deletions(-) diff --git a/src/frontend/src/views/script-manage/common/copy-create.vue b/src/frontend/src/views/script-manage/common/copy-create.vue index 382ab320a1..59a21a525a 100644 --- a/src/frontend/src/views/script-manage/common/copy-create.vue +++ b/src/frontend/src/views/script-manage/common/copy-create.vue @@ -66,7 +66,7 @@ - + - {{ $t('script.脚本内容') }} + {{ $t('script.脚本内容.label') }}
- {{ $t('script.版本日志') }} + {{ $t('script.版本日志.label') }}
diff --git a/src/frontend/src/views/script-manage/common/edit.vue b/src/frontend/src/views/script-manage/common/edit.vue index 3f5bf55f0e..6adc507a35 100644 --- a/src/frontend/src/views/script-manage/common/edit.vue +++ b/src/frontend/src/views/script-manage/common/edit.vue @@ -58,7 +58,7 @@ required> - + - +
@@ -360,6 +360,7 @@ import ScriptBasic from './components/script-basic'; import Diff from '../common/diff'; import NewVersion from './components/new-version'; + import { Base64 } from 'js-base64'; const TABLE_COLUMN_CACHE = 'script_version_list_columns'; @@ -513,13 +514,23 @@ this.scriptId = this.$route.params.id; this.fetchData(true); - + this.searchSelect = [ { name: I18n.t('script.版本号.colHead'), id: 'version', default: true, }, + { + name: I18n.t('script.脚本内容.colHead'), + id: 'content', + default: true, + }, + { + name: I18n.t('script.版本日志.colHead'), + id: 'versionDesc', + default: true, + }, { name: I18n.t('script.更新人.colHead'), id: 'lastModifyUser', @@ -625,7 +636,7 @@ const windowHeight = window.innerHeight; this.tableHeight = windowHeight - top - 20; }, - + rowClassName ({ row }) { return row.scriptVersionId === this.selectVersionId ? 'active' : ''; }, @@ -679,12 +690,16 @@ * @param {Object} payload 搜索字段 */ handleSearch (payload) { - let list = this.dataMemo; + let scriptVersionList = this.dataMemo; Object.keys(payload).forEach((key) => { const reg = new RegExp(encodeRegexp(payload[key])); - list = list.filter(item => reg.test(item[key])); + + scriptVersionList = scriptVersionList.filter((scriptVersionData) => { + const value = key === 'content' ? Base64.decode(scriptVersionData.content) : scriptVersionData[key]; + return reg.test(value); + }); }); - this.data = Object.freeze(list); + this.data = Object.freeze(scriptVersionList); this.handleLayoutFlod(); }, /** @@ -824,7 +839,7 @@ */ handleSync (row) { const routerName = this.isPublicScript ? 'scriptPublicSync' : 'scriptSync'; - + this.$router.push({ name: routerName, params: { @@ -965,7 +980,7 @@ handleEditCancel () { this.displayCom = 'detail'; }, - + /** * @desc 判断是否可以选中 * @param {Object} row 脚本数据