| | |
| | | import request from '@/utils/request' |
| | | |
| | | // ç»ç»æ¶æ,æ¥è¯¢ç»ç»ä¿¡æ¯ |
| | | // export function STorgData(data) { |
| | | // return request({ |
| | | // url: 'BasicSetting/STorgData', |
| | | // method: 'get', |
| | | // params: data |
| | | // }) |
| | | // } |
| | | export function STorgData(data) { |
| | | return request({ |
| | | url: 'BasicSetting/STorgData', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // ç»ç»æ¶ææ¥æ¾ |
| | | export function PrentOrganization(data) { |
| | | return request({ |
| | | url: 'BasicSetting/PrentOrganization', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // ç»ç»æ¶ææ°å¢ |
| | | export function AddUpdateOrganization(data) { |
| | | return request({ |
| | | url: 'BasicSetting/AddUpdateOrganization', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // ç»ç»æ¶æå é¤ |
| | | export function DeleteOrganization(data) { |
| | | return request({ |
| | | url: 'BasicSetting/DeleteOrganization', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // å²ä½ä¿¡æ¯å表æ¥è¯¢ |
| | | export function PostData(data) { |
| | | return request({ |
| | | url: 'BasicSetting/PostData', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // å²ä½æ°å¢æ´æ° |
| | | export function AddUpdatePost(data) { |
| | | return request({ |
| | | url: 'BasicSetting/AddUpdatePost', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | // å²ä½å é¤ |
| | | export function DeletePost(data) { |
| | | return request({ |
| | | url: 'BasicSetting/DeletePost', |
| | | method: 'post', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // è§è²æéæ¥è¯¢è§è² |
| | | export function RolePermissionSearchRole(data) { |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // è§è²æ°å¢ãç¼è¾ä¿å |
| | | export function RoleAddUpdateSava(data) { |
| | | return request({ |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // è§è²å é¤ |
| | | export function RoleDeleteSava(data) { |
| | | return request({ |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // è§è²æéæäº¤ |
| | | export function RolePermissionSava(data, rolecode, type) { |
| | | return request({ |
| | |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // æ°æ®æéåºç¡èµæ |
| | | export function DataPermissions() { |
| | | return request({ |
| | |
| | | </el-tooltip> |
| | | |
| | | <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA;cursor: pointer"> |
| | | <!-- {{ stu_torgname }}--> |
| | | {{ stu_torgname }} |
| | | |
| | | <el-dropdown v-if="stu_torgname.toString().length>0" class="avatar-container" trigger="hover"> |
| | | <div class="avatar-wrapper"> |
| | | <div style="display: flex;align-items: center;margin-top: -5px"> |
| | | <!-- <el-dropdown v-if="stu_torgname.toString().length>0" class="avatar-container" trigger="hover">--> |
| | | <!-- <div class="avatar-wrapper">--> |
| | | <!-- <div style="display: flex;align-items: center;margin-top: -5px">--> |
| | | |
| | | <i class="el-icon-office-building" style="font-weight: bolder;font-size: 18px;margin-right: 5px;color:#A7A7A7" /> |
| | | <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA">{{ stu_torgname }}</div> |
| | | </div> |
| | | <!-- <i class="el-icon-office-building" style="font-weight: bolder;font-size: 18px;margin-right: 5px;color:#A7A7A7" />--> |
| | | <!-- <div style=" font-size: 18px;font-family: 'Microsoft YaHei';color:#AAAAAA">{{ stu_torgname }}</div>--> |
| | | <!-- </div>--> |
| | | |
| | | </div> |
| | | <el-dropdown-menu |
| | | v-if="stu_torgname.toString().length>0" |
| | | slot="dropdown" |
| | | class="user-dropdown" |
| | | style="text-align: center" |
| | | > |
| | | <el-dropdown-item |
| | | v-for="(item,index) in $stu_torg" |
| | | :key="item.torg_code" |
| | | :divided="index!==0" |
| | | @click.native="changeTrog(item)" |
| | | > |
| | | <span style="display:block;">{{ item.torg_name }}</span> |
| | | </el-dropdown-item> |
| | | <!-- </div>--> |
| | | <!-- <el-dropdown-menu--> |
| | | <!-- v-if="stu_torgname.toString().length>0"--> |
| | | <!-- slot="dropdown"--> |
| | | <!-- class="user-dropdown"--> |
| | | <!-- style="text-align: center"--> |
| | | <!-- >--> |
| | | <!-- <el-dropdown-item--> |
| | | <!-- v-for="(item,index) in $stu_torg"--> |
| | | <!-- :key="item.torg_code"--> |
| | | <!-- :divided="index!==0"--> |
| | | <!-- >--> |
| | | <!-- <!– @click.native="changeTrog(item)"–>--> |
| | | <!-- <span style="display:block;">{{ item.torg_name }}</span>--> |
| | | <!-- </el-dropdown-item>--> |
| | | |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | <!-- </el-dropdown-menu>--> |
| | | <!-- </el-dropdown>--> |
| | | |
| | | </div> |
| | | <!-- <el-tooltip content="Global Size" effect="dark" placement="bottom">--> |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | changeTrog(val) { |
| | | if (val.torg_name !== this.stu_torgname) { |
| | | this.stu_torgname = val.torg_name |
| | | localStorage.setItem('torg_code', val.torg_code) |
| | | localStorage.setItem('torg_name', val.torg_name) |
| | | |
| | | store.dispatch('user/getMenu') |
| | | // this.$store.state.tagsView.visitedViews = this.$store.state.tagsView.visitedViews.filter(i => i.title === 'ç³»ç»é¦é¡µ') |
| | | } |
| | | }, |
| | | // changeTrog(val) { |
| | | // if (val.torg_name !== this.stu_torgname) { |
| | | // this.stu_torgname = val.torg_name |
| | | // localStorage.setItem('torg_code', val.torg_code) |
| | | // localStorage.setItem('torg_name', val.torg_name) |
| | | // |
| | | // store.dispatch('user/getMenu') |
| | | // // this.$store.state.tagsView.visitedViews = this.$store.state.tagsView.visitedViews.filter(i => i.title === 'ç³»ç»é¦é¡µ') |
| | | // } |
| | | // }, |
| | | // 建ç«hubè¿æ¥ |
| | | async getHubConnectionBuilder() { |
| | | const url = 'http://121.196.36.24:8019/chatHub' |
| | |
| | | // jwtè§£å¯è·åç¨æ·ç¼ç |
| | | const jwt = decode(localStorage.getItem('token')) |
| | | localStorage.setItem('usercode', jwt.usercode) |
| | | localStorage.setItem('torg_name', jwt.storg_name) |
| | | localStorage.setItem('torg_code', jwt.storg_code) |
| | | |
| | | const code = await store.dispatch('user/getUserTorgData') |
| | | if (code === '200') { |
| | | // const code = await store.dispatch('user/getUserTorgData') |
| | | // if (code === '200') { |
| | | // æåèåä¿¡æ¯è¡¨ |
| | | const menu = await store.dispatch('user/getMenu') |
| | | // çæå¯è®¿é®çè·¯ç±è¡¨ |
| | |
| | | router.addRoutes(store.getters.addRouters) |
| | | // hackæ¹æ³ ç¡®ä¿addRoutes已宿 |
| | | next({ ...to, replace: true }) |
| | | } |
| | | // } |
| | | // // æåèåä¿¡æ¯è¡¨ |
| | | // const menu = await store.dispatch('user/getMenu') |
| | | // // çæå¯è®¿é®çè·¯ç±è¡¨ |
| | |
| | | torg_code: localStorage.getItem('torg_code') |
| | | }).then(res => { |
| | | if (res.code === '200') { |
| | | ButtonData().then(res2 => { |
| | | localStorage.setItem('ButtonData', JSON.stringify(res2.data)) |
| | | }) |
| | | |
| | | commit('SET_NAME', res.message) |
| | | commit('SET_MENU', res.data) |
| | | resolve(res.data) |
| | |
| | | /*justify-content: space-between;*/ |
| | | /*justify-content: space-around;*/ |
| | | width: 100%; |
| | | height:50px; |
| | | flex-wrap: wrap; |
| | | } |
| | | |
| | |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div |
| | | class="elTableDiv" |
| | | > |
| | | |
| | | <div style="width: 300px;background:#fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">ç»ç»åç§°</div> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button> |
| | | </div> |
| | | |
| | | <!-- <div style="margin-right:10px">--> |
| | | <!-- <i class="el-icon-plus" style="cursor: pointer;color: #999" />--> |
| | | <!-- </div>--> |
| | | <!-- @click="rolePlusClick"--> |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | style="padding: 10px;overflow: auto" |
| | | :style="{height:(tableHeight-20)+'px'}" |
| | | :data="treeLeft" |
| | | node-key="code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | draggable |
| | | :allow-drop="treeLeftAllowDrop" |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <!-- @node-click="treeLeftNodeClick"--> |
| | | |
| | | <span slot-scope="{ node, data }" class="custom-tree-node"> |
| | | <span v-if="!data.isEdit">{{ data.name }}</span> |
| | | <input |
| | | v-if="data.isEdit" |
| | | :ref="data.code" |
| | | v-model="data.name" |
| | | type="text" |
| | | @click.stop |
| | | @blur="treeSave(data)" |
| | | @keyup.enter="treeSave(data)" |
| | | > |
| | | |
| | | <span v-if="!data.isEdit"> |
| | | <i |
| | | class="el-icon-plus" |
| | | style="margin-right:10px;color: #999" |
| | | @click.stop="val=>treeAddClick(val,node,data)" |
| | | /> |
| | | <i |
| | | v-if="data.code!=='000'" |
| | | class="el-icon-edit" |
| | | style="margin-right:10px;color: #999" |
| | | @click.stop="val=>treeEditClick(val,node,data)" |
| | | /> |
| | | <i |
| | | v-if="data.code!=='000'" |
| | | class="el-icon-delete" |
| | | style="margin-right: 4px;color: #999" |
| | | @click.stop="val=>treeDeleteClick(val,node,data)" |
| | | /> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | <div class="elForm"> |
| | | <el-form-item label="ç»ç»ç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.storg_code" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ç»åç§°" style=" display: flex;"> |
| | | <el-input v-model="form.storg_name" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | <div |
| | | style="margin-left: 10px;width:100%;position: relative" |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getSTorgData">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="(tableHeight-40)+'px'" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:(tableHeight-40)+'px',marginBottom:'10px'}" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | row-key="torg_code" |
| | | default-expand-all |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- prop="RowNum"--> |
| | | <!-- <el-table-column--> |
| | | <!-- prop="rowNum"--> |
| | | <!-- width="120"--> |
| | | <!-- fixed--> |
| | | <!-- label="åºå·"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="code" |
| | | label="ç¨æ·ç¼ç " |
| | | prop="torg_code" |
| | | label="ç»ç»ç¼ç " |
| | | sortable="custom" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æä½"--> |
| | | <!-- width="120"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top">--> |
| | | <!-- <i class="el-icon-edit-outline" @click="edit('edit',row)" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">--> |
| | | <!-- <i class="el-icon-delete" @click="del(row)" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column |
| | | prop="torg_name" |
| | | label="ç»ç»åç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">æ£å¸¸</el-tag> |
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">åç¨</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | label="å建人å" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="å建æ¶é´" |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-edit-outline" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="del(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getOrganizationSearch" |
| | | @pagination="getSTorgData" |
| | | /> |
| | | |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="ç»ç»ç¼ç " prop="OrganCode"> |
| | | <el-input v-model="dialogForm.OrganCode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ç»åç§°" prop="OrganName"> |
| | | <el-input v-model="dialogForm.OrganName" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ç»ç»" prop="parent_id"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | v-model="dialogForm.parent_id" |
| | | :options="cascaderOptions" |
| | | filterable |
| | | :props="defaultProps" |
| | | :show-all-levels="false" |
| | | @change="cascaderChange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item required label="ç»ç»ç¶æ"> |
| | | <el-radio-group v-model="dialogForm.status"> |
| | | <el-radio label="Y">æ£å¸¸</el-radio> |
| | | <el-radio label="N">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button v-waves type="primary" @click="dialogVisibleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateOrganization, |
| | | DeleteOrganization, |
| | | PrentOrganization, |
| | | STorgData |
| | | } from '@/api/basicSettings' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import arrayToTree from 'array-to-tree' |
| | | import { throttle } from '@/utils/debounceAndThrottle' |
| | | import Pagination from '@/components/Pagination' |
| | | |
| | | export default { |
| | | name: 'RoleList', |
| | | directives: { waves }, |
| | | name: 'Zzjg', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | |
| | | treeLeft: [ |
| | | { |
| | | code: '000', |
| | | name: '大å²çµå¨', |
| | | isEdit: false, |
| | | children: [ |
| | | { |
| | | code: '001', |
| | | name: 'ç åé¨', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '002', |
| | | name: 'éå®é¨', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '003', |
| | | name: 'ç产é¨', |
| | | isEdit: false, |
| | | children: [ |
| | | { |
| | | code: '004', |
| | | name: 'é工车é´ä¸', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '005', |
| | | name: 'é工车é´äº', |
| | | isEdit: false, |
| | | children: [] |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | ], // 左侧æ |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | tableData: [ |
| | | { code: '001' }, |
| | | { code: '002' }, |
| | | { code: '003' } |
| | | ], |
| | | form: { |
| | | page: 1, |
| | | rows: 20 |
| | | storg_code: '', // ç»ç»æ¶æç¼ç |
| | | storg_name: '', // ç»ç»æ¶æåç§° |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | total: 0 |
| | | total: 10, |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | OrganCode: '', // ç»ç»ç¼ç |
| | | OrganName: '', // ç»ç»åç§° |
| | | leve: 0, // å±çº§ç¼ç |
| | | parent_id: '', // ç¶çº§ç¼ç |
| | | torg_seq: '', // æåº |
| | | status: 'Y'// ç¶æ |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | OrganCode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | OrganName: [ |
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | parent_id: [ |
| | | { required: true, message: 'è¯·éæ©æå±ç»ç»', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | defaultProps: { |
| | | checkStrictly: true, |
| | | expandTrigger: 'hover', |
| | | value: 'torg_code', |
| | | label: 'torg_name' |
| | | }, |
| | | Options: [], |
| | | cascaderOptions: [] |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | // treeLeft: { |
| | | // handler(newValue, oldValue) { |
| | | // newValue[0].roles.forEach(i => { |
| | | // if (i.isEdit) { |
| | | // this.$nextTick(() => { |
| | | // this.$refs[i.code].focus() |
| | | // }) |
| | | // } |
| | | // }) |
| | | // }, |
| | | // deep: true |
| | | // } |
| | | }, |
| | | |
| | | created() { |
| | | |
| | | this.getSTorgData() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 75 |
| | | this.tableHeight = this.mainHeight - 50 |
| | | // ç»ç»æ¶æå¤§å表æ¥è¯¢ |
| | | async getSTorgData() { |
| | | const res = await STorgData(this.form) |
| | | this.tableData = arrayToTree(res.data, { |
| | | parentProperty: 'parent_id', |
| | | customID: 'torg_code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | this.total = res.count |
| | | }, |
| | | // ç»ç»æ¶æçº§èéæ©å¨ |
| | | async getPrentOrganization() { |
| | | const { data: res } = await PrentOrganization() |
| | | this.Options = res |
| | | this.cascaderOptions = arrayToTree(res, { |
| | | parentProperty: 'parent_id', |
| | | customID: 'torg_code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | }, |
| | | // 左侧æ å½¢æå¨å¤ç |
| | | treeLeftAllowDrop(draggingNode, dropNode, type) { |
| | | // console.log(draggingNode, dropNode, type) |
| | | // 注æçæ¯åçº§ææ½ |
| | | // if (draggingNode.level === dropNode.level) { |
| | | // return type === 'prev' || type === 'next' |
| | | // } else { |
| | | // // ä¸å级è¿è¡å¤ç |
| | | // return false |
| | | // } |
| | | }, |
| | | getTreeAttr(val) { |
| | | console.log(val, 1) |
| | | if (val['children']) { |
| | | val['children'].push({ |
| | | code: '', |
| | | name: '', |
| | | isEdit: true, |
| | | children: [] |
| | | }) |
| | | } else { |
| | | val.children.push( |
| | | { code: '', name: '', isEdit: true } |
| | | ) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs[''].focus() |
| | | }) |
| | | }, |
| | | // è§è²åç§°ä¿å éç¨é²æå½¢å¼ |
| | | treeSave: throttle(function(val) { |
| | | val.isEdit = false |
| | | |
| | | console.log('æ§è¡äºï¼') |
| | | }, 1000, true), |
| | | |
| | | treeEditClick(val, node, data) { |
| | | data.isEdit = true |
| | | this.$nextTick(() => { |
| | | this.$refs[data.code].focus() |
| | | }) |
| | | }, |
| | | treeDeleteClick(val, node, data) { |
| | | |
| | | }, |
| | | treeAddClick(val, node, data) { |
| | | // console.log(val, node, data, 2) |
| | | |
| | | // this.treeLeft = data.children.push({ code: '', name: '', isEdit: true }) |
| | | this.getTreeAttr(data) |
| | | |
| | | // console.log(this.treeLeft, 3) |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | // this.getOrganizationSearch() |
| | | this.getSTorgData() |
| | | }, |
| | | getOrganizationSearch() { |
| | | |
| | | // éç½® |
| | | reset() { |
| | | this.form.storg_code = '' |
| | | this.form.storg_name = '' |
| | | this.getSTorgData() |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | this.getPrentOrganization() |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | await this.getPrentOrganization() |
| | | this.cascaderOptions = this.filterChildren(this.cascaderOptions, row.torg_code) |
| | | this.$nextTick(() => { |
| | | this.dialogForm.OrganCode = row.torg_code |
| | | this.dialogForm.OrganName = row.torg_name |
| | | this.dialogForm.leve = parseFloat(row.leve) |
| | | this.dialogForm.torg_seq = row.torg_seq |
| | | this.dialogForm.status = row.status |
| | | this.dialogForm.parent_id = this.findParent([], row.parent_id, this.cascaderOptions).reverse() |
| | | }) |
| | | }, |
| | | filterChildren(treeData, code) { |
| | | treeData.forEach(item => { |
| | | if (code.split(',').includes(item.torg_code)) { |
| | | item.disabled = true |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, item.children.map(it => it.torg_code).join(',')) |
| | | } |
| | | } else { |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, code) |
| | | } |
| | | } |
| | | }) |
| | | return treeData |
| | | }, |
| | | // parents:ç¨äºè¿åçæ°ç»ï¼childNode:è¦æ¥è¯¢çèç¹ï¼treeDataï¼jsonæ å½¢æ°æ® |
| | | findParent(parents, childNode, treeData) { |
| | | // console.log(parents, childNode, treeData, 2) |
| | | for (let i = 0; i < treeData.length; i++) { |
| | | // ç¶èç¹æ¥è¯¢æ¡ä»¶ |
| | | if (treeData[i].torg_code === childNode) { |
| | | // 妿æ¾å°ç»æ,ä¿åå½åèç¹ |
| | | parents.push(treeData[i].torg_code) |
| | | // ç¨å½åèç¹åå»åæ°æ®æ¥æ¾å½åèç¹çç¶èç¹ |
| | | this.findParent(parents, treeData[i].parent_id, this.cascaderOptions) |
| | | break |
| | | } else { |
| | | if (treeData[i].children instanceof Array) { |
| | | // 没æ¾å°ï¼éå该èç¹çåèç¹ |
| | | this.findParent(parents, childNode, treeData[i].children) |
| | | } |
| | | } |
| | | } |
| | | return parents |
| | | }, |
| | | // å é¤æé® |
| | | async del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteOrganization({ orgcode: row.torg_code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getSTorgData() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.OrganCode = '' |
| | | this.dialogForm.OrganName = '' |
| | | this.dialogForm.parent_id = '' |
| | | this.dialogForm.status = 'Y' |
| | | this.dialogForm.leve = 0 |
| | | this.$refs.cascader.checkedValue = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | cascaderChange(val) { |
| | | const temp = this.Options.find(i => i.torg_code === val[val.length - 1]) |
| | | this.dialogForm.parent_id = val |
| | | this.dialogForm.leve = parseFloat(temp.leve) + 1 |
| | | this.dialogForm.torg_seq = this.Options.filter(i => i.parent_id === val[val.length - 1]).length + 1 |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.dialogForm.parent_id = this.dialogForm.parent_id[this.dialogForm.parent_id.length - 1] |
| | | AddUpdateOrganization(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogVisible = false |
| | | this.getSTorgData() |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 200 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .custom-tree-node { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | font-size: 14px; |
| | | padding-right: 8px; |
| | | } |
| | | |
| | | //::v-deep .el-checkbox__label { |
| | | // width: 55px; |
| | | //} |
| | | // |
| | | .el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover { |
| | | color: #000 !important; |
| | | } |
| | | </style> |
| | |
| | | <template /> |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="å²ä½ç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.postcode" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="å²ä½åç§°" style=" display: flex;"> |
| | | <el-input v-model="form.postname" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getPostData">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | row-key="torg_code" |
| | | default-expand-all |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <el-table-column |
| | | prop="rowNum" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="postcode" |
| | | label="å²ä½ç¼ç " |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="postname" |
| | | label="å²ä½åç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">æ£å¸¸</el-tag> |
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">åç¨</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="description" |
| | | label="æè¿°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | label="å建人å" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="å建æ¶é´" |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-edit-outline" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="del(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getPostData" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="å²ä½ç¼ç " prop="postcode"> |
| | | <el-input v-model="dialogForm.postcode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="å²ä½åç§°" prop="postname"> |
| | | <el-input v-model="dialogForm.postname" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æè¿°"> |
| | | <el-input |
| | | v-model="dialogForm.description" |
| | | type="textarea" |
| | | style="width: 200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item required label="å²ä½ç¶æ"> |
| | | <el-radio-group v-model="dialogForm.status"> |
| | | <el-radio label="Y">æ£å¸¸</el-radio> |
| | | <el-radio label="N">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button v-waves type="primary" @click="dialogVisibleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateOrganization, AddUpdatePost, |
| | | DeleteOrganization, DeletePost, PostData, |
| | | PrentOrganization, |
| | | STorgData |
| | | } from '@/api/basicSettings' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | |
| | | export default { |
| | | name: 'PostList' |
| | | name: 'Zzjg', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | postcode: '', // ç»ç»æ¶æç¼ç |
| | | postname: '', // ç»ç»æ¶æåç§° |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | total: 10, |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | postcode: '', // ç»ç»ç¼ç |
| | | postname: '', // ç»ç»åç§° |
| | | description: '', // æè¿° |
| | | status: 'Y'// ç¶æ |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | postcode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | postname: [ |
| | | { required: true, message: '请è¾å
¥å²ä½åç§°', trigger: ['blur', 'change'] } |
| | | ] |
| | | } |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getPostData() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // ç»ç»æ¶æå¤§å表æ¥è¯¢ |
| | | async getPostData() { |
| | | const res = await PostData(this.form) |
| | | this.tableData = res.data |
| | | this.total = res.count |
| | | }, |
| | | |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getPostData() |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.form.postcode = '' |
| | | this.form.postname = '' |
| | | this.getPostData() |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | |
| | | this.$nextTick(() => { |
| | | this.dialogForm.postcode = row.postcode |
| | | this.dialogForm.postname = row.postname |
| | | this.dialogForm.description = row.description |
| | | this.dialogForm.status = row.status |
| | | }) |
| | | }, |
| | | // å é¤æé® |
| | | async del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeletePost({ postcode: row.postcode }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getPostData() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.postcode = '' |
| | | this.dialogForm.postname = '' |
| | | this.dialogForm.status = 'Y' |
| | | this.dialogForm.description = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | AddUpdatePost(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogVisible = false |
| | | this.getPostData() |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 200 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 255 |
| | | this.tableHeight = this.mainHeight - 245 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div |
| | | class="elTableDiv" |
| | | > |
| | | |
| | | <div style="width: 300px;background:#fff"> |
| | | |
| | | <div style="margin: 20px 10px 0 10px;display: flex;justify-content: space-between;"> |
| | | <div style="display: flex;"> |
| | | <div |
| | | style="width: 5px;height: 100%;border-radius: 5px;" |
| | | :style="{background:$store.state.settings.theme}" |
| | | /> |
| | | <div style="margin-left: 8px;">ç»ç»åç§°</div> |
| | | </div> |
| | | |
| | | <!-- <div style="margin-right:10px">--> |
| | | <!-- <i class="el-icon-plus" style="cursor: pointer;color: #999" />--> |
| | | <!-- </div>--> |
| | | <!-- @click="rolePlusClick"--> |
| | | </div> |
| | | |
| | | <el-tree |
| | | ref="treeLeftRef" |
| | | style="padding: 10px;overflow: auto" |
| | | :style="{height:(tableHeight-20)+'px'}" |
| | | :data="treeLeft" |
| | | node-key="code" |
| | | highlight-current |
| | | :props="defaultPropsLeft" |
| | | :default-expand-all="true" |
| | | :expand-on-click-node="false" |
| | | draggable |
| | | :allow-drop="treeLeftAllowDrop" |
| | | > |
| | | <!-- @node-click="treeLeftNodeClick"--> |
| | | |
| | | <span slot-scope="{ node, data }" class="custom-tree-node"> |
| | | <span v-if="!data.isEdit">{{ data.name }}</span> |
| | | <input |
| | | v-if="data.isEdit" |
| | | :ref="data.code" |
| | | v-model="data.name" |
| | | type="text" |
| | | @click.stop |
| | | @blur="treeSave(data)" |
| | | @keyup.enter="treeSave(data)" |
| | | > |
| | | |
| | | <span v-if="!data.isEdit"> |
| | | <i |
| | | class="el-icon-plus" |
| | | style="margin-right:10px;color: #999" |
| | | @click.stop="val=>treeAddClick(val,node,data)" |
| | | /> |
| | | <i |
| | | v-if="data.code!=='000'" |
| | | class="el-icon-edit" |
| | | style="margin-right:10px;color: #999" |
| | | @click.stop="val=>treeEditClick(val,node,data)" |
| | | /> |
| | | <i |
| | | v-if="data.code!=='000'" |
| | | class="el-icon-delete" |
| | | style="margin-right: 4px;color: #999" |
| | | @click.stop="val=>treeDeleteClick(val,node,data)" |
| | | /> |
| | | </span> |
| | | </span> |
| | | </el-tree> |
| | | </div> |
| | | |
| | | <div |
| | | style="margin-left: 10px;width:100%;position: relative" |
| | | > |
| | | |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="(tableHeight-40)+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:(tableHeight-40)+'px',marginBottom:'10px'}" |
| | | highlight-current-row |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- prop="RowNum"--> |
| | | <el-table-column |
| | | type="index" |
| | | width="50" |
| | | fixed |
| | | label="åºå·" |
| | | /> |
| | | <el-table-column |
| | | prop="code" |
| | | label="ç¨æ·ç¼ç " |
| | | sortable="custom" |
| | | /> |
| | | <!-- <el-table-column--> |
| | | <!-- label="æä½"--> |
| | | <!-- width="120"--> |
| | | <!-- fixed="right"--> |
| | | <!-- >--> |
| | | <!-- <template slot-scope="{row}">--> |
| | | <!-- <div class="operationClass">--> |
| | | <!-- <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top">--> |
| | | <!-- <i class="el-icon-edit-outline" @click="edit('edit',row)" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top">--> |
| | | <!-- <i class="el-icon-delete" @click="del(row)" />--> |
| | | <!-- </el-tooltip>--> |
| | | <!-- </div>--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | </el-table> |
| | | |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getOrganizationSearch" |
| | | /> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import waves from '@/directive/waves' |
| | | import arrayToTree from 'array-to-tree' |
| | | import { throttle } from '@/utils/debounceAndThrottle' |
| | | import Pagination from '@/components/Pagination' |
| | | |
| | | export default { |
| | | name: 'RoleList', |
| | | directives: { waves }, |
| | | components: { |
| | | Pagination |
| | | }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | |
| | | treeLeft: [ |
| | | { |
| | | code: '000', |
| | | name: '大å²çµå¨', |
| | | isEdit: false, |
| | | children: [ |
| | | { |
| | | code: '001', |
| | | name: 'ç åé¨', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '002', |
| | | name: 'éå®é¨', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '003', |
| | | name: 'ç产é¨', |
| | | isEdit: false, |
| | | children: [ |
| | | { |
| | | code: '004', |
| | | name: 'é工车é´ä¸', |
| | | isEdit: false, |
| | | children: [] |
| | | }, { |
| | | code: '005', |
| | | name: 'é工车é´äº', |
| | | isEdit: false, |
| | | children: [] |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | ], // 左侧æ |
| | | defaultPropsLeft: { |
| | | children: 'children', |
| | | label: 'name' |
| | | }, |
| | | tableData: [ |
| | | { code: '001' }, |
| | | { code: '002' }, |
| | | { code: '003' } |
| | | ], |
| | | form: { |
| | | page: 1, |
| | | rows: 20 |
| | | }, |
| | | total: 0 |
| | | |
| | | } |
| | | }, |
| | | watch: { |
| | | // treeLeft: { |
| | | // handler(newValue, oldValue) { |
| | | // newValue[0].roles.forEach(i => { |
| | | // if (i.isEdit) { |
| | | // this.$nextTick(() => { |
| | | // this.$refs[i.code].focus() |
| | | // }) |
| | | // } |
| | | // }) |
| | | // }, |
| | | // deep: true |
| | | // } |
| | | }, |
| | | |
| | | created() { |
| | | |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 75 |
| | | this.tableHeight = this.mainHeight - 50 |
| | | }) |
| | | }, |
| | | // 左侧æ å½¢æå¨å¤ç |
| | | treeLeftAllowDrop(draggingNode, dropNode, type) { |
| | | // console.log(draggingNode, dropNode, type) |
| | | // 注æçæ¯åçº§ææ½ |
| | | if (draggingNode.level === dropNode.level) { |
| | | return type === 'prev' || type === 'next' |
| | | } else { |
| | | // ä¸å级è¿è¡å¤ç |
| | | return false |
| | | } |
| | | }, |
| | | getTreeAttr(val) { |
| | | console.log(val, 1) |
| | | if (val['children']) { |
| | | val['children'].push({ |
| | | code: '', |
| | | name: '', |
| | | isEdit: true, |
| | | children: [] |
| | | }) |
| | | } else { |
| | | val.children.push( |
| | | { code: '', name: '', isEdit: true } |
| | | ) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs[''].focus() |
| | | }) |
| | | }, |
| | | // è§è²åç§°ä¿å éç¨é²æå½¢å¼ |
| | | treeSave: throttle(function(val) { |
| | | val.isEdit = false |
| | | |
| | | console.log('æ§è¡äºï¼') |
| | | }, 1000, true), |
| | | |
| | | treeEditClick(val, node, data) { |
| | | data.isEdit = true |
| | | this.$nextTick(() => { |
| | | this.$refs[data.code].focus() |
| | | }) |
| | | }, |
| | | treeDeleteClick(val, node, data) { |
| | | |
| | | }, |
| | | treeAddClick(val, node, data) { |
| | | // console.log(val, node, data, 2) |
| | | |
| | | // this.treeLeft = data.children.push({ code: '', name: '', isEdit: true }) |
| | | this.getTreeAttr(data) |
| | | |
| | | // console.log(this.treeLeft, 3) |
| | | }, |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | // this.getOrganizationSearch() |
| | | }, |
| | | getOrganizationSearch() { |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .custom-tree-node { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | font-size: 14px; |
| | | padding-right: 8px; |
| | | } |
| | | |
| | | //::v-deep .el-checkbox__label { |
| | | // width: 55px; |
| | | //} |
| | | // |
| | | .el-icon-plus:hover, .el-icon-edit:hover, .el-icon-delete:hover { |
| | | color: #000 !important; |
| | | } |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <div class="body" :style="{height:mainHeight+'px'}"> |
| | | <div class="bodyTopButtonGroup" style="justify-content: space-between"> |
| | | <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">æ°å¢</el-button> |
| | | </div> |
| | | |
| | | <div class="bodyTopFormGroup"> |
| | | <el-form |
| | | ref="form" |
| | | :model="form" |
| | | label-width="100px" |
| | | inline |
| | | style="display: flex;" |
| | | > |
| | | <div class="elForm"> |
| | | <el-form-item label="ç»ç»ç¼ç " style=" display: flex;"> |
| | | <el-input v-model="form.storg_code" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ç»åç§°" style=" display: flex;"> |
| | | <el-input v-model="form.storg_name" placeholder="请è¾å
¥" style="width: 200px" /> |
| | | </el-form-item> |
| | | </div> |
| | | <div |
| | | class="bodySearchReset" |
| | | :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}" |
| | | > |
| | | <el-button v-waves type="primary" icon="el-icon-search" @click="getSTorgData">æ¥è¯¢</el-button> |
| | | <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">éç½®</el-button> |
| | | </div> |
| | | </el-form> |
| | | |
| | | </div> |
| | | |
| | | <div class="elTableDiv"> |
| | | <el-table |
| | | ref="tableDataRef" |
| | | class="tableFixed" |
| | | :data="tableData" |
| | | :height="tableHeight+'px'" |
| | | border |
| | | row-class-name="custom-row" |
| | | :style="{width: 100+'%',height:tableHeight+'px',}" |
| | | highlight-current-row |
| | | row-key="torg_code" |
| | | default-expand-all |
| | | :header-cell-style="this.$headerCellStyle" |
| | | :cell-style="this.$cellStyle" |
| | | @sort-change="sortChange" |
| | | > |
| | | <!-- <el-table-column--> |
| | | <!-- prop="rowNum"--> |
| | | <!-- width="120"--> |
| | | <!-- fixed--> |
| | | <!-- label="åºå·"--> |
| | | <!-- />--> |
| | | <el-table-column |
| | | prop="torg_code" |
| | | label="ç»ç»ç¼ç " |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="torg_name" |
| | | label="ç»ç»åç§°" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="status" |
| | | label="ç¶æ" |
| | | sortable="custom" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-tag v-if="row.status==='Y'" size="small" type="success">æ£å¸¸</el-tag> |
| | | <el-tag v-if="row.status==='N'" size="small" type="danger">åç¨</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="lm_user" |
| | | label="å建人å" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | prop="lm_date" |
| | | label="å建æ¶é´" |
| | | width="160" |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="æä½" |
| | | width="120" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <div class="operationClass"> |
| | | <el-tooltip class="item" effect="dark" content="ç¼è¾" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-edit-outline" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="edit('edit',row)" |
| | | /> |
| | | </el-tooltip> |
| | | <el-tooltip v-del-tab-index class="item" effect="dark" content="å é¤" placement="top"> |
| | | <i |
| | | v-if="row.leve!==0" |
| | | class="el-icon-delete" |
| | | :style="{color:$store.state.settings.theme}" |
| | | @click="del(row)" |
| | | /> |
| | | </el-tooltip> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <!--å页--> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="form.page" |
| | | :limit.sync="form.rows" |
| | | align="right" |
| | | layout="total,prev, pager, next,sizes,jumper" |
| | | popper-class="select_bottom" |
| | | @pagination="getSTorgData" |
| | | /> |
| | | </div> |
| | | |
| | | <el-dialog |
| | | v-el-drag-dialog |
| | | :title="operation==='add'?'æ°å¢':'ç¼è¾'" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :close-on-click-modal="false" |
| | | top="15vh" |
| | | @closed="handleClose" |
| | | @close="handleClose" |
| | | > |
| | | <el-form ref="dialogForm" inline :rules="dialogFormRules" :model="dialogForm" label-width="80px"> |
| | | <el-form-item label="ç»ç»ç¼ç " prop="OrganCode"> |
| | | <el-input v-model="dialogForm.OrganCode" :disabled="operation!=='add'" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="ç»ç»åç§°" prop="OrganName"> |
| | | <el-input v-model="dialogForm.OrganName" style="width: 200px" /> |
| | | </el-form-item> |
| | | <el-form-item label="æå±ç»ç»" prop="parent_id"> |
| | | <el-cascader |
| | | ref="cascader" |
| | | v-model="dialogForm.parent_id" |
| | | :options="cascaderOptions" |
| | | filterable |
| | | :props="defaultProps" |
| | | :show-all-levels="false" |
| | | @change="cascaderChange" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item required label="ç»ç»ç¶æ"> |
| | | <el-radio-group v-model="dialogForm.status"> |
| | | <el-radio label="Y">æ£å¸¸</el-radio> |
| | | <el-radio label="N">åç¨</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <div class="footerButton"> |
| | | <el-button v-waves @click="dialogVisibleCancel">å æ¶</el-button> |
| | | <el-button v-waves type="primary" @click="dialogVisibleConfirm">ç¡® å®</el-button> |
| | | </div> |
| | | </span> |
| | | </el-dialog> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Pagination from '@/components/Pagination' |
| | | import { |
| | | AddUpdateOrganization, |
| | | DeleteOrganization, |
| | | PrentOrganization, |
| | | STorgData |
| | | } from '@/api/basicSettings' |
| | | import { validateCode } from '@/utils/global' |
| | | import elDragDialog from '@/directive/el-drag-dialog' |
| | | import waves from '@/directive/waves' |
| | | import arrayToTree from 'array-to-tree' |
| | | |
| | | export default { |
| | | name: 'Zzjg', |
| | | components: { |
| | | Pagination |
| | | }, |
| | | directives: { elDragDialog, waves }, |
| | | data() { |
| | | return { |
| | | mainHeight: 0, |
| | | tableHeight: 0, |
| | | form: { |
| | | storg_code: '', // ç»ç»æ¶æç¼ç |
| | | storg_name: '', // ç»ç»æ¶æåç§° |
| | | prop: 'lm_date', // æåºå段 |
| | | order: 'desc', // æåºå段 |
| | | page: 1, // 第å 页 |
| | | rows: 20 // æ¯é¡µå¤å°æ¡ |
| | | }, |
| | | total: 10, |
| | | tableData: [], |
| | | dialogVisible: false, |
| | | dialogForm: { |
| | | OrganCode: '', // ç»ç»ç¼ç |
| | | OrganName: '', // ç»ç»åç§° |
| | | leve: 0, // å±çº§ç¼ç |
| | | parent_id: '', // ç¶çº§ç¼ç |
| | | torg_seq: '', // æåº |
| | | status: 'Y'// ç¶æ |
| | | }, |
| | | operation: '', |
| | | dialogFormRules: { |
| | | OrganCode: [ |
| | | { required: true, validator: validateCode, trigger: ['blur', 'change'] } |
| | | ], |
| | | OrganName: [ |
| | | { required: true, message: '请è¾å
¥ç»ç»åç§°', trigger: ['blur', 'change'] } |
| | | ], |
| | | parent_id: [ |
| | | { required: true, message: 'è¯·éæ©æå±ç»ç»', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | defaultProps: { |
| | | checkStrictly: true, |
| | | expandTrigger: 'hover', |
| | | value: 'torg_code', |
| | | label: 'torg_name' |
| | | }, |
| | | Options: [], |
| | | cascaderOptions: [] |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | this.getSTorgData() |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.getHeight) |
| | | this.getHeight() |
| | | }, |
| | | methods: { |
| | | // ç»ç»æ¶æå¤§å表æ¥è¯¢ |
| | | async getSTorgData() { |
| | | const res = await STorgData(this.form) |
| | | this.tableData = arrayToTree(res.data, { |
| | | parentProperty: 'parent_id', |
| | | customID: 'torg_code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | this.total = res.count |
| | | }, |
| | | // ç»ç»æ¶æçº§èéæ©å¨ |
| | | async getPrentOrganization() { |
| | | const { data: res } = await PrentOrganization() |
| | | this.Options = res |
| | | this.cascaderOptions = arrayToTree(res, { |
| | | parentProperty: 'parent_id', |
| | | customID: 'torg_code', |
| | | childrenProperty: 'children' |
| | | }) |
| | | }, |
| | | // æåºæ¹åæ¶ |
| | | sortChange({ column, prop, order }) { |
| | | if (order === 'descending') { |
| | | order = 'desc' |
| | | } else if (order === 'ascending') { |
| | | order = 'asc' |
| | | } else { |
| | | order = 'desc' |
| | | } |
| | | this.form.order = order |
| | | this.form.prop = prop |
| | | this.getSTorgData() |
| | | }, |
| | | // éç½® |
| | | reset() { |
| | | this.form.storg_code = '' |
| | | this.form.storg_name = '' |
| | | this.getSTorgData() |
| | | }, |
| | | // æ°å¢æé® |
| | | add(operation) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Add' |
| | | this.getPrentOrganization() |
| | | }, |
| | | // ä¿®æ¹æé® |
| | | async edit(operation, row) { |
| | | this.operation = operation |
| | | this.dialogVisible = true |
| | | this.dialogForm.OperType = 'Update' |
| | | await this.getPrentOrganization() |
| | | this.cascaderOptions = this.filterChildren(this.cascaderOptions, row.torg_code) |
| | | this.$nextTick(() => { |
| | | this.dialogForm.OrganCode = row.torg_code |
| | | this.dialogForm.OrganName = row.torg_name |
| | | this.dialogForm.leve = parseFloat(row.leve) |
| | | this.dialogForm.torg_seq = row.torg_seq |
| | | this.dialogForm.status = row.status |
| | | this.dialogForm.parent_id = this.findParent([], row.parent_id, this.cascaderOptions).reverse() |
| | | }) |
| | | }, |
| | | filterChildren(treeData, code) { |
| | | treeData.forEach(item => { |
| | | if (code.split(',').includes(item.torg_code)) { |
| | | item.disabled = true |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, item.children.map(it => it.torg_code).join(',')) |
| | | } |
| | | } else { |
| | | if (item.children && item.children.length > 0) { |
| | | this.filterChildren(item.children, code) |
| | | } |
| | | } |
| | | }) |
| | | return treeData |
| | | }, |
| | | // parents:ç¨äºè¿åçæ°ç»ï¼childNode:è¦æ¥è¯¢çèç¹ï¼treeDataï¼jsonæ å½¢æ°æ® |
| | | findParent(parents, childNode, treeData) { |
| | | // console.log(parents, childNode, treeData, 2) |
| | | for (let i = 0; i < treeData.length; i++) { |
| | | // ç¶èç¹æ¥è¯¢æ¡ä»¶ |
| | | if (treeData[i].torg_code === childNode) { |
| | | // 妿æ¾å°ç»æ,ä¿åå½åèç¹ |
| | | parents.push(treeData[i].torg_code) |
| | | // ç¨å½åèç¹åå»åæ°æ®æ¥æ¾å½åèç¹çç¶èç¹ |
| | | this.findParent(parents, treeData[i].parent_id, this.cascaderOptions) |
| | | break |
| | | } else { |
| | | if (treeData[i].children instanceof Array) { |
| | | // 没æ¾å°ï¼éå该èç¹çåèç¹ |
| | | this.findParent(parents, childNode, treeData[i].children) |
| | | } |
| | | } |
| | | } |
| | | return parents |
| | | }, |
| | | // å é¤æé® |
| | | async del(row) { |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | | cancelButtonText: 'åæ¶', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | DeleteOrganization({ orgcode: row.torg_code }).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success('å 餿å!') |
| | | if (this.form.page > 1 && this.tableData.length === 1) { |
| | | this.form.page-- |
| | | } |
| | | this.getSTorgData() |
| | | } |
| | | }) |
| | | }).catch(() => { |
| | | this.$notify.info('已忶å é¤') |
| | | }) |
| | | }, |
| | | // å¯¹è¯æ¡å
³éäºä»¶ |
| | | handleClose() { |
| | | this.dialogForm.OrganCode = '' |
| | | this.dialogForm.OrganName = '' |
| | | this.dialogForm.parent_id = '' |
| | | this.dialogForm.status = 'Y' |
| | | this.dialogForm.leve = 0 |
| | | this.$refs.cascader.checkedValue = '' |
| | | this.$refs.dialogForm.clearValidate() |
| | | }, |
| | | cascaderChange(val) { |
| | | const temp = this.Options.find(i => i.torg_code === val[val.length - 1]) |
| | | this.dialogForm.parent_id = val |
| | | this.dialogForm.leve = parseFloat(temp.leve) + 1 |
| | | this.dialogForm.torg_seq = this.Options.filter(i => i.parent_id === val[val.length - 1]).length + 1 |
| | | }, |
| | | // å¯¹è¯æ¡åæ¶ |
| | | dialogVisibleCancel() { |
| | | this.dialogVisible = false |
| | | }, |
| | | // å¯¹è¯æ¡ç¡®è®¤ |
| | | dialogVisibleConfirm() { |
| | | this.$refs.dialogForm.validate(valid => { |
| | | if (valid) { |
| | | this.dialogForm.parent_id = this.dialogForm.parent_id[this.dialogForm.parent_id.length - 1] |
| | | AddUpdateOrganization(this.dialogForm).then(res => { |
| | | if (res.code === '200') { |
| | | this.$notify.success(this.operation === 'add' ? 'æ·»å æåï¼' : 'ä¿®æ¹æåï¼') |
| | | this.dialogVisible = false |
| | | this.getSTorgData() |
| | | } else { |
| | | this.$notify.error(this.operation === 'add' ? 'æ·»å 失败ï¼' : 'ä¿®æ¹å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | // è·å页é¢é«åº¦ |
| | | getHeight() { |
| | | this.$nextTick(() => { |
| | | this.mainHeight = window.innerHeight - 85 |
| | | this.tableHeight = this.mainHeight - 200 |
| | | this.$refs.tableDataRef.doLayout() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |