| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- @extends('layouts.base')
- @section('title', '链接列表')
- @section('content')
- <style xmlns:v-bind="http://www.w3.org/1999/xhtml">
- .rightlist #app .rightlist-head{padding:15px 0;line-height:50px;}
- .rightlist #app{margin-left:30px;}
- .rightlist-head-con{float:left;padding-right:20px;font-size:16px;color:#888;}
- .el-form-item__label{padding-right:30px;}
- .mouse-active{cursor:pointer;border:1px dotted #409EFF;border-radius: 4px;}
- /* 滑块选择小白点 */
- .el-switch.is-checked .el-switch__core::after {left: 100%;margin-left: -17px;}
- .el-switch__core::after {content: "";position: absolute;top: 1px;left: 1px;border-radius: 100%;transition: all .3s;width: 16px;height: 16px;background-color: #fff;}
- </style>
- <link rel="stylesheet" href="//at.alicdn.com/t/font_913727_zrmdutznqpd.css">
- <div id="app-share-activity">
- <template>
- <el-container>
- <el-header height="auto">
- <div class="">
- <h4 class="card-title">链接列表</h4>
- <el-button type="primary" icon="el-icon-plus" @click="addLink()">创建链接</el-button>
- </div>
- </el-header>
- {{--表格start--}}
- <el-main>
- <template>
- <el-table :data="list">
- <el-table-column align="center" align="center" prop="id" label="ID" width="auto"></el-table-column>
- <el-table-column align="center" prop="path" label="页面路径" width="auto"></el-table-column>
- <el-table-column align="center" prop="remark" label="备注" width="auto"></el-table-column>
- <el-table-column align="center" prop="browse" label="访问次数" width="auto"></el-table-column>
- <el-table-column align="center" label="操作">
- <template slot-scope="scope">
- <a v-bind:href="'{{ yzWebUrl('plugin.link-tool.admin.link.add.index', array('id' => '')) }}'+[[scope.row.id]]" title="编辑">
- <i class="el-icon-edit" style="font-size:28px;color:#606266"></i>
- </a>
- <a href="#" title="删除">
- <i class="el-icon-delete" style="font-size:28px;color:#606266" @click="del(scope.row.id)"></i>
- </a>
- <a href="#">
- <i class="iconfont icon-ht_operation_copyline" style="font-size:28px;color:#606266" title="点击复制链接" @click="copy(scope.row,scope.$index,'scheme')"></i>
- <el-input v-model="scope.row.copy_link" :ref="'copy'+scope.$index" style="height: 1px;position: absolute;opacity:0;z-index:-2"></el-input>
- </a>
- </template>
- </el-table-column>
- </el-table>
- </template>
- </el-main>
- {{--表格end--}}
- <el-footer>
- <el-pagination
- layout="prev, pager, next"
- @current-change="currentChange"
- :current-page.sync="current_page"
- :total="page_total"
- :page-size="page_size"
- background v-loading="loading">
- </el-pagination>
- </el-footer>
- </el-container>
- </template>
- </div>
- <script>
- var app = new Vue({
- el: '#app-share-activity',
- delimiters: ['[[', ']]'],
- data() {
- let pageList = {!! $pageList ?: '{}'!!};
- return {
- form : {},
- loading : false,
- real_search_form: {
- 'id' : '',
- 'name' : '',
- 'create_time' : '',
- },
- list : pageList.data,
- current_page : pageList.current_page,
- page_total : pageList.total,
- page_size : pageList.per_page,
- }
- },
- methods: {
- statusChange(index,row,id) {
- this.loading = true;
- this.$http.post('{!! yzWebFullUrl('plugin.share-activity.admin.activity.change-status') !!}',{id:id,status:row.status}).then(function (response) {
- if (response.data.result){
- if(row.status){
- this.$message({message: '开启成功',type: 'success'});
- }
- else {
- this.$message({message: '关闭成功',type: 'success'});
- }
- } else {
- this.$message({message: response.data.msg,type: 'error'});
- if (this.list[index].status==1){
- this.list[index].status = 0;
- }
- else{
- this.list[index].status = 1;
- }
- }
- this.loading = false;
- },function (response) {
- this.$message({message: response.data.msg,type: 'error'});
- if (this.list[index].status==1){
- this.list[index].status = 0;
- } else{
- this.list[index].status = 1;
- }
- this.loading = false;
- });
- },
- del(id) {
- this.$confirm('是否删除', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.$http.post('{!! yzWebFullUrl('plugin.link-tool.admin.link.del.index') !!}',{id:id}).then(function (response) {
- if (response.data.result) {
- this.$message({
- type: 'success',
- message: '删除成功!'
- });
- window.open("{!! yzWebUrl('plugin.link-tool.admin.link.manage.index') !!}", '_self');
- }
- });
- }).catch(() => {
- this.$message({
- type: 'info',
- message: '已取消删除'
- });
- });
- },
- addLink(){
- window.open("{!! yzWebUrl('plugin.link-tool.admin.link.add.index') !!}", '_self');
- },
- copy(row,index,type) {
- let Url = this.$refs['copy'+index];
- console.log(Url)
- Url.select(); // 选择对象
- document.execCommand("Copy",false);
- this.$message({message:"复制成功!",type:"success"});
- },
- currentChange(val) {
- this.loading = true;
- this.$http.post('{!! yzWebFullUrl('plugin.share-activity.admin.activity.search') !!}',{page:val,search:this.real_search_form}).then(function (response) {
- if (response.data.result){
- let datas = response.data.data;
- this.page_total = datas.total;
- this.list = datas.data;
- this.page_size = datas.per_page;
- this.current_page = datas.current_page;
- }
- else {
- this.$message({message: response.data.msg,type: 'error'});
- }
- this.loading = false;
- },function (response) {
- this.loading = false;
- this.$message({message: response.data.msg,type: 'error'});
- }
- );
- }
- },
- });
- </script>
- @endsection
|