格雷 2 tahun lalu
induk
melakukan
abb827c293

+ 9 - 1
.idea/IOmga.iml

@@ -4,7 +4,15 @@
     <content url="file://$MODULE_DIR$">
       <excludeFolder url="file://$MODULE_DIR$/venv" />
     </content>
-    <orderEntry type="jdk" jdkName="Iomga" jdkType="Python SDK" />
+    <orderEntry type="jdk" jdkName="Python 3.8 (IOmga)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
+  <component name="TemplatesService">
+    <option name="TEMPLATE_CONFIGURATION" value="Jinja2" />
+    <option name="TEMPLATE_FOLDERS">
+      <list>
+        <option value="$MODULE_DIR$/templates" />
+      </list>
+    </option>
+  </component>
 </module>

+ 1 - 1
.idea/misc.xml

@@ -3,5 +3,5 @@
   <component name="Black">
     <option name="sdkName" value="Iomga" />
   </component>
-  <component name="ProjectRootManager" version="2" project-jdk-name="Iomga" project-jdk-type="Python SDK" />
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (IOmga)" project-jdk-type="Python SDK" />
 </project>

+ 4 - 0
.idea/shelf/_2024_3_26_0026_08_50____.xml

@@ -0,0 +1,4 @@
+<changelist name="在进行更新之前于_2024_3_26_0026_08_50_取消提交了更改_[更改]" date="1711414252509" recycled="true" deleted="true">
+  <option name="PATH" value="$PROJECT_DIR$/.idea/shelf/在进行更新之前于_2024_3_26_0026_08_50_取消提交了更改_[更改]/shelved.patch" />
+  <option name="DESCRIPTION" value="在进行更新之前于 2024/3/26 0026 08:50 取消提交了更改 [更改]" />
+</changelist>

+ 196 - 0
.idea/shelf/在进行更新之前于_2024_3_26_0026_08_50_取消提交了更改_[更改]/shelved.patch

