Browse Source

fix: 修复选择候选人员数据为空导致页面加载失败问题

master
tony 3 years ago
parent
commit
bd47623b68
  1. 7
      ruoyi-ui/src/components/flow/Expression/index.vue
  2. 15
      ruoyi-ui/src/components/flow/Role/index.vue
  3. 17
      ruoyi-ui/src/components/flow/User/index.vue

7
ruoyi-ui/src/components/flow/Expression/index.vue

@ -25,7 +25,7 @@
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="expressionList" @current-change="handleSingleExpSelect">
<el-table v-loading="loading" :data="expressionList" row-key="id" @current-change="handleSingleExpSelect">
<el-table-column width="55" align="center" >
<template slot-scope="scope">
<!-- 可以手动的修改label的值从而控制选择哪一项 -->
@ -51,6 +51,7 @@
<script>
import { listExpression } from "@/api/system/expression";
import {StrUtil} from "@/utils/StrUtil";
export default {
name: "Expression",
@ -98,7 +99,9 @@ export default {
watch: {
selectValues: {
handler(newVal) {
this.radioSelected = newVal
if (StrUtil.isNotBlank(newVal)) {
this.radioSelected = newVal
}
},
immediate: true,
}

15
ruoyi-ui/src/components/flow/Role/index.vue

@ -60,6 +60,7 @@
<script>
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import {StrUtil} from "@/utils/StrUtil";
export default {
name: "FlowRole",
@ -109,23 +110,25 @@ export default {
//
form: {},
radioSelected: null, //
selectRoleList: null //
selectRoleList: [] //
};
},
watch: {
selectValues: {
handler(newVal) {
if (newVal instanceof Number || newVal instanceof String) {
this.radioSelected = newVal
} else {
this.selectRoleList = newVal;
if (StrUtil.isNotBlank(newVal)) {
if (newVal instanceof Number || newVal instanceof String) {
this.radioSelected = newVal
} else {
this.selectRoleList = newVal;
}
}
},
immediate: true
},
roleList: {
handler(newVal) {
if (newVal && this.selectRoleList) {
if (StrUtil.isNotBlank(newVal) && this.selectRoleList.length > 0) {
this.$nextTick(() => {
this.$refs.dataTable.clearSelection();
this.selectRoleList?.split(',').forEach(key => {

17
ruoyi-ui/src/components/flow/User/index.vue

@ -90,6 +90,7 @@
import { listUser, deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {StrUtil} from "@/utils/StrUtil";
export default {
name: "FlowUser",
@ -125,7 +126,7 @@ export default {
//
total: 0,
//
userList: null,
userList: [],
//
title: "",
//
@ -160,7 +161,7 @@ export default {
{ key: 6, label: `创建时间`, visible: true }
],
radioSelected: null, //
selectUserList: null //
selectUserList: [] //
};
},
watch: {
@ -170,17 +171,19 @@ export default {
},
selectValues: {
handler(newVal) {
if (newVal instanceof Number) {
this.radioSelected = newVal
} else {
this.selectUserList = newVal;
if (StrUtil.isNotBlank(newVal)) {
if (newVal instanceof Number) {
this.radioSelected = newVal
} else {
this.selectUserList = newVal;
}
}
},
immediate: true
},
userList: {
handler(newVal) {
if (newVal && this.selectUserList) {
if (StrUtil.isNotBlank(newVal) && this.selectUserList.length > 0) {
this.$nextTick(() => {
this.$refs.dataTable.clearSelection();
this.selectUserList?.split(',').forEach(key => {

Loading…
Cancel
Save