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

25
package-lock.json generated

@ -3696,8 +3696,7 @@
"commander": { "commander": {
"version": "2.20.3", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
"dev": true
}, },
"commondir": { "commondir": {
"version": "1.0.1", "version": "1.0.1",
@ -4240,6 +4239,11 @@
"integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
"dev": true "dev": true
}, },
"cssfilter": {
"version": "0.0.10",
"resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz",
"integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw=="
},
"cssnano": { "cssnano": {
"version": "4.1.10", "version": "4.1.10",
"resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz", "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-4.1.10.tgz",
@ -7115,6 +7119,14 @@
"object-visit": "^1.0.0" "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": { "md5.js": {
"version": "1.3.5", "version": "1.3.5",
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
@ -12317,6 +12329,15 @@
"async-limiter": "~1.0.0" "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": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

@ -12,6 +12,7 @@
"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",
"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",

@ -1,223 +1,310 @@
<template> <template>
<div class="quill" :class="[classes,readonly ? 'readonly' : '']"> <div>
<div :ref="toref" :style="styles" v-loading="loading"></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-upload :headers="headers"
<el-button :id="'editorUpload' + index" ref="editorUpload" size="small" type="primary">点击上传</el-button> :action="this.api.fileupload"
</el-upload> :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> </div>
<mavon-editor class="md"
v-model="mdVal"
v-show="editorType == 1"
ref="md"
:ishljs="true"
:subfield="false"
@change="mdChange"
@imgAdd="imgAdd" />
</div>
</template> </template>
<script> <script>
import Quill from 'quill'; import Quill from 'quill';
import 'quill/dist/quill.core.css'; import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css'; import 'quill/dist/quill.bubble.css';
import toolbarOptions from './options' 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', name: 'quill',
props: { components: {
toref: { mavonEditor
type: String, },
default: 'editor' props: {
}, toref: {
value: { type: String,
type: String, default: 'editor'
default: '' },
}, value: {
readonly: { type: String,
type: Boolean, default: ''
default: false },
}, readonly: {
toTop: { type: Boolean,
type: Boolean, default: false
default: true },
}, toTop: {
border: { type: Boolean,
type: Boolean, default: true
default: false },
}, border: {
height: { type: Boolean,
type: Number default: false
}, },
minHeight: { height: {
type: Number type: Number
}, },
// minHeight: {
index: { type: Number
type: Number, },
default: 0 //
}, index: {
}, type: Number,
data () { default: 0
let that = this },
return { //
headers: { type: {
token: this.$store.state.token type: String,
}, default: '0'
Quill: null, },
currentValue: '', },
options: { data () {
theme: 'snow', let that = this
bounds: document.body, return {
debug: 'warn', headers: {
modules: { token: this.$store.state.token
toolbar: { },
container: this.readonly ? [] : toolbarOptions, editorType: '0',
handlers: { mdVal: '',
"image": function(value) { Quill: null,
if (value) { currentValue: '',
// iview options: {
document.querySelector("#editorUpload" + that.index).click(); theme: 'snow',
} else { bounds: document.body,
this.Quill.format("image", false); debug: 'warn',
} modules: {
} toolbar: {
} container: this.readonly ? [] : toolbarOptions,
} handlers: {
}, "image": function (value) {
placeholder: '', if (value) {
readOnly: this.readonly // iview
}, document.querySelector("#editorUpload" + that.index).click();
loading: false, } else {
qu: null this.Quill.format("image", false);
}
},
computed: {
classes () {
return [
{
'quill-no-border': !this.border
}
];
},
styles () {
let style = {};
if (this.minHeight) {
style.minHeight = `${this.minHeight}px`;
}
if (this.height) {
style.height = `${this.height}px`;
} }
return style; }
} }
}
}, },
watch: { placeholder: '',
value: { readOnly: this.readonly
handler (val) { },
if (val !== this.currentValue) { loading: false,
this.currentValue = val; qu: null
if (this.Quill) { }
this.Quill.pasteHTML(this.value); },
} computed: {
} classes () {
}, return [
immediate: true {
} 'quill-no-border': !this.border
}, }
mounted () { ];
// console.log(this.$refs.editorUpload.$el) },
this.init(); styles () {
}, let style = {};
beforeDestroy () { if (this.minHeight) {
// style.minHeight = `${this.minHeight}px`;
this.Quill = null; }
}, if (this.height) {
methods: { style.height = `${this.height}px`;
init () { }
let toeval = "this.$refs."+this.toref return style;
const editor = eval(toeval) }
// },
this.Quill = new Quill(editor, this.options); watch: {
const ins = this.Quill type: {
// handler (val) {
this.Quill.pasteHTML(this.currentValue); this.editorType = val
if(this.toTop){ },
this.$nextTick(() => { immediate: true
window.scrollTo(0,0) },
}) value: {
} handler (val) {
// if (this.type == 0) {
this.Quill.on('text-change', (delta, oldDelta, source) => { if (val !== this.currentValue) {
const html = this.$refs[this.toref].children[0].innerHTML; this.currentValue = val;
const text = this.Quill.getText(); if (this.Quill) {
const quill = this.Quill; this.Quill.pasteHTML(this.value);
//
this.currentValue = html;
// v-model
this.$emit('input', html);
//
this.$emit('on-change', { html, text, quill });
});
// quill
this.Quill.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
this.Quill.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
this.Quill.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
//
ins.root.addEventListener('paste', evt => {
if (evt.clipboardData && evt.clipboardData.files && evt.clipboardData.files.length) {
evt.preventDefault();
//
[].forEach.call(evt.clipboardData.files, file => {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return
}
const param = new FormData()
param.append('file', file)
// base64
this.$post(this.api.fileupload, param, {
headers: { "Content-Type": "multipart/form-data" }
}).then(res => {
var range = ins.getSelection()
console.log(333, range)
if (range) {
//
ins.insertEmbed(range.index, 'image', res.data.filesResult.fileUrl)
//
ins.setSelection(range.index + 1)
}
}).catch(res => {})
});
}
}, false)
},
beforeUpload(file){
this.loading = true
},
editorUploadSuccess(res) {
//
let quill = this.Quill;
//
if (res.data.filesResult.fileUrl) {
//
let length = quill.getSelection().index;
// res
quill.insertEmbed(length, "image", res.data.filesResult.fileUrl);
//
quill.setSelection(length + 1);
} else {
util.successMsg("图片插入失败");
}
this.loading = false;
} }
}
} }
if (!this.mdVal) this.mdVal = val
},
immediate: true
} }
},
mounted () {
this.init();
},
beforeDestroy () {
//
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
const editor = eval(toeval)
//
this.Quill = new Quill(editor, this.options);
const ins = this.Quill
//
this.Quill.pasteHTML(this.currentValue);
if (this.toTop) {
this.$nextTick(() => {
window.scrollTo(0, 0)
})
}
//
this.Quill.on('text-change', (delta, oldDelta, source) => {
const html = this.$refs[this.toref].children[0].innerHTML;
const text = this.Quill.getText();
const quill = this.Quill;
//
this.currentValue = html;
// v-model
this.$emit('input', html);
//
this.$emit('on-change', { html, text, quill });
});
// quill
this.Quill.on('text-change', (delta, oldDelta, source) => {
this.$emit('on-text-change', delta, oldDelta, source);
});
this.Quill.on('selection-change', (range, oldRange, source) => {
this.$emit('on-selection-change', range, oldRange, source);
});
this.Quill.on('editor-change', (eventName, ...args) => {
this.$emit('on-editor-change', eventName, ...args);
});
//
ins.root.addEventListener('paste', evt => {
if (evt.clipboardData && evt.clipboardData.files && evt.clipboardData.files.length) {
evt.preventDefault();
//
[].forEach.call(evt.clipboardData.files, file => {
if (!file.type.match(/^image\/(gif|jpe?g|a?png|bmp)/i)) {
return
}
const param = new FormData()
param.append('file', file)
// base64
this.$post(this.api.fileupload, param, {
headers: { "Content-Type": "multipart/form-data" }
}).then(res => {
var range = ins.getSelection()
console.log(333, range)
if (range) {
//
ins.insertEmbed(range.index, 'image', res.data.filesResult.fileUrl)
//
ins.setSelection(range.index + 1)
}
}).catch(res => { })
});
}
}, false)
},
beforeUpload (file) {
this.loading = true
},
// quill
editorUploadSuccess (res) {
//
let quill = this.Quill;
//
if (res.data.filesResult.fileUrl) {
//
let length = quill.getSelection().index;
// res
quill.insertEmbed(length, "image", res.data.filesResult.fileUrl);
//
quill.setSelection(length + 1);
} else {
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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.quill-no-border{ .type-radio {
.ql-toolbar.ql-snow{ margin-bottom: 20px;
border: none; }
border-bottom: 1px solid #e8eaec; .quill-no-border {
} .ql-toolbar.ql-snow {
.ql-container.ql-snow{ border: none;
border: none; border-bottom: 1px solid #e8eaec;
} }
} .ql-container.ql-snow {
border: none;
}
}
.md {
max-height: 300px;
}
/deep/.v-note-wrapper .v-note-panel {
min-height: 200px;
}
</style> </style>

@ -11,7 +11,7 @@ if(isKd){
host = 'http://124.71.12.62:9000'; // 巢湖版 host = 'http://124.71.12.62:9000'; // 巢湖版
} else if (dev) { } else if (dev) {
host = 'http://121.37.12.51'; //线上 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'; let host1 = 'http://121.37.12.51:8080';
@ -22,6 +22,11 @@ export default {
// 交易类(流程类) // 交易类(流程类)
getAllBusiness: `${host}/judgment/judgment/lcRecord/getAllBusiness`, // 获取流程记录列表(树) getAllBusiness: `${host}/judgment/judgment/lcRecord/getAllBusiness`, // 获取流程记录列表(树)
getProcess: `${host}/judgment/judgment/lcRecord/getProcess`, // 获取流程记录列表(树) 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获取题目信息 getSubjectInfo: `${host}/judgment/judgment/lcSubject/getSubjectInfo`, // 根据题目id获取题目信息
addJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则 addJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/addJudgmentRule`, // 添加判分点规则
updateJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则 updateJudgmentRule: `${host}/judgment/judgment/lcJudgmentRule/updateJudgmentRule`, // 添加判分点规则

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

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

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