|
@@ -0,0 +1,380 @@
|
|
|
|
|
+<template>
|
|
|
|
|
+ <div class="app-container">
|
|
|
|
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
+ <el-form-item label="播放方案名称" prop="planName">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.planName"
|
|
|
|
|
+ placeholder="请输入播放方案名称"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="循环方式:loop循环播放,once播放一次" prop="loopMode">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.loopMode"
|
|
|
|
|
+ placeholder="请输入循环方式:loop循环播放,once播放一次"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="默认方案标识:0否,1是" prop="defaultFlag">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.defaultFlag"
|
|
|
|
|
+ placeholder="请输入默认方案标识:0否,1是"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="素材数量" prop="assetCount">
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ v-model="queryParams.assetCount"
|
|
|
|
|
+ placeholder="请输入素材数量"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter="handleQuery"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item>
|
|
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="Plus"
|
|
|
|
|
+ @click="handleAdd"
|
|
|
|
|
+ v-hasPermi="['base:plan:add']"
|
|
|
|
|
+ >新增</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="success"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="Edit"
|
|
|
|
|
+ :disabled="single"
|
|
|
|
|
+ @click="handleUpdate"
|
|
|
|
|
+ v-hasPermi="['base:plan:edit']"
|
|
|
|
|
+ >修改</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="Delete"
|
|
|
|
|
+ :disabled="multiple"
|
|
|
|
|
+ @click="handleDelete"
|
|
|
|
|
+ v-hasPermi="['base:plan:remove']"
|
|
|
|
|
+ >删除</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="warning"
|
|
|
|
|
+ plain
|
|
|
|
|
+ icon="Download"
|
|
|
|
|
+ @click="handleExport"
|
|
|
|
|
+ v-hasPermi="['base:plan:export']"
|
|
|
|
|
+ >导出</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table v-loading="loading" :data="planList" @selection-change="handleSelectionChange">
|
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
+ <el-table-column label="主键ID" align="center" prop="id" />
|
|
|
|
|
+ <el-table-column label="播放方案名称" align="center" prop="planName" />
|
|
|
|
|
+ <el-table-column label="循环方式:loop循环播放,once播放一次" align="center" prop="loopMode" />
|
|
|
|
|
+ <el-table-column label="默认方案标识:0否,1是" align="center" prop="defaultFlag" />
|
|
|
|
|
+ <el-table-column label="素材数量" align="center" prop="assetCount" />
|
|
|
|
|
+ <el-table-column label="启用状态:0停用,1启用" align="center" prop="status" />
|
|
|
|
|
+ <el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['base:plan:edit']">修改</el-button>
|
|
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['base:plan:remove']">删除</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+
|
|
|
|
|
+ <pagination
|
|
|
|
|
+ v-show="total>0"
|
|
|
|
|
+ :total="total"
|
|
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
|
|
+ @pagination="getList"
|
|
|
|
|
+ />
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 添加或修改播放方案对话框 -->
|
|
|
|
|
+ <el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
|
|
+ <el-form ref="planRef" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
+ <el-row>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="播放方案名称" prop="planName">
|
|
|
|
|
+ <el-input v-model="form.planName" placeholder="请输入播放方案名称" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="循环方式:loop循环播放,once播放一次" prop="loopMode">
|
|
|
|
|
+ <el-input v-model="form.loopMode" placeholder="请输入循环方式:loop循环播放,once播放一次" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="默认方案标识:0否,1是" prop="defaultFlag">
|
|
|
|
|
+ <el-input v-model="form.defaultFlag" placeholder="请输入默认方案标识:0否,1是" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="素材数量" prop="assetCount">
|
|
|
|
|
+ <el-input v-model="form.assetCount" placeholder="请输入素材数量" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="24">
|
|
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
|
|
+ <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-divider content-position="center">播放方案素材明细信息</el-divider>
|
|
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="primary" icon="Plus" @click="handleAddRobotOpsPlayPlanItem">添加</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
|
+ <el-button type="danger" icon="Delete" @click="handleDeleteRobotOpsPlayPlanItem">删除</el-button>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-table :data="robotOpsPlayPlanItemList" @selection-change="handleRobotOpsPlayPlanItemSelectionChange" ref="robotOpsPlayPlanItem">
|
|
|
|
|
+ <el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
+ <el-table-column label="序号" width="60">
|
|
|
|
|
+ <template #default="{ $index }">
|
|
|
|
|
+ {{ $index + 1 }}
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="素材ID,关联robot_ops_media_asset.id" prop="assetId" width="150">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-input v-model="scope.row.assetId" placeholder="请输入素材ID,关联robot_ops_media_asset.id" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="播放顺序,数字越小越靠前" prop="playOrder" width="150">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-input v-model="scope.row.playOrder" placeholder="请输入播放顺序,数字越小越靠前" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="停留时长,图片必填,视频可为空" prop="staySeconds" width="150">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-input v-model="scope.row.staySeconds" placeholder="请输入停留时长,图片必填,视频可为空" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ <el-table-column label="转场方式,预留字段:none无转场,fade淡入淡出" prop="transitionType" width="150">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-select v-model="scope.row.transitionType" placeholder="请选择转场方式,预留字段:none无转场,fade淡入淡出">
|
|
|
|
|
+ <el-option label="请选择字典生成" value="" />
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <div class="dialog-footer">
|
|
|
|
|
+ <el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+ </div>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script setup name="Plan">
|
|
|
|
|
+import { listPlan, getPlan, delPlan, addPlan, updatePlan } from "@/api/base/plan"
|
|
|
|
|
+
|
|
|
|
|
+const { proxy } = getCurrentInstance()
|
|
|
|
|
+
|
|
|
|
|
+const planList = ref([])
|
|
|
|
|
+const robotOpsPlayPlanItemList = ref([])
|
|
|
|
|
+const open = ref(false)
|
|
|
|
|
+const loading = ref(true)
|
|
|
|
|
+const showSearch = ref(true)
|
|
|
|
|
+const ids = ref([])
|
|
|
|
|
+const checkedRobotOpsPlayPlanItem = ref([])
|
|
|
|
|
+const single = ref(true)
|
|
|
|
|
+const multiple = ref(true)
|
|
|
|
|
+const total = ref(0)
|
|
|
|
|
+const title = ref("")
|
|
|
|
|
+
|
|
|
|
|
+const data = reactive({
|
|
|
|
|
+ form: {},
|
|
|
|
|
+ queryParams: {
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ planName: undefined,
|
|
|
|
|
+ loopMode: undefined,
|
|
|
|
|
+ defaultFlag: undefined,
|
|
|
|
|
+ assetCount: undefined,
|
|
|
|
|
+ status: undefined,
|
|
|
|
|
+ },
|
|
|
|
|
+ rules: {
|
|
|
|
|
+ planName: [
|
|
|
|
|
+ { required: true, message: "播放方案名称不能为空", trigger: "blur" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ loopMode: [
|
|
|
|
|
+ { required: true, message: "循环方式:loop循环播放,once播放一次不能为空", trigger: "blur" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ defaultFlag: [
|
|
|
|
|
+ { required: true, message: "默认方案标识:0否,1是不能为空", trigger: "blur" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ assetCount: [
|
|
|
|
|
+ { required: true, message: "素材数量不能为空", trigger: "blur" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ status: [
|
|
|
|
|
+ { required: true, message: "启用状态:0停用,1启用不能为空", trigger: "change" }
|
|
|
|
|
+ ],
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
|
|
+const { queryParams, form, rules } = toRefs(data)
|
|
|
|
|
+
|
|
|
|
|
+/** 查询播放方案列表 */
|
|
|
|
|
+function getList() {
|
|
|
|
|
+ loading.value = true
|
|
|
|
|
+ listPlan(queryParams.value).then(response => {
|
|
|
|
|
+ planList.value = response.rows
|
|
|
|
|
+ total.value = response.total
|
|
|
|
|
+ loading.value = false
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 取消按钮 */
|
|
|
|
|
+function cancel() {
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ reset()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 表单重置 */
|
|
|
|
|
+function reset() {
|
|
|
|
|
+ form.value = {
|
|
|
|
|
+ id: null,
|
|
|
|
|
+ planName: null,
|
|
|
|
|
+ loopMode: null,
|
|
|
|
|
+ defaultFlag: null,
|
|
|
|
|
+ assetCount: null,
|
|
|
|
|
+ status: null,
|
|
|
|
|
+ remark: null,
|
|
|
|
|
+ createBy: null,
|
|
|
|
|
+ createTime: null,
|
|
|
|
|
+ updateBy: null,
|
|
|
|
|
+ updateTime: null
|
|
|
|
|
+ }
|
|
|
|
|
+ robotOpsPlayPlanItemList.value = []
|
|
|
|
|
+ proxy.resetForm("planRef")
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 搜索按钮操作 */
|
|
|
|
|
+function handleQuery() {
|
|
|
|
|
+ queryParams.value.pageNum = 1
|
|
|
|
|
+ getList()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 重置按钮操作 */
|
|
|
|
|
+function resetQuery() {
|
|
|
|
|
+ proxy.resetForm("queryRef")
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 多选框选中数据 */
|
|
|
|
|
+function handleSelectionChange(selection) {
|
|
|
|
|
+ ids.value = selection.map(item => item.id)
|
|
|
|
|
+ single.value = selection.length != 1
|
|
|
|
|
+ multiple.value = !selection.length
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 新增按钮操作 */
|
|
|
|
|
+function handleAdd() {
|
|
|
|
|
+ reset()
|
|
|
|
|
+ open.value = true
|
|
|
|
|
+ title.value = "添加播放方案"
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 修改按钮操作 */
|
|
|
|
|
+function handleUpdate(row) {
|
|
|
|
|
+ reset()
|
|
|
|
|
+ const _id = row.id || ids.value
|
|
|
|
|
+ getPlan(_id).then(response => {
|
|
|
|
|
+ form.value = response.data
|
|
|
|
|
+ robotOpsPlayPlanItemList.value = response.data.robotOpsPlayPlanItemList
|
|
|
|
|
+ open.value = true
|
|
|
|
|
+ title.value = "修改播放方案"
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 提交按钮 */
|
|
|
|
|
+function submitForm() {
|
|
|
|
|
+ proxy.$refs["planRef"].validate(valid => {
|
|
|
|
|
+ if (valid) {
|
|
|
|
|
+ form.value.robotOpsPlayPlanItemList = robotOpsPlayPlanItemList.value
|
|
|
|
|
+ if (form.value.id != null) {
|
|
|
|
|
+ updatePlan(form.value).then(() => {
|
|
|
|
|
+ proxy.$modal.msgSuccess("修改成功")
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ addPlan(form.value).then(() => {
|
|
|
|
|
+ proxy.$modal.msgSuccess("新增成功")
|
|
|
|
|
+ open.value = false
|
|
|
|
|
+ getList()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 删除按钮操作 */
|
|
|
|
|
+function handleDelete(row) {
|
|
|
|
|
+ const _ids = row.id || ids.value
|
|
|
|
|
+ proxy.$modal.confirm('是否确认删除播放方案编号为"' + _ids + '"的数据项?').then(function() {
|
|
|
|
|
+ return delPlan(_ids)
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ getList()
|
|
|
|
|
+ proxy.$modal.msgSuccess("删除成功")
|
|
|
|
|
+ }).catch(() => {})
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 播放方案素材明细添加按钮操作 */
|
|
|
|
|
+function handleAddRobotOpsPlayPlanItem() {
|
|
|
|
|
+ let obj = {}
|
|
|
|
|
+ obj.assetId = undefined
|
|
|
|
|
+ obj.playOrder = undefined
|
|
|
|
|
+ obj.staySeconds = undefined
|
|
|
|
|
+ obj.transitionType = undefined
|
|
|
|
|
+ robotOpsPlayPlanItemList.value.push(obj)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 播放方案素材明细删除按钮操作 */
|
|
|
|
|
+function handleDeleteRobotOpsPlayPlanItem() {
|
|
|
|
|
+ if (checkedRobotOpsPlayPlanItem.value.length == 0) {
|
|
|
|
|
+ proxy.$modal.msgError("请先选择要删除的播放方案素材明细数据")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ const robotOpsPlayPlanItems = robotOpsPlayPlanItemList.value
|
|
|
|
|
+ const checkedRobotOpsPlayPlanItems = checkedRobotOpsPlayPlanItem.value
|
|
|
|
|
+ robotOpsPlayPlanItemList.value = robotOpsPlayPlanItems.filter(function(item) {
|
|
|
|
|
+ return checkedRobotOpsPlayPlanItems.indexOf(item.index) == -1
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 复选框选中数据 */
|
|
|
|
|
+function handleRobotOpsPlayPlanItemSelectionChange(selection) {
|
|
|
|
|
+ checkedRobotOpsPlayPlanItem.value = selection.map(item => item.index)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/** 导出按钮操作 */
|
|
|
|
|
+function handleExport() {
|
|
|
|
|
+ proxy.download('base/plan/export', {
|
|
|
|
|
+ ...queryParams.value
|
|
|
|
|
+ }, `plan_${new Date().getTime()}.xlsx`)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+getList()
|
|
|
|
|
+</script>
|