45
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
<a-input style="height: 32px" v-model="searchKey" allow-clear></a-input>
|
<a-input style="height: 32px" v-model="searchKey" allow-clear></a-input>
|
||||||
<a-button @click="handleSearchTreeDataClick">搜索</a-button>
|
<a-button @click="handleSearchTreeDataClick">搜索</a-button>
|
||||||
</a-input-group>
|
</a-input-group>
|
||||||
<a-alert title="提示" style="margin-bottom: 10px" class="mt-0 py-1 h-1/12"
|
<a-button type="primary" @click="toggleExpanded" class="mb-1">
|
||||||
>空搜索需要点击搜索按钮</a-alert
|
{{ expandedKeys?.length ? "全部收缩" : "全部展开" }}
|
||||||
>
|
</a-button>
|
||||||
<a-tree
|
<a-tree
|
||||||
class="h-10/12"
|
class="h-10/12"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
animation
|
animation
|
||||||
@select="pointNode"
|
@select="pointNode"
|
||||||
:load-more="loadMore"
|
:load-more="loadMore"
|
||||||
|
v-model:expanded-keys="expandedKeys"
|
||||||
showLine
|
showLine
|
||||||
ref="treeRef"
|
ref="treeRef"
|
||||||
border
|
border
|
||||||
@@ -280,6 +281,15 @@ const handleRoundSubmit = async (value) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 1.定义展开的tree-key 2.定义全部展开的数据 3.定义展开收缩函数 -> 注意在treeStore里面使用递归处理
|
||||||
|
const expandedKeys = ref([])
|
||||||
|
const allExpandedKeys = ref([])
|
||||||
|
const toggleExpanded = () => {
|
||||||
|
allExpandedKeys.value = treeDataStore.outExpandNode()
|
||||||
|
expandedKeys.value = expandedKeys?.value.length ? [] : allExpandedKeys.value
|
||||||
|
}
|
||||||
|
|
||||||
/// 设置轮次弹窗的列信息
|
/// 设置轮次弹窗的列信息
|
||||||
const roundColumn = ref([
|
const roundColumn = ref([
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,7 +77,8 @@ const useTreeDataStore = defineStore("treeDataStore", {
|
|||||||
let caseKey = temp[4]
|
let caseKey = temp[4]
|
||||||
const nodeKey = temp.join("-")
|
const nodeKey = temp.join("-")
|
||||||
const res = await projectApi.getProblemInfo(projrctId, nodeKey, "4")
|
const res = await projectApi.getProblemInfo(projrctId, nodeKey, "4")
|
||||||
this.treeData[roundKey].children[dutKey].children[designKey].children[testKey].children[caseKey].children = res.data
|
this.treeData[roundKey].children[dutKey].children[designKey].children[testKey].children[caseKey].children =
|
||||||
|
res.data
|
||||||
},
|
},
|
||||||
setCurrentNode(nodeKey) {
|
setCurrentNode(nodeKey) {
|
||||||
this.currentNode = nodeKey
|
this.currentNode = nodeKey
|
||||||
@@ -98,6 +99,28 @@ const useTreeDataStore = defineStore("treeDataStore", {
|
|||||||
} else {
|
} else {
|
||||||
return roundLength
|
return roundLength
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// 输出当前树状结构可展开的节点
|
||||||
|
outExpandNode() {
|
||||||
|
// 定义递归函数
|
||||||
|
const res = []
|
||||||
|
function digui(data) {
|
||||||
|
if (Object.prototype.toString.call(data) === "[object Array]") {
|
||||||
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
if (data[i].children) {
|
||||||
|
res.push(data[i].key)
|
||||||
|
digui(data[i].children)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.treeData.forEach((item) => {
|
||||||
|
if (item.children) {
|
||||||
|
res.push(item.key)
|
||||||
|
digui(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
width: 140,
|
width: 140,
|
||||||
search: true,
|
search: true,
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
align: "center",
|
align: "center",
|
||||||
search: true,
|
search: true,
|
||||||
commonRules: [{ required: true, message: "标识是必填" }],
|
commonRules: [{ required: true, message: "标识是必填" }],
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ const crudOptions = ref({
|
|||||||
},
|
},
|
||||||
showIndex: false,
|
showIndex: false,
|
||||||
rowSelection: { showCheckedAll: true },
|
rowSelection: { showCheckedAll: true },
|
||||||
searchColNumber: 3,
|
searchColNumber: 4,
|
||||||
tablePagination: false,
|
tablePagination: false,
|
||||||
operationColumn: true,
|
operationColumn: true,
|
||||||
operationColumnAlign: "center",
|
operationColumnAlign: "center",
|
||||||
@@ -64,6 +64,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
width: 120,
|
width: 120,
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
search: true,
|
search: true,
|
||||||
@@ -79,6 +80,13 @@ const crudColumns = ref([
|
|||||||
commonRules: [{ required: true, message: "需求名称是必填" }],
|
commonRules: [{ required: true, message: "需求名称是必填" }],
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title:'章节号',
|
||||||
|
align:'center',
|
||||||
|
width:150,
|
||||||
|
dataIndex:'chapter',
|
||||||
|
search:true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "需求类型",
|
title: "需求类型",
|
||||||
width: 150,
|
width: 150,
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
width: 150,
|
width: 150,
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
search: true,
|
search: true,
|
||||||
@@ -161,6 +162,30 @@ const crudColumns = ref([
|
|||||||
commonRules: [{ required: true, message: "需求名称是必填" }],
|
commonRules: [{ required: true, message: "需求名称是必填" }],
|
||||||
validateTrigger: "blur"
|
validateTrigger: "blur"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: "版本",
|
||||||
|
align: "center",
|
||||||
|
dataIndex: "version",
|
||||||
|
search: true,
|
||||||
|
commonRules: [{ required: true, message: "版本必填" }],
|
||||||
|
validateTrigger: "blur"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "单位",
|
||||||
|
align: "center",
|
||||||
|
dataIndex: "release_union",
|
||||||
|
search: true,
|
||||||
|
commonRules: [{ required: true, message: "单位必选" }],
|
||||||
|
formType: "select",
|
||||||
|
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "发布时间",
|
||||||
|
dataIndex: "release_date",
|
||||||
|
hide: true,
|
||||||
|
commonRules: [{ required: true, message: "时间必填" }],
|
||||||
|
formType: "date"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "空行",
|
title: "空行",
|
||||||
hide: true,
|
hide: true,
|
||||||
@@ -191,12 +216,14 @@ const crudColumns = ref([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "总代码",
|
title: "总代码",
|
||||||
|
hide: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "total_code_line",
|
dataIndex: "total_code_line",
|
||||||
formType: "input-number"
|
formType: "input-number"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "总行数",
|
title: "总行数",
|
||||||
|
hide: true,
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "total_line",
|
dataIndex: "total_line",
|
||||||
formType: "input-number"
|
formType: "input-number"
|
||||||
@@ -205,6 +232,7 @@ const crudColumns = ref([
|
|||||||
title: "注释率 %",
|
title: "注释率 %",
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: "comment_line",
|
dataIndex: "comment_line",
|
||||||
|
hide: true,
|
||||||
addDisabled: true,
|
addDisabled: true,
|
||||||
editDisabled: true,
|
editDisabled: true,
|
||||||
customRender: ({ record }) => {
|
customRender: ({ record }) => {
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
width: 140,
|
width: 140,
|
||||||
align: "center",
|
align: "center",
|
||||||
search: true,
|
search: true,
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ const crudColumns = ref([
|
|||||||
{
|
{
|
||||||
title: "标识",
|
title: "标识",
|
||||||
width: 70,
|
width: 70,
|
||||||
|
sortable: { sortDirections: ["ascend"] },
|
||||||
dataIndex: "ident",
|
dataIndex: "ident",
|
||||||
search: true,
|
search: true,
|
||||||
commonRules: [{ required: true, message: "标识是必填" }],
|
commonRules: [{ required: true, message: "标识是必填" }],
|
||||||
|
|||||||
Reference in New Issue
Block a user