sh-view 2.7.7 → 2.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/other.js +8 -0
- package/package.json +4 -3
- package/packages/components/index.js +35 -35
- package/packages/components/{global-components/sh-alert → sh-alert}/index.vue +8 -15
- package/packages/components/{global-components/sh-badge → sh-badge}/index.vue +6 -5
- package/packages/components/{global-components/sh-drawer → sh-drawer}/index.vue +49 -27
- package/packages/components/{global-components/sh-form → sh-form}/js/useForm.js +2 -2
- package/packages/components/sh-header/index.vue +260 -0
- package/packages/components/{global-components/sh-poptip → sh-poptip}/index.vue +1 -1
- package/packages/components/{global-components/sh-progress → sh-progress}/index.vue +2 -18
- package/packages/components/{global-components/sh-table → sh-table}/css/index.scss +18 -0
- package/packages/components/{global-components/sh-table → sh-table}/js/useTable.js +4 -6
- package/packages/components/{global-components/sh-table → sh-table}/table.vue +217 -218
- package/packages/components/{global-components/sh-tabs → sh-tabs}/index.vue +97 -34
- package/packages/components/{global-components/sh-tree → sh-tree}/components/table-tree.vue +1 -1
- package/packages/components/{global-components/sh-tree → sh-tree}/css/index.scss +1 -0
- package/packages/components/{global-components/sh-tree → sh-tree}/index.vue +16 -5
- package/packages/components/{global-components/sh-tree → sh-tree}/mixin/treeProps.js +1 -1
- package/packages/index.js +39 -39
- package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-week-box.vue +126 -126
- package/packages/{components/other-components → other}/sh-menu/index.vue +3 -0
- package/packages/{components/other-components → other}/sh-menu/menu-item-content.vue +3 -3
- package/packages/other/sh-preview/components/sh-excel.vue +163 -0
- package/packages/{components/other-components → other}/sh-preview/index.vue +92 -80
- package/packages/vxeTable/css/index.scss +1 -2
- package/packages/vxeTable/index.js +1 -1
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +70 -63
- package/packages/components/global-components/sh-header/index.vue +0 -278
- package/packages/components/other-components/sh-preview/components/sh-excel.vue +0 -929
- /package/packages/components/{global-components/sh-calendar → sh-calendar}/index.vue +0 -0
- /package/packages/components/{global-components/sh-card → sh-card}/index.vue +0 -0
- /package/packages/components/{global-components/sh-code-editor → sh-code-editor}/index.vue +0 -0
- /package/packages/components/{global-components/sh-code-editor → sh-code-editor}/themes/dark.js +0 -0
- /package/packages/components/{global-components/sh-code-editor → sh-code-editor}/themes/dracula.js +0 -0
- /package/packages/components/{global-components/sh-code-editor → sh-code-editor}/themes/index.js +0 -0
- /package/packages/components/{global-components/sh-col → sh-col}/css/index.scss +0 -0
- /package/packages/components/{global-components/sh-col → sh-col}/index.vue +0 -0
- /package/packages/components/{global-components/sh-corner → sh-corner}/index.vue +0 -0
- /package/packages/components/{global-components/sh-count-to → sh-count-to}/index.vue +0 -0
- /package/packages/components/{global-components/sh-date → sh-date}/index.vue +0 -0
- /package/packages/components/{global-components/sh-drawer → sh-drawer}/scrollbar.js +0 -0
- /package/packages/components/{global-components/sh-empty → sh-empty}/index.vue +0 -0
- /package/packages/components/{global-components/sh-form → sh-form}/form.vue +0 -0
- /package/packages/components/{global-components/sh-form → sh-form}/js/props.js +0 -0
- /package/packages/components/{global-components/sh-form → sh-form}/query.vue +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/default/icons.scss +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/default/ionicons.svg +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/default/ionicons.ttf +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/default/ionicons.woff +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/default/ionicons.woff2 +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/iconfont.js +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/iconfont.json +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/iconfont.ttf +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/iconfont.woff +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/iconfont.woff2 +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/font/icons.scss +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/css/index.scss +0 -0
- /package/packages/components/{global-components/sh-icon → sh-icon}/index.vue +0 -0
- /package/packages/components/{global-components/sh-image → sh-image}/index.vue +0 -0
- /package/packages/components/{global-components/sh-list → sh-list}/index.vue +0 -0
- /package/packages/components/{global-components/sh-loading → sh-loading}/index.vue +0 -0
- /package/packages/components/{global-components/sh-modal → sh-modal}/index.vue +0 -0
- /package/packages/components/{global-components/sh-noticebar → sh-noticebar}/index.vue +0 -0
- /package/packages/components/{global-components/sh-pull-refresh → sh-pull-refresh}/index.vue +0 -0
- /package/packages/components/{global-components/sh-result → sh-result}/index.vue +0 -0
- /package/packages/components/{global-components/sh-row → sh-row}/css/index.scss +0 -0
- /package/packages/components/{global-components/sh-row → sh-row}/index.vue +0 -0
- /package/packages/components/{global-components/sh-split → sh-split}/components/trigger.vue +0 -0
- /package/packages/components/{global-components/sh-split → sh-split}/index.vue +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/components/importModal.vue +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/components/sh-column.vue +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/grid.vue +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/js/excel_to_json.js +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/js/props.js +0 -0
- /package/packages/components/{global-components/sh-table → sh-table}/js/tableMethods.js +0 -0
- /package/packages/components/{global-components/sh-tag → sh-tag}/index.vue +0 -0
- /package/packages/components/{global-components/sh-toolbar → sh-toolbar}/index.vue +0 -0
- /package/packages/components/{global-components/sh-upload → sh-upload}/index.vue +0 -0
- /package/packages/components/{global-components/sh-upload → sh-upload}/js/ajax.js +0 -0
- /package/packages/components/{global-components/sh-water-fall → sh-water-fall}/index.vue +0 -0
- /package/packages/components/{global-components/sh-water-mark → sh-water-mark}/index.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/components/cron-content.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/css/index.scss +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/index.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/mixin/cron-emits.js +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/mixin/cron-hooks.js +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/mixin/cron-props.js +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-day-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-hour-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-minute-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-month-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-second-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/tabs/cron-year-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-cron-modal/utils/index.js +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/index.vue +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/langs/zh-Hans.js +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/content/default/content.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.inline.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.inline.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.mobile.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/content.mobile.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.css +0 -0
- /package/packages/{components/other-components → other}/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.min.css +0 -0
- /package/packages/{components/other-components → other}/sh-menu/menu-group-content.vue +0 -0
- /package/packages/{components/other-components → other}/sh-menu-card/index.vue +0 -0
- /package/packages/{components/other-components → other}/sh-menu-card/menu-box.vue +0 -0
- /package/packages/{components/other-components → other}/sh-preview/components/sh-word.vue +0 -0
- /package/packages/{components/other-components → other}/sh-preview/js/data-hook.js +0 -0
- /package/packages/{components/other-components → other}/sh-preview/js/data-props.js +0 -0
- /package/packages/{components/other-components → other}/sh-system-tip/index.vue +0 -0
package/README.md
CHANGED
|
@@ -71,16 +71,16 @@ createApp(App).use(ShView).mount('#app')
|
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
#### 项目预览
|
|
74
|
-
<img alt="img.png" src="
|
|
75
|
-
<img alt="img_1.png" src="
|
|
76
|
-
<img alt="img_2.png" src="
|
|
77
|
-
<img alt="img_3.png" src="
|
|
78
|
-
<img alt="img_4.png" src="
|
|
79
|
-
<img alt="img_5.png" src="
|
|
80
|
-
<img alt="img_6.png" src="
|
|
81
|
-
<img alt="img_7.png" src="
|
|
82
|
-
<img alt="img_8.png" src="
|
|
83
|
-
<img alt="img_9.png" src="
|
|
84
|
-
<img alt="img_10.png" src="
|
|
85
|
-
<img alt="img_11.png" src="
|
|
86
|
-
<img alt="img_12.png" src="
|
|
74
|
+
<img alt="img.png" src="public/img/img.png" width="100%"/>
|
|
75
|
+
<img alt="img_1.png" src="public/img/img_1.png" width="49%"/>
|
|
76
|
+
<img alt="img_2.png" src="public/img/img_2.png" width="49%"/>
|
|
77
|
+
<img alt="img_3.png" src="public/img/img_3.png" width="49%"/>
|
|
78
|
+
<img alt="img_4.png" src="public/img/img_4.png" width="49%"/>
|
|
79
|
+
<img alt="img_5.png" src="public/img/img_5.png" width="49%"/>
|
|
80
|
+
<img alt="img_6.png" src="public/img/img_6.png" width="49%"/>
|
|
81
|
+
<img alt="img_7.png" src="public/img/img_7.png" width="49%"/>
|
|
82
|
+
<img alt="img_8.png" src="public/img/img_8.png" width="49%"/>
|
|
83
|
+
<img alt="img_9.png" src="public/img/img_9.png" width="49%"/>
|
|
84
|
+
<img alt="img_10.png" src="public/img/img_10.png" width="49%"/>
|
|
85
|
+
<img alt="img_11.png" src="public/img/img_11.png" width="49%"/>
|
|
86
|
+
<img alt="img_12.png" src="public/img/img_12.png" width="49%"/>
|
package/other.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineAsyncComponent } from 'vue'
|
|
2
|
+
|
|
3
|
+
export const ShCronModal = defineAsyncComponent(() => import('./packages/other/sh-cron-modal/index.vue'))
|
|
4
|
+
export const ShMarkdown = defineAsyncComponent(() => import('./packages/other/sh-markdown/index.vue'))
|
|
5
|
+
export const ShMenu = defineAsyncComponent(() => import('./packages/other/sh-menu/index.vue'))
|
|
6
|
+
export const ShMenuCard = defineAsyncComponent(() => import('./packages/other/sh-menu-card/index.vue'))
|
|
7
|
+
export const ShPreview = defineAsyncComponent(() => import('./packages/other/sh-preview/index.vue'))
|
|
8
|
+
export const ShSystemTip = defineAsyncComponent(() => import('./packages/other/sh-system-tip/index.vue'))
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-view",
|
|
3
|
-
"version": "2.7.
|
|
4
|
-
"description": "基于vxe-table
|
|
3
|
+
"version": "2.7.9",
|
|
4
|
+
"description": "基于vxe-table二次封装,更包含Alert,Badge,Card,CodeEditor,Col,Corner,CountTo,Drawer,Empty,Form,Header,Icon,List,Loading,Modal,Noticebar,Poptip,Progress,PullRefresh,Query,Result,Row,Split,Grid,Table,Tabs,Tag,Toolbar,Tree,Upload,WaterFall,WaterMark等丰富组件库",
|
|
5
5
|
"main": "packages/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"serve": "vue-cli-service serve",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@codemirror/lang-json": "^6.0.1",
|
|
19
19
|
"@codemirror/lang-sql": "^6.5.2",
|
|
20
20
|
"@tinymce/tinymce-vue": "^5.0.0",
|
|
21
|
+
"@wolf-table/table": "^0.0.1",
|
|
21
22
|
"babel-polyfill": "^6.26.0",
|
|
22
23
|
"codemirror": "^6.0.1",
|
|
23
24
|
"core-js": "^3.32.2",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"jszip": "^3.10.1",
|
|
30
31
|
"lunar-typescript": "^1.6.10",
|
|
31
32
|
"popper.js": "^1.16.1",
|
|
32
|
-
"sh-tools": "^2.2.
|
|
33
|
+
"sh-tools": "^2.2.5",
|
|
33
34
|
"tinymce": "^5.10.5",
|
|
34
35
|
"vue": "^3.3.4",
|
|
35
36
|
"vue-masonry": "^0.16.0",
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
// 全局公共封装组件
|
|
2
|
-
import ShAlert from './
|
|
3
|
-
import ShBadge from './
|
|
4
|
-
import ShCalendar from './
|
|
5
|
-
import ShCard from './
|
|
6
|
-
import ShCodeEditor from './
|
|
7
|
-
import ShCol from './
|
|
8
|
-
import ShCorner from './
|
|
9
|
-
import ShCountTo from './
|
|
10
|
-
import ShDate from './
|
|
11
|
-
import ShDrawer from './
|
|
12
|
-
import ShEmpty from './
|
|
13
|
-
import ShForm from './
|
|
14
|
-
import ShHeader from './
|
|
15
|
-
import ShIcon from './
|
|
16
|
-
import ShImage from './
|
|
17
|
-
import ShList from './
|
|
18
|
-
import ShLoading from './
|
|
19
|
-
import ShModal from './
|
|
20
|
-
import ShNoticebar from './
|
|
21
|
-
import ShPoptip from './
|
|
22
|
-
import ShProgress from './
|
|
23
|
-
import ShPullRefresh from './
|
|
24
|
-
import ShQuery from './
|
|
25
|
-
import ShResult from './
|
|
26
|
-
import ShRow from './
|
|
27
|
-
import ShSplit from './
|
|
28
|
-
import ShGrid from './
|
|
29
|
-
import ShTable from './
|
|
30
|
-
import ShTabs from './
|
|
31
|
-
import ShTag from './
|
|
32
|
-
import ShToolbar from './
|
|
33
|
-
import ShTree from './
|
|
34
|
-
import ShUpload from './
|
|
35
|
-
import ShWaterFall from './
|
|
36
|
-
import ShWaterMark from './
|
|
2
|
+
import ShAlert from './sh-alert/index.vue'
|
|
3
|
+
import ShBadge from './sh-badge/index.vue'
|
|
4
|
+
import ShCalendar from './sh-calendar/index.vue'
|
|
5
|
+
import ShCard from './sh-card/index.vue'
|
|
6
|
+
import ShCodeEditor from './sh-code-editor/index.vue'
|
|
7
|
+
import ShCol from './sh-col/index.vue'
|
|
8
|
+
import ShCorner from './sh-corner/index.vue'
|
|
9
|
+
import ShCountTo from './sh-count-to/index.vue'
|
|
10
|
+
import ShDate from './sh-date/index.vue'
|
|
11
|
+
import ShDrawer from './sh-drawer/index.vue'
|
|
12
|
+
import ShEmpty from './sh-empty/index.vue'
|
|
13
|
+
import ShForm from './sh-form/form.vue'
|
|
14
|
+
import ShHeader from './sh-header/index.vue'
|
|
15
|
+
import ShIcon from './sh-icon/index.vue'
|
|
16
|
+
import ShImage from './sh-image/index.vue'
|
|
17
|
+
import ShList from './sh-list/index.vue'
|
|
18
|
+
import ShLoading from './sh-loading/index.vue'
|
|
19
|
+
import ShModal from './sh-modal/index.vue'
|
|
20
|
+
import ShNoticebar from './sh-noticebar/index.vue'
|
|
21
|
+
import ShPoptip from './sh-poptip/index.vue'
|
|
22
|
+
import ShProgress from './sh-progress/index.vue'
|
|
23
|
+
import ShPullRefresh from './sh-pull-refresh/index.vue'
|
|
24
|
+
import ShQuery from './sh-form/query.vue'
|
|
25
|
+
import ShResult from './sh-result/index.vue'
|
|
26
|
+
import ShRow from './sh-row/index.vue'
|
|
27
|
+
import ShSplit from './sh-split/index.vue'
|
|
28
|
+
import ShGrid from './sh-table/grid.vue'
|
|
29
|
+
import ShTable from './sh-table/table.vue'
|
|
30
|
+
import ShTabs from './sh-tabs/index.vue'
|
|
31
|
+
import ShTag from './sh-tag/index.vue'
|
|
32
|
+
import ShToolbar from './sh-toolbar/index.vue'
|
|
33
|
+
import ShTree from './sh-tree/index.vue'
|
|
34
|
+
import ShUpload from './sh-upload/index.vue'
|
|
35
|
+
import ShWaterFall from './sh-water-fall/index.vue'
|
|
36
|
+
import ShWaterMark from './sh-water-mark/index.vue'
|
|
37
37
|
import { VxeButton, VxeInput, VxeTextarea, VxeSelect } from 'vxe-table'
|
|
38
38
|
|
|
39
39
|
const components = {
|
|
@@ -55,23 +55,16 @@ export default defineComponent({
|
|
|
55
55
|
const { slots, emit } = context
|
|
56
56
|
const closed = ref(false)
|
|
57
57
|
|
|
58
|
+
const iconTypeMap = {
|
|
59
|
+
success: 'ios-checkmark-circle',
|
|
60
|
+
info: 'ios-information-circle',
|
|
61
|
+
warning: 'ios-alert',
|
|
62
|
+
error: 'ios-close-circle'
|
|
63
|
+
}
|
|
64
|
+
|
|
58
65
|
const isDesc = computed(() => !!slots.content)
|
|
59
66
|
const iconType = computed(() => {
|
|
60
|
-
let type =
|
|
61
|
-
switch (props.type) {
|
|
62
|
-
case 'success':
|
|
63
|
-
type = 'ios-checkmark-circle'
|
|
64
|
-
break
|
|
65
|
-
case 'info':
|
|
66
|
-
type = 'ios-information-circle'
|
|
67
|
-
break
|
|
68
|
-
case 'warning':
|
|
69
|
-
type = 'ios-alert'
|
|
70
|
-
break
|
|
71
|
-
case 'error':
|
|
72
|
-
type = 'ios-close-circle'
|
|
73
|
-
break
|
|
74
|
-
}
|
|
67
|
+
let type = iconTypeMap[props.type]
|
|
75
68
|
if (isDesc.value) type += '-outline'
|
|
76
69
|
return type
|
|
77
70
|
})
|
|
@@ -72,19 +72,20 @@ export default defineComponent({
|
|
|
72
72
|
return parseInt(props.count) >= parseInt(props.overflowCount) ? `${props.overflowCount}+` : props.count
|
|
73
73
|
})
|
|
74
74
|
const hasBadge = computed(() => {
|
|
75
|
+
let hasStatus = false
|
|
75
76
|
if (props.count) {
|
|
76
|
-
|
|
77
|
+
hasStatus = !(parseInt(props.count) === 0)
|
|
77
78
|
}
|
|
78
79
|
if (props.dot) {
|
|
79
|
-
|
|
80
|
+
hasStatus = true
|
|
80
81
|
if (props.count !== null) {
|
|
81
82
|
if (parseInt(props.count) === 0) {
|
|
82
|
-
|
|
83
|
+
hasStatus = false
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
if (props.text !== '')
|
|
87
|
-
return
|
|
87
|
+
if (props.text !== '') hasStatus = true
|
|
88
|
+
return hasStatus || props.showZero
|
|
88
89
|
})
|
|
89
90
|
const hasCount = computed(() => {
|
|
90
91
|
if (props.count || props.text !== '') return true
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<slot name="footer"></slot>
|
|
26
26
|
</div>
|
|
27
27
|
</div>
|
|
28
|
-
<div v-if="draggable
|
|
28
|
+
<div v-if="draggable" class="sh-drawer-drag" :class="'sh-drawer-drag-' + placement" @mousedown="handleTriggerMousedown">
|
|
29
29
|
<slot name="trigger">
|
|
30
30
|
<div class="sh-drawer-drag-move-trigger">
|
|
31
31
|
<div class="sh-drawer-drag-move-trigger-point"><i></i><i></i><i></i><i></i><i></i></div>
|
|
@@ -127,6 +127,7 @@ export default defineComponent({
|
|
|
127
127
|
const wrapperWidth = ref(props.width)
|
|
128
128
|
const wrapperHeight = ref(props.height)
|
|
129
129
|
const wrapperLeft = ref(0)
|
|
130
|
+
const wrapperTop = ref(0)
|
|
130
131
|
const minWidth = ref(256)
|
|
131
132
|
const minHeight = ref(256)
|
|
132
133
|
const id = ref($vUtils.randomStr(6))
|
|
@@ -134,6 +135,7 @@ export default defineComponent({
|
|
|
134
135
|
const sliderList = ref([])
|
|
135
136
|
let timer = null
|
|
136
137
|
|
|
138
|
+
const isHorizontal = computed(() => ['left', 'right'].includes(props.placement))
|
|
137
139
|
const wrapClasses = computed(() => {
|
|
138
140
|
return {
|
|
139
141
|
'sh-drawer-hidden': !wrapShow.value,
|
|
@@ -145,7 +147,7 @@ export default defineComponent({
|
|
|
145
147
|
})
|
|
146
148
|
const mainStyles = computed(() => {
|
|
147
149
|
let style = {}
|
|
148
|
-
if (
|
|
150
|
+
if (isHorizontal.value) {
|
|
149
151
|
const width = parseInt(dragWidth.value)
|
|
150
152
|
const styleWidth = {
|
|
151
153
|
width: width <= 100 ? `${width}%` : `${width}px`
|
|
@@ -168,7 +170,7 @@ export default defineComponent({
|
|
|
168
170
|
}
|
|
169
171
|
})
|
|
170
172
|
const transitionName = computed(() => {
|
|
171
|
-
if (
|
|
173
|
+
if (isHorizontal.value) return `move-${props.placement}`
|
|
172
174
|
else if (props.placement === 'top') return 'move-up'
|
|
173
175
|
else return 'move-down'
|
|
174
176
|
})
|
|
@@ -205,25 +207,45 @@ export default defineComponent({
|
|
|
205
207
|
}
|
|
206
208
|
const handleMousemove = event => {
|
|
207
209
|
if (!canMove.value || !props.draggable || !visible.value) return
|
|
208
|
-
//
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
// 更新容器距离
|
|
211
|
+
handleSetWrapper()
|
|
212
|
+
if (isHorizontal.value) {
|
|
213
|
+
const left = event.pageX - wrapperLeft.value
|
|
214
|
+
// 如果抽屉方向为右边,宽度计算需用容器宽度减去left
|
|
215
|
+
let width = props.placement === 'right' ? wrapperWidth.value - left : left
|
|
216
|
+
// 限定最小宽度
|
|
217
|
+
width = Math.max(width, parseFloat(minWidth.value))
|
|
218
|
+
event.atMin = width === parseFloat(minWidth.value)
|
|
219
|
+
// 如果当前width不大于100,视为百分比
|
|
220
|
+
if (width <= 100) width = (width / wrapperWidth.value) * 100
|
|
221
|
+
if (width >= window.innerWidth) width = window.innerWidth
|
|
222
|
+
dragWidth.value = width
|
|
223
|
+
emit('resize-width', parseInt(dragWidth.value))
|
|
224
|
+
emit('drag', 'dragging', parseInt(dragWidth.value))
|
|
225
|
+
} else {
|
|
226
|
+
const top = event.pageY - wrapperTop.value
|
|
227
|
+
// 如果抽屉方向为下面,宽度计算需用容器宽度减去left
|
|
228
|
+
let heigth = props.placement === 'bottom' ? wrapperHeight.value - top : top
|
|
229
|
+
// 限定最小高度
|
|
230
|
+
heigth = Math.max(heigth, parseFloat(minHeight.value))
|
|
231
|
+
event.atMin = heigth === parseFloat(minHeight.value)
|
|
232
|
+
// 如果当前heigth不大于100,视为百分比
|
|
233
|
+
if (heigth <= 100) heigth = (heigth / wrapperHeight.value) * 100
|
|
234
|
+
if (heigth >= window.innerHeight) heigth = window.innerHeight
|
|
235
|
+
dragHeight.value = heigth
|
|
236
|
+
emit('resize-width', parseInt(dragHeight.value))
|
|
237
|
+
emit('drag', 'dragging', parseInt(dragHeight.value))
|
|
238
|
+
}
|
|
222
239
|
}
|
|
223
|
-
const
|
|
224
|
-
const { width, left } = drawerRef.value.getBoundingClientRect()
|
|
225
|
-
|
|
226
|
-
|
|
240
|
+
const handleSetWrapper = () => {
|
|
241
|
+
const { width, height, left, top } = drawerRef.value.getBoundingClientRect()
|
|
242
|
+
if (isHorizontal.value) {
|
|
243
|
+
wrapperWidth.value = width
|
|
244
|
+
wrapperLeft.value = left
|
|
245
|
+
} else {
|
|
246
|
+
wrapperHeight.value = height
|
|
247
|
+
wrapperTop.value = top
|
|
248
|
+
}
|
|
227
249
|
}
|
|
228
250
|
const handleMouseup = () => {
|
|
229
251
|
if (!props.draggable || !visible.value) return
|
|
@@ -330,7 +352,7 @@ export default defineComponent({
|
|
|
330
352
|
addDrawer()
|
|
331
353
|
$vUtils.onListener(document, 'mousemove', handleMousemove)
|
|
332
354
|
$vUtils.onListener(document, 'mouseup', handleMouseup)
|
|
333
|
-
|
|
355
|
+
handleSetWrapper()
|
|
334
356
|
})
|
|
335
357
|
onBeforeUnmount(() => {
|
|
336
358
|
removeDrawer()
|
|
@@ -342,17 +364,17 @@ export default defineComponent({
|
|
|
342
364
|
return {
|
|
343
365
|
slots,
|
|
344
366
|
visible,
|
|
345
|
-
handleMask,
|
|
346
367
|
wrapClasses,
|
|
347
|
-
handleWrapClick,
|
|
348
368
|
transitionName,
|
|
349
369
|
classes,
|
|
350
370
|
mainStyles,
|
|
351
|
-
close,
|
|
352
371
|
showHead,
|
|
353
|
-
handleTriggerMousedown,
|
|
354
372
|
drawerRef,
|
|
355
|
-
drawerContent
|
|
373
|
+
drawerContent,
|
|
374
|
+
close,
|
|
375
|
+
handleMask,
|
|
376
|
+
handleWrapClick,
|
|
377
|
+
handleTriggerMousedown
|
|
356
378
|
}
|
|
357
379
|
}
|
|
358
380
|
})
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-pageheader" :style="styles" :class="classes">
|
|
3
|
+
<sh-loading :loading="loading" fix />
|
|
4
|
+
<div class="sh-pageheader-heading">
|
|
5
|
+
<div v-if="showback" class="sh-pageheader-back">
|
|
6
|
+
<div class="sh-pageheader-back-button" @click="handleBack"><sh-icon :size="iconSize" type="ios-arrow-back" /></div>
|
|
7
|
+
</div>
|
|
8
|
+
<sh-icon v-if="icon" style="margin-right: 0.5rem" :type="icon" :size="iconSize" :color="iconColor"></sh-icon>
|
|
9
|
+
<span v-if="title || slots.title" class="sh-pageheader-title" :style="titleStyle">
|
|
10
|
+
<slot name="title">{{ title }}</slot>
|
|
11
|
+
</span>
|
|
12
|
+
<span v-if="subTitle || slots.subTitle" class="sh-pageheader-subtitle">
|
|
13
|
+
<slot name="subTitle">{{ subTitle }}</slot>
|
|
14
|
+
</span>
|
|
15
|
+
<div v-if="slots.tags" class="sh-pageheader-tags"><slot name="tags"></slot></div>
|
|
16
|
+
<div v-if="slots.extra" class="sh-pageheader-extra"><slot name="extra"></slot></div>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="slots.default" :class="contentClass">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</div>
|
|
21
|
+
<slot name="body"></slot>
|
|
22
|
+
<div v-if="slots.footer" class="sh-pageheader-footer"><slot name="footer"></slot></div>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { defineComponent, computed } from 'vue'
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: 'ShHeader',
|
|
30
|
+
props: {
|
|
31
|
+
size: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'default'
|
|
34
|
+
},
|
|
35
|
+
color: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: ''
|
|
38
|
+
},
|
|
39
|
+
theme: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ''
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
type: String
|
|
45
|
+
},
|
|
46
|
+
iconSize: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: 20
|
|
49
|
+
},
|
|
50
|
+
iconColor: {
|
|
51
|
+
type: String
|
|
52
|
+
},
|
|
53
|
+
ghost: {
|
|
54
|
+
type: Boolean
|
|
55
|
+
},
|
|
56
|
+
full: {
|
|
57
|
+
type: Boolean
|
|
58
|
+
},
|
|
59
|
+
border: {
|
|
60
|
+
type: Boolean
|
|
61
|
+
},
|
|
62
|
+
type: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: '' // 'success', 'info', 'warning', 'error'
|
|
65
|
+
},
|
|
66
|
+
title: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: ''
|
|
69
|
+
},
|
|
70
|
+
subTitle: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ''
|
|
73
|
+
},
|
|
74
|
+
loading: {
|
|
75
|
+
type: Boolean
|
|
76
|
+
},
|
|
77
|
+
nowrap: {
|
|
78
|
+
type: Boolean
|
|
79
|
+
},
|
|
80
|
+
showback: {
|
|
81
|
+
type: Boolean
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
emits: ['back'],
|
|
85
|
+
setup(props, context) {
|
|
86
|
+
const { emit, slots } = context
|
|
87
|
+
|
|
88
|
+
let sizeMap = {
|
|
89
|
+
large: '19px',
|
|
90
|
+
default: '17px',
|
|
91
|
+
medium: 'var(--vxe-font-size)',
|
|
92
|
+
small: 'var(--vxe-font-size-small)',
|
|
93
|
+
mini: 'var(--vxe-font-size-smini)'
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const styles = computed(() => {
|
|
97
|
+
return {
|
|
98
|
+
backgroundColor: props.color
|
|
99
|
+
}
|
|
100
|
+
})
|
|
101
|
+
const classes = computed(() => {
|
|
102
|
+
return {
|
|
103
|
+
'sh-pageheader-ghost': props.ghost,
|
|
104
|
+
'sh-pageheader-full': props.full,
|
|
105
|
+
'sh-pageheader-border': props.border,
|
|
106
|
+
[`sh-pageheader-theme-${props.theme}`]: props.theme,
|
|
107
|
+
'has-footer': slots.footer,
|
|
108
|
+
[`sh-pageheader-type-${props.type}`]: props.type,
|
|
109
|
+
[`${props.size}`]: props.size
|
|
110
|
+
}
|
|
111
|
+
})
|
|
112
|
+
const titleStyle = computed(() => {
|
|
113
|
+
return {
|
|
114
|
+
fontSize: sizeMap[props.size] || sizeMap.default,
|
|
115
|
+
whiteSpace: props.nowrap ? 'nowrap' : ''
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
const contentClass = computed(() => {
|
|
119
|
+
return {
|
|
120
|
+
'sh-pageheader-content': true,
|
|
121
|
+
'no-padding': !props.title && !slots.title && !props.subTitle && !slots.subTitle && !slots.tags && !slots.extra
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
const handleBack = () => {
|
|
126
|
+
emit('back')
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
styles,
|
|
130
|
+
classes,
|
|
131
|
+
titleStyle,
|
|
132
|
+
contentClass,
|
|
133
|
+
slots,
|
|
134
|
+
handleBack
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
</script>
|
|
139
|
+
|
|
140
|
+
<style lang="scss" scoped>
|
|
141
|
+
.sh-pageheader {
|
|
142
|
+
display: block;
|
|
143
|
+
box-sizing: border-box;
|
|
144
|
+
border-radius: 2px;
|
|
145
|
+
line-height: 1.5;
|
|
146
|
+
position: relative;
|
|
147
|
+
padding: 0.5rem 1rem;
|
|
148
|
+
background-color: var(--vxe-table-body-background-color);
|
|
149
|
+
&-theme {
|
|
150
|
+
color: #fff;
|
|
151
|
+
&-primary {
|
|
152
|
+
background-color: var(--vxe-primary-color);
|
|
153
|
+
}
|
|
154
|
+
&-success {
|
|
155
|
+
background-color: var(--vxe-success-color);
|
|
156
|
+
}
|
|
157
|
+
&-warning {
|
|
158
|
+
background-color: var(--vxe-warning-color);
|
|
159
|
+
}
|
|
160
|
+
&-error {
|
|
161
|
+
background-color: var(--vxe-danger-color);
|
|
162
|
+
}
|
|
163
|
+
&-info {
|
|
164
|
+
background-color: var(--vxe-info-color);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
&-type {
|
|
168
|
+
color: #fff;
|
|
169
|
+
&-primary {
|
|
170
|
+
border-left: 4px solid var(--vxe-primary-color);
|
|
171
|
+
background-color: var(--primary-weak-color);
|
|
172
|
+
.sh-pageheader-heading-title {
|
|
173
|
+
color: var(--vxe-primary-color);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
&-success {
|
|
177
|
+
border-left: 4px solid var(--vxe-success-color);
|
|
178
|
+
background-color: #edfff3;
|
|
179
|
+
.sh-pageheader-heading-title {
|
|
180
|
+
color: var(--vxe-success-color);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
&-warning {
|
|
184
|
+
border-left: 4px solid var(--vxe-warning-color);
|
|
185
|
+
background-color: #fff9e6;
|
|
186
|
+
.sh-pageheader-heading-title {
|
|
187
|
+
color: var(--vxe-warning-color);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
&-error {
|
|
191
|
+
border-left: 4px solid var(--vxe-danger-color);
|
|
192
|
+
background-color: #ffefe6;
|
|
193
|
+
.sh-pageheader-heading-title {
|
|
194
|
+
color: var(--vxe-danger-color);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
&-info {
|
|
198
|
+
border-left: 4px solid var(--vxe-info-color);
|
|
199
|
+
background-color: #f0faff;
|
|
200
|
+
.sh-pageheader-heading-title {
|
|
201
|
+
color: var(--vxe-info-color);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
&-full {
|
|
206
|
+
padding-left: 0;
|
|
207
|
+
padding-right: 0;
|
|
208
|
+
}
|
|
209
|
+
&-ghost {
|
|
210
|
+
background-color: transparent;
|
|
211
|
+
}
|
|
212
|
+
&-border {
|
|
213
|
+
border: 1px solid var(--vxe-table-border-color);
|
|
214
|
+
}
|
|
215
|
+
&-heading {
|
|
216
|
+
width: 100%;
|
|
217
|
+
display: flex;
|
|
218
|
+
justify-content: space-between;
|
|
219
|
+
align-items: center;
|
|
220
|
+
}
|
|
221
|
+
&-content {
|
|
222
|
+
margin-top: 10px;
|
|
223
|
+
&.no-padding {
|
|
224
|
+
padding-top: 0;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
&-footer {
|
|
228
|
+
margin-top: 10px;
|
|
229
|
+
}
|
|
230
|
+
&-back {
|
|
231
|
+
font-size: 1.2rem;
|
|
232
|
+
line-height: 1;
|
|
233
|
+
margin-right: 0.5rem;
|
|
234
|
+
&-button {
|
|
235
|
+
color: inherit;
|
|
236
|
+
text-decoration: none;
|
|
237
|
+
outline: none;
|
|
238
|
+
transition: color 0.3s;
|
|
239
|
+
cursor: pointer;
|
|
240
|
+
&:hover {
|
|
241
|
+
opacity: 0.85;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
&-title {
|
|
246
|
+
display: block;
|
|
247
|
+
margin-right: 0.5rem;
|
|
248
|
+
font-weight: 600;
|
|
249
|
+
}
|
|
250
|
+
&-subtitle {
|
|
251
|
+
margin-right: 0.5rem;
|
|
252
|
+
color: rgba(0, 0, 0, 0.45);
|
|
253
|
+
}
|
|
254
|
+
&-tags {
|
|
255
|
+
}
|
|
256
|
+
&-extra {
|
|
257
|
+
margin-left: auto;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<script>
|
|
43
43
|
import { defineComponent, computed, onMounted, onUpdated, onBeforeUnmount, getCurrentInstance, ref, watch, nextTick } from 'vue'
|
|
44
|
-
import { transferIndex, transferIncrease } from '
|
|
44
|
+
import { transferIndex, transferIncrease } from '../../utils/transfer-queue'
|
|
45
45
|
import Popper from 'popper.js'
|
|
46
46
|
const handleGetIndex = () => {
|
|
47
47
|
transferIncrease()
|
|
@@ -72,15 +72,7 @@ export default defineComponent({
|
|
|
72
72
|
return ''
|
|
73
73
|
})
|
|
74
74
|
const bgStyle = computed(() => {
|
|
75
|
-
const style = props.vertical
|
|
76
|
-
? {
|
|
77
|
-
height: `${props.percent}%`,
|
|
78
|
-
width: `${props.strokeWidth}px`
|
|
79
|
-
}
|
|
80
|
-
: {
|
|
81
|
-
width: `${props.percent}%`,
|
|
82
|
-
height: `${props.strokeWidth}px`
|
|
83
|
-
}
|
|
75
|
+
const style = props.vertical ? { height: `${props.percent}%`, width: `${props.strokeWidth}px` } : { width: `${props.percent}%`, height: `${props.strokeWidth}px` }
|
|
84
76
|
if (props.strokeColor) {
|
|
85
77
|
if (typeof props.strokeColor === 'string') {
|
|
86
78
|
style['background-color'] = props.strokeColor
|
|
@@ -91,15 +83,7 @@ export default defineComponent({
|
|
|
91
83
|
return style
|
|
92
84
|
})
|
|
93
85
|
const successBgStyle = computed(() => {
|
|
94
|
-
return props.vertical
|
|
95
|
-
? {
|
|
96
|
-
height: `${props.successPercent}%`,
|
|
97
|
-
width: `${props.strokeWidth}px`
|
|
98
|
-
}
|
|
99
|
-
: {
|
|
100
|
-
width: `${props.successPercent}%`,
|
|
101
|
-
height: `${props.strokeWidth}px`
|
|
102
|
-
}
|
|
86
|
+
return props.vertical ? { height: `${props.successPercent}%`, width: `${props.strokeWidth}px` } : { width: `${props.successPercent}%`, height: `${props.strokeWidth}px` }
|
|
103
87
|
})
|
|
104
88
|
const wrapClasses = computed(() => {
|
|
105
89
|
return {
|