Explorar o código

考评得分规则详情页面,新增时增加函数,运算符项;增加月/季度考评一级页;

SunZehao %!s(int64=2) %!d(string=hai) anos
pai
achega
b0a4ccfcc5

+ 259 - 0
src/components/assessment/monthQuarterPage.vue

@@ -0,0 +1,259 @@
+<template>
+    <div class="monthQuarter">
+        <div class="monthQuarterBtn">
+            <p class="titleSty">月/季度考评</p>
+            <div class="collectSeach">
+                <div class="exceed">
+                    <span class="exceedSpan">业务编号:</span>
+                    <el-input v-model="usernames" placeholder="请输入业务编号"></el-input>
+                </div>
+                <div class="exceed">
+                    <span class="exceedSpan">流程状态:</span>
+                    <el-input v-model="usernames" placeholder="请输入流程状态"></el-input>
+                </div>
+                <el-button type="primary" style="margin-left: 10px;" @click="getSeachData">搜索</el-button>
+                <el-button style="margin-left: 10px;" @click="reset">重置</el-button>
+            </div>
+            <div style="display:flex;justify-content: space-between;padding: 10px;">
+                <el-row :gutter="10" class="PeriodBtn">
+                    <el-col :span="1.5">
+                        <el-col :span="1.5">
+                            <el-button
+                            type="primary"
+                            plain
+                            icon="Plus"
+                            size="mini"
+                            @click="handleAdd"
+                            >新增</el-button>
+                        </el-col>
+                        <el-button
+                        type="danger"
+                        plain
+                        icon="Delete"
+                        size="mini"
+                        :disabled="deleteSelect.length === 0"
+                        @click="handleDelete"
+                        >批量删除</el-button>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-button
+                            type="warning"
+                            plain
+                            icon="Download"
+                            size="mini"
+                            @click="handleExport"
+                        >导出</el-button>
+                    </el-col>
+                </el-row>
+            </div>
+            <div class="monthQuarterTableData">
+                <el-table :data="monthQuarterData" border style="width: 100%" @select="rowClick" @select-all="allSelect">
+                    <el-table-column type="selection" label="操作" align="center"></el-table-column>
+                    <el-table-column label="业务编号" prop="create_time" />
+                    <el-table-column label="考评单位" prop="create_by" />
+                    <el-table-column label="业务类别" prop="indicator_id" />
+                    <el-table-column label="考评纬度" prop="total_score" />
+                    <el-table-column label="流程状态" prop="desc" />
+                    <el-table-column label="业务简述" prop="update_time" />
+                    <el-table-column label="填报日期" prop="update_by" />
+                    <el-table-column label="考评总分" prop="evaluate_formula" />
+                    <el-table-column label="考评排名" prop="evaluate_method" />
+                    <el-table-column label="操作">
+                        <template #default="scope">
+                            <p class="indicitem" @click="editRuleDetail(scope.row)">详情</p>
+                        </template>
+                    </el-table-column>
+                </el-table>
+                <el-pagination
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                    :current-page="page.currentPage"
+                    :page-size="page.pagesize"
+                    layout="total, prev, pager, next, jumper"
+                    :total="page.total">
+                </el-pagination>
+            </div>
+            <el-dialog :title="title" v-model="dialogVisible" width="1400px" :close-on-click-modal="false">
+                <!-- <start-from-list></start-from-list> -->
+                <template #footer>
+                    <span class="dialog-footer">
+                        <el-button type="primary" plain>发 布</el-button>
+                        <el-button type="warning" plain>保 存</el-button>
+                        <el-button >流 程</el-button>
+                        <el-button type="success" plain>导 出</el-button>
+                    </span>
+                </template>
+            </el-dialog>
+        </div>
+    </div>
+</template>
+
+<script>
+// import startFromList from './monthQuarterFrom.vue'
+import {apiGetgetStandardPointManagementList, apiGetdeleteStandardPointManagement} from '../../api/api'
+export default {
+    components: {
+        // startFromList
+    },
+    data() {
+        return {
+            dialogVisible: false,
+            title: '',
+
+            windframradio: {},
+            deleteSelect: [],
+            changeDateSelect: [],
+            monthQuarterData:[],
+            page:{
+                pagesize: 12,
+                currentPage: 1,
+                total: 0
+            }
+        }
+    },
+    mounted() {
+
+    },
+    methods:{
+        getSeachData() {
+            this.page.currentPage = 1
+        },
+        handleSizeChange(val){
+            this.page.pagesize = val
+        },
+        handleCurrentChange(val){
+            this.page.currentPage =val
+        },
+        rowClick(selection, row) {
+            this.windframradio = {}
+            this.deleteSelect = []
+            this.changeDateSelect = []
+            if (selection.length === 1) { 
+                this.windframradio = selection[0]
+            }
+            if (selection.length > 0) {
+                selection.forEach(item =>{
+                    this.deleteSelect.push(item.itemNo)
+                    this.changeDateSelect.push(item.itemNo)
+                })
+            }
+        },
+        allSelect(selection) {
+            this.deleteSelect = []
+            this.changeDateSelect = []
+            if (selection.length > 0) {
+                selection.forEach(item =>{
+                    this.deleteSelect.push(item.itemNo)
+                    this.changeDateSelect.push(item.itemNo)
+                })
+            }
+        },
+        handleAdd() {
+            this.dialogVisible = true
+            this.title = '新建表单填报'
+        },
+    }
+}
+</script>
+
+<style lang="less">
+.monthQuarter{
+  .monthQuarterBtn{
+    //   background: #fff;
+      padding: 10px 20px 0 20px;
+      .collectSeach{
+          display: flex;
+          margin: 20px 20px 10px;
+            .exceed{
+                display: flex;
+                margin-right: 10px;
+                .exceedSpan{
+                    margin-top: 3px;
+                    display: inline-block;
+                    width: 100px;
+                }
+                .el-input{
+                    margin-right:10px;
+                    height: 30px;
+                    .el-input__inner{
+                        height:30px;
+                    }
+                    .el-input__suffix{
+                        .el-select__caret{
+                            line-height:30px;
+                        }
+                    }
+                }
+            }
+            .el-select{
+                margin-right:10px;
+                .el-input__inner{
+                    height:30px;
+                }
+                .el-input__suffix{
+                    .el-select__caret{
+                        line-height:30px;
+                    }
+                }
+            }
+      }
+      .titleSty{
+          border-left: 4px solid #007aab;
+          padding-left: 5px;
+          font-size: 16px;
+          font-weight: bold;
+          font-family: '微软雅黑';
+          margin-left:20px;
+      }
+      span{
+          font-size:14px;
+      }
+      .PeriodBtn{
+          padding-left: 10px;
+      }
+      .el-button{
+          height: 30px;
+          // width:100px;
+          padding: 0 20px ;
+          // padding-top: 8px;
+          span{
+              margin:0;
+          }
+      }
+  }
+  .monthQuarterTableData{
+    padding: 10px 20px;
+    .el-table{
+        .el-table__body-wrapper{
+            .el-table__empty-block{
+            height: 64vh !important;
+            }
+        }
+        .el-input__inner{
+            height: 30px !important;
+        }
+        .el-radio__label{
+            display: none;
+        }
+    }
+    .el-pagination{
+        margin-top: 20px;
+        text-align: end;
+        position: relative;
+    }
+    }
+    .el-overlay{
+        .el-dialog{
+            margin-top: 10vh;
+            .el-dialog__body{
+                padding: 0px 60px 20px 20px !important;
+            }
+            .el-dialog__footer{
+                .dialog-footer{
+                    text-align: center;
+                }
+            }
+        }
+    }
+}
+</style>

