Bladeren bron

餐厅管理试点ai建议接口改成统一dify工作流接口调用

xiongxing 4 maanden geleden
bovenliggende
commit
da2891cd52

+ 9 - 0
src/api/dify/index.ts

@@ -0,0 +1,9 @@
+import request from '@/config/axios'
+
+// 执行 Dify 工作流
+export const difyWorkflowRun = (data) => {
+  return request.post({
+    url: `/dify-work-flow-record/workflow-run`,
+    data
+  })
+}

+ 1 - 0
src/views/system/food/canteenManage/AddForm.vue

@@ -5,6 +5,7 @@
     :title="title"
     class="OutwardRegistrationBak"
     noPaddingEL="OutwardRegistrationBak"
+    @close="handleClosed"
   >
     <el-form ref="formRef" :model="dataForm" :rules="dataRule" :label-width="labelWidth">
       <div class="info-wrap">

+ 7 - 89
src/views/system/food/canteenManage/index.vue

@@ -76,7 +76,6 @@
         <template #default="scope">
           <div
             class="row-el"
-            @click.stop="aa"
             style="height: 40px;justify-content: center;align-items: center;"
           >
             <image-preview
@@ -120,13 +119,6 @@
         </template>
       </el-table-column>
     </el-table>
-    <!-- 分页 -->
-    <!--    <Pagination-->
-    <!--      :total="total"-->
-    <!--      v-model:page="queryParams.pageNo"-->
-    <!--      v-model:limit="queryParams.pageSize"-->
-    <!--      @pagination="getList"-->
-    <!--    />-->
   </ContentWrap>
 
   <AddForm
@@ -142,7 +134,8 @@
 import AddForm from '@/views/system/food/canteenManage/AddForm.vue'
 import DetailsForm from '@/views/system/food/canteenManage/DetailsForm.vue'
 import { chargeCategoryDel } from '@/api/elderly/fee/chargeCategory'
-import { getAiSuggest,getListRestaurant, restaurantManagementDelete } from '@/api/system/foods'
+import { getListRestaurant, restaurantManagementDelete } from '@/api/system/foods'
+import { difyWorkflowRun } from '@/api/dify'
 import { getTenantId } from '@/utils/auth'
 import { ElMessageBox } from 'element-plus'
 
@@ -150,14 +143,12 @@ const message = useMessage() // 消息弹窗
 const { t } = useI18n() // 国际化
 
 const loading = ref(true) // 列表的加载中
-const detailRef = ref()
 const addFoodRef = ref()
 const foodDetailsForm = ref()
-const total = ref(0) // 列表的总页数
 
 const suggestInterval = ref(5000)
 
-const list = ref([]) // 列表的数据
+const list = ref([] as any[]) // 列表的数据
 let queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -202,7 +193,7 @@ const triggerAiSuggestFlow = async () => {
   let needRestartTimer = false
   isAiSuggestRunning.value = true
   try {
-    const suggest = await getAiSuggest(tenantId)
+    const suggest = await difyWorkflowRun({tenantId,workNumber:'restaurantManagementGetAiSuggest'})
     // const suggest = {
     //   restaurantName: '测试餐厅名称',
     //   restaurantDescription: '测试餐厅描述'
@@ -319,52 +310,10 @@ const editCK = (item) => {
   addFoodRef.value.open(item)
 }
 
-const defaultProps = ref({
-  // 树形属性
-  children: 'childrenList',
-  label: 'name',
-  value: 'id'
-})
-
-/**
- * 点击树节点
- */
-const handleNodeClick = async (item) => {
-  queryParams.categoryId = item.id
-  category.id = item.id
-  category.name = item.name
-  // getList()
-}
-
-const showIconId = ref('')
-// 鼠标移入
-const handleMouseEnter = (data) => {
-  showIconId.value = data.id
-}
-
-// 鼠标移出
-const handleMouseLeave = () => {
-  showIconId.value = ''
-}
 
-const handleOpenCategory = (row) => {
-  addClassifyForm.value.open(row.id, true)
-}
 
-const remove = async (data) => {
-  try {
-    // 删除的二次确认
-    await message.delConfirm()
-    // 发起删除
-    await chargeCategoryDel(data.id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getTreeData()
-  } catch {}
-}
 
 const queryFormRef = ref() // 搜索的表单
-const treeRef = ref() // 树的表单
 
 /** 查询列表 */
 const getList = async () => {
@@ -386,10 +335,9 @@ const getList = async () => {
   }
 }
 
-const multipleSelection = ref([])
+const multipleSelection = ref([] as any[])
 const handleSelectionChange = (val) => {
   multipleSelection.value = val
-  console.log(multipleSelection.value)
 }
 
 /** 搜索按钮操作 */
@@ -401,49 +349,19 @@ const handleQuery = () => {
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryParams.elderName = ''
-  queryParams.queryTime = []
   queryFormRef.value.resetFields()
   handleQuery()
 }
 
-/** 添加/修改操作 */
-const addClassifyForm = ref()
-const addForm1 = (id?: number, isDetail: boolean = false) => {
-  addClassifyForm.value.open(id, isDetail)
-}
 
-const varietyDishesEdit = (item: any) => {
-  addClassifyForm.value.open(item.id, true)
-}
+
 
 const detailFormCK = (id?: number) => {
   foodDetailsForm.value.open(id)
 }
 
-const openReturnHospitalFormRef = async () => {
-  try {
-    // 取消的二次确认
-    await message.cancelConfirm('确定要撤销这条变更吗?')
-    // 发起取消
-    // await elderlyBakDel(id)
-    message.success('撤销成功!')
-    // 刷新列表
-    await getList()
-  } catch {}
-}
-
 /** 取消按钮操作 */
-const cancelDelete = async (id: number) => {
-  try {
-    // 取消的二次确认
-    await message.cancelConfirm()
-    // 发起取消
-    // await elderlyBakDel(id)
-    message.success(t('common.delSuccess'))
-    // 刷新列表
-    await getList()
-  } catch {}
-}
+
 
 /** 初始化 **/
 onMounted(() => {