| | |
| | | }else { |
| | | if (record.templet && typeof (record.templet) == 'string' && !validatenull(record.templet) && record.templet.indexOf("function(row,column)")>-1) { |
| | | record.formatter = eval("(" + record.templet + ")"); |
| | | //function(row,column){return row[column.property]=='true'?'是':'否'} |
| | | //function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'} |
| | | }else if(record.fieldType=="truefalse"){ |
| | | record.formatter = function(row,column){return row[column.property]=='true' || row[column.property]=='1'?'是':'否'} |
| | | } |
| | | } |
| | | }) |
| | |
| | | }, |
| | | }, |
| | | methods: { |
| | | // 转换数据true和false |
| | | formatBoolean(row, column) { |
| | | if (column.fieldType === "truefalse") { |
| | | return row[column.property] =='true'? "是" : "否"; |
| | | } |
| | | return row[column.property]; |
| | | }, |
| | | // 发布 |
| | | setHandler() { |
| | | if (this.selectRow.length <= 0) { |
| | |
| | | ></formula-editor> |
| | | <!-- 新增 --> |
| | | <el-dialog :visible.sync="addVisible" append-to-body title="从业务类型中选择属性"> |
| | | <avue-crud :data="businessData" :option="businessOption" @select="businessSelect"> |
| | | <avue-crud :data="businessData" :option="businessOption" @selection-change="businessSelect"> |
| | | <template slot="menuLeft"> |
| | | <div style="display: flex;"> |
| | | <el-select> |
| | |
| | | style="width: 100%" |
| | | @cell-click="handleCellClicks" |
| | | @select="selectHandle" |
| | | @selection-change="selectionChange" |
| | | v-if="this.crudArrayFlag" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | | width="55"> |
| | | </el-table-column> |
| | | <el-table-column fixed label="序号" type="index" width="55"></el-table-column> |
| | | <!--<el-table-column fixed label="序号" type="index" width="55"></el-table-column>--> |
| | | <el-table-column v-for="item in this.option.column" :key="item.id" |
| | | :label="item.label" |
| | | :prop="item.prop" |
| | |
| | | align="center" |
| | | > |
| | | <template slot-scope="{ row }"> |
| | | <el-input v-if="editingRows === row && editShows== item.prop" v-model="row[item.prop]" |
| | | <el-input v-if="editingRows === row && editShows== item.prop && (item.edit == 'text' || item.edit == 'select' ||item.edit == 'refer')" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input> |
| | | <el-input-number controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]" |
| | | @blur="saveRows"></el-input-number> |
| | | <el-switch |
| | | v-if="item.label === 'true' || item.label === 'false'" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949"> |
| | | v-if="item.edit === 'switch'" v-model="row[item.prop]" active-value="true" |
| | | inactive-value="false"> |
| | | </el-switch> |
| | | <span v-else>{{ row[item.prop] }}</span> |
| | | </template> |
| | |
| | | }, |
| | | // 编码申请预览data |
| | | applicationData: [], |
| | | //业务类型单选数组 |
| | | //业务类型选择数组 |
| | | busineSelectList: [], |
| | | //业务类型添加数据 |
| | | busineAddList: {}, |
| | | //表格单选数组 |
| | | CrudSelect: [], |
| | | attrSelectList: [], |
| | | //表格oid |
| | | CrudOid: "", |
| | | attrOid: "", |
| | | //场景变量 |
| | | thisSceneTableData: [ |
| | | { |
| | |
| | | rowCellList: [], |
| | | List: [], |
| | | option: { |
| | | index: true, |
| | | index: false, |
| | | border: true, |
| | | editBtn: false, |
| | | selection: true, |
| | |
| | | prop: 'name', |
| | | order: 'descending' |
| | | }, |
| | | column: [ |
| | | { |
| | | column: [{ |
| | | prop: 'orderNum', |
| | | label: '排序号', |
| | | sortable: true, |
| | | edit: 'number', |
| | | width: 60, |
| | | fixed: true |
| | | }, { |
| | | label: "属性英文编号", |
| | | prop: "id", |
| | | fixed: true, |
| | |
| | | fixed: true, |
| | | cell: false, |
| | | width: 125, |
| | | edit: 'text', |
| | | sortable: true |
| | | }, |
| | | { |
| | |
| | | prop: "attributeGroup", |
| | | cell: false, |
| | | sortable: true, |
| | | edit: 'text', |
| | | width: 125, |
| | | }, |
| | | { |
| | |
| | | cell: false, |
| | | sortable: true, |
| | | width: 105, |
| | | edit: 'number' |
| | | }, |
| | | { |
| | | label: "关键属性", |
| | | prop: "keyAttrFlag", |
| | | cell: false, |
| | | type: "switch", |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "查询属性", |
| | | prop: "queryAttrFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "高级查询属性", |
| | | prop: "seniorQueryAttrFlag", |
| | | width: 95, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "相似查询属性", |
| | | label: "相似查重属性", |
| | | prop: "sameRepeatAttrFlag", |
| | | width: 95, |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "必输", |
| | | prop: "requireFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "表单显示", |
| | | prop: "formDisplayFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "列表显示", |
| | | prop: "tableDisplayFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "只读", |
| | | prop: "readonlyFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "列表排序", |
| | | prop: "sortAttrFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | |
| | | { |
| | | label: "多行文本", |
| | | prop: "textareaFlag", |
| | | cell: false, |
| | | edit: "switch" |
| | | }, |
| | | { |
| | | label: "默认值", |
| | | prop: "defaultValue", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'text', |
| | | width: 95, |
| | | }, |
| | | { |
| | | label: "前缀", |
| | | prop: "prefixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | | label: "后缀", |
| | | prop: "suffixValue", |
| | | sortable: true, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | |
| | | prop: "componentRule", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'refer', |
| | | width: 105, |
| | | }, |
| | | { |
| | |
| | | prop: "verifyRule", |
| | | sortable: true, |
| | | cell: false, |
| | | edit: 'refer', |
| | | width: 105, |
| | | }, |
| | | { |
| | |
| | | prop: "codeDateFormat", |
| | | sortable: true, |
| | | width: 105, |
| | | edit: 'select', |
| | | cell: false, |
| | | }, |
| | | { |
| | | label: "分类注入", |
| | | prop: "classifyInvokeLevel", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "枚举注入", |
| | | prop: "enumString", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "级联属性", |
| | | prop: "parentCode", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "参照配置", |
| | | prop: "referConfig", |
| | | cell: false, |
| | | edit: 'refer' |
| | | }, |
| | | { |
| | | label: "级联查询属性", |
| | | prop: "parentQueryAttr", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "选择库标识", |
| | | prop: "libraryIdentification", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "填写提示", |
| | | prop: "explain", |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表单显示样式", |
| | | prop: "formDisplayStyle", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表格显示样式", |
| | | prop: "tableDisplayStyle", |
| | | width: 105, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表单超链接", |
| | | prop: "formHref", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表格超链接", |
| | | prop: "tableHref", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "表格显示js", |
| | | prop: "tableDisplayJs", |
| | | width: 95, |
| | | cell: false, |
| | | edit: 'text' |
| | | }, |
| | | { |
| | | label: "长度", |
| | | prop: "controlLength", |
| | | cell: false, |
| | | cell: false |
| | | }, |
| | | { |
| | | label: "小数精度", |
| | | prop: "precisionLength", |
| | | cell: false, |
| | | cell: false |
| | | }, |
| | | { |
| | | label: "取值范围", |
| | |
| | | sortable: true, |
| | | cell: false, |
| | | width: 105, |
| | | edit: 'text' |
| | | }, |
| | | ], |
| | | List: [] |
| | | }, |
| | | vciFieldTypeMap : { |
| | | VTBoolean: "布尔型", |
| | | VTClob: "长文本", |
| | | VTDate: "日期", |
| | | VTDateTime: "日期时间", |
| | | VTTime: "时间", |
| | | VTLong: "长整型", |
| | | VTDouble: "金额/双精度", |
| | | VTInteger: "整形", |
| | | VTFilePath: "文件", |
| | | VTString: "字符串" |
| | | } |
| | | } |
| | | }, |
| | | computed:{ |
| | | attrOids() { |
| | | let oids = []; |
| | | this.attrSelectList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | }, |
| | | busineOids() { |
| | | let oids = []; |
| | | this.busineSelectList.forEach(ele => { |
| | | oids.push(ele.oid); |
| | | }); |
| | | return oids.join(","); |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | //属性分组按钮 |
| | | attrVisibleHandle() { |
| | | |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.CrudSelect < 1) { |
| | | } else if (this.attrSelectList < 1) { |
| | | this.$message.warning('请选择一条模板属性') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.attrVisible = true; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //业务类型保存 |
| | | busineAddHandle() { |
| | | if (this.busineSelectList.length > 1) { |
| | | this.$message.warning('请选择一条业务类型数据') |
| | | } else { |
| | | this.$set(this.busineAddList, 'classifytemplateoid', this.crudOid) |
| | | this.$set(this.busineAddList, 'oid', '') |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | this.addVisible = false; |
| | | if (this.busineSelectList.length == 0) { |
| | | this.$message.warning('请选择属性集'); |
| | | return false; |
| | | } |
| | | debugger; |
| | | let ordernum = this.ProData.length; |
| | | this.busineSelectList.forEach((citem) => { |
| | | let isCopy = false; |
| | | this.ProData.forEach((item) => { |
| | | if (citem.id == item.id) { |
| | | isCopy = true; |
| | | return false; |
| | | } |
| | | }) |
| | | if (!isCopy) { |
| | | citem.oid = '' |
| | | this.busineAddList=Object.assign(citem, { |
| | | orderNum: ++ordernum, |
| | | attributedatatype: citem.attrDataType, |
| | | attributeDataTypeText: this.vciFieldTypeMap[citem.attrDataType], |
| | | controlLength: citem.attributeLength, |
| | | valueArea: citem.range, |
| | | referbtmid: citem.referBtmTypeId, |
| | | referbtmname: citem.referBtmTypeName, |
| | | referConfig: '', |
| | | enumid: citem.enumId, |
| | | precisionLength: (citem.precisionLength ? citem.precisionLength : '') + (citem.scaleLength ? '(' + citem.scaleLength + ')' : ''), |
| | | classifyTemplateOid: this.crudOid, |
| | | classifytemplateoid: this.crudOid, |
| | | formDisplayFlag: true, |
| | | tableDisplayFlag: true, |
| | | sortAttrFlag: false, |
| | | queryAttrFlag: true, |
| | | seniorQueryAttrFlag: true, |
| | | attrTableWidth: 120 |
| | | }) |
| | | this.ProData.push(JSON.parse(JSON.stringify(this.busineAddList))) |
| | | } |
| | | }) |
| | | |
| | | |
| | | this.addVisible = false; |
| | | |
| | | }, |
| | | //业务类型单选 |
| | | //业务类型选择 |
| | | businessSelect(selection, row) { |
| | | this.busineSelectList = selection |
| | | this.busineAddList = row |
| | | }, |
| | | // 从业务类型中选择数据 |
| | | // 从业务类型中选择数据弹窗 |
| | | busineHandle() { |
| | | this.addVisible = true; |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => { |
| | | this.businessData = res.data.data; |
| | | }) |
| | | this.addVisible = true; |
| | | this.busineSelectList = [] |
| | | this.busineAddList = []; |
| | | AttrByBtm({'conditionMap[oid]': this.crudOid}).then(res => { |
| | | this.businessData = res.data.data; |
| | | }) |
| | | }, |
| | | // 级联属性按钮 |
| | | CascadeHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板属性') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.CascadeVisible = true; |
| | | gridCodeClassifyTemplateAttr({ |
| | | 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, |
| | | 'conditionMap[oid_notequal]': this.CrudOid |
| | | 'conditionMap[oid_notequal]': this.attrOid |
| | | }).then(res => { |
| | | this.CascadeData = res.data.data; |
| | | }) |
| | |
| | | }, |
| | | //表格单选 |
| | | selectHandle(selection, row) { |
| | | this.CrudOid = row.oid; |
| | | this.CrudSelect = selection; |
| | | this.attrOid = row.oid; |
| | | this.attrRow = row; |
| | | console.log('123',row,selection) |
| | | }, |
| | | //表格选择 |
| | | selectionChange(list) { |
| | | this.attrSelectList = list; |
| | | }, |
| | | //保存 |
| | | addsHandler() { |
| | |
| | | }, |
| | | //表格行编辑 |
| | | handleCellClicks(row, column) { |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | this.editingRows = row; |
| | | this.editShows = column.property; |
| | | this.rowOid = row.oid; |
| | | }, |
| | | saveRows() { |
| | | this.editingRows = null; |
| | |
| | | }, |
| | | //枚举注入按钮 |
| | | enmuVisHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性') |
| | | } else if (this.CrudSelect < 1) { |
| | | } else if (this.attrSelectList < 1) { |
| | | this.$message.warning('请选择一条模板属性') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.enumVisible = true; |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //点击分类注入按钮 |
| | | injectBtn() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板数据') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板数据') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.injectVisible = true |
| | | } |
| | | }, |
| | |
| | | }, |
| | | //同步到其他模板 |
| | | syncHandle() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性数据') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板属性数据') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | copyto({oid: this.attrRow.oid}).then(res => { |
| | | this.$message.success('同步成功') |
| | | }) |
| | |
| | | }, |
| | | //组合规则 |
| | | isShowHandler() { |
| | | if (this.CrudSelect.length > 1) { |
| | | if (this.attrSelectList.length > 1) { |
| | | this.$message.warning('只能选择一条模板属性数据') |
| | | } else if (this.CrudSelect.length < 1) { |
| | | } else if (this.attrSelectList.length < 1) { |
| | | this.$message.warning('请选择一条模板属性数据') |
| | | } else if (this.CrudSelect.length === 1) { |
| | | } else if (this.attrSelectList.length === 1) { |
| | | this.isShowformulaEdit = true; |
| | | } |
| | | }, |