From 7a58d274a72d3818c1f1ef827ad279536d379e68 Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Wed, 28 Sep 2022 11:56:33 +0800 Subject: [PATCH 01/15] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E5=9B=BE?= =?UTF-8?q?=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/icons/svg/field_time.svg | 5 +- frontend/src/styles/index.scss | 10 +++- frontend/src/views/dataset/data/FieldEdit.vue | 50 +++++++++---------- 3 files changed, 35 insertions(+), 30 deletions(-) diff --git a/frontend/src/icons/svg/field_time.svg b/frontend/src/icons/svg/field_time.svg index 77a79164c4..b5c0c4e47d 100644 --- a/frontend/src/icons/svg/field_time.svg +++ b/frontend/src/icons/svg/field_time.svg @@ -1,4 +1 @@ - - - - \ No newline at end of file + \ No newline at end of file diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index eae59c1bf8..000f6ac012 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -302,7 +302,7 @@ div:focus { .field-icon-time { @extend %field-icon; - color: #faaa39; + color: #3370FF; } .field-icon-value { @@ -322,6 +322,14 @@ div:focus { margin: 0 2px 1px 0; } +.field-icon-dimension{ + color: #3370FF!important; +} + +.field-icon-quota{ + color: #04B49C!important; +} + .ds-icon-pdf { width: 20px; height: 20px; diff --git a/frontend/src/views/dataset/data/FieldEdit.vue b/frontend/src/views/dataset/data/FieldEdit.vue index 7da11cf244..93ef48423f 100644 --- a/frontend/src/views/dataset/data/FieldEdit.vue +++ b/frontend/src/views/dataset/data/FieldEdit.vue @@ -146,22 +146,22 @@ {{ @@ -174,28 +174,28 @@ @@ -220,7 +220,7 @@ scope.row.deExtractType === 6 " icon-class="field_text" - class="field-icon-text" + class="field-icon-text field-icon-dimension" /> {{ $t('dataset.text') }} @@ -228,7 +228,7 @@ {{ $t('dataset.time') }} @@ -246,7 +246,7 @@ scope.row.deExtractType === 4 " icon-class="field_value" - class="field-icon-value" + class="field-icon-value field-icon-dimension" /> {{ $t('dataset.location') }} @@ -464,22 +464,22 @@ {{ @@ -492,28 +492,28 @@ @@ -530,7 +530,7 @@ {{ $t('dataset.text') }} @@ -538,7 +538,7 @@ {{ $t('dataset.time') }} @@ -556,7 +556,7 @@ scope.row.deExtractType === 4 " icon-class="field_value" - class="field-icon-value" + class="field-icon-value field-icon-quota" /> {{ $t('dataset.location') }} @@ -1098,4 +1098,4 @@ span { transform: translate(-50%, -50%); } } - \ No newline at end of file + From 585d737d43de13fcd536169a8a2c7d636850dc2c Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 12:04:26 +0800 Subject: [PATCH 02/15] =?UTF-8?q?fix:=20=E5=88=9B=E5=BB=BA=E5=A4=9Asheet?= =?UTF-8?q?=E9=A1=B5=E7=9A=84Excel=E6=95=B0=E6=8D=AE=E9=9B=86=EF=BC=8C?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BB=8D=E7=84=B6=E4=BC=9A=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/dataset/DataSetTableService.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java index f1be09918c..1486fc545f 100644 --- a/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java +++ b/backend/src/main/java/io/dataease/service/dataset/DataSetTableService.java @@ -204,6 +204,19 @@ public class DataSetTableService { excelSheetData.setData(null); excelSheetData.setJsonArray(null); }); + } + for (String s : map.keySet()) { + DataSetTableRequest sheetTable = new DataSetTableRequest(); + BeanUtils.copyBean(sheetTable, datasetTable); + sheetTable.setId(UUID.randomUUID().toString()); + sheetTable.setCreateBy(AuthUtils.getUser().getUsername()); + sheetTable.setCreateTime(System.currentTimeMillis()); + List excelSheetDataList = map.get(s); + sheetTable.setName(excelSheetDataList.get(0).getDatasetName()); + excelSheetDataList.forEach(excelSheetData -> { + excelSheetData.setData(null); + excelSheetData.setJsonArray(null); + }); DataTableInfoDTO info = new DataTableInfoDTO(); info.setExcelSheetDataList(excelSheetDataList); sheetTable.setInfo(new Gson().toJson(info)); @@ -225,6 +238,9 @@ public class DataSetTableService { if (checkIsRepeat(fieldArray)) { DataEaseException.throwException(Translator.get("i18n_excel_field_repeat")); } + } + + for (ExcelSheetData sheet : datasetTable.getSheets()) { DataSetTableRequest sheetTable = new DataSetTableRequest(); BeanUtils.copyBean(sheetTable, datasetTable); sheetTable.setId(UUID.randomUUID().toString()); From 3255cfb4493fd0141099120b7e86ceece619c112 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 13:36:27 +0800 Subject: [PATCH 03/15] =?UTF-8?q?fix:=20API=20=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/system/datasource/dsTable.vue | 101 +++++++++++------- 1 file changed, 62 insertions(+), 39 deletions(-) diff --git a/frontend/src/views/system/datasource/dsTable.vue b/frontend/src/views/system/datasource/dsTable.vue index 2b0e9b13ae..ade0b4a39e 100644 --- a/frontend/src/views/system/datasource/dsTable.vue +++ b/frontend/src/views/system/datasource/dsTable.vue @@ -6,17 +6,16 @@ - + />
@@ -37,11 +36,11 @@ > @@ -71,47 +70,64 @@ - - - - - - - + :data="dsTableData" + stripe + style="width: 100%" + > + + + + + + + +
\ No newline at end of file + From 5a4b2aea1fb3143cebe792edc519ef1fe7812396 Mon Sep 17 00:00:00 2001 From: junjun Date: Wed, 28 Sep 2022 14:39:00 +0800 Subject: [PATCH 04/15] =?UTF-8?q?refactor(=E6=95=B0=E6=8D=AE=E9=9B=86):=20?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=AD=97=E6=AE=B5UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/lang/en.js | 6 +- frontend/src/lang/tw.js | 6 +- frontend/src/lang/zh.js | 6 +- .../views/chart/view/CalcChartFieldEdit.vue | 19 +++++-- .../src/views/dataset/data/CalcFieldEdit.vue | 56 +++++++++++-------- 5 files changed, 62 insertions(+), 31 deletions(-) diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js index 9940582d9b..cce695692c 100644 --- a/frontend/src/lang/en.js +++ b/frontend/src/lang/en.js @@ -1656,7 +1656,11 @@ export default { sql_ds_union_error: 'Direct connect SQL dataset can not be union', api_data: 'API dataset', copy: 'Copy', - sync_log: 'Sync log' + sync_log: 'Sync log', + field_edit_name: 'Field Name', + input_edit_name: 'Input field name', + edit_search: 'Search by name', + na: 'None' }, driver: { driver: 'Driver', diff --git a/frontend/src/lang/tw.js b/frontend/src/lang/tw.js index eeecbe3040..abd48e4d4a 100644 --- a/frontend/src/lang/tw.js +++ b/frontend/src/lang/tw.js @@ -1656,7 +1656,11 @@ export default { sql_ds_union_error: '直連模式下SQL數據集,不支持關聯', api_data: 'API 數據集', copy: '復製', - sync_log: '同步日誌' + sync_log: '同步日誌', + field_edit_name: '字段名稱', + input_edit_name: '請輸入字段名稱', + edit_search: '通過名稱搜索', + na: '暫無' }, driver: { driver: '驅動', diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index e1f5e5861a..62976c8d72 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -1655,7 +1655,11 @@ export default { sql_ds_union_error: '直连模式下SQL数据集,不支持关联', api_data: 'API 数据集', copy: '复制', - sync_log: '同步日志' + sync_log: '同步日志', + field_edit_name: '字段名称', + input_edit_name: '请输入字段名称', + edit_search: '通过名称搜索', + na: '暂无' }, driver: { driver: '驱动', diff --git a/frontend/src/views/chart/view/CalcChartFieldEdit.vue b/frontend/src/views/chart/view/CalcChartFieldEdit.vue index 4f7e3264f9..e13ebae46c 100644 --- a/frontend/src/views/chart/view/CalcChartFieldEdit.vue +++ b/frontend/src/views/chart/view/CalcChartFieldEdit.vue @@ -2,8 +2,8 @@ - {{ $t('dataset.field_name') }} - + {{ $t('dataset.field_edit_name') }} + @@ -94,13 +94,14 @@
{{ $t('chart.dimension') }} +
{{ $t('dataset.na') }}
{{ $t('chart.quota') }} +
{{ $t('dataset.na') }}
@@ -176,7 +180,7 @@ @@ -670,4 +674,11 @@ span { float: right; margin-top: 10px; } + +.class-na { + margin-top: 8px; + text-align: center; + font-size: 14px; + color: var(--deTextDisable); +} diff --git a/frontend/src/views/dataset/data/CalcFieldEdit.vue b/frontend/src/views/dataset/data/CalcFieldEdit.vue index b9073177fa..0d3881ed9a 100644 --- a/frontend/src/views/dataset/data/CalcFieldEdit.vue +++ b/frontend/src/views/dataset/data/CalcFieldEdit.vue @@ -1,11 +1,11 @@ @@ -326,16 +327,16 @@ export default { } }, watch: { - param: function () { + param: function() { this.initFunctions() }, field: { - handler: function () { + handler: function() { this.initField() }, deep: true }, - tableFields: function () { + tableFields: function() { this.dimensionData = JSON.parse( JSON.stringify(this.tableFields.dimensionList) ).filter((ele) => ele.extField === 0) @@ -343,7 +344,7 @@ export default { JSON.stringify(this.tableFields.quotaList) ).filter((ele) => ele.extField === 0) }, - searchField: function (val) { + searchField: function(val) { if (val && val !== '') { this.dimensionData = JSON.parse( JSON.stringify( @@ -374,7 +375,7 @@ export default { ).filter((ele) => ele.extField === 0) } }, - searchFunction: function (val) { + searchFunction: function(val) { if (val && val !== '') { this.functionData = JSON.parse( JSON.stringify( @@ -563,10 +564,10 @@ export default { box-sizing: border-box; margin-left: 12px; width: 214px; - overflow-y: auto; + overflow-y: hidden; } .field-height { - height: calc(50% - 25px); + height: calc(50% - 41px); margin-top: 4px; } .drag-list { @@ -673,7 +674,7 @@ export default { background: var(--ContentBG); } .function-height { - height: calc(100% - 50px); + height: calc(100% - 21px - 32px - 4px - 24px); overflow: auto; margin-top: 4px; } @@ -689,6 +690,13 @@ export default { margin: 6px 0 0 0; font-size: 10px; } + +.class-na { + margin-top: 8px; + text-align: center; + font-size: 14px; + color: var(--deTextDisable); +} \ No newline at end of file + From 94bfe751adb109889a006467edcf0712c9a501bb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 28 Sep 2022 14:44:31 +0800 Subject: [PATCH 05/15] =?UTF-8?q?fix(=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF)?= =?UTF-8?q?:=20=E6=89=AB=E7=A0=81=E7=BB=91=E5=AE=9A=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=B9=B3=E5=8F=B0=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/controller/sys/SysUserController.java | 5 ++++- .../io/dataease/plugins/server/XDingtalkServer.java | 3 +++ .../io/dataease/plugins/server/XLarkServer.java | 3 +++ .../io/dataease/plugins/server/XWecomServer.java | 4 ++++ .../io/dataease/service/sys/SysUserService.java | 9 ++++++++- frontend/src/views/system/user/privateForm.vue | 13 ++++++++++++- 6 files changed, 34 insertions(+), 3 deletions(-) diff --git a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java index a3074b4366..8c8f4d0f87 100644 --- a/backend/src/main/java/io/dataease/controller/sys/SysUserController.java +++ b/backend/src/main/java/io/dataease/controller/sys/SysUserController.java @@ -258,7 +258,7 @@ public class SysUserController { } @PostMapping("/unbindAssist/{type}") - public void unbindAssist(String type) { + public void unbindAssist(@PathVariable("type") String type) { Boolean valid = StringUtils.equals(WECOM, type) || StringUtils.equals(DINGTALK, type) || StringUtils.equals(LARK, type); if (!valid) { @@ -275,6 +275,9 @@ public class SysUserController { if (StringUtils.equals(LARK, type)) { sysUserAssist.setLarkId(null); } + if (StringUtils.isBlank(sysUserAssist.getWecomId()) && StringUtils.isBlank(sysUserAssist.getDingtalkId()) && StringUtils.isBlank(sysUserAssist.getLarkId())) { + sysUserService.changeUserFrom(userId, 0); + } sysUserService.saveAssist(userId, sysUserAssist.getWecomId(), sysUserAssist.getDingtalkId(), sysUserAssist.getLarkId()); } diff --git a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java index 474ae29640..d88341ac51 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XDingtalkServer.java @@ -159,10 +159,12 @@ public class XDingtalkServer { SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state)); if (ObjectUtils.isEmpty(userEntity)) { bindError(response, url, "绑定用户不存在"); + return; } SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state)); if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) { bindError(response, url, "目标用户已绑定其他钉钉账号"); + return; } Boolean isOpen = authUserService.supportDingtalk(); if (!isOpen) { @@ -177,6 +179,7 @@ public class XDingtalkServer { SysUserEntity sysUserEntity = authUserService.getUserByDingtalkId(userId); if (null != sysUserEntity) { bindError(response, url, "当前钉钉账号已绑定其他DE用户"); + return; } if (ObjectUtils.isEmpty(sysUserAssist)) { sysUserAssist = new SysUserAssist(); diff --git a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java index 5e6711324e..26521964b2 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XLarkServer.java @@ -158,10 +158,12 @@ public class XLarkServer { SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state)); if (ObjectUtils.isEmpty(userEntity)) { bindError(response, url, "绑定用户不存在"); + return; } SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state)); if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) { bindError(response, url, "目标用户已绑定其他飞书账号"); + return; } Boolean isOpen = authUserService.supportLark(); @@ -176,6 +178,7 @@ public class XLarkServer { SysUserEntity sysUserEntity = authUserService.getUserByLarkId(userId); if (null != sysUserEntity) { bindError(response, url, "当前飞书账号已绑定其他DE用户"); + return; } if (ObjectUtils.isEmpty(sysUserAssist)) { diff --git a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java index c92d31c1ed..7ff7678cdb 100644 --- a/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/XWecomServer.java @@ -165,15 +165,18 @@ public class XWecomServer { SysUserEntity userEntity = authUserService.getUserById(Long.parseLong(state)); if (ObjectUtils.isEmpty(userEntity)) { bindError(response, url, "绑定用户不存在"); + return; } SysUserAssist sysUserAssist = sysUserService.assistInfo(Long.parseLong(state)); if (ObjectUtils.isNotEmpty(sysUserAssist) && StringUtils.isNotBlank(sysUserAssist.getWecomId())) { bindError(response, url, "目标用户已绑定其他企业微信账号"); + return; } Boolean supportWecom = authUserService.supportWecom(); if (!supportWecom) { DEException.throwException("未开启企业微信"); + return; } wecomXpackService = SpringContextUtil.getBean(WecomXpackService.class); WecomAuthResult authResult = wecomXpackService.auth(code); @@ -183,6 +186,7 @@ public class XWecomServer { SysUserEntity sysUserEntity = authUserService.getUserByWecomId(userId); if (null != sysUserEntity) { bindError(response, url, "当前企业微信账号已绑定其他DE用户"); + return; } if (ObjectUtils.isEmpty(sysUserAssist)) { sysUserAssist = new SysUserAssist(); diff --git a/backend/src/main/java/io/dataease/service/sys/SysUserService.java b/backend/src/main/java/io/dataease/service/sys/SysUserService.java index ab70cae6a5..52192680a5 100644 --- a/backend/src/main/java/io/dataease/service/sys/SysUserService.java +++ b/backend/src/main/java/io/dataease/service/sys/SysUserService.java @@ -529,7 +529,7 @@ public class SysUserService { public boolean needPwdNoti(Long userId) { SysUserAssist userAssist = sysUserAssistMapper.selectByPrimaryKey(userId); - return ObjectUtils.isEmpty(userAssist) || userAssist.getNeedFirstNoti(); + return ObjectUtils.isEmpty(userAssist) || ObjectUtils.isEmpty(userAssist.getNeedFirstNoti()) || userAssist.getNeedFirstNoti(); } public void saveUserAssist(Boolean noti) { @@ -567,4 +567,11 @@ public class SysUserService { return sysUserAssistMapper.selectByPrimaryKey(userId); } + public void changeUserFrom(Long userId, Integer from) { + SysUser sysUser = new SysUser(); + sysUser.setUserId(userId); + sysUser.setFrom(from); + sysUserMapper.updateByPrimaryKeySelective(sysUser); + } + } diff --git a/frontend/src/views/system/user/privateForm.vue b/frontend/src/views/system/user/privateForm.vue index a4ff64871f..a41ebc3924 100644 --- a/frontend/src/views/system/user/privateForm.vue +++ b/frontend/src/views/system/user/privateForm.vue @@ -91,6 +91,7 @@ import { allRoles } from '@/api/system/user' import { updatePerson, personInfo } from '@/api/system/user' import { pluginLoaded } from '@/api/user' import PluginCom from '@/views/system/plugin/PluginCom' +import Cookies from 'js-cookie' export default { components: { LayoutContent, Treeselect, PluginCom }, @@ -173,6 +174,7 @@ export default { }, created() { this.$store.dispatch('app/toggleSideBarHide', true) + this.showError() this.queryPerson() this.initRoles() }, @@ -183,7 +185,16 @@ export default { }) }, methods: { - + showError() { + const errKeys = ['WecomError', 'DingtalkError', 'LarkError'] + errKeys.forEach(key => { + const msg = Cookies.get(key) + if (msg) { + this.$error(msg) + Cookies.remove(key) + } + }) + }, queryPerson() { personInfo().then(res => { const info = res.data From bf118ffb7ab25620ac2bffd9d9943d43aa631b45 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 28 Sep 2022 14:47:36 +0800 Subject: [PATCH 06/15] =?UTF-8?q?fix:=20=E7=B3=BB=E7=BB=9F=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4=E9=97=B4=E9=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/SysParam/BasicSetting.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/system/SysParam/BasicSetting.vue b/frontend/src/views/system/SysParam/BasicSetting.vue index 369608b71b..da530395c5 100644 --- a/frontend/src/views/system/SysParam/BasicSetting.vue +++ b/frontend/src/views/system/SysParam/BasicSetting.vue @@ -47,7 +47,7 @@ - + @@ -374,6 +374,13 @@ export default { width: 156px; } } + +.demo-form-inline-ds { + .el-form-item { + margin-bottom: 0px !important; + } +} + \ No newline at end of file + diff --git a/frontend/src/views/system/task/TaskRecord.vue b/frontend/src/views/system/task/TaskRecord.vue index da8f158aea..f138e175c9 100644 --- a/frontend/src/views/system/task/TaskRecord.vue +++ b/frontend/src/views/system/task/TaskRecord.vue @@ -6,60 +6,58 @@ - + /> {{ $t("user.filter") - }} + >{{ $t("user.filter") + }}
-
+
{{ paginationConfig.total }} {{ $t("user.result_one") }} - + + @click="scrollPre" + />
-

- {{ ele }} +

+ {{ ele }}

+ @click="scrollNext" + /> {{ $t("user.clear_filter") }} + >{{ $t("user.clear_filter") }}
{{ scope.row.name }} + >{{ scope.row.name }} @@ -99,15 +96,15 @@ {{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }} - + >{{ $t(`dataset.${scope.row.status.toLocaleLowerCase()}`) }} + - - +
{}, + default: () => {} }, transCondition: { type: Object, - default: () => {}, - }, + default: () => {} + } }, data() { return { columns: [], - nikeName: "", + nickName: '', showScroll: false, filterTexts: [], cacheCondition: [], paginationConfig: { currentPage: 1, pageSize: 10, - total: 0, + total: 0 }, data: [], orderConditions: [], show_error_massage: false, - error_massage: "", + error_massage: '', matchLogId: null, - lastRequestComplete: true, - }; - }, - created() { - const { taskId: id, name: label } = this.transCondition; - if (id) { - this.nikeName = label; + lastRequestComplete: true } - const { taskId, name, logId } = (this.param || {}); - if (this.param !== null && taskId) { - this.matchLogId = logId || this.matchLogId; - this.transCondition.taskId = taskId; - this.transCondition.name = name; - this.nikeName = name; - } - this.createTimer(); - }, - mounted() { - this.resizeObserver(); }, watch: { filterTexts: { handler() { - this.getScrollStatus(); + this.getScrollStatus() }, - deep: true, - }, + deep: true + } + }, + created() { + const { taskId: id, name: label } = this.transCondition + if (id) { + this.nickName = label + } + const { taskId, name, logId } = (this.param || {}) + if (this.param !== null && taskId) { + this.matchLogId = logId || this.matchLogId + this.transCondition.taskId = taskId + this.transCondition.name = name + this.nickName = name + } + this.createTimer() + }, + mounted() { + this.resizeObserver() }, beforeDestroy() { - this.destroyTimer(); + this.destroyTimer() }, methods: { exportConfirm() { - this.$confirm(this.$t("log.confirm"), "", { - confirmButtonText: this.$t("commons.confirm"), - cancelButtonText: this.$t("commons.cancel"), - type: "warning", + this.$confirm(this.$t('log.confirm'), '', { + confirmButtonText: this.$t('commons.confirm'), + cancelButtonText: this.$t('commons.cancel'), + type: 'warning' }) .then(() => { - this.exportData(); + this.exportData() }) .catch(() => { // this.$info(this.$t('commons.delete_cancel')) - }); + }) }, exportData() { - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } exportExcel(param).then((res) => { - const blob = new Blob([res], { type: "application/vnd.ms-excel" }); - const link = document.createElement("a"); - link.style.display = "none"; - link.href = URL.createObjectURL(blob); - link.download = "DataEase" + this.$t("dataset.sync_log") + ".xls"; - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - }); + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.style.display = 'none' + link.href = URL.createObjectURL(blob) + link.download = 'DataEase' + this.$t('dataset.sync_log') + '.xls' + document.body.appendChild(link) + link.click() + document.body.removeChild(link) + }) }, getScrollStatus() { this.$nextTick(() => { - const dom = document.querySelector(".filter-texts-container"); - this.showScroll = dom && dom.scrollWidth > dom.offsetWidth; - }); + const dom = document.querySelector('.filter-texts-container') + this.showScroll = dom && dom.scrollWidth > dom.offsetWidth + }) }, resizeObserver() { this.resizeForFilter = new ResizeObserver((entries) => { - if (!this.filterTexts.length) return; - this.layoutResize(); - }); + if (!this.filterTexts.length) return + this.layoutResize() + }) this.resizeForFilter.observe( - document.querySelector("#resize-for-filter") - ); + document.querySelector('#resize-for-filter') + ) }, - layoutResize: _.debounce(function () { - this.getScrollStatus(); + layoutResize: _.debounce(function() { + this.getScrollStatus() }, 200), scrollPre() { - const dom = document.querySelector(".filter-texts-container"); - dom.scrollLeft -= 10; + const dom = document.querySelector('.filter-texts-container') + dom.scrollLeft -= 10 if (dom.scrollLeft <= 0) { - dom.scrollLeft = 0; + dom.scrollLeft = 0 } }, scrollNext() { - const dom = document.querySelector(".filter-texts-container"); - dom.scrollLeft += 10; - const width = dom.scrollWidth - dom.offsetWidth; + const dom = document.querySelector('.filter-texts-container') + dom.scrollLeft += 10 + const width = dom.scrollWidth - dom.offsetWidth if (dom.scrollLeft > width) { - dom.scrollLeft = width; + dom.scrollLeft = width } }, clearFilter() { - this.$refs.filterUser.clearFilter(); + this.$refs.filterUser.clearFilter() }, clearOneFilter(index) { - this.$refs.filterUser.clearOneFilter(index); - this.$refs.filterUser.search(); + this.$refs.filterUser.clearOneFilter(index) + this.$refs.filterUser.search() }, filterDraw(condition, filterTexts = []) { - this.cacheCondition = condition; - this.filterTexts = filterTexts; - this.initSearch(); + this.cacheCondition = condition + this.filterTexts = filterTexts + this.initSearch() }, filterShow() { - this.$refs.filterUser.init(); + this.$refs.filterUser.init() }, createTimer() { - this.initSearch(); + this.initSearch() if (!this.timer) { this.timer = setInterval(() => { - this.timerSearch(false); - }, 15000); + this.timerSearch(false) + }, 15000) } }, destroyTimer() { if (this.timer) { - clearInterval(this.timer); - this.timer = null; + clearInterval(this.timer) + this.timer = null } }, handleSizeChange(pageSize) { - this.paginationConfig.currentPage = 1; - this.paginationConfig.pageSize = pageSize; - this.search(); + this.paginationConfig.currentPage = 1 + this.paginationConfig.pageSize = pageSize + this.search() }, handleCurrentChange(currentPage) { - this.paginationConfig.currentPage = currentPage; - this.search(); + this.paginationConfig.currentPage = currentPage + this.search() }, initSearch() { - this.handleCurrentChange(1); + this.handleCurrentChange(1) }, timerSearch(showLoading = true) { if (!this.lastRequestComplete) { - return; + return } else { - this.lastRequestComplete = false; + this.lastRequestComplete = false } - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } post( - "/dataset/taskLog/list/notexcel/" + + '/dataset/taskLog/list/notexcel/' + this.paginationConfig.currentPage + - "/" + + '/' + this.paginationConfig.pageSize, param, showLoading ) .then((response) => { - this.data = response.data.listObject; - this.paginationConfig.total = response.data.itemCount; - this.lastRequestComplete = true; + this.data = response.data.listObject + this.paginationConfig.total = response.data.itemCount + this.lastRequestComplete = true }) .catch(() => { - this.lastRequestComplete = true; - }); + this.lastRequestComplete = true + }) }, search(condition, showLoading = true) { - const { taskId, name } = this.transCondition; + const { taskId, name } = this.transCondition const param = { orders: formatOrders(this.orderConditions), - conditions: [...this.cacheCondition], - }; - if (this.nikeName) { + conditions: [...this.cacheCondition] + } + if (this.nickName) { param.conditions.push({ field: `dataset_table_task.name`, - operator: "like", - value: this.nikeName, - }); + operator: 'like', + value: this.nickName + }) } - if (taskId && this.nikeName === name) { + if (taskId && this.nickName === name) { param.conditions.push({ - operator: "eq", + operator: 'eq', value: taskId, - field: "dataset_table_task.id", - }); + field: 'dataset_table_task.id' + }) } post( - "/dataset/taskLog/list/notexcel/" + + '/dataset/taskLog/list/notexcel/' + this.paginationConfig.currentPage + - "/" + + '/' + this.paginationConfig.pageSize, param, showLoading ).then((response) => { - this.data = response.data.listObject; - this.paginationConfig.total = response.data.itemCount; - }); + this.data = response.data.listObject + this.paginationConfig.total = response.data.itemCount + }) }, showErrorMassage(massage) { - this.show_error_massage = true; - this.error_massage = massage; + this.show_error_massage = true + this.error_massage = massage }, jumpTask(item) { - this.$emit("jumpTask", item); + this.$emit('jumpTask', item) }, rowClassMethod({ row, rowIndex }) { if (this.matchLogId && this.matchLogId === row.id) { - return "row-match-class"; + return 'row-match-class' } - return ""; - }, - }, -}; + return '' + } + } +}