|
@@ -158,6 +158,21 @@
|
|
|
<RowItem :label="'ID:'" :label-span="5" :value-span="19">{{scope.row.id}}</RowItem>
|
|
<RowItem :label="'ID:'" :label-span="5" :value-span="19">{{scope.row.id}}</RowItem>
|
|
|
<RowItem :label="'信息:'" :label-span="5" :value-span="19">{{scope.row.message}}</RowItem>
|
|
<RowItem :label="'信息:'" :label-span="5" :value-span="19">{{scope.row.message}}</RowItem>
|
|
|
<RowItem :label="'时间:'" :label-span="5" :value-span="19">{{formatter(scope.row.timestamp)}}</RowItem>
|
|
<RowItem :label="'时间:'" :label-span="5" :value-span="19">{{formatter(scope.row.timestamp)}}</RowItem>
|
|
|
|
|
+ <RowItem :label="'操作:'" :label-span="5" :value-span="19">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="!deletedCommitIndex.has(scope.$index)"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ @click="handleDelete(scope.$index,scope.row.id)"
|
|
|
|
|
+ >删除</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-else
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="info"
|
|
|
|
|
+ @click="handleRestore(scope.$index, scope.row.id)"
|
|
|
|
|
+ >撤销</el-button>
|
|
|
|
|
+ </RowItem>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -184,7 +199,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-import { RequirementAPI } from '@/api';
|
|
|
|
|
|
|
+import { ProjectAPI, RequirementAPI } from '@/api';
|
|
|
import PriorityTag from '@/components/PriorityTag.vue';
|
|
import PriorityTag from '@/components/PriorityTag.vue';
|
|
|
import StateTag from '@/components/StateTag.vue';
|
|
import StateTag from '@/components/StateTag.vue';
|
|
|
import { priorityOptions, stateOptions } from '@/utils/constants';
|
|
import { priorityOptions, stateOptions } from '@/utils/constants';
|
|
@@ -232,6 +247,7 @@ export default {
|
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
|
stateOptions,
|
|
stateOptions,
|
|
|
priorityOptions,
|
|
priorityOptions,
|
|
|
|
|
+ deletedCommitIndex: new Set(),
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -278,6 +294,16 @@ export default {
|
|
|
changeContent(id) {
|
|
changeContent(id) {
|
|
|
this.$emit('change', id);
|
|
this.$emit('change', id);
|
|
|
},
|
|
},
|
|
|
|
|
+ async handleDelete(index, commitId) {
|
|
|
|
|
+ await ProjectAPI.linkCommit(this.$store.state.workspace.currentProjectId, commitId, 'NONE', this.id);
|
|
|
|
|
+ this.deletedCommitIndex.add(index);
|
|
|
|
|
+ },
|
|
|
|
|
+ async handleRestore(index, commitId) {
|
|
|
|
|
+ console.log(commitId);
|
|
|
|
|
+ console.log(index);
|
|
|
|
|
+ await ProjectAPI.linkCommit(this.$store.state.workspace.currentProjectId, commitId, 'TREE_ID', this.id);
|
|
|
|
|
+ this.deletedCommitIndex.delete(index);
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|