diff --git a/frontend/src/components/canvas/components/Editor/DateFormat.vue b/frontend/src/components/canvas/components/Editor/DateFormat.vue
new file mode 100644
index 0000000000..e7c3be67b9
--- /dev/null
+++ b/frontend/src/components/canvas/components/Editor/DateFormat.vue
@@ -0,0 +1,181 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/canvas/components/Editor/index.vue b/frontend/src/components/canvas/components/Editor/index.vue
index 3bec402bf6..4088446f96 100644
--- a/frontend/src/components/canvas/components/Editor/index.vue
+++ b/frontend/src/components/canvas/components/Editor/index.vue
@@ -1351,7 +1351,7 @@ export default {
},
resizeView(index, item) {
- if (item.type === 'view') {
+ if (item.type === 'view' || item.type === 'de-show-date') {
this.$refs.wrapperChild[index].chartResize()
}
},
diff --git a/frontend/src/components/canvas/components/TextAttr.vue b/frontend/src/components/canvas/components/TextAttr.vue
index db382e2368..3526f73f9f 100644
--- a/frontend/src/components/canvas/components/TextAttr.vue
+++ b/frontend/src/components/canvas/components/TextAttr.vue
@@ -78,8 +78,12 @@
-
-
+
+
+
+
+
+
@@ -90,9 +94,10 @@
diff --git a/frontend/src/components/widget/DeWidget/TimeComplex.vue b/frontend/src/components/widget/DeWidget/TimeComplex.vue
new file mode 100644
index 0000000000..62179bac4d
--- /dev/null
+++ b/frontend/src/components/widget/DeWidget/TimeComplex.vue
@@ -0,0 +1,261 @@
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/widget/DeWidget/TimeDefault.vue b/frontend/src/components/widget/DeWidget/TimeDefault.vue
new file mode 100644
index 0000000000..bd8249ae74
--- /dev/null
+++ b/frontend/src/components/widget/DeWidget/TimeDefault.vue
@@ -0,0 +1,58 @@
+
+ {{ nowDate }}
+
+
+
+
+
diff --git a/frontend/src/components/widget/DeWidget/TimeElec.vue b/frontend/src/components/widget/DeWidget/TimeElec.vue
new file mode 100644
index 0000000000..0d32882d5b
--- /dev/null
+++ b/frontend/src/components/widget/DeWidget/TimeElec.vue
@@ -0,0 +1,112 @@
+
+
+
{{ date }}
+
{{ time }}
+
+
+
+
+
+
diff --git a/frontend/src/components/widget/DeWidget/TimeSimple.vue b/frontend/src/components/widget/DeWidget/TimeSimple.vue
new file mode 100644
index 0000000000..a11cdab701
--- /dev/null
+++ b/frontend/src/components/widget/DeWidget/TimeSimple.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
diff --git a/frontend/src/lang/en.js b/frontend/src/lang/en.js
index dbaab8569a..7ed129df3f 100644
--- a/frontend/src/lang/en.js
+++ b/frontend/src/lang/en.js
@@ -1522,5 +1522,22 @@ export default {
deyear: {
label: 'Year',
placeholder: 'Please select year'
+ },
+ deshowdate: {
+ label: 'Time',
+ show_week: 'Show week',
+ show_date: 'Show date',
+ time_format: 'Time format',
+ date_format: 'Date format',
+ custom: 'Custom format',
+ open_mode: 'Time category',
+ m_default: 'Default',
+ m_elec: 'Electronic clock',
+ m_simple: 'Simple clock',
+ m_complex: 'Complex clock',
+ select_openMode: 'Please select time category',
+ select_time_format: 'Please select time format',
+ select_date_format: 'Please select date format'
+
}
}
diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js
index d52373d63c..230926a63a 100644
--- a/frontend/src/lang/zh.js
+++ b/frontend/src/lang/zh.js
@@ -1543,5 +1543,22 @@ export default {
deyear: {
label: '年份',
placeholder: '请选择年份'
+ },
+ deshowdate: {
+ label: '时间',
+ show_week: '显示星期',
+ show_date: '显示日期',
+ time_format: '时间格式',
+ date_format: '日期格式',
+ custom: '自定义格式',
+ open_mode: '展示风格',
+ m_default: '简单风格',
+ m_elec: '电子时钟',
+ m_simple: '简单表盘',
+ m_complex: '复杂表盘',
+ select_openMode: '请选择展示风格',
+ select_time_format: '请选择时间格式',
+ select_date_format: '请选择时间格式'
+
}
}
diff --git a/frontend/src/main.js b/frontend/src/main.js
index 070d1068c5..9fc65811e5 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -23,6 +23,8 @@ import './utils/dialog'
import DeComplexInput from '@/components/business/condition-table/DeComplexInput'
import DeComplexSelect from '@/components/business/condition-table/DeComplexSelect'
import '@/components/canvas/custom-component' // 注册自定义组件
+
+import '@/utils/DateUtil'
Vue.config.productionTip = false
Vue.use(VueClipboard)
Vue.use(widgets)
diff --git a/frontend/src/styles/deicon/iconfont.css b/frontend/src/styles/deicon/iconfont.css
index 420f446663..3438ed8f00 100644
--- a/frontend/src/styles/deicon/iconfont.css
+++ b/frontend/src/styles/deicon/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2459092 */
- src: url('iconfont.woff2?t=1634191971474') format('woff2'),
- url('iconfont.woff?t=1634191971474') format('woff'),
- url('iconfont.ttf?t=1634191971474') format('truetype');
+ src: url('iconfont.woff2?t=1634625523445') format('woff2'),
+ url('iconfont.woff?t=1634625523445') format('woff'),
+ url('iconfont.ttf?t=1634625523445') format('truetype');
}
.iconfont {
@@ -13,6 +13,18 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-tabs:before {
+ content: "\e9a8";
+}
+
+.icon-shijian:before {
+ content: "\e665";
+}
+
+.icon-shijiangeshizhuanhuan:before {
+ content: "\e6fb";
+}
+
.icon-chaolianjie:before {
content: "\e9b2";
}
@@ -45,10 +57,6 @@
content: "\e8e6";
}
-.icon-tabs:before {
- content: "\e62a";
-}
-
.icon-xiyu:before {
content: "\e619";
}
diff --git a/frontend/src/styles/deicon/iconfont.js b/frontend/src/styles/deicon/iconfont.js
index 07207f78aa..63d1522ad7 100644
--- a/frontend/src/styles/deicon/iconfont.js
+++ b/frontend/src/styles/deicon/iconfont.js
@@ -1 +1 @@
-!function(h){var l,c,a,v,t,i='',z=(z=document.getElementsByTagName("script"))[z.length-1].getAttribute("data-injectcss"),o=function(h,l){l.parentNode.insertBefore(h,l)};if(z&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}function m(){t||(t=!0,a())}function s(){try{v.documentElement.doScroll("left")}catch(h){return void setTimeout(s,50)}m()}l=function(){var h,l;(l=document.createElement("div")).innerHTML=i,i=null,(h=l.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",l=h,(h=document.body).firstChild?o(l,h.firstChild):h.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),l()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(a=l,v=h.document,t=!1,s(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,m())})}(window);
\ No newline at end of file
+!function(h){var l,a,c,v,i,t='',z=(z=document.getElementsByTagName("script"))[z.length-1].getAttribute("data-injectcss"),o=function(h,l){l.parentNode.insertBefore(h,l)};if(z&&!h.__iconfont__svg__cssinject__){h.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}function m(){i||(i=!0,c())}function s(){try{v.documentElement.doScroll("left")}catch(h){return void setTimeout(s,50)}m()}l=function(){var h,l;(l=document.createElement("div")).innerHTML=t,t=null,(h=l.getElementsByTagName("svg")[0])&&(h.setAttribute("aria-hidden","true"),h.style.position="absolute",h.style.width=0,h.style.height=0,h.style.overflow="hidden",l=h,(h=document.body).firstChild?o(l,h.firstChild):h.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(a=function(){document.removeEventListener("DOMContentLoaded",a,!1),l()},document.addEventListener("DOMContentLoaded",a,!1)):document.attachEvent&&(c=l,v=h.document,i=!1,s(),v.onreadystatechange=function(){"complete"==v.readyState&&(v.onreadystatechange=null,m())})}(window);
\ No newline at end of file
diff --git a/frontend/src/styles/deicon/iconfont.json b/frontend/src/styles/deicon/iconfont.json
index 093b9a689d..b7035567e9 100644
--- a/frontend/src/styles/deicon/iconfont.json
+++ b/frontend/src/styles/deicon/iconfont.json
@@ -5,6 +5,27 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
+ {
+ "icon_id": "11982148",
+ "name": "tabs",
+ "font_class": "tabs",
+ "unicode": "e9a8",
+ "unicode_decimal": 59816
+ },
+ {
+ "icon_id": "658039",
+ "name": "时间",
+ "font_class": "shijian",
+ "unicode": "e665",
+ "unicode_decimal": 58981
+ },
+ {
+ "icon_id": "8691950",
+ "name": "时间格式转换",
+ "font_class": "shijiangeshizhuanhuan",
+ "unicode": "e6fb",
+ "unicode_decimal": 59131
+ },
{
"icon_id": "3229030",
"name": "超链接",
@@ -61,13 +82,6 @@
"unicode": "e8e6",
"unicode_decimal": 59622
},
- {
- "icon_id": "15196968",
- "name": "44.tabs",
- "font_class": "tabs",
- "unicode": "e62a",
- "unicode_decimal": 58922
- },
{
"icon_id": "23570269",
"name": "洗浴",
diff --git a/frontend/src/styles/deicon/iconfont.ttf b/frontend/src/styles/deicon/iconfont.ttf
index 07b588c066..479dc6ad86 100644
Binary files a/frontend/src/styles/deicon/iconfont.ttf and b/frontend/src/styles/deicon/iconfont.ttf differ
diff --git a/frontend/src/styles/deicon/iconfont.woff b/frontend/src/styles/deicon/iconfont.woff
index 0e4fe53f11..9e84b8762a 100644
Binary files a/frontend/src/styles/deicon/iconfont.woff and b/frontend/src/styles/deicon/iconfont.woff differ
diff --git a/frontend/src/styles/deicon/iconfont.woff2 b/frontend/src/styles/deicon/iconfont.woff2
index 34eb3d8f1a..faa1dc85f9 100644
Binary files a/frontend/src/styles/deicon/iconfont.woff2 and b/frontend/src/styles/deicon/iconfont.woff2 differ
diff --git a/frontend/src/utils/DateUtil.js b/frontend/src/utils/DateUtil.js
new file mode 100644
index 0000000000..0ae20d8b76
--- /dev/null
+++ b/frontend/src/utils/DateUtil.js
@@ -0,0 +1,21 @@
+/* eslint-disable no-extend-native */
+Date.prototype.format = function(fmt) {
+ var o = {
+ 'M+': this.getMonth() + 1, // 月份
+ 'd+': this.getDate(), // 日
+ 'h+': this.getHours(), // 小时
+ 'm+': this.getMinutes(), // 分
+ 's+': this.getSeconds(), // 秒
+ 'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
+ 'S': this.getMilliseconds() // 毫秒
+ }
+ if (/(y+)/.test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
+ }
+ for (var k in o) {
+ if (new RegExp('(' + k + ')').test(fmt)) {
+ fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
+ }
+ }
+ return fmt
+}
diff --git a/frontend/src/views/panel/AssistComponent/index.vue b/frontend/src/views/panel/AssistComponent/index.vue
index c37451808e..f5ce2ba388 100644
--- a/frontend/src/views/panel/AssistComponent/index.vue
+++ b/frontend/src/views/panel/AssistComponent/index.vue
@@ -48,6 +48,30 @@
+
+
@@ -55,7 +79,7 @@