| | |
| | | |
| | | <span style="display: flex;align-items: center; margin-right: 5px;"> |
| | | <p class="tableTopLabel">查询模板名称:</p> |
| | | <el-select v-model="form.itemQtName" placeholder="请选择查询模板" size="mini"> |
| | | <el-select v-model="topForm.itemQtName" placeholder="请选择查询模板" size="mini"> |
| | | <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" |
| | | :value="item.qtName"></el-option> |
| | | </el-select> |
| | |
| | | type="primary"></el-button> |
| | | </div> |
| | | <el-input |
| | | v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'" |
| | | v-model="item.value" |
| | | :placeholder="item.text"> |
| | | v-if="item.itemType === 'textarea' || item.itemType === 'richtext' || item.itemType === 'webeditor'" |
| | | v-model="item.value" |
| | | :placeholder="item.text"> |
| | | </el-input> |
| | | <el-input-number size="mini" v-if="item.itemType === 'number'" v-model="item.value" :max="99999" |
| | | :min="1"></el-input-number> |
| | | <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" :min="1" |
| | | size="mini"></el-input-number> |
| | | <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="请输入密码" |
| | | show-password></el-input> |
| | | <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio> |
| | | <el-checkbox v-if="item.itemType === 'checkbox'" v-model="item.value"></el-checkbox> |
| | | <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'" |
| | | <el-select v-if="item.itemType === 'select' || item.itemType === 'multiselect'" |
| | | v-model="item.value" :disabled="false" placeholder="请选择" size="mini"> |
| | | </el-select> |
| | | <el-date-picker |
| | | class="formItemMargin" |
| | | v-if="item.itemType === 'date' || item.itemType === 'datetime'" |
| | | v-model="item.value" |
| | | :placeholder="item.itemType === 'date' ? '请选择日期' : '请选择日期时间'" |
| | | class="formItemMargin" |
| | | type="date"> |
| | | </el-date-picker> |
| | | |
| | | <el-time-select |
| | | class="formItemMargin" |
| | | v-if="item.itemType === 'time'" |
| | | v-model="item.value" |
| | | :picker-options="{ |
| | |
| | | step: '00:15', |
| | | end: '18:30' |
| | | }" |
| | | class="formItemMargin" |
| | | placeholder="选择时间"> |
| | | </el-time-select> |
| | | <el-button v-if="item.itemType === 'file'" |
| | |
| | | <el-form-item label="使用字段"> |
| | | <div style="display: flex;align-items: center"> |
| | | <el-input v-model="form.text" :readonly="true" placeholder="请输入使用字段" size="mini"></el-input> |
| | | <el-checkbox v-model="form.itemIsEditable" true-label="1" false-label="0" style="margin-left: 5px; margin-right: 5px">只读 |
| | | <el-checkbox v-model="form.itemIsEditable" false-label="0" |
| | | style="margin-left: 5px; margin-right: 5px" |
| | | true-label="1">只读 |
| | | </el-checkbox> |
| | | <el-checkbox v-model="form.itemIsRequired" true-label="1" false-label="0" style="margin-left: 5px;margin-right: 0px">必填 |
| | | <el-checkbox v-model="form.itemIsRequired" false-label="0" |
| | | style="margin-left: 5px;margin-right: 0px" |
| | | true-label="1">必填 |
| | | </el-checkbox> |
| | | </div> |
| | | </el-form-item> |
| | |
| | | </el-container> |
| | | |
| | | <!-- 添加自定义组件 --> |
| | | |
| | | <el-dialog |
| | | v-dialogDrag |
| | | v-loading="customLoading" |
| | |
| | | :show-header="false" |
| | | border |
| | | stripe |
| | | style="width: 100%"> |
| | | style="width: 100%" |
| | | @row-click="customOptionTableClick"> |
| | | <el-table-column |
| | | align="center" |
| | | label="名称" |
| | |
| | | <el-button plain size="mini" style="margin-right: 5px" type="success" |
| | | @click="optionAddClickHandler('dialog')">添加 |
| | | </el-button> |
| | | <el-button plain size="mini" style="margin-left: 5px" type="danger">删除</el-button> |
| | | <el-button plain size="mini" style="margin-left: 5px" type="danger" |
| | | @click="optionDeleteClickHandler('dialog')">删除 |
| | | </el-button> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | :placeholder="item.text"> |
| | | </el-input> |
| | | |
| | | <el-input-number size="mini" v-if="item.itemType === 'number'" v-model="item.value" :max="99999" |
| | | :min="1"></el-input-number> |
| | | <el-input-number v-if="item.itemType === 'number'" v-model="item.value" :max="99999" :min="1" |
| | | size="mini"></el-input-number> |
| | | <el-input v-if="item.itemType === 'password'" v-model="input" placeholder="请输入密码" |
| | | show-password></el-input> |
| | | <el-radio v-if="item.itemType === 'radio'" v-model="item.value"></el-radio> |
| | |
| | | <avue-tree :key="refresh" ref="authTree" v-model="treeAuthForm" :data="treeAuthData" :option="treeAuthOption" |
| | | @check-change="treeAuthCheckChange"> |
| | | <span slot-scope="{ node, data }" class="el-tree-node__label"> |
| | | <span style="font-size: 15px"> |
| | | <span> |
| | | <i class="el-icon-s-promotion"></i> |
| | | {{ (node || {}).label }} |
| | | </span> |
| | |
| | | |
| | | <script> |
| | | import {getObjTypeQTs, getTreeAttributes, savePortalVI, refPersonOrgTree} from "@/api/UI/formDefine/api"; |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import func from "@/util/func"; |
| | | import basicOption from "@/util/basic-option"; |
| | | import {gridAttribute} from "@/api/modeling/attributePool/api"; |
| | | import {getSysModelTreeMenuByPID} from "@/api/systemModel/mangeModel/api"; |
| | | |
| | | export default { |
| | | name: "formDialog", |
| | |
| | | children: 'childNodes', |
| | | }, |
| | | treeLoad: (node, resolve) => { |
| | | // console.log(node); |
| | | const params = { |
| | | 'conditionMap[dataType]': node.data.data, |
| | | 'conditionMap[parentId]': node.data.data, |
| | |
| | | ], |
| | | form: {}, |
| | | topForm: { |
| | | itemQtName: '', |
| | | columnNumber: 8, |
| | | showColumn: '3', |
| | | viName: '', |
| | |
| | | children: 'children', |
| | | }, |
| | | }, |
| | | treeData: [] |
| | | treeData: [], |
| | | optionRow: {}, |
| | | customOptionRow: {}, |
| | | optionCurrentIndex: 0, |
| | | customOptionCurrentIndex: 0 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | const types = ['radio', 'checkbox', 'select']; |
| | | return types.includes(this.form.itemType); // 展示 |
| | | }, |
| | | |
| | | itemStyleTypeStatus() { |
| | | const types = ['hidden', 'webeditor', 'radio', 'checkbox']; |
| | | return !types.includes(this.form.itemType); // 不展示 |
| | |
| | | oid: data.oid, |
| | | itemType: 'text', |
| | | itemName: data.data.name, |
| | | itemCols :"1" |
| | | itemCols: "1", |
| | | itemIsEditable: "0", |
| | | itemIsRequired: "0", |
| | | } |
| | | console.log(data); |
| | | const isDuplicate = this.formList.some(item => item.text === data.text); |
| | | |
| | | if (isDuplicate) { |
| | |
| | | this.activeItem = item; |
| | | this.activeItemIndex = index; |
| | | this.form = {...item}; |
| | | // this.form.itemCols = "1"; |
| | | console.log(item); |
| | | |
| | | // console.log(item,index); |
| | | this.topForm.position = index += 1; |
| | | // this.$forceUpdate(); |
| | | }, |
| | | |
| | | // 设置显示行数 |
| | |
| | | this.$message.error('请选择一条数据进行删除'); |
| | | return; |
| | | } |
| | | this.formList = this.formList.filter(item => item.text != this.activeItem.text); |
| | | this.formList = this.formList.filter(item => item.text !== this.activeItem.text); |
| | | this.activeItem = {}; |
| | | this.form = {}; |
| | | }, |
| | |
| | | |
| | | // 选项表格行点击 |
| | | optionTableClick(row) { |
| | | console.log(row); |
| | | this.optionRow = row; |
| | | }, |
| | | |
| | | customOptionTableClick(row) { |
| | | this.customOptionRow = row; |
| | | }, |
| | | |
| | | // 选项添加 |
| | |
| | | |
| | | const params = { |
| | | key: optionObj.optionName, |
| | | value: optionObj.optionValue |
| | | value: optionObj.optionValue, |
| | | index: val === 'dialog' ? this.customOptionCurrentIndex++ : this.optionCurrentIndex++ |
| | | }; |
| | | |
| | | itemKeyValueList.push(params); |
| | | }, |
| | | |
| | | // 选项删除 |
| | | optionDeleteClickHandler() { |
| | | |
| | | optionDeleteClickHandler(val) { |
| | | if (val === 'dialog') { |
| | | this.customForm.itemKeyValueList.splice(this.customOptionRow.index, 1); |
| | | } else { |
| | | this.form.itemKeyValueList.splice(this.optionRow.index, 1); |
| | | } |
| | | }, |
| | | |
| | | // 添加自定义组件 |
| | |
| | | this.formList = this.formList.map(item => { |
| | | return { |
| | | ...item, |
| | | itemField: item.text // 将itemField赋值为text,因为忘记父组件为什么在编辑回填时把itemField赋值为text了 |
| | | itemField: item.text // 将itemField重新赋值为text,因为忘记当时在父组件编辑回填方法里为什么把itemField赋值为text了 |
| | | }; |
| | | }); |
| | | const params = { |
| | |
| | | viType: 1, // 视图类型 |
| | | viTypeText: "表单", // 视图中文名称 |
| | | prm: { |
| | | formQtName: this.form.qtName, // 查询模板名称 |
| | | formQtName: this.topForm.itemQtName, // 查询模板名称 |
| | | showCols: this.topForm.showColumn, |
| | | prmItemList: this.formList |
| | | }, |
| | |
| | | } |
| | | if (!this.form.text) { |
| | | this.$message.error('请在右侧选择数据后进行操作!'); |
| | | return; |
| | | } |
| | | |
| | | }, |
| | | |
| | | // 自定义组件修改显示类型 |
| | |
| | | this.$message.error('请选择一条数据进行保存'); |
| | | return; |
| | | } |
| | | // console.log(this.customAttrRow) |
| | | this.customForm.text = this.customAttrRow.id; |
| | | this.customAttrVisible = false; |
| | | }, |
| | |
| | | this.$message.error('请添加一条数据进行保存!'); |
| | | return; |
| | | } |
| | | |
| | | this.formList = this.formList.map(item => |
| | | item.text === this.form.text ? this.form : item |
| | | ); |
| | |
| | | return `${key}=${oids.join(',')}`; // 用 , 连接同一类型的 oid |
| | | }).join('&&'); // 最后用 && 连接不同类型 |
| | | |
| | | // console.log(resultString); |
| | | if (this.authType === 'attr') { |
| | | this.customForm.itemRight = resultString; |
| | | } else { |
| | | this.form.itemRight = resultString; |
| | | } |
| | | // this.form.itemRight = resultString; |
| | | this.authDialogClose(); |
| | | } |
| | | |
| | |
| | | font-size: 14px |
| | | } |
| | | |
| | | .formItemMargin{ |
| | | margin: 10px 0 10px 0; |
| | | } |
| | | //.formItemMargin { |
| | | // margin: 10px 0 10px 0; |
| | | //} |
| | | |
| | | </style> |
| | | |