<template>
|
<app-dialog-form
|
v-bind="dialogFormProps"
|
>
|
<app-collapse-form title="匹配规则">
|
<div class="table">
|
<div class="item" v-for="(item,index) in form.join">
|
<el-input
|
style="width: 35%;"
|
v-model="item.base_band_column_name"
|
readonly
|
/>
|
<el-input
|
style="width: 20%;"
|
v-model="item.join_type"
|
readonly
|
/>
|
<el-input
|
style="width: 35%;"
|
v-model="item.target_band_column_name"
|
readonly
|
/>
|
</div>
|
</div>
|
</app-collapse-form>
|
<app-collapse-form title="默认过滤">
|
<div class="table">
|
<div class="item" v-for="(item,index) in form.filter">
|
<el-input
|
style="width: 35%;"
|
v-model="item.name"
|
readonly
|
/>
|
<el-input
|
style="width: 20%;"
|
v-model="item.filter_type"
|
readonly
|
/>
|
<el-input
|
style="width: 35%;"
|
v-model="item.filter_value"
|
readonly
|
/>
|
</div>
|
</div>
|
</app-collapse-form>
|
</app-dialog-form>
|
</template>
|
|
<script setup>
|
|
import {dict} from '@/hooks';
|
|
const {useDictMap} = dict;
|
|
import {useAppStore, useEntityStore} from "@/store/modules";
|
|
const entityStore = useEntityStore();
|
|
const appStore = useAppStore();
|
|
const dialogFormRef = ref();
|
|
const loading = ref(false);
|
|
|
const filterMap = {
|
'in': '范围内'
|
}
|
|
const [,dictMapCode] = useDictMap(['filter_type']);
|
|
const form = reactive({
|
join: [],
|
filter: []
|
});
|
|
const init = async (id) => {
|
loadiyang.value = true;
|
const [join, filter] = await Promise.all([
|
entityStore.getEntitySet({
|
dataName: "v_plan_join_info",
|
attachMeta: false,
|
filter: `id = '${id}'`
|
}),
|
entityStore.getEntitySet({
|
dataName: "v_plan_filter_info",
|
attachMeta: false,
|
filter: `id = '${id}'`
|
})
|
]);
|
|
console.log(dictMapCode.filter_type);
|
form.join = join.data.entityset.map(item => {
|
item.join_type = dictMapCode.filter_type[item.join_type];
|
return item;
|
});
|
form.filter = filter.data.entityset.map(item => {
|
item.filter_type = filterMap[item.filter_type] || item.filter_type;
|
return item;
|
});
|
}
|
|
const dialogFormProps = {
|
title: '列表',
|
ref: dialogFormRef,
|
footerDom: false
|
};
|
|
const onOpen = async (id) => {
|
dialogFormRef.value.onOpen();
|
await nextTick();
|
|
await init(id);
|
}
|
|
defineExpose({
|
onOpen
|
});
|
|
</script>
|
|
<style lang="scss" scoped>
|
.table {
|
|
.item {
|
margin-bottom: 10px;
|
display: flex;
|
justify-content: space-around;
|
}
|
}
|
</style>
|