@@ -0,0 +1,196 @@
+Index: .idea/workspace.xml
+===================================================================
+diff --git a/.idea/workspace.xml b/.idea/workspace.xml
+deleted file mode 100644
+--- a/.idea/workspace.xml	(revision a2edba644ca938f1e0c6667d29031663fd29ece2)
++++ /dev/null	(revision a2edba644ca938f1e0c6667d29031663fd29ece2)
+@@ -1,188 +0,0 @@
+-<?xml version="1.0" encoding="UTF-8"?>
+-<project version="4">
+-  <component name="ChangeListManager">
+-    <list default="true" id="0223e498-9d37-4de5-9ad1-8a9d3c8e31c3" name="更改" comment="2024.03.13">
+-      <change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
+-      <change beforePath="$PROJECT_DIR$/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/index.html" afterDir="false" />
+-    </list>
+-    <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="Python Script" />
+-        <option value="HTML File" />
+-      </list>
+-    </option>
+-  </component>
+-  <component name="FlaskConsoleOptions" custom-start-script="import sys&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;from flask.cli import ScriptInfo&#10;locals().update(ScriptInfo(create_app=None).load_app().make_shell_context())&#10;print(&quot;Python %s on %s\nApp: %s [%s]\nInstance: %s&quot; % (sys.version, sys.platform, app.import_name, app.env, app.instance_path))">
+-    <envs>
+-      <env key="FLASK_APP" value="app" />
+-    </envs>
+-    <option name="myCustomStartScript" value="import sys&#10;sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS])&#10;from flask.cli import ScriptInfo&#10;locals().update(ScriptInfo(create_app=None).load_app().make_shell_context())&#10;print(&quot;Python %s on %s\nApp: %s [%s]\nInstance: %s&quot; % (sys.version, sys.platform, app.import_name, app.env, app.instance_path))" />
+-    <option name="myEnvs">
+-      <map>
+-        <entry key="FLASK_APP" value="app" />
+-      </map>
+-    </option>
+-  </component>
+-  <component name="Git.Settings">
+-    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+-    <option name="SET_USER_NAME_GLOBALLY" value="false" />
+-  </component>
+-  <component name="MarkdownSettingsMigration">
+-    <option name="stateVersion" value="1" />
+-  </component>
+-  <component name="ProjectId" id="2dcnLohNDxLqQbbzoH11K0b5t0H" />
+-  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
+-  <component name="ProjectViewState">
+-    <option name="hideEmptyMiddlePackages" value="true" />
+-    <option name="showLibraryContents" value="true" />
+-  </component>
+-  <component name="PropertiesComponent">{
+-  &quot;keyToString&quot;: {
+-    &quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
+-    &quot;DefaultHtmlFileTemplate&quot;: &quot;HTML File&quot;,
+-    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
+-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
+-    &quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;,
+-    &quot;settings.editor.selected.configurable&quot;: &quot;preferences.pluginManager&quot;
+-  }
+-}</component>
+-  <component name="RunManager" selected="Python.app">
+-    <configuration name="app" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
+-      <module name="IOmga" />
+-      <option name="INTERPRETER_OPTIONS" value="" />
+-      <option name="PARENT_ENVS" value="true" />
+-      <envs>
+-        <env name="PYTHONUNBUFFERED" value="1" />
+-        <env name="FLASK_ENV" value="development" />
+-        <env name="FLASK_DEBUG" value="1" />
+-      </envs>
+-      <option name="SDK_HOME" value="" />
+-      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
+-      <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="SCRIPT_NAME" value="$PROJECT_DIR$/app.py" />
+-      <option name="PARAMETERS" value="" />
+-      <option name="SHOW_COMMAND_LINE" value="false" />
+-      <option name="EMULATE_TERMINAL" value="false" />
+-      <option name="MODULE_MODE" value="false" />
+-      <option name="REDIRECT_INPUT" value="false" />
+-      <option name="INPUT_FILE" value="" />
+-      <method v="2" />
+-    </configuration>
+-    <configuration name="Flask (app.py)" type="Python.FlaskServer" temporary="true" nameIsGenerated="true">
+-      <module name="IOmga" />
+-      <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="$PROJECT_DIR$" />
+-      <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>
+-    <list>
+-      <item itemvalue="Flask 服务器.Flask (app.py)" />
+-      <item itemvalue="Python.app" />
+-    </list>
+-    <recent_temporary>
+-      <list>
+-        <item itemvalue="Python.app" />
+-        <item itemvalue="Flask 服务器.Flask (app.py)" />
+-      </list>
+-    </recent_temporary>
+-  </component>
+-  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
+-  <component name="TaskManager">
+-    <task active="true" id="Default" summary="默认任务">
+-      <changelist id="0223e498-9d37-4de5-9ad1-8a9d3c8e31c3" name="更改" comment="" />
+-      <created>1710316180946</created>
+-      <option name="number" value="Default" />
+-      <option name="presentableId" value="Default" />
+-      <updated>1710316180946</updated>
+-      <workItem from="1710316205375" duration="92000" />
+-      <workItem from="1710316302952" duration="2345000" />
+-      <workItem from="1710318758218" duration="425000" />
+-      <workItem from="1710319189675" duration="6270000" />
+-      <workItem from="1711329272552" duration="17731000" />
+-    </task>
+-    <task id="LOCAL-00001" summary="2024.03.13">
+-      <created>1710318899380</created>
+-      <option name="number" value="00001" />
+-      <option name="presentableId" value="LOCAL-00001" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710318899380</updated>
+-    </task>
+-    <task id="LOCAL-00002" summary="2024.03.13">
+-      <created>1710319633484</created>
+-      <option name="number" value="00002" />
+-      <option name="presentableId" value="LOCAL-00002" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710319633484</updated>
+-    </task>
+-    <task id="LOCAL-00003" summary="2024.03.13">
+-      <created>1710320110380</created>
+-      <option name="number" value="00003" />
+-      <option name="presentableId" value="LOCAL-00003" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710320110380</updated>
+-    </task>
+-    <task id="LOCAL-00004" summary="2024.03.13">
+-      <created>1710320166910</created>
+-      <option name="number" value="00004" />
+-      <option name="presentableId" value="LOCAL-00004" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710320166910</updated>
+-    </task>
+-    <task id="LOCAL-00005" summary="2024.03.13">
+-      <created>1710320348280</created>
+-      <option name="number" value="00005" />
+-      <option name="presentableId" value="LOCAL-00005" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710320348280</updated>
+-    </task>
+-    <task id="LOCAL-00006" summary="2024.03.13">
+-      <created>1710324363716</created>
+-      <option name="number" value="00006" />
+-      <option name="presentableId" value="LOCAL-00006" />
+-      <option name="project" value="LOCAL" />
+-      <updated>1710324363716</updated>
+-    </task>
+-    <option name="localTasksCounter" value="7" />
+-    <servers />
+-  </component>
+-  <component name="TypeScriptGeneratedFilesManager">
+-    <option name="version" value="3" />
+-  </component>
+-  <component name="Vcs.Log.Tabs.Properties">
+-    <option name="TAB_STATES">
+-      <map>
+-        <entry key="MAIN">
+-          <value>
+-            <State />
+-          </value>
+-        </entry>
+-      </map>
+-    </option>
+-  </component>
+-  <component name="VcsManagerConfiguration">
+-    <MESSAGE value="2024.03.13" />
+-    <option name="LAST_COMMIT_MESSAGE" value="2024.03.13" />
+-  </component>
+-  <component name="com.intellij.coverage.CoverageDataManagerImpl">
+-    <SUITE FILE_PATH="coverage/IOmga$Flask__app_py_.coverage" NAME="Flask (app.py) 覆盖结果" MODIFIED="1710318377612" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+-    <SUITE FILE_PATH="coverage/IOmga$app.coverage" NAME="app 覆盖结果" MODIFIED="1711356440750" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+-  </component>
+-</project>
+\ No newline at end of file

+ 21 - 23
.idea/workspace.xml

@@ -1,13 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="AutoImportSettings">
-    <option name="autoReloadType" value="SELECTIVE" />
-  </component>
   <component name="ChangeListManager">
-    <list default="true" id="0223e498-9d37-4de5-9ad1-8a9d3c8e31c3" name="更改" comment="2024.03.13">
+    <list default="true" id="0c4e5391-a61c-4580-a848-8f7f11272093" name="更改" comment="">
+      <change afterPath="$PROJECT_DIR$/templates/base-layout.html" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/templates/search-container.html" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/IOmga.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/IOmga.iml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/static/js/layui-modules/labelGeneration.css" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/static/js/layui-modules/labelGeneration.js" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/templates/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/templates/index.html" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
@@ -42,10 +43,6 @@
   <component name="MarkdownSettingsMigration">
     <option name="stateVersion" value="1" />
   </component>
-  <component name="ProjectColorInfo"><![CDATA[{
-  "customColor": "",
-  "associatedIndex": 1
-}]]></component>
   <component name="ProjectId" id="2dcnLohNDxLqQbbzoH11K0b5t0H" />
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
   <component name="ProjectViewState">
@@ -59,13 +56,7 @@
     "RunOnceActivity.OpenProjectViewOnStart": "true",
     "RunOnceActivity.ShowReadmeOnStart": "true",
     "WebServerToolWindowFactoryState": "false",
