Merge branch 'v1.2'

This commit is contained in:
chenjianxing 2020-08-28 11:38:35 +08:00
commit 2548bad565
4 changed files with 18 additions and 11 deletions

View File

@ -0,0 +1 @@
ALTER TABLE test_case MODIFY COLUMN node_path varchar(999) NOT NULL COMMENT 'Node path this case belongs to' ;

View File

@ -72,6 +72,9 @@
},
methods: {
addTemplate(template) {
if (!this.beanShellProcessor.script) {
this.beanShellProcessor.script = "";
}
this.beanShellProcessor.script += template.value;
this.reload();
},

View File

@ -131,6 +131,7 @@
<el-row v-if="form.method && form.method != 'auto'" type="flex" justify="center">
<el-col :span="20">
<el-table
v-if="isStepTableAlive"
:data="form.steps"
class="tb-edit"
border
@ -145,7 +146,7 @@
size="mini"
:disabled="readOnly"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:autosize="{ minRows: 1, maxRows: 6}"
:rows="2"
v-model="scope.row.desc"
:placeholder="$t('commons.input_content')"
@ -159,7 +160,7 @@
size="mini"
:disabled="readOnly"
type="textarea"
:autosize="{ minRows: 2, maxRows: 4}"
:autosize="{ minRows: 1, maxRows: 6}"
:rows="2"
v-model="scope.row.result"
:placeholder="$t('commons.input_content')"
@ -272,7 +273,8 @@ export default {
},
formLabelWidth: "120px",
operationType: '',
isCreateContinue: false
isCreateContinue: false,
isStepTableAlive: true
};
},
props: {
@ -302,6 +304,10 @@ export default {
}
},
methods: {
reload() {
this.isStepTableAlive = false;
this.$nextTick(() => (this.isStepTableAlive = true));
},
open(testCase) {
this.resetForm();
@ -339,6 +345,7 @@ export default {
}
this.getSelectOptions();
this.reload();
this.dialogFormVisible = true;
},
handleAddStep(index, data) {

View File

@ -1,6 +1,6 @@
import router from './components/common/router/router'
import {TokenKey} from '../common/js/constants';
import {hasRolePermissions, hasRoles} from "../common/js/utils";
import {TokenKey} from '@/common/js/constants';
import {hasRolePermissions, hasRoles} from "@/common/js/utils";
const whiteList = ['/login']; // no redirect whitelist
@ -17,22 +17,18 @@ export const roles = {
};
function checkRolePermission(el, binding, type) {
const { value } = binding;
const rolesString = localStorage.getItem("roles");
const roles = rolesString.split(',');
const {value} = binding;
if (value && value instanceof Array && value.length > 0) {
const permissionRoles = value;
let hasPermission = false;
if (type === 'roles') {
hasPermission = hasRoles(...permissionRoles);
hasPermission = hasRoles(...permissionRoles);
} else if (type === 'permission') {
hasPermission = hasRolePermissions(...permissionRoles);
}
if (!hasPermission) {
el.parentNode && el.parentNode.removeChild(el)
}
} else {
// throw new Error(`need roles! Like v-permission="['admin','editor']"`)
}
}