| | |
| | | }); |
| | | } |
| | | |
| | | // 链接类型下拉查询 |
| | | export function getLinkDatasByPage(page, limit, params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/getLinkDatasByPage", |
| | | method: "get", |
| | | params: { |
| | | page, |
| | | limit, |
| | | ...params |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 查询模板下拉查询 |
| | | export function getQTInfoDatasByPage(page, limit, params) { |
| | | return request({ |
| | |
| | | }); |
| | | } |
| | | |
| | | // 保存接口 |
| | | export function addPageDefination(params) { |
| | | return request({ |
| | | url: "/api/uiManagerController/addPageDefination", |
| | | method: "post", |
| | | data:params |
| | | }); |
| | | } |
| | | |
| | |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button icon="el-icon-edit" size="small" type="text" @click="editBtnClick(scope.row)">编辑 |
| | | </el-button> |
| | | <el-button icon="el-icon-delete" size="small" type="text" @click="rowDeleteHandler(scope.row)">删除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <!-- eventKey以及eventValue显示区域 --> |
| | | <template slot="bottomValueForm" slot-scope="scope"> |
| | | <avue-crud |
| | |
| | | getQTInfoDatasByPage, |
| | | getTabButtons, |
| | | addTapButton, |
| | | updateTapButton, getTabByContextIdAndType |
| | | updateTapButton, |
| | | getLinkDatasByPage, |
| | | addPageDefination |
| | | } from "@/api/UI/uiDefine"; |
| | | import actionDialog from '@/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action'; |
| | | |
| | |
| | | name: "index", |
| | | data() { |
| | | return { |
| | | paramsForm:{}, |
| | | paramsForm: {}, |
| | | eventOption: { |
| | | ...basicOption, |
| | | addBtn: false, |
| | |
| | | addBtn: false, |
| | | index: true, |
| | | calcHeight: -30, |
| | | editBtn: false, |
| | | delBtn: false, |
| | | column: [ |
| | | { |
| | | label: '名称', |
| | |
| | | return val; |
| | | }, |
| | | change: (val) => { |
| | | console.log(val); |
| | | const list = ['showType' ,'linkType' ,'templateId', 'SubUILayout' , 'searchObjType' ,'queryTemplateName', 'controlPath' ,'expandCols', 'rootContent', 'showAbs' ,'showLinkAbs' ,'separator'] |
| | | list.forEach(item => { |
| | | this.form[item] = ""; |
| | | }) |
| | | const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 获取搜索类型配置项 |
| | | searchTarger.display = true; // 切换默认展示搜索类型 |
| | | // 模板类型为表格 |
| | |
| | | dicData: [ |
| | | { |
| | | label: '不显示', |
| | | value: '1' |
| | | value: '3' |
| | | }, |
| | | { |
| | | label: '显示角色', |
| | |
| | | }, |
| | | { |
| | | label: '显示Folder', |
| | | value: '3', |
| | | value: '1', |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | const obj = this.option.group[0].column.find(item => item.prop === 'linkType'); |
| | | obj.display = val.value !== '1'; |
| | | } |
| | | // 切换清空模板类型 |
| | | const list = ['showType', 'linkType', 'templateId', 'SubUILayout', 'queryTemplateName', 'searchObjType']; |
| | | list.forEach(item => { |
| | | this.form[item] = ''; |
| | | }) |
| | | } |
| | | }, |
| | | { |
| | |
| | | label: 'name', |
| | | value: 'name' |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择内容', |
| | | trigger: 'change' |
| | | } |
| | | ], |
| | | children: { |
| | | border: true, |
| | | column: [{ |
| | |
| | | prop: 'label' |
| | | }], |
| | | }, |
| | | change: (val) => { |
| | | const list = ['linkType', 'templateId', 'SubUILayout', 'queryTemplateName', 'searchObjType']; |
| | | list.forEach(item => { |
| | | this.form[item] = ''; |
| | | }) |
| | | }, |
| | | onLoad: ({page, value, data}, callback) => { |
| | | //page分页 |
| | | // 不管是搜索 还是首次加载都会触发page 所以只需要拿page存在与否进行请求就可以 如果再去判断data搜索 或者value初次加载就会重复请求 |
| | | if (page) { |
| | | const params = { |
| | | "conditionMap[filterInputValue]": value ? value.name : '' |
| | | "conditionMap[filterInputValue]": data ? data.name : '' |
| | | }; |
| | | getBtmDatasByPage(page.currentPage, page.pageSize, params).then(res => { |
| | | callback({ |
| | |
| | | type: 'table', |
| | | display: false, |
| | | props: { |
| | | label: 'viName', |
| | | value: 'viName' |
| | | label: 'name', |
| | | value: 'name' |
| | | }, |
| | | children: { |
| | | border: true, |
| | |
| | | label: '名称', |
| | | search: true, |
| | | searchSpan: 24, |
| | | prop: 'viName' |
| | | prop: 'name' |
| | | }, { |
| | | label: '类型', |
| | | prop: 'viType' |
| | | label: '标签', |
| | | prop: 'tag' |
| | | }], |
| | | }, |
| | | onLoad: ({page, value, data}, callback) => { |
| | | if (page) { |
| | | const params = { |
| | | "conditionMap[selectBtmType]": this.form.showType, |
| | | "conditionMap[filterInputValue]": data ? data.viName : '', |
| | | }; |
| | | getPortalVIDatasByPage(page.currentPage, page.pageSize, params).then(res => { |
| | | getLinkDatasByPage(page.currentPage, page.pageSize, params).then(res => { |
| | | console.log(res); |
| | | callback({ |
| | | total: res.data.total, |
| | |
| | | }, |
| | | { |
| | | label: '选择模板', |
| | | prop: 'showTypea', |
| | | prop: 'templateId', |
| | | display: false, |
| | | type: 'table', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择模板', |
| | | trigger: 'submit' |
| | | } |
| | | ], |
| | | props: { |
| | | label: 'viName', |
| | | value: 'viName' |
| | |
| | | }, |
| | | { |
| | | label: 'UI定义', |
| | | prop: 'UI', |
| | | prop: 'SubUILayout', |
| | | type: 'table', |
| | | display: false, |
| | | props: { |
| | |
| | | label: '查询类型', |
| | | prop: 'searchType', |
| | | display: false, |
| | | value: '1', |
| | | type: 'radio', |
| | | span: 24, |
| | | dicData: [ |
| | |
| | | onLoad: ({page, value, data}, callback) => { |
| | | if (page) { |
| | | const params = { |
| | | "conditionMap[selectBtmType]": this.form.showType, |
| | | "conditionMap[filterInputValue]": data ? data.qtName : '', |
| | | "conditionMap[selectBtmType]": null, // cs端有问题 暂时不展示内容 |
| | | }; |
| | | getQTInfoDatasByPage(page.currentPage, page.pageSize, params).then(res => { |
| | | getLinkDatasByPage(page.currentPage, page.pageSize, params).then(res => { |
| | | console.log(res); |
| | | callback({ |
| | | total: res.data.total, |
| | | data: res.data.data |
| | |
| | | }, |
| | | { |
| | | label: '查询模板', |
| | | prop: 'showTypes', |
| | | prop: 'queryTemplateName', |
| | | type: 'table', |
| | | display: false, |
| | | props: { |
| | |
| | | }, |
| | | { |
| | | label: '控制路径', |
| | | prop: 'kzlj', |
| | | prop: 'controlPath', |
| | | display: false, |
| | | type: 'textarea', |
| | | span: 24, |
| | | rows: 3 |
| | | }, |
| | | { |
| | | label: '根节点显示表达式', |
| | | prop: 'genjiedian', |
| | | label: '树结构展开列', |
| | | prop: 'expandCols', |
| | | labelWidth: 110, |
| | | display: false, |
| | | labelWidth: 135, |
| | | span: 24 |
| | | }, |
| | | { |
| | | label: '树节点显示表达式', |
| | | prop: 'shujiedian', |
| | | display: false, |
| | | labelWidth: 135, |
| | | span: 24 |
| | | span: 12 |
| | | }, |
| | | { |
| | | label: '参照树设置', |
| | | prop: 'canzhaoshu', |
| | | prop: 'showLinkAbs', |
| | | display: false, |
| | | }, |
| | | { |
| | | label: '分隔符', |
| | | prop: 'fgf', |
| | | prop: 'separator', |
| | | display: false, |
| | | }, |
| | | { |
| | | label: '展开方式', |
| | | prop: 'zkfs', |
| | | prop: 'expandMode', |
| | | display: false, |
| | | type: 'radio', |
| | | value:'1', |
| | | dicData: [ |
| | | { |
| | | label: '逐级展开', |
| | |
| | | }, |
| | | { |
| | | label: '全部展开', |
| | | value: '2' |
| | | value: '0' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: '根节点显示表达式', |
| | | prop: 'rootContent', |
| | | display: false, |
| | | labelWidth: 135, |
| | | span: 12 |
| | | }, |
| | | { |
| | | label: '树节点显示表达式', |
| | | prop: 'showAbs', |
| | | display: false, |
| | | labelWidth: 135, |
| | | span: 12 |
| | | }, |
| | | ] |
| | | }, |
| | |
| | | this.$refs.crud.rowAdd(); |
| | | }, |
| | | |
| | | // 修改 |
| | | editBtnClick(row) { |
| | | console.log(row); |
| | | this.eventData = []; |
| | | if (row.eventKey && row.eventValue) { |
| | | let keys = row.eventKey.split(','); |
| | | let values = row.eventValue.split(','); |
| | | |
| | | this.eventData = keys.map((key, index) => { |
| | | return { |
| | | index: this.eventData.length, |
| | | eventKey: key.trim(), |
| | | eventValue: values[index], |
| | | $cellEdit: true |
| | | }; |
| | | }); |
| | | } |
| | | this.$refs.crud.rowEdit(row); |
| | | }, |
| | | |
| | | // 保存 |
| | | rowSaveHandler(row,done,loading){ |
| | | if(row.templateType === '6'){ |
| | | row.SubUIObjType = row.showType; |
| | | row.showType = ""; |
| | | } |
| | | console.log(this.sourceData); |
| | | const params = { |
| | | ...row, |
| | | tabPageOId:this.sourceData.plOId |
| | | } |
| | | addPageDefination(params).then(res => { |
| | | console.log(res); |
| | | if(res.data.code === 200){ |
| | | this.$message.success(res.data.obj); |
| | | done() |
| | | } |
| | | }).catch(err=> { |
| | | loading(); |
| | | }) |
| | | }, |
| | | |
| | | // 对话框表格行点击 |
| | | formDataRowClick(row) { |
| | | this.formDataRow = row; |
| | |
| | | // 模板类型为表格 |
| | | templateTypeTable(val) { |
| | | if (!val) return; |
| | | this.updateDisplay(val, ['showType', 'showTypea', 'showTypes']); |
| | | this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName']); |
| | | }, |
| | | |
| | | // 模板类型为自定义模板 |
| | |
| | | if (!val) return; |
| | | const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 获取搜索类型配置项 |
| | | searchTarger.display = false; // 不展示搜索类型 |
| | | this.updateDisplay(val, ['kzlj']); |
| | | this.updateDisplay(val, ['controlPath']); |
| | | }, |
| | | |
| | | // 模板类型为树表 |
| | | templateTypeTreeTable(val) { |
| | | if (!val) return; |
| | | this.updateDisplay(val, ['showType', 'showTypea', 'showTypes', 'zkl', 'zkfs']); |
| | | this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName', 'expandCols', 'zkfs']); |
| | | }, |
| | | |
| | | // 模板类型为表单 |
| | | templateTypeForm(val) { |
| | | if (!val) return; |
| | | this.updateDisplay(val, ['showType', 'showTypea', 'showTypes']); |
| | | this.updateDisplay(val, ['showType', 'templateId', 'queryTemplateName']); |
| | | }, |
| | | |
| | | // 模板类型为树 |
| | |
| | | if (!val) return; |
| | | const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 获取搜索类型配置项 |
| | | searchTarger.display = false; // 不展示搜索类型 |
| | | this.updateDisplay(val, ['showType', 'showTypes', 'genjiedian', 'shujiedian', 'canzhaoshu', 'fgf', 'zkfs', 'linkType']); |
| | | this.updateDisplay(val, ['showType', 'queryTemplateName', 'rootContent', 'showAbs', 'showLinkAbs', 'separator', 'expandMode', 'linkType']); |
| | | }, |
| | | |
| | | // 模板类型为UI定义 |
| | |
| | | if (!val) return; |
| | | const searchTarger = this.option.column.find(item => item.prop === 'searchTarger'); // 获取搜索类型配置项 |
| | | searchTarger.display = false; // 不展示搜索类型 |
| | | this.updateDisplay(val, ['showType', 'UI', 'searchType', 'searchObjType', 'showTypes']); |
| | | this.updateDisplay(val, ['showType', 'SubUILayout', 'searchType', 'searchObjType', 'queryTemplateName']); |
| | | }, |
| | | |
| | | // 查找数组中对象索引 |