新增设计需求、测试项、用例批量新增页面和功能
This commit is contained in:
@@ -59,8 +59,7 @@ const props = defineProps({
|
||||
toolbar: {
|
||||
type: [String, Array],
|
||||
// 如果要取消粘贴只粘贴文本,需要用户加格式请加上pastetext
|
||||
default:
|
||||
"code undo redo aligncenter alignleft indent styleselect formatselect fontselect fontsizeselect removeformat"
|
||||
default: "code undo redo aligncenter alignleft indent styleselect formatselect fontselect fontsizeselect removeformat"
|
||||
|
||||
// 下面是备份配置:
|
||||
// default:"code undo redo restoredraft | paste | bold | aligncenter alignleft alignjustify indent searchreplace | \
|
||||
@@ -154,10 +153,7 @@ const initConfig = reactive({
|
||||
min_height: 100,
|
||||
max_height: 600,
|
||||
autoresize_bottom_margin: 10,
|
||||
content_css:
|
||||
theme.value === "dark"
|
||||
? "/tinymce/skins/content/dark/content.css"
|
||||
: "/tinymce/skins/content/default/content.css",
|
||||
content_css: theme.value === "dark" ? "/tinymce/skins/content/dark/content.css" : "/tinymce/skins/content/default/content.css",
|
||||
// selector: "#textarea1", // 下面自定义样式选中的区域为编辑区
|
||||
content_style: "body {line-height:1.5;font-size:14px;} p {margin:2px 0px;}", // 这里可以设置自定义样式
|
||||
// paste_as_text: false,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:width="prop.width"
|
||||
:fullscreen="isFull"
|
||||
:fullscreen="prop.isFull"
|
||||
v-model:visible="modal.visible"
|
||||
:on-before-ok="modal.submit"
|
||||
unmount-on-close
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
<!--
|
||||
- @Author XXX
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<ma-form-item
|
||||
v-if="typeof props.component.display == 'undefined' || props.component.display === true"
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<template>
|
||||
<div class="w-full" ref="containerRef" id="form-main-id">
|
||||
<a-spin :loading="formLoading" :tip="options.loadingText" class="w-full ma-form-spin">
|
||||
<div
|
||||
v-if="options.showFormTitle"
|
||||
:class="['ma-form-title', options.formTitleClass]"
|
||||
:style="options.formTitleStyle"
|
||||
>
|
||||
<div v-if="options.showFormTitle" :class="['ma-form-title', options.formTitleClass]" :style="options.formTitleStyle">
|
||||
{{ options.formTitle }}
|
||||
</div>
|
||||
<a-form
|
||||
@@ -37,23 +33,13 @@
|
||||
<a-space>
|
||||
<slot name="formBeforeButtons" />
|
||||
<slot name="formButtons">
|
||||
<a-button
|
||||
:type="options.submitType"
|
||||
:status="options.submitStatus"
|
||||
v-if="options.submitShowBtn"
|
||||
html-type="submit"
|
||||
>
|
||||
<a-button :type="options.submitType" :status="options.submitStatus" v-if="options.submitShowBtn" html-type="submit">
|
||||
<template #icon v-if="options?.submitIcon">
|
||||
<component :is="options.submitIcon" />
|
||||
</template>
|
||||
{{ options.submitText }}
|
||||
</a-button>
|
||||
<a-button
|
||||
:type="options.resetType"
|
||||
:status="options.resetStatus"
|
||||
v-if="options.resetShowBtn"
|
||||
@click="resetForm"
|
||||
>
|
||||
<a-button :type="options.resetType" :status="options.resetStatus" v-if="options.resetShowBtn" @click="resetForm">
|
||||
<template #icon v-if="options?.resetIcon">
|
||||
<component :is="options.resetIcon" />
|
||||
</template>
|
||||
@@ -90,14 +76,7 @@
|
||||
import { ref, watch, provide, onMounted, onUnmounted, nextTick, getCurrentInstance, inject, computed } from "vue"
|
||||
import { isNil, set, get, cloneDeep } from "lodash-es"
|
||||
import defaultOptions from "./js/defaultOptions.js"
|
||||
import {
|
||||
getComponentName,
|
||||
toHump,
|
||||
interactiveControl,
|
||||
handleFlatteningColumns,
|
||||
insertGlobalCssToHead,
|
||||
insertGlobalFunctionsToHtml
|
||||
} from "./js/utils.js"
|
||||
import { getComponentName, toHump, interactiveControl, handleFlatteningColumns, insertGlobalCssToHead, insertGlobalFunctionsToHtml } from "./js/utils.js"
|
||||
import { loadDict, handlerCascader } from "./js/networkRequest.js"
|
||||
import arrayComponentDefault from "./js/defaultArrayComponent.js"
|
||||
import ColumnService from "./js/columnService.js"
|
||||
@@ -150,14 +129,9 @@ import ParentPreview from "@/views/project/ParentPreview/index.vue"
|
||||
// 判断是否有
|
||||
const formKey = computed(() => {
|
||||
// 去掉双击被测件:即key.split("").length > 1
|
||||
if (
|
||||
form.value.key &&
|
||||
typeof form.value.key !== "number" &&
|
||||
form.value.key &&
|
||||
form.value.key.split("-").length > 2
|
||||
) {
|
||||
if (form.value.key && typeof form.value.key !== "number" && form.value.key && form.value.key.split("-").length > 2) {
|
||||
// 如果存在则取前面的
|
||||
return form.value.key.slice(0, -2)
|
||||
return form.value.key.split("-").slice(0, -1).join("-")
|
||||
}
|
||||
return ""
|
||||
})
|
||||
@@ -257,14 +231,7 @@ const init = async () => {
|
||||
}
|
||||
|
||||
// 联动
|
||||
await handlerCascader(
|
||||
get(form.value, item.dataIndex),
|
||||
item,
|
||||
flatteningColumns.value,
|
||||
dictList.value,
|
||||
form.value,
|
||||
false
|
||||
)
|
||||
await handlerCascader(get(form.value, item.dataIndex), item, flatteningColumns.value, dictList.value, form.value, false)
|
||||
})
|
||||
|
||||
await nextTick(() => {
|
||||
|
||||
@@ -11,11 +11,7 @@
|
||||
:label-style="props.labelStyle"
|
||||
:value-style="props.valueStyle"
|
||||
>
|
||||
<a-descriptions-item
|
||||
v-for="item in descriptions"
|
||||
:label="item.label"
|
||||
:span="item.span ? item.span : isArray(item.value) ? props.column : 1"
|
||||
>
|
||||
<a-descriptions-item v-for="item in descriptions" :label="item.label" :span="item.span ? item.span : isArray(item.value) ? props.column : 1">
|
||||
<template v-if="item.formType === 'upload'">
|
||||
<a-image-preview-group infinite v-if="isArray(item.value)">
|
||||
<a-space>
|
||||
@@ -34,11 +30,10 @@
|
||||
<template v-for="(sub, idx) in item.value" :key="idx">
|
||||
<!-- 这是每个测试子项 -->
|
||||
<div class="subTitle mt-1">{{ idx + 1 }}.{{ sub.subName }}</div>
|
||||
<div>测试子项描述:{{ sub.subDescription }}</div>
|
||||
<template v-for="(step, index) in sub.subStep" :key="index">
|
||||
<span class="text-amber-700">步骤{{ index + 1 }})</span>
|
||||
<div class="operation">
|
||||
<span class="text-bold">操作:</span>{{ step.operation }}
|
||||
</div>
|
||||
<div class="operation"><span class="text-bold">操作:</span>{{ step.operation }}</div>
|
||||
<div class="mb-1"><span class="text-bold">预期:</span>{{ step.expect }}</div>
|
||||
</template>
|
||||
</template>
|
||||
@@ -46,9 +41,7 @@
|
||||
<template v-else>暂无信息</template>
|
||||
</div>
|
||||
</template>
|
||||
<template
|
||||
v-else-if="item.formType === 'radio' || item.formType === 'select' || item.formType === 'checkbox'"
|
||||
>
|
||||
<template v-else-if="item.formType === 'radio' || item.formType === 'select' || item.formType === 'checkbox'">
|
||||
<template v-if="isArray(item.value)">
|
||||
<!-- 修改源码 -->
|
||||
<a-space>
|
||||
@@ -162,6 +155,8 @@ defineExpose({ reset })
|
||||
|
||||
<style scoped>
|
||||
.white-space-change {
|
||||
max-height: 68vh;
|
||||
white-space: normal;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -3,112 +3,115 @@
|
||||
- @Link XXX
|
||||
-->
|
||||
<template>
|
||||
<div class="flex flex-col w-full h-full">
|
||||
<a-input-group class="mb-2 w-full" size="mini">
|
||||
<a-input
|
||||
:placeholder="props?.searchPlaceholder"
|
||||
allow-clear
|
||||
@input="changeKeyword"
|
||||
@clear="resetData"
|
||||
/>
|
||||
<a-button
|
||||
@click="() => {
|
||||
isExpand ? maTree.expandAll(false) : maTree.expandAll(true)
|
||||
isExpand = ! isExpand
|
||||
}"
|
||||
>{{ isExpand ? '折叠' : '展开' }}</a-button>
|
||||
</a-input-group>
|
||||
<a-tree
|
||||
blockNode
|
||||
ref="maTree"
|
||||
:data="treeData"
|
||||
class="h-full w-full"
|
||||
@select="handlerSelect"
|
||||
:field-names="props.fieldNames"
|
||||
v-model:selected-keys="modelValue"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<template #icon v-if="props.icon"><component :is="props.icon" /></template>
|
||||
</a-tree>
|
||||
</div>
|
||||
<div class="flex flex-col w-full h-full">
|
||||
<a-input-group class="mb-2 w-full" size="mini">
|
||||
<a-input :placeholder="props?.searchPlaceholder" allow-clear @input="changeKeyword" @clear="resetData" />
|
||||
<a-button
|
||||
@click="
|
||||
() => {
|
||||
isExpand ? maTree.expandAll(false) : maTree.expandAll(true)
|
||||
isExpand = !isExpand
|
||||
}
|
||||
"
|
||||
>{{ isExpand ? "折叠" : "展开" }}</a-button
|
||||
>
|
||||
</a-input-group>
|
||||
<a-tree
|
||||
blockNode
|
||||
ref="maTree"
|
||||
:data="treeData"
|
||||
class="h-full w-full"
|
||||
@select="handlerSelect"
|
||||
:field-names="props.fieldNames"
|
||||
v-model:selected-keys="modelValue"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<template #icon v-if="props.icon"><component :is="props.icon" /></template>
|
||||
</a-tree>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, watch, computed } from 'vue'
|
||||
import { ref, watch, computed } from "vue"
|
||||
|
||||
const treeData = ref([])
|
||||
const maTree = ref()
|
||||
const isExpand = ref(false)
|
||||
const treeData = ref([])
|
||||
const maTree = ref()
|
||||
const isExpand = ref(false)
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'click'])
|
||||
const emit = defineEmits(["update:modelValue", "click"])
|
||||
|
||||
const props = defineProps({
|
||||
const props = defineProps({
|
||||
modelValue: { type: Array },
|
||||
data: { type: Array },
|
||||
searchPlaceholder: { type: String },
|
||||
fieldNames: { type: Object, default: () => { return { title: 'label', key: 'value' } } },
|
||||
icon: { type: String, default: undefined },
|
||||
})
|
||||
fieldNames: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return { title: "label", key: "value" }
|
||||
}
|
||||
},
|
||||
icon: { type: String, default: undefined }
|
||||
})
|
||||
|
||||
const modelValue = computed({
|
||||
const modelValue = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
return props.modelValue
|
||||
},
|
||||
set(newVal) {
|
||||
emit('update:modelValue', newVal)
|
||||
emit("update:modelValue", newVal)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
watch(
|
||||
watch(
|
||||
() => props.data,
|
||||
val => {
|
||||
treeData.value = val
|
||||
(val) => {
|
||||
treeData.value = val
|
||||
},
|
||||
{ immediate: true, deep: true }
|
||||
)
|
||||
)
|
||||
|
||||
const handlerSelect = (item, data) => {
|
||||
modelValue.value = [ item ]
|
||||
emit('click', ...[item, data])
|
||||
}
|
||||
const handlerSelect = (item, data) => {
|
||||
modelValue.value = [item]
|
||||
emit("click", ...[item, data])
|
||||
}
|
||||
|
||||
const resetData = () => treeData.value = props.data
|
||||
const resetData = () => (treeData.value = props.data)
|
||||
|
||||
const changeKeyword = (keyword) => {
|
||||
if (!keyword || keyword === '') {
|
||||
treeData.value = Object.assign(props.data, [])
|
||||
return false
|
||||
const changeKeyword = (keyword) => {
|
||||
if (!keyword || keyword === "") {
|
||||
treeData.value = Object.assign(props.data, [])
|
||||
return false
|
||||
}
|
||||
treeData.value = searchNode(keyword)
|
||||
}
|
||||
}
|
||||
|
||||
const searchNode = (keyword) => {
|
||||
const searchNode = (keyword) => {
|
||||
const loop = (data) => {
|
||||
let tree = []
|
||||
data.map(item => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
const temp = loop(item.children)
|
||||
tree.push(...temp)
|
||||
} else if (item[props.fieldNames['title']].indexOf(keyword) !== -1) {
|
||||
tree.push(item)
|
||||
}
|
||||
return tree
|
||||
})
|
||||
let tree = []
|
||||
data.map((item) => {
|
||||
if (item.children && item.children.length > 0) {
|
||||
const temp = loop(item.children)
|
||||
tree.push(...temp)
|
||||
} else if (item[props.fieldNames["title"]].indexOf(keyword) !== -1) {
|
||||
tree.push(item)
|
||||
}
|
||||
return tree
|
||||
})
|
||||
|
||||
return tree
|
||||
return tree
|
||||
}
|
||||
return loop(treeData.value)
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ maTree })
|
||||
defineExpose({ maTree })
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
:deep(.arco-tree-node:hover) {
|
||||
background-color: var(--color-fill-2);
|
||||
border-radius: 3px;
|
||||
background-color: var(--color-fill-2);
|
||||
border-radius: 3px;
|
||||
}
|
||||
:deep(.arco-tree-node-switcher) {
|
||||
margin-left: 2px;
|
||||
margin-left: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user