update
This commit is contained in:
@@ -484,6 +484,20 @@ const merchant = {
|
||||
data: data
|
||||
});
|
||||
},
|
||||
saveMode: async (data) => {
|
||||
return request({
|
||||
url: '/index/task/saveMode',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
getModeList: async (data) => {
|
||||
return request({
|
||||
url: '/index/task/getModeList',
|
||||
method: Method.POST,
|
||||
data: data
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
export default merchant;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<script setup>
|
||||
import {reactive, ref, watch} from "vue";
|
||||
import Api from "../../../../../api";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
|
||||
const {id} = defineProps({
|
||||
id: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
});
|
||||
const modeList = reactive([]);
|
||||
const visible = ref(false);
|
||||
const form = reactive({
|
||||
remark: null,
|
||||
});
|
||||
|
||||
const success = async () => {
|
||||
if (form.remark.length > 100) {
|
||||
Message.warning('不允许大于100字');
|
||||
return;
|
||||
}
|
||||
const {msg} = await Api.merchant.saveMode({
|
||||
id: id,
|
||||
...form,
|
||||
});
|
||||
Message.success(msg);
|
||||
}
|
||||
|
||||
watch(
|
||||
() => visible.value,
|
||||
(val) => {
|
||||
if (val) Api.merchant.getModeList().then(({data}) => {
|
||||
modeList.length = 0;
|
||||
modeList.push(...data);
|
||||
})
|
||||
},
|
||||
{deep: true}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div @click="visible=true">
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
<a-modal
|
||||
@ok="success"
|
||||
title="存为模板"
|
||||
ok-text="确定存为模板"
|
||||
title-align="start"
|
||||
v-model:visible="visible">
|
||||
<div class="text-[14px] text-[#4E5969] mb-[8px]">将该任务,存为模板。下次新建任务时,可一键填写</div>
|
||||
<a-input v-model:model-value="form.remark" placeholder="请输入模板备注,方便您快速找到该模板"></a-input>
|
||||
<div class="mt-[20px] text-[14px] text-[#4E5969]">模板已创建</div>
|
||||
<div class="mt-[8px] text-[14px] text-[#4E5969]"><span class="text-[#165DFF]">{{ modeList.length }}</span>/20
|
||||
</div>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
@@ -7,6 +7,7 @@ import Api from "../../../../api/index.js";
|
||||
import {toPath} from "../../../../utils/index.js";
|
||||
import {Message} from "@arco-design/web-vue";
|
||||
import {usePayTask} from "../../../../hooks/usePayTask.js";
|
||||
import SaveTemplate from "./components/SaveTemplate.vue";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
@@ -183,7 +184,7 @@ const stopTask = async (id) => {
|
||||
<template v-slot:start="{record}">
|
||||
<a-switch
|
||||
@change="startTask($event, record)"
|
||||
:disabled="record.status !== -2 && record.status !== 3 && record.status !== 4"
|
||||
:disabled="record.status !== -2 && record.status !== 3 && record.status !== 4 && record.status !== 2"
|
||||
:model-value="record.status === 4">
|
||||
</a-switch>
|
||||
</template>
|
||||
@@ -209,21 +210,26 @@ const stopTask = async (id) => {
|
||||
</a-link>
|
||||
<a-popconfirm content="确认终止吗?" @ok="stopTask(record.id)">
|
||||
<a-link :disabled="!(record.status === 4 || record.status === -2)" :hoverable="false"
|
||||
status="danger">终止
|
||||
status="danger">
|
||||
终止
|
||||
</a-link>
|
||||
</a-popconfirm>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:exp>
|
||||
<template v-slot:exp="{record}">
|
||||
<a-trigger trigger="click" :unmount-on-close="false">
|
||||
<a-link :hoverable="false">更多
|
||||
<icon-down/>
|
||||
</a-link>
|
||||
<template #content>
|
||||
<div class="demo-basic">
|
||||
<a-button type="text">
|
||||
存为模版
|
||||
<SaveTemplate :id="record.id">
|
||||
<a-button
|
||||
type="text"
|
||||
:disabled="record.status===0 || record.status===1 || record.status===-1">
|
||||
存为模板
|
||||
</a-button>
|
||||
</SaveTemplate>
|
||||
</div>
|
||||
</template>
|
||||
</a-trigger>
|
||||
|
||||
Reference in New Issue
Block a user