|  | @@ -7,10 +7,9 @@
 | 
	
		
			
				|  |  |              <span class="shape"></span>
 | 
	
		
			
				|  |  |              <p style="margin-right: 5px">乐团资讯</p>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  | -        <auth auths="musicGroupNews/add">
 | 
	
		
			
				|  |  | -        <el-button type="text" @click="addInfo">+新增乐团资讯</el-button>
 | 
	
		
			
				|  |  | -        </auth>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +          <auth auths="musicGroupNews/add">
 | 
	
		
			
				|  |  | +            <el-button type="text" @click="addInfo">+新增乐团资讯</el-button>
 | 
	
		
			
				|  |  | +          </auth>
 | 
	
		
			
				|  |  |          </div>
 | 
	
		
			
				|  |  |        </template>
 | 
	
		
			
				|  |  |      </el-alert>
 | 
	
	
		
			
				|  | @@ -25,7 +24,7 @@
 | 
	
		
			
				|  |  |        <el-table-column align="center" prop="linkUrl" label="资讯链接">
 | 
	
		
			
				|  |  |          <template slot-scope="scope">
 | 
	
		
			
				|  |  |            <div @click="gotoLink(scope.row.linkUrl)" class="link">
 | 
	
		
			
				|  |  | -            {{scope.row.linkUrl}}
 | 
	
		
			
				|  |  | +            {{ scope.row.linkUrl }}
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  |        </el-table-column>
 | 
	
	
		
			
				|  | @@ -41,13 +40,16 @@
 | 
	
		
			
				|  |  |        <el-table-column align="center" prop="id" label="操作">
 | 
	
		
			
				|  |  |          <template slot-scope="scope">
 | 
	
		
			
				|  |  |            <div>
 | 
	
		
			
				|  |  | -                  <auth auths="musicGroupNews/update">
 | 
	
		
			
				|  |  | -          <el-button type="text" @click="resetInfo(scope.row)">修改</el-button>
 | 
	
		
			
				|  |  | -        </auth>
 | 
	
		
			
				|  |  | -                 <auth auths="musicGroupNews/del">
 | 
	
		
			
				|  |  | -          <el-button type="text" @click="deleteInfo(scope.row)">删除</el-button>
 | 
	
		
			
				|  |  | -        </auth>
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +            <auth auths="musicGroupNews/update">
 | 
	
		
			
				|  |  | +              <el-button type="text" @click="resetInfo(scope.row)"
 | 
	
		
			
				|  |  | +                >修改</el-button
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +            </auth>
 | 
	
		
			
				|  |  | +            <auth auths="musicGroupNews/del">
 | 
	
		
			
				|  |  | +              <el-button type="text" @click="deleteInfo(scope.row)"
 | 
	
		
			
				|  |  | +                >删除</el-button
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +            </auth>
 | 
	
		
			
				|  |  |            </div>
 | 
	
		
			
				|  |  |          </template>
 | 
	
		
			
				|  |  |        </el-table-column>
 | 
	
	
		
			
				|  | @@ -68,7 +70,13 @@
 | 
	
		
			
				|  |  |        width="600px"
 | 
	
		
			
				|  |  |        v-if="infoVisible"
 | 
	
		
			
				|  |  |      >
 | 
	
		
			
				|  |  | -      <el-form :inline="true" :model.sync="form" ref="form" label-width="80px">
 | 
	
		
			
				|  |  | +      <el-form
 | 
	
		
			
				|  |  | +        :inline="true"
 | 
	
		
			
				|  |  | +        :model.sync="form"
 | 
	
		
			
				|  |  | +        ref="form"
 | 
	
		
			
				|  |  | +        label-width="80px"
 | 
	
		
			
				|  |  | +        append-to-body
 | 
	
		
			
				|  |  | +      >
 | 
	
		
			
				|  |  |          <el-form-item
 | 
	
		
			
				|  |  |            prop="title"
 | 
	
		
			
				|  |  |            label="资讯标题"
 | 
	
	
		
			
				|  | @@ -109,7 +117,12 @@
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | -import { getMusicGroupNews, addMusicGroupNews,resetMusicGroupNews,delMusicGroupNews } from "./api";
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  getMusicGroupNews,
 | 
	
		
			
				|  |  | +  addMusicGroupNews,
 | 
	
		
			
				|  |  | +  resetMusicGroupNews,
 | 
	
		
			
				|  |  | +  delMusicGroupNews,
 | 
	
		
			
				|  |  | +} from "./api";
 | 
	
		
			
				|  |  |  import pagination from "@/components/Pagination/index";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  |    components: {
 | 
	
	
		
			
				|  | @@ -132,7 +145,7 @@ export default {
 | 
	
		
			
				|  |  |          linkUrl: "",
 | 
	
		
			
				|  |  |          title: "",
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  | -      activeRow:null
 | 
	
		
			
				|  |  | +      activeRow: null,
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    mounted() {
 | 
	
	
		
			
				|  | @@ -142,6 +155,14 @@ export default {
 | 
	
		
			
				|  |  |      addInfo() {
 | 
	
		
			
				|  |  |        this.infoTitle = "新增资讯";
 | 
	
		
			
				|  |  |        this.infoVisible = true;
 | 
	
		
			
				|  |  | +      this.$nextTick((res) => {
 | 
	
		
			
				|  |  | +        this.form = {
 | 
	
		
			
				|  |  | +          author: "",
 | 
	
		
			
				|  |  | +          linkUrl: "",
 | 
	
		
			
				|  |  | +          title: "",
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +        this.$refs.form.resetFields();
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      async getList() {
 | 
	
		
			
				|  |  |        try {
 | 
	
	
		
			
				|  | @@ -154,15 +175,14 @@ export default {
 | 
	
		
			
				|  |  |          this.rules.total = res.data.total;
 | 
	
		
			
				|  |  |        } catch (e) {}
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    resetInfo(row){
 | 
	
		
			
				|  |  | -       this.infoTitle = "修改资讯";
 | 
	
		
			
				|  |  | -      this.activeRow = row
 | 
	
		
			
				|  |  | -      this.form = {...row}
 | 
	
		
			
				|  |  | -      this.infoVisible = true
 | 
	
		
			
				|  |  | +    resetInfo(row) {
 | 
	
		
			
				|  |  | +      this.infoTitle = "修改资讯";
 | 
	
		
			
				|  |  | +      this.activeRow = row;
 | 
	
		
			
				|  |  | +      this.form = { ...row };
 | 
	
		
			
				|  |  | +      this.infoVisible = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    deleteInfo(row){
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -           this.$confirm("确定删除?", "提示", {
 | 
	
		
			
				|  |  | +    deleteInfo(row) {
 | 
	
		
			
				|  |  | +      this.$confirm("确定删除?", "提示", {
 | 
	
		
			
				|  |  |          confirmButtonText: "确定",
 | 
	
		
			
				|  |  |          cancelButtonText: "取消",
 | 
	
		
			
				|  |  |          type: "warning",
 | 
	
	
		
			
				|  | @@ -182,13 +202,13 @@ export default {
 | 
	
		
			
				|  |  |        this.$refs.form.validate(async (flag) => {
 | 
	
		
			
				|  |  |          if (flag) {
 | 
	
		
			
				|  |  |            if (this.activeRow) {
 | 
	
		
			
				|  |  | -            try{
 | 
	
		
			
				|  |  | -            const res = await resetMusicGroupNews({...this.form})
 | 
	
		
			
				|  |  | -                this.$message.success("修改成功");
 | 
	
		
			
				|  |  | +            try {
 | 
	
		
			
				|  |  | +              const res = await resetMusicGroupNews({ ...this.form });
 | 
	
		
			
				|  |  | +              this.$message.success("修改成功");
 | 
	
		
			
				|  |  |                this.infoVisible = false;
 | 
	
		
			
				|  |  |                this.getList();
 | 
	
		
			
				|  |  | -            }catch(e){
 | 
	
		
			
				|  |  | -              console.log(e)
 | 
	
		
			
				|  |  | +            } catch (e) {
 | 
	
		
			
				|  |  | +              console.log(e);
 | 
	
		
			
				|  |  |              }
 | 
	
		
			
				|  |  |              // 修改
 | 
	
		
			
				|  |  |            } else {
 | 
	
	
		
			
				|  | @@ -207,14 +227,16 @@ export default {
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  | -    gotoLink(url){
 | 
	
		
			
				|  |  | +    gotoLink(url) {
 | 
	
		
			
				|  |  |        var p = window.location.protocol;
 | 
	
		
			
				|  |  | -      if(url.indexOf('http')!= -1){
 | 
	
		
			
				|  |  | -         window.open(`${p}//${url}`,"_blank")
 | 
	
		
			
				|  |  | -      }else{
 | 
	
		
			
				|  |  | -         window.open(url,"_blank")
 | 
	
		
			
				|  |  | +      if (url.indexOf("http") != -1) {
 | 
	
		
			
				|  |  | +        console.log(url);
 | 
	
		
			
				|  |  | +        window.open(url, "_blank");
 | 
	
		
			
				|  |  | +      } else {
 | 
	
		
			
				|  |  | +        console.log(url);
 | 
	
		
			
				|  |  | +        window.open(`${p}//${url}`, "_blank");
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  | -    }
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  </script>
 |