This commit is contained in:
molong
2022-11-14 20:34:53 +08:00
parent 5cee9dcfab
commit d02cf12370
18 changed files with 4081 additions and 151 deletions

View File

@@ -12,8 +12,8 @@ const DEFAULT_CONFIG = {
CORE_VER: "1.6.6",
//接口地址
// API_URL: "http://127.0.0.1:8000/",
API_URL: "http://q.dxpd.cn/",
API_URL: "http://127.0.0.1:8000/",
// API_URL: "http://q.dxpd.cn/",
//请求超时
TIMEOUT: 10000,
@@ -58,12 +58,12 @@ const DEFAULT_CONFIG = {
//控制台首页默认布局
DEFAULT_GRID: {
//默认分栏数量和宽度 例如 [24] [18,6] [8,8,8] [6,12,6]
layout: [12, 6, 6],
//小组件分布com取值:views/home/components 文件名
layout: [24, 12, 12],
//小组件分布com取值:pages/home/components 文件名
copmsList: [
['welcome'],
['about', 'ver'],
['time', 'progress']
['about'],
['ver']
]
}
}

76
ui/src/mixin/import.vue Normal file
View File

@@ -0,0 +1,76 @@
<script>
import excel from '@/utils/excel';
export default {
data(){
return {
insert_page: 1
}
},
methods:{
beforeUpload(file){
const fileExt = file.name.split('.').pop().toLocaleLowerCase()
if (fileExt === 'xlsx' || fileExt === 'xls') {
this.readFile(file)
this.file = file
} else {
this.$message.warning('文件:' + file.name + '不是EXCEL文件请选择后缀为.xlsx或者.xls的EXCEL文件。')
}
return false;
},
// 读取文件
readFile(file){
const reader = new FileReader()
reader.readAsArrayBuffer(file)
reader.onloadstart = () => {
this.uploadLoading = true
this.tableLoading = true
this.showProgress = true
}
reader.onprogress = e => {
this.progressPercent = Math.round(e.loaded / e.total * 100)
}
reader.onerror = () => {
this.$message.error('文件读取出错')
}
reader.onload = e => {
this.$message.success('文件读取成功')
const data = e.target.result
const { header, results } = excel.read(data, 'array')
console.log(header);
this.insertData(results)
}
},
insertData(data){console.log(data)
let list = [];
let pagesize = 100;
var length = data.length;
if (this.insert_page > Math.ceil(length / pagesize)) {
this.$message.success('全部导入完成')
// this.action.show = false;
// this.loading = true;
// this.search.page = 1;
this.$refs.table.reload(this.search);
return false;
}else{
for (var i = (pagesize * (this.insert_page - 1)); i < (pagesize * this.insert_page); i++) {
list.push(data[i]);
}
let current = pagesize * (this.insert_page - 1) + 1;
let lastNum = (pagesize * this.insert_page < length) ? (pagesize * this.insert_page) : length;
this.$message.success('正在导入第' + current + '至' + lastNum + '条,请耐心等待导入,当出现“全部导入完成”后关闭窗口!');
this.$API.customer.company.insert.post({data:list})
.then(res => {
if(res.code == 1){
this.insert_page = this.insert_page + 1;
this.$message.success('导入完成当前页!')
this.insertData(data);
}else{
this.$message.success('导入失败,请重新导入!')
}
})
}
}
}
}
</script>

View File

@@ -1,25 +1,28 @@
<template>
<el-card shadow="hover" header="关于项目" class="item-background">
<p>高性能 / 精致 / 优雅基于Vue3 + Element-Plus 的中后台前端解决方案如果喜欢就点个星星支持一下</p>
<p>
<a href='https://gitee.com/lolicode/scui' target="_blank">
<img src='https://gitee.com/lolicode/scui/badge/star.svg?theme=dark' alt='star' style="vertical-align: middle">
</a>
</p>
<el-card shadow="hover" header="关于我们" class="item-background">
<el-descriptions border :column="1">
<el-descriptions-item :label="item.lable" v-for="(item, index) in info" :key="index">{{item.values}}</el-descriptions-item>
</el-descriptions>
</el-card>
</template>
<script>
export default {
title: "关于项目",
icon: "el-icon-setting",
description: "点个星星支持一下",
data() {
return {
}
export default {
title: '关于我们',
icon: "el-icon-setting",
description: "点个星星支持一下",
data() {
return {
info: [
{lable: '总策划', values: '郭平平'},
{lable: '产品设计及研发团队', values: '南昌腾速科技有限公司'},
{lable: '界面及用户体验团队', values: 'https://www.tensent.cn/'},
{lable: '官方网址', values: 'SCUI研发团队'},
{lable: 'BUG反馈', values: 'http://bbs.sentcms.com'},
]
}
}
}
</script>
<style scoped>

View File

@@ -1,14 +1,8 @@
<template>
<el-card shadow="hover" header="版本信息">
<div style="height: 210px;text-align: center;">
<img src="static/images/ver.svg" style="height:140px"/>
<h2 style="margin-top: 15px;">管理系统 {{$CONFIG.CORE_VER}}</h2>
<p style="margin-top: 5px;">最新版本 {{ver}}</p>
</div>
<div style="margin-top: 20px;">
<el-button type="primary" plain round @click="golog">更新日志</el-button>
<el-button type="primary" plain round @click="gogit">gitee</el-button>
</div>
<el-descriptions border :column="1">
<el-descriptions-item :label="item.label" v-for="(item, index) in verInfo" :key="index">{{item.values}}</el-descriptions-item>
</el-descriptions>
</el-card>
</template>
@@ -19,7 +13,7 @@
description: "当前项目版本信息",
data() {
return {
ver: 'loading...'
verInfo: []
}
},
mounted() {
@@ -27,8 +21,8 @@
},
methods: {
async getVer(){
const ver = await this.$API.demo.ver.get()
this.ver = ver.data
const ver = await this.$API.system.version.get()
this.verInfo = ver.data
},
golog(){
// window.open("https://gitee.com/lolicode/scui/releases")

View File

@@ -1,24 +1,10 @@
<template>
<el-card shadow="hover" header="欢迎">
<el-card shadow="never" class="aboutTop">
<div class="welcome">
<div class="logo">
<img src="static/images/logo.png">
<h2>SentOS</h2>
</div>
<div class="tips">
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-menu/></el-icon></div>
<div class="tips-item-message">这里是项目控制台你可以点击右上方的自定义按钮来添加移除或者移动部件</div>
</div>
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-promotion/></el-icon></div>
<div class="tips-item-message">在提高前端算力减少带宽请求和代码执行力上多次优化并且持续着</div>
</div>
<div class="tips-item">
<div class="tips-item-icon"><el-icon><el-icon-milk-tea/></el-icon></div>
<div class="tips-item-message">项目目的让前端工作更快乐</div>
</div>
</div>
</div>
</el-card>
</template>
@@ -42,15 +28,16 @@
</script>
<style scoped>
.welcome {}
.welcome .logo {text-align: center;}
.welcome .logo img {vertical-align: bottom;width: 100px;height: 100px;margin-bottom: 20px;}
.welcome .logo h2 {font-size: 30px;font-weight: normal;display: flex;align-items: center;justify-content: center;}
.welcome .logo {text-align: center;}
.welcome .logo img {vertical-align: bottom;width: 100px;height: 100px;margin-bottom: 20px;}
.welcome .logo h2 {font-size: 30px;font-weight: normal;display: flex;align-items: center;justify-content: center;}
.tips {margin-top: 20px;padding:0 40px;}
.tips-item {display: flex;align-items: center;justify-content: center;padding:7.5px 0;}
.tips-item-icon {width: 40px;height:40px;display: flex;align-items: center;justify-content: center;border-radius: 50%;font-size: 18px;margin-right: 20px;color: var(--el-color-primary);background: rgba(180,180,180,0.1);}
.tips-item-message {flex: 1;font-size: 14px;}
.aboutTop {border:0;background: linear-gradient(to right, #8E54E9, #4776E6);color: #fff;}
.aboutTop-info {text-align: center}
.tips {padding:0 40px;}
.tips-item {display: flex;align-items: center;justify-content: center;padding:7.5px 0;}
.tips-item-icon {width: 40px;height:40px;display: flex;align-items: center;justify-content: center;border-radius: 50%;font-size: 18px;margin-right: 20px;color: var(--el-color-primary);background: rgba(180,180,180,0.1);}
.tips-item-message {flex: 1;font-size: 14px;}
.actions {text-align: center;margin: 40px 0 20px 0;}
.actions {text-align: center;margin: 40px 0 20px 0;}
</style>

View File

@@ -1,5 +1,5 @@
<template>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
<el-form-item prop="user">
<el-input v-model="form.user" prefix-icon="el-icon-user" clearable :placeholder="$t('login.userPlaceholder')"></el-input>
</el-form-item>

View File

@@ -1,5 +1,5 @@
<template>
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large">
<el-form ref="loginForm" :model="form" :rules="rules" label-width="0" size="large" @keyup.enter="login">
<el-form-item prop="phone">
<el-input v-model="form.phone" prefix-icon="el-icon-iphone" clearable :placeholder="$t('login.mobilePlaceholder')">
<template #prepend>+86</template>