refactor: 缺陷列表样式优化

This commit is contained in:
chenjianxing 2021-07-21 10:59:06 +08:00 committed by jianxing
parent 5178c5b457
commit 2b7109ab85
8 changed files with 17 additions and 19 deletions

View File

@ -122,6 +122,7 @@ export default {
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
}, },
refreshTable() { refreshTable() {
this.$refs.table.reloadTable();
}, },
appendData(customFieldIds) { appendData(customFieldIds) {
let condition = {}; let condition = {};
@ -148,7 +149,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
/*.default-value-item >>> .custom-with {*/
/* width: 207px;*/
/*}*/
</style> </style>

View File

@ -18,7 +18,8 @@
field-key="CUSTOM_FIELD" field-key="CUSTOM_FIELD"
:screen-height="tableHeight" :screen-height="tableHeight"
@handlePageChange="getCustomFields" @handlePageChange="getCustomFields"
@refresh="getCustomFields"> @refresh="getCustomFields"
ref="table">
<div v-for="(item) in fields" :key="item.key"> <div v-for="(item) in fields" :key="item.key">
@ -200,6 +201,7 @@ export default {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable();
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -232,7 +234,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
/deep/ .el-table__fixed-body-wrapper {
top: 47PX !IMPORTANT;
}
</style> </style>

View File

@ -159,6 +159,7 @@ export default {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable();
}); });
} }
}, },

View File

@ -199,6 +199,7 @@ export default {
} }
this.templateContainIds.add(item.fieldId); this.templateContainIds.add(item.fieldId);
}); });
this.$refs.customFieldFormList.refreshTable();
}); });
} else { } else {
this.appendDefaultFiled(); this.appendDefaultFiled();

View File

@ -17,7 +17,8 @@
:screen-height="tableHeight" :screen-height="tableHeight"
:enable-selection="false" :enable-selection="false"
@handlePageChange="initTableData" @handlePageChange="initTableData"
@refresh="initTableData"> @refresh="initTableData"
ref="table">
<ms-table-column <ms-table-column
:label="$t('commons.name')" :label="$t('commons.name')"
@ -147,6 +148,7 @@ export default {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable();
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -178,7 +180,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
/deep/ .el-table__fixed-body-wrapper {
top: 47PX !IMPORTANT;
}
</style> </style>

View File

@ -16,7 +16,8 @@
:screen-height="tableHeight" :screen-height="tableHeight"
:enable-selection="false" :enable-selection="false"
@handlePageChange="initTableData" @handlePageChange="initTableData"
@refresh="initTableData"> @refresh="initTableData"
ref="table">
<ms-table-column <ms-table-column
:label="$t('commons.name')" :label="$t('commons.name')"
@ -155,6 +156,7 @@ export default {
let data = response.data; let data = response.data;
this.total = data.itemCount; this.total = data.itemCount;
this.tableData = data.listObject; this.tableData = data.listObject;
this.$refs.table.reloadTable();
}); });
}, },
handleEdit(data) { handleEdit(data) {
@ -186,7 +188,4 @@ export default {
</script> </script>
<style scoped> <style scoped>
/deep/ .el-table__fixed-body-wrapper {
top: 47PX !IMPORTANT;
}
</style> </style>

View File

@ -24,7 +24,7 @@
<el-row class="custom-field-row"> <el-row class="custom-field-row">
<el-col :span="8" v-if="hasTapdId"> <el-col :span="8" v-if="hasTapdId">
<el-form-item :label="$t('test_track.issue.tapd_current_owner')" prop="tapdUsers"> <el-form-item :label-width="formLabelWidth" :label="$t('test_track.issue.tapd_current_owner')" prop="tapdUsers">
<el-select v-model="form.tapdUsers" multiple filterable <el-select v-model="form.tapdUsers" multiple filterable
:placeholder="$t('test_track.issue.please_choose_current_owner')"> :placeholder="$t('test_track.issue.please_choose_current_owner')">
<el-option v-for="(userInfo, index) in tapdUsers" :key="index" :label="userInfo.user" <el-option v-for="(userInfo, index) in tapdUsers" :key="index" :label="userInfo.user"
@ -33,7 +33,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="hasZentaoId"> <el-col :span="8" v-if="hasZentaoId">
<el-form-item :label="$t('test_track.issue.zentao_bug_build')" prop="zentaoBuilds"> <el-form-item :label-width="formLabelWidth" :label="$t('test_track.issue.zentao_bug_build')" prop="zentaoBuilds">
<el-select v-model="form.zentaoBuilds" multiple filterable <el-select v-model="form.zentaoBuilds" multiple filterable
:placeholder="$t('test_track.issue.zentao_bug_build')"> :placeholder="$t('test_track.issue.zentao_bug_build')">
<el-option v-for="(build, index) in Builds" :key="index" :label="build.name" <el-option v-for="(build, index) in Builds" :key="index" :label="build.name"
@ -42,7 +42,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" v-if="hasZentaoId"> <el-col :span="8" v-if="hasZentaoId">
<el-form-item :label="$t('test_track.issue.zentao_bug_assigned')" prop="zentaoAssigned"> <el-form-item :label-width="formLabelWidth" :label="$t('test_track.issue.zentao_bug_assigned')" prop="zentaoAssigned">
<el-select v-model="form.zentaoAssigned" filterable <el-select v-model="form.zentaoAssigned" filterable
:placeholder="$t('test_track.issue.please_choose_current_owner')"> :placeholder="$t('test_track.issue.please_choose_current_owner')">
<el-option v-for="(userInfo, index) in zentaoUsers" :key="index" :label="userInfo.name" <el-option v-for="(userInfo, index) in zentaoUsers" :key="index" :label="userInfo.name"
@ -96,7 +96,7 @@ export default {
result: {}, result: {},
relateFields: [], relateFields: [],
isFormAlive: true, isFormAlive: true,
formLabelWidth: "100px", formLabelWidth: "150px",
issueTemplate: {}, issueTemplate: {},
customFieldForm: {}, customFieldForm: {},
customFieldRules: {}, customFieldRules: {},

View File

@ -99,6 +99,7 @@ export default {
this.tableData.forEach(item => { this.tableData.forEach(item => {
this.testCaseContainIds.add(item.id); this.testCaseContainIds.add(item.id);
}); });
this.$refs.table.reloadTable();
}); });
} }
}, },