From 09d80a298af06fa8ad9108f5de65eecb044592b7 Mon Sep 17 00:00:00 2001 From: ruibaby Date: Sun, 5 May 2019 21:08:36 +0800 Subject: [PATCH] Remove useless files or codes. --- src/components/Ellipsis/Ellipsis.vue | 9 -- src/components/Exception/ExceptionPage.vue | 88 ---------------- src/components/Exception/index.js | 2 - src/components/Exception/type.js | 19 ---- src/components/NumberInfo/NumberInfo.vue | 54 ---------- src/components/NumberInfo/index.js | 3 - src/components/NumberInfo/index.less | 55 ---------- src/components/TagSelect/TagSelectOption.jsx | 45 -------- src/components/TagSelect/index.jsx | 102 ------------------- src/components/_util/util.js | 13 --- src/components/index.js | 4 - src/views/exception/403.vue | 16 --- src/views/exception/type.js | 7 +- 13 files changed, 1 insertion(+), 416 deletions(-) delete mode 100644 src/components/Exception/ExceptionPage.vue delete mode 100644 src/components/Exception/index.js delete mode 100644 src/components/Exception/type.js delete mode 100644 src/components/NumberInfo/NumberInfo.vue delete mode 100644 src/components/NumberInfo/index.js delete mode 100644 src/components/NumberInfo/index.less delete mode 100644 src/components/TagSelect/TagSelectOption.jsx delete mode 100644 src/components/TagSelect/index.jsx delete mode 100644 src/views/exception/403.vue diff --git a/src/components/Ellipsis/Ellipsis.vue b/src/components/Ellipsis/Ellipsis.vue index f47d4f9e..fa612b95 100644 --- a/src/components/Ellipsis/Ellipsis.vue +++ b/src/components/Ellipsis/Ellipsis.vue @@ -1,15 +1,6 @@ - - diff --git a/src/components/Exception/index.js b/src/components/Exception/index.js deleted file mode 100644 index dda91be1..00000000 --- a/src/components/Exception/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import ExceptionPage from './ExceptionPage.vue' -export default ExceptionPage diff --git a/src/components/Exception/type.js b/src/components/Exception/type.js deleted file mode 100644 index 8158f0f9..00000000 --- a/src/components/Exception/type.js +++ /dev/null @@ -1,19 +0,0 @@ -const types = { - 403: { - img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', - title: '403', - desc: '抱歉,你无权访问该页面' - }, - 404: { - img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', - title: '404', - desc: '抱歉,你访问的页面不存在或仍在开发中' - }, - 500: { - img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg', - title: '500', - desc: '抱歉,服务器出错了' - } -} - -export default types diff --git a/src/components/NumberInfo/NumberInfo.vue b/src/components/NumberInfo/NumberInfo.vue deleted file mode 100644 index dd4cdc35..00000000 --- a/src/components/NumberInfo/NumberInfo.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - - - diff --git a/src/components/NumberInfo/index.js b/src/components/NumberInfo/index.js deleted file mode 100644 index 659a2f38..00000000 --- a/src/components/NumberInfo/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import NumberInfo from './NumberInfo' - -export default NumberInfo diff --git a/src/components/NumberInfo/index.less b/src/components/NumberInfo/index.less deleted file mode 100644 index 719113da..00000000 --- a/src/components/NumberInfo/index.less +++ /dev/null @@ -1,55 +0,0 @@ -@import "../index"; - -@numberInfo-prefix-cls: ~"@{ant-pro-prefix}-number-info"; - -.@{numberInfo-prefix-cls} { - - .ant-pro-number-info-subtitle { - color: @text-color-secondary; - font-size: @font-size-base; - height: 22px; - line-height: 22px; - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; - white-space: nowrap; - } - - .number-info-value { - margin-top: 4px; - font-size: 0; - overflow: hidden; - text-overflow: ellipsis; - word-break: break-all; - white-space: nowrap; - - & > span { - color: @heading-color; - display: inline-block; - line-height: 32px; - height: 32px; - font-size: 24px; - margin-right: 32px; - } - - .sub-total { - color: @text-color-secondary; - font-size: @font-size-lg; - vertical-align: top; - margin-right: 0; - i { - font-size: 12px; - transform: scale(0.82); - margin-left: 4px; - } - :global { - .anticon-caret-up { - color: @red-6; - } - .anticon-caret-down { - color: @green-6; - } - } - } - } -} \ No newline at end of file diff --git a/src/components/TagSelect/TagSelectOption.jsx b/src/components/TagSelect/TagSelectOption.jsx deleted file mode 100644 index f0b098e4..00000000 --- a/src/components/TagSelect/TagSelectOption.jsx +++ /dev/null @@ -1,45 +0,0 @@ -import { Tag } from 'ant-design-vue' -const { CheckableTag } = Tag - -export default { - name: 'TagSelectOption', - props: { - prefixCls: { - type: String, - default: 'ant-pro-tag-select-option' - }, - value: { - type: [String, Number, Object], - default: '' - }, - checked: { - type: Boolean, - default: false - } - }, - data() { - return { - localChecked: this.checked || false - } - }, - watch: { - 'checked'(val) { - this.localChecked = val - }, - '$parent.items': { - handler: function(val) { - this.value && val.hasOwnProperty(this.value) && (this.localChecked = val[this.value]) - }, - deep: true - } - }, - render() { - const { $slots, value } = this - const onChange = (checked) => { - this.$emit('change', { value, checked }) - } - return ( - {$slots.default} - ) - } -} diff --git a/src/components/TagSelect/index.jsx b/src/components/TagSelect/index.jsx deleted file mode 100644 index e692b9f8..00000000 --- a/src/components/TagSelect/index.jsx +++ /dev/null @@ -1,102 +0,0 @@ -import PropTypes from 'ant-design-vue/es/_util/vue-types' -import Option from './TagSelectOption.jsx' -import { filterEmpty } from '@/components/_util/util' - -export default { - Option, - name: 'TagSelect', - model: { - prop: 'checked', - event: 'change' - }, - props: { - prefixCls: { - type: String, - default: 'ant-pro-tag-select' - }, - defaultValue: { - type: PropTypes.array, - default: null - }, - value: { - type: PropTypes.array, - default: null - }, - expandable: { - type: Boolean, - default: false - }, - hideCheckAll: { - type: Boolean, - default: false - } - }, - data() { - return { - expand: false, - localCheckAll: false, - items: this.getItemsKey(filterEmpty(this.$slots.default)), - val: this.value || this.defaultValue || [] - } - }, - methods: { - onChange(checked) { - const key = Object.keys(this.items).filter(key => key === checked.value) - this.items[key] = checked.checked - const bool = Object.values(this.items).lastIndexOf(false) - if (bool === -1) { - this.localCheckAll = true - } else { - this.localCheckAll = false - } - }, - onCheckAll(checked) { - Object.keys(this.items).forEach(v => { - this.items[v] = checked.checked - }) - }, - getItemsKey(items) { - const totalItem = {} - items.forEach(item => { - totalItem[item.componentOptions.propsData && item.componentOptions.propsData.value] = false - }) - return totalItem - }, - // CheckAll Button - renderCheckAll() { - return !this.hideCheckAll && () || null - }, - // expandable - renderExpandable() { - - }, - // render option - renderTags(items) { - const listeners = { - change: (checked) => { - this.onChange(checked) - this.$emit('change', checked) - } - } - - return items.map(vnode => { - const options = vnode.componentOptions - options.listeners = listeners - return vnode - }) - } - }, - render() { - const { $props: { prefixCls } } = this - const classString = { - [`${prefixCls}`]: true - } - const tagItems = filterEmpty(this.$slots.default) - return ( -
- {this.renderCheckAll()} - {this.renderTags(tagItems)} -
- ) - } -} diff --git a/src/components/_util/util.js b/src/components/_util/util.js index a761e321..c8e0a5ff 100644 --- a/src/components/_util/util.js +++ b/src/components/_util/util.js @@ -1,16 +1,3 @@ -/** - * components util - */ - -/** - * 清理空值,对象 - * @param children - * @returns {*[]} - */ -export function filterEmpty(children = []) { - return children.filter(c => c.tag || (c.text && c.text.trim() !== '')) -} - /** * 获取字符串长度,英文字符 长度1,中文字符长度2 * @param {*} str diff --git a/src/components/index.js b/src/components/index.js index 19d865d5..89813d27 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -3,17 +3,13 @@ import Vue from 'vue' // pro components import Ellipsis from '@/components/Ellipsis' import FooterToolbar from '@/components/FooterToolbar' -import NumberInfo from '@/components/NumberInfo' import DescriptionList from '@/components/DescriptionList' -import ExceptionPage from '@/components/Exception' import Upload from '@/components/Upload/Upload' const _components = { Ellipsis, FooterToolbar, - NumberInfo, DescriptionList, - ExceptionPage, Upload } diff --git a/src/views/exception/403.vue b/src/views/exception/403.vue deleted file mode 100644 index d64e8559..00000000 --- a/src/views/exception/403.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/src/views/exception/type.js b/src/views/exception/type.js index 8158f0f9..fb13be57 100644 --- a/src/views/exception/type.js +++ b/src/views/exception/type.js @@ -1,13 +1,8 @@ const types = { - 403: { - img: 'https://gw.alipayobjects.com/zos/rmsportal/wZcnGqRDyhPOEYFcZDnb.svg', - title: '403', - desc: '抱歉,你无权访问该页面' - }, 404: { img: 'https://gw.alipayobjects.com/zos/rmsportal/KpnpchXsobRgLElEozzI.svg', title: '404', - desc: '抱歉,你访问的页面不存在或仍在开发中' + desc: '抱歉,你访问的页面不存在' }, 500: { img: 'https://gw.alipayobjects.com/zos/rmsportal/RVRUAYdCGeYNBWoKiIwB.svg',