Commit 03e4203ed724b3e0ef68644b89abe52cbae4b4b0

Authored by xp.Huang
2 parents f49abb9b 8d9d93a2

Merge branch 'ft_local_dev' into 'main'

联调脚本管理

See merge request huang/yun-teng-iot-front!369
  1 +import { BasicPageParams } from '/@/api/model/baseModel';
  2 +export type ScriptQueryParam = BasicPageParams & ScriptParam;
  3 +
  4 +export type ScriptParam = {
  5 + name?: string;
  6 + transportType?: string;
  7 + status?: number;
  8 +};
  9 +
  10 +export interface ScriptModel {
  11 + convertJs: string;
  12 + createTime: '2022-10-31T01:19:57.912Z';
  13 + creator: string;
  14 + description: string;
  15 + id: string;
  16 + name: string;
  17 + status: 0;
  18 + tenantId: string;
  19 + updateTime: '2022-10-31T01:19:57.912Z';
  20 + updater: string;
  21 +}
  22 +
  23 +export interface ScriptRecord {
  24 + id: string;
  25 + creator: string;
  26 + createTime: string;
  27 + updater: string;
  28 + updateTime: string;
  29 + name: string;
  30 + convertJs: string;
  31 + enabled: boolean;
  32 + tenantId: string;
  33 + description: string;
  34 + status: boolean;
  35 +}
  1 +import { defHttp } from '/@/utils/http/axios';
  2 +import { ScriptParam, ScriptQueryParam, ScriptRecord } from './model/scriptModel';
  3 +import { PaginationResult } from '/#/axios';
  4 +
  5 +enum ScriptManagerApi {
  6 + SCRIPT_POST_URL = '/js',
  7 + SCRIPT_GET_URL = '/js',
  8 + SCRIPT_DELETE_URL = '/js',
  9 + SCRIPT_MELIST_URL = '/js/me/list',
  10 + SCRIPT_TEST_URL = '/js/test',
  11 +}
  12 +
  13 +export const ScriptPage = (params: ScriptQueryParam) => {
  14 + return defHttp.get<PaginationResult<ScriptRecord>>({
  15 + url: ScriptManagerApi.SCRIPT_GET_URL,
  16 + params,
  17 + });
  18 +};
  19 +
  20 +//删除脚本
  21 +export const deleteScriptManage = (ids: string[]) => {
  22 + return defHttp.delete({
  23 + url: ScriptManagerApi.SCRIPT_DELETE_URL,
  24 + data: {
  25 + ids: ids,
  26 + },
  27 + });
  28 +};
  29 +
  30 +// 创建或编辑脚本
  31 +export const createOrEditScriptManage = (data) => {
  32 + return defHttp.post<ScriptParam>({
  33 + url: ScriptManagerApi.SCRIPT_POST_URL,
  34 + data,
  35 + });
  36 +};
  37 +
  38 +// 查询脚本详情
  39 +export const getScriptManageDetail = (id: string) => {
  40 + return defHttp.get({
  41 + url: ScriptManagerApi.SCRIPT_GET_URL + `/${id}`,
  42 + });
  43 +};
  44 +
  45 +// 获取脚本选项列表
  46 +export const getScriptManageMeList = () => {
  47 + return defHttp.get({
  48 + url: ScriptManagerApi.SCRIPT_MELIST_URL,
  49 + });
  50 +};
  51 +
  52 +// 测试脚本执行结果
  53 +export const testScriptManage = (data) => {
  54 + return defHttp.post<ScriptParam>({
  55 + url: ScriptManagerApi.SCRIPT_TEST_URL,
  56 + data,
  57 + });
  58 +};
