pengjun 2 years ago
parent
commit
14153addac
  1. 11
      src/utlis/validate.js
  2. 52
      src/views/basic-dictionary/ResultStatus.vue

11
src/utlis/validate.js

@ -33,7 +33,7 @@ export const yzstr = (value) => {
if (!reg.test(s1)) { if (!reg.test(s1)) {
isyz = false; isyz = false;
} else { } else {
isyz = true;
isyz = true;
} }
} else { } else {
//失败 //失败
@ -46,4 +46,11 @@ export const yzstr = (value) => {
//正则校验密码 //正则校验密码
const regex = /^.{6,15}$/; const regex = /^.{6,15}$/;
export const isValid = regex.test(); export const isValid = regex.test();
console.log(isValid);
console.log(isValid);
//颜色转换
// export const Contrcolro = function (v) {
// // 去除开头的#号
// hexColor = hexColor.substring(v);
// // 转换为十进制
// this.form.reportBackgroundColor = parseInt(hexColor, 16);
// }

52
src/views/basic-dictionary/ResultStatus.vue

@ -105,12 +105,14 @@
prop="reportBackgroundColor" prop="reportBackgroundColor"
> >
<el-color-picker <el-color-picker
v-model="form.reportBackgroundColor"
@change="reportBackgroundColorchange"
v-model="form.reportBackgroundColor16"
></el-color-picker> ></el-color-picker>
<!-- <el-input></el-input> --> <!-- <el-input></el-input> -->
<!-- <input type="text" v-model="form.reportBackgroundColor"> --> <!-- <input type="text" v-model="form.reportBackgroundColor"> -->
<el-input <el-input
v-model="form.reportBackgroundColor" v-model="form.reportBackgroundColor"
@change="reportBackgroundColorchange1"
style=" style="
width: 85%; width: 85%;
position: absolute; position: absolute;
@ -128,10 +130,14 @@
> >
<!-- <el-input v-model="form.reportFontColor"></el-input> --> <!-- <el-input v-model="form.reportFontColor"></el-input> -->
<el-color-picker <el-color-picker
v-model="form.reportFontColor"
v-model="form.reportFontColor16"
@change="reportFontColorchange"
></el-color-picker> ></el-color-picker>
<el-input <el-input
v-model="form.reportFontColor" v-model="form.reportFontColor"
@change="reportFontColor1"
maxlength="15"
minlength="6"
style=" style="
width: 85%; width: 85%;
position: absolute; position: absolute;
@ -144,12 +150,11 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="数据录入背景" label-width="100px"> <el-form-item label="数据录入背景" label-width="100px">
<el-color-picker <el-color-picker
v-model="form.dataInputBackgroundColor"
v-model="form.dataInputBackgroundColor16"
@change="dataInputBackgroundColorchange"
></el-color-picker> ></el-color-picker>
<el-input <el-input
v-model="form.dataInputBackgroundColor" v-model="form.dataInputBackgroundColor"
maxlength="12"
minlength="6"
style=" style="
width: 85%; width: 85%;
position: absolute; position: absolute;
@ -167,10 +172,12 @@
prop="dataInputFontColor" prop="dataInputFontColor"
> >
<el-color-picker <el-color-picker
v-model="form.dataInputFontColor"
v-model="form.dataInputFontColor16"
@change="dataInputFontColorchange"
></el-color-picker> ></el-color-picker>
<el-input <el-input
v-model="form.dataInputFontColor" v-model="form.dataInputFontColor"
@change="dataInputFontColor1"
style=" style="
width: 85%; width: 85%;
margin-left: 10px; margin-left: 10px;
@ -215,9 +222,13 @@ export default {
dataInputPrompt: "", dataInputPrompt: "",
reportPrompt: "", reportPrompt: "",
reportBackgroundColor: "", reportBackgroundColor: "",
reportBackgroundColor16: "",
reportFontColor: "", reportFontColor: "",
reportFontColor16: "",
dataInputBackgroundColor: "", dataInputBackgroundColor: "",
dataInputBackgroundColor16: "",
dataInputFontColor: "", dataInputFontColor: "",
dataInputFontColor16: "",
}, },
dialogVisible: false, dialogVisible: false,
title: 1, title: 1,
@ -285,7 +296,7 @@ export default {
hexColor = hexColor.substring(1); hexColor = hexColor.substring(1);
this.form.dataInputBackgroundColor = parseInt(hexColor, 16); this.form.dataInputBackgroundColor = parseInt(hexColor, 16);
}, },
//
//
reportFontColorchange(v) { reportFontColorchange(v) {
var hexColor = v; var hexColor = v;
hexColor = hexColor.substring(1); hexColor = hexColor.substring(1);
@ -300,10 +311,33 @@ export default {
this.form.reportBackgroundColor = parseInt(hexColor, 16); this.form.reportBackgroundColor = parseInt(hexColor, 16);
console.log(this.form.reportBackgroundColor); console.log(this.form.reportBackgroundColor);
}, },
dataInputFontColor1(v) {
this.form.dataInputFontColor16 = "#" + v;
},
//
reportFontColor1(v) {
this.form.reportFontColor16 = "#" + v;
},
//
reportBackgroundColorchange1(v) {
//
this.form.reportBackgroundColor16 = "#" + v;
},
rowclick(row) { rowclick(row) {
this.form = row; this.form = row;
console.log(row);
// this.form.reportBackgroundColor16 = "#"+row.reportBackgroundColor;
// this.form.reportFontColor16 = "#"+row.reportFontColor;
// this.form.dataInputBackgroundColor16 = "#"+row.dataInputBackgroundColor;
// this.form.dataInputFontColor16 = "#"+row.dataInputFontColor;
this.form.reportBackgroundColor16 = "#" + row.reportBackgroundColor;
this.form.reportFontColor16 = "#" + row.reportFontColor;
this.form.dataInputBackgroundColor16 = "#" + row.dataInputBackgroundColor;
this.form.dataInputFontColor16 = "#" + row.dataInputFontColor;
console.log(this.form);
}, },
haxadecimal() { haxadecimal() {
let str = this.form.dataInputFontColor; let str = this.form.dataInputFontColor;
this.form.dataInputFontColor = str this.form.dataInputFontColor = str
@ -384,6 +418,8 @@ export default {
if (this.form.id == undefined) { if (this.form.id == undefined) {
this.$message.warning("请选择操作的数据"); this.$message.warning("请选择操作的数据");
} else { } else {
console.log("22222222222222");
this.dialogVisible = true; this.dialogVisible = true;
this.title = 2; this.title = 2;
} }

Loading…
Cancel
Save