作者 唐俊升

海关任务管理、dify嵌入

@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 <head> 4 <head>
5 <meta charset="utf-8"> 5 <meta charset="utf-8">
6 - <title>物流信息平台</title> 6 + <title>智慧统计</title>
7 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> 7 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
8 </head> 8 </head>
9 9
  1 +import http from "../http";
  2 +import axios from "axios";
  3 +let baseUrl = 'ifea-admin'
  4 +
  5 +//任务分类
  6 +// 列表
  7 +export const getCategoryList = params => { return axios.get(`${baseUrl}/excelTaskCate/list`, { params: params }); };
  8 +// 更新
  9 +export const updateCategory = params => { return http.post(`${baseUrl}/excelTaskCate/update`, params); };
  10 +// 新增
  11 +export const addCategory = params => { return http.post(`${baseUrl}/excelTaskCate/add`, params); };
  12 +// 删除
  13 +export const delCategory = params => { return http.post(`${baseUrl}/excelTaskCate/delete`, params); };
  14 +
  15 +// 任务管理
  16 +// 列表
  17 +export const getTaskManageList = params => { return axios.get(`${baseUrl}/excelTask/list`, { params: params }); };
  18 +// 更新
  19 +export const updateTaskManage = params => { return http.post(`${baseUrl}/excelTask/update`, params); };
  20 +// 新增
  21 +export const addTaskManage = params => { return http.post(`${baseUrl}/excelTask/add`, params); };
  22 +// 删除
  23 +export const delTaskManage = params => { return http.post(`${baseUrl}/excelTask/delete`, params); };
@@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
20 20
21 <div align="center" style="height: 66px;line-height: 66px;"> 21 <div align="center" style="height: 66px;line-height: 66px;">
22 <!-- <img id="logo" src="~@/assets/logo1.png">--> 22 <!-- <img id="logo" src="~@/assets/logo1.png">-->
23 - <h1 id="logo-text" style="color:white;display: inline-block;font-weight: 600;font-size: 15px;line-height: 50px"> &nbsp; &nbsp;物流信息平台</h1> 23 + <h1 id="logo-text" style="color:white;display: inline-block;font-weight: 600;font-size: 15px;line-height: 50px"> &nbsp; &nbsp;智慧统计</h1>
24 </div> 24 </div>
25 <template v-for="(item,index) in menu"> 25 <template v-for="(item,index) in menu">
26 <el-submenu :index="index+''" v-if="item.hasChild"> 26 <el-submenu :index="index+''" v-if="item.hasChild">
@@ -225,6 +225,9 @@ import yqdeclare from './views/airtransport/yqdeclare.vue' @@ -225,6 +225,9 @@ import yqdeclare from './views/airtransport/yqdeclare.vue'
225 //import AiCoustoms from "./views/AiCoustoms/AiCoustoms.vue"; 225 //import AiCoustoms from "./views/AiCoustoms/AiCoustoms.vue";
226 import Category from "./views/AiCoustoms/task/Category.vue"; 226 import Category from "./views/AiCoustoms/task/Category.vue";
227 import TaskManage from "./views/AiCoustoms/task/TaskManage.vue"; 227 import TaskManage from "./views/AiCoustoms/task/TaskManage.vue";
  228 +import ChatflowReportForm from "./views/AiCoustoms/questionsAndAnswers/ChatflowReportForm.vue"
  229 +import ChatflowReport from "./views/AiCoustoms/questionsAndAnswers/ChatflowReport.vue"
  230 +import ChatflowReportFormRoutine from "./views/AiCoustoms/questionsAndAnswers/ChatflowReportFormRoutine.vue"
