|
@@ -39,13 +39,13 @@
|
|
|
<div class="rulesDetailTableData">
|
|
|
<el-table :data="indicatoroptions" border style="width: 100%" @select="rowClick" @select-all="rowClick">
|
|
|
<el-table-column type="selection" label="操作" align="center"></el-table-column>
|
|
|
- <el-table-column label="规则区间" prop="optionName" />
|
|
|
- <el-table-column label="规则公式" prop="optionCode" />
|
|
|
- <el-table-column label="创建者" prop="createBy" />
|
|
|
- <el-table-column label="创建时间" prop="createTime" />
|
|
|
- <el-table-column label="描述">
|
|
|
+ <el-table-column label="规则公式" prop="regularExpression" />
|
|
|
+ <el-table-column label="规则区间" prop="range" />
|
|
|
+ <!-- <el-table-column label="创建者" prop="createBy" />
|
|
|
+ <el-table-column label="创建时间" prop="createTime" /> -->
|
|
|
+ <el-table-column label="规则描述" width="500">
|
|
|
<template #default="scope">
|
|
|
- <span>{{scope.row.des}}</span>
|
|
|
+ <span>{{scope.row.ruleDescription}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -60,122 +60,118 @@
|
|
|
</div>
|
|
|
<div class="onlyDialog">
|
|
|
<el-dialog :title="title" v-model="dialogVisible" width="50vw" :close-on-click-modal="false">
|
|
|
- <el-form :model="itemForm" :rules="rules" ref="itemForm" label-width="50px" :validate-on-rule-change="false">
|
|
|
- <div class="periodFrom">
|
|
|
- <div class="fromLeft">
|
|
|
- <el-tabs type="border-card">
|
|
|
- <el-tab-pane label="指标名称">
|
|
|
- <el-table
|
|
|
- size="mini"
|
|
|
- fit
|
|
|
- :show-header="false"
|
|
|
- :highlight-current-row="true"
|
|
|
- :stripe="false"
|
|
|
- :border="false"
|
|
|
- height="240"
|
|
|
- :data="[]"
|
|
|
- >
|
|
|
- <el-table-column prop="uniformCode" />
|
|
|
- <el-table-column prop="name" />
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="指标项名称">
|
|
|
- <el-table
|
|
|
- size="mini"
|
|
|
- fit
|
|
|
- :show-header="false"
|
|
|
- :highlight-current-row="true"
|
|
|
- :stripe="false"
|
|
|
- :border="false"
|
|
|
- height="240"
|
|
|
- :data="[]"
|
|
|
- >
|
|
|
- <el-table-column prop="uniformCode" />
|
|
|
- <el-table-column prop="name" />
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="函数">
|
|
|
- <el-table
|
|
|
- size="mini"
|
|
|
- fit
|
|
|
- :show-header="false"
|
|
|
- :highlight-current-row="true"
|
|
|
- :stripe="false"
|
|
|
- :border="false"
|
|
|
- :height="270"
|
|
|
- :data="[]"
|
|
|
- >
|
|
|
- <el-table-column min-width="60%">
|
|
|
- <template #default="scope">
|
|
|
- <el-popover trigger="hover" placement="bottom">
|
|
|
- <p>描述:{{ scope.row.describe }}</p>
|
|
|
- <p>参数:{{ scope.row.param }}</p>
|
|
|
- <template #reference>
|
|
|
- <span size="medium" transition="fade-in-linear">{{
|
|
|
- scope.row.lab
|
|
|
- }}</span>
|
|
|
- </template>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column min-width="40%">
|
|
|
- <template #default="scope">
|
|
|
- <el-popover trigger="hover" placement="bottom">
|
|
|
- <p>描述:{{ scope.row.describe }}</p>
|
|
|
- <p>参数:{{ scope.row.param }}</p>
|
|
|
- <template #reference>
|
|
|
- <span size="medium" transition="fade-in-linear">{{
|
|
|
- scope.row.name
|
|
|
- }}</span>
|
|
|
- </template>
|
|
|
- </el-popover>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- </el-tab-pane>
|
|
|
- <el-tab-pane label="运算符">
|
|
|
- <!-- <el-button-group>
|
|
|
- <el-button
|
|
|
- v-for="item in operator"
|
|
|
- :key="item"
|
|
|
- plain
|
|
|
- type="primary"
|
|
|
- @click="elInputSplit(item)"
|
|
|
- style="width: 60px; margin: 7px 12px; height: 40px"
|
|
|
- >
|
|
|
- {{ item }}
|
|
|
- </el-button>
|
|
|
- </el-button-group> -->
|
|
|
- </el-tab-pane>
|
|
|
- </el-tabs>
|
|
|
+ <div class="periodFrom">
|
|
|
+ <div class="fromLeft">
|
|
|
+ <el-tabs type="border-card">
|
|
|
+ <el-tab-pane label="指标项名称">
|
|
|
+ <el-table
|
|
|
+ size="mini"
|
|
|
+ :show-header="false"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ :stripe="false"
|
|
|
+ :border="false"
|
|
|
+ height="240"
|
|
|
+ @row-dblclick="rowDbclick"
|
|
|
+ :data="indicItemoptions"
|
|
|
+ >
|
|
|
+ <el-table-column prop="optionName" />
|
|
|
+ <el-table-column prop="optionCode" />
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="函数">
|
|
|
+ <el-table
|
|
|
+ size="mini"
|
|
|
+ fit
|
|
|
+ :show-header="false"
|
|
|
+ :highlight-current-row="true"
|
|
|
+ :stripe="false"
|
|
|
+ :border="false"
|
|
|
+ height="240"
|
|
|
+ :data="[]"
|
|
|
+ >
|
|
|
+ <el-table-column min-width="60%">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-popover trigger="hover" placement="bottom">
|
|
|
+ <p>描述:{{ scope.row.describe }}</p>
|
|
|
+ <p>参数:{{ scope.row.param }}</p>
|
|
|
+ <template #reference>
|
|
|
+ <span size="medium" transition="fade-in-linear">{{
|
|
|
+ scope.row.lab
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column min-width="40%">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-popover trigger="hover" placement="bottom">
|
|
|
+ <p>描述:{{ scope.row.describe }}</p>
|
|
|
+ <p>参数:{{ scope.row.param }}</p>
|
|
|
+ <template #reference>
|
|
|
+ <span size="medium" transition="fade-in-linear">{{
|
|
|
+ scope.row.name
|
|
|
+ }}</span>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane label="运算符">
|
|
|
+ <!-- <el-button-group>
|
|
|
+ <el-button
|
|
|
+ v-for="item in operator"
|
|
|
+ :key="item"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ @click="elInputSplit(item)"
|
|
|
+ style="width: 60px; margin: 7px 12px; height: 40px"
|
|
|
+ >
|
|
|
+ {{ item }}
|
|
|
+ </el-button>
|
|
|
+ </el-button-group> -->
|
|
|
+ </el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ <div class="fromRight">
|
|
|
+ <div>
|
|
|
+ <div style="display:flex">
|
|
|
+ <el-checkbox style="margin-right: 10px" v-model="isrepresentation" @change="changeRep" />
|
|
|
+ <el-tag style="margin-bottom: 5px">表达式</el-tag>
|
|
|
</div>
|
|
|
- <div class="fromRight">
|
|
|
- <div>
|
|
|
- <p>表达式</p>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- rows="10"
|
|
|
- v-model="itemForm.desc"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <p>表达式</p>
|
|
|
- <el-input
|
|
|
- type="textarea"
|
|
|
- rows="4"
|
|
|
- v-model="itemForm.desc"
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="10"
|
|
|
+ v-model="itemForm.representation"
|
|
|
+ id="representation"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px">
|
|
|
+ <div style="display:flex">
|
|
|
+ <el-checkbox style="margin-right: 10px" v-model="isrange" @change="changeRank" />
|
|
|
+ <el-tag style="margin-bottom: 5px">区间</el-tag>
|
|
|
</div>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="4"
|
|
|
+ v-model="itemForm.range"
|
|
|
+ id="range"
|
|
|
+ />
|
|
|
</div>
|
|
|
- <el-form-item label="描述">
|
|
|
- <el-input v-model="itemForm.desc" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px">
|
|
|
+ <el-tag style="margin-bottom: 5px">描述</el-tag>
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ rows="4"
|
|
|
+ v-model="itemForm.desc"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="saverulesDetailMsg('itemForm')">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="saverulesDetailMsg()">确 定</el-button>
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -187,7 +183,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {apiGetIndicatordictionaryList, apiGetdataDictionaryList, apiGetIndicatordicsaveList, apiGetIndicatordicdeleteList} from '../../api/api'
|
|
|
+import {apiGetintervaltableList, apiGetindicatorselectByCode, apiGetintervalscoringsaveOrUpdate, apiGetintervalscoringRemove} from '../../api/api'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -197,16 +193,13 @@ export default {
|
|
|
indicatoroptions: [],
|
|
|
indicItemoptions: [],
|
|
|
indicItem: '',
|
|
|
- evaluationIndexData:[],
|
|
|
+ isrepresentation: true,
|
|
|
+ isrange: false,
|
|
|
itemForm: {
|
|
|
- optionName: '',
|
|
|
+ representation: '',
|
|
|
+ range: '',
|
|
|
desc: ''
|
|
|
},
|
|
|
- rules: {
|
|
|
- optionName: [
|
|
|
- { required: true, message: '请选择指标名称', trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
page:{
|
|
|
pagesize: 12,
|
|
|
currentPage: 1,
|
|
@@ -224,46 +217,71 @@ export default {
|
|
|
this.indicItemoptions = []
|
|
|
this.rowevalradio = row
|
|
|
this.getrulesDetailData(row)
|
|
|
- this.getindicItemData()
|
|
|
+ this.getindicItemData(row)
|
|
|
},
|
|
|
- // 查询指标项数据
|
|
|
+ // 查询考评得分规则详情列表
|
|
|
getrulesDetailData(row, type) {
|
|
|
let that = this
|
|
|
let params = {
|
|
|
- pageNum: this.page.currentPage,
|
|
|
- pageSize: this.page.pagesize,
|
|
|
- indicatorId: row.id
|
|
|
+ ruleId: row.id
|
|
|
}
|
|
|
if (type) {
|
|
|
params.optionName = that.indicItem
|
|
|
}
|
|
|
- apiGetIndicatordictionaryList(params).then(datas =>{
|
|
|
- if (datas) {
|
|
|
- that.indicatoroptions = datas
|
|
|
+ apiGetintervaltableList(params).then(datas =>{
|
|
|
+ if (datas && datas.data) {
|
|
|
+ that.indicatoroptions = datas.data
|
|
|
that.changeDateSelect = []
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
// 查询指标项条目
|
|
|
- getindicItemData() {
|
|
|
+ getindicItemData(row) {
|
|
|
let that = this
|
|
|
- apiGetdataDictionaryList().then(datas =>{
|
|
|
+ let params = {
|
|
|
+ indicatorCede: row.indicatorId
|
|
|
+ }
|
|
|
+ apiGetindicatorselectByCode(params).then(datas =>{
|
|
|
if (datas && datas.data) {
|
|
|
- that.indicItemoptions = datas.data
|
|
|
+ that.indicItemoptions = datas.data[row.indicatorId]
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 新增区域信息
|
|
|
+ changeRep(val) {
|
|
|
+ this.isrange = !val
|
|
|
+ },
|
|
|
+ changeRank(val) {
|
|
|
+ this.isrepresentation = !val
|
|
|
+ },
|
|
|
+ rowDbclick(row) {
|
|
|
+ let optionCode = row.optionCode
|
|
|
+ let elInput = null
|
|
|
+ if (this.isrepresentation) {
|
|
|
+ elInput = document.getElementById("representation");
|
|
|
+ } else {
|
|
|
+ elInput = document.getElementById("range");
|
|
|
+ }
|
|
|
+ let startPos = elInput.selectionStart;
|
|
|
+ let endPos = elInput.selectionEnd;
|
|
|
+ if (startPos === undefined || endPos === undefined) return;
|
|
|
+ let txt = elInput.value;
|
|
|
+ let txtSplit = optionCode;
|
|
|
+ let result = txt.substring(0, startPos) + txtSplit + txt.substring(endPos);
|
|
|
+ elInput.value = result;
|
|
|
+ elInput.focus();
|
|
|
+ elInput.selectionStart = startPos + txtSplit.length;
|
|
|
+ elInput.selectionEnd = startPos + txtSplit.length;
|
|
|
+ },
|
|
|
handleAdd() {
|
|
|
this.dialogVisible = true
|
|
|
this.isSave = false
|
|
|
this.title = '新增指标项管理'
|
|
|
this.$nextTick(() =>{
|
|
|
this.itemForm = {
|
|
|
- optionName: '',
|
|
|
+ representation: '',
|
|
|
+ range: '',
|
|
|
desc: ''
|
|
|
}
|
|
|
- // this.$refs['itemForm'].resetFields()
|
|
|
})
|
|
|
},
|
|
|
handleEdit() {
|
|
@@ -272,30 +290,29 @@ export default {
|
|
|
this.title = '修改指标项管理'
|
|
|
this.evalradio = this.changeDateSelect[0]
|
|
|
this.itemForm = {
|
|
|
- optionName: this.evalradio.optionCode,
|
|
|
- desc: this.evalradio.des
|
|
|
+ representation: this.evalradio.regularExpression,
|
|
|
+ range: this.evalradio.range,
|
|
|
+ desc: this.evalradio.ruleDescription
|
|
|
}
|
|
|
},
|
|
|
- saverulesDetailMsg(formName) {
|
|
|
+ saverulesDetailMsg() {
|
|
|
let that = this
|
|
|
- that.$refs[formName].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- that.saveAndEditIndicatorData()
|
|
|
- }
|
|
|
- });
|
|
|
+ if (that.itemForm.representation === '' || that.itemForm.range === '' || that.itemForm.desc === '') return
|
|
|
+ that.saveAndEditIndicatorData()
|
|
|
},
|
|
|
//新增/修改指标数据
|
|
|
saveAndEditIndicatorData() {
|
|
|
let that = this
|
|
|
let params = {
|
|
|
- indicatorId: that.rowevalradio.id,
|
|
|
- optionCode: that.itemForm.optionName,
|
|
|
- des: that.itemForm.desc
|
|
|
+ ruleId: that.rowevalradio.id,
|
|
|
+ regularExpression: document.getElementById("representation").value,
|
|
|
+ range: document.getElementById("range").value,
|
|
|
+ ruleDescription: that.itemForm.desc
|
|
|
}
|
|
|
if (that.isSave) {
|
|
|
params.id = this.evalradio.id
|
|
|
}
|
|
|
- apiGetIndicatordicsaveList(params).then(datas =>{
|
|
|
+ apiGetintervalscoringsaveOrUpdate(params).then(datas =>{
|
|
|
if (!that.isSave) {
|
|
|
that.$message({
|
|
|
message: '指标项新增成功',
|
|
@@ -323,7 +340,7 @@ export default {
|
|
|
that.changeDateSelect.forEach(it =>{
|
|
|
paramsArr.push(it.id)
|
|
|
})
|
|
|
- apiGetIndicatordicdeleteList(paramsArr.join(',')).then(datas =>{
|
|
|
+ apiGetintervalscoringRemove(paramsArr.join(',')).then(datas =>{
|
|
|
that.$message({
|
|
|
type: 'success',
|
|
|
message: '删除成功!'
|
|
@@ -373,7 +390,7 @@ export default {
|
|
|
padding: 10px 20px;
|
|
|
.el-table{
|
|
|
.el-table__body-wrapper{
|
|
|
- height: 55vh !important;
|
|
|
+ max-height: 55vh !important;
|
|
|
}
|
|
|
.el-input__inner{
|
|
|
height: 30px !important;
|
|
@@ -398,11 +415,14 @@ export default {
|
|
|
.periodFrom{
|
|
|
display: flex;
|
|
|
.fromLeft{
|
|
|
- width: 65%;
|
|
|
+ width: 55%;
|
|
|
margin-right: 20px;
|
|
|
+ .el-tabs{
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
.fromRight{
|
|
|
- width: 33%;
|
|
|
+ width: 43%;
|
|
|
}
|
|
|
}
|
|
|
}
|