-    "git-widget-placeholder": "master",
-    "node.js.detected.package.eslint": "true",
-    "node.js.detected.package.tslint": "true",
-    "node.js.selected.package.eslint": "(autodetect)",
-    "node.js.selected.package.tslint": "(autodetect)",
-    "settings.editor.selected.configurable": "preferences.pluginManager",
-    "vue.rearranger.settings.migration": "true"
+    "settings.editor.selected.configurable": "com.jetbrains.python.templateLanguages.PyTemplateLanguageModulesConfigurable"
   }
 }]]></component>
   <component name="RunManager" selected="Python.app">
@@ -122,7 +113,7 @@
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
   <component name="TaskManager">
     <task active="true" id="Default" summary="默认任务">
-      <changelist id="0223e498-9d37-4de5-9ad1-8a9d3c8e31c3" name="更改" comment="" />
+      <changelist id="0c4e5391-a61c-4580-a848-8f7f11272093" name="更改" comment="" />
       <created>1710316180946</created>
       <option name="number" value="Default" />
       <option name="presentableId" value="Default" />
@@ -131,8 +122,8 @@
       <workItem from="1710316302952" duration="2345000" />
       <workItem from="1710318758218" duration="425000" />
       <workItem from="1710319189675" duration="6270000" />
-      <workItem from="1711329272552" duration="17731000" />
-      <workItem from="1711374103110" duration="1540000" />
+      <workItem from="1711329272552" duration="18425000" />
+      <workItem from="1711414296788" duration="12274000" />
     </task>
     <task id="LOCAL-00001" summary="2024.03.13">
       <created>1710318899380</created>
@@ -176,7 +167,14 @@
       <option name="project" value="LOCAL" />
       <updated>1710324363716</updated>
     </task>
-    <option name="localTasksCounter" value="7" />
+    <task id="LOCAL-00007" summary="2024.03.25">
+      <created>1711360966024</created>
+      <option name="number" value="00007" />
+      <option name="presentableId" value="LOCAL-00007" />
+      <option name="project" value="LOCAL" />
+      <updated>1711360966024</updated>
+    </task>
+    <option name="localTasksCounter" value="8" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -195,11 +193,11 @@
   </component>
   <component name="VcsManagerConfiguration">
     <MESSAGE value="2024.03.13" />
-    <option name="LAST_COMMIT_MESSAGE" value="2024.03.13" />
+    <MESSAGE value="2024.03.25" />
+    <option name="LAST_COMMIT_MESSAGE" value="2024.03.25" />
   </component>
   <component name="com.intellij.coverage.CoverageDataManagerImpl">
-    <SUITE FILE_PATH="coverage/IOmga$app.coverage" NAME="app 覆盖结果" MODIFIED="1711356440750" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/IOmga$Flask__app_py_.coverage" NAME="Flask (app.py) 覆盖结果" MODIFIED="1710318377612" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
-    <SUITE FILE_PATH="coverage/Iomga$app.coverage" NAME="app 覆盖结果" MODIFIED="1711374195770" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+    <SUITE FILE_PATH="coverage/IOmga$app.coverage" NAME="app 覆盖结果" MODIFIED="1711434447333" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
   </component>
 </project>

TEMPAT SAMPAH
static/img/Book-Online-hover.png


File diff ditekan karena terlalu besar
+ 2 - 0
static/img/LOGO.svg


+ 0 - 7
static/js/layui-modules/labelGeneration.css

@@ -1,7 +0,0 @@
-.none-transition{
-    transition: none;
-    -webkit-transition: none;
-}
-.layui-btn{
-	margin: 10px 0px 10px 10px;
-}

+ 0 - 272
static/js/layui-modules/labelGeneration.js

