From 0fb6d8682c06c607f84971fd105c600e97ff07fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=AC=E9=8B=86=E5=B1=BE?= <804461479@qq.com> Date: Thu, 15 Jun 2023 11:42:13 +0800 Subject: [PATCH] tui --- .../admin/src/views/basic/set/drawershow.vue | 263 +++++++++++------- .../src/views/system/menu/dialogshow.vue | 178 +++++++----- .../admin/src/views/system/menu/list.vue | 251 +++++++++-------- 3 files changed, 396 insertions(+), 296 deletions(-) diff --git a/smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue b/smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue index a0d58dc..258e12a 100644 --- a/smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue +++ b/smart-office-manager-ui/admin/src/views/basic/set/drawershow.vue @@ -1,84 +1,138 @@ <template> - <!-- 寮瑰嚭妗嗚〃鍗� --> - <el-drawer - :title="title" - :visible.sync="open" - :direction="direction" - size="60%"> - <el-form ref="form" :model="form" :rules="rules" label-width="180px"> - <el-row> - <Field :span="20" label="鐢靛瓙闂ㄧ墝淇℃伅"> - <el-checkbox - true-label="1" - false-label="0" - v-model="form.showPhoto" - >鐓х墖</el-checkbox> + <!-- 寮瑰嚭妗嗚〃鍗� --> + <el-drawer + :title="title" + :visible.sync="open" + :direction="direction" + size="60%" + > + <el-form ref="form" :model="form" :rules="rules" label-width="180px"> + <el-row> + <Field :span="20" label="鐢靛瓙闂ㄧ墝淇℃伅"> + <el-checkbox true-label="1" false-label="0" v-model="form.showPhoto" + >鐓х墖</el-checkbox + > - <el-checkbox - true-label="1" - false-label="0" - v-model="form.showName" - >濮撳悕</el-checkbox> + <el-checkbox true-label="1" false-label="0" v-model="form.showName" + >濮撳悕</el-checkbox + > - <el-checkbox - true-label="1" - false-label="0" - v-model="form.showPost" - >鑱屼綅</el-checkbox> + <el-checkbox true-label="1" false-label="0" v-model="form.showPost" + >鑱屼綅</el-checkbox + > - <el-checkbox - true-label="1" - false-label="0" - v-model="form.showWork" - >鍦ㄥ矖鐘舵€�</el-checkbox> + <el-checkbox true-label="1" false-label="0" v-model="form.showWork" + >鍦ㄥ矖鐘舵€�</el-checkbox + > - <el-checkbox - true-label="1" - false-label="0" - v-model="form.showPhone" - >鐢佃瘽</el-checkbox> + <el-checkbox true-label="1" false-label="0" v-model="form.showPhone" + >鐢佃瘽</el-checkbox + > + </Field> + <Field + :span="20" + label="鐢靛瓙闂ㄧ墝搴曢儴淇℃伅璁剧疆" + prop="showElect" + v-model="form.showElect" + type="radio" + :enumData="dict.showElect" + placeholder="璇烽€夋嫨鏄剧ず鐢靛瓙闂ㄧ墝淇℃伅" + /> + <Field + :span="20" + label="鑷畾涔夊唴瀹�" + v-if="form.showElect == 1" + prop="showElectDesc" + type="textarea" + v-model="form.showElectDesc" + placeholder="璇疯緭鍏ユ樉绀虹數瀛愰棬鐗屼俊鎭嚜瀹氫箟鍐呭" + /> + <Field + :span="20" + label="浼氳瀹ら棬鐗屽簳閮ㄤ俊鎭缃�" + prop="showMeet" + v-model="form.showMeet" + type="radio" + :enumData="dict.showMeet" + placeholder="璇烽€夋嫨鏄剧ず浼氳瀹ら棬鐗屼俊鎭�" + /> + <Field + :span="20" + label="鑷畾涔夊唴瀹�" + v-if="form.showMeet == 1" + type="textarea" + prop="showMeetDesc" + v-model="form.showMeetDesc" + placeholder="璇疯緭鍏ユ樉绀轰細璁闂ㄧ墝淇℃伅鑷畾涔夊唴瀹�" + /> + <Field + :span="20" + label="澶囨敞" + prop="remark" + v-model="form.remark" + type="textarea" + placeholder="璇疯緭鍏ュ娉�" + /> + </el-row> - </Field> - <Field :span="20" label="鐢靛瓙闂ㄧ墝搴曢儴淇℃伅璁剧疆" prop="showElect" v-model="form.showElect" type="radio" :enumData="dict.showElect" placeholder="璇烽€夋嫨鏄剧ず鐢靛瓙闂ㄧ墝淇℃伅"/> - <Field :span="20" label="鑷畾涔夊唴瀹�" v-if="form.showElect==1" prop="showElectDesc" type="textarea" v-model="form.showElectDesc" placeholder="璇疯緭鍏ユ樉绀虹數瀛愰棬鐗屼俊鎭嚜瀹氫箟鍐呭"/> - <Field :span="20" label="浼氳瀹ら棬鐗屽簳閮ㄤ俊鎭缃�" prop="showMeet" v-model="form.showMeet" type="radio" :enumData="dict.showMeet" placeholder="璇烽€夋嫨鏄剧ず浼氳瀹ら棬鐗屼俊鎭�"/> - <Field :span="20" label="鑷畾涔夊唴瀹�" v-if="form.showMeet==1" type="textarea" prop="showMeetDesc" v-model="form.showMeetDesc" placeholder="璇疯緭鍏ユ樉绀轰細璁闂ㄧ墝淇℃伅鑷畾涔夊唴瀹�"/> - <Field :span="20" label="澶囨敞" prop="remark" v-model="form.remark" type="textarea" placeholder="璇疯緭鍏ュ娉�"/> + <el-divider content-position="center">鐘舵€佽缃俊鎭�</el-divider> + <br /> + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button + type="primary" + icon="el-icon-plus" + size="mini" + @click="handleAddBasicStatus" + >娣诲姞</el-button + > + </el-col> + <el-col :span="1.5"> + <el-button + type="danger" + icon="el-icon-delete" + size="mini" + @click="handleDeleteBasicStatus" + >鍒犻櫎</el-button + > + </el-col> + </el-row> - </el-row> + <el-table + :data="basicStatusList" + :row-class-name="rowBasicStatusIndex" + @selection-change="handleBasicStatusSelectionChange" + ref="basicStatus" + height="600" + + > + <el-table-column type="selection" width="50" align="center" /> + <el-table-column label="搴忓彿" align="center" prop="index" width="50" /> + <el-table-column label="鐘舵€佸悕绉�" prop="statusName"> + <template slot-scope="scope"> + <el-input + v-model="scope.row.statusName" + placeholder="璇疯緭鍏ョ姸鎬佸悕绉�" + /> + </template> + </el-table-column> + <el-table-column label="鐘舵€侀鑹插€�" prop="statusColor"> + <template slot-scope="scope"> + <el-color-picker + v-model="scope.row.statusColor" + placeholder="璇疯緭鍏ョ姸鎬侀鑹插€�" + ></el-color-picker> + </template> + </el-table-column> + </el-table> - <el-divider content-position="center">鐘舵€佽缃俊鎭�</el-divider> - <br/> - <el-row :gutter="10" class="mb8"> - <el-col :span="1.5"> - <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAddBasicStatus">娣诲姞</el-button> - </el-col> - <el-col :span="1.5"> - <el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDeleteBasicStatus">鍒犻櫎</el-button> - </el-col> - </el-row> - - <el-table :data="basicStatusList" :row-class-name="rowBasicStatusIndex" @selection-change="handleBasicStatusSelectionChange" ref="basicStatus"> - <el-table-column type="selection" width="50" align="center" /> - <el-table-column label="搴忓彿" align="center" prop="index" width="50"/> - <el-table-column label="鐘舵€佸悕绉�" prop="statusName"> - <template slot-scope="scope"> - <el-input v-model="scope.row.statusName" placeholder="璇疯緭鍏ョ姸鎬佸悕绉�" /> - </template> - </el-table-column> - <el-table-column label="鐘舵€侀鑹插€�" prop="statusColor"> - <template slot-scope="scope"> - <el-color-picker v-model="scope.row.statusColor" placeholder="璇疯緭鍏ョ姸鎬侀鑹插€�"></el-color-picker> - - </template> - </el-table-column> - - </el-table> - - <form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn /> - </el-form> - - </el-drawer> + <form-buttons + @submit="submitForm" + v-if="pageInfo.type != 'view'" + noCancelBtn + /> + </el-form> + </el-drawer> </template> <script> @@ -86,11 +140,9 @@ import form from "@/assets/mixins/formdialog"; export default { name: "BasicSetDetail", mixins: [form], - components: { - - }, + components: {}, created() { - this.changePath("basic/set") + this.changePath("basic/set"); }, data() { return { @@ -104,8 +156,8 @@ export default { title: "鍩虹璁剧疆", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, - direction:"rtl", - toString:[ + direction: "rtl", + toString: [ "showPhoto", "showName", "showPost", @@ -114,14 +166,11 @@ export default { "showElect", "showMeet", ], - toDate:[ - ], + toDate: [], // 琛ㄥ崟鏍¢獙 rules: { - createTime: [ - {required: true,message: "璇烽€夋嫨鍒涘缓鏃堕棿" }, - ], - } + createTime: [{ required: true, message: "璇烽€夋嫨鍒涘缓鏃堕棿" }], + }, }; }, @@ -145,7 +194,9 @@ export default { /** 鐘舵€佽缃垹闄ゆ寜閽搷浣� */ handleDeleteBasicStatus() { if (this.checkedBasicStatus.length == 0) { - this.$alert("璇峰厛閫夋嫨瑕佸垹闄ょ殑鐘舵€佽缃暟鎹�", "鎻愮ず", { confirmButtonText: "纭畾", }); + this.$alert("璇峰厛閫夋嫨瑕佸垹闄ょ殑鐘舵€佽缃暟鎹�", "鎻愮ず", { + confirmButtonText: "纭畾", + }); } else { this.basicStatusList.splice(this.checkedBasicStatus[0].index - 1, 1); } @@ -161,35 +212,35 @@ export default { }, // 娓叉煋鍓嶇疆澶勭悊 beforeRender(data) { - if(data.entity.basicStatusList) { + if (data.entity.basicStatusList) { this.basicStatusList = data.entity.basicStatusList; } - return data + return data; }, /** 缂栬緫 */ edit(row) { - this.reset() + this.reset(); this.query = { id: row.id }; - this.urls.currUrl ="basic/set/edit"; + this.urls.currUrl = "basic/set/edit"; this.getData(); - this.pageInfo.type="edit" + this.pageInfo.type = "edit"; this.title = "淇敼鍩虹璁剧疆"; }, /** 鏂板 */ add(row) { - this.reset() + this.reset(); this.urls.currUrl = "basic/set/add"; this.getData(); - this.pageInfo.type="add" + this.pageInfo.type = "add"; this.title = "鏂板鍩虹璁剧疆"; }, /** 鏌ョ湅*/ view(row) { - this.reset() + this.reset(); this.query = { id: row.id }; - this.urls.currUrl ="basic/set/view"; + this.urls.currUrl = "basic/set/view"; this.getData(); - this.pageInfo.type="view" + this.pageInfo.type = "view"; this.title = "鍩虹璁剧疆璇︾粏"; }, /**鍙栨秷鎸夐挳 */ @@ -209,16 +260,16 @@ export default { // 琛ㄥ崟閲嶇疆 reset() { this.form = { - showPhoto : 0, - showName : 0, - showPost : 0, - showWork : 0, - showPhone : 0, - showElect : 0, - showElectDesc : "", - showMeet : 0, - showMeetDesc : "", - remark : "", + showPhoto: 0, + showName: 0, + showPost: 0, + showWork: 0, + showPhone: 0, + showElect: 0, + showElectDesc: "", + showMeet: 0, + showMeetDesc: "", + remark: "", }; this.resetForm("form"); }, diff --git a/smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue b/smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue index f739658..72b3661 100644 --- a/smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue +++ b/smart-office-manager-ui/admin/src/views/system/menu/dialogshow.vue @@ -6,24 +6,48 @@ <el-col :span="24" v-if="form.parentId !== 0"> <el-form-item label="涓婄骇鑺傜偣" prop="parentId"> <treeselect - v-model="form.parentId" - :options="menuOptions" - :normalizer="normalizer" - placeholder="閫夋嫨涓婄骇鑿滃崟淇℃伅" + v-model="form.parentId" + :options="menuOptions" + :normalizer="normalizer" + placeholder="閫夋嫨涓婄骇鑿滃崟淇℃伅" /> </el-form-item> </el-col> <!--<Field label="ID" prop="id" v-model="form.id" v-if='pageInfo.type !== "add"' disabled />--> - <Field label="鍚嶇О" prop="name" v-model="form.name"/> - <Field label="鏉冮檺绫诲瀷" prop="authType" v-model="form.authType" :enumData='dict.authType' type='select' /> - <Field label="璁块棶鍦板潃" prop="url" v-model="form.url" /> - <Field label="鐘舵€�" prop="status" v-model="form.status" :enumData='dict.status' type='radio' /> - <Field class="radio-group-container" label="鍥炬爣" prop="imgPath" :span='24'> - <el-radio-group v-model="form.imgPath" class='form-el-radio-group'> - <el-radio-button style="width: 180px" label="">涓嶉渶瑕佸浘鏍�</el-radio-button> - <el-radio-button style="width: 180px" v-for='(icon, index) in icons' :key='index' :label="icon"> - <i :class="'el-icon-'+icon" style="font-size: 20px"></i> - {{icon}} + <Field label="鍚嶇О" prop="name" v-model="form.name" /> + <Field + label="鏉冮檺绫诲瀷" + prop="authType" + v-model="form.authType" + :enumData="dict.authType" + type="select" + /> + <Field label="璁块棶鍦板潃" prop="url" v-model="form.url" /> + <Field + label="鐘舵€�" + prop="status" + v-model="form.status" + :enumData="dict.status" + type="radio" + /> + <Field + class="radio-group-container" + label="鍥炬爣" + prop="imgPath" + :span="24" + > + <el-radio-group v-model="form.imgPath" class="form-el-radio-group"> + <el-radio-button style="width: 180px" label="" + >涓嶉渶瑕佸浘鏍�</el-radio-button + > + <el-radio-button + style="width: 180px" + v-for="(icon, index) in icons" + :key="index" + :label="icon" + > + <i :class="'el-icon-' + icon" style="font-size: 20px"></i> + {{ icon }} </el-radio-button> </el-radio-group> </Field> @@ -40,7 +64,7 @@ import form from "@/assets/mixins/formdialog"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; -import axios from 'axios' +import axios from "axios"; export default { mixins: [form], components: { @@ -48,16 +72,43 @@ export default { }, data() { return { - fileContent:"", - id:null, + fileContent: "", + id: null, icons: [ - 'info', 'error', 'success', 'warning', 'question', - 'tickets', 'document', 'goods', 'sold-out', 'news', - 'message', 'date', 'printer', 'time', 'bell', - 'mobile-phone', 'service', 'view', 'menu', 'star-on', - 'location', 'phone', 'picture', 'delete', 'search', - 'edit', 'rank', 'refresh', 'share', 'setting', - 'upload', 'upload2', 'download', 'loading', + "info", + "error", + "success", + "warning", + "question", + "tickets", + "document", + "goods", + "sold-out", + "news", + "message", + "date", + "printer", + "time", + "bell", + "mobile-phone", + "service", + "view", + "menu", + "star-on", + "location", + "phone", + "picture", + "delete", + "search", + "edit", + "rank", + "refresh", + "share", + "setting", + "upload", + "upload2", + "download", + "loading", ], menuOptions: [], // 閬僵灞� @@ -66,44 +117,36 @@ export default { title: "鑿滃崟淇℃伅", // 鏄惁鏄剧ず寮瑰嚭灞� open: false, - toString:[ - "status", - "linkType", - "commMenu", - "menuType", - "authType", - ], + toString: ["status", "linkType", "commMenu", "menuType", "authType"], // 琛ㄥ崟鏍¢獙 - rules: { - } + rules: {}, }; }, created() { - axios.get('/icon.txt') - .then(response => { - this.fileContent = response.data - this.icons = this.fileContent.split('\n') - }) + axios.get("/icon.txt").then((response) => { + this.fileContent = response.data; + this.icons = this.fileContent.split("\n"); + }); }, methods: { /** 缂栬緫 */ edit(row, menuOptions) { - this.reset() + this.reset(); this.query = { id: row.id }; - this.urls.currUrl =this.pageInfo.editUrl;; + this.urls.currUrl = this.pageInfo.editUrl; this.getData(); this.menuOptions = menuOptions; this.title = "淇敼鑿滃崟淇℃伅"; }, /** 鏂板 */ add(row, menuOptions) { - this.reset() + this.reset(); this.query = { id: row.id }; this.urls.currUrl = this.pageInfo.addUrl; this.getData(); - if(row.id){ - this.id=row.id - this.form.parentId=row.id + if (row.id) { + this.id = row.id; + this.form.parentId = row.id; } this.menuOptions = menuOptions; this.title = "鏂板鑿滃崟淇℃伅"; @@ -111,7 +154,7 @@ export default { /** 鏌ョ湅*/ view(row, menuOptions) { this.query = { id: row.id }; - this.urls.currUrl =this.pageInfo.viewUrl;; + this.urls.currUrl = this.pageInfo.viewUrl; this.getData(); this.menuOptions = menuOptions; this.title = "鑿滃崟淇℃伅璇︾粏"; @@ -122,8 +165,8 @@ export default { }, /**鑾峰彇鏁版嵁鍚庡脊妗� */ afterRender(data) { - if(this.id){ - this.form.parentId=this.id + if (this.id) { + this.form.parentId = this.id; } this.open = true; }, @@ -147,28 +190,27 @@ export default { reset() { this.resetForm("form"); this.form = { - name : "", - url : null, - ancestors : null, - parentId : null, - orderId : null, - status : 1, - linkType : 0, - groupId : 1, - groupName : null, - imgPath : null, - buttonImgPath : null, - imgCommPath : null, - commMenu : 0, - menuType : 0, - authType : 3, - createUserName : null, + name: "", + url: null, + ancestors: null, + parentId: null, + orderId: null, + status: 1, + linkType: 0, + groupId: 1, + groupName: null, + imgPath: null, + buttonImgPath: null, + imgCommPath: null, + commMenu: 0, + menuType: 0, + authType: 3, + createUserName: null, }; - }, resetForm(refName) { if (this.$refs[refName]) { - console.log("閲嶇疆琛ㄥ崟") + console.log("閲嶇疆琛ㄥ崟"); this.$refs[refName].resetFields(); } }, @@ -196,10 +238,10 @@ export default { box-shadow: none; } -.el-radio-button__orig-radio:checked+.el-radio-button__inner { +.el-radio-button__orig-radio:checked + .el-radio-button__inner { background: rgba(0, 0, 0, 0); - border: 1px solid #3E7BFA !important; - color: #3E7BFA; + border: 1px solid #3e7bfa !important; + color: #3e7bfa; line-height: 14px; outline: none; box-shadow: none; diff --git a/smart-office-manager-ui/admin/src/views/system/menu/list.vue b/smart-office-manager-ui/admin/src/views/system/menu/list.vue index 1dc9337..b9eaf1f 100644 --- a/smart-office-manager-ui/admin/src/views/system/menu/list.vue +++ b/smart-office-manager-ui/admin/src/views/system/menu/list.vue @@ -1,14 +1,22 @@ <template> - <div className="page"> + <div + class="page" + style="padding: 0 !important;height: 81% !important; min-height: 81% !important;" + > <el-card> - <LayoutTable notPagination ref="layoutTable" :data="tableData" :config="tableConfig"/> + <LayoutTable + notPagination + ref="layoutTable" + :data="tableData" + :config="tableConfig" + /> </el-card> - <dialog-show ref="dialogform" @ok="getData"/> + <dialog-show ref="dialogform" @ok="getData" /> </div> </template> <script> -import {handleTree} from "@/assets/utils/table"; +import { handleTree } from "@/assets/utils/table"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import table from "@/assets/mixins/table"; @@ -17,15 +25,15 @@ import dialogShow from "./dialogshow"; export default { name: "Menu", mixins: [table], - components: {Treeselect, dialogShow}, + components: { Treeselect, dialogShow }, created() { - this.query={"page":1,"size":-1} + this.query = { page: 1, size: -1 }; }, methods: { afterRender(data) { data.data = handleTree(data.data, "id", "parentId"); this.menuOptions = data.data; - this.$refs.layoutTable.showType = "treetable" + this.$refs.layoutTable.showType = "treetable"; }, handleUp(data) { @@ -46,17 +54,17 @@ export default { id: id, type: type, }) - .then((res) => { - if (res && res.code && res.code == 1) { - this.getData() - this.loading = false; - this.$message.success("鏇存柊鎺掑簭鎴愬姛锛�"); - } - }) - .catch((error) => { + .then((res) => { + if (res && res.code && res.code == 1) { + this.getData(); this.loading = false; - this.$message.error(error.message); - }); + this.$message.success("鏇存柊鎺掑簭鎴愬姛锛�"); + } + }) + .catch((error) => { + this.loading = false; + this.$message.error(error.message); + }); }, handleAdd(row) { @@ -70,17 +78,17 @@ export default { /** 閲嶅啓缂栬緫鏂规硶 */ toEdit(row) { this.loading = true; - this.$post(this.pageInfo.exclude, {id: row.id}) - .then((res) => { - if (res && res.code && res.code == 1) { - this.menuOptions = handleTree(res.data.data); - this.$refs.dialogform.edit(row, this.menuOptions); - this.loading = false; - } - }) - .catch((error) => { - this.$message.error(error.message); - }) + this.$post(this.pageInfo.exclude, { id: row.id }) + .then((res) => { + if (res && res.code && res.code == 1) { + this.menuOptions = handleTree(res.data.data); + this.$refs.dialogform.edit(row, this.menuOptions); + this.loading = false; + } + }) + .catch((error) => { + this.$message.error(error.message); + }); }, /** 閲嶅啓鏌ョ湅鏂规硶 */ toView(row) { @@ -89,145 +97,144 @@ export default { // 灞曠ず鑿滃崟鍥炬爣 showIcon(row, column) { - return <i class={'el-icon-'+row.imgPath}></i> + return <i class={"el-icon-" + row.imgPath}></i>; }, - handleStatus(row){ - if(row.status==1){ - this.$post("/menu/change/status", {id:row.id,status:0}) - .then(res => { - if(res.code==1){ - row.status=0; - } - }) - .catch(error => { - this.$message.error(error.message); - }) - }else{ - this.$post("/menu/change/status", {id:row.id,status:1}) - .then(res => { - if(res.code==1){ - row.status=1; - } - }) - .catch(error => { - this.$message.error(error.message); - }) + handleStatus(row) { + if (row.status == 1) { + this.$post("/menu/change/status", { id: row.id, status: 0 }) + .then((res) => { + if (res.code == 1) { + row.status = 0; + } + }) + .catch((error) => { + this.$message.error(error.message); + }); + } else { + this.$post("/menu/change/status", { id: row.id, status: 1 }) + .then((res) => { + if (res.code == 1) { + row.status = 1; + } + }) + .catch((error) => { + this.$message.error(error.message); + }); } }, }, data() { return { - value: '1', + value: "1", config: { - isshowTabPane:true, + isshowTabPane: true, /** 鏍戣〃鏄惁榛樿灞曞紑 */ expand: false, showType: "treetable", search: [], columns: [ { - type: 'selection', + type: "selection", width: 60, }, { - prop: 'id', - label: 'ID', + prop: "id", + label: "ID", width: 120, }, { - prop: 'name', - label: '鍚嶇О', + prop: "name", + label: "鍚嶇О", width: 160, }, { - prop: 'imgPath', - label: '鍥炬爣', + prop: "imgPath", + label: "鍥炬爣", width: 50, formatter: this.showIcon, }, { - prop: 'authType', - label: '鏉冮檺绫诲瀷', + prop: "authType", + label: "鏉冮檺绫诲瀷", formatter: this.formatter, }, { - prop: 'parentId', - label: '鐖禝D', + prop: "parentId", + label: "鐖禝D", + width: 160, }, { - prop: 'url', - label: '鍦板潃', + prop: "url", + label: "鍦板潃", + width: 160, }, { - prop: 'status', - label: '鐘舵€�', + prop: "status", + label: "鐘舵€�", width: 100, - formatter: row => { + formatter: (row) => { return ( - <el-switch - value={row.status+""} - active-color="#13ce66" - inactive-color="#ff4949" - active-value='1' - inactive-value='0' - onChange={() => { - this.handleStatus(row); - }} - > - </el-switch> + <el-switch + value={row.status + ""} + active-color="#13ce66" + inactive-color="#ff4949" + active-value="1" + inactive-value="0" + onChange={() => { + this.handleStatus(row); + }} + ></el-switch> ); - } - + }, }, { label: "鎿嶄綔", width: 280, - formatter: row => { + formatter: (row) => { return ( - <div> - <el-link - style="margin-right:5px;margin-left:5px" - icon="el-icon-top" - onClick={() => { - this.handleUp(row); - }} - ></el-link> + <div> + <el-link + style="margin-right:5px;margin-left:5px" + icon="el-icon-top" + onClick={() => { + this.handleUp(row); + }} + ></el-link> - <el-link - style="margin-right:5px;margin-left:5px" - icon="el-icon-bottom" - onClick={() => { - this.handleDown(row); - }} + <el-link + style="margin-right:5px;margin-left:5px" + icon="el-icon-bottom" + onClick={() => { + this.handleDown(row); + }} + ></el-link> - ></el-link> - - <el-button - size="mini" - type="text" - icon="el-icon-edit-outline" - onClick={() => { - this.handleAdd(row); - }} - > - 鏂板 - </el-button> - <table-buttons - noAdd - noView - row={row} - onEdit={this.toEdit} - onView={this.toView} - onDel={this.toDel} - /> - </div> + <el-button + size="mini" + type="text" + icon="el-icon-edit-outline" + onClick={() => { + this.handleAdd(row); + }} + > + 鏂板 + </el-button> + <table-buttons + noAdd + noView + row={row} + onEdit={this.toEdit} + onView={this.toView} + onDel={this.toDel} + /> + </div> ); - } - } - ] - } + }, + }, + ], + }, }; - } + }, }; </script> -- 2.24.3