云联一号 5 ngày trước cách đây
mục cha
commit
67b7742a64

+ 39 - 5
src/views/lobster/dedup-config/index.vue

@@ -82,6 +82,7 @@
 
 
 <script>
 <script>
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
+import request from '@/utils/request'
 
 
 export default {
 export default {
   name: 'DedupConfig',
   name: 'DedupConfig',
@@ -97,14 +98,47 @@ export default {
   created() { this.loadCompanies(); this.getList() },
   created() { this.loadCompanies(); this.getList() },
   methods: {
   methods: {
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
-    getList() { this.loading = true; this.loading = false },
+    async getList() {
+      this.loading = true
+      try {
+        const res = await request({ url: '/workflow/lobster/dedup-config/list', method: 'get', params: this.queryParams })
+        this.list = (res.data || [])
+        this.total = this.list.length
+      } catch (e) {
+        this.list = []
+      } finally {
+        this.loading = false
+      }
+    },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
-    handleAdd() { this.isAdd = true; this.dialogTitle = '新增去重配置'; this.form = { companyId: null, configName: '', dedupMode: 'hybrid', exactWindowSize: 5, semanticThreshold: 0.85, windowDurationSeconds: 300, ignorePrefixCount: 0, remark: '' }; this.dialogVisible = true },
+    handleAdd() { this.isAdd = true; this.dialogTitle = '新增去重配置'; this.form = { companyId: this.queryParams.companyId, configName: '', dedupMode: 'hybrid', exactWindowSize: 5, semanticThreshold: 0.85, windowDurationSeconds: 300, ignorePrefixCount: 0, remark: '', enabled: 1 }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改去重配置'; this.form = { ...row }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改去重配置'; this.form = { ...row }; this.dialogVisible = true },
-    handleStatusChange(row) { this.$message.success('状态已更新') },
-    submitForm() { this.$refs.formRef.validate(v => { if (!v) return; this.$message.success(this.isAdd ? '新增成功' : '修改成功'); this.dialogVisible = false; this.getList() }) },
-    handleDelete(row) { this.$confirm('确认删除?', '警告', { type: 'warning' }).then(() => { this.$message.success('删除成功'); this.getList() }).catch(() => {}) }
+    async handleStatusChange(row) {
+      try {
+        await request({ url: '/workflow/lobster/dedup-config/save', method: 'post', data: row })
+        this.$message.success('状态已更新')
+      } catch (e) { this.$message.error('更新失败') }
+    },
+    async submitForm() {
+      this.$refs.formRef.validate(async v => {
+        if (!v) return
+        try {
+          await request({ url: '/workflow/lobster/dedup-config/save', method: 'post', data: this.form })
+          this.$message.success(this.isAdd ? '新增成功' : '修改成功')
+          this.dialogVisible = false
+          this.getList()
+        } catch (e) { this.$message.error('保存失败') }
+      })
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm('确认删除?', '警告', { type: 'warning' })
+        await request({ url: `/workflow/lobster/dedup-config/${row.id}`, method: 'delete', params: { companyId: row.companyId } })
+        this.$message.success('删除成功')
+        this.getList()
+      } catch (e) { if (e !== 'cancel') this.$message.error('删除失败') }
+    }
   }
   }
 }
 }
 </script>
 </script>

+ 34 - 7
src/views/lobster/profile-config/index.vue

