root před 2 roky
rodič
revize
0ab5f99f23
4 změnil soubory, kde provedl 2 přidání a 611 odebrání
  1. 2 0
      app.html
  2. 0 49
      headertest.html
  3. 0 211
      login.htmlback
  4. 0 351
      testapp.html

+ 2 - 0
app.html

@@ -163,6 +163,8 @@
                 });
             });
           },
+        
+       
           updateLocation: (location, replace) => {
             location = normalizeLink(location);
             if (location === 'goBack') {

+ 0 - 49
headertest.html

@@ -1,49 +0,0 @@
-{
-    "type": "page",
-    "initApi": "/api/sys_user_info",
-    "body": [
-      {
-        "type": "flex",
-        "justify": "flex-end",
-        "items": [
-          {
-            "size": 30,
-            "type": "avatar",
-            "fit": "contain",
-            "src": "${avatar}",
-            "id": "u:20b0d53266be"
-          },
-          {
-            "type": "dropdown-button",
-            "label": "名字e",
-            "className": "header-menu",
-            "buttons": [
-              {
-                "type": "button",
-                "label": "个人信息",
-                "actionType": "link",
-                "link": "/view/user_info",
-                "id": "u:a3011c84be15"
-              },
-              {
-                "type": "button",
-                "actionType": "url",
-                "url": "/login/out",
-                "blank": false,
-                "confirmText": "确定要退出吗",
-                "label": "退出登录",
-                "id": "u:4e435f2c13f9"
-              }
-            ],
-            "id": "u:a4b02d9f8f31",
-            "size": "md",
-            "level": "default",
-            "align": "right",
-            "block": true
-          }
-        ],
-        "id": "u:e7752d0c1dbe"
-      }
-    ],
-    "id": "u:d16525b6aae6"
-  }

+ 0 - 211
login.htmlback

@@ -1,211 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh">
-<head>
-    <meta charset="UTF-8" />
-    <title>登录</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <link rel="icon" type="image/x-ico" href=""/>
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
-    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
-    <link rel="stylesheet" href="./public/static/amis-sdk/helper.css">
-
-    <link rel="stylesheet" href="./public/static/amis-sdk/sdk.css">
-    <style>
-        html,
-        body,
-        .app-wrapper {
-            /* position: relative; */
-            width: 100%;
-            height: 100%;
-            margin: 0;
-            padding: 0;
-            touch-action: pan-y;
-            overflow: hidden;
-        }
-        :root {
-            --Form-item-gap: 1.3rem;
-            --InputGroup-height: 2.5rem;
-            --Button-height: 2.5rem;
-            --InputGroup-paddingX: .6rem;
-            --InputGroup-addOn-bg: var(--Form-input-bg);
-            /* --fontSizeBase: .9rem; */
-        }
-
-        .app-wrapper {
-            /* position: relative; */
-            width: 100%;
-            height: 100%;
-            margin: 0;
-            padding: 0;
-        }
-
-        .amis-scope .cxd-Icon{height: 1rem}
-        .amis-scope .cxd-TextControl-input input{height: 100% !important;}
-        .amis-scope .cxd-TextControl-input:hover{border:var(--Form-input-borderWidth) solid var(--Form-input-borderColor)}
-        .amis-scope .cxd-InputGroup .cxd-TextControl-input{border-left-width: 0;padding-left: 0;}
-        .code_img{cursor: pointer;}
-
-        .amis-scope .cxd-Form{
-            font-size: var(--Form-fontSize);
-            position: none !important;
-            max-width: 700px;
-            margin: 0 auto;
-            margin-top: 10vh;
-            /* position:; */
-        }
-        .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
-            width: 100%;
-            height: 100%;
-        }
-        .change-language {
-            float: right;
-        }
-        .amis-scope h1 {
-            font-size: 5vw;
-        }
-        @media (max-width: 768px) {
-            .amis-scope .cxd-Form{
-                font-size: var(--Form-fontSize);
-                position: none !important;
-                margin: 0 auto;
-                margin-top: 0vh;
-                /* position:; */
-            }
-            .amis-scope .cxd-Wrapper--md, .amis-scope .cxd-Container--md {
-                padding: 0;
-            }
-        }
-    </style>
-</head>
-<body>
-<div id="root" class="app-wrapper"></div>
-<script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
-
-<script type="text/javascript">
-    (function () {
-        let amis = amisRequire('amis/embed');
-
-        const amisJSON = {
-            "type": "wrapper",
-            "className": "fixed login_layout m:h-screen m:w-full bg-gray-50",
-            "body": {
-                "type": "form",
-                "className": "h-full pc:p-9 m:p-4 m:pt-20",
-                "api": {
-                    "method":"post",
-                    "url":"/login",
-                    "adaptor": function (data) {
-                        if (data.status !== 0) {
-                            // 登录请求提交后,刷新验证码
-                            refresh_code();
-                        }
-                        return data;
-                    },
-                },
-                "redirect": "/",
-                "wrapWithPanel": false,
-                "body": [
-                    {
-                        "type":"html",
-                        "className":"text-center",
-                        "html":"<img class='change-language' src='./public/static/icon/shield-user-line.svg'/>"
-                    },
-                    {
-                        "type":"html",
-                        "className":"text-center",
-                        "html":"<h1 class='title-name'>Roma管理后台</h1>"
-                    },
-                    {
-                        "type": "input-group",
-                        "label": "",
-                        "body": [
-                            {
-                                "type": "icon",
-                                "icon": "./public/static/icon/shield-user-line.svg"
-                            },
-                            {
-                                "type": "input-text",
-                                "label": false,
-                                "placeholder": "用户名",
-                                "name": "name",
-                                "required": true
-                            }
-                        ]
-                    },
-                    {
-                        "type": "input-group",
-                        "label": "",
-                        "body": [
-                            {
-                                "type": "icon",
-                                "icon": "./public/static/icon/lock-password-line.svg",
-                            },
-                            {
-                                "type": "input-password",
-                                "label": false,
-                                "placeholder": "密码",
-                                "name": "pwd",
-                                "required": true
-                            }
-                        ]
-                    },
-                    {
-                        "type": "input-group",
-                        "label": "",
-                        "body": [
-                            {
-                                "type": "icon",
-                                "icon": "./public/static/icon/shield-check-line.svg"
-                            },
-                            {
-                                "type": "input-text",
-                                "label": false,
-                                "placeholder": "验证码",
-                                "name": "code",
-                                "required": true
-                            },
-                            {
-                                "type": "action",
-                                "body": {
-                                    "type": "image",
-                                "height": "38px",
-                                "width": "110px",
-                                "name":"codeUrl",
-                                "imageClassName":"code_img b-none",
-                                "imageMode":"original",
-                                "src": "/login/verify"
-                                },
-                                // 点击图片 刷新二维码
-                                "onClick": "refresh_code()"
-                            }
-                        ]
-                    },
-                    {
-                        "label": "登 录",
-                        "type": "action",
-                        "actionType": "submit",
-                        "level": "primary",
-                        "className":"w-full h-2.5",
-                    },
-                    // {
-                    //     "type":"html",
-                    //     "className":"text-center",
-                    //     "html":"<p class='mt-10 text-gray-600'>Roma平台</p>"
-                    // },
-                ]
-
-            }
-
-        };
-
-        let amisScoped = amis.embed('#root', amisJSON);
-    })();
-    // 刷新验证码
-    function refresh_code()
-    {
-        document.querySelector('.code_img').src = '/login/verify?' + Math.random();
-    }
-</script>
-</body>
-</html>
-

+ 0 - 351
testapp.html

@@ -1,351 +0,0 @@
-<!DOCTYPE html>
-<html lang="zh">
-<head>
-    <meta charset="UTF-8" />
-    <title>ROMA</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <link rel="icon" type="image/x-ico" href=""/>
-    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
-    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
-    <link rel="stylesheet" href="./public/static/amis-sdk/helper.css">
-
-    <link rel="stylesheet" href="./public/static/amis-sdk/sdk.css">
-    <link rel="stylesheet" href="./public/static/amis-sdk/iconfont.css">
-<link rel="stylesheet" href="./public/static/fonts/remixicon.css">
-    <style>
-        html,
-        body,
-        .app-wrapper {
-            position: relative;
-            width: 100%;
-            height: 100%;
-            margin: 0;
-            padding: 0;
-            touch-action: pan-y;
-        }
-        :root {
-            --Form-item-gap: 1.3rem;
-            --InputGroup-height: 2.5rem;
-            --Button-height: 2.5rem;
-            --InputGroup-paddingX: .6rem;
-            --InputGroup-addOn-bg: var(--Form-input-bg);
-            /* --fontSizeBase: .9rem; */
-        }
-        .app-wrapper {
-            position: relative;
-            width: 100%;
-            height: 100%;
-            margin: 0;
-            padding: 0;
-        }
-        .amis-scope .cxd-Layout--headerFixed .cxd-Layout-header .cxd-Page {
-          background: none;
-        }
-        .amis-scope .cxd-Page-body .cxd-DropDown--alignRight .cxd-DropDown-menu {
-          text-align: center;
-        }
-    </style>
-</head>
-<body>
-<div id="root" class="app-wrapper"></div>
-
-<script type='text/javascript' src='./public/static/amis-sdk/sdk.js'></script>
-<script type='text/javascript' src='./public/static/amis-static/history.js'></script>
-<script src="./lang/en-US.js"></script>
-<script src="./lang/zh-CN.js"></script>
-
-<script>
-  
-    (function () {
-      let amis = amisRequire('amis/embed');
-      const match = amisRequire('path-to-regexp').match;
-    
-      let enUSLocale = enUs()
-      let zhCNLocale = zhCn()
-      //多语言映射
-      const languageMap = {
-        "en-US": {
-          register: enUSLocale.register,
-          replaceText: enUSLocale.replaceText,
-          langReplaceTextIgnoreKeys: enUSLocale.langReplaceTextIgnoreKeys
-        },
-        "zh-CN": {
-          register: zhCNLocale.register,
-          replaceText: zhCNLocale.replaceText,
-          langReplaceTextIgnoreKeys: zhCNLocale.langReplaceTextIgnoreKeys
-        }
-      }
-      // 缓存中设置的语言
-      let lang = localStorage.getItem('language')
-      //内置组件的翻译信息
-      let langRegister = {}
-      //json配置的全文翻译信息
-      let langReplaceText = {}
-      //需要忽略json配置的全文替换key
-      let langReplaceTextIgnoreKeys = {}
-      if (undefined !== languageMap[lang]) {
-        langRegister = languageMap[lang].register
-        langReplaceText = languageMap[lang].replaceText
-        langReplaceTextIgnoreKeys = languageMap[lang].langReplaceTextIgnoreKeys
-      } else {
-        lang = 'zh-CN'
-      }
-      if (undefined !== langReplaceText && Object.keys(langReplaceText).length !== 0) {
-      } else {
-        langReplaceText = {}
-      }
-
-      if (undefined !== langReplaceTextIgnoreKeys && Object.keys(langReplaceTextIgnoreKeys).length !== 0) {
-      } else {
-        langReplaceTextIgnoreKeys = {}
-      }
-      
-
-
-      // 如果想用 browserHistory 请切换下这处代码, 其他不用变
-      // const history = History.createBrowserHistory();
-      const history = History.createHashHistory();
-      const header = {
-  "type": "page",
-  "initApi": "/api/sys_user_info",
-  "body": [
-    {
-      "type": "flex",
-      "justify": "flex-end",
-      "items": [
-        {
-          "type": "dropdown-button",
-          "label": "切换语言",
-          "className": "header-menu",
-          "buttons": [
-            {
-              "type": "button",
-              "label": "中文",
-              "id": "u:6911502c8fcc",
-              "onEvent": {
-                "click": {
-                  "actions": [
-                    {
-                      "script": "localStorage.setItem('language', 'zh-CN')\nlocation.reload()",
-                      "actionType": "custom",
-                      "args": {
-                      }
-                    }
-                  ],
-                  "weight": 0
-                }
-              }
-            },
-            {
-              "type": "button",
-              "label": "English",
-              "id": "u:e702685a7a45",
-              "onEvent": {
-                "click": {
-                  "actions": [
-                    {
-                      "script": "localStorage.setItem('language', 'en-US')\r\nlocation.reload()",
-                      "actionType": "custom"
-                    }
-                  ],
-                  "weight": 0
-                }
-              },
-              "actionType": "",
-              "link": "/view/user_info"
-            }
-          ],
-          "id": "u:4fedf7a987bf",
-          "size": "md",
-          "level": "default",
-          "align": "right",
-          "block": true,
-          "hideCaret": false
-        },
-        {
-          "type": "dropdown-button",
-          "label": "名字e",
-          "className": "header-menu",
-          "buttons": [
-            {
-              "type": "button",
-              "label": "个人信息",
-              "actionType": "link",
-              "link": "/view/user_info",
-              "id": "u:57cf3ed9c568"
-            },
-            {
-              "type": "button",
-              "actionType": "url",
-              "url": "/login/out",
-              "blank": false,
-              "confirmText": "确定要退出吗",
-              "label": "退出登录",
-              "id": "u:88d8afc464b5"
-            }
-          ],
-          "id": "u:d324269526b9",
-          "size": "md",
-          "level": "default",
-          "align": "right",
-          "block": true
-        }
-      ],
-      "id": "u:e7752d0c1dbe"
-    }
-  ],
-  "id": "u:d16525b6aae6"
-}
-      const app = {
-        type: 'app',
-        brandName: 'ROMA',
-        // logo: './public/static/images/logo.jpg',
-        
-        // footer: '<div class="p-2 text-center bg-light">底部区域</div>',
-        // asideBefore: '<div class="p-2 text-center">菜单前面区域</div>',
-        // asideAfter: '<div class="p-2 text-center">菜单后面区域</div>',
-        // // api: '/pages/site.json'
-        header,
-        api: 'http://172.20.118.83:8051/demomenu'
-      };
-
-      function normalizeLink(to, location = history.location) {
-        to = to || '';
-
-        if (to && to[0] === '#') {
-          to = location.pathname + location.search + to;
-        } else if (to && to[0] === '?') {
-          to = location.pathname + to;
-        }
-
-        const idx = to.indexOf('?');
-        const idx2 = to.indexOf('#');
-        let pathname = ~idx
-          ? to.substring(0, idx)
-          : ~idx2
-          ? to.substring(0, idx2)
-          : to;
-        let search = ~idx ? to.substring(idx, ~idx2 ? idx2 : undefined) : '';
-        let hash = ~idx2 ? to.substring(idx2) : location.hash;
-
-        if (!pathname) {
-          pathname = location.pathname;
-        } else if (pathname[0] != '/' && !/^https?\:\/\//.test(pathname)) {
-          let relativeBase = location.pathname;
-          const paths = relativeBase.split('/');
-          paths.pop();
-          let m;
-          while ((m = /^\.\.?\//.exec(pathname))) {
-            if (m[0] === '../') {
-              paths.pop();
-            }
-            pathname = pathname.substring(m[0].length);
-          }
-          pathname = paths.concat(pathname).join('/');
-        }
-
-        return pathname + search + hash;
-      }
-
-      function isCurrentUrl(to, ctx) {
-        if (!to) {
-          return false;
-        }
-        const pathname = history.location.pathname;
-        const link = normalizeLink(to, {
-          ...location,
-          pathname,
-          hash: ''
-        });
-
-        if (!~link.indexOf('http') && ~link.indexOf(':')) {
-          let strict = ctx && ctx.strict;
-          return match(link, {
-            decode: decodeURIComponent,
-            strict: typeof strict !== 'undefined' ? strict : true
-          })(pathname);
-        }
-
-        return decodeURI(pathname) === link;
-      }
-
-      let amisInstance = amis.embed(
-        '#root',
-        app,
-        {
-          location: history.location,
-          locale: lang
-        },
-        {
-          replaceText: langReplaceText,
-          langReplaceTextIgnoreKeys: langReplaceTextIgnoreKeys,
-
-          // watchRouteChange: fn => {
-          //   return history.listen(fn);
-          // },
-          updateLocation: (location, replace) => {
-            location = normalizeLink(location);
-            if (location === 'goBack') {
-              return history.goBack();
-            } else if (
-              (!/^https?\:\/\//.test(location) &&
-                location ===
-                  history.location.pathname + history.location.search) ||
-              location === history.location.href
-            ) {
-              // 目标地址和当前地址一样,不处理,免得重复刷新
-              return;
-            } else if (/^https?\:\/\//.test(location) || !history) {
-              return (window.location.href = location);
-            }
-
-            history[replace ? 'replace' : 'push'](location);
-          },
-          jumpTo: (to, action) => {
-            if (to === 'goBack') {
-              return history.goBack();
-            }
-
-            to = normalizeLink(to);
-
-            if (isCurrentUrl(to)) {
-              return;
-            }
-
-            if (action && action.actionType === 'url') {
-              action.blank === false
-                ? (window.location.href = to)
-                : window.open(to, '_blank');
-              return;
-            } else if (action && action.blank) {
-              window.open(to, '_blank');
-              return;
-            }
-
-            if (/^https?:\/\//.test(to)) {
-              window.location.href = to;
-            } else if (
-              (!/^https?\:\/\//.test(to) &&
-                to === history.pathname + history.location.search) ||
-              to === history.location.href
-            ) {
-              // do nothing
-            } else {
-              history.push(to);
-            }
-          },
-          isCurrentUrl: isCurrentUrl,
-          theme: 'cxd'
-        }
-      );
-
-      history.listen(state => {
-        amisInstance.updateProps({
-          location: state.location || state
-        });
-      });
-    })();
-  </script>
-</body>
-</html>
-