This commit is contained in:
caozehui
2025-03-17 14:33:19 +08:00
parent ec1d09dbd0
commit 1675a5af31

View File

@@ -13,17 +13,23 @@
<el-input v-model.trim="formContent.name" placeholder="请输入脚本名称" clearable />
</el-form-item>
<el-form-item label="参照标准名称" prop="standardName">
<el-input v-model.trim="formContent.standardName" placeholder="请输入参照标准名称" clearable />
<!-- <el-input v-model.trim="formContent.standardName" placeholder="请输入参照标准名称" clearable />-->
<el-select v-model="formContent.standardName" filterable placeholder="请选择参照标准名称" @change="setStandardTimeList">
<el-option v-for="item in standardNameList" :key="item.label" :label="item.label" :value="item.label" />
</el-select>
</el-form-item>
<el-form-item label="标准推行年份" prop="standardTime">
<el-date-picker
v-model="formContent.standardTime"
style="width: 100%"
type="year"
format="YYYY"
value-format="YYYY"
placeholder="请选择标准推行年份"
/>
<!-- <el-date-picker-->
<!-- v-model="formContent.standardTime"-->
<!-- style="width: 100%"-->
<!-- type="year"-->
<!-- format="YYYY"-->
<!-- value-format="YYYY"-->
<!-- placeholder="请选择标准推行年份"-->
<!-- />-->
<el-select v-model="formContent.standardTime" filterable placeholder="请选择标准推行年份">
<el-option v-for="item in standardTimeList" :key="item" :value="item" :label="item" />
</el-select>
</el-form-item>
<el-form-item label="模版类型" prop="type">
<el-select v-model="formContent.type" filterable clearable placeholder="请选择模版类型">
@@ -100,6 +106,8 @@ const modeId = ref()
const show = ref(false)
const height = ref('125px')
const router = useRouter()
const standardNameList = reactive<{id:string,label: string, value: string}[]>([])
const standardTimeList = reactive<Array<string>>([])
const secondLevelOptions: any[] = []
// 定义弹出组件元信息
@@ -166,6 +174,15 @@ const close = () => {
// 关闭信息弹框
const closeInformation = () => {}
const setStandardTimeList = ()=>{
let checkStandard = standardNameList.find(item => item.label === formContent.value.standardName)
if (checkStandard) {
standardTimeList.push(...checkStandard.value.split(','))
} else {
standardTimeList.push('2016', '2017', '2018', '2019', '2020', '2021', '2022', '2023', '2024', '2025')
}
}
// 保存数据
const save = () => {
// dialogFormRef
@@ -197,6 +214,10 @@ const save = () => {
// 打开弹窗,可能是新增,也可能是编辑
const open = async (title: string, row: any) => {
dictStore.getDictData("Script_Standard_Name").forEach(item => {
standardNameList.push({id: item.id, label: item.name, value: item.value})
})
titleType.value = title
if (title == '新增检测脚本') {
show.value = false