| | |
| | | |
| | | <!-- 对话框 --> |
| | | <el-dialog title="编码规则使用范围" |
| | | append-to-body |
| | | :visible.sync="codeRangeSettingBox" |
| | | width="800px"> |
| | | append-to-body |
| | | :visible.sync="codeRangeSettingBox" |
| | | width="800px"> |
| | | <avue-crud |
| | | :option="dialogeOption" |
| | | :table-loading="dialogLoading" |
| | | :data="useRangeData" |
| | | @refresh-change="refreshUseRangeChange"></avue-crud> |
| | | :option="dialogeOption" |
| | | :table-loading="dialogLoading" |
| | | :data="useRangeData" |
| | | @refresh-change="refreshUseRangeChange"> |
| | | </avue-crud> |
| | | </el-dialog> |
| | | <!-- 克隆对话框 --> |
| | | <el-dialog title="克隆编码规则" |
| | | append-to-body |
| | | :visible.sync="cloneSettingBox" |
| | | width="800px"> |
| | | append-to-body |
| | | :visible.sync="cloneSettingBox" |
| | | width="800px"> |
| | | <clone-code></clone-code> |
| | | </el-dialog> |
| | | |
| | |
| | | </avue-crud> |
| | | </basic-container> |
| | | |
| | | <!-- 基础编码规则对话框 @closed="closeRefresh"--> |
| | | <!-- 基础编码规则对话框 --> |
| | | <el-dialog title="添加码段信息" |
| | | append-to-body |
| | | :visible.sync="addBasicCodeSettingBox" |
| | | width="780px" |
| | | style=" margin-top: -8vh;" |
| | | destroy-on-close> |
| | | <add-basic-code ref='addBasicChild'></add-basic-code> |
| | | :visible.sync="addBasicCodeSettingBox" |
| | | width="780px" |
| | | append-to-body |
| | | style="margin-top: -8vh;" |
| | | destroy-on-close> |
| | | |
| | | <!-- 属性码段,属性选择弹窗 --> |
| | | <el-dialog title="为[属性]选取值" |
| | | append-to-body |
| | | :visible.sync="isShowSelectAttrOption" |
| | | width="78%" |
| | | style="height: 100%; margin-top: -8vh; overflow: hidden"> |
| | | <div style="overflow-y: auto; height: 60vh"> |
| | | <el-row> |
| | | <!-- 左侧主题库分类树 --> |
| | | <el-col :span="5"> |
| | | <div class="box"> |
| | | <el-scrollbar style="height: auto; border-bottom-right-radius:8px "> |
| | | <basic-container> |
| | | <div class="abox"> |
| | | <avue-tree :data="attrClassifyTreeData" :option="treeOption" @node-click="nodeClick"/> |
| | | </div> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> |
| | | |
| | | <!-- 右侧表格显示区域 --> |
| | | <el-col span="19"> |
| | | <basic-container> |
| | | <div class="bbox"> |
| | | <avue-crud ref="crud" |
| | | v-model="form" |
| | | :data="selectattrData" |
| | | :option="attrOption" |
| | | :permission="permissionList" |
| | | :table-loading="selectAttrOptionLoading" |
| | | @search-change="selectAttrOptionSearchChange" |
| | | @search-reset="searchAttrReset" |
| | | @selection-change="selectionChangeAttr"> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-container> |
| | | </el-col> |
| | | |
| | | </el-row> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="isShowSelectAttrOption = false">取 消</el-button> |
| | | <el-button type="primary" @click="savelistClassifyLinkAttr">确 定</el-button> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | <!-- 属性码段,公式编辑框弹窗 --> |
| | | <el-dialog title="公式编辑框" |
| | | append-to-body |
| | | :visible.sync="isShowformulaEdit" |
| | | @close="closeFormulaEdit" |
| | | width="78%" |
| | | style="height: 150vh; margin-top: -13vh; overflow: hidden"> |
| | | |
| | | <div style="overflow-y: auto; height: 80vh"> |
| | | <el-row> |
| | | <!-- 左侧公式内容 --> |
| | | <el-col :span="14" style="overflow: hidden"> |
| | | <el-card class="box-card" style="height: 33vh; overflow-y: auto; overflow-x: auto;"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium;">公式内容</span> |
| | | <el-button type="primary" size="mini" style="float: right;" @click="saveFormulaContent">确定</el-button> |
| | | <el-button type="warning" size="mini" style="margin-right: 10px; float: right;" @click="resetformulaContent">清空内容</el-button> |
| | | </div> |
| | | <div class="text item"> |
| | | <el-input type="textarea" :rows="5" style="width: 560px;" v-model="formulaContent"></el-input> |
| | | </div> |
| | | |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | <!-- 右侧运算符 --> |
| | | <el-col :span="10"> |
| | | <el-card class="box-card" style="height: 33vh;"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium;">运算符</span> |
| | | </div> |
| | | <div class="text item"> |
| | | <div class="formula-editor"> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'7'})">7</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'8'})">8</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'9'})">9</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'/'})">/</button><br/> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'4'})">4</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'5'})">5</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'6'})">6</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'*'})">*</button><br/> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'1'})">1</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'2'})">2</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'3'})">3</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>'})">-</button><br/> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'0'})">0</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'00'})">00</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'.'})">.</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'+'})">+</button><br/> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'->'})">-></button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'=='})">==</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'('})">(</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':')'})">)</button><br/> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'<'})"><</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>'})">></button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'<='})"><=</button> |
| | | <button class="formula-editor-btn-sm" @click="dbClickAddContent({'formula':'>='})">>=</button> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | |
| | | <!-- 左侧公式选择区域 --> |
| | | <el-col :span="14" style="overflow: hidden"> |
| | | <el-card class="box-card" style="height: 40vh; overflow-y: auto; overflow-x: auto;"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium;">公式选择</span> |
| | | </div> |
| | | <div class="text item"> |
| | | <el-tabs v-model="activeName"> |
| | | |
| | | <el-tab-pane label="常用" name="first"> |
| | | <el-table |
| | | :data="commonFormulaTableData" |
| | | :show-header="false" |
| | | @row-dblclick="dbClickAddContent" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="300"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="300"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="财务" name="second"> |
| | | <el-table |
| | | :data="financialFormulaTableData" |
| | | @row-dblclick="dbClickAddContent" |
| | | :show-header="false" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="300"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="300"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="日期" name="third"> |
| | | <el-table |
| | | :data="dateFormulaTableData" |
| | | :show-header="false" |
| | | @row-dblclick="dbClickAddContent" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="300"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="300"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="数学" name="fourth"> |
| | | <el-table |
| | | :data="mathFormulaTableData" |
| | | :show-header="false" |
| | | @row-dblclick="dbClickAddContent" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="300"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="300"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | | <el-tab-pane label="其他" name="five"> |
| | | <el-table |
| | | :data="otherFormulaTableData" |
| | | @row-dblclick="dbClickAddContent" |
| | | :show-header="false" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="300"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="300"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | <!-- 右侧变量选择区域 --> |
| | | <el-col :span="10" style="overflow: hidden"> |
| | | <el-card class="box-card" style="height: 40vh; overflow-y: auto; overflow-x: auto;"> |
| | | <div slot="header" class="clearfix"> |
| | | <span style="font-size: medium;">变量</span> |
| | | </div> |
| | | <div class="text item"> |
| | | <el-tabs v-model="activeNameAttr"> |
| | | <el-tab-pane label="本场景变量" name="first"> |
| | | <el-table |
| | | :data="thisSceneTableData" |
| | | @row-dblclick="dbClickAddContent" |
| | | :show-header="false" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="40"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="100"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="系统变量" name="second"> |
| | | <el-table |
| | | :data="systemVariableTableData" |
| | | @row-dblclick="dbClickAddContent" |
| | | :show-header="false" |
| | | style="width: 100%"> |
| | | <el-table-column |
| | | prop="formula" |
| | | width="150"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="desc" |
| | | width="150"> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | <!-- 添加码段信息的自定义组件 --> |
| | | <add-basic-code ref='addBasicChild' @openAttrSelectOrGetValue="openAttrSelectOrGetValue" @openformulaEdit="openformulaEdit"></add-basic-code> |
| | | |
| | | <!-- 第一层对话框的按钮和,线条 --> |
| | | <el-divider direction="horizontal"></el-divider> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="addBasicCodeSettingBox = false">取 消</el-button> |
| | | <el-button type="primary" @click="saveBasicCode">保 存</el-button> |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | </basic-container> |
| | |
| | | <script> |
| | | import { gridCodeRule, getDetail, add, update, remove, listUseRange, updateStatus } from "@/api/code/mdmrule"; |
| | | import { gridCodeBasicSec, downOrderNum, upOrderNum, deleteData, editSave, getObjectByOid, listDataByOids, refDataGrid} from "@/api/code/codebasic"; |
| | | import { treeTopCodeClassify, listClassifyLinkAttr } from "@/api/code/codeclassify"; |
| | | import optionBasic from "@/const/code/codebasic"; |
| | | import optionRule from "@/const/code/mdmrule"; |
| | | import attrOption from "@/const/code/selectattroption"; |
| | | import treeOption from "@/const/code/classifytreeoption"; |
| | | import {mapGetters} from "vuex"; |
| | | |
| | | export default { |
| | |
| | | total: 0 |
| | | }, |
| | | selectionList: [], |
| | | //编码规则表格配置 |
| | | /*编码规则表格配置*/ |
| | | optionRule: optionRule, |
| | | |
| | | data: [], |
| | |
| | | cloneSettingBox: false, |
| | | optionBasic: optionBasic, |
| | | |
| | | //基础码段展示 |
| | | /*基础码段相关数据*/ |
| | | basicData:[], |
| | | loadingBasic: true, |
| | | selectionBasicList: [], |
| | | addBasicCodeSettingBox: false, |
| | | /* 为属性选取值窗口显示打开控制变量 */ |
| | | isShowSelectAttrOption: false, |
| | | /* 为属性选值左侧树数据 */ |
| | | attrClassifyTreeData: [], |
| | | treeOption: treeOption, |
| | | currentSelectTreeData: '', //当前选中的树节点 |
| | | /* 为属性选值右侧表格相关数据 */ |
| | | attrOption: attrOption, |
| | | selectattrData: [], |
| | | selectAttrOptionLoading: false, |
| | | selectionChangeAttrList: [], |
| | | /*公式编辑框对话框*/ |
| | | isShowformulaEdit: false, //公式编辑框对话框显示控制 |
| | | formulaContent: '', //公式编辑框内容 |
| | | activeName: 'first', //当前活动的tab |
| | | activeNameAttr: 'first', //变量中的当前活动tab |
| | | |
| | | |
| | | /*使用范围对话框控制*/ |
| | | //常用公式 |
| | | commonFormulaTableData: [{ |
| | | "formula": 'if(compare,trueResult,falseResult)', |
| | | "desc": '如果compare的表达式为true,则执行trueResult的表达式,否则执行flaseResult.例如if(3>2,2*(3+2),3/(2-4)),值等于10', |
| | | }, |
| | | { |
| | | "formula": 'sum(douber1,douber2)', |
| | | "desc": '两个格式为douber的参数求和', |
| | | }, |
| | | { |
| | | "formula": 'sub(douber1,douber2)', |
| | | "desc": '格式为douber的参数douber1减去格式为douber的参数douber2', |
| | | }, |
| | | { |
| | | "formula": 'mul(douber1,douber2)', |
| | | "desc": '两个格式为douber的参数相乘', |
| | | }, |
| | | { |
| | | "formula": 'div(douber1,douber2)', |
| | | "desc": '格式为douber的参数douber1除以格式为douber的参数douber2.当douber2等于0的时候,返回0;如果除不尽的时候保留10位小数', |
| | | }, |
| | | { |
| | | "formula": 'mod(int,int)', |
| | | "desc": '求余数', |
| | | }, |
| | | { |
| | | "formula": 'toInt(string)', |
| | | "desc": '转换为int格式', |
| | | }, |
| | | { |
| | | "formula": 'doubleRound(string,count)', |
| | | "desc": '处理douber的小数位数,count表示小数位数', |
| | | }, |
| | | { |
| | | "formula": 'zeroIfNull(value)', |
| | | "desc": '如果参数的值为null或者"",将返回0', |
| | | }, |
| | | { |
| | | "formula": 'endsWith(string,str1)', |
| | | "desc": '字符串string是不是以str1结尾', |
| | | }, |
| | | { |
| | | "formula": 'startsWith(string,str1)', |
| | | "desc": '字符串string是否以str1开头', |
| | | }, |
| | | { |
| | | "formula": 'charAt(string,index)', |
| | | "desc": '获取字符串string中第index位置的字符,如果长度小于index,则返回', |
| | | }, |
| | | { |
| | | "formula": 'equalsIgnoreCase(str1,str2)', |
| | | "desc": '字符串str1和字符串str2是否相等', |
| | | }, |
| | | { |
| | | "formula": 'indexOf(str1,str2)', |
| | | "desc": '字符串str2在字符串str1中首次出现的位置', |
| | | }, |
| | | { |
| | | "formula": 'isEmpty(str1)', |
| | | "desc": '参数str1是否为空,其中null这个字符串也表示为空', |
| | | }, |
| | | { |
| | | "formula": 'lastIndexOf(str1,str2)', |
| | | "desc": '字符串str2在字符串str1中最后出现的位置', |
| | | }, |
| | | { |
| | | "formula": 'leftStr(str1,index)', |
| | | "desc": '获取index位置左侧的所有字符', |
| | | }, |
| | | { |
| | | "formula": 'rightStr(str1,str2)', |
| | | "desc": '获取index位置右侧的所有字符', |
| | | }, |
| | | { |
| | | "formula": 'length(str1)', |
| | | "desc": '参数str1的长度', |
| | | }, |
| | | { |
| | | "formula": 'mid(str1,start,end)', |
| | | "desc": '获取str1的从start到end直接的字符串,出现异常时返回', |
| | | }, |
| | | { |
| | | "formula": 'tolowercase(str1)', |
| | | "desc": '将字符串str1转为小写', |
| | | }, |
| | | { |
| | | "formula": 'touppercase(str1)', |
| | | "desc": '将字符串str1转为大写', |
| | | }, |
| | | { |
| | | "formula": 'trimzero(str1)', |
| | | "desc": '去除字符串str1中的0', |
| | | }, |
| | | { |
| | | "formula": 'MD5(str1)', |
| | | "desc": '将字符串进行MD5加密', |
| | | }, |
| | | ], |
| | | //财务公式 |
| | | financialFormulaTableData: [{ |
| | | "formula": 'toChinese(value)', |
| | | "desc": '将阿拉伯数字转为为汉字大写方式' |
| | | }, |
| | | { |
| | | "formula": 'getChineseCurrency(value)', |
| | | "desc": '将阿拉伯数字转为为汉字金额大写方式,与tochiness的区别是这个会显示元、角、分' |
| | | }, |
| | | { |
| | | "formula": 'setThmark(value)', |
| | | "desc": '为参数value设置千分位' |
| | | } |
| | | ], |
| | | //日期公式 |
| | | dateFormulaTableData: [{ |
| | | "formula": 'compareDate(d1,d2)', |
| | | "desc": '对比参数d1,d2的大小。d1,d2为yyyy-MM-dd格式的日期字符串' |
| | | }, |
| | | { |
| | | "formula": 'nowDate()', |
| | | "desc": '获取当前日期' |
| | | }, |
| | | { |
| | | "formula": 'chinaDate(d1)', |
| | | "desc": '将时间转换为农历,d1是yyyy-MM-dd格式的日期字符串' |
| | | }, |
| | | { |
| | | "formula": 'dateAdd(d1,count)', |
| | | "desc": '在d1的基础上添加count天,d1为yyyy-MM-dd HH:mm:ss格式的时间字符串' |
| | | }, |
| | | { |
| | | "formula": 'dateBalanceYear(sourceDate,targetDate,false)', |
| | | "desc": '计算相差的年份,比如计算年龄,targetDate为""表示当前时间,第三个参数为true表示有多余的月份或者天数时,就加1;' |
| | | }, |
| | | { |
| | | "formula": 'dateBalanceDay(sourceDate,targetDate)', |
| | | "desc": '计算相差的天数,targetDate为""表示当前时间' |
| | | }, |
| | | { |
| | | "formula": 'dateformat(d1,format)<', |
| | | "desc": '将当前的日期(时间)字符串转为指定的字符串,如果format的内容有空格,请使用&代替' |
| | | }, |
| | | { |
| | | "formula": 'nowDatetime()', |
| | | "desc": '获取当前日期和时间。格式为yyyy-MM-dd HH:mm:ss' |
| | | }, |
| | | { |
| | | "formula": 'dayOf(d1)', |
| | | "desc": '获取格式为yyyy-MM-dd的日期的天数' |
| | | }, |
| | | { |
| | | "formula": 'nowMon()', |
| | | "desc": '获取当前的月份,格式为MM' |
| | | }, |
| | | { |
| | | "formula": 'monOf(d1)', |
| | | "desc": '获取日期d1的月份数' |
| | | }, |
| | | { |
| | | "formula": 'nowTime()', |
| | | "desc": '获取当前时间,格式为HH:mm:ss' |
| | | }, |
| | | { |
| | | "formula": 'nowYear()', |
| | | "desc": '获取年份,格式为yyyy' |
| | | }, |
| | | { |
| | | "formula": 'yearOf()', |
| | | "desc": '获取时间d1的年份' |
| | | } |
| | | ], |
| | | //数学公式 |
| | | mathFormulaTableData: [{ |
| | | "formula": 'abs(value)', |
| | | "desc": '求参数value的绝对值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'acos(value)', |
| | | "desc": '求参数value的反余弦,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'asin(value)', |
| | | "desc": '求参数value的反正弦,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'atan(value)', |
| | | "desc": '求参数value的反正切,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'cbrt(value)', |
| | | "desc": '求参数value的立方根,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'ceil(value)', |
| | | "desc": '返回不大于参数value的最小整数,例如ceil(1.7)就等于2,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'cos(value)', |
| | | "desc": '求参数value的余弦值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'cosh(value)', |
| | | "desc": '求参数value的双曲余弦值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'exp(n)', |
| | | "desc": '欧拉数 e 的n次幂,n必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'floor(n)', |
| | | "desc": '欧拉数 e 的n次幂减1,n必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'log(value)', |
| | | "desc": '返回不小于参数value的最大整数,例如floor(1.7)等于1,n必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'log10(value)', |
| | | "desc": '自然对数,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'log1p(value)', |
| | | "desc": '计算底数为 10 的对数,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'random()', |
| | | "desc": '返回参数与 1 之和的自然对数,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'rint(value)', |
| | | "desc": '返回一个伪随机数,该值大于等于 0.0 且小于 1.0' |
| | | }, |
| | | { |
| | | "formula": 'round(value)', |
| | | "desc": '返回其值最接近参数并且是整数的 double 值。如果两个整数的 double 值都同样接近,那么结果取偶数。特殊情况是:如果参数值是整数,那么结果就是该参数。如果参数是 NaN 或无穷大或正零或负零,那么结果与参数相同' |
| | | }, |
| | | { |
| | | "formula": 'signum(value)', |
| | | "desc": '符号函数;如果参数为 0,则返回 0;如果参数大于 0, 则返回 1.0;如果参数小于 0,则返回 -1.0' |
| | | }, |
| | | { |
| | | "formula": 'sin(value)', |
| | | "desc": '求参数value的正弦值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'sinh(value)', |
| | | "desc": '求参数value的双曲正弦值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'tan(value)', |
| | | "desc": '求参数value的正切值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'tanh(value)', |
| | | "desc": '求参数value的双曲正切值,value必须为数字格式' |
| | | }, |
| | | { |
| | | "formula": 'max(v1,v2)', |
| | | "desc": '求两个数中的较大的值,v1,v2都必须为数字格式,例如max(3.2,3)就等于3.2' |
| | | }, |
| | | { |
| | | "formula": 'min(v1,v2)', |
| | | "desc": '求两个数中的较小的值,v1,v2都必须为数字格式,例如max(3.2,3)就等于3' |
| | | }, |
| | | { |
| | | "formula": 'sqrt(value)', |
| | | "desc": '求平方根' |
| | | }, |
| | | ], |
| | | //其他公式 |
| | | otherFormulaTableData: [{ |
| | | "formula": 'getcolvalue(servername,tablename,fieldname,pkField,pkValue)', |
| | | "desc": '查询servername中tablename数据库表中fieldname字段的值,pkfield表示主键的字段名称,pkValue表示主键的值,serverName现在默认为localServer' |
| | | }, |
| | | ], |
| | | |
| | | //本场景变量 |
| | | thisSceneTableData: [{ |
| | | "formula": '${}', |
| | | "desc": ' ' |
| | | }, |
| | | ], |
| | | //系统变量 |
| | | systemVariableTableData: [{ |
| | | "formula": '#CURRENTUSER.OID#', |
| | | "desc": '当前用户的主键' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.ID#', |
| | | "desc": '当前用户的账户' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTTIME#', |
| | | "desc": '当前时间' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTDATE#', |
| | | "desc": '当前日期' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTDATETIME#', |
| | | "desc": '当前日期时间' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER_NAME#', |
| | | "desc": '当前用户的姓名' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.SECRETGRADE#', |
| | | "desc": '当前用户密级' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.IPSECRET#', |
| | | "desc": '当前用户的IP密级' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.BUSINESSUNIT#', |
| | | "desc": '当前用户所属业务单元' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.BUSINESSUNITNAME#', |
| | | "desc": '当前用户所属业务单元名称' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.GROUPOID#', |
| | | "desc": '当前用户的部门主键' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.GROUPNAME#', |
| | | "desc": '当前用户所属部门名称' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.EMAIL#', |
| | | "desc": '当前用户邮件地址' |
| | | }, |
| | | { |
| | | "formula": '#CURRENTUSER.ROLENAME#', |
| | | "desc": '当前用户所属角色名称' |
| | | } |
| | | ], |
| | | |
| | | /*使用范围对话框显示控制*/ |
| | | codeRangeSettingBox: false, |
| | | useRangeData: [], |
| | | dialogLoading: true, |
| | | /*使用范围对话框*/ |
| | | /*使用范围对话框配置*/ |
| | | dialogeOption: { |
| | | height: 'auto', |
| | | calcHeight: 30, |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | |
| | | // 打开公式编辑框,第二层嵌套对话框 |
| | | openformulaEdit(){ |
| | | this.isShowformulaEdit = true; |
| | | }, |
| | | |
| | | //双击添加公式内容 |
| | | dbClickAddContent(row){ |
| | | //console.log(row.formula); |
| | | this.formulaContent = this.formulaContent + row.formula; |
| | | }, |
| | | |
| | | //清空公式内容 |
| | | resetformulaContent(){ |
| | | this.formulaContent = ''; |
| | | }, |
| | | |
| | | //关闭时清空上次公式内容 |
| | | closeFormulaEdit(){ |
| | | this.resetformulaContent(); |
| | | }, |
| | | |
| | | //编辑完成公式内容回调到子组件进行回显 |
| | | saveFormulaContent(){ |
| | | console.log(this.formulaContent); |
| | | if(this.formulaContent.trim == null){ |
| | | this.$message.warning("公式内容不能为空!"); |
| | | return; |
| | | } |
| | | this.$refs.addBasicChild.saveFormulaContent(this.formulaContent); |
| | | this.isShowformulaEdit = false; |
| | | }, |
| | | |
| | | // 打开属性选取值,第二层嵌套对话框 |
| | | openAttrSelectOrGetValue(){ |
| | | //console.log(111); |
| | | this.isShowSelectAttrOption = true; |
| | | }, |
| | | |
| | | // 获取当前被选中树节点的oid |
| | | nodeClick(data) { |
| | | this.currentSelectTreeData = data; |
| | | this.loadlistClassifyLinkAttr() |
| | | }, |
| | | |
| | | // 加载分类连接属性表格数据 |
| | | loadlistClassifyLinkAttr(){ |
| | | this.selectAttrOptionLoading = true; |
| | | listClassifyLinkAttr({"page": 1,"limit": -1,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}).then(res=>{ |
| | | //console.log(res.data.data); |
| | | //造假数据 |
| | | let dataInfo =[ |
| | | {"id":"address","name":"会议室地址","oid":"058D840D-1010-A7DE-7C52-B39C03CE89C1","attrLength":"150","description":"","attributeDataTypeText":"字符串"}, |
| | | {"id":"businesslicensetype","name":"营业执照类型","oid":"BDAC6D3E-1827-35A0-F3CA-0E58A43F6A07","attrLength":"255","description":"营业执照类型","attributeDataTypeText":"字符串"}, |
| | | {"id":"certificatenumber","name":"保密证编号","oid":"E2BC8332-A721-3713-26C3-C9F6340C2C1D","attrLength":"255","description":"保密证编号","attributeDataTypeText":"字符串"}, |
| | | ] |
| | | this.selectattrData = dataInfo; |
| | | this.selectAttrOptionLoading = false; |
| | | }) |
| | | }, |
| | | |
| | | // 点击搜索后触发该事件 |
| | | selectAttrOptionSearchChange(params, done) { |
| | | this.query = params; |
| | | console.log(params); //这儿需要改 |
| | | this.loadlistClassifyLinkAttr({"page":1,"limit":-1 ,'conditionMap[codeClassifyOid]':this.currentSelectTreeData.oid}); |
| | | done(); |
| | | }, |
| | | |
| | | // 属性取值当前选中行发生变化时触发 |
| | | selectionChangeAttr(list){ |
| | | this.selectionChangeAttrList = list; |
| | | }, |
| | | |
| | | //重置位属性选取值表格的搜索框之后的回调 |
| | | searchAttrReset() { |
| | | this.loadlistClassifyLinkAttr() |
| | | }, |
| | | |
| | | // 属性取值选取成功保存之后触发 |
| | | savelistClassifyLinkAttr(){ |
| | | if(this.selectionChangeAttrList.length != 1){ |
| | | this.$message.warning("只能选择一条数据!"); |
| | | return false; |
| | | } |
| | | let data = { |
| | | "referAttributeId":this.selectionChangeAttrList[0].id, |
| | | "referAttributeName":this.selectionChangeAttrList[0].name, |
| | | "referCodeClassifyOid": this.currentSelectTreeData.key, |
| | | "referCodeClassifyOidName": this.currentSelectTreeData.title, |
| | | } |
| | | //console.log(data); |
| | | //调用子组件并传递当前选中的参数值,实现回显 |
| | | this.$refs.addBasicChild.selectedListClassifyLinkAttr(data); |
| | | this.isShowSelectAttrOption = false; |
| | | }, |
| | | |
| | | // 编码规则当前选中行变化的时候触发 |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | if(this.selectionList.length > 0){ |
| | | this.currentCodeRuleOid = this.selectionList [list.length-1]; |
| | | this.loadBasic(this.selectionList[list.length-1]); |
| | | } |
| | | }, |
| | | |
| | | // 打开新增窗口 |
| | | addBasicCodeSec(){ |
| | |
| | | this.loadingBasic = false; |
| | | }); |
| | | }, |
| | | // 基础码段选中时触发 |
| | | selectionBasicChange(list) { |
| | | this.selectionBasicList = list; |
| | | //console.log(this.selectionBasicList); |
| | |
| | | }); |
| | | } |
| | | } |
| | | }; |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | |
| | | .el-divider--horizontal { |
| | | margin-top: 19px !important; |
| | | margin-bottom: -20px !important; |
| | |
| | | margin: 0; |
| | | } |
| | | |
| | | .el-card__body > .abox { |
| | | height: 50vh; |
| | | } |
| | | |
| | | .el-col-5 > .box { |
| | | height: 55vh; |
| | | } |
| | | |
| | | .operator_,filter, .layui-btn{ |
| | | width:60px; |
| | | } |
| | | |
| | | .formula-editor{ |
| | | |
| | | } |
| | | |
| | | </style> |