feat: select组件替换
This commit is contained in:
@ -54,18 +54,18 @@
|
||||
<template v-if="[AuditStatus.Auditing, AuditStatus.Passed].includes(query.audit_status)">
|
||||
<div class="filter-row-item">
|
||||
<span class="label">审核平台</span>
|
||||
<a-select
|
||||
v-model="query.audit_platform"
|
||||
size="medium"
|
||||
<Select
|
||||
v-model:value="query.audit_platform"
|
||||
size="middle"
|
||||
placeholder="全部"
|
||||
allow-clear
|
||||
allowClear
|
||||
@change="handleSearch"
|
||||
class="!w-160px"
|
||||
>
|
||||
<a-option v-for="(item, index) in PLATFORMS" :key="index" :value="item.value" :label="item.label">{{
|
||||
<Option v-for="(item, index) in PLATFORMS" :key="index" :value="item.value" :label="item.label">{{
|
||||
item.label
|
||||
}}</a-option>
|
||||
</a-select>
|
||||
}}</Option>
|
||||
</Select>
|
||||
</div>
|
||||
<div class="filter-row-item">
|
||||
<span class="label">审核时间</span>
|
||||
@ -100,7 +100,8 @@
|
||||
|
||||
<script setup>
|
||||
import { defineEmits, defineProps } from 'vue';
|
||||
import { Button, Input } from 'ant-design-vue';
|
||||
import { Button, Input, Select } from 'ant-design-vue';
|
||||
const { Option } = Select;
|
||||
import { PLATFORMS } from '@/views/writer-material-center/components/finished-products/manuscript/check-list/constants';
|
||||
import { AuditStatus } from '@/views/writer-material-center/components/finished-products/constants';
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<div class="highlight-textarea-container">
|
||||
<a-textarea
|
||||
<TextArea
|
||||
ref="textareaWrapRef"
|
||||
v-model="inputValue"
|
||||
v-model:value="inputValue"
|
||||
placeholder="请输入作品描述"
|
||||
:disabled="disabled"
|
||||
show-word-limit
|
||||
:max-length="1000"
|
||||
showCount
|
||||
:maxlength="1000"
|
||||
size="large"
|
||||
class="textarea-input h-full w-full"
|
||||
@input="handleInput"
|
||||
@ -24,6 +24,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Input } from 'ant-design-vue';
|
||||
const { TextArea } = Input;
|
||||
import { ref, computed, watch, defineProps, defineEmits, onMounted, onUnmounted } from 'vue';
|
||||
import { escapeRegExp } from './constants';
|
||||
|
||||
@ -112,8 +114,8 @@ const generateHighlightedHtml = (): string => {
|
||||
|
||||
onMounted(() => {
|
||||
nativeTextarea =
|
||||
(textareaWrapRef.value?.$el || textareaWrapRef.value)?.querySelector?.('textarea.arco-textarea') ||
|
||||
document.querySelector('.textarea-input .arco-textarea');
|
||||
(textareaWrapRef.value?.$el || textareaWrapRef.value)?.querySelector?.('textarea.ant-input') ||
|
||||
document.querySelector('.textarea-input .ant-input');
|
||||
|
||||
if (nativeTextarea) {
|
||||
nativeTextarea.addEventListener('scroll', handleTextareaScroll);
|
||||
@ -196,36 +198,31 @@ const handleCompositionUpdate = () => {
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.arco-textarea-wrapper) {
|
||||
:deep(.ant-input) {
|
||||
@include textarea-style;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
caret-color: #211f24 !important;
|
||||
resize: none;
|
||||
@include textarea-padding;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.arco-textarea {
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
background: transparent;
|
||||
color: transparent;
|
||||
caret-color: #211f24 !important;
|
||||
resize: none;
|
||||
@include textarea-padding;
|
||||
overflow-y: auto;
|
||||
}
|
||||
:deep(.ant-input-data-count) {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.arco-textarea-word-limit {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&.arco-textarea-disabled {
|
||||
.arco-textarea {
|
||||
background: #f2f3f5;
|
||||
}
|
||||
}
|
||||
&:deep(.ant-input:disabled) {
|
||||
background: #f2f3f5;
|
||||
}
|
||||
|
||||
// 处于中文输入法合成态时,显示真实文本并隐藏高亮层
|
||||
:deep(.textarea-input.composing .arco-textarea) {
|
||||
:deep(.textarea-input.composing .ant-input) {
|
||||
color: #211f24 !important;
|
||||
-webkit-text-fill-color: #211f24 !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user