yujialong 1 year ago
parent 123a722bbe
commit 838abe42b8
  1. 25
      package-lock.json
  2. 1
      package.json
  3. 135
      src/components/quill/index.vue
  4. 7
      src/utils/api.js
  5. 135
      src/views/Home.vue
  6. 201
      src/views/Program.vue
  7. 659
      src/views/Transaction.vue

25
package-lock.json generated

@ -3696,8 +3696,7 @@
"commander": {
"version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
"dev": true
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"commondir": {
"version": "1.0.1",
@ -4240,6 +4239,11 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true
},
"cssfilter": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
"integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
},
"cssnano": {
"version": "4.1.10",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
@ -7115,6 +7119,14 @@
"object-visit": "^1.0.0"
}
},
"mavon-editor": {
"version": "2.10.4",
"resolved": "https://registry.npmjs.org/mavon-editor/-/mavon-editor-2.10.4.tgz",
"integrity": "sha512-CFsBLkgt/KZBDg+SJYe2fyYv4zClY149PiwpH0rDAiiP4ae1XNs0GC8nBsoTeipsHcebDLN1QMkt3bUsnMDjQw==",
"requires": {
"xss": "^1.0.6"
}
},
"md5.js": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -12317,6 +12329,15 @@
"async-limiter": "~1.0.0"
}
},
"xss": {
"version": "1.0.14",
"resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz",
"integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==",
"requires": {
"commander": "^2.20.3",
"cssfilter": "0.0.10"
}
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

@ -12,6 +12,7 @@
"core-js": "^3.6.5",
"element-ui": "^2.14.0",
"lib-flexible": "^0.3.2",
"mavon-editor": "^2.10.4",
"postcss-px2rem": "^0.3.0",
"postcss-pxtorem": "^5.1.1",
"px2rem-loader": "^0.1.9",

@ -1,22 +1,56 @@
<template>
<div class="quill" :class="[classes,readonly ? 'readonly' : '']">
<div :ref="toref" :style="styles" v-loading="loading"></div>
<div>
<el-radio-group v-if="!readonly"
class="type-radio"
v-model="editorType"
@change="typeChange">
<el-radio label="0">富文本</el-radio>
<el-radio label="1">markdown</el-radio>
</el-radio-group>
<div v-show="editorType == 0"
class="quill"
:class="[classes,readonly ? 'readonly' : '']">
<div :ref="toref"
:style="styles"
v-loading="loading"></div>
<el-upload :headers="headers" :action="this.api.fileupload" :before-upload="beforeUpload" :on-success="editorUploadSuccess" style="display: none">
<el-button :id="'editorUpload' + index" ref="editorUpload" size="small" type="primary">点击上传</el-button>
<el-upload :headers="headers"
:action="this.api.fileupload"
:before-upload="beforeUpload"
:on-success="editorUploadSuccess"
style="display: none">
<el-button :id="'editorUpload' + index"
ref="editorUpload"
size="small"
type="primary">点击上传</el-button>
</el-upload>
</div>
<mavon-editor class="md"
v-model="mdVal"
v-show="editorType == 1"
ref="md"
:ishljs="true"
:subfield="false"
@change="mdChange"
@imgAdd="imgAdd" />
</div>
</template>
<script>
import Quill from 'quill';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options'
import Quill from 'quill';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options'
import axios from 'axios'
import { mavonEditor } from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
export default {
export default {
name: 'quill',
components: {
mavonEditor
},
props: {
toref: {
type: String,
@ -49,6 +83,11 @@
type: Number,
default: 0
},
//
type: {
type: String,
default: '0'
},
},
data () {
let that = this
@ -56,6 +95,8 @@
headers: {
token: this.$store.state.token
},
editorType: '0',
mdVal: '',
Quill: null,
currentValue: '',
options: {
@ -66,7 +107,7 @@
toolbar: {
container: this.readonly ? [] : toolbarOptions,
handlers: {
"image": function(value) {
"image": function (value) {
if (value) {
// iview
document.querySelector("#editorUpload" + that.index).click();
@ -104,20 +145,28 @@
}
},
watch: {
type: {
handler (val) {
this.editorType = val
},
immediate: true
},
value: {
handler (val) {
if (this.type == 0) {
if (val !== this.currentValue) {
this.currentValue = val;
if (this.Quill) {
this.Quill.pasteHTML(this.value);
}
}
}
if (!this.mdVal) this.mdVal = val
},
immediate: true
}
},
mounted () {
// console.log(this.$refs.editorUpload.$el)
this.init();
},
beforeDestroy () {
@ -125,17 +174,22 @@
this.Quill = null;
},
methods: {
//
typeChange (val) {
this.$emit('update:type', val)
if (!this.mdVal) this.mdVal = this.value
},
init () {
let toeval = "this.$refs."+this.toref
let toeval = "this.$refs." + this.toref
const editor = eval(toeval)
//
this.Quill = new Quill(editor, this.options);
const ins = this.Quill
//
this.Quill.pasteHTML(this.currentValue);
if(this.toTop){
if (this.toTop) {
this.$nextTick(() => {
window.scrollTo(0,0)
window.scrollTo(0, 0)
})
}
//
@ -183,15 +237,16 @@
//
ins.setSelection(range.index + 1)
}
}).catch(res => {})
}).catch(res => { })
});
}
}, false)
},
beforeUpload(file){
beforeUpload (file) {
this.loading = true
},
editorUploadSuccess(res) {
// quill
editorUploadSuccess (res) {
//
let quill = this.Quill;
//
@ -206,18 +261,50 @@
util.successMsg("图片插入失败");
}
this.loading = false;
},
//
mdChange (val) {
this.$emit('input', val)
},
// markdown
imgAdd (pos, $file) {
let $vm = this.$refs.md
// ..
const formData = new FormData();
formData.append('file', $file);
axios({
url: this.api.fileupload,
method: 'post',
data: formData,
headers: {
token: this.$store.state.token,
'Content-Type': 'multipart/form-data'
},
}).then((res) => {
$vm.$img2Url(pos, res.data.data.filesResult.fileUrl);
})
},
}
}
}
}
</script>
<style lang="scss" scoped>
.quill-no-border{
.ql-toolbar.ql-snow{
.type-radio {
margin-bottom: 20px;
}
.quill-no-border {
.ql-toolbar.ql-snow {
border: none;
border-bottom: 1px solid #e8eaec;
}
.ql-container.ql-snow{
.ql-container.ql-snow {
border: none;
}
}
}
.md {
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
}
</style>

@ -11,7 +11,7 @@ if(isKd){
host = 'http://124.71.12.62:9000'; // 巢湖版
} else if (dev) {
host = 'http://121.37.12.51'; //线上
// host = 'http://192.168.31.137:9000'; //赓
// host = 'http://192.168.31.217:9000';
}
}
let host1 = 'http://121.37.12.51:8080';
@ -22,6 +22,11 @@ export default {
// 交易类(流程类)
getAllBusiness: `${host}/judgment/judgment/lcRecord/getAllBusiness`, // 获取流程记录列表(树)
getProcess: `${host}/judgment/judgment/lcRecord/getProcess`, // 获取流程记录列表(树)
// getAllBusinessSt: `${host}/nakadai/nakadai/customsPass/checkpointList`, // 获取流程记录列表(树)
getProcessSt: `${host}/judgment/judgment/stRecord/getProcess`, // 获取流程记录列表(树)
getAllBusinessSt: `${host}/judgment/judgment/stRecord/getAllBusiness`, // 获取流程记录列表(树)
getSubjectInfoSt: `${host}/judgment/stSubject/getSubjectInfo`, // 根据题目id获取题目信息
queryJudgmentPointDetailsSt: `${host}/judgment/judgment/lcJudgmentPoint/queryJudgmentPointDetailsBySt`, // 获取判分点详细信息
getSubjectInfo: `${host}/judgment/judgment/lcSubject/getSubjectInfo`, // 根据题目id获取题目信息
addJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则
updateJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则

@ -1,7 +1,9 @@
<template>
<div class="content">
<div class="header flex">
<i class="el-icon-arrow-left" @click="BackMain()" style="cursor:pointer">
<i class="el-icon-arrow-left"
@click="BackMain()"
style="cursor:pointer">
<span>Back</span>
</i>
@ -9,59 +11,80 @@
</div>
<div class="footer">
<div class="footer_h">
<div class="black" style="float: left"></div>
<div class="black"
style="float: left"></div>
<p style="float: left">判分点列表</p>
</div>
<div class="flex footer_h">
<div style="width: 300px;float: left">
<el-input placeholder="请输入判分点名称" style="height: 33px;width:100%" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
<el-input placeholder="请输入判分点名称"
style="height: 33px;width:100%"
prefix-icon="el-icon-search"
v-model="keyword"
clearable></el-input>
</div>
<div style="float: right">
<el-button class="button" style="height: 33px;line-height: 0px" @click="HomepageJump()">新增</el-button>
<el-button class="button" style="height: 33px;line-height: 0px" @click="deletes()">批量删除</el-button>
<el-button class="button"
style="height: 33px;line-height: 0px"
@click="HomepageJump()">新增</el-button>
<el-button class="button"
style="height: 33px;line-height: 0px"
@click="deletes()">批量删除</el-button>
</div>
</div>
<div>
<el-row>
<el-col :span="24">
<el-card shadow="hover">
<el-table
:data="tableData"
<el-table :data="tableData"
:cell-style="rowClass"
:header-cell-style="headClass"
:stripe="true"
header-align="center"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column type="index" label="序号" align="center">
<el-table-column type="index"
label="序号"
align="center">
<template slot-scope="scope">{{ scope.$index + (pageNum - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="name" label="判分点名称" align="center"></el-table-column>
<el-table-column label="实验要求" align="center">
<el-table-column prop="name"
label="判分点名称"
align="center"></el-table-column>
<el-table-column label="实验要求"
align="center">
<template slot-scope="scope">
<quill :border="true" :readonly="true" v-model="scope.row.experimentalRequirements" :minHeight="150"
:height="150"/>
<quill :border="true"
:readonly="true"
v-model="scope.row.experimentalRequirements"
:minHeight="150"
:height="150" />
</template>
</el-table-column>
<el-table-column prop="operate" label="操作" align="center">
<el-table-column prop="operate"
label="操作"
align="center">
<template slot-scope="scope">
<el-button @click="handleEdit(scope.row)" type="text" size="small">编辑</el-button>
<el-button @click="handleDelete(scope.row)" type="text" size="small">删除</el-button>
<el-button @click="handleEdit(scope.row)"
type="text"
size="small">编辑</el-button>
<el-button @click="handleDelete(scope.row)"
type="text"
size="small">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="isOpen" label="是否启用" align="center" min-width="20%">
<el-table-column prop="isOpen"
label="是否启用"
align="center"
min-width="20%">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isOpen"
<el-switch v-model="scope.row.isOpen"
:active-value="0"
:inactive-value="1"
@change="changeSwitch(scope.row)"
></el-switch>
@change="changeSwitch(scope.row)"></el-switch>
</template>
</el-table-column>
</el-table>
@ -71,14 +94,12 @@
<!-- 分页 -->
<div class="block">
<el-pagination
background
<el-pagination background
@current-change="handleCurrentChange"
:current-page="pageNum"
:page-size="10"
layout="total,prev, pager, next, jumper"
:total="dataTotal"
></el-pagination>
:total="dataTotal"></el-pagination>
</div>
</div>
</div>
@ -89,7 +110,7 @@
import quill from '@/components/quill'
export default {
data() {
data () {
return {
keyword: '',
searchTimer: null,
@ -101,10 +122,10 @@ export default {
systemId: this.$route.query.systemId,
systemName: this.$route.query.systemName,
isProcess: false, //
multipleSelection:[],
multipleSelection: [],
};
},
components: {quill},
components: { quill },
watch: {
keyword: function (val) {
clearTimeout(this.searchTimer)
@ -114,11 +135,11 @@ export default {
}, 500)
},
},
mounted() {
mounted () {
console.log('当前地址=', location.host);
console.log("token=", this.$route.query.token)
console.log("systemId=", this.$route.query.systemId)
this.isProcess = this.systemId == 11 || this.systemId == 12
this.isProcess = this.systemId == 11 || this.systemId == 12 || this.systemId == 19
// sessionStorage.setItem('token',this.$route.query.token)
this.$route.query.token && this.$store.commit('setParam', {
token: atob(decodeURI(this.$route.query.token)),
@ -128,14 +149,14 @@ export default {
this.initData();
},
methods: {
BackMain() { //
BackMain () { //
history.back()
},
handleCurrentChange(val) { //
handleCurrentChange (val) { //
this.pageNum = val;
this.initData();
},
initData() { //
initData () { //
let params = {
name: this.keyword,
pageNum: this.pageNum,
@ -147,14 +168,14 @@ export default {
this.getProcessClassData(params);
} else {
//
if (location.host == 'http://124.71.12.62' || location.host == 'http://occupationlab.com'){
if (location.host == 'http://124.71.12.62' || location.host == 'http://occupationlab.com') {
this.getCHProgrammingClassData(params);
}else{
} else {
this.getProgrammingClassData(params);
}
}
},
getProcessClassData(params) { //
getProcessClassData (params) { //
this.$post(`${this.api.queryAllJudgmentPoint}`, params).then(res => {
if (res.status === 200) {
this.tableData = res.message.records;
@ -167,21 +188,21 @@ export default {
});
},
//
handleSelectionChange(val){
handleSelectionChange (val) {
console.log(val)
this.multipleSelection = val;
},
//
deletes(){
deletes () {
let bcIdList = [];
let nameList =[];
let nameList = [];
let lcIdList = [];
for(var i=0;i<this.multipleSelection.length;i++){
for (var i = 0; i < this.multipleSelection.length; i++) {
bcIdList.push(this.multipleSelection[i].bcId)
lcIdList.push(this.multipleSelection[i].lcId)
nameList.push(this.multipleSelection[i].name)
}
if (nameList.length > 0){
if (nameList.length > 0) {
this.$confirm(`此操作将永久删除【${nameList}】判分点, 是否继续?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -213,13 +234,13 @@ export default {
console.log(err);
});
}
if(this.nameList.length === this.tableData.length && this.pageNum>1) {
if (this.nameList.length === this.tableData.length && this.pageNum > 1) {
this.handleCurrentChange(this.pageNum - 1)
}
}).catch(() => {
this.$message.info("已取消删除");
});
}else{
} else {
this.$alert('请选择需要删除的判分点', '提示', {
confirmButtonText: '好的',
callback: action => {
@ -228,14 +249,14 @@ export default {
});
}
},
getProgrammingClassData(params) { //
getProgrammingClassData (params) { //
this.$post(this.api.getBcJudgmentPoint, params).then(res => {
this.tableData = res.message.records;
this.dataTotal = res.message.total;
}).catch(err => {
});
},
getCHProgrammingClassData(){
getCHProgrammingClassData () {
let systemId = this.$route.query.systemId
let userId = this.$route.query.userId
let pageNum = this.$route.query.pageNum
@ -249,7 +270,7 @@ export default {
console.log(err);
});
},
HomepageJump() { //
HomepageJump () { //
if (this.isProcess) {
//
this.$router.push(`Transaction?isAdd=true&systemId=${this.systemId}`);
@ -258,7 +279,7 @@ export default {
this.$router.push(`program?isAdd=true&systemId=${this.systemId}`);
}
},
handleEdit(row) { //
handleEdit (row) { //
if (this.isProcess) {
//
this.$router.push(`Transaction?isEdit=true&systemId=${this.systemId}&lcId=${row.lcId}`);
@ -267,7 +288,7 @@ export default {
this.$router.push(`program?isEdit=true&systemId=${this.systemId}&bcId=${row.bcId}`)
}
},
handleDelete(row) { //
handleDelete (row) { //
this.$confirm(`此操作将永久删除【${row.name}】判分点, 是否继续?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -303,7 +324,7 @@ export default {
this.$message.info("已取消删除");
});
},
changeSwitch(row) { //
changeSwitch (row) { //
if (this.isProcess) {
//
this.$get(`${this.api.updateIsOpen}?isOpen=${row.isOpen}&lcId=${row.lcId}`).then(res => {
@ -332,12 +353,12 @@ export default {
},
//
headClass() {
headClass () {
return "text-align: center;";
},
//
rowClass() {
rowClass () {
return "text-align: center;";
},
}
@ -352,7 +373,7 @@ export default {
}
//
.footer /deep/ .el-pagination span:not([class*="suffix"]),
.footer /deep/ .el-pagination span:not([class*='suffix']),
.el-pagination button {
font-size: 16px;
margin-right: 30px;
@ -481,8 +502,8 @@ export default {
outline: 0;
}
.header /deep/ [class*=" el-icon-"],
[class^="el-icon-"] {
.header /deep/ [class*=' el-icon-'],
[class^='el-icon-'] {
line-height: 3;
padding-left: 10px;
}

@ -3,13 +3,18 @@
<div class="content">
<div class="header">
<div>
<i class="back el-icon-arrow-left" @click="Back()" style="cursor:pointer">
<i class="back el-icon-arrow-left"
@click="Back()"
style="cursor:pointer">
<span>Back</span>
</i>
<span class="title">判分点设置</span>
</div>
<div>
<el-button v-if="!isView" type="primary" size="mini" @click="saveAll">保存</el-button>
<el-button v-if="!isView"
type="primary"
size="mini"
@click="saveAll">保存</el-button>
</div>
</div>
@ -22,18 +27,22 @@
</div>
<div class="item">
<div class="label">判分点</div>
<el-input
v-model.trim="formData.points.name"
<el-input v-model.trim="formData.points.name"
:readonly="isView"
@blur="handleBlur"
placeholder="请输入内容"
clearable
style="width: 400px"
></el-input>
style="width: 400px"></el-input>
</div>
<div class="item">
<div class="label">实验要求</div>
<quill class="quill" v-model="formData.points.experimentalRequirements" :readonly="isView" :border="true" :minHeight="150" :height="150"/>
<quill class="quill"
v-model="formData.points.experimentalRequirements"
:type.sync="formData.points.experimentalRequirementsType"
:readonly="isView"
:border="true"
:minHeight="150"
:height="150" />
</div>
</div>
@ -45,7 +54,13 @@
</div>
<p style="text-align: center;">参考答案</p>
<div>
<quill v-model="formData.points.experimentCode" :readonly="isView" :border="true" :minHeight="300" :height="300" :index="1"/>
<quill v-model="formData.points.experimentCode"
:type.sync="formData.points.experimentCodeType"
:readonly="isView"
:border="true"
:minHeight="300"
:height="300"
:index="1" />
</div>
</div>
@ -57,75 +72,98 @@
<div>判分规则</div>
</div>
<div>
<el-button v-if="!isView" type="primary" size="mini" @click="batchDel">批量删除</el-button>
<el-button v-if="!isView" type="primary" size="mini" @click="addRule">新增</el-button>
<el-button v-if="!isView"
type="primary"
size="mini"
@click="batchDel">批量删除</el-button>
<el-button v-if="!isView"
type="primary"
size="mini"
@click="addRule">新增</el-button>
</div>
</div>
<el-card shadow="hover">
<el-table
class="lc-table"
<el-table class="lc-table"
:data="tableData"
:stripe="true"
:cell-style="rowClass"
header-align="center"
:header-cell-style="headClass"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column prop="id" type="index" label="序号" width="80">
<el-table-column prop="id"
type="index"
label="序号"
width="80">
<template slot-scope="scope">
{{ scope.row.isSubject && scope.row.index + 1 }}
</template>
</el-table-column>
<el-table-column label="编译器中正确答案" align="center">
<template slot-scope="scope" v-if="scope.row.isSubject">
<el-table-column label="编译器中正确答案"
align="center">
<template slot-scope="scope"
v-if="scope.row.isSubject">
<p class="p">字段一致性规则用户编辑器中至少出现如下语句</p>
<el-input
type="textarea"
<el-input type="textarea"
:rows="3"
v-model="scope.row.required"
:disabled="isView || scope.row.isDisabled"
></el-input>
:disabled="isView || scope.row.isDisabled"></el-input>
</template>
</el-table-column>
<el-table-column label=" " width="150">
<el-table-column label=" "
width="150">
<template slot-scope="scope">
<el-button
circle
<el-button circle
type="primary"
v-if="scope.row.isSubject"
:disabled="isView || scope.row.isDisabled"
@click="changeResult(scope.row)"
style="position: absolute; right: 55px"
>
style="position: absolute; right: 55px">
{{ scope.row.resultOperation === 0 ? '且' : '或' }}
</el-button>
<el-button v-else type="primary" circle @click="changeRule(scope.row, scope.$index)">
<el-button v-else
type="primary"
circle
@click="changeRule(scope.row, scope.$index)">
{{ scope.row.ruleOperation === 0 ? "且" : "或" }}
</el-button>
</template>
</el-table-column>
<el-table-column label="终端中正确答案" align="center">
<template slot-scope="scope" v-if="scope.row.isSubject">
<el-table-column label="终端中正确答案"
align="center">
<template slot-scope="scope"
v-if="scope.row.isSubject">
<p class="p">运行结果一致性规则用户运行结果需要与下方代码运行结果一致</p>
<el-input
type="textarea"
<el-input type="textarea"
:rows="3"
v-model="scope.row.result"
:disabled="isView || scope.row.isDisabled"
></el-input>
:disabled="isView || scope.row.isDisabled"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="300" v-if="!isView">
<template slot-scope="scope" v-if="scope.row.isSubject">
<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 v-show="scope.row.isDisabled" size="mini" type="text" @click="handleDelete(scope.$index)">删除</el-button>
<el-table-column label="操作"
width="300"
v-if="!isView">
<template slot-scope="scope"
v-if="scope.row.isSubject">
<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 v-show="scope.row.isDisabled"
size="mini"
type="text"
@click="handleDelete(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -137,10 +175,10 @@
<script>
import quill from '@/components/quill'
import {deepCopy} from '@/utils/deepCopy'
import { deepCopy } from '@/utils/deepCopy'
export default {
components: {quill},
data() {
components: { quill },
data () {
return {
bcId: "", // id
isAdd: Boolean(this.$route.query.isAdd), //
@ -156,7 +194,9 @@ export default {
isDel: 0,
isOpen: 0,
projectId: "",
systemId: ""
systemId: "",
experimentCodeType: '0',
experimentalRequirementsType: '0',
},
bcJudgmentRuleList: []
}, //
@ -165,11 +205,7 @@ export default {
isAddRule: false, //
};
},
mounted() {
console.log('当前地址=', location.host);
console.log("token=", this.$route.query.token)
console.log("systemId=", this.$route.query.systemId)
mounted () {
this.$route.query.token && this.$store.commit('setParam', {
token: atob(decodeURI(this.$route.query.token)),
referrer: atob(decodeURI(this.$route.query.referrer))
@ -183,13 +219,15 @@ export default {
}
},
methods: {
Back() { //
Back () { //
this.$router.back();
},
getInfoData(bcId) { //
getInfoData (bcId) { //
this.$get(`${this.api.queryBcJudgmentPointByBcId}?bcId=${bcId}`).then(res => {
if (res.status === 200) {
let {judgmentPoint, judgmentRule} = res;
let { judgmentPoint, judgmentRule } = res;
if (!judgmentPoint.experimentCodeType) judgmentPoint.experimentCodeType = '0'
if (!judgmentPoint.experimentalRequirementsType) judgmentPoint.experimentalRequirementsType = '0'
this.formData = {
points: judgmentPoint,
bcJudgmentRuleList: judgmentRule
@ -211,18 +249,18 @@ export default {
console.log(err)
});
},
handleSelectionChange(val){
handleSelectionChange (val) {
this.multipleSelection = val
},
//
setIndex() {
setIndex () {
let i = 0
this.tableData.map(e => {
if (e.isSubject) e.index = i++
})
},
//
anewPosttingData(judgmentRule){
anewPosttingData (judgmentRule) {
let length = judgmentRule.length;
let tempArr = [];
judgmentRule.forEach((item, index) => {
@ -258,13 +296,13 @@ export default {
}
tempArr.push(obj);
if (length > 1 && index !== (length - 1)) {
tempArr.push({ruleOperation: item.ruleOperation});
tempArr.push({ ruleOperation: item.ruleOperation });
}
this.tableData = tempArr;
this.setIndex()
});
},
handleBlur() { // /
handleBlur () { // /
if (this.formData.points.name) {
let params = {
bcId: this.bcId,
@ -281,7 +319,7 @@ export default {
});
}
},
saveAll() { //
saveAll () { //
if (this.isNameRepeat) {
this.$message.warning(`当前判分点名称已存在`);
return;
@ -305,7 +343,7 @@ export default {
}
}
}
if (this.formData.points.name || this.formData.points.experimentCode){
if (this.formData.points.name || this.formData.points.experimentCode) {
let tempArr = [];
this.tableData.forEach(i => {
if (i.isSubject) {
@ -344,7 +382,7 @@ export default {
console.log(err)
})
}
}else{
} else {
this.$message.warning(`实验代码与判分点名称至少填写一个`);
// if (!this.formData.points.name) {
// this.$message.warning(``);
@ -356,7 +394,7 @@ export default {
// }
}
},
addRule() { //
addRule () { //
this.isAddRule = true;
// this.tableData.length && this.tableData.push({ruleOperation: 0, indexNo: ""});
if (this.tableData.length > 0) {
@ -396,18 +434,18 @@ export default {
}
this.setIndex()
},
changeResult(row) { // (0 1 0)
changeResult (row) { // (0 1 0)
row.resultOperation = row.resultOperation === 0 ? 1 : 0;
},
changeRule(row, index) { // (0 1 0)
changeRule (row, index) { // (0 1 0)
row.ruleOperation = row.ruleOperation === 0 ? 1 : 0;
this.tableData[index - 1].ruleOperation = row.ruleOperation;
},
handleEdit(row) { //
handleEdit (row) { //
this.tableDataCopy = deepCopy(this.tableData); //
row.isDisabled = false;
},
handleSave(row) { //
handleSave (row) { //
if (!row.required && !row.result) {
this.$message.warning(`规则与结果至少填写一个`);
return;
@ -416,36 +454,36 @@ export default {
row.isDisabled = true;
this.isAddRule = false;
},
handleCancel(row, index) { //
handleCancel (row, index) { //
if (row.isSave) {
this.$set(this.tableData, index, this.tableDataCopy[index]);
} else {
this.tableData.splice(index-1, 2);
this.tableData.splice(index - 1, 2);
// this.tableData.splice(index, 1);
this.isAddRule = false;
}
this.setIndex()
},
handleDelete(index) { //
handleDelete (index) { //
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
center: true,
}).then(() => {
if (index+1 == this.tableData.length){
if (index + 1 == this.tableData.length) {
this.tableData.splice(index - 1, 2)
}else{
this.tableData.splice(index,2);
} else {
this.tableData.splice(index, 2);
}
this.itemkey = Math.random()
this.isAddRule = false;
this.setIndex()
}).catch(() => {})
}).catch(() => { })
},
//
batchDel() {
if(this.multipleSelection.length){
batchDel () {
if (this.multipleSelection.length) {
this.$confirm("此操作将永久删除该规则, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@ -463,17 +501,17 @@ export default {
this.setIndex()
this.itemkey = Math.random()
this.isAddRule = false;
}).catch(() => {})
}).catch(() => { })
} else {
this.$message.error('请先选择数据 !')
}
},
//
headClass() {
headClass () {
return "text-align: center;";
},
//
rowClass() {
rowClass () {
return "text-align: center;";
}
}
@ -567,7 +605,6 @@ export default {
}
}
}
}
}
@ -597,17 +634,17 @@ export default {
border-radius: 0;
background: #dddddd;
}
.tree-con{
.tree-con {
height: 230px;
position: relative;
.mask{
.mask {
width: 100%;
height: 100%;
position: absolute;
top: 0;
bottom: 0;
right: 10px;
cursor:not-allowed;
cursor: not-allowed;
z-index: 99999;
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save