@@ -1,272 +0,0 @@
-layui.define(['form'], function (exports) {
-
-    var form = layui.form,
-        $ = layui.jquery,
-        index = 0,
-		oldId,
-    MOD_NAME = 'labelGeneration',
-        formField = {
-            label: {
-                id: '-1',
-                tag: "label",
-            },
-        },
-        labelGeneration = {
-            set: function (options) {
-                var that = this;
-                that.config = $.extend({}
-                    , that.config
-                    , options);
-                return that;
-            }
-            //事件监听
-            , on: function (events
-                , callback) {
-                return layui.onevent.call(this
-                    , MOD_NAME
-                    , events
-                    , callback);
-            }
-        },
-        Class = function (options) {
-            var that = this;
-            that.config = $.extend({}
-                , that.config
-                , labelGeneration.config
-                , options);
-            that.render();
-        },
-        thisIns = function () {
-            var that = this
-                , options = that.config;
-            return {
-                reload: function (options) {
-                    that.reload.call(that
-                        , options);
-                }, getOptions: function () {
-                    return options || null;
-                }, getData: function () {
-                    return options.data || null;
-                }
-            }
-        }
-
-    Class.prototype.config = {
-        version: "1.0.0"
-        , Author: "谁家没一个小强"
-        , generateId: 0
-        , data: []
-        , isEnter: false
-    };
-
-    /* 自动生成ID 当前页面自动排序*/
-    Class.prototype.autoId = function (tag) {
-        var that = this,
-            options = that.config;
-        options.generateId = options.generateId + 1;
-        return tag + '_' + options.generateId;
-    }
-
-    Class.prototype.components = {
-        label: {
-            render: function (json,options) {
-                var _html = '<blockquote class="layui-elem-quote">';
-                _html += '<div class="layui-form layui-form-pane layui-form-item">';
-                _html += '<label class="layui-form-label">输入标签</label>';
-                _html += '<div class="layui-input-inline">';
-				if (options.isEnter) {
-                _html += '<input type="text" id="{0}" lay-verify="required" placeholder="按回车生成标签" autocomplete="off" class="layui-input">'
-                    .format(json.id);
-				} else {
-					_html += '<input type="text" id="{0}" lay-verify="required" placeholder="通过按钮生成标签" autocomplete="off" class="layui-input">'
-                    .format(json.id);
-				}
-                _html += '</div>';
-                if (!options.isEnter) {
-                    _html += '<button type="button" id="{0}-button" class="layui-btn layui-btn-normal">确定</button>'.format(json.id);
-                }
-                _html += '<label class="layui-form-label">颜色选择</label>';
-                _html += '<div class="layui-input-inline">';
-                _html += '<select lay-filter="{0}-switchTest">'.format(json.id);
-                _html += '<option value="" selected>墨绿色</option>';
-                _html += '<option value="layui-btn-primary">原始色</option>';
-                _html += '<option value="layui-btn-normal">天蓝色</option>';
-                _html += '<option value="layui-btn-warm">暖黄色</option>';
-                _html += '<option value="layui-btn-danger">红色</option>';
-                _html += '</select>';
-                _html += '</div>';
-                _html += '</div>';
-                _html += '<div id="{0}-content"></div>'.format(json.id);
-                _html += '</blockquote>';
-                return _html;
-            },
-            update: function (json) {
-
-            },
-            /* 获取对象 */
-            jsonData: function (id, that) {
-                //分配一个新的ID
-                var _json = JSON.parse(JSON.stringify(formField.label));
-                _json.id = id == undefined ? that.autoId(_json.tag) : id;
-				that.checkId(_json,that);
-                return _json;
-            }
-        }
-    };
-
-	/* 判定id是否重复*/
-    Class.prototype.checkId = function (json,that) {
-        if ($("#" + json.id + "-content").length != 0) {
-				json.id = that.autoId(json.tag);
-				that.checkId(json);
-		} else {
-			return;
-		}
-    }
-
-    Class.prototype.bindGridSortEvent = function (json) {
-        var that = this
-            , options = that.config;
-        var formItemSort = Sortable.create(document.getElementById(json.id + "-content"), {
-            group: {
-                name: 'group' + json.id
-            },
-            animation: 1000,
-            onEnd: function (evt) {
-                var _values = $("#" + json.id + "-content").find("div");
-                var ops = [];
-                for (var i = 0; i < _values.length; i++) {
-                    ops.push({"ngColor": $(_values[i]).attr("ng-color"), "value": $(_values[i]).text()});
-                }
-                options.data = ops;
-            }
-        });
-    }
-
-    /* 绑定事件*/
-    Class.prototype.deleteValue = function (value, ngValue) {
-        var that = this
-            , options = that.config;
-        for (var i = 0; i < options.data.length; i++) {
-            if (options.data[i].value === value && options.data[i].ngColor === ngValue) {
-                options.data.splice(i, 1);
-                break;
-            }
-        }
-    }
-
-    /* 绑定事件*/
-    Class.prototype.bindPropertyEvent = function (_json) {
-        var that = this
-            , options = that.config;
-        var colorClass = "";
-        if (options.isEnter) {
-            $("#" + _json.id).keypress(function (event) {
-                if (event.which === 13) {
-                    var _value = $(this).val();
-                    index = index + 1;
-                    var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
-                        .format(colorClass, _value, _json.id + index, index);
-                    $("#" + _json.id + "-content").append(_html);
-                    options.data.push({"ngColor": colorClass, "value": _value});
-                    $("#" + _json.id + index + " .layui-icon-close").click(function () {
-                        that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
-                        $(this).parent().remove();
-                    });
-                }
-            });
-        } else {
-            $("#" + _json.id + "-button").click(function (event) {
-                var _value = $("#" + _json.id).val();
-                index = index + 1;
-                var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
-                    .format(colorClass, _value, _json.id + index, index);
-                $("#" + _json.id + "-content").append(_html);
-                options.data.push({"ngColor": colorClass, "value": _value});
-                $("#" + _json.id + index + " .layui-icon-close").click(function () {
-                    that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
-                    $(this).parent().remove();
-                });
-            });
-        }
-
-        form.on('select(' + _json.id + '-switchTest)', function (data) {
-            colorClass = data.value;
-        });
-        for (var i = 0; i < options.data.length; i++) {
-            index = index + 1;
-            var _html = '<div class="layui-btn {0} none-transition" id="{2}" ng-index="{3}" ng-color="{0}">{1}<i class="layui-icon layui-icon-close"></i></div>'
-                .format(options.data[i].ngColor, options.data[i].value, _json.id + index, index);
-            $("#" + _json.id + "-content").append(_html);
-            $("#" + _json.id + index + " .layui-icon-close").click(function () {
-                that.deleteValue($(this).parent().text(), $(this).parent().attr("ng-color"));
-                $(this).parent().remove();
-            });
-        }
-    }
-
-    /* 渲染组件 */
-    Class.prototype.renderComponents = function () {
-        var that = this
-            , options = that.config;
-        var elem = $(options.elem);
-        elem.empty();
-        var jsonData = that.components['label'].jsonData(undefined, that);
-        elem.append(that.components['label'].render(jsonData,options));
-        that.bindPropertyEvent(jsonData);
-        that.bindGridSortEvent(jsonData);
-        form.render();
-    }
-
-    Class.prototype.reload = function (options) {
-        var that = this;
-        options = options || {};//如果是空的话,就赋值 {}
-        that.config = $.extend({}
-            , that.config
-            , labelGeneration.config
-            , options);
-        that.render();
-    }
-
-    //核心入口 初始化一个 regionSelect 类
-    labelGeneration.render = function (options) {
-        var ins = new Class(options);
-        return thisIns.call(ins);
-    }
-    /**
-     * 渲染组件
-     */
-    Class.prototype.render = function (options) {
-        var that = this
-            , options = that.config;
-        that.renderComponents();
-    }
-
-    String.prototype.format = function (args) {
-        var result = this;
-        if (arguments.length > 0) {
-            if (arguments.length == 1 && typeof (args) == "object") {
-                for (var key in args) {
-                    if (args[key] != undefined) {
-                        var reg = new RegExp("({" + key + "})"
-                            , "g");
-                        result = result.replace(reg
-                            , args[key]);
-                    }
-                }
-            } else {
-                for (var i = 0; i < arguments.length; i++) {
-                    if (arguments[i] != undefined) {
-                        var reg = new RegExp("({[" + i + "]})"
-                            , "g");
-                        result = result.replace(reg
-                            , arguments[i]);
-                    }
-                }
-            }
-        }
-        return result;
-    }
-
-    exports(MOD_NAME, labelGeneration);
-});

