Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad0f174996 | ||
|
|
45874b17ee | ||
|
|
d7d7e554ee | ||
|
|
8835721924 | ||
|
|
4748a286db |
@@ -40,7 +40,6 @@ Pear Admin Flask 基于 Flask 生态的后台管理系统,该项目旨在为 p
|
||||
+ [flask](https://dormousehole.readthedocs.io/en/latest/)
|
||||
+ [flask-login](https://flask-login.readthedocs.io/en/latest/)
|
||||
+ [flask-sqlalchemy](http://www.pythondoc.com/flask-sqlalchemy/quickstart.html)
|
||||
+ [flask-restful](https://flask-restful.readthedocs.io/en/latest/)
|
||||
|
||||
|
||||
## 预览
|
||||
@@ -52,7 +51,7 @@ Pear Admin Flask 有以下几个版本:
|
||||
|
||||
[Mini 分支版本 ](https://gitee.com/pear-admin/pear-admin-flask/tree/mini/)
|
||||
|
||||
>flask 2.x + flask-sqlalchemy + Flask-restful + 基于角色的权限管理
|
||||
>flask 2.x + flask-sqlalchemy + 基于角色的权限管理
|
||||
|
||||
| | |
|
||||
|---------------------|---------------------|
|
||||
@@ -80,9 +79,6 @@ Pear Admin Flask 有以下几个版本:
|
||||
```bash
|
||||
git clone https://gitee.com/pear-admin/pear-admin-flask
|
||||
|
||||
# 进入 pear-admin-flask 代码根目录
|
||||
cd pear-admin-flask
|
||||
|
||||
# 切换分支
|
||||
git checkout mini
|
||||
```
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
import typing as t
|
||||
|
||||
from flask import jsonify
|
||||
from flask.views import MethodView
|
||||
from flask_pydantic import validate
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from common.utils.http import success_api, fail_api
|
||||
from common.utils.http import success_api, fail_api, table_api
|
||||
from extensions import db
|
||||
from models import DepartmentModel, UserModel
|
||||
|
||||
|
||||
class DeptModel(BaseModel):
|
||||
class DeptSchema(BaseModel):
|
||||
address: t.Optional[str]
|
||||
dept_name: t.Optional[str] = Field(alias='deptName')
|
||||
email: t.Optional[str]
|
||||
@@ -39,10 +38,9 @@ class DepartmentsApi(MethodView):
|
||||
return dict(success=True, message='ok', dept=dept_data)
|
||||
|
||||
dept_data = DepartmentModel.query.order_by(DepartmentModel.sort).all()
|
||||
# TODO dtree 需要返回状态信息
|
||||
res = {
|
||||
"status": {"code": 200, "message": "默认"},
|
||||
"data": [
|
||||
return table_api(
|
||||
result={
|
||||
'items': [
|
||||
{
|
||||
'deptId': item.id,
|
||||
'parentId': item.parent_id,
|
||||
@@ -56,12 +54,12 @@ class DepartmentsApi(MethodView):
|
||||
'address': item.address,
|
||||
'create_at': item.create_at.strftime('%Y-%m-%d %H:%M:%S')
|
||||
} for item in dept_data
|
||||
]
|
||||
}
|
||||
return jsonify(res)
|
||||
],
|
||||
'total': len(dept_data)}
|
||||
, code=0)
|
||||
|
||||
@validate()
|
||||
def post(self, body: DeptModel):
|
||||
def post(self, body: DeptSchema):
|
||||
dept = DepartmentModel(
|
||||
parent_id=body.parent_id,
|
||||
dept_name=body.dept_name,
|
||||
@@ -78,7 +76,7 @@ class DepartmentsApi(MethodView):
|
||||
return success_api(message="成功")
|
||||
|
||||
@validate()
|
||||
def put(self, _id, body: DeptModel):
|
||||
def put(self, _id, body: DeptSchema):
|
||||
data = {
|
||||
"dept_name": body.dept_name,
|
||||
"sort": body.sort,
|
||||
@@ -90,9 +88,9 @@ class DepartmentsApi(MethodView):
|
||||
}
|
||||
body = DepartmentModel.query.filter_by(id=_id).update(data)
|
||||
if not body:
|
||||
return fail_api(message="更新失败")
|
||||
return {'success': False, 'message': "更新失败", 'code': 404}
|
||||
db.session.commit()
|
||||
return success_api(message="更新成功")
|
||||
return {'success': True, 'message': '更新成功', 'code': 200}
|
||||
|
||||
def delete(self, _id):
|
||||
ret = DepartmentModel.query.filter_by(id=_id).delete()
|
||||
|
||||
@@ -147,7 +147,7 @@ def make_menu_tree():
|
||||
return sorted(menu_dict.get(0), key=lambda item: item['sort'])
|
||||
|
||||
|
||||
class PowerModel(BaseModel):
|
||||
class PowerSchema(BaseModel):
|
||||
icon: str
|
||||
open_type: Optional[str] = Field(alias='openType')
|
||||
parent_id: Optional[str] = Field(alias='parentId')
|
||||
@@ -199,7 +199,7 @@ class RightsApi(MethodView):
|
||||
|
||||
class PowerApi(MethodView):
|
||||
@validate()
|
||||
def post(self, body: PowerModel):
|
||||
def post(self, body: PowerSchema):
|
||||
power = RightModel(
|
||||
icon=body.icon,
|
||||
open_type=body.open_type,
|
||||
@@ -239,7 +239,7 @@ class PowerApi(MethodView):
|
||||
return fail_api(message="删除失败")
|
||||
|
||||
@validate()
|
||||
def put(self, _id, body: PowerModel):
|
||||
def put(self, _id, body: PowerSchema):
|
||||
data = {
|
||||
"icon": body.icon,
|
||||
"open_type": body.open_type,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
from flask import Blueprint
|
||||
|
||||
from common import register_api
|
||||
from .file import FilePhotoAPI
|
||||
from .passport import LoginAPI
|
||||
@@ -7,4 +5,4 @@ from .passport import LoginAPI
|
||||
|
||||
def register_sys_api(api_bp):
|
||||
register_api(LoginAPI, 'login_api', '/passport/login', pk='_id', app=api_bp)
|
||||
register_api(FilePhotoAPI, 'photo_api', '/file/photo/', pk='photo_id', app=api_bp)
|
||||
register_api(FilePhotoAPI, 'photo_api', '/file/photo', pk='photo_id', app=api_bp)
|
||||
|
||||
@@ -11,7 +11,7 @@ from common.utils.rights import record_logging
|
||||
from models import UserModel
|
||||
|
||||
|
||||
class LoginModel(BaseModel):
|
||||
class LoginSchema(BaseModel):
|
||||
username: str
|
||||
password: str
|
||||
captcha: str
|
||||
@@ -25,7 +25,7 @@ class LoginAPI(MethodView):
|
||||
return make_response(render_template('index/login.html'))
|
||||
|
||||
@validate()
|
||||
def post(self, body: LoginModel):
|
||||
def post(self, body: LoginSchema):
|
||||
s_code = session.get("code", None)
|
||||
session["code"] = None
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ def users_delete():
|
||||
return success_api(message="批量删除成功")
|
||||
|
||||
|
||||
class QueryModel(BaseModel):
|
||||
class QuerySchema(BaseModel):
|
||||
page: int = 1
|
||||
limit: int = 10
|
||||
real_name: t.Optional[str] = Field(alias='realName')
|
||||
@@ -78,7 +78,7 @@ class QueryModel(BaseModel):
|
||||
status: t.Optional[int]
|
||||
|
||||
|
||||
class PersonModel(BaseModel):
|
||||
class PersonSchema(BaseModel):
|
||||
role_ids: str = Field(alias='roleIds')
|
||||
username: str
|
||||
real_name: str = Field(alias='realName')
|
||||
@@ -89,7 +89,7 @@ class UserApi(MethodView):
|
||||
"""修改用户数据"""
|
||||
|
||||
@validate()
|
||||
def get(self, _id, query: QueryModel):
|
||||
def get(self, _id, query: QuerySchema):
|
||||
|
||||
filters = []
|
||||
|
||||
@@ -123,7 +123,7 @@ class UserApi(MethodView):
|
||||
)
|
||||
|
||||
@validate()
|
||||
def post(self, body: PersonModel):
|
||||
def post(self, body: PersonSchema):
|
||||
"""新建单个用户"""
|
||||
|
||||
role_ids = body.role_ids.split(',')
|
||||
|
||||
@@ -3,11 +3,12 @@ from flask import Flask
|
||||
from .index import index_bp
|
||||
from .logs_view import logs_bp
|
||||
from .roles import role_bp
|
||||
from .system_view import system_bp
|
||||
from .document_view import document_bp
|
||||
|
||||
from . import department
|
||||
from . import file
|
||||
from . import rights
|
||||
from . import passport
|
||||
from . import users
|
||||
|
||||
|
||||
@@ -15,3 +16,5 @@ def init_view(app: Flask):
|
||||
app.register_blueprint(index_bp)
|
||||
app.register_blueprint(logs_bp)
|
||||
app.register_blueprint(role_bp)
|
||||
app.register_blueprint(system_bp)
|
||||
app.register_blueprint(document_bp)
|
||||
|
||||
@@ -5,18 +5,11 @@ from common.utils.rights import permission_required, view_logging_required
|
||||
from applications.view import index_bp
|
||||
|
||||
|
||||
@index_bp.get('/dept')
|
||||
@view_logging_required
|
||||
@permission_required("admin:dept:main")
|
||||
def dept_index():
|
||||
return render_template('admin/department/dept.html')
|
||||
|
||||
|
||||
@index_bp.get('/dept/add')
|
||||
@view_logging_required
|
||||
@permission_required("admin:dept:add")
|
||||
def add():
|
||||
return render_template('admin/department/dept_add.html')
|
||||
return render_template('view/system/department_add.html')
|
||||
|
||||
|
||||
@index_bp.get('/dept/edit')
|
||||
@@ -25,4 +18,4 @@ def add():
|
||||
def edit():
|
||||
dept_id = request.args.get("deptId", type=int)
|
||||
dept = DepartmentModel.query.get(dept_id)
|
||||
return render_template('admin/department/dept_edit.html', dept=dept)
|
||||
return render_template('view/system/department_edit.html', dept=dept)
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
document_bp = Blueprint('document', __name__)
|
||||
|
||||
|
||||
@document_bp.route('/component/code/index.html')
|
||||
def component_code():
|
||||
return render_template('component/code/index.html')
|
||||
|
||||
|
||||
@document_bp.route('/view/<document>/<file>')
|
||||
def document_view(document, file):
|
||||
return render_template(f'view/{document}/{file}')
|
||||
|
||||
|
||||
@document_bp.get('/login.html')
|
||||
def login_html():
|
||||
return render_template('login.html')
|
||||
@@ -8,11 +8,11 @@ from common.utils.rights import view_logging_required, permission_required
|
||||
@view_logging_required
|
||||
@permission_required("admin:file:main")
|
||||
def file_index():
|
||||
return render_template('admin/file/photo.html')
|
||||
return render_template('view/system/photo.html')
|
||||
|
||||
|
||||
@index_bp.get('/file/photo/add')
|
||||
@view_logging_required
|
||||
@permission_required("admin:file:main")
|
||||
def file_photo_add():
|
||||
return render_template('admin/file/photo_add.html')
|
||||
return render_template('view/system/photo_add.html')
|
||||
|
||||
@@ -1,24 +1,78 @@
|
||||
from flask import Blueprint
|
||||
from flask import render_template
|
||||
from flask_login import login_required, current_user
|
||||
from flask import Blueprint, redirect, url_for
|
||||
from flask import send_file
|
||||
from flask import session, render_template
|
||||
from flask_login import current_user, logout_user, login_required
|
||||
|
||||
from common.gen_captcha import get_captcha_image
|
||||
|
||||
index_bp = Blueprint('index', __name__)
|
||||
|
||||
|
||||
@index_bp.route('/')
|
||||
@index_bp.route('/admin')
|
||||
@login_required
|
||||
def index():
|
||||
return render_template('index/index.html')
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
# 首页
|
||||
@index_bp.get('/admin/')
|
||||
@index_bp.route('/config/pear.config.json')
|
||||
def pear_config():
|
||||
return send_file('static/config/pear.config.json')
|
||||
|
||||
|
||||
@index_bp.route('/admin/data/menu.json')
|
||||
def menu():
|
||||
return send_file('static/admin/data/menu.json')
|
||||
|
||||
|
||||
@index_bp.route('/admin/data/message.json')
|
||||
def message():
|
||||
return send_file('static/admin/data/message.json')
|
||||
|
||||
|
||||
@index_bp.route('/view/console/console1.html')
|
||||
def console1():
|
||||
# 控制后台
|
||||
return render_template('view/console/console1.html')
|
||||
|
||||
|
||||
@index_bp.route('/view/console/console2.html')
|
||||
def console2():
|
||||
# 数据分析
|
||||
return render_template('view/console/console2.html')
|
||||
|
||||
|
||||
@index_bp.route('/view/system/theme.html')
|
||||
def theme():
|
||||
# 酸爽翻倍
|
||||
return render_template('view/system/theme.html')
|
||||
|
||||
|
||||
@index_bp.route('/view/document/core.html')
|
||||
def core():
|
||||
# 酸爽翻倍
|
||||
return render_template('view/document/core.html')
|
||||
|
||||
|
||||
@index_bp.get('/passport/getCaptcha')
|
||||
def get_captcha():
|
||||
resp, code = get_captcha_image()
|
||||
session["code"] = code
|
||||
return resp
|
||||
|
||||
|
||||
# 退出登录
|
||||
@index_bp.post('/logout')
|
||||
@login_required
|
||||
def admin_index():
|
||||
return render_template('index/admin_index.html', user=current_user)
|
||||
def logout():
|
||||
logout_user()
|
||||
session.pop('permissions')
|
||||
print({"message": "注销成功", "success": True})
|
||||
return {"message": "注销成功", "success": True}
|
||||
|
||||
|
||||
# 控制台页面
|
||||
@index_bp.get('/admin/welcome')
|
||||
@login_required
|
||||
def welcome():
|
||||
return render_template('index/welcome.html')
|
||||
@index_bp.get('/login')
|
||||
def login():
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('admin.index'))
|
||||
return render_template('login.html')
|
||||
|
||||
@@ -8,12 +8,6 @@ from models import LogModel
|
||||
logs_bp = Blueprint('logs', __name__, url_prefix='/logs')
|
||||
|
||||
|
||||
@logs_bp.get('/')
|
||||
@permission_required("admin:log:main")
|
||||
def index():
|
||||
return render_template('admin/logs_temp/main.html')
|
||||
|
||||
|
||||
@logs_bp.get('/login_log')
|
||||
@permission_required("admin:log:main")
|
||||
def login_log():
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
from flask import session, redirect, render_template, url_for
|
||||
from flask_login import login_required, logout_user, current_user
|
||||
|
||||
from common.gen_captcha import get_captcha_image
|
||||
from common.utils.http import success_api
|
||||
|
||||
# 获取验证码
|
||||
from applications.view import index_bp
|
||||
|
||||
|
||||
@index_bp.get('/passport/getCaptcha')
|
||||
def get_captcha():
|
||||
resp, code = get_captcha_image()
|
||||
session["code"] = code
|
||||
return resp
|
||||
|
||||
|
||||
# 退出登录
|
||||
@index_bp.post('/passport/logout')
|
||||
@login_required
|
||||
def logout():
|
||||
logout_user()
|
||||
session.pop('permissions')
|
||||
return success_api(message="注销成功")
|
||||
|
||||
|
||||
@index_bp.get('/passport/login')
|
||||
def login():
|
||||
if current_user.is_authenticated:
|
||||
return redirect(url_for('admin.index'))
|
||||
# TODO 分离视图操作 最终实现接口登录与视图登录两套逻辑
|
||||
return render_template('index/login.html')
|
||||
@@ -5,13 +5,6 @@ from models import RightModel
|
||||
from applications.view import index_bp
|
||||
|
||||
|
||||
@index_bp.get('/rights/')
|
||||
@view_logging_required
|
||||
@permission_required("admin:power:main")
|
||||
def rights_index():
|
||||
return render_template('admin/rights/rights.html')
|
||||
|
||||
|
||||
@index_bp.get('/rights/power/<int:power_id>')
|
||||
@view_logging_required
|
||||
@permission_required("admin:power:edit")
|
||||
@@ -22,11 +15,11 @@ def rights_edit(power_id):
|
||||
icon = icon[1]
|
||||
else:
|
||||
icon = None
|
||||
return render_template('admin/rights/rights_edit.html', power=power, icon=icon)
|
||||
return render_template('view/system/power_edit.html', power=power, icon=icon)
|
||||
|
||||
|
||||
@index_bp.get('/rights/add')
|
||||
@view_logging_required
|
||||
@permission_required("admin:power:main")
|
||||
def rights_add():
|
||||
return render_template('admin/rights/rights_add.html')
|
||||
return render_template('view/system/power_add.html')
|
||||
|
||||
@@ -7,20 +7,12 @@ from models import RoleModel
|
||||
role_bp = Blueprint('role', __name__, url_prefix='/admin/role')
|
||||
|
||||
|
||||
# 角色而管理
|
||||
@role_bp.get('/')
|
||||
@view_logging_required
|
||||
@permission_required("admin:role:main")
|
||||
def main():
|
||||
return render_template('admin/roles/roles.html')
|
||||
|
||||
|
||||
# 角色授权操作
|
||||
@role_bp.get('/power/<int:role_id>')
|
||||
@view_logging_required
|
||||
@permission_required("admin:role:power")
|
||||
def power(role_id):
|
||||
return render_template('admin/roles/roles_power.html', role_id=role_id)
|
||||
return render_template('view/system/roles_power.html', role_id=role_id)
|
||||
|
||||
|
||||
# 角色编辑
|
||||
@@ -29,11 +21,11 @@ def power(role_id):
|
||||
@permission_required("admin:role:edit")
|
||||
def role_editor(role_id):
|
||||
role = RoleModel.query.filter_by(id=role_id).first()
|
||||
return render_template('admin/roles/roles_edit.html', role=role)
|
||||
return render_template('view/system/roles_edit.html', role=role)
|
||||
|
||||
|
||||
@role_bp.get('/add')
|
||||
@view_logging_required
|
||||
@permission_required("admin:role:edit")
|
||||
def role_add():
|
||||
return render_template('admin/roles/roles_add.html')
|
||||
return render_template('view/system/roles_add.html')
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
from flask import Blueprint, render_template
|
||||
|
||||
system_bp = Blueprint('system', __name__)
|
||||
|
||||
|
||||
@system_bp.route('/view/system/user.html')
|
||||
def system_user():
|
||||
return render_template('view/system/user.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/role.html')
|
||||
def system_role():
|
||||
return render_template('view/system/role.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/power.html')
|
||||
def system_power():
|
||||
return render_template('view/system/power.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/department.html')
|
||||
def system_department():
|
||||
return render_template('view/system/department.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/log.html')
|
||||
def system_log():
|
||||
return render_template('view/system/log.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/dict.html')
|
||||
def system_dict():
|
||||
return render_template('view/system/dict.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/operate/add.html')
|
||||
def system_operate_add():
|
||||
return render_template('view/system/operate/add.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/operate/edit.html')
|
||||
def system_operate_edit():
|
||||
return render_template('view/system/operate/edit.html')
|
||||
|
||||
|
||||
@system_bp.route('/view/system/operate/profile.html')
|
||||
def system_operate_profile():
|
||||
return render_template('view/system/operate/profile.html')
|
||||
@@ -1,26 +1,16 @@
|
||||
from flask import render_template
|
||||
from flask_login import login_required, current_user
|
||||
from sqlalchemy import desc
|
||||
|
||||
from common.utils.rights import permission_required, view_logging_required
|
||||
from models import LogModel, RoleModel, UserModel
|
||||
from models import RoleModel, UserModel
|
||||
from . import index_bp
|
||||
|
||||
|
||||
# 用户增加
|
||||
@index_bp.get('/users/')
|
||||
@view_logging_required
|
||||
@permission_required("admin:user:main")
|
||||
def users_main():
|
||||
return render_template('admin/users/users.html')
|
||||
|
||||
|
||||
@index_bp.get('/users/add')
|
||||
@view_logging_required
|
||||
@permission_required("admin:user:add")
|
||||
def users_add_view():
|
||||
roles = RoleModel.query.all()
|
||||
return render_template('admin/users/users_add.html', roles=roles)
|
||||
return render_template('view/system/user_add.html', roles=roles)
|
||||
|
||||
|
||||
@index_bp.get('/users/<user_id>')
|
||||
@@ -33,17 +23,4 @@ def users_user_id_view(user_id):
|
||||
checked_roles = []
|
||||
for r in user.role:
|
||||
checked_roles.append(r.id)
|
||||
return render_template('admin/users/users_edit.html', user=user, roles=roles, checked_roles=checked_roles)
|
||||
|
||||
|
||||
@index_bp.get('/users/center')
|
||||
@login_required
|
||||
def users_center():
|
||||
user_logs = LogModel.query.filter_by(url='/passport/login').filter_by(uid=current_user.id).order_by(
|
||||
desc(LogModel.create_at)).limit(10)
|
||||
return render_template('admin/users/profile.html', user_info=current_user, user_logs=user_logs)
|
||||
|
||||
|
||||
@index_bp.get('/users/avatar')
|
||||
def users_avatar_view():
|
||||
return render_template('admin/users/profile_avatar.html')
|
||||
return render_template('view/system/user_edit.html', user=user, roles=roles, checked_roles=checked_roles)
|
||||
|
||||
@@ -24,7 +24,7 @@ SYSTEM_PANEL_LINKS = [
|
||||
SECRET_KEY = os.getenv('SECRET_KEY', 'dev key')
|
||||
|
||||
# mysql 配置
|
||||
MYSQL_USERNAME = "root"
|
||||
MYSQL_USERNAME = "windows"
|
||||
MYSQL_PASSWORD = "123456"
|
||||
MYSQL_HOST = "127.0.0.1"
|
||||
MYSQL_PORT = 3306
|
||||
@@ -39,8 +39,7 @@ SQLALCHEMY_DATABASE_URI = r'sqlite:///pear_admin.db'
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = True
|
||||
SQLALCHEMY_ECHO = False
|
||||
SQLALCHEMY_POOL_RECYCLE = 8
|
||||
# SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@\
|
||||
# {MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}"
|
||||
# SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_USERNAME}:{MYSQL_PASSWORD}@{MYSQL_HOST}:{MYSQL_PORT}/{MYSQL_DATABASE}"
|
||||
|
||||
LOG_LEVEL = logging.ERROR
|
||||
|
||||
|
||||
@@ -32,6 +32,22 @@ class RightModel(db.Model):
|
||||
|
||||
parent = db.relationship("RightModel", remote_side=[id]) # 自关联
|
||||
|
||||
"""
|
||||
id = db.Column(db.Integer, primary_key=True, comment='权限编号')
|
||||
powerName = db.Column(db.String(255), comment='权限名称')
|
||||
powerType = db.Column(db.SMALLINT, comment='权限类型')
|
||||
powerCode = db.Column(db.String(30), comment='权限标识')
|
||||
powerUrl = db.Column(db.String(255), comment='权限路径')
|
||||
openType = db.Column(db.String(10), comment='打开方式')
|
||||
parentId = db.Column(db.Integer, db.ForeignKey("rt_power.id"), comment='父类编号')
|
||||
icon = db.Column(db.String(128), comment='图标')
|
||||
sort = db.Column(db.Integer, comment='排序')
|
||||
enable = db.Column(db.Boolean, comment='是否开启')
|
||||
checkArr = db.Column(db.String(128), comment='')
|
||||
|
||||
parent = db.relationship("RightModel", remote_side=[id]) # 自关联
|
||||
"""
|
||||
|
||||
|
||||
class RoleModel(db.Model):
|
||||
__tablename__ = 'rt_role'
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
.pear-container {background-color: whitesmoke;margin: 10px;}
|
||||
.pear-card {width: 100%;height: 66px;background-color: #F8F8F8;display: inline-block;border-radius: 5px;text-align: center;margin-bottom: 3px;}
|
||||
.pear-card:hover,.pear-card2:hover{box-shadow: 2px 0 8px 0 lightgray!important;}.pear-card2 {width: 100%;height: 90px;background-color: #F8F8F8;display: inline-block;border-radius: 5px;text-align: center;margin-bottom: 3px;}
|
||||
.pear-card2 i {font-size: 30px;height: 90px;line-height: 90px;}
|
||||
.pear-card i {font-size: 30px;height: 66px;line-height: 66px;}
|
||||
.layui-col-md3 {text-align: center;}
|
||||
.pear-card-title {margin-top: 3px;}
|
||||
.person img {width: 90px;height: 90px;border-radius: 4px;margin-top: 8px;margin-left: 8px;}
|
||||
.pear-card2 .count {color: #51A351;font-size: 30px;margin-top: 12px;}
|
||||
.pear-card2 .title {color: gray;font-size: 14px;margin-top: 14px;}
|
||||
.pear-card-status {padding: 0 10px 10px;}
|
||||
.pear-card-status li {position: relative;padding: 10px 0;border-bottom: 1px solid #EEE;}
|
||||
.pear-card-status li h3 {padding-bottom: 5px;font-weight: 700;}
|
||||
.pear-card-status li p {padding-bottom: 10px;padding-top: 3px ;}
|
||||
.pear-card-status li>span {color: #999;}
|
||||
.pear-reply {position: absolute;right: 20px;}
|
||||
.person .title{font-size: 17px;font-weight: 600;margin-left: 18px;margin-top: 16px;position: absolute;display: inline-block;}
|
||||
.person .desc{font-size: 16px;font-weight: 600;margin-left: 115px;margin-top: -30px;position: absolute;display: inline-block;}
|
||||
@@ -1,58 +0,0 @@
|
||||
.dept-tree {
|
||||
width: 100%;
|
||||
height: -webkit-calc(100vh - 247px);
|
||||
height: -moz-calc(100vh - 247px);
|
||||
height: calc(100vh - 247px);
|
||||
margin-top: 20px;
|
||||
}
|
||||
.dtree-laySimple-item-this{
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.dtree-nav-div:hover{
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.button{
|
||||
margin-top: 10px;
|
||||
width: 94%;
|
||||
margin-left: 3%;
|
||||
display: block;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 15px;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
font-size: 14.5px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
display:inline-block;
|
||||
outline: 0;
|
||||
border-radius: 2px;
|
||||
-webkit-appearance: none;
|
||||
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
.button-primary{
|
||||
background-color: #5FB878;
|
||||
color: white;
|
||||
}
|
||||
.button-default{
|
||||
color: #2f495e;
|
||||
background-color: #edf2f7;
|
||||
}
|
||||
.user-main{
|
||||
width: calc(100% - 312px);
|
||||
float: right;
|
||||
}
|
||||
.user-left{
|
||||
width: 300px;
|
||||
float: left;
|
||||
}
|
||||
.user-collasped.user-main{
|
||||
width: 100%;
|
||||
}
|
||||
.user-collasped.user-left{
|
||||
width: 0px;
|
||||
}
|
||||
.user-collasped.user-left .user-group{
|
||||
display: none;
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "...",
|
||||
"count": 3,
|
||||
"data": [{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
"title": "Alipay",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
},{
|
||||
"id": "2",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png",
|
||||
"title": "Layui",
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
},{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
},{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
"title": "Alipay",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
},{
|
||||
"id": "2",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png",
|
||||
"title": "Layui",
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
},{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}]
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
[{
|
||||
"id": 1,
|
||||
"title": "私信",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条私人消息",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条私人消息",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "消息",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条紧急任务",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "通知",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条警告通知",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"admin/images/avatar.jpg",
|
||||
"title": "收到一条警告通知",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "2019-02-15"
|
||||
}]
|
||||
}
|
||||
]
|
||||
@@ -1 +0,0 @@
|
||||
{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"code":0,"msg":"...","count":3,"data":[{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"1","roleName":"超级管理员","roleCode":"admin","enable":"1","details":"超级管理员","checked":false},{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"2","roleName":"普通管理员","roleCode":"manager","enable":"0","details":"普通管理员","checked":false},{"createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"remark":null,"roleId":"3","roleName":"普通用户","roleCode":"pearson","enable":"0","details":"普通用户","checked":false}]}
|
||||
@@ -1 +0,0 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#FAFAFA;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
@@ -1,3 +0,0 @@
|
||||
.layui-iconpicker .layui-anim{
|
||||
width: 300px!important;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
.layui-layer-msg{
|
||||
border-color: transparent!important;
|
||||
box-shadow: 2px 0 6px rgb(0 21 41 / 0.05)!important;
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
.pear-notice .layui-this {
|
||||
color: #5FB878 !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pear-notice li {
|
||||
border-right: 1px solid whitesmoke;
|
||||
}
|
||||
|
||||
.pear-notice * {
|
||||
color: dimgray !important;
|
||||
}
|
||||
|
||||
.pear-notice{
|
||||
width: 285px!important;
|
||||
}
|
||||
|
||||
.pear-notice span{
|
||||
margin-left: 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.pear-notice img{
|
||||
margin-left: 8px;
|
||||
width: 33px!important;
|
||||
height: 33px!important;
|
||||
border-radius: 50px;
|
||||
}
|
||||
|
||||
.pear-notice-item{
|
||||
height: 45px!important;
|
||||
line-height: 45px!important;
|
||||
}
|
||||
|
||||
/** 滚动条样式 */
|
||||
.pear-notice *::-webkit-scrollbar{width:0px;height:0px;}
|
||||
.pear-notice *::-webkit-scrollbar-track{background: white;border-radius:2px;}
|
||||
.pear-notice *::-webkit-scrollbar-thumb{background: #E6E6E6;border-radius:2px;}
|
||||
.pear-notice *::-webkit-scrollbar-thumb:hover{background: #E6E6E6;}
|
||||
.pear-notice *::-webkit-scrollbar-corner{background: #f6f6f6;}
|
||||
|
||||
|
||||
@@ -1,539 +0,0 @@
|
||||
layui.define(['message', 'table', 'jquery', 'element', 'yaml', 'form', 'tab', 'menu', 'frame', 'theme', 'convert'],
|
||||
function(exports) {
|
||||
"use strict";
|
||||
|
||||
var $ = layui.jquery,
|
||||
form = layui.form,
|
||||
element = layui.element,
|
||||
yaml = layui.yaml,
|
||||
pearTab = layui.tab,
|
||||
convert = layui.convert,
|
||||
pearMenu = layui.menu,
|
||||
pearFrame = layui.frame,
|
||||
pearTheme = layui.theme,
|
||||
message = layui.message;
|
||||
|
||||
var bodyFrame;
|
||||
var sideMenu;
|
||||
var bodyTab;
|
||||
var config;
|
||||
var logout = function() {};
|
||||
var msgInstance;
|
||||
|
||||
var body = $('body');
|
||||
|
||||
var pearAdmin = new function() {
|
||||
|
||||
// 默认配置
|
||||
var configType = 'yml';
|
||||
var configPath = 'pear.config.yml';
|
||||
|
||||
this.setConfigPath = function(path) {
|
||||
configPath = path;
|
||||
}
|
||||
|
||||
this.setConfigType = function(type) {
|
||||
configType = type;
|
||||
}
|
||||
|
||||
this.setAvatar = function(url, username) {
|
||||
var image = new Image();
|
||||
image.src = url || "admin/images/avatar.jpg";
|
||||
image.onload = function() {
|
||||
$(".layui-nav-img").attr("src", convert.imageToBase64(image));
|
||||
}
|
||||
$(".layui-nav-img").parent().append(username);
|
||||
}
|
||||
|
||||
this.render = function(initConfig) {
|
||||
if (initConfig !== undefined) {
|
||||
applyConfig(initConfig);
|
||||
} else {
|
||||
applyConfig(pearAdmin.readConfig());
|
||||
}
|
||||
}
|
||||
|
||||
this.readConfig = function() {
|
||||
if (configType === "yml") {
|
||||
return yaml.load(configPath);
|
||||
} else {
|
||||
var data;
|
||||
$.ajax({
|
||||
url: configPath,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
async: false,
|
||||
success: function(result) {
|
||||
data = result;
|
||||
}
|
||||
})
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
this.messageRender = function(option) {
|
||||
var option = {
|
||||
elem: '.message',
|
||||
url: option.header.message,
|
||||
height: '250px'
|
||||
};
|
||||
msgInstance = message.render(option);
|
||||
}
|
||||
|
||||
this.logoRender = function(param) {
|
||||
$(".layui-logo .logo").attr("src", param.logo.image);
|
||||
$(".layui-logo .title").html(param.logo.title);
|
||||
}
|
||||
|
||||
this.menuRender = function(param) {
|
||||
sideMenu = pearMenu.render({
|
||||
elem: 'sideMenu',
|
||||
async: param.menu.async !== undefined ? param.menu.async : true,
|
||||
theme: "dark-theme",
|
||||
height: '100%',
|
||||
method: param.menu.method,
|
||||
control: param.menu.control ? 'control' : false, // control
|
||||
controlWidth: param.menu.controlWidth,
|
||||
defaultMenu: 0,
|
||||
accordion: param.menu.accordion,
|
||||
url: param.menu.data,
|
||||
data: param.menu.data, //async为false时,传入菜单数组
|
||||
parseData: false,
|
||||
change: function() {
|
||||
compatible();
|
||||
},
|
||||
done: function() {
|
||||
sideMenu.selectItem(param.menu.select);
|
||||
pearAdmin.collaspe(param);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.bodyRender = function(param) {
|
||||
body.on("click", ".refresh", function() {
|
||||
var refreshA = $(".refresh a");
|
||||
refreshA.removeClass("layui-icon-refresh-1");
|
||||
refreshA.addClass("layui-anim");
|
||||
refreshA.addClass("layui-anim-rotate");
|
||||
refreshA.addClass("layui-anim-loop");
|
||||
refreshA.addClass("layui-icon-loading");
|
||||
if (param.tab.muiltTab) bodyTab.refresh(400);
|
||||
else bodyFrame.refresh(400);
|
||||
setTimeout(function() {
|
||||
refreshA.addClass("layui-icon-refresh-1");
|
||||
refreshA.removeClass("layui-anim");
|
||||
refreshA.removeClass("layui-anim-rotate");
|
||||
refreshA.removeClass("layui-anim-loop");
|
||||
refreshA.removeClass("layui-icon-loading");
|
||||
}, 600)
|
||||
})
|
||||
if (param.tab.muiltTab) {
|
||||
bodyTab = pearTab.render({
|
||||
elem: 'content',
|
||||
roll: true,
|
||||
tool: true,
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
session: param.tab.session,
|
||||
index: 0,
|
||||
tabMax: param.tab.tabMax,
|
||||
closeEvent: function(id) {
|
||||
sideMenu.selectItem(id);
|
||||
},
|
||||
data: [{
|
||||
id: param.tab.index.id,
|
||||
url: param.tab.index.href,
|
||||
title: param.tab.index.title,
|
||||
close: false
|
||||
}],
|
||||
success: function(id) {
|
||||
if (param.tab.session) {
|
||||
setTimeout(function() {
|
||||
sideMenu.selectItem(id);
|
||||
bodyTab.positionTab();
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
});
|
||||
bodyTab.click(function(id) {
|
||||
if (!param.tab.keepState) {
|
||||
bodyTab.refresh(false);
|
||||
}
|
||||
bodyTab.positionTab();
|
||||
sideMenu.selectItem(id);
|
||||
})
|
||||
|
||||
sideMenu.click(function(dom, data) {
|
||||
bodyTab.addTabOnly({
|
||||
id: data.menuId,
|
||||
title: data.menuTitle,
|
||||
url: data.menuUrl,
|
||||
icon: data.menuIcon,
|
||||
close: true
|
||||
}, 300);
|
||||
|
||||
compatible();
|
||||
|
||||
})
|
||||
} else {
|
||||
bodyFrame = pearFrame.render({
|
||||
elem: 'content',
|
||||
title: '首页',
|
||||
url: param.tab.index.href,
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
});
|
||||
|
||||
sideMenu.click(function(dom, data) {
|
||||
bodyFrame.changePage(data.menuUrl, data.menuPath, true);
|
||||
compatible()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
this.keepLoad = function(param) {
|
||||
compatible()
|
||||
setTimeout(function() {
|
||||
$(".loader-main").fadeOut(200);
|
||||
}, param.other.keepLoad)
|
||||
}
|
||||
|
||||
this.collaspe = function(param) {
|
||||
if (param.menu.collaspe) {
|
||||
if ($(window).width() >= 768) {
|
||||
collaspe()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.themeRender = function(option) {
|
||||
if (option.theme.allowCustom === false) {
|
||||
$(".setting").remove();
|
||||
}
|
||||
var colorId = localStorage.getItem("theme-color");
|
||||
var currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-context", currentColor.color);
|
||||
pearTheme.changeTheme(window, option.other.autoHead);
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
if (menu == null) {
|
||||
menu = option.theme.defaultMenu;
|
||||
} else {
|
||||
if (option.theme.allowCustom === false) {
|
||||
menu = option.theme.defaultMenu;
|
||||
}
|
||||
}
|
||||
localStorage.setItem("theme-menu", menu);
|
||||
this.menuSkin(menu);
|
||||
}
|
||||
|
||||
this.menuSkin = function(theme) {
|
||||
var pearAdmin = $(".pear-admin");
|
||||
pearAdmin.removeClass("light-theme");
|
||||
pearAdmin.removeClass("dark-theme");
|
||||
pearAdmin.addClass(theme);
|
||||
}
|
||||
|
||||
this.logout = function(callback) {
|
||||
logout = callback;
|
||||
}
|
||||
|
||||
this.message = function(callback) {
|
||||
if (callback != null) {
|
||||
msgInstance.click(callback);
|
||||
} else {
|
||||
msgInstance.click(messageTip);
|
||||
}
|
||||
}
|
||||
|
||||
this.jump = function(id, title, url) {
|
||||
if (config.tab.muiltTab) {
|
||||
bodyTab.addTabOnly({
|
||||
id: id,
|
||||
title: title,
|
||||
url: url,
|
||||
icon: null,
|
||||
close: true
|
||||
}, 300);
|
||||
} else {
|
||||
sideMenu.selectItem(id);
|
||||
bodyFrame.changePage(url, title, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var messageTip = function(id, title, context, form) {
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '消息', //标题
|
||||
area: ['390px', '330px'], //宽高
|
||||
shade: 0.4, //遮罩透明度
|
||||
content: "<div style='background-color:whitesmoke;'><div class='layui-card'><div class='layui-card-body'>来源 : " +
|
||||
form + "</div><div class='layui-card-header' >标题 : " + title +
|
||||
"</div><div class='layui-card-body' >内容 : " + context + "</div></div></div>", //支持获取DOM元素
|
||||
btn: ['确认'], //按钮组
|
||||
scrollbar: false, //屏蔽浏览器滚动条
|
||||
yes: function(index) { //layer.msg('yes'); //点击确定回调
|
||||
layer.close(index);
|
||||
showToast();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function collaspe() {
|
||||
sideMenu.collaspe();
|
||||
var admin = $(".pear-admin");
|
||||
var left = $(".layui-icon-spread-left")
|
||||
var right = $(".layui-icon-shrink-right")
|
||||
if (admin.is(".pear-mini")) {
|
||||
left.addClass("layui-icon-shrink-right")
|
||||
left.removeClass("layui-icon-spread-left")
|
||||
admin.removeClass("pear-mini");
|
||||
} else {
|
||||
right.addClass("layui-icon-spread-left")
|
||||
right.removeClass("layui-icon-shrink-right")
|
||||
admin.addClass("pear-mini");
|
||||
}
|
||||
}
|
||||
|
||||
body.on("click", ".logout", function() {
|
||||
// 回调
|
||||
var result = logout();
|
||||
|
||||
if (result) {
|
||||
// 清空缓存
|
||||
bodyTab.clear();
|
||||
}
|
||||
})
|
||||
|
||||
body.on("click", ".collaspe,.pear-cover", function() {
|
||||
collaspe();
|
||||
});
|
||||
|
||||
body.on("click", ".fullScreen", function() {
|
||||
if ($(this).hasClass("layui-icon-screen-restore")) {
|
||||
screenFun(2).then(function() {
|
||||
$(".fullScreen").eq(0).removeClass("layui-icon-screen-restore");
|
||||
});
|
||||
} else {
|
||||
screenFun(1).then(function() {
|
||||
$(".fullScreen").eq(0).addClass("layui-icon-screen-restore");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
body.on("click", '[user-menu-id]', function() {
|
||||
if (config.tab.muiltTab) {
|
||||
bodyTab.addTabOnly({
|
||||
id: $(this).attr("user-menu-id"),
|
||||
title: $(this).attr("user-menu-title"),
|
||||
url: $(this).attr("user-menu-url"),
|
||||
icon: "",
|
||||
close: true
|
||||
}, 300);
|
||||
} else {
|
||||
bodyFrame.changePage($(this).attr("user-menu-url"), "", true);
|
||||
}
|
||||
});
|
||||
|
||||
body.on("click", ".setting", function() {
|
||||
|
||||
var bgColorHtml =
|
||||
'<li class="layui-this" data-select-bgcolor="dark-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 40px; background: #28333E;"></span><span style="display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;"></span></div>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
bgColorHtml +=
|
||||
'<li data-select-bgcolor="light-theme" >' +
|
||||
'<a href="javascript:;" data-skin="skin-blue" style="" class="clearfix full-opacity-hover">' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 12px; background: white;"></span><span style="display:block; width: 80%; float: left; height: 12px; background: white;"></span></div>' +
|
||||
'<div><span style="display:block; width: 20%; float: left; height: 40px; background: white;"></span><span style="display:block; width: 80%; float: left; height: 40px; background: #f4f5f7;"></span></div>' +
|
||||
'</a>' +
|
||||
'</li>';
|
||||
|
||||
var html =
|
||||
'<div class="pearone-color">\n' +
|
||||
'<div class="color-title">整体风格</div>\n' +
|
||||
'<div class="color-content">\n' +
|
||||
'<ul>\n' + bgColorHtml + '</ul>\n' +
|
||||
'</div>\n' +
|
||||
'</div>';
|
||||
|
||||
layer.open({
|
||||
type: 1,
|
||||
offset: 'r',
|
||||
area: ['320px', '100%'],
|
||||
title: false,
|
||||
shade: 0.1,
|
||||
closeBtn: 0,
|
||||
shadeClose: false,
|
||||
anim: -1,
|
||||
skin: 'layer-anim-right',
|
||||
move: false,
|
||||
content: html + buildColorHtml() + buildLinkHtml() + bottomTool(),
|
||||
success: function(layero, index) {
|
||||
|
||||
var color = localStorage.getItem("theme-color");
|
||||
var menu = localStorage.getItem("theme-menu");
|
||||
|
||||
if (color !== "null") {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
$("*[color-id='" + color + "']").addClass("layui-icon").addClass("layui-icon-ok");
|
||||
}
|
||||
if (menu !== "null") {
|
||||
$("*[data-select-bgcolor]").removeClass("layui-this");
|
||||
$("[data-select-bgcolor='" + menu + "']").addClass("layui-this");
|
||||
}
|
||||
$('#layui-layer-shade' + index).click(function() {
|
||||
var $layero = $('#layui-layer' + index);
|
||||
$layero.animate({
|
||||
left: $layero.offset().left + $layero.width()
|
||||
}, 200, function() {
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
|
||||
$('#closeTheme').click(function() {
|
||||
var $layero = $('#layui-layer' + index);
|
||||
$layero.animate({
|
||||
left: $layero.offset().left + $layero.width()
|
||||
}, 200, function() {
|
||||
layer.close(index);
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function bottomTool() {
|
||||
return "<button id='closeTheme' style='position: absolute;bottom: 20px;left: 20px;' class='pear-btn'>关闭</button>"
|
||||
}
|
||||
|
||||
body.on('click', '[data-select-bgcolor]', function() {
|
||||
var theme = $(this).attr('data-select-bgcolor');
|
||||
$('[data-select-bgcolor]').removeClass("layui-this");
|
||||
$(this).addClass("layui-this");
|
||||
localStorage.setItem("theme-menu", theme);
|
||||
pearAdmin.menuSkin(theme);
|
||||
});
|
||||
|
||||
body.on('click', '.select-color-item', function() {
|
||||
$(".select-color-item").removeClass("layui-icon").removeClass("layui-icon-ok");
|
||||
$(this).addClass("layui-icon").addClass("layui-icon-ok");
|
||||
var colorId = $(".select-color-item.layui-icon-ok").attr("color-id");
|
||||
var currentColor = getColorById(colorId);
|
||||
localStorage.setItem("theme-color", currentColor.id);
|
||||
localStorage.setItem("theme-color-context", currentColor.color);
|
||||
pearTheme.changeTheme(window, config.other.autoHead);
|
||||
});
|
||||
|
||||
function applyConfig(param) {
|
||||
config = param;
|
||||
pearAdmin.logoRender(param);
|
||||
pearAdmin.menuRender(param);
|
||||
pearAdmin.bodyRender(param);
|
||||
pearAdmin.themeRender(param);
|
||||
pearAdmin.keepLoad(param);
|
||||
if (param.header.message != false) {
|
||||
pearAdmin.messageRender(param);
|
||||
}
|
||||
}
|
||||
|
||||
function getColorById(id) {
|
||||
var color;
|
||||
var flag = false;
|
||||
$.each(config.colors, function(i, value) {
|
||||
if (value.id === id) {
|
||||
color = value;
|
||||
flag = true;
|
||||
}
|
||||
})
|
||||
if (flag === false || config.theme.allowCustom === false) {
|
||||
$.each(config.colors, function(i, value) {
|
||||
if (value.id === config.theme.defaultColor) {
|
||||
color = value;
|
||||
}
|
||||
})
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
function buildLinkHtml() {
|
||||
var links = "";
|
||||
$.each(config.links, function(i, value) {
|
||||
// value.target 存在,则为新窗口打开,增加 target="_blank" 属性
|
||||
links += '<a class="more-menu-item" href="' + value.href + '" ' + (value.target ? ' target="_blank" ' : '') +
|
||||
'>' +
|
||||
'<i class="' + value.icon + '" style="font-size: 19px;"></i> ' + value.title +
|
||||
'</a>'
|
||||
})
|
||||
return '<div class="more-menu-list">' + links + '</div>';
|
||||
}
|
||||
|
||||
function buildColorHtml() {
|
||||
var colors = "";
|
||||
$.each(config.colors, function(i, value) {
|
||||
colors += "<span class='select-color-item' color-id='" + value.id + "' style='background-color:" + value.color +
|
||||
";'></span>";
|
||||
})
|
||||
return "<div class='select-color'><div class='select-color-title'>主题配色</div><div class='select-color-content'>" +
|
||||
colors + "</div></div>"
|
||||
}
|
||||
|
||||
function compatible() {
|
||||
if ($(window).width() <= 768) {
|
||||
collaspe()
|
||||
}
|
||||
}
|
||||
|
||||
function screenFun(num) {
|
||||
num = num || 1;
|
||||
num = num * 1;
|
||||
var docElm = document.documentElement;
|
||||
switch (num) {
|
||||
case 1:
|
||||
if (docElm.requestFullscreen) {
|
||||
docElm.requestFullscreen();
|
||||
} else if (docElm.mozRequestFullScreen) {
|
||||
docElm.mozRequestFullScreen();
|
||||
} else if (docElm.webkitRequestFullScreen) {
|
||||
docElm.webkitRequestFullScreen();
|
||||
} else if (docElm.msRequestFullscreen) {
|
||||
docElm.msRequestFullscreen();
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (document.exitFullscreen) {
|
||||
document.exitFullscreen();
|
||||
} else if (document.mozCancelFullScreen) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if (document.webkitCancelFullScreen) {
|
||||
document.webkitCancelFullScreen();
|
||||
} else if (document.msExitFullscreen) {
|
||||
document.msExitFullscreen();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return new Promise(function(res, rej) {
|
||||
res("返回值");
|
||||
});
|
||||
}
|
||||
|
||||
function isFullscreen() {
|
||||
return document.fullscreenElement ||
|
||||
document.msFullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement || false;
|
||||
}
|
||||
|
||||
window.onresize = function() {
|
||||
if (!isFullscreen()) {
|
||||
$(".fullScreen").eq(0).removeClass("layui-icon-screen-restore");
|
||||
}
|
||||
}
|
||||
|
||||
exports('admin', pearAdmin);
|
||||
})
|
||||
@@ -1,102 +0,0 @@
|
||||
layui.define(['table', 'laypage','jquery', 'element'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
var MOD_NAME = 'card',
|
||||
$ = layui.jquery,
|
||||
element = layui.element,
|
||||
laypage = layui.laypage;
|
||||
|
||||
var pearCard = function(opt) {
|
||||
this.option = opt;
|
||||
};
|
||||
|
||||
pearCard.prototype.render = function(opt) {
|
||||
var option = {
|
||||
// 构建的模型
|
||||
elem: opt.elem,
|
||||
// 数据 url 连接
|
||||
url: opt.url,
|
||||
// lineSize 每行的个数
|
||||
lineSize: opt.lineSize ? opt.lineSize : 4,
|
||||
// 共多少个
|
||||
pageSize: opt.pageSize ? opt.pageSize : 12,
|
||||
// 当前页
|
||||
currentPage: opt.currentSize ? opt.currentSize : 0,
|
||||
// 完 成 函 数
|
||||
done: opt.done ? opt.done : function() {
|
||||
alert("跳转页面");
|
||||
}
|
||||
}
|
||||
// 根 据 请 求 方 式 获 取 数 据
|
||||
if (option.url != null) {
|
||||
// 复制数据
|
||||
option.data = getData(option.url).data;
|
||||
}
|
||||
|
||||
// 根据结果进行相应结构的创建
|
||||
var html = createComponent(option.data);
|
||||
|
||||
$(option.elem).html(html);
|
||||
|
||||
// 初始化分页组件
|
||||
laypage.render({
|
||||
elem: 'cardpage'
|
||||
,count: 100
|
||||
,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']
|
||||
,jump: function(obj){
|
||||
console.log(obj)
|
||||
}
|
||||
});
|
||||
|
||||
return new pearCard(option);
|
||||
}
|
||||
|
||||
function createComponent(data) {
|
||||
var html = "<div class='pear-card-component'>"
|
||||
var content = createCards(data);
|
||||
var page = "<div id='cardpage'></div>"
|
||||
content = content + page;
|
||||
html += content + "</div>"
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
/** 创建指定数量的卡片 */
|
||||
function createCards(data) {
|
||||
|
||||
var content = "<div class='layui-row layui-col-space30'>";
|
||||
$.each(data, function(i, item) {
|
||||
|
||||
content += createCard(item);
|
||||
|
||||
})
|
||||
content += "</div>"
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
/** 创建一个卡片 */
|
||||
function createCard(item) {
|
||||
|
||||
var card =
|
||||
'<div class="layui-col-md3 ew-datagrid-item" data-index="0" data-number="1"> <div class="project-list-item"> <img class="project-list-item-cover" src="'+item.image+'"> <div class="project-list-item-body"> <h2>'+item.title+'</h2> <div class="project-list-item-text layui-text">'+item.remark+'</div> <div class="project-list-item-desc"> <span class="time">'+item.time+'</span> <div class="ew-head-list"> <img class="ew-head-list-item" lay-tips="曲丽丽" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/ZiESqWwCXBRQoaPONSJe.png"> <img class="ew-head-list-item" lay-tips="王昭君" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/tBOxZPlITHqwlGjsJWaF.png"> <img class="ew-head-list-item" lay-tips="董娜娜" lay-offset="0,-5px" src="https://gw.alipayobjects.com/zos/rmsportal/sBxjgqiuHMGRkIjqlQCd.png"> </div> </div> </div> </div> </div>'
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
/** 同 步 请 求 获 取 数 据 */
|
||||
function getData(url) {
|
||||
|
||||
$.ajaxSettings.async = false;
|
||||
var data = null;
|
||||
|
||||
$.get(url, function(result) {
|
||||
data = result;
|
||||
});
|
||||
|
||||
$.ajaxSettings.async = true;
|
||||
return data;
|
||||
}
|
||||
|
||||
exports(MOD_NAME, new pearCard());
|
||||
})
|
||||
@@ -1,185 +0,0 @@
|
||||
layui.define(['jquery', 'element'], function(exports) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Drawer component
|
||||
* */
|
||||
var MOD_NAME = 'drawer',
|
||||
$ = layui.jquery,
|
||||
element = layui.element;
|
||||
|
||||
var drawer = new function() {
|
||||
|
||||
/**
|
||||
* open drawer
|
||||
* */
|
||||
this.open = function(option) {
|
||||
var obj = new mSlider({
|
||||
dom: option.dom,
|
||||
direction: option.direction,
|
||||
distance: option.distance,
|
||||
time: option.time ? option.time : 0,
|
||||
maskClose: option.maskClose,
|
||||
callback: option.success
|
||||
});
|
||||
obj.open();
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
exports(MOD_NAME, drawer);
|
||||
});
|
||||
|
||||
/**
|
||||
* 源码
|
||||
* */
|
||||
(function(b, c) {
|
||||
function a(d) {
|
||||
this.opts = {
|
||||
"direction": d.direction || "left",
|
||||
"distance": d.distance || "60%",
|
||||
"dom": this.Q(d.dom),
|
||||
"time": d.time || "",
|
||||
"maskClose": (d.maskClose + "").toString() !== "false" ? true : false,
|
||||
"callback": d.callback || ""
|
||||
};
|
||||
this.rnd = this.rnd();
|
||||
this.dom = this.opts.dom[0];
|
||||
this.wrap = "";
|
||||
this.inner = "";
|
||||
this.mask = "";
|
||||
this.init()
|
||||
}
|
||||
a.prototype = {
|
||||
Q: function(d) {
|
||||
return document.querySelectorAll(d)
|
||||
},
|
||||
isMobile: function() {
|
||||
return navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i) ? true : false
|
||||
},
|
||||
addEvent: function(f, e, d) {
|
||||
if (f.attachEvent) {
|
||||
f.attachEvent("on" + e, d)
|
||||
} else {
|
||||
f.addEventListener(e, d, false)
|
||||
}
|
||||
},
|
||||
rnd: function() {
|
||||
return Math.random().toString(36).substr(2, 6)
|
||||
},
|
||||
init: function() {
|
||||
var g = this;
|
||||
if (!g.dom) {
|
||||
console.log("未正确绑定弹窗容器");
|
||||
return
|
||||
}
|
||||
var d = document.createElement("div");
|
||||
var e = document.createElement("div");
|
||||
var f = document.createElement("div");
|
||||
d.setAttribute("class", "mSlider-main ms-" + g.rnd);
|
||||
e.setAttribute("class", "mSlider-inner");
|
||||
f.setAttribute("class", "mSlider-mask");
|
||||
g.Q("body")[0].appendChild(d);
|
||||
g.Q(".ms-" + g.rnd)[0].appendChild(e);
|
||||
g.Q(".ms-" + g.rnd)[0].appendChild(f);
|
||||
g.wrap = g.Q(".ms-" + g.rnd)[0];
|
||||
g.inner = g.Q(".ms-" + g.rnd + " .mSlider-inner")[0];
|
||||
g.mask = g.Q(".ms-" + g.rnd + " .mSlider-mask")[0];
|
||||
g.inner.appendChild(g.dom);
|
||||
switch (g.opts.direction) {
|
||||
case "top":
|
||||
g.top = "0";
|
||||
g.left = "0";
|
||||
g.width = "100%";
|
||||
g.height = g.opts.distance;
|
||||
g.translate = "0,-100%,0";
|
||||
break;
|
||||
case "bottom":
|
||||
g.bottom = "0";
|
||||
g.left = "0";
|
||||
g.width = "100%";
|
||||
g.height = g.opts.distance;
|
||||
g.translate = "0,100%,0";
|
||||
break;
|
||||
case "right":
|
||||
g.top = "0";
|
||||
g.right = "0";
|
||||
g.width = g.opts.distance;
|
||||
g.height = document.documentElement.clientHeight + "px";
|
||||
g.translate = "100%,0,0";
|
||||
break;
|
||||
default:
|
||||
g.top = "0";
|
||||
g.left = "0";
|
||||
g.width = g.opts.distance;
|
||||
g.height = document.documentElement.clientHeight + "px";
|
||||
g.translate = "-100%,0,0"
|
||||
}
|
||||
g.wrap.style.display = "none";
|
||||
g.wrap.style.position = "fixed";
|
||||
g.wrap.style.top = "0";
|
||||
g.wrap.style.left = "0";
|
||||
g.wrap.style.width = "100%";
|
||||
g.wrap.style.height = "100%";
|
||||
g.wrap.style.zIndex = 9999999;
|
||||
g.inner.style.position = "absolute";
|
||||
g.inner.style.top = g.top;
|
||||
g.inner.style.bottom = g.bottom;
|
||||
g.inner.style.left = g.left;
|
||||
g.inner.style.right = g.right;
|
||||
g.inner.style.width = g.width;
|
||||
g.inner.style.height = g.height;
|
||||
g.inner.style.backgroundColor = "#fff";
|
||||
g.inner.style.transform = "translate3d(" + g.translate + ")";
|
||||
g.inner.style.webkitTransition = "all .2s ease-out";
|
||||
g.inner.style.transition = "all .2s ease-out";
|
||||
g.inner.style.zIndex = 10000000;
|
||||
g.mask.style.width = "100%";
|
||||
g.mask.style.height = "100%";
|
||||
g.mask.style.opacity = "0.1";
|
||||
g.mask.style.backgroundColor = "black";
|
||||
g.mask.style.zIndex = "9999998";
|
||||
g.mask.style.webkitBackfaceVisibility = "hidden";
|
||||
g.events()
|
||||
},
|
||||
open: function() {
|
||||
var d = this;
|
||||
d.wrap.style.display = "block";
|
||||
|
||||
setTimeout(function() {
|
||||
d.inner.style.transform = "translate3d(0,0,0)";
|
||||
d.inner.style.webkitTransform = "translate3d(0,0,0)";
|
||||
d.mask.style.opacity = 0.1
|
||||
}, 30);
|
||||
if (d.opts.time) {
|
||||
d.timer = setTimeout(function() {
|
||||
d.close()
|
||||
}, d.opts.time)
|
||||
}
|
||||
},
|
||||
close: function() {
|
||||
var d = this;
|
||||
d.timer && clearTimeout(d.timer);
|
||||
d.inner.style.webkitTransform = "translate3d(" + d.translate + ")";
|
||||
d.inner.style.transform = "translate3d(" + d.translate + ")";
|
||||
d.mask.style.opacity = 0;
|
||||
setTimeout(function() {
|
||||
d.wrap.style.display = "none";
|
||||
d.timer = null;
|
||||
d.opts.callback && d.opts.callback()
|
||||
}, 300)
|
||||
},
|
||||
events: function() {
|
||||
var d = this;
|
||||
d.addEvent(d.mask, "touchmove", function(f) {
|
||||
f.preventDefault()
|
||||
});
|
||||
d.addEvent(d.mask, (d.isMobile() ? "touchend" : "click"), function(f) {
|
||||
if (d.opts.maskClose) {
|
||||
d.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
b.mSlider = a
|
||||
})(window);
|
||||
@@ -1,81 +0,0 @@
|
||||
layui.define(['table', 'jquery', 'element'], function (exports) {
|
||||
"use strict";
|
||||
|
||||
var MOD_NAME = 'frame',
|
||||
$ = layui.jquery,
|
||||
element = layui.element;
|
||||
|
||||
var pearFrame = function (opt) {
|
||||
this.option = opt;
|
||||
};
|
||||
|
||||
pearFrame.prototype.render = function (opt) {
|
||||
var option = {
|
||||
elem:opt.elem,
|
||||
url:opt.url,
|
||||
title:opt.title,
|
||||
width:opt.width,
|
||||
height:opt.height,
|
||||
done:opt.done ? opt.done: function(){ console.log("菜单渲染成功");}
|
||||
}
|
||||
createFrameHTML(option);
|
||||
$("#"+option.elem).width(option.width);
|
||||
$("#"+option.elem).height(option.height);
|
||||
return new pearFrame(option);
|
||||
}
|
||||
|
||||
pearFrame.prototype.changePage = function(url,title,loading){
|
||||
if(loading){
|
||||
var loading = $("#"+this.option.elem).find(".pear-frame-loading");
|
||||
loading.css({display:'block'});
|
||||
}
|
||||
$("#"+this.option.elem+" iframe").attr("src",url);
|
||||
$("#"+this.option.elem+" .title").html(title);
|
||||
if(loading){
|
||||
var loading = $("#"+this.option.elem).find(".pear-frame-loading");
|
||||
setTimeout(function(){
|
||||
loading.css({display:'none'});
|
||||
},800)
|
||||
}
|
||||
}
|
||||
|
||||
pearFrame.prototype.changePageByElement = function(elem,url,title,loading){
|
||||
if(loading){
|
||||
var loading = $("#"+elem).find(".pear-frame-loading");
|
||||
loading.css({display:'block'});
|
||||
}
|
||||
$("#"+elem+" iframe").attr("src",url);
|
||||
$("#"+elem+" .title").html(title);
|
||||
if(loading){
|
||||
var loading = $("#"+elem).find(".pear-frame-loading");
|
||||
setTimeout(function(){
|
||||
loading.css({display:'none'});
|
||||
},800)
|
||||
}
|
||||
}
|
||||
|
||||
pearFrame.prototype.refresh = function (time) {
|
||||
if(time!=false){
|
||||
var loading = $("#"+this.option.elem).find(".pear-frame-loading");
|
||||
loading.css({display:'block'});
|
||||
if(time!=0){
|
||||
setTimeout(function(){
|
||||
loading.css({display:'none'});
|
||||
},time)
|
||||
}
|
||||
}
|
||||
$("#"+this.option.elem).find("iframe")[0].contentWindow.location.reload(true);
|
||||
}
|
||||
|
||||
function createFrameHTML(option){
|
||||
var header = "<div class='pear-frame-title'><div class='dot'></div><div class='title'>"+option.title+"</div></div>"
|
||||
var iframe = "<iframe class='pear-frame-content' style='width:100%;height:100%;' scrolling='auto' frameborder='0' src='"+option.url+"' ></iframe>";
|
||||
var loading = '<div class="pear-frame-loading">'+
|
||||
'<div class="ball-loader">'+
|
||||
'<span></span><span></span><span></span><span></span>'+
|
||||
'</div>'+
|
||||
'</div></div>';
|
||||
$("#"+option.elem).html("<div class='pear-frame'>"+header+iframe+loading+"</div>");
|
||||
}
|
||||
exports(MOD_NAME,new pearFrame());
|
||||
})
|
||||
@@ -1,388 +0,0 @@
|
||||
layui.define(['laypage', 'form'], function (exports) {
|
||||
"use strict";
|
||||
|
||||
var IconPicker =function () {
|
||||
this.v = '1.1';
|
||||
}, _MOD = 'iconPicker',
|
||||
_this = this,
|
||||
$ = layui.jquery,
|
||||
laypage = layui.laypage,
|
||||
form = layui.form,
|
||||
BODY = 'body',
|
||||
TIPS = '请选择图标';
|
||||
|
||||
IconPicker.prototype.render = function(options){
|
||||
var opts = options,
|
||||
// DOM选择器
|
||||
elem = opts.elem,
|
||||
// 数据类型:fontClass/unicode
|
||||
type = opts.type == null ? 'fontClass' : opts.type,
|
||||
// 是否分页:true/false
|
||||
page = opts.page == null ? true : opts.page,
|
||||
// 每页显示数量
|
||||
limit = opts.limit == null ? 12 : opts.limit,
|
||||
// 是否开启搜索:true/false
|
||||
search = opts.search == null ? true : opts.search,
|
||||
// 每个图标格子的宽度:'43px'或'20%'
|
||||
cellWidth = opts.cellWidth,
|
||||
// 点击回调
|
||||
click = opts.click,
|
||||
// 渲染成功后的回调
|
||||
success = opts.success,
|
||||
// json数据
|
||||
data = {},
|
||||
// 唯一标识
|
||||
tmp = new Date().getTime(),
|
||||
// 是否使用的class数据
|
||||
isFontClass = opts.type === 'fontClass',
|
||||
// 初始化时input的值
|
||||
ORIGINAL_ELEM_VALUE = $(elem).val(),
|
||||
TITLE = 'layui-select-title',
|
||||
TITLE_ID = 'layui-select-title-' + tmp,
|
||||
ICON_BODY = 'layui-iconpicker-' + tmp,
|
||||
PICKER_BODY = 'layui-iconpicker-body-' + tmp,
|
||||
PAGE_ID = 'layui-iconpicker-page-' + tmp,
|
||||
LIST_BOX = 'layui-iconpicker-list-box',
|
||||
selected = 'layui-form-selected',
|
||||
unselect = 'layui-unselect';
|
||||
|
||||
var a = {
|
||||
init: function () {
|
||||
data = common.getData[type]();
|
||||
|
||||
a.hideElem().createSelect().createBody().toggleSelect();
|
||||
a.preventEvent().inputListen();
|
||||
common.loadCss();
|
||||
|
||||
if (success) {
|
||||
success(this.successHandle());
|
||||
}
|
||||
|
||||
return a;
|
||||
},
|
||||
successHandle: function(){
|
||||
var d = {
|
||||
options: opts,
|
||||
data: data,
|
||||
id: tmp,
|
||||
elem: $('#' + ICON_BODY)
|
||||
};
|
||||
return d;
|
||||
},
|
||||
/**
|
||||
* 隐藏elem
|
||||
*/
|
||||
hideElem: function () {
|
||||
$(elem).hide();
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制select下拉选择框
|
||||
*/
|
||||
createSelect: function () {
|
||||
var oriIcon = '<i class="layui-icon">';
|
||||
|
||||
// 默认图标
|
||||
if(ORIGINAL_ELEM_VALUE === '') {
|
||||
if(isFontClass) {
|
||||
ORIGINAL_ELEM_VALUE = 'layui-icon-circle-dot';
|
||||
} else {
|
||||
ORIGINAL_ELEM_VALUE = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (isFontClass) {
|
||||
oriIcon = '<i class="layui-icon '+ ORIGINAL_ELEM_VALUE +'">';
|
||||
} else {
|
||||
oriIcon += ORIGINAL_ELEM_VALUE;
|
||||
}
|
||||
oriIcon += '</i>';
|
||||
|
||||
var selectHtml = '<div class="layui-iconpicker layui-unselect layui-form-select" id="'+ ICON_BODY +'">' +
|
||||
'<div class="'+ TITLE +'" id="'+ TITLE_ID +'">' +
|
||||
'<div class="layui-iconpicker-item">'+
|
||||
'<span class="layui-iconpicker-icon layui-unselect">' +
|
||||
oriIcon +
|
||||
'</span>'+
|
||||
'<i class="layui-edge"></i>' +
|
||||
'</div>'+
|
||||
'</div>' +
|
||||
'<div class="layui-anim layui-anim-upbit" style="">' +
|
||||
'123' +
|
||||
'</div>';
|
||||
$(elem).after(selectHtml);
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 展开/折叠下拉框
|
||||
*/
|
||||
toggleSelect: function () {
|
||||
var item = '#' + TITLE_ID + ' .layui-iconpicker-item,#' + TITLE_ID + ' .layui-iconpicker-item .layui-edge';
|
||||
a.event('click', item, function (e) {
|
||||
var $icon = $('#' + ICON_BODY);
|
||||
if ($icon.hasClass(selected)) {
|
||||
$icon.removeClass(selected).addClass(unselect);
|
||||
} else {
|
||||
// 隐藏其他picker
|
||||
$('.layui-form-select').removeClass(selected);
|
||||
// 显示当前picker
|
||||
$icon.addClass(selected).removeClass(unselect);
|
||||
}
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制主体部分
|
||||
*/
|
||||
createBody: function () {
|
||||
// 获取数据
|
||||
var searchHtml = '';
|
||||
|
||||
if (search) {
|
||||
searchHtml = '<div class="layui-iconpicker-search">' +
|
||||
'<input class="layui-input">' +
|
||||
'<i class="layui-icon"></i>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
// 组合dom
|
||||
var bodyHtml = '<div class="layui-iconpicker-body" id="'+ PICKER_BODY +'">' +
|
||||
searchHtml +
|
||||
'<div class="'+ LIST_BOX +'"></div> '+
|
||||
'</div>';
|
||||
$('#' + ICON_BODY).find('.layui-anim').eq(0).html(bodyHtml);
|
||||
a.search().createList().check().page();
|
||||
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 绘制图标列表
|
||||
* @param text 模糊查询关键字
|
||||
* @returns {string}
|
||||
*/
|
||||
createList: function (text) {
|
||||
var d = data,
|
||||
l = d.length,
|
||||
pageHtml = '',
|
||||
listHtml = $('<div class="layui-iconpicker-list">')//'<div class="layui-iconpicker-list">';
|
||||
|
||||
// 计算分页数据
|
||||
var _limit = limit, // 每页显示数量
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1), // 总计多少页
|
||||
_id = PAGE_ID;
|
||||
|
||||
// 图标列表
|
||||
var icons = [];
|
||||
|
||||
for (var i = 0; i < l; i++) {
|
||||
var obj = d[i];
|
||||
|
||||
// 判断是否模糊查询
|
||||
if (text && obj.indexOf(text) === -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否自定义格子宽度
|
||||
var style = '';
|
||||
if (cellWidth !== null) {
|
||||
style += ' style="width:' + cellWidth + '"';
|
||||
}
|
||||
|
||||
// 每个图标dom
|
||||
var icon = '<div class="layui-iconpicker-icon-item" title="'+ obj +'" '+ style +'>';
|
||||
if (isFontClass){
|
||||
icon += '<i class="layui-icon '+ obj +'"></i>';
|
||||
} else {
|
||||
icon += '<i class="layui-icon">'+ obj.replace('amp;', '') +'</i>';
|
||||
}
|
||||
icon += '</div>';
|
||||
|
||||
icons.push(icon);
|
||||
}
|
||||
|
||||
// 查询出图标后再分页
|
||||
l = icons.length;
|
||||
_pages = l % _limit === 0 ? l / _limit : parseInt(l / _limit + 1);
|
||||
for (var i = 0; i < _pages; i++) {
|
||||
// 按limit分块
|
||||
var lm = $('<div class="layui-iconpicker-icon-limit" id="layui-iconpicker-icon-limit-' + tmp + (i+1) +'">');
|
||||
|
||||
for (var j = i * _limit; j < (i+1) * _limit && j < l; j++) {
|
||||
lm.append(icons[j]);
|
||||
}
|
||||
|
||||
listHtml.append(lm);
|
||||
}
|
||||
|
||||
// 无数据
|
||||
if (l === 0) {
|
||||
listHtml.append('<p class="layui-iconpicker-tips">无数据</p>');
|
||||
}
|
||||
|
||||
// 判断是否分页
|
||||
if (page){
|
||||
$('#' + PICKER_BODY).addClass('layui-iconpicker-body-page');
|
||||
pageHtml = '<div class="layui-iconpicker-page" id="'+ PAGE_ID +'">' +
|
||||
'<div class="layui-iconpicker-page-count">' +
|
||||
'<span id="'+ PAGE_ID +'-current">1</span>/' +
|
||||
'<span id="'+ PAGE_ID +'-pages">'+ _pages +'</span>' +
|
||||
' (<span id="'+ PAGE_ID +'-length">'+ l +'</span>)' +
|
||||
'</div>' +
|
||||
'<div class="layui-iconpicker-page-operate">' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-prev" data-index="0" prev></i> ' +
|
||||
'<i class="layui-icon" id="'+ PAGE_ID +'-next" data-index="2" next></i> ' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).find('.layui-anim').find('.' + LIST_BOX).html('').append(listHtml).append(pageHtml);
|
||||
return a;
|
||||
},
|
||||
preventEvent: function() {
|
||||
var item = '#' + ICON_BODY + ' .layui-anim';
|
||||
a.event('click', item, function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
page: function () {
|
||||
var icon = '#' + PAGE_ID + ' .layui-iconpicker-page-operate .layui-icon';
|
||||
|
||||
$(icon).unbind('click');
|
||||
a.event('click', icon, function (e) {
|
||||
var elem = e.currentTarget,
|
||||
total = parseInt($('#' +PAGE_ID + '-pages').html()),
|
||||
isPrev = $(elem).attr('prev') !== undefined,
|
||||
// 按钮上标的页码
|
||||
index = parseInt($(elem).attr('data-index')),
|
||||
$cur = $('#' +PAGE_ID + '-current'),
|
||||
// 点击时正在显示的页码
|
||||
current = parseInt($cur.html());
|
||||
|
||||
// 分页数据
|
||||
if (isPrev && current > 1) {
|
||||
current=current-1;
|
||||
$(icon + '[prev]').attr('data-index', current);
|
||||
} else if (!isPrev && current < total){
|
||||
current=current+1;
|
||||
$(icon + '[next]').attr('data-index', current);
|
||||
}
|
||||
$cur.html(current);
|
||||
|
||||
// 图标数据
|
||||
$('#'+ ICON_BODY + ' .layui-iconpicker-icon-limit').hide();
|
||||
$('#layui-iconpicker-icon-limit-' + tmp + current).show();
|
||||
e.stopPropagation();
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
search: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-search .layui-input';
|
||||
a.event('input propertychange', item, function (e) {
|
||||
var elem = e.target,
|
||||
t = $(elem).val();
|
||||
a.createList(t);
|
||||
});
|
||||
return a;
|
||||
},
|
||||
/**
|
||||
* 点击选中图标
|
||||
*/
|
||||
check: function () {
|
||||
var item = '#' + PICKER_BODY + ' .layui-iconpicker-icon-item';
|
||||
a.event('click', item, function (e) {
|
||||
var el = $(e.currentTarget).find('.layui-icon'),
|
||||
icon = '';
|
||||
if (isFontClass) {
|
||||
var clsArr = el.attr('class').split(/[\s\n]/),
|
||||
cls = clsArr[1],
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html('').attr('class', clsArr.join(' '));
|
||||
} else {
|
||||
var cls = el.html(),
|
||||
icon = cls;
|
||||
$('#' + TITLE_ID).find('.layui-iconpicker-item .layui-icon').html(icon);
|
||||
}
|
||||
|
||||
$('#' + ICON_BODY).removeClass(selected).addClass(unselect);
|
||||
$(elem).val(icon).attr('value', icon);
|
||||
// 回调
|
||||
if (click) {
|
||||
click({
|
||||
icon: icon
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
return a;
|
||||
},
|
||||
// 监听原始input数值改变
|
||||
inputListen: function(){
|
||||
var el = $(elem);
|
||||
a.event('change', elem, function(){
|
||||
var value = el.val();
|
||||
})
|
||||
// el.change(function(){
|
||||
|
||||
// });
|
||||
return a;
|
||||
},
|
||||
event: function (evt, el, fn) {
|
||||
$(BODY).on(evt, el, fn);
|
||||
}
|
||||
};
|
||||
|
||||
var common = {
|
||||
/**
|
||||
* 加载样式表
|
||||
*/
|
||||
loadCss: function () {
|
||||
var css = '.layui-iconpicker {max-width: 280px;}.layui-iconpicker .layui-anim{display:none;width:280px;position:absolute;left:0;top:42px;padding:5px 0;z-index:899;min-width:100%;border:1px solid #d2d2d2;max-height:300px;overflow-y:auto;background-color:#fff;border-radius:2px;box-shadow:0 2px 4px rgba(0,0,0,.12);box-sizing:border-box;}.layui-iconpicker-item{border:1px solid #e6e6e6;width:90px;height:38px;border-radius:4px;cursor:pointer;position:relative;}.layui-iconpicker-icon{border-right:1px solid #e6e6e6;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;width:60px;height:100%;float:left;text-align:center;background:#fff;transition:all .3s;}.layui-iconpicker-icon i{line-height:38px;font-size:18px;}.layui-iconpicker-item > .layui-edge{left:70px;}.layui-iconpicker-item:hover{border-color:#D2D2D2!important;}.layui-iconpicker-item:hover .layui-iconpicker-icon{border-color:#D2D2D2!important;}.layui-iconpicker.layui-form-selected .layui-anim{display:block;}.layui-iconpicker-body{padding:6px;}.layui-iconpicker .layui-iconpicker-list{background-color:#fff;border:1px solid #ccc;border-radius:4px;}.layui-iconpicker .layui-iconpicker-icon-item{display:inline-block;width:21.1%;line-height:36px;text-align:center;cursor:pointer;vertical-align:top;height:36px;margin:4px;border:1px solid #ddd;border-radius:2px;transition:300ms;}.layui-iconpicker .layui-iconpicker-icon-item i.layui-icon{font-size:17px;}.layui-iconpicker .layui-iconpicker-icon-item:hover{background-color:#eee;border-color:#ccc;-webkit-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;-moz-box-shadow:0 0 2px #aaa,0 0 2px #fff inset;box-shadow:0 0 2px #aaa,0 0 2px #fff inset;text-shadow:0 0 1px #fff;}.layui-iconpicker-search{position:relative;margin:0 0 6px 0;border:1px solid #e6e6e6;border-radius:2px;transition:300ms;}.layui-iconpicker-search:hover{border-color:#D2D2D2!important;}.layui-iconpicker-search .layui-input{cursor:text;display:inline-block;width:86%;border:none;padding-right:0;margin-top:1px;}.layui-iconpicker-search .layui-icon{position:absolute;top:11px;right:4%;}.layui-iconpicker-tips{text-align:center;padding:8px 0;cursor:not-allowed;}.layui-iconpicker-page{margin-top:6px;margin-bottom:-6px;font-size:12px;padding:0 2px;}.layui-iconpicker-page-count{display:inline-block;}.layui-iconpicker-page-operate{display:inline-block;float:right;cursor:default;}.layui-iconpicker-page-operate .layui-icon{font-size:12px;cursor:pointer;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit{display:none;}.layui-iconpicker-body-page .layui-iconpicker-icon-limit:first-child{display:block;}';
|
||||
var $style = $('head').find('style[iconpicker]');
|
||||
if ($style.length === 0) {
|
||||
$('head').append('<style rel="stylesheet" iconpicker>'+css+'</style>');
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
getData: {
|
||||
fontClass: function () {
|
||||
var arr = ["layui-icon-rate-half","layui-icon-rate","layui-icon-rate-solid","layui-icon-cellphone","layui-icon-vercode","layui-icon-login-wechat","layui-icon-login-qq","layui-icon-login-weibo","layui-icon-password","layui-icon-username","layui-icon-refresh-3","layui-icon-auz","layui-icon-spread-left","layui-icon-shrink-right","layui-icon-snowflake","layui-icon-tips","layui-icon-note","layui-icon-home","layui-icon-senior","layui-icon-refresh","layui-icon-refresh-1","layui-icon-flag","layui-icon-theme","layui-icon-notice","layui-icon-website","layui-icon-console","layui-icon-face-surprised","layui-icon-set","layui-icon-template-1","layui-icon-app","layui-icon-template","layui-icon-praise","layui-icon-tread","layui-icon-male","layui-icon-female","layui-icon-camera","layui-icon-camera-fill","layui-icon-more","layui-icon-more-vertical","layui-icon-rmb","layui-icon-dollar","layui-icon-diamond","layui-icon-fire","layui-icon-return","layui-icon-location","layui-icon-read","layui-icon-survey","layui-icon-face-smile","layui-icon-face-cry","layui-icon-cart-simple","layui-icon-cart","layui-icon-next","layui-icon-prev","layui-icon-upload-drag","layui-icon-upload","layui-icon-download-circle","layui-icon-component","layui-icon-file-b","layui-icon-user","layui-icon-find-fill","layui-icon-loading","layui-icon-loading-1","layui-icon-add-1","layui-icon-play","layui-icon-pause","layui-icon-headset","layui-icon-video","layui-icon-voice","layui-icon-speaker","layui-icon-fonts-del","layui-icon-fonts-code","layui-icon-fonts-html","layui-icon-fonts-strong","layui-icon-unlink","layui-icon-picture","layui-icon-link","layui-icon-face-smile-b","layui-icon-align-left","layui-icon-align-right","layui-icon-align-center","layui-icon-fonts-u","layui-icon-fonts-i","layui-icon-tabs","layui-icon-radio","layui-icon-circle","layui-icon-edit","layui-icon-share","layui-icon-delete","layui-icon-form","layui-icon-cellphone-fine","layui-icon-dialogue","layui-icon-fonts-clear","layui-icon-layer","layui-icon-date","layui-icon-water","layui-icon-code-circle","layui-icon-carousel","layui-icon-prev-circle","layui-icon-layouts","layui-icon-util","layui-icon-templeate-1","layui-icon-upload-circle","layui-icon-tree","layui-icon-table","layui-icon-chart","layui-icon-chart-screen","layui-icon-engine","layui-icon-triangle-d","layui-icon-triangle-r","layui-icon-file","layui-icon-set-sm","layui-icon-add-circle","layui-icon-404","layui-icon-about","layui-icon-up","layui-icon-down","layui-icon-left","layui-icon-right","layui-icon-circle-dot","layui-icon-search","layui-icon-set-fill","layui-icon-group","layui-icon-friends","layui-icon-reply-fill","layui-icon-menu-fill","layui-icon-log","layui-icon-picture-fine","layui-icon-face-smile-fine","layui-icon-list","layui-icon-release","layui-icon-ok","layui-icon-help","layui-icon-chat","layui-icon-top","layui-icon-star","layui-icon-star-fill","layui-icon-close-fill","layui-icon-close","layui-icon-ok-circle","layui-icon-add-circle-fine"];
|
||||
return arr;
|
||||
},
|
||||
unicode: function () {
|
||||
return ["&#xe6c9;","&#xe67b;","&#xe67a;","&#xe678;","&#xe679;","&#xe677;","&#xe676;","&#xe675;","&#xe673;","&#xe66f;","&#xe9aa;","&#xe672;","&#xe66b;","&#xe668;","&#xe6b1;","&#xe702;","&#xe66e;","&#xe68e;","&#xe674;","&#xe669;","&#xe666;","&#xe66c;","&#xe66a;","&#xe667;","&#xe7ae;","&#xe665;","&#xe664;","&#xe716;","&#xe656;","&#xe653;","&#xe663;","&#xe6c6;","&#xe6c5;","&#xe662;","&#xe661;","&#xe660;","&#xe65d;","&#xe65f;","&#xe671;","&#xe65e;","&#xe659;","&#xe735;","&#xe756;","&#xe65c;","&#xe715;","&#xe705;","&#xe6b2;","&#xe6af;","&#xe69c;","&#xe698;","&#xe657;","&#xe65b;","&#xe65a;","&#xe681;","&#xe67c;","&#xe601;","&#xe857;","&#xe655;","&#xe770;","&#xe670;","&#xe63d;","&#xe63e;","&#xe654;","&#xe652;","&#xe651;","&#xe6fc;","&#xe6ed;","&#xe688;","&#xe645;","&#xe64f;","&#xe64e;","&#xe64b;","&#xe62b;","&#xe64d;","&#xe64a;","&#xe64c;","&#xe650;","&#xe649;","&#xe648;","&#xe647;","&#xe646;","&#xe644;","&#xe62a;","&#xe643;","&#xe63f;","&#xe642;","&#xe641;","&#xe640;","&#xe63c;","&#xe63b;","&#xe63a;","&#xe639;","&#xe638;","&#xe637;","&#xe636;","&#xe635;","&#xe634;","&#xe633;","&#xe632;","&#xe631;","&#xe630;","&#xe62f;","&#xe62e;","&#xe62d;","&#xe62c;","&#xe629;","&#xe628;","&#xe625;","&#xe623;","&#xe621;","&#xe620;","&#xe61f;","&#xe61c;","&#xe60b;","&#xe619;","&#xe61a;","&#xe603;","&#xe602;","&#xe617;","&#xe615;","&#xe614;","&#xe613;","&#xe612;","&#xe611;","&#xe60f;","&#xe60e;","&#xe60d;","&#xe60c;","&#xe60a;","&#xe609;","&#xe605;","&#xe607;","&#xe606;","&#xe604;","&#xe600;","&#xe658;","&#x1007;","&#x1006;","&#x1005;","&#xe608;"];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
a.init();
|
||||
return new IconPicker();
|
||||
};
|
||||
|
||||
/**
|
||||
* 选中图标
|
||||
* @param filter lay-filter
|
||||
* @param iconName 图标名称,自动识别fontClass/unicode
|
||||
*/
|
||||
IconPicker.prototype.checkIcon = function (filter, iconName){
|
||||
var el = $('*[lay-filter='+ filter +']'),
|
||||
p = el.next().find('.layui-iconpicker-item .layui-icon'),
|
||||
c = iconName;
|
||||
|
||||
if (c.indexOf('#xe') > 0){
|
||||
p.html(c);
|
||||
} else {
|
||||
p.html('').attr('class', 'layui-icon ' + c);
|
||||
}
|
||||
el.attr('value', c).val(c);
|
||||
};
|
||||
|
||||
var iconPicker = new IconPicker();
|
||||
exports(_MOD, iconPicker);
|
||||
});
|
||||
@@ -12,14 +12,67 @@ body,
|
||||
transition: all .3s;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side {
|
||||
top: 60px!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-logo {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-side-scroll {
|
||||
height: 100%!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-side .layui-side-scroll {
|
||||
height: 100%!important;
|
||||
}
|
||||
|
||||
.pear-admin .layui-header.dark-theme .layui-layout-control .layui-this *{
|
||||
background-color: rgba(0,0,0,.1)!important;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header {
|
||||
z-index: 99999;
|
||||
width: 100%;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-layout-left {
|
||||
left: 230px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-logo .title {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header .layui-layout-control {
|
||||
display: inline-block;
|
||||
left: 370px;
|
||||
}
|
||||
|
||||
.pear-admin.banner-layout .layui-header.dark-theme {
|
||||
box-shadow: 2px 0 6px rgb(0 21 41 / 35%);
|
||||
}
|
||||
|
||||
.pear-admin .layui-header .layui-logo {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-admin .layui-logo .title {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.pear-admin .layui-layout-right .layui-nav-child {
|
||||
border: 1px solid whitesmoke;
|
||||
border-radius: 6px;
|
||||
width: 150px;
|
||||
border-radius: 4px;
|
||||
width: auto;
|
||||
left: auto;
|
||||
right: -23px;
|
||||
}
|
||||
|
||||
.pear-admin .layui-header {
|
||||
@@ -29,11 +82,6 @@ body,
|
||||
border-bottom: 1px solid whitesmoke;
|
||||
}
|
||||
|
||||
.pear-admin .layui-header .layui-nav-img {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.pear-admin .layui-layout-control {
|
||||
left: 140px;
|
||||
position: absolute;
|
||||
@@ -45,10 +93,11 @@ body,
|
||||
|
||||
.pear-admin .layui-logo {
|
||||
width: 230px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
height: 59px;
|
||||
line-height: 59px;
|
||||
position: relative;
|
||||
background-color: #28333E;
|
||||
border-bottom: 1px solid rgba(0, 0, 0, .12);
|
||||
}
|
||||
|
||||
.pear-admin .layui-logo img {
|
||||
@@ -103,12 +152,29 @@ body,
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
/** 隐 藏 布 局 样 式 */
|
||||
.pear-mini .layui-logo .title {
|
||||
.pear-admin .layui-footer {
|
||||
position: absolute;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
left: 230px;
|
||||
background: #fff;
|
||||
border-top: 1px solid #F2F2F2;
|
||||
box-shadow: none;
|
||||
-webkit-transition: left .3s;
|
||||
transition: left .3s;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pear-admin .layui-footer.close {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-mini .layui-logo .logo {
|
||||
/** 收缩布局 */
|
||||
.pear-mini .layui-side .layui-logo .title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-mini .layui-side .layui-logo .logo {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
@@ -125,10 +191,14 @@ body,
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-logo {
|
||||
.pear-mini .layui-side .layui-logo {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-footer {
|
||||
left: 60px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-nav-tree .layui-nav-item span {
|
||||
display: none;
|
||||
}
|
||||
@@ -155,7 +225,7 @@ body,
|
||||
display: none;
|
||||
}
|
||||
|
||||
.pear-collasped-pe {
|
||||
.pear-collapsed-pe {
|
||||
display: none;
|
||||
width: 50px;
|
||||
position: absolute;
|
||||
@@ -170,7 +240,7 @@ body,
|
||||
box-shadow: 2px 0 6px rgba(0, 21, 41, .35);
|
||||
}
|
||||
|
||||
.pear-collasped-pe a {
|
||||
.pear-collapsed-pe a {
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
@@ -188,11 +258,11 @@ body,
|
||||
|
||||
/** 新增兼容 */
|
||||
@media screen and (max-width:768px) {
|
||||
.collaspe {
|
||||
.collapse {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.pear-collasped-pe {
|
||||
.pear-collapsed-pe {
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
@@ -213,7 +283,6 @@ body,
|
||||
height: calc(100% - 62px);
|
||||
}
|
||||
|
||||
/** 隐 藏 布 局 样 式 */
|
||||
.pear-mini .layui-side {
|
||||
width: 0px;
|
||||
}
|
||||
@@ -227,6 +296,10 @@ body,
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-footer {
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.pear-mini .layui-logo {
|
||||
width: 0px;
|
||||
}
|
||||
@@ -292,22 +365,50 @@ body,
|
||||
|
||||
}
|
||||
|
||||
/** 亮色侧边风格 */
|
||||
.light-theme .layui-logo {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.light-theme .layui-side-scroll {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
/** 侧边主题 (亮) */
|
||||
.light-theme.layui-side {
|
||||
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, .05) !important;
|
||||
}
|
||||
|
||||
/** 主 题 选 择 界 面 样 式 */
|
||||
.light-theme.layui-side .layui-logo {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
border-bottom: 1px whitesmoke solid;
|
||||
}
|
||||
|
||||
.light-theme.layui-side .layui-side-scroll {
|
||||
background-color: white !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header {
|
||||
border-bottom: none;
|
||||
background-color: #28333E;
|
||||
color: whitesmoke;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header li>a{
|
||||
color: whitesmoke!important;
|
||||
}
|
||||
|
||||
.dark-theme.layui-header .layui-logo {
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/** 顶部主题 (白) */
|
||||
.light-theme.layui-header .layui-logo {
|
||||
background-color: white;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/** 主题面板 */
|
||||
.pearone-color .set-text {
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
}
|
||||
|
||||
.pearone-color .color-title {
|
||||
padding: 15px 0 0px 20px;
|
||||
margin-bottom: 4px;
|
||||
@@ -390,57 +491,70 @@ body,
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
/** 友情链接 */
|
||||
.more-setting {
|
||||
margin-top: 45px;
|
||||
.message .layui-tab-title li:not(:last-child) {
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
|
||||
.more-setting form {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.more-setting-title {
|
||||
padding: 15px 0 0px 20px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.more-setting .layui-form-label {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.more-menu-list {
|
||||
width: 100%;
|
||||
margin-top: 80px;
|
||||
}
|
||||
|
||||
.more-menu-item:first-child {
|
||||
border-top: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
.more-menu-item .layui-icon {
|
||||
font-size: 18px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.more-menu-item {
|
||||
color: #595959;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 16px;
|
||||
padding: 0 25px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
font-style: normal;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.more-menu-item:hover {
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
.more-menu-item:after {
|
||||
color: #8c8c8c;
|
||||
right: 16px;
|
||||
content: "\e602";
|
||||
/* 搜索面板 */
|
||||
.menu-search-content .layui-input-prefix {
|
||||
position: absolute;
|
||||
font-family: layui-icon !important;
|
||||
margin-top: 10px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.menu-search-content .layui-input {
|
||||
padding-left: 30px;
|
||||
}
|
||||
|
||||
.menu-search-content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.menu-search-input-wrapper {
|
||||
width: 100%;
|
||||
padding: 15px 15px;
|
||||
}
|
||||
|
||||
.menu-search-no-data {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
height: 122px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.menu-search-list {
|
||||
width: 100%;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
|
||||
.menu-search-list li {
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
height: 50px;
|
||||
margin-bottom: 8px;
|
||||
padding: 0px 10px;
|
||||
color: currentColor;
|
||||
font-size: 14px;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px #d4d9e1;
|
||||
cursor: pointer;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.menu-search-list li:hover {
|
||||
background-color: #5FB878;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.menu-search-list li.this {
|
||||
background-color: #5FB878;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* 搜索面板结束 */
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
.top-panel-number {
|
||||
line-height: 60px;
|
||||
font-size: 30px;
|
||||
font-size: 29px;
|
||||
border-right: 1px solid #eceff9;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,10 @@
|
||||
.custom-tab .layui-tab-title li {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.list .list-item {
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
height: 31.8px;
|
||||
line-height: 31.8px;
|
||||
color: gray;
|
||||
padding: 5px;
|
||||
padding-left: 15px;
|
||||
@@ -0,0 +1,121 @@
|
||||
.pear-container {
|
||||
background-color: whitesmoke;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.pear-card {
|
||||
width: 100%;
|
||||
height: 66px;
|
||||
background-color: #F8F8F8;
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.pear-card:hover,
|
||||
.pear-card2:hover {
|
||||
box-shadow: 2px 0 8px 0 lightgray !important;
|
||||
}
|
||||
|
||||
.pear-card2 {
|
||||
width: 100%;
|
||||
height: 90px;
|
||||
background-color: #F8F8F8;
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.pear-card2 i {
|
||||
font-size: 30px;
|
||||
height: 90px;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
.pear-card i {
|
||||
font-size: 30px;
|
||||
height: 66px;
|
||||
line-height: 66px;
|
||||
}
|
||||
|
||||
.layui-col-md3 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pear-card-title {
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.person img {
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border-radius: 4px;
|
||||
margin-top: 8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.pear-card2 .count {
|
||||
color: #51A351;
|
||||
font-size: 30px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.pear-card2 .title {
|
||||
color: gray;
|
||||
font-size: 14px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.pear-card-status {
|
||||
padding: 0 10px 10px;
|
||||
}
|
||||
|
||||
.pear-card-status li {
|
||||
position: relative;
|
||||
padding: 10px 0;
|
||||
border-bottom: 1px solid #EEE;
|
||||
}
|
||||
|
||||
.pear-card-status li h3 {
|
||||
padding-bottom: 5px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.pear-card-status li p {
|
||||
padding-bottom: 10px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
.pear-card-status li>span {
|
||||
color: #999;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.pear-reply {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
bottom: 12px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
.person .title {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
margin-left: 18px;
|
||||
margin-top: 16px;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.person .desc {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-left: 115px;
|
||||
margin-top: -30px;
|
||||
position: absolute;
|
||||
display: inline-block;
|
||||
}
|
||||
@@ -391,14 +391,6 @@
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"msg": "not data",
|
||||
"count": 30,
|
||||
"data": [{
|
||||
"id": "1",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
"title": "Alipay",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "2",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png",
|
||||
"title": "Layui",
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "3",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "4",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "5",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/gLaIAoVWTtLbBWZNYEMg.png",
|
||||
"title": "Alipay",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "6",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iXjVmWVHbCJAyqvDxdtx.png",
|
||||
"title": "Layui",
|
||||
"remark": "生命就像一盒巧克力,结果往往出人意料",
|
||||
"time": "几秒前"
|
||||
}, {
|
||||
"id": "7",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/iZBVOIhGJiAnhplqjvZW.png",
|
||||
"title": "Angular",
|
||||
"remark": "希望是一个好东西,也许是最好的,好东西是不会消亡的",
|
||||
"time": "几秒前"
|
||||
},
|
||||
{
|
||||
"id": "8",
|
||||
"image": "https://gw.alipayobjects.com/zos/rmsportal/uMfMFlvUuceEyPpotzlq.png",
|
||||
"title": "React",
|
||||
"remark": "那是一种内在的东西, 他们到达不了,也无法触及的",
|
||||
"time": "几秒前"
|
||||
}
|
||||
],
|
||||
"code": 0
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
[{
|
||||
"id": 1,
|
||||
"title": "工作空间",
|
||||
"type": 0,
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 0,
|
||||
"href": "",
|
||||
"children": [{
|
||||
"id": 10,
|
||||
@@ -24,7 +24,7 @@
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "http://www.baidu.com"
|
||||
"href": "http://www.bing.com"
|
||||
}, {
|
||||
"id": 15,
|
||||
"title": "主题预览",
|
||||
@@ -32,6 +32,13 @@
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/system/theme.html"
|
||||
}, {
|
||||
"id": 16,
|
||||
"title": "酸爽翻倍",
|
||||
"icon": "layui-icon layui-icon-console",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/core.html"
|
||||
}]
|
||||
},
|
||||
{
|
||||
@@ -144,11 +151,18 @@
|
||||
"href": "view/document/drawer.html"
|
||||
}, {
|
||||
"id": 2022,
|
||||
"title": "消息通知",
|
||||
"title": "消息通知 (过时)",
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/notice.html"
|
||||
}, {
|
||||
"id": 2025,
|
||||
"title": "消息通知 (新增)",
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/toast.html"
|
||||
}, {
|
||||
"id": 2024,
|
||||
"title": "加载组件",
|
||||
@@ -195,7 +209,7 @@
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/document/hash.html"
|
||||
"href": "view/document/encrypt.html"
|
||||
},
|
||||
{
|
||||
"id": 2042,
|
||||
@@ -328,7 +342,7 @@
|
||||
"icon": "layui-icon layui-icon-face-cry",
|
||||
"type": 1,
|
||||
"openType": "_iframe",
|
||||
"href": "view/system/deptment.html"
|
||||
"href": "view/system/department.html"
|
||||
},
|
||||
{
|
||||
"id": 605,
|
||||
@@ -0,0 +1,127 @@
|
||||
[{
|
||||
"id": 1,
|
||||
"title": "通知",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "消息",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "代办",
|
||||
"children": [{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "你收到了 14 份新周报",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png",
|
||||
"title": "曲妮妮 已通过第三轮面试",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png",
|
||||
"title": "可以区分多种通知类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}, {
|
||||
"id": 12,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png",
|
||||
"title": "左侧图标用于区分不同的类型",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"avatar":"https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png",
|
||||
"title": "内容不要超过两行字",
|
||||
"context": "这是消息内容。",
|
||||
"form": "就眠仪式",
|
||||
"time": "刚刚"
|
||||
}]
|
||||
}
|
||||
]
|
||||
@@ -12,6 +12,7 @@
|
||||
"parentId": "0",
|
||||
"icon": "layui-icon-set-fill",
|
||||
"sort": 1,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "2",
|
||||
@@ -23,6 +24,7 @@
|
||||
"parentId": "1",
|
||||
"icon": "layui-icon-username",
|
||||
"sort": null,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "3",
|
||||
@@ -34,6 +36,7 @@
|
||||
"parentId": "1",
|
||||
"icon": "layui-icon-user",
|
||||
"sort": null,
|
||||
"enable": 1,
|
||||
"checkArr": "0"
|
||||
}, {
|
||||
"powerId": "4",
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"code": 0,
|
||||
"msg": "...",
|
||||
"count": 3,
|
||||
"data": [{
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "1",
|
||||
"roleName": "超级管理员",
|
||||
"roleCode": "admin",
|
||||
"enable": "1",
|
||||
"details": "超级管理员",
|
||||
"checked": false
|
||||
}, {
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "2",
|
||||
"roleName": "普通管理员",
|
||||
"roleCode": "manager",
|
||||
"enable": "0",
|
||||
"details": "普通管理员",
|
||||
"checked": false
|
||||
}, {
|
||||
"createTime": null,
|
||||
"createBy": null,
|
||||
"updateTime": null,
|
||||
"updateBy": null,
|
||||
"remark": null,
|
||||
"roleId": "3",
|
||||
"roleName": "普通用户",
|
||||
"roleCode": "pearson",
|
||||
"enable": "0",
|
||||
"details": "普通用户",
|
||||
"checked": false
|
||||
}]
|
||||
}
|
||||
@@ -27,7 +27,7 @@
|
||||
"avatar": null,
|
||||
"sex": "1",
|
||||
"phone": "1555324324234",
|
||||
"enable": "1",
|
||||
"enable": "0",
|
||||
"login": "1",
|
||||
"roleIds": null
|
||||
}, {
|
||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 87 KiB After Width: | Height: | Size: 87 KiB |
|
Before Width: | Height: | Size: 197 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 74 KiB |
@@ -18,15 +18,6 @@
|
||||
<animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="35s" type="rotate" from="0 210 530" to="360 210 530" repeatCount="indefinite"/>
|
||||
</path>
|
||||
|
||||
<circle cx="1200" cy="600" r="30" stroke="rgb(241, 243, 244)" fill="rgb(241, 243, 244)">
|
||||
<animateMotion path="M 0 0 L -20 40 Z" dur="9s" repeatCount="indefinite"/>
|
||||
</circle>
|
||||
|
||||
<path d="M 100 350 A 40 40 0 1 1 180 350 L 180 430 A 40 40 0 1 1 100 430 Z" stroke="rgb(241, 243, 244)" fill="rgb(241, 243, 244)">
|
||||
<animateMotion path="M 140 390 L 180 360 L 140 390" dur="20s" begin="0s" repeatCount="indefinite"/>
|
||||
<animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="30s" type="rotate" values="0 140 390; -60 140 390; 0 140 390" keyTimes="0 ; 0.5 ; 1" repeatCount="indefinite"/>
|
||||
</path>
|
||||
|
||||
<rect x="400" y="600" rx="40" ry="40" width="100" height="100" stroke="rgb(129, 201, 149)" fill="rgb(129, 201, 149)">
|
||||
<animateTransform attributeType="XML" attributeName="transform" begin="0s" dur="35s" type="rotate" from="-30 550 750" to="330 550 750" repeatCount="indefinite"/>
|
||||
</rect>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 296 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 55 KiB |
@@ -0,0 +1 @@
|
||||
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-view{display:block;position:relative;margin:10px 0;padding:0;border:1px solid #eee;border-left-width:6px;background-color:#fafafa;color:#333;font-family:Courier New;font-size:12px}.layui-code-h3{position:relative;padding:0 10px;height:40px;line-height:40px;border-bottom:1px solid #eee;font-size:12px}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 10px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view .layui-code-ol li:first-child{padding-top:10px}.layui-code-view .layui-code-ol li:last-child{padding-bottom:10px}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0c0c0c;border-left-color:#3f3f3f;background-color:#0c0c0c;color:#c2be9e}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3f3f3f;border-left:none}.layui-code-demo .layui-code{visibility:visible!important;margin:-15px;border-top:none;border-right:none;border-bottom:none}.layui-code-demo .layui-tab-content{padding:15px;border-top:none}
|
||||
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 701 B After Width: | Height: | Size: 701 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 299 KiB After Width: | Height: | Size: 299 KiB |
@@ -1,4 +1,3 @@
|
||||
/** Buttom 默认*/
|
||||
.pear-btn {
|
||||
display: inline-block;
|
||||
line-height: 38px;
|
||||
@@ -25,7 +24,6 @@
|
||||
opacity: .8;
|
||||
filter: alpha(opacity=80);
|
||||
color: #409eff;
|
||||
border-color: #c6e2ff;
|
||||
background-color: #ECF5FF;
|
||||
}
|
||||
|
||||
@@ -37,22 +35,23 @@
|
||||
line-height: 37px;
|
||||
color: #fff !important
|
||||
}
|
||||
|
||||
/** Button 主题 */
|
||||
.pear-btn-primary {
|
||||
background-color: #2D8CF0 !important;
|
||||
border: #2D8CF0;
|
||||
background-color: #2D8CF0 !important;
|
||||
}
|
||||
.pear-btn-danger {
|
||||
background-color: #f56c6c !important;
|
||||
border: #f56c6c;
|
||||
background-color: #f56c6c !important;
|
||||
}
|
||||
.pear-btn-warming {
|
||||
background-color: #f6ad55 !important;
|
||||
border: #f6ad55;
|
||||
background-color: #f6ad55 !important;
|
||||
}
|
||||
.pear-btn-success {
|
||||
background-color: #5FB878 !important;
|
||||
border: #5FB878;
|
||||
border: #36b368;
|
||||
background-color: #36b368 !important;
|
||||
}
|
||||
|
||||
.pear-btn[round] {
|
||||
@@ -60,9 +59,9 @@
|
||||
}
|
||||
|
||||
.pear-btn-primary[plain] {
|
||||
border: #409eff !important;
|
||||
color: #409eff !important;
|
||||
background: #ecf5ff 10% !important;
|
||||
border-color: #b3d8ff !important;
|
||||
}
|
||||
|
||||
.pear-btn-primary[plain]:hover {
|
||||
@@ -71,20 +70,20 @@
|
||||
}
|
||||
|
||||
.pear-btn-success[plain] {
|
||||
color: #67c23a !important;
|
||||
border: #36b368 !important;
|
||||
color: #36b368 !important;
|
||||
background: #f0f9eb !important;
|
||||
border-color: #c2e7b0 !important;
|
||||
}
|
||||
|
||||
.pear-btn-success[plain]:hover {
|
||||
color: white !important;
|
||||
background-color: #67c23a !important
|
||||
background-color: #36b368 !important
|
||||
}
|
||||
|
||||
.pear-btn-warming[plain] {
|
||||
border: #e6a23c !important;
|
||||
color: #e6a23c !important;
|
||||
background: #fdf6ec !important;
|
||||
border-color: #f5dab1 !important;
|
||||
}
|
||||
|
||||
.pear-btn-warming[plain]:hover {
|
||||
@@ -93,9 +92,9 @@
|
||||
}
|
||||
|
||||
.pear-btn-danger[plain] {
|
||||
border: #f56c6c !important;
|
||||
color: #f56c6c !important;
|
||||
background: #fef0f0 !important;
|
||||
border-color: #fbc4c4 !important;
|
||||
}
|
||||
|
||||
.pear-btn-danger[plain]:hover {
|
||||
@@ -69,10 +69,25 @@
|
||||
margin-left: -10px;
|
||||
}
|
||||
|
||||
.pear-card-component {
|
||||
.cloud-card-component {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.pear-card-component .layui-laypage .layui-laypage-curr .layui-laypage-em {
|
||||
border-radius: 0px !important;
|
||||
.cloud-card-component .layui-table-click {
|
||||
border-radius: 6px!important;
|
||||
}
|
||||
|
||||
.ew-table-loading {
|
||||
padding: 10px 0;
|
||||
text-align: center;
|
||||
}
|
||||
.ew-table-loading > i {
|
||||
color: #999;
|
||||
font-size: 30px;
|
||||
}
|
||||
.ew-table-loading.ew-loading-float {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |