Commit 9f5f4d96 authored by daywrite's avatar daywrite

delete功能添加

parent e111a349
const urlEnd = '?duplextrans' const dev = process.env.NODE_ENV === 'development'
let urlEnd = dev ? '?duplextrans' : ''
export default { export default {
getScheduleList: { getScheduleList: {
url: '/vue/schedule/list' + urlEnd url: '/vue/schedule/list' + urlEnd
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>留言</el-button> <el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>留言</el-button>
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>汇报</el-button> <el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>汇报</el-button>
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>编辑</el-button> <el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>编辑</el-button>
<el-button type="primary" size="mini"><i class="el-icon-share el-icon--left"></i>删除</el-button> <el-button type="primary" size="mini" @click="deleteSch(item.id)"><i class="el-icon-share el-icon--left"></i>删除</el-button>
</div> </div>
</div> </div>
</el-col> </el-col>
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
</template> </template>
<script> <script>
import {
requestWithJsonAPI,
api
} from '@/lib/commonMixin'
export default { export default {
name: 'scheduleItem', name: 'scheduleItem',
...@@ -91,6 +95,23 @@ export default { ...@@ -91,6 +95,23 @@ export default {
}, },
mounted () { mounted () {
},
methods: {
deleteSch (id) {
this.$confirm('删除该待办事项?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
requestWithJsonAPI(api.deleteSchedule)
.then((res) => {
console.log(res)
})
}).catch(() => {
this.$message.info('取消删除')
})
}
} }
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment