From 27ba504441037666e787ded85b4af2f65be65c17 Mon Sep 17 00:00:00 2001
From: schangxiang@126.com <schangxiang@126.com>
Date: 周二, 29 4月 2025 18:06:07 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo

---
 HIAWms/web/src/components/Container/Container.tsx |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 deletions(-)

diff --git a/HIAWms/web/src/components/Container/Container.tsx b/HIAWms/web/src/components/Container/Container.tsx
new file mode 100644
index 0000000..fd6626b
--- /dev/null
+++ b/HIAWms/web/src/components/Container/Container.tsx
@@ -0,0 +1,64 @@
+import { computed, defineComponent, ref } from 'vue'
+import styles from './Container.module.scss'
+import Icon from '@/components/Icon/Icon'
+import { useVModel } from '@vueuse/core'
+import { debounce } from 'lodash'
+export default defineComponent({
+  name: '閫氱敤澶撮儴',
+  props: {
+    title: {
+      type: String,
+      required: true,
+    },
+    placeholder: {
+      type: String,
+      default: '璇疯緭鍏ユ悳绱�',
+    },
+    modelValue: {
+      type: String,
+      default: '',
+    },
+    isSearch: {
+      type: Boolean,
+      default: true,
+    },
+  },
+  emits: ['confirm', 'update:modelValue'],
+  setup(props, { slots, emit }) {
+    const innerValue = useVModel(props)
+    const isBlur = ref(false)
+    const confirm = (event: KeyboardEvent) => {
+      if (event.key === 'Enter' || event.keyCode === 13) {
+        emit('confirm', innerValue.value)
+      }
+    }
+
+    const onEventChange = (isFocus: boolean) => {
+      isBlur.value = isFocus
+    }
+    return () => {
+      return (
+        <div class={styles.container}>
+          <div class={styles.header}>
+            <span class={styles.title}>{props.title}</span>
+            {props.isSearch && (
+              <el-input
+                size="small"
+                onKeydown={confirm}
+                v-model={innerValue.value}
+                class={styles.innerInput}
+                onBlur={() => onEventChange(false)}
+                onFocus={() => onEventChange(true)}
+                placeholder={!isBlur.value ? props.placeholder : ''}
+                prefix-icon={
+                  <Icon icon="white_search" width={12} height={12} />
+                }
+              />
+            )}
+          </div>
+          <div class={styles.content}>{slots.default?.()}</div>
+        </div>
+      )
+    }
+  },
+})

--
Gitblit v1.9.3