228 231
229 232
230 let routes = [ 233 let routes = [
@@ -819,7 +822,10 @@ let routes = [ @@ -819,7 +822,10 @@ let routes = [
819 children: [ 822 children: [
820 //{path: '/AiCoustoms', component: AiCoustoms, name: 'Ai智慧关务'}, 823 //{path: '/AiCoustoms', component: AiCoustoms, name: 'Ai智慧关务'},
821 {path: '/Category', component: Category, name: '任务分类'}, 824 {path: '/Category', component: Category, name: '任务分类'},
822 - {path: '/TaskManage', component: TaskManage, name: '任务管理'} 825 + {path: '/TaskManage', component: TaskManage, name: '任务管理'},
  826 + {path: '/ChatflowReportForm', component: ChatflowReportForm, name: '报表'},
  827 + {path: '/ChatflowReport', component: ChatflowReport, name: '报告'},
  828 + {path: '/ChatflowReportFormRoutine', component: ChatflowReportFormRoutine, name: '常规报表'},
823 ] 829 ]
824 }, 830 },
825 { 831 {
  1 +<template>
  2 + <iframe
  3 + src="http://10.78.6.30/chat/ukXcVUWhP7HHv0Ss"
  4 + style="width: 100%; height: 100%; min-height: 700px"
  5 + frameborder="0"
  6 + allow="microphone">
  7 + </iframe>
  8 +</template>
  9 +
  10 +<script>
  11 + export default {
  12 + }
  13 +</script>
  1 +<template>
  2 + <iframe
  3 + src="http://10.78.6.30/chat/2HCKREpFAnlbIlQf"
  4 + style="width: 100%; height: 100%; min-height: 700px"
  5 + frameborder="0"
  6 + allow="microphone">
  7 + </iframe>
  8 +</template>
  9 +
  10 +<script>
  11 + export default {
  12 + }
  13 +</script>
  1 +<template>
  2 + <iframe
  3 + src="http://ai.15miaoo.com:17999/chatbot/VrcUZBXmDOhvn7SQ"
  4 + style="width: 100%; height: 100%; min-height: 700px"
  5 + frameborder="0"
  6 + allow="microphone">
  7 + </iframe>
  8 +</template>
  9 +
  10 +<script>
  11 + export default {
  12 + }
  13 +</script>
@@ -5,37 +5,18 @@ @@ -5,37 +5,18 @@
5 <el-table 5 <el-table
6 :data="tableData" 6 :data="tableData"
7 border 7 border
8 - style="width: 100%"> 8 + style="width: 100%"
  9 + height="500">
9 <el-table-column 10 <el-table-column
10 fixed 11 fixed
11 - prop="date"  
12 - label="日期"  
13 - width="150"> 12 + prop="id"
  13 + label="代码"
  14 + width="100">
14 </el-table-column> 15 </el-table-column>
15 <el-table-column 16 <el-table-column
16 prop="name" 17 prop="name"
17 - label="姓名"  
18 - width="120">  
19 - </el-table-column>  
20 - <el-table-column  
21 - prop="province"  
22 - label="省份"  
23 - width="120">  
24 - </el-table-column>  
25 - <el-table-column  
26 - prop="city"  
27 - label="市区"  
28 - width="120">  
29 - </el-table-column>  
30 - <el-table-column  
31 - prop="address"  
32 - label="地址"  
33 - width="300">  
34 - </el-table-column>  
35 - <el-table-column  
36 - prop="zip"  
37 - label="邮编"  
38 - width="120"> 18 + label="名称"
  19 + min-width="200">
39 </el-table-column> 20 </el-table-column>
40 <el-table-column 21 <el-table-column
41 fixed="right" 22 fixed="right"
@@ -97,47 +78,18 @@ @@ -97,47 +78,18 @@
97 </el-pagination> 78 </el-pagination>
98 </div> 79 </div>
99 </el-col> 80 </el-col>
100 -  
101 </el-row> 81 </el-row>
102 </el-contaier> 82 </el-contaier>
103 </template> 83 </template>
104 84
105 <script> 85 <script>
106 - import {delArea} from "../../../api/consigner/station"; 86 + // import {delArea} from "../../../api/consigner/station";
  87 + import {getCategoryList, updateCategory, addCategory, delCategory} from "../../../api/AiCustoms/CustomsTask"
107 88
108 export default { 89 export default {
109 data() { 90 data() {
110 return { 91 return {
111 - tableData: [  
112 - {  
113 - date: '2016-05-02',  
114 - name: '王小虎',  
115 - province: '上海',  
116 - city: '普陀区',  
117 - address: '上海市普陀区金沙江路 1518 弄',  
118 - zip: 200333  
119 - }, {  
120 - date: '2016-05-04',  
121 - name: '王小虎',  
122 - province: '上海',  
123 - city: '普陀区',  
124 - address: '上海市普陀区金沙江路 1517 弄',  
125 - zip: 200333  
126 - }, {  
127 - date: '2016-05-01',  
128 - name: '王小虎',  
129 - province: '上海',  
130 - city: '普陀区',  
131 - address: '上海市普陀区金沙江路 1519 弄',  
132 - zip: 200333  
133 - }, {  
134 - date: '2016-05-03',  
135 - name: '王小虎',  
136 - province: '上海',  
137 - city: '普陀区',  
138 - address: '上海市普陀区金沙江路 1516 弄',  
139 - zip: 200333  
140 - }], 92 + tableData: [],
141 dialogVisible:false, 93 dialogVisible:false,
142 ruleForm:{ 94 ruleForm:{
143 id:'', 95 id:'',
@@ -159,25 +111,62 @@ @@ -159,25 +111,62 @@
159 total:0, 111 total:0,
160 } 112 }
161 }, 113 },
162 - methods: { 114 + mounted() {
  115 + this.getCategoryList()
  116 + },
  117 + methods: {
  118 + // 获取数据列表
  119 + getCategoryList(){
  120 + getCategoryList({page:this.page, pageSize:this.pageSize}).then((response) => {
  121 + const code = response.data.code;
  122 + if (code != 200){
  123 + return this.$message.error('获取列表失败!')
  124 + }
  125 + this.tableData = response.data.data.rows;
  126 + this.total = response.data.data.total;
  127 + this.$message.success('获取列表成功!')
  128 + }).catch(error => {
  129 + this.$message.error(error.toString())
  130 + })
  131 + },
163 handleSizeChange(val) { 132 handleSizeChange(val) {
164 console.log(`每页 ${val} 条`); 133 console.log(`每页 ${val} 条`);
  134 + this.pageSize = val;
  135 + this.getCategoryList();
165 }, 136 },
166 handleCurrentChange(val) { 137 handleCurrentChange(val) {
167 console.log(`当前页: ${val}`); 138 console.log(`当前页: ${val}`);
  139 + this.page = val;
  140 + this.getCategoryList();
168 }, 141 },
169 handleClick(row) { 142 handleClick(row) {
  143 + this.ruleForm=JSON.parse(JSON.stringify(row));
170 this.dialogApply='update'; 144 this.dialogApply='update';
171 this.dialogVisible=true; 145 this.dialogVisible=true;
172 }, 146 },
173 submitForm(formName) { 147 submitForm(formName) {
174 - this.$refs[formName].validate((valid) => {  
175 - if (valid) {  
176 - alert('submit!');  
177 - } else { 148 + this.$refs[formName].validate(async (valid) => {
  149 + if (!valid){
178 console.log('error submit!!'); 150 console.log('error submit!!');
179 return false; 151 return false;
180 } 152 }
  153 + try {
  154 + let response;
  155 + if (this.dialogApply === 'create'){
  156 + response = await addCategory(this.ruleForm);
  157 + } else if (this.dialogApply === 'update'){
  158 + response = await updateCategory(this.ruleForm);
  159 + }
  160 + if (response.data.code !== 200){
  161 + return this.$message.error(this.dialogApply === 'create' ? '新增失败!' : '更新失败!')
  162 + return;
  163 + }
  164 + this.$message.success(this.dialogApply === 'create' ? '新增成功!' : '更新成功!')
  165 + this.dialogVisible = false;
  166 + this.getCategoryList();
  167 + } catch (error){
  168 + this.$message.error(error.toString())
  169 + }
181 }); 170 });
182 }, 171 },
183 resetForm(formName) { 172 resetForm(formName) {
@@ -192,7 +181,7 @@ @@ -192,7 +181,7 @@
192 .catch(_ => {}); 181 .catch(_ => {});
193 }, 182 },
194 // 删除 183 // 删除
195 - applyDel(index, row) { 184 + applyDel(row) {
196 // 弹框询问是否删除? 185 // 弹框询问是否删除?
197 this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', { 186 this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
198 confirmButtonText: '确定删除', 187 confirmButtonText: '确定删除',
@@ -200,7 +189,18 @@ @@ -200,7 +189,18 @@
200 type: 'warning' 189 type: 'warning'
201 } 190 }
202 ).then(() => { 191 ).then(() => {
203 - // 192 + // 删除
  193 + const delIds = [row.id];
  194 + delCategory(delIds).then((response) => {
  195 + const code =response.data.code;
  196 + if (code != 200){
  197 + return this.$message.error('删除失败!')
  198 + }
  199 + this.$message.success('删除成功!')
  200 + this.getCategoryList();
  201 + }).catch(error => {
  202 + this.$message.error(error.toString())
  203 + })
204 }).catch(() => { 204 }).catch(() => {
205 }) 205 })
206 }, 206 },
@@ -2,14 +2,14 @@ @@ -2,14 +2,14 @@
2 <el-contaier> 2 <el-contaier>
3 <el-row> 3 <el-row>
4 <el-col :span="5"> 4 <el-col :span="5">
5 - <el-input v-model="name" placeholder="任务名称" style="width: 200px"></el-input> 5 + <el-input v-model="name" placeholder="任务分类" style="width: 200px"></el-input>
6 </el-col> 6 </el-col>
7 <el-col :span="5"> 7 <el-col :span="5">
8 - <el-input v-model="cateId" placeholder="任务分类" style="width: 200px"></el-input> 8 + <el-input v-model="cateId" placeholder="任务名称" style="width: 200px"></el-input>
9 </el-col> 9 </el-col>
10 10
11 <el-col :span="6"> 11 <el-col :span="6">
12 - <el-button type="primary" size="mini" @click="add()">查询</el-button> 12 + <el-button type="primary" size="mini" @click="getTaskManageList()">查询</el-button>
13 <el-button type="success" size="mini" @click="add()">新增</el-button> 13 <el-button type="success" size="mini" @click="add()">新增</el-button>
14 </el-col> 14 </el-col>
15 </el-row> 15 </el-row>
@@ -18,38 +18,62 @@ @@ -18,38 +18,62 @@
18 <el-table 18 <el-table
19 :data="tableData" 19 :data="tableData"
20 border 20 border
21 - style="width: 100%"> 21 + style="width: 100%"
  22 + height="500">
  23 +<!-- <el-table-column-->
  24 +<!-- fixed-->
  25 +<!-- prop="id"-->
  26 +<!-- label="代码"-->
  27 +<!-- width="150">-->
  28 +<!-- </el-table-column>-->
22 <el-table-column 29 <el-table-column
23 - fixed  
24 - prop="date"  
25 - label="日期"  
26 - width="150"> 30 + prop="name"
  31 + label="名称"
  32 + width="150"
  33 + show-overflow-tooltip>
27 </el-table-column> 34 </el-table-column>
28 <el-table-column 35 <el-table-column
29 - prop="name"  
30 - label="姓名"  
31 - width="120"> 36 + prop="cateId"
  37 + label="分类"
  38 + width="50"
  39 + show-overflow-tooltip>
32 </el-table-column> 40 </el-table-column>
33 <el-table-column 41 <el-table-column
34 - prop="province"  
35 - label="省份"  
36 - width="120"> 42 + prop="dateRule"
  43 + label="日期规则"
  44 + width="300"
  45 + show-overflow-tooltip>
37 </el-table-column> 46 </el-table-column>
38 <el-table-column 47 <el-table-column
39 - prop="city"  
40 - label="市区"  
41 - width="120"> 48 + prop="form"
  49 + label="表单"
  50 + width="300"
  51 + show-overflow-tooltip>
42 </el-table-column> 52 </el-table-column>
43 <el-table-column 53 <el-table-column
44 - prop="address"  
45 - label="地址"  
46 - width="300"> 54 + prop="creator"
  55 + label="创建者"
  56 + width="80"
  57 + show-overflow-tooltip>
47 </el-table-column> 58 </el-table-column>
48 <el-table-column 59 <el-table-column
49 - prop="zip"  
50 - label="邮编"  
51 - width="120"> 60 + prop="creatorId"
  61 + label="创建者Id"
  62 + width="80"
  63 + show-overflow-tooltip>
52 </el-table-column> 64 </el-table-column>
  65 + <el-table-column
  66 + prop="createTime"
  67 + label="创建时间"
  68 + width="120"
  69 + show-overflow-tooltip>
  70 + </el-table-column>
  71 + <el-table-column
  72 + prop="updateTime"
  73 + label="更新时间"
  74 + width="120"
  75 + show-overflow-tooltip>
  76 + </el-table-column>
53 <el-table-column 77 <el-table-column
54 fixed="right" 78 fixed="right"
55 label="操作" 79 label="操作"
@@ -86,6 +110,35 @@ @@ -86,6 +110,35 @@
86 <el-form-item label="任务名称" prop="name"> 110 <el-form-item label="任务名称" prop="name">
87 <el-input v-model="ruleForm.name"></el-input> 111 <el-input v-model="ruleForm.name"></el-input>
88 </el-form-item> 112 </el-form-item>
  113 + <el-form-item label="任务分类" prop="cateId">
  114 + <el-input v-model="ruleForm.cateId"></el-input>
  115 + </el-form-item>
  116 + <el-form-item label="日期规则" prop="dateRule">
  117 + <el-input v-model="ruleForm.dateRule"></el-input>
  118 + </el-form-item>
  119 + <el-form-item label="表单" prop="form">
  120 + <el-input v-model="ruleForm.form"></el-input>
  121 + </el-form-item>
  122 + <el-form-item label="创建者" prop="creator">
  123 + <el-input v-model="ruleForm.creator"></el-input>
  124 + </el-form-item>
  125 + <el-form-item label="创建者Id" prop="creatorId">
  126 + <el-input v-model="ruleForm.creatorId"></el-input>
  127 + </el-form-item>
  128 + <el-form-item label="创建时间" prop="createTime">
  129 + <el-input
  130 + v-model="ruleForm.createTime"
  131 + readonly
  132 + disabled
  133 + ></el-input>
  134 + </el-form-item>
  135 + <el-form-item label="更新时间" prop="updateTime">
  136 + <el-input
  137 + v-model="ruleForm.updateTime"
  138 + readonly
  139 + disabled
  140 + ></el-input>
  141 + </el-form-item>
89 <el-form-item> 142 <el-form-item>
90 <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button> 143 <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
91 <el-button @click="resetForm('ruleForm')">取消</el-button> 144 <el-button @click="resetForm('ruleForm')">取消</el-button>
@@ -114,48 +167,37 @@ @@ -114,48 +167,37 @@
114 167
115 <script> 168 <script>
116 169
  170 +import {getCategoryList, getTaskManageList, updateTaskManage, addTaskManage, delTaskManage} from "../../../api/AiCustoms/CustomsTask";
  171 +
117 export default { 172 export default {
118 data() { 173 data() {
119 return { 174 return {
120 - tableData: [  
121 - {  
122 - date: '2016-05-02',  
123 - name: '王小虎',  
124 - province: '上海',  
125 - city: '普陀区',  
126 - address: '上海市普陀区金沙江路 1518 弄',  
127 - zip: 200333  
128 - }, {  
129 - date: '2016-05-04',  
130 - name: '王小虎',  
131 - province: '上海',  
132 - city: '普陀区',  
133 - address: '上海市普陀区金沙江路 1517 弄',  
134 - zip: 200333  
135 - }, {  
136 - date: '2016-05-01',  
137 - name: '王小虎',  
138 - province: '上海',  
139 - city: '普陀区',  
140 - address: '上海市普陀区金沙江路 1519 弄',  
141 - zip: 200333  
142 - }, {  
143 - date: '2016-05-03',  
144 - name: '王小虎',  
145 - province: '上海',  
146 - city: '普陀区',  
147 - address: '上海市普陀区金沙江路 1516 弄',  
148 - zip: 200333  
149 - }], 175 + tableData: [],
150 dialogVisible:false, 176 dialogVisible:false,
151 ruleForm:{ 177 ruleForm:{
152 id:'', 178 id:'',
153 - name:'' 179 + name:'',
  180 + cateId:'',
  181 + dateRule:'',
  182 + form:'',
  183 + creator:'',
  184 + creatorId:'',
  185 + createTime:'',
  186 + updateTime:''
154 }, 187 },
155 rules:{ 188 rules:{
156 name: [ 189 name: [
157 { required: true, message: '请输入任务名称', trigger: 'blur' }, 190 { required: true, message: '请输入任务名称', trigger: 'blur' },
158 { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' } 191 { min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
  192 + ],
  193 + cateId: [
  194 + { required: true, message: '请输入任务分类', trigger: 'blur' }
  195 + ],
  196 + dateRule: [
  197 + { required: true, message: '请输入日期规则', trigger: 'blur' }
  198 + ],
  199 + form: [
  200 + { required: true, message: '请输入表单', trigger: 'blur' }
159 ] 201 ]
160 }, 202 },
161 dialogMap: { 203 dialogMap: {
@@ -170,24 +212,103 @@ @@ -170,24 +212,103 @@
170 cateId:'' 212 cateId:''
171 } 213 }
172 }, 214 },
  215 +
  216 + mounted() {
  217 + this.getTaskManageList();
  218 +
  219 + // // 使用 $nextTick 确保 DOM 渲染完成后再加载脚本
  220 + // this.$nextTick(() => {
  221 + // // 添加 Dify Chatbot 配置
  222 + // window.difyChatbotConfig = {
  223 + // token: 'VrcUZBXmDOhvn7SQ',
  224 + // baseUrl: 'http://ai.15miaoo.com:17999',
  225 + // systemVariables: {
  226 + // // user_id: 'YOU CAN DEFINE USER ID HERE',
  227 + // },
  228 + // };
  229 + //
  230 + // // 动态加载脚本
  231 + // this.loadDifyScript();
  232 + // });
  233 + },
  234 +
  235 + // // 添加 beforeDestroy 钩子来清理资源
  236 + // beforeDestroy() {
  237 + // // 移除聊天机器人相关的DOM元素
  238 + // const chatbotElements = [
  239 + // document.getElementById('dify-chatbot-bubble-button'),
  240 + // document.getElementById('dify-chatbot-bubble-window'),
  241 + // document.getElementById('VrcUZBXmDOhvn7SQ')
  242 + // ];
  243 + //
  244 + // chatbotElements.forEach(element => {
  245 + // if (element && element.parentNode) {
  246 + // element.parentNode.removeChild(element);
  247 + // }
  248 + // });
  249 + //
  250 + // // 清理可能存在的全局配置
  251 + // if (window.difyChatbotConfig) {
  252 + // delete window.difyChatbotConfig;
  253 + // }
  254 + // },
  255 +
173 methods: { 256 methods: {
  257 + getTaskManageList() {
  258 + getTaskManageList({name:this.name,cateId:this.cateId,page:this.page,pageSize:this.pageSize}).then((response) => {
  259 + console.log(this.page)
  260 + console.log(this.pageSize)
  261 + const code = response.data.code;
  262 + if (code != 200){
  263 + return this.$message.error('获取任务列表失败!')
  264 + }
  265 + this.tableData = response.data.data.rows;
  266 + this.total = response.data.data.total;
  267 + this.$message.success('获取任务列表成功!')
  268 + }).catch(erroe => {
  269 + this.$message.error(erroe.toString())
  270 + })
  271 + },
174 handleSizeChange(val) { 272 handleSizeChange(val) {
175 console.log(`每页 ${val} 条`); 273 console.log(`每页 ${val} 条`);
  274 + this.pageSize=val;
  275 + this.getTaskManageList();
176 }, 276 },
177 handleCurrentChange(val) { 277 handleCurrentChange(val) {
178 console.log(`当前页: ${val}`); 278 console.log(`当前页: ${val}`);
  279 + this.page=val;
  280 + this.getTaskManageList();
179 }, 281 },
180 handleClick(row) { 282 handleClick(row) {
  283 + this.ruleForm=JSON.parse(JSON.stringify(row));
181 this.dialogApply='update'; 284 this.dialogApply='update';
182 this.dialogVisible=true; 285 this.dialogVisible=true;
183 }, 286 },
184 submitForm(formName) { 287 submitForm(formName) {
185 - this.$refs[formName].validate((valid) => {  
186 - if (valid) {  
187 - alert('submit!');  
188 - } else {  
189 - console.log('error submit!!');  
190 - return false; 288 + this.$refs[formName].validate(async (valid) => {
  289 + if (!valid){
  290 + console.log('error submit!!');
  291 + return false;
  292 + }
  293 + try {
  294 + let response;
  295 + if (this.dialogApply === 'create'){
  296 + response = await addTaskManage(this.ruleForm);
  297 + } else if (this.dialogApply === 'update'){
  298 + response = await updateTaskManage(this.ruleForm);
  299 + }
  300 + const code = response.data.code;
  301 + if (code !== 200){
  302 + this.$message.error(this.dialogApply === 'create' ? '新增失败!' : '更新失败!')
  303 + return;
  304 + }
  305 + this.$message.success(this.dialogApply === 'create' ? '新增成功!' : '更新成功!')
  306 + this.dialogVisible=false;
  307 + this.name = this.ruleForm.name;
  308 + this.cateId = this.ruleForm.cateId;
  309 + this.getTaskManageList();
  310 + } catch (error) {
  311 + this.$message.error(error.toString())
191 } 312 }
192 }); 313 });
193 }, 314 },
@@ -203,7 +324,7 @@ @@ -203,7 +324,7 @@
203 .catch(_ => {}); 324 .catch(_ => {});
204 }, 325 },
205 // 删除 326 // 删除
206 - applyDel(index, row) { 327 + applyDel(row) {
207 // 弹框询问是否删除? 328 // 弹框询问是否删除?
208 this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', { 329 this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
209 confirmButtonText: '确定删除', 330 confirmButtonText: '确定删除',
@@ -211,18 +332,60 @@ @@ -211,18 +332,60 @@
211 type: 'warning' 332 type: 'warning'
212 } 333 }
213 ).then(() => { 334 ).then(() => {
214 - // 335 + // 删除
  336 + const delIds = [row.id];
  337 + delTaskManage(delIds).then((response) => {
  338 + const code =response.data.code;
  339 + if (code != 200){
  340 + return this.$message.error('删除失败!')
  341 + }
  342 + this.$message.success('删除成功!')
  343 + }).catch(error => {
  344 + this.$message.error(error.toString())
  345 + })
  346 + this.name = row.name;
  347 + this.cateId = row.cateId;
  348 + this.getTaskManageList();
215 }).catch(() => { 349 }).catch(() => {
216 }) 350 })
217 }, 351 },
218 add(){ 352 add(){
219 this.ruleForm={ 353 this.ruleForm={
220 id:'', 354 id:'',
221 - name:'' 355 + name:'',
  356 + cateId:'',
  357 + dateRule:'',
  358 + form:'',
  359 + creator:'',
  360 + creatorId:'',
  361 + createTime:'',
  362 + updateTime:''
222 }; 363 };
223 this.dialogApply='create'; 364 this.dialogApply='create';
224 this.dialogVisible=true; 365 this.dialogVisible=true;
225 - } 366 + },
  367 + // loadDifyScript() {
  368 + // // 检查是否已经加载过脚本
  369 + // if (document.getElementById('VrcUZBXmDOhvn7SQ')) {
  370 + // return;
  371 + // }
  372 + //
  373 + // const script = document.createElement('script');
  374 + // script.src = 'http://ai.15miaoo.com:17999/embed.min.js';
  375 + // script.id = 'VrcUZBXmDOhvn7SQ';
  376 + // script.defer = true;
  377 + // document.head.appendChild(script);
  378 + // }
226 } 379 }
227 } 380 }
228 </script> 381 </script>
  382 +
  383 +<!--<style>/* 原有样式 */-->
  384 +<!--#dify-chatbot-bubble-button {-->
  385 +<!-- background-color: #1C64F2 !important;-->
  386 +<!--}-->
  387 +<!--#dify-chatbot-bubble-window {-->
  388 +<!-- width: 24rem !important;-->
  389 +<!-- height: 40rem !important;-->
  390 +<!--}-->
  391 +<!--</style>-->