first commit

master
str 5 years ago
commit d7102f92bb

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/new.iml" filepath="$PROJECT_DIR$/.idea/new.iml" />
</modules>
</component>
</project>

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="Flask">
<option name="enabled" value="true" />
</component>
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
<option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
<option name="TEMPLATE_FOLDERS">
<list>
<option value="$MODULE_DIR$/../new\templates" />
</list>
</option>
</component>
</module>

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="4fc7205a-f53b-45ee-9929-2df590039939" name="默认更改列表" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Flask Main" />
<option value="HTML File" />
</list>
</option>
</component>
<component name="ProjectId" id="1bT1Kg27LSLRSsES2RRFYbM5jw6" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="F:/WeChat/WeChat Files/str18235971887/FileStorage/File/2020-05/untitled7/templates/insert_page捐赠记录.html" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.detected.package.tslint" value="true" />
<property name="node.js.path.for.package.eslint" value="project" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.eslint" value="(autodetect)" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
</component>
<component name="RunManager" selected="Flask server.Flask (app.py)">
<configuration name="查询分配情况.html" type="JavascriptDebugType" temporary="true" nameIsGenerated="true" uri="http://localhost:63342/new/templates/查询分配情况.html" useBuiltInWebServerPort="true">
<method v="2" />
</configuration>
<configuration name="Flask (app.py)" type="Python.FlaskServer" temporary="true" nameIsGenerated="true">
<module name="new" />
<option name="target" value="$PROJECT_DIR$/app.py" />
<option name="targetType" value="PATH" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
<configuration name="new" type="Python.FlaskServer">
<module name="new" />
<option name="target" value="$PROJECT_DIR$/app.py" />
<option name="targetType" value="PATH" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="false" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="launchJavascriptDebuger" value="false" />
<method v="2" />
</configuration>
<recent_temporary>
<list>
<item itemvalue="Flask server.Flask (app.py)" />
<item itemvalue="JavaScript Debug.查询分配情况.html" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="4fc7205a-f53b-45ee-9929-2df590039939" name="默认更改列表" comment="" />
<created>1588641206977</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1588641206977</updated>
<workItem from="1588641211751" duration="6300000" />
<workItem from="1588661021324" duration="5839000" />
<workItem from="1588682652663" duration="10545000" />
<workItem from="1588727397096" duration="3864000" />
<workItem from="1588748075201" duration="1714000" />
<workItem from="1588751057428" duration="82000" />
<workItem from="1588753185353" duration="78000" />
</task>
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="WindowStateProjectService">
<state x="545" y="168" key="FileChooserDialogImpl" timestamp="1588753241014">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="545" y="168" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1588753241014" />
<state width="1342" height="195" key="GridCell.Tab.0.bottom" timestamp="1588750971963">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1342" height="195" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1588750971963" />
<state width="1342" height="195" key="GridCell.Tab.0.center" timestamp="1588750971963">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1342" height="195" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1588750971963" />
<state width="1342" height="195" key="GridCell.Tab.0.left" timestamp="1588750971963">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1342" height="195" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1588750971963" />
<state width="1342" height="195" key="GridCell.Tab.0.right" timestamp="1588750971963">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state width="1342" height="195" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1588750971963" />
<state x="464" y="238" key="com.intellij.ide.util.TipDialog" timestamp="1588753185362">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="464" y="238" key="com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824" timestamp="1588753185362" />
<state x="428" y="145" width="672" height="678" key="search.everywhere.popup" timestamp="1588688607058">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="428" y="145" width="672" height="678" key="search.everywhere.popup/0.0.1536.824@0.0.1536.824" timestamp="1588688607058" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/new$Flask__app_py_.coverage" NAME="Flask (app.py) Coverage Results" MODIFIED="1588750429401" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="" />
</component>
</project>

Binary file not shown.

153
app.py