+ 266 - 31
src/components/knowledgePage/scoringRulesDetailPage.vue

@@ -87,49 +87,50 @@
                                                 :stripe="false"
                                                 :border="false"
                                                 height="240"
-                                                :data="[]"
+                                                @row-dblclick="tabFuncRowClickHandle"
+                                                :data="funcMsg"
                                             >
-                                                <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>
+                                                <el-table-column min-width="50%">
+                                                    <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-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>
+                                                <el-table-column min-width="50%">
+                                                    <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-popover>
-                                                </template>
                                                 </el-table-column>
                                             </el-table>
                                         </el-tab-pane>
                                         <el-tab-pane label="运算符">
-                                            <!-- <el-button-group>
+                                            <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"
+                                                @click="scorRuleSplit(item)"
+                                                style="width: 60px; margin: 7px 12px; height: 40px; border: 1px solid #409EFF;"
                                                 >
                                                 {{ item }}
                                                 </el-button>
-                                            </el-button-group> -->
+                                            </el-button-group>
                                         </el-tab-pane>
                                     </el-tabs>
                                 </div>
@@ -137,7 +138,7 @@
                                     <div>
                                         <div style="display:flex">
                                             <el-checkbox style="margin-right: 10px" v-model="isrepresentation" @change="changeRep" />