1 -<template>  
2 - <div>  
3 - <BasicModal  
4 - destroyOnClose  
5 - v-bind="$attrs"  
6 - width="60rem"  
7 - @register="register"  
8 - :title="getTitle"  
9 - :minHeight="500"  
10 - @cancel="handleCancel"  
11 - @ok="handleSubmit"  
12 - >  
13 - <ConverScript :ifAdd="!isUpdate ? false : true" ref="converScriptRef" />  
14 - </BasicModal>  
15 - </div>  
16 -</template>  
17 -<script setup lang="ts">  
18 - import { ref, computed, unref } from 'vue';  
19 - import { BasicModal, useModalInner } from '/@/components/Modal';  
20 - import ConverScript from '/@/views/scriptmanage/converscript/ConverScript.vue';  
21 -  
22 - const converScriptRef = ref<InstanceType<typeof ConverScript>>();  
23 - const getTitle = computed(() => (isUpdate.value ? '测试脚本' : '新建脚本'));  
24 - const isUpdate = ref(false);  
25 - const [register, { setModalProps, closeModal }] = useModalInner(async (data) => {  
26 - setModalProps({ loading: true });  
27 - handleCancel(false);  
28 - isUpdate.value = data.isUpdate;  
29 - converScriptRef.value?.initEditor(data.record?.configuration?.jsScript);  
30 - setModalProps({ loading: false });  
31 - const title = !unref(isUpdate) ? '测试脚本' : '新建脚本';  
32 - const okText = !unref(isUpdate) ? '测试' : '确定';  
33 - setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText });  
34 - // converScriptRef.value?.setFormData();  
35 - });  
36 - const handleSubmit = async () => {  
37 - const val = await converScriptRef.value?.getFormData();  
38 - console.log(val);  
39 - handleCancel(true);  
40 - };  
41 - const handleCancel = (flag) => {  
42 - if (flag) {  
43 - closeModal();  
44 - }  
45 - converScriptRef.value?.resetFormData();  
46 - };  
47 -</script>  
48 -<style lang="less" scoped>  
49 - @import url('/@/views/scriptmanage/converscript/ConverScriptModal.less');  
50 -</style>  
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 > 27 >
28 </template> 28 </template>
29 </BasicForm> 29 </BasicForm>
30 - <ConverScriptModal @register="registerModal" /> 30 + <ConverScriptModal @register="registerModal" @success="handleSuccess" />
31 </div> 31 </div>
32 </template> 32 </template>
33 <script lang="ts" setup> 33 <script lang="ts" setup>
@@ -37,24 +37,33 @@ @@ -37,24 +37,33 @@
37 import { SelectTypes } from 'ant-design-vue/es/select'; 37 import { SelectTypes } from 'ant-design-vue/es/select';
38 import { Select } from 'ant-design-vue'; 38 import { Select } from 'ant-design-vue';
39 import { useModal } from '/@/components/Modal'; 39 import { useModal } from '/@/components/Modal';
40 - import ConverScriptModal from './ConverScriptModal.vue';  
41 import { useMessage } from '/@/hooks/web/useMessage'; 40 import { useMessage } from '/@/hooks/web/useMessage';
  41 + import { getScriptManageMeList } from '/@/api/scriptmanage/scriptManager';
  42 + import ConverScriptModal from '/@/views/scriptmanage/converscript/ConverScriptModal.vue';
42 43
43 const { createMessage } = useMessage(); 44 const { createMessage } = useMessage();
44 const selectScript = reactive({ 45 const selectScript = reactive({
45 script: null, 46 script: null,
46 }); 47 });
47 - const selectOptions: Ref<SelectTypes['options']> = ref([  
48 - {  
49 - label: '电表转换脚本',  
50 - value: '2dadsasd212asddafd1',  
51 - },  
52 - {  
53 - label: '水表转换脚本',  
54 - value: 'dasdads776216dasdb1212sx',  
55 - },  
56 - ]);  
57 - onMounted(() => {}); 48 + const selectOptions: Ref<SelectTypes['options']> = ref([]);
  49 + onMounted(async () => {
  50 + const res = await getScriptManageMeList();
  51 + selectOptions.value = res.map((m) => {
  52 + return {
  53 + label: m.name,
  54 + value: m.id,
  55 + };
  56 + });
  57 + });
  58 + const handleSuccess = async () => {
  59 + const res = await getScriptManageMeList();
  60 + selectOptions.value = res.map((m) => {
  61 + return {
  62 + label: m.name,
  63 + value: m.id,
  64 + };
  65 + });
  66 + };
