diff --git a/admin-ui/src/views/ai/order/index.vue b/admin-ui/src/views/ai/order/index.vue
index 2c1c741..0f7e4d8 100644
--- a/admin-ui/src/views/ai/order/index.vue
+++ b/admin-ui/src/views/ai/order/index.vue
@@ -36,7 +36,8 @@
-
+
+
{{ orderTypeLabel(scope.row.orderType) }}
@@ -44,12 +45,30 @@
+
+
+
+
+
+ -
+
+
{{ parseTime(scope.row.createTime) }}
+
+
+ 详情
+
+
+
+
+
+
+ {{ formatJson(value) }}
+ {{ value === null || value === undefined || value === "" ? "-" : value }}
+
+
+
+ 关闭
+
+
@@ -73,12 +104,11 @@ export default {
showSearch: true,
total: 0,
orderList: [],
+ detailVisible: false,
+ detailData: {},
orderTypeOptions: [
{ label: "充值", value: 0 },
- { label: "退款", value: 1 },
- { label: "下发", value: 2 },
- { label: "回收", value: 3 },
- { label: "手动修改", value: 4 }
+ { label: "退款", value: 1 }
],
queryParams: {
pageNum: 1,
@@ -97,6 +127,52 @@ export default {
const hit = this.orderTypeOptions.find(o => o.value === n)
return hit ? hit.label : "—"
},
+ extractVideoUrl(result) {
+ if (!result) return ""
+ if (typeof result === "string") {
+ const value = result.trim()
+ if (!value) return ""
+ if (/^https?:\/\/|^\/\//.test(value)) return value
+ try {
+ const parsed = JSON.parse(value)
+ return this.extractVideoUrl(parsed)
+ } catch (e) {
+ return ""
+ }
+ }
+ if (Array.isArray(result)) {
+ for (let i = 0; i < result.length; i += 1) {
+ const url = this.extractVideoUrl(result[i])
+ if (url) return url
+ }
+ return ""
+ }
+ if (typeof result === "object") {
+ const directKeys = ["videoUrl", "url", "resultUrl", "playUrl", "output", "fileUrl"]
+ for (let i = 0; i < directKeys.length; i += 1) {
+ const key = directKeys[i]
+ if (result[key]) {
+ const url = this.extractVideoUrl(result[key])
+ if (url) return url
+ }
+ }
+ }
+ return ""
+ },
+ handleDetail(row) {
+ this.detailData = row || {}
+ this.detailVisible = true
+ },
+ isObjectValue(value) {
+ return value !== null && typeof value === "object"
+ },
+ formatJson(value) {
+ try {
+ return JSON.stringify(value, null, 2)
+ } catch (e) {
+ return String(value)
+ }
+ },
getList() {
this.loading = true
listOrder(this.queryParams).then(response => {
diff --git a/admin-ui/src/views/ai/record/index.vue b/admin-ui/src/views/ai/record/index.vue
index a014eee..e9bffb6 100644
--- a/admin-ui/src/views/ai/record/index.vue
+++ b/admin-ui/src/views/ai/record/index.vue
@@ -17,21 +17,10 @@
@keyup.enter.native="handleQuery"
/>
-
-
-
-
-
+
+
+
+
搜索
@@ -57,7 +46,11 @@
-
+
+
+ {{ typeLabel(scope.row.type) }}
+
+
@@ -89,14 +82,19 @@ export default {
showSearch: true,
total: 0,
recordList: [],
+ typeOptions: [
+ { label: "充值", value: 0 },
+ { label: "退款", value: 1 },
+ { label: "下发", value: 2 },
+ { label: "回收", value: 3 },
+ { label: "手动修改", value: 4 }
+ ],
queryParams: {
pageNum: 1,
pageSize: 10,
relationOrderNo: null,
deptId: null,
- type: null,
- changeAmount: null,
- resultAmount: null
+ type: null
}
}
},
@@ -104,6 +102,11 @@ export default {
this.getList()
},
methods: {
+ typeLabel(type) {
+ const n = type !== undefined && type !== null ? Number(type) : null
+ const hit = this.typeOptions.find(item => item.value === n)
+ return hit ? hit.label : "-"
+ },
getList() {
this.loading = true
listRecord(this.queryParams).then(response => {
diff --git a/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/domain/AiOrder.java b/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/domain/AiOrder.java
index 780b2f9..3d9a87b 100644
--- a/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/domain/AiOrder.java
+++ b/web-api/ruoyi-system/src/main/java/com/ruoyi/ai/domain/AiOrder.java
@@ -128,5 +128,11 @@ public class AiOrder extends BaseEntity {
@TableField(exist = false)
private String uuid;
+ /**
+ * 部门名称(关联sys_dept.dept_name)
+ */
+ @TableField(exist = false)
+ private String deptName;
+
}
diff --git a/web-api/ruoyi-system/src/main/resources/mapper/system/AiOrderMapper.xml b/web-api/ruoyi-system/src/main/resources/mapper/system/AiOrderMapper.xml
index b01f074..66539b1 100644
--- a/web-api/ruoyi-system/src/main/resources/mapper/system/AiOrderMapper.xml
+++ b/web-api/ruoyi-system/src/main/resources/mapper/system/AiOrderMapper.xml
@@ -35,11 +35,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
- select ao.id, ao.del_flag, ao.create_by, ao.create_time, ao.update_by, ao.update_time, ao.remark, ao.order_num, ao.third_party_order_num, ao.user_id, ao.dept_id, ao.type, ao.pre_deduct_amount, ao.amount, ao.total_usage, ao.result, ao.status, ao.source, ao.text, ao.is_top, ao.img1, ao.img2, ao.mode, ao.duration, ao.resolution, ao.ratio, ao.model, ao.video_params, au.user_id uuid, ao.ext_status, ao.is_backfilled, ao.video_gen_request_id from ai_order ao
+ select ao.id, ao.del_flag, ao.create_by, ao.create_time, ao.update_by, ao.update_time, ao.remark, ao.order_num, ao.third_party_order_num, ao.user_id, ao.dept_id, ao.type, ao.pre_deduct_amount, ao.amount, ao.total_usage, ao.result, ao.status, ao.source, ao.text, ao.is_top, ao.img1, ao.img2, ao.mode, ao.duration, ao.resolution, ao.ratio, ao.model, ao.video_params, au.user_id uuid, ao.ext_status, ao.is_backfilled, ao.video_gen_request_id, sd.dept_name from ai_order ao
left join ai_user au on au.id = ao.user_id
+ left join sys_dept sd on sd.dept_id = ao.dept_id