@@ -84,6 +84,7 @@
 
 
 <script>
 <script>
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
+import request from '@/utils/request'
 
 
 export default {
 export default {
   name: 'ProfileConfig',
   name: 'ProfileConfig',
@@ -99,17 +100,43 @@ export default {
   },
   },
   created() { this.loadCompanies(); this.getList() },
   created() { this.loadCompanies(); this.getList() },
   methods: {
   methods: {
-    async loadCompanies() {
-      try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {}
+    async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
+    async getList() {
+      this.loading = true
+      try {
+        const res = await request({ url: '/workflow/lobster/profile-config/list', method: 'get', params: this.queryParams })
+        this.list = (res.data || [])
+        this.total = this.list.length
+      } catch (e) { this.list = []
+      } finally { this.loading = false }
     },
     },
-    getList() { this.loading = true; /* API: /workflow/lobster/profile-config/list */ this.loading = false },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
-    handleAdd() { this.isAdd = true; this.dialogTitle = '新增画像配置'; this.form = { companyId: null, configName: '', profileSource: 'crm_tag', refreshStrategy: 'daily', maxFields: 10, fieldMappings: '', remark: '' }; this.dialogVisible = true },
+    handleAdd() { this.isAdd = true; this.dialogTitle = '新增画像配置'; this.form = { companyId: this.queryParams.companyId, configName: '', profileSource: 'crm_tag', refreshStrategy: 'daily', maxFields: 10, fieldMappings: '', remark: '', enabled: 1 }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改画像配置'; this.form = { ...row }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改画像配置'; this.form = { ...row }; this.dialogVisible = true },
-    handleStatusChange(row) { this.$message.success('状态已更新') },
-    submitForm() { this.$refs.formRef.validate(v => { if (!v) return; this.$message.success(this.isAdd ? '新增成功' : '修改成功'); this.dialogVisible = false; this.getList() }) },
-    handleDelete(row) { this.$confirm('确认删除?', '警告', { type: 'warning' }).then(() => { this.$message.success('删除成功'); this.getList() }).catch(() => {}) }
+    async handleStatusChange(row) {
+      try {
+        await request({ url: '/workflow/lobster/profile-config/save', method: 'post', data: row })
+        this.$message.success('状态已更新')
+      } catch (e) { this.$message.error('更新失败') }
+    },
+    async submitForm() {
+      this.$refs.formRef.validate(async v => {
+        if (!v) return
+        try {
+          await request({ url: '/workflow/lobster/profile-config/save', method: 'post', data: this.form })
+          this.$message.success(this.isAdd ? '新增成功' : '修改成功')
+          this.dialogVisible = false; this.getList()
+        } catch (e) { this.$message.error('保存失败') }
+      })
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm('确认删除?', '警告', { type: 'warning' })
+        await request({ url: `/workflow/lobster/profile-config/${row.id}`, method: 'delete', params: { companyId: row.companyId } })
+        this.$message.success('删除成功'); this.getList()
+      } catch (e) { if (e !== 'cancel') this.$message.error('删除失败') }
+    }
   }
   }
 }
 }
 </script>
 </script>

+ 38 - 5
src/views/lobster/sensitive-words/index.vue

@@ -87,6 +87,7 @@
 
 
 <script>
 <script>
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
+import request from '@/utils/request'
 
 
 export default {
 export default {
   name: 'SensitiveWords',
   name: 'SensitiveWords',
@@ -103,15 +104,47 @@ export default {
   created() { this.loadCompanies(); this.getList() },
   created() { this.loadCompanies(); this.getList() },
   methods: {
   methods: {
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
-    getList() { this.loading = true; /* API: /workflow/lobster/sensitive-words/list */ this.loading = false },
+    async getList() {
+      this.loading = true
+      try {
+        const res = await request({ url: '/workflow/lobster/sensitive-words/list', method: 'get', params: this.queryParams })
+        this.list = (res.data || [])
+        this.total = this.list.length
+      } catch (e) { this.list = []
+      } finally { this.loading = false }
+    },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
     handleSelectionChange(selection) { this.selectedIds = selection.map(s => s.id) },
     handleSelectionChange(selection) { this.selectedIds = selection.map(s => s.id) },
-    handleAdd() { this.isAdd = true; this.dialogTitle = '新增敏感词'; this.form = { companyId: null, word: '', category: '', severity: 1, remark: '' }; this.dialogVisible = true },
+    handleAdd() { this.isAdd = true; this.dialogTitle = '新增敏感词'; this.form = { companyId: this.queryParams.companyId, word: '', category: '', severity: 1, remark: '', enabled: 1 }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改敏感词'; this.form = { ...row }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改敏感词'; this.form = { ...row }; this.dialogVisible = true },
-    submitForm() { this.$refs.formRef.validate(v => { if (!v) return; this.$message.success(this.isAdd ? '新增成功' : '修改成功'); this.dialogVisible = false; this.getList() }) },
-    handleDelete(row) { this.$confirm('确认删除?', '警告', { type: 'warning' }).then(() => { this.$message.success('删除成功'); this.getList() }).catch(() => {}) },
-    handleBatchDelete() { if (!this.selectedIds.length) return; this.$confirm('确认批量删除?', '警告', { type: 'warning' }).then(() => { this.$message.success('批量删除成功'); this.getList() }).catch(() => {}) }
+    async submitForm() {
+      this.$refs.formRef.validate(async v => {
+        if (!v) return
+        try {
+          await request({ url: '/workflow/lobster/sensitive-words/save', method: 'post', data: this.form })
+          this.$message.success(this.isAdd ? '新增成功' : '修改成功')
+          this.dialogVisible = false; this.getList()
+        } catch (e) { this.$message.error('保存失败') }
+      })
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm('确认删除?', '警告', { type: 'warning' })
+        await request({ url: `/workflow/lobster/sensitive-words/${row.id}`, method: 'delete', params: { companyId: row.companyId } })
+        this.$message.success('删除成功'); this.getList()
+      } catch (e) { if (e !== 'cancel') this.$message.error('删除失败') }
+    },
+    async handleBatchDelete() {
+      if (!this.selectedIds.length) return
+      try {
+        await this.$confirm(`确认批量删除 ${this.selectedIds.length} 条?`, '警告', { type: 'warning' })
+        for (const id of this.selectedIds) {
+          await request({ url: `/workflow/lobster/sensitive-words/${id}`, method: 'delete', params: { companyId: this.queryParams.companyId } })
+        }
+        this.$message.success('批量删除成功'); this.getList()
+      } catch (e) { if (e !== 'cancel') this.$message.error('批量删除失败') }
+    }
   }
   }
 }
 }
 </script>
 </script>

