|
@@ -101,12 +101,24 @@
|
|
|
<FormItem label="填报信息">
|
|
|
<CheckboxGroup v-model="activityData.infoArr">
|
|
|
<Checkbox v-for="(item, index) in infoArr" :key="index" :label="item.value">{{ item.label }}</Checkbox>
|
|
|
+ <Icon type="md-add-circle" @click="addInfoType = true" v-show="!addInfoType" size="18" />
|
|
|
+ <div v-show="addInfoType">
|
|
|
+ <Input v-model="addInfo" placeholder="自定义填报的信息" style="width: 300px"></Input>
|
|
|
+ <Icon type="md-checkmark-circle" size="18" style="margin: 0 10px;" @click="addInform()" />
|
|
|
+ <Icon type="md-close-circle" size="18" @click="addInfoType = false" />
|
|
|
+ </div>
|
|
|
</CheckboxGroup>
|
|
|
</FormItem>
|
|
|
<FormItem label="报名方式">
|
|
|
<RadioGroup v-model="activityData.applicationType">
|
|
|
<Radio :label="1">{{ '报名制' }}</Radio>
|
|
|
<Radio :label="2">{{ '邀请制' }}</Radio>
|
|
|
+ <Select v-model="schoolChange" multiple filterable v-show="activityData.applicationType === 2 && isArea === 'area'" style="width: 500px" placeholder="选择参加活动的学校">
|
|
|
+ <Option v-for="format in schoolList" :value="format.code" :key="format.code">{{ format.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ <Select v-model="schoolChange" multiple filterable v-show="activityData.applicationType === 2 && isArea === 'school'" style="width: 500px" placeholder="选择参加活动的学校">
|
|
|
+ <Option v-for="format in teacherList" :value="format.code" :key="format.code">{{ format.name }}</Option>
|
|
|
+ </Select>
|
|
|
</RadioGroup>
|
|
|
</FormItem>
|
|
|
<!-- 邀请制且团队赛,按照教研组分组,组长为教研组组长 -->
|
|
@@ -182,13 +194,14 @@
|
|
|
<DatePicker :editable="false" @on-change="getReviewTime" type="datetimerange" format="yyyy-MM-dd HH:mm" :placeholder="$t('train.create.timeHolder')" style="width: 500px"></DatePicker>
|
|
|
</FormItem>
|
|
|
<FormItem label="评审规则">
|
|
|
- <Select v-model="activityData.review" style="width:200px">
|
|
|
+ <Select v-model="activityData.review" transfer style="width:200px">
|
|
|
<Option v-for="item in reviewList" :value="item.value" :key="item.value">
|
|
|
{{ item.label }}
|
|
|
- <span @click="ruleDrawer = true">预览</span>
|
|
|
+ <span @click.stop="ruleDrawer = true">预览</span>
|
|
|
+ <span @click.stop="reviewEditRule()">编辑</span>
|
|
|
</Option>
|
|
|
</Select>
|
|
|
- <Icon size="20" type="md-add-circle" @click="ruleDrawerAdd = true" />
|
|
|
+ <Icon size="20" type="md-add-circle" @click="drawerRule()" />
|
|
|
</FormItem>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -242,7 +255,7 @@
|
|
|
<Table row-key="id" :columns="ruleColumns" :data="ruleInfo.children"></Table>
|
|
|
</div>
|
|
|
</Drawer>
|
|
|
- <Drawer title="添加评审规则" :width="50" :closable="false" v-model="ruleDrawerAdd">
|
|
|
+ <Drawer title="添加评审规则" :width="50" :closable="false" v-model="ruleDrawerAdd" class="light-iview-form">
|
|
|
<Form :model="processInfo" :label-width="80" class="create-form">
|
|
|
<FormItem label="规则名称">
|
|
|
<Input v-model="processInfo.name" placeholder="请输入规则名称"></Input>
|
|
@@ -250,23 +263,33 @@
|
|
|
<FormItem label="规则描述">
|
|
|
<Input v-model="processInfo.describe" placeholder="请输入规则描述"></Input>
|
|
|
</FormItem>
|
|
|
- <FormItem label="规则分值">
|
|
|
+ <!-- <FormItem label="规则分值">
|
|
|
<Input v-model="processInfo.score" placeholder="请输入分值"></Input>
|
|
|
- </FormItem>
|
|
|
+ </FormItem> -->
|
|
|
<div class="rule-header">
|
|
|
<span>分项</span>
|
|
|
<span>描述</span>
|
|
|
<span>分值</span>
|
|
|
<span>操作</span>
|
|
|
</div>
|
|
|
- <Tree :data="ruleTree"></Tree>
|
|
|
+ <el-tree :data="processInfo.rule" node-key="id" default-expand-all :expand-on-click-node="false">
|
|
|
+ <div class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ <Input v-model="data.name" placeholder="分项名称" style="width: 200px;"></Input>
|
|
|
+ <Input v-model="data.describe" placeholder="对分项内容进行描述"></Input>
|
|
|
+ <InputNumber v-model="data.score" :min="1" style="width: 100px;" :disabled="(data.children && data.children.length) ? true : false" @on-change="scoreChange(node, data)" />
|
|
|
+ <span>
|
|
|
+ <Button size="small" style="margin-right: 10px;" :disabled="data.isThree" @click="append(node, data)">添加子项</Button>
|
|
|
+ <Button size="small" type='error' @click="remove(node, data)">删除</Button>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </el-tree>
|
|
|
</Form>
|
|
|
- <div style="margin: 10px 0; text-align: right;">
|
|
|
- <!-- <span>总分:0</span> -->
|
|
|
- <Button @click="addRule">添加分项</Button>
|
|
|
+ <div style="margin: 10px 0; display: flex; justify-content: space-between; align-items: center;">
|
|
|
+ <span style="font-size: 20px;">总分:{{ processInfo.score }}</span>
|
|
|
+ <Button @click="addRule()">添加分项</Button>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <Button @click="save">仅本次活动使用</Button>
|
|
|
+ <Button @click="save()">仅本次活动使用</Button>
|
|
|
<Button>保存为模板</Button>
|
|
|
</div>
|
|
|
</Drawer>
|
|
@@ -588,12 +611,13 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
title: '描述',
|
|
|
- key: 'describe'
|
|
|
+ key: 'describe',
|
|
|
},
|
|
|
{
|
|
|
title: '分值',
|
|
|
key: 'score',
|
|
|
width: 100,
|
|
|
+ align: 'center',
|
|
|
},
|
|
|
],
|
|
|
ruleInfo: {
|
|
@@ -644,334 +668,94 @@ export default {
|
|
|
name: '教学过程',
|
|
|
describe: '',
|
|
|
score: 5,
|
|
|
+ parentId: '106',
|
|
|
},
|
|
|
{
|
|
|
id: '10601',
|
|
|
name: '教学设计',
|
|
|
describe: '',
|
|
|
score: 5,
|
|
|
+ parentId: '106',
|
|
|
},
|
|
|
{
|
|
|
id: '10602',
|
|
|
name: '融合创新',
|
|
|
describe: '',
|
|
|
score: 5,
|
|
|
+ parentId: '106',
|
|
|
},
|
|
|
{
|
|
|
id: '10603',
|
|
|
name: '技术应用',
|
|
|
describe: '',
|
|
|
score: 5,
|
|
|
+ parentId: '106',
|
|
|
},
|
|
|
{
|
|
|
id: '10604',
|
|
|
name: '教学效果',
|
|
|
describe: '',
|
|
|
score: 5,
|
|
|
+ parentId: '106',
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
- processInfo: {
|
|
|
- rule: [
|
|
|
- {
|
|
|
+ processInfo: {},
|
|
|
+ timer: null,
|
|
|
+ treeType: '',
|
|
|
+ editRule: false,
|
|
|
+ dataRuleMould: [{
|
|
|
+ id: 1,
|
|
|
+ name: '',
|
|
|
+ describe: '',
|
|
|
+ score: null,
|
|
|
+ children: [{
|
|
|
+ id: 2,
|
|
|
+ name: '',
|
|
|
+ describe: '',
|
|
|
+ score: null,
|
|
|
+ children: [{
|
|
|
+ id: 3,
|
|
|
name: '',
|
|
|
describe: '',
|
|
|
score: null,
|
|
|
- nodeKey: 0,
|
|
|
- children: [
|
|
|
- {
|
|
|
- name: '',
|
|
|
- describe: '',
|
|
|
- score: null,
|
|
|
- nodeKey: 1,
|
|
|
- children: [
|
|
|
- {
|
|
|
- name: '',
|
|
|
- describe: '',
|
|
|
- score: null,
|
|
|
- }
|
|
|
- ],
|
|
|
- }
|
|
|
- ],
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- ruleTree: [
|
|
|
+ isThree: true,
|
|
|
+ }]
|
|
|
+ }]
|
|
|
+ }],
|
|
|
+ addInfoType: false,
|
|
|
+ addInfo: '',
|
|
|
+ schoolList: [
|
|
|
{
|
|
|
- title: '1',
|
|
|
- expand: true,
|
|
|
- name: '',
|
|
|
- describe: '',
|
|
|
- score: null,
|
|
|
- render: (h, { root, node, data }) => {
|
|
|
- return h('div', [
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.name,
|
|
|
- placeholder: '一级分项',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '20%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'name')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.describe,
|
|
|
- placeholder: '对分项内容进行描述',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '65%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'describe')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.score,
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'score')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('span', [
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- // type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- that.append(data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '插入'),
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- /* style: {
|
|
|
- width: '13%',
|
|
|
- }, */
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- that.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ])
|
|
|
- ], data.title)
|
|
|
- },
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '101',
|
|
|
- expand: true,
|
|
|
- name: '',
|
|
|
- describe: '',
|
|
|
- score: null,
|
|
|
- render: (h, { root, node, data }) => {
|
|
|
- return h('div', [
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.name,
|
|
|
- placeholder: '二级分项',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '20%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'name')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.describe,
|
|
|
- placeholder: '对分项内容进行描述',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '62.9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'describe')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.score,
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'score')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('span', [
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- // type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- that.append(data, true)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '插入'),
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- /* style: {
|
|
|
- width: '13%',
|
|
|
- }, */
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- that.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ])
|
|
|
- ])
|
|
|
- },
|
|
|
- children: [
|
|
|
- {
|
|
|
- title: '101',
|
|
|
- expand: true,
|
|
|
- name: '',
|
|
|
- describe: '',
|
|
|
- score: null,
|
|
|
- render: (h, { root, node, data }) => {
|
|
|
- return h('div', [
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.name,
|
|
|
- placeholder: '三级分项',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '20%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'name')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.describe,
|
|
|
- placeholder: '对分项内容进行描述',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '61.3%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'describe')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.score,
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- that.inputChange(data, value, 'score')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginLeft: '50px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- that.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ])
|
|
|
- },
|
|
|
- }
|
|
|
- ],
|
|
|
- }
|
|
|
- ],
|
|
|
+ code: '111',
|
|
|
+ name: '醍摩豆学校'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '222',
|
|
|
+ name: '研发学校'
|
|
|
},
|
|
|
],
|
|
|
- timer: null,
|
|
|
- treeType: '',
|
|
|
+ teacherList: [
|
|
|
+ {
|
|
|
+ code: '111',
|
|
|
+ name: '教研组1'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ code: '222',
|
|
|
+ name: '教研组2'
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ schoolChange: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.processInfo = {
|
|
|
+ name: '',
|
|
|
+ describe: '',
|
|
|
+ score: 0,
|
|
|
+ rule: this.dataRuleMould
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -1094,245 +878,83 @@ export default {
|
|
|
this.createData.file.splice(index, 1)
|
|
|
},
|
|
|
addRule() {
|
|
|
- this.ruleTree.push({
|
|
|
- title: this.ruleTree.length,
|
|
|
- expand: true,
|
|
|
+ this.processInfo.rule.push({
|
|
|
+ id: Math.random() * 1000000,
|
|
|
name: '',
|
|
|
describe: '',
|
|
|
score: null,
|
|
|
- render: (h, { root, node, data }) => {
|
|
|
- return h('div', [
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.name,
|
|
|
- placeholder: '一级分项',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '20%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'name')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.describe,
|
|
|
- placeholder: '对分项内容进行描述',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '65%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'describe')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.score,
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'score')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('span', [
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- // type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- this.append(data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '插入'),
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- /* style: {
|
|
|
- width: '13%',
|
|
|
- }, */
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- this.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ])
|
|
|
- ])
|
|
|
- },
|
|
|
})
|
|
|
- this.$forceUpdate()
|
|
|
},
|
|
|
- append(data, isThree) {
|
|
|
+ append(node, data) {
|
|
|
+ console.log(node.parent.parent);
|
|
|
const children = data.children || [];
|
|
|
children.push({
|
|
|
- title: '101',
|
|
|
- expand: true,
|
|
|
+ id: Math.random() * 1000000,
|
|
|
name: '',
|
|
|
describe: '',
|
|
|
score: null,
|
|
|
- render: (h, { root, node, data }) => {
|
|
|
- return h('div', [
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.name,
|
|
|
- placeholder: isThree ? '三级分项' : '二级分项',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '20%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'name')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.describe,
|
|
|
- placeholder: '对分项内容进行描述',
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: isThree ? '61.3%' : '62.9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'describe')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('Input', {
|
|
|
- props: {
|
|
|
- value: data.score,
|
|
|
- },
|
|
|
- style: {
|
|
|
- width: '9%',
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- 'on-change': value => {
|
|
|
- console.log(data, value);
|
|
|
- if(value.data !== null) {
|
|
|
- this.inputChange(data, value, 'score')
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- }),
|
|
|
- h('span', {
|
|
|
- style: {
|
|
|
- display: isThree ? 'none' : 'inline-block'
|
|
|
- },
|
|
|
- }, [
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- // type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginRight: '10px',
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- this.append(data, true)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '插入'),
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- /* style: {
|
|
|
- width: '13%',
|
|
|
- }, */
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- this.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ]),
|
|
|
-
|
|
|
- h('Button', {
|
|
|
- props: {
|
|
|
- type: 'error',
|
|
|
- size: 'small',
|
|
|
- },
|
|
|
- style: {
|
|
|
- marginLeft: '50px',
|
|
|
- display: isThree ? 'inline-block' : 'none'
|
|
|
- },
|
|
|
- on: {
|
|
|
- click:() => {
|
|
|
- this.remove(root, node, data)
|
|
|
- }
|
|
|
- },
|
|
|
- }, '删除'),
|
|
|
- ])
|
|
|
- },
|
|
|
- });
|
|
|
+ isThree: node.parent.parent ? true : false
|
|
|
+ })
|
|
|
this.$set(data, 'children', children)
|
|
|
},
|
|
|
- remove(root, node, data) {
|
|
|
- console.log(root, node, data);
|
|
|
- const parentKey = root.find(el => el === node).parent;
|
|
|
- console.log(parentKey);
|
|
|
- if(parentKey === undefined) {
|
|
|
- // this.ruleTree = this.ruleTree.filter(i => i.nodeKey !== data.nodeKey)
|
|
|
- let index = this.ruleTree.findIndex(i => i.nodeKey === data.nodeKey)
|
|
|
- this.$delete(this.ruleTree,index)
|
|
|
- console.log(JSON.stringify(this.ruleTree))
|
|
|
- } else {
|
|
|
- const parent = root.find(el => el.nodeKey === parentKey).node;
|
|
|
- console.log(parent);
|
|
|
- const index = parent.children.indexOf(data);
|
|
|
- console.log(index);
|
|
|
- parent.children.splice(index, 1);
|
|
|
- console.log(parent);
|
|
|
- }
|
|
|
+ remove(node, data) {
|
|
|
+ const parent = node.parent;
|
|
|
+ const children = parent.data.children || parent.data;
|
|
|
+ const index = children.findIndex(d => d.id === data.id);
|
|
|
+ children.splice(index, 1);
|
|
|
},
|
|
|
save() {
|
|
|
- console.log(this.ruleTree);
|
|
|
- console.log(JSON.stringify(this.ruleTree))
|
|
|
+ console.log(this.processInfo);
|
|
|
+ console.log(JSON.stringify(this.processInfo))
|
|
|
},
|
|
|
- inputChange(data, value, type) {
|
|
|
- console.log(data, value.target._value, value.data);
|
|
|
- data[type] = (value.target._value === null ? '' : value.target._value) + (value.data === null ? '' : value.data)
|
|
|
+ reviewEditRule() {
|
|
|
+ this.processInfo = {
|
|
|
+ name: this.ruleInfo.name,
|
|
|
+ describe: this.ruleInfo.describe,
|
|
|
+ score: this.ruleInfo.score,
|
|
|
+ rule: this.ruleInfo.children
|
|
|
+ }
|
|
|
+ this.ruleDrawerAdd = true
|
|
|
+ },
|
|
|
+ drawerRule() {
|
|
|
+ this.processInfo = {
|
|
|
+ name: '',
|
|
|
+ describe: '',
|
|
|
+ score: 0,
|
|
|
+ rule: this.dataRuleMould
|
|
|
+ }
|
|
|
+ this.ruleDrawerAdd = true
|
|
|
+ },
|
|
|
+ addInform() {
|
|
|
+ this.infoArr.push({
|
|
|
+ value: this.addInfo,
|
|
|
+ label: this.addInfo,
|
|
|
+ })
|
|
|
+ this.addInfoType = false
|
|
|
+ this.addInfo = ''
|
|
|
+ },
|
|
|
+ scoreChange(node, data) {
|
|
|
+ // console.log(node, data);
|
|
|
+ this.setParentScore(node)
|
|
|
+ },
|
|
|
+ setParentScore(node) {
|
|
|
+ const parent = node.parent
|
|
|
+ if(!Array.isArray(parent.data)) {
|
|
|
+ let score = 0
|
|
|
+ parent.childNodes.forEach(item => {
|
|
|
+ score += item.data.score
|
|
|
+ })
|
|
|
+ parent.data.score = score
|
|
|
+ } else {
|
|
|
+ let proScore = 0
|
|
|
+ this.processInfo.score = parent.data.forEach(item => {
|
|
|
+ proScore += item.score
|
|
|
+ })
|
|
|
+ this.processInfo.score = proScore
|
|
|
+ }
|
|
|
+ if(parent.parent) {
|
|
|
+ this.setParentScore(parent)
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
}
|
|
@@ -1388,6 +1010,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="less">
|
|
@@ -1420,4 +1043,30 @@ export default {
|
|
|
padding-left: 10px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.rule-box {
|
|
|
+ .edit-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+
|
|
|
+ &>span {
|
|
|
+ width: 100px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.el-tree-node__content {
|
|
|
+ height: 40px;
|
|
|
+}
|
|
|
+.custom-tree-node {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ width: 100%;
|
|
|
+ .ivu-input-wrapper,
|
|
|
+ .ivu-input-number {
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|