diff --git a/cdTMP/src/api/project/designDemand.js b/cdTMP/src/api/project/designDemand.js index 1fbc07b..70b2117 100644 --- a/cdTMP/src/api/project/designDemand.js +++ b/cdTMP/src/api/project/designDemand.js @@ -13,7 +13,7 @@ export default { }) }, /** - * 传入id以及data编辑设计需求 + * 编辑设计需求 * @returns 成功编辑或失败 */ editDesignDemand(id, data = {}) { @@ -22,5 +22,38 @@ export default { method: "put", data }) - } + }, + /** + * 添加设计需求 + * @returns + */ + save(params = {}) { + return request({ + url: "/project/designDemand/save", + method: "post", + data: params + }) + }, + /** + * 更新dut + * @returns + */ + update(id, data = {}) { + return request({ + url: "/project/designDemand/update/" + id, + method: "put", + data + }) + }, + /** + * 删除设计需求 + * @returns + */ + delete(data) { + return request({ + url: "/project/designDemand/delete", + method: "delete", + data + }) + }, } diff --git a/cdTMP/src/api/project/testDemand.js b/cdTMP/src/api/project/testDemand.js index 39b8c58..051c2d7 100644 --- a/cdTMP/src/api/project/testDemand.js +++ b/cdTMP/src/api/project/testDemand.js @@ -11,12 +11,37 @@ export default { params }) }, - // 修改测试项信息 - editTestDemand(id, data = {}) { + /** + * 添加被测件 + * @returns + */ + save(params = {}) { return request({ - url: `project/editTestDemand/` + id, + url: "/project/testDemand/save", method: "post", + data: params + }) + }, + /** + * 更新dut + * @returns + */ + update(id, data = {}) { + return request({ + url: "/project/testDemand/update/" + id, + method: "put", data }) - } + }, + /** + * 删除dut + * @returns + */ + delete(data) { + return request({ + url: "/project/testDemand/delete", + method: "delete", + data + }) + }, } diff --git a/cdTMP/src/views/project/design-demand/index.vue b/cdTMP/src/views/project/design-demand/index.vue index 08805b6..f7cc1ab 100644 --- a/cdTMP/src/views/project/design-demand/index.vue +++ b/cdTMP/src/views/project/design-demand/index.vue @@ -15,11 +15,14 @@ const route = useRoute() const router = useRouter() // 根据传参获取key,分别为轮次、设计需求的key const roundNumber = route.query.key.split("-")[0] -const dutNumber = route.query.key.split("-")[0] +const dutNumber = route.query.key.split("-")[1] const designDemandNumber = route.query.key.split("-")[2] // crud组件 const crudOptions = ref({ api: testDemandApi.getTestDemandList, + add: { show: true ,api:testDemandApi.save}, + edit: { show: true, api: testDemandApi.update }, + delete: { show: true,api:testDemandApi.delete }, parameters: { projectId: route.query.id, round: roundNumber, @@ -28,9 +31,6 @@ const crudOptions = ref({ }, showIndex: false, rowSelection: { showCheckedAll: true }, - add: { show: true }, - edit: { show: true, api: testDemandApi.editTestDemand }, - delete: { show: true }, searchColNumber: 3, tablePagination: false, operationColumn: true, diff --git a/cdTMP/src/views/project/dut/index.vue b/cdTMP/src/views/project/dut/index.vue index 8fb51c8..07cd0c7 100644 --- a/cdTMP/src/views/project/dut/index.vue +++ b/cdTMP/src/views/project/dut/index.vue @@ -18,6 +18,9 @@ const dutNumber = route.query.key.split("-")[1] // crud组件 const crudOptions = ref({ api: designDemandApi.getDesignDemandList, + add: { show: true ,api: designDemandApi.save}, + edit: { show: true, api: designDemandApi.editDesignDemand }, + delete: { show: true,api: designDemandApi.delete }, parameters: { projectId: route.query.id, round: roundNumber, @@ -25,21 +28,18 @@ const crudOptions = ref({ }, showIndex: false, rowSelection: { showCheckedAll: true }, - add: { show: true }, - edit: { show: true, api: designDemandApi.editDesignDemand }, - delete: { show: true }, searchColNumber: 3, tablePagination: false, operationColumn: true, - operationColumnAlign:'center', + operationColumnAlign: "center", formOption: { - width: 1200, + width: 1200 } }) const crudColumns = ref([ { title: "ID", - align:'center', + align: "center", width: 50, dataIndex: "id", commonRules: [{ required: true, message: "标识是必填" }], @@ -47,7 +47,7 @@ const crudColumns = ref([ }, { title: "标识", - align:'center', + align: "center", width: 120, dataIndex: "ident", search: true, @@ -56,7 +56,7 @@ const crudColumns = ref([ }, { title: "需求名称", - align:'center', + align: "center", width: 150, dataIndex: "name", search: true, @@ -66,8 +66,9 @@ const crudColumns = ref([ { title: "需求类型", width: 150, - align:'center', + align: "center", dataIndex: "demandType", + addDefaultValue: "1", formType: "radio", search: true, dict: { name: "demandType", props: { label: "title", value: "key" }, translation: true }, @@ -77,7 +78,7 @@ const crudColumns = ref([ { title: "需求描述", dataIndex: "description", - hide:true, + hide: true, width: 300, formType: "editor", height: 300