作者 lifangxu

first on

正在显示 66 个修改的文件 包含 4711 行增加0 行删除

要显示太多修改。

为保证性能只显示 66 of 66+ 个文件。

  1 +{
  2 + "directory" : "public/assets/libs",
  3 + "ignoredDependencies": [
  4 + "file-saver",
  5 + "html2canvas",
  6 + "jspdf",
  7 + "jspdf-autotable"
  8 + ]
  9 +}
  1 +[app]
  2 +debug = false
  3 +trace = false
  4 +
  5 +[database]
  6 +hostname = 127.0.0.1
  7 +database = campus
  8 +username = campus
  9 +password = campus
  10 +hostport = 3306
  11 +prefix = fa_
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<module type="WEB_MODULE" version="4">
  3 + <component name="NewModuleRootManager">
  4 + <content url="file://$MODULE_DIR$" />
  5 + <orderEntry type="inheritedJdk" />
  6 + <orderEntry type="sourceFolder" forTests="false" />
  7 + </component>
  8 +</module>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="PublishConfigData" autoUpload="Always" serverName="campus">
  4 + <serverData>
  5 + <paths name="campus">
  6 + <serverdata>
  7 + <mappings>
  8 + <mapping deploy="/" local="$PROJECT_DIR$" web="/" />
  9 + </mappings>
  10 + </serverdata>
  11 + </paths>
  12 + <paths name="gamemall">
  13 + <serverdata>
  14 + <mappings>
  15 + <mapping local="$PROJECT_DIR$" web="/" />
  16 + </mappings>
  17 + </serverdata>
  18 + </paths>
  19 + <paths name="record">
  20 + <serverdata>
  21 + <mappings>
  22 + <mapping local="$PROJECT_DIR$" web="/" />
  23 + </mappings>
  24 + </serverdata>
  25 + </paths>
  26 + </serverData>
  27 + <option name="myAutoUpload" value="ALWAYS" />
  28 + </component>
  29 +</project>
  1 +<component name="InspectionProjectProfileManager">
  2 + <profile version="1.0">
  3 + <option name="myName" value="Project Default" />
  4 + <inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
  5 + <inspection_tool class="Jscs" enabled="true" level="ERROR" enabled_by_default="true" />
  6 + </profile>
  7 +</component>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ProjectModuleManager">
  4 + <modules>
  5 + <module fileurl="file://$PROJECT_DIR$/.idea/campus.iml" filepath="$PROJECT_DIR$/.idea/campus.iml" />
  6 + </modules>
  7 + </component>
  8 +</project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="WebServers">
  4 + <option name="servers">
  5 + <webServer id="24376dd6-7d05-4dfd-8983-67ab82adfcc5" name="campus" url="http://47.103.26.35">
  6 + <fileTransfer host="47.103.26.35" port="21">
  7 + <advancedOptions>
  8 + <advancedOptions dataProtectionLevel="Private" />
  9 + </advancedOptions>
  10 + <option name="port" value="21" />
  11 + </fileTransfer>
  12 + </webServer>
  13 + </option>
  14 + </component>
  15 +</project>
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<project version="4">
  3 + <component name="ChangeListManager">
  4 + <list default="true" id="d314d458-24d6-4b43-8f5a-763c7a27acda" name="Default" comment="" />
  5 + <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
  6 + <option name="TRACKING_ENABLED" value="true" />
  7 + <option name="SHOW_DIALOG" value="false" />
  8 + <option name="HIGHLIGHT_CONFLICTS" value="true" />
  9 + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
  10 + <option name="LAST_RESOLUTION" value="IGNORE" />
  11 + </component>
  12 + <component name="FileEditorManager">
  13 + <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
  14 + <file leaf-file-name="Getopenid.php" pinned="false" current-in-tab="false">
  15 + <entry file="file://$PROJECT_DIR$/application/api/controller/Getopenid.php">
  16 + <provider selected="true" editor-type-id="text-editor">
  17 + <state relative-caret-position="13150">
  18 + <caret line="545" column="28" lean-forward="false" selection-start-line="545" selection-start-column="28" selection-end-line="545" selection-end-column="28" />
  19 + <folding />
  20 + </state>
  21 + </provider>
  22 + </entry>
  23 + </file>
  24 + <file leaf-file-name="userinfo.js" pinned="false" current-in-tab="false">
  25 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/userinfo.js">
  26 + <provider selected="true" editor-type-id="text-editor">
  27 + <state relative-caret-position="825">
  28 + <caret line="33" column="130" lean-forward="false" selection-start-line="33" selection-start-column="130" selection-end-line="33" selection-end-column="130" />
  29 + <folding />
  30 + </state>
  31 + </provider>
  32 + </entry>
  33 + </file>
  34 + <file leaf-file-name="Base.php" pinned="false" current-in-tab="false">
  35 + <entry file="file://$PROJECT_DIR$/application/validate/Base.php">
  36 + <provider selected="true" editor-type-id="text-editor">
  37 + <state relative-caret-position="250">
  38 + <caret line="21" column="20" lean-forward="false" selection-start-line="21" selection-start-column="20" selection-end-line="21" selection-end-column="20" />
  39 + <folding />
  40 + </state>
  41 + </provider>
  42 + </entry>
  43 + </file>
  44 + <file leaf-file-name="Userinfo.php" pinned="false" current-in-tab="false">
  45 + <entry file="file://$PROJECT_DIR$/application/api/controller/Userinfo.php">
  46 + <provider selected="true" editor-type-id="text-editor">
  47 + <state relative-caret-position="14700">
  48 + <caret line="610" column="245" lean-forward="false" selection-start-line="610" selection-start-column="245" selection-end-line="610" selection-end-column="245" />
  49 + <folding />
  50 + </state>
  51 + </provider>
  52 + </entry>
  53 + </file>
  54 + <file leaf-file-name="studyclassinfo.js" pinned="false" current-in-tab="false">
  55 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/studyclassinfo.js">
  56 + <provider selected="true" editor-type-id="text-editor">
  57 + <state relative-caret-position="750">
  58 + <caret line="30" column="40" lean-forward="false" selection-start-line="30" selection-start-column="33" selection-end-line="30" selection-end-column="40" />
  59 + <folding />
  60 + </state>
  61 + </provider>
  62 + </entry>
  63 + </file>
  64 + <file leaf-file-name="Studyclassinfo.php" pinned="false" current-in-tab="true">
  65 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Studyclassinfo.php">
  66 + <provider selected="true" editor-type-id="text-editor">
  67 + <state relative-caret-position="445">
  68 + <caret line="61" column="27" lean-forward="false" selection-start-line="61" selection-start-column="27" selection-end-line="61" selection-end-column="27" />
  69 + <folding />
  70 + </state>
  71 + </provider>
  72 + </entry>
  73 + </file>
  74 + <file leaf-file-name="Backend.php" pinned="false" current-in-tab="false">
  75 + <entry file="file://$PROJECT_DIR$/application/admin/library/traits/Backend.php">
  76 + <provider selected="true" editor-type-id="text-editor">
  77 + <state relative-caret-position="1550">
  78 + <caret line="70" column="5" lean-forward="false" selection-start-line="39" selection-start-column="4" selection-end-line="70" selection-end-column="5" />
  79 + <folding>
  80 + <marker date="1557390272000" expanded="true" signature="13160:13267" ph="SELECT COLUM... COLUMNS" />
  81 + </folding>
  82 + </state>
  83 + </provider>
  84 + </entry>
  85 + </file>
  86 + <file leaf-file-name="Studyclassinfo.php" pinned="false" current-in-tab="false">
  87 + <entry file="file://$PROJECT_DIR$/application/admin/model/Studyclassinfo.php">
  88 + <provider selected="true" editor-type-id="text-editor">
  89 + <state relative-caret-position="850">
  90 + <caret line="34" column="55" lean-forward="false" selection-start-line="34" selection-start-column="55" selection-end-line="34" selection-end-column="55" />
  91 + <folding />
  92 + </state>
  93 + </provider>
  94 + </entry>
  95 + </file>
  96 + <file leaf-file-name="Userinfo.php" pinned="false" current-in-tab="false">
  97 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Userinfo.php">
  98 + <provider selected="true" editor-type-id="text-editor">
  99 + <state relative-caret-position="0">
  100 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  101 + <folding />
  102 + </state>
  103 + </provider>
  104 + </entry>
  105 + </file>
  106 + <file leaf-file-name="Userinfo.php" pinned="false" current-in-tab="false">
  107 + <entry file="file://$PROJECT_DIR$/application/validate/Userinfo.php">
  108 + <provider selected="true" editor-type-id="text-editor">
  109 + <state relative-caret-position="575">
  110 + <caret line="28" column="28" lean-forward="false" selection-start-line="28" selection-start-column="28" selection-end-line="28" selection-end-column="28" />
  111 + <folding />
  112 + </state>
  113 + </provider>
  114 + </entry>
  115 + </file>
  116 + </leaf>
  117 + </component>
  118 + <component name="FindInProjectRecents">
  119 + <findStrings>
  120 + <find>con</find>
  121 + <find>connection</find>
  122 + <find>Connection</find>
  123 + <find>config\</find>
  124 + <find>config</find>
  125 + <find>$config</find>
  126 + <find>dump</find>
  127 + <find>du</find>
  128 + <find>$connection</find>
  129 + <find>iv</find>
  130 + <find>$openid</find>
  131 + <find>$this-&gt;openid</find>
  132 + <find>classinfoset</find>
  133 + <find>setsubject</find>
  134 + <find>$replaceArr</find>
  135 + <find>$layout</find>
  136 + <find>getsubjectname</find>
  137 + <find>getclass</find>
  138 + <find>getpsubjects</find>
  139 + <find>$starttime</find>
  140 + <find>getclassindex</find>
  141 + <find>课后</find>
  142 + <find>发布</find>
  143 + <find>Classarea</find>
  144 + <find>signinindex</find>
  145 + <find>readinfo</find>
  146 + <find>sig</find>
  147 + <find>题目</find>
  148 + <find>startclass</find>
  149 + <find>login</find>
  150 + </findStrings>
  151 + </component>
  152 + <component name="IdeDocumentHistory">
  153 + <option name="CHANGED_PATHS">
  154 + <list>
  155 + <option value="$PROJECT_DIR$/public/assets/js/backend/psubject.js" />
  156 + <option value="$PROJECT_DIR$/application/admin/controller/Psubject.php" />
  157 + <option value="$PROJECT_DIR$/application/admin/view/subject/edit.html" />
  158 + <option value="$PROJECT_DIR$/application/admin/model/Userinfo1.php" />
  159 + <option value="$PROJECT_DIR$/application/admin/view/studyclassinfo/index.html" />
  160 + <option value="$PROJECT_DIR$/application/admin/controller/Classarea.php" />
  161 + <option value="$PROJECT_DIR$/public/assets/js/backend/classarea.js" />
  162 + <option value="$PROJECT_DIR$/application/admin/view/classarea/index.html" />
  163 + <option value="$PROJECT_DIR$/application/common.php" />
  164 + <option value="$PROJECT_DIR$/application/admin/model/Subject.php" />
  165 + <option value="$PROJECT_DIR$/public/assets/js/backend/subject.js" />
  166 + <option value="&lt;6b057809-9d70-421b-9d6c-8510ee0e1282&gt;/application/admin/view/tsubject/index.html" />
  167 + <option value="$PROJECT_DIR$/application/admin/view/tsubject/index.html" />
  168 + <option value="$PROJECT_DIR$/application/admin/model/Tsubject.php" />
  169 + <option value="$PROJECT_DIR$/application/admin/view/classsubject/index.html" />
  170 + <option value="$PROJECT_DIR$/application/admin/controller/Subject.php" />
  171 + <option value="$PROJECT_DIR$/public/assets/js/backend/tsubject.js" />
  172 + <option value="$PROJECT_DIR$/application/admin/controller/Tsubject.php" />
  173 + <option value="$PROJECT_DIR$/application/admin/model/Studentclass.php" />
  174 + <option value="$PROJECT_DIR$/application/api/validate/Base.php" />
  175 + <option value="$PROJECT_DIR$/application/api/validate/Notice.php" />
  176 + <option value="$PROJECT_DIR$/application/admin/model/Userinfo.php" />
  177 + <option value="$PROJECT_DIR$/application/api/controller/Classend.php" />
  178 + <option value="$PROJECT_DIR$/application/api/controller/Upload.php" />
  179 + <option value="$PROJECT_DIR$/application/api/controller/Classendsubjectinfo.php" />
  180 + <option value="$PROJECT_DIR$/application/admin/model/Commonuser.php" />
  181 + <option value="$PROJECT_DIR$/application/api/controller/Base.php" />
  182 + <option value="$PROJECT_DIR$/application/admin/model/Colloctsubject.php" />
  183 + <option value="$PROJECT_DIR$/application/extra/sms.php" />
  184 + <option value="$PROJECT_DIR$/application/extra/wx.php" />
  185 + <option value="$PROJECT_DIR$/application/admin/model/Classsubject.php" />
  186 + <option value="$PROJECT_DIR$/public/assets/js/backend/classsubject.js" />
  187 + <option value="$PROJECT_DIR$/application/admin/view/userinfo/edit.html" />
  188 + <option value="$PROJECT_DIR$/public/assets/js/backend/studentclass.js" />
  189 + <option value="$PROJECT_DIR$/application/admin/view/studyclass/index.html" />
  190 + <option value="$PROJECT_DIR$/application/admin/controller/School.php" />
  191 + <option value="$PROJECT_DIR$/public/assets/js/backend/info.js" />
  192 + <option value="$PROJECT_DIR$/application/admin/view/signin/info.html" />
  193 + <option value="$PROJECT_DIR$/public/assets/js/backend/studyclass.js" />
  194 + <option value="$PROJECT_DIR$/application/api/controller/Study.php" />
  195 + <option value="$PROJECT_DIR$/public/assets/js/backend/signin.js" />
  196 + <option value="$PROJECT_DIR$/application/admin/controller/Signin.php" />
  197 + <option value="$PROJECT_DIR$/application/admin/view/signin/index.html" />
  198 + <option value="$PROJECT_DIR$/application/api/controller/Getopenid.php" />
  199 + <option value="$PROJECT_DIR$/application/validate/Userinfo1.php" />
  200 + <option value="$PROJECT_DIR$/public/assets/js/backend/userinfo.js" />
  201 + <option value="$PROJECT_DIR$/application/validate/Userinfo.php" />
  202 + <option value="$PROJECT_DIR$/application/api/controller/Userinfo.php" />
  203 + <option value="$PROJECT_DIR$/application/admin/model/Studyclassinfo.php" />
  204 + <option value="$PROJECT_DIR$/public/assets/js/backend/studyclassinfo.js" />
  205 + <option value="$PROJECT_DIR$/application/admin/controller/Studyclassinfo.php" />
  206 + </list>
  207 + </option>
  208 + </component>
  209 + <component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
  210 + <component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER" />
  211 + <component name="JsGulpfileManager">
  212 + <detection-done>true</detection-done>
  213 + <sorting>DEFINITION_ORDER</sorting>
  214 + </component>
  215 + <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  216 + <component name="ProjectFrameBounds" extendedState="7">
  217 + <option name="x" value="537" />
  218 + <option name="y" value="46" />
  219 + <option name="width" value="1148" />
  220 + <option name="height" value="809" />
  221 + </component>
  222 + <component name="ProjectView">
  223 + <navigator currentView="ProjectPane" proportions="" version="1">
  224 + <flattenPackages />
  225 + <showMembers />
  226 + <showModules />
  227 + <showLibraryContents />
  228 + <hideEmptyPackages />
  229 + <abbreviatePackageNames />
  230 + <autoscrollToSource />
  231 + <autoscrollFromSource />
  232 + <sortByType />
  233 + <manualOrder />
  234 + <foldersAlwaysOnTop value="true" />
  235 + </navigator>
  236 + <panes>
  237 + <pane id="Scratches" />
  238 + <pane id="ProjectPane">
  239 + <subPane>
  240 + <expand>
  241 + <path>
  242 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  243 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  244 + </path>
  245 + <path>
  246 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  247 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  248 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  249 + </path>
  250 + <path>
  251 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  252 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  253 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  254 + <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
  255 + </path>
  256 + <path>
  257 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  258 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  259 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  260 + <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
  261 + <item name="controller" type="2a2b976b:PhpTreeStructureProvider$1" />
  262 + </path>
  263 + <path>
  264 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  265 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  266 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  267 + <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
  268 + <item name="library" type="2a2b976b:PhpTreeStructureProvider$1" />
  269 + </path>
  270 + <path>
  271 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  272 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  273 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  274 + <item name="admin" type="2a2b976b:PhpTreeStructureProvider$1" />
  275 + <item name="library" type="2a2b976b:PhpTreeStructureProvider$1" />
  276 + <item name="traits" type="2a2b976b:PhpTreeStructureProvider$1" />
  277 + </path>
  278 + <path>
  279 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  280 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  281 + <item name="application" type="2a2b976b:PhpTreeStructureProvider$1" />
  282 + <item name="api" type="2a2b976b:PhpTreeStructureProvider$1" />
  283 + </path>
  284 + <path>
  285 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  286 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  287 + <item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
  288 + </path>
  289 + <path>
  290 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  291 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  292 + <item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
  293 + <item name="assets" type="2a2b976b:PhpTreeStructureProvider$1" />
  294 + </path>
  295 + <path>
  296 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  297 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  298 + <item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
  299 + <item name="assets" type="2a2b976b:PhpTreeStructureProvider$1" />
  300 + <item name="js" type="2a2b976b:PhpTreeStructureProvider$1" />
  301 + </path>
  302 + <path>
  303 + <item name="campus" type="b2602c69:ProjectViewProjectNode" />
  304 + <item name="campus" type="2a2b976b:PhpTreeStructureProvider$1" />
  305 + <item name="public" type="2a2b976b:PhpTreeStructureProvider$1" />
  306 + <item name="assets" type="2a2b976b:PhpTreeStructureProvider$1" />
  307 + <item name="js" type="2a2b976b:PhpTreeStructureProvider$1" />
  308 + <item name="backend" type="2a2b976b:PhpTreeStructureProvider$1" />
  309 + </path>
  310 + </expand>
  311 + <select />
  312 + </subPane>
  313 + </pane>
  314 + <pane id="Scope" />
  315 + </panes>
  316 + </component>
  317 + <component name="PropertiesComponent">
  318 + <property name="settings.editor.selected.configurable" value="web-ide.project.structure" />
  319 + <property name="WebServerToolWindowFactoryState" value="true" />
  320 + <property name="WebServerToolWindowPanel.toolwindow.show.size" value="false" />
  321 + <property name="WebServerToolWindowPanel.toolwindow.show.date" value="false" />
  322 + <property name="WebServerToolWindowPanel.toolwindow.show.permissions" value="false" />
  323 + <property name="WebServerToolWindowPanel.toolwindow.highlight.symlinks" value="true" />
  324 + <property name="WebServerToolWindowPanel.toolwindow.highlight.mappings" value="true" />
  325 + <property name="nodejs_interpreter_path" value="C:/Program Files/nodejs/node" />
  326 + <property name="node.js.path.for.package.jscs" value="project" />
  327 + <property name="node.js.detected.package.jscs" value="true" />
  328 + <property name="node.js.selected.package.jscs" value="" />
  329 + </component>
  330 + <component name="RecentsManager">
  331 + <key name="CopyFile.RECENT_KEYS">
  332 + <recent name="D:\lfxstore\wamp\campus\vendor" />
  333 + <recent name="D:\lfxstore\wamp\campus\public\assets\js\backend" />
  334 + <recent name="D:\lfxstore\wamp\campus\application\admin\view\signin" />
  335 + <recent name="D:\lfxstore\wamp\campus\application\extra" />
  336 + <recent name="D:\lfxstore\wamp\campus\application\api\validate" />
  337 + </key>
  338 + </component>
  339 + <component name="RunDashboard">
  340 + <option name="ruleStates">
  341 + <list>
  342 + <RuleState>
  343 + <option name="name" value="ConfigurationTypeDashboardGroupingRule" />
  344 + </RuleState>
  345 + <RuleState>
  346 + <option name="name" value="StatusDashboardGroupingRule" />
  347 + </RuleState>
  348 + </list>
  349 + </option>
  350 + </component>
  351 + <component name="ShelveChangesManager" show_recycled="false">
  352 + <option name="remove_strategy" value="false" />
  353 + </component>
  354 + <component name="TaskManager">
  355 + <task active="true" id="Default" summary="Default task">
  356 + <changelist id="d314d458-24d6-4b43-8f5a-763c7a27acda" name="Default" comment="" />
  357 + <created>1557379768123</created>
  358 + <option name="number" value="Default" />
  359 + <option name="presentableId" value="Default" />
  360 + <updated>1557379768123</updated>
  361 + <workItem from="1557379778117" duration="17724000" />
  362 + <workItem from="1557448718421" duration="27248000" />
  363 + <workItem from="1557534716675" duration="29367000" />
  364 + <workItem from="1557707398672" duration="20226000" />
  365 + <workItem from="1557794148502" duration="2431000" />
  366 + <workItem from="1557801266611" duration="24542000" />
  367 + <workItem from="1557880572978" duration="25849000" />
  368 + <workItem from="1557966804238" duration="601000" />
  369 + </task>
  370 + <servers />
  371 + </component>
  372 + <component name="TimeTrackingManager">
  373 + <option name="totallyTimeSpent" value="147988000" />
  374 + </component>
  375 + <component name="ToolWindowManager">
  376 + <frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
  377 + <layout>
  378 + <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.16151386" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
  379 + <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1359275" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  380 + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
  381 + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934782" sideWeight="0.5063966" order="7" side_tool="true" content_ui="tabs" />
  382 + <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
  383 + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
  384 + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
  385 + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  386 + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934782" sideWeight="0.4978678" order="9" side_tool="false" content_ui="tabs" />
  387 + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
  388 + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
  389 + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
  390 + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  391 + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  392 + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
  393 + <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32934782" sideWeight="0.4936034" order="10" side_tool="false" content_ui="tabs" />
  394 + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
  395 + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  396 + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  397 + </layout>
  398 + <layout-to-restore>
  399 + <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
  400 + <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
  401 + <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  402 + <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
  403 + <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32934782" sideWeight="0.5063966" order="7" side_tool="true" content_ui="tabs" />
  404 + <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
  405 + <window_info id="File Transfer" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32934782" sideWeight="0.4936034" order="10" side_tool="false" content_ui="tabs" />
  406 + <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
  407 + <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
  408 + <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32934782" sideWeight="0.4978678" order="9" side_tool="false" content_ui="tabs" />
  409 + <window_info id="Remote Host" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16151386" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
  410 + <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.13486141" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
  411 + <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
  412 + <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
  413 + <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  414 + <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  415 + <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
  416 + <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
  417 + <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
  418 + </layout-to-restore>
  419 + </component>
  420 + <component name="TypeScriptGeneratedFilesManager">
  421 + <option name="version" value="1" />
  422 + </component>
  423 + <component name="VcsContentAnnotationSettings">
  424 + <option name="myLimit" value="2678400000" />
  425 + </component>
  426 + <component name="XDebuggerManager">
  427 + <breakpoint-manager />
  428 + <watches-manager />
  429 + </component>
  430 + <component name="editorHistoryManager">
  431 + <entry file="file://$PROJECT_DIR$/application/api/controller/Validate.php">
  432 + <provider selected="true" editor-type-id="text-editor">
  433 + <state relative-caret-position="-900">
  434 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  435 + </state>
  436 + </provider>
  437 + </entry>
  438 + <entry file="file://$PROJECT_DIR$/application/admin/model/Commonuser.php">
  439 + <provider selected="true" editor-type-id="text-editor">
  440 + <state relative-caret-position="350">
  441 + <caret line="55" column="53" lean-forward="false" selection-start-line="55" selection-start-column="53" selection-end-line="55" selection-end-column="53" />
  442 + </state>
  443 + </provider>
  444 + </entry>
  445 + <entry file="file://$PROJECT_DIR$/application/api/controller/Base.php">
  446 + <provider selected="true" editor-type-id="text-editor">
  447 + <state relative-caret-position="464">
  448 + <caret line="48" column="9" lean-forward="false" selection-start-line="48" selection-start-column="9" selection-end-line="48" selection-end-column="9" />
  449 + </state>
  450 + </provider>
  451 + </entry>
  452 + <entry file="file://$PROJECT_DIR$/application/api/controller/Upload.php">
  453 + <provider selected="true" editor-type-id="text-editor">
  454 + <state relative-caret-position="175">
  455 + <caret line="27" column="44" lean-forward="false" selection-start-line="27" selection-start-column="44" selection-end-line="27" selection-end-column="44" />
  456 + </state>
  457 + </provider>
  458 + </entry>
  459 + <entry file="file://$PROJECT_DIR$/application/api/controller/Token.php">
  460 + <provider selected="true" editor-type-id="text-editor">
  461 + <state relative-caret-position="0">
  462 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  463 + </state>
  464 + </provider>
  465 + </entry>
  466 + <entry file="file://$PROJECT_DIR$/application/api/controller/Classend.php">
  467 + <provider selected="true" editor-type-id="text-editor">
  468 + <state relative-caret-position="1053">
  469 + <caret line="116" column="8" lean-forward="false" selection-start-line="113" selection-start-column="21" selection-end-line="116" selection-end-column="8" />
  470 + </state>
  471 + </provider>
  472 + </entry>
  473 + <entry file="file://$PROJECT_DIR$/application/admin/model/Colloctsubject.php">
  474 + <provider selected="true" editor-type-id="text-editor">
  475 + <state relative-caret-position="300">
  476 + <caret line="30" column="28" lean-forward="false" selection-start-line="30" selection-start-column="20" selection-end-line="30" selection-end-column="28" />
  477 + </state>
  478 + </provider>
  479 + </entry>
  480 + <entry file="file://$PROJECT_DIR$/application/extra/sms.php">
  481 + <provider selected="true" editor-type-id="text-editor">
  482 + <state relative-caret-position="75">
  483 + <caret line="3" column="36" lean-forward="false" selection-start-line="3" selection-start-column="21" selection-end-line="3" selection-end-column="36" />
  484 + </state>
  485 + </provider>
  486 + </entry>
  487 + <entry file="file://$PROJECT_DIR$/application/extra/site.php">
  488 + <provider selected="true" editor-type-id="text-editor">
  489 + <state relative-caret-position="100">
  490 + <caret line="4" column="16" lean-forward="true" selection-start-line="4" selection-start-column="16" selection-end-line="4" selection-end-column="16" />
  491 + </state>
  492 + </provider>
  493 + </entry>
  494 + <entry file="file://$PROJECT_DIR$/application/extra/databasecommon.php">
  495 + <provider selected="true" editor-type-id="text-editor">
  496 + <state relative-caret-position="175">
  497 + <caret line="7" column="34" lean-forward="true" selection-start-line="7" selection-start-column="34" selection-end-line="7" selection-end-column="34" />
  498 + </state>
  499 + </provider>
  500 + </entry>
  501 + <entry file="file://$PROJECT_DIR$/application/admin/model/Validatetel.php">
  502 + <provider selected="true" editor-type-id="text-editor">
  503 + <state relative-caret-position="275">
  504 + <caret line="16" column="0" lean-forward="false" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="42" />
  505 + </state>
  506 + </provider>
  507 + </entry>
  508 + <entry file="file://$PROJECT_DIR$/application/api/controller/Smsset.php">
  509 + <provider selected="true" editor-type-id="text-editor">
  510 + <state relative-caret-position="189">
  511 + <caret line="21" column="16" lean-forward="false" selection-start-line="21" selection-start-column="16" selection-end-line="21" selection-end-column="16" />
  512 + </state>
  513 + </provider>
  514 + </entry>
  515 + <entry file="file://$PROJECT_DIR$/application/api/controller/Sms.php">
  516 + <provider selected="true" editor-type-id="text-editor">
  517 + <state relative-caret-position="-750">
  518 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  519 + </state>
  520 + </provider>
  521 + </entry>
  522 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/colloctsubject.js">
  523 + <provider selected="true" editor-type-id="text-editor">
  524 + <state relative-caret-position="-150">
  525 + <caret line="12" column="44" lean-forward="true" selection-start-line="12" selection-start-column="44" selection-end-line="12" selection-end-column="44" />
  526 + </state>
  527 + </provider>
  528 + </entry>
  529 + <entry file="file://$PROJECT_DIR$/application/admin/model/Classsubject.php">
  530 + <provider selected="true" editor-type-id="text-editor">
  531 + <state relative-caret-position="91">
  532 + <caret line="37" column="81" lean-forward="false" selection-start-line="37" selection-start-column="16" selection-end-line="37" selection-end-column="81" />
  533 + </state>
  534 + </provider>
  535 + </entry>
  536 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/classsubject.js">
  537 + <provider selected="true" editor-type-id="text-editor">
  538 + <state relative-caret-position="367">
  539 + <caret line="36" column="43" lean-forward="true" selection-start-line="36" selection-start-column="43" selection-end-line="36" selection-end-column="43" />
  540 + </state>
  541 + </provider>
  542 + </entry>
  543 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/subject.js">
  544 + <provider selected="true" editor-type-id="text-editor">
  545 + <state relative-caret-position="0">
  546 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  547 + </state>
  548 + </provider>
  549 + </entry>
  550 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/psubject.js">
  551 + <provider selected="true" editor-type-id="text-editor">
  552 + <state relative-caret-position="0">
  553 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  554 + </state>
  555 + </provider>
  556 + </entry>
  557 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Classsubject.php">
  558 + <provider selected="true" editor-type-id="text-editor">
  559 + <state relative-caret-position="-308">
  560 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  561 + <folding />
  562 + </state>
  563 + </provider>
  564 + </entry>
  565 + <entry file="file://$PROJECT_DIR$/application/admin/view/userinfo/add.html">
  566 + <provider selected="true" editor-type-id="text-editor">
  567 + <state relative-caret-position="325">
  568 + <caret line="25" column="10" lean-forward="true" selection-start-line="20" selection-start-column="4" selection-end-line="25" selection-end-column="10" />
  569 + </state>
  570 + </provider>
  571 + </entry>
  572 + <entry file="file://$PROJECT_DIR$/application/admin/view/userinfo/edit.html">
  573 + <provider selected="true" editor-type-id="text-editor">
  574 + <state relative-caret-position="300">
  575 + <caret line="15" column="90" lean-forward="false" selection-start-line="15" selection-start-column="90" selection-end-line="15" selection-end-column="90" />
  576 + </state>
  577 + </provider>
  578 + </entry>
  579 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/studentclass.js">
  580 + <provider selected="true" editor-type-id="text-editor">
  581 + <state relative-caret-position="-450">
  582 + <caret line="0" column="107" lean-forward="false" selection-start-line="0" selection-start-column="107" selection-end-line="0" selection-end-column="107" />
  583 + </state>
  584 + </provider>
  585 + </entry>
  586 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/studyanswer.js">
  587 + <provider selected="true" editor-type-id="text-editor">
  588 + <state relative-caret-position="0">
  589 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  590 + </state>
  591 + </provider>
  592 + </entry>
  593 + <entry file="file://$PROJECT_DIR$/application/admin/controller/School.php">
  594 + <provider selected="true" editor-type-id="text-editor">
  595 + <state relative-caret-position="342">
  596 + <caret line="31" column="7" lean-forward="false" selection-start-line="31" selection-start-column="7" selection-end-line="31" selection-end-column="7" />
  597 + <folding />
  598 + </state>
  599 + </provider>
  600 + </entry>
  601 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/info.js" />
  602 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/studyclass.js">
  603 + <provider selected="true" editor-type-id="text-editor">
  604 + <state relative-caret-position="0">
  605 + <caret line="32" column="155" lean-forward="false" selection-start-line="32" selection-start-column="155" selection-end-line="32" selection-end-column="155" />
  606 + </state>
  607 + </provider>
  608 + </entry>
  609 + <entry file="file://$PROJECT_DIR$/application/admin/view/studyclass/index.html">
  610 + <provider selected="true" editor-type-id="text-editor">
  611 + <state relative-caret-position="225">
  612 + <caret line="9" column="220" lean-forward="false" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="220" />
  613 + </state>
  614 + </provider>
  615 + </entry>
  616 + <entry file="file://$PROJECT_DIR$/application/admin/view/signin/info.html">
  617 + <provider selected="true" editor-type-id="text-editor">
  618 + <state relative-caret-position="395">
  619 + <caret line="19" column="30" lean-forward="false" selection-start-line="19" selection-start-column="30" selection-end-line="19" selection-end-column="30" />
  620 + </state>
  621 + </provider>
  622 + </entry>
  623 + <entry file="file://$PROJECT_DIR$/vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php">
  624 + <provider selected="true" editor-type-id="text-editor">
  625 + <state relative-caret-position="247">
  626 + <caret line="1099" column="44" lean-forward="false" selection-start-line="1099" selection-start-column="23" selection-end-line="1099" selection-end-column="44" />
  627 + </state>
  628 + </provider>
  629 + </entry>
  630 + <entry file="file://$PROJECT_DIR$/application/api/controller/Study.php">
  631 + <provider selected="true" editor-type-id="text-editor">
  632 + <state relative-caret-position="-250">
  633 + <caret line="30" column="84" lean-forward="false" selection-start-line="30" selection-start-column="84" selection-end-line="30" selection-end-column="84" />
  634 + </state>
  635 + </provider>
  636 + </entry>
  637 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/signin.js">
  638 + <provider selected="true" editor-type-id="text-editor">
  639 + <state relative-caret-position="425">
  640 + <caret line="32" column="56" lean-forward="false" selection-start-line="32" selection-start-column="56" selection-end-line="32" selection-end-column="56" />
  641 + </state>
  642 + </provider>
  643 + </entry>
  644 + <entry file="file://$PROJECT_DIR$/vendor/phpoffice/phpexcel/Classes/PHPExcel.php">
  645 + <provider selected="true" editor-type-id="text-editor">
  646 + <state relative-caret-position="8850">
  647 + <caret line="363" column="20" lean-forward="false" selection-start-line="363" selection-start-column="20" selection-end-line="363" selection-end-column="20" />
  648 + </state>
  649 + </provider>
  650 + </entry>
  651 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Signin.php">
  652 + <provider selected="true" editor-type-id="text-editor">
  653 + <state relative-caret-position="481">
  654 + <caret line="129" column="61" lean-forward="false" selection-start-line="129" selection-start-column="61" selection-end-line="129" selection-end-column="61" />
  655 + <folding />
  656 + </state>
  657 + </provider>
  658 + </entry>
  659 + <entry file="file://$PROJECT_DIR$/application/admin/view/studyclassinfo/index.html">
  660 + <provider selected="true" editor-type-id="text-editor">
  661 + <state relative-caret-position="0">
  662 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  663 + </state>
  664 + </provider>
  665 + </entry>
  666 + <entry file="file://$PROJECT_DIR$/application/extra/system.php">
  667 + <provider selected="true" editor-type-id="text-editor">
  668 + <state relative-caret-position="150">
  669 + <caret line="6" column="3" lean-forward="true" selection-start-line="6" selection-start-column="3" selection-end-line="6" selection-end-column="3" />
  670 + </state>
  671 + </provider>
  672 + </entry>
  673 + <entry file="file://$PROJECT_DIR$/application/extra/upload.php">
  674 + <provider selected="true" editor-type-id="text-editor">
  675 + <state relative-caret-position="0">
  676 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  677 + </state>
  678 + </provider>
  679 + </entry>
  680 + <entry file="file://$PROJECT_DIR$/application/extra/wx.php">
  681 + <provider selected="true" editor-type-id="text-editor">
  682 + <state relative-caret-position="200">
  683 + <caret line="8" column="32" lean-forward="false" selection-start-line="8" selection-start-column="14" selection-end-line="8" selection-end-column="32" />
  684 + </state>
  685 + </provider>
  686 + </entry>
  687 + <entry file="file://$PROJECT_DIR$/application/admin/view/signin/index.html">
  688 + <provider selected="true" editor-type-id="text-editor">
  689 + <state relative-caret-position="225">
  690 + <caret line="9" column="0" lean-forward="false" selection-start-line="9" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
  691 + </state>
  692 + </provider>
  693 + </entry>
  694 + <entry file="file://$PROJECT_DIR$/application/admin/view/userinfo/index.html">
  695 + <provider selected="true" editor-type-id="text-editor">
  696 + <state relative-caret-position="-225">
  697 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  698 + </state>
  699 + </provider>
  700 + </entry>
  701 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/userinfo.js">
  702 + <provider selected="true" editor-type-id="text-editor">
  703 + <state relative-caret-position="825">
  704 + <caret line="33" column="130" lean-forward="false" selection-start-line="33" selection-start-column="130" selection-end-line="33" selection-end-column="130" />
  705 + <folding />
  706 + </state>
  707 + </provider>
  708 + </entry>
  709 + <entry file="file://$PROJECT_DIR$/application/validate/Base.php">
  710 + <provider selected="true" editor-type-id="text-editor">
  711 + <state relative-caret-position="250">
  712 + <caret line="21" column="20" lean-forward="false" selection-start-line="21" selection-start-column="20" selection-end-line="21" selection-end-column="20" />
  713 + <folding />
  714 + </state>
  715 + </provider>
  716 + </entry>
  717 + <entry file="file://$PROJECT_DIR$/application/validate/Userinfo1.php">
  718 + <provider selected="true" editor-type-id="text-editor">
  719 + <state relative-caret-position="450">
  720 + <caret line="23" column="29" lean-forward="false" selection-start-line="23" selection-start-column="29" selection-end-line="23" selection-end-column="29" />
  721 + </state>
  722 + </provider>
  723 + </entry>
  724 + <entry file="file://$PROJECT_DIR$/application/api/controller/Classendsubjectinfo.php">
  725 + <provider selected="true" editor-type-id="text-editor">
  726 + <state relative-caret-position="367">
  727 + <caret line="97" column="5" lean-forward="false" selection-start-line="97" selection-start-column="5" selection-end-line="97" selection-end-column="5" />
  728 + </state>
  729 + </provider>
  730 + </entry>
  731 + <entry file="file://$PROJECT_DIR$/application/validate/Userinfo.php">
  732 + <provider selected="true" editor-type-id="text-editor">
  733 + <state relative-caret-position="575">
  734 + <caret line="28" column="28" lean-forward="false" selection-start-line="28" selection-start-column="28" selection-end-line="28" selection-end-column="28" />
  735 + <folding />
  736 + </state>
  737 + </provider>
  738 + </entry>
  739 + <entry file="file://$PROJECT_DIR$/application/api/controller/Userinfo.php">
  740 + <provider selected="true" editor-type-id="text-editor">
  741 + <state relative-caret-position="14700">
  742 + <caret line="610" column="245" lean-forward="false" selection-start-line="610" selection-start-column="245" selection-end-line="610" selection-end-column="245" />
  743 + <folding />
  744 + </state>
  745 + </provider>
  746 + </entry>
  747 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Userinfo.php">
  748 + <provider selected="true" editor-type-id="text-editor">
  749 + <state relative-caret-position="0">
  750 + <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
  751 + <folding />
  752 + </state>
  753 + </provider>
  754 + </entry>
  755 + <entry file="file://$PROJECT_DIR$/application/admin/model/Studyclassinfo.php">
  756 + <provider selected="true" editor-type-id="text-editor">
  757 + <state relative-caret-position="850">
  758 + <caret line="34" column="55" lean-forward="false" selection-start-line="34" selection-start-column="55" selection-end-line="34" selection-end-column="55" />
  759 + <folding />
  760 + </state>
  761 + </provider>
  762 + </entry>
  763 + <entry file="file://$PROJECT_DIR$/public/assets/js/backend/studyclassinfo.js">
  764 + <provider selected="true" editor-type-id="text-editor">
  765 + <state relative-caret-position="750">
  766 + <caret line="30" column="40" lean-forward="false" selection-start-line="30" selection-start-column="33" selection-end-line="30" selection-end-column="40" />
  767 + <folding />
  768 + </state>
  769 + </provider>
  770 + </entry>
  771 + <entry file="file://$PROJECT_DIR$/application/api/controller/Getopenid.php">
  772 + <provider selected="true" editor-type-id="text-editor">
  773 + <state relative-caret-position="13150">
  774 + <caret line="545" column="28" lean-forward="false" selection-start-line="545" selection-start-column="28" selection-end-line="545" selection-end-column="28" />
  775 + <folding />
  776 + </state>
  777 + </provider>
  778 + </entry>
  779 + <entry file="file://$PROJECT_DIR$/application/admin/library/traits/Backend.php">
  780 + <provider selected="true" editor-type-id="text-editor">
  781 + <state relative-caret-position="1550">
  782 + <caret line="70" column="5" lean-forward="false" selection-start-line="39" selection-start-column="4" selection-end-line="70" selection-end-column="5" />
  783 + <folding>
  784 + <marker date="1557390272000" expanded="true" signature="13160:13267" ph="SELECT COLUM... COLUMNS" />
  785 + </folding>
  786 + </state>
  787 + </provider>
  788 + </entry>
  789 + <entry file="file://$PROJECT_DIR$/application/admin/controller/Studyclassinfo.php">
  790 + <provider selected="true" editor-type-id="text-editor">
  791 + <state relative-caret-position="445">
  792 + <caret line="61" column="27" lean-forward="false" selection-start-line="61" selection-start-column="27" selection-end-line="61" selection-end-column="27" />
  793 + <folding />
  794 + </state>
  795 + </provider>
  796 + </entry>
  797 + </component>
  798 +</project>
  1 +Apache License
  2 +Version 2.0, January 2004
  3 +http://www.apache.org/licenses/
  4 +
  5 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
  6 +
  7 +1. Definitions.
  8 +
  9 +"License" shall mean the terms and conditions for use, reproduction, and
  10 +distribution as defined by Sections 1 through 9 of this document.
  11 +
  12 +"Licensor" shall mean the copyright owner or entity authorized by the copyright
  13 +owner that is granting the License.
  14 +
  15 +"Legal Entity" shall mean the union of the acting entity and all other entities
  16 +that control, are controlled by, or are under common control with that entity.
  17 +For the purposes of this definition, "control" means (i) the power, direct or
  18 +indirect, to cause the direction or management of such entity, whether by
  19 +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
  20 +outstanding shares, or (iii) beneficial ownership of such entity.
  21 +
  22 +"You" (or "Your") shall mean an individual or Legal Entity exercising
  23 +permissions granted by this License.
  24 +
  25 +"Source" form shall mean the preferred form for making modifications, including
  26 +but not limited to software source code, documentation source, and configuration
  27 +files.
  28 +
  29 +"Object" form shall mean any form resulting from mechanical transformation or
  30 +translation of a Source form, including but not limited to compiled object code,
  31 +generated documentation, and conversions to other media types.
  32 +
  33 +"Work" shall mean the work of authorship, whether in Source or Object form, made
  34 +available under the License, as indicated by a copyright notice that is included
  35 +in or attached to the work (an example is provided in the Appendix below).
  36 +
  37 +"Derivative Works" shall mean any work, whether in Source or Object form, that
  38 +is based on (or derived from) the Work and for which the editorial revisions,
  39 +annotations, elaborations, or other modifications represent, as a whole, an
  40 +original work of authorship. For the purposes of this License, Derivative Works
  41 +shall not include works that remain separable from, or merely link (or bind by
  42 +name) to the interfaces of, the Work and Derivative Works thereof.
  43 +
  44 +"Contribution" shall mean any work of authorship, including the original version
  45 +of the Work and any modifications or additions to that Work or Derivative Works
  46 +thereof, that is intentionally submitted to Licensor for inclusion in the Work
  47 +by the copyright owner or by an individual or Legal Entity authorized to submit
  48 +on behalf of the copyright owner. For the purposes of this definition,
  49 +"submitted" means any form of electronic, verbal, or written communication sent
  50 +to the Licensor or its representatives, including but not limited to
  51 +communication on electronic mailing lists, source code control systems, and
  52 +issue tracking systems that are managed by, or on behalf of, the Licensor for
  53 +the purpose of discussing and improving the Work, but excluding communication
  54 +that is conspicuously marked or otherwise designated in writing by the copyright
  55 +owner as "Not a Contribution."
  56 +
  57 +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
  58 +of whom a Contribution has been received by Licensor and subsequently
  59 +incorporated within the Work.
  60 +
  61 +2. Grant of Copyright License.
  62 +
  63 +Subject to the terms and conditions of this License, each Contributor hereby
  64 +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
  65 +irrevocable copyright license to reproduce, prepare Derivative Works of,
  66 +publicly display, publicly perform, sublicense, and distribute the Work and such
  67 +Derivative Works in Source or Object form.
  68 +
  69 +3. Grant of Patent License.
  70 +
  71 +Subject to the terms and conditions of this License, each Contributor hereby
  72 +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
  73 +irrevocable (except as stated in this section) patent license to make, have
  74 +made, use, offer to sell, sell, import, and otherwise transfer the Work, where
  75 +such license applies only to those patent claims licensable by such Contributor
  76 +that are necessarily infringed by their Contribution(s) alone or by combination
  77 +of their Contribution(s) with the Work to which such Contribution(s) was
  78 +submitted. If You institute patent litigation against any entity (including a
  79 +cross-claim or counterclaim in a lawsuit) alleging that the Work or a
  80 +Contribution incorporated within the Work constitutes direct or contributory
  81 +patent infringement, then any patent licenses granted to You under this License
  82 +for that Work shall terminate as of the date such litigation is filed.
  83 +
  84 +4. Redistribution.
  85 +
  86 +You may reproduce and distribute copies of the Work or Derivative Works thereof
  87 +in any medium, with or without modifications, and in Source or Object form,
  88 +provided that You meet the following conditions:
  89 +
  90 +You must give any other recipients of the Work or Derivative Works a copy of
  91 +this License; and
  92 +You must cause any modified files to carry prominent notices stating that You
  93 +changed the files; and
  94 +You must retain, in the Source form of any Derivative Works that You distribute,
  95 +all copyright, patent, trademark, and attribution notices from the Source form
  96 +of the Work, excluding those notices that do not pertain to any part of the
  97 +Derivative Works; and
  98 +If the Work includes a "NOTICE" text file as part of its distribution, then any
  99 +Derivative Works that You distribute must include a readable copy of the
  100 +attribution notices contained within such NOTICE file, excluding those notices
  101 +that do not pertain to any part of the Derivative Works, in at least one of the
  102 +following places: within a NOTICE text file distributed as part of the
  103 +Derivative Works; within the Source form or documentation, if provided along
  104 +with the Derivative Works; or, within a display generated by the Derivative
  105 +Works, if and wherever such third-party notices normally appear. The contents of
  106 +the NOTICE file are for informational purposes only and do not modify the
  107 +License. You may add Your own attribution notices within Derivative Works that
  108 +You distribute, alongside or as an addendum to the NOTICE text from the Work,
  109 +provided that such additional attribution notices cannot be construed as
  110 +modifying the License.
  111 +You may add Your own copyright statement to Your modifications and may provide
  112 +additional or different license terms and conditions for use, reproduction, or
  113 +distribution of Your modifications, or for any such Derivative Works as a whole,
  114 +provided Your use, reproduction, and distribution of the Work otherwise complies
  115 +with the conditions stated in this License.
  116 +
  117 +5. Submission of Contributions.
  118 +
  119 +Unless You explicitly state otherwise, any Contribution intentionally submitted
  120 +for inclusion in the Work by You to the Licensor shall be under the terms and
  121 +conditions of this License, without any additional terms or conditions.
  122 +Notwithstanding the above, nothing herein shall supersede or modify the terms of
  123 +any separate license agreement you may have executed with Licensor regarding
  124 +such Contributions.
  125 +
  126 +6. Trademarks.
  127 +
  128 +This License does not grant permission to use the trade names, trademarks,
  129 +service marks, or product names of the Licensor, except as required for
  130 +reasonable and customary use in describing the origin of the Work and
  131 +reproducing the content of the NOTICE file.
  132 +
  133 +7. Disclaimer of Warranty.
  134 +
  135 +Unless required by applicable law or agreed to in writing, Licensor provides the
  136 +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
  137 +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
  138 +including, without limitation, any warranties or conditions of TITLE,
  139 +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
  140 +solely responsible for determining the appropriateness of using or
  141 +redistributing the Work and assume any risks associated with Your exercise of
  142 +permissions under this License.
  143 +
  144 +8. Limitation of Liability.
  145 +
  146 +In no event and under no legal theory, whether in tort (including negligence),
  147 +contract, or otherwise, unless required by applicable law (such as deliberate
  148 +and grossly negligent acts) or agreed to in writing, shall any Contributor be
  149 +liable to You for damages, including any direct, indirect, special, incidental,
  150 +or consequential damages of any character arising as a result of this License or
  151 +out of the use or inability to use the Work (including but not limited to
  152 +damages for loss of goodwill, work stoppage, computer failure or malfunction, or
  153 +any and all other commercial damages or losses), even if such Contributor has
  154 +been advised of the possibility of such damages.
  155 +
  156 +9. Accepting Warranty or Additional Liability.
  157 +
  158 +While redistributing the Work or Derivative Works thereof, You may choose to
  159 +offer, and charge a fee for, acceptance of support, warranty, indemnity, or
  160 +other liability obligations and/or rights consistent with this License. However,
  161 +in accepting such obligations, You may act only on Your own behalf and on Your
  162 +sole responsibility, not on behalf of any other Contributor, and only if You
  163 +agree to indemnify, defend, and hold each Contributor harmless for any liability
  164 +incurred by, or claims asserted against, such Contributor by reason of your
  165 +accepting any such warranty or additional liability.
  166 +
  167 +END OF TERMS AND CONDITIONS
  168 +
  169 +APPENDIX: How to apply the Apache License to your work
  170 +
  171 +To apply the Apache License to your work, attach the following boilerplate
  172 +notice, with the fields enclosed by brackets "{}" replaced with your own
  173 +identifying information. (Don't include the brackets!) The text should be
  174 +enclosed in the appropriate comment syntax for the file format. We also
  175 +recommend that a file or class name and description of purpose be included on
  176 +the same "printed page" as the copyright notice for easier identification within
  177 +third-party archives.
  178 +
  179 + Copyright 2017 Karson
  180 +
  181 + Licensed under the Apache License, Version 2.0 (the "License");
  182 + you may not use this file except in compliance with the License.
  183 + You may obtain a copy of the License at
  184 +
  185 + http://www.apache.org/licenses/LICENSE-2.0
  186 +
  187 + Unless required by applicable law or agreed to in writing, software
  188 + distributed under the License is distributed on an "AS IS" BASIS,
  189 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  190 + See the License for the specific language governing permissions and
  191 + limitations under the License.
  1 +FastAdmin是一款基于ThinkPHP5+Bootstrap的极速后台开发框架。
  2 +
  3 +
  4 +## **主要特性**
  5 +
  6 +* 基于`Auth`验证的权限管理系统
  7 + * 支持无限级父子级权限继承,父级的管理员可任意增删改子级管理员及权限设置
  8 + * 支持单管理员多角色
  9 + * 支持管理子级数据或个人数据
  10 +* 强大的一键生成功能
  11 + * 一键生成CRUD,包括控制器、模型、视图、JS、语言包、菜单、回收站等
  12 + * 一键压缩打包JS和CSS文件,一键CDN静态资源部署
  13 + * 一键生成控制器菜单和规则
  14 + * 一键生成API接口文档
  15 +* 完善的前端功能组件开发
  16 + * 基于`AdminLTE`二次开发
  17 + * 基于`Bootstrap`开发,自适应手机、平板、PC
  18 + * 基于`RequireJS`进行JS模块管理,按需加载
  19 + * 基于`Less`进行样式开发
  20 + * 基于`Bower`进行前端组件包管理
  21 +* 强大的插件扩展功能,在线安装卸载升级插件
  22 +* 通用的会员模块和API模块
  23 +* 共用同一账号体系的Web端会员中心权限验证和API接口会员权限验证
  24 +* 二级域名部署支持,同时域名支持绑定到插件
  25 +* 多语言支持,服务端及客户端支持
  26 +* 强大的第三方模块支持([CMS](https://www.fastadmin.net/store/cms.html)[博客](https://www.fastadmin.net/store/blog.html)[知识付费问答](https://www.fastadmin.net/store/ask.html))
  27 +* 整合第三方短信接口(阿里云、腾讯云短信)
  28 +* 无缝整合第三方云存储(七牛、阿里云OSS、又拍云)功能
  29 +* 第三方富文本编辑器支持(Summernote、Kindeditor、百度编辑器)
  30 +* 第三方登录(QQ、微信、微博)整合
  31 +* 第三方支付(微信、支付宝)无缝整合,微信支持PC端扫码支付
  32 +* 丰富的插件应用市场
  33 +
  34 +## **安装使用**
  35 +
  36 +https://doc.fastadmin.net
  37 +
  38 +## **在线演示**
  39 +
  40 +https://demo.fastadmin.net
  41 +
  42 +用户名:admin
  43 +
  44 +密 码:123456
  45 +
  46 +提 示:演示站数据无法进行修改,请下载源码安装体验全部功能
  47 +
  48 +## **界面截图**
  49 +![控制台](https://gitee.com/uploads/images/2017/0411/113717_e99ff3e7_10933.png "控制台")
  50 +
  51 +## **问题反馈**
  52 +
  53 +在使用中有任何问题,请使用以下联系方式联系我们
  54 +
  55 +交流社区: https://forum.fastadmin.net
  56 +
  57 +QQ群: [636393962](https://jq.qq.com/?_wv=1027&k=487PNBb)() [708784003](https://jq.qq.com/?_wv=1027&k=5ObjtwM)(满) [964776039](https://jq.qq.com/?_wv=1027&k=59qjU2P)(3群)
  58 +
  59 +Email: (karsonzhang#163.com, 把#换成@)
  60 +
  61 +Github: https://github.com/karsonzhang/fastadmin
  62 +
  63 +Gitee: https://gitee.com/karson/fastadmin
  64 +
  65 +## **特别鸣谢**
  66 +
  67 +感谢以下的项目,排名不分先后
  68 +
  69 +ThinkPHP:http://www.thinkphp.cn
  70 +
  71 +AdminLTE:https://adminlte.io
  72 +
  73 +Bootstrap:http://getbootstrap.com
  74 +
  75 +jQuery:http://jquery.com
  76 +
  77 +Bootstrap-table:https://github.com/wenzhixin/bootstrap-table
  78 +
  79 +Nice-validator: https://validator.niceue.com
  80 +
  81 +SelectPage: https://github.com/TerryZ/SelectPage
  82 +
  83 +
  84 +## **版权信息**
  85 +
  86 +FastAdmin遵循Apache2开源协议发布,并提供免费使用。
  87 +
  88 +本项目包含的第三方源码和二进制文件之版权信息另行标注。
  89 +
  90 +版权所有Copyright © 2017-2019 by FastAdmin (https://www.fastadmin.net)
  91 +
  92 +All rights reserved。
  1 +<?php
  2 +
  3 +namespace addons\command;
  4 +
  5 +use app\common\library\Menu;
  6 +use think\Addons;
  7 +
  8 +/**
  9 + * 在线命令插件
  10 + */
  11 +class Command extends Addons
  12 +{
  13 +
  14 + /**
  15 + * 插件安装方法
  16 + * @return bool
  17 + */
  18 + public function install()
  19 + {
  20 + $menu = [
  21 + [
  22 + 'name' => 'command',
  23 + 'title' => '在线命令管理',
  24 + 'icon' => 'fa fa-terminal',
  25 + 'sublist' => [
  26 + ['name' => 'command/index', 'title' => '查看'],
  27 + ['name' => 'command/add', 'title' => '添加'],
  28 + ['name' => 'command/detail', 'title' => '详情'],
  29 + ['name' => 'command/execute', 'title' => '运行'],
  30 + ['name' => 'command/del', 'title' => '删除'],
  31 + ['name' => 'command/multi', 'title' => '批量更新'],
  32 + ]
  33 + ]
  34 + ];
  35 + Menu::create($menu);
  36 + return true;
  37 + }
  38 +
  39 + /**
  40 + * 插件卸载方法
  41 + * @return bool
  42 + */
  43 + public function uninstall()
  44 + {
  45 + Menu::delete('command');
  46 + return true;
  47 + }
  48 +
  49 + /**
  50 + * 插件启用方法
  51 + * @return bool
  52 + */
  53 + public function enable()
  54 + {
  55 + Menu::enable('command');
  56 + return true;
  57 + }
  58 +
  59 + /**
  60 + * 插件禁用方法
  61 + * @return bool
  62 + */
  63 + public function disable()
  64 + {
  65 + Menu::disable('command');
  66 + return true;
  67 + }
  68 +
  69 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller;
  4 +
  5 +use app\common\controller\Backend;
  6 +use think\Config;
  7 +use think\console\Input;
  8 +use think\Db;
  9 +use think\Exception;
  10 +
  11 +/**
  12 + * 在线命令管理
  13 + *
  14 + * @icon fa fa-circle-o
  15 + */
  16 +class Command extends Backend
  17 +{
  18 +
  19 + /**
  20 + * Command模型对象
  21 + */
  22 + protected $model = null;
  23 + protected $noNeedRight = ['get_controller_list', 'get_field_list'];
  24 +
  25 + public function _initialize()
  26 + {
  27 + parent::_initialize();
  28 + $this->model = model('Command');
  29 + $this->view->assign("statusList", $this->model->getStatusList());
  30 + }
  31 +
  32 + /**
  33 + * 添加
  34 + */
  35 + public function add()
  36 + {
  37 +
  38 + $tableList = [];
  39 + $list = \think\Db::query("SHOW TABLES");
  40 + foreach ($list as $key => $row) {
  41 + $tableList[reset($row)] = reset($row);
  42 + }
  43 +
  44 + $this->view->assign("tableList", $tableList);
  45 + return $this->view->fetch();
  46 + }
  47 +
  48 + /**
  49 + * 获取字段列表
  50 + * @internal
  51 + */
  52 + public function get_field_list()
  53 + {
  54 + $dbname = Config::get('database.database');
  55 + $prefix = Config::get('database.prefix');
  56 + $table = $this->request->request('table');
  57 + //从数据库中获取表字段信息
  58 + $sql = "SELECT * FROM `information_schema`.`columns` "
  59 + . "WHERE TABLE_SCHEMA = ? AND table_name = ? "
  60 + . "ORDER BY ORDINAL_POSITION";
  61 + //加载主表的列
  62 + $columnList = Db::query($sql, [$dbname, $table]);
  63 + $fieldlist = [];
  64 + foreach ($columnList as $index => $item) {
  65 + $fieldlist[] = $item['COLUMN_NAME'];
  66 + }
  67 + $this->success("", null, ['fieldlist' => $fieldlist]);
  68 + }
  69 +
  70 + /**
  71 + * 获取控制器列表
  72 + * @internal
  73 + */
  74 + public function get_controller_list()
  75 + {
  76 + $adminPath = dirname(__DIR__) . DS;
  77 + $controllerDir = $adminPath . 'controller' . DS;
  78 + $files = new \RecursiveIteratorIterator(
  79 + new \RecursiveDirectoryIterator($controllerDir), \RecursiveIteratorIterator::LEAVES_ONLY
  80 + );
  81 + $list = [];
  82 + foreach ($files as $name => $file) {
  83 + if (!$file->isDir()) {
  84 + $filePath = $file->getRealPath();
  85 + $name = str_replace($controllerDir, '', $filePath);
  86 + $name = str_replace(DS, "/", $name);
  87 + $list[] = ['id' => $name, 'name' => $name];
  88 + }
  89 + }
  90 + $pageNumber = $this->request->request("pageNumber");
  91 + $pageSize = $this->request->request("pageSize");
  92 + return json(['list' => array_slice($list, ($pageNumber - 1) * $pageSize, $pageSize), 'total' => count($list)]);
  93 + }
  94 +
  95 + /**
  96 + * 详情
  97 + */
  98 + public function detail($ids)
  99 + {
  100 + $row = $this->model->get($ids);
  101 + if (!$row)
  102 + $this->error(__('No Results were found'));
  103 + $this->view->assign("row", $row);
  104 + return $this->view->fetch();
  105 + }
  106 +
  107 + /**
  108 + * 执行
  109 + */
  110 + public function execute($ids)
  111 + {
  112 + $row = $this->model->get($ids);
  113 + if (!$row)
  114 + $this->error(__('No Results were found'));
  115 + $result = $this->doexecute($row['type'], json_decode($row['params'], true));
  116 + $this->success("", null, ['result' => $result]);
  117 + }
  118 +
  119 + /**
  120 + * 执行命令
  121 + */
  122 + public function command($action = '')
  123 + {
  124 + $commandtype = $this->request->request("commandtype");
  125 + $params = $this->request->request();
  126 + $allowfields = [
  127 + 'crud' => 'table,controller,model,fields,force,local,delete,menu',
  128 + 'menu' => 'controller,delete',
  129 + 'min' => 'module,resource,optimize',
  130 + 'api' => 'url,module,output,template,force,title,author,class,language',
  131 + ];
  132 + $argv = [];
  133 + $allowfields = isset($allowfields[$commandtype]) ? explode(',', $allowfields[$commandtype]) : [];
  134 + $allowfields = array_filter(array_intersect_key($params, array_flip($allowfields)));
  135 + if (isset($params['local']) && !$params['local']) {
  136 + $allowfields['local'] = $params['local'];
  137 + } else {
  138 + unset($allowfields['local']);
  139 + }
  140 + foreach ($allowfields as $key => $param) {
  141 + $argv[] = "--{$key}=" . (is_array($param) ? implode(',', $param) : $param);
  142 + }
  143 + if ($commandtype == 'crud') {
  144 + $extend = 'setcheckboxsuffix,enumradiosuffix,imagefield,filefield,intdatesuffix,switchsuffix,citysuffix,selectpagesuffix,selectpagessuffix,ignorefields,sortfield,editorsuffix,headingfilterfield';
  145 + $extendArr = explode(',', $extend);
  146 + foreach ($params as $index => $item) {
  147 + if (in_array($index, $extendArr)) {
  148 + foreach (explode(',', $item) as $key => $value) {
  149 + if ($value) {
  150 + $argv[] = "--{$index}={$value}";
  151 + }
  152 + }
  153 + }
  154 + }
  155 + $isrelation = (int)$this->request->request('isrelation');
  156 + if ($isrelation && isset($params['relation'])) {
  157 + foreach ($params['relation'] as $index => $relation) {
  158 + foreach ($relation as $key => $value) {
  159 + $argv[] = "--{$key}=" . (is_array($value) ? implode(',', $value) : $value);
  160 + }
  161 + }
  162 + }
  163 + } else if ($commandtype == 'menu') {
  164 + if (isset($params['allcontroller']) && $params['allcontroller']) {
  165 + $argv[] = "--controller=all-controller";
  166 + } else {
  167 + foreach (explode(',', $params['controllerfile']) as $index => $param) {
  168 + if ($param) {
  169 + $argv[] = "--controller=" . substr($param, 0, -4);
  170 + }
  171 + }
  172 + }
  173 + } else if ($commandtype == 'min') {
  174 +
  175 + } else if ($commandtype == 'api') {
  176 +
  177 + } else {
  178 +
  179 + }
  180 + if ($action == 'execute') {
  181 + $result = $this->doexecute($commandtype, $argv);
  182 + $this->success("", null, ['result' => $result]);
  183 + } else {
  184 + $this->success("", null, ['command' => "php think {$commandtype} " . implode(' ', $argv)]);
  185 + }
  186 +
  187 + return;
  188 + }
  189 +
  190 + protected function doexecute($commandtype, $argv)
  191 + {
  192 + $commandName = "\\app\\admin\\command\\" . ucfirst($commandtype);
  193 + $input = new Input($argv);
  194 + $output = new \addons\command\library\Output();
  195 + $command = new $commandName($commandtype);
  196 + $data = [
  197 + 'type' => $commandtype,
  198 + 'params' => json_encode($argv),
  199 + 'command' => "php think {$commandtype} " . implode(' ', $argv),
  200 + 'executetime' => time(),
  201 + ];
  202 + $this->model->save($data);
  203 + try {
  204 + $command->run($input, $output);
  205 + $result = implode("\n", $output->getMessage());
  206 + $this->model->status = 'successed';
  207 + } catch (Exception $e) {
  208 + $result = implode("\n", $output->getMessage()) . "\n";
  209 + $result .= $e->getMessage();
  210 + $this->model->status = 'failured';
  211 + }
  212 + $result = trim($result);
  213 + $this->model->content = $result;
  214 + $this->model->save();
  215 + return $result;
  216 + }
  217 +
  218 +
  219 +}
  1 +<?php
  2 +
  3 +return [
  4 + 'Id' => 'ID',
  5 + 'Type' => '类型',
  6 + 'Params' => '参数',
  7 + 'Command' => '命令',
  8 + 'Content' => '返回结果',
  9 + 'Executetime' => '执行时间',
  10 + 'Createtime' => '创建时间',
  11 + 'Updatetime' => '更新时间',
  12 + 'Execute again' => '再次执行',
  13 + 'Successed' => '成功',
  14 + 'Failured' => '失败',
  15 + 'Status' => '状态'
  16 +];
  1 +<?php
  2 +
  3 +namespace app\admin\model;
  4 +
  5 +use think\Model;
  6 +
  7 +class Command extends Model
  8 +{
  9 + // 表名
  10 + protected $name = 'command';
  11 +
  12 + // 自动写入时间戳字段
  13 + protected $autoWriteTimestamp = 'int';
  14 +
  15 + // 定义时间戳字段名
  16 + protected $createTime = 'createtime';
  17 + protected $updateTime = 'updatetime';
  18 +
  19 + // 追加属性
  20 + protected $append = [
  21 + 'executetime_text',
  22 + 'type_text',
  23 + 'status_text'
  24 + ];
  25 +
  26 +
  27 + public function getStatusList()
  28 + {
  29 + return ['successed' => __('Successed'), 'failured' => __('Failured')];
  30 + }
  31 +
  32 +
  33 + public function getExecutetimeTextAttr($value, $data)
  34 + {
  35 + $value = $value ? $value : $data['executetime'];
  36 + return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
  37 + }
  38 +
  39 + public function getTypeTextAttr($value, $data)
  40 + {
  41 + $value = $value ? $value : $data['type'];
  42 + $list = ['crud' => '一键生成CRUD', 'menu' => '一键生成菜单', 'min' => '一键压缩打包', 'api' => '一键生成文档'];
  43 + return isset($list[$value]) ? $list[$value] : '';
  44 + }
  45 +
  46 + public function getStatusTextAttr($value, $data)
  47 + {
  48 + $value = $value ? $value : $data['status'];
  49 + $list = $this->getStatusList();
  50 + return isset($list[$value]) ? $list[$value] : '';
  51 + }
  52 +
  53 + protected function setExecutetimeAttr($value)
  54 + {
  55 + return $value && !is_numeric($value) ? strtotime($value) : $value;
  56 + }
  57 +
  58 +
  59 +}
  1 +<?php
  2 +
  3 +namespace app\admin\validate;
  4 +
  5 +use think\Validate;
  6 +
  7 +class Command extends Validate
  8 +{
  9 + /**
  10 + * 验证规则
  11 + */
  12 + protected $rule = [
  13 + ];
  14 + /**
  15 + * 提示消息
  16 + */
  17 + protected $message = [
  18 + ];
  19 + /**
  20 + * 验证场景
  21 + */
  22 + protected $scene = [
  23 + 'add' => [],
  24 + 'edit' => [],
  25 + ];
  26 +
  27 +}
  1 +<style>
  2 + .relation-item {margin-top:10px;}
  3 + legend {padding-bottom:5px;font-size:14px;font-weight:600;}
  4 + label {font-weight:normal;}
  5 + .form-control{padding:6px 8px;}
  6 + #extend-zone .col-xs-2 {margin-top:10px;padding-right:0;}
  7 + #extend-zone .col-xs-2:nth-child(6n+0) {padding-right:15px;}
  8 +</style>
  9 +<div class="panel panel-default panel-intro">
  10 + <div class="panel-heading">
  11 + <ul class="nav nav-tabs">
  12 + <li class="active"><a href="#crud" data-toggle="tab">{:__('一键生成CRUD')}</a></li>
  13 + <li><a href="#menu" data-toggle="tab">{:__('一键生成菜单')}</a></li>
  14 + <li><a href="#min" data-toggle="tab">{:__('一键压缩打包')}</a></li>
  15 + <li><a href="#api" data-toggle="tab">{:__('一键生成API文档')}</a></li>
  16 + </ul>
  17 + </div>
  18 + <div class="panel-body">
  19 + <div id="myTabContent" class="tab-content">
  20 + <div class="tab-pane fade active in" id="crud">
  21 + <div class="row">
  22 + <div class="col-xs-12">
  23 + <form role="form">
  24 + <input type="hidden" name="commandtype" value="crud" />
  25 + <div class="form-group">
  26 + <div class="row">
  27 + <div class="col-xs-3">
  28 + <input checked="" name="isrelation" type="hidden" value="0">
  29 + <label class="control-label" data-toggle="tooltip" title="当前只支持生成1对1关联模型,选中后请配置关联表和字段">
  30 + <input name="isrelation" type="checkbox" value="1">
  31 + 关联模型
  32 + </label>
  33 + </div>
  34 + <div class="col-xs-3">
  35 + <input checked="" name="local" type="hidden" value="1">
  36 + <label class="control-label" data-toggle="tooltip" title="默认模型生成在application/admin/model目录下,选中后将生成在application/common/model目录下">
  37 + <input name="local" type="checkbox" value="0"> 全局模型类
  38 + </label>
  39 + </div>
  40 + <div class="col-xs-3">
  41 + <input checked="" name="delete" type="hidden" value="0">
  42 + <label class="control-label" data-toggle="tooltip" title="删除CRUD生成的相关文件">
  43 + <input name="delete" type="checkbox" value="1"> 删除模式
  44 + </label>
  45 + </div>
  46 + <div class="col-xs-3">
  47 + <input checked="" name="force" type="hidden" value="0">
  48 + <label class="control-label" data-toggle="tooltip" title="选中后,如果已经存在同名文件将被覆盖。如果是删除将不再提醒">
  49 + <input name="force" type="checkbox" value="1">
  50 + 强制覆盖模式
  51 + </label>
  52 + </div>
  53 + <!--
  54 + <div class="col-xs-3">
  55 + <input checked="" name="menu" type="hidden" value="0">
  56 + <label class="control-label" data-toggle="tooltip" title="选中后,将同时生成后台菜单规则">
  57 + <input name="menu" type="checkbox" value="1">
  58 + 生成菜单
  59 + </label>
  60 + </div>
  61 + -->
  62 + </div>
  63 + </div>
  64 + <div class="form-group">
  65 + <legend>主表设置</legend>
  66 + <div class="row">
  67 + <div class="col-xs-3">
  68 + <label>请选择主表</label>
  69 + {:build_select('table',$tableList,null,['class'=>'form-control selectpicker']);}
  70 + </div>
  71 + <div class="col-xs-3">
  72 + <label>自定义控制器名</label>
  73 + <input type="text" class="form-control" name="controller" data-toggle="tooltip" title="默认根据表名自动生成,如果需要放在二级目录请手动填写" placeholder="支持目录层级,以/分隔">
  74 + </div>
  75 + <div class="col-xs-3">
  76 + <label>自定义模型名</label>
  77 + <input type="text" class="form-control" name="model" data-toggle="tooltip" title="默认根据表名自动生成" placeholder="不支持目录层级">
  78 + </div>
  79 + <div class="col-xs-3">
  80 + <label>请选择显示字段(默认全部)</label>
  81 + <select name="fields[]" id="fields" multiple style="height:30px;" class="form-control selectpicker"></select>
  82 + </div>
  83 +
  84 + </div>
  85 +
  86 + </div>
  87 +
  88 + <div class="form-group hide" id="relation-zone">
  89 + <legend>关联表设置</legend>
  90 +
  91 + <div class="row" style="margin-top:15px;">
  92 + <div class="col-xs-12">
  93 + <a href="javascript:;" class="btn btn-primary btn-sm btn-newrelation" data-index="1">追加关联模型</a>
  94 + </div>
  95 + </div>
  96 + </div>
  97 +
  98 + <hr>
  99 + <div class="form-group" id="extend-zone">
  100 + <legend>字段识别设置 <span style="font-size:12px;font-weight: normal;">(与之匹配的字段都将生成相应组件)</span></legend>
  101 + <div class="row">
  102 + <div class="col-xs-2">
  103 + <label>复选框后缀</label>
  104 + <input type="text" class="form-control" name="setcheckboxsuffix" placeholder="默认为set类型" />
  105 + </div>
  106 + <div class="col-xs-2">
  107 + <label>单选框后缀</label>
  108 + <input type="text" class="form-control" name="enumradiosuffix" placeholder="默认为enum类型" />
  109 + </div>
  110 + <div class="col-xs-2">
  111 + <label>图片类型后缀</label>
  112 + <input type="text" class="form-control" name="imagefield" placeholder="默认为image,images,avatar,avatars" />
  113 + </div>
  114 + <div class="col-xs-2">
  115 + <label>文件类型后缀</label>
  116 + <input type="text" class="form-control" name="filefield" placeholder="默认为file,files" />
  117 + </div>
  118 + <div class="col-xs-2">
  119 + <label>日期时间后缀</label>
  120 + <input type="text" class="form-control" name="intdatesuffix" placeholder="默认为time" />
  121 + </div>
  122 + <div class="col-xs-2">
  123 + <label>开关后缀</label>
  124 + <input type="text" class="form-control" name="switchsuffix" placeholder="默认为switch" />
  125 + </div>
  126 + <div class="col-xs-2">
  127 + <label>城市选择后缀</label>
  128 + <input type="text" class="form-control" name="citysuffix" placeholder="默认为city" />
  129 + </div>
  130 + <div class="col-xs-2">
  131 + <label>动态下拉后缀(单)</label>
  132 + <input type="text" class="form-control" name="selectpagesuffix" placeholder="默认为_id" />
  133 + </div>
  134 + <div class="col-xs-2">
  135 + <label>动态下拉后缀(多)</label>
  136 + <input type="text" class="form-control" name="selectpagessuffix" placeholder="默认为_ids" />
  137 + </div>
  138 + <div class="col-xs-2">
  139 + <label>忽略的字段</label>
  140 + <input type="text" class="form-control" name="ignorefields" placeholder="默认无" />
  141 + </div>
  142 + <div class="col-xs-2">
  143 + <label>排序字段</label>
  144 + <input type="text" class="form-control" name="sortfield" placeholder="默认为weigh" />
  145 + </div>
  146 + <div class="col-xs-2">
  147 + <label>富文本编辑器</label>
  148 + <input type="text" class="form-control" name="editorsuffix" placeholder="默认为content" />
  149 + </div>
  150 + <div class="col-xs-2">
  151 + <label>选项卡过滤字段</label>
  152 + <input type="text" class="form-control" name="headingfilterfield" placeholder="默认为status" />
  153 + </div>
  154 +
  155 + </div>
  156 +
  157 + </div>
  158 +
  159 + <div class="form-group">
  160 + <legend>生成命令行</legend>
  161 + <textarea class="form-control" data-toggle="tooltip" title="如果在线执行命令失败,可以将命令复制到命令行进行执行" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  162 + </div>
  163 +
  164 + <div class="form-group">
  165 + <legend>返回结果</legend>
  166 + <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  167 + </div>
  168 +
  169 + <div class="form-group">
  170 + <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  171 + <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  172 + </div>
  173 +
  174 + </form>
  175 + </div>
  176 + </div>
  177 + </div>
  178 + <div class="tab-pane fade" id="menu">
  179 + <div class="row">
  180 + <div class="col-xs-12">
  181 + <form role="form">
  182 + <input type="hidden" name="commandtype" value="menu" />
  183 + <div class="form-group">
  184 + <div class="row">
  185 + <div class="col-xs-3">
  186 + <input checked="" name="allcontroller" type="hidden" value="0">
  187 + <label class="control-label">
  188 + <input name="allcontroller" data-toggle="collapse" data-target="#controller" type="checkbox" value="1"> 一键生成全部控制器
  189 + </label>
  190 + </div>
  191 + <div class="col-xs-3">
  192 + <input checked="" name="delete" type="hidden" value="0">
  193 + <label class="control-label">
  194 + <input name="delete" type="checkbox" value="1"> 删除模式
  195 + </label>
  196 + </div>
  197 + <div class="col-xs-3">
  198 + <input checked="" name="force" type="hidden" value="0">
  199 + <label class="control-label">
  200 + <input name="force" type="checkbox" value="1"> 强制覆盖模式
  201 + </label>
  202 + </div>
  203 + </div>
  204 + </div>
  205 +
  206 + <div class="form-group in" id="controller">
  207 + <legend>控制器设置</legend>
  208 +
  209 + <div class="row" style="margin-top:15px;">
  210 + <div class="col-xs-12">
  211 + <input type="text" name="controllerfile" class="form-control selectpage" style="width:720px;" data-source="command/get_controller_list" data-multiple="true" name="controller" placeholder="请选择控制器" />
  212 + </div>
  213 + </div>
  214 + </div>
  215 +
  216 + <div class="form-group">
  217 + <legend>生成命令行</legend>
  218 + <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  219 + </div>
  220 +
  221 + <div class="form-group">
  222 + <legend>返回结果</legend>
  223 + <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  224 + </div>
  225 +
  226 + <div class="form-group">
  227 + <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  228 + <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  229 + </div>
  230 +
  231 + </form>
  232 + </div>
  233 + </div>
  234 + </div>
  235 + <div class="tab-pane fade" id="min">
  236 + <div class="row">
  237 + <div class="col-xs-12">
  238 + <form role="form">
  239 + <input type="hidden" name="commandtype" value="min" />
  240 + <div class="form-group">
  241 + <legend>基础设置</legend>
  242 + <div class="row">
  243 + <div class="col-xs-3">
  244 + <label>请选择压缩模块</label>
  245 + <select name="module" class="form-control selectpicker">
  246 + <option value="all" selected>全部</option>
  247 + <option value="backend">后台Backend</option>
  248 + <option value="frontend">前台Frontend</option>
  249 + </select>
  250 + </div>
  251 + <div class="col-xs-3">
  252 + <label>请选择压缩资源</label>
  253 + <select name="resource" class="form-control selectpicker">
  254 + <option value="all" selected>全部</option>
  255 + <option value="js">JS</option>
  256 + <option value="css">CSS</option>
  257 + </select>
  258 + </div>
  259 + <div class="col-xs-3">
  260 + <label>请选择压缩模式</label>
  261 + <select name="optimize" class="form-control selectpicker">
  262 + <option value=""></option>
  263 + <option value="uglify">uglify</option>
  264 + <option value="closure">closure</option>
  265 + </select>
  266 + </div>
  267 + </div>
  268 + </div>
  269 +
  270 + <div class="form-group in">
  271 + <legend>控制器设置</legend>
  272 +
  273 + <div class="row" style="margin-top:15px;">
  274 + <div class="col-xs-12">
  275 +
  276 + </div>
  277 + </div>
  278 + </div>
  279 +
  280 + <div class="form-group">
  281 + <legend>生成命令行</legend>
  282 + <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  283 + </div>
  284 +
  285 + <div class="form-group">
  286 + <legend>返回结果</legend>
  287 + <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  288 + </div>
  289 +
  290 + <div class="form-group">
  291 + <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  292 + <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  293 + </div>
  294 +
  295 + </form>
  296 + </div>
  297 + </div>
  298 + </div>
  299 + <div class="tab-pane fade" id="api">
  300 + <div class="row">
  301 + <div class="col-xs-12">
  302 + <form role="form">
  303 + <input type="hidden" name="commandtype" value="api" />
  304 + <div class="form-group">
  305 + <div class="row">
  306 + <div class="col-xs-3">
  307 + <input checked="" name="force" type="hidden" value="0">
  308 + <label class="control-label">
  309 + <input name="force" type="checkbox" value="1">
  310 + 覆盖模式
  311 + </label>
  312 + </div>
  313 + </div>
  314 + </div>
  315 + <div class="form-group">
  316 + <legend>文档设置</legend>
  317 + <div class="row">
  318 + <div class="col-xs-3">
  319 + <label>请输入接口URL</label>
  320 + <input type="text" name="url" class="form-control" placeholder="API URL,可留空" />
  321 + </div>
  322 + <div class="col-xs-3">
  323 + <label>接口生成文件</label>
  324 + <input type="text" name="output" class="form-control" placeholder="留空则使用api.html" />
  325 + </div>
  326 + <div class="col-xs-3">
  327 + <label>模板文件</label>
  328 + <input type="text" name="template" class="form-control" placeholder="如果不清楚请留空" />
  329 + </div>
  330 + </div>
  331 + <div class="row" style="margin-top:10px;">
  332 + <div class="col-xs-3">
  333 + <label>文档标题</label>
  334 + <input type="text" name="title" class="form-control" placeholder="默认为FastAdmin" />
  335 + </div>
  336 + <div class="col-xs-3">
  337 + <label>文档作者</label>
  338 + <input type="text" name="author" class="form-control" placeholder="默认为FastAdmin" />
  339 + </div>
  340 + <div class="col-xs-3">
  341 + <label>文档语言</label>
  342 + <select name="language" class="form-control">
  343 + <option value="" selected>请选择语言</option>
  344 + <option value="zh-cn">中文</option>
  345 + <option value="en">英文</option>
  346 + </select>
  347 + </div>
  348 + </div>
  349 + </div>
  350 +
  351 + <div class="form-group">
  352 + <legend>生成命令行</legend>
  353 + <textarea class="form-control" rel="command" rows="1" placeholder="请点击生成命令行"></textarea>
  354 + </div>
  355 +
  356 + <div class="form-group">
  357 + <legend>返回结果</legend>
  358 + <textarea class="form-control" rel="result" rows="5" placeholder="请点击立即执行"></textarea>
  359 + </div>
  360 +
  361 + <div class="form-group">
  362 + <button type="button" class="btn btn-info btn-embossed btn-command">{:__('生成命令行')}</button>
  363 + <button type="button" class="btn btn-success btn-embossed btn-execute">{:__('立即执行')}</button>
  364 + </div>
  365 +
  366 + </form>
  367 + </div>
  368 + </div>
  369 + </div>
  370 + </div>
  371 + </div>
  372 +</div>
  373 +<script id="relationtpl" type="text/html">
  374 + <div class="row relation-item">
  375 + <div class="col-xs-2">
  376 + <label>请选择关联表</label>
  377 + <select name="relation[<%=index%>][relation]" class="form-control relationtable"></select>
  378 + </div>
  379 + <div class="col-xs-2">
  380 + <label>请选择关联类型</label>
  381 + <select name="relation[<%=index%>][relationmode]" class="form-control relationmode"></select>
  382 + </div>
  383 + <div class="col-xs-2">
  384 + <label>关联外键</label>
  385 + <select name="relation[<%=index%>][relationforeignkey]" class="form-control relationforeignkey"></select>
  386 + </div>
  387 + <div class="col-xs-2">
  388 + <label>关联主键</label>
  389 + <select name="relation[<%=index%>][relationprimarykey]" class="form-control relationprimarykey"></select>
  390 + </div>
  391 + <div class="col-xs-2">
  392 + <label>请选择显示字段</label>
  393 + <select name="relation[<%=index%>][relationfields][]" multiple class="form-control relationfields"></select>
  394 + </div>
  395 + <div class="col-xs-2">
  396 + <label>&nbsp;</label>
  397 + <a href="javascript:;" class="btn btn-danger btn-block btn-removerelation">移除</a>
  398 + </div>
  399 + </div>
  400 +</script>
  1 +<table class="table table-striped">
  2 + <thead>
  3 + <tr>
  4 + <th>{:__('Title')}</th>
  5 + <th>{:__('Content')}</th>
  6 + </tr>
  7 + </thead>
  8 + <tbody>
  9 + <tr>
  10 + <td>{:__('Type')}</td>
  11 + <td>{$row.type}({$row.type_text})</td>
  12 + </tr>
  13 + <tr>
  14 + <td>{:__('Params')}</td>
  15 + <td>{$row.params}</td>
  16 + </tr>
  17 + <tr>
  18 + <td>{:__('Command')}</td>
  19 + <td>{$row.command}</td>
  20 + </tr>
  21 + <tr>
  22 + <td>{:__('Content')}</td>
  23 + <td>
  24 + <textarea class="form-control" name="" id="" cols="60" rows="10">{$row.content}</textarea>
  25 + </td>
  26 + </tr>
  27 + <tr>
  28 + <td>{:__('Executetime')}</td>
  29 + <td>{$row.executetime|datetime}</td>
  30 + </tr>
  31 + <tr>
  32 + <td>{:__('Status')}</td>
  33 + <td>{$row.status_text}</td>
  34 + </tr>
  35 + </tbody>
  36 +</table>
  37 +<div class="hide layer-footer">
  38 + <label class="control-label col-xs-12 col-sm-2"></label>
  39 + <div class="col-xs-12 col-sm-8">
  40 + <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
  41 + </div>
  42 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
  10 + <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('command/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
  11 + <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('command/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
  12 +
  13 + </div>
  14 + <table id="table" class="table table-striped table-bordered table-hover"
  15 + data-operate-detail="{:$auth->check('command/detail')}"
  16 + data-operate-execute="{:$auth->check('command/execute')}"
  17 + data-operate-del="{:$auth->check('command/del')}"
  18 + width="100%">
  19 + </table>
  20 + </div>
  21 + </div>
  22 +
  23 + </div>
  24 + </div>
  25 +</div>
  1 +<?php
  2 +
  3 +return [
  4 +];
  1 +<?php
  2 +
  3 +namespace addons\command\controller;
  4 +
  5 +use think\addons\Controller;
  6 +
  7 +class Index extends Controller
  8 +{
  9 +
  10 + public function index()
  11 + {
  12 + $this->error("当前插件暂无前台页面");
  13 + }
  14 +
  15 +}
  1 +name = command
  2 +title = 在线命令
  3 +intro = 可在线执行FastAdmin的命令行相关命令
  4 +author = Karson
  5 +website = http://www.fastadmin.net
  6 +version = 1.0.5
  7 +state = 1
  8 +url = /addons/command.html
  1 +CREATE TABLE IF NOT EXISTS `__PREFIX__command` (
  2 + `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'ID',
  3 + `type` varchar(30) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '类型',
  4 + `params` varchar(1500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '参数',
  5 + `command` varchar(1500) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '命令',
  6 + `content` text COMMENT '返回结果',
  7 + `executetime` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '执行时间',
  8 + `createtime` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '创建时间',
  9 + `updatetime` int(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT '更新时间',
  10 + `status` enum('successed','failured') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'failured' COMMENT '状态',
  11 + PRIMARY KEY (`id`) USING BTREE
  12 +) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '在线命令表' ROW_FORMAT = Compact;
  1 +<?php
  2 +
  3 +namespace addons\command\library;
  4 +
  5 +/**
  6 + * Class Output
  7 + */
  8 +class Output extends \think\console\Output
  9 +{
  10 +
  11 + protected $message = [];
  12 +
  13 + public function __construct($driver = 'console')
  14 + {
  15 + parent::__construct($driver);
  16 + }
  17 +
  18 + protected function block($style, $message)
  19 + {
  20 + $this->message[] = $message;
  21 + }
  22 +
  23 + public function getMessage()
  24 + {
  25 + return $this->message;
  26 + }
  27 +
  28 +}
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'command/index',
  9 + add_url: 'command/add',
  10 + edit_url: '',
  11 + del_url: 'command/del',
  12 + multi_url: 'command/multi',
  13 + table: 'command',
  14 + }
  15 + });
  16 +
  17 + var table = $("#table");
  18 +
  19 + // 初始化表格
  20 + table.bootstrapTable({
  21 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  22 + pk: 'id',
  23 + sortName: 'id',
  24 + columns: [
  25 + [
  26 + {checkbox: true},
  27 + {field: 'id', title: __('Id')},
  28 + {field: 'type', title: __('Type'), formatter: Table.api.formatter.search},
  29 + {field: 'type_text', title: __('Type')},
  30 + {
  31 + field: 'command', title: __('Command'), formatter: function (value, row, index) {
  32 + return '<input type="text" class="form-control" value="' + value + '">';
  33 + }
  34 + },
  35 + {
  36 + field: 'executetime',
  37 + title: __('Executetime'),
  38 + operate: 'RANGE',
  39 + addclass: 'datetimerange',
  40 + formatter: Table.api.formatter.datetime
  41 + },
  42 + {
  43 + field: 'createtime',
  44 + title: __('Createtime'),
  45 + operate: 'RANGE',
  46 + addclass: 'datetimerange',
  47 + formatter: Table.api.formatter.datetime
  48 + },
  49 + {
  50 + field: 'updatetime',
  51 + title: __('Updatetime'),
  52 + operate: 'RANGE',
  53 + addclass: 'datetimerange',
  54 + formatter: Table.api.formatter.datetime
  55 + },
  56 + {
  57 + field: 'status',
  58 + title: __('Status'),
  59 + table: table,
  60 + custom: {"successed": 'success', "failured": 'danger'},
  61 + searchList: {"successed": __('Successed'), "failured": __('Failured')},
  62 + formatter: Table.api.formatter.status
  63 + },
  64 + {
  65 + field: 'operate',
  66 + title: __('Operate'),
  67 + buttons: [
  68 + {
  69 + name: 'execute',
  70 + title: __('Execute again'),
  71 + text: __('Execute again'),
  72 + url: 'command/execute',
  73 + icon: 'fa fa-repeat',
  74 + classname: 'btn btn-success btn-xs btn-execute btn-ajax',
  75 + success: function (data) {
  76 + Layer.alert("<textarea class='form-control' cols='60' rows='5'>" + data.result + "</textarea>", {
  77 + title: __("执行结果"),
  78 + shadeClose: true
  79 + });
  80 + table.bootstrapTable('refresh');
  81 + return false;
  82 + }
  83 + },
  84 + {
  85 + name: 'execute',
  86 + title: __('Detail'),
  87 + text: __('Detail'),
  88 + url: 'command/detail',
  89 + icon: 'fa fa-list',
  90 + classname: 'btn btn-info btn-xs btn-execute btn-dialog'
  91 + }
  92 + ],
  93 + table: table,
  94 + events: Table.api.events.operate,
  95 + formatter: Table.api.formatter.operate
  96 + }
  97 + ]
  98 + ]
  99 + });
  100 +
  101 + // 为表格绑定事件
  102 + Table.api.bindevent(table);
  103 + },
  104 + add: function () {
  105 + require(['bootstrap-select', 'bootstrap-select-lang']);
  106 + var mainfields = [];
  107 + var relationfields = {};
  108 + var maintable = [];
  109 + var relationtable = [];
  110 + var relationmode = ["belongsto", "hasone"];
  111 +
  112 + var renderselect = function (select, data) {
  113 + var html = [];
  114 + for (var i = 0; i < data.length; i++) {
  115 + html.push("<option value='" + data[i] + "'>" + data[i] + "</option>");
  116 + }
  117 + $(select).html(html.join(""));
  118 + select.trigger("change");
  119 + if (select.data("selectpicker")) {
  120 + select.selectpicker('refresh');
  121 + }
  122 + return select;
  123 + };
  124 +
  125 + $("select[name=table] option").each(function () {
  126 + maintable.push($(this).val());
  127 + });
  128 + $(document).on('change', "input[name='isrelation']", function () {
  129 + $("#relation-zone").toggleClass("hide", !$(this).prop("checked"));
  130 + });
  131 + $(document).on('change', "select[name='table']", function () {
  132 + var that = this;
  133 + Fast.api.ajax({
  134 + url: "command/get_field_list",
  135 + data: {table: $(that).val()},
  136 + }, function (data, ret) {
  137 + mainfields = data.fieldlist;
  138 + $("#relation-zone .relation-item").remove();
  139 + renderselect($("#fields"), mainfields);
  140 + return false;
  141 + });
  142 + return false;
  143 + });
  144 + $(document).on('click', "a.btn-newrelation", function () {
  145 + var that = this;
  146 + var index = parseInt($(that).data("index")) + 1;
  147 + var content = Template("relationtpl", {index: index});
  148 + content = $(content.replace(/\[index\]/, index));
  149 + $(this).data("index", index);
  150 + $(content).insertBefore($(that).closest(".row"));
  151 + $('select', content).selectpicker();
  152 + var exists = [$("select[name='table']").val()];
  153 + $("select.relationtable").each(function () {
  154 + exists.push($(this).val());
  155 + });
  156 + relationtable = [];
  157 + $.each(maintable, function (i, j) {
  158 + if ($.inArray(j, exists) < 0) {
  159 + relationtable.push(j);
  160 + }
  161 + });
  162 + renderselect($("select.relationtable", content), relationtable);
  163 + $("select.relationtable", content).trigger("change");
  164 + });
  165 + $(document).on('click', "a.btn-removerelation", function () {
  166 + $(this).closest(".row").remove();
  167 + });
  168 + $(document).on('change', "#relation-zone select.relationmode", function () {
  169 + var table = $("select.relationtable", $(this).closest(".row")).val();
  170 + var that = this;
  171 + Fast.api.ajax({
  172 + url: "command/get_field_list",
  173 + data: {table: table},
  174 + }, function (data, ret) {
  175 + renderselect($(that).closest(".row").find("select.relationprimarykey"), $(that).val() == 'belongsto' ? data.fieldlist : mainfields);
  176 + renderselect($(that).closest(".row").find("select.relationforeignkey"), $(that).val() == 'hasone' ? data.fieldlist : mainfields);
  177 + return false;
  178 + });
  179 + });
  180 + $(document).on('change', "#relation-zone select.relationtable", function () {
  181 + var that = this;
  182 + Fast.api.ajax({
  183 + url: "command/get_field_list",
  184 + data: {table: $(that).val()},
  185 + }, function (data, ret) {
  186 + renderselect($(that).closest(".row").find("select.relationmode"), relationmode);
  187 + renderselect($(that).closest(".row").find("select.relationfields"), mainfields)
  188 + renderselect($(that).closest(".row").find("select.relationforeignkey"), data.fieldlist)
  189 + renderselect($(that).closest(".row").find("select.relationfields"), data.fieldlist)
  190 + return false;
  191 + });
  192 + });
  193 + $(document).on('click', ".btn-command", function () {
  194 + var form = $(this).closest("form");
  195 + var textarea = $("textarea[rel=command]", form);
  196 + textarea.val('');
  197 + Fast.api.ajax({
  198 + url: "command/command/action/command",
  199 + data: form.serialize(),
  200 + }, function (data, ret) {
  201 + textarea.val(data.command);
  202 + return false;
  203 + });
  204 + });
  205 + $(document).on('click', ".btn-execute", function () {
  206 + var form = $(this).closest("form");
  207 + var textarea = $("textarea[rel=result]", form);
  208 + textarea.val('');
  209 + Fast.api.ajax({
  210 + url: "command/command/action/execute",
  211 + data: form.serialize(),
  212 + }, function (data, ret) {
  213 + textarea.val(data.result);
  214 + window.parent.$(".toolbar .btn-refresh").trigger('click');
  215 + top.window.Fast.api.refreshmenu();
  216 + return false;
  217 + }, function () {
  218 + window.parent.$(".toolbar .btn-refresh").trigger('click');
  219 + });
  220 + });
  221 + $("select[name='table']").trigger("change");
  222 + Controller.api.bindevent();
  223 + },
  224 + edit: function () {
  225 + Controller.api.bindevent();
  226 + },
  227 + api: {
  228 + bindevent: function () {
  229 + Form.api.bindevent($("form[role=form]"));
  230 + }
  231 + }
  232 + };
  233 + return Controller;
  234 +});
  1 +<?php
  2 +
  3 +namespace addons\example;
  4 +
  5 +use app\common\library\Menu;
  6 +use think\Addons;
  7 +
  8 +/**
  9 + * Example
  10 + */
  11 +class Example extends Addons
  12 +{
  13 +
  14 + /**
  15 + * 插件安装方法
  16 + * @return bool
  17 + */
  18 + public function install()
  19 + {
  20 + $menu = [
  21 + [
  22 + 'name' => 'example',
  23 + 'title' => '开发示例管理',
  24 + 'icon' => 'fa fa-magic',
  25 + 'sublist' => [
  26 + [
  27 + 'name' => 'example/bootstraptable',
  28 + 'title' => '表格完整示例',
  29 + 'icon' => 'fa fa-table',
  30 + 'sublist' => [
  31 + ['name' => 'example/bootstraptable/index', 'title' => '查看'],
  32 + ['name' => 'example/bootstraptable/detail', 'title' => '详情'],
  33 + ['name' => 'example/bootstraptable/change', 'title' => '变更'],
  34 + ['name' => 'example/bootstraptable/del', 'title' => '删除'],
  35 + ['name' => 'example/bootstraptable/multi', 'title' => '批量更新'],
  36 + ]
  37 + ],
  38 + [
  39 + 'name' => 'example/customsearch',
  40 + 'title' => '自定义搜索',
  41 + 'icon' => 'fa fa-table',
  42 + 'sublist' => [
  43 + ['name' => 'example/customsearch/index', 'title' => '查看'],
  44 + ['name' => 'example/customsearch/del', 'title' => '删除'],
  45 + ['name' => 'example/customsearch/multi', 'title' => '批量更新'],
  46 + ]
  47 + ],
  48 + [
  49 + 'name' => 'example/colorbadge',
  50 + 'title' => '彩色角标',
  51 + 'icon' => 'fa fa-table',
  52 + 'sublist' => [
  53 + ['name' => 'example/colorbadge/index', 'title' => '查看'],
  54 + ['name' => 'example/colorbadge/del', 'title' => '删除'],
  55 + ['name' => 'example/colorbadge/multi', 'title' => '批量更新'],
  56 + ]
  57 + ],
  58 + [
  59 + 'name' => 'example/controllerjump',
  60 + 'title' => '控制器间跳转',
  61 + 'icon' => 'fa fa-table',
  62 + 'sublist' => [
  63 + ['name' => 'example/controllerjump/index', 'title' => '查看'],
  64 + ['name' => 'example/controllerjump/del', 'title' => '删除'],
  65 + ['name' => 'example/controllerjump/multi', 'title' => '批量更新'],
  66 + ]
  67 + ],
  68 + [
  69 + 'name' => 'example/cxselect',
  70 + 'title' => '多级联动',
  71 + 'icon' => 'fa fa-table',
  72 + 'sublist' => [
  73 + ['name' => 'example/cxselect/index', 'title' => '查看'],
  74 + ['name' => 'example/cxselect/del', 'title' => '删除'],
  75 + ['name' => 'example/cxselect/multi', 'title' => '批量更新'],
  76 + ]
  77 + ],
  78 + [
  79 + 'name' => 'example/multitable',
  80 + 'title' => '多表格示例',
  81 + 'icon' => 'fa fa-table',
  82 + 'sublist' => [
  83 + ['name' => 'example/multitable/index', 'title' => '查看'],
  84 + ['name' => 'example/multitable/del', 'title' => '删除'],
  85 + ['name' => 'example/multitable/multi', 'title' => '批量更新'],
  86 + ]
  87 + ],
  88 + [
  89 + 'name' => 'example/relationmodel',
  90 + 'title' => '关联模型示例',
  91 + 'icon' => 'fa fa-table',
  92 + 'sublist' => [
  93 + ['name' => 'example/relationmodel/index', 'title' => '查看'],
  94 + ['name' => 'example/relationmodel/del', 'title' => '删除'],
  95 + ['name' => 'example/relationmodel/multi', 'title' => '批量更新'],
  96 + ]
  97 + ],
  98 + [
  99 + 'name' => 'example/tabletemplate',
  100 + 'title' => '表格模板示例',
  101 + 'icon' => 'fa fa-table',
  102 + 'sublist' => [
  103 + ['name' => 'example/tabletemplate/index', 'title' => '查看'],
  104 + ['name' => 'example/tabletemplate/detail', 'title' => '详情'],
  105 + ['name' => 'example/tabletemplate/del', 'title' => '删除'],
  106 + ['name' => 'example/tabletemplate/multi', 'title' => '批量更新'],
  107 + ]
  108 + ],
  109 + [
  110 + 'name' => 'example/baidumap',
  111 + 'title' => '百度地图示例',
  112 + 'icon' => 'fa fa-map-pin',
  113 + 'sublist' => [
  114 + ['name' => 'example/baidumap/index', 'title' => '查看'],
  115 + ['name' => 'example/baidumap/map', 'title' => '详情'],
  116 + ['name' => 'example/baidumap/del', 'title' => '删除'],
  117 + ]
  118 + ],
  119 + ]
  120 + ]
  121 + ];
  122 + Menu::create($menu);
  123 + return true;
  124 + }
  125 +
  126 + /**
  127 + * 插件卸载方法
  128 + * @return bool
  129 + */
  130 + public function uninstall()
  131 + {
  132 + Menu::delete('example');
  133 + return true;
  134 + }
  135 +
  136 + /**
  137 + * 插件启用方法
  138 + */
  139 + public function enable()
  140 + {
  141 + Menu::enable('example');
  142 + }
  143 +
  144 + /**
  145 + * 插件禁用方法
  146 + */
  147 + public function disable()
  148 + {
  149 + Menu::disable('example');
  150 + }
  151 +
  152 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 百度地图
  9 + *
  10 + * @icon fa fa-map
  11 + * @remark 可以搜索百度位置,调用百度地图的相关API
  12 + */
  13 +class Baidumap extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + }
  23 +
  24 + /**
  25 + * 查找地图
  26 + */
  27 + public function map()
  28 + {
  29 + return $this->view->fetch();
  30 + }
  31 +
  32 + /**
  33 + * 搜索列表
  34 + */
  35 + public function selectpage()
  36 + {
  37 + $this->model = model('Area');
  38 + return parent::selectpage();
  39 + }
  40 +
  41 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 表格完整示例
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark 在使用Bootstrap-table中的常用方式,更多使用方式可查看:http://bootstrap-table.wenzhixin.net.cn/zh-cn/
  12 + */
  13 +class Bootstraptable extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 + protected $noNeedRight = ['start', 'pause', 'change', 'detail', 'cxselect', 'searchlist'];
  18 +
  19 + public function _initialize()
  20 + {
  21 + parent::_initialize();
  22 + $this->model = model('AdminLog');
  23 + }
  24 +
  25 + /**
  26 + * 查看
  27 + */
  28 + public function index()
  29 + {
  30 + if ($this->request->isAjax()) {
  31 + list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL);
  32 + $total = $this->model
  33 + ->where($where)
  34 + ->order($sort, $order)
  35 + ->count();
  36 + $list = $this->model
  37 + ->where($where)
  38 + ->order($sort, $order)
  39 + ->limit($offset, $limit)
  40 + ->select();
  41 + $result = array("total" => $total, "rows" => $list, "extend" => ['money' => mt_rand(100000,999999), 'price' => 200]);
  42 +
  43 + return json($result);
  44 + }
  45 + return $this->view->fetch();
  46 + }
  47 +
  48 + /**
  49 + * 详情
  50 + */
  51 + public function detail($ids)
  52 + {
  53 + $row = $this->model->get(['id' => $ids]);
  54 + if (!$row)
  55 + $this->error(__('No Results were found'));
  56 + if ($this->request->isAjax()) {
  57 + $this->success("Ajax请求成功", null, ['id' => $ids]);
  58 + }
  59 + $this->view->assign("row", $row->toArray());
  60 + return $this->view->fetch();
  61 + }
  62 +
  63 + /**
  64 + * 启用
  65 + */
  66 + public function start($ids = '')
  67 + {
  68 + $this->success("模拟启动成功");
  69 + }
  70 +
  71 + /**
  72 + * 暂停
  73 + */
  74 + public function pause($ids = '')
  75 + {
  76 + $this->success("模拟暂停成功");
  77 + }
  78 +
  79 + /**
  80 + * 切换
  81 + */
  82 + public function change($ids = '')
  83 + {
  84 + $this->success("模拟切换成功");
  85 + }
  86 +
  87 + /**
  88 + * 联动搜索
  89 + */
  90 + public function cxselect()
  91 + {
  92 + $type = $this->request->get('type');
  93 + $group_id = $this->request->get('group_id');
  94 + $list = null;
  95 + if ($group_id !== '') {
  96 + if ($type == 'group') {
  97 + $groupIds = $this->auth->getChildrenGroupIds(true);
  98 + $list = \app\admin\model\AuthGroup::where('id', 'in', $groupIds)->field('id as value, name')->select();
  99 + } else {
  100 + $adminIds = \app\admin\model\AuthGroupAccess::where('group_id', 'in', $group_id)->column('uid');
  101 + $list = \app\admin\model\Admin::where('id', 'in', $adminIds)->field('id as value, username AS name')->select();
  102 + }
  103 + }
  104 + $this->success('', null, $list);
  105 + }
  106 +
  107 + /**
  108 + * 搜索下拉列表
  109 + */
  110 + public function searchlist()
  111 + {
  112 + $result = $this->model->limit(10)->select();
  113 + $searchlist = [];
  114 + foreach ($result as $key => $value) {
  115 + $searchlist[] = ['id' => $value['url'], 'name' => $value['url']];
  116 + }
  117 + $data = ['searchlist' => $searchlist];
  118 + $this->success('', null, $data);
  119 + }
  120 +
  121 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 彩色角标
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark 在JS端控制角标的显示与隐藏,请注意左侧菜单栏角标的数值变化
  12 + */
  13 +class Colorbadge extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + }
  23 +
  24 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 控制器间跳转
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark FastAdmin支持在控制器间跳转,点击后将切换到另外一个TAB中,无需刷新当前页面
  12 + */
  13 +class Controllerjump extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + }
  23 +
  24 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 自定义搜索
  9 + *
  10 + * @icon fa fa-search
  11 + * @remark 自定义列表的搜索
  12 + */
  13 +class Customsearch extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + $ipList = $this->model->whereTime('createtime', '-37 days')->group("ip")->column("ip,ip as aa");
  23 + $this->view->assign("ipList", $ipList);
  24 + }
  25 +
  26 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 多级联动
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark FastAdmin使用了jQuery-cxselect实现多级联动,更多文档请参考https://github.com/karsonzhang/cxSelect
  12 + */
  13 +class Cxselect extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + }
  22 +
  23 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 多表格示例
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark 当一个页面上存在多个Bootstrap-table时该如何控制按钮和表格
  12 + */
  13 +class Multitable extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + }
  22 +
  23 + /**
  24 + * 查看
  25 + */
  26 + public function index()
  27 + {
  28 + $this->loadlang('general/attachment');
  29 + $this->loadlang('general/crontab');
  30 + return $this->view->fetch();
  31 + }
  32 +
  33 + public function table1()
  34 + {
  35 + $this->model = model('Attachment');
  36 + //设置过滤方法
  37 + $this->request->filter(['strip_tags']);
  38 + if ($this->request->isAjax())
  39 + {
  40 + //如果发送的来源是Selectpage,则转发到Selectpage
  41 + if ($this->request->request('keyField'))
  42 + {
  43 + return $this->selectpage();
  44 + }
  45 + list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  46 + $total = $this->model
  47 + ->where($where)
  48 + ->order($sort, $order)
  49 + ->count();
  50 +
  51 + $list = $this->model
  52 + ->where($where)
  53 + ->order($sort, $order)
  54 + ->limit($offset, $limit)
  55 + ->select();
  56 +
  57 + $result = array("total" => $total, "rows" => $list);
  58 +
  59 + return json($result);
  60 + }
  61 + return $this->view->fetch('index');
  62 + }
  63 +
  64 + public function table2()
  65 + {
  66 + $this->model = model('AdminLog');
  67 + //设置过滤方法
  68 + $this->request->filter(['strip_tags']);
  69 + if ($this->request->isAjax())
  70 + {
  71 + //如果发送的来源是Selectpage,则转发到Selectpage
  72 + if ($this->request->request('keyField'))
  73 + {
  74 + return $this->selectpage();
  75 + }
  76 + list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  77 + $total = $this->model
  78 + ->where($where)
  79 + ->order($sort, $order)
  80 + ->count();
  81 +
  82 + $list = $this->model
  83 + ->where($where)
  84 + ->order($sort, $order)
  85 + ->limit($offset, $limit)
  86 + ->select();
  87 +
  88 + $result = array("total" => $total, "rows" => $list);
  89 +
  90 + return json($result);
  91 + }
  92 + return $this->view->fetch('index');
  93 + }
  94 +
  95 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 关联模型
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark 当使用到关联模型时需要重载index方法
  12 + */
  13 +class Relationmodel extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + }
  23 +
  24 + /**
  25 + * 查看
  26 + */
  27 + public function index()
  28 + {
  29 + $this->relationSearch = true;
  30 + $this->searchFields = "admin.username,id";
  31 + if ($this->request->isAjax())
  32 + {
  33 + list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  34 + $total = $this->model
  35 + ->with("admin")
  36 + ->where($where)
  37 + ->order($sort, $order)
  38 + ->count();
  39 + $list = $this->model
  40 + ->with("admin")
  41 + ->where($where)
  42 + ->order($sort, $order)
  43 + ->limit($offset, $limit)
  44 + ->select();
  45 + $result = array("total" => $total, "rows" => $list);
  46 +
  47 + return json($result);
  48 + }
  49 + return $this->view->fetch();
  50 + }
  51 +
  52 +}
  1 +<?php
  2 +
  3 +namespace app\admin\controller\example;
  4 +
  5 +use app\common\controller\Backend;
  6 +
  7 +/**
  8 + * 表格模板示例
  9 + *
  10 + * @icon fa fa-table
  11 + * @remark 可以通过使用表格模板将表格中的行渲染成一样的展现方式,基于此功能可以任意定制自己想要的展示列表
  12 + */
  13 +class Tabletemplate extends Backend
  14 +{
  15 +
  16 + protected $model = null;
  17 +
  18 + public function _initialize()
  19 + {
  20 + parent::_initialize();
  21 + $this->model = model('AdminLog');
  22 + }
  23 +
  24 + /**
  25 + * 查看
  26 + */
  27 + public function index()
  28 + {
  29 + if ($this->request->isAjax())
  30 + {
  31 + list($where, $sort, $order, $offset, $limit) = $this->buildparams(NULL);
  32 + $total = $this->model
  33 + ->where($where)
  34 + ->order($sort, $order)
  35 + ->count();
  36 + $list = $this->model
  37 + ->where($where)
  38 + ->order($sort, $order)
  39 + ->limit($offset, $limit)
  40 + ->select();
  41 + $result = array("total" => $total, "rows" => $list);
  42 +
  43 + return json($result);
  44 + }
  45 + return $this->view->fetch();
  46 + }
  47 +
  48 + /**
  49 + * 详情
  50 + */
  51 + public function detail($ids)
  52 + {
  53 + $row = $this->model->get(['id' => $ids]);
  54 + if (!$row)
  55 + $this->error(__('No Results were found'));
  56 + $this->view->assign("row", $row->toArray());
  57 + return $this->view->fetch();
  58 + }
  59 +
  60 +}
  1 +<?php
  2 +
  3 +namespace app\admin\model;
  4 +
  5 +use think\Model;
  6 +
  7 +class Area extends Model
  8 +{
  9 +
  10 + // 开启自动写入时间戳字段
  11 + protected $autoWriteTimestamp = false;
  12 + // 定义时间戳字段名
  13 + protected $createTime = false;
  14 + protected $updateTime = false;
  15 +
  16 +}
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + <a href="example/baidumap/map" class="btn btn-info btn-dialog" title="地图"><i class="fa fa-map-signs"></i> 地图</a>
  11 + </div>
  12 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  13 +
  14 + </table>
  15 +
  16 + </div>
  17 + </div>
  18 +
  19 + </div>
  20 + </div>
  21 +</div>
  1 +{__NOLAYOUT__}
  2 +<!DOCTYPE html>
  3 +<html lang="{$config.language}">
  4 + <head>
  5 + {include file="common/meta" /}
  6 + <style type="text/css">
  7 + body, html,#allmap{width: 100%;height: 100%;overflow: hidden;margin:0;font-family:"微软雅黑";}
  8 + #search{position:absolute;top:20px;left:20px;}
  9 + </style>
  10 + </head>
  11 +
  12 + <body class="inside-header inside-aside {:defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''}">
  13 + <div class="container-fluid" id="search">
  14 + <div class="row">
  15 + <div class="col-xs-12 col-sm-4">
  16 + <form role="form" action="">
  17 + <div class="input-group" style="width:300px;">
  18 + <input type="text" id="searchaddress" class="form-control selectpage" data-primary-key="name" data-source="example/baidumap/selectpage" />
  19 + <span class="input-group-btn">
  20 + <button class="btn btn-success btn-search" type="button">搜索</button>
  21 + </span>
  22 + </div>
  23 + </form>
  24 + </div>
  25 + </div>
  26 + </div>
  27 + <div id='allmap'></div>
  28 + {include file="common/script" /}
  29 + </body>
  30 +</html>
  1 +<table class="table table-striped">
  2 + <thead>
  3 + <tr>
  4 + <th>{:__('Title')}</th>
  5 + <th>{:__('Content')}</th>
  6 + </tr>
  7 + </thead>
  8 + <tbody>
  9 + {volist name="row" id="vo" }
  10 + <tr>
  11 + <td>{$key}</td>
  12 + <td>{$vo}</td>
  13 + </tr>
  14 + {/volist}
  15 + {if $Think.get.dialog}
  16 + <tr>
  17 + <td>回传数据</td>
  18 + <td>
  19 + <div class="input-group">
  20 + <input name="callback" class="form-control" value="test" />
  21 + <span class="input-group-btn"><a href="javascript:;" class="btn btn-success btn-callback" >回传数据</a></span>
  22 + </div>
  23 + </td>
  24 + </tr>
  25 + {/if}
  26 + </tbody>
  27 +</table>
  28 +<div class="hide layer-footer">
  29 + <label class="control-label col-xs-12 col-sm-2"></label>
  30 + <div class="col-xs-12 col-sm-8">
  31 + <button type="reset" class="btn btn-primary btn-embossed btn-close" onclick="Layer.closeAll();">{:__('Close')}</button>
  32 + </div>
  33 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + <a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 获取选中项</a>
  11 + <div class="dropdown btn-group">
  12 + <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> <?= __('More') ?></a>
  13 + <ul class="dropdown-menu text-left" role="menu">
  14 + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
  15 + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
  16 + </ul>
  17 + </div>
  18 + <a class="btn btn-success btn-singlesearch" href="javascript:;"><i class="fa fa-user"></i> 自定义搜索</a>
  19 + <a class="btn btn-success btn-change btn-start" data-params="action=start" data-url="example/bootstraptable/start" href="javascript:;"><i class="fa fa-play"></i> 启动</a>
  20 + <a class="btn btn-danger btn-change btn-pause" data-params="action=pause" data-url="example/bootstraptable/pause" href="javascript:;"><i class="fa fa-pause"></i> 暂停</a>
  21 + <a href="javascript:;" class="btn btn-default" style="font-size:14px;color:dodgerblue;">
  22 + <i class="fa fa-dollar"></i>
  23 + <span class="extend">
  24 + 金额:<span id="money">0</span>
  25 + 单价:<span id="price">0</span>
  26 + </span>
  27 + </a>
  28 + </div>
  29 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  30 +
  31 + </table>
  32 +
  33 + </div>
  34 + </div>
  35 +
  36 + </div>
  37 + </div>
  38 +</div>
  39 +<script id="categorytpl" type="text/html">
  40 + <div class="row">
  41 + <div class="col-xs-12">
  42 + <div class="form-inline" data-toggle="cxselect" data-selects="group,admin">
  43 + <select class="group form-control" name="group" data-url="example/bootstraptable/cxselect?type=group"></select>
  44 + <select class="admin form-control" name="admin_id" data-url="example/bootstraptable/cxselect?type=admin" data-query-name="group_id"></select>
  45 + <input type="hidden" class="operate" data-name="admin_id" value="=" />
  46 + </div>
  47 + </div>
  48 + </div>
  49 +</script>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + </div>
  11 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  12 +
  13 + </table>
  14 +
  15 +
  16 + </div>
  17 + </div>
  18 +
  19 + </div>
  20 + </div>
  21 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + </div>
  11 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  12 +
  13 + </table>
  14 +
  15 +
  16 + </div>
  17 + </div>
  18 +
  19 + </div>
  20 + </div>
  21 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh')}
  10 + </div>
  11 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  12 +
  13 + </table>
  14 +
  15 + </div>
  16 + </div>
  17 +
  18 + </div>
  19 + </div>
  20 +</div>
  21 +
  22 +<script id="customformtpl" type="text/html">
  23 + <!--form表单必须添加form-commsearch这个类-->
  24 + <form action="" class="form-commonsearch">
  25 + <div style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:20px;">
  26 + <h4>自定义搜索表单</h4>
  27 + <hr>
  28 + <div class="row">
  29 + <div class="col-xs-12 col-sm-6 col-md-3">
  30 + <div class="form-group">
  31 + <label class="control-label">ID</label>
  32 + <!--显式的operate操作符-->
  33 + <div class="input-group">
  34 + <div class="input-group-btn">
  35 + <select class="form-control operate" data-name="id" style="width:auto;">
  36 + <option value="=" selected>等于</option>
  37 + <option value=">">大于</option>
  38 + <option value="<">小于</option>
  39 + </select>
  40 + </div>
  41 + <input class="form-control" type="text" name="id" placeholder="" value=""/>
  42 + </div>
  43 + </div>
  44 + </div>
  45 + <div class="col-xs-12 col-sm-6 col-md-3">
  46 + <div class="form-group">
  47 + <label class="control-label">标题</label>
  48 + <!--隐式的operate操作符,必须携带一个classoperate隐藏的文本框,且它的data-name="字段",值为操作符-->
  49 + <input class="operate" type="hidden" data-name="title" value="="/>
  50 + <input class="form-control" type="text" name="title" placeholder="请输入查找的标题" value=""/>
  51 + </div>
  52 + </div>
  53 + <div class="col-xs-12 col-sm-6 col-md-3">
  54 + <div class="form-group">
  55 + <label class="control-label">管理员ID</label>
  56 + <div class="row" data-toggle="cxselect" data-selects="group,admin">
  57 + <div class="col-xs-6">
  58 + <select class="group form-control" name="group"
  59 + data-url="example/bootstraptable/cxselect?type=group"></select>
  60 + </div>
  61 + <div class="col-xs-6">
  62 + <select class="admin form-control" name="admin_id"
  63 + data-url="example/bootstraptable/cxselect?type=admin"
  64 + data-query-name="group_id"></select>
  65 + </div>
  66 + <input type="hidden" class="operate" data-name="admin_id" value="="/>
  67 + </div>
  68 + </div>
  69 + </div>
  70 + <div class="col-xs-12 col-sm-6 col-md-3">
  71 + <div class="form-group">
  72 + <label class="control-label">用户名</label>
  73 + <input type="hidden" class="operate" data-name="username" value="="/>
  74 + <input id="c-category_id" data-source="auth/admin/index" data-primary-key="username"
  75 + data-field="username" class="form-control selectpage" name="username" type="text"
  76 + value="">
  77 + </div>
  78 + </div>
  79 +
  80 + <div class="col-xs-12 col-sm-6 col-md-3" style="min-height:68px;">
  81 + <!--这里添加68px是为了避免刷新时出现元素错位闪屏-->
  82 + <div class="form-group">
  83 + <label class="control-label">IP</label>
  84 + <input type="hidden" class="operate" data-name="ip" value="in"/>
  85 + <!--select一个固定的高度-->
  86 + <select id="c-flag" class="form-control selectpicker" multiple name="ip" style="height:31px;">
  87 + {foreach name="ipList" item="vo"}
  88 + <option value="{$key}" {in name="key" value="" }selected{/in}>{$vo}</option>
  89 + {/foreach}
  90 + </select>
  91 + </div>
  92 + </div>
  93 + <div class="col-xs-12 col-sm-6 col-md-3">
  94 + <div class="form-group">
  95 + <label class="control-label">IP</label>
  96 + <input type="hidden" class="operate" data-name="createtime" value="RANGE"/>
  97 + <input type="text" class="form-control datetimerange" name="createtime" value=""/>
  98 + </div>
  99 + </div>
  100 + <div class="col-xs-12 col-sm-6 col-md-3">
  101 + <div class="form-group">
  102 + <label class="control-label"></label>
  103 + <div class="row">
  104 + <div class="col-xs-6">
  105 + <input type="submit" class="btn btn-success btn-block" value="提交"/>
  106 + </div>
  107 + <div class="col-xs-6">
  108 + <input type="reset" class="btn btn-primary btn-block" value="重置"/>
  109 + </div>
  110 + </div>
  111 + </div>
  112 + </div>
  113 + </div>
  114 + </div>
  115 + </form>
  116 +</script>
  1 +<style>#cxselect-example textarea{margin:10px 0;}</style>
  2 +<div class="panel panel-default panel-intro">
  3 + {:build_heading()}
  4 +
  5 + <div class="panel-body">
  6 + <div id="myTabContent" class="tab-content">
  7 + <div class="tab-pane fade active in" id="one">
  8 + <div class="widget-body no-padding" id="cxselect-example">
  9 + <form id="cxselectform" action="">
  10 + <div class="row">
  11 + <div class="col-md-6">
  12 +
  13 + <div class="panel panel-default">
  14 + <div class="panel-heading"><b>省市区联动</b>(通过AJAX读取数据)</div>
  15 + <div class="panel-body">
  16 + <div class="row">
  17 + <div class="col-xs-9">
  18 + <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
  19 + <select class="province form-control" name="province" data-url="ajax/area"></select>
  20 + <select class="city form-control" name="city" data-url="ajax/area"></select>
  21 + <select class="area form-control" name="area" data-url="ajax/area"></select>
  22 + </div>
  23 + </div>
  24 + <div class="col-xs-3 text-right">
  25 + <h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
  26 + </div>
  27 + <div class="col-xs-12">
  28 + <textarea class="form-control" rows="8">
  29 + </textarea>
  30 + </div>
  31 + </div>
  32 + <div class="row">
  33 + <div class="col-xs-9">
  34 + <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
  35 + <select class="province form-control" name="province" data-url="ajax/area">
  36 + <option value="1964" selected>广东省</option>
  37 + </select>
  38 + <select class="city form-control" name="city" data-url="ajax/area">
  39 + <option value="1988" selected>深圳市</option>
  40 + </select>
  41 + <select class="area form-control" name="area" data-url="ajax/area">
  42 + <option value="1991" selected>南山区</option>
  43 + </select>
  44 + </div>
  45 + </div>
  46 + <div class="col-xs-3 text-right">
  47 + <h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
  48 + </div>
  49 + <div class="col-xs-12">
  50 + <textarea class="form-control" rows="8">
  51 + </textarea>
  52 + </div>
  53 + </div>
  54 + </div>
  55 +
  56 + </div>
  57 + </div>
  58 + <div class="col-md-6">
  59 + <div class="panel panel-default">
  60 + <div class="panel-heading"><b>类别联动</b>(Ajax读取数据)</div>
  61 + <div class="panel-body">
  62 + <div class="row">
  63 + <div class="col-xs-9">
  64 + <div class="form-inline" data-toggle="cxselect" data-selects="first,second">
  65 + <select class="first form-control" name="first" data-url="ajax/category?type=page&pid=5"></select>
  66 + <select class="second form-control" name="second" data-url="ajax/category" data-query-name="pid"></select>
  67 + </div>
  68 + </div>
  69 + <div class="col-xs-3 text-right">
  70 + <h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
  71 + </div>
  72 + <div class="col-xs-12">
  73 + <textarea class="form-control" rows="8">
  74 + </textarea>
  75 + </div>
  76 + </div>
  77 + <div class="row">
  78 + <div class="col-xs-9">
  79 + <div class="form-inline" data-toggle="cxselect" data-selects="first,second">
  80 + <select class="first form-control" name="first" data-url="ajax/category?type=page&pid=5">
  81 + <option value="6" selected>网站建站</option>
  82 + </select>
  83 + <select class="second form-control" name="second" data-url="ajax/category" data-query-name="pid">
  84 + <option value="9" selected>移动端</option>
  85 + </select>
  86 + </div>
  87 + </div>
  88 + <div class="col-xs-3 text-right">
  89 + <h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
  90 + </div>
  91 + <div class="col-xs-12">
  92 + <textarea class="form-control" rows="8">
  93 + </textarea>
  94 + </div>
  95 + </div>
  96 +
  97 + </div>
  98 + </div>
  99 + </div>
  100 + <div class="col-md-6">
  101 + <div class="panel panel-default">
  102 + <div class="panel-heading"><b>省市区联动</b>(通过JSON渲染数据)</div>
  103 + <div class="panel-body">
  104 + <div class="row">
  105 + <div class="col-xs-9">
  106 + <!--由于在初始化中修改了默认值,所以这里需要修改-jsonSpace/jsonValue/jsonName的值-->
  107 + <div class="form-inline" data-toggle="cxselect" data-url="__CDN__/assets/libs/fastadmin-cxselect/js/cityData.min.json"
  108 + data-selects="province,city,area" data-json-space="" data-json-name="n" data-json-value="">
  109 + <select class="province form-control" name="province"></select>
  110 + <select class="city form-control" name="city"></select>
  111 + <select class="area form-control" name="area"></select>
  112 + </div>
  113 + </div>
  114 + <div class="col-xs-3 text-right">
  115 + <h6><label class="label label-primary"><i class="fa fa-pencil"></i> 增加</label></h6>
  116 + </div>
  117 + <div class="col-xs-12">
  118 + <textarea class="form-control" rows="8">
  119 + </textarea>
  120 + </div>
  121 + </div>
  122 + <div class="row">
  123 + <div class="col-xs-9">
  124 + <!--由于在初始化中修改了默认值,所以这里需要修改-jsonSpace/jsonValue/jsonName的值-->
  125 + <div class="form-inline" data-toggle="cxselect" data-url="__CDN__/assets/libs/fastadmin-cxselect/js/cityData.min.json"
  126 + data-selects="province,city,area" data-json-space="" data-json-name="n" data-json-value="">
  127 + <select class="province form-control" data-first-title="选择省">
  128 + <option value="">请选择</option>
  129 + <option value="浙江省" selected>浙江省</option>
  130 + </select>
  131 + <select class="city form-control" data-first-title="选择市">
  132 + <option value="">请选择</option>
  133 + <option value="杭州市" selected>杭州市</option>
  134 + </select>
  135 + <select class="area form-control" data-first-title="选择地区">
  136 + <option value="">请选择</option>
  137 + <option value="西湖区" selected>西湖区</option>
  138 + </select>
  139 + </div>
  140 + </div>
  141 + <div class="col-xs-3 text-right">
  142 + <h6><label class="label label-success"><i class="fa fa-edit"></i> 修改</label></h6>
  143 + </div>
  144 + <div class="col-xs-12">
  145 + <textarea class="form-control" rows="8">
  146 + </textarea>
  147 + </div>
  148 + </div>
  149 + </div>
  150 +
  151 + </div>
  152 + </div>
  153 + </div>
  154 + </form>
  155 + </div>
  156 + </div>
  157 +
  158 + </div>
  159 + </div>
  160 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + <div class="panel-heading">
  3 + <div class="panel-lead"><em>多表格(Multitable)</em>用于展示在一个页面展示多个表格数据,并且每次切换时刷新</div>
  4 + <ul class="nav nav-tabs">
  5 + <li class="active"><a href="#first" data-toggle="tab">表格1</a></li>
  6 + <li><a href="#second" data-toggle="tab">表格2</a></li>
  7 + </ul>
  8 + </div>
  9 + <div class="panel-body">
  10 + <div id="myTabContent" class="tab-content">
  11 + <div class="tab-pane fade active in" id="first">
  12 + <div id="toolbar1" class="toolbar">
  13 + {:build_toolbar('refresh')}
  14 + </div>
  15 + <table id="table1" class="table table-striped table-bordered table-hover" width="100%">
  16 + </table>
  17 + </div>
  18 + <div class="tab-pane fade" id="second">
  19 + <div id="toolbar2" class="toolbar">
  20 + {:build_toolbar('refresh')}
  21 + </div>
  22 + <table id="table2" class="table table-striped table-bordered table-hover" width="100%">
  23 + </table>
  24 + </div>
  25 + </div>
  26 + </div>
  27 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + </div>
  11 + <table id="table" class="table table-striped table-bordered table-hover" width="100%">
  12 +
  13 + </table>
  14 +
  15 +
  16 + </div>
  17 + </div>
  18 +
  19 + </div>
  20 + </div>
  21 +</div>
  1 +<div class="panel panel-default panel-intro">
  2 + {:build_heading()}
  3 +
  4 + <div class="panel-body">
  5 + <div id="myTabContent" class="tab-content">
  6 + <div class="tab-pane fade active in" id="one">
  7 + <div class="widget-body no-padding">
  8 + <div id="toolbar" class="toolbar">
  9 + {:build_toolbar('refresh,delete')}
  10 + <a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;"><i class="fa fa-leaf"></i> 获取选中项</a>
  11 + <a class="btn btn-success btn-toggle-view" href="javascript:;"><i class="fa fa-leaf"></i> 切换视图</a>
  12 + </div>
  13 + <table id="table" class="table table-striped table-hover" width="100%">
  14 +
  15 + </table>
  16 +
  17 + </div>
  18 + </div>
  19 +
  20 + </div>
  21 + </div>
  22 +</div>
  23 +<style type="text/css">
  24 + .example {
  25 + height:100%;position: relative;
  26 + }
  27 + .example > span {
  28 + position:absolute;left:15px;top:15px;
  29 + }
  30 +</style>
  31 +
  32 +<script id="itemtpl" type="text/html">
  33 + <!--
  34 + 如果启用了templateView,默认调用的是itemtpl这个模板,可以通过设置templateFormatter来修改
  35 + 在当前模板中可以使用三个变量(item:行数据,i:当前第几行,data:所有的行数据)
  36 + 此模板引擎使用的是art-templatenative,可参考官方文档
  37 + -->
  38 +
  39 + <div class="col-sm-4 col-md-3">
  40 + <!--下面四行是为了展示随机图片和标签,可移除-->
  41 + <% var imagearr = ['https://ws2.sinaimg.cn/large/006tNc79gy1fgphwokqt9j30dw0990tb.jpg', 'https://ws2.sinaimg.cn/large/006tNc79gy1fgphwt8nq8j30e609f3z4.jpg', 'https://ws1.sinaimg.cn/large/006tNc79gy1fgphwn44hvj30go0b5myb.jpg', 'https://ws1.sinaimg.cn/large/006tNc79gy1fgphwnl37mj30dw09agmg.jpg', 'https://ws3.sinaimg.cn/large/006tNc79gy1fgphwqsvh6j30go0b576c.jpg']; %>
  42 + <% var image = imagearr[item.id % 5]; %>
  43 + <% var labelarr = ['primary', 'success', 'info', 'danger', 'warning']; %>
  44 + <% var label = labelarr[item.id % 5]; %>
  45 + <div class="thumbnail example">
  46 + <span class="btn btn-<%=label%>">ID:<%=item.id%></span>
  47 + <img src="<%=image%>" class="img-responsive" alt="<%=item.title%>">
  48 + <div class="caption">
  49 + <h4><%=item.title?item.title:'无'%></h4>
  50 + <p class="text-muted">操作者IP:<%=item.ip%></p>
  51 + <p class="text-muted">操作时间:<%=Moment(item.createtime*1000).format("YYYY-MM-DD HH:mm:ss")%></p>
  52 + <p>
  53 + <!--详情的事件需要在JS中手动绑定-->
  54 + <a href="#" class="btn btn-primary btn-success btn-detail" data-id="<%=item.id%>"><i class="fa fa-camera"></i> 详情</a>
  55 +
  56 + <!--如果需要响应编辑或删除事件,可以给元素添加 btn-editbtn-del的类和data-id这个属性值-->
  57 + <a href="#" class="btn btn-primary btn-edit" data-id="<%=item.id%>"><i class="fa fa-pencil"></i> 编辑</a>
  58 + <a href="#" class="btn btn-danger btn-del" data-id="<%=item.id%>"><i class="fa fa-times"></i> 删除</a>
  59 + <span class="pull-right" style="margin-top:10px;">
  60 + <!--如果需要多选操作,请确保有下面的checkbox元素存在,可移除-->
  61 + <input name="checkbox" data-id="<%=item.id%>" type="checkbox" />
  62 + </span>
  63 + </p>
  64 + </div>
  65 + </div>
  66 + </div>
  67 +</script>
  1 +/*!
  2 + * Start Bootstrap - Modern Business (http://startbootstrap.com/)
  3 + * Copyright 2013-2016 Start Bootstrap
  4 + * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap/blob/gh-pages/LICENSE)
  5 + */
  6 +
  7 +/* Global Styles */
  8 +
  9 +html,
  10 +body {
  11 + height: 100%;
  12 +}
  13 +
  14 +body {
  15 + padding-top: 50px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
  16 + -webkit-font-smoothing: antialiased;
  17 + -moz-osx-font-smoothing: grayscale;
  18 + font-family: 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  19 +}
  20 +
  21 +.img-addon {
  22 + margin-bottom: 10px;
  23 + width:100%;
  24 +}
  25 +
  26 +.img-hover:hover {
  27 + opacity: 0.8;
  28 +}
  29 +
  30 +.display-1 {
  31 + font-size:44px;
  32 +}
  33 +.display-4 {
  34 + font-size:24px;
  35 + line-height:32px;
  36 +}
  37 +
  38 +/* Home Page Carousel */
  39 +
  40 +header.carousel {
  41 + height: 50%;
  42 +}
  43 +
  44 +header.carousel .item,
  45 +header.carousel .item.active,
  46 +header.carousel .carousel-inner {
  47 + height: 100%;
  48 +}
  49 +
  50 +header.carousel .fill {
  51 + width: 100%;
  52 + height: 100%;
  53 +}
  54 +
  55 +/* 404 Page Styles */
  56 +
  57 +.error-404 {
  58 + font-size: 100px;
  59 +}
  60 +
  61 +/* Pricing Page Styles */
  62 +
  63 +.price {
  64 + display: block;
  65 + font-size: 50px;
  66 + line-height: 50px;
  67 +}
  68 +
  69 +.price sup {
  70 + top: -20px;
  71 + left: 2px;
  72 + font-size: 20px;
  73 +}
  74 +
  75 +.period {
  76 + display: block;
  77 + font-style: italic;
  78 +}
  79 +
  80 +/* Footer Styles */
  81 +
  82 +footer {
  83 + margin: 50px 0;
  84 +}
  85 +
  86 +/* Responsive Styles */
  87 +
  88 +@media(max-width:991px) {
  89 + .customer-img,
  90 + .img-related {
  91 + margin-bottom: 30px;
  92 + }
  93 +}
  94 +
  95 +@media(max-width:767px) {
  96 + .img-addon {
  97 + margin-bottom: 15px;
  98 + }
  99 +
  100 + header.carousel .carousel {
  101 + height: 70%;
  102 + }
  103 +}
  104 +.carousel-body {
  105 + position:absolute;
  106 + width: 100%;
  107 + top:25%;
  108 + text-align:center;
  109 + color:#fff;
  110 +}
  111 +
  112 +.addonlist a > p{
  113 + margin-bottom:15px;
  114 +}
  1 +/** @license
  2 + * RequireJS plugin for async dependency load like JSONP and Google Maps
  3 + * Author: Miller Medeiros
  4 + * Version: 0.1.2 (2014/02/24)
  5 + * Released under the MIT license
  6 + */
  7 +define(function(){
  8 +
  9 + var DEFAULT_PARAM_NAME = 'callback',
  10 + _uid = 0;
  11 +
  12 + function injectScript(src){
  13 + var s, t;
  14 + s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = src;
  15 + t = document.getElementsByTagName('script')[0]; t.parentNode.insertBefore(s,t);
  16 + }
  17 +
  18 + function formatUrl(name, id){
  19 + var paramRegex = /!(.+)/,
  20 + url = name.replace(paramRegex, ''),
  21 + param = (paramRegex.test(name))? name.replace(/.+!/, '') : DEFAULT_PARAM_NAME;
  22 + url += (url.indexOf('?') < 0)? '?' : '&';
  23 + return url + param +'='+ id;
  24 + }
  25 +
  26 + function uid() {
  27 + _uid += 1;
  28 + return '__async_req_'+ _uid +'__';
  29 + }
  30 +
  31 + return{
  32 + load : function(name, req, onLoad, config){
  33 + if(config.isBuild){
  34 + onLoad(null); //avoid errors on the optimizer
  35 + }else{
  36 + var id = uid();
  37 + //create a global variable that stores onLoad so callback
  38 + //function can define new module after async load
  39 + window[id] = onLoad;
  40 + injectScript(formatUrl(req.toUrl(name), id));
  41 + }
  42 + }
  43 + };
  44 +});
  1 +require.config({
  2 + paths: {
  3 + 'async': '../addons/example/js/async',
  4 + 'BMap': ['//api.map.baidu.com/api?v=2.0&ak=mXijumfojHnAaN2VxpBGoqHM'],
  5 + },
  6 + shim: {
  7 + 'BMap': {
  8 + deps: ['jquery'],
  9 + exports: 'BMap'
  10 + }
  11 + }
  12 +});
  1 +<?php
  2 +
  3 +return [
  4 + [
  5 + 'name' => 'title',
  6 + 'title' => '标题',
  7 + 'type' => 'string',
  8 + 'content' => [
  9 + ],
  10 + 'value' => '示例标题',
  11 + 'rule' => 'required',
  12 + 'msg' => '',
  13 + 'tip' => '',
  14 + 'ok' => '',
  15 + 'extend' => ''
  16 + ],
  17 + [
  18 + //配置唯一标识
  19 + 'name' => 'theme',
  20 + //显示的标题
  21 + 'title' => '皮肤',
  22 + //类型
  23 + 'type' => 'string',
  24 + //数据字典
  25 + 'content' => [
  26 + ],
  27 + //值
  28 + 'value' => 'default',
  29 + //验证规则
  30 + 'rule' => 'required',
  31 + //错误消息
  32 + 'msg' => '',
  33 + //提示消息
  34 + 'tip' => '',
  35 + //成功消息
  36 + 'ok' => '',
  37 + //扩展信息
  38 + 'extend' => ''
  39 + ],
  40 + [
  41 + 'name' => 'domain',
  42 + 'title' => '绑定二级域名前缀',
  43 + 'type' => 'string',
  44 + 'content' => [
  45 + ],
  46 + 'value' => '',
  47 + 'rule' => '',
  48 + 'msg' => '',
  49 + 'tip' => '',
  50 + 'ok' => '',
  51 + 'extend' => ''
  52 + ],
  53 + [
  54 + 'name' => 'rewrite',
  55 + 'title' => '伪静态',
  56 + 'type' => 'array',
  57 + 'content' => [],
  58 + 'value' => [
  59 + 'index/index' => '/example$',
  60 + 'demo/index' => '/example/d/[:name]',
  61 + 'demo/demo1' => '/example/d1/[:name]',
  62 + 'demo/demo2' => '/example/d2/[:name]',
  63 + ],
  64 + 'rule' => 'required',
  65 + 'msg' => '',
  66 + 'tip' => '',
  67 + 'ok' => '',
  68 + 'extend' => ''
  69 + ],
  70 +];
  1 +<?php
  2 +
  3 +namespace addons\example\controller;
  4 +
  5 +use think\addons\Controller;
  6 +
  7 +/**
  8 + * 测试控制器
  9 + */
  10 +class Demo extends Controller
  11 +{
  12 +
  13 + protected $layout = 'default';
  14 + protected $noNeedLogin = ['index', 'demo1'];
  15 + protected $noNeedRight = ['*'];
  16 +
  17 + public function index()
  18 + {
  19 + return $this->view->fetch();
  20 + }
  21 +
  22 + public function demo1()
  23 + {
  24 + return $this->view->fetch();
  25 + }
  26 +
  27 + public function demo2()
  28 + {
  29 + return $this->view->fetch();
  30 + }
  31 +
  32 +}
  1 +<?php
  2 +
  3 +namespace addons\example\controller;
  4 +
  5 +use think\addons\Controller;
  6 +
  7 +class Index extends Controller
  8 +{
  9 +
  10 + protected $layout = 'default';
  11 +
  12 + public function index()
  13 + {
  14 + return $this->view->fetch();
  15 + }
  16 +
  17 +}
  1 +name = example
  2 +title = 开发示例
  3 +intro = FastAdmin多个开发示例
  4 +author = Karson
  5 +website = http://www.fastadmin.net
  6 +version = 1.0.7
  7 +state = 1
  8 +url = /addons/example
此 diff 太大无法显示。
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 + var Controller = {
  3 + index: function () {
  4 + //
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/baidumap/index',
  9 + add_url: 'example/baidumap/add',
  10 + edit_url: 'example/baidumap/edit',
  11 + del_url: 'example/baidumap/del',
  12 + multi_url: 'example/baidumap/multi',
  13 + table: '',
  14 + }
  15 + });
  16 +
  17 + var table = $("#table");
  18 +
  19 + // 初始化表格
  20 + table.bootstrapTable({
  21 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  22 + pk: 'id',
  23 + sortName: 'id',
  24 + columns: [
  25 + [
  26 + {checkbox: true},
  27 + {field: 'id', title: 'ID', operate: false},
  28 + {field: 'admin_id', title: __('Admin_id'), visible: false, operate: false},
  29 + {field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
  30 + {field: 'title', title: __('Title')},
  31 + {field: 'url', title: __('Url'), align: 'left'},
  32 + {field: 'ip', title: __('IP')},
  33 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  34 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  35 + ]
  36 + ]
  37 + });
  38 +
  39 + // 为表格绑定事件
  40 + Table.api.bindevent(table);
  41 + },
  42 + add: function () {
  43 + Controller.api.bindevent();
  44 + },
  45 + edit: function () {
  46 + Controller.api.bindevent();
  47 + },
  48 + map: function () {
  49 + Form.api.bindevent($("form[role=form]"));
  50 + require(['async!BMap'], function () {
  51 + // 更多文档可参考 http://lbsyun.baidu.com/jsdemo.htm
  52 + // 百度地图API功能
  53 + var map = new BMap.Map("allmap");
  54 + var point = new BMap.Point(116.404, 39.915);
  55 +
  56 + map.centerAndZoom(point, 13); //设置中心坐标点和级别
  57 + var marker = new BMap.Marker(point); // 创建标注
  58 + map.addOverlay(marker); // 将标注添加到地图中
  59 + marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
  60 +
  61 + map.enableDragging(); //开启拖拽
  62 + //map.enableInertialDragging(); //开启惯性拖拽
  63 + map.enableScrollWheelZoom(true); //是否允许缩放
  64 + //map.centerAndZoom("上海",15); //根据城市名设定地图中心点
  65 +
  66 + var geolocation = new BMap.Geolocation();
  67 + geolocation.getCurrentPosition(function (r) {
  68 + if (this.getStatus() == BMAP_STATUS_SUCCESS) {
  69 + var mk = new BMap.Marker(r.point);
  70 + map.addOverlay(mk);
  71 + map.panTo(r.point);
  72 + //Layer.alert('您的位置:' + r.point.lng + ',' + r.point.lat);
  73 + } else {
  74 + Layer.alert('failed' + this.getStatus());
  75 + }
  76 + }, {enableHighAccuracy: true});
  77 +
  78 + // 点搜索按钮时解析地址坐标
  79 + $(document).on('click', '.btn-search', function () {
  80 + // 创建地址解析器实例
  81 + var myGeo = new BMap.Geocoder();
  82 + // 将地址解析结果显示在地图上,并调整地图视野
  83 + myGeo.getPoint($("#searchaddress").val(), function (point) {
  84 + if (point) {
  85 + map.centerAndZoom(point, 16);
  86 + map.addOverlay(new BMap.Marker(point));
  87 + } else {
  88 + Layer.alert("您选择地址没有解析到结果!");
  89 + }
  90 + });
  91 + });
  92 +
  93 + });
  94 + },
  95 + api: {
  96 + bindevent: function () {
  97 + Form.api.bindevent($("form[role=form]"));
  98 + }
  99 + }
  100 + };
  101 + return Controller;
  102 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/bootstraptable/index',
  9 + add_url: '',
  10 + edit_url: '',
  11 + del_url: 'example/bootstraptable/del',
  12 + multi_url: '',
  13 + }
  14 + });
  15 +
  16 + var table = $("#table");
  17 +
  18 + //在普通搜索提交搜索前
  19 + table.on('common-search.bs.table', function (event, table, query) {
  20 + //这里可以获取到普通搜索表单中字段的查询条件
  21 + console.log(query);
  22 + });
  23 +
  24 + //在普通搜索渲染后
  25 + table.on('post-common-search.bs.table', function (event, table) {
  26 + var form = $("form", table.$commonsearch);
  27 + $("input[name='title']", form).addClass("selectpage").data("source", "auth/adminlog/selectpage").data("primaryKey", "title").data("field", "title").data("orderBy", "id desc");
  28 + $("input[name='username']", form).addClass("selectpage").data("source", "auth/admin/index").data("primaryKey", "username").data("field", "username").data("orderBy", "id desc");
  29 + Form.events.cxselect(form);
  30 + Form.events.selectpage(form);
  31 + });
  32 +
  33 + //在表格内容渲染完成后回调的事件
  34 + table.on('post-body.bs.table', function (e, settings, json, xhr) {
  35 + console.log(e, settings, json, xhr);
  36 + });
  37 +
  38 + //当表格数据加载完成时
  39 + table.on('load-success.bs.table', function (e, data) {
  40 + //这里可以获取从服务端获取的JSON数据
  41 + console.log(data);
  42 + //这里我们手动设置底部的值
  43 + $("#money").text(data.extend.money);
  44 + $("#price").text(data.extend.price);
  45 + });
  46 +
  47 + // 初始化表格
  48 + // 这里使用的是Bootstrap-table插件渲染表格
  49 + // 相关文档:http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/
  50 + table.bootstrapTable({
  51 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  52 + columns: [
  53 + [
  54 + //更多配置参数可参考http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/#c
  55 + //该列为复选框字段,如果后台的返回state值将会默认选中
  56 + {field: 'state', checkbox: true,},
  57 + //sortable为是否排序,operate为搜索时的操作符,visible表示是否可见
  58 + {field: 'id', title: 'ID', sortable: true, operate: false},
  59 + //默认隐藏该列
  60 + {field: 'admin_id', title: __('管理员'), operate: false},
  61 + //直接响应搜索
  62 + {field: 'username', title: __('管理员'), formatter: Table.api.formatter.search},
  63 + //模糊搜索
  64 + {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索,*表示任意字符'},
  65 + //通过Ajax渲染searchList,也可以使用JSON数据
  66 + {
  67 + field: 'url',
  68 + title: __('Url'),
  69 + align: 'left',
  70 + searchList: $.getJSON('example/bootstraptable/searchlist?search=a&field=row[user_id]'),
  71 + formatter: Controller.api.formatter.url
  72 + },
  73 + //点击IP时同时执行搜索此IP
  74 + {
  75 + field: 'ip',
  76 + title: __('IP'),
  77 + events: Controller.api.events.ip,
  78 + formatter: Controller.api.formatter.ip
  79 + },
  80 + //自定义栏位,custom是不存在的字段
  81 + {field: 'custom', title: __('切换'), operate: false, formatter: Controller.api.formatter.custom},
  82 + //browser是一个不存在的字段
  83 + //通过formatter来渲染数据,同时为它添加上事件
  84 + {
  85 + field: 'browser',
  86 + title: __('Browser'),
  87 + operate: false,
  88 + events: Controller.api.events.browser,
  89 + formatter: Controller.api.formatter.browser
  90 + },
  91 + {
  92 + field: 'admin_id', title: __('联动搜索'), searchList: function (column) {
  93 + return Template('categorytpl', {});
  94 + }
  95 + },
  96 + //启用时间段搜索
  97 + {
  98 + field: 'createtime',
  99 + title: __('Update time'),
  100 + sortable: true,
  101 + formatter: Table.api.formatter.datetime,
  102 + operate: 'RANGE',
  103 + addclass: 'datetimerange'
  104 + },
  105 + //操作栏,默认有编辑、删除或排序按钮,可自定义配置buttons来扩展按钮
  106 + {
  107 + field: 'operate',
  108 + width: "120px",
  109 + title: __('Operate'),
  110 + table: table,
  111 + events: Table.api.events.operate,
  112 + buttons: [
  113 + {
  114 + name: 'detail',
  115 + title: __('弹出窗口打开'),
  116 + classname: 'btn btn-xs btn-primary btn-dialog',
  117 + icon: 'fa fa-list',
  118 + url: 'example/bootstraptable/detail',
  119 + callback: function (data) {
  120 + Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
  121 + }
  122 + },
  123 + {
  124 + name: 'ajax',
  125 + title: __('发送Ajax'),
  126 + classname: 'btn btn-xs btn-success btn-magic btn-ajax',
  127 + icon: 'fa fa-magic',
  128 + url: 'example/bootstraptable/detail',
  129 + success: function (data, ret) {
  130 + Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
  131 + //如果需要阻止成功提示,则必须使用return false;
  132 + //return false;
  133 + },
  134 + error: function (data, ret) {
  135 + console.log(data, ret);
  136 + Layer.alert(ret.msg);
  137 + return false;
  138 + }
  139 + },
  140 + {
  141 + name: 'addtabs',
  142 + title: __('新选项卡中打开'),
  143 + classname: 'btn btn-xs btn-warning btn-addtabs',
  144 + icon: 'fa fa-folder-o',
  145 + url: 'example/bootstraptable/detail'
  146 + }
  147 + ],
  148 + formatter: Table.api.formatter.operate
  149 + },
  150 + ],
  151 + ],
  152 + //更多配置参数可参考http://bootstrap-table.wenzhixin.net.cn/zh-cn/documentation/#t
  153 + //亦可以参考require-table.js中defaults的配置
  154 + //禁用默认搜索
  155 + search: false,
  156 + //启用普通表单搜索
  157 + commonSearch: true,
  158 + //可以控制是否默认显示搜索单表,false则隐藏,默认为false
  159 + searchFormVisible: true,
  160 + queryParams: function (params) {
  161 + //这里可以追加搜索条件
  162 + var filter = JSON.parse(params.filter);
  163 + var op = JSON.parse(params.op);
  164 + //这里可以动态赋值,比如从URL中获取admin_id的值,filter.admin_id=Fast.api.query('admin_id');
  165 + filter.admin_id = 1;
  166 + op.admin_id = "=";
  167 + params.filter = JSON.stringify(filter);
  168 + params.op = JSON.stringify(op);
  169 + return params;
  170 + },
  171 + });
  172 +
  173 + // 为表格绑定事件
  174 + Table.api.bindevent(table);
  175 +
  176 + // 监听下拉列表改变的事件
  177 + $(document).on('change', 'select[name=admin]', function () {
  178 + $("input[name='admin_id']").val($(this).val());
  179 + });
  180 +
  181 + // 指定搜索条件
  182 + $(document).on("click", ".btn-singlesearch", function () {
  183 + var options = table.bootstrapTable('getOptions');
  184 + var queryParams = options.queryParams;
  185 + options.pageNumber = 1;
  186 + options.queryParams = function (params) {
  187 + //这一行必须要存在,否则在点击下一页时会丢失搜索栏数据
  188 + params = queryParams(params);
  189 +
  190 + //如果希望追加搜索条件,可使用
  191 + var filter = params.filter ? JSON.parse(params.filter) : {};
  192 + var op = params.op ? JSON.parse(params.op) : {};
  193 + filter.url = 'login';
  194 + op.url = 'like';
  195 + params.filter = JSON.stringify(filter);
  196 + params.op = JSON.stringify(op);
  197 +
  198 + //如果希望忽略搜索栏搜索条件,可使用
  199 + //params.filter = JSON.stringify({url: 'login'});
  200 + //params.op = JSON.stringify({url: 'like'});
  201 + return params;
  202 + };
  203 + table.bootstrapTable('refresh', {});
  204 + Toastr.info("当前执行的是自定义搜索,搜索URL中包含login的数据");
  205 + return false;
  206 + });
  207 +
  208 + // 获取选中项
  209 + $(document).on("click", ".btn-selected", function () {
  210 + Layer.alert(JSON.stringify(table.bootstrapTable('getSelections')));
  211 + });
  212 +
  213 + // 启动和暂停按钮
  214 + $(document).on("click", ".btn-start,.btn-pause", function () {
  215 + //在table外不可以使用添加.btn-change的方法
  216 + //只能自己调用Table.api.multi实现
  217 + //如果操作全部则ids可以置为空
  218 + var ids = Table.api.selectedids(table);
  219 + Table.api.multi("changestatus", ids.join(","), table, this);
  220 + });
  221 +
  222 + },
  223 + add: function () {
  224 + Controller.api.bindevent();
  225 + },
  226 + edit: function () {
  227 + Controller.api.bindevent();
  228 + },
  229 + detail: function () {
  230 + $(document).on('click', '.btn-callback', function () {
  231 + Fast.api.close($("input[name=callback]").val());
  232 + });
  233 + },
  234 + api: {
  235 + bindevent: function () {
  236 + Form.api.bindevent($("form[role=form]"));
  237 + },
  238 + formatter: {//渲染的方法
  239 + url: function (value, row, index) {
  240 + return '<div class="input-group input-group-sm" style="width:250px;"><input type="text" class="form-control input-sm" value="' + value + '"><span class="input-group-btn input-group-sm"><a href="' + value + '" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>';
  241 + },
  242 + ip: function (value, row, index) {
  243 + return '<a class="btn btn-xs btn-ip bg-success"><i class="fa fa-map-marker"></i> ' + value + '</a>';
  244 + },
  245 + browser: function (value, row, index) {
  246 + //这里我们直接使用row的数据
  247 + return '<a class="btn btn-xs btn-browser">' + row.useragent.split(" ")[0] + '</a>';
  248 + },
  249 + custom: function (value, row, index) {
  250 + //添加上btn-change可以自定义请求的URL进行数据处理
  251 + return '<a class="btn-change text-success" data-url="example/bootstraptable/change" data-id="' + row.id + '"><i class="fa ' + (row.title == '' ? 'fa-toggle-off' : 'fa-toggle-on') + ' fa-2x"></i></a>';
  252 + },
  253 + },
  254 + events: {//绑定事件的方法
  255 + ip: {
  256 + //格式为:方法名+空格+DOM元素
  257 + 'click .btn-ip': function (e, value, row, index) {
  258 + e.stopPropagation();
  259 + console.log();
  260 + var container = $("#table").data("bootstrap.table").$container;
  261 + var options = $("#table").bootstrapTable('getOptions');
  262 + //这里我们手动将数据填充到表单然后提交
  263 + $("form.form-commonsearch [name='ip']", container).val(value);
  264 + $("form.form-commonsearch", container).trigger('submit');
  265 + Toastr.info("执行了自定义搜索操作");
  266 + }
  267 + },
  268 + browser: {
  269 + 'click .btn-browser': function (e, value, row, index) {
  270 + e.stopPropagation();
  271 + Layer.alert("该行数据为: <code>" + JSON.stringify(row) + "</code>");
  272 + }
  273 + },
  274 + }
  275 + }
  276 + };
  277 + return Controller;
  278 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/colorbadge/index',
  9 + add_url: '',
  10 + edit_url: '',
  11 + del_url: 'example/colorbadge/del',
  12 + multi_url: '',
  13 + }
  14 + });
  15 +
  16 + var table = $("#table");
  17 +
  18 + // 初始化表格
  19 + table.bootstrapTable({
  20 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  21 + columns: [
  22 + [
  23 + {field: 'state', checkbox: true, },
  24 + {field: 'id', title: 'ID'},
  25 + {field: 'title', title: __('Title')},
  26 + {field: 'ip', title: __('IP')},
  27 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  28 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  29 + ]
  30 + ],
  31 + onLoadSuccess: function (data) {
  32 + // 在表格第次加载成功后,刷新左侧菜单栏彩色小角标,支持一次渲染多个
  33 + // 如果需要在进入后台即显示左侧的彩色小角标,请使用服务端渲染方式,详情修改application/admin/controller/Index.php
  34 + Backend.api.sidebar({
  35 + 'example/colorbadge': data.total
  36 + });
  37 + Toastr.info("左侧角标已经刷新成功");
  38 + }
  39 + });
  40 +
  41 + // 为表格绑定事件
  42 + Table.api.bindevent(table);
  43 + },
  44 + add: function () {
  45 + Form.api.bindevent($("form[role=form]"));
  46 + },
  47 + edit: function () {
  48 + Form.api.bindevent($("form[role=form]"));
  49 + }
  50 + };
  51 + return Controller;
  52 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/controllerjump/index',
  9 + add_url: '',
  10 + edit_url: '',
  11 + del_url: 'example/controllerjump/del',
  12 + multi_url: '',
  13 + }
  14 + });
  15 +
  16 + var table = $("#table");
  17 +
  18 + // 初始化表格
  19 + table.bootstrapTable({
  20 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  21 + columns: [
  22 + [
  23 + {field: 'state', checkbox: true, },
  24 + {field: 'id', title: 'ID'},
  25 + {field: 'admin_id', title: __('Admin_id')},
  26 + {field: 'title', title: __('Title')},
  27 + {field: 'ip', title: __('IP'), formatter: Controller.api.formatter.ip},
  28 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  29 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  30 + ]
  31 + ]
  32 + });
  33 +
  34 + // 为表格绑定事件
  35 + Table.api.bindevent(table);
  36 + },
  37 + add: function () {
  38 + Form.api.bindevent($("form[role=form]"));
  39 + },
  40 + edit: function () {
  41 + Form.api.bindevent($("form[role=form]"));
  42 + },
  43 + api: {
  44 + formatter: {
  45 + ip: function (value, row, index) {
  46 + //这里手动构造URL
  47 + url = "example/bootstraptable?" + this.field + "=" + value;
  48 +
  49 + //方式一,直接返回class带有addtabsit的链接,这可以方便自定义显示内容
  50 + return '<a href="' + url + '" class="label label-success addtabsit" title="' + __("Search %s", value) + '">' + __('Search %s', value) + '</a>';
  51 +
  52 + //方式二,直接调用Table.api.formatter.addtabs
  53 + return Table.api.formatter.addtabs(value, row, index, url);
  54 + }
  55 + }
  56 + }
  57 + };
  58 + return Controller;
  59 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 + var Controller = {
  3 + index: function () {
  4 + //
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/customsearch/index',
  9 + add_url: 'example/customsearch/add',
  10 + edit_url: 'example/customsearch/edit',
  11 + del_url: 'example/customsearch/del',
  12 + multi_url: 'example/customsearch/multi',
  13 + table: '',
  14 + }
  15 + });
  16 +
  17 + var table = $("#table");
  18 +
  19 + // 初始化表格
  20 + table.bootstrapTable({
  21 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  22 + pk: 'id',
  23 + sortName: 'id',
  24 + searchFormVisible: true,
  25 + searchFormTemplate: 'customformtpl',
  26 + columns: [
  27 + [
  28 + {checkbox: true},
  29 + {field: 'id', title: 'ID', operate: false},
  30 + {field: 'admin_id', title: __('Admin_id'), visible: false, operate: false},
  31 + {field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
  32 + {field: 'title', title: __('Title')},
  33 + {field: 'url', title: __('Url'), align: 'left'},
  34 + {field: 'ip', title: __('IP')},
  35 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  36 + {
  37 + field: 'operate',
  38 + title: __('Operate'),
  39 + table: table,
  40 + events: Table.api.events.operate,
  41 + formatter: Table.api.formatter.operate
  42 + }
  43 + ]
  44 + ]
  45 + });
  46 +
  47 + // 为表格绑定事件
  48 + Table.api.bindevent(table);
  49 + },
  50 + add: function () {
  51 + Controller.api.bindevent();
  52 + },
  53 + edit: function () {
  54 + Controller.api.bindevent();
  55 + },
  56 + api: {
  57 + bindevent: function () {
  58 + Form.api.bindevent($("form[role=form]"));
  59 + }
  60 + }
  61 + };
  62 + return Controller;
  63 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + $("#cxselect-example .col-xs-12").each(function () {
  6 + $("textarea", this).val($(this).prev().prev().html().replace(/[ ]{2}/g, ''));
  7 + });
  8 +
  9 + //这里需要手动为Form绑定上元素事件
  10 + Form.api.bindevent($("form#cxselectform"));
  11 + }
  12 + };
  13 + return Controller;
  14 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init();
  7 +
  8 + //绑定事件
  9 + $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  10 + var panel = $($(this).attr("href"));
  11 + if (panel.size() > 0) {
  12 + Controller.table[panel.attr("id")].call(this);
  13 + $(this).on('click', function (e) {
  14 + $($(this).attr("href")).find(".btn-refresh").trigger("click");
  15 + });
  16 + }
  17 + //移除绑定的事件
  18 + $(this).unbind('shown.bs.tab');
  19 + });
  20 +
  21 + //必须默认触发shown.bs.tab事件
  22 + $('ul.nav-tabs li.active a[data-toggle="tab"]').trigger("shown.bs.tab");
  23 + },
  24 + table: {
  25 + first: function () {
  26 + // 表格1
  27 + var table1 = $("#table1");
  28 + table1.bootstrapTable({
  29 + url: 'example/multitable/table1',
  30 + toolbar: '#toolbar1',
  31 + sortName: 'id',
  32 + search: false,
  33 + columns: [
  34 + [
  35 + {field: 'state', checkbox: true, },
  36 + {field: 'id', title: 'ID'},
  37 + {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
  38 + {field: 'imagewidth', title: __('Imagewidth')},
  39 + {field: 'imageheight', title: __('Imageheight')},
  40 + {field: 'mimetype', title: __('Mimetype')},
  41 + {field: 'operate', title: __('Operate'), table: table1, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  42 + ]
  43 + ]
  44 + });
  45 +
  46 + // 为表格1绑定事件
  47 + Table.api.bindevent(table1);
  48 + },
  49 + second: function () {
  50 + // 表格2
  51 + var table2 = $("#table2");
  52 + table2.bootstrapTable({
  53 + url: 'example/multitable/table2',
  54 + extend: {
  55 + index_url: '',
  56 + add_url: '',
  57 + edit_url: '',
  58 + del_url: '',
  59 + multi_url: '',
  60 + table: '',
  61 + },
  62 + toolbar: '#toolbar2',
  63 + sortName: 'id',
  64 + search: false,
  65 + columns: [
  66 + [
  67 + {field: 'id', title: 'ID'},
  68 + {field: 'title', title: __('Title')},
  69 + {field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url},
  70 + {field: 'ip', title: __('ip')},
  71 + {field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  72 + ]
  73 + ]
  74 + });
  75 +
  76 + // 为表格2绑定事件
  77 + Table.api.bindevent(table2);
  78 + }
  79 + },
  80 + add: function () {
  81 + Controller.api.bindevent();
  82 + },
  83 + edit: function () {
  84 + Controller.api.bindevent();
  85 + },
  86 + api: {
  87 + bindevent: function () {
  88 + Form.api.bindevent($("form[role=form]"));
  89 + },
  90 + }
  91 + };
  92 + return Controller;
  93 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/relationmodel/index',
  9 + add_url: '',
  10 + edit_url: '',
  11 + del_url: 'example/relationmodel/del',
  12 + multi_url: '',
  13 + }
  14 + });
  15 +
  16 + var table = $("#table");
  17 +
  18 + // 初始化表格
  19 + table.bootstrapTable({
  20 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  21 + columns: [
  22 + [
  23 + {field: 'state', checkbox: true, },
  24 + {field: 'id', title: 'ID', operate: '='},
  25 + {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'},
  26 + {field: 'admin.avatar', title: __('Avatar'), operate: false, formatter: Table.api.formatter.image},
  27 + {field: 'admin.username', title: __('Username'), operate: '='},
  28 + {field: 'admin.nickname', title: __('Nickname'), operate: 'LIKE %...%', placeholder: '关键字,模糊搜索'},
  29 + {field: 'ip', title: __('IP'), operate: '='},
  30 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  31 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  32 + ]
  33 + ],
  34 + });
  35 +
  36 + // 为表格绑定事件
  37 + Table.api.bindevent(table);
  38 + },
  39 + add: function () {
  40 + Form.api.bindevent($("form[role=form]"));
  41 + },
  42 + edit: function () {
  43 + Form.api.bindevent($("form[role=form]"));
  44 + },
  45 + };
  46 + return Controller;
  47 +});
  1 +define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
  2 +
  3 + var Controller = {
  4 + index: function () {
  5 + // 初始化表格参数配置
  6 + Table.api.init({
  7 + extend: {
  8 + index_url: 'example/tabletemplate/index',
  9 + add_url: '',
  10 + edit_url: '',
  11 + del_url: 'example/tabletemplate/del',
  12 + multi_url: '',
  13 + }
  14 + });
  15 +
  16 + var table = $("#table");
  17 +
  18 + Template.helper("Moment", Moment);
  19 +
  20 + // 初始化表格
  21 + table.bootstrapTable({
  22 + url: $.fn.bootstrapTable.defaults.extend.index_url,
  23 + templateView: true,
  24 + columns: [
  25 + [
  26 + {field: 'state', checkbox: true, },
  27 + {field: 'id', title: 'ID', operate: false},
  28 + //直接响应搜索
  29 + {field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
  30 + //模糊搜索
  31 + {field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索,*表示任意字符', style: 'width:200px'},
  32 + //通过Ajax渲染searchList
  33 + {field: 'url', title: __('Url'), align: 'left', formatter: Controller.api.formatter.url},
  34 + //点击IP时同时执行搜索此IP,同时普通搜索使用下拉列表的形式
  35 + {field: 'ip', title: __('IP'), searchList: ['127.0.0.1', '127.0.0.2'], events: Controller.api.events.ip, formatter: Controller.api.formatter.ip},
  36 + //browser是一个不存在的字段
  37 + //通过formatter来渲染数据,同时为它添加上事件
  38 + {field: 'browser', title: __('Browser'), operate: false, events: Controller.api.events.browser, formatter: Controller.api.formatter.browser},
  39 + //启用时间段搜索
  40 + {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
  41 + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  42 + ],
  43 + ],
  44 + //禁用默认搜索
  45 + search: false,
  46 + //启用普通表单搜索
  47 + commonSearch: false,
  48 + //可以控制是否默认显示搜索单表,false则隐藏,默认为false
  49 + searchFormVisible: false,
  50 + //分页大小
  51 + pageSize: 12
  52 + });
  53 +
  54 + // 为表格绑定事件
  55 + Table.api.bindevent(table);
  56 +
  57 + //指定搜索条件
  58 + $(document).on("click", ".btn-toggle-view", function () {
  59 + var options = table.bootstrapTable('getOptions');
  60 + table.bootstrapTable('refreshOptions', {templateView: !options.templateView});
  61 + });
  62 +
  63 + //点击详情
  64 + $(document).on("click", ".btn-detail[data-id]", function () {
  65 + Backend.api.open('example/bootstraptable/detail/ids/' + $(this).data('id'), __('Detail'));
  66 + });
  67 +
  68 + //获取选中项
  69 + $(document).on("click", ".btn-selected", function () {
  70 + //在templateView的模式下不能调用table.bootstrapTable('getSelections')来获取选中的ID,只能通过下面的Table.api.selectedids来获取
  71 + Layer.alert(JSON.stringify(Table.api.selectedids(table)));
  72 + });
  73 + },
  74 + add: function () {
  75 + Controller.api.bindevent();
  76 + },
  77 + edit: function () {
  78 + Controller.api.bindevent();
  79 + },
  80 + api: {
  81 + bindevent: function () {
  82 + Form.api.bindevent($("form[role=form]"));
  83 + },
  84 + formatter: {
  85 + url: function (value, row, index) {
  86 + return '<div class="input-group input-group-sm" style="width:250px;"><input type="text" class="form-control input-sm" value="' + value + '"><span class="input-group-btn input-group-sm"><a href="' + value + '" target="_blank" class="btn btn-default btn-sm"><i class="fa fa-link"></i></a></span></div>';
  87 + },
  88 + ip: function (value, row, index) {
  89 + return '<a class="btn btn-xs btn-ip bg-success"><i class="fa fa-map-marker"></i> ' + value + '</a>';
  90 + },
  91 + browser: function (value, row, index) {
  92 + //这里我们直接使用row的数据
  93 + return '<a class="btn btn-xs btn-browser">' + row.useragent.split(" ")[0] + '</a>';
  94 + }
  95 + },
  96 + events: {
  97 + ip: {
  98 + 'click .btn-ip': function (e, value, row, index) {
  99 + var options = $("#table").bootstrapTable('getOptions');
  100 + //这里我们手动将数据填充到表单然后提交
  101 + $("#commonSearchContent_" + options.idTable + " form [name='ip']").val(value);
  102 + $("#commonSearchContent_" + options.idTable + " form").trigger('submit');
  103 + Toastr.info("执行了自定义搜索操作");
  104 + }
  105 + },
  106 + browser: {
  107 + 'click .btn-browser': function (e, value, row, index) {
  108 + Layer.alert("该行数据为: <code>" + JSON.stringify(row) + "</code>");
  109 + }
  110 + }
  111 + }
  112 + }
  113 + };
  114 + return Controller;
  115 +});
  1 +<!-- Page Content -->
  2 + <div class="container">
  3 +
  4 + <!-- Page Heading/Breadcrumbs -->
  5 + <div class="row">
  6 + <div class="col-lg-12">
  7 + <h1 class="page-header">无需登录页面
  8 + <small>开发者示例</small>
  9 + </h1>
  10 + <ol class="breadcrumb">
  11 + <li><a href="{:addon_url('example/index/index')}">插件首页</a>
  12 + </li>
  13 + <li class="active">无需登录页面</li>
  14 + </ol>
  15 + </div>
  16 + </div>
  17 + <!-- /.row -->
  18 +
  19 + <!-- Content Row -->
  20 + <div class="row">
  21 + <div class="col-lg-12">
  22 + <p class="well">当前登录页面无需登录即可查看,当前请求的name值为:{$Request.param.name}</p>
  23 + {if $user}
  24 + <p class="well text-danger">但是如果你登录后可以浏览到这段隐藏的信息</p>
  25 + {/if}
  26 + </div>
  27 + </div>
  28 + <!-- /.row -->
  29 +
  30 + <hr>
  31 +
  32 + </div>
  33 + <!-- /.container -->
  1 +<!-- Page Content -->
  2 +<div class="container">
  3 +
  4 + <!-- Page Heading/Breadcrumbs -->
  5 + <div class="row">
  6 + <div class="col-lg-12">
  7 + <h1 class="page-header">需登录页面
  8 + <small>开发者示例</small>
  9 + </h1>
  10 + <ol class="breadcrumb">
  11 + <li><a href="{:addon_url('example/index/index')}">插件首页</a>
  12 + </li>
  13 + <li class="active">需登录页面</li>
  14 + </ol>
  15 + </div>
  16 + </div>
  17 + <!-- /.row -->
  18 +
  19 + <!-- Content Row -->
  20 + <div class="row">
  21 + <div class="col-lg-12">
  22 + <p class="well">当前登录页面需要登录后才可以查看,你可以退出后再访问此页面,会提醒登录,当前请求的name值为:{$Request.param.name}</p>
  23 + <p class="well">你好!{$user.nickname},<a href="{:url('index/user/logout')}">注销登录</a></p>
  24 + </div>
  25 + </div>
  26 + <!-- /.row -->
  27 +
  28 + <hr>
  29 +
  30 +</div>
  31 +<!-- /.container -->