UPDATE: 检测计划选择数据源逻辑改成主计划默认全选,子计划勾选校验
This commit is contained in:
@@ -46,7 +46,7 @@ export namespace Plan {
|
|||||||
|
|
||||||
|
|
||||||
export interface ReqPlan extends ResPlan {
|
export interface ReqPlan extends ResPlan {
|
||||||
datasourceIds:string;
|
datasourceIds:string | string[];
|
||||||
sourceIds: string | null;
|
sourceIds: string | null;
|
||||||
planId:string;
|
planId:string;
|
||||||
scriptName: string ;
|
scriptName: string ;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
style="width: 82%; margin: 0 10px"
|
style="width: 82%; margin: 0 10px"
|
||||||
size="small"
|
size="small"
|
||||||
|
clearable
|
||||||
v-model="filter.leftText"
|
v-model="filter.leftText"
|
||||||
:placeholder="props.filterPlaceholder"
|
:placeholder="props.filterPlaceholder"
|
||||||
/>
|
/>
|
||||||
@@ -138,6 +139,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
style="width: 80%; margin: 0 10px"
|
style="width: 80%; margin: 0 10px"
|
||||||
size="small"
|
size="small"
|
||||||
|
clearable
|
||||||
v-model="filter.rightText"
|
v-model="filter.rightText"
|
||||||
:placeholder="props.filterPlaceholder"
|
:placeholder="props.filterPlaceholder"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -80,13 +80,13 @@
|
|||||||
<el-form-item :label-width="110" label="数据源" prop="datasourceIds">
|
<el-form-item :label-width="110" label="数据源" prop="datasourceIds">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="formContent.datasourceIds"
|
v-model="formContent.datasourceIds"
|
||||||
:disabled="planType != 0 || allDisabled"
|
:disabled="allDisabled"
|
||||||
:max-collapse-tags="2"
|
:max-collapse-tags="1"
|
||||||
:multiple="selectByMode"
|
:multiple="selectByMode"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
clearable
|
:clearable="planType != 0"
|
||||||
collapse-tags
|
collapse-tags
|
||||||
filterable
|
:filterable="planType != 0"
|
||||||
placeholder="请选择数据源"
|
placeholder="请选择数据源"
|
||||||
@change="handleDataSourceChange"
|
@change="handleDataSourceChange"
|
||||||
>
|
>
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.code || ''"
|
:value="item.code || ''"
|
||||||
|
:disabled="planType == 0 || allDisabled"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -731,7 +732,11 @@ const open = async (sign: string, data: Plan.ReqPlan, currentMode: string, plan:
|
|||||||
formContent.scriptId = pqScriptList.value[0]?.id ?? ''
|
formContent.scriptId = pqScriptList.value[0]?.id ?? ''
|
||||||
formContent.errorSysId = pqErrSysList.value[0]?.id ?? ''
|
formContent.errorSysId = pqErrSysList.value[0]?.id ?? ''
|
||||||
formContent.sourceIds = pqSourceList.value[0]?.id ?? ''
|
formContent.sourceIds = pqSourceList.value[0]?.id ?? ''
|
||||||
formContent.datasourceIds = dictStore.getDictData('Datasource')[0]?.code ?? ''
|
const datasourceDicts = dictStore.getDictData('Datasource')
|
||||||
|
if (plan == 0) {
|
||||||
|
formContent.datasourceIds = datasourceDicts.map(item => item.code)
|
||||||
|
}
|
||||||
|
// formContent.datasourceIds = dictStore.getDictData('Datasource')[0]?.code ?? ''
|
||||||
formContent.dataRule = dictStore.getDictData('Data_Rule')[0]?.id ?? ''
|
formContent.dataRule = dictStore.getDictData('Data_Rule')[0]?.id ?? ''
|
||||||
} else {
|
} else {
|
||||||
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
|
//编辑时先给表单赋值(这会没接收被检设备),需要手动再给被检设备复制后整体表单赋值
|
||||||
@@ -1018,6 +1023,7 @@ const dataSourceType = computed(() => {
|
|||||||
|
|
||||||
const handleDataSourceChange = () => {
|
const handleDataSourceChange = () => {
|
||||||
if (mode.value != '比对式') return
|
if (mode.value != '比对式') return
|
||||||
|
if (planType.value == 1 || planType.value == 2) {
|
||||||
// 获取当前选中的 datasourceIds,并确保为数组
|
// 获取当前选中的 datasourceIds,并确保为数组
|
||||||
const values = Array.isArray(formContent.datasourceIds)
|
const values = Array.isArray(formContent.datasourceIds)
|
||||||
? formContent.datasourceIds
|
? formContent.datasourceIds
|
||||||
@@ -1043,6 +1049,7 @@ const handleDataSourceChange = () => {
|
|||||||
formContent.datasourceIds = ''
|
formContent.datasourceIds = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//导入设备
|
//导入设备
|
||||||
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
const deviceImportExcel = ref<InstanceType<typeof ImportExcel> | null>(null)
|
||||||
|
|||||||
Reference in New Issue
Block a user