Compare commits
2 Commits
f27be181ae
...
f82e52c3dd
| Author | SHA1 | Date |
|---|---|---|
|
|
f82e52c3dd | |
|
|
c8b14cd377 |
|
|
@ -10,6 +10,8 @@ enum Api {
|
||||||
DetailTask = "/api/AdminTaskManage/GteTaskById",
|
DetailTask = "/api/AdminTaskManage/GteTaskById",
|
||||||
GetAiShp = "/api/AdminTaskManage/GteAiShp",
|
GetAiShp = "/api/AdminTaskManage/GteAiShp",
|
||||||
GetTif = "/api/AdminTaskManage/GteTif",
|
GetTif = "/api/AdminTaskManage/GteTif",
|
||||||
|
GetTifByTime = "/api/AdminTaskManage/GteTifByTime",
|
||||||
|
PublishTask = "/api/AdminTaskManage/ReleaseTask",
|
||||||
// 普通用户任务
|
// 普通用户任务
|
||||||
PersonTaskList = "/api/PersonTask/Load",
|
PersonTaskList = "/api/PersonTask/Load",
|
||||||
PersonTaskDetail = "/api/PersonTask/GetTaskDetail",
|
PersonTaskDetail = "/api/PersonTask/GetTaskDetail",
|
||||||
|
|
@ -38,18 +40,25 @@ export const addTask = (params:Task) =>
|
||||||
export const updateTask = (params:Task) =>
|
export const updateTask = (params:Task) =>
|
||||||
defHttp.post<TaskResultModel>({ url: Api.EditTask, params });
|
defHttp.post<TaskResultModel>({ url: Api.EditTask, params });
|
||||||
|
|
||||||
|
export const publishTask = (params) =>
|
||||||
|
defHttp.post<TaskResultModel>({ url: Api.PublishTask, params });
|
||||||
|
|
||||||
|
|
||||||
export const deleteTask = (params) =>
|
export const deleteTask = (params) =>
|
||||||
defHttp.post<TaskResultModel>({ url: Api.DeleteTask, params });
|
defHttp.post<TaskResultModel>({ url: Api.DeleteTask, params });
|
||||||
|
|
||||||
export const getTaskDetail = (params) =>
|
export const getTaskDetail = (params) =>
|
||||||
defHttp.get<TaskResultModel>({ url: Api.DetailTask, params });
|
defHttp.get<TaskResultModel>({ url: Api.DetailTask, params });
|
||||||
|
|
||||||
export const getAiShape = () =>
|
export const getAiShape = (params) =>
|
||||||
defHttp.get<TaskResultModel>({ url: Api.GetAiShp });
|
defHttp.get<TaskResultModel>({ url: Api.GetAiShp,params});
|
||||||
|
|
||||||
export const getTif = () =>
|
export const getTif = () =>
|
||||||
defHttp.get<TaskResultModel>({ url: Api.GetTif });
|
defHttp.get<TaskResultModel>({ url: Api.GetTif });
|
||||||
|
|
||||||
|
export const getTifByTime = (params)=>
|
||||||
|
defHttp.get<TaskResultModel>({ url: Api.GetTifByTime ,params});
|
||||||
|
|
||||||
// 普通用户任务
|
// 普通用户任务
|
||||||
export const getPersonTaskList = (params) =>
|
export const getPersonTaskList = (params) =>
|
||||||
defHttp.get<TaskResultModel>({ url: Api.PersonTaskList, params });
|
defHttp.get<TaskResultModel>({ url: Api.PersonTaskList, params });
|
||||||
|
|
@ -74,9 +83,9 @@ export const LoadAllUsers = () =>
|
||||||
defHttp.get({ url: Api.LoadAllUsers });
|
defHttp.get({ url: Api.LoadAllUsers });
|
||||||
|
|
||||||
// shape
|
// shape
|
||||||
export const updateShape = (params) =>
|
export const updateShape = () =>
|
||||||
defHttp.post<TaskResultModel>({ url: Api.UpdateShape,params });
|
defHttp.post<TaskResultModel>({ url: Api.UpdateShape });
|
||||||
|
|
||||||
// tif
|
// tif
|
||||||
export const updateTif = (params) =>
|
export const updateTif = () =>
|
||||||
defHttp.post<TaskResultModel>({ url: Api.UpdateTif,params });
|
defHttp.post<TaskResultModel>({ url: Api.UpdateTif });
|
||||||
|
|
|
||||||
|
|
@ -1,66 +1,172 @@
|
||||||
<template>
|
<template>
|
||||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
|
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
|
||||||
<BasicForm @register="registerForm" />
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="{ span: 6 }"
|
||||||
|
>
|
||||||
|
<a-form-item label="选择AI解译成果" name="shpId" required>
|
||||||
|
<a-row :gutter="12">
|
||||||
|
<a-col :span="17">
|
||||||
|
<a-select
|
||||||
|
v-model:value="form.shpId"
|
||||||
|
placeholder="请选择AI解译成果"
|
||||||
|
:fieldNames="{
|
||||||
|
label: 'shpName',
|
||||||
|
key: 'id',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
:options="shapefiles"
|
||||||
|
show-search
|
||||||
|
allowClear
|
||||||
|
@search="handlerOnSearch"
|
||||||
|
:filterOption="false"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<a-button type="primary" @click="handlerUpdateAiShape">更新数据</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
<a-form-item label="选择前时项" required name="previousPhase">
|
||||||
|
<a-row :gutter="12">
|
||||||
|
<a-col :span="17">
|
||||||
|
<a-tree-select
|
||||||
|
v-if="false"
|
||||||
|
v-model:value="form.previousPhase"
|
||||||
|
placeholder="选择前时项"
|
||||||
|
allow-clear
|
||||||
|
multiple
|
||||||
|
:tree-default-expand-all="false"
|
||||||
|
defaultExpandAll
|
||||||
|
:tree-data="afterTifs"
|
||||||
|
tree-node-filter-prop="label"
|
||||||
|
:fieldNames="{
|
||||||
|
label: 'name',
|
||||||
|
key: 'id',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
</a-tree-select>
|
||||||
|
|
||||||
|
<a-select
|
||||||
|
v-model:value="form.previousPhase"
|
||||||
|
mode="multiple"
|
||||||
|
style="width: 100%"
|
||||||
|
disabled
|
||||||
|
placeholder="选择前时项"
|
||||||
|
:fieldNames="{
|
||||||
|
label: 'tifName',
|
||||||
|
key: 'id',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
:options="previousPhaseOptions"
|
||||||
|
></a-select>
|
||||||
|
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<!-- <a-button type="primary" @click="handlerUpdateTif">更新数据</a-button> -->
|
||||||
|
<a-button type="primary" @click="handlerSelectTif('选择前时项')">选择数据</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label="选择后时项" required name="laterPhase">
|
||||||
|
<a-row :gutter="12">
|
||||||
|
<a-col :span="17">
|
||||||
|
<a-select
|
||||||
|
v-model:value="form.laterPhase"
|
||||||
|
mode="multiple"
|
||||||
|
style="width: 100%"
|
||||||
|
placeholder="选择后时项"
|
||||||
|
:fieldNames="{
|
||||||
|
label: 'tifName',
|
||||||
|
key: 'id',
|
||||||
|
value: 'id',
|
||||||
|
}"
|
||||||
|
disabled
|
||||||
|
:options="laterPhaseOptions"
|
||||||
|
></a-select>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="7">
|
||||||
|
<!-- <a-button type="primary" @click="handlerUpdateTif">更新数据</a-button> -->
|
||||||
|
<a-button type="primary" @click="handlerSelectTif('选择后时项')">选择数据</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item ref="taskName" label="任务名称" name="taskName" required>
|
||||||
|
<a-input v-model:value="form.taskName" />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item ref="remark" label="备注/说明" name="remark" >
|
||||||
|
<a-textarea v-model:value="form.remark" />
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
<a-modal v-model:open="tifListVisible" :title="tifListTitle" width="600px" @ok="handlerReturnTif">
|
||||||
|
<TifSelect ref="TifSelectComponent" v-if="tifListVisible" ></TifSelect>
|
||||||
|
|
||||||
|
</a-modal>
|
||||||
|
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed, unref } from 'vue';
|
import { ref, computed, unref ,reactive,watch} from 'vue';
|
||||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||||
import { BasicForm, useForm } from '@/components/Form';
|
import TifSelect from "./tifselect.vue"
|
||||||
import { formSchema } from './dept.data';
|
// import { BasicForm, useForm } from '@/components/Form';
|
||||||
|
// import { formSchema } from './dept.data';
|
||||||
|
|
||||||
import { getDeptList, addDept, updateDept } from '@/api/demo/system';
|
// import { getDeptList, addDept, updateDept } from '@/api/demo/system';
|
||||||
import {getAiShape,getTif,addTask,updateTask} from '@/api/task'
|
import {getAiShape,updateShape,getTifByTime,updateTif,addTask,updateTask} from '@/api/task'
|
||||||
|
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
defineOptions({ name: 'DeptModal' });
|
defineOptions({ name: 'DeptModal' });
|
||||||
|
|
||||||
|
const form = ref({
|
||||||
|
shpId:null
|
||||||
|
})
|
||||||
|
|
||||||
|
const queryForm = ref({
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const emit = defineEmits(['success', 'register']);
|
const emit = defineEmits(['success', 'register']);
|
||||||
|
|
||||||
const isUpdate = ref(true);
|
const isUpdate = ref(true);
|
||||||
|
|
||||||
const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
|
|
||||||
labelWidth: 120,
|
const shapefiles = ref();
|
||||||
baseColProps: { span: 24 },
|
|
||||||
schemas: formSchema,
|
getAiShape({name:null}).then(res=>{
|
||||||
showActionButtonGroup: false,
|
shapefiles.value = res;
|
||||||
});
|
})
|
||||||
|
|
||||||
|
|
||||||
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
resetFields();
|
// resetFields();
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
|
|
||||||
isUpdate.value = !!data?.isUpdate;
|
isUpdate.value = !!data?.isUpdate;
|
||||||
|
|
||||||
if (unref(isUpdate)) {
|
if (unref(isUpdate)) {
|
||||||
setFieldsValue({
|
form.value = data.record;
|
||||||
...data.record,
|
previousPhaseOptions.value = data.record.previousPhaseInfo;
|
||||||
});
|
laterPhaseOptions.value = data.record.laterPhaseInfo;
|
||||||
|
}else{
|
||||||
|
form.value = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
const treeData = await getDeptList();
|
|
||||||
|
|
||||||
const shapefiles = await getAiShape();
|
|
||||||
|
|
||||||
const tifs = await getTif();
|
|
||||||
|
|
||||||
let afterTifs = handleDealTifTree(tifs)
|
|
||||||
|
|
||||||
|
|
||||||
// 更新字段值
|
|
||||||
updateSchema([
|
|
||||||
{
|
|
||||||
field: 'shpId',
|
|
||||||
componentProps: { options:shapefiles },
|
|
||||||
},{
|
|
||||||
field: 'previousPhase',
|
|
||||||
componentProps: { treeData:afterTifs },
|
|
||||||
},{
|
|
||||||
field: 'laterPhase',
|
|
||||||
componentProps: { treeData:afterTifs },
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const getTitle = computed(() => (!unref(isUpdate) ? '创建任务' : '编辑任务'));
|
const getTitle = computed(() => (!unref(isUpdate) ? '创建任务' : '编辑任务'));
|
||||||
|
|
@ -119,41 +225,103 @@
|
||||||
return handlerAfterTifs;
|
return handlerAfterTifs;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formRef = ref(null);
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const values = await validate();
|
// const values = await validate();
|
||||||
let query = values;
|
formRef.value.validate().then(() => {
|
||||||
// if (query.id) {
|
let query = form.value;
|
||||||
// query.id = Number(query.id);
|
if (!unref(isUpdate)) {
|
||||||
// } else {
|
addTask(query).then(data=>{
|
||||||
// query.id = 0;
|
if (data) {
|
||||||
// }
|
setModalProps({ confirmLoading: true });
|
||||||
// 调用接口
|
closeModal();
|
||||||
if (!unref(isUpdate)) {
|
emit('success');
|
||||||
const data = await addTask(query);
|
return createMessage.success('创建成功');
|
||||||
if (data) {
|
} else {
|
||||||
setModalProps({ confirmLoading: true });
|
return createMessage.error('创建失败');
|
||||||
closeModal();
|
}
|
||||||
emit('success');
|
})
|
||||||
return createMessage.success('创建成功');
|
|
||||||
} else {
|
} else {
|
||||||
return createMessage.error('创建失败');
|
updateTask(query).then(data=>{
|
||||||
|
if (data) {
|
||||||
|
setModalProps({ confirmLoading: true });
|
||||||
|
closeModal();
|
||||||
|
emit('success');
|
||||||
|
return createMessage.success('编辑成功');
|
||||||
|
} else {
|
||||||
|
return createMessage.error('编辑失败');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
}).catch(() => {
|
||||||
const data = await updateTask(query);
|
|
||||||
if (data) {
|
});
|
||||||
setModalProps({ confirmLoading: true });
|
|
||||||
closeModal();
|
|
||||||
emit('success');
|
|
||||||
return createMessage.success('编辑成功');
|
|
||||||
} else {
|
|
||||||
return createMessage.error('编辑失败');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} finally {
|
} finally {
|
||||||
setModalProps({ confirmLoading: false });
|
setModalProps({ confirmLoading: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleConfirm(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlerOnSearch(value){
|
||||||
|
getAiShape({name:value}).then(res=>{
|
||||||
|
shapefiles.value = res;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function handlerUpdateAiShape(){
|
||||||
|
updateShape().then(res=>{
|
||||||
|
if(res){
|
||||||
|
createMessage.success("更新数据成功!");
|
||||||
|
}else{
|
||||||
|
createMessage.error("更新数据失败!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const tifListVisible = ref(false);
|
||||||
|
const tifListTitle = ref("")
|
||||||
|
|
||||||
|
|
||||||
|
function handlerSelectTif(type){
|
||||||
|
tifListTitle.value = type;
|
||||||
|
tifListVisible.value =true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const previousPhaseOptions = ref([]);
|
||||||
|
const laterPhaseOptions = ref([]);
|
||||||
|
|
||||||
|
|
||||||
|
const TifSelectComponent = ref(null);
|
||||||
|
|
||||||
|
const handlerReturnTif = ()=>{
|
||||||
|
let info = TifSelectComponent.value.getSelectedInfo();
|
||||||
|
|
||||||
|
if(tifListTitle.value == "选择前时项"){
|
||||||
|
form.value.previousPhase = info.selectedRowKeys;
|
||||||
|
previousPhaseOptions.value = info.selectedRows;
|
||||||
|
console.log("previousPhaseOptions",form.value.previousPhase,previousPhaseOptions.value)
|
||||||
|
tifListTitle.value = false;
|
||||||
|
}else if(tifListTitle.value=="选择后时项"){
|
||||||
|
form.value.laterPhase = info.selectedRowKeys;
|
||||||
|
laterPhaseOptions.value = info.selectedRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
tifListVisible.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
::v-deep .update-button{
|
::v-deep .update-button{
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
<a-descriptions-item label="备注/说明" :span="6">{{taskInfo.remark}}</a-descriptions-item>
|
<a-descriptions-item label="备注/说明" :span="6">{{taskInfo.remark}}</a-descriptions-item>
|
||||||
|
|
||||||
<a-descriptions-item label="AI解释成果" :span="2">
|
<a-descriptions-item label="AI解释成果" :span="2">
|
||||||
{{ tifInfo.shpInfo.shpPath }}
|
{{ tifInfo.shpInfo?.shpPath }}
|
||||||
<a-button type="link" @click="copyToClipboard(tifInfo.shpInfo.shpPath)">复制</a-button>
|
<a-button v-show="tifInfo.shpInfo?.shpPath" type="link" @click="copyToClipboard(tifInfo.shpInfo.shpPath)">复制</a-button>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
|
|
||||||
<a-descriptions-item label="前时相" :span="2">
|
<a-descriptions-item label="前时相" :span="2">
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
<a-tag color="orange" v-if="taskInfo.state == 0">待领取</a-tag>
|
<a-tag color="orange" v-if="taskInfo.state == 0">待领取</a-tag>
|
||||||
<a-tag color="blue" v-if="taskInfo.state == 1">领取中</a-tag>
|
<a-tag color="blue" v-if="taskInfo.state == 1">领取中</a-tag>
|
||||||
<a-tag color="green" v-if="taskInfo.state == 2">已领完</a-tag>
|
<a-tag color="green" v-if="taskInfo.state == 2">已领完</a-tag>
|
||||||
|
<a-tag color="green" v-if="taskInfo.state == 3">未发布</a-tag>
|
||||||
</a-descriptions-item>
|
</a-descriptions-item>
|
||||||
|
|
||||||
<a-descriptions-item label="创建人" :span="2">{{taskInfo.createUserName}}</a-descriptions-item>
|
<a-descriptions-item label="创建人" :span="2">{{taskInfo.createUserName}}</a-descriptions-item>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { h } from 'vue';
|
||||||
import { Tag } from 'ant-design-vue';
|
import { Tag } from 'ant-design-vue';
|
||||||
import { getPosGroupList } from '@/api/demo/system';
|
import { getPosGroupList } from '@/api/demo/system';
|
||||||
|
|
||||||
import { updateShape,updateTif } from '@/api/task';
|
import { updateShape,updateTif,getAiShape } from '@/api/task';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
const { createMessage } = useMessage();
|
const { createMessage } = useMessage();
|
||||||
|
|
||||||
|
|
@ -126,8 +126,19 @@ export const formSchema: FormSchema[] = [
|
||||||
key: 'id',
|
key: 'id',
|
||||||
value: 'id',
|
value: 'id',
|
||||||
},
|
},
|
||||||
|
showSearch:true,
|
||||||
onChange:(value)=>{
|
onChange:(value)=>{
|
||||||
|
|
||||||
|
},
|
||||||
|
onSearch:(value)=>{
|
||||||
|
let options = getAiShape({name:value});
|
||||||
|
return options;
|
||||||
|
},
|
||||||
|
filterOption:(input: string, option: any) => {
|
||||||
|
// console.log("option",option);
|
||||||
|
// let options = getAiShape({name:input});
|
||||||
|
// return options;
|
||||||
|
// return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
||||||
},
|
},
|
||||||
getPopupContainer: () => document.body,
|
getPopupContainer: () => document.body,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<a-tag color="orange" v-if="record.state == 0">待领取</a-tag>
|
<a-tag color="orange" v-if="record.state == 0">待领取</a-tag>
|
||||||
<a-tag color="blue" v-if="record.state == 1">领取中</a-tag>
|
<a-tag color="blue" v-if="record.state == 1">领取中</a-tag>
|
||||||
<a-tag color="green" v-if="record.state == 2">已领完</a-tag>
|
<a-tag color="green" v-if="record.state == 2">已领完</a-tag>
|
||||||
|
<a-tag color="red" v-if="record.state == 3">未发布</a-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
|
|
@ -32,7 +33,7 @@
|
||||||
|
|
||||||
import { BasicTable, useTable } from '@/components/Table';
|
import { BasicTable, useTable } from '@/components/Table';
|
||||||
import { getOrgList, deleteDept } from '@/api/demo/system';
|
import { getOrgList, deleteDept } from '@/api/demo/system';
|
||||||
import {getTaskList,deleteTask,getTaskDetail} from '@/api/task'
|
import {getTaskList,deleteTask,getTaskDetail,publishTask} from '@/api/task'
|
||||||
import { PageWrapper } from '@/components/Page';
|
import { PageWrapper } from '@/components/Page';
|
||||||
import { useModal } from '@/components/Modal';
|
import { useModal } from '@/components/Modal';
|
||||||
import { useMessage } from '@/hooks/web/useMessage';
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
|
|
@ -136,6 +137,23 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handlePublish(){
|
||||||
|
let rows = getSelectRows();
|
||||||
|
if (rows.length == 0) {
|
||||||
|
return createMessage.warn('请选择一个任务进行发布');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const data = await publishTask({id:rows[0].id});
|
||||||
|
if (data) {
|
||||||
|
handleSuccess();
|
||||||
|
createMessage.success('发布成功');
|
||||||
|
} else {
|
||||||
|
createMessage.error('发布失败');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
async function handleDelete() {
|
async function handleDelete() {
|
||||||
let rows = getSelectRows();
|
let rows = getSelectRows();
|
||||||
if (rows.length == 0) {
|
if (rows.length == 0) {
|
||||||
|
|
@ -153,10 +171,10 @@
|
||||||
try{
|
try{
|
||||||
const data = await deleteTask({id:rows[0].id});
|
const data = await deleteTask({id:rows[0].id});
|
||||||
if (data) {
|
if (data) {
|
||||||
handleSuccess();
|
handleSuccess();
|
||||||
createMessage.success('删除成功');
|
createMessage.success('删除成功');
|
||||||
} else {
|
} else {
|
||||||
createMessage.error('删除失败');
|
createMessage.error('删除失败');
|
||||||
}
|
}
|
||||||
}catch(e){
|
}catch(e){
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
@ -182,6 +200,8 @@
|
||||||
case 'btnDetail':
|
case 'btnDetail':
|
||||||
handleDetail();
|
handleDetail();
|
||||||
break;
|
break;
|
||||||
|
case 'btnPublish':
|
||||||
|
handlePublish();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,140 @@
|
||||||
|
<template>
|
||||||
|
<div class="filter-container" style="padding:0px 12px;">
|
||||||
|
<a-row :gutter="12">
|
||||||
|
|
||||||
|
<a-col :span="10">
|
||||||
|
|
||||||
|
<a-range-picker
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
@change="onDateChange"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input v-model:value="tifListParams.name" placeholder="搜索名称" />
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="8">
|
||||||
|
<a-button type="primary" @click="getTifByTimeList">查询</a-button>
|
||||||
|
|
||||||
|
<a-button type="primary" @click="handlerUpdateTif">更新数据</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
<div class="list-container" style="padding:12px;" >
|
||||||
|
<a-table
|
||||||
|
size="small"
|
||||||
|
:columns="columns"
|
||||||
|
:data-source="tifListData"
|
||||||
|
rowKey="id"
|
||||||
|
:row-selection="{ selectedRowKeys: selectedRowKeysA, onChange: handleSelectionChange }"
|
||||||
|
:loading="loading"
|
||||||
|
:pagination="{
|
||||||
|
current: tifListParams.page,
|
||||||
|
pageSize: tifListParams.limit,
|
||||||
|
total: total,
|
||||||
|
onChange: handlePageChange,
|
||||||
|
pageSizeOptions:[5,10,20,50],
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import {ref,defineProps,defineExpose} from 'vue';
|
||||||
|
import {getAiShape,updateShape,getTifByTime,updateTif,addTask,updateTask} from '@/api/task'
|
||||||
|
import { useMessage } from '@/hooks/web/useMessage';
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '县区',
|
||||||
|
dataIndex: 'areaName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '日期',
|
||||||
|
dataIndex: 'tifDate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'tifName',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const loading = ref(true)
|
||||||
|
|
||||||
|
const tifListParams = ref({
|
||||||
|
name:null,
|
||||||
|
beginTime:null,
|
||||||
|
endTime:null,
|
||||||
|
page:1,
|
||||||
|
limit:5
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const total = ref(0)
|
||||||
|
|
||||||
|
|
||||||
|
const tifListData = ref([])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function getTifByTimeList(){
|
||||||
|
getTifByTime(tifListParams.value).then(res=>{
|
||||||
|
tifListData.value = res.items;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getTifByTimeList();
|
||||||
|
|
||||||
|
const handlePageChange = (page, pageSize) => {
|
||||||
|
tifListParams.value.page = page;
|
||||||
|
tifListParams.value.limit = pageSize;
|
||||||
|
getTifByTimeList();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectedRowKeysA = ref([]);
|
||||||
|
const selectedRowsA = ref();
|
||||||
|
// 选择框变化时的回调函数
|
||||||
|
const handleSelectionChange = (selectedRowKeys, selectedRows)=>{
|
||||||
|
selectedRowKeysA.value = selectedRowKeys;
|
||||||
|
selectedRowsA.value = selectedRows;
|
||||||
|
console.log("selectedRowKeys",selectedRowKeys.value,selectedRows.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function handlerUpdateTif(){
|
||||||
|
updateTif().then(res=>{
|
||||||
|
if(res){
|
||||||
|
createMessage.success("更新数据成功!");
|
||||||
|
}else{
|
||||||
|
createMessage.error("更新数据失败!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function onDateChange(date){
|
||||||
|
tifListParams.value.beginTime = date[0];
|
||||||
|
tifListParams.value.endTime = date[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSelectedInfo(){
|
||||||
|
let res = {
|
||||||
|
selectedRowKeys:selectedRowKeysA.value,
|
||||||
|
selectedRows:selectedRowsA.value
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
getSelectedInfo
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -27,7 +27,7 @@ export const columns: BasicColumn[] = [
|
||||||
customRender: ({ record }) => {
|
customRender: ({ record }) => {
|
||||||
const enable = record.isComplate;
|
const enable = record.isComplate;
|
||||||
const color = enable ? 'green' : 'red';
|
const color = enable ? 'green' : 'red';
|
||||||
const text = enable ? '已完成' : '未完成';
|
const text = enable ? '已完成' : '进行中';
|
||||||
return h(Tag, { color: color }, () => text);
|
return h(Tag, { color: color }, () => text);
|
||||||
},
|
},
|
||||||
},{
|
},{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue