更新提交

master
yujialong 3 years ago
parent 8790213d02
commit 94926dba89
  1. 4
      src/utils/http.js
  2. 3
      src/views/Home.vue
  3. 66
      src/views/Program.vue
  4. 94
      src/views/Transaction.vue
  5. 2
      vue.config.js

@ -197,9 +197,7 @@ export function post(url, params) {
break; break;
case 500: case 500:
resolve(res.data); resolve(res.data);
this.$message.error( // this.$message.error(res.data.errmessage || res.data.message);
res.data.errmessage || res.data.message
);
break; break;
case 404: case 404:
this.$message.error( this.$message.error(

@ -100,6 +100,7 @@ export default {
keyword: function (val) { keyword: function (val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
this.pageNum = 1;
this.initData() this.initData()
}, 500) }, 500)
}, },
@ -136,7 +137,7 @@ export default {
this.getProcessClassData(params); this.getProcessClassData(params);
} else { } else {
// //
this.getProgrammingClassData(params) this.getProgrammingClassData(params);
} }
}, },
getProcessClassData(params) { // getProcessClassData(params) { //

@ -24,6 +24,7 @@
<div class="label">判分点名称</div> <div class="label">判分点名称</div>
<el-input <el-input
v-model.trim="formData.points.name" v-model.trim="formData.points.name"
:readonly="isView"
@blur="handleBlur" @blur="handleBlur"
placeholder="请输入内容" placeholder="请输入内容"
clearable clearable
@ -32,7 +33,7 @@
</div> </div>
<div class="item"> <div class="item">
<div class="label">实验要求</div> <div class="label">实验要求</div>
<quill :border="true" v-model="formData.points.experimentalRequirements" :minHeight="150" :height="150"/> <quill v-model="formData.points.experimentalRequirements" :readonly="isView" :border="true" :minHeight="150" :height="150" style="width: 100%"/>
</div> </div>
</div> </div>
@ -44,7 +45,7 @@
</div> </div>
<p style=" text-align: center;">参考答案</p> <p style=" text-align: center;">参考答案</p>
<div> <div>
<quill :border="true" v-model="formData.points.experimentCode" :minHeight="300" :height="300"/> <quill v-model="formData.points.experimentCode" :readonly="isView" :border="true" :minHeight="300" :height="300"/>
</div> </div>
</div> </div>
@ -105,9 +106,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300" v-if="!isView"> <el-table-column label="操作" width="300" v-if="!isView">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="!scope.row.isSave" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> <el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleSave(scope.row)">保存</el-button> <el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row)">保存</el-button>
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleCancel(scope.$index)">取消</el-button> <el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.$index)">删除</el-button> <el-button size="mini" type="text" @click="handleDelete(scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -125,9 +126,10 @@ export default {
components: {quill}, components: {quill},
data() { data() {
return { return {
isAdd: false, // bcId: "", // id
isEdit: false, // isAdd: Boolean(this.$route.query.isAdd), //
isView: false, // isEdit: Boolean(this.$route.query.isEdit), //
isView: Boolean(this.$route.query.isView), //
isNameRepeat: false, // isNameRepeat: false, //
formData: { formData: {
points: { points: {
@ -143,21 +145,20 @@ export default {
}, // }, //
tableData: [], // tableData: [], //
tableDataCopy: [], // tableDataCopy: [], //
isAddRule: false, // isAddRule: false, //
}; };
}, },
mounted() { mounted() {
console.log('当前地址=', location.host);
console.log("token=", this.$route.query.token)
console.log("systemId=", this.$route.query.systemId)
this.$route.query.token && this.$store.commit('setParam', { this.$route.query.token && this.$store.commit('setParam', {
token: atob(decodeURI(this.$route.query.token)) token: atob(decodeURI(this.$route.query.token)),
referrer: atob(decodeURI(this.$route.query.referrer))
}); });
if (this.$route.query.isView) {
this.isView = true;
} else if (this.$route.query.isEdit) {
this.isEdit = true;
} else if (this.$route.query.isAdd) {
this.isAdd = true;
}
if (this.$route.query.bcId) { if (this.$route.query.bcId) {
this.bcId = this.$route.query.bcId;
this.getInfoData(this.$route.query.bcId); this.getInfoData(this.$route.query.bcId);
} }
if (this.$route.query.systemId) { if (this.$route.query.systemId) {
@ -178,7 +179,12 @@ export default {
} }
// //
judgmentRule.forEach((item, index) => { judgmentRule.forEach((item, index) => {
this.tableData.push({ ...item, isSubject: true, isDisabled: true, isSave: false}); this.tableData.push({
...item,
isSubject: true,
isDisabled: true,
isSave: true
});
}) })
} else { } else {
this.$message.warning(res.message); this.$message.warning(res.message);
@ -190,7 +196,7 @@ export default {
handleBlur() { // / handleBlur() { // /
if (this.formData.points.name) { if (this.formData.points.name) {
let params = { let params = {
lcId: this.$route.query.lcId ? this.$route.query.lcId : "", bcId: this.bcId,
name: this.formData.points.name name: this.formData.points.name
} }
this.$post(this.api.bcQueryNameIsExist, params).then(res => { this.$post(this.api.bcQueryNameIsExist, params).then(res => {
@ -232,7 +238,7 @@ export default {
} else if (!this.tableData[i].result) { } else if (!this.tableData[i].result) {
this.$message.warning(`${i + 1}项,规则结果不能为空`); this.$message.warning(`${i + 1}项,规则结果不能为空`);
return; return;
} else if (this.tableData[i].isSave) { } else if (!this.tableData[i].isSave) {
this.$message.warning(`${i + 1}项,未保存`); this.$message.warning(`${i + 1}项,未保存`);
return; return;
} }
@ -242,7 +248,7 @@ export default {
this.tableData.forEach(i => { this.tableData.forEach(i => {
let obj = { let obj = {
id: i.id ? i.id : "", id: i.id ? i.id : "",
bcId: i.bcId ? i.bcId : "", bcId: i.bcId,
required: i.required, required: i.required,
result: i.result, result: i.result,
withOr: i.withOr withOr: i.withOr
@ -277,8 +283,9 @@ export default {
addRule() { // addRule() { //
this.isAddRule = true; this.isAddRule = true;
this.tableData.push({ this.tableData.push({
isDisabled: true, isDisabled: false, //
isSave: false, isSave: false, //
bcId: this.bcId,
required: "", required: "",
result: "", result: "",
withOr: 0 withOr: 0
@ -290,7 +297,6 @@ export default {
handleEdit(row) { // handleEdit(row) { //
this.tableDataCopy = deepCopy(this.tableData); // this.tableDataCopy = deepCopy(this.tableData); //
row.isDisabled = false; row.isDisabled = false;
row.isSave = true;
}, },
handleSave(row) { // handleSave(row) { //
if (!row.required) { if (!row.required) {
@ -301,12 +307,17 @@ export default {
this.$message.warning(`规则结果不能为空`); this.$message.warning(`规则结果不能为空`);
return; return;
} }
row.isSave = false; row.isSave = true;
row.isDisabled = true; row.isDisabled = true;
this.isAddRule = false; this.isAddRule = false;
}, },
handleCancel(index) { // handleCancel(row, index) { //
this.$set(this.tableData, index, this.tableDataCopy[index]); if (row.isSave) {
this.$set(this.tableData, index, this.tableDataCopy[index]);
} else {
this.tableData.splice(index, 1);
this.isAddRule = false;
}
}, },
handleDelete(index) { // handleDelete(index) { //
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", { this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
@ -449,6 +460,7 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 10px;
cursor:not-allowed; cursor:not-allowed;
z-index: 99999; z-index: 99999;
} }

@ -23,6 +23,7 @@
<div class="label">判分点名称</div> <div class="label">判分点名称</div>
<el-input <el-input
v-model.trim="formData.lcJudgmentPoint.name" v-model.trim="formData.lcJudgmentPoint.name"
:readonly="isView"
@blur="handleBlur" @blur="handleBlur"
placeholder="请输入内容" placeholder="请输入内容"
clearable clearable
@ -31,8 +32,14 @@
</div> </div>
<div class="item"> <div class="item">
<div class="label">实验要求</div> <div class="label">实验要求</div>
<quill :border="true" v-model="formData.lcJudgmentPoint.experimentalRequirements" :minHeight="150" <quill
:height="150"/> v-model="formData.lcJudgmentPoint.experimentalRequirements"
:readonly="isView"
:border="true"
:minHeight="150"
:height="150"
style="width: 100%"
/>
</div> </div>
</div> </div>
@ -102,7 +109,7 @@
<!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) --> <!-- type: 题目类型(1选择 2判断 3填空 4问答 5指标结果) -->
<template v-if="scope.row.type == 1"> <template v-if="scope.row.type == 1">
<div class="line"> <div class="line">
<span class="label" style="width: auto;text-align: left">{{ scope.row.name }}</span> <div>{{ scope.row.name }}</div>
</div> </div>
<div class="line"> <div class="line">
<span class="label mini">正确答案</span> <span class="label mini">正确答案</span>
@ -127,7 +134,7 @@
<template v-if="scope.row.type == 2"> <template v-if="scope.row.type == 2">
<div class="line"> <div class="line">
<span class="label" style="width: auto;text-align: left">{{ scope.row.name }}</span> <div>{{ scope.row.name }}</div>
</div> </div>
<div class="line"> <div class="line">
<span class="label mini">正确答案</span> <span class="label mini">正确答案</span>
@ -215,6 +222,7 @@
<template v-if="scope.row.type == 5"> <template v-if="scope.row.type == 5">
<div class="line"> <div class="line">
<!--
<span class="label">选择指标</span> <span class="label">选择指标</span>
<div class="action"> <div class="action">
<el-select <el-select
@ -229,7 +237,10 @@
:value="item.itemId" :value="item.itemId"
></el-option> ></el-option>
</el-select> </el-select>
</div> </div>
-->
<div>{{ scope.row.name }}</div>
</div> </div>
<div class="line"> <div class="line">
<span class="label">交易指标区间</span> <span class="label">交易指标区间</span>
@ -274,9 +285,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="300" v-if="!isView"> <el-table-column label="操作" width="300" v-if="!isView">
<template slot-scope="scope" v-if="scope.row.isSubject"> <template slot-scope="scope" v-if="scope.row.isSubject">
<el-button v-if="!scope.row.isSave" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button> <el-button v-show="scope.row.isDisabled" size="mini" type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button> <el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleSave(scope.row, scope.$index)">保存</el-button>
<el-button v-if="scope.row.isSave" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button> <el-button v-show="!scope.row.isDisabled" size="mini" type="text" @click="handleCancel(scope.row, scope.$index)">取消</el-button>
<el-button size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button> <el-button size="mini" type="text" @click="handleDelete(scope.row, scope.$index)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -294,9 +305,10 @@ export default {
components: {quill}, components: {quill},
data() { data() {
return { return {
isAdd: false, // lcId: "", // id
isEdit: false, // isAdd: Boolean(this.$route.query.isAdd), //
isView: false, // isEdit: Boolean(this.$route.query.isEdit), //
isView: Boolean(this.$route.query.isView), //
isNameRepeat: false, // isNameRepeat: false, //
treeData: [], // treeData: [], //
defaultProps: { defaultProps: {
@ -317,22 +329,16 @@ export default {
}, // }, //
tableData: [], // tableData: [], //
tableDataCopy: [], // tableDataCopy: [], //
isAddRule: false, // isAddRule: false, //
}; };
}, },
mounted() { mounted() {
this.$route.query.token && this.$store.commit('setParam', { this.$route.query.token && this.$store.commit('setParam', {
token: atob(decodeURI(this.$route.query.token)) token: atob(decodeURI(this.$route.query.token))
}); });
if (this.$route.query.isView) {
this.isView = true;
} else if (this.$route.query.isEdit) {
this.isEdit = true;
} else if (this.$route.query.isAdd) {
this.isAdd = true;
}
this.getTreeData(); this.getTreeData();
if (this.$route.query.lcId) { if (this.$route.query.lcId) {
this.lcId = this.$route.query.lcId;
this.getInfoData(this.$route.query.lcId); this.getInfoData(this.$route.query.lcId);
} }
if (this.$route.query.systemId) { if (this.$route.query.systemId) {
@ -353,9 +359,14 @@ export default {
let length = judgmentRuleList.length; let length = judgmentRuleList.length;
let tempArr = []; let tempArr = [];
judgmentRuleList.forEach((item, index) => { judgmentRuleList.forEach((item, index) => {
let obj = { ...item, isSubject: true, isDisabled: true, isSave: false}; let obj = {
...item,
isSubject: true,
isDisabled: true, //
isSave: true //
};
//(1 2 3 4 5) //(1 2 3 4 5)
if (item.type == 1) { if (item.type == 1 || item.type == 2) {
obj.subjectId = Number(item.emptyOne); obj.subjectId = Number(item.emptyOne);
obj.value1 = Number(item.emptyTwo); obj.value1 = Number(item.emptyTwo);
} else if (item.type == 3) { } else if (item.type == 3) {
@ -367,8 +378,8 @@ export default {
obj.value1 = item.emptyOne; obj.value1 = item.emptyOne;
obj.value2 = ""; obj.value2 = "";
} else { } else {
obj.value1 = item.emptyOne.substring(1,item.emptyOne.indexOf(',')); obj.value1 = item.emptyOne.substring(0,item.emptyOne.indexOf(','));
obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length - 1) obj.value2 = item.emptyOne.substring(item.emptyOne.indexOf(',') + 1,item.emptyOne.length)
} }
obj.value3 = item.emptyTwo; obj.value3 = item.emptyTwo;
} else if (item.type == 5) { } else if (item.type == 5) {
@ -385,7 +396,7 @@ export default {
this.tableData = tempArr; this.tableData = tempArr;
}); });
this.tableData.forEach((item, index) => { this.tableData.forEach(async (item, index) => {
// //
if (item.operationIds) { if (item.operationIds) {
this.$nextTick(() => { this.$nextTick(() => {
@ -393,8 +404,8 @@ export default {
}); });
} }
// id, // id,
if (item.type && item.type != 4 && item.emptyOne) { if (item.isSubject && item.type && item.type != 4 && item.emptyOne) {
this.getSubjectData(item.subjectId, index); await this.getSubjectData(item.emptyOne, index);
} }
}); });
@ -470,7 +481,7 @@ export default {
handleBlur() { // / handleBlur() { // /
if (this.formData.lcJudgmentPoint.name) { if (this.formData.lcJudgmentPoint.name) {
let params = { let params = {
lcId: this.$route.query.lcId ? this.$route.query.lcId : "", lcId: this.lcId,
name: this.formData.lcJudgmentPoint.name name: this.formData.lcJudgmentPoint.name
} }
this.$post(this.api.queryNameIsExist, params).then(res => { this.$post(this.api.queryNameIsExist, params).then(res => {
@ -505,7 +516,7 @@ export default {
if (this.tableData[i].isSubject && !this.tableData[i].operationIds) { if (this.tableData[i].isSubject && !this.tableData[i].operationIds) {
this.$message.warning(`${i + 1}项请选择操作点`); this.$message.warning(`${i + 1}项请选择操作点`);
return; return;
} else if (this.tableData[i].isSave) { } else if (this.tableData[i].isSubject && !this.tableData[i].isSave) {
this.$message.warning(`${i + 1}项,未保存`); this.$message.warning(`${i + 1}项,未保存`);
return; return;
} }
@ -518,7 +529,7 @@ export default {
emptyOne: "", emptyOne: "",
emptyTwo: "", emptyTwo: "",
id: i.id ? i.id : "", id: i.id ? i.id : "",
lcId: i.lcId ? i.lcId : "", lcId: i.lcId,
type: i.type ? i.type : "", type: i.type ? i.type : "",
operationIds: i.operationIds, operationIds: i.operationIds,
resultOperation: i.resultOperation, resultOperation: i.resultOperation,
@ -577,8 +588,9 @@ export default {
this.tableData.length && this.tableData.push({ruleOperation: 0}); this.tableData.length && this.tableData.push({ruleOperation: 0});
this.tableData.push({ this.tableData.push({
isSubject: true, isSubject: true,
isDisabled: true, isDisabled: false, //
isSave: false, isSave: false, //
lcId: this.lcId,
resultOperation: 0, resultOperation: 0,
ruleOperation: 0, ruleOperation: 0,
operationIds: "", operationIds: "",
@ -599,7 +611,6 @@ export default {
handleEdit(row) { // handleEdit(row) { //
this.tableDataCopy = deepCopy(this.tableData); // this.tableDataCopy = deepCopy(this.tableData); //
row.isDisabled = false; row.isDisabled = false;
row.isSave = true;
}, },
handleSave(row, index) { // handleSave(row, index) { //
let keys = this.$refs[`tree-${index}`].getCheckedKeys(); let keys = this.$refs[`tree-${index}`].getCheckedKeys();
@ -641,16 +652,22 @@ export default {
} }
} }
} }
row.isSave = false; row.isSave = true;
row.isDisabled = true; row.isDisabled = true;
this.isAddRule = false; this.isAddRule = false;
}, },
handleCancel(row, index) { // handleCancel(row, index) { //
this.$set(this.tableData, index, this.tableDataCopy[index]); if (row.isSave) {
if (!this.tableData[index].operationIds) { this.$set(this.tableData, index, this.tableDataCopy[index]);
this.$refs[`tree-${index}`].setCheckedKeys([]); if (!this.tableData[index].operationIds) {
this.$refs[`tree-${index}`].setCheckedKeys([]);
} else {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]);
}
} else { } else {
this.$refs[`tree-${index}`].setCheckedKeys([this.tableData[index].operationIds]); this.tableData.splice(index, 1);
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = false;
} }
}, },
handleDelete(row, index) { // handleDelete(row, index) { //
@ -662,7 +679,7 @@ export default {
}).then(() => { }).then(() => {
this.tableData.splice(index, 1); this.tableData.splice(index, 1);
index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1); index ? this.tableData.splice(index - 1, 1) : this.tableData.splice(0, 1);
this.isAddRule = index === 0 ? false : true; this.isAddRule = false;
}).catch(() => {}) }).catch(() => {})
}, },
// //
@ -795,6 +812,7 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
right: 10px;
cursor:not-allowed; cursor:not-allowed;
z-index: 99999; z-index: 99999;
} }

@ -20,7 +20,7 @@ module.exports = {
} }
}, },
publicPath: './', publicPath: '/',
outputDir: 'dist', outputDir: 'dist',
assetsDir: 'static', assetsDir: 'static',
devServer: { devServer: {

Loading…
Cancel
Save