xiatian 5 жил өмнө
parent
commit
f61e2e75e2

+ 31 - 6
src/modules/basic/view/clientConfig.vue

@@ -9,6 +9,20 @@
         class="demo-ruleForm"
         :inline-message="true"
       >
+        <el-form-item v-if="isSuperAdmin" label="学校">
+          <el-select
+            v-model="ruleForm.orgId"
+            placeholder="请选择"
+            style="width: 180px"
+          >
+            <el-option
+              v-for="item in rootOrgList"
+              :label="item.name"
+              :value="item.id"
+              :key="item.id"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="系统名称" prop="OE_STUDENT_SYS_NAME">
           <el-input
             v-model="ruleForm.OE_STUDENT_SYS_NAME"
@@ -117,7 +131,7 @@ import {
 export default {
   data() {
     return {
-      rootOrgId: null,
+      rootOrgList: [],
       loginTypes: LOGIN_TYPE,
       propertyGroupId: "",
       preventCheatingConfigs: PREVENT_CHEATING_CONFIG,
@@ -214,13 +228,13 @@ export default {
     },
 
     initForm() {
-      this.ruleForm.orgId = this.user.rootOrgId;
+      this.uploadAction = CORE_API + "/org/importLogo/" + this.ruleForm.orgId;
       this.ruleForm.STUDENT_CLIENT_DEFAULT_SIZE = "1400*900";
       this.ruleForm.relatedPropertyGroupIdList = ["studentClientConfig"];
       var url =
         CORE_API +
         "/org/getOrgPropertiesByGroupWithoutCache/" +
-        this.rootOrgId +
+        this.ruleForm.orgId +
         "/" +
         this.propertyGroupId;
       this.$httpWithMsg.get(url).then(response => {
@@ -419,17 +433,25 @@ export default {
     }
   },
   created() {
-    this.rootOrgId = this.user.rootOrgId;
+    this.ruleForm.orgId = this.user.rootOrgId;
     this.propertyGroupId = "studentClientConfig4Edit";
-    this.uploadAction = CORE_API + "/org/importLogo/" + this.rootOrgId;
     this.uploadHeaders = {
       key: this.user.key,
       token: this.user.token
     };
-    console.log(this.propertyGroupId);
+    if (this.isSuperAdmin) {
+      this.$httpWithMsg.get(CORE_API + "/org/getRootOrgList").then(response => {
+        this.rootOrgList = response.data;
+      });
+    }
     this.initForm();
   },
   watch: {
+    "ruleForm.orgId": {
+      handler: function() {
+        this.initForm();
+      }
+    },
     ruleForm: {
       deep: true,
       handler: function(newForm) {
@@ -460,6 +482,9 @@ export default {
     btnSaveDiabled() {
       console.log(this.formDataChanged);
       return !this.formDataChanged;
+    },
+    isSuperAdmin() {
+      return this.user.roleList.some(role => role.roleCode == "SUPER_ADMIN");
     }
   }
 };

+ 19 - 5
src/modules/basic/view/sys_prop_list.vue

@@ -91,8 +91,9 @@
       <!-- 新增或修改弹出框 -->
       <el-dialog
         title="参数信息"
-        width="450px"
+        width="700px"
         :visible.sync="sysPropDialog"
+        :close-on-click-modal="false"
         @close="dialogBeforeClose"
       >
         <el-form
@@ -116,6 +117,7 @@
           </el-form-item>
           <el-form-item label="类型" prop="propValueType">
             <el-select
+              :disabled="this.disPropValueType()"
               class="pull_length"
               :remote-method="getBasicDataTypes"
               @focus="e => getBasicDataTypes(e.target.value)"
@@ -136,7 +138,8 @@
           </el-form-item>
           <el-form-item label="参数值" prop="propValue">
             <el-input
-              class="pull_length"
+              class="pull_length text_area"
+              type="textarea"
               v-model="sysPropForm.propValue"
               auto-complete="off"
               placeholder="请输入参数值"
@@ -145,7 +148,8 @@
           </el-form-item>
           <el-form-item label="描述" prop="description">
             <el-input
-              class="pull_length"
+              type="textarea"
+              class="pull_length text_area"
               v-model="sysPropForm.description"
               auto-complete="off"
               placeholder="请输入参数描述"
@@ -276,6 +280,13 @@ export default {
     }
   },
   methods: {
+    disPropValueType() {
+      if (this.sysPropForm.propKey) {
+        return true;
+      } else {
+        return false;
+      }
+    },
     dialogBeforeClose() {
       this.$refs.sysPropForm.clearValidate();
     },
@@ -481,9 +492,12 @@ export default {
   width: 180px;
 }
 .pull_center {
-  margin-left: 120px;
+  text-align: center;
 }
 .pull_length {
-  width: 200px;
+  width: 400px;
+}
+.text_area {
+  margin-bottom: 10px;
 }
 </style>