<template>
	<div  style="width: 100%;">
		<a-space direction="vertical" style="width: 100%;">
			<a-textarea v-model:value="text" />
			<a-flex justify="flex-end">
				<a-space>
					<a-button type="primary" @click="saveTxt">保存</a-button>
				</a-space>
			</a-flex>
		</a-space>
	</div>
</template>

<script lang="ts" setup>
	import { ref, onMounted, watch, computed } from 'vue';
	import { GetTokenizerGet, PostTokenizerModify } from '@/apis/models';
	import { useCommon } from '@/hooks/useCommon';
	let { store, commomParams, showModal, showOtherModal1, message } = useCommon();
	let text = ref<String>('')

	onMounted(() => {
		getData();
	})

	const getData = async () => {
		try {
			let res = await GetTokenizerGet();
			text.value = res.data.text;
		} catch {
		}
	}

	const saveTxt = () => {
		PostTokenizerModify({ text: text.value }).then(res => {
			message.success('分词器更新成功');
		})
	}
</script>

<style lang="less" scoped>

</style>