| | |
| | | <el-col :span="24"> |
| | | <el-form-item label="查询模板"> |
| | | <el-select v-model="form.itemQtName" placeholder="请选择查询模板" size="mini"> |
| | | <el-option label="区域一" value="shanghai"></el-option> |
| | | <el-option label="区域二" value="beijing"></el-option> |
| | | <el-option v-for="(item,index) in searchQtNameList" :key="index" :label="item.qtName" :value="item.qtName"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | |
| | | <script> |
| | | import basicOption from "@/util/basic-option"; |
| | | import {gridPortalVIDatas, getPortalVIById, getItemDblList, savePortalVI} from "@/api/UI/formDefine/api"; |
| | | import {gridPortalVIDatas, getPortalVIById, getItemDblList, savePortalVI, getObjTypeQTs} from "@/api/UI/formDefine/api"; |
| | | import func from "@/util/func"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | searchQtNameList:[], |
| | | formLoading: false, |
| | | itemImgHeight: '', |
| | | itemImgWidth: '', |
| | |
| | | formSelectClickHandler() { |
| | | this.selectFormVisible = true; |
| | | const params = { |
| | | 'conditionMap[typeName]': this.TreeNodeRow.id, |
| | | 'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, |
| | | 'conditionMap[viType]': 'Form', |
| | | 'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '', |
| | | } |
| | |
| | | getFormSelectList() { |
| | | this.formLoading = true; |
| | | const params = { |
| | | 'conditionMap[typeName]': this.TreeNodeRow.id, |
| | | 'conditionMap[typeName]': this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, |
| | | 'conditionMap[viType]': 'Form', |
| | | 'conditionMap[viTypeFlag]': this.treeRadio === '0' ? 'BtmType' : this.treeRadio === '1' ? 'LinkType' : '', |
| | | }; |
| | |
| | | // 确保 this.selectList 已经赋值且不为空 |
| | | if (this.selectList && this.selectList.length > 0) { |
| | | const param = { |
| | | id: this.selectList[0].id, |
| | | id: this.form.itemInObj, |
| | | viType: '1' |
| | | }; |
| | | |
| | |
| | | const list = data.filter(item => |
| | | !this.form.itemOutFieldList.some(outItem => outItem.id === item.id) |
| | | ); |
| | | this.getSearchSelectList(); |
| | | this.$set(this.form, 'itemSelectOutFieldList', list); |
| | | this.formLoading = false; |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 查询模板下拉接口查询 |
| | | getSearchSelectList(){ |
| | | getObjTypeQTs({btName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name}).then(res => { |
| | | this.searchQtNameList = res.data.data; |
| | | }) |
| | | }, |
| | | |
| | |
| | | |
| | | // 查询模板添加 |
| | | searchAddClickHandler() { |
| | | if(!this.form.searchLabel){ |
| | | this.$message.error('查询字段不能为空!'); |
| | | return; |
| | | } |
| | | this.form.itemSeniorQueryBOS.push({ |
| | | itemSeniorQueryCols: this.form.searchLabel, |
| | | itemSeniorQueryColsCounts: this.form.searchNumber, |
| | |
| | | return; |
| | | } |
| | | |
| | | this.form.itemSeniorQueryBOS = this.form.itemSeniorQueryBOS.filter(item => item.itemSeniorQueryCols != this.itemSeniorRow.id); |
| | | this.itemSeniorRow = {}; |
| | | this.form.itemSeniorQueryBOS = this.form.itemSeniorQueryBOS.filter(item => item.itemSeniorQueryCols != this.itemSeniorRow.itemSeniorQueryCols); |
| | | }, |
| | | |
| | | // 表格对话框保存 |
| | | dialogSaveClickHandler() { |
| | | this.form.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 可使用字段 |
| | | this.form.itemOutFieldList = this.form.itemOutFieldList.map(item => item.id); // 需要使用字段 |
| | | this.form.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 可供搜索字段 |
| | | this.form.itemKeyFieldList = this.form.itemKeyFieldList.map(item => item.id); // 需要使用字段 |
| | | this.form.itemImgWH = `${this.itemImgHeight},${this.itemImgWidth}`; |
| | | const paramsForm = {...this.form}; |
| | | paramsForm.itemSelectOutFieldList = this.form.itemSelectOutFieldList.map(item => item.id); // 可使用字段 |
| | | paramsForm.itemOutFieldList = this.form.itemOutFieldList.map(item => item.id); // 需要使用字段 |
| | | paramsForm.itemSearchFieldList = this.form.itemSearchFieldList.map(item => item.id); // 可供搜索字段 |
| | | paramsForm.itemKeyFieldList = this.form.itemKeyFieldList.map(item => item.id); // 需要使用字段 |
| | | paramsForm.itemImgWH = `${this.itemImgWidth},${this.itemImgHeight}`; |
| | | const params = { |
| | | id: this.form.editNodeId, |
| | | prm: { |
| | | formQtName: '', |
| | | prmItemList: [ |
| | | this.form |
| | | paramsForm |
| | | ], |
| | | }, |
| | | typeFlag: this.treeRadio, |
| | | typeFlagText: this.treeRadio === '0' ? "业务类型的表单" : '链接类型的表单', |
| | | typeName: this.TreeNodeRow.attributes.id, |
| | | typeName: this.treeRadio === '0' ? this.TreeNodeRow.id : this.TreeNodeRow.name, // 业务类型名 or 链接类型名 |
| | | viName: this.form.viName, |
| | | viType: 0, |
| | | viTypeText: "表格" |
| | | } |
| | | savePortalVI(params).then(res => { |
| | | // console.log(params); |
| | | if (res.data.code === 200) { |
| | | this.$message.success('保存成功'); |
| | | this.closeDialog(); |
| | | this.$message.success(res.data.obj); |
| | | // this.closeDialog(); |
| | | this.$emit('updataTable'); |
| | | this.visible = false; |
| | | } |
| | | }) |
| | | } |