更新提交

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;
case 500:
resolve(res.data);
this.$message.error(
res.data.errmessage || res.data.message
);
// this.$message.error(res.data.errmessage || res.data.message);
break;
case 404:
this.$message.error(

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

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

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

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

Loading…
Cancel
Save