3
0
Pārlūkot izejas kodu

部署接口调试

zhangjie 2 gadi atpakaļ
vecāks
revīzija
03760d02ac

+ 82 - 0
src/assets/styles/base.scss

@@ -25,20 +25,24 @@ i {
   box-sizing: border-box;
   -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
 }
+
 li {
   list-style: none;
 }
+
 em,
 i,
 u {
   font-style: normal;
 }
+
 input {
   outline: none;
   border: none;
   background: rgba(245, 245, 245, 1);
   font-family: $--font-family;
 }
+
 input::-webkit-input-placeholder,
 input::-moz-placeholder,
 input:-ms-input-placeholder,
@@ -47,10 +51,12 @@ input:-moz-placeholder {
   font-weight: bold;
   color: $--color-text-gray-4;
 }
+
 button,
 textarea {
   font-family: $--font-family;
 }
+
 h1,
 h2,
 h3,
@@ -59,19 +65,23 @@ h5,
 h6 {
   font-size: 100%;
 }
+
 fieldset,
 img {
   border: 0;
 }
+
 abbr {
   border: 0;
   font-variant: normal;
 }
+
 a {
   text-decoration: none;
   color: inherit;
   *color: $--color-text-gray-3;
 }
+
 img {
   vertical-align: middle;
 }
