From e500f3ad66d88053118d76f4c838f6f176736615 Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期三, 19 十月 2022 17:10:16 +0800 Subject: [PATCH] 封装table组件,封装上传组件,修改消息发布,修改bug --- src/views/operate/lawEnforcement/index.vue | 47 ++++++++++++++++++++++++++++++++++++----------- 1 files changed, 36 insertions(+), 11 deletions(-) diff --git a/src/views/operate/lawEnforcement/index.vue b/src/views/operate/lawEnforcement/index.vue index 68ec27e..d635173 100644 --- a/src/views/operate/lawEnforcement/index.vue +++ b/src/views/operate/lawEnforcement/index.vue @@ -1,11 +1,24 @@ <template> <div class="law-enforcement"> - <MyTable :tableData="list" :tableOption="tableOption" @openDialog="changeDialog"> + <!-- table琛ㄦ牸灞曠ず --> + <MyTable + :tableData="list" + :tableOption="tableOption" + :totalNum="totalNum" + @getCurrentPage="getCurrentPage" + @openDialog="changeDialog"> + <template #operation="{info}"> + <div class="btn"> + <!-- 鎿嶄綔鍖哄煙 --> + <!-- {{getData(info)}} --> + <span @click="dataView(info)">鏌ョ湅</span> + </div> + </template> </MyTable> - <!-- 缁勪欢鍖� --> + <!-- 寮圭獥 --> <div class="dialog"> <el-dialog v-if="visible" :visible.async="visible" title="闂鐧昏" width="60%" :before-close="handleClose"> - <MyView :viewData=showData /> + <MyView :viewData=showData /> </el-dialog> </div> </div> @@ -15,7 +28,7 @@ import MyView from './components/dataView' export default { components: { - MyTable,MyView + MyTable, MyView }, data() { return { @@ -63,21 +76,25 @@ children: [ { operationName: '鏌ョ湅', - mykey : 'look', + mykey: 'look', }, { operationName: '淇敼', - mykey:'update', + mykey: 'update', } ] }, ] }, - visible:false, - showData:{}, + visible: false, + totalNum:'', + showData: {}, } }, - methods:{ + created(){ + this.totalNum = this.list.length; + }, + methods: { // 鍏抽棴瀵硅瘽妗� handleClose(done) { this.$confirm('纭鍏抽棴锛�') @@ -88,10 +105,18 @@ .catch(_ => { }); }, // 鑾峰彇鎿嶄綔缁撴灉 - changeDialog({index,mykey}){ - console.log(index,mykey); + changeDialog({ index, mykey }) { + console.log(index, mykey); this.showData = this.list[index]; this.visible = true; + }, + // 鏁版嵁灞曠ず + dataView(data) { + console.log(data); + }, + // 鑾峰彇褰撳墠椤垫暟鎹� + getCurrentPage(current){ + console.log(current); } } } -- Gitblit v1.8.0