This commit is contained in:
2023-06-09 19:31:54 +08:00
parent f8947d332a
commit 137c4cd564
14 changed files with 328 additions and 227 deletions

View File

@@ -1,12 +1,3 @@
<!--
- MineAdmin is committed to providing solutions for quickly building web applications
- Please view the LICENSE file that was distributed with this source code,
- For the full copyright and license information.
- Thank you very much for using MineAdmin.
-
- @Author X.Mo<root@imoi.cn>
- @Link https://gitee.com/xmo/mineadmin-vue
-->
<template> <template>
<div class="editor" ref="dom" :style="'width: 100%; height: ' + props.height + 'px'"></div> <div class="editor" ref="dom" :style="'width: 100%; height: ' + props.height + 'px'"></div>
</template> </template>
@@ -86,7 +77,7 @@ if (props.isBind) {
<style scoped lang="less"> <style scoped lang="less">
.editor { .editor {
border: 1px solid var(--color-border-2); border: 1px solid var(--color-border-2);
border-radius: 3px; border-radius: 1px;
background: var(--color-bg-2); background: var(--color-bg-2);
} }
</style> </style>

View File

@@ -145,7 +145,7 @@ defineExpose({
background: var(--color-bg-2); background: var(--color-bg-2);
border: 1px solid var(--color-border-2); border: 1px solid var(--color-border-2);
padding: 7px 0; padding: 7px 0;
border-radius: 4px; border-radius: 1px;
li .context-menu-item { li .context-menu-item {
cursor: pointer; cursor: pointer;
padding: 5px 10px; padding: 5px 10px;

View File

@@ -6,7 +6,7 @@
:title="props.title" :title="props.title"
:layout="props.layout" :layout="props.layout"
:bordered="props.bordered" :bordered="props.bordered"
table-layout="fixed" table-layout="auto"
:size="props.size" :size="props.size"
:label-style="props.labelStyle" :label-style="props.labelStyle"
:value-style="props.valueStyle" :value-style="props.valueStyle"
@@ -23,6 +23,15 @@
<template v-else-if="item.infoSlot"> <template v-else-if="item.infoSlot">
<slot :name="item.dataIndex" :row="item" :data="data"></slot> <slot :name="item.dataIndex" :row="item" :data="data"></slot>
</template> </template>
<template
v-else-if="(item.multiple === true && item.formType === 'select') || item.formType === 'checkbox'"
>
<a-space size="mini"
><a-tag color="pinkpurple" v-for="subItem in item.value" :key="subItem">
{{ item.dict.data.find((row) => row.value == subItem)?.label }}
</a-tag>
</a-space>
</template>
<template v-else-if="item.formType === 'radio' || item.formType === 'select'"> <template v-else-if="item.formType === 'radio' || item.formType === 'select'">
<a-tag color="blue">{{ item.dict.data.find((row) => row.value == item.value)?.label }}</a-tag> <a-tag color="blue">{{ item.dict.data.find((row) => row.value == item.value)?.label }}</a-tag>
</template> </template>

View File

@@ -98,7 +98,7 @@ defineExpose({ maTree })
<style scoped lang="less"> <style scoped lang="less">
:deep(.arco-tree-node:hover) { :deep(.arco-tree-node:hover) {
background-color: var(--color-fill-2); background-color: var(--color-fill-2);
border-radius: 3px; border-radius: 2px;
} }
:deep(.arco-tree-node-switcher) { :deep(.arco-tree-node-switcher) {
margin-left: 2px; margin-left: 2px;

View File

@@ -217,7 +217,7 @@ watch(
.file-list { .file-list {
position: relative; position: relative;
background-color: var(--color-primary-light-1); background-color: var(--color-primary-light-1);
border-radius: 4px; border-radius: 2px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
padding: 0 10px; padding: 0 10px;

View File

@@ -147,7 +147,7 @@ watch(
.file-list { .file-list {
position: relative; position: relative;
background-color: var(--color-primary-light-1); background-color: var(--color-primary-light-1);
border-radius: 4px; border-radius: 2px;
height: 36px; height: 36px;
line-height: 36px; line-height: 36px;
padding: 0 10px; padding: 0 10px;

View File

@@ -160,7 +160,7 @@ const paddingStyle = computed(() => {
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border: 4px solid transparent; border: 4px solid transparent;
background-clip: padding-box; background-clip: padding-box;
border-radius: 7px; border-radius: 3px;
background-color: var(--color-text-4); background-color: var(--color-text-4);
} }

View File

@@ -70,7 +70,7 @@ body {
padding: 0px 15px; padding: 0px 15px;
height: 40px; height: 40px;
margin-left: 5px; margin-left: 5px;
border-radius: 4px; border-radius: 1px;
color: var(--color-neutral-10); color: var(--color-neutral-10);
fill: var(--color-neutral-10); fill: var(--color-neutral-10);
@@ -118,14 +118,14 @@ body {
.backend-setting .arco-drawer-body::-webkit-scrollbar-thumb, .backend-setting .arco-drawer-body::-webkit-scrollbar-thumb,
.arco-list::-webkit-scrollbar-thumb, .arco-list::-webkit-scrollbar-thumb,
.customer-scrollbar::-webkit-scrollbar-thumb { .customer-scrollbar::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 2px;
background: var(--color-text-4); background: var(--color-text-4);
} }
.ma-menu .arco-menu-inner::-webkit-scrollbar-thumb:hover, .ma-menu .arco-menu-inner::-webkit-scrollbar-thumb:hover,
.backend-setting .arco-drawer-body::-webkit-scrollbar-thumb:hover, .backend-setting .arco-drawer-body::-webkit-scrollbar-thumb:hover,
.arco-list::-webkit-scrollbar-thumb:hover, .arco-list::-webkit-scrollbar-thumb:hover,
.customer-scrollbar::-webkit-scrollbar-thumb:hover { .customer-scrollbar::-webkit-scrollbar-thumb:hover {
border-radius: 10px; border-radius: 2px;
background: var(--color-text-3); background: var(--color-text-3);
} }
.ma-menu .arco-menu-inner::-webkit-scrollbar-track, .ma-menu .arco-menu-inner::-webkit-scrollbar-track,
@@ -158,7 +158,7 @@ body {
height: 27px; height: 27px;
line-height: 27px; line-height: 27px;
padding: 0 8px; padding: 0 8px;
border-radius: 4px; border-radius: 2px;
cursor: pointer; cursor: pointer;
transition: all 0.2s; transition: all 0.2s;
margin-right: 4px; margin-right: 4px;
@@ -171,7 +171,7 @@ body {
.tag-icon:hover { .tag-icon:hover {
color: rgb(var(--primary-4)); color: rgb(var(--primary-4));
background-color: var(--color-bg-2); background-color: var(--color-bg-2);
border-radius: 4px; border-radius: 2px;
} }
} }
@@ -203,7 +203,7 @@ body {
z-index: 999; z-index: 999;
width: 170px; width: 170px;
background-color: var(--color-bg-5); background-color: var(--color-bg-5);
border-radius: 4px; border-radius: 2px;
.arco-divider-horizontal { .arco-divider-horizontal {
margin: 5px 0; margin: 5px 0;
@@ -237,7 +237,7 @@ body {
.ma-content-block { .ma-content-block {
background-color: var(--color-bg-2); background-color: var(--color-bg-2);
border-radius: 2px; border-radius: 1px;
} }
} }

View File

@@ -44,7 +44,7 @@ onMounted(() => {
color: #fff; color: #fff;
width: 160px; width: 160px;
text-align: center; text-align: center;
border-radius: 3px; border-radius: 2px;
padding: 5px 10px; padding: 5px 10px;
} }
.bg-color { .bg-color {

View File

@@ -145,7 +145,7 @@ const handleSubmit = async ({ values, errors }) => {
position: relative; position: relative;
top: 50%; top: 50%;
margin-top: -255px; margin-top: -255px;
border-radius: 5px; border-radius: 2px;
} }
.left-panel { .left-panel {

View File

@@ -0,0 +1,125 @@
import projectApi from "@/api/testmanage/project"
export const crudOptions = {
showIndex: false,
rowSelection: { showCheckedAll: true },
api: projectApi.getPageList,
add: { show: true },
edit: { show: true },
delete: { show: true },
searchColNumber: 3,
tablePagination: true,
operationColumn: true,
operationWidth: 200,
showIndex: false,
formOption: {
isFull: true,
layout: [
{
formType: "grid",
cols: [
{ span: 8, formList: [{ dataIndex: "ident" }] },
{ span: 8, formList: [{ dataIndex: "name" }] },
{ span: 8, formList: [{ dataIndex: "engin_model" }] }
]
},
{
formType: "grid",
cols: [
{ span: 8, formList: [{ dataIndex: "section_system" }] },
{ span: 8, formList: [{ dataIndex: "sub_system" }] },
{ span: 8, formList: [{ dataIndex: "device" }] }
]
},
{
formType: "divider"
},
{
formType: "grid",
cols: [
{ span: 8, formList: [{ dataIndex: "beginTime" }] },
{ span: 8, formList: [{ dataIndex: "endTime" }] },
{ span: 8, formList: [{ dataIndex: "duty_person" }] },
{ span: 8, formList: [{ dataIndex: "member" }] }
]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "security_level" }] }]
},
{
formType: "grid",
cols: [
{ span: 12, formList: [{ dataIndex: "test_level" }] },
{ span: 12, formList: [{ dataIndex: "plant_type" }] }
]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "report_type" }] }]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "language" }] }]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "standard" }] }]
},
{
formType: "grid-tailwind",
customClass: ["mt-0"],
colNumber: 3,
cols: [
{
formList: [
{
formType: "card",
title: "委托方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "entrust_ident" },
{ dataIndex: "entrust_legal" },
{ dataIndex: "entrust_contact" },
{ dataIndex: "entrust_contact_phone" },
{ dataIndex: "entrust_email" }
]
}
]
},
{
formList: [
{
formType: "card",
title: "研制方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "dev_ident" },
{ dataIndex: "dev_legal" },
{ dataIndex: "dev_contact" },
{ dataIndex: "dev_contact_phone" },
{ dataIndex: "dev_email" }
]
}
]
},
{
formList: [
{
formType: "card",
title: "测评中心信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "test_ident" },
{ dataIndex: "test_legal" },
{ dataIndex: "test_contact" },
{ dataIndex: "test_contact_phone" },
{ dataIndex: "test_email" }
]
}
]
}
]
}
]
}
}

