|
|
@@ -88,23 +88,35 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="类型" align="center" width="100" prop="itemType">
|
|
|
<template #default="scope">
|
|
|
- <dict-tag :options="smsb_push_type" :value="scope.row.itemType" />
|
|
|
+ <dict-tag :options="smsb_push_type" :value="scope.row.itemType"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="审核状态" align="center" width="100" prop="status">
|
|
|
<template #default="scope">
|
|
|
- <dict-tag :options="smsb_push_state" :value="scope.row.status" />
|
|
|
+ <dict-tag :options="smsb_push_state" :value="scope.row.status"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="创建时间" align="left" prop="createTime" width="180" />
|
|
|
- <el-table-column label="创建人" align="left" prop="createUser" width="180" :show-overflow-tooltip="true" />
|
|
|
+ <el-table-column label="生效日期" align="left" prop="startDate" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="失效日期" align="left" prop="endDate" width="140">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="发布时间" align="left" prop="createTime" width="160"/>
|
|
|
+ <el-table-column label="创建人" align="left" prop="createUser" width="120" :show-overflow-tooltip="true"/>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
|
|
<template #default="scope">
|
|
|
<el-tooltip content="修改" placement="top">
|
|
|
- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['source:itemPush:edit']"></el-button>
|
|
|
+ <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['source:itemPush:edit']"></el-button>
|
|
|
</el-tooltip>
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['source:itemPush:remove']"></el-button>
|
|
|
+ <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['source:itemPush:remove']"></el-button>
|
|
|
</el-tooltip>
|
|
|
<!-- <el-tooltip content="提交审核" placement="top">
|
|
|
<el-button link type="primary" icon="Top" @click="handleReview(scope.row)" v-hasPermi="['source:minioData:add']"></el-button>
|
|
|
@@ -129,13 +141,13 @@
|
|
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
</el-card>
|
|
|
<!-- 添加或修改内容发布对话框 -->
|
|
|
- <el-dialog :title="dialog.title" v-model="dialog.visible" width="1500px" append-to-body>
|
|
|
+ <el-dialog :title="dialog.title" v-model="dialog.visible" width="1500px" style="height: 700px" append-to-body>
|
|
|
<el-row :gutter="20" style="height: 100%; display: flex">
|
|
|
<!--设备列表-->
|
|
|
<el-col :span="6" style="height: 100%; overflow: auto; border-right: 1px solid #eee; padding-right: 10px">
|
|
|
- <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectDevice">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="设备名称" align="left" prop="name" :show-overflow-tooltip="true" />
|
|
|
+ <el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectDevice" style="height: 520px">
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="设备名称" align="left" prop="name" :show-overflow-tooltip="true"/>
|
|
|
</el-table>
|
|
|
</el-col>
|
|
|
<!--发布名称-->
|
|
|
@@ -201,14 +213,14 @@
|
|
|
<div v-if="form.itemType === 1 || form.itemType === 2">
|
|
|
<!--<el-table v-loading="loading" :data="itemList" @selection-change="handleSelectItem">
|
|
|
<el-table-column type="selection" width="55" align="center" />-->
|
|
|
- <el-table v-loading="loading" :data="itemList">
|
|
|
+ <el-table v-loading="loading" :data="itemList" style="height: 520px">
|
|
|
<el-table-column label="ID" width="200" align="left" :show-overflow-tooltip="true">
|
|
|
<template #default="{ row }">
|
|
|
- <el-radio v-model="selectedRowId" :label="row.id" @change="handleRadioChange(row)" />
|
|
|
+ <el-radio v-model="selectedRowId" :label="row.id" @change="handleRadioChange(row)"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="名称" align="left" prop="itemName" :show-overflow-tooltip="true" />
|
|
|
- <el-table-column label="资源数量" align="center" prop="sourceNum" width="80" />
|
|
|
+ <el-table-column label="名称" align="left" prop="itemName" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="资源数量" align="center" prop="sourceNum" width="80"/>
|
|
|
<!--
|
|
|
<el-table-column label="创建人" align="left" prop="createUser" width="100" :show-overflow-tooltip="true" />
|
|
|
-->
|
|
|
@@ -280,17 +292,25 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup name="ItemPush" lang="ts">
|
|
|
-import { listItemPush, getItemPush, delItemPush, addItemPush, updateItemPush, pushStatistics, reviewItemPush } from '@/api/smsb/source/item_push';
|
|
|
-import { ItemPushVO, ItemPushQuery, ItemPushForm } from '@/api/smsb/source/item_push_type';
|
|
|
-import { DeviceQuery, DeviceVO } from '@/api/smsb/device/device_type';
|
|
|
-import { listDevice } from '@/api/smsb/device/device';
|
|
|
-import { ItemQuery, ItemVO } from '@/api/smsb/source/item_type';
|
|
|
-import { listItem } from '@/api/smsb/source/item';
|
|
|
-import { ItemPushDeviceVO } from '@/api/smsb/source/item_push_device_type';
|
|
|
-import { listItemPushDeviceV2, removeItemPushDevice } from '@/api/smsb/source/item_push_device';
|
|
|
-
|
|
|
-const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
-const { smsb_push_state, smsb_push_device_state, smsb_push_type, smsb_push_level } = toRefs<any>(
|
|
|
+import {
|
|
|
+ addItemPush,
|
|
|
+ delItemPush,
|
|
|
+ getItemPush,
|
|
|
+ listItemPush,
|
|
|
+ pushStatistics,
|
|
|
+ reviewItemPush,
|
|
|
+ updateItemPush
|
|
|
+} from '@/api/smsb/source/item_push';
|
|
|
+import {ItemPushForm, ItemPushQuery, ItemPushVO} from '@/api/smsb/source/item_push_type';
|
|
|
+import {DeviceQuery, DeviceVO} from '@/api/smsb/device/device_type';
|
|
|
+import {listDevice} from '@/api/smsb/device/device';
|
|
|
+import {ItemQuery, ItemVO} from '@/api/smsb/source/item_type';
|
|
|
+import {listItem} from '@/api/smsb/source/item';
|
|
|
+import {ItemPushDeviceVO} from '@/api/smsb/source/item_push_device_type';
|
|
|
+import {listItemPushDeviceV2, removeItemPushDevice} from '@/api/smsb/source/item_push_device';
|
|
|
+
|
|
|
+const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const {smsb_push_state, smsb_push_device_state, smsb_push_type, smsb_push_level} = toRefs<any>(
|
|
|
proxy?.useDict('smsb_push_state', 'smsb_push_device_state', 'smsb_push_type', 'smsb_push_level')
|
|
|
);
|
|
|
|
|
|
@@ -551,13 +571,31 @@ const handleUpdate = async (row?: ItemPushVO) => {
|
|
|
Object.assign(form.value, res.data);
|
|
|
dialog.visible = true;
|
|
|
dialog.title = '修改内容发布';
|
|
|
- getDeviceList();
|
|
|
+ await getDeviceList();
|
|
|
};
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
const submitForm = () => {
|
|
|
itemPushFormRef.value?.validate(async (valid: boolean) => {
|
|
|
if (valid) {
|
|
|
+ /*const options: Intl.DateTimeFormatOptions = {
|
|
|
+ timeZone: 'Asia/Shanghai',
|
|
|
+ year: 'numeric',
|
|
|
+ month: '2-digit',
|
|
|
+ day: '2-digit',
|
|
|
+ hour: '2-digit',
|
|
|
+ minute: '2-digit',
|
|
|
+ second: '2-digit'
|
|
|
+ };
|
|
|
+ const formatter = new Intl.DateTimeFormat('zh-CN', options);
|
|
|
+ let startDate = formatter.format(form.value.timeRange.start);
|
|
|
+ startDate = startDate.replace(/\//g, '-');
|
|
|
+ startDate = startDate.replace(/:/g, '-');
|
|
|
+ console.log("startDate : " + startDate);
|
|
|
+ let endDate = formatter.format(form.value.timeRange.end);
|
|
|
+ endDate = endDate.replace(/\//g, '-');
|
|
|
+ endDate = endDate.replace(/:/g, '-');
|
|
|
+ console.log("endDate : " + endDate)*/
|
|
|
buttonLoading.value = true;
|
|
|
if (form.value.id) {
|
|
|
await updateItemPush(form.value).finally(() => (buttonLoading.value = false));
|