<template>
  <div
    v-if="title != '质量异常' && title != '剔除列表' && title != '检验任务'"
    class="screen-common-component-header"
    :style="{ fontSize: bigScreenData.fontSize * 2.4 + 'px' }"
    @dblclick="selectComponents"
  >
    {{ title }}
  </div>
  <!--  title == '质量异常' || title == '剔除列表' || title == '检验任务'-->
  <div
    v-if="title == '质量异常' || title == '剔除列表' || title == '检验任务'"
    class="screen-common-component-header"
    :style="{ fontSize: bigScreenData.fontSize * 2.4 + 'px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }"
    @dblclick="selectComponents"
  >
    <dv-decoration-1 style="width:180px;height:50px;"/>
    <div style="flex: 1; text-align: center;">{{ title }}</div>
    <dv-decoration-1 style="width:180px;height:50px;"/>
  </div>
</template>

<script lang="ts" setup>
import { useCommonStore } from "@/store";
const bigScreenData: any = inject("bigScreenData");
const commonS = useCommonStore();

const props = defineProps({
  moduleId: {
    type: String,
    required: true,
  },
  title: {
    type: String,
    required: false,
  },
  align: {
    type: String,
    default: "center",
  },
  titleSize: {
    type: String,
    default: "16px",
  },
});

const selectComponents = () => {
  commonS.moduleKey = props.moduleId;
  commonS.isShowSelectModule = true;
};
</script>

<style lang="scss" scoped>
.screen-common-component-header {
  width: 100%;
  display: flex;
  justify-content: v-bind(align);
  align-items: center;
  font-size: v-bind(titleSize);
  color: #fff;
}
</style>
