987
This commit is contained in:
@@ -87,6 +87,13 @@ const columns = ref([
|
||||
width: 220,
|
||||
commonRules: [{ required: true, message: "字典标签必填" }]
|
||||
},
|
||||
{
|
||||
title:"字段缩写",
|
||||
dataIndex:"show_title",
|
||||
width: 220,
|
||||
align: "center",
|
||||
search: true,
|
||||
},
|
||||
{
|
||||
title: "字典键值",
|
||||
align: "center",
|
||||
|
||||
@@ -150,8 +150,9 @@ const crudColumns = ref([
|
||||
width: 140,
|
||||
search: true,
|
||||
dataIndex: "ident",
|
||||
editDisabled: true,
|
||||
addDisabled: true,
|
||||
addDefaultValue: `PT_${route.query.ident}_`,
|
||||
commonRules: [{ required: true, message: "标识是必填" }],
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<div class="ma-content-block lg:flex justify-between p-4">
|
||||
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||
<!-- CRUD组件 -->
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns"></ma-crud>
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns">
|
||||
<template #ident="{ record }">
|
||||
{{ showType(record) }}
|
||||
</template>
|
||||
</ma-crud>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -12,6 +16,7 @@ import { ref } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import testDemandApi from "@/api/project/testDemand"
|
||||
import { useTreeDataStore } from "@/store"
|
||||
import commonApi from "@/api/common"
|
||||
const treeDataStore = useTreeDataStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -20,6 +25,23 @@ const roundNumber = route.query.key.split("-")[0]
|
||||
const dutNumber = route.query.key.split("-")[1]
|
||||
const designDemandNumber = route.query.key.split("-")[2]
|
||||
const projectId = ref(route.query.id)
|
||||
// 标识显示字段
|
||||
const testTypeDict = ref([])
|
||||
!(function () {
|
||||
commonApi.getDict("testType").then((res) => {
|
||||
testTypeDict.value = res
|
||||
})
|
||||
})()
|
||||
const showType = (record) => {
|
||||
let len = testTypeDict.value.data.length
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (testTypeDict.value.data[i].key === record.testType) {
|
||||
let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1
|
||||
let item = testTypeDict.value.data[i]
|
||||
return item.show_title + "-" + record.ident + "-" + key_string.toString().padStart(3,"0")
|
||||
}
|
||||
}
|
||||
}
|
||||
// crud组件
|
||||
const crudOptions = ref({
|
||||
api: testDemandApi.getTestDemandList,
|
||||
|
||||
@@ -2,15 +2,20 @@
|
||||
<div class="ma-content-block lg:flex justify-between p-4">
|
||||
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||
<!-- CRUD组件 -->
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns"></ma-crud>
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns">
|
||||
<template #ident="{ record }">
|
||||
{{ showType(record) }}
|
||||
</template>
|
||||
</ma-crud>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue"
|
||||
<script setup lang="jsx">
|
||||
import { ref, computed } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import designDemandApi from "@/api/project/designDemand"
|
||||
import commonApi from "@/api/common"
|
||||
import { useTreeDataStore } from "@/store"
|
||||
const treeDataStore = useTreeDataStore()
|
||||
const route = useRoute()
|
||||
@@ -18,6 +23,24 @@ const router = useRouter()
|
||||
const roundNumber = route.query.key.split("-")[0]
|
||||
const dutNumber = route.query.key.split("-")[1]
|
||||
const projectId = ref(route.query.id)
|
||||
// 显示标识是FT-{标识}-001,大体思路是:根据类型生成FT,拼接标识和key的最后一位
|
||||
const demandTypeDict = ref([])
|
||||
!(function () {
|
||||
commonApi.getDict("demandType").then((res) => {
|
||||
demandTypeDict.value = res
|
||||
})
|
||||
})()
|
||||
|
||||
const showType = (record) => {
|
||||
let len = demandTypeDict.value.data.length
|
||||
for (let i = 0; i < len; i++) {
|
||||
if (demandTypeDict.value.data[i].key === record.demandType) {
|
||||
let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1
|
||||
let item = demandTypeDict.value.data[i]
|
||||
return item.show_title + "-" + record.ident + "-" + key_string.toString().padStart(3,"0")
|
||||
}
|
||||
}
|
||||
}
|
||||
// crud组件
|
||||
const crudOptions = ref({
|
||||
api: designDemandApi.getDesignDemandList,
|
||||
@@ -81,11 +104,11 @@ const crudColumns = ref([
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
{
|
||||
title:'章节号',
|
||||
align:'center',
|
||||
width:150,
|
||||
dataIndex:'chapter',
|
||||
search:true,
|
||||
title: "章节号",
|
||||
align: "center",
|
||||
width: 150,
|
||||
dataIndex: "chapter",
|
||||
search: true
|
||||
},
|
||||
{
|
||||
title: "需求类型",
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<div class="ma-content-block lg:flex justify-between p-4">
|
||||
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||
<!-- CRUD组件 -->
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns"></ma-crud>
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns">
|
||||
<template #ident="{ record }">
|
||||
{{ showType(record) }}
|
||||
</template>
|
||||
</ma-crud>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -20,6 +24,11 @@ const dutNumber = route.query.key.split("-")[1]
|
||||
const designDemandNumber = route.query.key.split("-")[2]
|
||||
const testDemandNumber = route.query.key.split("-")[3]
|
||||
const projectId = ref(route.query.id)
|
||||
// 标识显示字段
|
||||
const showType = (record) => {
|
||||
let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1
|
||||
return record.ident + "-" + "YL" + key_string.toString().padStart(3,"0")
|
||||
}
|
||||
// crud设置
|
||||
const crudOptions = ref({
|
||||
api: caseApi.getCaseList,
|
||||
@@ -93,8 +102,11 @@ const crudColumns = ref([
|
||||
sortable: { sortDirections: ["ascend"] },
|
||||
width: 140,
|
||||
align: "center",
|
||||
addDisabled: true,
|
||||
addDefaultValue: route.query.key,
|
||||
editDefaultValue: route.query.key,
|
||||
editDisabled: true,
|
||||
search: true,
|
||||
commonRules: [{ required: true, message: "标识是必填" }],
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user