mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2024-11-01 06:02:38 +08:00
解决 task 数据显示异常
This commit is contained in:
parent
ca6d5365dd
commit
bff76769b0
@ -214,13 +214,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, onMounted, reactive } from "vue";
|
import { computed, defineComponent, inject, onMounted, reactive } from "vue";
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
import Draggable from "vuedraggable/src/vuedraggable";
|
import Draggable from "vuedraggable/src/vuedraggable";
|
||||||
import { checkPerm } from "/$/base";
|
import { checkPerm } from "/$/base";
|
||||||
import { ContextMenu } from "@cool-vue/crud";
|
import { ContextMenu } from "@cool-vue/crud";
|
||||||
import Cron from "../components/cron";
|
import Cron from "../components/cron";
|
||||||
import { useCool } from "/@/cool";
|
import { useRefs } from "/@/cool";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "task",
|
name: "task",
|
||||||
@ -231,7 +231,8 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
setup() {
|
setup() {
|
||||||
const { refs, setRefs, service } = useCool();
|
const { refs, setRefs } = useRefs();
|
||||||
|
const service = inject<any>("service");
|
||||||
|
|
||||||
// 任务列表
|
// 任务列表
|
||||||
const list = reactive<any[]>([
|
const list = reactive<any[]>([
|
||||||
@ -394,7 +395,6 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "名称",
|
label: "名称",
|
||||||
prop: "name",
|
prop: "name",
|
||||||
value: info.name,
|
|
||||||
component: {
|
component: {
|
||||||
name: "el-input",
|
name: "el-input",
|
||||||
props: {
|
props: {
|
||||||
@ -409,7 +409,7 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "类型",
|
label: "类型",
|
||||||
prop: "taskType",
|
prop: "taskType",
|
||||||
value: info.taskType || 0,
|
value: 0,
|
||||||
component: {
|
component: {
|
||||||
name: "el-select",
|
name: "el-select",
|
||||||
options: [
|
options: [
|
||||||
@ -440,7 +440,6 @@ export default defineComponent({
|
|||||||
hidden: ({ scope }: any) => {
|
hidden: ({ scope }: any) => {
|
||||||
return scope.taskType == 1;
|
return scope.taskType == 1;
|
||||||
},
|
},
|
||||||
value: info.cron,
|
|
||||||
component: {
|
component: {
|
||||||
name: "slot-cron"
|
name: "slot-cron"
|
||||||
},
|
},
|
||||||
@ -452,7 +451,6 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "次数",
|
label: "次数",
|
||||||
prop: "limit",
|
prop: "limit",
|
||||||
value: info.limit,
|
|
||||||
hidden: ({ scope }: any) => {
|
hidden: ({ scope }: any) => {
|
||||||
return scope.taskType == 0;
|
return scope.taskType == 0;
|
||||||
},
|
},
|
||||||
@ -467,7 +465,6 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "间隔(秒)",
|
label: "间隔(秒)",
|
||||||
prop: "every",
|
prop: "every",
|
||||||
value: info.every,
|
|
||||||
hidden: ({ scope }: any) => {
|
hidden: ({ scope }: any) => {
|
||||||
return scope.taskType == 0;
|
return scope.taskType == 0;
|
||||||
},
|
},
|
||||||
@ -486,7 +483,6 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "service",
|
label: "service",
|
||||||
prop: "service",
|
prop: "service",
|
||||||
value: info.service,
|
|
||||||
component: {
|
component: {
|
||||||
name: "el-input",
|
name: "el-input",
|
||||||
props: {
|
props: {
|
||||||
@ -497,29 +493,31 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "开始时间",
|
label: "开始时间",
|
||||||
prop: "startDate",
|
prop: "startDate",
|
||||||
value: info.startDate || "",
|
hidden: ({ scope }: any) => {
|
||||||
|
return scope.taskType == 1;
|
||||||
|
},
|
||||||
component: {
|
component: {
|
||||||
name: "el-date-picker",
|
name: "el-date-picker",
|
||||||
props: {
|
props: {
|
||||||
type: "datetime"
|
type: "datetime",
|
||||||
|
"value-format": "YYYY-MM-DD HH:mm:ss"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "结束时间",
|
label: "结束时间",
|
||||||
prop: "endDate",
|
prop: "endDate",
|
||||||
value: info.endDate || "",
|
|
||||||
component: {
|
component: {
|
||||||
name: "el-date-picker",
|
name: "el-date-picker",
|
||||||
props: {
|
props: {
|
||||||
type: "datetime"
|
type: "datetime",
|
||||||
|
"value-format": "YYYY-MM-DD HH:mm:ss"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "备注",
|
label: "备注",
|
||||||
prop: "remark",
|
prop: "remark",
|
||||||
value: info.remark,
|
|
||||||
component: {
|
component: {
|
||||||
name: "el-input",
|
name: "el-input",
|
||||||
props: {
|
props: {
|
||||||
@ -530,7 +528,6 @@ export default defineComponent({
|
|||||||
{
|
{
|
||||||
label: "状态",
|
label: "状态",
|
||||||
prop: "status",
|
prop: "status",
|
||||||
value: info.status === 0 ? 0 : 1,
|
|
||||||
component: {
|
component: {
|
||||||
name: "el-radio-group",
|
name: "el-radio-group",
|
||||||
options: [
|
options: [
|
||||||
@ -546,6 +543,9 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
form: {
|
||||||
|
...info
|
||||||
|
},
|
||||||
on: {
|
on: {
|
||||||
submit: (data: any, { close, done }: any) => {
|
submit: (data: any, { close, done }: any) => {
|
||||||
if (!data.limit) {
|
if (!data.limit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user