Browse Source

图标组件、提示组件、全局loading、表格空状态、表格loading

pull/27/head
zq 2 months ago
parent
commit
b31004099b
  1. 16
      src/App.vue
  2. BIN
      src/assets/headerBg.mp4
  3. 1
      src/assets/loadingAni.json
  4. BIN
      src/assets/table_empty.png
  5. 115
      src/components/GlobalLoading.vue
  6. 104
      src/components/GuipToolTip.vue
  7. 126
      src/components/SvgIcon.vue
  8. 3
      src/main.js
  9. 29
      src/services/loading.js
  10. 19
      src/store/index.js
  11. 747
      src/style/theme/commonOld.scss
  12. 190
      src/views/elementGroups.vue

16
src/App.vue

@ -18,8 +18,10 @@
<el-container> <el-container>
<!-- 面包屑导航 --> <!-- 面包屑导航 -->
<Breadcrumb /> <Breadcrumb />
<el-main> <el-main class="app-content">
<global-loading>
<router-view /> <router-view />
</global-loading>
</el-main> </el-main>
<!-- <el-footer v-if="showFooter"> <!-- <el-footer v-if="showFooter">
<Footer></Footer> <Footer></Footer>
@ -36,6 +38,9 @@ import SliderMenu from '@/components/SliderMenu.vue';
import { mapState } from 'vuex'; import { mapState } from 'vuex';
import Header from './components/Header.vue'; import Header from './components/Header.vue';
import Breadcrumb from './components/Breadcrumb.vue'; import Breadcrumb from './components/Breadcrumb.vue';
// import loadingAnimation from '@/assets/loadingAni.json' // JSON
import GlobalLoading from '@/components/GlobalLoading1.vue'
// import ContentWithLoading from '@/components/ContentWithLoading'
export default { export default {
data() { data() {
return { return {
@ -63,13 +68,15 @@ export default {
}; };
}, },
components: { components: {
GlobalLoading,
// ContentWithLoading,
SliderMenu, SliderMenu,
// Footer, // Footer,
Header, Header,
Breadcrumb Breadcrumb
}, },
computed: { computed: {
...mapState(['showSidebar', 'showFooter', 'showHeader']) // VuexshowSidebar ...mapState(['showSidebar', 'showFooter', 'showHeader','contentLoading']) // VuexshowSidebar
}, },
mounted() { mounted() {
window.addEventListener('beforeunload', this.clearStorage); window.addEventListener('beforeunload', this.clearStorage);
@ -102,7 +109,10 @@ export default {
height: 100%; height: 100%;
background: #F5F7FA; background: #F5F7FA;
} }
.app-content {
position: relative;
isolation: isolate;
}
.short-container { .short-container {
height: calc(100vh - 62px); height: calc(100vh - 62px);
} }

BIN
src/assets/headerBg.mp4

Binary file not shown.

1
src/assets/loadingAni.json

@ -0,0 +1 @@
{"v":"4.8.0","meta":{"g":"LottieFiles AE 3.5.3","a":"","k":"","d":"","tc":""},"fr":29.9700012207031,"ip":0,"op":36.0000014663101,"w":500,"h":500,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.886],"y":[1.074]},"o":{"x":[0.098],"y":[0.184]},"t":0,"s":[0]},{"t":28.0000011404634,"s":[361]}],"ix":10},"p":{"a":0,"k":[250,272,0],"ix":2},"a":{"a":0,"k":[3,9,0],"ix":1},"s":{"a":0,"k":[114,114,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[130,130],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.480536935844,0.805985813515,0.932549091414,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[3,11],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":36.0000014663101,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 2","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[3.75,-53.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[80,80,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,-6.213],[6.213,0],[0,6.213],[-6.213,0]],"o":[[0,6.213],[-6.213,0],[0,-6.213],[6.213,0]],"v":[[11.25,0],[0,11.25],[-11.25,0],[0,-11.25]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.06274510175,0.823529422283,0.972549021244,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":36.0000014663101,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.934],"y":[1.075]},"o":{"x":[0.082],"y":[0.144]},"t":0,"s":[0]},{"t":28.0000011404634,"s":[-359]}],"ix":10},"p":{"a":0,"k":[249.75,270,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[7.456,0],[0,0],[0,7.456],[0,0],[-7.456,0],[0,0],[0,-7.456],[0,0]],"o":[[0,0],[-7.456,0],[0,0],[0,-7.456],[0,0],[7.456,0],[0,0],[0,7.456]],"v":[[0,39.75],[0,39.75],[-13.5,26.25],[-13.5,-26.25],[0,-39.75],[0,-39.75],[13.5,-26.25],[13.5,26.25]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":3,"k":{"a":0,"k":[0.318,0.78,0.294,0.98,0.605,0.502,0.551,0.943,0.892,0.224,0.808,0.906],"ix":9}},"s":{"a":0,"k":[1.25,51],"ix":5},"e":{"a":0,"k":[-1.99,-35.4],"ix":6},"t":1,"nm":"Gradient Fill 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":36.0000014663101,"st":0,"bm":0}],"markers":[]}

BIN
src/assets/table_empty.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

115
src/components/GlobalLoading.vue

@ -0,0 +1,115 @@
<!-- src/components/GlobalLoading.vue -->
<template>
<div class="content-loading-overlay" v-if="isLoading">
<div class="loading-content">
<div ref="lottieContainer" class="animation-container"></div>
<!-- <div class="loading-text">{{ text }}</div> -->
</div>
</div>
<div v-else>
<slot></slot>
</div>
</template>
<script>
import lottie from 'lottie-web'
import { mapState } from 'vuex'
import defaultAnimation from '@/assets/loadingAni.json' // JSON
export default {
name: 'GlobalLoading',
data() {
return {
text: '加载中',
autoplay: true,
animationData: defaultAnimation,
animInstance: null
}
},
computed: {
...mapState(['isLoading', 'loadingText'])
},
mounted() {
this.$nextTick(()=>{
this.initAnimation()
})
},
methods: {
initAnimation() {
console.log('1====000000');
this.animInstance = lottie.loadAnimation({
container: this.$refs.lottieContainer,
renderer: 'svg',
loop: true,
// autoplay: true,
animationData: this.animationData
})
console.log(this.animInstance,'this.animInstance---');
if (this.animInstance) {
this.animInstance.play()
}
},
show(text = '加载中...') {
this.text = text
this.isLoading = true
if (this.animInstance) {
this.animInstance.play()
}
},
hide() {
this.isLoading = false
if (this.animInstance) {
this.animInstance.stop()
}
},
setAnimationData(data) {
this.animationData = data
this.initAnimation()
}
},
beforeDestroy() {
if (this.animInstance) {
this.animInstance.destroy()
}
}
}
</script>
<style scoped>
.global-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 9999;
}
/* 关键样式 */
.content-loading-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.8);
z-index: 1000; /* 确保高于内容 */
display: flex;
justify-content: center;
align-items: center;
}
.loading-content {
text-align: center;
}
.animation-container {
width: 160px;
height: 160px;
margin: 0 auto;
}
</style>

