Commit a3346ca4 by 米嘉伟

Merge branch 'dev_zwpt' of http://47.92.108.28/changchao/founder_vue into dev_zwpt

parents f45a259a 93ab7356
<!--
* @Author: your name
* @Date: 2021-12-27 11:19:03
* @LastEditTime: 2021-12-27 21:15:20
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \founder_vue\src\views\SystemManage\editableLable.vue
-->
<template>
<div class="editableLable">
<label v-if="!canEdit" @click="enableEdit">{{
preText.toString() + curTxt.toString()
}}</label>
<div v-else>
<span class="preText">{{ preText }}</span>
<el-input
v-model="curTxt"
@change="textChange"
@blur="canEdit = false"
></el-input>
</div>
</div>
</template>
<script>
export default {
props: {
id: {
type: String,
require: false,
default: "",
},
type: {
type: Number,
require: false,
default: 0,
},
// 当前文本
text: {
type: String,
require: false,
default: "",
},
// 固定前缀
preText: {
type: String,
require: false,
default: "",
},
},
data() {
return {
canEdit: false,
curTxt: "",
};
},
watch: {
text: function(text) {
this.curTxt = text;
},
},
methods: {
textChange(txt) {
this.curTxt = txt;
this.canEdit = false;
this.$emit("change", this.id, this.type, txt);
},
enableEdit() {
this.canEdit = true;
},
},
mounted() {
this.curTxt = this.text;
},
};
</script>
<style lang="scss" scoped>
.editableLable {
width: 100%;
height: 100%;
& > label {
display: block;
}
}
.preText {
display: inline-block;
left: 1rem;
position: absolute;
z-index: 1;
font-size: 14px;
font-family: MicrosoftYaHei;
color: #333333;
line-height: 24px;
}
/deep/ .el-input__inner {
padding-left: 1.5rem;
width: 72px;
height: 24px;
}
</style>
<!--
* @Author: your name
* @Date: 2021-12-27 15:29:03
* @LastEditTime: 2021-12-27 17:50:56
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \founder_vue\src\views\SystemManage\numberInput.vue
-->
<template>
<div class="numberinput">
<span class="preText">{{ preText }}</span>
<el-input-number
v-model="curTxt"
@change="textChange"
size="mini"
:min="0"
controls-position="right"
></el-input-number>
</div>
</template>
<script>
export default {
props: {
// 当前文本
text: {
type: Number,
require: false,
default: 0,
},
// 固定前缀
preText: {
type: String,
require: false,
default: "",
},
},
watch: {
text: function(text) {
this.curTxt = text;
},
},
data() {
return {
curTxt: "",
};
},
methods: {
textChange(val) {
this.curTxt = val;
if (val && !Number(val)) {
this.curTxt = val.replace(/[^0-9]/gi, "");
}
this.$emit("change", this.curTxt);
},
},
mounted() {
this.curTxt = this.text;
},
};
</script>
<style lang="scss" scoped>
.numberinput {
display: inline-block;
}
.preText {
display: inline-block;
// left: 1rem;
margin-left: 10px;
position: absolute;
z-index: 1;
font-size: 18px;
font-family: MicrosoftYaHei;
color: #333333;
line-height: 24px;
}
/deep/ .el-input__inner {
padding-left: 1.5rem;
}
</style>
/*
* @Author: your name
* @Date: 2021-09-07 09:57:48
* @LastEditTime: 2021-12-27 21:08:23
* @LastEditTime: 2021-12-27 21:21:08
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: \指纹系统\founder_vue\vue.config.js
......
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