View File

@@ -2,7 +2,7 @@
<!-- 描述列表组件 --> <!-- 描述列表组件 -->
<a-modal width="1000px" v-model:visible="visible" :footer="false"> <a-modal width="1000px" v-model:visible="visible" :footer="false">
<template #title>{{ previewRecord.name }}</template> <template #title>{{ previewRecord.name }}</template>
<ma-info :columns="columns" :data="previewRecord"></ma-info> <ma-info :columns="columns" :data="previewRecord" column="3"></ma-info>
</a-modal> </a-modal>
</template> </template>
@@ -17,7 +17,6 @@ const open = (record, outColumns) => {
visible.value = true visible.value = true
previewRecord.value = record previewRecord.value = record
columns.value = outColumns columns.value = outColumns
console.log(previewRecord.value);
} }
defineExpose({ open }) defineExpose({ open })
// MA-INFO的columns // MA-INFO的columns

View File

@@ -1,22 +1,14 @@
<template> <template>
<div class="ma-content-block p-3 lg:h-full block lg:border-0 lg:flex justify-between"> <div class="ma-content-block p-3 lg:h-full block lg:border-0 lg:flex justify-between">
<ul class="w-full lg:w-2/12 msg-menu p-2 shadow" ref="msgMenuRef">
<li v-for="(item, index) in msgType" :key="item" @click="getProjectType(item.key, index)">
<Component :is="typeIcon[item.key] ? typeIcon[item.key] : 'icon-common'" />
<span class="pl-3">{{ item.title }}</span>
</li>
</ul>
<div class="h-full w-full lg:ml-3 lg:mr-2 pt-2"> <div class="h-full w-full lg:ml-3 lg:mr-2 pt-2">
<!-- ma-crud组件 --> <!-- ma-crud组件 -->
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef"> <ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
<template #operationBeforeExtend="{ record }"> <template #operationBeforeExtend="{ record }">
<!-- <a-link @click="previewRef.open(record, crudColumns)"><icon-eye />预览</a-link> --> <a-link @click="previewRef.open(record, crudColumns)"><icon-eye />预览</a-link>
<a-link @click="infoModalRef.open()"><icon-eye />预览</a-link>
</template> </template>
</ma-crud> </ma-crud>
</div> </div>
<!-- <preview ref="previewRef"></preview> --> <preview ref="previewRef"></preview>
<ma-info-modal ref="infoModalRef"></ma-info-modal>
</div> </div>
</template> </template>
@@ -24,36 +16,8 @@
import { ref } from "vue" import { ref } from "vue"
import projectApi from "@/api/testmanage/project" import projectApi from "@/api/testmanage/project"
import preview from "./cpns/preview.vue" import preview from "./cpns/preview.vue"
import MaInfoModal from "@/components/ma-info-modal/index.vue"
// 定义预览组件的Ref // 定义预览组件的Ref
const infoModalRef = ref(null)
const previewRef = ref(null) const previewRef = ref(null)
// 定义左侧标签切换-假数据
const typeIcon = ref({
er_fpga: "icon-send",
san_fpga: "icon-email",
er_cpu: "icon-copy",
san_cpu: "icon-calendar",
system_test: "icon-mobile",
examination_test: "icon-notification"
})
const msgMenuRef = ref()
const getProjectType = (key, index) => {
const children = msgMenuRef.value.children
// 如果有li元素的className找到active则清空再把点击的加上active样式
if (children && children[index].className.indexOf("active") === -1) {
for (let i = 0; i < children.length; i++) children[i].className = ""
children[index].className = "active"
}
}
const msgType = ref([
{ key: "er_fpga", title: "二方FPGA测试" },
{ key: "san_fpga", title: "三方FPGA测试" },
{ key: "examination_test", title: "考试项目测试" },
{ key: "er_cpu", title: "二方CPU测试" },
{ key: "san_cpu", title: "三方CPU测试" },
{ key: "system_test", title: "系统级测试" }
])
// CRUD-OPTIONS // CRUD-OPTIONS
const crudRef = ref() const crudRef = ref()
const crudOptions = ref({ const crudOptions = ref({
@@ -88,17 +52,15 @@ const crudOptions = ref({
] ]
}, },
{ {
formType: "grid", formType: "divider"
cols: [
{ span: 12, formList: [{ dataIndex: "beginTime" }] },
{ span: 12, formList: [{ dataIndex: "endTime" }] }
]
}, },
{ {
formType: "grid", formType: "grid",
cols: [ cols: [
{ span: 12, formList: [{ dataIndex: "duty_person" }] }, { span: 8, formList: [{ dataIndex: "beginTime" }] },
{ span: 12, formList: [{ dataIndex: "member" }] } { span: 8, formList: [{ dataIndex: "endTime" }] },
{ span: 8, formList: [{ dataIndex: "duty_person" }] },
{ span: 8, formList: [{ dataIndex: "member" }] }
] ]
}, },
{ {
@@ -111,6 +73,73 @@ const crudOptions = ref({
{ span: 12, formList: [{ dataIndex: "test_level" }] }, { span: 12, formList: [{ dataIndex: "test_level" }] },
{ span: 12, formList: [{ dataIndex: "plant_type" }] } { span: 12, formList: [{ dataIndex: "plant_type" }] }
] ]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "report_type" }] }]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "language" }] }]
},
{
formType: "grid",
cols: [{ span: 24, formList: [{ dataIndex: "standard" }] }]
},
{
formType: "grid-tailwind",
customClass: ["mt-0"],
colNumber: 3,
cols: [
{
formList: [
{
formType: "card",
title: "委托方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "entrust_ident" },
{ dataIndex: "entrust_legal" },
{ dataIndex: "entrust_contact" },
{ dataIndex: "entrust_contact_phone" },
{ dataIndex: "entrust_email" }
]
}
]
},
{
formList: [
{
formType: "card",
title: "研制方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "dev_ident" },
{ dataIndex: "dev_legal" },
{ dataIndex: "dev_contact" },
{ dataIndex: "dev_contact_phone" },
{ dataIndex: "dev_email" }
]
}
]
},
{
formList: [
{
formType: "card",
title: "测评中心信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "test_ident" },
{ dataIndex: "test_legal" },
{ dataIndex: "test_contact" },
{ dataIndex: "test_contact_phone" },
{ dataIndex: "test_email" }
]
}
]
}
]
} }
] ]
} }
@@ -155,6 +184,7 @@ const crudColumns = ref([
search: true, search: true,
addDisplay: false, addDisplay: false,
editDisplay: false, editDisplay: false,
infoShow: false,
formType: "range" formType: "range"
}, },
{ {
@@ -231,160 +261,104 @@ const crudColumns = ref([
formType: "checkbox", formType: "checkbox",
dict: { name: "standard", props: { label: "title", value: "key" } } dict: { name: "standard", props: { label: "title", value: "key" } }
}, },
{
hide: true,
formType: "grid-tailwind",
customClass: ["mt-0 mb-3"],
colNumber: 3,
cols: [
{
formList: [
{
title: "委托方信息",
customClass: ["mt-0"],
formType: "card",
formList: [
{
formType: "grid-tailwind",
colNumber: 1,
cols: [
{
formList: [
{ {
title: "标识", title: "标识",
dataIndex: "entrust_ident", dataIndex: "entrust_ident",
hide: true,
rules: [{ required: true, message: "标识必填" }] rules: [{ required: true, message: "标识必填" }]
}, },
{ {
title: "法人", title: "法人",
dataIndex: "entrust_legal", dataIndex: "entrust_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }] rules: [{ required: true, message: "法人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系人", title: "联系人",
dataIndex: "entrust_contact", dataIndex: "entrust_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }] rules: [{ required: true, message: "联系人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系电话", title: "联系电话",
dataIndex: "entrust_contact_phone", dataIndex: "entrust_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }] rules: [{ required: true, message: "联系电话必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "电子邮箱", title: "电子邮箱",
dataIndex: "entrust_email", dataIndex: "entrust_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }] rules: [{ required: true, message: "电子邮箱必填" }]
}
]
}
]
}
]
}
]
}, },
{
formList: [
{
title: "研制单位信息",
customClass: ["mt-0"],
formType: "card",
formList: [
{
formType: "grid-tailwind",
colNumber: 1,
cols: [
{
formList: [
{ {
title: "标识", title: "标识",
dataIndex: "dev_ident", dataIndex: "dev_ident",
hide: true,
rules: [{ required: true, message: "标识必填" }] rules: [{ required: true, message: "标识必填" }]
}, },
{ {
title: "法人", title: "法人",
dataIndex: "dev_legal", dataIndex: "dev_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }] rules: [{ required: true, message: "法人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系人", title: "联系人",
dataIndex: "dev_contact", dataIndex: "dev_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }] rules: [{ required: true, message: "联系人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系电话", title: "联系电话",
dataIndex: "dev_contact_phone", dataIndex: "dev_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }] rules: [{ required: true, message: "联系电话必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "电子邮箱", title: "电子邮箱",
dataIndex: "dev_email", dataIndex: "dev_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }] rules: [{ required: true, message: "电子邮箱必填" }]
}
]
}
]
}
]
}
]
}, },
{
formList: [
{
title: "测评单位信息",
customClass: ["mt-0"],
formType: "card",
formList: [
{
formType: "grid-tailwind",
colNumber: 1,
cols: [
{
formList: [
{ {
title: "标识", title: "标识",
dataIndex: "test_ident", dataIndex: "test_ident",
hide: true,
rules: [{ required: true, message: "标识必填" }] rules: [{ required: true, message: "标识必填" }]
}, },
{ {
title: "法人", title: "法人",
dataIndex: "test_legal", dataIndex: "test_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }] rules: [{ required: true, message: "法人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系人", title: "联系人",
dataIndex: "test_contact", dataIndex: "test_contact",
hide: true,
rules: [{ required: true, message: "联系人必填" }] rules: [{ required: true, message: "联系人必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "联系电话", title: "联系电话",
dataIndex: "test_contact_phone", dataIndex: "test_contact_phone",
hide: true,
rules: [{ required: true, message: "联系电话必填" }] rules: [{ required: true, message: "联系电话必填" }]
}, },
{ {
formType: "input", formType: "input",
title: "电子邮箱", title: "电子邮箱",
dataIndex: "test_email", dataIndex: "test_email",
hide: true,
rules: [{ required: true, message: "电子邮箱必填" }] rules: [{ required: true, message: "电子邮箱必填" }]
}
]
}
]
}
]
}
]
}
]
}, },
{ {
title: "状态", title: "状态",

View File

@@ -78,19 +78,22 @@ watch(
) )
const reset = (vl) => { const reset = (vl) => {
data.value = vl data.value = vl // 外传columns
descriptions.value = [] descriptions.value = [] // 初始化表达数据
if (!columns.value) { if (!columns.value) { // 如果不存在columns值则不处理
return return
} }
columns.value.forEach(async (item) => { columns.value.forEach(async (item) => {
let value = null let value = null
// 如果item为空、dataIndex为"__operation"、infoShow属性为false则不处理
if (isEmpty(item) || item.dataIndex === "__operation" || item.infoShow === false) { if (isEmpty(item) || item.dataIndex === "__operation" || item.infoShow === false) {
return return
} }
// 处理公共列
if (isBoolean(item.common) && item.common && globalColumn[item.dataIndex]) { if (isBoolean(item.common) && item.common && globalColumn[item.dataIndex]) {
item = globalColumn[item.dataIndex] item = globalColumn[item.dataIndex]
} }
// 处理字典字段
if (item.dict) { if (item.dict) {
await loadDict(dictList, item) await loadDict(dictList, item)
item.dict.data = dictList[item.dataIndex] ?? [] item.dict.data = dictList[item.dataIndex] ?? []