指标区间添加两个单位输入框

master
yujialong 8 months ago
parent 96320065ac
commit aa26695fd2
  1. 78
      package.json
  2. 16
      public/index.html
  3. 99
      src/views/Transaction.vue
  4. 3
      vue.config.js

@ -1,41 +1,41 @@
{ {
"name": "python_admin", "name": "python_admin",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "npm run serve", "dev": "npm run serve",
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"ali-oss": "^6.18.1", "ali-oss": "^6.18.1",
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"element-ui": "^2.14.0", "element-ui": "^2.14.0",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mavon-editor": "^2.10.4", "mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "^5.1.1", "postcss-pxtorem": "^5.1.1",
"px2rem-loader": "^0.1.9", "px2rem-loader": "^0.1.9",
"quill": "^1.3.7", "quill": "^1.3.7",
"scss": "^0.2.4", "scss": "^0.2.4",
"vue": "^2.6.12", "vue": "^2.6.12",
"vue-router": "^3.4.8" "vue-router": "^3.4.8"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "^4.5.8", "@vue/cli-plugin-babel": "^4.5.8",
"@vue/cli-plugin-router": "^4.5.8", "@vue/cli-plugin-router": "^4.5.8",
"@vue/cli-plugin-vuex": "^4.5.8", "@vue/cli-plugin-vuex": "^4.5.8",
"@vue/cli-service": "^4.5.8", "@vue/cli-service": "^4.5.8",
"element-theme-chalk": "^2.14.0", "element-theme-chalk": "^2.14.0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"sass-loader": "^8.0.2", "sass-loader": "^8.0.2",
"vue-template-compiler": "^2.6.12", "vue-template-compiler": "^2.6.12",
"vuex": "^3.5.1" "vuex": "^3.5.1"
}, },
"browserslist": [ "browserslist": [
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
} }

@ -1,15 +1,19 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title> <title>判分点管理系统</title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

