mirror of https://github.com/halo-dev/halo
pref: #291 (halo-dev/console#300)
parent
566f365ab2
commit
b82d606d39
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
|
@ -26,46 +26,46 @@
|
||||||
"enquire.js": "^2.1.6",
|
"enquire.js": "^2.1.6",
|
||||||
"filepond": "^4.25.1",
|
"filepond": "^4.25.1",
|
||||||
"filepond-plugin-file-validate-type": "^1.2.5",
|
"filepond-plugin-file-validate-type": "^1.2.5",
|
||||||
"filepond-plugin-image-preview": "^4.6.4",
|
"filepond-plugin-image-preview": "^4.6.5",
|
||||||
"flv.js": "^1.5.0",
|
"flv.js": "^1.5.0",
|
||||||
"halo-editor": "^2.8.2",
|
"halo-editor": "^2.8.2",
|
||||||
"marked": "^1.2.7",
|
"marked": "^1.2.9",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"tiny-pinyin": "^1.3.2",
|
"tiny-pinyin": "^1.3.2",
|
||||||
"verte": "^0.0.12",
|
"verte": "^0.0.12",
|
||||||
"vue": "^2.6.12",
|
"vue": "^2.6.12",
|
||||||
"vue-clipboard2": "^0.3.1",
|
"vue-clipboard2": "^0.3.1",
|
||||||
"vue-codemirror-lite": "^1.0.4",
|
"vue-codemirror-lite": "^1.0.4",
|
||||||
"vue-contextmenujs": "^1.3.12",
|
"vue-contextmenujs": "^1.3.13",
|
||||||
"vue-count-to": "^1.0.13",
|
"vue-count-to": "^1.0.13",
|
||||||
"vue-dplayer": "0.0.10",
|
"vue-dplayer": "0.0.10",
|
||||||
"vue-filepond": "^6.0.3",
|
"vue-filepond": "^6.0.3",
|
||||||
"vue-ls": "^3.2.1",
|
"vue-ls": "^3.2.2",
|
||||||
"vue-router": "^3.4.9",
|
"vue-router": "^3.4.9",
|
||||||
"vuedraggable": "^2.24.3",
|
"vuedraggable": "^2.24.3",
|
||||||
"vuejs-logger": "^1.5.4",
|
"vuejs-logger": "^1.5.5",
|
||||||
"vuex": "^3.6.0"
|
"vuex": "^3.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/polyfill": "^7.11.5",
|
"@babel/polyfill": "^7.12.1",
|
||||||
"@vue/cli-plugin-babel": "^3.8.0",
|
"@vue/cli-plugin-babel": "^3.8.0",
|
||||||
"@vue/cli-plugin-eslint": "^4.5.4",
|
"@vue/cli-plugin-eslint": "^4.5.4",
|
||||||
"@vue/cli-plugin-unit-jest": "^4.5.4",
|
"@vue/cli-plugin-unit-jest": "^4.5.4",
|
||||||
"@vue/cli-service": "^4.5.4",
|
"@vue/cli-service": "^4.5.4",
|
||||||
"@vue/eslint-config-standard": "^4.0.0",
|
"@vue/eslint-config-standard": "^4.0.0",
|
||||||
"@vue/test-utils": "^1.1.0",
|
"@vue/test-utils": "^1.1.3",
|
||||||
"babel-core": "7.0.0-bridge.0",
|
"babel-core": "7.0.0-bridge.0",
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-jest": "^26.3.0",
|
"babel-jest": "^26.6.3",
|
||||||
"babel-plugin-import": "^1.13.0",
|
"babel-plugin-import": "^1.13.3",
|
||||||
"eslint": "^6.8.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint-plugin-html": "^6.1.0",
|
"eslint-plugin-html": "^6.1.1",
|
||||||
"eslint-plugin-vue": "^6.2.2",
|
"eslint-plugin-vue": "^6.2.2",
|
||||||
"generate-asset-webpack-plugin": "^0.3.0",
|
"generate-asset-webpack-plugin": "^0.3.0",
|
||||||
"husky": "^4.3.0",
|
"husky": "^4.3.8",
|
||||||
"less": "^3.12.2",
|
"less": "^3.13.1",
|
||||||
"less-loader": "^5.0.0",
|
"less-loader": "^5.0.0",
|
||||||
"lint-staged": "^10.3.0",
|
"lint-staged": "^10.5.4",
|
||||||
"tailwindcss": "^1.8.8",
|
"tailwindcss": "^1.8.8",
|
||||||
"vue-svg-component-runtime": "^1.0.1",
|
"vue-svg-component-runtime": "^1.0.1",
|
||||||
"vue-svg-icon-loader": "^2.1.1",
|
"vue-svg-icon-loader": "^2.1.1",
|
||||||
|
|
|
@ -93,12 +93,7 @@
|
||||||
:xs="24"
|
:xs="24"
|
||||||
class="pb-3"
|
class="pb-3"
|
||||||
>
|
>
|
||||||
<a-card
|
<a-card :bodyStyle="{ padding: '16px' }">
|
||||||
:bodyStyle="{ padding: '16px' }"
|
|
||||||
ref="mheader"
|
|
||||||
:class="{ 'card-header-fixed': headerIsFixed }"
|
|
||||||
:headStyle="headStyle"
|
|
||||||
>
|
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span>
|
<span>
|
||||||
{{ menuListTitle }}
|
{{ menuListTitle }}
|
||||||
|
@ -106,7 +101,7 @@
|
||||||
<a-tooltip
|
<a-tooltip
|
||||||
slot="action"
|
slot="action"
|
||||||
title="分组下的菜单为空时,该分组也不会保存"
|
title="分组下的菜单为空时,该分组也不会保存"
|
||||||
v-if="list.data.length <= 0"
|
v-if="list.data.length <= 0 && !list.loading"
|
||||||
>
|
>
|
||||||
<a-icon
|
<a-icon
|
||||||
type="info-circle-o"
|
type="info-circle-o"
|
||||||
|
@ -127,13 +122,20 @@
|
||||||
:disabled="list.data.length<=0"
|
:disabled="list.data.length<=0"
|
||||||
></ReactiveButton>
|
></ReactiveButton>
|
||||||
<a-button
|
<a-button
|
||||||
|
v-if="!form.visible"
|
||||||
@click="handleOpenCreateMenuForm()"
|
@click="handleOpenCreateMenuForm()"
|
||||||
:disabled="form.visible"
|
|
||||||
type="primary"
|
type="primary"
|
||||||
ghost
|
ghost
|
||||||
>
|
>
|
||||||
新增
|
新增
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
v-else
|
||||||
|
@click="handleCloseCreateMenuForm()"
|
||||||
|
type="default"
|
||||||
|
>
|
||||||
|
取消新增
|
||||||
|
</a-button>
|
||||||
<a-dropdown :trigger="['click']">
|
<a-dropdown :trigger="['click']">
|
||||||
<a-menu slot="overlay">
|
<a-menu slot="overlay">
|
||||||
<a-menu-item @click="menuInternalLinkSelector.visible = true">
|
<a-menu-item @click="menuInternalLinkSelector.visible = true">
|
||||||
|
@ -225,17 +227,10 @@ export default {
|
||||||
menuInternalLinkSelector: {
|
menuInternalLinkSelector: {
|
||||||
visible: false,
|
visible: false,
|
||||||
},
|
},
|
||||||
headerIsFixed: false,
|
|
||||||
headStyle: {},
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['options']),
|
...mapGetters(['options']),
|
||||||
computedTeams() {
|
|
||||||
return this.teams.data.filter((item) => {
|
|
||||||
return item !== ''
|
|
||||||
})
|
|
||||||
},
|
|
||||||
computedMenusMoved() {
|
computedMenusMoved() {
|
||||||
const menus = deepClone(this.list.data)
|
const menus = deepClone(this.list.data)
|
||||||
return this.handleMenuMoved(0, menus)
|
return this.handleMenuMoved(0, menus)
|
||||||
|
@ -267,9 +262,6 @@ export default {
|
||||||
defaultMenuTeam() {
|
defaultMenuTeam() {
|
||||||
return this.options.default_menu_team ? this.options.default_menu_team : ''
|
return this.options.default_menu_team ? this.options.default_menu_team : ''
|
||||||
},
|
},
|
||||||
mHeaderFromTopAbs() {
|
|
||||||
return Math.floor(Math.abs(this.mHeaderFromTop))
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.handleListTeams()
|
this.handleListTeams()
|
||||||
|
@ -294,6 +286,7 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleListMenus() {
|
handleListMenus() {
|
||||||
|
this.list.data = []
|
||||||
this.list.loading = true
|
this.list.loading = true
|
||||||
menuApi
|
menuApi
|
||||||
.listTreeByTeam(this.teams.selected)
|
.listTreeByTeam(this.teams.selected)
|
||||||
|
@ -412,7 +405,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.refreshOptionsCache()
|
this.refreshOptionsCache()
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -18,6 +18,18 @@
|
||||||
>
|
>
|
||||||
<a-list-item class="cursor-pointer menu-item">
|
<a-list-item class="cursor-pointer menu-item">
|
||||||
<a-list-item-meta>
|
<a-list-item-meta>
|
||||||
|
<span
|
||||||
|
slot="title"
|
||||||
|
class="title cursor-move inline-block font-bold"
|
||||||
|
>{{ item.name }}
|
||||||
|
<a-tooltip
|
||||||
|
title="外部链接"
|
||||||
|
v-if="item.target==='_blank'"
|
||||||
|
>
|
||||||
|
<a-icon type="link" />
|
||||||
|
</a-tooltip>
|
||||||
|
{{ item.formVisible?'(正在编辑)':'' }}
|
||||||
|
</span>
|
||||||
<span
|
<span
|
||||||
slot="description"
|
slot="description"
|
||||||
class="inline-block"
|
class="inline-block"
|
||||||
|
@ -28,26 +40,22 @@
|
||||||
class="ant-anchor-link-title"
|
class="ant-anchor-link-title"
|
||||||
> {{ item.url }} </a>
|
> {{ item.url }} </a>
|
||||||
</span>
|
</span>
|
||||||
<span
|
|
||||||
slot="title"
|
|
||||||
class="title cursor-move inline-block font-bold"
|
|
||||||
>{{ item.name }}
|
|
||||||
<a-tooltip title="外部链接">
|
|
||||||
<a-icon
|
|
||||||
v-if="item.target==='_blank'"
|
|
||||||
type="link"
|
|
||||||
/>
|
|
||||||
</a-tooltip>
|
|
||||||
{{ item.formVisible?'(正在编辑)':'' }}
|
|
||||||
</span>
|
|
||||||
</a-list-item-meta>
|
</a-list-item-meta>
|
||||||
<template slot="actions">
|
<template slot="actions">
|
||||||
<a
|
<a
|
||||||
|
v-if="!item.formVisible"
|
||||||
href="javascript:void(0);"
|
href="javascript:void(0);"
|
||||||
@click="handleOpenEditForm(item)"
|
@click="handleOpenEditForm(item)"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</a>
|
</a>
|
||||||
|
<a
|
||||||
|
v-else
|
||||||
|
href="javascript:void(0);"
|
||||||
|
@click="handleCloseCreateMenuForm(item)"
|
||||||
|
>
|
||||||
|
取消编辑
|
||||||
|
</a>
|
||||||
</template>
|
</template>
|
||||||
<template slot="actions">
|
<template slot="actions">
|
||||||
<a
|
<a
|
||||||
|
@ -146,9 +154,11 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
dragOptions() {
|
dragOptions() {
|
||||||
return {
|
return {
|
||||||
animation: 200,
|
animation: 300,
|
||||||
group: 'description',
|
group: 'description',
|
||||||
ghostClass: 'ghost',
|
ghostClass: 'ghost',
|
||||||
|
chosenClass: 'chosen',
|
||||||
|
dragClass: 'drag',
|
||||||
emptyInsertThreshold: 20,
|
emptyInsertThreshold: 20,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -210,7 +220,16 @@ export default {
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.ghost {
|
.ghost {
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
background: #c8ebfb;
|
@apply bg-gray-200;
|
||||||
|
}
|
||||||
|
.chosen {
|
||||||
|
opacity: 0.8;
|
||||||
|
@apply bg-gray-200;
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
.drag {
|
||||||
|
@apply bg-white;
|
||||||
|
padding: 0 5px;
|
||||||
}
|
}
|
||||||
::v-deep .ant-list-item-action {
|
::v-deep .ant-list-item-action {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
Loading…
Reference in New Issue