删除无用前端

This commit is contained in:
橙子
2022-04-09 00:31:23 +08:00
parent feb73174eb
commit 7aee6c4c12
123 changed files with 62 additions and 29127 deletions

141
README.md
View File

@@ -1,8 +1,7 @@
<h1 align="center"><img align="left" height="100px" src="https://user-images.githubusercontent.com/68722157/138828506-f58b7c57-5e10-4178-8f7d-5d5e12050113.png"> Yi框架-一个紧跟时代的.NetCore开源框架</h1>
<h1 align="center">基于.NET6+Vue快速开发框架</h1>
<h4 align="center">意义为了开发更简易</h4>
<h1 align="center"><img align="left" height="100px" src="https://user-images.githubusercontent.com/68722157/138828506-f58b7c57-5e10-4178-8f7d-5d5e12050113.png"> Yi框架</h1>
<h4 align="center">一套与SqlSugar一样爽的.Net6低代码开源框架</h4>
[English](README-en.md) | 简体中文
@@ -10,21 +9,12 @@
****
#### 简介:
**中文:意框架**
**CC.Yi.Old**.Net5早期三层单体架构已被CC.Yi取代
**CC.Yi**:.Net5经典极简三层WebApi单体应用架构
**Yi.Framework.Net5**:.Net5 DDD领域驱动设计分层微服务架构
**Yi.Framework.Net6**:.Net6 DDD领域驱动设计分层微服务架构正在更新
**Yi.Vue**Vue2.0配合CC.Yi.Framework使用前端项目正在更新
**分支ec****Yi.Framework.Net5+vue2.0** 实战项目!基于 Yi.Framework.Net5 微服务千万级并发电商项目DEMO同步更新
**分支erp****Yi.Framework.Net6+vue2.0** 实战项目!基于 Yi.Framework6 云管理系统项目DEMO同步更新
**中文:意框架**(和他的名字一样“简易”)
**英文YiFramework**
分支:
本项目由EFCore版本历经3年不断迭代至Sqlsugar版本现EFcore版本已弃用
**SqlSugar**:.Net6 DDD领域驱动设计分层微服务架构
**ec**:EFcore完整电商项目
****
@@ -32,15 +22,8 @@
废话少说直接上地址,**请不要**更改里面的数据
API服务 [yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号admin 、 123
![image](https://user-images.githubusercontent.com/68722157/147379813-f18b8e28-5c7f-4cd1-a93a-8ba3028424b1.png)
网关地址:[gate.ccnetcore.com/swagger](http://gate.ccnetcore.com/swagger)
![image](https://user-images.githubusercontent.com/68722157/147379797-0f8fb455-d072-414d-a9d7-ad717dd34357.png)
API服务~~[yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号admin 、 123~~
网关地址:~~[gate.ccnetcore.com/swagger](http://gate.ccnetcore.com/swagger)~~
#### 支持:
@@ -52,21 +35,21 @@ API服务 [yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号a
****
#### 软件架构:
**架构**:后端.NET6(Asp.NetCore 6)与.NET5(Asp.NetCore 5)、前端Vue2.0
**架构**:后端.NET6(Asp.NetCore 6)、WebFirst代码生成器~~与.NET5(Asp.NetCore 5)、前端Vue2.0~~
**关系型数据库**mysql、sql server、sqlite、oracle
**关系型数据库**mysql、sql server、sqlite、oracle(正在兼容中)
**操作系统**Windows、Linux
**身份验证**Identity、JWT、IdentityServer4
**身份验证**JWT、IdentityServer4
**组件**EFcore、Autofac、Castle、Swagger、Log4Net、Redis、RabbitMq、ES、Quartz.net、T4
**组件**~~EFcore~~SqlSugar、Autofac、Castle、Swagger、Log4Net、Redis、RabbitMq、ES、Quartz.net、~~T4~~
**分布式**CAP、Lock
**微服务**Consul、Ocelot、IdentityService、Apollo、Docker、Jenkins、Nginx、K8s、ELK、Polly
**封装**Json处理模块滑动验证码模块base64图片处理模块异常捕捉模块、邮件处理模块、linq封装模块、随机数模块、统一接口模块、基于策略的jwt验证、过滤器、数据库连接、跨域、初始化种子数据、Base32、Console输出、日期处理、文件传输、html筛选、http请求、ip过滤、md5加密、Rsa加密、序列化、雪花算法、字符串处理、编码处理、地址处理、xml处理、心跳检查
**封装**Json处理模块滑动验证码模块base64图片处理模块异常捕捉模块、邮件处理模块、linq封装模块、随机数模块、统一接口模块、基于策略的jwt验证、过滤器、数据库连接、跨域、初始化种子数据、Base32、Console输出、日期处理、文件传输、html筛选、http请求、ip过滤、md5加密、Rsa加密、序列化、雪花算法、字符串处理、编码处理、地址处理、xml处理、心跳检查。。。
****
#### 支持模块:
@@ -77,28 +60,30 @@ API服务 [yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号a
![image](https://user-images.githubusercontent.com/68722157/142923150-ebe1b538-c3fc-42dd-bea8-83e10e0f819a.png)
![image](https://user-images.githubusercontent.com/68722157/142923529-e4fbb2f6-def1-4702-b9da-5adbd22f0a2f.png)
- [x] 支持`DDD领域驱动设计`进行分层,支持微服务扩展
(删除线代表已实现功能还未迁移过来)
- [x] 支持大致`DDD领域驱动设计`进行分层,支持微服务扩展
- [x] 支持采用`异步`开发awit/async
- [x] 支持数据库主从`读写分离`
- [] 支持数据库主从`读写分离`
- [x] 支持功能替换,无需改动代码,只需配置`json文件`进行装配即可
- [x] 支持采用DbFirst开发方式使用`T4模板代码生成器`自动映射模型一键生成Service及IService所有代码
- [x] 支持`用户-角色-菜单-接口`以及vue2.0前端全部逻辑代码,下载无需修改直接使用
~~- [x] 支持采用DbFirst开发方式使用`T4模板代码生成器`自动映射模型一键生成Service及IService所有代码~~
- [x] 支持WebFirst无需改动代码自动生成全套代码与数据库只需点点点
~~- [x] 支持`用户-角色-菜单-接口`以及vue2.0前端全部逻辑代码,下载无需修改直接使用~~
- [x] 支持`Aop封装`FilterAop、IocAop、LogAop
- [x] 支持`Log4Net日志`记录自动生成至bin目录下的logs文件夹
- [x] 支持`DbSeed数据库种子数据`接入默认创建admin用户密码123
- [x] 支持主流`数据库随意切换`Mysql/Sqlite/Sqlserver/Oracle
- [x] 支持微软官方`EFcore ORM`
- [x] 支持`SwaggerWebAPI`jwt身份认证接入
- [x] 支持`DbSeed数据库种子数据`接入
~~- [x] 支持主流`数据库随意切换`Mysql/Sqlite/Sqlserver/Oracle~~
- [x] 支持上海杰哥官方`SqlSugar ORM`封装
- [x] 支持新版`SwaggerWebAPI`jwt身份认证接入
- [x] 支持`Cors`跨域
- [x] 支持`AutoFac`自动映射依赖注入
- [x] 支持`consul`健康检查
- [x] 支持`AutoFac`自动映射依赖注入
- [x] 支持`consul`服务器注册与发现
- [x] 支持`健康检查`
- [x] 支持`RabbitMQ`消息队列
- [x] 支持`Redis`多级缓存
- [x] 支持`Ocelot`网关路由、服务聚合、服务发现、认证、鉴权、限流、熔断、缓存、Header头传递
- [x] 支持`Apollo`全局配置中心;
- [x] 支持`docker`镜像制作
- [x] 支持页面`静态化处理`,将动态页面生成静态页面
~~- [x] 支持页面`静态化处理`,将动态页面生成静态页面~~
- [x] 支持`Quartz.net`任务调度,实现任意接口被调度
- [x] 支持`ELK`log4net+kafka+es+logstach+kibana
- [x] 支持`IdentityService4`授权中心
@@ -109,25 +94,22 @@ API服务 [yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号a
- [x] 支持`Jenkins+CI/CD`
- [x] 支持`AutoMapper`模块映射
- [ ] 支持`微信支付`(没账号)
- [x] 支持`单表多租户`常用功能
- [x]支持`逻辑删除`常用功能
- [x] 支持`操作日志`常用功能
****
#### 目录结构:
![图片](https://user-images.githubusercontent.com/68722157/138565689-ac6e2489-4b8f-47fd-93c1-47f26d453779.png)
![图片](https://s1.ax1x.com/2022/04/09/LCTleH.png)
我们依照DDD领域驱动设计分层
- BackGround后台进程
- Client客户端
- Domain领域层
- Infrastructure实例层
- MicroServiceInstance服务层
另外,**分支ec电商**目录结构:
![image](https://user-images.githubusercontent.com/68722157/142923703-9c56cd4c-2201-4933-9b26-dcb3f9f2d1b8.png)
我们大致依照DDD领域驱动设计分层
~~- BackGround后台进程目前可以无视等待更新~~
- Client客户端测试、客户端
- Domain领域层Dto、服务接口层、模型层、仓储层、服务层
- Infrastructure基础实例层(通用工具层、核心层、定时任务Job、国际化、Web扩展层)
- MicroServiceInstance服务层微服务
****
#### 安装教程:
@@ -135,57 +117,58 @@ API服务 [yi.ccnetcore.com](http://yi.ccnetcore.com) 管理员账号a
我们将在之后更新教程手册!
1. 下载全部源码默认使用sqlite数据库已经生成
2. 使用Visual Studio 2019在windows环境中打开CC.Yi.sln文件即可
2. 使用Visual Studio 2022在windows环境中打开CC.Yi.sln文件即可
****
#### 使用说明:
1. 导入使用仓库中的WebFirst数据库
2. 使用WebFirst添加实体、同步实体、修改地址并生成方案
没了,恭喜你已经成功启动了项目,并且已经具备大部分通用场景业务
是不是一个字?爽!
到此为止,你无需写任何一个代码!
我们将使用说明转移至我们的官方论坛中,正在制作中,尽情期待!
****
#### 感谢人员
#### 感谢一下人员对框架开发的大力支持
**国内.Net行业领头人** Eleven神、哲学的老张
**国内.Net行业领头人** Eleven神、sqlsugar上海杰哥、Gerry、哲学的老张
**核心开发人员**
[橙子]https://github.com/ccnetcore
[橙子]https://ccnetcore.com
[lzw]https://github.com/yeslode
[其他]https://github.com
[朝夕教育]https://www.zhaoxiedu.net
[sqlsugar]https://www.donet5.com/Home/Doc
****
#### 联系我们:
QQ454313500
作者QQ454313500
官方网址:正在建设
****
#### FQA:
问1不采用经典的三层架构
问1什么不采用EFcore
答1EFcoreORM已经非常强大已经完全可以充当数据处理层另一个原因在简单与复杂我们选择了简单
答1别问问就是Sqlsugar和本框架一样爽
问2这个框架的一切都是原创的吗?
问2以后会持续更新下去吗?
答2并不是,我们在初期是参考过非常非常多的其他框架,但我们可以保证,基本上绝大部分都是原创
答2一定会的,我们的标题是 一个和Sqlsugar一样爽的.Net6开源框架 只要Sqlsugar在我们将一直更新下去
问3以后会持续更新下去吗?
问3这个框架的针对人群是哪些人?适合所有人吗?
答3一定会的,我们的标题是 一个紧跟时代的.Netcore开源框架 ,如果有我们比较感兴趣的技术,我们一定会加入进来,例如:.Net6 。(已更新)
答3并不是适合所有人,应该算适合需要有一定基础的开发人员,当然,如果你是大神,你完全可以将这个框架二次开发!
问4这个框架的针对人群是哪些人?适合所有人吗
问4花如此多的精力制作这个框架是为了什么是为了赚钱吗和目前主流的abp等框架比又有什么意义呢
答4并不是适合所有人,应该算适合需要有一定基础的开发人员,当然,如果你是大神,你完全可以将这个框架改进!
答4我们与Sqlsugar作者理念一直我们是从用户角度出发框架是为用户服务与ABP复杂上手理念完全是相反的。
问5花如此多的精力制作这个框架是为了什么是为了赚钱吗和目前主流的abp等框架比又有什么意义呢?
问5为何不出版一个详细的说明书呢?
答5不说什么大话制作这个框架主要原因是为了自己使用以及其他的参考学习。abp确实非常优秀但和我们意框架其实并不冲突使用场景是不一样的
问6为何不出版一个详细的说明书呢
答5应该不会了代码都是基于Asp.Netcore框架适用于新手不用造轮子整个框架较为简单阅读源码后基本能自定义改造使用了过难也已经封装完毕别忘了其意义是为了开发更加简易
答5暂时不会了之后可能会代码都是基于Asp.Netcore框架适用于新手不用造轮子整个框架较为简单阅读源码后基本能自定义改造使用了过难也已经封装完毕别忘了其意义是为了开发更加简易建议添加作者好友这里人人都是顾问

View File

@@ -1,3 +0,0 @@
> 1%
last 2 versions
not dead

View File

@@ -1,4 +0,0 @@
#接口服务地址
VUE_APP_SERVICE_URL='https://localhost:44329/api'
#开发环境路径前缀
VUE_APP_BASE_API='/dev-apis'

View File

@@ -1,2 +0,0 @@
#生成环境路径前缀
VUE_APP_BASE_API='/prod-apis'

23
Yi.Vue2.x/.gitignore vendored
View File

@@ -1,23 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

View File

@@ -1,19 +0,0 @@
# vuetify-test
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

10192
Yi.Vue2.x/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,27 +0,0 @@
{
"name": "vuetify-test",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
},
"dependencies": {
"axios": "^0.22.0",
"vue": "^2.6.11",
"vue-chartist": "^2.3.1",
"vue-router": "^3.2.0",
"vuetify": "^2.4.0",
"vuetify-dialog": "^2.0.17",
"vuex": "^3.6.2"
},
"devDependencies": {
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"sass": "~1.32.0",
"sass-loader": "^10.0.0",
"vue-cli-plugin-vuetify": "~2.4.2",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.7.0"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -1,22 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>Yi-Vue</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<noscript>
<strong>We're sorry but Yi-Vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

View File

@@ -1,23 +0,0 @@
<template>
<v-fade-transition mode="out-in">
<router-view />
</v-fade-transition>
</template>
<script>
// Styles
import '@/styles/overrides.sass'
export default {
name: 'App',
metaInfo: {
title: 'App',
titleTemplate: '%s | Material Dashboard Free',
htmlAttrs: { lang: 'en' },
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
],
},
}
</script>

View File

@@ -1,46 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
login(username, password) {
return myaxios({
url: '/Account/login',
method: 'post',
data: {
username,
password
}
})
},
logout() {
return myaxios({
url: '/Account/logout',
method: 'post',
})
},
register(username, password, phone, code) {
return myaxios({
url: `/Account/register?code=${code}`,
method: 'post',
data: { username, password, phone }
})
},
email(emailAddress) {
return myaxios({
url: `/Account/email?emailAddress=${emailAddress}`,
method: 'post',
})
},
SendSMS(smsAddress) {
return myaxios({
url: `/Account/SendSMS?SMSAddress=${smsAddress}`,
method: 'post',
})
},
changePassword(user, newPassword) {
return myaxios({
url: `/Account/changePassword`,
method: 'put',
data: { user, newPassword }
})
}
}

View File

@@ -1,11 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
EditIcon(file) {
return myaxios({
url: '/File/EditIcon',
method: 'post',
headers: { "Content-Type": "multipart/form-data" },
data: file
})
}
}

View File

@@ -1,50 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
GetMenuInMould() {
return myaxios({
url: '/Menu/GetMenuInMould',
method: 'get'
})
},
addChildrenMenu(id, data) {
return myaxios({
url: '/Menu/addChildrenMenu',
method: 'post',
data: { parentId: id, data }
})
},
UpdateMenu(data) {
return myaxios({
url: '/Menu/UpdateMenu',
method: 'put',
data: data
})
},
DelListMenu(ids) {
return myaxios({
url: '/Menu/DelListMenu',
method: 'delete',
data: ids
})
},
AddTopMenu(data) {
return myaxios({
url: '/Menu/AddTopMenu',
method: 'post',
data: data
})
},
SetMouldByMenu(menuId, mouldId) {
return myaxios({
url: '/Menu/SetMouldByMenu',
method: 'post',
data: { id1: menuId, id2: mouldId }
})
},
GetTopMenusByHttpUser() {
return myaxios({
url: '/Menu/GetTopMenusByHttpUser',
method: 'get'
})
}
}

View File

@@ -1,10 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
getMould() {
return myaxios({
url: '/Mould/GetMould',
method: 'get'
})
}
}

View File

@@ -1,29 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
getRole() {
return myaxios({
url: '/Role/getRole',
method: 'get'
})
},
setMenuByRole(roleList, menuList) {
return myaxios({
url: '/Role/setMenuByRole',
method: 'post',
data: { ids1: roleList, ids2: menuList }
})
},
GetTopMenusByRoleId(roleId) {
return myaxios({
url: `/Role/GetTopMenusByRoleId?roleId=${roleId}`,
method: 'get'
})
},
GetRolesByUserId(userId) {
return myaxios({
url: `/Role/GetRolesByUserId?userId=${userId}`,
method: 'get'
})
},
}

View File

@@ -1,31 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
SetRoleByUser(userIds, roleIds) {
return myaxios({
url: '/User/SetRoleByUser',
method: 'post',
data: { "ids1": userIds, "ids2": roleIds }
})
},
GetUserInRolesByHttpUser() {
return myaxios({
url: `/User/GetUserInRolesByHttpUser`,
method: 'get'
})
},
GetMenuByHttpUser() {
return myaxios({
url: `/User/GetMenuByHttpUser`,
method: 'get'
})
},
GetAxiosByRouter(router) {
return myaxios({
url: `/User/GetAxiosByRouter?router=${router}`,
method: 'get'
})
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>

Before

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,30 +0,0 @@
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M132.472 205L182.534 118.292L162.162 130.093V119.162L191.975 102.019L221.665 50.5903L132.472 102.019V205Z" fill="#AEDDFF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M132.472 194.938L173.714 123.386L162.162 130.094V124.255V119.162V113.448L189.863 97.423L214.584 54.5659L132.472 102.019V194.938Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M183.155 101.274L189.987 97.2988L214.707 54.5659L175.329 77.2988C176.447 85.8702 179.18 93.9447 183.155 101.274Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M132.472 194.938L173.839 123.385L162.162 130.093V124.255V123.634C151.23 125.497 141.168 129.845 132.472 135.932V194.938Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M132.472 156.553V178.043C134.584 180.279 136.447 182.515 138.311 184.876L145.888 171.832C141.913 166.242 137.441 161.149 132.472 156.553Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M132.472 146.242C139.056 151.584 145.019 157.671 150.112 164.379L166.137 136.677C156.323 127.236 145.019 119.286 132.472 113.447V146.242Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M160.299 85.9946L141.665 96.8021C151.23 101.647 161.665 105.249 172.472 107.485L189.988 97.4232L195.205 88.3549C191.727 88.7275 188.249 88.8518 184.771 88.8518C176.323 88.8518 168.125 87.858 160.299 85.9946Z" fill="#AEDDFF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M170.609 80.0311C175.206 80.6522 179.926 81.0249 184.771 81.0249C189.988 81.0249 195.081 80.6522 200.05 79.7826L212.1 58.9131C208.87 60.0311 205.516 61.0249 202.038 61.7702L170.609 80.0311Z" fill="#AEDDFF"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M132.472 194.938L173.714 123.385L171.975 124.379L132.472 192.826" fill="#AEDDFF"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M189.117 96.5534L161.043 112.827L162.161 119.162V113.448L189.863 97.423L214.583 54.5659L212.72 55.6839L189.117 96.5534Z" fill="#AEDDFF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M123.528 205V102.019L34.3359 50.5903L84.398 137.298V113.696L93.8389 119.162V153.572L123.528 205Z" fill="#7BC6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M123.528 194.937V102.018L43.0308 55.5586L84.3972 127.235V113.695V107.981L93.8381 113.447V119.161V143.509L123.528 194.937Z" fill="#7BC6FF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M123.528 194.937V144.006C116.82 150.714 111.478 158.788 107.875 167.733L123.528 194.937Z" fill="#7BC6FF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M60.5463 85.9933C68.2481 84.5026 75.4531 81.894 82.0369 78.1673L43.0308 55.5586L60.5463 85.9933Z" fill="#7BC6FF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M69.7397 101.895L82.5348 124.006C83.1559 124.131 83.777 124.255 84.3981 124.379V113.82V107.982L93.8391 113.447V119.286V126.367C104.522 129.224 114.46 133.696 123.528 139.534V109.472C109.864 104.379 95.0813 101.522 79.5534 101.522C76.1994 101.522 72.9696 101.646 69.7397 101.895Z" fill="#7BC6FF"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M93.8384 143.509L100.671 155.31C108.994 158.912 116.695 163.633 123.528 169.223V148.85C114.584 142.515 104.646 137.546 93.8384 134.44V143.509Z" fill="#7BC6FF"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M84.3973 114.939V113.696V107.982L93.8383 113.448V119.162V120.404L94.8321 112.827L83.2793 106.119L84.3973 114.939Z" fill="#7BC6FF"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M43.0308 55.5586L84.3972 127.235V125.124L44.8941 56.6766L43.0308 55.5586Z" fill="#7BC6FF"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M123.528 192.826L93.8384 141.398V143.51L123.528 194.938" fill="#7BC6FF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M135.948 60.3699L128.124 64.8994L103.418 50.5903H54.2114L128.124 93.2086L202.037 50.5903H119.065L135.948 60.3699Z" fill="#1867C0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M140.065 57.8993L135.947 60.3699L128.124 64.8994L103.418 50.5903H62.5493L128.124 88.4732L193.698 50.5903H127.3L140.065 57.8993Z" fill="#1867C0"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M167.036 66.0317L193.698 50.5903H170.33C168.58 55.4286 167.448 60.6787 167.036 66.0317Z" fill="#1867C0"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M62.5493 50.5903L100.432 72.4142C105.579 67.7817 110.006 62.3258 113.3 56.2522L103.418 50.5903H62.5493Z" fill="#1867C0"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M102.903 50.5903H94.1533C101.977 65.517 113.301 78.2819 127.095 87.8555L128.124 88.4732L140.272 81.4731C125.036 74.8848 112.168 64.0758 102.903 50.5903Z" fill="#1867C0"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" d="M128.125 64.8994L118.86 59.5464C126.889 67.37 136.566 73.4436 147.375 77.3555L163.434 68.0906C153.654 67.1641 144.39 64.4876 135.948 60.3699L128.125 64.8994Z" fill="#1867C0"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M127.301 50.5903L140.066 57.8993L135.948 60.3699L135.021 60.8846L141.816 57.8993L129.051 50.5903H127.301Z" fill="#1867C0"/>
<path opacity="0.3" fill-rule="evenodd" clip-rule="evenodd" d="M128.124 87.4438L64.2993 50.5903H62.5493L128.124 88.4732L193.698 50.5903H191.948L128.124 87.4438Z" fill="#1867C0"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M167.037 66.0317L163.331 68.0906L147.375 77.3554L140.272 81.4731L128.125 88.4732V93.2086L202.038 50.5903H193.699L167.037 66.0317Z" fill="#1867C0"/>
</svg>

Before

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -1 +0,0 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#aeddff;}</style></defs><title>Artboard 47</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-2" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-3" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg>

Before

Width:  |  Height:  |  Size: 518 B

View File

@@ -1,64 +0,0 @@
<template>
<v-container>
<v-row align="center">
<v-col
v-for="(link, i) in links"
:key="i"
class="text-center"
cols="6"
md="auto"
>
<a
:href="link.href"
class="text-decoration-none text-uppercase text-caption font-weight-regular"
rel="noopener"
target="_blank"
v-text="link.text"
/>
</v-col>
<v-spacer class="hidden-sm-and-down" />
<v-col
cols="12"
md="auto"
>
<div class="text-body-1 font-weight-light pt-6 pt-md-0 text-center">
&copy; {{ (new Date()).getFullYear() }}, Made by <v-icon>mdi-vuetify</v-icon>
<a
href="https://ccnetcore"
class="text-decoration-none"
>ccnetcore</a>
</div>
</v-col>
</v-row>
</v-container>
</template>
<script>
export default {
name: 'Links',
data: () => ({
links: [
{
href: '#',
text: 'YiFramework文档',
},
{
href: '#',
text: 'GitHub',
},
{
href: '#',
text: '论坛',
}
],
}),
}
</script>
<style lang="sass" scoped>
a
color: inherit !important
</style>

View File

@@ -1,59 +0,0 @@
<template>
<v-alert
class="v-alert--material"
dark
v-bind="$attrs"
v-on="$listeners"
>
<template
v-if="$attrs.icon"
v-slot:prepend
>
<v-avatar
class="align-self-start mt-n9 elevation-6 mr-4"
size="38"
>
<v-icon
:color="$attrs.color"
class="elevation-6 white"
light
>
{{ $attrs.icon }}
</v-icon>
</v-avatar>
</template>
<slot />
<template
v-if="$attrs.dismissible"
v-slot:close="{ toggle }"
>
<v-btn
:aria-label="$vuetify.lang.t('$vuetify.close')"
class="ml-4"
color
icon
small
@click="toggle"
>
<v-icon>
$vuetify.icons.cancel
</v-icon>
</v-btn>
</template>
</v-alert>
</template>
<script>
export default { name: 'MaterialAlert' }
</script>
<style lang="sass">
.v-alert--material
margin-top: 32px
.v-alert__dismissible
align-self: flex-start
margin: 0 0 0 16px !important
</style>

View File

@@ -1,113 +0,0 @@
<template>
<app-card
v-bind="$attrs"
class="v-card--material mt-4"
>
<v-card-title class="align-start">
<v-sheet
:color="color"
:width="fullHeader ? '100%' : undefined"
class="overflow-hidden mt-n9 transition-swing v-card--material__sheet"
elevation="6"
max-width="100%"
rounded
>
<v-theme-provider
v-if="hasHeading"
dark
>
<div
v-if="icon"
:class="iconSmall ? 'pa-7' : 'pa-8'"
>
<v-icon
:large="!iconSmall"
v-text="icon"
/>
</div>
<slot name="heading" />
<div
v-if="heading"
class="text-h4 white--text pa-7 v-card--material__title"
>
{{ heading }}
</div>
</v-theme-provider>
</v-sheet>
<div
v-if="hasTitle"
:class="fullHeader ? 'pt-4' : 'pl-3'"
class="text-h4 v-card--material__title"
>
<slot name="title" />
<template v-if="title">
{{ title }}
</template>
<div class="text-subtitle-1 mb-n4">
<slot name="subtitle" />
<template v-if="subtitle">
{{ subtitle }}
</template>
</div>
</div>
</v-card-title>
<slot />
<template v-if="$slots.actions">
<v-divider class="mt-2 mx-4" />
<v-card-actions class="px-4 text-caption grey--text">
<slot name="actions" />
</v-card-actions>
</template>
</app-card>
</template>
<script>
export default {
name: 'MaterialCard',
props: {
color: String,
fullHeader: Boolean,
heading: String,
icon: String,
iconSmall: Boolean,
subtitle: String,
title: String,
},
computed: {
hasHeading () {
return !!(
this.icon ||
this.heading ||
this.$slots.heading
)
},
hasTitle () {
return !!(
this.title ||
this.subtitle ||
this.$slots.title ||
this.$slots.subtitle
)
},
},
}
</script>
<style lang="sass">
.v-card.v-card--material
> .v-card__title
> .v-card--material__title
flex: 1 1 auto
word-break: break-word
</style>

View File

@@ -1,93 +0,0 @@
<template>
<material-card
v-bind="$attrs"
class="v-card--material-chart"
full-header
>
<template #heading>
<div class="pa-4">
<chartist
:data="data"
:event-handlers="eventHandlers"
:options="options"
:ratio="ratio"
:responsive-options="responsiveOptions"
:type="type"
style="max-height: 150px;"
/>
</div>
</template>
<template #subtitle>
<slot name="subtitle" />
</template>
<slot />
<template #actions>
<slot name="actions" />
</template>
</material-card>
</template>
<script>
export default {
name: 'MaterialChartCard',
inheritAttrs: false,
props: {
data: {
type: Object,
default: () => ({}),
},
eventHandlers: {
type: Array,
default: () => ([]),
},
options: {
type: Object,
default: () => ({}),
},
ratio: String,
responsiveOptions: {
type: Array,
default: () => ([]),
},
type: {
type: String,
required: true,
validator: v => ['Bar', 'Line', 'Pie'].includes(v),
},
},
}
</script>
<style lang="sass">
.v-card--material-chart
p
color: #999
.v-card--material__sheet
max-height: 185px
width: 100%
.ct-label
color: rgba(255, 255, 255, 1)
opacity: .7
font-size: 0.875rem
font-weight: 300
.ct-grid
stroke: hsla(0,0%,100%,.2)
.ct-series-a .ct-point,
.ct-series-a .ct-line,
.ct-series-a .ct-bar,
.ct-series-a .ct-slice-donut
stroke: rgba(255,255,255,.8)
.ct-series-a .ct-slice-pie,
.ct-series-a .ct-area
fill: rgba(255,255,255,.4)
</style>

View File

@@ -1,78 +0,0 @@
<template>
<v-snackbar
v-model="internalValue"
class="v-snackbar--material"
v-bind="{
...$attrs,
'color': 'transparent'
}"
>
<material-alert
v-model="internalValue"
:color="$attrs.color"
:dismissible="dismissible"
:type="type"
class="ma-0"
dark
>
<slot />
</material-alert>
</v-snackbar>
</template>
<script>
export default {
name: 'MaterialSnackbar',
props: {
dismissible: {
type: Boolean,
default: true,
},
type: {
type: String,
default: '',
},
value: Boolean,
},
data () {
return {
internalValue: this.value,
}
},
watch: {
internalValue (val, oldVal) {
if (val === oldVal) return
this.$emit('input', val)
},
value (val, oldVal) {
if (val === oldVal) return
this.internalValue = val
},
},
}
</script>
<style lang="sass">
.v-snackbar--material
margin-top: 32px
margin-bottom: 32px
.v-alert
padding: 32px 16px
.v-alert--material,
.v-snack__wrapper
border-radius: 4px
.v-snack__content
overflow: visible
padding: 0
.v-snack__action
display: none
</style>

View File

@@ -1,39 +0,0 @@
<template>
<material-card
class="v-card--material-stats"
v-bind="$attrs"
v-on="$listeners"
>
<template #subtitle>
<div
class="text-right text-h3 v-card__subtitle--material-stats"
v-text="value"
/>
</template>
<template #actions>
<slot name="actions" />
</template>
<slot />
</material-card>
</template>
<script>
export default {
name: 'MaterialStatCard',
props: { value: String },
}
</script>
<style lang="sass">
.v-card--material-stats.v-card--material .v-card--material__title
color: #999999
font-size: .875rem !important
margin-left: auto
text-align: right
.v-card__subtitle--material-stats
color: #3C4858
</style>

View File

@@ -1,30 +0,0 @@
import myaxios from '@/util/myaxios'
export default {
getItem(url) {
return myaxios({
url: url,
method: 'get'
})
},
addItem(url, data) {
return myaxios({
url: url,
method: 'post',
data: data
})
},
updateItem(url, data) {
return myaxios({
url: url,
method: 'put',
data: data
})
},
delItemList(url, Ids) {
return myaxios({
url: url,
method: 'delete',
data: Ids
})
},
}

View File

@@ -1,37 +0,0 @@
<template>
<section class="mb-12 text-center">
<h1
class="mb-2 text-h3"
v-text="heading"
/>
<div
v-if="link"
class="text-body-2 font-weight-light"
>
Please checkout the <a
:href="`https://vuetifyjs.com/en/${link}`"
class="text-decoration-none secondary--text"
target="_blank"
>full documentation</a>
</div>
<v-responsive
class="text-center mx-auto text-body-1 font-weight-light"
max-width="400"
>
<slot />
</v-responsive>
</section>
</template>
<script>
export default {
name: 'ViewIntro',
props: {
heading: String,
link: String,
},
}
</script>

View File

@@ -1,29 +0,0 @@
<script>
import { VHover, VListItem } from 'vuetify/lib'
export default {
name: 'AppBarItem',
render (h) {
return h(VHover, {
scopedSlots: {
default: ({ hover }) => {
return h(VListItem, {
attrs: this.$attrs,
class: {
'black--text': !hover,
'white--text secondary elevation-12': hover,
},
props: {
activeClass: '',
dark: hover,
link: true,
...this.$attrs,
},
}, this.$slots.default)
},
},
})
},
}
</script>

View File

@@ -1,22 +0,0 @@
<template>
<v-btn
:color="color"
v-bind="$attrs"
v-on="$listeners"
>
<slot />
</v-btn>
</template>
<script>
export default {
name: 'AppBtn',
props: {
color: {
type: String,
default: 'primary',
},
},
}
</script>

View File

@@ -1,12 +0,0 @@
<template>
<v-card
v-bind="$attrs"
v-on="$listeners"
>
<slot />
</v-card>
</template>
<script>
export default { name: 'AppCard' }
</script>

View File

@@ -1,42 +0,0 @@
<template>
<v-tabs
:active-class="`${color} ${theme.isDark ? 'black' : 'white'}--text`"
class="v-tabs--pill"
hide-slider
v-bind="$attrs"
v-on="$listeners"
>
<slot />
<slot name="items" />
</v-tabs>
</template>
<script>
export default {
name: 'AppTabs',
inject: ['theme'],
props: {
color: {
type: String,
default: 'primary',
},
},
}
</script>
<style lang="sass">
.v-tabs--pill
.v-tab,
.v-tab:before
border-radius: 24px
&.v-tabs--icons-and-text
&:not(.v-tabs--vertical) > .v-tabs-bar
height: 100px
.v-tab,
.v-tab:before
border-radius: 4px
</style>

View File

@@ -1,28 +0,0 @@
<template>
<v-avatar :size="size" >
<!-- <img src="https://z3.ax1x.com/2021/05/09/gJadhD.jpg" /> -->
<img
:src="baseurl +'/image/'+$store.state.user.user.icon"
/>
</v-avatar>
</template>
<script>
// Utilities
// import { get } from 'vuex-pathify'
export default {
name: 'ccAvatar',
mounted() {
this.baseurl = process.env.VUE_APP_BASE_API;
},
data:()=>({
baseurl: "",
}),
props: {
size: {
type: Number,
}
},
}
</script>

View File

@@ -1,67 +0,0 @@
<template>
<v-dialog v-model="dialog" persistent max-width="600px">
<template v-slot:activator="{ on, attrs }">
<v-btn class="ma-2" color="primary" dark v-bind="attrs" v-on="on">
{{ headers }}
</v-btn>
</template>
<v-card>
<v-card-title>
<span class="text-h5">{{ headers }}</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col cols="12">
<v-combobox
v-model="select"
:items="items"
label="请点击选择"
multiple
chips
:item-text="itemText"
></v-combobox>
</v-col>
</v-row>
</v-container>
<small>*可多选</small>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="dialog = false"> 关闭 </v-btn>
<div @click="dialog = false"> <slot name="save" ></slot> </div>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
export default {
props: {
headers: {
type: String
},
items:{
type:Array
},
itemText:{
type: String
}
},
name: "ccCombobox",
data() {
return {
dialog: false,
select: [],
};
},
watch:{
select:{//深度监听,可监听到对象、数组的变化
handler(val, oldVal){
this.$emit("select",val);
},
deep:true
}
},
};
</script>

View File

@@ -1,245 +0,0 @@
<template>
<v-data-table
:headers="headers"
:items="desserts"
sort-by="calories"
class="elevation-1"
item-key="id"
show-select
v-model="selected"
:search="search"
>
<slot />
<template v-slot:top>
<!-- 搜索框 -->
<v-toolbar flat>
<v-spacer></v-spacer>
<v-text-field
v-model="search"
append-icon="mdi-magnify"
label="搜索"
single-line
hide-details
class="mx-4"
></v-text-field>
<v-btn
v-if="axiosUrls.add != null"
color="primary"
dark
class="mb-2 mx-2"
@click="dialog = true"
>
添加新项
</v-btn>
<!-- 添加提示框 -->
<v-dialog
v-if="axiosUrls.add != null"
v-model="dialog"
max-width="500px"
>
<v-card>
<v-card-title>
<span class="headline">{{ formTitle }}</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col
cols="12"
sm="6"
md="4"
v-for="(value, key, index) in editedItem"
:key="index"
>
<v-text-field
v-model="editedItem[key]"
:label="key"
></v-text-field>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="close"> 取消 </v-btn>
<v-btn color="blue darken-1" text @click="save"> 保存 </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-btn
v-if="axiosUrls.del != null"
color="secondary"
class="mb-2"
@click="deleteItem(null)"
>
删除所选
</v-btn>
</v-toolbar>
</template>
<!-- 表格中的删除和修改 -->
<template v-slot:item.actions="{ item }">
<slot name="action" :item="item"></slot>
<v-icon
v-if="axiosUrls.update != null"
small
class="mr-2"
@click="editItem(item)"
>
mdi-pencil
</v-icon>
<v-icon v-if="axiosUrls.del != null" small @click="deleteItem(item)">
mdi-delete
</v-icon>
</template>
<!-- 初始化 -->
<template v-slot:no-data>
<v-btn color="primary" @click="initialize"> 刷新 </v-btn>
</template>
</v-data-table>
</template>
<script>
import itemApi from "./TableApi.js";
export default {
name: "ccTable",
props: {
defaultItem: {
type: Object,
},
headers: {
type: Array,
},
axiosUrls: {
type: Object,
},
},
data: () => ({
page: 1,
selected: [],
search: "",
dialog: false,
desserts: [],
editedIndex: -1,
editedItem: {},
}),
computed: {
formTitle() {
return this.editedIndex === -1 ? "添加数据" : "编辑数据";
},
},
watch: {
axiosUrls: {
handler(val, oldVal) {
this.dataInit(val.get);
},
deep: true,
},
selected: {
handler(val, oldVal) {
this.$emit("selected", val);
},
deep: true,
},
dialog(val) {
val || this.close();
},
},
created() {
this.initialize();
},
methods: {
dataInit(getStr) {
itemApi.getItem(getStr).then((resp) => {
const response = resp.data;
this.desserts = response;
});
},
initialize() {
if(this.axiosUrls.get!=undefined && this.axiosUrls.get!=null )
{
this.dataInit(this.axiosUrls.get)
}
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
},
// 添加和修改都打开同一个编辑框
editItem(item) {
this.editedIndex = this.desserts.indexOf(item);
this.editedItem = Object.assign({}, item);
this.dialog = true;
},
async deleteItem(item) {
this.editedIndex = this.desserts.indexOf(item);
this.editedItem = Object.assign({}, item);
var p = await this.$dialog.warning({
text: "你确定要删除此条记录吗??",
title: "警告",
actions: {
false: "取消",
true: "确定",
},
});
if (p) {
this.deleteItemConfirm();
}
},
deleteItemConfirm() {
var Ids = [];
if (this.editedIndex > -1) {
Ids.push(this.editedItem.id);
} else {
this.selected.forEach(function (item) {
Ids.push(item.id);
});
}
itemApi
.delItemList(this.axiosUrls.del, Ids)
.then(() => this.initialize());
},
close() {
this.dialog = false;
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
},
closeDelete() {
this.dialogDelete = false;
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
},
save() {
if (this.editedIndex > -1) {
itemApi
.updateItem(this.axiosUrls.update, this.editedItem)
.then(() => this.initialize());
} else {
itemApi
.addItem(this.axiosUrls.add, this.editedItem)
.then(() => this.initialize());
}
this.close();
},
},
};
</script>

View File

@@ -1,227 +0,0 @@
<template>
<div>
<v-divider></v-divider>
<app-btn dark class="ma-4" @click="showAll"> 展开全部</app-btn>
<app-btn dark class="my-4 mr-4" @click="dialog = true"> 添加新项 </app-btn>
<app-btn dark class="my-4" color="secondary" @click="deleteItem(null)">
删除所选
</app-btn>
<v-dialog v-model="dialog" max-width="500px">
<v-card>
<v-card-title>
<span class="headline">{{ formTitle }}</span>
</v-card-title>
<v-card-text>
<v-container>
<v-row>
<v-col
cols="12"
sm="6"
md="4"
v-for="(value, key, index) in editedItem"
:key="index"
>
<v-text-field
v-model="editedItem[key]"
:label="key"
></v-text-field>
</v-col>
</v-row>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" text @click="close"> 取消 </v-btn>
<v-btn color="blue darken-1" text @click="save"> 保存 </v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-treeview
ref="tree"
open-on-click
selectable
:items="desserts"
:selection-type="selectionType"
v-model="selection"
return-object
open-all
hoverable
item-text="menu_name"
>
<template v-slot:append="{ item }">
<v-btn class="mr-2">编号:{{ item.id }}</v-btn>
<v-btn class="mr-2">图标:{{ item.icon }}</v-btn>
<v-btn class="mr-2">路由:{{ item.router }}</v-btn>
<v-btn v-if="item.mould" class="mr-2">接口名:{{ item.mould.mould_name }}</v-btn>
<v-btn v-if="item.mould" class="mr-2" color="secondary">接口地址:{{ item.mould.url }}</v-btn>
<ccCombobox
headers="设置接口权限"
itemText="url"
:items="mouldList"
@select="getSelect"
>
<template v-slot:save>
<v-btn @click="setMould(item)" color="blue darken-1" text>
保存</v-btn
>
</template>
</ccCombobox>
<app-btn
@click="
parentId = item.id;
dialog = true;
"
>添加子菜单</app-btn
>
<app-btn class="mx-2" @click="editItem(item)">编辑</app-btn>
<app-btn color="secondary" class="mr-2" @click="deleteItem(item)">删除</app-btn>
</template>
</v-treeview>
</div>
</template>
<script>
import mouldApi from "../api/mouldApi";
import menuApi from "../api/menuApi";
export default {
name: "ccTreeview",
data: () => ({
mouldSelect: [],
mouldList: [],
desserts: [],
selectionType: "independent",
selection: [],
dialog: false,
editedItem: {},
editedIndex: -1,
parentId: 0,
defaultItem: {
icon: "mdi-start",
router: "test",
menu_name: "测试",
is_show:1
},
}),
computed: {
formTitle() {
return this.editedIndex === -1 ? "添加数据" : "编辑数据";
},
},
created() {
this.init();
},
methods: {
showAll(){
this.$refs.tree.updateAll(true);
},
setMould(item) {
menuApi.SetMouldByMenu(item.id, this.mouldSelect[0].id).then((resp) => {
this.$dialog.notify.info(resp.msg, {
position: "top-right",
timeout: 5000,
});
this.init();
});
},
getSelect(data) {
this.mouldSelect = data;
},
async deleteItem(item) {
this.editedIndex = this.desserts.indexOf(item);
this.editedItem = Object.assign({}, item);
var p = await this.$dialog.warning({
text: "你确定要删除此条记录吗??",
title: "警告",
actions: {
false: "取消",
true: "确定",
},
});
if (p) {
this.deleteItemConfirm();
}
},
deleteItemConfirm() {
var Ids = [];
if (this.editedIndex > -1) {
Ids.push(this.editedItem.id);
} else {
this.selection.forEach(function (item) {
Ids.push(item.id);
});
}
menuApi.DelListMenu(Ids).then(() => this.init());
},
close() {
this.dialog = false;
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
},
init() {
this.parentId = 0;
mouldApi.getMould().then((resp) => {
this.mouldList = resp.data;
});
menuApi.GetMenuInMould().then((resp) => {
this.desserts =[ resp.data];
});
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem);
this.editedIndex = -1;
});
},
editItem(item) {
this.editedIndex = item.id;
this.editedItem = Object.assign({}, item);
this.dialog = true;
},
save() {
if (this.editedIndex > -1) {
menuApi.UpdateMenu(this.editedItem).then(() => this.init());
} else {
if (this.parentId == 0) {
menuApi.AddTopMenu(this.editedItem).then(() => {
this.init();
});
} else {
menuApi.addChildrenMenu(this.parentId, this.editedItem).then(() => {
this.init();
});
}
}
this.close();
},
},
watch: {
selection: {
//深度监听,可监听到对象、数组的变化
handler(val, oldVal) {
this.$emit("selection", val);
},
deep: true,
},
dialog(val) {
val || this.close();
},
},
};
</script>

View File

@@ -1,79 +0,0 @@
<template>
<v-app-bar
id="default-app-bar"
app
absolute
class="v-bar--underline"
color="transparent"
:clipped-left="$vuetify.rtl"
:clipped-right="!$vuetify.rtl"
height="70"
flat
>
<v-app-bar-nav-icon class="hidden-md-and-up" @click="$store.state.home.drawer = !$store.state.home.drawer;" />
<default-drawer-toggle class="hidden-sm-and-down" />
<v-toolbar-title class="font-weight-light text-h5" v-text="name" />
<v-spacer />
<default-search class="hidden-sm-and-down" />
<default-go-home />
<default-notifications />
<default-account />
</v-app-bar>
</template>
<script>
// Utilities
// import { get, sync } from 'vuex-pathify'
export default {
data: () => ({
name: "系统",
}),
name: "DefaultBar",
components: {
DefaultAccount: () =>
import(
/* webpackChunkName: "default-account" */
"./widgets/Account"
),
DefaultDrawerToggle: () =>
import(
/* webpackChunkName: "default-drawer-toggle" */
"./widgets/DrawerToggle"
),
DefaultGoHome: () =>
import(
/* webpackChunkName: "default-go-home" */
"./widgets/GoHome"
),
DefaultNotifications: () =>
import(
/* webpackChunkName: "default-notifications" */
"./widgets/Notifications"
),
DefaultSearch: () =>
import(
/* webpackChunkName: "default-search" */
"./widgets/Search"
),
},
// computed: {
// ...sync('app', [
// 'drawer',
// 'mini',
// ]),
// name: get('route/name'),
// },
};
</script>

View File

@@ -1,141 +0,0 @@
<template>
<v-navigation-drawer
id="default-drawer"
v-model="$store.state.home.drawer"
:dark="dark"
:right="$vuetify.rtl"
:src="drawerImage ? image : ''"
:mini-variant.sync="$store.state.home.mini"
mini-variant-width="80"
app
width="260"
>
<template v-if="drawerImage" #img="props">
<v-img :key="image" :gradient="gradient" v-bind="props" />
</template>
<div class="px-2">
<default-drawer-header />
<v-divider class="mx-3 mb-2" />
<default-list :items="items" />
</div>
<template #append>
<div class="pa-4 text-center">
<app-btn
class="text-none mb-4"
color="white"
href="https://vuetifyjs.com"
small
text
>
Documentation
</app-btn>
<app-btn block class="text-none" color="secondary" @click="logout">
<v-icon left> mdi-package-up </v-icon>
退出
</app-btn>
</div>
</template>
<div class="pt-12" />
</v-navigation-drawer>
</template>
<script>
// Utilities
// import { get, sync } from 'vuex-pathify'
import userApi from "@/api/userApi";
export default {
methods: {
init() {
userApi.GetMenuByHttpUser().then((resp) => {
this.items = resp.data.children;
});
},
logout() {
this.$store.dispatch("Logout").then((resp) => {
this.$router.push({ path: "/login" });
});
},
},
created() {
this.init();
},
computed: {
image() {
return this.$store.getters.image;
},
gradient() {
return this.$store.getters.gradient;
},
drawerImage()
{
return this.$store.state.home.drawerImage;
},
dark()
{
return this.$store.state.user.dark;
}
},
data: () => ({
items: [],
}),
name: "DefaultDrawer",
components: {
DefaultDrawerHeader: () =>
import(
/* webpackChunkName: "default-drawer-header" */
"./widgets/DrawerHeader"
),
DefaultList: () =>
import(
/* webpackChunkName: "default-list" */
"./List"
),
},
// computed: {
// ...get('user', [
// 'dark',
// 'gradient',
// 'image',
// ]),
// ...get('app', [
// 'items',
// 'version',
// ]),
// ...sync('app', [
// 'drawer',
// 'drawerImage',
// 'mini',
// ]),
// },
};
</script>
<style lang="sass">
#default-drawer
.v-list-item
margin-bottom: 8px
.v-list-item::before,
.v-list-item::after
display: none
.v-list-group__header__prepend-icon,
.v-list-item__icon
margin-top: 12px
margin-bottom: 12px
margin-left: 4px
&.v-navigation-drawer--mini-variant
.v-list-item
justify-content: flex-start !important
</style>

View File

@@ -1,22 +0,0 @@
<template>
<v-footer
id="default-footer"
color="transparent"
absolute
app
inset
>
<links />
</v-footer>
</template>
<script>
// Components
import Links from '@/components/Links'
export default {
name: 'DefaultFooter',
components: { Links },
}
</script>

View File

@@ -1,43 +0,0 @@
<template>
<v-app>
<default-bar />
<default-drawer />
<default-view />
<default-footer />
<default-settings />
</v-app>
</template>
<script>
export default {
name: 'DefaultLayout',
components: {
DefaultBar: () => import(
/* webpackChunkName: "default-app-bar" */
'./AppBar'
),
DefaultDrawer: () => import(
/* webpackChunkName: "default-drawer" */
'./Drawer'
),
DefaultFooter: () => import(
/* webpackChunkName: "default-footer" */
'./Footer'
),
DefaultSettings: () => import(
/* webpackChunkName: "default-settings" */
'./Settings'
),
DefaultView: () => import(
/* webpackChunkName: "default-view" */
'./View'
),
},
}
</script>

View File

@@ -1,40 +0,0 @@
<template>
<v-list
expand
nav
v-bind="$attrs"
v-on="$listeners"
>
<template v-for="(item, i) in items">
<default-list-group
v-if="item.children"
:key="`group-${i}`"
:item="item"
/>
<default-list-item
v-else
:key="`item-${i}`"
:item="item"
/>
</template>
</v-list>
</template>
<script>
export default {
name: 'DefaultList',
components: {
DefaultListGroup: () => import('./ListGroup'),
DefaultListItem: () => import('./ListItem'),
},
props: {
items: {
type: Array,
default: () => ([]),
},
},
}
</script>

View File

@@ -1,91 +0,0 @@
<template>
<v-list-group
:group="group"
:prepend-icon="item.icon"
eager
v-bind="$attrs"
>
<template v-slot:activator>
<v-list-item-icon
v-if="!item.icon && !item.avatar"
class="text-caption text-uppercase text-center my-2 align-self-center"
style="margin-top: 14px"
>
{{ title }}
</v-list-item-icon>
<v-list-item-avatar v-if="item.avatar">
<v-img :src="item.avatar" />
</v-list-item-avatar>
<v-list-item-content v-if="item.menu_name">
<v-list-item-title v-text="item.menu_name" />
</v-list-item-content>
</template>
<template v-for="(child, i) in item.children">
<default-list-group
v-if="child.children"
:key="`sub-group-${i}`"
:item="child"
/>
<default-list-item
v-if="!child.children"
:key="`child-${i}`"
:item="child"
/>
</template>
</v-list-group>
</template>
<script>
// Utilities
// import { get } from 'vuex-pathify'
export default {
name: 'DefaultListGroup',
components: {
DefaultListItem: () => import('./ListItem'),
},
props: {
item: {
type: Object,
default: () => ({}),
},
},
computed: {
group () {
return this.genGroup(this.item.children)
},
title () {
const matches = this.item.menu_name.match(/\b(\w)/g)
if(matches!=null)
{
return matches.join('')
}
},
},
methods: {
genGroup (items) {
return items.reduce((acc, cur) => {
if (!cur.router) return acc
acc.push(
cur.children
? this.genGroup(cur.children)
: cur.router.slice(1, -1),
)
return acc
}, []).join('|')
},
},
}
</script>

View File

@@ -1,58 +0,0 @@
<template>
<v-list-item
:href="item.href"
:rel="item.href ? 'nofollow' : undefined"
:target="item.href ? '_blank' : undefined"
:to="item.router"
active-class="primary white--text"
link
class="py-1"
v-bind="$attrs"
v-on="$listeners"
>
<v-list-item-icon
v-if="!item.icon"
class="text-caption text-uppercase justify-center ml-1 my-2 align-self-center"
>
{{ title }}
</v-list-item-icon>
<v-list-item-avatar v-if="item.avatar">
<v-img :src="item.avatar" />
</v-list-item-avatar>
<v-list-item-icon
v-if="item.icon"
class="my-2 align-self-center"
>
<v-icon v-text="item.icon" />
</v-list-item-icon>
<v-list-item-content v-if="item.menu_name">
<v-list-item-title v-text="item.menu_name" />
</v-list-item-content>
</v-list-item>
</template>
<script>
export default {
name: 'DefaultListItem',
props: {
item: {
type: Object,
default: () => ({}),
},
},
computed: {
title () {
const matches = this.item.menu_name.match(/\b(\w)/g)
if(matches!=null)
{
return matches.join('')
}
},
},
}
</script>

View File

@@ -1,303 +0,0 @@
<template>
<div id="settings-wrapper">
<v-card
id="settings"
class="py-2 px-4"
color="rgba(0, 0, 0, .3)"
dark
flat
link
min-width="100"
style="
position: fixed;
top: 115px;
right: -35px;
border-radius: 8px;
z-index: 1;
"
>
<v-icon large> mdi-cog </v-icon>
</v-card>
<v-menu
v-model="menu"
:close-on-content-click="false"
activator="#settings"
bottom
content-class="v-settings"
left
nudge-left="8"
offset-x
origin="top right"
transition="scale-transition"
>
<v-card class="text-center mb-0" width="300">
<v-card-text>
<strong class="mb-3 d-inline-block">主题颜色</strong>
<v-item-group v-model="color" mandatory>
<v-item v-for="color in colors" :key="color" :value="color">
<template v-slot="{ active, toggle }">
<v-avatar
:class="active && 'v-settings__item--active'"
:color="color"
class="v-settings__item mx-1"
size="25"
@click="toggle"
/>
</template>
</v-item>
</v-item-group>
<v-divider class="my-4 secondary" />
<strong class="mb-3 d-inline-block">图层颜色</strong>
<v-item-group v-model="gradient" mandatory>
<v-item
v-for="(scrim, index) in gradients"
:key="scrim"
:value="index"
class="mx-1"
>
<template v-slot="{ active, toggle }">
<v-avatar
:class="active && 'v-settings__item--active'"
:color="scrim"
class="v-settings__item"
size="24"
@click="toggle"
/>
</template>
</v-item>
</v-item-group>
<v-divider class="my-4 secondary" />
<v-row align="center" no-gutters>
<v-col cols="auto"> 主题模式 </v-col>
<v-spacer />
<v-col cols="auto">
<v-switch
v-model="$vuetify.theme.dark"
class="ma-0 pa-0"
color="secondary"
hide-details
/>
</v-col>
</v-row>
<v-divider class="my-4 secondary" />
<v-row align="center" no-gutters>
<v-col cols="auto"> 迷你菜单 </v-col>
<v-spacer />
<v-col cols="auto">
<v-switch
v-model="$store.state.home.mini"
class="ma-0 pa-0"
color="secondary"
hide-details
/>
</v-col>
</v-row>
<v-divider class="my-4 secondary" />
<v-row align="center" no-gutters>
<v-col cols="auto"> 图片菜单 </v-col>
<v-spacer />
<v-col cols="auto">
<v-switch
v-model="drawerImage"
class="ma-0 pa-0"
color="secondary"
hide-details
/>
</v-col>
</v-row>
<v-divider class="my-4 secondary" />
<strong class="mb-3 d-inline-block">图片</strong>
<v-card :disabled="!drawerImage" flat>
<v-item-group
v-model="image"
class="d-flex justify-space-between mb-3"
>
<v-item
v-for="(img, index) in images"
:key="img"
:value="index"
class="mx-1"
>
<template v-slot="{ active, toggle }">
<v-sheet
:class="active && 'v-settings__item--active'"
class="d-inline-block v-settings__item"
@click="toggle"
>
<v-img :src="img" height="100" width="50" />
</v-sheet>
</template>
</v-item>
</v-item-group>
</v-card>
<v-btn
block
class="mb-3"
color="grey darken-1"
dark
href="https://github.com/ccnetcore/yi"
rel="noopener"
target="_blank"
>
Github 地址
</v-btn>
<v-btn
block
color="info"
href="https://ccnetcore.com"
rel="noopener"
target="_blank"
>
加入我们
</v-btn>
<div class="my-12" />
<div>
<strong class="mb-3 d-inline-block">感谢你的支持</strong>
</div>
<v-btn class="ma-1" color="#55acee" dark rounded>
<v-icon>mdi-twitter</v-icon>
- 45
</v-btn>
<v-btn class="ma-1" color="#3b5998" dark default rounded>
<v-icon>mdi-facebook</v-icon>
- 50
</v-btn>
</v-card-text>
</v-card>
</v-menu>
</div>
</template>
<script>
// Mixins
import Proxyable from "vuetify/lib/mixins/proxyable";
// Vuex
// import { get, sync } from 'vuex-pathify'
export default {
name: "DashboardCoreSettings",
mixins: [Proxyable],
computed: {
gradients(){
return this.$store.state.user.gradients},
image:{
get(){
return this.$store.state.user.drawer.image;
},
set(value){
this.$store.commit('SetImage',value)
}
},
gradient:{
get(){
return this.$store.state.user.drawer.gradient;
},
set(value){
this.$store.commit('SetGradient',value)
}
},
images()
{
return this.$store.state.user.images;
},
drawerImage:
{
get(){
return this.$store.state.home.drawerImage;
},
set(value){
this.$store.commit('SetDrawerImage',value)
},
},
dark()
{
return this.$store.state.user.dark;
},
drawer()
{
return this.$store.state.home.drawer;
}
},
data: () => ({
color: "#E91E63",
colors: ["#9C27b0", "#00CAE3", "#4CAF50", "#ff9800", "#E91E63", "#FF5252"],
menu: false,
saveImage: "",
}),
// computed: {
// ...sync('app', [
// 'drawer',
// 'drawerImage',
// 'mini',
// ]),
// ...sync('user', [
// 'drawer@gradient',
// 'drawer@image',
// ]),
// ...get('user', [
// 'images',
// 'gradients',
// ]),
// },
watch: {
color(val) {
this.$vuetify.theme.themes[this.isDark ? "dark" : "light"].primary = val;
this.$vuetify.theme.dark=true;
this.$vuetify.theme.dark=false;
},
},
};
</script>
<style lang="sass">
.v-settings
.v-item-group > *
cursor: pointer
&__item
border-width: 3px
border-style: solid
border-color: transparent !important
&--active
border-color: #00cae3 !important
</style>

View File

@@ -1,20 +0,0 @@
<template>
<v-main>
<v-container fluid>
<v-progress-linear
:active="this.$store.state.loader.load"
:indeterminate="this.$store.state.loader.load"
background-color="primary lighten-4"
color="primary lighten-1"
striped
></v-progress-linear>
<router-view :key="$route.path" />
</v-container>
</v-main>
</template>
<script>
export default {
name: 'DefaultView',
}
</script>

View File

@@ -1,50 +0,0 @@
<template>
<v-menu
bottom
left
min-width="200"
offset-y
origin="top right"
transition="scale-transition"
>
<template v-slot:activator="{ attrs, on }">
<v-btn class="ml-2" min-width="0" text v-bind="attrs" v-on="on">
<!-- <v-icon>mdi-account</v-icon> -->
<ccAvatar :size="36" class="elevation-2"></ccAvatar>
</v-btn>
</template>
<v-list :tile="false" flat nav>
<app-bar-item to="/"
><v-list-item-title v-text="'用户名:'+$store.state.user.user.username"
/></app-bar-item>
<app-bar-item to="/"
><v-list-item-title v-text="'称号:'+$store.state.user.user.nick"
/></app-bar-item>
<v-divider class="mb-2 mt-2" />
<template v-for="(p, i) in profile">
<v-divider v-if="p.divider" :key="`divider-${i}`" class="mb-2 mt-2" />
<app-bar-item v-else :key="`item-${i}`" to="/">
<v-list-item-title v-text="p.title" />
</app-bar-item>
</template>
</v-list>
</v-menu>
</template>
<script>
export default {
name: "DefaultAccount",
data: () => ({
profile: [
{ title: "用户信息" },
{ title: "设置" },
{ divider: true },
{ title: "登出" },
],
}),
};
</script>

View File

@@ -1,39 +0,0 @@
<template>
<default-list
:items="items"
class="mb-n2"
/>
</template>
<script>
export default {
name: 'DefaultAccountSettings',
components: {
DefaultList: () => import(
/* webpackChunkName: "default-list" */
'../List'
),
},
data: () => ({
items: [
{
title: 'John Leider',
icon: 'mdi-vuetify',
items: [
{
title: 'My Profile',
},
{
title: 'Edit Profile',
},
{
title: 'Settings',
},
],
},
],
}),
}
</script>

View File

@@ -1,29 +0,0 @@
<template>
<v-list-item class="mb-0 justify-space-between pl-3">
<v-list-item-avatar>
<v-img
:src="
require('@/assets/vmd.svg')"
/>
</v-list-item-avatar>
<v-list-item-content class="pl-2">
<v-list-item-title class="text-h3">
<strong class="mr-1 font-weight-black">Yi</strong>
<span class="primary--text">Framework</span>
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</template>
<script>
// Utilities
// import { get } from 'vuex-pathify'
export default {
name: 'DefaultDrawerHeader',
// computed: { version: get('app/version') },
}
</script>

View File

@@ -1,31 +0,0 @@
<template>
<v-btn
class="ml-3 mr-4"
elevation="1"
fab
small
@click="$store.state.home.mini = !$store.state.home.mini"
>
<v-icon>
{{ $store.state.home.mini ? 'mdi-format-list-bulleted' : 'mdi-dots-vertical' }}
</v-icon>
</v-btn>
</template>
<script>
// Utilities
// import { sync } from 'vuex-pathify'
export default {
data:()=>({
}),
name: 'DefaultDrawerToggle',
computed: {
// mini: sync('app/mini'),
},
}
</script>

View File

@@ -1,17 +0,0 @@
<template>
<v-btn
class="ml-2"
min-width="0"
text
to="/"
exact
>
<v-icon>mdi-view-dashboard</v-icon>
</v-btn>
</template>
<script>
export default {
name: 'DefaultGoHome',
}
</script>

View File

@@ -1,62 +0,0 @@
<template>
<v-menu
bottom
left
offset-y
origin="top right"
transition="scale-transition"
>
<template v-slot:activator="{ attrs, on }">
<v-btn
class="ml-2"
min-width="0"
text
v-bind="attrs"
v-on="on"
>
<v-badge
bordered
color="red"
overlap
>
<template v-slot:badge>
<span>5</span>
</template>
<v-icon>mdi-bell</v-icon>
</v-badge>
</v-btn>
</template>
<v-list
flat
nav
>
<app-bar-item
v-for="(n, i) in notifications"
:key="i"
link
>
<v-list-item-content>
<v-list-item-title>{{ n }} </v-list-item-title>
</v-list-item-content>
</app-bar-item>
</v-list>
</v-menu>
</template>
<script>
export default {
name: 'DefaultNotifications',
data: () => ({
notifications: [
'临时消息1请检查邮箱',
'临时消息2请检查邮箱',
'临时消息3请检查邮箱',
'临时消息4请检查邮箱',
'临时消息5请检查邮箱',
],
}),
}
</script>

View File

@@ -1,31 +0,0 @@
<template>
<v-text-field
placeholder="全站搜索"
class="mr-16"
color="secondary"
hide-details
style="max-width: 400px"
>
<template
v-if="$vuetify.breakpoint.mdAndUp"
v-slot:append-outer
>
<v-btn
class="mt-n2 ml-n2"
fab
small
elevation="2"
height="44"
width="44"
>
<v-icon>mdi-magnify</v-icon>
</v-btn>
</template>
</v-text-field>
</template>
<script>
export default {
name: 'DefaultSearch',
}
</script>

View File

@@ -1,38 +0,0 @@
<template>
<v-app>
<div class="auth-wrapper auth-v1">
<div class="auth-inner">
<router-view></router-view>
</div>
<!-- background triangle shape -->
<img
class="auth-mask-bg"
height="173"
:src="
require(`@/assets/mask-${$vuetify.theme.dark ? 'dark' : 'light'}.png`)
"
/>
<!-- tree -->
<v-img
class="auth-tree"
width="247"
height="185"
src="@/assets/tree.png"
></v-img>
<!-- tree -->
<v-img
class="auth-tree-3"
width="377"
height="289"
src="@/assets/tree-3.png"
></v-img>
</div>
</v-app>
</template>
<style lang="scss">
@import "@/styles/auth.scss";
</style>

View File

@@ -1,24 +0,0 @@
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import vuetify from './plugins/vuetify'
import VuetifyDialog from 'vuetify-dialog'
import 'vuetify-dialog/dist/vuetify-dialog.css'
import './plugins'
import "./permission"
import store from './store/index'
Vue.config.productionTip = false
Vue.use(VuetifyDialog, {
context: {
vuetify
}
});
let vm = new Vue({
router,
store,
vuetify,
render: function(h) { return h(App) }
}).$mount('#app')
export default vm;

View File

@@ -1,18 +0,0 @@
import router from './router/index'
import store from './store/index'
// import accountApi from '@/api/accountApi'
router.beforeEach((to, from, next) => {
const user = store.state.user.user; //获取是有user
if (!user) { //如果没有登入
if (to.path == '/login/' || to.path == '/register/' || to.path == '/reset_password/' || to.path == '/qq/') {
next();
} else {
next({ path: '/login/' });
}
} else {
next();
}
})

View File

@@ -1,20 +0,0 @@
/**
* plugins/app.js
*
* Automatically loads and bootstraps files
* in the `./src/components/` folder.
*/
// Imports
import Vue from 'vue'
const requireComponent = require.context('@/components', true, /\.vue$/)
for (const file of requireComponent.keys()) {
const componentConfig = requireComponent(file)
Vue.component(
componentConfig.default.name,
componentConfig.default || componentConfig,
)
}

View File

@@ -1,4 +0,0 @@
import Vue from 'vue'
import 'chartist/dist/chartist.min.css'
Vue.use(require('vue-chartist'))

View File

@@ -1,6 +0,0 @@
// Automatically included in './src/main.js'
import './app'
import './chartist'
// import './webfontloader'
// import './vue-meta'

View File

@@ -1,30 +0,0 @@
// Vuetify Documentation https://vuetifyjs.com
import Vue from 'vue'
import Vuetify from 'vuetify/lib/framework'
import ripple from 'vuetify/lib/directives/ripple'
Vue.use(Vuetify, { directives: { ripple } })
const theme = {
primary: '#E91E63',
secondary: '#9C27b0',
accent: '#e91e63',
info: '#00CAE3',
success: '#4CAF50',
warning: '#FB8C00',
error: '#FF5252',
}
export default new Vuetify({
breakpoint: { mobileBreakpoint: 960 },
icons: {
values: { expand: 'mdi-menu-down' },
},
theme: {
themes: {
dark: theme,
light: theme,
},
},
})

View File

@@ -1,43 +0,0 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import { trailingSlash } from '@/util/helpers'
import {
layout,
route,
} from '@/util/routes'
Vue.use(VueRouter)
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
scrollBehavior: (to, from, savedPosition) => {
if (to.hash) return { selector: to.hash }
if (savedPosition) return savedPosition
return { x: 0, y: 0 }
},
routes: [
layout('Default', [
route('Index'),
route('AdmUser', null, 'AdmUser'),
route('AdmRole', null, 'AdmRole'),
route('AdmMenu', null, 'AdmMenu'),
route('AdmMould', null, 'AdmMould'),
route('AdmRoleMenu', null, 'AdmRoleMenu'),
route('userInfo', null, 'userInfo'),
]),
layout('Login', [
route('login', null, 'login'),
route('register', null, 'register')
])
]
})
router.beforeEach((to, from, next) => {
return to.path.endsWith('/') ? next() : next(trailingSlash(to.path))
})
export default router

View File

@@ -1,18 +0,0 @@
import Vue from 'vue'
import Vuex from 'vuex'
import home from './modules/home'
import user from './modules/user'
import theme from './modules/theme'
import loader from './modules/loader'
Vue.use(Vuex);
//实例化
const store = new Vuex.Store({
modules: {
home,
user,
theme,
loader
}
})
export default store

View File

@@ -1,56 +0,0 @@
const state = {
drawer: null,
drawerImage: true,
mini: false,
items: [{
title: 'Dashboard',
icon: 'mdi-view-dashboard',
to: '/',
},
{
title: 'User Profile',
icon: 'mdi-account',
to: '/components/profile/',
},
{
title: 'Regular Tables',
icon: 'mdi-clipboard-outline',
to: '/tables/regular/',
},
{
title: 'Typography',
icon: 'mdi-format-font',
to: '/components/typography/',
},
{
title: 'Icons',
icon: 'mdi-chart-bubble',
to: '/components/icons/',
},
{
title: 'Google Maps',
icon: 'mdi-map-marker',
to: '/maps/google/',
},
{
title: 'Notifications',
icon: 'mdi-bell',
to: '/components/notifications/',
},
],
}
const mutations = { //变化//载荷
SetDrawerImage(state, drawerImage) {
state.drawerImage = drawerImage
}
}
//在action中可以配合axios进行权限判断
const actions = { //动作
}
const getters = {}
export default { state, mutations, actions, getters }

View File

@@ -1,34 +0,0 @@
const state = { //状态
load: false
}
const mutations = { //变化//载荷
OPEN(state) {
state.load = true;
},
CLOSE(state) {
state.load = false;
},
}
//在action中可以配合axios进行权限判断
const actions = { //动作
openLoad(context) {
context.commit('OPEN')
},
closeLoad(context) {
context.commit('CLOSE')
}
}
// const getters = { //类似与计算属性 派生属性
// msg(state) {
// if (state.count > 80) {
// return "成绩优异"
// } else {
// return "成绩不合格"
// }
// }
// }
export default { state, mutations, actions }

View File

@@ -1,33 +0,0 @@
import vuetify from '../../plugins/vuetify';
const state = { //状态
light: {
primary: '#1976D2',
secondary: '#424242',
accent: '#82B1FF',
error: '#FF5252',
info: '#2196F3',
success: '#4CAF50',
warning: '#FFC107',
cyan: "#FAB2B1",
blue: "#2196F3"
},
dark: {}
}
const mutations = { //变化//载荷
SET_Light(state, n) {
state.light = n
vuetify.framework.theme.themes.light = n
},
}
//在action中可以配合axios进行权限判断
const actions = { //动作
set_light(context, n) {
context.commit('SET_Light', n)
},
}
export default { state, mutations, actions }

View File

@@ -1,153 +0,0 @@
import { getToken, setToken, getUser, setUser, removeToken } from '../../util/usertoken'
import accountApi from "@/api/accountApi"
//再导入axion请求
const state = { //状态
token: getToken(),
user: getUser(),
dark: false,
drawer: {
image: 0,
gradient: 1,
mini: false,
},
gradients: [
'rgba(0, 0, 0, .7), rgba(0, 0, 0, .7)',
'rgba(228, 226, 226, 1), rgba(255, 255, 255, 0.7)',
'rgba(244, 67, 54, .8), rgba(244, 67, 54, .8)',
],
images: [
'https://z3.ax1x.com/2021/05/09/gJadhD.jpg',
'https://s4.ax1x.com/2022/01/11/7eT9kn.jpg',
'https://s4.ax1x.com/2022/01/11/7eTCYq.jpg',
'https://s4.ax1x.com/2022/01/11/7eTSTs.jpg',
],
notifications: [],
rtl: false
}
const mutations = { //变化//载荷
SET_TOKEN(state, token) {
state.token = token
setToken(token)
},
SET_USER(state, user) {
state.user = user
setUser(user)
},
SetGradient(state, gradient) {
state.drawer.gradient = gradient
},
SetImage(state, image) {
state.drawer.image = image
}
}
//在action中可以配合axios进行权限判断
const actions = { //动作
setIcon({ commit, state }, icon) {
state.user.icon = icon
commit('SET_USER', state.user)
},
// qqUpdate({ state }, openid) {
// return new Promise((resolv, reject) => {
// qqApi.qqupdate(openid, state.user.id).then(resp => {
// resolv(resp)
// }).catch(error => {
// reject(error)
// })
// })
// },
// qqLogin({ commit }, openid) {
// return new Promise((resolv, reject) => {
// qqApi.qqlogin(openid).then(resp => {
// if (resp.status) {
// commit('SET_TOKEN', resp.data.token)
// commit('SET_USER', resp.data.user)
// }
// resolv(resp)
// }).catch(error => {
// reject(error)
// })
// })
// },
Login({ commit }, form) {
return new Promise((resolv, reject) => {
accountApi.login(form.username.trim(), form.password.trim()).then(resp => {
if (resp.status) {
commit('SET_TOKEN', resp.data.token)
commit('SET_USER', resp.data.user)
}
resolv(resp)
}).catch(error => {
reject(error)
})
})
},
Register({ commit }, form) {
return new Promise((resolv, reject) => {
accountApi.register(form.username.trim(), form.password.trim(), form.email.trim(), form.code.trim()).then(resp => {
resolv(resp)
}).catch(error => {
reject(error)
})
})
},
Logged({ commit }) {
return new Promise((resolv, reject) => {
accountApi.logged().then(resp => {
resolv(resp)
}).catch(error => {
reject(error)
})
})
},
// GetUserInfo({ commit, state }) {
// return new Promise((resolv, reject) => {
// // getUserInfo(state.token).then(response => {
// // commit('SET_USER', response.data)
// // resolve(response)
// // }).catch(error=>{
// // reject(error)
// // })
// })
// },
Logout({ commit, state }) {
return new Promise((resolv, reject) => {
accountApi.logout().then(response => {
commit('SET_TOKEN', '')
commit('SET_USER', null)
removeToken()
resolv(response)
}).catch(error => {
reject(error)
})
})
}
}
const getters = { //类似与计算属性 派生属性
dark: (state, getters) => {
return (
state.dark ||
getters.gradient.indexOf('255, 255, 255') === -1
)
},
gradient: state => {
return state.gradients[state.drawer.gradient]
},
image: state => {
return state.drawer.image === '' ? state.drawer.image : state.images[state.drawer.image]
}
}
export default { state, mutations, actions, getters }

View File

@@ -1,55 +0,0 @@
.auth-wrapper {
display: flex;
min-height: calc(var(--vh, 1vh) * 100);
width: 100%;
flex-basis: 100%;
align-items: center;
background-color: #F4F5FA;
// common style for both v1 and v2
a {
text-decoration: unset;
}
// auth v1
&.auth-v1 {
align-items: center;
justify-content: center;
overflow: hidden;
padding: 1.5rem;
.auth-mask-bg {
position: absolute;
bottom: 0;
width: 100%;
}
.auth-tree,
.auth-tree-3 {
position: absolute;
}
.auth-tree {
bottom: 0;
left: 0;
}
.auth-tree-3 {
bottom: 0;
right: 0;
}
// auth card
.auth-inner {
width: 28rem;
z-index: 1;
.auth-card {
padding: 0.9375rem 0.875rem;
}
}
}
}
@media (max-width: 600px) {
// auth bg and tree hide in sm screen
.auth-v1 {
.auth-tree,
.auth-tree-3,
.auth-mask-bg {
display: none;
}
}
}

View File

@@ -1,26 +0,0 @@
.text-mono
font-family: monospace
// Helpers
.flex-1-1-auto
flex: 1 1 auto !important
.flex-1-0-auto
flex: 1 0 auto !important
.flex-0-1-auto
flex: 0 1 auto !important
.flex-0-0-auto
flex: 0 0 auto !important
.position-relative
position: relative !important
.overflow-y-scroll
overflow-y: scroll
table
> thead > tr > th,
> tbody > tr > td
font-weight: 300 !important

View File

@@ -1,106 +0,0 @@
// reduce button default elevation
// default background color is #EEEEEE
$btn-sizes: (
'small': 28,
'default': 41,
'large': 54
);
$btn-font-sizes: (
'default': .75rem
);
$btn-font-weight: 400;
$btn-letter-spacing: normal;
$material-light: (
'background': #EEEEEE,
'text': (
'primary': #333333,
'secondary': #999999
)
);
$btn-icon-font-size: 1.0625rem !important;
$list-item-min-height: 48px;
$blockquote-font-size: 1.25rem;
$card-border-radius: 6px;
$card-text-font-weight: 300;
$card-elevation: 1;
$data-table-regular-header-font-size: 1.0625rem;
$shadow-key-umbra: (
1: (0 1px 4px 0 rgba(0,0,0,.14)),
12: (0 16px 38px -12px rgba(0,0,0,.56))
);
$shadow-key-penumbra: (
1: (0 0 0 0 rgba(0,0,0,0)),
12: (0 4px 25px 0 rgba(0,0,0,.12))
);
$shadow-key-ambient: (
1: (0 0 0 0 rgba(0,0,0,0)),
12: (0 8px 10px -5px rgba(0,0,0,.2))
);
$headings: (
'h1': (
'size': 3.3125rem,
'line-height': 1.15em,
'weight': 300
),
'h2': (
'size': 2.25rem,
'line-height': 1.5em,
'weight': 300
),
'h3': (
'size': 1.5625rem,
'line-height': 1.4em,
'weight': 300
),
'h4': (
'size': 1.125rem,
'line-height': 1.4em,
'weight': 300
),
'h5': (
'size': 1.0625rem,
'line-height': 1.4em,
'weight': 300
),
'h6': (
'size': .75rem,
'line-height': 1.5em,
'text-transform': uppercase,
'weight': 500
),
'subtitle-1': (
'size': 0.875rem,
'weight': 300
),
'subtitle-2': (
'size': 0.875rem,
'line-height': 1.5em !important,
'weight': 300
),
'caption': (
'size': 0.8125rem,
'weight': 300
),
'overline': (
'letter-spacing': normal,
'line-height': 0.625rem,
'size': 0.625rem,
'weight': 500
)
);
// Tabs
$tab-font-size: .775rem;
$tab-font-weight: 500;
$tabs-item-letter-spacing: normal;

View File

@@ -1,13 +0,0 @@
function notify(resp) {
if (resp.status) {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
});
} else {
this.$dialog.notify.error(resp.msg, {
position: "top-right",
});
}
};
export default { notify };

View File

@@ -1,54 +0,0 @@
var start = true;
function getUrl(menuList, menuStr) {
if (start) {
for (var i = 0; i < menuList.length; i++) {
if (menuList[i].menu_name == menuStr) {
start = false;
console.log(handUrl(menuList[i]))
return handUrl(menuList[i])
} else {
if (menuList[i].children != undefined && start) {
getUrl(menuList[i].children, menuStr);
}
}
}
}
};
function handUrl(menu) {
var axiosUrls = {
get: "123",
update: "123",
del: "123",
add: "123",
};
const myMenu = menu.children;
myMenu.forEach(item => {
const myName = item.mould.mould_name;
const myUrl = item.mould.url;
switch (myName) {
case 'get':
axiosUrls.get = myUrl;
break;
case 'update':
axiosUrls.update = myUrl;
break;
case 'del':
axiosUrls.del = myUrl;
break;
case 'add':
axiosUrls.add = myUrl;
break;
}
});
return axiosUrls;
}
export {
getUrl,
handUrl
}

View File

@@ -1,11 +0,0 @@
const EN_LOCALE_ONLY = process.env.EN_LOCALE_ONLY === 'true'
const IN_BROWSER = typeof window !== 'undefined'
const IS_DEBUG = process.env.DEBUG === 'true'
const IS_PROD = process.env.NODE_ENV === 'production'
module.exports = {
EN_LOCALE_ONLY,
IN_BROWSER,
IS_DEBUG,
IS_PROD,
}

View File

@@ -1,11 +0,0 @@
export function leadingSlash (str) {
return str.startsWith('/') ? str : '/' + str
}
export function trailingSlash (str) {
return str.endsWith('/') ? str : str + '/'
}
export const wait = timeout => {
return new Promise(resolve => setTimeout(resolve, timeout))
}

View File

@@ -1,16 +0,0 @@
const actionList = [
"用户管理",
"角色管理",
"权限管理",
"板块管理",
"等级管理",
"主题管理",
"设置管理",
"横幅管理",
"版本管理",
"道具管理",
"商城管理",
"日志管理",
"类型管理"
];
export default { actionList };

View File

@@ -1,84 +0,0 @@
import axios from 'axios'
import store from '../store/index'
import vm from '../main'
// import VuetifyDialogPlugin from 'vuetify-dialog/nuxt/index';
const myaxios = axios.create({
// baseURL:'/'//
baseURL: process.env.VUE_APP_BASE_API, // /dev-apis
timeout: 50000,
headers: {
'Authorization': 'Bearer ' + ""
},
})
// 请求拦截器
myaxios.interceptors.request.use(function(config) {
config.headers.Authorization = 'Bearer ' + store.state.user.token;
store.dispatch("openLoad");
return config;
}, function(error) {
return Promise.reject(error);
});
// 响应拦截器
myaxios.interceptors.response.use(async function(response) {
const resp = response.data
if (resp.code == undefined && resp.msg == undefined) {
vm.$dialog.notify.error("错误代码:无,原因:与服务器失去连接", {
position: "top-right",
timeout: 5000,
});
} else if (resp.code == 401) {
const res = await vm.$dialog.error({
text: `错误代码:${resp.code},原因:${resp.msg}<br>是否重新进行登录?`,
title: '错误',
actions: {
'false': '取消',
'true': '跳转'
}
});
if (res) {
vm.$router.push({ path: "/login" });
}
} else if (resp.code !== 200) {
vm.$dialog.notify.error(`错误代码:${resp.code},原因:${resp.msg}`, {
position: "top-right",
timeout: 5000,
});
}
store.dispatch("closeLoad");
return resp;
}, async function(error) {
const resp = error.response.data
if (resp.code == undefined && resp.msg == undefined) {
vm.$dialog.notify.error("错误代码:无,原因:与服务器失去连接", {
position: "top-right",
timeout: 5000,
});
} else if (resp.code == 401) {
const res = await vm.$dialog.error({
text: `错误代码:${resp.code},原因:${resp.msg}<br>是否重新进行登录?`,
title: '错误',
actions: {
'false': '取消',
'true': '跳转'
}
});
if (res) {
vm.$store.dispatch("Logout").then((resp) => {
vm.$router.push({ path: "/login" });
});
}
} else if (resp.code !== 200) {
vm.$dialog.notify.error(`错误代码:${resp.code},原因:${resp.msg}`, {
position: "top-right",
timeout: 5000,
});
}
store.dispatch("closeLoad");
return Promise.reject(error);
});
export default myaxios

View File

@@ -1,9 +0,0 @@
const myqqLogin = {
appId: "101951505",
redirectURI: "https://jiftcc.com/qq?state=0",
};
const myqqUpdate = {
appId: "101951505",
redirectURI: "https://jiftcc.com/qq?state=1",
};
export default { myqqLogin, myqqUpdate };

View File

@@ -1,75 +0,0 @@
// Imports
import { kebabCase } from 'lodash'
import { leadingSlash, trailingSlash } from '@/util/helpers'
export function abort(code = 404) {
return {
name: 'FourOhFour',
path: '*',
component: () => error(code),
}
}
export function error(code = 404) {
return import (
/* webpackChunkName: "error-[request]" */
`@/views/${code}.vue`
)
}
export function layout(layout = 'Default', children, path = '') {
const dir = kebabCase(layout)
return {
children,
component: () =>
import (
/* webpackChunkName: "layout-[request]" */
`@/layouts/${dir}/Index`
),
path,
}
}
export function redirect(
path = '*',
rhandler,
) {
if (typeof path === 'function') {
rhandler = path
path = '*'
}
return {
path,
redirect: to => {
const rpath = rhandler(to)
const url = rpath !== '' ?
leadingSlash(trailingSlash(rpath)) :
rpath
return `/${url}`
},
}
}
export function route(name, component, path = '') {
component = Object(component) === component ?
component : { default: name.replace(' ', '') }
const components = {}
for (const [key, value] of Object.entries(component)) {
components[key] = () =>
import (
/* webpackChunkName: "views-[request]" */
`@/views/${value}`
)
}
return {
name,
components,
path,
}
}

View File

@@ -1,34 +0,0 @@
//引入安装的signalr包
import * as signalR from '@microsoft/signalr'
const signal = new signalR.HubConnectionBuilder()    //服务器地址
.withUrl([process.env.VUE_APP_BASE_API] + '/chat', {})
.build()
/* const signalr = function () {
var hub
if (hub === undefined) {
hub = signal
}
return hub
} */
// 自动重连
// async function start() {
// try {
// await signal.start()
// console.log('connected')
// } catch (err) {
// console.log(err)
// setTimeout(() => start(), 5000)
// }
// }
// signal.onclose(async() => {
// await start()
// })
// //将创建的signal赋值给Vue实例
export default {
install: function(Vue) {
Vue.prototype.signalr = signal
}
}

View File

@@ -1,18 +0,0 @@
const TOKEN_KEY = "token_key"
const USER_KEY = "user_key"
export function getToken() {
return localStorage.getItem(TOKEN_KEY)
}
export function setToken(token) {
return localStorage.setItem(TOKEN_KEY, token)
}
export function getUser() {
return JSON.parse(localStorage.getItem(USER_KEY))
}
export function setUser(user) {
return localStorage.setItem(USER_KEY, JSON.stringify(user))
}
export function removeToken() {
localStorage.removeItem(TOKEN_KEY)
localStorage.removeItem(USER_KEY)
}

View File

@@ -1,25 +0,0 @@
<template>
<material-card color="primary" icon="mdi-account-outline">
<template #title>
菜单管理 <small class="text-body-1">菜单可分配一个接口</small>
</template>
<ccTreeview></ccTreeview>
</material-card>
</template>
<script>
export default {
created() {
},
data: () => ({
}),
methods: {
},
};
</script>

View File

@@ -1,39 +0,0 @@
<template>
<material-card color="primary" icon="mdi-account-outline">
<template #title>
接口管理 <small class="text-body-1">接口可被菜单拥有</small>
</template>
<ccTable
:defaultItem="defaultItem"
:headers="headers"
:axiosUrls="axiosUrls"
></ccTable>
</material-card>
</template>
<script>
import userApi from "../api/userApi"
export default {
created(){this.init()},
methods:{
init(){
userApi.GetAxiosByRouter(this.$route.path).then(resp=>{
this.axiosUrls=resp.data;
})
}
},
data: () => ({
axiosUrls: {
},
headers: [
{ text: "编号", align: "start", value: "id" },
{ text: "接口名", value: "mould_name", sortable: false },
{ text: "接口地址", value: "url", sortable: false },
{ text: "操作", value: "actions", sortable: false },
],
defaultItem: {
mould_name: "get",
url: "/get/gettest",
},
}),
};
</script>

View File

@@ -1,44 +0,0 @@
<template>
<material-card color="primary" icon="mdi-account-tie">
<template #title>
角色管理 <small class="text-body-1">角色可分配多个菜单</small>
</template>
<ccTable
:defaultItem="defaultItem"
:headers="headers"
:axiosUrls="axiosUrls"
>
</ccTable>
</material-card>
</template>
<script>
import userApi from "../api/userApi"
export default {
created() {
this.init();
},
methods: {
init() {
userApi.GetAxiosByRouter(this.$route.path).then(resp=>{
this.axiosUrls=resp.data;
})
}
},
data: () => ({
start: true,
axiosUrls: {
},
headers: [
{ text: "编号", align: "start", value: "id" },
{ text: "角色名", value: "role_name", sortable: false },
{ text: "简介", value: "introduce", sortable: false },
{ text: "操作", value: "actions", sortable: false },
],
defaultItem: {
role_name: "",
introduce: "",
},
}),
};
</script>

View File

@@ -1,120 +0,0 @@
<template>
<v-row>
<v-col cols="12">
<material-card color="primary" icon="mdi-account-outline">
<template #title>
角色菜单分配管理
<small class="text-body-1"
>你可以在这里多角色分配多菜单/选中一个可查看</small
> </template
>
<v-divider></v-divider>
<app-btn dark class="ma-4" @click="showAll"> 展开全部</app-btn>
<app-btn class="my-4 mr-4" @click="setMenu">确定分配</app-btn
>
<app-btn class="my-4" color="secondary" @click="clear">清空选择</app-btn></material-card
>
</v-col>
<v-col cols="12" md="4" lg="4">
<v-card class="mx-auto" width="100%">
<v-treeview
selectable
:items="RoleItems"
v-model="selectionRole"
return-object
open-all
hoverable
item-text="role_name"
>
</v-treeview>
</v-card>
</v-col>
<v-col cols="12" md="8" lg="8">
<v-card class="mx-auto" width="100%">
<v-treeview
ref="tree"
open-on-click
selectable
:items="Menuitems"
selection-type="independent"
v-model="selectionMenu"
return-object
open-all
hoverable
item-text="menu_name"
>
<template v-slot:append="{ item }">
<v-btn>id:{{ item.id }}</v-btn>
</template>
</v-treeview>
</v-card></v-col
>
</v-row>
</template>
<script>
import roleApi from "../api/roleApi";
import menuApi from "../api/menuApi";
export default {
created() {
this.init();
},
watch: {
selectionRole: {
handler(val, oldVal) {
if (val.length == 1) {
roleApi.GetTopMenusByRoleId(val[0].id).then((resp) => {
this.selectionMenu = resp.data;
});
}
},
deep: true,
},
},
methods: {
showAll(){
this.$refs.tree.updateAll(true);
},
clear() {
this.selectionMenu = [];
this.selectionRole = [];
},
setMenu() {
var roleIds = [];
var menuIds = [];
this.selectionRole.forEach((ele) => {
roleIds.push(ele.id);
});
this.selectionMenu.forEach((ele) => {
menuIds.push(ele.id);
});
roleApi.setMenuByRole(roleIds, menuIds).then((resp) => {
this.$dialog.notify.info(resp.msg, {
position: "top-right",
timeout: 5000,
});
});
},
init() {
roleApi.getRole().then((resp) => {
this.RoleItems = resp.data;
});
menuApi.GetMenuInMould().then((resp) => {
this.Menuitems = [resp.data];
});
},
},
data: () => ({
selectionMenu: [],
selectionRole: [],
RoleItems: [],
Menuitems: [],
}),
};
</script>

View File

@@ -1,121 +0,0 @@
<template>
<material-card color="primary" icon="mdi-account-outline">
<template #title>
用户管理 <small class="text-body-1">用户可拥有多个角色</small>
</template>
<ccCombobox
headers="设置角色"
:items="roleItems"
@select="getSelect"
itemText="role_name"
>
<template v-slot:save>
<v-btn @click="setRole" color="blue darken-1" text> 保存</v-btn>
</template>
</ccCombobox>
<ccTable
:defaultItem="defaultItem"
:headers="headers"
:axiosUrls="axiosUrls"
@selected="getTableSelect"
>
<template v-slot:action="{ item }">
<v-icon small class="mr-2" @click="showItem(item)"> mdi-eye </v-icon>
</template>
</ccTable>
</material-card>
</template>
<script>
import userApi from "../api/userApi";
import roleApi from "../api/roleApi";
export default {
created() {
this.init();
},
methods: {
async showItem(item) {
var strInfo = "";
roleApi.GetRolesByUserId(item.id).then(async (resp) => {
const roleData = resp.data;
strInfo += "拥有的角色:<br>";
roleData.forEach((u) => {
strInfo += u.role_name + "<br>";
});
strInfo += "<hr>";
Object.keys(item).forEach(async function (key) {
strInfo += key + ":" + item[key] + "<br>";
});
await this.$dialog.confirm({
text: strInfo,
title: "信息详情",
actions: {
true: "关闭",
},
});
});
},
init() {
userApi.GetAxiosByRouter(this.$route.path).then((resp) => {
this.axiosUrls = resp.data;
});
roleApi.getRole().then((resp) => {
this.roleItems = resp.data;
});
},
setRole() {
var userIds = [];
var roleIds = [];
this.TableSelect.forEach((item) => {
userIds.push(item.id);
});
this.select.forEach((item) => {
roleIds.push(item.id);
});
userApi.SetRoleByUser(userIds, roleIds).then((resp) => {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
});
},
getTableSelect(data) {
this.TableSelect = data;
},
getSelect(data) {
this.select = data;
},
},
data: () => ({
TableSelect: [],
select: [],
roleItems: [],
axiosUrls: {},
headers: [
{ text: "编号", align: "start", value: "id" },
{ text: "用户名", value: "username", sortable: false },
{ text: "密码", value: "password", sortable: false },
{ text: "图标", value: "icon", sortable: false },
{ text: "昵称", value: "nick", sortable: true },
{ text: "邮箱", value: "email", sortable: true },
{ text: "IP", value: "ip", sortable: false },
{ text: "年龄", value: "age", sortable: false },
{ text: "地址", value: "address", sortable: false },
{ text: "电话", value: "phone", sortable: false },
{ text: "操作", value: "actions", sortable: false },
],
defaultItem: {
username: "test",
password: "123",
icon: "mdi-lock",
nick: "橙子",
age: 18,
address: "中国",
phone: "",
},
}),
};
</script>

View File

@@ -1,442 +0,0 @@
<template>
<v-container
id="dashboard-view"
fluid
tag="section"
>
<v-row>
<v-col cols="12">
<v-row>
<v-col
v-for="(chart, i) in charts"
:key="`chart-${i}`"
cols="12"
md="6"
lg="4"
>
<material-chart-card
:color="chart.color"
:data="chart.data"
:options="chart.options"
:responsive-options="chart.responsiveOptions"
:title="chart.title"
:type="chart.type"
>
<template #subtitle>
<div class="font-weight-light text--secondary">
<div v-html="chart.subtitle" />
</div>
</template>
<template #actions>
<v-icon
class="mr-1"
small
>
mdi-clock-outline
</v-icon>
<span
class="text-caption grey--text font-weight-light"
v-text="chart.time"
/>
</template>
</material-chart-card>
</v-col>
</v-row>
</v-col>
<v-col
v-for="({ actionIcon, actionText, ...attrs }, i) in stats"
:key="i"
cols="12"
md="6"
lg="3"
>
<material-stat-card v-bind="attrs">
<template #actions>
<v-icon
class="mr-2"
small
v-text="actionIcon"
/>
<div class="text-truncate">
{{ actionText }}
</div>
</template>
</material-stat-card>
</v-col>
<v-col
cols="12"
md="6"
>
<material-card
color="orange"
full-header
>
<template #heading>
<div class="pa-8 white--text">
<div class="text-h4 font-weight-light">
Employees Stats
</div>
<div class="text-caption">
New employees on 15th September, 2016
</div>
</div>
</template>
<v-card-text>
<v-data-table
:headers="headers"
:items="items"
/>
</v-card-text>
</material-card>
</v-col>
<v-col
cols="12"
md="6"
>
<material-card
color="accent"
full-header
>
<template #heading>
<v-tabs
v-model="tabs"
background-color="transparent"
slider-color="white"
class="pa-8"
>
<span
class="subheading font-weight-light mx-3"
style="align-self: center"
>Tasks:</span>
<v-tab class="mr-3">
<v-icon class="mr-2">
mdi-bug
</v-icon>
Bugs
</v-tab>
<v-tab class="mr-3">
<v-icon class="mr-2">
mdi-code-tags
</v-icon>
Website
</v-tab>
<v-tab>
<v-icon class="mr-2">
mdi-cloud
</v-icon>
Server
</v-tab>
</v-tabs>
</template>
<v-tabs-items
v-model="tabs"
background-color="transparent"
>
<v-tab-item
v-for="n in 3"
:key="n"
>
<v-card-text>
<template v-for="(task, i) in tasks[tabs]">
<v-row
:key="i"
align="center"
class="flex-nowrap"
>
<v-col cols="1">
<v-list-item-action>
<v-simple-checkbox
v-model="task.value"
color="secondary"
/>
</v-list-item-action>
</v-col>
<v-col
class="font-weight-light"
cols="8"
v-text="task.text"
/>
<v-col
cols="auto"
class="text-right"
>
<v-icon class="mx-1">
mdi-pencil
</v-icon>
<v-icon
class="mx-1"
color="error"
>
mdi-close
</v-icon>
</v-col>
</v-row>
</template>
</v-card-text>
</v-tab-item>
</v-tabs-items>
</material-card>
</v-col>
</v-row>
</v-container>
</template>
<script>
// Utilities
// import { get } from 'vuex-pathify'
import Vue from 'vue'
const lineSmooth = Vue.chartist.Interpolation.cardinal({
tension: 0,
})
export default {
name: 'DashboardView',
data: () => ({
charts: [{
type: 'Bar',
color: 'primary',
title: 'Website Views',
subtitle: 'Last Campaign Performance',
time: 'updated 10 minutes ago',
data: {
labels: ['Ja', 'Fe', 'Ma', 'Ap', 'Mai', 'Ju', 'Jul', 'Au', 'Se', 'Oc', 'No', 'De'],
series: [
[542, 443, 320, 780, 553, 453, 326, 434, 568, 610, 756, 895],
],
},
options: {
axisX: {
showGrid: false,
},
low: 0,
high: 1000,
chartPadding: {
top: 0,
right: 5,
bottom: 0,
left: 0,
},
},
responsiveOptions: [
['screen and (max-width: 640px)', {
seriesBarDistance: 5,
axisX: {
labelInterpolationFnc: function (value) {
return value[0]
},
},
}],
],
}, {
type: 'Line',
color: 'success',
title: 'Daily Sales',
subtitle: '<i class="mdi mdi-arrow-up green--text"></i><span class="green--text">55%</span>&nbsp;increase in today\'s sales',
time: 'updated 4 minutes ago',
data: {
labels: ['12am', '3pm', '6pm', '9pm', '12pm', '3am', '6am', '9am'],
series: [
[230, 750, 450, 300, 280, 240, 200, 190],
],
},
options: {
lineSmooth,
low: 0,
high: 1000, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: {
top: 0,
right: 0,
bottom: 0,
left: 0,
},
},
}, {
type: 'Line',
color: 'info',
title: 'Completed Tasks',
subtitle: 'Last Campaign Performance',
time: 'campaign sent 26 minutes ago',
data: {
labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
series: [
[12, 17, 7, 17, 23, 18, 38],
],
},
options: {
lineSmooth,
low: 0,
high: 50, // creative tim: we recommend you to set the high sa the biggest value + something for a better look
chartPadding: {
top: 0,
right: 0,
bottom: 0,
left: 0,
},
},
}],
headers: [
{
sortable: false,
text: 'ID',
value: 'id',
},
{
sortable: false,
text: 'Name',
value: 'name',
},
{
sortable: false,
text: 'Salary',
value: 'salary',
align: 'right',
},
{
sortable: false,
text: 'Country',
value: 'country',
align: 'right',
},
{
sortable: false,
text: 'City',
value: 'city',
align: 'right',
},
],
items: [
{
id: 1,
name: 'Dakota Rice',
country: 'Niger',
city: 'Oud-Tunrhout',
salary: '$35,738',
},
{
id: 2,
name: 'Minerva Hooper',
country: 'Curaçao',
city: 'Sinaai-Waas',
salary: '$23,738',
},
{
id: 3,
name: 'Sage Rodriguez',
country: 'Netherlands',
city: 'Overland Park',
salary: '$56,142',
},
{
id: 4,
name: 'Philip Chanley',
country: 'Korea, South',
city: 'Gloucester',
salary: '$38,735',
},
{
id: 5,
name: 'Doris Greene',
country: 'Malawi',
city: 'Feldkirchen in Kārnten',
salary: '$63,542',
},
],
stats: [
{
actionIcon: 'mdi-alert',
actionText: 'Get More Space...',
color: '#FD9A13',
icon: 'mdi-sofa-single',
title: 'Bookings',
value: '184',
},
{
actionIcon: 'mdi-tag',
actionText: 'Tracked from Google Analytics',
color: 'primary',
icon: 'mdi-chart-bar',
title: 'Website Visits',
value: '75.521',
},
{
actionIcon: 'mdi-calendar-range',
actionText: 'Last 24 Hours',
color: 'success',
icon: 'mdi-store',
title: 'Revenue',
value: '$34,245',
},
{
actionIcon: 'mdi-history',
actionText: 'Just Updated',
color: 'info',
icon: 'mdi-twitter',
title: 'Followers',
value: '+245',
},
],
tabs: 0,
tasks: {
0: [
{
text: 'Sign contract for "What are conference organizers afraid of?"',
value: true,
},
{
text: 'Lines From Great Russian Literature? Or E-mails From My Boss?',
value: false,
},
{
text: 'Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit',
value: false,
},
{
text: 'Create 4 Invisible User Experiences you Never Knew About',
value: true,
},
],
1: [
{
text: 'Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit',
value: true,
},
{
text: 'Sign contract for "What are conference organizers afraid of?"',
value: false,
},
],
2: [
{
text: 'Lines From Great Russian Literature? Or E-mails From My Boss?',
value: false,
},
{
text: 'Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit',
value: true,
},
{
text: 'Sign contract for "What are conference organizers afraid of?"',
value: true,
},
],
},
}),
computed: {
// sales: get('sales/sales'),
// totalSales () {
// return this.sales.reduce((acc, val) => acc + val.salesInM, 0)
// },
},
}
</script>

View File

@@ -1,134 +0,0 @@
<template>
<v-card class="auth-card">
<!-- logo -->
<v-card-title class="d-flex align-center justify-center py-7">
<router-link to="/" class="d-flex align-center">
<v-img
:src="require('@/assets/logo.svg')"
max-height="30px"
max-width="30px"
alt="logo"
contain
class="me-3"
></v-img>
<h2 class="text-2xl font-weight-semibold">Yi-Framework</h2>
</router-link>
</v-card-title>
<!-- title -->
<v-card-text>
<p class="text-2xl font-weight-semibold text--primary mb-2">
欢迎来到CCNetCore! 👋🏻
</p>
<p class="mb-2">登入你的用户开始畅游一切</p>
</v-card-text>
<!-- login form -->
<v-card-text>
<v-form>
<v-text-field
v-model="form.username"
outlined
label="用户"
placeholder="123456789@qq.com"
counter="20"
></v-text-field>
<v-text-field
v-model="form.password"
outlined
:type="isPasswordVisible ? 'text' : 'password'"
label="密码"
placeholder="············"
:append-icon="isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'"
@click:append="isPasswordVisible = !isPasswordVisible"
></v-text-field>
<div class="d-flex align-center justify-space-between flex-wrap">
<v-checkbox label="记住密码" hide-details class="me-3 mt-1">
</v-checkbox>
<!-- forgot link -->
<a href="javascript:void(0)" class="mt-1"> 忘记密码? </a>
</div>
<v-btn block color="primary" @click="login" class="mt-6"> 登录 </v-btn>
</v-form>
</v-card-text>
<!-- create new account -->
<v-card-text class="d-flex align-center justify-center flex-wrap mt-2">
<span class="me-2"> 没有我们的账号? </span>
<router-link :to="{ path: '/register' }"> 注册账号 </router-link>
</v-card-text>
<!-- divider -->
<v-card-text class="d-flex align-center mt-2">
<v-divider></v-divider>
<span class="mx-5">or</span>
<v-divider></v-divider>
</v-card-text>
<!-- social links -->
<v-card-actions class="d-flex justify-center ">
<v-btn v-for="link in socialLink" :key="link.icon" icon class="ms-1">
<v-icon :color="$vuetify.theme.dark ? link.colorInDark : link.color">
{{ link.icon }}
</v-icon>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
export default {
data: () => ({
socialLink: [
{
icon: "mdi-qqchat",
color: "#8D5EE0",
colorInDark: "#8D5EE0",
},
{
icon: "mdi-facebook",
color: "#4267b2",
colorInDark: "#4267b2",
},
{
icon: "mdi-twitter",
color: "#1da1f2",
colorInDark: "#1da1f2",
},
{
icon: "mdi-github",
color: "#272727",
colorInDark: "#fff",
},
{
icon: "mdi-google",
color: "#db4437",
colorInDark: "#db4437",
},
],
isPasswordVisible: false,
form: {
username: "",
password: "",
},
}),
methods: {
login() {
this.$store.dispatch("Login", this.form).then((resp) => {
if (resp.status) {
this.$router.push("/");
} else {
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
});
},
},
};
</script>

View File

@@ -1,183 +0,0 @@
<template>
<v-card class="auth-card">
<!-- logo -->
<v-card-title class="d-flex align-center justify-center py-7">
<router-link to="/" class="d-flex align-center">
<v-img
:src="require('@/assets/logo.svg')"
max-height="30px"
max-width="30px"
alt="logo"
contain
class="me-3"
></v-img>
<h2 class="text-2xl font-weight-semibold">Yi-Framework</h2>
</router-link>
</v-card-title>
<!-- title -->
<v-card-text>
<p class="text-2xl font-weight-semibold text--primary mb-1">
注册-从这里开始 🚀
</p>
<p class="mb-1">加入我们获得一个有趣的灵魂</p>
</v-card-text>
<!-- login form -->
<v-card-text>
<v-form>
<v-text-field
v-model="form.username"
outlined
label="用户名"
placeholder="cc"
class="mb-1"
counter="20"
></v-text-field>
<v-text-field
v-model="form.phone"
outlined
label="电话"
placeholder="12345678901"
class="mb-1"
>
</v-text-field>
<v-row>
<v-col cols="9">
<v-text-field
v-model="code"
outlined
label="验证码"
placeholder="123456"
class="mb-1"
>
</v-text-field>
</v-col>
<v-col cols="3">
<v-btn color="secondary" @click="sendSMS" class="mb-1 mt-1" :disabled="is_en">验证码</v-btn>
</v-col>
</v-row>
<v-text-field
v-model="form.password"
outlined
:type="isPasswordVisible ? 'text' : 'password'"
label="密码"
placeholder="············"
:append-icon="isPasswordVisible ? 'mdi-eye' : 'mdi-eye-off'"
@click:append="isPasswordVisible = !isPasswordVisible"
></v-text-field>
<v-checkbox hide-details class="mt-1">
<template #label>
<div class="d-flex align-center flex-wrap">
<span class="me-2">我同意</span
><a href="javascript:void(0)">协议 &amp; 策略</a>
</div>
</template>
</v-checkbox>
<v-btn block color="primary" class="mt-6" @click="register">
注册
</v-btn>
</v-form>
</v-card-text>
<!-- create new account -->
<v-card-text class="d-flex align-center justify-center flex-wrap mt-2">
<span class="me-2"> 已经存在账号? </span>
<router-link :to="{ path: '/login' }"> 跳转登录 </router-link>
</v-card-text>
<!-- divider -->
<v-card-text class="d-flex align-center mt-2">
<v-divider></v-divider>
<span class="mx-5">or</span>
<v-divider></v-divider>
</v-card-text>
<!-- social link -->
<v-card-actions class="d-flex justify-center">
<v-btn v-for="link in socialLink" :key="link.icon" icon class="ms-1">
<v-icon :color="$vuetify.theme.dark ? link.colorInDark : link.color">
{{ link.icon }}
</v-icon>
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import accoutAPI from "../api/accountApi";
export default {
methods: {
sendSMS() {
this.is_en=true
accoutAPI.SendSMS(this.form.phone).then(resp=>{
if (resp.status) {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
});
},
register() {
accoutAPI
.register(
this.form.username,
this.form.password,
this.form.phone,
this.code
)
.then((resp) => {
if (resp.status) {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
this.$router.push("/login/");
}
});
},
},
data: () => ({
socialLink: [
{
icon: "mdi-qqchat",
color: "#8D5EE0",
colorInDark: "#8D5EE0",
},
{
icon: "mdi-facebook",
color: "#4267b2",
colorInDark: "#4267b2",
},
{
icon: "mdi-twitter",
color: "#1da1f2",
colorInDark: "#1da1f2",
},
{
icon: "mdi-github",
color: "#272727",
colorInDark: "#fff",
},
{
icon: "mdi-google",
color: "#db4437",
colorInDark: "#db4437",
},
],
isPasswordVisible: false,
code: "",
is_en:false,
form: {
phone: "",
username: "",
password: "",
},
}),
};
</script>

View File

@@ -1,348 +0,0 @@
<template>
<v-container id="user-profile-view" fluid tag="section">
<v-row justify="center">
<v-col cols="12" md="4">
<app-card class="mt-4 text-center">
<ccAvatar :size="128" class="rounded-circle elevation-6 mt-n12 d-inline-block"></ccAvatar>
<v-card-text class="text-center">
<h6 class="text-h6 mb-2 text--secondary">
{{ userInfo.username }}
</h6>
<h4 class="text-h4 mb-3 text--primary">{{ userInfo.nick }}</h4>
<p class="text--secondary">{{ userInfo.introduction }}</p>
<input
type="file"
ref="imgFile"
@change="uploadImage()"
class="d-none"
/>
<v-btn class="mr-4" @click="choiceImg" color="primary" min-width="100" rounded>
编辑头像
</v-btn>
<v-btn color="primary" min-width="100" rounded> 绑定QQ </v-btn>
</v-card-text>
</app-card>
</v-col>
<v-col cols="12" md="8">
<material-card color="primary" icon="mdi-account-outline">
<template #title>
用户信息 <small class="text-body-1">编辑属于你的一切</small>
</template>
<v-form>
<v-tabs class="pl-4" v-model="tab">
<v-tab href="#tab-1">
账户信息
<v-icon>mdi-phone</v-icon>
</v-tab>
<v-tab href="#tab-2">
额外信息
<v-icon>mdi-account-box</v-icon>
</v-tab>
<v-tab href="#tab-3">
修改密码
<v-icon>mdi-account-box</v-icon>
</v-tab>
</v-tabs>
<v-tabs-items v-model="tab">
<v-tab-item :value="'tab-1'">
<v-card class="py-0">
<v-card-text>
<div>Account Information</div>
<v-row>
<v-col cols="12" md="4">
<v-text-field
color="purple"
label="用户名"
v-model="editInfo.username"
disabled
/>
</v-col>
<v-col cols="12" md="4">
<v-text-field
color="purple"
label="昵称"
v-model="editInfo.nick"
/>
</v-col>
<v-col cols="12" md="4">
<v-text-field
color="purple"
label="邮箱"
v-model="editInfo.email"
/>
</v-col>
<v-col cols="12" md="6">
<v-text-field
color="purple"
label="住址"
v-model="editInfo.address"
/>
</v-col>
<v-col cols="12" md="6">
<v-text-field
color="purple"
label="电话"
type="number"
v-model="editInfo.phone"
/>
</v-col>
<v-col cols="12">
<v-textarea
v-model="editInfo.introduction"
color="purple"
label="简介"
value="空空如也Ta什么也没有留下"
/>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item :value="'tab-2'">
<v-card class="py-0 mx-auto">
<v-card-text>
<div>Extra Information</div>
<v-row>
<v-col cols="12">
<v-list two-line>
<v-list-item>
<v-list-item-icon>
<v-icon color="secondary"> mdi-phone </v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>等级</v-list-item-title>
<v-list-item-subtitle>100</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-icon>
<v-icon>mdi-message-text</v-icon>
</v-list-item-icon>
</v-list-item>
<v-list-item>
<v-list-item-action></v-list-item-action>
<v-list-item-content>
<v-list-item-title>经验</v-list-item-title>
<v-list-item-subtitle>1000</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-icon>
<v-icon>mdi-message-text</v-icon>
</v-list-item-icon>
</v-list-item>
<v-divider inset></v-divider>
<v-list-item>
<v-list-item-icon>
<v-icon color="secondary"> mdi-lock </v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>拥有角色</v-list-item-title>
<v-list-item-subtitle>
<v-row>
<v-col
v-for="item in editInfo.roles"
:key="item.id"
cols="6"
sm="3"
md="1"
>{{ item.role_name }}</v-col
>
</v-row>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item>
<v-list-item-action></v-list-item-action>
<v-list-item-content>
<v-list-item-title>拥有菜单</v-list-item-title>
<v-list-item-subtitle>
<v-row>
<v-col
v-for="item in menuInfo"
:key="item.id"
cols="6"
sm="3"
md="1"
>{{ item.menu_name }}</v-col
>
</v-row>
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-divider inset></v-divider>
<v-list-item>
<v-list-item-icon>
<v-icon color="secondary"> mdi-email </v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>等待更新</v-list-item-title>
<v-list-item-subtitle>1000</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item>
<v-list-item-action></v-list-item-action>
<v-list-item-content>
<v-list-item-title>等待更新</v-list-item-title>
<v-list-item-subtitle>500</v-list-item-subtitle>
</v-list-item-content>
</v-list-item>
<v-list-item>
<v-list-item-action></v-list-item-action>
<v-list-item-content>
<v-btn dark color="primary" class="ml-0" dense>
等待更新
</v-btn>
</v-list-item-content>
</v-list-item>
<v-divider inset></v-divider>
</v-list>
</v-col>
</v-row>
</v-card-text>
</v-card>
</v-tab-item>
<v-tab-item :value="'tab-3'">
<v-card>
<v-card-text>
<div>Password Information</div>
<v-col cols="12">
<v-text-field
style="width: 80%"
label="原密码"
v-model="editInfo.password"
outlined
clearable
></v-text-field>
<v-text-field
required
style="width: 80%"
:counter="120"
v-model="newPassword"
:disabled="dis_newPassword"
label="新密码"
></v-text-field>
</v-col>
</v-card-text>
</v-card>
</v-tab-item>
</v-tabs-items>
<v-col cols="12" class="text-right">
<v-btn color="primary" class="ma-4" min-width="100"> 清空 </v-btn>
<v-btn color="secondary" @click="save()" min-width="100">
保存
</v-btn>
</v-col>
</v-form>
</material-card>
</v-col>
</v-row>
</v-container>
</template>
<script>
import fileApi from "../api/fileApi";
import userApi from "../api/userApi";
import menuApi from "../api/menuApi";
import accountApi from "../api/accountApi";
export default {
name: "UserProfileView",
data: () => ({
tab: "tab-1",
userInfo: {},
editInfo: {},
newPassword: "",
dis_newPassword: true,
menuInfo: [],
}),
created() {
this.init();
},
watch: {
editInfo: {
handler(val, oldVal) {
if (val.password.length > 0) {
this.dis_newPassword = false;
} else {
this.dis_newPassword = true;
}
},
deep: true, //true 深度监听
},
},
methods: {
save() {
accountApi
.changePassword(this.editInfo, this.newPassword)
.then((resp) => {
if (resp.status) {
this.$dialog.notify.error(resp.msg, {
position: "top-right",
timeout: 5000,
});
} else {
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
}
this.init();
});
},
init() {
this.newPassword = "";
userApi.GetUserInRolesByHttpUser().then((resp) => {
this.userInfo = resp.data;
this.userInfo.password = "";
this.editInfo = Object.assign({}, this.userInfo);
this.$store.commit('SET_USER',this.userInfo)
});
menuApi.GetTopMenusByHttpUser().then((resp) => {
this.menuInfo = resp.data;
});
},
choiceImg() {
this.$refs.imgFile.dispatchEvent(new MouseEvent("click"));
},
uploadImage() {
const file = this.$refs.imgFile.files[0];
let formData = new FormData();
formData.append("file", file);
fileApi.EditIcon(formData).then(resp=>{
this.init();
this.$dialog.notify.success(resp.msg, {
position: "top-right",
timeout: 5000,
});
})
},
},
};
</script>

View File

@@ -1,23 +0,0 @@
module.exports = {
// publicPath: './',
transpileDependencies: [
'vuetify'
],
devServer: {
port: 6789,
open: true,
https: false,
host: "localhost",
proxy: {
[process.env.VUE_APP_BASE_API]: {
target: process.env.VUE_APP_SERVICE_URL,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''
}
},
}
},
lintOnSave: false, //关闭格式检查
productionSourceMap: false
}

Some files were not shown because too many files have changed in this diff Show More