sss
This commit is contained in:
@@ -112,5 +112,16 @@ export default {
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取用户分组group的id和层级信息
|
||||
* @returns
|
||||
*/
|
||||
getGroupList(params = {}) {
|
||||
return request({
|
||||
url: "system/user/group/list",
|
||||
method: "get",
|
||||
params
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// 复制到粘贴板
|
||||
import useClipboard from "vue-clipboard3"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
|
||||
|
||||
17
cdTMP/src/layout/hooks/tools.js
Normal file
17
cdTMP/src/layout/hooks/tools.js
Normal file
@@ -0,0 +1,17 @@
|
||||
export function getContextNodeInfo(element) {
|
||||
const pElement = element.parentElement
|
||||
if (pElement.dataset.key) {
|
||||
const title = pElement.querySelector("span.arco-tree-node-title-text").innerText
|
||||
const isLeaf = pElement.classList.contains("arco-tree-node-is-leaf")
|
||||
return {
|
||||
nodekey: pElement.dataset.key,
|
||||
level: pElement.dataset.level,
|
||||
title,
|
||||
isLeaf
|
||||
}
|
||||
} else {
|
||||
if (pElement.parentElement) {
|
||||
return getContextNodeInfo(pElement) // 易错点,必须返回调用无用
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
class="h-10/12 select-none my-arco-wrap-class"
|
||||
:data="treeData"
|
||||
size="mini"
|
||||
showLine
|
||||
checkable
|
||||
block-node
|
||||
draggable
|
||||
@@ -35,7 +36,6 @@
|
||||
v-model:expanded-keys="expandedKeys"
|
||||
v-model:selected-keys="selectedKeys"
|
||||
v-model:checked-keys="checkedKeys"
|
||||
showLine
|
||||
ref="treeRef"
|
||||
border
|
||||
@contextmenu="displayRightMenu"
|
||||
@@ -239,6 +239,7 @@ import { useTreeDataStore } from "@/store"
|
||||
import { storeToRefs } from "pinia"
|
||||
import dayjs from "dayjs"
|
||||
import Progress from "@/views/testmanage/projmanage/cpns/progress.vue"
|
||||
import { getContextNodeInfo } from "@/layout/hooks/tools"
|
||||
// router-view里面组件的ref
|
||||
const routeViewRef = ref()
|
||||
/// 初始化round轮次数据
|
||||
@@ -783,10 +784,9 @@ const roundRightContainer = ref(null)
|
||||
const problemTitle = ref("第1轮问题单")
|
||||
/// 紧点击测试项节点显示右键菜单
|
||||
const displayRightMenu = (e) => {
|
||||
const { proxy } = e.target.__vueParentComponent
|
||||
const { level, isLeaf, nodekey, title } = proxy
|
||||
const { nodekey, level, title, isLeaf } = getContextNodeInfo(e.target)
|
||||
// 如果是测试项则弹出【1.根据测试项步骤生成当前测试项用例 2.复制测试项到设计需求】
|
||||
if (level === 3) {
|
||||
if (+level === 3) {
|
||||
e.preventDefault()
|
||||
// 首先将被右键点击的node储存到组件全局
|
||||
rightClickNode.level = level
|
||||
@@ -797,7 +797,7 @@ const displayRightMenu = (e) => {
|
||||
popupContainer.value = e.target
|
||||
popupVisible.value = true
|
||||
}
|
||||
if (level === 0) {
|
||||
if (+level === 0) {
|
||||
// 测试显示下拉框
|
||||
e.preventDefault()
|
||||
rightClickNode.level = level
|
||||
@@ -1062,4 +1062,7 @@ const problemRoundRef = ref(null)
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
.chen-node-title {
|
||||
cursor: help;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
<template>
|
||||
<div class="ma-content-block lg:flex justify-between p-4">
|
||||
<div class="lg:w-2/12 w-full h-full p-2 shadow">
|
||||
<ma-tree-slider
|
||||
v-model="depts"
|
||||
searchPlaceholder="用户类型"
|
||||
:field-names="{ title: 'label', value: 'value' }"
|
||||
@click="switchDept"
|
||||
></ma-tree-slider>
|
||||
</div>
|
||||
<div class="lg:w-10/12 w-full lg:ml-4 mt-5 lg:mt-0">
|
||||
<div class="lg:w-12/12 w-full lg:ml-4 mt-5 lg:mt-0">
|
||||
<!-- CRUD组件 -->
|
||||
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
|
||||
<template #status="{ record }">
|
||||
@@ -26,7 +18,6 @@
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from "vue"
|
||||
import MaTreeSlider from "@/components/ma-treeSlider/index.vue"
|
||||
import userApi from "@/api/system/user"
|
||||
import user from "@/api/system/user"
|
||||
import { Message } from "@arco-design/web-vue"
|
||||
@@ -35,115 +26,6 @@ const changeStatus = (e, id) => {
|
||||
console.log("当前值:", e)
|
||||
console.log("当前ID:", id)
|
||||
}
|
||||
// 树状组件-注意在onMounted中加载数据,不然不显示
|
||||
const depts = ref([])
|
||||
onMounted(() => {
|
||||
depts.value = [
|
||||
{
|
||||
id: 15,
|
||||
parent_id: 0,
|
||||
value: 15,
|
||||
label: "成都分部",
|
||||
children: [
|
||||
{
|
||||
id: 16,
|
||||
parent_id: 15,
|
||||
value: 16,
|
||||
label: "FPGA组"
|
||||
},
|
||||
{
|
||||
id: 17,
|
||||
parent_id: 15,
|
||||
value: 17,
|
||||
label: "CPU组"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
parent_id: 0,
|
||||
value: 1,
|
||||
label: "上海本部",
|
||||
children: [
|
||||
{
|
||||
id: 3,
|
||||
parent_id: 1,
|
||||
value: 3,
|
||||
label: "FPGA组",
|
||||
children: [
|
||||
{
|
||||
id: 6,
|
||||
parent_id: 3,
|
||||
value: 6,
|
||||
label: "研发部门"
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
parent_id: 3,
|
||||
value: 7,
|
||||
label: "市场部门"
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
parent_id: 3,
|
||||
value: 8,
|
||||
label: "测试部门"
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
parent_id: 3,
|
||||
value: 9,
|
||||
label: "财务部门"
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
parent_id: 3,
|
||||
value: 10,
|
||||
label: "运维部门"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
parent_id: 1,
|
||||
value: 2,
|
||||
label: "CPU组",
|
||||
children: [
|
||||
{
|
||||
id: 11,
|
||||
parent_id: 2,
|
||||
value: 11,
|
||||
label: "市场部门",
|
||||
children: [
|
||||
{
|
||||
id: 13,
|
||||
parent_id: 11,
|
||||
value: 13,
|
||||
label: "外勤"
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
parent_id: 11,
|
||||
value: 14,
|
||||
label: "行政"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
parent_id: 2,
|
||||
value: 12,
|
||||
label: "财务部门"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
})
|
||||
const switchDept = (key) => {
|
||||
console.log("选择", key)
|
||||
}
|
||||
// crud组件
|
||||
const crudRef = ref()
|
||||
const crudOptions = reactive({
|
||||
@@ -160,9 +42,10 @@ const crudOptions = reactive({
|
||||
// 是否显示操作列
|
||||
operationColumn: true,
|
||||
operationWidth: 200,
|
||||
showTools: false,
|
||||
// 设置列表数据API
|
||||
api: userApi.getPageList,
|
||||
// 设置新增接口-show为true则显示按钮、
|
||||
// 设置新增接口-show为true则显示按钮
|
||||
add: {
|
||||
show: true,
|
||||
api: userApi.save
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="jsx">
|
||||
import { ref } from "vue"
|
||||
import { useRoute, useRouter } from "vue-router"
|
||||
import caseApi from "@/api/project/case"
|
||||
import dictApi from "@/api/system/dict"
|
||||
import { useTreeDataStore } from "@/store"
|
||||
const treeDataStore = useTreeDataStore()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const roundNumber = route.query.key.split("-")[0]
|
||||
const dutNumber = route.query.key.split("-")[1]
|
||||
const designDemandNumber = route.query.key.split("-")[2]
|
||||
@@ -30,6 +30,7 @@ const showType = (record) => {
|
||||
let key_string = parseInt(record.key.substring(record.key.lastIndexOf("-") + 1)) + 1
|
||||
return "YL-" + record.testType + "-" + record.ident + "-" + key_string.toString().padStart(3, "0")
|
||||
}
|
||||
|
||||
// crud设置
|
||||
const crudOptions = ref({
|
||||
api: caseApi.getCaseList,
|
||||
@@ -138,7 +139,7 @@ const crudOptions = ref({
|
||||
const crudColumns = ref([
|
||||
{
|
||||
title: "ID",
|
||||
width: 50,
|
||||
width: 60,
|
||||
align: "center",
|
||||
dataIndex: "id",
|
||||
fixed: "left"
|
||||
@@ -165,6 +166,83 @@ const crudColumns = ref([
|
||||
commonRules: [{ required: true, message: "名称是必填" }],
|
||||
validateTrigger: "blur"
|
||||
},
|
||||
{
|
||||
title: "执行情况",
|
||||
align: "center",
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
customRender: ({ record }) => {
|
||||
// 执行情况逻辑,查看所有步骤的执行情况 - 暂时硬编码
|
||||
let completeCount = 0
|
||||
let stepCount = record.testStep.length
|
||||
record.testStep.forEach((item) => {
|
||||
if (item.status === "1") {
|
||||
completeCount++
|
||||
}
|
||||
})
|
||||
if (completeCount === stepCount) {
|
||||
return (
|
||||
<a-tag bordered color="green">
|
||||
已执行
|
||||
</a-tag>
|
||||
)
|
||||
} else if (completeCount > 0 && completeCount < stepCount) {
|
||||
return (
|
||||
<a-tag bordered color="orange">
|
||||
部分执行
|
||||
</a-tag>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a-tag bordered color="red">
|
||||
未执行
|
||||
</a-tag>
|
||||
)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "是否通过",
|
||||
align: "center",
|
||||
display: false,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
customRender: ({ record }) => {
|
||||
let passCount = 0
|
||||
let failCount = 0
|
||||
let stepCount = record.testStep.length
|
||||
record.testStep.forEach((item) => {
|
||||
if (item.passed === "1") {
|
||||
passCount++
|
||||
} else if (item.passed === "2") {
|
||||
failCount++
|
||||
}
|
||||
})
|
||||
if (failCount > 0) {
|
||||
return (
|
||||
<a-tag bordered color="red">
|
||||
未通过
|
||||
</a-tag>
|
||||
)
|
||||
} else {
|
||||
if (passCount === stepCount) {
|
||||
return (
|
||||
<a-tag bordered color="green">
|
||||
已通过
|
||||
</a-tag>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<a-tag bordered color="orange">
|
||||
包含未执行
|
||||
</a-tag>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: "设计人员",
|
||||
width: 80,
|
||||
@@ -188,7 +266,7 @@ const crudColumns = ref([
|
||||
dataIndex: "monitorPerson",
|
||||
width: 80,
|
||||
align: "center",
|
||||
search: true,
|
||||
hide: true,
|
||||
formType: "select",
|
||||
dict: { url: "system/user/list", translation: true, props: { label: "name", value: "name" } }
|
||||
},
|
||||
@@ -196,6 +274,7 @@ const crudColumns = ref([
|
||||
title: "用例综述",
|
||||
align: "center",
|
||||
dataIndex: "summarize",
|
||||
hide: true,
|
||||
search: true,
|
||||
addDefaultValue: ""
|
||||
},
|
||||
@@ -215,7 +294,7 @@ const crudColumns = ref([
|
||||
title: "执行时间",
|
||||
dataIndex: "exe_time",
|
||||
hide: true,
|
||||
formType: "date",
|
||||
formType: "date"
|
||||
},
|
||||
{
|
||||
title: "测试步骤",
|
||||
|
||||
Reference in New Issue
Block a user