@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
|
||||||
<data-source source="LOCAL" name="django6o293@localhost" uuid="ced7ba72-70fa-4aec-bfe7-bbc19ab2575b">
|
|
||||||
<driver-ref>mysql.8</driver-ref>
|
|
||||||
<synchronize>true</synchronize>
|
|
||||||
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
|
||||||
<jdbc-url>jdbc:mysql://localhost:3306/django6o293</jdbc-url>
|
|
||||||
<working-dir>$ProjectFileDir$</working-dir>
|
|
||||||
</data-source>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,34 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="django" name="Django">
|
|
||||||
<configuration>
|
|
||||||
<option name="rootFolder" value="$MODULE_DIR$" />
|
|
||||||
<option name="settingsModule" value="dj2/settings.py" />
|
|
||||||
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
|
|
||||||
<option name="environment" value="<map/>" />
|
|
||||||
<option name="doNotUseTestRunner" value="false" />
|
|
||||||
<option name="trackFilePattern" value="migrations" />
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
<component name="PyDocumentationSettings">
|
|
||||||
<option name="format" value="PLAIN" />
|
|
||||||
<option name="myDocStringFormat" value="Plain" />
|
|
||||||
</component>
|
|
||||||
<component name="TemplatesService">
|
|
||||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
|
||||||
<option name="TEMPLATE_FOLDERS">
|
|
||||||
<list>
|
|
||||||
<option value="$MODULE_DIR$/templates" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</module>
|
|
@ -1,12 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<profile version="1.0">
|
|
||||||
<option name="myName" value="Project Default" />
|
|
||||||
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
|
|
||||||
<option name="ignoredErrors">
|
|
||||||
<list>
|
|
||||||
<option value="N801" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</inspection_tool>
|
|
||||||
</profile>
|
|
||||||
</component>
|
|
@ -1,6 +0,0 @@
|
|||||||
<component name="InspectionProjectProfileManager">
|
|
||||||
<settings>
|
|
||||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
|
||||||
<version value="1.0" />
|
|
||||||
</settings>
|
|
||||||
</component>
|
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (django6o293)" project-jdk-type="Python SDK" />
|
|
||||||
</project>
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/django6o293.iml" filepath="$PROJECT_DIR$/.idea/django6o293.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,89 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package net.micode.notes.ui;
|
|
||||||
|
|
||||||
import java.util.Calendar;
|
|
||||||
|
|
||||||
import net.micode.notes.R;
|
|
||||||
import net.micode.notes.ui.DateTimePicker.OnDateTimeChangedListener;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.DialogInterface.OnClickListener;
|
|
||||||
import android.text.format.DateFormat;
|
|
||||||
import android.text.format.DateUtils;
|
|
||||||
|
|
||||||
public class DateTimePickerDialog extends AlertDialog implements OnClickListener {
|
|
||||||
|
|
||||||
private Calendar mDate = Calendar.getInstance();
|
|
||||||
private boolean mIs24HourView;
|
|
||||||
private OnDateTimeSetListener mOnDateTimeSetListener;
|
|
||||||
private DateTimePicker mDateTimePicker;
|
|
||||||
|
|
||||||
public interface OnDateTimeSetListener {
|
|
||||||
void onDateTimeSet(AlertDialog dialog, long date);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DateTimePickerDialog(Context context, long date) {
|
|
||||||
super(context);
|
|
||||||
mDateTimePicker = new DateTimePicker(context);
|
|
||||||
setView(mDateTimePicker);
|
|
||||||
mDateTimePicker.setOnDateTimeChangedListener(new OnDateTimeChangedListener() {
|
|
||||||
public void onDateTimeChanged(DateTimePicker int year, int month,
|
|
||||||
int dayOfMonth, int hourOfDay, int minute) {
|
|
||||||
mDate.set(Calendar.YEAR, year);
|
|
||||||
mDate.set(Calendar.MONTH, month);
|
|
||||||
mDate.set(Calendar.DAY_OF_MONTH, dayOfMonth);
|
|
||||||
mDate.set(Calendar.HOUR_OF_DAY, hourOfDay);
|
|
||||||
mDate.set(Calendar.MINUTE, minute);
|
|
||||||
updateTitle(mDate.getTimeInMillis());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mDate.setTimeInMillis(date);
|
|
||||||
mDate.set(Calendar.SECOND, 0);
|
|
||||||
mDateTimePicker.setCurrentDate(mDate.getTimeInMillis());
|
|
||||||
setButton(context.getString(R.string.datetime_dialog_ok), this);
|
|
||||||
setButton2(context.getString(R.string.datetime_dialog_cancel), (OnClickListener)null);
|
|
||||||
set24HourView(DateFormat.is24HourFormat(this.getContext()));
|
|
||||||
updateTitle(mDate.getTimeInMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void set24HourView(boolean is24HourView) {
|
|
||||||
mIs24HourView = is24HourView;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOnDateTimeSetListener(OnDateTimeSetListener callBack) {
|
|
||||||
mOnDateTimeSetListener = callBack;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateTitle(long date) {
|
|
||||||
int flag =
|
|
||||||
DateUtils.FORMAT_SHOW_YEAR |
|
|
||||||
DateUtils.FORMAT_SHOW_DATE |
|
|
||||||
DateUtils.FORMAT_SHOW_TIME;
|
|
||||||
flag |= mIs24HourView ? DateUtils.FORMAT_24HOUR : DateUtils.FORMAT_12HOUR;
|
|
||||||
setTitle(DateUtils.formatDateTime(this.getContext(), date, flag));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onClick() {
|
|
||||||
if (mOnDateTimeSetListener != null) {
|
|
||||||
mOnDateTimeSetListener.OnDateTimeSet(this, mDate.getTimeInMillis());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
[sql]
|
|
||||||
;support two sql,mysql and mssql,choose one
|
|
||||||
type = mysql
|
|
||||||
host = 127.0.0.1
|
|
||||||
port = 3306
|
|
||||||
user = root
|
|
||||||
passwd = 123456
|
|
||||||
db = django6o293
|
|
||||||
charset = utf8
|
|
@ -1,3 +0,0 @@
|
|||||||
import pymysql
|
|
||||||
|
|
||||||
pymysql.install_as_MySQLdb()
|
|
@ -1,171 +0,0 @@
|
|||||||
"""
|
|
||||||
Django settings for dj2 project.
|
|
||||||
|
|
||||||
Generated by 'django-admin startproject' using Django 2.0.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/2.0/topics/settings/
|
|
||||||
|
|
||||||
For the full list of settings and their values, see
|
|
||||||
https://docs.djangoproject.com/en/2.0/ref/settings/
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
from util.configread import config_read
|
|
||||||
|
|
||||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
||||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
||||||
|
|
||||||
# Quick-start development settings - unsuitable for production
|
|
||||||
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/
|
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
|
||||||
SECRET_KEY = 'w5yn#0gn2tt7pvu%hvwt0!lt=!$6+eqp4%m8)u3u#gknm@jm)k'
|
|
||||||
|
|
||||||
# SECURITY WARNING: don't run with debug turned on in production!
|
|
||||||
DEBUG = True
|
|
||||||
|
|
||||||
ALLOWED_HOSTS = ["*"]
|
|
||||||
|
|
||||||
# Application definition
|
|
||||||
|
|
||||||
INSTALLED_APPS = [
|
|
||||||
'django.contrib.admin',
|
|
||||||
'django.contrib.auth',
|
|
||||||
'django.contrib.contenttypes',
|
|
||||||
'django.contrib.sessions',
|
|
||||||
'django.contrib.messages',
|
|
||||||
'django.contrib.staticfiles',
|
|
||||||
"main",
|
|
||||||
]
|
|
||||||
|
|
||||||
MIDDLEWARE = [
|
|
||||||
'django.middleware.security.SecurityMiddleware',
|
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
||||||
'django.middleware.common.CommonMiddleware',
|
|
||||||
# 'django.middleware.csrf.CsrfViewMiddleware',#Forbidden (CSRF cookie not set.)
|
|
||||||
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
||||||
'django.contrib.messages.middleware.MessageMiddleware',
|
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
|
||||||
'threadlocals.middleware.ThreadLocalMiddleware',
|
|
||||||
"xmiddleware.xparam.Xparam",
|
|
||||||
"xmiddleware.xauth.Xauth",
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
|
|
||||||
SESSION_COOKIE_NAME = "sessionid"
|
|
||||||
SESSION_COOKIE_PATH = "/"
|
|
||||||
SESSION_COOKIE_DOMAIN = None
|
|
||||||
SESSION_COOKIE_SECURE = False
|
|
||||||
SESSION_COOKIE_HTTPONLY = True
|
|
||||||
SESSION_COOKIE_AGE = 1209600
|
|
||||||
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
|
|
||||||
SESSION_SAVE_EVERY_REQUEST = False
|
|
||||||
|
|
||||||
ROOT_URLCONF = 'dj2.urls'
|
|
||||||
TEMPLATES_DIR = os.path.join(BASE_DIR, "templates")
|
|
||||||
TEMPLATES = [
|
|
||||||
{
|
|
||||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
||||||
'DIRS': [TEMPLATES_DIR],
|
|
||||||
'APP_DIRS': True,
|
|
||||||
'OPTIONS': {
|
|
||||||
'context_processors': [
|
|
||||||
'django.template.context_processors.debug',
|
|
||||||
'django.template.context_processors.request',
|
|
||||||
'django.contrib.auth.context_processors.auth',
|
|
||||||
'django.contrib.messages.context_processors.messages',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
WSGI_APPLICATION = 'dj2.wsgi.application'
|
|
||||||
|
|
||||||
# Database
|
|
||||||
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
|
|
||||||
|
|
||||||
# DATABASES = {
|
|
||||||
# 'default': {
|
|
||||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
|
|
||||||
dbtype, host, port, user, passwd, dbName, charset = config_read("config.ini")
|
|
||||||
dbName=dbName.replace(" ","").strip()
|
|
||||||
print(dbtype, host, port, user, passwd, dbName, charset)
|
|
||||||
|
|
||||||
if dbtype == 'mysql':
|
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
# 'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
|
|
||||||
'ENGINE': 'django.db.backends.mysql',
|
|
||||||
'OPTIONS': {
|
|
||||||
'sql_mode': 'traditional',
|
|
||||||
'init_command': "SET sql_mode='traditional'", # STRICT_TRANS_TABLES
|
|
||||||
},
|
|
||||||
'NAME': dbName,
|
|
||||||
'USER': user,
|
|
||||||
'PASSWORD': passwd,
|
|
||||||
'HOST': host,
|
|
||||||
'PORT': port,
|
|
||||||
'charset': charset,
|
|
||||||
'TEST': {
|
|
||||||
'CHARSET': charset,
|
|
||||||
'COLLATION': 'utf8_general_ci',
|
|
||||||
},
|
|
||||||
'CONN_MAX_AGE':60
|
|
||||||
},
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
print("请使用mysql5.5数据库")
|
|
||||||
os._exit(1)
|
|
||||||
# Password validation
|
|
||||||
# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators
|
|
||||||
|
|
||||||
AUTH_PASSWORD_VALIDATORS = [
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
# Internationalization
|
|
||||||
# https://docs.djangoproject.com/en/2.0/topics/i18n/
|
|
||||||
|
|
||||||
LANGUAGE_CODE = 'zh-Hans'
|
|
||||||
|
|
||||||
TIME_ZONE = 'UTC'
|
|
||||||
|
|
||||||
USE_I18N = True
|
|
||||||
|
|
||||||
USE_L10N = True
|
|
||||||
|
|
||||||
USE_TZ = True
|
|
||||||
|
|
||||||
# Static files (CSS, JavaScript, Images)
|
|
||||||
# https://docs.djangoproject.com/en/2.0/howto/static-files/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
STATIC_URL = '/assets/'
|
|
||||||
STATICFILES_DIRS =[
|
|
||||||
os.path.join(BASE_DIR, "templates/front/assets"),
|
|
||||||
]
|
|
||||||
|
|
||||||
# media
|
|
||||||
MEDIA_URL = "/media/" # 自定义
|
|
||||||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') # 自定义
|
|
||||||
if os.path.isdir(MEDIA_ROOT) == False:
|
|
||||||
os.mkdir(MEDIA_ROOT)
|
|
@ -1,101 +0,0 @@
|
|||||||
"""dj2 URL Configuration
|
|
||||||
|
|
||||||
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
||||||
https://docs.djangoproject.com/en/2.0/topics/http/urls/
|
|
||||||
Examples:
|
|
||||||
Function views
|
|
||||||
1. Add an import: from my_app import views
|
|
||||||
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
||||||
Class-based views
|
|
||||||
1. Add an import: from other_app.views import Home
|
|
||||||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
||||||
Including another URLconf
|
|
||||||
1. Import the include() function: from django.urls import include, path
|
|
||||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
||||||
"""
|
|
||||||
import os
|
|
||||||
from django.contrib import admin
|
|
||||||
from django.urls import path,include,re_path
|
|
||||||
from django.conf.urls import url
|
|
||||||
from django.views.static import serve
|
|
||||||
from django.views.generic import TemplateView
|
|
||||||
|
|
||||||
|
|
||||||
from . import views
|
|
||||||
from dj2.settings import dbName as schemaName
|
|
||||||
|
|
||||||
urlpatterns = [
|
|
||||||
path('xadmin/', admin.site.urls),
|
|
||||||
path(r'index/',views.index),
|
|
||||||
re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)$', views.admin_lib2),
|
|
||||||
re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.admin_lib3),
|
|
||||||
re_path(r'admin/lib/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.admin_lib4),
|
|
||||||
re_path(r'admin/page/(?P<p1>.*)$', views.admin_page),
|
|
||||||
re_path(r'admin/page/(?P<p1>.*)/(?P<p2>.*)$', views.admin_page2),
|
|
||||||
re_path(r'admin/pages/(?P<p1>.*)$', views.admin_pages),
|
|
||||||
re_path(r'admin/pages/(?P<p1>.*)/(?P<p2>.*)$', views.admin_pages2),
|
|
||||||
|
|
||||||
re_path(r'front/(?P<p1>.*)$', views.schema_front1),
|
|
||||||
re_path(r'front/(?P<p1>.*)/(?P<p2>.*)$', views.schema_front2),
|
|
||||||
re_path(r'front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.schema_front3),
|
|
||||||
re_path(r'front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.schema_front4),
|
|
||||||
re_path(r'{}/front/(?P<p1>.*)$'.format(schemaName), views.schema_front1),
|
|
||||||
re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)$'.format(schemaName), views.schema_front2),
|
|
||||||
re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$'.format(schemaName), views.schema_front3),
|
|
||||||
re_path(r'{}/front/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$'.format(schemaName), views.schema_front4),
|
|
||||||
# re_path(r'assets/(?P<p1>.*)$', views.assets1),
|
|
||||||
# re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)$', views.assets2),
|
|
||||||
# re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.assets3),
|
|
||||||
# re_path(r'assets/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.assets4),
|
|
||||||
#re_path(r'admin/(?P<p1>.*)$', views.admin_file1),
|
|
||||||
re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)$', views.admin_file2),
|
|
||||||
re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.admin_file3),
|
|
||||||
re_path(r'admin/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.admin_file4),
|
|
||||||
re_path(r'layui/(?P<p1>.*)$', views.layui1),
|
|
||||||
re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)$', views.layui2),
|
|
||||||
re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)$', views.layui3),
|
|
||||||
re_path(r'layui/(?P<p1>.*)/(?P<p2>.*)/(?P<p3>.*)/(?P<p4>.*)$', views.layui4),
|
|
||||||
re_path(r'pages/(?P<p1>.*)$', views.front_pages),
|
|
||||||
re_path(r'pages/(?P<p1>.*)/(?P<p2>.*)$', views.front_pages2),
|
|
||||||
# re_path(r'pages/(?P<p1>.*)$', views.front_file1),
|
|
||||||
# re_path(r'(?P<p1>css|jss|img|image|iamges|font|fonts)/(?P<p2>.*)$', views.front_file2),
|
|
||||||
re_path(r'modules/(?P<p1>.*)$', views.front_modules),
|
|
||||||
re_path(r'css/(?P<p1>.*)$', views.css1),
|
|
||||||
re_path(r'js/(?P<p1>.*)$', views.js1),
|
|
||||||
re_path(r'img/(?P<p1>.*)$', views.img1),
|
|
||||||
path(r'test/<str:p1>/',views.test),
|
|
||||||
path(r'null',views.null),
|
|
||||||
path('{}/'.format(schemaName),include('main.urls')),#导入schemaName
|
|
||||||
]
|
|
||||||
|
|
||||||
#判断admin使用vue还是jquery
|
|
||||||
if os.path.isdir(os.path.join(os.getcwd(),"templates/front/admin/dist/")):
|
|
||||||
urlpatterns.extend([
|
|
||||||
path(r'{}/admin/dist/index.html'.format(schemaName),
|
|
||||||
TemplateView.as_view(template_name='front/admin/dist/index.html')),
|
|
||||||
path(r'{}/admin/'.format(schemaName), TemplateView.as_view(template_name='front/admin/dist/index.html')),
|
|
||||||
# 以下是后台admin的url匹配规则
|
|
||||||
path(r'admin/dist/index.html'.format(schemaName),
|
|
||||||
TemplateView.as_view(template_name='front/admin/dist/index.html')),
|
|
||||||
path(r'admin/', TemplateView.as_view(template_name='front/admin/dist/index.html')),
|
|
||||||
])
|
|
||||||
else:
|
|
||||||
urlpatterns.extend([
|
|
||||||
path(r'{}/admin/index.html'.format(schemaName),
|
|
||||||
TemplateView.as_view(template_name='front/admin/index.html')),
|
|
||||||
path(r'{}/admin/'.format(schemaName), TemplateView.as_view(template_name='front/admin/index.html')),
|
|
||||||
# 以下是后台admin的url匹配规则
|
|
||||||
path(r'admin/index.html'.format(schemaName),
|
|
||||||
TemplateView.as_view(template_name='front/admin/index.html')),
|
|
||||||
path(r'admin/', TemplateView.as_view(template_name='front/admin/index.html')),
|
|
||||||
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
if os.path.isfile(os.path.join(os.getcwd(),"templates/front/index.html")):
|
|
||||||
urlpatterns.extend([
|
|
||||||
path(r'index.html', TemplateView.as_view(template_name='front/index.html')),
|
|
||||||
path(r'{}/index.html'.format(schemaName), TemplateView.as_view(template_name='front/index.html')),
|
|
||||||
path(r'{}/front/index.html'.format(schemaName), TemplateView.as_view(template_name='front/index.html')),
|
|
||||||
path(r'', TemplateView.as_view(template_name='front/index.html')),
|
|
||||||
])
|
|
@ -1,963 +0,0 @@
|
|||||||
# coding:utf-8
|
|
||||||
__author__ = "ila"
|
|
||||||
import os,sys
|
|
||||||
from django.http import JsonResponse, HttpResponse
|
|
||||||
from django.apps import apps
|
|
||||||
|
|
||||||
|
|
||||||
def index(request):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
msg = {"code": 200, "msg": "success", "data": []}
|
|
||||||
print("=================>index")
|
|
||||||
# allModels = apps.get_app_config('main').get_models()
|
|
||||||
# for m in allModels:
|
|
||||||
# print(m.__tablename__)
|
|
||||||
# print(dir(m))
|
|
||||||
# # for col in m._meta.fields:
|
|
||||||
# # print("col name============>",col.name)
|
|
||||||
# # print("col type============>",col.get_internal_type())
|
|
||||||
# print(allModels)
|
|
||||||
|
|
||||||
return JsonResponse(msg)
|
|
||||||
|
|
||||||
|
|
||||||
def test(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
msg = {"code": 200, "msg": "success", "data": []}
|
|
||||||
print("=================>index ", p1)
|
|
||||||
return JsonResponse(msg)
|
|
||||||
|
|
||||||
def null(request,):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
msg = {"code": 200, "msg": "success", "data": []}
|
|
||||||
return JsonResponse(msg)
|
|
||||||
|
|
||||||
def check_suffix(filelName,path1):
|
|
||||||
try:
|
|
||||||
image_data = open(path1, "rb").read()
|
|
||||||
except:
|
|
||||||
image_data = "no file"
|
|
||||||
if '.js' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
elif '.jpg' in filelName or '.jpeg' in filelName or '.png' in filelName or '.gif' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="image/png")
|
|
||||||
elif '.css' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="text/css")
|
|
||||||
elif '.ttf' in filelName or '.woff' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
elif '.mp4' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
elif '.mp3' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
elif '.csv' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/CSV")
|
|
||||||
elif '.doc' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/msword")
|
|
||||||
elif '.docx' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/vnd.openxmlformats-officedocument.wordprocessingml.document")
|
|
||||||
elif '.xls' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/vnd.ms-excel")
|
|
||||||
elif '.xlsx' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
|
||||||
elif '.ppt' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/vnd.ms-powerpoint")
|
|
||||||
elif '.pptx' in filelName:
|
|
||||||
return HttpResponse(image_data, content_type="application/vnd.openxmlformats-officedocument.presentationml.presentation")
|
|
||||||
else:
|
|
||||||
return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def admin_lib2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/lib/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_lib3(request, p1, p2, p3):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/lib/", p1, p2, p3)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p3 or '.jpeg' in p3 or '.png' in p3 or '.gif' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p3 or '.woff' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_lib4(request, p1, p2, p3, p4):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/lib/", p1, p2, p3, p4)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p4 or '.jpeg' in p4 or '.png' in p4 or '.gif' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p4 or '.woff' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_page(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/page/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_page2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/page/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_pages(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/pages/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_pages2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/pages/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_file1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_file2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/", p1, p2)
|
|
||||||
if not os.path.isfile(path1):
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/dist/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_file3(request, p1, p2, p3):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/", p1, p2, p3)
|
|
||||||
|
|
||||||
if not os.path.isfile(path1):
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/dist/", p1, p2,p3)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p3 or '.jpeg' in p3 or '.png' in p3 or '.gif' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p3 or '.woff' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def admin_file4(request, p1, p2, p3, p4):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/", p1, p2, p3, p4)
|
|
||||||
if not os.path.isfile(path1):
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/admin/dist/", p1, p2,p3,p4)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p4 or '.jpeg' in p4 or '.png' in p4 or '.gif' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p4 or '.woff' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def front_pages(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/pages/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def front_pages2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/pages/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def layui1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/layui/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def layui2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/layui/", p1, p2)
|
|
||||||
print("layui2 path1========================>",path1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def layui3(request, p1, p2, p3):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/layui/", p1, p2, p3)
|
|
||||||
print("layui3 path1========================>",path1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
#
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p3 or '.jpeg' in p3 or '.png' in p3 or '.gif' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p3 or '.woff' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def layui4(request, p1, p2, p3, p4):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/layui/", p1, p2, p3, p4)
|
|
||||||
print("layui4 path1========================>",path1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p4 or '.jpeg' in p4 or '.png' in p4 or '.gif' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p4 or '.woff' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def pages1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/pages/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def pages2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/pages/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def front_file1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def front_file2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def schema_front1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def schema_front2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def schema_front3(request, p1, p2, p3):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1, p2, p3)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p3 or '.jpeg' in p3 or '.png' in p3 or '.gif' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p3 or '.woff' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def schema_front4(request, p1, p2, p3, p4):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/", p1, p2, p3, p4)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p4 or '.jpeg' in p4 or '.png' in p4 or '.gif' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p4 or '.woff' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def assets1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/assets/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# elif '.map' in p1:
|
|
||||||
# return JsonResponse({})
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def assets2(request, p1, p2):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/assets/", p1, p2)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p2 or '.jpeg' in p2 or '.png' in p2 or '.gif' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p2 or '.woff' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p2:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# elif '.map' in p2:
|
|
||||||
# return JsonResponse({})
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def assets3(request, p1, p2, p3):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/assets/", p1, p2, p3)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p3 or '.jpeg' in p3 or '.png' in p3 or '.gif' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p3 or '.woff' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p3:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# elif '.map' in p3:
|
|
||||||
# return JsonResponse({})
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
|
|
||||||
def assets4(request, p1, p2, p3, p4):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/assets/", p1, p2, p3, p4)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p4 or '.jpeg' in p4 or '.png' in p4 or '.gif' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p4 or '.woff' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p4:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# elif '.map' in p4:
|
|
||||||
# return JsonResponse({})
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def css1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/css/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def js1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/js/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
|
|
||||||
def img1(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/img/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
||||||
|
|
||||||
# try:
|
|
||||||
# image_data = open(path1, "rb").read()
|
|
||||||
# except:
|
|
||||||
# image_data="no file"
|
|
||||||
# if '.js' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/javascript")
|
|
||||||
# elif '.jpg' in p1 or '.jpeg' in p1 or '.png' in p1 or '.gif' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="image/png")
|
|
||||||
# elif '.css' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="text/css")
|
|
||||||
# elif '.ttf' in p1 or '.woff' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="application/octet-stream")
|
|
||||||
# elif '.mp4' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="video/mp4")
|
|
||||||
# elif '.mp3' in p1:
|
|
||||||
# return HttpResponse(image_data, content_type="audio/mp3")
|
|
||||||
# else:
|
|
||||||
# return HttpResponse(image_data, content_type="text/html")
|
|
||||||
def front_modules(request, p1):
|
|
||||||
if request.method in ["GET", "POST"]:
|
|
||||||
fullPath = request.get_full_path()
|
|
||||||
print("{}=============>".format(sys._getframe().f_code.co_name), fullPath)
|
|
||||||
path1 = os.path.join(os.getcwd(), "templates/front/modules/", p1)
|
|
||||||
|
|
||||||
return check_suffix(eval(eval(sys._getframe().f_code.co_name).__code__.co_varnames[-3]),path1)
|
|
@ -1,16 +0,0 @@
|
|||||||
"""
|
|
||||||
WSGI config for dj2 project.
|
|
||||||
|
|
||||||
It exposes the WSGI callable as a module-level variable named ``application``.
|
|
||||||
|
|
||||||
For more information on this file, see
|
|
||||||
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from django.core.wsgi import get_wsgi_application
|
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj2.settings")
|
|
||||||
|
|
||||||
application = get_wsgi_application()
|
|
@ -1,53 +0,0 @@
|
|||||||
# coding:utf-8
|
|
||||||
# author:ila
|
|
||||||
import click,py_compile,os
|
|
||||||
from configparser import ConfigParser
|
|
||||||
from util.configread import config_read
|
|
||||||
from util.sqlinit import Create
|
|
||||||
@click.group()
|
|
||||||
def sub():
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
def initdb(ini="config.ini"):
|
|
||||||
dbtype, host, port, user, passwd, dbName, charset = config_read(ini)
|
|
||||||
if dbtype == 'mysql':
|
|
||||||
cm = Create(dbtype, host, port, user, passwd, dbName, charset)
|
|
||||||
cm.create_db("CREATE DATABASE IF NOT EXISTS `{}` /*!40100 DEFAULT CHARACTER SET utf8 */ ;".format(dbName))
|
|
||||||
|
|
||||||
cm.conn_close()
|
|
||||||
elif dbtype == 'mssql':
|
|
||||||
cm = Create(dbtype, host, port, user, passwd, dbName, charset)
|
|
||||||
cm.create_db("CREATE DATABASE IF NOT EXISTS `{}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;".format(dbName))
|
|
||||||
|
|
||||||
cm.conn_close()
|
|
||||||
else:
|
|
||||||
print('请修改当前面目录下的config.ini文件')
|
|
||||||
|
|
||||||
@click.command()
|
|
||||||
def initsql(ini="config.ini"):
|
|
||||||
dbtype, host, port, user, passwd, dbName, charset = config_read(ini)
|
|
||||||
if dbtype == 'mysql':
|
|
||||||
cm = Create(dbtype, host, port, user, passwd, dbName, charset)
|
|
||||||
cm.create_db("CREATE DATABASE IF NOT EXISTS `{}` /*!40100 DEFAULT CHARACTER SET utf8 */ ;".format(dbName))
|
|
||||||
with open("./db/mysql.sql", encoding="utf8") as f:
|
|
||||||
createsql = f.read()
|
|
||||||
createsql = "DROP TABLE" + createsql.split('DROP TABLE', 1)[-1]
|
|
||||||
cm.create_tables(createsql.split(';')[:-1])
|
|
||||||
cm.conn_close()
|
|
||||||
elif dbtype == 'mssql':
|
|
||||||
cm = Create(dbtype, host, port, user, passwd, dbName, charset)
|
|
||||||
cm.create_db("CREATE DATABASE IF NOT EXISTS `{}` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;".format(dbName))
|
|
||||||
with open("./db/mssql.sql", encoding="utf8") as f:
|
|
||||||
createsql = f.read()
|
|
||||||
createsql = "DROP TABLE" + createsql.split('DROP TABLE', 1)[-1]
|
|
||||||
cm.create_tables(createsql.split(';')[:-1])
|
|
||||||
cm.conn_close()
|
|
||||||
else:
|
|
||||||
print('请修改当前面目录下的config.ini文件')
|
|
||||||
|
|
||||||
sub.add_command(initdb,"initdb")
|
|
||||||
sub.add_command(initsql,"initsql")
|
|
||||||
if __name__ == "__main__":
|
|
||||||
sub()
|
|
@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj2.settings")
|
|
||||||
try:
|
|
||||||
from django.core.management import execute_from_command_line
|
|
||||||
except ImportError as exc:
|
|
||||||
raise ImportError(
|
|
||||||
"Couldn't import Django. Are you sure it's installed and "
|
|
||||||
"available on your PYTHONPATH environment variable? Did you "
|
|
||||||
"forget to activate a virtual environment?"
|
|
||||||
) from exc
|
|
||||||
execute_from_command_line(sys.argv)
|
|
@ -1,5 +0,0 @@
|
|||||||
django==2.0
|
|
||||||
django-threadlocals
|
|
||||||
pymysql
|
|
||||||
click
|
|
||||||
requests
|
|
Before Width: | Height: | Size: 332 KiB |
@ -1 +0,0 @@
|
|||||||
cnpm install
|
|
@ -1 +0,0 @@
|
|||||||
cnpm run serve
|
|
@ -1 +0,0 @@
|
|||||||
cnpm run build
|
|
@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: [
|
|
||||||
'@vue/cli-plugin-babel/preset'
|
|
||||||
]
|
|
||||||
}
|
|
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 4.7 KiB |
@ -1 +0,0 @@
|
|||||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="./favicon.ico"><title>后台管理系统</title><link href="./css/app.96d5f7b3.css" rel="preload" as="style"><link href="./css/chunk-vendors.a72b0961.css" rel="preload" as="style"><link href="./js/app.12858357.js" rel="preload" as="script"><link href="./js/chunk-vendors.27201129.js" rel="preload" as="script"><link href="./css/chunk-vendors.a72b0961.css" rel="stylesheet"><link href="./css/app.96d5f7b3.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but mas-creator-admin doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="./js/chunk-vendors.27201129.js"></script><script src="./js/app.12858357.js"></script></body></html>
|
|
@ -1,62 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "mas-creator-admin",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"serve": "vue-cli-service serve",
|
|
||||||
"build": "vue-cli-service build",
|
|
||||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
|
|
||||||
"lint": "vue-cli-service lint"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"axios": "^0.19.2",
|
|
||||||
"core-js": "^3.4.4",
|
|
||||||
"echarts": "^4.6.0",
|
|
||||||
"element-ui": "^2.13.0",
|
|
||||||
"js-md5": "^0.7.3",
|
|
||||||
"print-js": "^1.5.0",
|
|
||||||
"vue": "^2.6.10",
|
|
||||||
"vue-quill-editor": "^3.0.6",
|
|
||||||
"vue-amap": "^0.5.10",
|
|
||||||
"vue-json-excel": "^0.3.0",
|
|
||||||
"vue-router": "^3.1.5"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@vue/cli-plugin-babel": "^4.1.0",
|
|
||||||
"@vue/cli-plugin-eslint": "^4.1.0",
|
|
||||||
"@vue/cli-service": "^4.1.0",
|
|
||||||
"babel-eslint": "^10.0.3",
|
|
||||||
"babel-plugin-component": "^1.1.1",
|
|
||||||
"eslint": "^5.16.0",
|
|
||||||
"eslint-plugin-vue": "^5.0.0",
|
|
||||||
"node-sass": "^4.13.1",
|
|
||||||
"sass-loader": "^8.0.2",
|
|
||||||
"svg-sprite-loader": "4.1.3",
|
|
||||||
"svgo": "1.2.2",
|
|
||||||
"vue-template-compiler": "^2.6.10"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"plugin:vue/essential",
|
|
||||||
"eslint:recommended"
|
|
||||||
],
|
|
||||||
"rules": {
|
|
||||||
"no-console": "off",
|
|
||||||
"no-unused-vars": 0,
|
|
||||||
"no-useless-escape": "off"
|
|
||||||
},
|
|
||||||
"parserOptions": {
|
|
||||||
"parser": "babel-eslint"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"not ie <= 8",
|
|
||||||
"Android >= 4.0"
|
|
||||||
]
|
|
||||||
}
|
|
Before Width: | Height: | Size: 4.2 KiB |
@ -1,21 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
||||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
|
||||||
<title>后台管理系统</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<noscript>
|
|
||||||
<strong>We're sorry but mas-creator-admin doesn't work properly without JavaScript enabled. Please enable it to
|
|
||||||
continue.</strong>
|
|
||||||
</noscript>
|
|
||||||
<div id="app"></div>
|
|
||||||
<!-- built files will be auto injected -->
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
@ -1,30 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="app" class="">
|
|
||||||
<router-view></router-view>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: "app",
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
*{
|
|
||||||
padding: 0;
|
|
||||||
margin:0;
|
|
||||||
}
|
|
||||||
html,body{
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
#app{
|
|
||||||
height:100%;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,9 +0,0 @@
|
|||||||
/* 改变主题色变量 */
|
|
||||||
$--color-primary: #00c292 !default;
|
|
||||||
$--color-success: #67c23a !default;
|
|
||||||
$--color-warning: #e6a23c !default;
|
|
||||||
$--color-danger: #f56c6c !default;
|
|
||||||
$--color-info: #909399 !default;
|
|
||||||
/* 改变 icon 字体路径变量,必需 */
|
|
||||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
|
||||||
@import "~element-ui/packages/theme-chalk/src/index";
|
|
@ -1,47 +0,0 @@
|
|||||||
.form-content {
|
|
||||||
background: #ffffff;
|
|
||||||
padding: 10px 10px 0 10px;
|
|
||||||
}
|
|
||||||
.table-content {
|
|
||||||
background: #ffffff;
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
|
||||||
.pagination-content {
|
|
||||||
margin-top: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
.detail-form-content{
|
|
||||||
background: #ffffff;
|
|
||||||
padding: 10px;
|
|
||||||
.el-input{
|
|
||||||
min-width: 200px;
|
|
||||||
max-width: 600px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.bg {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.login-form {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
width: 350px;
|
|
||||||
height: 100%;
|
|
||||||
background: #ffffff;
|
|
||||||
padding: 0 60px;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.h1 {
|
|
||||||
margin-top: 80px;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.btn-login {
|
|
||||||
margin-top: 50px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 90 KiB |
Before Width: | Height: | Size: 4.1 MiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 1.2 KiB |
@ -1,43 +0,0 @@
|
|||||||
<template>
|
|
||||||
<svg :class="svgClass" aria-hidden="true" v-on="$listeners">
|
|
||||||
<use :xlink:href="iconName" />
|
|
||||||
</svg>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'SvgIcon',
|
|
||||||
props: {
|
|
||||||
iconClass: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
className: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
iconName() {
|
|
||||||
return `#icon-${this.iconClass}`
|
|
||||||
},
|
|
||||||
svgClass() {
|
|
||||||
if (this.className) {
|
|
||||||
return 'svg-icon ' + this.className
|
|
||||||
} else {
|
|
||||||
return 'svg-icon'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.svg-icon {
|
|
||||||
width: 1em;
|
|
||||||
height: 1em;
|
|
||||||
vertical-align: -0.15em;
|
|
||||||
fill: currentColor;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,109 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-breadcrumb class="app-breadcrumb" separator="(●'◡'●)" style="height:50px;backgroundColor:rgba(79, 73, 73, 1);borderRadius:0px;padding:0px 20px 0px 20px;boxShadow:;borderWidth:2px;borderStyle:;borderColor:rgba(193, 180, 180, 0.5);">
|
|
||||||
<transition-group name="breadcrumb" class="box" :style="1==1?'justifyContent:flex-start;':1==2?'justifyContent:center;':'justifyContent:flex-end;'">
|
|
||||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
|
||||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.name }}</span>
|
|
||||||
<a v-else @click.prevent="handleLink(item)">{{ item.name }}</a>
|
|
||||||
</el-breadcrumb-item>
|
|
||||||
</transition-group>
|
|
||||||
</el-breadcrumb>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import pathToRegexp from 'path-to-regexp'
|
|
||||||
import { generateTitle } from '@/utils/i18n'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
levelList: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
$route() {
|
|
||||||
this.getBreadcrumb()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getBreadcrumb()
|
|
||||||
this.breadcrumbStyleChange()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
generateTitle,
|
|
||||||
getBreadcrumb() {
|
|
||||||
// only show routes with meta.title
|
|
||||||
let route = this.$route
|
|
||||||
let matched = route.matched.filter(item => item.meta)
|
|
||||||
const first = matched[0]
|
|
||||||
matched = [{ path: '/index' }].concat(matched)
|
|
||||||
|
|
||||||
this.levelList = matched.filter(item => item.meta)
|
|
||||||
},
|
|
||||||
isDashboard(route) {
|
|
||||||
const name = route && route.name
|
|
||||||
if (!name) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return name.trim().toLocaleLowerCase() === 'Index'.toLocaleLowerCase()
|
|
||||||
},
|
|
||||||
pathCompile(path) {
|
|
||||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
||||||
const { params } = this.$route
|
|
||||||
var toPath = pathToRegexp.compile(path)
|
|
||||||
return toPath(params)
|
|
||||||
},
|
|
||||||
handleLink(item) {
|
|
||||||
const { redirect, path } = item
|
|
||||||
if (redirect) {
|
|
||||||
this.$router.push(redirect)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$router.push(path)
|
|
||||||
},
|
|
||||||
breadcrumbStyleChange(val) {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__separator').forEach(el=>{
|
|
||||||
el.innerText = "(●'◡'●)"
|
|
||||||
el.style.color = "rgba(235, 90, 170, 1)"
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner a').forEach(el=>{
|
|
||||||
el.style.color = "rgba(196, 212, 244, 1)"
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.app-breadcrumb .el-breadcrumb__inner .no-redirect').forEach(el=>{
|
|
||||||
el.style.color = "rgba(244, 149, 32, 1)"
|
|
||||||
})
|
|
||||||
|
|
||||||
let str = "vertical"
|
|
||||||
if("vertical" === str) {
|
|
||||||
let headHeight = "60px"
|
|
||||||
headHeight = parseInt(headHeight) + 10 + 'px'
|
|
||||||
document.querySelectorAll('.app-breadcrumb').forEach(el=>{
|
|
||||||
el.style.marginTop = headHeight
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.app-breadcrumb {
|
|
||||||
display: block;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 50px;
|
|
||||||
|
|
||||||
.box {
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.no-redirect {
|
|
||||||
color: #97a8be;
|
|
||||||
cursor: text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,77 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-breadcrumb class="app-breadcrumb" separator="/">
|
|
||||||
<transition-group name="breadcrumb">
|
|
||||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
|
|
||||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.name }}</span>
|
|
||||||
<a v-else @click.prevent="handleLink(item)">{{ item.name }}</a>
|
|
||||||
</el-breadcrumb-item>
|
|
||||||
</transition-group>
|
|
||||||
</el-breadcrumb>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import pathToRegexp from 'path-to-regexp'
|
|
||||||
import { generateTitle } from '@/utils/i18n'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
levelList: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
$route() {
|
|
||||||
this.getBreadcrumb()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getBreadcrumb()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
generateTitle,
|
|
||||||
getBreadcrumb() {
|
|
||||||
// only show routes with meta.title
|
|
||||||
console.log(this.$route)
|
|
||||||
let matched = this.$route.matched.filter(item => item.meta)
|
|
||||||
const first = matched[0]
|
|
||||||
matched = [{ path: '/index' }].concat(matched)
|
|
||||||
|
|
||||||
this.levelList = matched.filter(item => item.meta)
|
|
||||||
},
|
|
||||||
isDashboard(route) {
|
|
||||||
const name = route && route.name
|
|
||||||
if (!name) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return name.trim().toLocaleLowerCase() === 'Index'.toLocaleLowerCase()
|
|
||||||
},
|
|
||||||
pathCompile(path) {
|
|
||||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
||||||
const { params } = this.$route
|
|
||||||
var toPath = pathToRegexp.compile(path)
|
|
||||||
return toPath(params)
|
|
||||||
},
|
|
||||||
handleLink(item) {
|
|
||||||
const { redirect, path } = item
|
|
||||||
if (redirect) {
|
|
||||||
this.$router.push(redirect)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$router.push(path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.app-breadcrumb.el-breadcrumb {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 14px;
|
|
||||||
line-height: 50px;
|
|
||||||
margin-left: 8px;
|
|
||||||
|
|
||||||
.no-redirect {
|
|
||||||
color: #97a8be;
|
|
||||||
cursor: text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,60 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card class="box-card">
|
|
||||||
<div slot="header" class="header">
|
|
||||||
<span>{{title}}</span>
|
|
||||||
<span>
|
|
||||||
<el-tag size="small" :type="titleTag">{{titleUnit}}</el-tag>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="content">
|
|
||||||
{{content}}
|
|
||||||
<span class="unit">{{contentUnit}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="bottom">
|
|
||||||
<span>{{bottomTitle}}</span>
|
|
||||||
<span>
|
|
||||||
{{bottomContent}}
|
|
||||||
<i :class="bottomIcon"></i>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: [
|
|
||||||
"title",
|
|
||||||
"titleTag",
|
|
||||||
"titleUnit",
|
|
||||||
"content",
|
|
||||||
"contentUnit",
|
|
||||||
"bottomTitle",
|
|
||||||
"bottomContent",
|
|
||||||
"bottomIcon"
|
|
||||||
]
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.box-card {
|
|
||||||
margin-right: 10px;
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.content {
|
|
||||||
font-size: 30px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #666;
|
|
||||||
text-align: center;
|
|
||||||
.unit {
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.bottom {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,101 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home-comment">
|
|
||||||
<div class="title">用户留言</div>
|
|
||||||
<div class="comment-list">
|
|
||||||
<div v-for="(item,index) in list" v-bind:key="index" class="comment-item">
|
|
||||||
<div class="user-content">
|
|
||||||
<el-image
|
|
||||||
class="avator"
|
|
||||||
:src="item.avator"
|
|
||||||
></el-image>
|
|
||||||
<span class="user">{{item.name}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="comment">{{item.content}}</div>
|
|
||||||
<div class="create-time">{{item.createTime}}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
list: [
|
|
||||||
{
|
|
||||||
name: "MaskLin",
|
|
||||||
avator:
|
|
||||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
|
||||||
content:
|
|
||||||
"你以为只要长得漂亮就有男生喜欢?你以为只要有了钱漂亮妹子就自己贴上来了?你以为学霸就能找到好工作?我告诉你吧,这些都是真的!",
|
|
||||||
createTime: "5月02日 00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "MaskLin",
|
|
||||||
avator:
|
|
||||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
|
||||||
content: "作者太帅了",
|
|
||||||
createTime: "5月04日 00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "MaskLin",
|
|
||||||
avator:
|
|
||||||
"https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
|
||||||
content: "作者太帅了",
|
|
||||||
createTime: "5月04日 00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "MaskLin",
|
|
||||||
avator: "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
|
|
||||||
content: "作者太帅了",
|
|
||||||
createTime: "5月04日 00:00"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.home-comment {
|
|
||||||
background: #ffffff;
|
|
||||||
.title {
|
|
||||||
font-size: 18px;
|
|
||||||
color: #666;
|
|
||||||
font-weight: bold;
|
|
||||||
padding: 10px;
|
|
||||||
border-bottom: 1px solid #eeeeee;
|
|
||||||
}
|
|
||||||
.comment-list {
|
|
||||||
padding: 10px;
|
|
||||||
.comment-item {
|
|
||||||
padding: 10px;
|
|
||||||
border-bottom: 1px solid #eeeeee;
|
|
||||||
.user-content {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
.user {
|
|
||||||
font-size: 18px;
|
|
||||||
color: #666;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 50px;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
.avator {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.comment {
|
|
||||||
margin-top: 10px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #888888;
|
|
||||||
}
|
|
||||||
.create-time {
|
|
||||||
margin-top: 15px;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #888888;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,55 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="home-progress">
|
|
||||||
<div class="title">月访问量</div>
|
|
||||||
<div class="tip">同上期增长</div>
|
|
||||||
<el-progress
|
|
||||||
class="progress"
|
|
||||||
:text-inside="true"
|
|
||||||
:stroke-width="24"
|
|
||||||
:percentage="20"
|
|
||||||
status="success"
|
|
||||||
></el-progress>
|
|
||||||
<div class="title">月用户量</div>
|
|
||||||
<div class="tip">同上期增长</div>
|
|
||||||
<el-progress
|
|
||||||
class="progress"
|
|
||||||
:text-inside="true"
|
|
||||||
:stroke-width="24"
|
|
||||||
:percentage="50"
|
|
||||||
status="success"
|
|
||||||
></el-progress>
|
|
||||||
<div class="title">月收入</div>
|
|
||||||
<div class="tip">同上期减少</div>
|
|
||||||
<el-progress
|
|
||||||
class="progress"
|
|
||||||
:text-inside="true"
|
|
||||||
:stroke-width="24"
|
|
||||||
:percentage="28"
|
|
||||||
status="exception"
|
|
||||||
></el-progress>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
export default {};
|
|
||||||
</script>
|
|
||||||
<style lang="scss">
|
|
||||||
.home-progress {
|
|
||||||
background: #ffffff;
|
|
||||||
height: 400px;
|
|
||||||
padding: 20px;
|
|
||||||
.title {
|
|
||||||
color: #666666;
|
|
||||||
font-weight: bold;
|
|
||||||
font-size: 20px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.tip {
|
|
||||||
color: #888888;
|
|
||||||
font-size: 16px;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.progress {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,56 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-aside class="index-aside" width="200px">
|
|
||||||
<div class="index-aside-inner">
|
|
||||||
<el-menu default-active="1">
|
|
||||||
<el-menu-item @click="menuHandler('/')" index="1">
|
|
||||||
<!-- <i class="el-icon-s-home"></i> -->
|
|
||||||
首页
|
|
||||||
</el-menu-item>
|
|
||||||
<sub-menu
|
|
||||||
v-for="menu in menuList"
|
|
||||||
:key="menu.menuId"
|
|
||||||
:menu="menu"
|
|
||||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
|
||||||
></sub-menu>
|
|
||||||
</el-menu>
|
|
||||||
</div>
|
|
||||||
</el-aside>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import SubMenu from "@/components/index/IndexAsideSub";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
menuList: [],
|
|
||||||
dynamicMenuRoutes: []
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
SubMenu
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
// 获取动态菜单数据并且渲染
|
|
||||||
this.menuList = JSON.parse(sessionStorage.getItem("menuList") || "[]");
|
|
||||||
this.dynamicMenuRoutes = JSON.parse(
|
|
||||||
sessionStorage.getItem("dynamicMenuRoutes") || "[]"
|
|
||||||
);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
menuHandler(path) {
|
|
||||||
this.$router.push({ path: path });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.index-aside {
|
|
||||||
margin-top: 80px;
|
|
||||||
overflow: hidden;
|
|
||||||
.index-aside-inner {
|
|
||||||
width: 217px;
|
|
||||||
height: 100%;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,240 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-aside class="index-aside" height="100vh" width="210px">
|
|
||||||
<div class="index-aside-inner menulist" style="height:100%">
|
|
||||||
<div v-for="item in menuList" :key="item.roleName" v-if="role==item.roleName" class="menulist-item" style="height:100%;broder:0;background-color:#988181">
|
|
||||||
<div class="menulistImg" style="backgroundColor:#ff0000;padding:25px 0" v-if="false && menulistStyle == 'vertical'">
|
|
||||||
<el-image v-if="'http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg'" src="http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg" fit="cover" />
|
|
||||||
</div>
|
|
||||||
<el-menu mode="vertical" :unique-opened="true" class="el-menu-demo" style="height:100%;" background-color="#988181" text-color="#111010" active-text-color="#99EFED" default-active="0">
|
|
||||||
<el-menu-item index="0" :style="menulistBorderBottom" @click="menuHandler('')"><i v-if="true" class="el-icon-s-home" />首页</el-menu-item>
|
|
||||||
<el-submenu :index="1+''" :style="menulistBorderBottom">
|
|
||||||
<template slot="title">
|
|
||||||
<i v-if="true" class="el-icon-user-solid" />
|
|
||||||
<span>个人中心</span>
|
|
||||||
</template>
|
|
||||||
<el-menu-item :index="1-1" @click="menuHandler('updatePassword')">修改密码</el-menu-item>
|
|
||||||
<el-menu-item :index="1-2" @click="menuHandler('center')">个人信息</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
<el-submenu :style="menulistBorderBottom" v-for=" (menu,index) in item.backMenu" :key="menu.menu" :index="index+2+''">
|
|
||||||
<template slot="title">
|
|
||||||
<i v-if="true" :class="icons[index]" />
|
|
||||||
<span>{{ menu.menu }}</span>
|
|
||||||
</template>
|
|
||||||
<el-menu-item v-for=" (child,sort) in menu.child" :key="sort" :index="(index+2)+'-'+sort" @click="menuHandler(child.tableName)">{{ child.menu }}</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
</el-menu>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-aside>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import menu from '@/utils/menu'
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
menuList: [],
|
|
||||||
dynamicMenuRoutes: [],
|
|
||||||
role: '',
|
|
||||||
icons: [
|
|
||||||
'el-icon-s-cooperation',
|
|
||||||
'el-icon-s-order',
|
|
||||||
'el-icon-s-platform',
|
|
||||||
'el-icon-s-fold',
|
|
||||||
'el-icon-s-unfold',
|
|
||||||
'el-icon-s-operation',
|
|
||||||
'el-icon-s-promotion',
|
|
||||||
'el-icon-s-release',
|
|
||||||
'el-icon-s-ticket',
|
|
||||||
'el-icon-s-management',
|
|
||||||
'el-icon-s-open',
|
|
||||||
'el-icon-s-shop',
|
|
||||||
'el-icon-s-marketing',
|
|
||||||
'el-icon-s-flag',
|
|
||||||
'el-icon-s-comment',
|
|
||||||
'el-icon-s-finance',
|
|
||||||
'el-icon-s-claim',
|
|
||||||
'el-icon-s-custom',
|
|
||||||
'el-icon-s-opportunity',
|
|
||||||
'el-icon-s-data',
|
|
||||||
'el-icon-s-check',
|
|
||||||
'el-icon-s-grid',
|
|
||||||
'el-icon-menu',
|
|
||||||
'el-icon-chat-dot-square',
|
|
||||||
'el-icon-message',
|
|
||||||
'el-icon-postcard',
|
|
||||||
'el-icon-position',
|
|
||||||
'el-icon-microphone',
|
|
||||||
'el-icon-close-notification',
|
|
||||||
'el-icon-bangzhu',
|
|
||||||
'el-icon-time',
|
|
||||||
'el-icon-odometer',
|
|
||||||
'el-icon-crop',
|
|
||||||
'el-icon-aim',
|
|
||||||
'el-icon-switch-button',
|
|
||||||
'el-icon-full-screen',
|
|
||||||
'el-icon-copy-document',
|
|
||||||
'el-icon-mic',
|
|
||||||
'el-icon-stopwatch',
|
|
||||||
],
|
|
||||||
menulistStyle: 'vertical',
|
|
||||||
menulistBorderBottom: {},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
const menus = menu.list()
|
|
||||||
this.menuList = menus
|
|
||||||
this.role = this.$storage.get('role')
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.menulistStyleChange()
|
|
||||||
},10)
|
|
||||||
this.icons.sort(()=>{
|
|
||||||
return (0.5-Math.random())
|
|
||||||
})
|
|
||||||
this.lineBorder()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
lineBorder() {
|
|
||||||
let style = 'vertical'
|
|
||||||
let w = '1px'
|
|
||||||
let s = 'solid'
|
|
||||||
let c = '#ccc'
|
|
||||||
if(style == 'vertical') {
|
|
||||||
this.menulistBorderBottom = {
|
|
||||||
borderBottomWidth: w,
|
|
||||||
borderBottomStyle: s,
|
|
||||||
borderBottomColor: c
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.menulistBorderBottom = {
|
|
||||||
borderRightWidth: w,
|
|
||||||
borderRightStyle: s,
|
|
||||||
borderRightColor: c
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
menuHandler(name) {
|
|
||||||
let router = this.$router
|
|
||||||
name = '/'+name
|
|
||||||
router.push(name)
|
|
||||||
},
|
|
||||||
// 菜单
|
|
||||||
setMenulistHoverColor(){
|
|
||||||
let that = this
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.menulist .el-menu-item').forEach(el=>{
|
|
||||||
el.addEventListener("mouseenter", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
|
||||||
})
|
|
||||||
el.addEventListener("mouseleave", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "#988181"
|
|
||||||
})
|
|
||||||
el.addEventListener("focus", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.menulist .el-submenu__title').forEach(el=>{
|
|
||||||
el.addEventListener("mouseenter", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "rgba(238, 221, 129, 1)"
|
|
||||||
})
|
|
||||||
el.addEventListener("mouseleave", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "#988181"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
setMenulistIconColor() {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.menulist .el-submenu__title .el-submenu__icon-arrow').forEach(el=>{
|
|
||||||
el.style.color = "rgba(153, 153, 153, 1)"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
menulistStyleChange() {
|
|
||||||
this.setMenulistIconColor()
|
|
||||||
this.setMenulistHoverColor()
|
|
||||||
this.setMenulistStyleHeightChange()
|
|
||||||
let str = "vertical"
|
|
||||||
if("horizontal" === str) {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.el-container .el-container').forEach(el=>{
|
|
||||||
el.style.display = "block"
|
|
||||||
el.style.paddingTop = "60px" // header 高度
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.el-aside').forEach(el=>{
|
|
||||||
el.style.width = "100%"
|
|
||||||
el.style.height = "62px"
|
|
||||||
el.style.paddingTop = '0'
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
|
||||||
el.style.paddingTop = '0'
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if("vertical" === str) {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.index-aside .index-aside-inner').forEach(el=>{
|
|
||||||
el.style.paddingTop = "60px"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
setMenulistStyleHeightChange() {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-menu-item').forEach(el=>{
|
|
||||||
el.style.height = "62px"
|
|
||||||
el.style.lineHeight = "62px"
|
|
||||||
})
|
|
||||||
document.querySelectorAll('.menulist-item>.el-menu--horizontal>.el-submenu>.el-submenu__title').forEach(el=>{
|
|
||||||
el.style.height = "62px"
|
|
||||||
el.style.lineHeight = "62px"
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.index-aside {
|
|
||||||
position: relative;
|
|
||||||
overflow: hidden;
|
|
||||||
|
|
||||||
.menulistImg {
|
|
||||||
padding: 24px 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
.el-image {
|
|
||||||
margin: 0 auto;
|
|
||||||
width: 100px;
|
|
||||||
height: 100px;
|
|
||||||
border-radius: 100%;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.index-aside-inner {
|
|
||||||
height: 100%;
|
|
||||||
margin-right: -17px;
|
|
||||||
margin-bottom: -17px;
|
|
||||||
overflow: scroll;
|
|
||||||
overflow-x: hidden !important;
|
|
||||||
padding-top: 60px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
|
|
||||||
&:focus {
|
|
||||||
outline: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-menu {
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,76 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-aside class="index-aside" width="200px">
|
|
||||||
<div class="index-aside-inner">
|
|
||||||
<div v-for="item in menuList" v-bind:key="item.roleName">
|
|
||||||
<el-menu
|
|
||||||
background-color="#263238"
|
|
||||||
text-color="#fff"
|
|
||||||
active-text-color="#ffd04b"
|
|
||||||
default-active="0"
|
|
||||||
v-if="role==item.roleName"
|
|
||||||
>
|
|
||||||
<el-menu-item @click="menuHandler('home')" index="0">首页</el-menu-item>
|
|
||||||
<el-submenu
|
|
||||||
:index="1+''"
|
|
||||||
>
|
|
||||||
<template slot="title">
|
|
||||||
<span>个人中心</span>
|
|
||||||
</template>
|
|
||||||
<el-menu-item
|
|
||||||
@click="menuHandler('updatePassword')"
|
|
||||||
:index="1-1"
|
|
||||||
>修改密码</el-menu-item>
|
|
||||||
<el-menu-item
|
|
||||||
@click="menuHandler('center')"
|
|
||||||
:index="1-2"
|
|
||||||
>个人信息</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
<el-submenu
|
|
||||||
v-for=" (menu,index) in item.backMenu"
|
|
||||||
v-bind:key="menu.menu"
|
|
||||||
:index="index+2+''"
|
|
||||||
>
|
|
||||||
<template slot="title">
|
|
||||||
<span>{{menu.menu}}</span>
|
|
||||||
</template>
|
|
||||||
<el-menu-item
|
|
||||||
v-for=" (child,sort) in menu.child"
|
|
||||||
v-bind:key="sort"
|
|
||||||
@click="menuHandler(child.tableName)"
|
|
||||||
:index="(index+2)+'-'+sort"
|
|
||||||
>{{child.menu}}</el-menu-item>
|
|
||||||
</el-submenu>
|
|
||||||
</el-menu>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-aside>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import menu from "@/utils/menu";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
menuList: [],
|
|
||||||
dynamicMenuRoutes: [],
|
|
||||||
role: ""
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let menus = menu.list();
|
|
||||||
this.menuList = menus;
|
|
||||||
this.role = this.$storage.get("role");
|
|
||||||
console.log(this.menuList)
|
|
||||||
console.log(this.role)
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
menuHandler(name) {
|
|
||||||
this.$router.push({
|
|
||||||
name: name
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,51 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-submenu v-if="menu.list && menu.list.length >= 1" :index="menu.menuId + ''">
|
|
||||||
<template slot="title">
|
|
||||||
<span>{{ menu.name }}</span>
|
|
||||||
</template>
|
|
||||||
<sub-menu
|
|
||||||
v-for="item in menu.list"
|
|
||||||
:key="item.menuId"
|
|
||||||
:menu="item"
|
|
||||||
:dynamicMenuRoutes="dynamicMenuRoutes"
|
|
||||||
></sub-menu>
|
|
||||||
</el-submenu>
|
|
||||||
<el-menu-item v-else :index="menu.menuId + ''" @click="gotoRouteHandle(menu)">
|
|
||||||
<span>{{ menu.name }}</span>
|
|
||||||
</el-menu-item>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import SubMenu from "./IndexAsideSub";
|
|
||||||
export default {
|
|
||||||
name: "sub-menu",
|
|
||||||
props: {
|
|
||||||
menu: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
dynamicMenuRoutes: {
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
SubMenu
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
|
|
||||||
gotoRouteHandle(menu) {
|
|
||||||
var route = this.dynamicMenuRoutes.filter(
|
|
||||||
item => item.meta.menuId === menu.menuId
|
|
||||||
);
|
|
||||||
if (route.length >= 1) {
|
|
||||||
if (route[0].component != null) {
|
|
||||||
this.$router.replace({ name: route[0].name });
|
|
||||||
} else {
|
|
||||||
this.$router.push({ name: "404" });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -1,184 +0,0 @@
|
|||||||
<template>
|
|
||||||
<!-- <el-header>
|
|
||||||
<el-menu background-color="#00c292" text-color="#FFFFFF" active-text-color="#FFFFFF" mode="horizontal">
|
|
||||||
<div class="fl title">{{this.$project.projectName}}</div>
|
|
||||||
<div class="fr logout" style="display:flex;">
|
|
||||||
<el-menu-item index="3">
|
|
||||||
<div>{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item @click="onLogout" index="2">
|
|
||||||
<div>退出登录</div>
|
|
||||||
</el-menu-item>
|
|
||||||
</div>
|
|
||||||
</el-menu>
|
|
||||||
</el-header> -->
|
|
||||||
<div class="navbar" :style="{backgroundColor:heads.headBgColor,height:heads.headHeight,boxShadow:heads.headBoxShadow,lineHeight:heads.headHeight}">
|
|
||||||
<div class="title-menu" :style="{justifyContent:heads.headTitleStyle=='1'?'flex-start':'center'}">
|
|
||||||
<el-image v-if="heads.headTitleImg" class="title-img" :style="{width:heads.headTitleImgWidth,height:heads.headTitleImgHeight,boxShadow:heads.headTitleImgBoxShadow,borderRadius:heads.headTitleImgBorderRadius}" :src="heads.headTitleImgUrl" fit="cover"></el-image>
|
|
||||||
<div class="title-name" :style="{color:heads.headFontColor,fontSize:heads.headFontSize}">{{this.$project.projectName}}</div>
|
|
||||||
</div>
|
|
||||||
<div class="right-menu">
|
|
||||||
<div class="user-info" :style="{color:heads.headUserInfoFontColor,fontSize:heads.headUserInfoFontSize}">{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
|
||||||
<div class="logout" :style="{color:heads.headLogoutFontColor,fontSize:heads.headLogoutFontSize}" @click="onIndexTap">退出到前台</div>
|
|
||||||
<div class="logout" :style="{color:heads.headLogoutFontColor,fontSize:heads.headLogoutFontSize}" @click="onLogout">退出登录</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
ruleForm: {},
|
|
||||||
user: {},
|
|
||||||
heads: {"headLogoutFontHoverColor":"rgba(41, 42, 42, 1)","headFontSize":"20px","headUserInfoFontColor":"rgba(238, 221, 129, 1)","headBoxShadow":"0 1px 6px #444","headTitleImgHeight":"44px","headLogoutFontHoverBgColor":"rgba(247, 142, 142, 1)","headFontColor":"rgba(153, 239, 237, 1)","headTitleImg":false,"headHeight":"60px","headTitleImgBorderRadius":"22px","headTitleImgUrl":"http://codegen.caihongy.cn/20201021/cc7d45d9c8164b58b18351764eba9be1.jpg","headBgColor":"#4F4949","headTitleImgBoxShadow":"0 1px 6px #444","headLogoutFontColor":"rgba(153, 239, 237, 1)","headUserInfoFontSize":"16px","headTitleImgWidth":"44px","headTitleStyle":"2","headLogoutFontSize":"16px"},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.setHeaderStyle()
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let sessionTable = this.$storage.get("sessionTable")
|
|
||||||
this.$http({
|
|
||||||
url: sessionTable + '/session',
|
|
||||||
method: "get"
|
|
||||||
}).then(({
|
|
||||||
data
|
|
||||||
}) => {
|
|
||||||
if (data && data.code === 0) {
|
|
||||||
this.user = data.data;
|
|
||||||
} else {
|
|
||||||
let message = this.$message
|
|
||||||
message.error(data.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onLogout() {
|
|
||||||
let storage = this.$storage
|
|
||||||
let router = this.$router
|
|
||||||
storage.clear()
|
|
||||||
router.replace({
|
|
||||||
name: "login"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onIndexTap(){
|
|
||||||
window.location.href = `${this.$base.indexUrl}`
|
|
||||||
},
|
|
||||||
setHeaderStyle() {
|
|
||||||
this.$nextTick(()=>{
|
|
||||||
document.querySelectorAll('.navbar .right-menu .logout').forEach(el=>{
|
|
||||||
el.addEventListener("mouseenter", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = this.heads.headLogoutFontHoverBgColor
|
|
||||||
el.style.color = this.heads.headLogoutFontHoverColor
|
|
||||||
})
|
|
||||||
el.addEventListener("mouseleave", e => {
|
|
||||||
e.stopPropagation()
|
|
||||||
el.style.backgroundColor = "transparent"
|
|
||||||
el.style.color = this.heads.headLogoutFontColor
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.navbar {
|
|
||||||
height: 60px;
|
|
||||||
line-height: 60px;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0 34px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
background-color: #ff00ff;
|
|
||||||
position: relative;
|
|
||||||
z-index: 111;
|
|
||||||
|
|
||||||
.right-menu {
|
|
||||||
position: absolute;
|
|
||||||
right: 34px;
|
|
||||||
top: 0;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
align-items: center;
|
|
||||||
z-index: 111;
|
|
||||||
|
|
||||||
.user-info {
|
|
||||||
font-size: 16px;
|
|
||||||
color: red;
|
|
||||||
padding: 0 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logout {
|
|
||||||
font-size: 16px;
|
|
||||||
color: red;
|
|
||||||
padding: 0 12px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-menu {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
|
|
||||||
.title-img {
|
|
||||||
width: 44px;
|
|
||||||
height: 44px;
|
|
||||||
border-radius: 22px;
|
|
||||||
box-shadow: 0 1px 6px #444;
|
|
||||||
margin-right: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title-name {
|
|
||||||
font-size: 24px;
|
|
||||||
color: #fff;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// .el-header .fr {
|
|
||||||
// float: right;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .el-header .fl {
|
|
||||||
// float: left;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .el-header {
|
|
||||||
// width: 100%;
|
|
||||||
// color: #333;
|
|
||||||
// text-align: center;
|
|
||||||
// line-height: 60px;
|
|
||||||
// padding: 0;
|
|
||||||
// z-index: 99;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .logo {
|
|
||||||
// width: 60px;
|
|
||||||
// height: 60px;
|
|
||||||
// margin-left: 70px;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .avator {
|
|
||||||
// width: 40px;
|
|
||||||
// height: 40px;
|
|
||||||
// background: #ffffff;
|
|
||||||
// border-radius: 50%;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// .title {
|
|
||||||
// color: #ffffff;
|
|
||||||
// font-size: 20px;
|
|
||||||
// font-weight: bold;
|
|
||||||
// margin-left: 20px;
|
|
||||||
// }
|
|
||||||
</style>
|
|
@ -1,89 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-header>
|
|
||||||
<el-menu background-color="#00c292" text-color="#FFFFFF" active-text-color="#FFFFFF" mode="horizontal">
|
|
||||||
<div class="fl title">{{this.$project.projectName}}</div>
|
|
||||||
<div class="fr logout" style="display:flex;">
|
|
||||||
<el-menu-item index="3">
|
|
||||||
<div>{{this.$storage.get('role')}} {{this.$storage.get('adminName')}}</div>
|
|
||||||
</el-menu-item>
|
|
||||||
<el-menu-item @click="onLogout" index="2">
|
|
||||||
<div>退出登录</div>
|
|
||||||
</el-menu-item>
|
|
||||||
</div>
|
|
||||||
</el-menu>
|
|
||||||
</el-header>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
ruleForm: {},
|
|
||||||
user: {}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.$http({
|
|
||||||
url: `${this.$storage.get("sessionTable")}/session`,
|
|
||||||
method: "get"
|
|
||||||
}).then(({
|
|
||||||
data
|
|
||||||
}) => {
|
|
||||||
if (data && data.code === 0) {
|
|
||||||
this.user = data.data;
|
|
||||||
} else {
|
|
||||||
this.$message.error(data.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onLogout() {
|
|
||||||
this.$storage.remove("Token");
|
|
||||||
this.$router.replace({
|
|
||||||
name: "login"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.el-header .fr {
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-header .fl {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-header {
|
|
||||||
width: 100%;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 60px;
|
|
||||||
padding: 0;
|
|
||||||
z-index: 99;
|
|
||||||
}
|
|
||||||
|
|
||||||
.logo {
|
|
||||||
width: 60px;
|
|
||||||
height: 60px;
|
|
||||||
margin-left: 70px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.avator {
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
color: #ffffff;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,124 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-main>
|
|
||||||
<bread-crumbs :title="title" class="bread-crumbs"></bread-crumbs>
|
|
||||||
<router-view class="router-view"></router-view>
|
|
||||||
</el-main>
|
|
||||||
</template>
|
|
||||||
<script>
|
|
||||||
import menu from "@/utils/menu";
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
menuList: [],
|
|
||||||
role: "",
|
|
||||||
currentIndex: -2,
|
|
||||||
itemMenu: [],
|
|
||||||
title: ''
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
let menus = menu.list();
|
|
||||||
this.menuList = menus;
|
|
||||||
this.role = this.$storage.get("role");
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
menuHandler(menu) {
|
|
||||||
this.$router.push({
|
|
||||||
name: menu.tableName
|
|
||||||
});
|
|
||||||
this.title = menu.menu;
|
|
||||||
},
|
|
||||||
titleChange(index, menus) {
|
|
||||||
this.currentIndex = index
|
|
||||||
this.itemMenu = menus;
|
|
||||||
console.log(menus);
|
|
||||||
},
|
|
||||||
homeChange(index) {
|
|
||||||
this.itemMenu = [];
|
|
||||||
this.title = ""
|
|
||||||
this.currentIndex = index
|
|
||||||
this.$router.push({
|
|
||||||
name: 'home'
|
|
||||||
});
|
|
||||||
},
|
|
||||||
centerChange(index) {
|
|
||||||
this.itemMenu = [{
|
|
||||||
"buttons": ["新增", "查看", "修改", "删除"],
|
|
||||||
"menu": "修改密码",
|
|
||||||
"tableName": "updatePassword"
|
|
||||||
}, {
|
|
||||||
"buttons": ["新增", "查看", "修改", "删除"],
|
|
||||||
"menu": "个人信息",
|
|
||||||
"tableName": "center"
|
|
||||||
}];
|
|
||||||
this.title = ""
|
|
||||||
this.currentIndex = index
|
|
||||||
this.$router.push({
|
|
||||||
name: 'home'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: #555;
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
|
||||||
background: #00c292;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-list {
|
|
||||||
width: 100%;
|
|
||||||
margin: 0 auto;
|
|
||||||
text-align: left;
|
|
||||||
margin-top: 20px;
|
|
||||||
|
|
||||||
.nav-title {
|
|
||||||
display: inline-block;
|
|
||||||
font-size: 15px;
|
|
||||||
color: #333;
|
|
||||||
padding: 15px 25px;
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-title.active {
|
|
||||||
color: #555;
|
|
||||||
cursor: default;
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
margin-top: 20px;
|
|
||||||
background: #FFFFFF;
|
|
||||||
padding: 15px 0;
|
|
||||||
|
|
||||||
.menu {
|
|
||||||
padding: 15px 25px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-main {
|
|
||||||
background-color: #F6F8FA;
|
|
||||||
padding: 0 24px;
|
|
||||||
// padding-top: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.router-view {
|
|
||||||
padding: 10px;
|
|
||||||
margin-top: 10px;
|
|
||||||
background: #FFFFFF;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bread-crumbs {
|
|
||||||
width: 100%;
|
|
||||||
// border-bottom: 1px solid #e9eef3;
|
|
||||||
// border-top: 1px solid #e9eef3;
|
|
||||||
margin-top: 10px;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,9 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import SvgIcon from '@/components/SvgIcon'// svg component
|
|
||||||
|
|
||||||
// register globally
|
|
||||||
Vue.component('svg-icon', SvgIcon)
|
|
||||||
|
|
||||||
const req = require.context('./svg/svg', false, /\.svg$/)
|
|
||||||
const requireAll = requireContext => requireContext.keys().map(requireContext)
|
|
||||||
requireAll(req)
|
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 765 B |
Before Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 300 B |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 921 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 379 B |