ÎļþÃû´Ó Source/UBCS-WEB/src/components/code-dialog-page/referConfigDialog.vue ÐÞ¸Ä |
| | |
| | | <el-dialog |
| | | title="åç
§é
ç½®" |
| | | append-to-body |
| | | :visible.sync="isShowReferConfig" |
| | | :visible.sync="isShowReferConfigForm" |
| | | width="90%" |
| | | id="refer-config" |
| | | id="refer-config-form" |
| | | @close="recoveryDataAndForm('initData')" |
| | | style="height: 115vh; margin-top: -14vh; overflow-y: hidden"> |
| | | <el-tabs v-model="activeName" @tab-click="handleClick"> |
| | | <el-tab-pane label="èªå®ä¹åç
§é
ç½®" name="first"> |
| | | <div style="width: 100%; overflow-y: auto; height: 65vh"> |
| | | <el-row> |
| | | <avue-form ref="form" :option="formOption" v-model="form" class="referTypeForm"> |
| | | <template #referTypeName="{disabled,size}"> |
| | | <el-input :disabled="disabled" |
| | | :size="size" |
| | | v-model="form.referTypeName" |
| | | ref="referTypeName" |
| | | placeholder="è¯·éæ© åç
§çä¸å¡ç±»å" |
| | | prefix-icon="el-icon-search" |
| | | readonly="true" |
| | | @focus="openSelectionTable('referType')"> |
| | | <i v-show="!disabled" slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('referType')" style="margin-right: 5px;cursor: pointer;"></i> |
| | | </el-input> |
| | | </template> |
| | | <template #sortField="{disabled,size}"> |
| | | <el-input :disabled="disabled" |
| | | :size="size" |
| | | v-model="form.sortField" |
| | | ref="sortField" |
| | | placeholder="è¯·éæ© æåºå段" |
| | | prefix-icon="el-icon-search" |
| | | readonly="true" |
| | | @focus="openSelectionTable('sortField')"> |
| | | <i slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('sortField')" style="margin-right: 5px;cursor: pointer;"></i> |
| | | </el-input> |
| | | </template> |
| | | </avue-form> |
| | | </el-row> |
| | | <el-row v-show="form.type=='default' || form.type=='grid'"> |
| | | <avue-crud |
| | | ref="crudAttr" |
| | | class="crud-attr" |
| | | :option="attrOption" |
| | | @cell-click="clickAttrEdit" |
| | | :data="attrData"> |
| | | <!-- è¡¨æ ¼å
æä½æé® --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-search" |
| | | plain |
| | | @click="scope.row.isquery=!scope.row.isquery"> |
| | | {{scope.row.isquery ? "åæ¶å¿«éæ¥è¯¢":"å¿«éæ¥è¯¢"}} |
| | | </el-button> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-minus" |
| | | plain |
| | | @click="removeCurrentRow(scope.row,'removeAttr')">ç§»é¤ |
| | | </el-button> |
| | | </template> |
| | | <!-- è¡¨æ ¼å·¦ä¸æ¹æé®åºå --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | icon="el-icon-plus" |
| | | @click="openSelectionTable('selectAttr')">鿩屿§ |
| | | </el-button> |
| | | <div class="tag-group" style="display: inline"> |
| | | <el-tag |
| | | v-for="item in attrData" |
| | | v-show="item.isquery && item.title!=''" |
| | | style="margin-left: 3px" |
| | | :key="item.title" |
| | | type="info" |
| | | size="small" |
| | | effect="dark"> |
| | | {{ item.title }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px"> |
| | | <avue-crud |
| | | ref="crudAddCondition" |
| | | :option="addSearchCondtionOption" |
| | | @cell-click="clickAddSearchCondtionEdit" |
| | | :data="addSearchCondtionData"> |
| | | <!-- è¡¨æ ¼å
æä½æé® --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-minus" |
| | | plain |
| | | @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">ç§»é¤ |
| | | </el-button> |
| | | </template> |
| | | <!-- è¡¨æ ¼å·¦ä¸æ¹æé®åºå --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | icon="el-icon-plus" |
| | | @click="openSelectionTable('addSearchCondition')"> |
| | | æ·»å æ¥è¯¢æ¡ä»¶ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="ç´æ¥éååç
§é
ç½®" name="second"> |
| | | <div style="width: 100%; overflow-y: auto; height: 65vh"> |
| | | <avue-crud |
| | | :option="selectReferConfigOption" |
| | | :table-loading="selectReferConfigLoading" |
| | | :data="selectReferConfigData" |
| | | :page.sync="selectReferConfigPage" |
| | | ref="selectReferConfigCrud" |
| | | @row-click="codeRuleRowClick" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | </avue-crud> |
| | | </div> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <div style="width: 100%; overflow-y: auto; height: 70vh"> |
| | | <el-row> |
| | | <avue-form ref="form" :option="formOption" v-model="form" class="referTypeForm"> |
| | | <template #referTypeName="{disabled,size}"> |
| | | <el-input :disabled="disabled" |
| | | :size="size" |
| | | v-model="form.referTypeName" |
| | | ref="referTypeName" |
| | | placeholder="è¯·éæ© åç
§çä¸å¡ç±»å" |
| | | prefix-icon="el-icon-search" |
| | | readonly="true" |
| | | @focus="openSelectionTable('referType')"> |
| | | <i v-show="!disabled" slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('referType')" style="margin-right: 5px;cursor: pointer;"></i> |
| | | </el-input> |
| | | </template> |
| | | <template #sortField="{disabled,size}"> |
| | | <el-input :disabled="disabled" |
| | | :size="size" |
| | | v-model="form.sortField" |
| | | ref="sortField" |
| | | placeholder="è¯·éæ© æåºå段" |
| | | prefix-icon="el-icon-search" |
| | | readonly="true" |
| | | @focus="openSelectionTable('sortField')"> |
| | | <i slot="suffix" class="el-icon-circle-close" @click="clearSelectionTable('sortField')" style="margin-right: 5px;cursor: pointer;"></i> |
| | | </el-input> |
| | | </template> |
| | | </avue-form> |
| | | </el-row> |
| | | <el-row v-show="form.type=='default' || form.type=='grid'"> |
| | | <avue-crud |
| | | ref="crudAttr" |
| | | class="crud-attr" |
| | | :option="attrOption" |
| | | @cell-click="clickAttrEdit" |
| | | :data="attrData"> |
| | | <!-- è¡¨æ ¼å
æä½æé® --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-search" |
| | | plain |
| | | @click="scope.row.isquery=!scope.row.isquery"> |
| | | {{scope.row.isquery ? "åæ¶å¿«éæ¥è¯¢":"å¿«éæ¥è¯¢"}} |
| | | </el-button> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-minus" |
| | | plain |
| | | @click="removeCurrentRow(scope.row,'removeAttr')">ç§»é¤ |
| | | </el-button> |
| | | </template> |
| | | <!-- è¡¨æ ¼å·¦ä¸æ¹æé®åºå --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | icon="el-icon-plus" |
| | | @click="openSelectionTable('selectAttr')">鿩屿§ |
| | | </el-button> |
| | | <div class="tag-group" style="display: inline"> |
| | | <el-tag |
| | | v-for="item in attrData" |
| | | v-show="item.isquery && item.title!=''" |
| | | style="margin-left: 3px" |
| | | :key="item.title" |
| | | type="info" |
| | | size="small" |
| | | effect="dark"> |
| | | {{ item.title }} |
| | | </el-tag> |
| | | </div> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | <el-row style="margin-top: 10px"> |
| | | <avue-crud |
| | | ref="crudAddCondition" |
| | | :option="addSearchCondtionOption" |
| | | @cell-click="clickAddSearchCondtionEdit" |
| | | :data="addSearchCondtionData"> |
| | | <!-- è¡¨æ ¼å
æä½æé® --> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <el-button type="text" |
| | | size="small" |
| | | icon="el-icon-minus" |
| | | plain |
| | | @click="removeCurrentRow(scope.row,'removeaddSearchCondtion')">ç§»é¤ |
| | | </el-button> |
| | | </template> |
| | | <!-- è¡¨æ ¼å·¦ä¸æ¹æé®åºå --> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | icon="el-icon-plus" |
| | | @click="openSelectionTable('addSearchCondition')"> |
| | | æ·»å æ¥è¯¢æ¡ä»¶ |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </el-row> |
| | | </div> |
| | | |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="selectedListReferConfig">ç¡® å®</el-button> |
| | | <el-button @click="recoveryDataAndForm('initForm')">æ¸
空å
容</el-button> |
| | | <el-button @click="isShowReferConfig = false">å æ¶</el-button> |
| | | <el-button @click="isShowReferConfigForm = false">å æ¶</el-button> |
| | | </div> |
| | | |
| | | <el-dialog title="为ãåç
§çä¸å¡ç±»åãéåå¼" |
| | |
| | | <template #radio="{row}"> |
| | | <el-radio v-model="referBtmTypeSelectRow" |
| | | :label="row.$index"> |
| | | - |
| | | |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | <template #radio="{row}"> |
| | | <el-radio v-model="sortFieldSelectRow" |
| | | :label="row.$index"> |
| | | - |
| | | |
| | | </el-radio> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import func from "@/util/func"; |
| | | export default { |
| | | name: "referConfigDialog", |
| | | props: { |
| | | //æ¬åºæ¯åé |
| | | thisSceneTableData: { |
| | | type: Array, |
| | | }, |
| | | }, |
| | | data() { |
| | | let element = ''; |
| | | return { |
| | | //æµè¯è¡¨æ ¼è¡ç¼è¾ææ |
| | | // tableData:[{ |
| | | // field: 'id', |
| | | // title: 'ç¼å·', |
| | | // fieldType: 'text', |
| | | // fieldTypeText: 'ææ¬æ¡', |
| | | // sort: true, |
| | | // sortField: 'id', |
| | | // width: '150', |
| | | // isquery: true, |
| | | // $cellEdit: false |
| | | // },{ |
| | | // field: 'name', |
| | | // title: 'åç§°', |
| | | // fieldType: 'text', |
| | | // fieldTypeText: 'ææ¬æ¡', |
| | | // sort: true, |
| | | // sortField: 'name', |
| | | // width: '180', |
| | | // isquery: true, |
| | | // $cellEdit: false |
| | | // }], |
| | | // tableOption:{ |
| | | // tableData:[], //è¡¨æ ¼æ°æ® |
| | | // options:[] //è¡¨æ ¼é
置项信æ¯ï¼è¡¨å¤´ï¼label宽度çï¼ |
| | | // }, |
| | | |
| | | activeName: 'first', //å½åæ´»å¨çtabs |
| | | labelWidth: '150', // æ é¢å®½åº¦ |
| | | isShowReferConfig: false, // 第ä¸å±å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶ |
| | | isShowReferConfigForm: false, // 第ä¸å±å¯¹è¯æ¡æ¾ç¤ºéèæ§å¶ |
| | | referTypeIsReadOnly: false, |
| | | // 表å对象 |
| | | form: { |
| | |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | selectReferConfigOption: { |
| | | height:'auto', |
| | | tip: false, |
| | | addBtn: false, |
| | | editBtn: false, |
| | | //searchShow: false, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | index: true, |
| | | viewBtn: false, |
| | | delBtn: false, |
| | | //selection: false, |
| | | //disablePage: false, |
| | | //refreshBtn: false, |
| | | //columnBtn: false, |
| | | dialogClickModal: false, |
| | | highlightCurrentRow: true, |
| | | column: [ |
| | | { |
| | | label: "ååæ®µ(*)", |
| | | prop: "field", |
| | | },{ |
| | | label: "åå(*)", |
| | | prop: "title", |
| | | },{ |
| | | label: "åæ®µç±»å(*)", |
| | | prop: "fieldTypeText", |
| | | },{ |
| | | label: "åè¡¨å¯æåº", |
| | | prop: "sort", |
| | | },{ |
| | | label: "æåºå段", |
| | | prop: "sortField", |
| | | },{ |
| | | label: "åæ®µå®½åº¦", |
| | | prop: "width", |
| | | },{ |
| | | label: "ååºå®ä½ç½®", |
| | | prop: "fixedText", |
| | | },{ |
| | | label: "jsæ¾ç¤ºä»£ç ", |
| | | prop: "templet", |
| | | }, |
| | | ] |
| | | }, |
| | | selectReferConfigLoading: false, |
| | | selectReferConfigData: [ |
| | | { |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | fieldType: 'text', |
| | | fieldTypeText: 'ææ¬æ¡', |
| | | sort: "true", |
| | | sortField: 'id', |
| | | width: '150', |
| | | isquery: true, |
| | | },{ |
| | | field: 'name', |
| | | title: 'åç§°', |
| | | fieldType: 'text', |
| | | fieldTypeText: 'ææ¬æ¡', |
| | | sort: "true", |
| | | sortField: 'name', |
| | | width: '180', |
| | | isquery: true, |
| | | } |
| | | ], |
| | | selectReferConfigPage: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0 |
| | | }, |
| | | selectReferConfigQuery: {}, |
| | | |
| | | //为ãåç
§çä¸å¡ç±»åãéåå¼å¯¹è¯æ¡ |
| | | selectionReferBtmTypeOption: { |
| | |
| | | //type: 'table', |
| | | tip: 'æ¥è¯¢æ°æ®æ¶çæåºå段', |
| | | tipPlacement: 'right', |
| | | // children: { |
| | | // border: true, |
| | | // column: [{ |
| | | // label: '屿§è±æç¼å·', |
| | | // width: 120, |
| | | // search: true, |
| | | // searchSpan: 8, |
| | | // searchLabelWidth: 100, |
| | | // prop: 'id' |
| | | // },{ |
| | | // label: '屿§ä¸æåç§°', |
| | | // search: true, |
| | | // searchSpan: 8, |
| | | // searchLabelWidth: 100, |
| | | // prop: 'name' |
| | | // },{ |
| | | // label: '屿§é¿åº¦', |
| | | // search: false, |
| | | // prop: 'attrLength' |
| | | // },{ |
| | | // label: '屿§ç±»å', |
| | | // search: false, |
| | | // prop: 'attrType' |
| | | // }], |
| | | // }, |
| | | // è¿å¿éè¦æ·»å ä¸å¡ç±»åæ¥å£è¯·æ±å®ç°å¼¹çªçé¢è¡¨æ ¼æ¸²æ |
| | | },{ |
| | | label: 'æåºç±»å', |
| | | prop: 'sortType', |
| | |
| | | ] |
| | | } |
| | | }, |
| | | |
| | | }, |
| | | mounted() { |
| | | // 麻çè¿ä¸ªå°æ¹è°æ»æäº |
| | | this.element = document.getElementById('refer-config'); |
| | | this.element = document.getElementById('refer-config-form'); |
| | | this.element.addEventListener("click", (e) => { |
| | | //<table cellspacing="0" cellpadding="0" border="0" class="el-table__body" style="width: 911px;"> |
| | | //console.log(e.target); |
| | |
| | | this.preClickAttrRow = row; |
| | | }, |
| | | // 屿§è¡¨æ ¼è¡ç¼è¾å¤±å»ç¦ç¹æ¶ä¿åæ¹æ³ |
| | | updateAttrBlur(value){ |
| | | // updateAttrBlur(value){ |
| | | //console.log(this.attrData[0]); |
| | | |
| | | }, |
| | | // }, |
| | | // åå»è¡¨æ ¼å®ç°è¡¨æ ¼è¡ç¼è¾ |
| | | clickAddSearchCondtionEdit(row, column, event){ |
| | | if(this.preClickAddSearchConditionRow && this.preClickAddSearchConditionRow != row){ |
| | |
| | | }, |
| | | //ä¸ä¸ä¸ªé¡µé¢å·²ç»éä¸åç
§åºç¨çä¸å¡ç±»åçæ
åµï¼åä¸ä¸æ¬¡å·²ç»é
ç½®è¿åç
§é
ç½®çæ
åµä¸è¿è¡é¡µé¢åå§å渲æ |
| | | initPageData(val){ |
| | | let value = JSON.parse(val); |
| | | if(value != null || value != 'undefined' ){ |
| | | this.form = value; |
| | | //console.log(val); |
| | | if(func.notEmpty(val.referConfig)){ |
| | | this.form = JSON.parse(val.referConfig); |
| | | //console.log(val); |
| | | this.referTypeIsReadOnly = true; |
| | | return; |
| | | } |
| | | if(func.notEmpty(val.referType)){ |
| | | this.form.referTypeName = val.referTypeName; |
| | | this.form.referType = val.referType; |
| | | this.referTypeIsReadOnly = true; |
| | | return; |
| | | } |
| | | //console.log(localStorage.getItem("userId")); |
| | | }, |
| | | // 忢å½åæ´»å¨çtabs |
| | | handleClick(tab, event) { |
| | | if(tab.index=='0'){ |
| | | this.onloadAttrData(); |
| | | }else{ |
| | | //this.onloadSelectReferConfigData(); |
| | | } |
| | | }, |
| | | // éæ©å®åç
§é
ç½®ä¹åç¹å»ä¿åæé®è§¦å |
| | | selectedListReferConfig(){ |
| | |
| | | let submitForm = this.filterForm(); |
| | | //console.log(submitForm); |
| | | this.$emit('echoReferConfig', submitForm) // 触åupdate:dataå°åç»ä»¶å¼ä¼ éç»ç¶ç»ä»¶ |
| | | this.isShowReferConfig = false; |
| | | this.isShowReferConfigForm = false; |
| | | done() |
| | | } else { |
| | | for(let attr in msg) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //ä»ç¼åä¸é£form表å对象 |
| | | getLocalStoregeForm(){ |
| | | localStorage.getItem("userId"); |
| | | |
| | | }, |
| | | /** å
¶å®éå屿§è¡¨æ ¼çé»è®¤æ°æ®ä¸éè¦å è½½ï¼ |
| | | 使¯å¼¹çªæå¼ä¼æè¡¨æ ¼éè¡é®é¢æä»¥éè¦å¨è¿è°ç¨doLayoutæ¹æ³*/ |
| | | onloadAttrData(){ |
| | | this.$nextTick(() => { |
| | | this.$refs.crudAttr.doLayout() |
| | | }) |
| | | this.attrData = [ |
| | | { |
| | | field: 'id', |
| | |
| | | $cellEdit: false |
| | | } |
| | | ]; |
| | | this.$nextTick(() => { |
| | | this.$refs.crudAttr.doLayout() |
| | | }) |
| | | }, |
| | | // 屿§éæ©è¡¨æ ¼ä¸çç§»é¤æé®åè½ |
| | | removeCurrentRow(row,condition){ |
| | |
| | | */ |
| | | checkArrayIsUndefined(val){ |
| | | return typeof val === 'array' && (val.length === 0 ||val === null || typeof val === 'undefined'); |
| | | }, |
| | | onloadSelectReferConfigData(){ |
| | | this.$nextTick(() => { |
| | | this.$refs.selectReferConfigCrud.doLayout() |
| | | }) |
| | | this.selectReferConfigData = [{ |
| | | field: 'id', |
| | | title: 'ç¼å·', |
| | | fieldType: 'text', |
| | | fieldTypeText: 'ææ¬æ¡', |
| | | sort: "true", |
| | | sortField: 'id', |
| | | width: '150', |
| | | isquery: true, |
| | | },{ |
| | | field: 'name', |
| | | title: 'åç§°', |
| | | fieldType: 'text', |
| | | fieldTypeText: 'ææ¬æ¡', |
| | | sort: "true", |
| | | sortField: 'name', |
| | | width: '180', |
| | | isquery: true, |
| | | }]; |
| | | }, |
| | | // æå¼è¡¨æ ¼éæ©æ¡ |
| | | openSelectionTable(condition){ |