123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <div>
- <el-dialog :class="type==='Delete'? 'response-tip-dialog' :'response-small-dialog'"
- :close-on-click-modal="false"
- :show="show"
- :title="title"
- :visible.sync="visible"
- center>
- <div v-if="type==='Edit'">
- <el-input :autosize="{ minRows: 6, maxRows: 10}" type="textarea" v-model="data.content"></el-input>
- </div>
- <div v-else-if="type==='Delete'">
- 是否删除此条笔记?
- </div>
- <div v-else-if="type==='Add'">
- <el-input
- :autosize="{ minRows: 6, maxRows: 10}"
- placeholder="请输入内容"
- type="textarea"
- v-model="addDialogConent">
- </el-input>
- </div>
- <span class="dialog-footer" slot="footer">
- <el-button @click="closeFun">取 消</el-button>
- <el-button :disabled="isDisable" @click="confirmFun" type="primary">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- export default {
- name: 'biji',
- props: {
- title: {
- type: String,
- default: '提示',
- },
- data: {
- type: Object,
- },
- type: {
- type: String,
- required: true,
- },
- show: {
- type: Boolean,
- default: false
- }
- },
- data() {
- return {
- visible: this.show,
- addDialogConent: '',
- isDisable: false,
- timer: null,
- };
- },
- watch: {
- show () {
- this.visible = this.show;
- }
- },
- methods: {
- closeFun(){
- console.log('show'+this.type);
- this.$emit('update:show', false)
- },
- confirmFun(){
- let opt = {
- conent:this.addDialogConent
- }
- this.isDisable = true
- this.timer = setTimeout(() => {
- this.isDisable = false
- }, 1000);
- this.$emit('confirmBtn'+this.type, this.data|| opt)
- },
- clearTime(){
- clearTimeout(this.timer)
- },
- },
- created() {
- },
- };
- </script>
- <style lang="scss">
- </style>
|