|
@@ -4,24 +4,24 @@
|
|
AI案卷题名生成列表
|
|
AI案卷题名生成列表
|
|
</template>
|
|
</template>
|
|
<template #extra>
|
|
<template #extra>
|
|
- <el-button type="primary" hc-btn>
|
|
|
|
|
|
+ <el-button type="primary" hc-btn :loading="saveLoading" @click="saveClick">
|
|
<HcIcon name="save" />
|
|
<HcIcon name="save" />
|
|
<span>确认页面</span>
|
|
<span>确认页面</span>
|
|
</el-button>
|
|
</el-button>
|
|
- <el-button hc-btn>
|
|
|
|
|
|
+ <el-button hc-btn @click="closePage">
|
|
<HcIcon name="close" />
|
|
<HcIcon name="close" />
|
|
<span>关闭页面</span>
|
|
<span>关闭页面</span>
|
|
</el-button>
|
|
</el-button>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
- <hc-table :column="tableColumn" :datas="tableData">
|
|
|
|
|
|
+ <hc-table ref="tableRef" :column="tableColumn" :datas="tableData" :check-style="{ width: 29 }" is-check is-new @selection-change="tableSelection">
|
|
<template #archiveNameAi="{ row }">
|
|
<template #archiveNameAi="{ row }">
|
|
<hc-table-input v-model="row.archiveNameAi" class="blue-text" />
|
|
<hc-table-input v-model="row.archiveNameAi" class="blue-text" />
|
|
</template>
|
|
</template>
|
|
<template #action="{ row, index }">
|
|
<template #action="{ row, index }">
|
|
<el-link type="warning">修订</el-link>
|
|
<el-link type="warning">修订</el-link>
|
|
- <el-link type="success">确认</el-link>
|
|
|
|
|
|
+ <el-link v-loading="row?.load" type="success" @click="confirmClick">确认</el-link>
|
|
</template>
|
|
</template>
|
|
</hc-table>
|
|
</hc-table>
|
|
|
|
|
|
@@ -35,23 +35,33 @@
|
|
import { onMounted, ref } from 'vue'
|
|
import { onMounted, ref } from 'vue'
|
|
import aiApi from '~api/ai/ai.js'
|
|
import aiApi from '~api/ai/ai.js'
|
|
import { useAppStore } from '~src/store'
|
|
import { useAppStore } from '~src/store'
|
|
-import { useRoute } from 'vue-router'
|
|
|
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
import { getArrValue } from 'js-fast-way'
|
|
import { getArrValue } from 'js-fast-way'
|
|
|
|
+import { rowsToId } from '~uti/tools'
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
|
|
|
|
const projectId = ref(useAppState.getProjectId)
|
|
const projectId = ref(useAppState.getProjectId)
|
|
const contractId = ref(useAppState.getContractId)
|
|
const contractId = ref(useAppState.getContractId)
|
|
const useRoutes = useRoute()
|
|
const useRoutes = useRoute()
|
|
|
|
+const router = useRouter() // 获取路由实例
|
|
const tableColumn = [
|
|
const tableColumn = [
|
|
{ key: 'archiveName', name: '案卷题名' },
|
|
{ key: 'archiveName', name: '案卷题名' },
|
|
{ key: 'archiveNameAi', name: 'AI题名' },
|
|
{ key: 'archiveNameAi', name: 'AI题名' },
|
|
{ key: 'action', name: '操作', width: 120 },
|
|
{ key: 'action', name: '操作', width: 120 },
|
|
]
|
|
]
|
|
|
|
+const tableRef = ref(null)
|
|
const tableData = ref([
|
|
const tableData = ref([
|
|
{ id: 1, name: '名称1', text: '文本1', color: 'red' },
|
|
{ id: 1, name: '名称1', text: '文本1', color: 'red' },
|
|
{ id: 2, name: '名称2', text: '文本2', color: 'blue' },
|
|
{ id: 2, name: '名称2', text: '文本2', color: 'blue' },
|
|
{ id: 3, name: '名称3', text: '文本3', color: '无' },
|
|
{ id: 3, name: '名称3', text: '文本3', color: '无' },
|
|
])
|
|
])
|
|
|
|
+
|
|
|
|
+//渲染完成
|
|
|
|
+onMounted(() => {
|
|
|
|
+ // getClassIfyList()
|
|
|
|
+ getTableData
|
|
|
|
+
|
|
|
|
+})
|
|
//搜索表单
|
|
//搜索表单
|
|
const searchForm = ref({ current: 1, size: 20, total: 60 })
|
|
const searchForm = ref({ current: 1, size: 20, total: 60 })
|
|
const taskId = ref(useRoutes.query.taskId)
|
|
const taskId = ref(useRoutes.query.taskId)
|
|
@@ -80,12 +90,43 @@ const getTableData = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-//渲染完成
|
|
|
|
-onMounted(() => {
|
|
|
|
- // getClassIfyList()
|
|
|
|
- getTableData
|
|
|
|
|
|
+const tableSelection = (rows) => {
|
|
|
|
+ tableCheckedKeys.value = rows
|
|
|
|
+}
|
|
|
|
+const saveLoading = ref(false)
|
|
|
|
+const tableCheckedKeys = ref([])
|
|
|
|
+const saveClick = async () => {
|
|
|
|
+ let ids = ''
|
|
|
|
+ const rows = tableCheckedKeys.value
|
|
|
|
+ ids = rowsToId(rows)
|
|
|
|
+ saveLoading.value = true
|
|
|
|
+ const { error, code, msg } = await aiApi.confirmAiName({
|
|
|
|
+ ids,
|
|
|
|
+ status:1,
|
|
|
|
+ })
|
|
|
|
+ saveLoading.value = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ getTableData()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
-})
|
|
|
|
|
|
+const confirmClick = async (row) => {
|
|
|
|
+
|
|
|
|
+ row.load = true
|
|
|
|
+ const { error, code, msg } = await aiApi.confirmAiName({
|
|
|
|
+ ids:row.id,
|
|
|
|
+ status:1,
|
|
|
|
+ })
|
|
|
|
+ row.load = false
|
|
|
|
+ if (!error && code === 200) {
|
|
|
|
+ window.$message.success(msg)
|
|
|
|
+ getTableData()
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const closePage = ()=>{
|
|
|
|
+ router.go(-1)
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style>
|
|
<style>
|