This commit is contained in:
2023-08-17 20:15:03 +08:00
parent de474e3b2e
commit 4ce12642fa
6 changed files with 139 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="ma-content-block lg:flex justify-between p-4">
<div class="ma-content-block lg:flex justify-between p-4" ref="crudRef">
<div class="lg:w-full w-full lg:ml-4 mt-5 lg:mt-0">
<!-- CRUD组件 -->
<ma-crud :options="crudOptions" :columns="crudColumns">

View File

@@ -0,0 +1,52 @@
<template>
<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">
<!-- crud组件 -->
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef"></ma-crud>
</div>
</div>
</template>
<script setup>
import { ref } from "vue"
import { Message } from "@arco-design/web-vue"
import contactApi from "@/api/system/contact"
const crudRef = ref()
const crudOptions = ref({
autoRequest: true,
api: contactApi.getlist,
add: { show: true, api: contactApi.save },
edit: { show: true, api: contactApi.update },
delete: { show: true, api: contactApi.delete },
operationWidth: 160,
operationColumn: true,
operationColumnAlign: "center",
showIndex: false,
searchColNumber: 3,
tablePagination: false,
rowSelection: { showCheckedAll: true }
})
const crudColumns = ref([
{ title: "ID", dataIndex: "id", addDisplay: false, editDisplay: false, width: 50, hide: true },
{ title: "公司编号", align: "center", dataIndex: "key", search: true, width: 220 },
{
title: "名称",
align: "center",
dataIndex: "name",
search: true,
width: 220,
commonRules: [{ required: true, message: "名称必填" }]
},
{
title: "法人",
align: "center",
dataIndex: "entrust_person",
search: true,
width: 220,
commonRules: [{ required: true, message: "法人必填" }]
}
])
</script>
<style lang="less" scoped></style>

View File

@@ -2,7 +2,7 @@
<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">
<!-- CRUD组件 -->
<ma-crud :options="crudOptions" :columns="crudColumns">
<ma-crud :options="crudOptions" :columns="crudColumns" ref="crudRef">
<template #total_code_line="{ record }">
<template v-if="record.total_code_line">
<a-statistic
@@ -50,7 +50,7 @@ const treeDataStore = useTreeDataStore()
const route = useRoute()
const roundNumber = route.query.key.split("-")[0]
const projectId = ref(route.query.id)
const crudRef = ref()
// crud组件
const crudOptions = ref({
api: dutApi.getDutList,
@@ -108,7 +108,10 @@ const crudColumns = ref([
align: "center",
dataIndex: "ident",
search: true,
commonRules: [{ required: true, message: "标识是必填" }],
// 这里做的标识预填
addDefaultValue: route.query.ident + "-R" + (parseInt(route.query.key) + 1) + "-UT",
addDisabled: true,
editDisabled: true,
validateTrigger: "blur"
},
{

View File

@@ -23,9 +23,9 @@ const crudRef = ref()
const crudOptions = ref({
rowSelection: { showCheckedAll: true },
api: projectApi.getPageList,
add: { show: true,api: projectApi.save},
edit: { show: true,api: projectApi.update},
delete: { show: true ,api:projectApi.delete},
add: { show: true, api: projectApi.save },
edit: { show: true, api: projectApi.update },
delete: { show: true, api: projectApi.delete },
searchColNumber: 3,
tablePagination: false,
operationColumn: true,
@@ -97,8 +97,7 @@ const crudOptions = ref({
title: "委托方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "entrust_ident" },
{ dataIndex: "entrust_legal" },
{ dataIndex: "entrust_unit" },
{ dataIndex: "entrust_contact" },
{ dataIndex: "entrust_contact_phone" },
{ dataIndex: "entrust_email" }
@@ -113,8 +112,7 @@ const crudOptions = ref({
title: "研制方信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "dev_ident" },
{ dataIndex: "dev_legal" },
{ dataIndex: "dev_unit" },
{ dataIndex: "dev_contact" },
{ dataIndex: "dev_contact_phone" },
{ dataIndex: "dev_email" }
@@ -129,8 +127,7 @@ const crudOptions = ref({
title: "测评中心信息",
customClass: ["mt-3", "mb-5", "mx-1"],
formList: [
{ dataIndex: "test_ident" },
{ dataIndex: "test_legal" },
{ dataIndex: "test_unit" },
{ dataIndex: "test_contact" },
{ dataIndex: "test_contact_phone" },
{ dataIndex: "test_email" }
@@ -262,16 +259,12 @@ const crudColumns = ref([
dict: { name: "standard", props: { label: "title", value: "key" } }
},
{
title: "标识",
dataIndex: "entrust_ident",
title: "单位",
dataIndex: "entrust_unit",
hide: true,
rules: [{ required: true, message: "标识必填" }]
},
{
title: "法人",
dataIndex: "entrust_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }]
commonRules: [{ required: true, message: "单位必选" }],
formType: "select",
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
},
{
formType: "input",
@@ -295,16 +288,12 @@ const crudColumns = ref([
rules: [{ required: true, message: "电子邮箱必填" }]
},
{
title: "标识",
dataIndex: "dev_ident",
title: "单位",
dataIndex: "dev_unit",
hide: true,
rules: [{ required: true, message: "标识必填" }]
},
{
title: "法人",
dataIndex: "dev_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }]
commonRules: [{ required: true, message: "单位必选" }],
formType: "select",
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
},
{
formType: "input",
@@ -328,16 +317,12 @@ const crudColumns = ref([
rules: [{ required: true, message: "电子邮箱必填" }]
},
{
title: "标识",
dataIndex: "test_ident",
title: "单位",
dataIndex: "test_unit",
hide: true,
rules: [{ required: true, message: "标识必填" }]
},
{
title: "法人",
dataIndex: "test_legal",
hide: true,
rules: [{ required: true, message: "法人必填" }]
commonRules: [{ required: true, message: "单位必选" }],
formType: "select",
dict: { url: "system/contact/index", props: { label: "name", value: "name" }, translation: true }
},
{
formType: "input",