@ -0,0 +1,153 @@
from flask import Flask
from flask import render_template,request,redirect,Flask
from mysql操作 import *
from flask_sqlalchemy import SQLAlchemy
#模板渲染引擎
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://root:123456@localhost:3306/goods'
#设置每次请求结束后会自动提交数据库中的改动
app.config['SQLALCHEMY_COMMIT_ON_TEARDOWN'] = True
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
#查询时会显示原始SQL语句
app.config['SQLALCHEMY_ECHO'] = True
db = SQLAlchemy(app)
class donations(db.Model):
捐赠编号 = db.Column(db.String(255),primary_key=True)
捐赠单位 = db.Column(db.String(255))
捐赠物资 = db.Column(db.String(255))
规格 = db.Column(db.String(255))
计量单位 = db.Column(db.String(255))
数量总计 = db.Column(db.String(255))
class distributions(db.Model):
分配编号 = db.Column(db.String(255),primary_key=True)
接收单位= db.Column(db.String(255))
品名= db.Column(db.String(255))
规格= db.Column(db.String(255))
计量单位= db.Column(db.String(255))
数量= db.Column(db.String(255))
仓库号= db.Column(db.String(255))
签收人 = db.Column(db.String(255))
签收人联系电话 = db.Column(db.String(255))
@app.route('/')
def hello():
return render_template('主页.html')
@app.route('/donations')
def donations():
donations = select('select * from donations')
return render_template('查询捐赠情况.html',donations = donations)
@app.route('/distributions')
def distributions():
distributions = select('select * from distributions')
return render_template('查询分配情况.html',distributions = distributions)
@app.route("/insert1")
def insert1():
return render_template("insert1.html")
@app.route("/insert2")
def insert2():
return render_template("insert2.html")
@app.route("/insertmask1",methods=['GET','POST'])
def insertmask1():
#com_name=request.form['com_name']
a1 = request.form['a1']
a2 = request.form['a2']
a3 = request.form['a3']
a4 = request.form['a4']
a5 = request.form['a5']
a6 = request.form['a6']
masktj=donations(捐赠编号 = a1,捐赠单位= a2,捐赠物资 = a3,规格 = a4,计量单位 = a5,数量总计 = a6)
db.session.add(masktj)
db.session.commit()
return render_template("查询捐赠情况.html")
@app.route("/insertmask2",methods=['GET','POST'])
def insertmask2():
#com_name=request.form['com_name']
a1 = request.form['a1']
a2 = request.form['a2']
a3 = request.form['a3']
a4 = request.form['a4']
a5 = request.form['a5']
a6 = request.form['a6']
a7 = request.form['a7']
a8 = request.form['a8']
a9 = request.form['a9']
masktj=mask(分配编号 = a1,接收单位= a2,品名= a3,规格= a4,计量单位= a5,数量= a6,仓库号= a7,签收人 = a8,签收人联系电话 = a9)
db.session.add(masktj)
db.session.commit()
return render_template("查询分配情况.html")
@app.route('/删除捐赠记录',methods=['GET'])
def shanchujuanzeng():
id= request.args.get("id")
#展示语句是否正确的
#print('delete from donations where 捐赠编号={};'.format(id))
delete('delete from donations where 捐赠编号={};'.format(id))
return redirect('/donations')
@app.route("/修改捐赠记录",methods=['GET','POST'])
def xiugaijuanzeng():
if request.method == 'GET':
id = request.args.get("id")
donation = select('select * from donations where 捐赠编号="{}"'.format(id))[0]
return render_template("修改捐赠记录.html",donation = donation)
else:
#接收参数,修改数据
id = request.form["id"]
捐赠单位 = request.form['捐赠单位']
捐赠物资名称 = request.form['捐赠物资名称']
规格 = request.form['规格']
计量单位 = request.form['计量单位']
数量总计 = request.form['数量总计']
#print('update donations set 时间=STR_TO_DATE("{}","%Y-%m-%d") ,捐赠方单位="{}" ,物资名称="{}" ,类别="{}" ,数量={} ,计量单位="{}" ,价值={} where 捐赠编号={}'.format(时间,捐赠方单位,物资名称,物资类别,数量,单位,价值,id))
alter('update donations set 捐赠单位="{}" ,捐赠物资名称="{}" ,规格="{}" ,计量单位="{}" ,数量总计="{}" where 捐赠编号="{}"'.format(捐赠单位,捐赠物资名称,规格,计量单位,数量总计,id))
return redirect('/donations')
@app.route('/删除分配记录',methods=['GET'])
def shanchufenpei():
id= request.args.get("id")
#展示语句是否正确的
#print('delete from distributions where 发放编号={};'.format(id))
delete('delete from distributions where 分配编号="{}";'.format(id))
#print(id)
return redirect('/distributions')
#/*----------------------------------------------------------------------------------------*/
@app.route("/修改分配记录",methods=['GET','POST'])
def xiugaifenpei():
if request.method == 'GET':
id = request.args.get("id")
distribution = select('select * from distributions where 分配编号="{}"'.format(id))[0]
return render_template("修改分配记录.html",distribution = distribution)
else:
#接收参数,修改数据
id = request.form["id"]
接收单位 = request.form['接收单位']
物资名称 = request.form['物资名称']
规格 = request.form['规格']
计量单位 = request.form['计量单位']
数量 = request.form['数量']
仓库号 = request.form['仓库号']
签收人 = request.form['签收人']
签收人联系电话= request.form['签收人联系电话']
#print('update donations set 时间=STR_TO_DATE("{}","%Y-%m-%d") ,捐赠方单位="{}" ,物资名称="{}" ,类别="{}" ,数量={} ,计量单位="{}" ,价值={} where 捐赠编号={}'.format(时间,捐赠方单位,物资名称,物资类别,数量,单位,价值,id))
alter('update distributions set 接收单位="{}" ,物资名称="{}" ,规格="{}" ,计量单位="{}" ,数量="{}" ,仓库号="{}" ,签收人="{}",签收人联系电话="{}" where 分配编号="{}"'.format(接收单位,物资名称,规格,计量单位,数量,仓库号, 签收人,签收人联系电话,id))
return redirect('/distributions')
if __name__ == '__main__':
app.run()