+ 34 - 5
src/views/lobster/summary-config/index.vue

@@ -82,6 +82,7 @@
 
 
 <script>
 <script>
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
 import { listAllCompanies } from '@/api/workflow/lobster-admin'
+import request from '@/utils/request'
 
 
 export default {
 export default {
   name: 'SummaryConfig',
   name: 'SummaryConfig',
@@ -97,14 +98,42 @@ export default {
   created() { this.loadCompanies(); this.getList() },
   created() { this.loadCompanies(); this.getList() },
   methods: {
   methods: {
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
     async loadCompanies() { try { const res = await listAllCompanies(); this.companyOptions = (res.data || []).map(c => ({ value: c.companyId, label: c.companyName || '未知' })) } catch (e) {} },
-    getList() { this.loading = true; this.loading = false },
+    async getList() {
+      this.loading = true
+      try {
+        const res = await request({ url: '/workflow/lobster/summary-config/list', method: 'get', params: this.queryParams })
+        this.list = (res.data || [])
+        this.total = this.list.length
+      } catch (e) { this.list = []
+      } finally { this.loading = false }
+    },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     handleQuery() { this.queryParams.pageNum = 1; this.getList() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
     resetQuery() { this.$refs.queryForm.resetFields(); this.handleQuery() },
-    handleAdd() { this.isAdd = true; this.dialogTitle = '新增摘要配置'; this.form = { companyId: null, configName: '', triggerStrategy: 'message_count', triggerInterval: 20, modelIdentifier: '', maxContextMessages: 50, maxSummaryLength: 500, remark: '' }; this.dialogVisible = true },
+    handleAdd() { this.isAdd = true; this.dialogTitle = '新增摘要配置'; this.form = { companyId: this.queryParams.companyId, configName: '', triggerStrategy: 'message_count', triggerInterval: 20, modelIdentifier: '', maxContextMessages: 50, maxSummaryLength: 500, remark: '', enabled: 1 }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改摘要配置'; this.form = { ...row }; this.dialogVisible = true },
     handleEdit(row) { this.isAdd = false; this.dialogTitle = '修改摘要配置'; this.form = { ...row }; this.dialogVisible = true },
-    handleStatusChange(row) { this.$message.success('状态已更新') },
-    submitForm() { this.$refs.formRef.validate(v => { if (!v) return; this.$message.success(this.isAdd ? '新增成功' : '修改成功'); this.dialogVisible = false; this.getList() }) },
-    handleDelete(row) { this.$confirm('确认删除?', '警告', { type: 'warning' }).then(() => { this.$message.success('删除成功'); this.getList() }).catch(() => {}) }
+    async handleStatusChange(row) {
+      try {
+        await request({ url: '/workflow/lobster/summary-config/save', method: 'post', data: row })
+        this.$message.success('状态已更新')
+      } catch (e) { this.$message.error('更新失败') }
+    },
+    async submitForm() {
+      this.$refs.formRef.validate(async v => {
+        if (!v) return
+        try {
+          await request({ url: '/workflow/lobster/summary-config/save', method: 'post', data: this.form })
+          this.$message.success(this.isAdd ? '新增成功' : '修改成功')
+          this.dialogVisible = false; this.getList()
+        } catch (e) { this.$message.error('保存失败') }
+      })
+    },
+    async handleDelete(row) {
+      try {
+        await this.$confirm('确认删除?', '警告', { type: 'warning' })
+        await request({ url: `/workflow/lobster/summary-config/${row.id}`, method: 'delete', params: { companyId: row.companyId } })
+        this.$message.success('删除成功'); this.getList()
+      } catch (e) { if (e !== 'cancel') this.$message.error('删除失败') }
+    }
   }
   }
 }
 }
 </script>
 </script>