104
src/components/GuipToolTip.vue

@ -0,0 +1,104 @@
<template>
<el-tooltip
v-bind="mergedProps"
:disabled="disabled"
:visible="controlledVisible"
@show="handleShow"
@hide="handleHide"
>
<slot></slot>
<!-- 用于自定义提示内容 -->
<template v-if="$slots.content" #content>
<slot name="content"></slot>
</template>
</el-tooltip>
</template>
<script>
export default {
name: 'EnhancedTooltip',
props: {
content: String,
placement: {//
type: String,
default: 'top'
},
effect: {//
type: String,
default: 'dark'
},
disabled: Boolean,
// true/
manual: Boolean,
// /
openDelay: {
type: Number,
default: 0
},
closeDelay: {
type: Number,
default: 0
},
//
hideAfterClick: {
type: Boolean,
default: false
}
},
data() {
return {
controlledVisible: false
}
},
computed: {
mergedProps() {
return {
effect: this.effect,
placement: this.placement,
content: this.content,
openDelay: this.openDelay,
closeDelay: this.closeDelay,
hideAfterClick: this.hideAfterClick,
...this.$attrs
}
}
},
methods: {
handleShow() {
if (this.manual) {
this.controlledVisible = true
}
this.$emit('show')
},
handleHide() {
if (this.manual) {
this.controlledVisible = false
}
this.$emit('hide')
},
//
show() {
if (this.manual && !this.disabled) {
this.controlledVisible = true
}
},
//
hide() {
if (this.manual) {
this.controlledVisible = false
}
},
// /
toggle() {
if (this.manual && !this.disabled) {
this.controlledVisible = !this.controlledVisible
}
}
}
}
</script>
<style scoped>
/* 可以添加一些自定义样式 */
</style>

126
src/components/SvgIcon.vue

