From 16eb67ab6b103663d30cad9ba74360f982e131cb Mon Sep 17 00:00:00 2001 From: xiangpei <xiangpei@timesnew.cn> Date: 星期二, 03 九月 2024 10:34:59 +0800 Subject: [PATCH] 自定义列显隐控制 --- src/views/system/unit/index.vue | 31 ++++++++++++++++++++++++------- 1 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/views/system/unit/index.vue b/src/views/system/unit/index.vue index 4409bfa..15d508e 100644 --- a/src/views/system/unit/index.vue +++ b/src/views/system/unit/index.vue @@ -31,8 +31,8 @@ ></el-date-picker> </el-form-item> <el-form-item> - <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> - <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="small" @click="resetQuery">閲嶇疆</el-button> </el-form-item> </el-form> @@ -44,6 +44,7 @@ icon="el-icon-plus" size="mini" @click="handleAdd" + v-hasPermi="['unit:add']" >鏂板</el-button> </el-col> <el-col :span="1.5"> @@ -54,6 +55,7 @@ size="mini" :disabled="single" @click="handleUpdate" + v-hasPermi="['unit:edit']" >淇敼</el-button> </el-col> <el-col :span="1.5"> @@ -64,6 +66,7 @@ size="mini" :disabled="multiple" @click="handleDelete" + v-hasPermi="['unit:remove']" >鍒犻櫎</el-button> </el-col> <el-col :span="1.5"> @@ -73,6 +76,7 @@ icon="el-icon-download" size="mini" @click="handleExport" + v-hasPermi="['unit:export']" >瀵煎嚭</el-button> </el-col> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> @@ -85,7 +89,7 @@ <el-table-column label="鍗曚綅鑱旂郴浜�" align="center" prop="unitContact" /> <el-table-column label="鍗曚綅鑱旂郴浜虹數璇�" align="center" prop="unitContactPhone" /> <el-table-column label="鍗曚綅绠$悊鍛樿处鍙�" align="center" prop="unitAdminAccount" /> - <el-table-column label="澶囨敞" align="center" prop="remark" /> + <el-table-column label="澶囨敞" align="center" prop="remark" show-overflow-tooltip/> <el-table-column label="娣诲姞鏃堕棿" align="center" prop="createTime" /> <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width"> <template slot-scope="scope"> @@ -94,12 +98,14 @@ type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['unit:edit']" >淇敼</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" + v-hasPermi="['unit:remove']" >鍒犻櫎</el-button> </template> </el-table-column> @@ -123,7 +129,10 @@ <el-input v-model="form.unitName" placeholder="璇疯緭鍏ュ崟浣嶅悕绉�" /> </el-form-item> <el-form-item label="鍗曚綅璐﹀彿" prop="unitAdminAccount"> - <el-input v-model="form.unitAdminAccount" placeholder="璇疯緭鍏ュ崟浣嶇鐞嗗憳璐﹀彿" /> + <el-input v-model="form.unitAdminAccount" placeholder="璇疯緭鍏ュ崟浣嶈处鍙�" :disabled="account" /> + </el-form-item> + <el-form-item label="璐﹀彿瀵嗙爜" prop="password"> + <el-input v-model="form.password" placeholder="璇疯緭鍏ュ崟浣嶈处鍙峰瘑鐮�" :disabled="account" /> </el-form-item> <el-form-item label="鍗曚綅鑱旂郴浜�" prop="unitContact"> <el-input v-model="form.unitContact" placeholder="璇疯緭鍏ュ崟浣嶈仈绯讳汉" /> @@ -136,8 +145,8 @@ </el-form-item> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> <el-button @click="cancel">鍙� 娑�</el-button> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> </div> </el-dialog> </div> @@ -150,6 +159,8 @@ name: "Unit", data() { return { + // 璐﹀彿涓嶅彲淇敼 + account: true, // 閬僵灞� loading: true, // 閫変腑鏁扮粍 @@ -196,8 +207,11 @@ { required: true, message: "鍗曚綅鑱旂郴浜虹數璇濅笉鑳戒负绌�", trigger: "blur" } ], unitAdminAccount: [ - { required: true, message: "鍗曚綅绠$悊鍛樿处鍙蜂笉鑳戒负绌�", trigger: "blur" } + { required: true, message: "鍗曚綅璐﹀彿涓嶈兘涓虹┖", trigger: "blur" } ], + password: [ + { required: true, message: "鍗曚綅璐﹀彿瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" } + ] } }; }, @@ -249,7 +263,8 @@ remark: null, createTime: null, updateTime: null, - deleted: null + deleted: null, + password: null, }; this.resetForm("form"); }, @@ -274,12 +289,14 @@ }, /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { + this.account = false; this.reset(); this.open = true; this.title = "娣诲姞杩愮淮鍗曚綅"; }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { + this.account = true; this.reset(); const id = row.id || this.ids getUnit(id).then(response => { -- Gitblit v1.8.0