| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <div class="sync-modal">
- <a-modal v-model:visible="Visible" width="450px" :title="Title" centered destroyOnClose @ok="handleOk"
- @cancel="handleCancel">
- <p>{{ tooltipText }}</p>
- <a-form :model="formState" name="basic" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" autocomplete="off">
- <a-form-item label="输入密码" name="passWord" :rules="[{ required: true, message: '请输入密码!' }]">
- <a-input-password style="width:220px" v-model:value="formState.passWord" />
- </a-form-item>
- </a-form>
- </a-modal>
- </div>
- </template>
- <script setup lang="ts">
- import { ref, reactive, watchEffect } from 'vue'
- let props = defineProps({
- visible: {
- type: Boolean,
- default: false
- },
- Title: {
- type: String,
- default: '操作确认'
- },
- tooltipText:{
- type:String,
- default:''
- }
- })
- let Visible = ref(false)
- let formState = reactive({
- passWord: ''
- })
- let $emit = defineEmits(['handleOk','handleCancel'])
- //确定
- function handleOk() {
- $emit('handleOk', { pass: formState.passWord, visib: false })
- }
- //取消
- function handleCancel(){
- formState.passWord=''
- $emit('handleCancel',false)
- }
- watchEffect(() => {
- Visible.value = props.visible
- })
- </script>
- <style lang="less" scoped>
- p {
- margin: 20px 40px;
- }
- </style>
|