Commit 0129b9ca by hulei

fix bugs [附言]

parent a365dbf3
<template> <template>
<div> <div>
<c-input <c-input
type="textarea" v-bind="$attrs"
v-model="text" v-model="value"
maxlength="60" @change="onChange"
:autosize="{ minRows: 4, maxRows: 6 }"
show-word-limit
placeholder="请输入Infotext"
@change="syncStream"
></c-input> ></c-input>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props:['stream'], props:['model'],
created:function(){ created:function(){
this.stream["rows"] = this.stream["rows"]||[]; this.model["rows"] = this.model["rows"]||[];
this.text=this.stream["rows"].join(); this.value=this.model["rows"].join("\n");
}, },
data:function(){ data:function(){
return { return {
text:"" value:""
} }
}, },
computed:{
},
methods:{ methods:{
syncStream(){
this.stream["rows"]=this.text.split("\r\n");
console.log(this.stream["rows"]);
this.$emit("change",this.text);
},
onChange(){ onChange(){
this.$emit("change",this.text); this.model["rows"]=this.value.split("\n");
console.log(this.model["rows"]);
this.$emit("change",this.value);
} }
} }
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
label="General" label="General"
prop="mtabut.coninf.oitinf.oit.inftxt" prop="mtabut.coninf.oitinf.oit.inftxt"
> >
<c-input <i-stream-input
type="textarea" type="textarea"
:rows="6" rows="6"
@change="valueChange($event, 'mtabut.coninf.oitinf.oit.inflev')"
v-model="model.mtabut.coninf.oitinf.oit.inftxt"
maxlength="60" maxlength="60"
resize="none" resize="none"
show-word-limit show-word-limit
placeholder="请输入Infotext" placeholder="请输入Infotext"
></c-input> @change="valueChange($event, 'mtabut.coninf.oitinf.oit.inflev')"
:model="model.mtabut.coninf.oitinf.oit.inftxt"
></i-stream-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="7" :offset="1"> <c-col :span="7" :offset="1">
...@@ -37,16 +37,16 @@ ...@@ -37,16 +37,16 @@
<c-col :span="24"> <c-col :span="24">
<c-col :span="15"> <c-col :span="15">
<el-form-item label="Settlement" prop="mtabut.coninf.oitset.oit.inftxt"> <el-form-item label="Settlement" prop="mtabut.coninf.oitset.oit.inftxt">
<c-input <i-stream-input
type="textarea" type="textarea"
:rows="6" rows="6"
@change="valueChange($event, 'mtabut.coninf.oitset.oit.inflev')"
v-model="model.mtabut.coninf.oitset.oit.inftxt"
maxlength="60" maxlength="60"
resize="none" resize="none"
show-word-limit show-word-limit
placeholder="请输入Infotext" placeholder="请输入Infotext"
></c-input> @change="valueChange($event, 'mtabut.coninf.oitset.oit.inflev')"
:model="model.mtabut.coninf.oitset.oit.inftxt"
></i-stream-input>
</el-form-item> </el-form-item>
</c-col> </c-col>
<c-col :span="7" :offset="1"> <c-col :span="7" :offset="1">
...@@ -90,7 +90,9 @@ ...@@ -90,7 +90,9 @@
// 附言页签,勿改 // 附言页签,勿改
import _ from "~/utils/Lodash.js"; import _ from "~/utils/Lodash.js";
import CommonProcess from "~/mixin/CommonProcess"; import CommonProcess from "~/mixin/CommonProcess";
import IStreamInput from '~/components/IStreamInput'
export default { export default {
components: {IStreamInput},
inject: ["root"], inject: ["root"],
props: ["model", "codes"], props: ["model", "codes"],
mixins: [CommonProcess], mixins: [CommonProcess],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment