From e24e690c0b79bf7f9e66fe5c75dedcc1d266cfde Mon Sep 17 00:00:00 2001
From: break60 <790061044@qq.com>
Date: Wed, 23 Dec 2020 09:39:33 +0800
Subject: [PATCH] [Improvement][ui]List vacancy optimization and icon icon
repair (#4286)
* [Improvement][ui] List vacancy optimization and icon icon repair
---
dolphinscheduler-ui/src/js/conf/home/index.js | 1 +
.../js/conf/home/pages/dag/_source/config.js | 2 +-
.../datasource/pages/list/_source/list.vue | 1 -
.../definition/pages/list/_source/list.vue | 6 ++++-
.../projects/pages/list/_source/list.vue | 6 ++++-
.../pages/file/pages/list/_source/list.vue | 6 ++++-
.../file/pages/subdirectory/_source/list.vue | 6 ++++-
.../pages/udf/pages/function/_source/list.vue | 6 ++++-
.../pages/udf/pages/resource/_source/list.vue | 6 ++++-
.../security/pages/tenement/_source/list.vue | 7 ++++--
.../security/pages/users/_source/list.vue | 6 ++++-
.../src/js/module/filter/filter.js | 18 ++++++++++++--
.../src/js/module/filter/filterNull.js | 24 +++++++++++++++++++
13 files changed, 82 insertions(+), 13 deletions(-)
create mode 100644 dolphinscheduler-ui/src/js/module/filter/filterNull.js
diff --git a/dolphinscheduler-ui/src/js/conf/home/index.js b/dolphinscheduler-ui/src/js/conf/home/index.js
index 1324705d99..3809f18a1c 100644
--- a/dolphinscheduler-ui/src/js/conf/home/index.js
+++ b/dolphinscheduler-ui/src/js/conf/home/index.js
@@ -28,6 +28,7 @@ import i18n from '@/module/i18n'
import { sync } from 'vuex-router-sync'
import Chart from '@/module/ana-charts'
import '@/module/filter/formatDate'
+import '@/module/filter/filterNull'
import themeData from '@/module/echarts/themeData.json'
import Permissions from '@/module/permissions'
import 'sass/conf/home/index.scss'
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
index f759496804..f0605491c3 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
@@ -150,7 +150,7 @@ const tasksState = {
id: 0,
desc: `${i18n.$t('Submitted successfully')}`,
color: '#A9A9A9',
- icoUnicode: 'fa-dot-circle-o',
+ icoUnicode: 'fa fa-dot-circle-o',
isSpin: false
},
RUNNING_EXECUTION: {
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue
index eaed95573e..cc1cc6a3e1 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/list.vue
@@ -32,7 +32,6 @@
-
{{scope.row.createTime | formatDate}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
index 3728af3d5c..0a6c75cbfc 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
@@ -47,7 +47,11 @@
{{scope.row.updateTime | formatDate}}
-
+
+
+ {{scope.row.description | filterNull}}
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
index 21ba3a7d88..8d59a96504 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
@@ -32,7 +32,11 @@
-
+
+
+ {{scope.row.description | filterNull}}
+
+
{{scope.row.createTime | formatDate}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
index 46021eeadf..7d38e93d0d 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
@@ -35,7 +35,11 @@
-
+
+
+ {{scope.row.description | filterNull}}
+
+
{{_rtSize(scope.row.size)}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue
index c7d739acc0..8e4950308e 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue
@@ -35,7 +35,11 @@
-
+
+
+ {{scope.row.description | filterNull}}
+
+
{{_rtSize(scope.row.size)}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
index 6a98f57823..32bd6911e7 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue
@@ -31,7 +31,11 @@
-
+
+
+ {{scope.row.description | filterNull}}
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
index e56ae5d599..78ea5927d1 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/udf/pages/resource/_source/list.vue
@@ -40,7 +40,11 @@
{{_rtSize(scope.row.size)}}
-
+
+
+ {{scope.row.description | filterNull}}
+
+
{{scope.row.createTime | formatDate}}
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
index 51a04afb48..ae3bf2cef8 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/list.vue
@@ -20,8 +20,11 @@
-
-
+
+
+ {{scope.row.description | filterNull}}
+
+
diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
index 2808aac369..36b798a890 100644
--- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/users/_source/list.vue
@@ -28,7 +28,11 @@
-
+
+
+ {{scope.row.phone | filterNull}}
+
+
{{scope.row.state === 1 ? `${$t('Enable')}` : `${$t('Disable')}`}}
diff --git a/dolphinscheduler-ui/src/js/module/filter/filter.js b/dolphinscheduler-ui/src/js/module/filter/filter.js
index 827b9e3b5a..af97cb8d41 100644
--- a/dolphinscheduler-ui/src/js/module/filter/filter.js
+++ b/dolphinscheduler-ui/src/js/module/filter/filter.js
@@ -22,9 +22,23 @@ import dayjs from 'dayjs'
*/
const formatDate = (value, fmt) => {
fmt = fmt || 'YYYY-MM-DD HH:mm:ss'
- return dayjs(value).format(fmt)
+ if (value === null) {
+ return '-'
+ } else {
+ return dayjs(value).format(fmt)
+ }
+}
+/**
+ * filter null
+ */
+const filterNull = (value) => {
+ if (value === null || value === '') {
+ return '-'
+ } else {
+ return value
+ }
}
export {
- formatDate
+ formatDate, filterNull
}
diff --git a/dolphinscheduler-ui/src/js/module/filter/filterNull.js b/dolphinscheduler-ui/src/js/module/filter/filterNull.js
new file mode 100644
index 0000000000..b5d2759293
--- /dev/null
+++ b/dolphinscheduler-ui/src/js/module/filter/filterNull.js
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Vue from 'vue'
+import { filterNull } from './filter'
+
+/**
+ * @param {String} fmt optional, define filter null
+ */
+Vue.filter('filterNull', filterNull)