4c9d459e by renchao@pashanhoo.com

style:下拉表格组件得修改

1 parent dff289db
......@@ -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 14:49:53
-->
<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: 关键值查询表格数据行
......
/*
* @Description:
* @Autor: renchao
* @LastEditTime: 2023-07-05 09:48:23
* @LastEditTime: 2023-07-27 14:44:38
*/
//表格选择器配置
export default {
pageSize: 10, //表格每一页条数
parseData: function (res) {
return {
data: res.data
}
},
request: {
page: 'page', //规定当前分页字段
pageSize: 'pageSize', //规定一页条数字段
},
props: {
label: 'label', //映射label显示字段
value: 'value', //映射value值字段
......
......@@ -240,14 +240,13 @@
</el-col>
<el-col :span="8">
<el-form-item label="竣工时间:">
<el-date-picker
<el-date-picker
v-model="ruleForm.fdcq2.jgsj"
class="width100"
class="width100"
type="date"
placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd"
>
format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-col>
......@@ -500,6 +499,7 @@
init(this.propsParam).then((res) => {
if (res.code == 200) {
this.ruleForm = res.result;
console.log(this.ruleForm, 'this.ruleForm');
let djlx = this.ruleForm.qlxx.djlx;
if (djlx == null || djlx == 100) {
this.ssqlxxshow = false;
......
......@@ -9,8 +9,8 @@
<el-form
:model="ruleForm"
:rules="rules"
:class="{readonly: editDisabled }"
class="loadingtext"
:class="{readonly: editDisabled }"
class="loadingtext"
ref="ruleForm"
:label-position="flag ? 'top' : ''"
:inline="flag"
......