Просмотр исходного кода

【模版目录】更新管理端页面源码

吴昊天 3 лет назад
Родитель
Сommit
4fe5469a31

+ 11 - 0
template/admin/src/api/setting.js

@@ -1088,4 +1088,15 @@ export function saveType(type) {
     url: `setting/lang_country/form/${id}`,
     method: 'get',
   });
+}
+/**
+ * 添加语言地区表单
+ * @param {*} id 
+ * @returns 
+ */
+ export function langTypeStatus(id,status) {
+  return request({
+    url: `setting/lang_type/status/${id}/${status}`,
+    method: 'put',
+  });
 }

+ 60 - 59
template/admin/src/api/system.js

@@ -332,18 +332,19 @@ export function opendirListApi(params) {
     url: `system/file/opendir`,
     method: 'GET',
     params,
-	file_edit:true
+    file_edit: true,
   });
 }
 
 /**
  * @description 文件管理 -- 读取文件
  */
-export function openfileApi(filepath) {
+export function openfileApi(params) {
   return request({
-    url: `system/file/openfile?filepath=${filepath}`,
+    url: `system/file/openfile`,
     method: 'GET',
-	file_edit:true
+    params,
+    file_edit: true,
   });
 }
 
@@ -352,10 +353,10 @@ export function openfileApi(filepath) {
  */
 export function savefileApi(data) {
   return request({
-    url: `system/file/savefile`,
+    url: `system/file/savefile?fileToken=${data.fileToken}`,
     method: 'post',
     data,
-	file_edit:true
+    file_edit: true,
   });
 }
 /**
@@ -366,7 +367,7 @@ export function createFolder(params) {
     url: `system/file/createFolder`,
     method: 'GET',
     params,
-	file_edit:true
+    file_edit: true,
   });
 }
 /**
@@ -377,7 +378,7 @@ export function createFile(params) {
     url: `system/file/createFile`,
     method: 'GET',
     params,
-	file_edit:true
+    file_edit: true,
   });
 }
 /**
@@ -388,7 +389,7 @@ export function rename(params) {
     url: `system/file/rename`,
     method: 'GET',
     params,
-	file_edit:true
+    file_edit: true,
   });
 }
 /**
@@ -399,7 +400,7 @@ export function delFolder(params) {
     url: `system/file/delFolder`,
     method: 'GET',
     params,
-	file_edit:true
+    file_edit: true,
   });
 }
 
@@ -587,44 +588,44 @@ export function setAgreements(data, type) {
 }
 
 /**
-* @description 获取授权产品
-*/
+ * @description 获取授权产品
+ */
 export function crmebProduct(params) {
   return request({
-      url: 'crmeb_product',
-      method: 'get',
-      params
+    url: 'crmeb_product',
+    method: 'get',
+    params,
   });
 }
 
 /**
  * @description 获取授权订单
  */
- export function getVersion() {
+export function getVersion() {
   return request({
-      url: `setting/get_version`,
-      method: 'get',
+    url: `setting/get_version`,
+    method: 'get',
   });
 }
 
 /**
-* @description 获取版权
-*/
+ * @description 获取版权
+ */
 export function getCrmebCopyRight() {
   return request({
-      url: `copyright`,
-      method: 'get'
+    url: `copyright`,
+    method: 'get',
   });
 }
 
 /**
-* @description 保存版权
-*/
+ * @description 保存版权
+ */
 export function saveCrmebCopyRight(data) {
   return request({
-      url: `copyright`,
-      method: 'post',
-      data
+    url: `copyright`,
+    method: 'post',
+    data,
   });
 }
 
@@ -632,41 +633,41 @@ export function saveCrmebCopyRight(data) {
  * @description 升级包 -- 列表
  * @param data
  */
- export function upgradeListApi (params) {
+export function upgradeListApi(params) {
   return request({
-      url: '/system/upgrade/list',
-      method: 'get',
-      params
-  })
+    url: '/system/upgrade/list',
+    method: 'get',
+    params,
+  });
 }
 
 /**
-* @description 升级进度
-*/
+ * @description 升级进度
+ */
 export function upgradeProgressApi() {
   return request({
-      url: `/system/upgrade_progress`,
-      method: 'get'
+    url: `/system/upgrade_progress`,
+    method: 'get',
   });
 }
 
 /**
-* @description 升级协议
-*/
+ * @description 升级协议
+ */
 export function upgradeAgreementApi() {
   return request({
-      url: `/system/upgrade/agreement`,
-      method: 'get'
+    url: `/system/upgrade/agreement`,
+    method: 'get',
   });
 }
 
 /**
-* @description 升级状态
-*/
+ * @description 升级状态
+ */
 export function upgradeStatusApi() {
   return request({
-      url: `/system/upgrade_status`,
-      method: 'get'
+    url: `/system/upgrade_status`,
+    method: 'get',
   });
 }
 
@@ -674,31 +675,31 @@ export function upgradeStatusApi() {
  * @description 升级包 -- 升级记录
  * @param data
  */
- export function upgradeLogListApi (params) {
+export function upgradeLogListApi(params) {
   return request({
-      url: '/system/upgrade_log/list',
-      method: 'get',
-      params
-  })
+    url: '/system/upgrade_log/list',
+    method: 'get',
+    params,
+  });
 }
 
 /**
  * 导出备份文件
  */
- export function upgradeExportApi(id) {
+export function upgradeExportApi(id) {
   return request({
     url: `system/upgrade_export/${id}`,
     method: 'get',
-    responseType: 'blob'
+    responseType: 'blob',
   });
 }
 
 /**
  * @description 下载升级包
  */
- export function downloadApi(params) {
+export function downloadApi(params) {
   return request({
-    url: '/system/upgrade_download/'+params,
+    url: '/system/upgrade_download/' + params,
     method: 'POST',
   });
 }
@@ -707,10 +708,10 @@ export function upgradeStatusApi() {
  * @description 升级包 -- 可升级列表
  * @param data
  */
- export function upgradeableListApi (params) {
+export function upgradeableListApi(params) {
   return request({
-      url: '/system/upgradeable/list',
-      method: 'get',
-      params
-  })
-}
+    url: '/system/upgradeable/list',
+    method: 'get',
+    params,
+  });
+}

+ 12 - 8
template/admin/src/components/copyright/index.vue

@@ -3,11 +3,15 @@
     <div class="ivu-global-footer-links">
       <a :href="item.href" target="_blank" v-for="(item, index) in links" :key="index">{{ item.title }}</a>
     </div>
-    <div class="ivu-global-footer-copyright"><a href="https://www.crmeb.com" target="_blank">{{ copyright }}</a></div>
+    <div class="ivu-global-footer-copyright" v-if="copyright">{{ copyright }}</div>
+    <div class="ivu-global-footer-copyright">
+      Copyright © 2014-2022 
+      <a href="https://www.crmeb.com" target="_blank">{{ version }}</a>
+    </div>
   </div>
 </template>
 <script>
-import { getCrmebCopyRight } from '@/api/system'
+import { getCrmebCopyRight } from '@/api/system';
 export default {
   name: 'i-copyright',
   data() {
@@ -29,19 +33,19 @@ export default {
           href: 'http://doc.crmeb.com',
         },
       ],
-      copyright: 'Copyright © 2022 | 西安众邦网络科技有限公司',
+      copyright: 'Copyright © 2014-2022',
+      version: '',
     };
   },
-  created(){
+  created() {
     this.getVersion();
-    
   },
   methods: {
     getVersion() {
-      let version = this.$store.state.userInfo.version;
+      this.version = this.$store.state.userInfo.version;
       getCrmebCopyRight().then((res) => {
-         this.copyright = res.data.copyrightContext || (this.copyright += version ? '  |  ' + version : '')
-      })
+        this.copyright = res.data.copyrightContext;
+      });
     },
   },
 };

+ 52 - 50
template/admin/src/components/main/components/side-menu/side-menu.vue

@@ -147,55 +147,57 @@ export default {
 </script>
 <style lang="less">
 @import './side-menu.less';
-.side-menu-wrapper a.drop-menu-a {
-  padding: 15px !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer {
-  background: rgb(0, 21, 41) !important;
-  width: 170px !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .ivu-select-dropdown {
-  background: rgb(0, 21, 41) !important;
-  width: 170px !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu {
-  min-width: unset !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item {
-  padding: 9px 0 9px 30px !important;
-  font-size: 13px !important;
-  text-align: left;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item:hover {
-  background-color: #2d8cf0 !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .menu-title {
-  padding-left: 0 !important;
-  color: rgba(225, 225, 225, 0.7) !important;
-  font-size: 13px !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item:hover .menu-title {
-  color: #fff !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .collased-menu-dropdown {
-  padding: 9px 0 9px 30px !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer .collased-menu-dropdown:hover {
-  background-color: #2d8cf0 !important;
-  color: #fff !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer
-  .collased-menu-dropdown:hover
-  > .ivu-dropdown-rel
-  > .drop-menu-a
-  > .menu-title {
-  color: #fff !important;
-}
-.ivu-select-dropdown.ivu-dropdown-transfer
-  .collased-menu-dropdown:hover
-  > .ivu-dropdown-rel
-  > .drop-menu-a
-  > .ivu-icon {
-  color: #fff !important;
+.ivu-menu {
+  .side-menu-wrapper a.drop-menu-a {
+    padding: 15px !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer {
+    background: rgb(0, 21, 41) !important;
+    width: 170px !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .ivu-select-dropdown {
+    background: rgb(0, 21, 41) !important;
+    width: 170px !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu {
+    min-width: unset !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item {
+    padding: 9px 0 9px 30px !important;
+    font-size: 13px !important;
+    text-align: left;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item:hover {
+    background-color: #2d8cf0 !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .menu-title {
+    padding-left: 0 !important;
+    color: rgba(225, 225, 225, 0.7) !important;
+    font-size: 13px !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .ivu-dropdown-menu .ivu-dropdown-item:hover .menu-title {
+    color: #fff !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .collased-menu-dropdown {
+    padding: 9px 0 9px 30px !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer .collased-menu-dropdown:hover {
+    background-color: #2d8cf0 !important;
+    color: #fff !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer
+    .collased-menu-dropdown:hover
+    > .ivu-dropdown-rel
+    > .drop-menu-a
+    > .menu-title {
+    color: #fff !important;
+  }
+  .ivu-select-dropdown.ivu-dropdown-transfer
+    .collased-menu-dropdown:hover
+    > .ivu-dropdown-rel
+    > .drop-menu-a
+    > .ivu-icon {
+    color: #fff !important;
+  }
 }
 </style>

+ 1 - 1
template/admin/src/components/main/components/tags-nav/tags-nav.vue

@@ -212,7 +212,7 @@ export default {
 
 <style lang="less">
 .close .ivu-dropdown-item {
-  color: rgba(255, 255, 255, 0.7) !important;
+  // color: rgba(255, 255, 255, 0.7) !important;
 }
 @import './tags-nav.less';
 </style>

+ 1 - 1
template/admin/src/components/main/components/user/user.vue

@@ -11,7 +11,7 @@
         <!--消息中心<Badge style="margin-left: 10px" :count="messageUnreadCount"></Badge>-->
         <!--</DropdownItem>-->
         <DropdownItem name="userCenter"><Icon type="ios-contact-outline" class="iconImg" />个人中心</DropdownItem>
-		    <DropdownItem v-show = "info.level === 0" name="fileEdit"><Icon type="ios-document-outline" class="iconImg" />文件管理</DropdownItem>
+		    <!-- <DropdownItem v-show = "info.level === 0" name="fileEdit"><Icon type="ios-document-outline" class="iconImg" />文件管理</DropdownItem> -->
         <DropdownItem name="logout"><Icon type="ios-log-out" class="iconImg" />退出登录</DropdownItem>
       </DropdownMenu>
     </Dropdown>

+ 6 - 7
template/admin/src/libs/request.js

@@ -34,14 +34,9 @@ service.interceptors.request.use(
     }
     const token = getCookies('token');
     const kefuToken = getCookies('kefu_token');
-	const fileToken = getCookies('file_token');
-    if (token || kefuToken || fileToken) {
-      config.headers['Authori-zation'] = config.file_edit ? (config.kefu ? 'Bearer ' + kefuToken : 'Bearer ' + fileToken) : (config.kefu ? 'Bearer ' + kefuToken : 'Bearer ' + token);
+    if (token || kefuToken) {
+      config.headers['Authori-zation'] = config.kefu ? 'Bearer ' + kefuToken : 'Bearer ' + token;
     }
-	if(fileToken)
-	{
-		config.headers['Invalid-zation'] = 'Bearer ' + fileToken;
-	}
     return config;
   },
   (error) => {
@@ -85,11 +80,15 @@ service.interceptors.response.use(
         removeCookies('kefu_uuid');
         router.replace({ path: '/kefu' });
         break;
+      case 110008:
+        router.replace({ path: '/admin/system/maintain/system_file/login' });
+        break;
       default:
         return Promise.reject(obj || { msg: '未知错误' });
     }
   },
   (error) => {
+    console.log(error);
     Message.error(error.msg);
     return Promise.reject(error);
   },

+ 16 - 12
template/admin/src/pages/account/login/index.vue

@@ -54,25 +54,24 @@
     </div>
 
     <Verify
-        @success="success"
-        captchaType="blockPuzzle"
-        :imgSize="{ width: '330px', height: '155px' }"
+      @success="success"
+      captchaType="blockPuzzle"
+      :imgSize="{ width: '330px', height: '155px' }"
       ref="verify"
     ></Verify>
     <div class="footer">
-      <div class="pull-right" v-if="copyright">{{copyright}}</div>
-      <div class="pull-right" v-else><a href="https://www.crmeb.com" target="_blank">Copyright © 2022 | 西安众邦网络科技有限公司 | {{version}}</a></div>
+      <div class="pull-right" v-if="copyright">{{ copyright }}</div>
+      <div class="pull-right" v-else>Copyright © 2014-2022 <a href="https://www.crmeb.com" target="_blank">{{version}}</a></div>
     </div>
   </div>
 </template>
 <script>
 import { AccountLogin, loginInfoApi } from '@/api/account';
 import { getWorkermanUrl } from '@/api/kefu';
-// import mixins from '../mixins'
 import Setting from '@/setting';
 import { setCookies } from '@/libs/util';
-import '../../../assets/js/canvas-nest.min';
-import Verify from "@/components/verifition/Verify";
+import '@/assets/js/canvas-nest.min';
+import Verify from '@/components/verifition/Verify';
 
 export default {
   components: {
@@ -106,7 +105,7 @@ export default {
       defaultSwiperList: require('@/assets/images/sw.jpg'),
       key: '',
       copyright: '',
-      version: ''
+      version: '',
     };
   },
   created() {
@@ -180,7 +179,7 @@ export default {
           this.swiperList = [{ slide: this.defaultSwiperList }];
         });
     },
-    success(params){
+    success(params) {
       this.closeModel(params);
     },
     // 关闭模态框
@@ -197,7 +196,7 @@ export default {
         imgcode: this.formInline.code,
         key: this.key,
         captchaType: 'blockPuzzle',
-        captchaVerification: params.captchaVerification,
+        captchaVerification: params ? params.captchaVerification : '',
       })
         .then(async (res) => {
           msg();
@@ -313,7 +312,11 @@ export default {
     handleSubmit(name) {
       this.$refs[name].validate((valid) => {
         if (valid) {
-          this.$refs.verify.show()
+          if (this.errorNum > 2) {
+            this.$refs.verify.show();
+          } else {
+            this.closeModel();
+          }
         }
       });
     },
@@ -464,6 +467,7 @@ a:link, a:visited, a:hover, a:active {
     color: #666;
 }
 .pull-right a {
+    margin-left: 0;
     color: #666;
 }
 .footer{

+ 4 - 3
template/admin/src/pages/kefu/index.vue

@@ -52,7 +52,7 @@
     </div>
     <div class="foot-box" v-if="copyright">{{ copyright }}</div>
     <div class="foot-box" v-else>
-      <a href="https://www.crmeb.com" target="_blank">Copyright © 2022 | 西安众邦网络科技有限公司 | {{ version }}</a>
+      Copyright © 2014-2022 <a href="https://www.crmeb.com" target="_blank">{{ version }}</a>
     </div>
   </div>
 </template>
@@ -401,13 +401,14 @@ export default {
   height: 100vh;
 
   .foot-box {
-    padding: 20px 0;
+    padding: 20px 20px;
     font-size: 14px;
     color: #666666;
-    text-align: center;
+    text-align: right;
     box-sizing: border-box;
 
     a {
+      margin-left: 0;
       color: #666666;
     }
   }

+ 10 - 5
template/admin/src/pages/setting/multiLanguage/country.vue

@@ -91,17 +91,22 @@ export default {
         {
           title: '编号',
           key: 'id',
-          width: 80,
+          width: 120,
         },
         {
-          title: '所属语言',
+          title: '浏览器语言识别码',
+          key: 'code',
+          minWidth: 150,
+        },
+        {
+          title: '语言说明',
           key: 'name',
           minWidth: 180,
         },
         {
-          title: '状态码/文字',
-          key: 'code',
-          minWidth: 300,
+          title: '关联语言',
+          key: 'link_lang',
+          minWidth: 180,
         },
         {
           title: '操作',

+ 5 - 2
template/admin/src/pages/setting/multiLanguage/langList.vue

@@ -53,8 +53,11 @@
       </Form>
     </Card>
     <Alert class="mt10">
-      通知
-      <template slot="desc">我是一个通知. </template>
+      使用说明
+      <template slot="desc"
+        >添加用户端页面语言,添加完成之后状态码为中文文字,前端页面使用 $t(`xxxx`),js文件中使用 this.t(`xxxx`)
+        或者使用 that.t(`xxxx`)<br />添加后端接口语言,添加完成之后状态码为6位数字,后台抛错或者控制器返回文字的时候直接填写状态码数字</template
+      >
     </Alert>
     <Card :bordered="false" dis-hover>
       <Row type="flex">

+ 10 - 13
template/admin/src/pages/setting/multiLanguage/list.vue

@@ -54,7 +54,7 @@
 
 <script>
 import { mapState } from 'vuex';
-import { langTypeList, langTypeForm } from '@/api/setting';
+import { langTypeList, langTypeForm, langTypeStatus } from '@/api/setting';
 export default {
   name: 'user_group',
   data() {
@@ -79,7 +79,7 @@ export default {
           minWidth: 200,
         },
         {
-          title: '语言编码',
+          title: '浏览器语言识别码',
           key: 'file_name',
           minWidth: 200,
         },
@@ -178,17 +178,14 @@ export default {
     },
     // 修改状态
     changeSwitch(row) {
-      console.log(row)
-      // PostgoodsIsShow(row.id, row.is_show)
-      //   .then((res) => {
-      //     this.$Message.success(res.msg);
-      //     this.goodHeade();
-      //     this.getDataList();
-      //   })
-      //   .catch((res) => {
-      //     row.is_show = !row.is_show ? 1 : 0;
-      //     this.$Message.error(res.msg);
-      //   });
+      langTypeStatus(row.id, row.status)
+        .then((res) => {
+          this.$Message.success(res.msg);
+        })
+        .catch((res) => {
+          row.status = !row.status ? 1 : 0;
+          this.$Message.error(res.msg);
+        });
     },
   },
 };

+ 139 - 147
template/admin/src/pages/system/maintain/systemFile/components/codemirror.vue

@@ -1,160 +1,152 @@
 <template>
-	<Modal v-model="modals_son" scrollable footer-hide closable :title="title" :mask-closable="false" width="900">
-
-		<Button type="primary" id="savefile" class="mr5 mb15" @click="savefile">保存</Button>
-		<Button id="undo" class="mr5 mb15" @click="undofile">撤销</Button>
-		<Button id="redo" class="mr5 mb15" @click="redofile">回退</Button>
-		<Button id="refresh" class="mb15" @click="refreshfile">刷新</Button>
-		<textarea ref="mycode" class="codesql public_text" v-model="code" style="height: 80vh"></textarea>
-		<Spin size="large" fix v-if="spinShow"></Spin>
-	</Modal>
+  <Modal v-model="modals_son" scrollable footer-hide closable :title="title" :mask-closable="false" width="900">
+    <Button type="primary" id="savefile" class="mr5 mb15" @click="savefile">保存</Button>
+    <Button id="undo" class="mr5 mb15" @click="undofile">撤销</Button>
+    <Button id="redo" class="mr5 mb15" @click="redofile">回退</Button>
+    <Button id="refresh" class="mb15" @click="refreshfile">刷新</Button>
+    <textarea ref="mycode" class="codesql public_text" v-model="code" style="height: 80vh"></textarea>
+    <Spin size="large" fix v-if="spinShow"></Spin>
+  </Modal>
 </template>
 
 <script>
-	import {
-		opendirLoginApi
-	} from '@/api/system';
-	import CodeMirror from 'codemirror/lib/codemirror';
-	import 'codemirror/theme/ambiance.css';
-	import {
-		setCookies,
-		getCookies,
-		removeCookies
-	} from '@/libs/util';
-
-
-	// 核心样式
-	// import 'codemirror/lib/codemirror.css'
-	// 引入主题后还需要在 options 中指定主题才会生效
-	import 'codemirror/theme/cobalt.css'
-
-	// 需要引入具体的语法高亮库才会有对应的语法高亮效果
-	// codemirror 官方其实支持通过 /addon/mode/loadmode.js 和 /mode/meta.js 来实现动态加载对应语法高亮库
-	// 但 vue 貌似没有无法在实例初始化后再动态加载对应 JS ,所以此处才把对应的 JS 提前引入
-	// import 'codemirror/mode/javascript/javascript.js'
-	// import 'codemirror/mode/css/css.js'
-	// import 'codemirror/mode/xml/xml.js'
-	// import 'codemirror/mode/clike/clike.js'
-	// import 'codemirror/mode/markdown/markdown.js'
-	// import 'codemirror/mode/python/python.js'
-	// import 'codemirror/mode/r/r.js'
-	// import 'codemirror/mode/shell/shell.js'
-	// import 'codemirror/mode/sql/sql.js'
-	// import 'codemirror/mode/swift/swift.js'
-	// import 'codemirror/mode/vue/vue.js'
+import { opendirLoginApi } from '@/api/system';
+import CodeMirror from 'codemirror/lib/codemirror';
+import 'codemirror/theme/ambiance.css';
+import { setCookies, getCookies, removeCookies } from '@/libs/util';
 
+// 核心样式
+// import 'codemirror/lib/codemirror.css'
+// 引入主题后还需要在 options 中指定主题才会生效
+import 'codemirror/theme/cobalt.css';
 
-	require('codemirror/mode/javascript/javascript');
-	export default {
-		name: 'opendir',
-		props: {
-			rows: {
-				type: Object,
-				default: {}
-			},
-			code: {
-				type: String,
-				default: ' '
-			},
-			modals: {
-				type: Boolean,
-				default: false
-			},
-			title: {
-				type: String,
-				default: ''
-			}
-		},
-		data() {
-			return {
-				editor: '',
-				isShowLogn: false, // 登录
-				isShowList: false, // 登录之后列表
-				spinShow: false,
-				loading: false,
+// 需要引入具体的语法高亮库才会有对应的语法高亮效果
+// codemirror 官方其实支持通过 /addon/mode/loadmode.js 和 /mode/meta.js 来实现动态加载对应语法高亮库
+// 但 vue 貌似没有无法在实例初始化后再动态加载对应 JS ,所以此处才把对应的 JS 提前引入
+// import 'codemirror/mode/javascript/javascript.js'
+// import 'codemirror/mode/css/css.js'
+// import 'codemirror/mode/xml/xml.js'
+// import 'codemirror/mode/clike/clike.js'
+// import 'codemirror/mode/markdown/markdown.js'
+// import 'codemirror/mode/python/python.js'
+// import 'codemirror/mode/r/r.js'
+// import 'codemirror/mode/shell/shell.js'
+// import 'codemirror/mode/sql/sql.js'
+// import 'codemirror/mode/swift/swift.js'
+// import 'codemirror/mode/vue/vue.js'
 
-				formItem: {
-					dir: '',
-					superior: 0,
-					filedir: '',
-				},
-				pathname: '',
-				modals_son : this.modals
-			};
-		},
-		watch: {
-			code: {
-				handler(newValue, oldValue) {
-					this.editor.setValue(newValue);
-				},
-				deep: true // 默认值是 false,代表是否深度监听
-			},
-			modals: {
-				handler(newValue, oldValue) {
-					this.modals_son = newValue
-				},
-				deep: true // 默认值是 false,代表是否深度监听
-			},
-		},
-		mounted() {
-			this.editor = CodeMirror.fromTextArea(this.$refs.mycode, {
-				value: 'http://www.crmeb.com', // 文本域默认显示的文本
-				mode: 'text/javascript',
-				theme: 'ambiance', // CSS样式选择
-				indentUnit: 8, // 缩进单位,默认2
-				smartIndent: true, // 是否智能缩进
-				tabSize: 4, // Tab缩进,默认4
-				readOnly: false, // 是否只读,默认false
-				showCursorWhenSelecting: true,
-				lineNumbers: true, // 是否显示行号
+require('codemirror/mode/javascript/javascript');
+export default {
+  name: 'opendir',
+  props: {
+    rows: {
+      type: Object,
+      default: {},
+    },
+    code: {
+      type: String,
+      default: ' ',
+    },
+    modals: {
+      type: Boolean,
+      default: false,
+    },
+    title: {
+      type: String,
+      default: '',
+    },
+  },
+  data() {
+    return {
+      editor: '',
+      isShowLogn: false, // 登录
+      isShowList: false, // 登录之后列表
+      spinShow: false,
+      loading: false,
 
-				indentWithTabs: true,
-				matchBrackets: true,
-				extraKeys: {
-					'Ctrl': 'autocomplete'
-				}, //自定义快捷键
-			});
-			//代码自动提示功能,记住使用cursorActivity事件不要使用change事件,这是一个坑,那样页面直接会卡死
-			editor.on('cursorActivity', function() {
-				editor.showHint()
-			})
-		},
-		created() {
-			// this.getList();
-			this.onIsLogin();
-		},
-		methods: {
+      formItem: {
+        dir: '',
+        superior: 0,
+        filedir: '',
+      },
+      pathname: '',
+      modals_son: this.modals,
+      fileToken: getCookies('file_token'),
+    };
+  },
+  watch: {
+    code: {
+      handler(newValue, oldValue) {
+        this.editor.setValue(newValue);
+      },
+      deep: true, // 默认值是 false,代表是否深度监听
+    },
+    modals: {
+      handler(newValue, oldValue) {
+        this.modals_son = newValue;
+      },
+      deep: true, // 默认值是 false,代表是否深度监听
+    },
+  },
+  mounted() {
+    this.editor = CodeMirror.fromTextArea(this.$refs.mycode, {
+      value: 'http://www.crmeb.com', // 文本域默认显示的文本
+      mode: 'text/javascript',
+      theme: 'ambiance', // CSS样式选择
+      indentUnit: 8, // 缩进单位,默认2
+      smartIndent: true, // 是否智能缩进
+      tabSize: 4, // Tab缩进,默认4
+      readOnly: false, // 是否只读,默认false
+      showCursorWhenSelecting: true,
+      lineNumbers: true, // 是否显示行号
 
-			// 保存
-			savefile() {
-				let data = {
-					comment: this.editor.getValue(),
-					filepath: this.pathname,
-				};
-				savefileApi(data)
-					.then(async (res) => {
-						this.$Message.success(res.msg);
-						this.modals = false;
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg);
-					});
-			},
-			// 撤销
-			undofile() {
-				this.editor.undo();
-			},
-			redofile() {
-				this.editor.redo();
-			},
-			// 刷新
-			refreshfile() {
-				this.editor.refresh();
-			},
-		},
-	};
+      indentWithTabs: true,
+      matchBrackets: true,
+      extraKeys: {
+        Ctrl: 'autocomplete',
+      }, //自定义快捷键
+    });
+    //代码自动提示功能,记住使用cursorActivity事件不要使用change事件,这是一个坑,那样页面直接会卡死
+    editor.on('cursorActivity', function () {
+      editor.showHint();
+    });
+  },
+  created() {
+    // this.getList();
+    this.onIsLogin();
+  },
+  methods: {
+    // 保存
+    savefile() {
+      let data = {
+        comment: this.editor.getValue(),
+        filepath: this.pathname,
+        fileToken: this.fileToken,
+      };
+      savefileApi(data)
+        .then(async (res) => {
+          this.$Message.success(res.msg);
+          this.modals = false;
+        })
+        .catch((res) => {
+          this.$Message.error(res.msg);
+        });
+    },
+    // 撤销
+    undofile() {
+      this.editor.undo();
+    },
+    redofile() {
+      this.editor.redo();
+    },
+    // 刷新
+    refreshfile() {
+      this.editor.refresh();
+    },
+  },
+};
 </script>
 <style scoped lang="stylus">
->>>.CodeMirror 
+>>>.CodeMirror
 	height: 70vh !important
 </style>

+ 126 - 0
template/admin/src/pages/system/maintain/systemFile/login.vue

@@ -0,0 +1,126 @@
+<template>
+  <div>
+    <div class="i-layout-page-header">
+      <div class="i-layout-page-header">
+        <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
+      </div>
+    </div>
+    <Row type="flex">
+      <Col span="24">
+        <div class="index_from page-account-container">
+          <div class="page-account-top">
+            <span class="page-account-top-tit">文件管理登录</span>
+          </div>
+          <Form ref="formInline" :model="formInline" :rules="ruleInline" @submit.native.prevent>
+            <!-- <FormItem prop="sms_account" class="maxInpt">
+            <Input type="text" v-model="formInline.account" prefix="ios-contact-outline" placeholder="请输入手机号" />
+          </FormItem> -->
+            <FormItem prop="sms_token" class="maxInpt">
+              <Input type="password" v-model="formInline.password" prefix="ios-lock-outline" placeholder="请输入密码" />
+              <span class="trip">提示:config/filesystem.php中手动配置password后使用,不能为空</span>
+            </FormItem>
+            <FormItem class="maxInpt">
+              <Button type="primary" long size="large" @click="handleSubmit('formInline')" class="btn">登录</Button>
+            </FormItem>
+          </Form>
+        </div>
+      </Col>
+    </Row>
+  </div>
+</template>
+
+<script>
+import { opendirLoginApi } from '@/api/system';
+import { setCookies } from '@/libs/util';
+
+export default {
+  name: 'file_login',
+  data() {
+    const validatePhone = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请填写手机号'));
+      } else if (!/^1[3456789]\d{9}$/.test(value)) {
+        callback(new Error('手机号格式不正确!'));
+      } else {
+        callback();
+      }
+    };
+    return {
+      formInline: {
+        // account: '',
+        password: '',
+      },
+      ruleInline: {
+        // account: [{ required: true, validator: validatePhone, trigger: 'blur' }],
+        password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
+      },
+    };
+  },
+  created() {
+    var _this = this;
+    document.onkeydown = function (e) {
+      let key = window.event.keyCode;
+      if (key === 13) {
+        _this.handleSubmit('formInline');
+      }
+    };
+  },
+  methods: {
+    handleSubmit(name) {
+      this.$refs[name].validate((valid) => {
+        if (valid) {
+          opendirLoginApi(this.formInline)
+            .then(async (res) => {
+              this.$Message.success('登录成功!');
+              //   this.$emit('on-Login', res.data);
+              let expires = this.getExpiresTime(res.data.expires_time);
+              // 记录用户登陆信息
+              setCookies('file_token', res.data.token, expires);
+              this.$router.push({
+                path: '/admin/system/maintain/system_file/opendir',
+              });
+            })
+            .catch((res) => {
+              this.$Message.error(res.msg);
+            });
+        } else {
+          return false;
+        }
+      });
+    },
+    //计算token过期时间
+    getExpiresTime(expiresTime) {
+      let nowTimeNum = Math.round(new Date() / 1000);
+      let expiresTimeNum = expiresTime - nowTimeNum;
+      return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
+    },
+  },
+};
+</script>
+
+<style scoped lang="stylus">
+.maxInpt{
+    max-width 400px
+    margin-left auto
+    margin-right auto
+}
+.trip{
+    color #aaa
+}
+.page-account-container{
+    text-align center
+    padding 50px 0
+}
+.page-account-top{
+    margin-bottom 20px
+}
+.page-account-top-tit
+    font-size 21px
+    color #1890FF
+.page-account-other
+    text-align center
+    color #1890FF
+    font-size 12px
+    span
+        cursor pointer
+</style>

Разница между файлами не показана из-за своего большого размера
+ 864 - 774
template/admin/src/pages/system/maintain/systemFile/opendir.vue


+ 1 - 1
template/admin/src/router/modules/setting.js

@@ -643,7 +643,7 @@ export default {
       name: `${pre}langCountry`,
       meta: {
         auth: ['admin-lang-country'],
-        title: '国家列表',
+        title: '地区关联语言',
       },
       component: () => import('@/pages/setting/multiLanguage/country'),
     },

+ 11 - 2
template/admin/src/router/modules/system.js

@@ -87,6 +87,15 @@ export default {
       },
       component: () => import('@/pages/system/maintain/systemFile/opendir'),
     },
+    {
+      path: 'maintain/system_file/login',
+      name: `${pre}opendir_login`,
+      meta: {
+        auth: ['system-maintain-system-file'],
+        title: '文件管理入口',
+      },
+      component: () => import('@/pages/system/maintain/systemFile/login'),
+    },
     {
       path: 'config/system_config_tab/index',
       name: `${pre}configTab`,
@@ -137,9 +146,9 @@ export default {
       name: `${pre}upgradeclient`,
       meta: {
         auth: ['system-onlineUpgrade-index'],
-        title: '在线升级'
+        title: '在线升级',
       },
-      component: () => import('@/pages/system/onlineUpgrade/index')
+      component: () => import('@/pages/system/onlineUpgrade/index'),
     },
   ],
 };