@ -0,0 +1,126 @@
<template>
<div
class="svg-icon-wrapper"
:style="{ width: size + 'px', height: size + 'px' }"
@click="handleClick"
@mouseenter="isHovered = true"
@mouseleave="isHovered = false"
>
<div
class="svg-icon"
v-html="svgContent"
:style="{
'--icon-color': isHovered ? hoverColor : color,
'--icon-hover-color': hoverColor
}"
></div>
</div>
</template>
<script>
export default {
name: 'SvgIcon',
props: {
// SVG
path: {
type: String,
required: true,
validator: value => value.endsWith('.svg')
},
//
size: {
type: Number,
default: 24
},
//
color: {
type: String,
default: '#333333'
},
//
hoverColor: {
type: String,
default: '#409EFF'
},
//
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
svgContent: '',
isHovered: false
}
},
watch: {
path: {
immediate: true,
handler: 'loadSvg'
}
},
methods: {
async loadSvg() {
try {
// 使importSVG
const response = await fetch(this.path)
if (!response.ok) throw new Error('SVG加载失败')
this.svgContent = await response.text()
// SVGfillcurrentColor便CSS
this.svgContent = this.svgContent.replace(/fill="[^"]*"/g, 'fill="currentColor"')
} catch (error) {
console.error('加载SVG图标失败:', error)
this.svgContent = ''
}
},
handleClick(event) {
if (!this.disabled) {
this.$emit('click', event)
}
}
}
}
</script>
<style scoped>
.svg-icon-wrapper {
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s;
}
.svg-icon-wrapper:hover {
opacity: 0.8;
}
.svg-icon {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: var(--icon-color);
transition: color 0.3s;
}
.svg-icon:hover {
color: var(--icon-hover-color);
}
.svg-icon-wrapper[disabled] {
cursor: not-allowed;
opacity: 0.5;
}
.svg-icon >>> path {
fill: currentColor;
}
.svg-icon >>> circle {
fill: currentColor;
}
</style>

3
src/main.js

@ -9,8 +9,9 @@ import './style/theme/index.css'
import './style/theme/common.scss' import './style/theme/common.scss'
import 'core-js/stable'; import 'core-js/stable';
import 'regenerator-runtime/runtime'; import 'regenerator-runtime/runtime';
// main.js import LoadingService from './services/loading'
import { directive as clickaway } from 'vue-clickaway'; import { directive as clickaway } from 'vue-clickaway';
Vue.prototype.$loadingFn = LoadingService
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$http = request; Vue.prototype.$http = request;
Vue.use(ElementUI); Vue.use(ElementUI);

29
src/services/loading.js

@ -0,0 +1,29 @@
import Vue from 'vue'
import GlobalLoading from '@/components/GlobalLoading.vue'
const LoadingConstructor = Vue.extend(GlobalLoading)
let loadingInstance = null
export default {
show(text) {
if (!loadingInstance) {
loadingInstance = new LoadingConstructor({
el: document.createElement('div')
})
document.body.appendChild(loadingInstance.$el)
}
loadingInstance.show(text)
},
hide() {
if (loadingInstance) {
loadingInstance.hide()
}
},
setAnimation(animationData) {
if (loadingInstance) {
loadingInstance.setAnimationData(animationData)
}
}
}

19
src/store/index.js

