Browse Source

增加弹出框组件

develop
zq 1 month ago
parent
commit
267bac6507
  1. 14
      examples/package-lock.json
  2. 1410
      examples/src/App.vue
  3. 106
      packages/Breadcrumb/src/index.vue
  4. 7
      packages/GuipDialog/index.js
  5. 124
      packages/GuipDialog/src/index.vue
  6. 1
      packages/assets/drop-selected.svg
  7. BIN
      packages/assets/dropDown_expand.png
  8. BIN
      packages/assets/dropDown_open.png
  9. BIN
      packages/assets/table_empty.png
  10. 7
      packages/index.js
  11. 2
      packages/styles/index.css

14
examples/package-lock.json

@ -30,7 +30,7 @@
}, },
"..": { "..": {
"name": "@zhicheng1012/zhicheng-components", "name": "@zhicheng1012/zhicheng-components",
"version": "1.0.18", "version": "1.0.21",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"async-validator": "^1.11.5", "async-validator": "^1.11.5",
@ -3218,9 +3218,9 @@
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
}, },
"node_modules/@zhicheng1012/zhicheng-components": { "node_modules/@zhicheng1012/zhicheng-components": {
"version": "1.0.18", "version": "1.0.21",
"resolved": "https://registry.npmjs.org/@zhicheng1012/zhicheng-components/-/zhicheng-components-1.0.18.tgz", "resolved": "https://registry.npmjs.org/@zhicheng1012/zhicheng-components/-/zhicheng-components-1.0.21.tgz",
"integrity": "sha512-bBbonkmlYC3JgPq0fCI8xJxG5NyhGiBjzl2hTADlPy3g/GySDtHFGITQPJUYtjT5RXdw13BHiFSEPv1R2XrArg==", "integrity": "sha512-cVW6uTEySEGF42k/Jd3kTNr4doGRkutLsnqAbyNx7ych/TOM6ovgSlpR8p3j6RS3NQGuVm2WmihSpEk9oCohGg==",
"dependencies": { "dependencies": {
"async-validator": "^1.11.5", "async-validator": "^1.11.5",
"core-js": "^3.40.0" "core-js": "^3.40.0"
@ -19478,9 +19478,9 @@
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
}, },
"@zhicheng1012/zhicheng-components": { "@zhicheng1012/zhicheng-components": {
"version": "1.0.18", "version": "1.0.21",
"resolved": "https://registry.npmjs.org/@zhicheng1012/zhicheng-components/-/zhicheng-components-1.0.18.tgz", "resolved": "https://registry.npmjs.org/@zhicheng1012/zhicheng-components/-/zhicheng-components-1.0.21.tgz",
"integrity": "sha512-bBbonkmlYC3JgPq0fCI8xJxG5NyhGiBjzl2hTADlPy3g/GySDtHFGITQPJUYtjT5RXdw13BHiFSEPv1R2XrArg==", "integrity": "sha512-cVW6uTEySEGF42k/Jd3kTNr4doGRkutLsnqAbyNx7ych/TOM6ovgSlpR8p3j6RS3NQGuVm2WmihSpEk9oCohGg==",
"requires": { "requires": {
"async-validator": "^1.11.5", "async-validator": "^1.11.5",
"core-js": "^3.40.0" "core-js": "^3.40.0"

1410
examples/src/App.vue

File diff suppressed because it is too large

106
packages/Breadcrumb/src/index.vue

@ -10,7 +10,7 @@
> >
<template v-if="index !== breadcrumbs.length - 1"> <template v-if="index !== breadcrumbs.length - 1">
<router-link to="/" v-if="item.title == '首页'"> <router-link to="/" v-if="item.title == '首页'">
<!-- <SvgIcon1 :iconPath="require(`../../assets/home-bread.svg`)" defaultColor="#8A9099" :size="16" activeColor="#006AFF"/> --> <!-- <SvgIcon1 :iconPath="require(`../../assets/home-bread.png`)" defaultColor="#8A9099" :size="16" activeColor="#006AFF"/> -->
<img class="home-icon" src="../../assets/home-bread.png" alt=""> <img class="home-icon" src="../../assets/home-bread.png" alt="">
</router-link> </router-link>
<router-link v-else :to="item.path">{{ item.title }}</router-link> <router-link v-else :to="item.path">{{ item.title }}</router-link>
@ -37,67 +37,67 @@ export default {
}, },
computed: { computed: {
breadcrumbs() { breadcrumbs() {
if (this.$route.meta.hideBreadcrumb) return []; // if (this.$route.meta.hideBreadcrumb) return [];
const crumbs = [ const crumbs = [
// { {
// path:{ path:{
// path:'/', path:'/',
// query:{uid: "2300"}, query:{uid: "2300"},
// params:{} params:{}
// }, },
// title:'' title:'首页'
// }, },
// { {
// path:{ path:{
// path: "/agent/siteList", path: "/agent/siteList",
// query:{uid: "2300"}, query:{uid: "2300"},
// params:{} params:{}
// }, },
// title:"" title:"站点列表"
// }, },
]; ];
let currentRoute = this.$route; // let currentRoute = this.$route;
// //
while (currentRoute) { // while (currentRoute) {
// // //
// const matchedRoute = this.$router.options.routes.find( // // const matchedRoute = this.$router.options.routes.find(
// r => r.name === currentRoute.name // // r => r.name === currentRoute.name
// ); // // );
// // //
const routeWithParams = { // const routeWithParams = {
path: currentRoute.path, // path: currentRoute.path,
query: currentRoute.query, // query: currentRoute.query,
params: currentRoute.params // params: currentRoute.params
}; // };
crumbs.unshift({ // crumbs.unshift({
path: routeWithParams, // path: routeWithParams,
title: this.getTitle(currentRoute) // title: this.getTitle(currentRoute)
}); // });
// meta.breadcrumbParent // // meta.breadcrumbParent
if (currentRoute.meta.breadcrumbParent) { // if (currentRoute.meta.breadcrumbParent) {
currentRoute = this.$router.options.routes.find( // currentRoute = this.$router.options.routes.find(
r => r.name === currentRoute.meta.breadcrumbParent // r => r.name === currentRoute.meta.breadcrumbParent
); // );
// $route // // $route
if (currentRoute) { // if (currentRoute) {
currentRoute = { // currentRoute = {
...currentRoute, // ...currentRoute,
path: currentRoute.path, // path: currentRoute.path,
query: this.$route.query, // // query: this.$route.query, //
params: this.$route.params, // // params: this.$route.params, //
meta: currentRoute.meta || {} // meta: currentRoute.meta || {}
}; // };
} // }
} else { // } else {
currentRoute = null; // currentRoute = null;
} // }
} // }
return crumbs; return crumbs;
}, },

7
packages/GuipDialog/index.js

@ -0,0 +1,7 @@
import GuipDialog from './src/index.vue'
GuipDialog.install = function(Vue) {
Vue.component(GuipDialog.name || 'GuipDialog', GuipDialog)
}
export default GuipDialog

124
packages/GuipDialog/src/index.vue

@ -0,0 +1,124 @@
<template>
<el-dialog
:visible.sync="dialogShow"
:title="title"
v-bind="$attrs"
append-to-body
:width="width"
:show-close="showCloseButton"
:before-close="handleClose"
:class="type == 'center' ?'center' : 'normal'"
>
<!-- 自定义内容 -->
<slot></slot>
<!-- 底部按钮 -->
<span v-if="showFooterButton" slot="footer" :class="[type == 'center' ? 'dialog-footer-center' : 'dialog-footer-normal', 'flex']" style="justify-content: space-between;">
<GuipButton v-if="showCancelButton" @click="handleCancel" type="ignore" >{{ cancelText }}</GuipButton>
<GuipButton type="primary" @click="handleConfirm">{{ confirmText }}</GuipButton>
</span>
</el-dialog>
</template>
<script>
import GuipButton from '../../GuipButton';
export default {
name: 'GuipDialog',
props: {
type:{
type:String,
default:'normal'
},
//
dialogVisible: {
type: Boolean,
default: false,
},
//
title: {
type: String,
default: '提示',
},
//
width: {
type: String,
default: '599px',
},
//
showCloseButton: {
type: Boolean,
default: true,
},
//
showCancelButton: {
type: Boolean,
default: true,
},
//
showFooterButton: {
type: Boolean,
default: true,
},
//
cancelText: {
type: String,
default: '取消',
},
//
confirmText: {
type: String,
default: '确定',
},
},
components:{
GuipButton
},
computed: {
dialogShow: {
get() {
return this.dialogVisible;
},
set(newVal) {
this.$emit('dialogVisibleChange', newVal);
}
}
},
data() {
return {
// visible
internalVisible: this.visible,
// dialogVisible:false,
};
},
watch: {
// // prop internalVisible
// visible(newVal) {
// this.internalVisible = newVal;
// },
// // internalVisible
// internalVisible(newVal) {
// this.$emit('update:visible', newVal);
// },
},
methods: {
//
handleClose(done) {
this.$emit('close');
this.internalVisible = false; //
if(done){
done();
}
},
//
handleCancel() {
this.$emit('cancel');
this.internalVisible = false; //
},
//
handleConfirm() {
this.$emit('confirm');
this.internalVisible = false; //
},
},
};
</script>

1
packages/assets/drop-selected.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><g><g></g><g><path d="M13.5732,5.315390953125Q13.6985,5.197082953125,13.7668,5.0388329531250005Q13.835,4.880582953125,13.835,4.708251953125Q13.835,4.626011653125,13.819,4.545351953125Q13.8029,4.464691953125,13.7714,4.388710953125Q13.74,4.3127309531249995,13.6943,4.244350953125Q13.6486,4.175970953125,13.5904,4.117817953125Q13.5323,4.059664953125,13.4639,4.013974953125Q13.3955,3.968284953125,13.3195,3.936812953125Q13.2436,3.905340953125,13.1629,3.889295953125Q13.0822,3.873251953125,13,3.873251953125Q12.90746,3.873251953125,12.81716,3.8935169531250002Q12.72686,3.913781953125,12.64319,3.953328953125Q12.55951,3.992875953125,12.48654,4.049783953125Q12.41356,4.106692953125,12.35481,4.178200953125L7.06803,9.842611953125001L3.542182,7.198221953125Q3.428807,7.101421953125,3.288942,7.049841953125Q3.149076,6.998251953125,3,6.998251953125Q2.9177597,6.998251953125,2.8371,7.014291953124999Q2.75644,7.030341953125,2.680459,7.061811953125Q2.604479,7.093281953125,2.536099,7.138971953125Q2.4677189999999998,7.184661953125,2.409566,7.242821953125Q2.351413,7.300971953125,2.305723,7.369351953124999Q2.260033,7.437731953125001,2.228561,7.513711953125Q2.197089,7.589691953125,2.181044,7.6703519531249995Q2.165,7.7510119531249995,2.165,7.833251953125Q2.165,7.937161953125,2.190469,8.037911953125Q2.215938,8.138651953125,2.265322,8.230081953125Q2.314706,8.321511953125,2.384993,8.398041953125Q2.45528,8.474581953125,2.542182,8.531551953125L6.66667,11.624921953125Q6.72781,11.670781953125001,6.796279999999999,11.704751953125001Q6.864739999999999,11.738721953125001,6.93825,11.759671953125Q7.01175,11.780621953125,7.08784,11.787851953125Q7.16393,11.795081953124999,7.24006,11.788351953125Q7.31619,11.781621953125,7.38983,11.761151953125001Q7.46347,11.740681953125,7.53216,11.707161953125Q7.60084,11.673641953125,7.66229,11.628181953125Q7.72373,11.582721953124999,7.77588,11.526851953125L13.5732,5.315390953125Z" fill-rule="evenodd" fill="#006AFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
packages/assets/dropDown_expand.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

BIN
packages/assets/dropDown_open.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 782 B

BIN
packages/assets/table_empty.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 14 KiB

7
packages/index.js

@ -12,6 +12,7 @@ import SvgIcon from './SvgIcon';
import GuipTable from './GuipTable'; import GuipTable from './GuipTable';
import GuipSwitch from './GuipSwitch'; import GuipSwitch from './GuipSwitch';
import GuipTooltip from './GuipToolTip'; import GuipTooltip from './GuipToolTip';
import GuipDialog from './GuipDialog';
import 'core-js/stable' import 'core-js/stable'
import 'element-ui/lib/theme-chalk/index.css'; // 如果依赖Element import 'element-ui/lib/theme-chalk/index.css'; // 如果依赖Element
import './styles/index.css'; // 全局引入 import './styles/index.css'; // 全局引入
@ -32,7 +33,8 @@ const components = [
SvgIcon, SvgIcon,
GuipTable, GuipTable,
GuipTooltip, GuipTooltip,
GuipSwitch GuipSwitch,
GuipDialog
] ]
const install = function (Vue) { const install = function (Vue) {
@ -59,5 +61,6 @@ export default {
SvgIcon, SvgIcon,
GuipTable, GuipTable,
GuipTooltip, GuipTooltip,
GuipSwitch GuipSwitch,
GuipDialog
} }

2
packages/styles/index.css

@ -4120,7 +4120,7 @@ border-color:#006AFF !important;
} }
.el-menu { .el-menu {
border-right: solid 1px #e6e6e6; border: none;
list-style: none; list-style: none;
position: relative; position: relative;
margin: 0; margin: 0;

Loading…
Cancel
Save