|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="container">
|
|
|
<el-header class="requirement-header">
|
|
|
- <el-input id="basicName" v-model="searchForm.name" placeholder="需求名称" style="width: 8%;" />
|
|
|
+ <el-input id="basicName1" v-model="searchForm.name" placeholder="需求名称" style="width: 8%;" />
|
|
|
<el-dropdown @command="handleCommand">
|
|
|
<span class="el-dropdown-link">
|
|
|
{{ searchTitle.project }}
|
|
@@ -55,7 +55,7 @@
|
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
|
<el-select
|
|
|
- id="basicName"
|
|
|
+ id="basicName2"
|
|
|
v-model="searchForm.pm"
|
|
|
filterable
|
|
|
remote
|
|
@@ -63,12 +63,7 @@
|
|
|
:remote-method="searchUser"
|
|
|
:loading="userLoading"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.idap"
|
|
|
- :label="item.name"
|
|
|
- :value="item.idap"
|
|
|
- >
|
|
|
+ <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
|
|
|
<div style="text-align: center">
|
|
|
<span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
|
|
|
<span>{{ item.name }}</span>
|
|
@@ -77,7 +72,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-select
|
|
|
- id="basicName"
|
|
|
+ id="basicName3"
|
|
|
v-model="searchForm.creator"
|
|
|
filterable
|
|
|
remote
|
|
@@ -85,12 +80,7 @@
|
|
|
:remote-method="searchUser"
|
|
|
:loading="userLoading"
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.idap"
|
|
|
- :label="item.name"
|
|
|
- :value="item.idap"
|
|
|
- >
|
|
|
+ <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="item.idap">
|
|
|
<div style="text-align: center">
|
|
|
<span style="float: left;color: #8492a6; font-size: 13px">{{ item.idap }}</span>
|
|
|
<span>{{ item.name }}</span>
|
|
@@ -114,22 +104,36 @@
|
|
|
@click="createDialogVisible = true"
|
|
|
>新建</el-button>
|
|
|
</div>
|
|
|
- <el-table v-loading="loading" :data="tableData" style="width: 100%" :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF' }">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%"
|
|
|
+ highlight-current-row
|
|
|
+ :header-cell-style="{ background: '#6AB4FF', color: '#FFFFFF' }"
|
|
|
+ @current-change="handleCurrentRowChange"
|
|
|
+ >
|
|
|
<el-table-column prop="priority" label="优先级" sortable min-width="8%">
|
|
|
<template v-slot="scope">
|
|
|
<el-tag size="mini" :type="getType(scope.row.priority)">{{ 'P'+scope.row.priority }}</el-tag>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="name" label="需求名称" sortable min-width="15%" />
|
|
|
- <el-table-column prop="belongingProject" label="业务线" sortable min-width="10%" />
|
|
|
+ <el-table-column prop="belongingProject" label="归属的项目" sortable min-width="10%">
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ getProjectName(scope.row.belongingProject) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="bizId" label="业务线" sortable min-width="10%">
|
|
|
+ <template v-slot="scope">
|
|
|
+ {{ getBizName(scope.row.belongingProject) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="pm" label="产品" sortable min-width="10%" />
|
|
|
<el-table-column prop="taskCount" label="任务总数" sortable min-width="8%" />
|
|
|
<el-table-column prop="bugCount" label="bug总数" sortable min-width="8%" />
|
|
|
<el-table-column prop="creator" label="创建人" sortable min-width="10%" />
|
|
|
<el-table-column prop="createTime" label="创建时间" sortable min-width="10%">
|
|
|
- <template v-slot="scope">
|
|
|
- {{ getcreateTime(scope.row.createTime) }}
|
|
|
- </template>
|
|
|
+ <template v-slot="scope">{{ getcreateTime(scope.row.createTime) }}</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<el-pagination
|
|
@@ -137,18 +141,28 @@
|
|
|
layout="->,total, sizes, prev, pager, next, jumper"
|
|
|
:current-page="searchForm.curIndex"
|
|
|
:page-size="searchForm.pageSize"
|
|
|
- :page-sizes="[10,30,50,total]"
|
|
|
+ :page-sizes="[15,30,45,total]"
|
|
|
:total="total"
|
|
|
@size-change="handleSizeChange"
|
|
|
@current-change="handleCurrentChange"
|
|
|
/>
|
|
|
</el-main>
|
|
|
- <requirement-create :visible="createDialogVisible" @cancel="createDialogVisible=false" @confirm="createDialogVisible=false" /></div>
|
|
|
+ <requirement-create
|
|
|
+ :visible="createDialogVisible"
|
|
|
+ :info="searchInfo"
|
|
|
+ @cancel="createDialogVisible=false"
|
|
|
+ @confirm="createDialogVisible=false"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getRequirement, getSearchInfo, getMemberInfo } from '@/api/requirement.js'
|
|
|
-import RequirementCreate from './requirementCreate'
|
|
|
+import {
|
|
|
+ getRequirement,
|
|
|
+ getSearchInfo,
|
|
|
+ getMemberInfo
|
|
|
+} from '@/api/requirement.js'
|
|
|
+import RequirementCreate from './create'
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -156,12 +170,15 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ currentRow: null,
|
|
|
searchInfo: {
|
|
|
belongingProject: [],
|
|
|
sourceType: [],
|
|
|
bizType: [],
|
|
|
priority: []
|
|
|
},
|
|
|
+ projectOb: {},
|
|
|
+ bizTypeOb: {},
|
|
|
searchForm: {
|
|
|
name: null,
|
|
|
belongingProject: null,
|
|
@@ -170,7 +187,7 @@ export default {
|
|
|
priority: null,
|
|
|
pm: null,
|
|
|
creator: null,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 15,
|
|
|
curIndex: 1
|
|
|
},
|
|
|
searchTitle: {
|
|
@@ -195,29 +212,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.getSearchInfo()
|
|
|
- .then(res => {
|
|
|
- this.getTableData()
|
|
|
- })
|
|
|
+ this.getSearchInfo().then(res => {
|
|
|
+ this.getTableData()
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
getTableData() {
|
|
|
this.loading = true
|
|
|
- getRequirement(this.searchForm)
|
|
|
- .then(res => {
|
|
|
- this.tableData = res.data.list
|
|
|
- this.total = res.data.total
|
|
|
- this.loading = false
|
|
|
- })
|
|
|
+ getRequirement(this.searchForm).then(res => {
|
|
|
+ this.tableData = res.data.list
|
|
|
+ this.total = res.data.total
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
},
|
|
|
getSearchInfo() {
|
|
|
- return getSearchInfo()
|
|
|
- .then(res => {
|
|
|
- this.userLoading = true
|
|
|
- this.searchInfo = res.data
|
|
|
- console.log(this.searchInfo)
|
|
|
- this.userLoading = false
|
|
|
- })
|
|
|
+ return getSearchInfo().then(res => {
|
|
|
+ this.searchInfo = res.data
|
|
|
+ for (const i in this.searchInfo.belongingProject) {
|
|
|
+ this.projectOb[this.searchInfo.belongingProject[i].code] = this.searchInfo.belongingProject[i].msg
|
|
|
+ }
|
|
|
+ for (const i in this.searchInfo.bizType) {
|
|
|
+ this.bizTypeOb[this.searchInfo.bizType[i].code] = this.searchInfo.bizType[i].msg
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
handleCommand(command) {
|
|
|
switch (command.flag) {
|
|
@@ -279,10 +296,11 @@ export default {
|
|
|
this.getTableData()
|
|
|
},
|
|
|
searchUser(query) {
|
|
|
- getMemberInfo({ memberIDAP: query })
|
|
|
- .then(res => {
|
|
|
- this.options = res.data
|
|
|
- })
|
|
|
+ this.userLoading = true
|
|
|
+ getMemberInfo({ memberIDAP: query }).then(res => {
|
|
|
+ this.options = res.data
|
|
|
+ this.userLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
reset() {
|
|
|
this.searchForm = {
|
|
@@ -303,6 +321,23 @@ export default {
|
|
|
priority: '优先级'
|
|
|
}
|
|
|
this.getTableData()
|
|
|
+ },
|
|
|
+ getProjectName(id) {
|
|
|
+ const ret = this.projectOb[id]
|
|
|
+ if (typeof ret === 'undefined') {
|
|
|
+ return '无归属项目'
|
|
|
+ }
|
|
|
+ return ret
|
|
|
+ },
|
|
|
+ getBizName(id) {
|
|
|
+ const ret = this.bizTypeOb[id]
|
|
|
+ if (typeof ret === 'undefined') {
|
|
|
+ return '无'
|
|
|
+ }
|
|
|
+ return ret
|
|
|
+ },
|
|
|
+ handleCurrentRowChange(val) {
|
|
|
+ this.$router.push({ name: '需求详情', params: { id: val.id + '' }})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -333,13 +368,20 @@ export default {
|
|
|
.requirement-header .el-input__inner {
|
|
|
border: none;
|
|
|
}
|
|
|
-#basicName::-webkit-input-placeholder {
|
|
|
+#basicName1::-webkit-input-placeholder {
|
|
|
+ color: #333333;
|
|
|
+}
|
|
|
+#basicName2::-webkit-input-placeholder {
|
|
|
+ color: #333333;
|
|
|
+}
|
|
|
+#basicName3::-webkit-input-placeholder {
|
|
|
color: #333333;
|
|
|
}
|
|
|
.priority_div {
|
|
|
- width:fit-content;
|
|
|
- width:-webkit-fit-content;
|
|
|
- width:-moz-fit-content;
|
|
|
+ width: fit-content;
|
|
|
+ width: -webkit-fit-content;
|
|
|
+ width: -moz-fit-content;
|
|
|
color: #ffffff;
|
|
|
}
|
|
|
+.requirement-main .el-table .el-table__body tr:hover td { color: #409EFF; background: #EEF0F5; } /*hover时字体, 背景颜色*/
|
|
|
</style>
|