fix: 🐛 eslint 打包警告问题修复
This commit is contained in:
@@ -5,21 +5,15 @@
|
|||||||
<el-col v-show="!item.hidden" v-bind="item.col">
|
<el-col v-show="!item.hidden" v-bind="item.col">
|
||||||
<el-form-item :label="item.label" :prop="item.prop">
|
<el-form-item :label="item.label" :prop="item.prop">
|
||||||
<!-- Label -->
|
<!-- Label -->
|
||||||
<template v-if="item.tips" #label>
|
<template #label>
|
||||||
<span>
|
<span class="flex-y-center">
|
||||||
{{ item.label }}
|
{{ item?.label || "" }}
|
||||||
<el-tooltip
|
<el-tooltip v-if="item?.tips" v-bind="getTooltipProps(item.tips)">
|
||||||
placement="bottom"
|
<QuestionFilled class="w-4 h-4 mx-1" />
|
||||||
effect="light"
|
|
||||||
:content="item.tips"
|
|
||||||
:raw-content="true"
|
|
||||||
>
|
|
||||||
<el-icon style="vertical-align: -0.15em" size="16">
|
|
||||||
<QuestionFilled />
|
|
||||||
</el-icon>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Input 输入框 -->
|
<!-- Input 输入框 -->
|
||||||
<template v-if="item.type === 'input' || item.type === undefined">
|
<template v-if="item.type === 'input' || item.type === undefined">
|
||||||
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
|
<el-input v-model="formData[item.prop]" v-bind="item.attrs" />
|
||||||
@@ -151,6 +145,11 @@ function setFormItemData(key: string, value: any) {
|
|||||||
formData[key] = value;
|
formData[key] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取tooltip提示框属性
|
||||||
|
const getTooltipProps = (tips: string | IObject) => {
|
||||||
|
return typeof tips === "string" ? { content: tips } : tips;
|
||||||
|
};
|
||||||
|
|
||||||
// 暴露的属性和方法
|
// 暴露的属性和方法
|
||||||
defineExpose({ formRef, getFormData, setFormData, setFormItemData });
|
defineExpose({ formRef, getFormData, setFormData, setFormItemData });
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,12 +12,7 @@
|
|||||||
<template #label>
|
<template #label>
|
||||||
<span class="flex-y-center">
|
<span class="flex-y-center">
|
||||||
{{ item?.label || "" }}
|
{{ item?.label || "" }}
|
||||||
<el-tooltip
|
<el-tooltip v-if="item?.tips" v-bind="getTooltipProps(item.tips)">
|
||||||
v-if="item?.tips"
|
|
||||||
v-bind="
|
|
||||||
typeof item.tips === 'string' ? { content: item.tips } : (item.tips as any)
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<QuestionFilled class="w-4 h-4 mx-1" />
|
<QuestionFilled class="w-4 h-4 mx-1" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span v-if="searchConfig.colon" class="ml-0.5">:</span>
|
<span v-if="searchConfig.colon" class="ml-0.5">:</span>
|
||||||
@@ -92,7 +87,10 @@ const componentMap = new Map<ISearchComponent, Component>([
|
|||||||
/* eslint-enable */
|
/* eslint-enable */
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
// 存储表单实例
|
||||||
const queryFormRef = ref<FormInstance>();
|
const queryFormRef = ref<FormInstance>();
|
||||||
|
// 存储查询参数
|
||||||
|
const queryParams = reactive<IObject>({});
|
||||||
// 是否显示
|
// 是否显示
|
||||||
const visible = ref(true);
|
const visible = ref(true);
|
||||||
// 响应式的formItems
|
// 响应式的formItems
|
||||||
@@ -119,12 +117,21 @@ const isGrid = computed(() =>
|
|||||||
? "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 4xl:grid-cols-6 gap-5"
|
? "grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 3xl:grid-cols-5 4xl:grid-cols-6 gap-5"
|
||||||
: "flex flex-wrap gap-x-8 gap-y-4"
|
: "flex flex-wrap gap-x-8 gap-y-4"
|
||||||
);
|
);
|
||||||
// 搜索表单数据
|
|
||||||
const queryParams = reactive<IObject>({});
|
// 获取tooltip提示框属性
|
||||||
|
const getTooltipProps = (tips: string | IObject) => {
|
||||||
|
return typeof tips === "string" ? { content: tips } : tips;
|
||||||
|
};
|
||||||
|
// 查询/重置操作
|
||||||
|
const handleQuery = () => emit("queryClick", queryParams);
|
||||||
|
const handleReset = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
emit("resetClick", queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
formItems.forEach((item) => {
|
formItems.forEach((item) => {
|
||||||
item.initFn && item.initFn(item);
|
item?.initFn && item.initFn(item);
|
||||||
if (["input-tag", "custom-tag", "cascader"].includes(item?.type ?? "")) {
|
if (["input-tag", "custom-tag", "cascader"].includes(item?.type ?? "")) {
|
||||||
queryParams[item.prop] = Array.isArray(item.initialValue) ? item.initialValue : [];
|
queryParams[item.prop] = Array.isArray(item.initialValue) ? item.initialValue : [];
|
||||||
} else if (item.type === "input-number") {
|
} else if (item.type === "input-number") {
|
||||||
@@ -134,14 +141,6 @@ onMounted(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 查询/重置操作
|
|
||||||
const handleQuery = () => emit("queryClick", queryParams);
|
|
||||||
const handleReset = () => {
|
|
||||||
queryFormRef.value?.resetFields();
|
|
||||||
emit("resetClick", queryParams);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 暴露的属性和方法
|
// 暴露的属性和方法
|
||||||
defineExpose({
|
defineExpose({
|
||||||
// 获取分页数据
|
// 获取分页数据
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import type { DialogProps, DrawerProps, FormItemRule, PaginationProps } from "element-plus";
|
import type { DialogProps, DrawerProps, FormItemRule, PaginationProps } from "element-plus";
|
||||||
import type { FormProps, TableProps, ColProps, ButtonProps, CardProps } from "element-plus";
|
import type { FormProps, TableProps, ColProps, ButtonProps, CardProps } from "element-plus";
|
||||||
import type { ElTooltipProps } from "element-plus";
|
|
||||||
import type PageContent from "./PageContent.vue";
|
import type PageContent from "./PageContent.vue";
|
||||||
import type PageForm from "./PageForm.vue";
|
import type PageForm from "./PageForm.vue";
|
||||||
import type PageModal from "./PageModal.vue";
|
import type PageModal from "./PageModal.vue";
|
||||||
@@ -53,7 +52,7 @@ export interface ISearchConfig {
|
|||||||
// 标签文本
|
// 标签文本
|
||||||
label?: string;
|
label?: string;
|
||||||
// 标签提示
|
// 标签提示
|
||||||
tips?: string | Partial<ElTooltipProps>;
|
tips?: string | IObject;
|
||||||
// 键名
|
// 键名
|
||||||
prop: string;
|
prop: string;
|
||||||
// 组件属性(input-tag组件支持join,btnText,size属性)
|
// 组件属性(input-tag组件支持join,btnText,size属性)
|
||||||
|
|||||||
Reference in New Issue
Block a user