+ 19 - 0
static/js/layui-modules/tag.css

@@ -0,0 +1,19 @@
+.input-new-tag {
+    width: 90px;
+}
+.input-new-tag input {
+    height: 100%;
+    border: none;
+    padding-left:0px;
+}
+
+.tag .layui-btn .tag-close:hover {
+    border-radius: 2px;
+    background-color: #FF5722;
+    color: #fff;
+}
+.tag .layui-btn .tag-close {
+    margin-left: 8px;
+    transition: all .2s;
+    -webkit-transition: all .2s;
+}

+ 170 - 0
static/js/layui-modules/tag.js

@@ -0,0 +1,170 @@
+/**
+
+ @Name:layui.age Tag标签
+ @Author:lih
+ @License:MIT
+    
+ */
+ 
+layui.define('jquery', function(exports){
+  "use strict";
+  
+  var $ = layui.$
+  ,MOD_NAME = 'tag',
+  TAG_CLASS = '.tag',
+  BUTTON_NEW_TAG ='button-new-tag',
+  INPUT_NEW_TAG ='input-new-tag',
+  TAG_ITEM ='tag-item',
+  CLOSE = 'tag-close',
+  DEFAULT_SKIN ='layui-btn layui-btn-primary layui-btn-sm'
+  ,tag = function(){
+    this.config = {
+      likeHref:'../../layui-modules/tag.css',
+      skin: DEFAULT_SKIN,
+      tagText:'+ New Tag'
+    };
+    this.configs = {}
+  };
+  
+  //全局设置
+  tag.prototype.set = function(options){
+    var that = this;
+    $.extend(true, that.config, options);
+    tag.render();
+    return that;
+  };
+  
+  //表单事件监听
+  tag.prototype.on = function(events, callback){
+    return layui.onevent.call(this, MOD_NAME, events, callback);
+  };
+  
+  //外部Tag新增
+  tag.prototype.add = function(filter, options){
+    var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']')
+    call.add(null, tagElem, options);
+    call.tagAuto(filter);
+    return this;
+  };
+  
+  //外部Tag删除
+  tag.prototype.delete = function(filter, layid){
+    var tagElem = $(TAG_CLASS + '[lay-filter='+ filter +']')
+    ,tagItemElem = tagElem.find('>.' + TAG_ITEM + '[lay-id="'+ layid +'"]');
+    call.delete(null, tagItemElem);
+    return this;
+  };
+
+  //基础事件体
+  var call = {
+    //Tag点击
+    tagClick: function(e, index, tagItemElem, options){
+      options = options || {};
+      var othis = tagItemElem || $(this)
+      ,index = index || othis.index(othis)
+      ,parents = othis.parents(TAG_CLASS).eq(0)
+      ,filter = parents.attr('lay-filter');
+      layui.event.call(this, MOD_NAME, 'click('+ filter +')', {
+        elem: parents
+        ,index: index
+      });
+    }
+    //Tag新增事件
+    ,add: function(e, tagElem, options){
+      var  filter = tagElem.attr('lay-filter'),
+           buttonNewTag = tagElem.children('.' + BUTTON_NEW_TAG),
+           index = buttonNewTag.index()
+          ,newTag = '<button lay-id="'+ (options.id||'') +'"' +(options.attr ? ' lay-attr="'+ options.attr +'"' : '') +' type="button" class="' + TAG_ITEM  + '">'+ (options.text||'unnaming') +'</button>';
+      var result = layui.event.call(this, MOD_NAME, 'add('+ filter +')', {
+        elem: tagElem
+        ,index: index
+        ,othis: newTag
+      })
+      if(result === false) return;
+      buttonNewTag[0] ? buttonNewTag.before(newTag) : tagElem.append(newTag);
+    }
+    //Tag输入事件
+    ,input: function(e, othis){
+      var buttonNewTag = othis || $(this)
+      ,parents = buttonNewTag.parents(TAG_CLASS).eq(0)
+      ,filter = parents.attr('lay-filter')
+      var options = tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options);
+      //标签输入框
+      var inpatNewTag = $('<div class="' + INPUT_NEW_TAG + '"><input type="text" autocomplete="off" class="layui-input"></div>');
+      inpatNewTag.addClass(options.skin);
+      buttonNewTag.after(inpatNewTag).remove();
+      inpatNewTag.children('.layui-input').on('blur', function () {
+        if(this.value){
+          var options = {
+            text: this.value
+          }
+          call.add(null, parents, options);
+        }
+        inpatNewTag.remove();
+        call.tagAuto(filter);
+      }).focus();
+    }
+    //Tag删除
+    ,delete: function(e, othis){
+      var tagItem = othis || $(this).parent(), index = tagItem.index()
+      ,parents = tagItem.parents(TAG_CLASS).eq(0)
+      ,filter = parents.attr('lay-filter');
+
+      var result = layui.event.call(this, MOD_NAME, 'delete('+ filter +')', {
+        elem: parents
+        ,index: index
+      })
+      if(result === false) return;
+      tagItem.remove()
+    }
+    //Tag 自适应
+    ,tagAuto: function(filter){
+      filter = filter || '';
+      var options = filter ? tag.configs[filter] || tag.config : tag.config;
+      var elemFilter = function(){
+        return filter ? ('[lay-filter="' + filter +'"]') : '';
+      }();
+      $(TAG_CLASS + elemFilter).each(function(){
+        var othis = $(this),tagItem = othis.children('.' + TAG_ITEM), buttonNewTag = othis.children('.' + BUTTON_NEW_TAG);
+        tagItem.removeClass(DEFAULT_SKIN).addClass(options.skin);
+        //允许关闭
+        if(othis.attr('lay-allowClose') && tagItem.length){
+          tagItem.each(function(){
+            var li = $(this);
+            if(!li.find('.'+CLOSE)[0]){
+              var close = $('<i class="layui-icon layui-unselect '+ CLOSE +'">&#x1006;</i>');
+              close.on('click', call.delete);
+              li.append(close);
+            }
+          });
+        }
+        //允许新增标签
+        if(othis.attr('lay-newTag') && buttonNewTag.length === 0){
+          buttonNewTag = $('<button type="button" class="' + BUTTON_NEW_TAG + '"></button>');
+          buttonNewTag.on('click', call.input);
+          othis.append(buttonNewTag);
+        }
+        buttonNewTag.html(options.tagText);
+        buttonNewTag.removeClass(DEFAULT_SKIN).addClass(options.skin);
+      });
+    }
+  };
+  
+  //初始化元素操作
+  tag.prototype.init = function(filter, options){
+    layui.addcss(tag.config.likeHref);
+    if(filter){
+      tag.configs[filter] = $.extend({}, tag.config, tag.configs[filter] || {}, options);
+    }
+    return call.tagAuto.call(this, filter);
+  };
+  
+  tag.prototype.render = tag.prototype.init;
+
+  var tag = new tag(), dom = $(document);
+  tag.render();
+
+  dom.on('click', '.' + TAG_ITEM, call.tagClick); //tag 单击事件
+  exports(MOD_NAME, tag);
+});
+

