987
This commit is contained in:
@@ -87,6 +87,13 @@ const columns = ref([
|
|||||||
width: 220,
|
width: 220,
|
||||||
commonRules: [{ required: true, message: "字典标签必填" }]
|
commonRules: [{ required: true, message: "字典标签必填" }]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title:"字段缩写",
|
||||||
|
dataIndex:"show_title",
|
||||||
|
width: 220,
|
||||||
|
align: "center",
|
||||||
|
search: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "字典键值",
|
title: "字典键值",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|||||||
@@ -150,8 +150,9 @@ const crudColumns = ref([
|
|||||||
width: 140,
|
width: 140,
|
||||||
search: true,
|
search: true,
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
|
editDisabled: true,
|
||||||
|
addDisabled: true,
|
||||||
addDefaultValue: `PT_${route.query.ident}_`,
|
addDefaultValue: `PT_${route.query.ident}_`,
|
||||||
commonRules: [{ required: true, message: "标识是必填" }],
|
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
<div class="ma-content-block lg:flex justify-between p-4">
|
<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">
|
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||||
<!-- CRUD组件 -->
|
<!-- 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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -12,6 +16,7 @@ import { ref } from "vue"
|
|||||||
import { useRoute, useRouter } from "vue-router"
|
import { useRoute, useRouter } from "vue-router"
|
||||||
import testDemandApi from "@/api/project/testDemand"
|
import testDemandApi from "@/api/project/testDemand"
|
||||||
import { useTreeDataStore } from "@/store"
|
import { useTreeDataStore } from "@/store"
|
||||||
|
import commonApi from "@/api/common"
|
||||||
const treeDataStore = useTreeDataStore()
|
const treeDataStore = useTreeDataStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@@ -20,6 +25,23 @@ const roundNumber = route.query.key.split("-")[0]
|
|||||||
const dutNumber = route.query.key.split("-")[1]
|
const dutNumber = route.query.key.split("-")[1]
|
||||||
const designDemandNumber = route.query.key.split("-")[2]
|
const designDemandNumber = route.query.key.split("-")[2]
|
||||||
const projectId = ref(route.query.id)
|
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组件
|
// crud组件
|
||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
api: testDemandApi.getTestDemandList,
|
api: testDemandApi.getTestDemandList,
|
||||||
|
|||||||
@@ -2,15 +2,20 @@
|
|||||||
<div class="ma-content-block lg:flex justify-between p-4">
|
<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">
|
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||||
<!-- CRUD组件 -->
|
<!-- 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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup lang="jsx">
|
||||||
import { ref } from "vue"
|
import { ref, computed } from "vue"
|
||||||
import { useRoute, useRouter } from "vue-router"
|
import { useRoute, useRouter } from "vue-router"
|
||||||
import designDemandApi from "@/api/project/designDemand"
|
import designDemandApi from "@/api/project/designDemand"
|
||||||
|
import commonApi from "@/api/common"
|
||||||
import { useTreeDataStore } from "@/store"
|
import { useTreeDataStore } from "@/store"
|
||||||
const treeDataStore = useTreeDataStore()
|
const treeDataStore = useTreeDataStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -18,6 +23,24 @@ const router = useRouter()
|
|||||||
const roundNumber = route.query.key.split("-")[0]
|
const roundNumber = route.query.key.split("-")[0]
|
||||||
const dutNumber = route.query.key.split("-")[1]
|
const dutNumber = route.query.key.split("-")[1]
|
||||||
const projectId = ref(route.query.id)
|
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组件
|
// crud组件
|
||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
api: designDemandApi.getDesignDemandList,
|
api: designDemandApi.getDesignDemandList,
|
||||||
@@ -81,11 +104,11 @@ const crudColumns = ref([
|
|||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title:'章节号',
|
title: "章节号",
|
||||||
align:'center',
|
align: "center",
|
||||||
width:150,
|
width: 150,
|
||||||
dataIndex:'chapter',
|
dataIndex: "chapter",
|
||||||
search:true,
|
search: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "需求类型",
|
title: "需求类型",
|
||||||
|
|||||||
@@ -2,7 +2,11 @@
|
|||||||
<div class="ma-content-block lg:flex justify-between p-4">
|
<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">
|
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
|
||||||
<!-- CRUD组件 -->
|
<!-- 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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -20,6 +24,11 @@ const dutNumber = route.query.key.split("-")[1]
|
|||||||
const designDemandNumber = route.query.key.split("-")[2]
|
const designDemandNumber = route.query.key.split("-")[2]
|
||||||
const testDemandNumber = route.query.key.split("-")[3]
|
const testDemandNumber = route.query.key.split("-")[3]
|
||||||
const projectId = ref(route.query.id)
|
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设置
|
// crud设置
|
||||||
const crudOptions = ref({
|
const crudOptions = ref({
|
||||||
api: caseApi.getCaseList,
|
api: caseApi.getCaseList,
|
||||||
@@ -93,8 +102,11 @@ const crudColumns = ref([
|
|||||||
sortable: { sortDirections: ["ascend"] },
|
sortable: { sortDirections: ["ascend"] },
|
||||||
width: 140,
|
width: 140,
|
||||||
align: "center",
|
align: "center",
|
||||||
|
addDisabled: true,
|
||||||
|
addDefaultValue: route.query.key,
|
||||||
|
editDefaultValue: route.query.key,
|
||||||
|
editDisabled: true,
|
||||||
search: true,
|
search: true,
|
||||||
commonRules: [{ required: true, message: "标识是必填" }],
|
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user