You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
2.5 KiB

9 months ago
<template>
<ns-view-list-table ref="mainRef" v-bind="config">
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'executionTime'">
{{ getData(record) }}
</template>
</template>
</ns-view-list-table>
<NsModalFrom ref="modalFormRef" v-bind="nsModalFormConfig" />
</template>
<script lang="ts" setup>
9 months ago
import { tableConfig } from './config';
import { ref, onMounted } from 'vue';
import NsModalFrom from '/@/components/ns-modal-form.vue';
import { planToAddApi } from '/@/api/planToAdd';
9 months ago
import { NsMessage } from '/nerv-lib/component';
9 months ago
//页面 创建
const orgId = ref('');
const projectId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const results = JSON.parse(sessionStorage.getItem('/hx-ai-intelligent/')!);
projectId.value = results.projectId;
const mainRef = ref(null);
const modalFormRef = ref(null);
const getData = (record: any) => {
return record.startTime
9 months ago
? record.startTime.substring(0, 10) + ' - ' + record.endTime.substring(0, 10)
9 months ago
: '未配置时间';
};
const nsModalFormConfig = ref({
api: planToAddApi.updPlan,
data: {},
title: '编辑',
schemas: [
{ field: 'id', component: 'NsInput', show: false },
{ field: 'orgId', component: 'NsInput', show: false },
{
field: 'createTime',
label: '执行时间',
component: 'NsRangePicker',
allowClear: true,
fieldMap: ['startTime', 'endTime'],
componentProps: {
9 months ago
valueFormat: 'YYYY-MM-DD hh:mm:ss',
9 months ago
placeholder: ['开始日期', '结束日期'],
},
rules: [
{
required: true,
message: '请选择执行时间',
},
],
},
],
extraModalConfig: {
bodyStyle: { paddingBottom: 0 },
},
success: (data: any) => {
9 months ago
if (data.msg === 'success') {
mainRef.value?.nsTableRef.reload();
} else {
NsMessage.error(data.msg);
}
9 months ago
},
});
//创建页面调用方法
onMounted(() => {});
9 months ago
const config = tableConfig(
orgId.value,
projectId.value,
mainRef,
nsModalFormConfig,
modalFormRef,
);
defineOptions({
name: 'LedgerIndex', // 与页面路由name一致缓存才可生效
});
</script>
9 months ago
<style lang="less" scoped>
:deep(.ns-table-search),
:deep(.ns-part-tree),
:deep(.ns-table-main) {
box-shadow: @ns-content-box-shadow;
}
</style>