|
@@ -4,29 +4,64 @@
|
|
|
<Col span="12">
|
|
|
<div class="part-box">
|
|
|
<h2 class="client-param-title">科目名称设置</h2>
|
|
|
- <Button type="success" icon="md-add" @click="toAdd">新增</Button>
|
|
|
- <Table
|
|
|
- ref="TableList"
|
|
|
- :columns="columes"
|
|
|
- :data="subjects"
|
|
|
- border
|
|
|
- ></Table></div
|
|
|
- ></Col>
|
|
|
+ <div class="part-box-top">
|
|
|
+ <Button type="success" icon="md-add" @click="toAdd">新增</Button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table class="table">
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>科目名称</th>
|
|
|
+ <th>科目代码</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(subject, index) in subjects" :key="index">
|
|
|
+ <td>{{ index + 1 }}</td>
|
|
|
+ <td>
|
|
|
+ <Input v-model="subject.subjectName" clearable></Input>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <Input v-model="subject.subjectCode" clearable></Input>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <Button size="small" type="primary" @click="toSave(subject)"
|
|
|
+ >保存</Button
|
|
|
+ >
|
|
|
+ <Button size="small" type="error" @click="toDelete(index)"
|
|
|
+ >删除</Button
|
|
|
+ >
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ </Col>
|
|
|
<Col span="12">
|
|
|
<div class=" part-box">
|
|
|
<h2 class="client-param-title">其他设置</h2>
|
|
|
- <Form ref="modalFormComp" :model="modalForm" :label-width="100">
|
|
|
- <FormItem prop="name">
|
|
|
- <Checkbox v-model="modalForm.isScanPackage"
|
|
|
- >是否整包扫描</Checkbox
|
|
|
- >
|
|
|
+ <Form ref="modalFormComp" :model="modalForm" :label-width="120">
|
|
|
+ <FormItem label="是否整包扫描:">
|
|
|
+ <RadioGroup v-model="modalForm.isScanPackage">
|
|
|
+ <Radio
|
|
|
+ v-for="(val, key) in BOOLEAN_TYPE"
|
|
|
+ :key="key"
|
|
|
+ :label="key"
|
|
|
+ style="margin-right: 50px;"
|
|
|
+ >{{ val }}</Radio
|
|
|
+ >
|
|
|
+ </RadioGroup>
|
|
|
</FormItem>
|
|
|
- <FormItem prop="name">
|
|
|
- <Checkbox v-model="modalForm.isImageEncryption"
|
|
|
- >图片是否加密</Checkbox
|
|
|
- >
|
|
|
+ <FormItem label="图片是否加密:">
|
|
|
+ <RadioGroup v-model="modalForm.isImageEncryption">
|
|
|
+ <Radio
|
|
|
+ v-for="(val, key) in BOOLEAN_TYPE"
|
|
|
+ :key="key"
|
|
|
+ :label="key"
|
|
|
+ style="margin-right: 50px;"
|
|
|
+ >{{ val }}</Radio
|
|
|
+ >
|
|
|
+ </RadioGroup>
|
|
|
</FormItem>
|
|
|
- <FormItem prop="imageNameRule" label="图片命名规则">
|
|
|
+ <FormItem prop="imageNameRule" label="图片命名规则:">
|
|
|
<Select
|
|
|
v-model="modalForm.imageNameRule"
|
|
|
placeholder="请选择图片命名规则"
|
|
@@ -34,7 +69,7 @@
|
|
|
<Option value=""></Option>
|
|
|
</Select>
|
|
|
</FormItem>
|
|
|
- <FormItem prop="paperGrading" label="试卷档位">
|
|
|
+ <FormItem prop="paperGrading" label="试卷档位:">
|
|
|
<Select
|
|
|
v-model="modalForm.imageNameRule"
|
|
|
placeholder="请选择试卷档位"
|
|
@@ -54,6 +89,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { subjectList, uploadSubject, deleteSubject } from "@/api";
|
|
|
+import { BOOLEAN_TYPE } from "@/constants/enumerate";
|
|
|
|
|
|
const initSubject = {
|
|
|
id: "",
|
|
@@ -66,83 +102,12 @@ export default {
|
|
|
name: "client-param-set",
|
|
|
data() {
|
|
|
return {
|
|
|
+ BOOLEAN_TYPE,
|
|
|
subjects: [],
|
|
|
- columes: [
|
|
|
- {
|
|
|
- type: "index",
|
|
|
- title: "序号",
|
|
|
- width: 60,
|
|
|
- align: "center"
|
|
|
- },
|
|
|
- {
|
|
|
- title: "科目名称",
|
|
|
- key: "subjectName",
|
|
|
- render: (h, param) => {
|
|
|
- return h("Input", {
|
|
|
- props: {
|
|
|
- value: param.row.subjectName,
|
|
|
- clearable: true
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: "120px"
|
|
|
- },
|
|
|
- on: {
|
|
|
- input: function(value) {
|
|
|
- param.row.subjectName = value;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "科目代码",
|
|
|
- key: "subjectCode",
|
|
|
- render: (h, param) => {
|
|
|
- return h("Input", {
|
|
|
- props: {
|
|
|
- value: param.row.subjectCode,
|
|
|
- clearable: true
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: "120px"
|
|
|
- },
|
|
|
- on: {
|
|
|
- input: function(value) {
|
|
|
- param.row.subjectCode = value;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: "操作",
|
|
|
- key: "action",
|
|
|
- width: 120,
|
|
|
- align: "center",
|
|
|
- render: (h, param) => {
|
|
|
- let actions = [
|
|
|
- {
|
|
|
- name: "保存",
|
|
|
- action: () => {
|
|
|
- this.toSave(param.row);
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- name: "删除",
|
|
|
- type: "error",
|
|
|
- action: () => {
|
|
|
- this.toDelete(param.row);
|
|
|
- }
|
|
|
- }
|
|
|
- ];
|
|
|
- return h("div", this.$tableAction(h, actions));
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
// other param
|
|
|
modalForm: {
|
|
|
- isScanPackage: false,
|
|
|
- isImageEncryption: false,
|
|
|
+ isScanPackage: "0",
|
|
|
+ isImageEncryption: "1",
|
|
|
imageNameRule: "",
|
|
|
paperGrading: ""
|
|
|
}
|
|
@@ -180,9 +145,12 @@ export default {
|
|
|
this.$Message.success("保存成功!");
|
|
|
this.getList();
|
|
|
},
|
|
|
- toDelete(row) {
|
|
|
+ toDelete(index) {
|
|
|
+ console.log(index);
|
|
|
+
|
|
|
+ const row = this.subjects[index];
|
|
|
if (!row.id) {
|
|
|
- // TODO:
|
|
|
+ this.subjects.splice(index, 1);
|
|
|
return;
|
|
|
}
|
|
|
this.$Modal.confirm({
|