@ -0,0 +1,50 @@
import pymysql
def select(sql):
conn = pymysql.connect(host='localhost',user='root', passwd='123456', charset='utf8')
cursor = conn.cursor()
conn.select_db('goods')
# -----------Begin----------
# 请在下面输入查询数据的语句,完成相应功能
command = sql
cursor.execute(command)
# 请在下面输入获取数据的语句,完成相应功能
records = cursor.fetchall()
# ------------End-----------
# 关闭数据库连接
cursor.close()
conn.close()
return records
def delete(sql):
conn = pymysql.connect(host='localhost',user='root', passwd='123456', charset='utf8')
cursor = conn.cursor()
conn.select_db('goods')
# -----------Begin----------
# 请在下面输入查询数据的语句,完成相应功能
command = sql
cursor.execute(command)
# 请在下面输入获取数据的语句,完成相应功能
# ------------End-----------
# 提交数据到数据库
conn.commit()
# 关闭数据库连接
cursor.close()
conn.close()
def alter(sql):
conn = pymysql.connect(host='localhost', user='root', passwd='123456', charset='utf8')
cursor = conn.cursor()
conn.select_db('goods')
command=sql
cursor.execute(command)
# 提交数据到数据库
conn.commit()
# 关闭数据库连接
cursor.close()
conn.close()

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none}

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 299 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@ -0,0 +1,2 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(clearInterval(e.timer),e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['<button class="layui-icon '+u+'" lay-type="sub">'+("updown"===n.anim?"&#xe619;":"&#xe603;")+"</button>",'<button class="layui-icon '+u+'" lay-type="add">'+("updown"===n.anim?"&#xe61a;":"&#xe602;")+"</button>"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['<div class="'+c+'"><ul>',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("<li"+(n.index===e?' class="layui-this"':"")+"></li>")}),i.join("")}(),"</ul></div>"].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):a<n.index&&e.slide("sub",n.index-a)})},m.prototype.slide=function(e,i){var n=this,l=n.elemItem,u=n.config,c=u.index,m=u.elem.attr("lay-filter");n.haveSlide||("sub"===e?(n.subIndex(i),l.eq(u.index).addClass(d),setTimeout(function(){l.eq(c).addClass(r),l.eq(u.index).addClass(r)},50)):(n.addIndex(i),l.eq(u.index).addClass(s),setTimeout(function(){l.eq(c).addClass(o),l.eq(u.index).addClass(o)},50)),setTimeout(function(){l.removeClass(a+" "+d+" "+s+" "+o+" "+r),l.eq(u.index).addClass(a),n.haveSlide=!1},300),n.elemInd.find("li").eq(u.index).addClass(a).siblings().removeClass(a),n.haveSlide=!0,layui.event.call(this,t,"change("+m+")",{index:u.index,prevIndex:c,item:l.eq(u.index)}))},m.prototype.events=function(){var e=this,i=e.config;i.elem.data("haveEvents")||(i.elem.on("mouseenter",function(){clearInterval(e.timer)}).on("mouseleave",function(){e.autoplay()}),i.elem.data("haveEvents",!0))},n.render=function(e){var i=new m(e);return i},e(t,n)});

@ -0,0 +1,2 @@
/** layui-v2.5.6 MIT License By https://www.layui.com */
;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),c.html('<ol class="layui-code-ol"><li>'+o.replace(/[\r\t\n]+/g,"</li><li>")+"</li></ol>"),c.find(">.layui-code-h3")[0]||c.prepend('<h3 class="layui-code-h3">'+(c.attr("lay-title")||e.title||"code")+(e.about?'<a href="'+l+'" target="_blank">layui.code</a>':"")+"</h3>");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss");

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

Loading…
Cancel
Save