@ -94,7 +94,7 @@
<div class="business"> <div class="business">
<div class="label">{{isSt ? '关卡' : '业务'}}</div> <div class="label">{{isSt ? '关卡' : '业务'}}</div>
<el-select v-model="formData.lcJudgmentPoint.business" <el-select v-model="formData.lcJudgmentPoint.business"
placeholder="请选择业务"> :placeholder="'请选择' + (isSt ? '关卡' : '业务')">
<el-option v-for="(item, i) in businessList" <el-option v-for="(item, i) in businessList"
:key="i" :key="i"
:label="item.name" :label="item.name"
@ -298,36 +298,22 @@
</template> </template>
<template v-if="scope.row.type == 5"> <template v-if="scope.row.type == 5">
<div class="box"> <div class="box"
style="padding: 0;">
<div class="line"> <div class="line">
<!--
<span class="label">选择指标</span>
<div class="action">
<el-select
v-model="scope.row.value1"
:disabled="isView || scope.row.isDisabled"
size="mini"
>
<el-option
v-for="(item, index) in scope.row.items"
:key="index"
:label="item.options"
:value="item.itemId"
></el-option>
</el-select>
</div>
-->
<div>{{ scope.row.name }}</div> <div>{{ scope.row.name }}</div>
</div> </div>
<div class="line"> <div class="line"
<span class="label">交易指标区间</span> style="flex-direction: column;">
<p class="label">交易指标区间</p>
<div class="action"> <div class="action">
<div class="inputs"> <div class="inputs range">
<el-select v-model="scope.row.value2" <el-select v-model="scope.row.value2"
:disabled="isView || scope.row.isDisabled" :disabled="isView || scope.row.isDisabled"
size="mini" size="mini"
clearable> clearable
placeholder="符号">
<el-option v-for="(item, i) in leftSymbols" <el-option v-for="(item, i) in leftSymbols"
:key="i" :key="i"
:value="item.name"></el-option> :value="item.name"></el-option>
@ -335,15 +321,29 @@
<el-input class="number-input" <el-input class="number-input"
v-model.trim="scope.row.value3" v-model.trim="scope.row.value3"
:disabled="isView || scope.row.isDisabled" :disabled="isView || scope.row.isDisabled"
size="mini"></el-input> size="mini"
placeholder="数值" />
<el-input class="number-input" <el-input class="number-input"
v-model.trim="scope.row.value4" v-model.trim="scope.row.value4"
:disabled="isView || scope.row.isDisabled" :disabled="isView || scope.row.isDisabled"
size="mini"></el-input> size="mini"
placeholder="单位" />
<span>~</span>
<el-input class="number-input"
v-model.trim="scope.row.value5"
:disabled="isView || scope.row.isDisabled"
size="mini"
placeholder="数值" />
<el-input class="number-input"
v-model.trim="scope.row.value6"
:disabled="isView || scope.row.isDisabled"
size="mini"
placeholder="单位" />
<el-select :disabled="isView || scope.row.isDisabled" <el-select :disabled="isView || scope.row.isDisabled"
v-model="scope.row.value5" v-model="scope.row.value7"
size="mini" size="mini"
clearable> clearable
placeholder="符号">
<el-option v-for="(item, i) in rightSymbols" <el-option v-for="(item, i) in rightSymbols"
:key="i" :key="i"
:value="item.name"></el-option> :value="item.name"></el-option>
@ -769,13 +769,17 @@ export default {
const temp = item.emptyTwo.split('~') const temp = item.emptyTwo.split('~')
if (temp.length) { if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g) const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/[^<>=]+/g) const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : '' const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[^<>=]+/g) : '' const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
obj.value2 = symbol ? symbol[0] : '' obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : '' obj.value3 = num ? num[0] : ''
obj.value4 = num1 ? num1[0] : '' obj.value4 = unit ? unit[0] : ''
obj.value5 = symbol1 ? symbol1[0] : '' obj.value5 = num1 ? num1[0] : ''
obj.value6 = unit1 ? unit1[0] : ''
obj.value7 = symbol1 ? symbol1[0] : ''
} }
} }
tempArr.push(obj); tempArr.push(obj);
@ -833,13 +837,17 @@ export default {
const temp = item.emptyTwo.split('~') const temp = item.emptyTwo.split('~')
if (temp.length) { if (temp.length) {
const symbol = temp[0].match(/[<>=]+/g) const symbol = temp[0].match(/[<>=]+/g)
const num = temp[0].match(/[^<>=]+/g) const num = temp[0].match(/\d+/g)
const unit = temp[0].match(/[^<>=\d]+/g)
const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : '' const symbol1 = temp.length > 1 ? temp[1].match(/[<>=]+/g) : ''
const num1 = temp.length > 1 ? temp[1].match(/[^<>=]+/g) : '' const num1 = temp.length > 1 ? temp[1].match(/\d+/g) : ''
const unit1 = temp.length > 1 ? temp[1].match(/[^<>=\d]+/g) : ''
obj.value2 = symbol ? symbol[0] : '' obj.value2 = symbol ? symbol[0] : ''
obj.value3 = num ? num[0] : '' obj.value3 = num ? num[0] : ''
obj.value4 = num1 ? num1[0] : '' obj.value4 = unit ? unit[0] : ''
obj.value5 = symbol1 ? symbol1[0] : '' obj.value5 = num1 ? num1[0] : ''
obj.value6 = unit1 ? unit1[0] : ''
obj.value7 = symbol1 ? symbol1[0] : ''
} }
} else if (item.type == 6) { } else if (item.type == 6) {
obj.subjectId = Number(item.emptyOne); obj.subjectId = Number(item.emptyOne);
@ -983,7 +991,7 @@ export default {
return; return;
} }
if (!point.business) { if (!point.business) {
this.$message.warning(`请选择业务`); this.$message.warning(`请选择${this.isSt ? '关卡' : '业务'}`);
return; return;
} }
if (!point.experimentalRequirements) { if (!point.experimentalRequirements) {
@ -1037,7 +1045,7 @@ export default {
} else if (i.type == 5) { } else if (i.type == 5) {
// obj.emptyOne = i.value1; // // obj.emptyOne = i.value1; //
obj.emptyOne = i.subjectId ? i.subjectId.toString() : ""; obj.emptyOne = i.subjectId ? i.subjectId.toString() : "";
obj.emptyTwo = `${i.value2 || ''}${i.value3}${i.value4 ? '~' + i.value4 : ''}${i.value5 || ''}`; obj.emptyTwo = `${i.value2 || ''}${i.value3}${i.value4}${i.value5 ? '~' + i.value5 : ''}${i.value6}${i.value7 || ''}`;
} else if (i.type == 6) { } else if (i.type == 6) {
const money = [] const money = []
const { moneys } = this const { moneys } = this
@ -1116,7 +1124,9 @@ export default {
value2: "", value2: "",
value3: "", value3: "",
value4: "", value4: "",
value5: "" value5: "",
value6: "",
value7: "",
}); });
} else { } else {
this.tableData.push({ this.tableData.push({
@ -1132,7 +1142,9 @@ export default {
value2: "", value2: "",
value3: "", value3: "",
value4: "", value4: "",
value5: "" value5: "",
value6: "",
value7: "",
}); });
} }
} else { } else {
@ -1199,10 +1211,10 @@ export default {
if ((!row.value2 || !row.value5) && !this.isSt) { if ((!row.value2 || !row.value5) && !this.isSt) {
this.$message.warning(`请选择交易指标区间`); this.$message.warning(`请选择交易指标区间`);
return; return;
} else if ((!row.value3 || !row.value4) && !this.isSt) { } else if ((!row.value3 || !row.value5) && !this.isSt) {
this.$message.warning(`请输入交易指标区间`); this.$message.warning(`请输入交易指标区间`);
return; return;
} else if (row.value3 && row.value4 && !isNaN(row.value3) && !isNaN(row.value4) && +row.value3 > +row.value4) { } else if (row.value3 && row.value5 && !isNaN(row.value3) && !isNaN(row.value5) && +row.value3 > +row.value5) {
this.$message.warning(`第一个指标必须小于第二个指标`); this.$message.warning(`第一个指标必须小于第二个指标`);
return; return;
} }
@ -1547,6 +1559,11 @@ export default {
margin-left: 0; margin-left: 0;
} }
} }
&.range {
/deep/ .el-input {
width: 80px;
}
}
} }
&.a-line { &.a-line {

@ -26,5 +26,6 @@ module.exports = {
lintOnSave: true, lintOnSave: true,
devServer: { devServer: {
port: 8087 port: 8087
} },
productionSourceMap: false,
} }
Loading…
Cancel
Save