58 67
59 const [register] = useForm({ 68 const [register] = useForm({
60 labelWidth: 180, 69 labelWidth: 180,
@@ -70,10 +79,17 @@ @@ -70,10 +79,17 @@
70 if (c === 'add') { 79 if (c === 'add') {
71 openModal(true, { 80 openModal(true, {
72 isUpdate: true, 81 isUpdate: true,
  82 + isView: false,
  83 + isTest: false,
  84 + isText: 'confirm',
  85 + isTitle: 'add',
73 }); 86 });
74 } else { 87 } else {
75 openModal(true, { 88 openModal(true, {
76 isUpdate: false, 89 isUpdate: false,
  90 + isTest: true,
  91 + isText: 'test',
  92 + isTitle: 'test',
77 }); 93 });
78 } 94 }
79 }; 95 };
@@ -96,7 +112,7 @@ @@ -96,7 +112,7 @@
96 selectScript.script = null; 112 selectScript.script = null;
97 }; 113 };
98 const setFormData = (v) => { 114 const setFormData = (v) => {
99 - selectScript.script = v; 115 + selectScript.script = v?.scriptId;
100 }; 116 };
101 defineExpose({ 117 defineExpose({
102 getFormData, 118 getFormData,
@@ -10,22 +10,22 @@ @@ -10,22 +10,22 @@
10 > 10 >
11 <a-form-item 11 <a-form-item
12 :label="ifAdd ? '名称' : '输入参数'" 12 :label="ifAdd ? '名称' : '输入参数'"
13 - :name="ifAdd ? 'scriptName' : 'inputParams'" 13 + :name="ifAdd ? 'name' : 'inputParams'"
14 :rules="[{ required: true, message: ifAdd ? '请输入脚本名称' : '请输入参数' }]" 14 :rules="[{ required: true, message: ifAdd ? '请输入脚本名称' : '请输入参数' }]"
15 > 15 >
16 - <a-input v-if="ifAdd" v-model:value="scriptForm.scriptName" placeholder="请输入脚本名称" /> 16 + <a-input v-if="ifAdd" v-model:value="scriptForm.name" placeholder="请输入脚本名称" />
17 <a-input v-else v-model:value="scriptForm.inputParams" placeholder="请输入参数" /> 17 <a-input v-else v-model:value="scriptForm.inputParams" placeholder="请输入参数" />
18 </a-form-item> 18 </a-form-item>
19 <a-form-item 19 <a-form-item
20 label="上报数据类型" 20 label="上报数据类型"
21 name="reportType" 21 name="reportType"
22 - :rules="[{ required: true, message: '请选择上报数据类型' }]" 22 + :rules="[{ required: false, message: '请选择上报数据类型' }]"
23 > 23 >
24 <a-space direction="vertical"> 24 <a-space direction="vertical">
25 <a-radio-group v-model:value="scriptForm.reportType" :options="typeOptions" /> 25 <a-radio-group v-model:value="scriptForm.reportType" :options="typeOptions" />
26 </a-space> 26 </a-space>
27 </a-form-item> 27 </a-form-item>
28 - <a-form-item label="脚本内容" name="scriptContent"> 28 + <a-form-item label="脚本内容" name="convertJs">
29 <Card title="脚本内容" :bodyStyle="{ padding: 0, height: '280px' }"> 29 <Card title="脚本内容" :bodyStyle="{ padding: 0, height: '280px' }">
30 <template #extra> 30 <template #extra>
31 <a-button @click="handleFormat" size="small">格式化</a-button> 31 <a-button @click="handleFormat" size="small">格式化</a-button>
@@ -41,12 +41,12 @@ @@ -41,12 +41,12 @@
41 </a-form-item> 41 </a-form-item>
42 <a-form-item 42 <a-form-item
43 :label="ifAdd ? '备注' : '输出参数'" 43 :label="ifAdd ? '备注' : '输出参数'"
44 - :name="ifAdd ? 'scriptRemark' : 'outputParams'" 44 + :name="ifAdd ? 'description' : 'outputParams'"
45 > 45 >
46 <a-textarea 46 <a-textarea
47 :rows="5" 47 :rows="5"
48 v-if="ifAdd" 48 v-if="ifAdd"
49 - v-model:value="scriptForm.scriptRemark" 49 + v-model:value="scriptForm.description"
50 placeholder="请输入备注" 50 placeholder="请输入备注"
51 /> 51 />
52 <a-textarea 52 <a-textarea
@@ -76,9 +76,9 @@ @@ -76,9 +76,9 @@
76 ifAdd: { type: Boolean, default: true }, 76 ifAdd: { type: Boolean, default: true },
77 }); 77 });
78 const scriptForm = reactive({ 78 const scriptForm = reactive({
79 - scriptName: '',  
80 - scriptRemark: '',  
81 - scriptContent: '', 79 + name: '',
  80 + description: '',
  81 + convertJs: '',
82 inputParams: '', 82 inputParams: '',
83 outputParams: '', 83 outputParams: '',
84 reportType: 'HEX', 84 reportType: 'HEX',
@@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
127 ` 127 `
128 ); 128 );
129 beautify(aceEditor.value.session); 129 beautify(aceEditor.value.session);
130 - scriptForm.scriptContent = aceEditor.value.getValue(); 130 + scriptForm.convertJs = aceEditor.value.getValue();
131 }; 131 };
132 const handleCopy = () => { 132 const handleCopy = () => {
133 const valueRef = aceEditor.value.getValue(); 133 const valueRef = aceEditor.value.getValue();
@@ -144,21 +144,27 @@ @@ -144,21 +144,27 @@
144 const formRef = ref(); 144 const formRef = ref();
145 const getFormData = async () => { 145 const getFormData = async () => {
146 const value = await formRef.value.validateFields(); 146 const value = await formRef.value.validateFields();
147 - scriptForm.scriptContent = aceEditor.value.getValue();  
148 - if (scriptForm.scriptContent == '') { 147 + scriptForm.convertJs = aceEditor.value.getValue();
  148 + if (scriptForm.convertJs == '') {
149 createMessage.error('请编写脚本内容'); 149 createMessage.error('请编写脚本内容');
150 throw '请编写脚本内容'; 150 throw '请编写脚本内容';
151 } 151 }
152 if (!value) return; 152 if (!value) return;
153 return { 153 return {
154 ...value, 154 ...value,
155 - ...{ scriptContent: scriptForm.scriptContent }, 155 + ...{ convertJs: scriptForm.convertJs },
156 }; 156 };
157 }; 157 };
158 const setFormData = (v) => { 158 const setFormData = (v) => {
159 for (let i in scriptForm) { 159 for (let i in scriptForm) {
160 Reflect.set(scriptForm, i, v[i]); 160 Reflect.set(scriptForm, i, v[i]);
161 } 161 }
  162 + aceEditor.value.setValue(v.convertJs);
  163 + handleFormat();
  164 + };
  165 + const setScriptContentData = (v) => {
  166 + aceEditor.value.setValue(v.convertJs);
  167 + handleFormat();
162 }; 168 };
163 const resetFormData = () => { 169 const resetFormData = () => {
164 for (let i in scriptForm) { 170 for (let i in scriptForm) {
@@ -172,6 +178,7 @@ @@ -172,6 +178,7 @@
172 getFormData, 178 getFormData,
173 resetFormData, 179 resetFormData,
174 setFormData, 180 setFormData,
  181 + setScriptContentData,
175 }); 182 });
176 </script> 183 </script>
177 <style lang="less" scoped> 184 <style lang="less" scoped>
@@ -15,10 +15,18 @@ @@ -15,10 +15,18 @@
15 </div> 15 </div>
16 </template> 16 </template>
17 <script setup lang="ts"> 17 <script setup lang="ts">
18 - import { ref, computed, unref } from 'vue'; 18 + import { ref, computed, unref, reactive } from 'vue';
19 import { BasicModal, useModalInner } from '/@/components/Modal'; 19 import { BasicModal, useModalInner } from '/@/components/Modal';
20 import ConverScript from './ConverScript.vue'; 20 import ConverScript from './ConverScript.vue';
  21 + import {
  22 + createOrEditScriptManage,
  23 + getScriptManageDetail,
  24 + testScriptManage,
  25 + } from '/@/api/scriptmanage/scriptManager';
  26 + import { useMessage } from '/@/hooks/web/useMessage';
21 27
  28 + const emits = defineEmits(['success', 'register']);
  29 + const { createMessage } = useMessage();
22 const converScriptRef = ref<InstanceType<typeof ConverScript>>(); 30 const converScriptRef = ref<InstanceType<typeof ConverScript>>();
23 const getTitle = computed(() => (isUpdate.value ? '编辑转换脚本' : '新增转换脚本')); 31 const getTitle = computed(() => (isUpdate.value ? '编辑转换脚本' : '新增转换脚本'));
24 const isUpdate = ref(false); 32 const isUpdate = ref(false);
@@ -26,6 +34,9 @@ @@ -26,6 +34,9 @@
26 const isTest = ref(false); 34 const isTest = ref(false);
27 const isText = ref(''); 35 const isText = ref('');
28 const isTitle = ref(''); 36 const isTitle = ref('');
  37 + const editData = reactive({
  38 + data: {},
  39 + });
29 const [register, { setModalProps, closeModal }] = useModalInner(async (data) => { 40 const [register, { setModalProps, closeModal }] = useModalInner(async (data) => {
30 setModalProps({ loading: true }); 41 setModalProps({ loading: true });
31 handleCancel(false); 42 handleCancel(false);
@@ -34,6 +45,7 @@ @@ -34,6 +45,7 @@
34 isTest.value = data.isTest; 45 isTest.value = data.isTest;
35 isText.value = data.isText; 46 isText.value = data.isText;
36 isTitle.value = data.isTitle; 47 isTitle.value = data.isTitle;
  48 + editData.data = data.record;
37 converScriptRef.value?.initEditor(data.record?.configuration?.jsScript); 49 converScriptRef.value?.initEditor(data.record?.configuration?.jsScript);
38 setModalProps({ loading: false }); 50 setModalProps({ loading: false });
39 if (!unref(isViewDetail)) { 51 if (!unref(isViewDetail)) {
@@ -44,17 +56,44 @@ @@ -44,17 +56,44 @@
44 ? '新增转换脚本' 56 ? '新增转换脚本'
45 : '测试转换脚本'; 57 : '测试转换脚本';
46 const okText = isText.value == 'test' ? '测试' : '确定'; 58 const okText = isText.value == 'test' ? '测试' : '确定';
  59 + if (unref(isTitle) == 'edit') {
  60 + converScriptRef.value?.setFormData(data.record);
  61 + }
  62 + if (unref(isTitle) == 'test') {
  63 + converScriptRef.value?.setScriptContentData(data.record);
  64 + }
47 setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText }); 65 setModalProps({ title, showOkBtn: true, showCancelBtn: true, okText });
48 if (!unref(isUpdate)) { 66 if (!unref(isUpdate)) {
49 } 67 }
50 } else { 68 } else {
51 setModalProps({ showOkBtn: false, showCancelBtn: false, title: '查看转换脚本' }); 69 setModalProps({ showOkBtn: false, showCancelBtn: false, title: '查看转换脚本' });
  70 + const res = await getScriptManageDetail(data.record.id);
  71 + converScriptRef.value?.setFormData(res || {});
52 } 72 }
53 }); 73 });
  74 +