@ -11,7 +11,8 @@ export default new Vuex.Store({
menuList:[],//目录菜单 menuList:[],//目录菜单
showBreadcrumb:false,//是否展示面包屑 showBreadcrumb:false,//是否展示面包屑
pageTitle:'一般新文献',//页面标题 pageTitle:'一般新文献',//页面标题
addServiceList:[]//选中的服务 addServiceList:[],//选中的服务
isLoading: false,//页面loading
}, },
actions: { actions: {
SET_HEADER({ commit }) { SET_HEADER({ commit }) {
@ -32,8 +33,24 @@ export default new Vuex.Store({
SET_ADDSERVICELIST({ commit }) { SET_ADDSERVICELIST({ commit }) {
commit('SET_ADDSERVICELIST'); commit('SET_ADDSERVICELIST');
}, },
showLoading({ commit }) {
console.log('zhixingle111');
commit('SHOW_LOADING')
},
hideLoading({ commit }) {
console.log('zhixingle222');
commit('HIDE_LOADING')
}
}, },
mutations: { mutations: {
SHOW_LOADING(state) {
state.isLoading = true
// state.loadingText = text || '加载中...'
},
HIDE_LOADING(state) {
state.isLoading = false
},
SET_SIDEBAR(state, show) { SET_SIDEBAR(state, show) {
state.showSidebar = show; state.showSidebar = show;
}, },

747
src/style/theme/commonOld.scss

@ -0,0 +1,747 @@
html {
scroll-behavior: smooth; /* 使整个页面的滚动平滑 */
}
body {
font-family: Microsoft YaHei UI;
font-size: 14px;
margin: 0;
width: 100vw;
height: 100vh;
p {
margin: 0;
padding: 0;
}
}
.point{
cursor: pointer;
}
.mt16{
margin-top: 16px;
}
.mt32{
margin-top: 32px;
}
.mb32{
margin-bottom: 32px;
}
.hide{
display: none !important;
}
.column{
display: flex;
flex-direction: column;
}
.mb24{
margin-bottom: 24px;
}
.mt12{
margin-top: 12px;
}
.mt10{
margin-top: 10px;
}
.ceshi{
transition: all .5s;
box-sizing: border-box;
/* main/main_stardard */
border: 1px solid #006AFF !important;
/* 蓝色阴影_常规 */
box-shadow: 0px 4px 16px 0px rgba(17, 55, 143, 0.12);
}
::v-deep .el-radio__original {
display: none !important;
}
.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
.el-radio__inner {
box-shadow: none !important;
}
.el-tabs__item.is-active {
letter-spacing: 0.08em;
/* main/main_stardard */
color: #006AFF;
font-weight: bold;
}
.el-tabs__nav-wrap::after {
content: none;
}
.addStore {
margin-top: 12px;
border-radius: 4px;
opacity: 1;
/* text/text_white_2 */
border: 1px dashed #BABDC2;
padding: 15px 20px;
color: #626573;
justify-content: center;
img{
margin-right: 12px;
}
}
@keyframes fadeInOut {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.ellipsis{
}
.el-container {
height: 100%;
.el-main {
padding: 0;
}
}
.min-width {
min-width: 1200px;
}
// 公共类名
.mb24 {
margin-bottom: 24px;
}
// 多数左右布局中间带竖线
.min-flex {
min-width: 1100px;
max-width: 1556px;
width: 84.75%;
margin: 0 auto;
}
.min-flex-right {
min-width: 1033px;
max-width: 1556px;
width: 84.75%;
margin: 0 auto;
.flex-common{
.flex-left,
.flex-right {
min-width: 440px;
max-width: 590px;
flex: 1;
}
.flex-line {
margin: 0 33px;
}
}
}
.desc {
font-size: 12px;
font-weight: normal;
line-height: 13px;
letter-spacing: 0.08em;
font-variation-settings: "opsz"auto;
/* text/text_4 */
color: #8A9099;
}
.borderNone{
border: none !important;
}
.flex-common {
padding: 32px 36px;
background-color: #fff;
h3 {
text-align: left;
margin: 0 0 32px 0;
span{
margin-left: 12px;
font-size: 14px;
font-weight: normal;
letter-spacing: 0.08em;
color: #626573;
}
}
.flex-wrap {
width: 100%;
display: flex;
justify-content: space-between;
}
.flex-line {
border-left: 1px solid #DFE2E6;
margin: 0 54px;
}
.flex-left,
.flex-right {
min-width: 460px;
max-width: 590px;
flex: 1;
}
.flex-left-desc{
/* body/body 2_regular */
font-family: Microsoft YaHei UI;
font-size: 14px;
font-weight: normal;
line-height: normal;
letter-spacing: 0.08em;
font-variation-settings: "opsz" auto;
/* text/text_1 */
color: #1E2226;
text-align: left;
// margin: ;
}
}
// end---------
//radio 发生change事件时会有报错
::v-deep .el-radio__original {
display: none !important;
}
::v-deep.el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) {
.el-radio__inner {
box-shadow: none !important;
}
}
::v-deep .el-popover {
display: none !important;
}
::v-deep.el-popover:focus:not(.is-focus):not(:active):not(.is-disabled) {}
// .el-radio__inner {
// box-shadow: none !important;
// }
/* button==== start */
.el-button {
width: 144px;
height: 46px;
font-family: Microsoft YaHei UI;
font-size: 14px;
letter-spacing: 0.08em;
display: flex;
align-items: center;
justify-content: center;
transition: all .3s;
span{
display: flex;
align-items: center;
}
img{
margin-right: 6px;
}
}
.el-button--normal {
color: #626573;
}
.el-button--mild {
background: #FFFFFF;
border: 1px solid #006AFF;
color: #006AFF;
}
.el-button--primary,
.el-button--success,
.el-button--info,
.el-button--warning,
.el-button--danger {
color: #fff !important;
}
.el-button--medium {
//中等按钮
width: 97px;
height: 33px;
font-size: 14px;
line-height: 14px;
span {
height: 14px;
}
}
.el-button--small {
//小的按钮
width: 80px;
height: 32px;
font-size: 12px;
}
.el-button--mini {
//迷你按钮
width: 80px;
height: 28px;
font-size: 12px;
}
.el-button--reverseMild {
background: #E8F0FE;
color: #006AFF;
border: none;
}
.el-button--reverseMild:hover {
border-color: #F2F7FF !important;
background-color: #F2F7FF !important;
}
.el-button--reverseMild.is-disabled,
.el-button--reverseMild.is-disabled:hover {
color: #006AFF;
border-color: #E8F0FE;
background-color: #E8F0FE;
opacity: .7;
}
.el-button--mild.is-disabled,
.el-button--mild.is-disabled:hover {
color: #006AFF;
opacity: .7;
border-color: #006AFF;
}
/* button==== end */
// radio ---start
.el-radio__input.is-checked .el-radio__inner::after {
content: '';
/* 清空默认的伪元素内容 */
width: 14px;
height: 14px;
background-image: url('../../assets/radio_checked.svg');
/* 使用你的自定义图标 */
background-size: contain;
background-repeat: no-repeat;
}
.el-radio__label {
font-weight: normal;
}
// radio ---end
// input ---start
.el-input {
border-radius: 2px;
border: 1px solid transparent;
}
.el-input:focus-within {
transition: all .5s;
outline: 3px solid #D8E9FA;
border-color: #006AFF !important;
}
.is-error .hoverclass {
border-color: transparent !important;
}
.is-error .el-input:focus-within {
outline: none !important;
border-color: transparent !important;
}
.el-input__inner {
height: 100%;
padding: 10px 12px;
border-radius: 4px;
}
.el-input__prefix {
display: flex;
align-items: center;
left: 12px;
cursor: pointer;
}
.el-input__suffix {
display: flex;
align-items: center;
right: 12px;
cursor: pointer;
}
.el-input__inner:focus {
border-color: transparent;
}
.el-input__inner:hover {
border-color: transparent;
}
.el-input__inner::placeholder {
color: #BABDC2;
}
.el-input--prefix .el-input__inner {
padding-left: 36px;
}
.el-input--suffix .el-input__inner {
padding-right: 36px;
}
.el-input.is-disabled .el-input__inner {
background: #F6F7FA !important;
border-color: #DFE2E6 !important;
color: #BABDC2 !important;
}
.hoverclass {
border-color: #006AFF !important;
transition: all .5s;
}
// input ---end
// select start
.el-select {
width: 100%;
transition: all .5s;
}
.el-select:hover .el-input__inner {
transition: all .5s;
border-color: transparent;
}
.el-select .el-input.is-focus .el-input__inner {
border-color: transparent;
transition: all .5s;
}
.el-select .el-input__inner:focus {
border-color: transparent;
}
.el-select>.el-input {
height: 100%;
}
// select end
// textarea start
.el-textarea__inner {
padding: 10px 12px;
border-radius: 2px;
height: 100%;
}
.el-textarea__inner:hover {
border-color: #006AFF;
}
.el-textarea__inner:focus {
transition: all .5s;
outline: 3px solid #D8E9FA;
}
// textarea end
.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label:before,
.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label:before {
content: '';
}
.el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap>.el-form-item__label::after,
.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::after {
content: url(../../assets/require.svg);
display: inline-block;
// background-image: url(../../assets/require.svg);
color: #ff4d4f;
margin-right: 4px;
margin-left: 4px;
}
.form-item1 {
display: flex;
align-items: center;
label {
min-width: 54px;
margin-right: 8px;
}
label.el-radio {
margin-right: 24px;
.el-radio__label {
padding-left: 8px;
}
}
label.el-radio:last-child {
margin-right: 0px;
}
.form-item-top {
height: 18px;
display: flex;
align-items: center;
text-align: left;
}
.form-item-bottom {
flex: 1;
}
.rightdesc {
flex: 1;
text-align: right;
font-size: 12px;
line-height: 13px;
letter-spacing: 0.08em;
font-variation-settings: "opsz"auto;
color: #8A9099;
}
.form-item {
margin-bottom: 0;
}
}
.el-form-item__content {
// width: 100%;
flex: 1;
position: relative;
.desc_right {
position: absolute;
right: 0;
top: -40px;
margin: 0;
font-size: 12px;
line-height: 40px;
letter-spacing: 0.08em;
font-variation-settings: "opsz"auto;
color: #8A9099;
}
}
.w510 {
width: 510px;
}
.w388 {
width: 388px;
}
.form-item {
display: flex;
align-items: center;
}
.column {
display: flex;
flex-direction: column !important;
align-items: self-start;
.form-item-top {
width: 100%;
margin-bottom: 12px;
justify-content: space-between;
}
.form-item-bottom {
width: 100%;
}
.el-form-item__content {
width: 100%;
display: flex;
justify-content: flex-start;
}
}
.form-top-icon {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
margin-right: 8px;
}
span {
color: #1E2226;
}
}
// table start
.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
background-color: #F6F7FA;
}
.el-table td.el-table__cell {
border-bottom: 1px solid#EAECF0;
}
.el-table--fit {
border: 1px solid#EAECF0;
}
.el-button--text {
padding: 0;
width: auto !important;
height: auto !important;
}
.el-table th.el-table__cell {
background: #F6F7FA;
padding: 10px 0;
}
.el-table th.el-table__cell>.cell {
padding-left: 16px;
padding-right: 16px;
}
.el-table .el-table__cell {
padding: 18px 0;
}
.el-table .cell {
padding-left: 16px;
padding-right: 16px;
}
.el-table .el-form-item {
margin-bottom: 0;
}
// table end
.el-pagination {
margin-top: 16px;
display: flex;
justify-content: flex-end;
}
// dialog--start
.el-dialog {
min-height: 214px;
max-height: 550px;
border-radius: 4px;
background: #FFFFFF;
box-shadow: 0px 4px 16px 0px rgba(0, 0, 0, 0.16);
display: flex;
flex-direction: column;
.el-dialog__header {
font-size: 20px;
font-weight: bold;
line-height: 26px;
text-align: left;
letter-spacing: 0.08em;
color: #1F2026;
padding: 32px 32px 12px;
}
.el-dialog__body {
padding: 0 32px 32px;
flex: 1;
}
}
.el-dialog__footer {
display: flex;
justify-content: center;
padding: 0 32px 32px !important;
.dialog-footer-center {
width: 100%;
justify-content: space-between;
button {
width: 247px;
height: 44px;
}
}
.dialog-footer-normal {
width: 100%;
justify-content: flex-end !important;
button {
width: 96px;
height: 38px;
}
}
}
.center {
.el-dialog .el-dialog__header{
text-align: center;
}
}
// dialog--end
// switch --start
// .el-switch__core{
// background-color: #00C261;
// }
// .el-switch.is-checked .el-switch__core{
// background-color: #BABDC2;
// }
// switch --end
// 弹出气泡框
.el-popover {
padding: 32px;
}
// 日历区间背景颜色
.el-date-table td.in-range div {
background: #F2F7FF;
}
.flex {
display: flex;
align-items: center;
}
// 自定义下拉内容框
.noraml-jump {
padding: 24px 10px;
border-bottom: 1px solid #EAECF0;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
font-family: Microsoft YaHei UI;
.left b {
display: block;
text-align: left;
margin-bottom: 12px;
}
.left p {
letter-spacing: 0.08em;
text-align: left;
line-height: 13px;
font-size: 12px;
color: #8A9099;
}
.left .one {
line-height: 18px;
font-size: 14px;
color: #1E2226;
margin-bottom: 4px;
}
}

190
src/views/elementGroups.vue

@ -17,21 +17,61 @@
<h3 for="">表格(表头自定义自定义渲染固定列)</h3> <h3 for="">表格(表头自定义自定义渲染固定列)</h3>
<GuipButton type="primary" @click="toggleAllSelection">全选按钮</GuipButton> <GuipButton type="primary" @click="toggleAllSelection">全选按钮</GuipButton>
<el-form>
<!-- <el-table :data="tableData">
<template>
<el-table-column prop="type" width="190">
<template slot="header">
<GuipSelect class="custom-select" v-model="chktype" :options="type2filterOptions"
defaultValue="全部检测类型" @change="changeSelectType" />
</template>
<template slot-scope="scope">
{{ type2name[scope.row.type] }}
</template>
</el-table-column>
</template>
</el-table> -->
<!-- style="width:100%; height:500px" -->
<GuipTable :tableData="tableData" ref="multipleTable" @selectChange="handleSelectionChange" <GuipTable :tableData="tableData" ref="multipleTable" @selectChange="handleSelectionChange"
:multiple="true" autoColumn="true" width="900px"> :multiple="true" autoColumn="true" :loading="tableLoading">
<!-- <template slot="header"> -->
<el-table-column width="180">
<template slot="header"> <template slot="header">
<el-table-column fixed prop="date" label="日期" width="180">
<template slot="header" slot-scope="scope">
<span>日期</span> <span>日期</span>
<el-button @click="handleFilter(scope.column)" icon="el-icon-search"
size="mini"></el-button>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="type">
<template slot="header">
<GuipSelect class="custom-select" v-model="chktype" :options="type2filterOptions"
defaultValue="全部检测类型" @change="changeSelectType" />
</template>
<template slot-scope="scope">
{{ type2name[scope.row.type] }}
</template>
</el-table-column> -->
<el-table-column prop="name" label="姓名" width="150"></el-table-column> <el-table-column prop="created_at" label="时间" width="150">
<el-table-column prop="name1" label="姓名" width="150"></el-table-column> <template slot-scope="scope">
<div class="flex cell_render">
<GuipToolTip content="点击编辑">
<span :class="(scope.row.payment == '0' ? 'normal_payment' : 'self_payment')">{{
scope.row.payment
==
'0' ? '默认站点支付' : '自定义支付' }}</span>
</GuipToolTip>
<svg-icon :path="require('@/assets/register/tableEdit.svg')" :color="'#8A9099'"
:hoverColor="'#006AFF'" />
</div>
</template>
</el-table-column>
<el-table-column prop="unit_num" label="数量" width="150"></el-table-column>
<el-table-column prop="name2" label="姓名" width="150"></el-table-column> <el-table-column prop="name2" label="姓名" width="150"></el-table-column>
<el-table-column prop="name3" label="姓名" width="150"></el-table-column> <!-- <el-table-column prop="name3" label="姓名" width="150"></el-table-column>
<el-table-column prop="name4" label="姓名" width="150"></el-table-column> <el-table-column prop="name4" label="姓名" width="150"></el-table-column>
<el-table-column prop="name5" label="姓名" width="150"></el-table-column> <el-table-column prop="name5" label="姓名" width="150"></el-table-column>
<el-table-column prop="name6" label="姓名" width="150"></el-table-column> <el-table-column prop="name6" label="姓名" width="150"></el-table-column>
@ -39,7 +79,7 @@
<el-table-column prop="name8" label="姓名" width="150"></el-table-column> <el-table-column prop="name8" label="姓名" width="150"></el-table-column>
<el-table-column prop="name9" label="姓名" width="150"></el-table-column> <el-table-column prop="name9" label="姓名" width="150"></el-table-column>
<el-table-column prop="name11" label="姓名" width="150"></el-table-column> <el-table-column prop="name11" label="姓名" width="150"></el-table-column>
<el-table-column prop="name12" label="姓名" width="150"></el-table-column> <el-table-column prop="name12" label="姓名" width="150"></el-table-column> -->
<el-table-column prop="price" label="价格" width="150"> <el-table-column prop="price" label="价格" width="150">
<!-- <template slot-scope="scope"> <!-- <template slot-scope="scope">
<span @click="handlePriceClick(scope.row)">{{ scope.row.price }}</span> <span @click="handlePriceClick(scope.row)">{{ scope.row.price }}</span>
@ -63,7 +103,7 @@
prop="card" :options="options" defaultValue="选项1" /> prop="card" :options="options" defaultValue="选项1" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column fixed="right" label="操作" width="100"> <el-table-column label="操作" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex"> <div class="flex">
<el-button @click="handleClick(scope.row)" type="text">查看</el-button> <el-button @click="handleClick(scope.row)" type="text">查看</el-button>
@ -71,13 +111,19 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
</template> <!-- </template> -->
</GuipTable> </GuipTable>
<el-pagination background @size-change='handleSizeChange' @current-change='handleCurrentChange'
:current-page="currentPage" :page-size=pageSize layout="prev, pager, next,jumper"
:total="total">
</el-pagination>
</el-form>
</div> </div>
<div> <div>
<h3 for="">表格(带气泡框),内容自定义</h3> <h3 for="">表格(带气泡框),内容自定义</h3>
<GuipTable :tableData="tableData" :key="random()" ref="multipleTable" <el-form>
<GuipTable :tableData="tableData2" :key="random()" ref="multipleTable"
@selectChange="handleSelectionChange" :multiple="true" autoColumn="true" width="900px" @selectChange="handleSelectionChange" :multiple="true" autoColumn="true" width="900px"
:columns="columns" @confirm="onConfirm" @cancel="onCancel"> :columns="columns" @confirm="onConfirm" @cancel="onCancel">
<!-- 自定义姓名列的气泡框内容 --> <!-- 自定义姓名列的气泡框内容 -->
@ -104,7 +150,10 @@
</div> </div>
</template> </template>
</GuipTable> </GuipTable>
</el-form>
</div> </div>
<div class="ele-item"> <div class="ele-item">
<label for="">文本域</label> <label for="">文本域</label>
<GuipTextarea disabled :styleObject="styleObject" /> <GuipTextarea disabled :styleObject="styleObject" />
@ -250,7 +299,8 @@
<div style="width: 100%;margin: 20px 0;height: 20px;background-color: antiquewhite;"> <div style="width: 100%;margin: 20px 0;height: 20px;background-color: antiquewhite;">
--------------------分割线0------------------------------</div> --------------------分割线0------------------------------</div>
<div style="display: flex;"> <div style="display: flex;" class="ele-item">
<label for="">日期选择器</label>
<el-date-picker v-model="date1" type="daterange" range-separator="" start-placeholder="开始日期" <el-date-picker v-model="date1" type="daterange" range-separator="" start-placeholder="开始日期"
end-placeholder="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
@ -275,8 +325,29 @@
<el-button @click="save" type="primary">保存</el-button> <el-button @click="save" type="primary">保存</el-button>
</div> --> </div> -->
</div> </div>
<div class="flex ele-item">
<el-button type="primary" @click="openDialog">打开弹框</el-button> <label for="">一些功能集合</label>
<GuipButton type="primary" @click="openDialog">打开弹框</GuipButton>
<GuipButton type="primary" @click="openLoading" size="page">展示加载动画 2s</GuipButton>
</div>
<div class="flex ele-item">
<label for="">提示信息</label>
<GuipToolTip content="这是一个提示">
<GuipButton type="primary" size="page">悬停查看提示</GuipButton>
</GuipToolTip>
<GuipToolTip placement="bottom" effect="light">
<GuipButton type="primary" size="page">自定义提示内容</GuipButton>
<template #content>
<div style="max-width: 200px">
<h4>自定义标题</h4>
<p>这里可以放任何HTML内容</p>
<el-button size="mini">甚至按钮</el-button>
</div>
</template>
</GuipToolTip>
</div>
<GuipDialog :dialogVisible="dialogVisible" title="自定义标题" :show-close-button="false" <GuipDialog :dialogVisible="dialogVisible" title="自定义标题" :show-close-button="false"
:show-cancel-button="showCancelButton" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose" :show-cancel-button="showCancelButton" @confirm="handleConfirm" @cancel="handleCancel" @close="handleClose"
@ -301,7 +372,13 @@ import GuipInput from '@/components/GuipInput.vue';
import GuipSelect from '@/components/GuipSelect.vue'; import GuipSelect from '@/components/GuipSelect.vue';
import GuipTable from '@/components/GuipTable.vue'; import GuipTable from '@/components/GuipTable.vue';
import GuipTextarea from '@/components/GuipTextarea.vue' import GuipTextarea from '@/components/GuipTextarea.vue'
import GuipToolTip from '@/components/GuipToolTip.vue'
import HoverButton from '@/components/HoverButton.vue' import HoverButton from '@/components/HoverButton.vue'
import SvgIcon from '@/components/SvgIcon.vue';
// import { mapState } from 'vuex'
// import store from '@/store';
export default { export default {
name: 'HomeView', name: 'HomeView',
components: { components: {
@ -313,11 +390,17 @@ export default {
GuipButton, GuipButton,
GuipInput, GuipInput,
GuipSelect, GuipSelect,
HoverButton GuipToolTip,
HoverButton,
SvgIcon
}, },
data() { data() {
return { return {
currentPage: 1, //
pageSize: 5, //
total: 0, //
tableLoading: false,
timer: null,
date1: '', date1: '',
switchValue: true, switchValue: true,
dialogVisible: false,// dialogVisible: false,//
@ -382,7 +465,7 @@ export default {
], ],
}, },
// //
tableData: [{ tableData2: [{
date: '2016-05-03', date: '2016-05-03',
name: '王小虎', name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄', address: '上海市普陀区金沙江路 1518 弄',
@ -522,7 +605,64 @@ export default {
}], }],
} }
}, },
mounted() {
this.getList();
this.getStagePurchase()
// this.$loadingFn.show()
// setInterval(()=>{
// this.$loadingFn.hide()
// },70000)
// this.timer = setTimeout(() => {
// this.$store.dispatch('hideLoading')
// }, 2000)
// this.timer = null;
},
methods: { methods: {
showTooltip() {
this.$refs.tooltip.show()
},
hideTooltip() {
this.$refs.tooltip.hide()
},
handleSizeChange(val) {
this.pageSize = val
this.getStagePurchase()
},
handleCurrentChange(val) {
this.currentPage = val
this.getStagePurchase()
},
getStagePurchase() {
this.tableLoading = true
const that = this
that.tableData = []
this.$http('POST', '/supernew/ajax_get_stage_purchase', {
type: 0,
cur_page: 1,
page_size: 5,
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
that.tableData = response.data.list
// that.type2name = response.data.type2name
that.total = response.data.total
})
}).catch(error => {
console.error(error, 'error')
})
},
btnClick() {
},
openLoading() {
this.$store.dispatch('showLoading')
setTimeout(() => {
this.$store.dispatch('hideLoading')
}, 2000)
},
handleFilter(column) { handleFilter(column) {
// //
console.log('筛选列:', column); console.log('筛选列:', column);
@ -533,7 +673,6 @@ export default {
return randomNumber return randomNumber
}, },
onSwitchChange(value) { onSwitchChange(value) {
console.log('Switch 状态变化:', this.switchValue, value); console.log('Switch 状态变化:', this.switchValue, value);
}, },
// ---start // ---start
@ -625,6 +764,7 @@ export default {
console.log(value, 'value===qinghcu'); console.log(value, 'value===qinghcu');
}, },
getList() { getList() {
console.log('zhixingle--');
const dataList = rules(); const dataList = rules();
dataList.forEach((item) => { dataList.forEach((item) => {
if (item.field === "id") { if (item.field === "id") {
@ -655,9 +795,14 @@ export default {
this.$refs.multipleTable.$refs.guiptable.toggleAllSelection(); this.$refs.multipleTable.$refs.guiptable.toggleAllSelection();
}, },
}, },
mounted() { beforeDestroy() {
this.getList(); if (this.timer) {
}, clearTimeout(this.timer)
// loading
this.$store.dispatch('hideContentLoading')
}
}
} }
</script> </script>
@ -715,6 +860,7 @@ export default {
border-radius: 4px; border-radius: 4px;
transition: all .3s; transition: all .3s;
background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%); background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%);
&:hover { &:hover {
opacity: 0.7; opacity: 0.7;
background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%); background: linear-gradient(290deg, #FF4143 4%, #FF768B 92%);

Loading…
Cancel
Save