29c9e685 by renchao@pashanhoo.com

style:table

1 parent 3d72b588
......@@ -4,7 +4,7 @@
* @Author: sakuya
* @Date: 2021年6月10日10:04:07
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-07-05 10:39:17
* @LastEditTime: 2023-07-27 17:21:52
-->
<template>
......@@ -32,7 +32,7 @@
import config from "./tableSelect";
export default {
props: {
modelValue: null,
value: null,
apiObj: { type: Object, default: () => { } },
placeholder: { type: String, default: "请选择" },
size: { type: String, default: "small" },
......@@ -63,9 +63,10 @@
computed: {
},
watch: {
modelValue: {
value: {
handler () {
this.defaultValue = this.modelValue
this.defaultValue = this.value
console.log(this.value, 'this.value');
this.autoCurrentLabel()
},
deep: true
......@@ -73,7 +74,7 @@
},
mounted () {
this.defaultProps = Object.assign(this.defaultProps, this.props);
this.defaultValue = this.modelValue
this.defaultValue = this.value
this.autoCurrentLabel()
},
methods: {
......@@ -149,7 +150,7 @@
this.defaultValue.splice(this.defaultValue.findIndex(item => item[this.defaultProps.value] == row[this.defaultProps.value]), 1)
}
this.autoCurrentLabel()
this.$emit('update:modelValue', this.defaultValue);
this.$emit('update:value', this.defaultValue);
this.$emit('change', this.defaultValue);
},
/**
......@@ -175,7 +176,7 @@
})
}
this.autoCurrentLabel()
this.$emit('update:modelValue', this.defaultValue);
this.$emit('update:value', this.defaultValue);
this.$emit('change', this.defaultValue);
},
/**
......@@ -191,7 +192,7 @@
this.$refs.select.blur()
this.autoCurrentLabel()
this.$refs.table.setCurrentRow(row);
this.$emit('update:modelValue', this.defaultValue);
this.$emit('update:value', this.defaultValue);
this.$emit('change', this.defaultValue);
}
},
......@@ -203,14 +204,14 @@
removeTag (tag) {
var row = this.findRowByKey(tag[this.defaultProps.value])
this.$refs.table.toggleRowSelection(row, false);
this.$emit('update:modelValue', this.defaultValue);
this.$emit('update:value', this.defaultValue);
},
/**
* @description: 清空后的回调
* @author: renchao
*/
clear () {
this.$emit('update:modelValue', this.defaultValue);
this.$emit('update:value', this.defaultValue);
},
/**
* @description: 关键值查询表格数据行
......