@@ -80,6 +90,7 @@ img {
 input:-webkit-autofill {
   box-shadow: 0 0 0 1000px white inset;
 }
+
 input[type="text"]:focus,
 input[type="password"]:focus,
 input[type="number"]:focus,
@@ -93,19 +104,24 @@ textarea:focus {
   height: 8px;
   background: transparent;
 }
+
 ::-webkit-scrollbar-button {
   display: none;
 }
+
 ::-webkit-scrollbar-track {
   background: transparent;
 }
+
 ::-webkit-scrollbar-thumb {
   border-radius: 8px;
   background: #666;
 }
+
 ::-webkit-scrollbar-corner {
   background: transparent;
 }
+
 ::-webkit-scrollbar-resizer {
   background: transparent;
 }
@@ -127,6 +143,7 @@ body {
   &-border {
     border: 1px solid $--color-border;
   }
+
   &-pad {
     padding: 20px;
   }
@@ -137,10 +154,12 @@ body {
     .el-form-item {
       margin-bottom: 15px;
     }
+
     .el-form-item__label {
       display: none;
     }
   }
+
   &-gray {
     background-color: $--color-text-gray-7;
   }
@@ -157,6 +176,7 @@ body {
     display: flex;
     align-items: flex-end;
   }
+
   &-tips {
     font-size: 16px;
     line-height: 25px;
@@ -175,6 +195,7 @@ body {
     > h3 {
       font-size: 17px;
     }
+
     .el-icon-question {
       margin-left: 10px;
       font-size: 16px;
@@ -187,6 +208,7 @@ body {
     }
   }
 }
+
 .part-title {
   font-size: 16px;
   font-weight: bold;
@@ -197,23 +219,28 @@ body {
   h2 {
     float: left;
   }
+
   &-infos {
     float: right;
   }
 }
+
 .part-body {
   padding: 25px;
 }
+
 .part-page {
   margin-top: 15px;
   text-align: right;
 }
+
 .part-none {
   padding: 100px;
   font-size: 20px;
   color: $--color-text-gray-3;
   text-align: center;
 }
+
 // box-justify
 .box-justify {
   display: flex;
@@ -225,6 +252,7 @@ body {
 .page-head {
   margin-bottom: 20px;
   color: $--color-text-dark;
+
   &-flex {
     display: flex;
     align-items: stretch;
@@ -234,6 +262,7 @@ body {
   > h2 {
     font-size: 20px;
   }
+
   .el-icon-question {
     margin-left: 10px;
     font-size: 16px;
@@ -264,6 +293,7 @@ body {
     color: $--color-text-gray-2;
     border: 1px solid $--color-border;
   }
+
   td {
     padding: 14px;
     line-height: 1.2;
@@ -273,12 +303,14 @@ body {
     &.td-link {
       span {
         cursor: pointer;
+
         &:hover {
           color: $--color-text-gray;
         }
       }
     }
   }
+
   .td-th {
     font-weight: 600;
     color: $--color-text-gray;
@@ -287,11 +319,13 @@ body {
   &--border {
     border: 1px solid $--color-border;
     border-radius: 10px;
+
     th {
       background-color: #fcfcfd;
       border: none;
       border-bottom: 1px solid $--color-border;
     }
+
     td {
       border: none;
       border-bottom: 1px solid $--color-border;
@@ -304,6 +338,7 @@ body {
   float: right;
   width: 300px;
 }
+
 .list-lr-left {
   margin-right: 320px;
 }
@@ -311,39 +346,60 @@ body {
 .vlcode {
   height: 36px;
 }
+
 .vlcode-left {
   margin-right: 135px;
 }
+
 .vlcode-right {
   float: right;
   width: 120px;
 }
+.logo-image {
+  display: inline-block;
+  padding: 15px;
+  border-radius: 5px;
+  background-color: #f0f4f9;
+}
+.logo-view {
+  display: block;
+  max-width: 200px;
+  height: auto;
+}
 
 // color
 .color-primary {
   color: $--color-primary !important;
 }
+
 .color-success {
   color: $--color-success;
 }
+
 .color-warning {
   color: $--color-warning;
 }
+
 .color-danger {
   color: $--color-danger;
 }
+
 .color-info {
   color: $--color-text-gray-1;
 }
+
 .color-dark {
   color: $--color-dark;
 }
+
 .color-gray {
   color: $--color-text-gray;
 }
+
 .color-gray-2 {
   color: $--color-text-gray-2;
 }
+
 .color-white {
   color: #fff;
 }
@@ -352,9 +408,11 @@ body {
 .text-center {
   text-align: center;
 }
+
 .text-left {
   text-align: left;
 }
+
 .text-right {
   text-align: right;
 }
@@ -370,10 +428,12 @@ body {
       color: mix(#000, $--color-danger, 20%) !important;
     }
   }
+
   &.is-disabled {
     background-color: transparent !important;
   }
 }
+
 .btn-primary {
   &.el-button--text {
     border-radius: 0;
@@ -392,6 +452,7 @@ body {
     background-color: transparent !important;
   }
 }
+
 .btn-success {
   border-radius: 0;
 
@@ -407,6 +468,7 @@ body {
       }
     }
   }
+
   &.is-disabled {
     background-color: transparent !important;
   }
@@ -416,9 +478,11 @@ body {
   background-color: #fff !important;
   color: #999 !important;
 }
+
 .font-bold {
   font-weight: bold;
 }
+
 .table-head-bg {
   th {
     background-color: #f6f6f6;
@@ -453,34 +517,44 @@ body {
 .cont-link {
   color: $--color-primary;
   cursor: pointer;
+
   &:hover {
     color: $--color-success;
   }
 }
+
 .ml-1 {
   margin-left: 5px;
 }
+
 .ml-2 {
   margin-left: 10px;
 }
+
 .mr-1 {
   margin-right: 5px;
 }
+
 .mr-2 {
   margin-right: 10px;
 }
+
 .mr-4 {
   margin-right: 20px;
 }
+
 .mb-0 {
   margin-bottom: 0;
 }
+
 .mb-2 {
   margin-bottom: 10px;
 }
+
 .mb-4 {
   margin-bottom: 20px;
 }
+
 .width-full {
   width: 100%;
 }
@@ -491,12 +565,15 @@ body {
   line-height: 20px;
   color: $--color-text-gray-2;
 }
+
 .tips-dark {
   color: $--color-text-gray;
 }
+
 .tips-error {
   color: $--color-danger;
 }
+
 .tips-icon {
   display: inline-block;
   vertical-align: middle;
@@ -505,10 +582,12 @@ body {
   margin: 0 10px;
   cursor: pointer;
 }
+
 .inline-block {
   display: inline-block;
   vertical-align: top;
 }
+
 .custom-tree-node {
   flex: 1;
   display: flex;
@@ -517,6 +596,7 @@ body {
   font-size: 12px;
   padding-right: 8px;
 }
+
 .form-item-content {
   padding: 6px 0;
   line-height: 20px;
@@ -534,9 +614,11 @@ body {
   &-base {
     background-image: url(../images/icon-base.png);
   }
+
   &-user {
     background-image: url(../images/icon-user.png);
   }
+
   &-password {
     background-image: url(../images/icon-password.png);
     width: 14px;

+ 132 - 0
src/assets/styles/element-ui-costom.scss

@@ -19,18 +19,22 @@
       background-color: #fff;
       border-bottom: 1px solid $--color-border;
     }
+
     .el-dialog__body {
       padding-top: 90px;
     }
   }
 }
+
 .el-dialog__header {
   padding: 15px 20px;
+
   .el-dialog__title {
     color: $--color-text-dark;
     font-size: 16px;
     line-height: 19px;
   }
+
   .el-dialog__headerbtn {
     top: 15px;
     width: 16px;
@@ -48,6 +52,7 @@
     }
   }
 }
+
 .el-dialog__body {
   padding: 30px 40px;
   position: relative;
@@ -57,13 +62,16 @@
   .el-form-item__label {
     padding-right: 2px;
   }
+
   .el-input-tips {
     color: rgba(187, 187, 187, 1);
     margin-left: 13px;
   }
 }
+
 .el-dialog__footer {
   overflow: hidden;
+
   .el-button {
     width: 100px;
     border-radius: 8px;
@@ -75,15 +83,19 @@
 .page-dialog {
   .el-dialog.is-fullscreen {
     background: $--color-background;
+
     .el-dialog__body {
       padding: 70px 20px 20px;
     }
   }
+
   .el-dialog {
     background: $--color-background;
+
     .el-dialog__body {
       padding: 20px;
     }
+
     .el-dialog__footer {
       display: none;
     }
@@ -95,10 +107,12 @@
   .el-dialog {
     background-color: transparent;
   }
+
   .el-dialog__header,
   .el-dialog__footer {
     display: none;
   }
+
   .el-dialog__body {
     position: absolute;
     width: 100%;
@@ -117,12 +131,14 @@
       font-size: 12px;
       color: rgba(254, 108, 105, 1);
     }
+
     &__content {
       .el-table {
         line-height: 1;
       }
     }
   }
+
   // form-info
   &.form-info {
     .el-form-item {
@@ -133,6 +149,7 @@
       }
     }
   }
+
   &--label-top {
     .el-form-item__label {
       line-height: 20px;
@@ -140,6 +157,7 @@
     }
   }
 }
+
 // input
 .el-input {
   &.is-focus {
@@ -147,21 +165,25 @@
       border-color: $--color-primary !important;
     }
   }
+
   &.is-disabled {
     .el-input__inner {
       color: $--color-text-gray-2;
     }
   }
+
   .el-input__inner {
     border-radius: 8px;
     border-color: #ddd;
     background-color: #fff;
   }
+
   // .el-input__suffix {
   //   right: 0;
   //   border-left: 1px solid #ddd;
   // }
 }
+
 // textarea
 .el-textarea {
   &.is-disabled {
@@ -170,27 +192,32 @@
     }
   }
 }
+
 .el-select {
   .el-input__suffix {
     right: 0;
     border-left: 1px solid #ddd;
   }
+
   .el-input {
     .el-select__caret {
       width: 30px;
     }
+
     .el-icon-arrow-up:before {
       font-size: 12px;
       content: "\e78f";
     }
   }
 }
+
 .el-select-dropdown {
   &.popper-filter {
     .el-scrollbar {
       display: block !important;
       padding-top: 52px;
     }
+
     .el-select-filter {
       padding: 0 10px;
       position: absolute;
@@ -201,11 +228,13 @@
     }
   }
 }
+
 // upload
 .el-upload,
 .el-upload-dragger {
   width: 100%;
 }
+
 // radio
 .el-radio-button {
   &:hover {
@@ -214,11 +243,13 @@
     }
   }
 }
+
 .el-radio-button__orig-radio:checked + .el-radio-button__inner {
   color: $--color-white;
   border-color: $--color-primary;
   background: $--color-primary;
 }
+
 // button
 .el-button {
   border-radius: $--border-radius;
@@ -226,9 +257,11 @@
   > .icon {
     margin-right: 5px;
   }
+
   > span {
     display: inline-block;
   }
+
   &.is-disabled {
     color: $--color-text-gray-3 !important;
     background: $--color-background;
@@ -240,16 +273,20 @@
 .popover-button + .el-button {
   margin-left: 10px;
 }
+
 .el-button + .el-button {
   margin-left: 10px;
 }
+
 .el-button--text + .el-button--text {
   margin-left: 5px;
 }
+
 .el-button--small {
   padding-top: 8px;
   padding-bottom: 8px;
 }
+
 .el-button--text {
   color: $--color-text-gray-2;
 
@@ -257,6 +294,7 @@
     margin-left: 10px;
   }
 }
+
 .el-button--info {
   background-color: $--color-cyan;
   border-color: $--color-cyan;
@@ -267,6 +305,7 @@
     border-color: $--color-cyan-light;
   }
 }
+
 .el-button--primary {
   background-color: $--color-primary;
   border-color: $--color-primary;
@@ -277,6 +316,7 @@
     border-color: $--color-primary-light;
   }
 }
+
 .el-button--success {
   background-color: $--color-success;
   border-color: $--color-success;
@@ -304,15 +344,18 @@
   tr.el-table__row {
     color: $--color-text-dark;
   }
+
   td,
   th {
     border-color: $--color-border !important;
     padding: 14px 0;
     font-weight: 500;
   }
+
   .el-table__row.row-danger {
     color: $--color-danger;
   }
+
   &.el-table--noback {
     tr.el-table__row {
       background-color: $--color-white;
@@ -324,60 +367,73 @@
     vertical-align: middle;
     line-height: 1.3;
   }
+
   // caret-wrapper
   .caret-wrapper {
     width: 20px;
     height: 20px;
     top: -1px;
+
     .sort-caret {
       &.ascending {
         top: -1px;
       }
+
       &.descending {
         bottom: -1px;
       }
     }
   }
+
   // action-column
   td.action-column {
     padding-left: 10px;
     padding-right: 10px;
+
     .cell {
       padding: 0;
       margin: 0 -5px;
     }
+
     .el-button--text {
       padding: 0;
       margin: 0 5px;
       border: none !important;
       outline: none !important;
       font-size: 14px;
+
       &:hover {
         transform: scale(1.1);
       }
     }
   }
 }
+
 .el-table--border {
   border-radius: 10px;
+
   th {
     padding: 12px 0;
     background-color: #fcfcfd;
     border-right: none;
   }
+
   td {
     border-right: none;
   }
 }
+
 // el-checkbox
 .el-checkbox {
   .el-checkbox__label {
     color: $--color-text-gray-2 !important;
   }
+
   .el-checkbox__inner::after {
     border-width: 2px;
   }
 }
+
 .el-checkbox__input.is-checked .el-checkbox__inner {
   background-color: $--color-white;
   border-color: $--color-primary;
@@ -386,9 +442,11 @@
     border-color: $--color-primary;
   }
 }
+
 .el-checkbox__input.is-indeterminate .el-checkbox__inner {
   background-color: $--color-white;
   border-color: $--color-primary;
+
   &::before {
     background-color: $--color-primary;
   }
@@ -399,9 +457,11 @@
     color: $--color-text-gray-2 !important;
   }
 }
+
 .el-radio__input.is-checked .el-radio__inner {
   background-color: $--color-white;
   border-color: $--color-primary;
+
   &::after {
     width: 6px;
     height: 6px;
@@ -428,15 +488,19 @@
   background-color: $--color-white;
   border: 1px solid #e1e3eb;
 }
+
 .el-pagination {
   padding: 0;
+
   .el-pagination__total {
     float: left;
   }
+
   span:not([class*="suffix"]) {
     line-height: 32px;
     height: 32px;
   }
+
   &.is-background {
     .btn-prev,
     .btn-next {
@@ -444,6 +508,7 @@
       margin: 0 5px;
       @extend .el-pagination-li;
     }
+
     .btn-prev:disabled,
     .btn-next:disabled {
       opacity: 0.7;
@@ -456,6 +521,7 @@
       line-height: 32px;
 
       @extend .el-pagination-li;
+
       &:not(.disabled).active {
         color: #fff;
         background-color: $--color-primary;
@@ -463,17 +529,21 @@
     }
   }
 }
+
 // el-message-box
 .el-message-box {
   width: 320px;
   background-color: #f6f6f6;
   border-radius: 10px;
+
   &__title {
     display: none;
   }
+
   &__headerbtn {
     display: none;
   }
+
   &__content {
     text-align: center;
 
@@ -487,6 +557,7 @@
 
       &.el-icon-warning {
         border-radius: 50%;
+
         &::before {
           content: "";
           position: absolute;
@@ -500,10 +571,12 @@
         }
       }
     }
+
     .el-message-box__message {
       padding: 0;
     }
   }
+
   &__btns {
     height: 75px;
     padding: 30px 20px 10px;
@@ -518,6 +591,7 @@
 .alert-message {
   .el-message-box__btns {
     text-align: center;
+
     > .el-button {
       position: relative;
       left: auto;
@@ -526,17 +600,21 @@
     }
   }
 }
+
 // .el-message
 .el-message-loading {
   border-color: mix($--color-white, $--color-success, 80%);
   background-color: mix($--color-white, $--color-success, 90%);
 }
+
 // el-date-editor
 .el-date-editor {
   border-radius: 8px;
+
   .el-range-separator {
     width: auto;
   }
+
   .el-range-input {
     background-color: transparent;
   }
@@ -550,19 +628,23 @@
   &__description.is-process {
     color: $--color-success;
   }
+
   &__title.is-process {
     font-weight: normal;
   }
+
   &__head.is-success {
     .el-step__line {
       background-color: $--color-success;
     }
+
     .el-step__icon.is-text {
       color: $--color-white;
       border-color: $--color-success;
       background-color: $--color-success;
     }
   }
+
   &__head.is-process {
     .el-step__icon.is-text {
       color: $--color-success;
@@ -574,6 +656,7 @@
   &__description.is-wait {
     color: $--color-text-gray-2;
   }
+
   &__head.is-wait {
     .el-step__icon.is-text {
       color: $--color-text-gray-2;
@@ -582,6 +665,7 @@
     }
   }
 }
+
 // el-popover
 .el-popper-dark {
   background-color: $--color-text-dark-1;
@@ -591,9 +675,11 @@
   padding: 16px;
   border: none;
 }
+
 .el-popper-dark {
   box-shadow: 0px 10px 10px 0px rgba(54, 61, 89, 0.2);
 }
+
 .el-popper-dark[x-placement^="right"] .popper__arrow {
   border-right-color: $--color-text-dark-1;
 
@@ -601,6 +687,7 @@
     border-right-color: $--color-text-dark-1;
   }
 }
+
 .el-popper-dark[x-placement^="top"] .popper__arrow {
   border-top-color: $--color-text-dark-1;
 
@@ -608,6 +695,7 @@
     border-top-color: $--color-text-dark-1;
   }
 }
+
 .el-popper-dark[x-placement^="bottom"] .popper__arrow {
   border-bottom-color: $--color-text-dark-1;
 
@@ -615,6 +703,7 @@
     border-bottom-color: $--color-text-dark-1;
   }
 }
+
 .el-popper-dark[x-placement^="left"] .popper__arrow {
   border-left-color: $--color-text-dark-1;
 
@@ -622,6 +711,7 @@
     border-left-color: $--color-text-dark-1;
   }
 }
+
 // popper-list
 .popper-list {
   min-width: auto;
@@ -630,8 +720,50 @@
     display: block;
     width: 100%;
     margin: 0;
+
     &:not(:last-child) {
       margin-bottom: 5px;
     }
   }
 }
+
+// el-tabs
+.el-tabs {
+  .el-tabs__header {
+    margin-bottom: 0;
+  }
+
+  .el-tabs__content {
+    background-color: #fff;
+    padding: 30px;
+  }
+
+  .el-tabs__item {
+    color: #626a82;
+    border: none;
+    background-color: #fff;
+    border-radius: 6px 6px 0 0;
+    margin-right: 12px;
+
+    &.is-active {
+      font-weight: 600;
+      color: #000;
+
+      &::before {
+        content: "";
+        display: inline-block;
+        vertical-align: middle;
+        width: 10px;
+        height: 10px;
+        background-color: $--color-primary;
+        border-radius: 50%;
+        margin-right: 5px;
+        margin-top: -2px;
+      }
+    }
+  }
+}
+
+.el-tabs--card > .el-tabs__header .el-tabs__nav {
+  border: none;
+}

+ 3 - 15
src/components/UploadFetchFile.vue

@@ -50,7 +50,6 @@ export default {
   data() {
     return {
       attachmentName: "",
-      canUpload: false,
       loading: false,
       res: {}
     };
@@ -68,9 +67,7 @@ export default {
       );
     },
     async handleFileChange(file) {
-      console.log(file);
-      this.attachmentName = file.name;
-      this.canUpload = file.status === "ready";
+      // console.log(file);
 
       if (file.size > this.maxSize) {
         this.handleExceededSize();
@@ -81,6 +78,7 @@ export default {
         this.handleFormatError();
         return Promise.reject();
       }
+      this.attachmentName = file.name;
       this.$emit("valid-change", { success: true });
 
       const md5 = await fileMD5(file.raw);
@@ -91,16 +89,6 @@ export default {
         file: file.raw
       });
     },
-    // upload(options) {
-    //   let formData = new FormData();
-    //   Object.entries(options.data).forEach(([k, v]) => {
-    //     formData.append(k, v);
-    //   });
-    //   formData.append("file", options.file);
-    //   this.$emit("uploading");
-
-    //   return $post(options.action, formData, { headers: options.headers });
-    // },
     handleFormatError() {
       const content = "只支持文件格式为" + this.format.join("/");
       this.res = {
@@ -111,7 +99,7 @@ export default {
     },
     handleExceededSize() {
       const content =
-        "文件大小不能超过" + Math.floor(this.maxSize / 1024) + "M";
+        "文件大小不能超过" + Math.floor(this.maxSize / (1024 * 1024)) + "M";
       this.res = {
         success: false,
         message: content

+ 15 - 1
src/constants/navs.js

@@ -14,8 +14,20 @@ export const navs = [
   {
     id: "3",
     parentId: "1",
+    name: "机构管理",
+    url: "OrgManage"
+  },
+  {
+    id: "4",
+    parentId: "1",
     name: "应用管理",
     url: "AppManage"
+  },
+  {
+    id: "5",
+    parentId: "1",
+    name: "微信小程序管理",
+    url: "WeChatAppManage"
   }
 ];
 
@@ -122,6 +134,8 @@ export const ROLE_NAV = {
         "app_nginx_prod_edit"
       ]
     },
-    { url: "UserManage", privilege: ["add", "edit", "enable", "resetPwd"] }
+    { url: "UserManage", privilege: ["add", "edit", "enable", "resetPwd"] },
+    { url: "OrgManage", privilege: ["add", "edit", "enable"] },
+    { url: "WeChatAppManage", privilege: ["add", "edit"] }
   ]
 };

+ 3 - 1
src/modules/admin/api.js

@@ -151,7 +151,9 @@ export const appDeployOrgList = deployId => {
   return $postParam("/api/admin/deploy/org/list", { id: deployId });
 };
 export const appDeployOrgUpdate = datas => {
-  return $postParam("/api/admin/deploy/org/update", datas);
+  return $postParam("/api/admin/deploy/org/update", datas, {
+    paramsSerializer: qsRepeatParams
+  });
 };
 // app-deploy-devive
 export const appDeployDeviceList = deployId => {

+ 2 - 2
src/modules/admin/components/AppDeployBindDevice.vue

@@ -11,7 +11,7 @@
       append-to-body
       @opened="visibleChange"
     >
-      <div class="flex-between md-2">
+      <div class="box-justify mb-2">
         <el-button type="success" @click="toExport">导出通用许可证</el-button>
         <el-button type="primary" @click="toUpload">上传设备信息</el-button>
       </div>
@@ -81,7 +81,7 @@ export default {
       modalIsShow: false,
       dataList: [],
       curDeviceId: null,
-      uploading: false
+      loading: false
     };
   },
   methods: {

+ 65 - 67
src/modules/admin/components/AppDeployBindOrg.vue

@@ -1,6 +1,6 @@
 <template>
   <el-dialog
-    class="page-dialog config-manage-dialog"
+    class="page-dialog"
     :visible.sync="modalIsShow"
     top="10px"
     width="1000px"
@@ -10,12 +10,9 @@
     append-to-body
     @open="visibleChange"
   >
-    <div class="part-box flex-between" slot="title">
+    <div class="box-justify" slot="title">
       <h3>应用关联机构</h3>
       <div>
-        <el-button size="mini" type="danger" plain @click="cancel"
-          >取消</el-button
-        >
         <el-button
           size="mini"
           type="primary"
@@ -23,6 +20,9 @@
           @click="submit"
           >确定</el-button
         >
+        <el-button size="mini" type="danger" plain @click="cancel"
+          >取消</el-button
+        >
       </div>
     </div>
 
@@ -33,7 +33,7 @@
           <span class="color-primary">({{ curSelectedOrgs.length }})</span>
         </span>
 
-        <el-table :data="curSelectedOrgs" border>
+        <el-table :data="curSelectedOrgs">
           <!-- <el-table-column width="60" type="index" label="序号" align="center">
           </el-table-column> -->
           <el-table-column prop="id" label="ID" width="80"></el-table-column>
@@ -51,11 +51,11 @@
               {{ scope.row.selected ? "已选择" : "未选择" }}
             </span>
           </el-table-column>
-          <el-table-column label="操作" width="120">
+          <el-table-column label="操作" width="80" class-name="action-column">
             <div slot-scope="scope">
               <el-button
-                size="mini"
-                type="danger"
+                class="btn-danger"
+                type="text"
                 @click="toDeleteSelected(scope.row)"
               >
                 删除
@@ -67,62 +67,60 @@
       <el-tab-pane name="resource">
         <span slot="label">机构筛选</span>
 
-        <div class="part-filter">
-          <div class="part-filter-form" style="padding-left: 0">
-            <el-form :model="filter" inline>
-              <el-form-item label="一级分类">
-                <el-select
-                  v-model="filter.type"
-                  placeholder="选择一级分类"
-                  clearable
-                  @change="typeChange"
+        <div class="part-box-filter" style="padding: 0 0 5px">
+          <el-form :model="filter" inline>
+            <el-form-item label="一级分类">
+              <el-select
+                v-model="filter.type"
+                placeholder="选择一级分类"
+                clearable
+                @change="typeChange"
+              >
+                <el-option
+                  v-for="item in orgTypes"
+                  :key="item.code"
+                  :value="item.code"
+                  :label="item.name"
                 >
-                  <el-option
-                    v-for="item in orgTypes"
-                    :key="item.code"
-                    :value="item.code"
-                    :label="item.name"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-              <el-form-item label="二级分类">
-                <el-select
-                  v-model="filter.subType"
-                  placeholder="选择二级分类"
-                  clearable
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="二级分类">
+              <el-select
+                v-model="filter.subType"
+                placeholder="选择二级分类"
+                clearable
+              >
+                <el-option
+                  v-for="item in curSubTypes"
+                  :key="item.code"
+                  :value="item.code"
+                  :label="item.name"
                 >
-                  <el-option
-                    v-for="item in curSubTypes"
-                    :key="item.code"
-                    :value="item.code"
-                    :label="item.name"
-                  >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-              <el-form-item label="编码" label-width="50">
-                <el-input
-                  v-model="filter.code"
-                  placeholder="编码"
-                  clearable
-                ></el-input>
-              </el-form-item>
-              <el-form-item label="模糊查询">
-                <el-input
-                  v-model.trim="filter.nameStartWith"
-                  placeholder="名称前缀"
-                  clearable
-                ></el-input>
-              </el-form-item>
-              <el-form-item>
-                <el-button type="primary" @click="toPage(1)">查询</el-button>
-              </el-form-item>
-            </el-form>
-          </div>
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="编码" label-width="50">
+              <el-input
+                v-model="filter.code"
+                placeholder="编码"
+                clearable
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="模糊查询">
+              <el-input
+                v-model.trim="filter.nameStartWith"
+                placeholder="名称前缀"
+                clearable
+              ></el-input>
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" @click="toPage(1)">查询</el-button>
+            </el-form-item>
+          </el-form>
         </div>
 
-        <el-table :data="orgs" border>
+        <el-table :data="orgs">
           <!-- <el-table-column
             width="60"
             type="index"
@@ -146,20 +144,20 @@
               {{ scope.row.selected ? "已选择" : "未选择" }}
             </span>
           </el-table-column>
-          <el-table-column label="操作" width="120">
+          <el-table-column label="操作" width="80" class-name="action-column">
             <div slot-scope="scope">
               <el-button
                 v-if="scope.row.selected"
-                size="mini"
-                type="danger"
+                class="btn-danger"
+                type="text"
                 @click="toDelete(scope.row)"
               >
                 删除
               </el-button>
               <el-button
                 v-else
-                size="mini"
-                type="primary"
+                class="btn-primary"
+                type="text"
                 @click="toSelect(scope.row)"
               >
                 添加
@@ -326,7 +324,7 @@ export default {
       if (this.isSubmit) return;
       this.isSubmit = true;
       const datas = {
-        appId: this.curApp.id,
+        id: this.instance.id,
         orgId: this.curSelectedOrgIds.length ? this.curSelectedOrgIds : ""
       };
       const data = await appDeployOrgUpdate(datas).catch(() => {

+ 2 - 2
src/modules/admin/components/AppDeployDeviceUpload.vue

@@ -16,7 +16,7 @@
       :rules="rules"
       label-width="70px"
     >
-      <el-form-item prop="deviceInfo" label="文件">
+      <el-form-item prop="deviceInfo" label="文件">
         <UploadFetchFile
           ref="UploadFetchFile"
           :format="[]"
@@ -25,7 +25,7 @@
           @valid-change="validChange"
         />
       </el-form-item>
-      <el-form-item label="备注">
+      <el-form-item label="备注">
         <el-input
           v-model.trim="modalForm.remark"
           type="textarea"

+ 10 - 3
src/modules/admin/components/AppDeployManage.vue

@@ -44,7 +44,7 @@
           <el-table-column prop="id" label="ID" width="80"></el-table-column>
           <el-table-column prop="name" label="名称"> </el-table-column>
           <el-table-column prop="modeName" label="部署方式"></el-table-column>
-          <el-table-column label="操作" align="center" width="260">
+          <el-table-column label="操作" width="200" class-name="action-column">
             <template slot-scope="scope">
               <el-button
                 v-if="checkPrivilege('app_deploy_edit')"
@@ -99,6 +99,11 @@
       ref="AppDeployBindOrg"
       :instance="curRow"
     ></app-deploy-bind-org>
+    <!-- AppDeployBindDevice -->
+    <app-deploy-bind-device
+      ref="AppDeployBindDevice"
+      :instance="curRow"
+    ></app-deploy-bind-device>
   </div>
 </template>
 
@@ -106,10 +111,11 @@
 import { appDeployList, appDeployModes } from "../api";
 import ModifyAppDeploy from "./ModifyAppDeploy.vue";
 import AppDeployBindOrg from "./AppDeployBindOrg.vue";
+import AppDeployBindDevice from "./AppDeployBindDevice.vue";
 
 export default {
   name: "app-deploy-manage",
-  components: { ModifyAppDeploy, AppDeployBindOrg },
+  components: { ModifyAppDeploy, AppDeployBindOrg, AppDeployBindDevice },
   props: {
     app: {
       type: Object,
@@ -164,7 +170,7 @@ export default {
       };
       const data = await appDeployList(datas);
       this.dataList = data.records.map(item => {
-        item.modeName = this.deployModeMap[item.type];
+        item.modeName = this.deployModeMap[item.mode];
         return item;
       });
       this.total = data.total;
@@ -187,6 +193,7 @@ export default {
     },
     toBindDevice(row) {
       this.curRow = { ...row, appId: this.app.id };
+      this.$refs.AppDeployBindDevice.open();
     }
   }
 };

+ 16 - 8
src/modules/admin/components/ModifyOrg.vue

@@ -17,21 +17,21 @@
       :key="modalForm.id"
       label-width="100px"
     >
-      <el-form-item prop="name" label="名称">
+      <el-form-item prop="name" label="名称">
         <el-input
           v-model.trim="modalForm.name"
           placeholder="请输入名称"
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item prop="code" label="编码">
+      <el-form-item prop="code" label="编码">
         <el-input
           v-model.trim="modalForm.code"
           placeholder="请输入编码"
           clearable
         ></el-input>
       </el-form-item>
-      <el-form-item prop="type" label="一级分类">
+      <el-form-item prop="type" label="一级分类">
         <el-select
           v-model="modalForm.type"
           placeholder="选择一级分类"
@@ -46,7 +46,7 @@
           </el-option>
         </el-select>
       </el-form-item>
-      <el-form-item label="二级分类">
+      <el-form-item label="二级分类">
         <el-select
           v-model="modalForm.subTypes"
           placeholder="选择二级分类"
@@ -63,7 +63,7 @@
           </el-option>
         </el-select>
       </el-form-item>
-      <el-form-item v-if="!isEdit" label="是否启用" required>
+      <el-form-item v-if="!isEdit" label="是否启用" required>
         <el-switch
           v-model="modalForm.enable"
           active-color="#13ce66"
@@ -71,8 +71,14 @@
         >
         </el-switch>
       </el-form-item>
-      <el-form-item label="logo">
-        <UploadFetchFile ref="UploadFetchFile" @file-change="logoChange" />
+      <el-form-item label="logo:">
+        <UploadFetchFile
+          ref="UploadFetchFile"
+          :format="format"
+          input-width="340px"
+          @file-change="logoChange"
+          @valid-change="validChange"
+        />
         <div class="logo-image" v-if="imgSrc">
           <img class="logo-view" :src="imgSrc" alt="logo" />
         </div>
@@ -156,7 +162,9 @@ export default {
             trigger: "change"
           }
         ]
-      }
+      },
+      // logo
+      format: ["jpg", "png"]
     };
   },
   methods: {

+ 1 - 1
src/modules/admin/components/ModifyUser.vue

@@ -55,10 +55,10 @@
       </el-form-item>
     </el-form>
     <div slot="footer">
+      <el-button type="danger" @click="cancel" plain>取消</el-button>
       <el-button type="primary" :disabled="isSubmit" @click="submit"
         >确认</el-button
       >
-      <el-button @click="cancel">取消</el-button>
     </div>
   </el-dialog>
 </template>

+ 12 - 0
src/modules/admin/router.js

@@ -1,5 +1,7 @@
 import AppManage from "./views/AppManage.vue";
 import UserManage from "./views/UserManage.vue";
+import OrgManage from "./views/OrgManage.vue";
+import WeChatAppManage from "./views/WeChatAppManage.vue";
 
 export default [
   {
@@ -11,5 +13,15 @@ export default [
     path: "user-manage",
     name: "UserManage",
     component: UserManage
+  },
+  {
+    path: "org-manage",
+    name: "OrgManage",
+    component: OrgManage
+  },
+  {
+    path: "wxapp-manage",
+    name: "WeChatAppManage",
+    component: WeChatAppManage
   }
 ];

+ 96 - 85
src/modules/admin/views/OrgManage.vue

@@ -1,87 +1,84 @@
 <template>
   <div class="org-manage">
-    <div class="part-filter">
-      <div class="part-filter-form">
-        <el-form
-          ref="FilterForm"
-          label-position="left"
-          label-width="80px"
-          inline
-        >
-          <el-form-item label="一级分类">
-            <el-select
-              v-model="filter.type"
-              placeholder="选择一级分类"
-              clearable
-              @change="typeChange"
-            >
-              <el-option
-                v-for="item in orgTypes"
-                :key="item.code"
-                :value="item.code"
-                :label="item.name"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="二级分类">
-            <el-select
-              v-model="filter.subType"
-              placeholder="选择二级分类"
-              clearable
-            >
-              <el-option
-                v-for="item in curSubTypes"
-                :key="item.code"
-                :value="item.code"
-                :label="item.name"
-              >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="启用/禁用:">
-            <el-select
-              v-model="filter.enable"
-              style="width: 110px;"
-              placeholder="启用/禁用"
-              clearable
-            >
-              <el-option
-                v-for="(val, key) in ABLE_TYPE"
-                :key="key"
-                :value="key * 1"
-                :label="val"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-          <el-form-item label="编码" label-width="50">
-            <el-input
-              v-model="filter.code"
-              placeholder="编码"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="模糊查询">
-            <el-input
-              v-model="filter.nameStartWith"
-              placeholder="名称前缀"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label-width="0px">
-            <el-button type="primary" icon="ios-search" @click="toPage(1)"
-              >查询</el-button
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" inline>
+        <el-form-item label="一级分类">
+          <el-select
+            v-model="filter.type"
+            placeholder="选择一级分类"
+            clearable
+            @change="typeChange"
+          >
+            <el-option
+              v-for="item in orgTypes"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
             >
-            <el-button type="success" icon="md-add" @click="toAdd"
-              >新增</el-button
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="二级分类">
+          <el-select
+            v-model="filter.subType"
+            placeholder="选择二级分类"
+            clearable
+          >
+            <el-option
+              v-for="item in curSubTypes"
+              :key="item.code"
+              :value="item.code"
+              :label="item.name"
             >
-          </el-form-item>
-        </el-form>
-      </div>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="启用/禁用:">
+          <el-select
+            v-model="filter.enable"
+            style="width: 110px;"
+            placeholder="启用/禁用"
+            clearable
+          >
+            <el-option
+              v-for="(val, key) in ABLE_TYPE"
+              :key="key"
+              :value="key * 1"
+              :label="val"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="编码" label-width="50">
+          <el-input
+            v-model="filter.code"
+            placeholder="编码"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="模糊查询">
+          <el-input
+            v-model="filter.nameStartWith"
+            placeholder="名称前缀"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label-width="0px">
+          <el-button type="primary" icon="ios-search" @click="toPage(1)"
+            >查询</el-button
+          >
+          <el-button
+            v-if="checkPrivilege('add')"
+            type="success"
+            icon="md-add"
+            @click="toAdd"
+            >新增</el-button
+          >
+        </el-form-item>
+      </el-form>
     </div>
 
-    <div class="part-box">
-      <el-table ref="TableList" :data="dataList" border>
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="dataList">
         <!-- <el-table-column
           type="index"
           label="序号"
@@ -114,21 +111,34 @@
             >{{ scope.row.enable | ableTypeFilter }}</span
           >
         </el-table-column>
-        <el-table-column label="密钥" width="130">
+        <el-table-column label="密钥" width="130" class-name="action-column">
           <template slot-scope="scope">
-            <el-button size="mini" type="primary" @click="toCopyKey(scope.row)"
+            <el-button
+              class="btn-primary"
+              type="text"
+              @click="toCopyKey(scope.row)"
               >复制到剪贴板</el-button
             >
           </template>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="160">
+        <el-table-column
+          class-name="action-column"
+          label="操作"
+          width="120"
+          fixed="right"
+        >
           <template slot-scope="scope">
-            <el-button size="mini" type="primary" @click="toEdit(scope.row)"
+            <el-button
+              v-if="checkPrivilege('edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEdit(scope.row)"
               >编辑</el-button
             >
             <el-button
-              size="mini"
-              :type="scope.row.enable ? 'danger' : 'success'"
+              v-if="checkPrivilege('enable')"
+              :class="scope.row.enable ? 'btn-danger' : 'btn-primary'"
+              type="text"
               :disabled="loading"
               @click="toEnable(scope.row)"
               >{{ scope.row.enable ? "禁用" : "启用" }}</el-button
@@ -151,10 +161,11 @@
 
     <!-- modify-app -->
     <ModifyOrg
+      v-if="checkPrivilege('edit') || checkPrivilege('add')"
+      ref="ModifyOrg"
       :datas="orgTypes"
       :instance="curRow"
       @modified="getList"
-      ref="ModifyOrg"
     />
   </div>
 </template>

+ 43 - 40
src/modules/admin/views/WeChatAppManage.vue

@@ -1,41 +1,38 @@
 <template>
   <div class="org-manage">
-    <div class="part-filter">
-      <div class="part-filter-form">
-        <el-form
-          ref="FilterForm"
-          label-position="left"
-          label-width="80px"
-          inline
-        >
-          <el-form-item label="应用ID">
-            <el-input
-              v-model="filter.id"
-              placeholder="应用ID"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label="模糊查询">
-            <el-input
-              v-model="filter.nameStartWith"
-              placeholder="名称前缀"
-              clearable
-            ></el-input>
-          </el-form-item>
-          <el-form-item label-width="0px">
-            <el-button type="primary" icon="ios-search" @click="toPage(1)"
-              >查询</el-button
-            >
-            <el-button type="success" icon="md-add" @click="toAdd"
-              >新增</el-button
-            >
-          </el-form-item>
-        </el-form>
-      </div>
+    <div class="part-box part-box-filter part-box-flex">
+      <el-form ref="FilterForm" label-position="left" inline>
+        <el-form-item label="应用ID">
+          <el-input
+            v-model="filter.id"
+            placeholder="应用ID"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="模糊查询">
+          <el-input
+            v-model="filter.nameStartWith"
+            placeholder="名称前缀"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item label-width="0px">
+          <el-button type="primary" icon="ios-search" @click="toPage(1)"
+            >查询</el-button
+          >
+          <el-button
+            v-if="checkPrivilege('add')"
+            type="success"
+            icon="md-add"
+            @click="toAdd"
+            >新增</el-button
+          >
+        </el-form-item>
+      </el-form>
     </div>
 
-    <div class="part-box">
-      <el-table ref="TableList" :data="dataList" border>
+    <div class="part-box part-box-pad">
+      <el-table ref="TableList" :data="dataList">
         <el-table-column prop="id" label="ID" width="80"></el-table-column>
         <el-table-column prop="name" label="名称"> </el-table-column>
         <el-table-column prop="createTime" label="创建时间" width="160">
@@ -48,9 +45,13 @@
             scope.row.updateTime | timestampFilter
           }}</span>
         </el-table-column>
-        <el-table-column label="操作" align="center" width="160">
+        <el-table-column class-name="action-column" label="操作" width="100">
           <template slot-scope="scope">
-            <el-button size="mini" type="primary" @click="toEdit(scope.row)"
+            <el-button
+              v-if="checkPrivilege('edit')"
+              class="btn-primary"
+              type="text"
+              @click="toEdit(scope.row)"
               >编辑</el-button
             >
           </template>
@@ -70,15 +71,17 @@
     </div>
 
     <el-dialog
+      v-if="checkPrivilege('edit') || checkPrivilege('add')"
       :visible.sync="visible"
+      top="10vh"
+      width="600px"
       append-to-body
-      width="520"
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       :title="`${modifyType === 'update' ? '修改' : '新增'}小程序`"
     >
       <el-form ref="form" :model="modalForm" :rules="rules" label-width="100px">
-        <el-form-item prop="id" label="应用ID">
+        <el-form-item prop="id" label="应用ID">
           <el-input
             :disabled="modifyType === 'update'"
             v-model.trim="modalForm.id"
@@ -86,14 +89,14 @@
             clearable
           ></el-input>
         </el-form-item>
-        <el-form-item prop="name" label="名称">
+        <el-form-item prop="name" label="名称">
           <el-input
             v-model.trim="modalForm.name"
             placeholder="请输入应用名称"
             clearable
           ></el-input>
         </el-form-item>
-        <el-form-item prop="secret" label="应用密钥">
+        <el-form-item prop="secret" label="应用密钥">
           <el-input
             v-model.trim="modalForm.secret"
             placeholder="请输入应用密钥"