54 const handleSubmit = async () => { 75 const handleSubmit = async () => {
55 - const val = await converScriptRef.value?.getFormData();  
56 - console.log(val);  
57 - handleCancel(true); 76 + setModalProps({ loading: true });
  77 + try {
  78 + const val = await converScriptRef.value?.getFormData();
  79 + const tempObj = {
  80 + ...editData.data,
  81 + ...val,
  82 + };
  83 + (await isText.value) == 'test' ? testScriptManage(val) : createOrEditScriptManage(tempObj);
  84 + createMessage.success(
  85 + unref(isTitle) == 'edit'
  86 + ? '编辑转换脚本成功'
  87 + : unref(isTitle) == 'add'
  88 + ? '新增转换脚本成功'
  89 + : '测试转换脚本成功'
  90 + );
  91 + closeModal();
  92 + emits('success');
  93 + } catch {
  94 + } finally {
  95 + setModalProps({ loading: false });
  96 + }
58 }; 97 };
59 const handleCancel = (flag) => { 98 const handleCancel = (flag) => {
60 if (flag) { 99 if (flag) {
@@ -8,15 +8,15 @@ import { findDictItemByCode } from '/@/api/system/dict'; @@ -8,15 +8,15 @@ import { findDictItemByCode } from '/@/api/system/dict';
8 export const columns: BasicColumn[] = [ 8 export const columns: BasicColumn[] = [
9 { 9 {
10 title: '脚本名称', 10 title: '脚本名称',
11 - dataIndex: 'reportConfigName', 11 + dataIndex: 'name',
12 width: 80, 12 width: 80,
13 }, 13 },
14 { 14 {
15 title: '脚本状态', 15 title: '脚本状态',
16 - dataIndex: 'organizationName', 16 + dataIndex: 'status',
17 width: 120, 17 width: 120,
18 customRender: ({ record }) => { 18 customRender: ({ record }) => {
19 - const status = record.organizationName; 19 + const status = record.status;
20 const color = status == 1 ? 'green' : 'red'; 20 const color = status == 1 ? 'green' : 'red';
21 const text = status == 1 ? '启用' : '禁用'; 21 const text = status == 1 ? '启用' : '禁用';
22 return h(Tag, { color: color }, () => text); 22 return h(Tag, { color: color }, () => text);
@@ -24,18 +24,18 @@ export const columns: BasicColumn[] = [ @@ -24,18 +24,18 @@ export const columns: BasicColumn[] = [
24 }, 24 },
25 { 25 {
26 title: '脚本内容', 26 title: '脚本内容',
27 - dataIndex: 'dataType', 27 + dataIndex: 'convertJs',
28 width: 120, 28 width: 120,
29 - slots: { customRender: 'dataType' }, 29 + slots: { customRender: 'convertJs' },
30 }, 30 },
31 { 31 {
32 title: '描述', 32 title: '描述',
33 - dataIndex: 'executeWay', 33 + dataIndex: 'description',
34 width: 120, 34 width: 120,
35 }, 35 },
36 { 36 {
37 title: '创建时间', 37 title: '创建时间',
38 - dataIndex: 'executeTime', 38 + dataIndex: 'createTime',
39 width: 180, 39 width: 180,
40 }, 40 },
41 ]; 41 ];
@@ -2,10 +2,10 @@ @@ -2,10 +2,10 @@
2 <div> 2 <div>
3 <BasicTable :clickToRowSelect="false" @register="registerTable" :searchInfo="searchInfo"> 3 <BasicTable :clickToRowSelect="false" @register="registerTable" :searchInfo="searchInfo">
4 <template #toolbar> 4 <template #toolbar>
5 - <Authority value=""> 5 + <Authority value="api:yt:js:post">
6 <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增转换脚本 </a-button> 6 <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增转换脚本 </a-button>
7 </Authority> 7 </Authority>
8 - <Authority value=""> 8 + <Authority value="api:yt:js:delete">
9 <Popconfirm 9 <Popconfirm
10 title="您确定要批量删除数据" 10 title="您确定要批量删除数据"
11 ok-text="确定" 11 ok-text="确定"
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 </Popconfirm> 16 </Popconfirm>
17 </Authority> 17 </Authority>
18 </template> 18 </template>
19 - <template #dataType="{ record }"> 19 + <template #convertJs="{ record }">
20 <a-button type="text" @click="handleScriptView(record)"> 20 <a-button type="text" @click="handleScriptView(record)">
21 <span style="color: #377dff">查看脚本</span> 21 <span style="color: #377dff">查看脚本</span>
22 </a-button> 22 </a-button>
@@ -33,13 +33,13 @@ @@ -33,13 +33,13 @@
33 { 33 {
34 label: '编辑', 34 label: '编辑',
35 icon: 'clarity:note-edit-line', 35 icon: 'clarity:note-edit-line',
36 - auth: '', 36 + auth: 'api:yt:js:update',
37 onClick: handleCreateOrEdit.bind(null, record), 37 onClick: handleCreateOrEdit.bind(null, record),
38 }, 38 },
39 { 39 {
40 label: '删除', 40 label: '删除',
41 icon: 'ant-design:delete-outlined', 41 icon: 'ant-design:delete-outlined',
42 - auth: '', 42 + auth: 'api:yt:js:delete',
43 color: 'error', 43 color: 'error',
44 popConfirm: { 44 popConfirm: {
45 title: '是否确认删除', 45 title: '是否确认删除',
@@ -50,26 +50,25 @@ @@ -50,26 +50,25 @@
50 /> 50 />
51 </template> 51 </template>
52 </BasicTable> 52 </BasicTable>
53 - <ConverScriptModal @register="registerModal" /> 53 + <ConverScriptModal @register="registerModal" @success="handleSuccess" />
54 </div> 54 </div>
55 </template> 55 </template>
56 56
57 <script lang="ts" setup> 57 <script lang="ts" setup>
58 import { reactive, nextTick } from 'vue'; 58 import { reactive, nextTick } from 'vue';
59 import { BasicTable, useTable, TableAction } from '/@/components/Table'; 59 import { BasicTable, useTable, TableAction } from '/@/components/Table';
60 - import { searchFormSchema, columns, mockData } from './config.data'; 60 + import { searchFormSchema, columns } from './config.data';
61 import { Authority } from '/@/components/Authority'; 61 import { Authority } from '/@/components/Authority';
62 import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; 62 import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
63 import { Popconfirm } from 'ant-design-vue'; 63 import { Popconfirm } from 'ant-design-vue';
64 import { useModal } from '/@/components/Modal'; 64 import { useModal } from '/@/components/Modal';
65 import ConverScriptModal from './ConverScriptModal.vue'; 65 import ConverScriptModal from './ConverScriptModal.vue';
66 - import { deleteExportManage } from '/@/api/export/exportManager'; 66 + import { ScriptPage, deleteScriptManage } from '/@/api/scriptmanage/scriptManager';
67 67
68 const searchInfo = reactive<Recordable>({}); 68 const searchInfo = reactive<Recordable>({});
69 const [registerTable, { reload, setProps }] = useTable({ 69 const [registerTable, { reload, setProps }] = useTable({
70 title: '转换脚本列表', 70 title: '转换脚本列表',
71 - // api: exportPage,  
72 - api: mockData, 71 + api: ScriptPage,
73 columns, 72 columns,
74 showIndexColumn: false, 73 showIndexColumn: false,
75 clickToRowSelect: false, 74 clickToRowSelect: false,
@@ -96,7 +95,7 @@ @@ -96,7 +95,7 @@
96 }; 95 };
97 96
98 const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( 97 const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete(
99 - deleteExportManage, 98 + deleteScriptManage,
100 handleSuccess, 99 handleSuccess,
101 setProps 100 setProps
102 ); 101 );