From bc4e1e2e9959dd8f6f1fddb333f9623461ecd95a Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Wed, 8 Nov 2023 17:06:00 +0800 Subject: [PATCH] up --- package.json | 1 + src/components/XyDialog/index.vue | 16 +- src/components/myecharts/index.vue | 195 +++++ src/components/myecharts/mixins/resize.js | 55 ++ src/utils/index.js | 12 + src/views/dashboard/index.vue | 728 ++++++++++++++++-- .../task/list/components/addQuestion.vue | 448 +++++++++++ src/views/task/list/components/addUnit.vue | 91 ++- src/views/task/list/components/checkUnit.vue | 14 +- src/views/task/list/components/showPatrol.vue | 32 +- src/views/task/list/patrol.vue | 20 - src/views/task/list/study.vue | 521 +++++++++++++ src/views/task/list/unit.vue | 111 ++- 13 files changed, 2081 insertions(+), 163 deletions(-) create mode 100644 src/components/myecharts/index.vue create mode 100644 src/components/myecharts/mixins/resize.js create mode 100644 src/views/task/list/components/addQuestion.vue create mode 100644 src/views/task/list/study.vue diff --git a/package.json b/package.json index a3f763d..9c65b62 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "avue-plugin-map": "^1.0.1", "axios": "^0.26.1", "core-js": "3.6.5", + "echarts": "^5.4.3", "element-ui": "^2.15.14", "js-cookie": "2.2.0", "less": "^3.13.1", diff --git a/src/components/XyDialog/index.vue b/src/components/XyDialog/index.vue index c57d04a..591115f 100644 --- a/src/components/XyDialog/index.vue +++ b/src/components/XyDialog/index.vue @@ -8,7 +8,7 @@ export default { }, width:{ type:Number, - default:65 + default:98 }, // isFullScreen:{ // type:Boolean, @@ -125,7 +125,7 @@ export default { width={width} title={title} value={isShow} - fullscreen + fullScreen on={{['on-visible-change']:showChange,['on-ok']:okClick}} scopedSlots={{ @@ -245,8 +245,8 @@ export default { } } .ivu-modal-body{ - max-height: 65vh !important; - min-height: 300px; + max-height: 87vh !important; + min-height: 87vh !important; overflow: scroll; } @@ -268,7 +268,7 @@ font-size: 15px; } .ivu-modal-body{ max-height: 100vh !important; - min-height: 300px; + min-height: 87vh !important; overflow: scroll; } @@ -281,8 +281,8 @@ font-size: 15px; height:100vh } .ivu-modal-body{ - max-height: 80vh !important; - min-height: 300px; + max-height: 87vh !important; + min-height: 87vh !important; overflow: scroll; } @@ -304,7 +304,7 @@ font-size: 15px; .el-form-item{ flex-shrink: 0; flex-basis: 50%; - margin-bottom:0 + margin-bottom:5px } .el-form-item__error{ display: none; diff --git a/src/components/myecharts/index.vue b/src/components/myecharts/index.vue new file mode 100644 index 0000000..b596f12 --- /dev/null +++ b/src/components/myecharts/index.vue @@ -0,0 +1,195 @@ + + + + diff --git a/src/components/myecharts/mixins/resize.js b/src/components/myecharts/mixins/resize.js new file mode 100644 index 0000000..234953b --- /dev/null +++ b/src/components/myecharts/mixins/resize.js @@ -0,0 +1,55 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + $_sidebarElm: null, + $_resizeHandler: null + } + }, + mounted() { + this.$_resizeHandler = debounce(() => { + if (this.chart) { + this.chart.resize() + } + }, 100) + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + beforeDestroy() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + // to fixed bug when cached by keep-alive + // https://github.com/PanJiaChen/vue-element-admin/issues/2116 + activated() { + this.$_initResizeEvent() + this.$_initSidebarResizeEvent() + }, + deactivated() { + this.$_destroyResizeEvent() + this.$_destroySidebarResizeEvent() + }, + methods: { + // use $_ for mixins properties + // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential + $_initResizeEvent() { + window.addEventListener('resize', this.$_resizeHandler) + }, + $_destroyResizeEvent() { + window.removeEventListener('resize', this.$_resizeHandler) + }, + $_sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.$_resizeHandler() + } + }, + $_initSidebarResizeEvent() { + this.$_sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.$_sidebarElm && this.$_sidebarElm.addEventListener('transitionend', this.$_sidebarResizeHandler) + }, + $_destroySidebarResizeEvent() { + this.$_sidebarElm && this.$_sidebarElm.removeEventListener('transitionend', this.$_sidebarResizeHandler) + } + } +} diff --git a/src/utils/index.js b/src/utils/index.js index 4830c04..db2b48f 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -115,3 +115,15 @@ export function param2Obj(url) { }) return obj } + +//防抖 +export function debounce(fn,delay=500){ + let timer = null + return function _debounce() { + if (timer) clearTimeout(timer) + timer = setTimeout(() => { + fn() + }, delay) + } +} + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 94a35bf..8ed9119 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,53 +1,290 @@