This commit is contained in:
2023-10-08 20:11:42 +08:00
parent 8c6b314546
commit 89fc1102f9
8 changed files with 89 additions and 28 deletions

View File

@@ -68,13 +68,13 @@ const crudOptions = ref({
rowSelection: { showCheckedAll: true },
operationColumn: true,
operationWidth: 160,
operationColumnAlign:'center',
operationColumnAlign: "center",
beforeAdd: (form) => {
form.id = currentRow.value?.id
},
add: { show: true, api: dictApi.saveDictItem },
edit: { show: true, api: dictApi.updateDictItemData },
delete: { show: true, api: dictApi.realDeleteItem },
delete: { show: true, api: dictApi.realDeleteItem }
})
// crudColumns
const columns = ref([
@@ -84,15 +84,14 @@ const columns = ref([
align: "center",
dataIndex: "title",
search: true,
width: 220,
width: 150,
commonRules: [{ required: true, message: "字典标签必填" }]
},
{
title:"字段缩写",
dataIndex:"show_title",
width: 220,
title: "字段缩写",
dataIndex: "show_title",
align: "center",
search: true,
search: true
},
{
title: "字典键值",
@@ -101,7 +100,6 @@ const columns = ref([
addDisplay: false,
editDisplay: false,
search: true,
width: 220,
commonRules: [{ required: true, message: "字典键值必填" }]
},
{
@@ -110,7 +108,7 @@ const columns = ref([
dataIndex: "sort",
formType: "input-number",
addDefaultValue: 1,
width: 180,
width: 130,
min: 0,
max: 1000
},
@@ -123,7 +121,7 @@ const columns = ref([
formType: "radio",
dict: { name: "data_status", props: { label: "title", value: "key" } },
addDefaultValue: "1",
width: 180
width: 70
},
{
title: "备注",
@@ -140,7 +138,28 @@ const columns = ref([
editDisplay: false,
search: true,
formType: "range",
width: 180
width: 110
},
{
title: "文档名称",
dataIndex: "doc_name",
align: "center",
search: false,
placeholder: "如果不是标准则不填"
},
{
title: "发布日期",
dataIndex: "publish_date",
align: "center",
search: false,
placeholder: "如果不是标准则不填"
},
{
title: "标准来源",
dataIndex: "source",
align: "center",
search: false,
placeholder: "如果不是标准则不填"
}
])

View File

@@ -60,7 +60,7 @@ const crudOptions = ref({
rowSelection: { showCheckedAll: true },
searchColNumber: 4,
tablePagination: false,
operationColumn: true,
operationColumn: true
})
const crudColumns = ref([
@@ -107,7 +107,7 @@ const crudColumns = ref([
search: true,
formType: "range",
width: 180
}
},
])
</script>

View File

@@ -45,6 +45,14 @@ const crudColumns = ref([
search: true,
width: 220,
commonRules: [{ required: true, message: "法人必填" }]
},
{
title:'地址',
align:'center',
dataIndex:'addr',
search:true,
width:200,
commonRules: [{ required: true, message: "公司地址必填" }]
}
])
</script>

View File

@@ -6,6 +6,8 @@
<template #operationBeforeExtend="{ record }">
<a-link @click="enterWorkPlant(record)">进入工作区</a-link>
<a-link @click="previewRef.open(record, crudColumns)"><icon-eye />预览</a-link>
<a-link @click="createYiju(record)"><icon-eye />测试生成依据文件</a-link>
<a-link @click="createContact(record)"><icon-eye />测试联系方式</a-link>
</template>
</ma-crud>
</div>
@@ -17,6 +19,8 @@ import { ref } from "vue"
import { useRoute, useRouter } from "vue-router"
import projectApi from "@/api/testmanage/project"
import preview from "./cpns/preview.vue"
import dgGenerateApi from "@/api/generate/dgGenerate"
import { Message } from "@arco-design/web-vue"
const router = useRouter()
// 定义预览组件的Ref
const previewRef = ref(null)
@@ -28,6 +32,17 @@ const enterWorkPlant = function (record) {
router.push({ name: "project", query: record })
}
// ~~~~~~~~测试生成文档~~~~~~~~
const createYiju = async (record) => {
const st = await dgGenerateApi.createYiju({ id: record.id })
Message.success(st.message)
}
const createContact = async (record) => {
const st = await dgGenerateApi.createContact({ id: record.id })
Message.success(st.message)
}
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CRUD-OPTIONS
const crudRef = ref()
const crudOptions = ref({