|
@@ -1,4 +1,4 @@
|
|
|
-<script setup lang="ts">
|
|
|
+<script lang="ts" setup>
|
|
|
import Selector from '/src/views/reportManage/dataCenter/normalDisplay/components/Selector/index.vue';
|
|
|
import { ref, reactive, onMounted, nextTick, watch } from 'vue';
|
|
|
import { VXETable, VxeGridInstance, VxeGridProps, VxeGridListeners } from 'vxe-table';
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
postDeleteTask
|
|
|
} from '/src/views/reportManage/TaskManage/api.ts';
|
|
|
import { ComponentSize, ElMessage, FormInstance, FormRules } from 'element-plus';
|
|
|
-
|
|
|
+import { Plus, Delete } from '@element-plus/icons-vue';
|
|
|
|
|
|
//表单
|
|
|
interface taskRuleForm {
|
|
@@ -66,7 +66,7 @@ const xGrid = ref<VxeGridInstance<RowVO>>();
|
|
|
const originalDataMap = new Map();
|
|
|
|
|
|
const gridOptions = reactive<VxeGridProps<RowVO>>({
|
|
|
- border: false,
|
|
|
+ border: 'inner',
|
|
|
keepSource: true,
|
|
|
showOverflow: true,
|
|
|
height: 850,
|
|
@@ -150,15 +150,15 @@ async function getTaskList(filters = {}) {
|
|
|
page: gridOptions.pagerConfig.currentPage,
|
|
|
limit: gridOptions.pagerConfig.pageSize,
|
|
|
...filters,
|
|
|
- });
|
|
|
+ });
|
|
|
gridOptions.data = response.data;
|
|
|
gridOptions.pagerConfig.total = response.total;
|
|
|
- }catch (error) {
|
|
|
- console.error('Error fetching task data:', error);
|
|
|
- } finally {
|
|
|
- gridOptions.loading = false;
|
|
|
- }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('Error fetching task data:', error);
|
|
|
+ } finally {
|
|
|
+ gridOptions.loading = false;
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
const selectorRef = ref(null);
|
|
|
|
|
@@ -182,7 +182,7 @@ const editRowEvent = (row: RowVO) => {
|
|
|
const $grid = xGrid.value;
|
|
|
if ($grid) {
|
|
|
// 在进入编辑状态前保存原始数据
|
|
|
- originalDataMap.set(row.id, { ...row });
|
|
|
+ originalDataMap.set(row.id, {...row});
|
|
|
// 初始化 row.user 确保其与 row.user_name 同步
|
|
|
if (!row.user || row.user.length === 0) {
|
|
|
row.user = operationList.value
|
|
@@ -248,17 +248,17 @@ const removeEvent = async () => {
|
|
|
};
|
|
|
|
|
|
const requiredFields = [
|
|
|
- { field: 'platformNumber', title: '平台编号' },
|
|
|
- { field: 'platformName', title: '平台名称' },
|
|
|
- { field: 'country', title: '国家' },
|
|
|
- { field: 'brandName', title: '品牌' },
|
|
|
- { field: 'user', title: '运营' },
|
|
|
- { field: 'currencyCode', title: '回款币种' },
|
|
|
- { field: 'currencyCodePlatform', title: '回款/余额币种' }
|
|
|
+ {field: 'platformNumber', title: '平台编号'},
|
|
|
+ {field: 'platformName', title: '平台名称'},
|
|
|
+ {field: 'country', title: '国家'},
|
|
|
+ {field: 'brandName', title: '品牌'},
|
|
|
+ {field: 'user', title: '运营'},
|
|
|
+ {field: 'currencyCode', title: '回款币种'},
|
|
|
+ {field: 'currencyCodePlatform', title: '回款/余额币种'}
|
|
|
];
|
|
|
|
|
|
const validateRow = (row) => {
|
|
|
- for (const { field, title } of requiredFields) {
|
|
|
+ for (const {field, title} of requiredFields) {
|
|
|
if (!row[field] || (Array.isArray(row[field]) && row[field].length === 0)) {
|
|
|
ElMessage.error(`${title}不能为空`);
|
|
|
return;
|
|
@@ -391,25 +391,25 @@ onMounted(() => {
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
- <el-card class="custom-card-style flex gap-1.5 justify-between my-1.5 mx-2">
|
|
|
+ <el-card class="custom-card-style flex gap-1.5 justify-between mx-8">
|
|
|
<Selector ref="selectorRef" @update:filteredData="filteredDataChange" />
|
|
|
</el-card>
|
|
|
- <el-card class="mx-2">
|
|
|
+ <el-card class="mx-8 my-3">
|
|
|
<div style="position: relative">
|
|
|
- <vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvents">
|
|
|
+ <vxe-grid ref="xGrid" stripe v-bind="gridOptions" v-on="gridEvents">
|
|
|
<template #toolbar_buttons>
|
|
|
- <vxe-button status="primary" icon="vxe-icon-add" plain @click="dialogFormVisible = true"> 添加任务</vxe-button>
|
|
|
- <vxe-button icon="vxe-icon-delete" @click="removeEvent">删除</vxe-button>
|
|
|
+ <el-button :icon="Plus" plain type="primary" @click="dialogFormVisible = true"> 添加任务</el-button>
|
|
|
+ <el-button :icon="Delete" type="danger" plain @click="removeEvent">删除</el-button>
|
|
|
<!--<vxe-button icon="vxe-icon-save" @click="saveEvent">保存</vxe-button>-->
|
|
|
</template>
|
|
|
<template #operate="{ row }">
|
|
|
<template v-if="hasActiveEditRow(row)">
|
|
|
- <vxe-button type="text" content="取消" @click="clearRowEvent(row)"></vxe-button>
|
|
|
- <vxe-button type="text" status="success" content="保存" @click="saveRowEvent(row)"></vxe-button>
|
|
|
+ <vxe-button content="取消" type="text" @click="clearRowEvent(row)"></vxe-button>
|
|
|
+ <vxe-button content="保存" status="success" type="text" @click="saveRowEvent(row)"></vxe-button>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<!--<el-button type="text" icon="Edit" />-->
|
|
|
- <el-button type="text" icon="Edit" @click="editRowEvent(row)"></el-button>
|
|
|
+ <el-button icon="Edit" type="text" @click="editRowEvent(row)"></el-button>
|
|
|
</template>
|
|
|
</template>
|
|
|
<template #number_edit="{ row }">
|
|
@@ -426,7 +426,8 @@ onMounted(() => {
|
|
|
</template>
|
|
|
<template #operation_edit="{ row }">
|
|
|
<vxe-select v-model="row.user" multiple>
|
|
|
- <vxe-option v-for="item in operationList" :key="item.value" :value="item.value" :label="item.label"></vxe-option>
|
|
|
+ <vxe-option v-for="item in operationList" :key="item.value" :label="item.label"
|
|
|
+ :value="item.value"></vxe-option>
|
|
|
</vxe-select>
|
|
|
</template>
|
|
|
<template #currency_edit="{ row }">
|
|
@@ -463,7 +464,8 @@ onMounted(() => {
|
|
|
<el-input v-model="taskRuleForm.brand" placeholder="请输入品牌" />
|
|
|
</el-form-item>
|
|
|
<el-form-item label="录入人员" prop="operation">
|
|
|
- <el-select v-model="taskRuleForm.operation" multiple collapse-tags collapse-tags-tooltip placeholder="请选择录入人员">
|
|
|
+ <el-select v-model="taskRuleForm.operation" collapse-tags collapse-tags-tooltip multiple
|
|
|
+ placeholder="请选择录入人员">
|
|
|
<el-option v-for="item in operationList" :key="item.value" :label="item.label"
|
|
|
:value="item.value"></el-option>
|
|
|
</el-select>
|
|
@@ -488,6 +490,19 @@ onMounted(() => {
|
|
|
.custom-card-style {
|
|
|
z-index: 999;
|
|
|
position: sticky;
|
|
|
- top: 0;
|
|
|
+ margin-top: 15px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.el-card {
|
|
|
+ border: none;
|
|
|
+ box-shadow: none;
|
|
|
+}
|
|
|
+
|
|
|
+.el-card:hover {
|
|
|
+ box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
|
+ 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
|
+ border-color: #eee;
|
|
|
+ transition: all 0.2s ease-in-out;
|
|
|
}
|
|
|
</style>
|