+ 86 - 0
templates/base-layout.html

@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <title>IOmga</title>
+    <link rel="stylesheet" href="{{ url_for('static', filename='js/layui-v2.9.7/css/layui.css') }}">
+    <style>
+        body, html {
+            height: 100vh;
+            margin: 0;
+            padding: 0;
+        }
+
+        .my-logo {
+            height: 68px;
+        }
+
+        .my-icon {
+            font-size: 18px;
+            margin-right: 6px;
+        }
+
+        .main-container {
+            height: 100%;
+            width: 100%;
+        }
+    </style>
+</head>
+<body>
+<div class="layui-layout layui-fluid" style="height: 100%; padding: 0">
+    <div class="layui-row" style="height: 100%">
+        <div class="layui-col-md2" style="height: 100%;background-color: pink">
+            <div class="layui-logo layui-hide-xs layui-bg-gray my-logo">
+                <img src="{{ url_for('static', filename='img/LOGO.svg') }}">
+            </div>
+            <div class="layui-row" style="height: calc(100% - 68px)">
+                <ul class="layui-nav layui-nav-tree" style="width: 100%; height: 100%; position: relative;">
+                    <li class="layui-nav-item layui-this">
+                        <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-home my-icon"></i>首页</a>
+                    </li>
+                    <li class="layui-nav-item">
+                        <a class="layui-font-18" href="javascript:;"><i
+                                class="layui-icon layui-icon-download-circle my-icon"></i>下载
+                            <span class="layui-badge">9</span>
+                        </a>
+                    </li>
+                    <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i
+                            class="layui-icon layui-icon-component my-icon"></i>插件</a></li>
+                    <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i
+                            class="layui-icon layui-icon-set my-icon"></i>设置</a></li>
+                    <li class="layui-nav-item" style="position: absolute; bottom: 0">
+                        <hr class="layui-bg-black" style="margin: 0; border-bottom-width: 2px">
+                        <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-tips my-icon"></i>关于</a>
+                    </li>
+                </ul>
+            </div>
+        </div>
+        <div class="layui-col-md10" style="height: 100%;background-color: white">
+            <div class="main-container">
+                {% block container %}main-container{% endblock %}
+            </div>
+        </div>
+    </div>
+</div>
+
+<!-- 引入 layui.js 的 <script> 标签最好放置在 html 末尾 -->
+<script src="{{ url_for('static', filename='js/layui-v2.9.7/layui.js') }}"></script>
+<script src="{{ url_for('static', filename='js/Sortable/Sortable.js') }}"></script>
+<script>
+    layui.config({
+        base: "{{ url_for('static', filename='js/layui-modules/') }}",
+        version: true
+    }).use(["layer", "element"], function () {
+        var layer = layui.layer
+            ,element = layui.element;
+
+        //欢迎信息
+        layer.msg('Hello World');
+        // 渲染 nav 导航菜单
+        element.render('nav');
+
+    });
+</script>
+</body>
+</html>

+ 171 - 123
templates/index.html

