|
@@ -5,11 +5,7 @@
|
|
|
>
|
|
|
<ex-table
|
|
|
v-loading="loading"
|
|
|
- v-if="
|
|
|
- powers && powers.length > 0 && powers.some((item) => item == '001')
|
|
|
- "
|
|
|
:table="table"
|
|
|
-
|
|
|
:data="tableData"
|
|
|
:columns="columns"
|
|
|
:page="pageInfo"
|
|
@@ -25,152 +21,165 @@
|
|
|
searchList();
|
|
|
"
|
|
|
>
|
|
|
- <template #table-header="{}">
|
|
|
- <el-col style="width: 150px;">
|
|
|
- <el-select
|
|
|
- :size="searchSize"
|
|
|
- v-model="parmValue.status"
|
|
|
- placeholder="请选择状态">
|
|
|
- <el-option
|
|
|
- v-for="item in statusList"
|
|
|
- :key="'status' + item.id"
|
|
|
- :label="item.label"
|
|
|
- :value="item.id"/>
|
|
|
- </el-select>
|
|
|
- </el-col>
|
|
|
- <div style="width: 100%">
|
|
|
- <el-row>
|
|
|
- <el-col :span="15">
|
|
|
- <el-input
|
|
|
+ <template #table-header="{}">
|
|
|
+ <el-row style="width:100%">
|
|
|
+ <el-col style="width: 150px">
|
|
|
+ <el-select
|
|
|
:size="searchSize"
|
|
|
- placeholder="请输入内容"
|
|
|
- v-model="input"
|
|
|
- class="input-with-select">
|
|
|
- <el-select
|
|
|
- v-model="select"
|
|
|
- slot="prepend"
|
|
|
- placeholder="请选择"
|
|
|
- style="width:120px;">
|
|
|
- <el-option label="视频名称" value="1"></el-option>
|
|
|
- <el-option label="视频链接" value="2"></el-option>
|
|
|
- <el-option label="视频编号" value="3"></el-option>
|
|
|
- </el-select>
|
|
|
- <el-button
|
|
|
- slot="append"
|
|
|
+ v-model="parmValue.status"
|
|
|
+ placeholder="视频状态"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in statusList"
|
|
|
+ :key="'status' + item.id"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.id"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="15" style="width: 400px;padding:0 0 0 10px">
|
|
|
+ <el-input
|
|
|
+ :size="searchSize"
|
|
|
+ placeholder="请输入内容"
|
|
|
+ v-model="input"
|
|
|
+ class="input-with-select"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="select"
|
|
|
+ slot="prepend"
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 120px"
|
|
|
+ >
|
|
|
+ <el-option label="视频名称" value="1"></el-option>
|
|
|
+ <el-option label="视频链接" value="2"></el-option>
|
|
|
+ <el-option label="视频编号" value="3"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button
|
|
|
+ slot="append"
|
|
|
@click.native="searchList"
|
|
|
- icon="el-icon-search">
|
|
|
+ icon="el-icon-search"
|
|
|
+ >
|
|
|
</el-button>
|
|
|
</el-input>
|
|
|
</el-col>
|
|
|
- <el-col
|
|
|
- :span="3"
|
|
|
- style="width: 60px; float: left;margin-left:10px">
|
|
|
- <el-button
|
|
|
- type="warning"
|
|
|
- :size="searchSize"
|
|
|
- @click="restSearch">
|
|
|
- 重置
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col
|
|
|
- :span="3"
|
|
|
- v-if="powers.some((item) => item == '003')"
|
|
|
- style="width: 60px; float: right">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- :size="searchSize"
|
|
|
- @click="restSearch">
|
|
|
- 搜索
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
- <el-col
|
|
|
- :span="2"
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ style="width: 66px; float: left; margin-left: 10px"
|
|
|
+ >
|
|
|
+ <el-button type="warning" :size="searchSize" @click="restSearch">
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="3"
|
|
|
+ v-if="powers.some((item) => item == '003')"
|
|
|
+ style="width: 70px; float: right"
|
|
|
+ >
|
|
|
+ <el-button type="primary" :size="searchSize" @click="restSearch">
|
|
|
+ 搜索
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col
|
|
|
+ :span="2"
|
|
|
+ v-if="powers.some((item) => item == '003')"
|
|
|
+ style="width: 70px; float: right; margin-right: 10px"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
v-if="powers.some((item) => item == '003')"
|
|
|
- style="width: 60px; float: right;margin-right:20px">
|
|
|
- <el-button
|
|
|
- v-if="powers.some((item) => item == '003')"
|
|
|
- type="primary"
|
|
|
- :size="searchSize"
|
|
|
- @click="openModal('add', '003', {})">
|
|
|
- 添加
|
|
|
- </el-button>
|
|
|
- </el-col>
|
|
|
+ type="primary"
|
|
|
+ :size="searchSize"
|
|
|
+ @click="openModal('add', '003', {})"
|
|
|
+ >
|
|
|
+ 添加
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #operation="{ scope }">
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '007')"
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="详情"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-view tb-icon"
|
|
|
- @click="openModal(scope.row.id, '007', scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '005')"
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="修改"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="el-icon-edit tb-icon"
|
|
|
- @click="openModal(scope.row.id, '005', scope.row)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '004')&&scope.row.status==='1'"
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="禁用"
|
|
|
- placement="top"
|
|
|
- @click="openModal(scope.row.id, '004', scope.row)"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="tb-icon el-icon-error"
|
|
|
- @click="selectPop(scope.row.status,scope.row.id)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '004')&&scope.row.status!=='1'"
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="启用"
|
|
|
- placement="top"
|
|
|
- @click="openModal(scope.row.id, '004', scope.row)"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="tb-icon el-icon-success"
|
|
|
- @click="selectPop(scope.row.status,scope.row.id)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip
|
|
|
- v-if="powers.some((item) => item == '006')"
|
|
|
- class="item"
|
|
|
- effect="dark"
|
|
|
- content="删除"
|
|
|
- placement="top"
|
|
|
- @click="openModal(scope.row.id, '006', scope.row)"
|
|
|
- >
|
|
|
- <i
|
|
|
- class="tb-icon el-icon-delete-solid"
|
|
|
- @click="deletePop(scope.row.id)"
|
|
|
- ></i>
|
|
|
- </el-tooltip>
|
|
|
- </template>
|
|
|
- <template #status="{ scope }">
|
|
|
+ </template>
|
|
|
+ <template #operation="{ scope }">
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '007')"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="详情"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-view tb-icon"
|
|
|
+ @click="openModal(scope.row.id, '007', scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '005')"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="修改"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="el-icon-edit tb-icon"
|
|
|
+ @click="openModal(scope.row.id, '005', scope.row)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="
|
|
|
+ powers.some((item) => item == '004') && scope.row.status === '1'
|
|
|
+ "
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="禁用"
|
|
|
+ placement="top"
|
|
|
+ @click="openModal(scope.row.id, '004', scope.row)"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="tb-icon el-icon-error"
|
|
|
+ @click="selectPop(scope.row.status, scope.row.id)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="
|
|
|
+ powers.some((item) => item == '004') && scope.row.status !== '1'
|
|
|
+ "
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="启用"
|
|
|
+ placement="top"
|
|
|
+ @click="openModal(scope.row.id, '004', scope.row)"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="tb-icon el-icon-success"
|
|
|
+ @click="selectPop(scope.row.status, scope.row.id)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip
|
|
|
+ v-if="powers.some((item) => item == '006')"
|
|
|
+ class="item"
|
|
|
+ effect="dark"
|
|
|
+ content="删除"
|
|
|
+ placement="top"
|
|
|
+ @click="openModal(scope.row.id, '006', scope.row)"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="tb-icon el-icon-delete-solid"
|
|
|
+ @click="deletePop(scope.row.id)"
|
|
|
+ ></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ <template #status="{ scope }">
|
|
|
<el-tag
|
|
|
:size="tablebtnSize"
|
|
|
- :type="scope.row.status == '0' ? 'danger' : scope.row.status == '1'?'success':''"
|
|
|
+ :type="
|
|
|
+ scope.row.status == '0'
|
|
|
+ ? 'danger'
|
|
|
+ : scope.row.status == '1'
|
|
|
+ ? 'success'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
v-text="
|
|
|
(statusList.find((item) => item.status == scope.row.status) || {})
|
|
|
.label || '--'
|
|
|
- ">
|
|
|
+ "
|
|
|
+ >
|
|
|
</el-tag>
|
|
|
</template>
|
|
|
</ex-table>
|
|
@@ -190,7 +199,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
-import asyncRequest from "@/apis/service/videos/videoList";
|
|
|
+import asyncRequest from "@/apis/service/mobile/videos";
|
|
|
import ExTable from "@/components/ExTableNew.vue";
|
|
|
import addEdit from "./addEdit";
|
|
|
import { mapGetters } from "vuex";
|
|
@@ -205,7 +214,10 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters(["tablebtnSize", "searchSize", "size"]),
|
|
|
powers() {
|
|
|
- let tran = this.$store.getters.btnList.find((item) => item.menu_route == "videos") || {};
|
|
|
+ let tran =
|
|
|
+ this.$store.getters.btnList.find(
|
|
|
+ (item) => item.menu_route == "videos"
|
|
|
+ ) || {};
|
|
|
if (tran && tran.action && tran.action.length > 0) {
|
|
|
return tran.action;
|
|
|
} else {
|
|
@@ -216,7 +228,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
sitem: null,
|
|
|
- select: "",
|
|
|
+ select: "1",
|
|
|
input: "",
|
|
|
statusList: [
|
|
|
{ status: "1", label: "启用" },
|
|
@@ -230,15 +242,15 @@ export default {
|
|
|
page: 1, // 页码数
|
|
|
size: 15, // 页容量
|
|
|
status: "", //视频状态
|
|
|
- video_sn: "",//视频编号
|
|
|
+ video_sn: "", //视频编号
|
|
|
video_name: "", // 视频名称
|
|
|
- video_url: "", // 视频地址
|
|
|
+ video_url: "", // 视频地址
|
|
|
},
|
|
|
tableData: [],
|
|
|
// 表格 - 数据
|
|
|
table: {
|
|
|
- stripe: true,//是否是斑马条纹边框
|
|
|
- border: true,//是否显示纵向边框
|
|
|
+ stripe: true, //是否是斑马条纹边框
|
|
|
+ border: true, //是否显示纵向边框
|
|
|
// _defaultHeader_: ["setcol"]
|
|
|
},
|
|
|
// 表格 - 分页
|
|
@@ -251,9 +263,9 @@ export default {
|
|
|
columns: [
|
|
|
{
|
|
|
prop: "id",
|
|
|
- label: "视频编号",
|
|
|
- width: "70px",
|
|
|
- fixed: "left",
|
|
|
+ label: "ID",
|
|
|
+ width: "70px",
|
|
|
+ fixed: "left",
|
|
|
},
|
|
|
{
|
|
|
prop: "video_name",
|
|
@@ -266,10 +278,9 @@ export default {
|
|
|
},
|
|
|
{
|
|
|
prop: "status",
|
|
|
- label:"视频状态",
|
|
|
+ label: "视频状态",
|
|
|
_slot_: "status",
|
|
|
- width:"100px"
|
|
|
-
|
|
|
+ width: "100px",
|
|
|
},
|
|
|
{
|
|
|
prop: "addtime",
|
|
@@ -289,36 +300,36 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.searchList();//异步调用接口,请求数据
|
|
|
+ this.searchList(); //异步调用接口,请求数据
|
|
|
},
|
|
|
methods: {
|
|
|
- selectPop(staus,id) {
|
|
|
- this.$confirm('此操作将切换视频状态, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.changeBtnStatus(staus,id)
|
|
|
- })
|
|
|
+ selectPop(staus, id) {
|
|
|
+ this.$confirm("此操作将切换视频状态, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ this.changeBtnStatus(staus, id);
|
|
|
+ });
|
|
|
},
|
|
|
- msgPop(){
|
|
|
+ msgPop() {
|
|
|
this.$alert(res.msg, {
|
|
|
- confirmButtonText: '确定',
|
|
|
- callback: action => {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ callback: (action) => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: `action: ${ action }`
|
|
|
+ type: "info",
|
|
|
+ message: `action: ${action}`,
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
});
|
|
|
},
|
|
|
- deletePop(id){
|
|
|
- this.$alert("请确认要删除吗?","提示",{
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
+ deletePop(id) {
|
|
|
+ this.$alert("请确认要删除吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
}).then(() => {
|
|
|
- this.deleteBtnProject(id)
|
|
|
+ this.deleteBtnProject(id);
|
|
|
});
|
|
|
},
|
|
|
//-重置-输入框数据
|
|
@@ -334,12 +345,12 @@ export default {
|
|
|
this.parmValue = {
|
|
|
video_name: "", // 视频名称
|
|
|
video_url: "", // 视频链接
|
|
|
- video_sn:"",//视频编号
|
|
|
+ video_sn: "", //视频编号
|
|
|
status: "", //视频状态
|
|
|
page: 1, // 页码
|
|
|
size: 15, // 每页显示条数
|
|
|
};
|
|
|
- this.searchList();//请求接口数据
|
|
|
+ this.searchList(); //请求接口数据
|
|
|
},
|
|
|
// 打开弹窗,添加-详情-修改-启/禁用-删除按钮
|
|
|
openModal(id, isDetail, sitem) {
|
|
@@ -348,60 +359,59 @@ export default {
|
|
|
this.isDetail = isDetail;
|
|
|
},
|
|
|
//
|
|
|
- async changeBtnStatus(status,id){
|
|
|
- this.loading = false;//开启loading加载
|
|
|
+ async changeBtnStatus(status, id) {
|
|
|
+ this.loading = false; //开启loading加载
|
|
|
let changeValue = {
|
|
|
- id:"",
|
|
|
- status:"",
|
|
|
+ id: "",
|
|
|
+ status: "",
|
|
|
};
|
|
|
- changeValue.status = (status === "1" ? "0" : "1");
|
|
|
+ changeValue.status = status === "1" ? "0" : "1";
|
|
|
changeValue.id = id;
|
|
|
- var res = await asyncRequest.change(changeValue);//请求更新视频接口/admin/Change
|
|
|
+ var res = await asyncRequest.change(changeValue); //请求更新视频接口/admin/Change
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
//正常响应的操作
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();//登出
|
|
|
+ await this.logout(); //登出
|
|
|
} else {
|
|
|
- this.msgPop();//警告弹窗,提示接口返回信息
|
|
|
+ this.msgPop(); //警告弹窗,提示接口返回信息
|
|
|
}
|
|
|
- this.loading = false;//停止loading
|
|
|
+ this.loading = false; //停止loading
|
|
|
this.searchList();
|
|
|
},
|
|
|
- async deleteBtnProject(id){
|
|
|
+ async deleteBtnProject(id) {
|
|
|
this.loading = false;
|
|
|
let deleteValue = {
|
|
|
- id:"",
|
|
|
- }
|
|
|
- deleteValue.id = id;//入参
|
|
|
- var res = await asyncRequest.delete(deleteValue);//调用/admin/Delete接口,
|
|
|
- if(res && res.code === 0){
|
|
|
- //正常响应后的操作
|
|
|
- }else if(res && res.code >= 100 && res.code <= 104){
|
|
|
+ id: "",
|
|
|
+ };
|
|
|
+ deleteValue.id = id; //入参
|
|
|
+ var res = await asyncRequest.delete(deleteValue); //调用/admin/Delete接口,
|
|
|
+ if (res && res.code === 0) {
|
|
|
+ //正常响应后的操作
|
|
|
+ } else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
await this.logout();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.msgPop();
|
|
|
}
|
|
|
this.loading = false;
|
|
|
this.searchList();
|
|
|
},
|
|
|
async searchList() {
|
|
|
- this.loading = true;//开启加载loading
|
|
|
- this.parmValue.video_name = this.select === "1" ? this.input : "";//把用户输入的name赋到video_name上
|
|
|
- this.parmValue.video_url = this.select === "2" ? this.input : "";//赋url
|
|
|
- this.parmValue.video_sn = this.select === "3" ? this.input : "";//赋video_sn
|
|
|
- const res = await asyncRequest.list(this.parmValue);//调用视频列表接口/admin/video
|
|
|
+ this.loading = true; //开启加载loading
|
|
|
+ this.parmValue.video_name = this.select === "1" ? this.input : ""; //把用户输入的name赋到video_name上
|
|
|
+ this.parmValue.video_url = this.select === "2" ? this.input : ""; //赋url
|
|
|
+ this.parmValue.video_sn = this.select === "3" ? this.input : ""; //赋video_sn
|
|
|
+ const res = await asyncRequest.list(this.parmValue); //调用视频列表接口/admin/video
|
|
|
if (res && res.code === 0 && res.data) {
|
|
|
- this.tableData = res.data.video;//正常响应把响应数据存到tableData中。
|
|
|
- this.pageInfo.total = Number(res.data.count);//存入总数据量
|
|
|
+ this.tableData = res.data.video; //正常响应把响应数据存到tableData中。
|
|
|
+ this.pageInfo.total = Number(res.data.count); //存入总数据量
|
|
|
} else if (res && res.code >= 100 && res.code <= 104) {
|
|
|
- await this.logout();//超时登出
|
|
|
+ await this.logout(); //超时登出
|
|
|
} else {
|
|
|
- this.tableData = [];//如果服务器未正常响应且不是登出状态,初始化数据
|
|
|
+ this.tableData = []; //如果服务器未正常响应且不是登出状态,初始化数据
|
|
|
this.pageInfo.total = 0;
|
|
|
}
|
|
|
- this.loading = false;//关闭loading
|
|
|
+ this.loading = false; //关闭loading
|
|
|
},
|
|
|
-
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -413,5 +423,4 @@ export default {
|
|
|
background-color: #fff;
|
|
|
width: 100px;
|
|
|
}
|
|
|
-
|
|
|
</style>
|