update 一系列功能

This commit is contained in:
2021-04-27 14:13:28 +08:00
parent 62e32bb8fd
commit 2945ecb3b8
16 changed files with 230 additions and 35 deletions

View File

@@ -1,17 +0,0 @@
body {
font-weight: 100;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 300;
}
.ant-card-meta-title {
font-weight: inherit;
}
.ant-table-thead > tr > th {
font-weight: 500;
}

View File

@@ -1,30 +1,20 @@
@import (reference) '~@/assets/style/extend.less';
.ant-modal-content {
background-color: fade(@primary-color, 20%);
background-color: fade(@white, 90%);
backdrop-filter: blur(10px);
backdrop-filter: blur(5px);
}
.ant-modal-header {
padding: @padding-sm @padding-md;
background-color: transparent;
}
.ant-modal-title {
color: fade(@white, 85%);
}
.ant-modal-body {
background-color: @white;
}
.ant-modal-footer {
background-color: @white;
}
.ant-modal-close {
color: fade(@white, 45%);
&:focus,
&:hover {
color: fade(@white, 75%);
}
}
.ant-modal-close-x {
line-height: 46px;

View File

@@ -29,7 +29,7 @@
}
.swiper-container {
position: absolute;
top: @layout-header-height - 20px;
top: @layout-header-height;
left: 0;
bottom: 0;
@@ -38,6 +38,32 @@
height: auto;
min-height: 100%;
}
.swiper-scrollbar {
transition: @animation-duration-slow opacity;
opacity: 0;
}
&:hover {
.swiper-scrollbar {
opacity: 1;
}
}
}
}
&--bar {
line-height: 20px;
height: 20px;
padding: 0 @padding-md;
text-align: right;
>.anticon {
cursor: pointer;
color: fade(@black, 50%);
&:hover {
color: fade(@black, 80%);
}
}
}
}

View File

@@ -122,6 +122,10 @@ export default {
this.onUpdateSwiper()
},
onUnexpandAll() {
this.expandedKeys = []
},
onSearch(value) {
const expandedKeys = this.list
.map(p => {
@@ -136,6 +140,10 @@ export default {
this.expandedKeys = expandedKeys
this.autoExpandParent = true
this.$nextTick(() => {
this.onUpdateSwiper()
})
},
onSelect(selectedKeys) {
@@ -238,6 +246,11 @@ export default {
<a-input-search allowClear={true} placeholder="请输入检索关键字" onSearch={this.onSearch} />
</div>
</a-layout-header>
<div class="yo-tree-layout--bar">
<a-tooltip placement="bottom" title="折叠全部">
<a-icon type="switcher" onClick={this.onUnexpandAll} />
</a-tooltip>
</div>
<div class="swiper-container" ref="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">

View File

@@ -25,6 +25,10 @@ import getAwesomeSwiper from 'vue-awesome-swiper/dist/exporter'
SwiperClass.use([Pagination, Mousewheel, Autoplay, Scrollbar])
Vue.use(getAwesomeSwiper(SwiperClass))
import hljs from 'highlight.js'
import 'highlight.js/styles/github.css'
Vue.use(hljs.vuePlugin);
/**
* api全局化
*/

View File

@@ -1,3 +0,0 @@
<template>
<div></div>
</template>

View File

@@ -0,0 +1,16 @@
export default {
props: {
code: {
type: String
}
},
render() {
const props = {
...this.$props,
...this.$attrs
}
return props.code && <highlightjs {...{ props }} />
}
}

View File

@@ -0,0 +1,53 @@
<template>
<container>
<template v-for="(doc, index) in docs">
<component :codes="codes" :is="doc.component" :key="index" />
</template>
<a-anchor>
<a-anchor-link href="#components-anchor-demo-basic" title="Basic demo" />
<a-anchor-link href="#components-anchor-demo-static" title="Static demo" />
<a-anchor-link
href="#components-anchor-demo-basic"
target="_blank"
title="Basic demo with Target"
/>
<a-anchor-link href="#API" title="API">
<a-anchor-link href="#Anchor-Props" title="Anchor Props" />
<a-anchor-link href="#Link-Props" title="Link Props" />
</a-anchor-link>
</a-anchor>
</container>
</template>
<script>
export default {
data() {
return {
docs: [
{
title: '开始使用',
name: 'use',
},
],
codes: {},
};
},
mounted() {
this.docs.forEach((doc) => {
this.$set(doc, 'component', () => import(`./${doc.name}`));
});
const files = require.context('@/../public/doc-part', true, /\.(js|html|vue|css|less)(\?.*)?$/);
const codes = {};
files.keys().forEach((p) => {
const fileName = p.slice(1);
const xhr = new XMLHttpRequest();
xhr.open('GET', `./doc-part${fileName}`, false);
xhr.overrideMimeType('text/plain;charset=utf-8');
xhr.send(null);
codes[fileName] = xhr.responseText;
});
console.log(codes);
this.codes = codes;
},
};
</script>

View File

@@ -0,0 +1,21 @@
<template>
<section>
<h3>开始使用</h3>
<Highlight :code="codes['/use/a.js'] || ''" language="javascript" />
<Highlight :code="codes['/use/test.vue'] || ''" language="javascript" />
</section>
</template>
<script>
import Highlight from './highlight';
export default {
components: {
Highlight,
},
props: {
codes: {
type: Object,
},
},
};
</script>

View File

@@ -260,6 +260,9 @@ export default {
} else {
this.$message.error(message);
}
})
.finally(() => {
record.statusChanging = false;
});
},

View File

@@ -127,7 +127,7 @@ export default {
<template slot="dataSource">
{this.renderSelect(this.searchResult)}
</template>
<a-input>
<a-input allow-clear>
<a-icon slot="suffix" type="search" class="certain-category-icon" />
</a-input>
</a-auto-complete>