@@ -1,148 +1,196 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-  <title>测试 - layui</title>
-  <link rel="stylesheet" href="{{ url_for('static', filename='js/layui-v2.9.7/css/layui.css') }}">
-  <link rel="stylesheet" href="{{ url_for('static', filename='js/layui-modules/labelGeneration.css') }}">
-  <style>
-    body,html{
-      height: 100vh;
-      margin: 0;
-      padding: 0;
-    }
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <title>IOmga</title>
+    <link rel="stylesheet" href="{{ url_for('static', filename='js/layui-v2.9.7/css/layui.css') }}">
+    <style>
+        body, html {
+            height: 100vh;
+            margin: 0;
+            padding: 0;
+        }
 
-    .my-logo {
-      height: 68px;
-    }
+        .my-logo {
+            height: 68px;
+        }
 
-    .my-icon {
-      font-size: 18px;
-      margin-right: 6px;
-    }
+        .my-icon {
+            font-size: 18px;
+            margin-right: 6px;
+        }
 
-    .main-container {
-      height: 100%;
-      width: 100%;
-      display: flex;
-      align-items: center;
-      justify-content: center;
-    }
+        .main-container {
+            height: 100%;
+            width: 100%;
+        }
 
-    .search-container {
-      width: calc(100% - 200px);
-    }
-  </style>
+        li#search-tab .layui-tab-close {
+            display: none;
+        }
+
+        .index-tab-content {
+            height: calc(100% - (41px + 10px));
+            padding: 0;
+        }
+
+        .search-body-container {
+            height: 100%;
+            width: 100%;
+            display: flex;
+            align-items: center;
+            justify-content: center;
+        }
+
+        .search-main-container {
+            width: calc(100% - 200px);
+            height: 300px;
+        }
+
+        .gradient {
+            /* 背景渐变色 */
+            background: linear-gradient(-45deg, #2af598 0%, #009efd 100%);
+            /* 背景尺寸 */
+            background-size: 600% 600%;
+            /* 循环动画 */
+            animation: gradientBG 5s ease infinite;
+        }
+
+        /* 动画,控制背景 background-position */
+        @keyframes gradientBG {
+            0% {
+                background-position: 0% 50%;
+            }
+            50% {
+                background-position: 100% 50%;
+            }
+            100% {
+                background-position: 0% 50%;
+            }
+        }
+    </style>
 </head>
 <body>
-  <div class="layui-layout layui-fluid" style="height: 100%; padding: 0">
+<div class="layui-layout layui-fluid" style="height: 100%; padding: 0">
     <div class="layui-row" style="height: 100%">
-      <div class="layui-col-md2" style="height: 100%;background-color: pink">
-        <div class="layui-logo layui-hide-xs layui-bg-gray my-logo">layout demo</div>
-        <div class="layui-row" style="height: calc(100% - 68px)">
-          <ul class="layui-nav layui-nav-tree" style="width: 100%; height: 100%; position: relative;">
-            <li class="layui-nav-item layui-this">
-              <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-home my-icon"></i>首页</a>
-            </li>
-            <li class="layui-nav-item">
-              <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-download-circle my-icon"></i>下载
-                <span class="layui-badge">9</span>
-              </a>
-            </li>
-            <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-component my-icon"></i>插件</a></li>
-            <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-set my-icon"></i>设置</a></li>
-            <li class="layui-nav-item" style="position: absolute; bottom: 0">
-              <hr class="layui-bg-black" style="margin: 0; border-bottom-width: 2px">
-              <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-tips my-icon"></i>关于</a>
-            </li>
-          </ul>
-        </div>
-      </div>
-      <div class="layui-col-md10" style="height: 100%;background-color: white">
-        <div class="main-container">
-          <div class="search-container">
-            <div class="layui-text" style=" ">
-              <h1>欢迎使用XXXXXX</h1>
+        <div class="layui-col-md2" style="height: 100%;background-color: pink">
+            <div class="layui-logo layui-hide-xs layui-bg-gray my-logo">
+                <img src="{{ url_for('static', filename='img/LOGO.svg') }}">
             </div>
-            <form class="layui-form" action="">
-              <div class="layui-form-item">
-                <div class="layui-input-group" style="width: 100%">
-                  <input type="text" placeholder="请输入想要搜寻的XXX..." class="layui-input">
-                  <div class="layui-input-split layui-input-suffix" style="cursor: pointer; width: 1px">
-                    <i class="layui-icon layui-icon-search my-icon"></i>
-                    搜索
-                  </div>
+            <div class="layui-row" style="height: calc(100% - 68px)">
+                <ul class="layui-nav layui-nav-tree" style="width: 100%; height: 100%; position: relative;">
+                    <li class="layui-nav-item layui-this">
+                        <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-home my-icon"></i>首页</a>
+                    </li>
+                    <li class="layui-nav-item">
+                        <a class="layui-font-18" href="javascript:;"><i
+                                class="layui-icon layui-icon-download-circle my-icon"></i>下载
+                            <span class="layui-badge">9</span>
+                        </a>
+                    </li>
+                    <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i
+                            class="layui-icon layui-icon-component my-icon"></i>插件</a></li>
+                    <li class="layui-nav-item"><a class="layui-font-18" href="javascript:;"><i
+                            class="layui-icon layui-icon-set my-icon"></i>设置</a></li>
+                    <li class="layui-nav-item" style="position: absolute; bottom: 0">
+                        <hr class="layui-bg-black" style="margin: 0; border-bottom-width: 2px">
+                        <a class="layui-font-18" href="javascript:;"><i class="layui-icon layui-icon-tips my-icon"></i>关于</a>
+                    </li>
+                </ul>
+            </div>
+        </div>
+        <div class="layui-col-md10" style="height: 100%;background-color: white">
+            <div class="main-container">
+                <div class="layui-tab" lay-filter="body-handle" lay-allowclose="true" style="padding-top: 10px; margin: 0">
+                    <ul class="layui-tab-title">
+                        <li id="search-tab" class="layui-this" lay-id="search">搜索</li>
+                        <li lay-id="search-result">搜索结果</li>
+                    </ul>
                 </div>
-              </div>
-              <div class="layui-form-item">
-                <label class="layui-form-label" style="padding-left: 0; text-align: left; width: 100px">选择搜索平台:</label>
-                <div class="layui-input-block" style="width: 180px; margin-left: 115px">
-                  <select name="platform" lay-filter="platform">
-                    <option value="0" selected>聚合搜索</option>
-                    <option value="1">AAAA</option>
-                    <option value="2">BBBB</option>
-                    <option value="3">CCCC</option>
-                    <option value="4">DDDD</option>
-                  </select>
+                <div class="layui-tab-content index-tab-content">
+                    <div class="layui-tab-item layui-show" style="height: 100%; width: 100%">
+                        <div class="search-body-container gradient">
+                            <div class="search-main-container">
+                                <div class="layui-text" style=" ">
+                                    <h1>欢迎使用XXXXXX</h1>
+                                </div>
+                                <form class="layui-form" action="">
+                                    <div class="layui-form-item">
+                                        <div class="layui-input-group" style="width: 100%">
+                                            <input type="text" placeholder="请输入想要搜寻的XXX..." class="layui-input">
+                                            <div class="layui-input-split layui-input-suffix layui-bg-green"
+                                                 style="cursor: pointer; width: 1px">
+                                                <i class="layui-icon layui-icon-search my-icon"></i>
+                                                搜索
+                                            </div>
+                                        </div>
+                                    </div>
+                                    <div class="layui-form-item">
+                                        <label class="layui-form-label"
+                                               style="padding-left: 0; text-align: left; width: 100px">选择搜索平台:</label>
+                                        <div class="layui-input-block" style="width: 180px; margin-left: 115px">
+                                            <select name="platform" lay-filter="platform">
+                                                <option value="0" selected>聚合搜索</option>
+                                                <option value="1">AAAA</option>
+                                                <option value="2">BBBB</option>
+                                                <option value="3">CCCC</option>
+                                                <option value="4">DDDD</option>
+                                            </select>
+                                        </div>
+                                    </div>
+                                </form>
+                                <div class="layui-btn-container tag" lay-filter="demo" lay-allowclose="true"
+                                     lay-newTag="">
+                                    <button lay-id="11" type="button" class="tag-item">网站设置</button>
+                                    <button lay-id="22" type="button" class="tag-item">用户管理</button>
+                                    <button lay-id="33" type="button" class="tag-item">权限分配</button>
+                                    <button lay-id="44" type="button" class="tag-item">商品管理</button>
+                                    <button lay-id="55" type="button" class="tag-item">订单管理</button>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                 </div>
-              </div>
-            </form>
-            <div id="formdesigner"></div>
-          </div>
+            </div>
         </div>
-      </div>
     </div>
-  </div>
+</div>
 
 <!-- 引入 layui.js 的 <script> 标签最好放置在 html 末尾 -->
 <script src="{{ url_for('static', filename='js/layui-v2.9.7/layui.js') }}"></script>
 <script src="{{ url_for('static', filename='js/Sortable/Sortable.js') }}"></script>
 <script>
-layui.config({
-  base: "{{ url_for('static', filename='js/layui-modules/') }}",
-  version: true
-}).use(["layer", "form", "laypage", "element", "util", "labelGeneration"], function(){
-  var layer = layui.layer
-  ,form = layui.form
-  ,laypage = layui.laypage
-  ,element = layui.element
-  ,util = layui.util
-  ,labelGeneration = layui.labelGeneration;
-  
-  //欢迎信息
-  layer.msg('Hello World');
-  // 渲染 nav 导航菜单
-  element.render('nav');
+    layui.config({
+        base: "{{ url_for('static', filename='js/layui-modules/') }}",
+        version: true
+    }).use(["layer", "form", "laypage", "element", "util", "tag"], function () {
+        var layer = layui.layer
+            , form = layui.form
+            , laypage = layui.laypage
+            , element = layui.element
+            , util = layui.util
+            , tag = layui.tag;
+
+        //欢迎信息
+        layer.msg('Hello World');
+        // 渲染 nav 导航菜单
+        element.render('nav');
+
+        tag.on('click(demo)', function (data) {
+            console.log('点击');
+            console.log(this); //当前Tag标签所在的原始DOM元素
+            console.log(data.index); //得到当前Tag的所在下标
+            console.log(data.elem); //得到当前的Tag大容器
+        });
 
-  var render = labelGeneration.render({
-    elem: '#formdesigner',
-    data: [
-      {
-        "ngColor": "",
-        "value": "标签1"
-      },
-      {
-        "ngColor": "layui-btn-primary",
-        "value": "标签2"
-      },
-      {
-        "ngColor": "layui-btn-normal",
-        "value": "标签3"
-      },
-      {
-        "ngColor": "layui-btn-warm",
-        "value": "标签4"
-      },
-      {
-        "ngColor": "layui-btn-danger",
-        "value": "标签5"
-      }
-    ],
-    isEnter: true
-  });
+        // tab 删除事件
+        element.on('tabDelete(body-handle)', function(data){
+          console.log(data.index); // 得到被删除的 tab 项的所在下标
+          console.log(data.elem); // 得到当前的 tab 容器
+        });
 
-});
+    });
 </script>
 </body>
 </html>

+ 4 - 0
templates/search-container.html

@@ -0,0 +1,4 @@
+{% extends "base-layout.html" %}
+{% block container %}
+
+{% endblock %}

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini