Browse Source

修改登录页标题/修改表单组表单绑定逻辑

lph 1 year ago
parent
commit
d7ec3aa4d3

+ 51 - 51
zkqy-ui/src/views/login.vue

@@ -8,16 +8,17 @@
       ref="loginForm"
       :model="loginForm"
       :rules="loginRules"
-      class="login-form">
+      class="login-form"
+    >
       <el-row>
         <el-col :span="12" class="comlogo"></el-col>
         <el-col :span="12">
           <div class="grid-content bg-purple-dark title">
-            工业应用操作系统
+            <!-- 工业应用操作系统 -->
+            工业应用引擎
             <!-- 智能制造平台 -->
           </div>
-        </el-col
-        >
+        </el-col>
       </el-row>
       <el-row class="rowww">
         <el-col :span="12" class="text" prop="username">用户名</el-col>
@@ -60,7 +61,7 @@
           </el-col>
           <el-col :span="4" :offset="1">
             <div class="login-code">
-              <img :src="codeUrl" @click="getCode" class="login-code-img"/>
+              <img :src="codeUrl" @click="getCode" class="login-code-img" />
             </div>
           </el-col>
         </el-row>
@@ -71,9 +72,8 @@
           <img :src="codeUrl" @click="getCode" class="login-code-img" />
         </div> -->
         <el-checkbox v-model="loginForm.rememberMe" class="aaa"
-        >在这个设备上记住我
-        </el-checkbox
-        >
+          >在这个设备上记住我
+        </el-checkbox>
       </el-row>
 
       <el-row>
@@ -81,19 +81,18 @@
           class="logg"
           :loading="loading"
           @click.native.prevent="handleLogin"
-        >登录
-        </el-col
-        >
+          >登录
+        </el-col>
       </el-row>
     </el-form>
   </div>
 </template>
 
 <script>
-import {getCodeImg, isTenantExist} from "@/api/login";
-import {changeDatasource} from "@/api/dataEngine";
+import { getCodeImg, isTenantExist } from "@/api/login";
+import { changeDatasource } from "@/api/dataEngine";
 import Cookies from "js-cookie";
-import {encrypt, decrypt} from "@/utils/jsencrypt";
+import { encrypt, decrypt } from "@/utils/jsencrypt";
 
 export default {
   name: "Login",
@@ -110,16 +109,16 @@ export default {
         rememberMe: false,
         code: "",
         uuid: "",
-        tenantID: ""
+        tenantID: "",
       },
       loginRules: {
         username: [
-          {required: true, trigger: "blur", message: "请输入您的账号"},
+          { required: true, trigger: "blur", message: "请输入您的账号" },
         ],
         password: [
-          {required: true, trigger: "blur", message: "请输入您的密码"},
+          { required: true, trigger: "blur", message: "请输入您的密码" },
         ],
-        code: [{required: true, trigger: "blur", message: "请输入验证码"}],
+        code: [{ required: true, trigger: "blur", message: "请输入验证码" }],
       },
       loading: true,
       // 验证码开关
@@ -140,45 +139,46 @@ export default {
     },
   },
   created() {
-    this.validateTenantId()
+    this.validateTenantId();
   },
   methods: {
     handleBlur(event) {
-      if (event.target.value.toLowerCase() === 'admin') {
-        this.loginForm.username = '';
-        this.$message.warning("请使用当前租户下的账号登录!")
+      if (event.target.value.toLowerCase() === "admin") {
+        this.loginForm.username = "";
+        this.$message.warning("请使用当前租户下的账号登录!");
       }
-      if (event.target.value.toLowerCase() === 'Admin') {
-        this.loginForm.username = '';
-        this.$message.warning("请使用当前租户下的账号登录!")
+      if (event.target.value.toLowerCase() === "Admin") {
+        this.loginForm.username = "";
+        this.$message.warning("请使用当前租户下的账号登录!");
       }
     },
     // 校验url
     validateTenantId() {
-      let tenantCode = this.$route.query['tenantCode']
+      let tenantCode = this.$route.query["tenantCode"];
       if (tenantCode != null) {
         // 得到tenantId 查询裤中是否存在该租户
-        isTenantExist({tenantCode: tenantCode}).then(res => {
+        isTenantExist({ tenantCode: tenantCode }).then((res) => {
           if (res == undefined) {
-            this.$router.push({path: "/401"})
-          } else if (res.data?.tenantId) { // 判断当前编号是否存在库中
+            this.$router.push({ path: "/401" });
+          } else if (res.data?.tenantId) {
+            // 判断当前编号是否存在库中
             this.tenantId = res.data.tenantId;
             this.loginForm.tenantID = this.tenantId;
             if (res.data.loginPageConfiguration != null) {
               // 得到租户的信息
-              this.config = res.data.loginPageConfiguration
+              this.config = res.data.loginPageConfiguration;
               this.setConfig();
             }
             this.getCode();
             this.getCookie();
           } else {
-            console.log("租户有问题!")
+            console.log("租户有问题!");
             // 当前访问链接中的租户编号不存在
-            this.$router.push({path: "/401"})
+            this.$router.push({ path: "/401" });
           }
-        })
+        });
       } else {
-        this.$router.push({path: "/401"})
+        this.$router.push({ path: "/401" });
       }
     },
     setConfig() {
@@ -198,7 +198,6 @@ export default {
           loginBgDom[0].style.backgroundImage = `url(${
             process.env.VUE_APP_BASE_IMG_API + loginPageBackgroundImage
           })`;
-
         }
       }
 
@@ -228,7 +227,6 @@ export default {
       if (loginPageDescription) {
         this.config.pageDescription = loginPageDescription;
       }
-
     },
     getCode() {
       getCodeImg().then((res) => {
@@ -257,7 +255,7 @@ export default {
         if (valid) {
           this.loading = true;
           if (this.loginForm.rememberMe) {
-            Cookies.set("username", this.loginForm.username, {expires: 30});
+            Cookies.set("username", this.loginForm.username, { expires: 30 });
             Cookies.set("password", encrypt(this.loginForm.password), {
               expires: 30,
             });
@@ -271,18 +269,20 @@ export default {
           }
           let form = {
             ...this.loginForm,
-            tenantID: this.tenantId
-          }
-          this.$store.dispatch("Login", form).then(() => {
-            // changeDatasource(); //切换数据源
-            this.$router.push({path: this.redirect || "/"}).catch(() => {
+            tenantID: this.tenantId,
+          };
+          this.$store
+            .dispatch("Login", form)
+            .then(() => {
+              // changeDatasource(); //切换数据源
+              this.$router.push({ path: this.redirect || "/" }).catch(() => {});
+            })
+            .catch(() => {
+              this.loading = false;
+              if (this.captchaEnabled) {
+                this.getCode();
+              }
             });
-          }).catch(() => {
-            this.loading = false;
-            if (this.captchaEnabled) {
-              this.getCode();
-            }
-          });
         }
       });
     },
@@ -340,9 +340,9 @@ export default {
   opacity: 1;
   border-radius: 27px;
   background: linear-gradient(
-      135deg,
-      rgba(79, 138, 255, 1) 0%,
-      rgba(75, 94, 255, 1) 100%
+    135deg,
+    rgba(79, 138, 255, 1) 0%,
+    rgba(75, 94, 255, 1) 100%
   );
   box-shadow: 0px 4px 16px rgba(179, 192, 231, 1);
   color: #fff;

+ 15 - 0
zkqy-ui/src/views/system/bpmnPro/components/Panel/components/ElementUnusualTasks.vue

@@ -331,6 +331,15 @@ export default {
       return formList;
     },
   },
+  watch: {
+    scriptKeyList: {
+      handler: (val) => {
+        console.log('new val',val);
+      },
+      deep: true,
+      immediate: true
+    }
+  },
   methods: {
     // 自定义表单规则
     composeNameValidate(rule, value, callback) {
@@ -441,6 +450,11 @@ export default {
         scriptType: "0",
         industryType,
       };
+      console.log(
+        this.allScriptList(),
+        condition,
+        filterUtil(condition, this.allScriptList())
+      );
       this.scriptKeyList = filterUtil(condition, this.allScriptList()).map(
         (item) => ({
           value: item.scriptKey,
@@ -448,6 +462,7 @@ export default {
           tableName: item.tableName,
         })
       );
+      console.log(JSON.parse(JSON.stringify(this.scriptKeyList)));
     },
     async getDragFormList() {
       try {

+ 1 - 1
zkqy-ui/src/views/system/excuteBtnMange/index.vue

@@ -89,7 +89,7 @@
         prop="btnGroupName"
         label="按钮组名称"
         :show-overflow-tooltip="true"
-        width="160"
+        width="250"
         align="center"
       ></el-table-column>
       <el-table-column prop="btnIcon" label="图标" align="center" width="100">

+ 5 - 3
zkqy-ui/src/views/system/formGroupMange/index.vue

@@ -465,7 +465,7 @@
         <el-table-column prop="tableName" label="依赖表单">
           <template slot-scope="scope">
             <el-select
-              v-model="scope.row.tableName"
+              v-model="scope.row.formKey"
               placeholder="请选择依赖表单"
               clearable
               filterable
@@ -710,8 +710,9 @@ export default {
     },
     // 依赖的主表单变化回调
     async changeTableName(row) {
-      if (row.tableName) {
-        let tableName = this.getTableNameByFormKey(row.tableName);
+      if (row.formKey) {
+        let tableName = this.getTableNameByFormKey(row.formKey);
+        row.tableName = tableName;
         let data = {
           databaseName: this.databaseName,
           databaseType: this.databaseType,
@@ -740,6 +741,7 @@ export default {
       this.conditionTableData.push({
         fieldName: "", //字段
         type: "", //类型
+        formKey: "", //字段
         tableName: "", //依赖表单
         relaField: "", //依赖字段
         refValue: "", //默认值