-                                            <el-tag style="margin-bottom: 5px">表达式</el-tag>
+                                            <el-tag style="margin-bottom: 5px">式</el-tag>
                                         </div>
                                         <el-input
                                         type="textarea"
@@ -195,6 +196,8 @@ export default {
             indicItem: '',
             isrepresentation: true,
             isrange: false,
+            funcMsg: [],
+            operator: [],
             itemForm: {
                 representation: '',
                 range: '',
@@ -210,6 +213,204 @@ export default {
             dialogVisible: false
         }
     },
+    created() {
+        this.funcMsg = [
+            {
+                lab: "MR",
+                name: "移动极差",
+                param: "测点名,时间(秒)",
+                describe: "是指两个或多个连续样本值中最大值与最小值之差",
+                scene: "测点的移动极差超限报警",
+            },
+            {
+                lab: "MAR",
+                name: "均值极差",
+                param: "测点名,时间(秒)",
+                describe: "",
+                scene: "测点的均值极差计算",
+            },
+            {
+                lab: "RiseExceed",
+                name: "上升趋势",
+                param: "测点名,时间(秒),阈值",
+                describe: "取测点在给定的时间范围内数据上升的量是否超过阈值",
+                scene: "测点值的上升速度过快等",
+            },
+            {
+                lab: "Sustain",
+                name: "持续时间",
+                param: "表达式,时间(秒)",
+                describe:
+                "判定状态(表达式成立)持续的时间是否超过给定的时间判断状态持续的时间",
+                scene: "",
+            },
+            {
+                lab: "LastUpdateTime",
+                name: "最近数据时间",
+                param: "测点名",
+                describe: "",
+                scene: "判定离线,状态持续时间等",
+            },
+            {
+                lab: "abs",
+                name: "取绝对值",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "acos",
+                name: "反余弦",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "asin",
+                name: "反正弦",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "atan",
+                name: "反正切",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "atan2",
+                name: "xy坐标转为极坐标",
+                param: "x,y",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "ceiling",
+                name: "向上取整",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "cos",
+                name: "余弦",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "cosh",
+                name: "双曲线余弦",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "exp",
+                name: "欧拉数 e 的 double 次幂的值",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "floor",
+                name: "向下取整",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "log",
+                name: "自然对数",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "log10",
+                name: "底数为 10 的对数",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "max",
+                name: "比较最大值",
+                param: "double a, double b",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "min",
+                name: "比较最小值",
+                param: "double a, double b",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "pow",
+                name: "返回第一个参数的第二个参数次幂的值",
+                param: "double a, double b",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "round",
+                name: "返回最接近参数的 long,或int",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "sign",
+                name: "负数返回-1.0,整数返回1.0,0返回0.0",
+                param: "float f/double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "sin",
+                name: "三角正弦值",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "sinh",
+                name: "双曲线正弦",
+                param: "double x",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "sqrt",
+                name: "正平方根",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "tan",
+                name: "正切",
+                param: "double a",
+                describe: "",
+                scene: "",
+            },
+            {
+                lab: "tanh",
+                name: "双曲线正切",
+                param: "double x",
+                describe: "",
+                scene: "",
+            },
+            { lab: "PI", name: "圆周率", param: "", describe: "", scene: "" },
+            { lab: "E", name: "自然对数", param: "", describe: "", scene: "" },
+        ]
+        this.operator = ["+", "-", "*", "/", "(", ")", ">", ">=", "<", "<=", "==", "!=",
+            "&&", "||", "!", "%", "true", "false", ".", ]
+    },
     methods: {
         init(row) {
             this.editEvaluaVisible = true
@@ -253,8 +454,40 @@ export default {
         changeRank(val) {
             this.isrepresentation = !val
         },
+        tabFuncRowClickHandle(row) {
+            let elInput = null
+            if (this.isrepresentation) {
+                elInput = document.getElementById("representation");
+            } else {
+                elInput = document.getElementById("range");
+            }
+            let startPos = elInput.selectionStart; //第0个字符到选中的字符
+            let endPos = elInput.selectionEnd; //选中字符到末尾字符
+            if (startPos === undefined || endPos === undefined) return;
+            let txt = elInput.value;
+            let func;
+            if (
+                row.lab === "MR" ||
+                row.lab === "MAR" ||
+                row.lab === "RiseExceed" ||
+                row.lab === "Sustain" ||
+                row.lab === "LastUpdateTime"
+            ) {
+                func = row.lab + "()";
+            } else if (row.lab === "PI" || row.lab === "E") {
+                func = "Math." + row.lab;
+            } else {
+                func = "Math." + row.lab + "()";
+            }
+            // 将插值添加到选中光标位置
+            let result = txt.substring(0, startPos) + func + txt.substring(endPos);
+            elInput.value = result;
+            elInput.focus();
+        },
         rowDbclick(row) {
-            let optionCode = row.optionCode
+            this.scorRuleSplit(row.optionCode);
+        },
+        scorRuleSplit(val) {
             let elInput = null
             if (this.isrepresentation) {
                 elInput = document.getElementById("representation");
@@ -265,7 +498,7 @@ export default {
             let endPos = elInput.selectionEnd;
             if (startPos === undefined || endPos === undefined) return;
             let txt = elInput.value;
-            let txtSplit = optionCode;
+            let txtSplit = val;
             let result = txt.substring(0, startPos) + txtSplit + txt.substring(endPos);
             elInput.value = result;
             elInput.focus();
@@ -297,7 +530,9 @@ export default {
         },
         saverulesDetailMsg() {
             let that = this
-            if (that.itemForm.representation === '' || that.itemForm.range === '' || that.itemForm.desc === '') return
+            let repre = document.getElementById("representation").value
+            let range = document.getElementById("range").value
+            if (repre === '' || range === '' || that.itemForm.desc === '') return
             that.saveAndEditIndicatorData()
         },
         //新增/修改指标数据

+ 10 - 0
src/components/knowledgePage/scoringRulesPage.vue

@@ -96,7 +96,11 @@
             <el-dialog :title="title" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
                 <div class="periodFrom">
                     <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
+                        <!-- <el-form-item label="规则名称" prop="ruleName">
+                            <el-input v-model="ruleForm.ruleName" placeholder="请输入规则名称"></el-input>
+                        </el-form-item> -->
                         <el-form-item label="指标名称" prop="indicatorId">
+                             <!-- multiple collapse-tags -->
                             <el-select v-model="ruleForm.indicatorId" placeholder="请选择指标名称" :disabled="isSave">
                                 <el-option
                                 v-for="item in indicItemoptions"
@@ -141,10 +145,14 @@ export default {
             changeDateSelect: [],
             isSave: false,
             ruleForm: {
+                // ruleName: '',
                 indicatorId: '',
                 desc: ''
             },
             rules: {
+                // ruleName: [
+                //     { required: true, message: '请输入规则名称', trigger: 'blur' }
+                // ],
                 indicatorId: [
                     { required: true, message: '请选择指标名称', trigger: 'change' }
                 ],
@@ -198,6 +206,7 @@ export default {
             this.title = '新增考评得分规则'
             this.$nextTick(() =>{
                 this.ruleForm = {
+                    // ruleName: '',
                     indicatorId: '',
                     desc: ''
                 }
@@ -209,6 +218,7 @@ export default {
             this.title = '修改考评得分规则'
             let evalradio = this.changeDateSelect[0]
             this.ruleForm = {
+                // ruleName: '',
                 indicatorId: evalradio.indicatorId,
                 desc: evalradio.describe
             }

+ 11 - 0
src/router/index.js

@@ -51,6 +51,17 @@ const routes = [
                                 '../components/assessment/evaluationStartPage.vue'
                             ),
                     },
+                    {
+                        path: '/assessment/monthQuarter',
+                        name: 'monthQuarter',
+                        meta: {
+                            title: '月/季度考评',
+                        },
+                        component: () =>
+                            import(
+                                '../components/assessment/monthQuarterPage.vue'
+                            ),
+                    },
                 ]
             },
             {

+ 2 - 1
src/views/homePage.vue

@@ -160,7 +160,8 @@ export default {
                     },
                     {
                         id: '2-5',
-                        label: '月/季度考评'
+                        label: '月/季度考评',
+                        path: '/assessment/monthQuarter'
                     },
                     {
                         id: '2-6',