|
|
@@ -51,16 +51,25 @@
|
|
|
<el-table-column label="APP数量" align="center" prop="appCount" width="80"/>
|
|
|
<el-table-column label="创建时间" align="left" prop="createTime" width="160"/>
|
|
|
<el-table-column label="更新时间" align="left" prop="updateTime" width="160"/>
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150">
|
|
|
<template #default="scope">
|
|
|
<!-- <el-tooltip content="文件列表" placement="top">
|
|
|
<el-button link type="primary" icon="Document" @click="handleToFileList(scope.row)"
|
|
|
v-hasPermi="['device:datasetsFile:list']"></el-button>
|
|
|
</el-tooltip>-->
|
|
|
<el-tooltip content="下发" placement="top">
|
|
|
- <el-button link type="primary" icon="Download" @click="handlePush(scope.row)"
|
|
|
+ <el-button link type="primary" icon="Position" @click="handlePush(scope.row)"
|
|
|
v-hasPermi="['device:datasets:edit']"></el-button>
|
|
|
</el-tooltip>
|
|
|
+ <el-tooltip content="产品条目" placement="top">
|
|
|
+ <el-button link type="primary" icon="View" @click="handleEntryList(scope.row)"
|
|
|
+ v-hasPermi="['device:datasets:query']"></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip content="刷新" placement="top">
|
|
|
+ <el-button link type="primary" icon="Refresh" @click="handleSync()"
|
|
|
+ v-hasPermi="['device:datasets:add']">
|
|
|
+ </el-button>
|
|
|
+ </el-tooltip>
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['device:datasets:remove']"></el-button>
|
|
|
@@ -112,6 +121,26 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <!-- 产品条目列表 -->
|
|
|
+ <el-dialog :title="viewDialog.title" v-model="viewDialog.visible" width="1200px" append-to-body>
|
|
|
+ <div class="table-content">
|
|
|
+ <el-table v-loading="entryLoading" :data="productList">
|
|
|
+ <el-table-column label="产品名称" align="left" prop="name" width="250" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="产品简介" align="left" prop="note" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="产品图片" align="left" width="100">
|
|
|
+ <template #default="scope">
|
|
|
+ <image-preview :src="scope.row.imgUrl" style="width: 40px; height: 40px; cursor: pointer"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建人" align="left" prop="createUser" width="100" :show-overflow-tooltip="true"/>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -120,18 +149,21 @@ import {
|
|
|
addDifyDatasets,
|
|
|
delDifyDatasets,
|
|
|
getDifyDatasets,
|
|
|
- listDifyDatasets, pushProductEntry,
|
|
|
+ listDifyDatasets,
|
|
|
+ pushProductEntry,
|
|
|
syncDifyDatasets,
|
|
|
updateDifyDatasets
|
|
|
} from '@/api/smsb/device/datasets';
|
|
|
import {DifyDatasetsForm, DifyDatasetsQuery, DifyDatasetsVO} from '@/api/smsb/device/datasets_type';
|
|
|
-import {listAllProduct} from "@/api/smsb/device/difyDatasetsProduct";
|
|
|
+import {listAllProduct, listProductByDatasetsId} from "@/api/smsb/device/difyDatasetsProduct";
|
|
|
+import {DifyDatasetsProductVO} from "@/api/smsb/device/difyDatasetsProduct/types";
|
|
|
|
|
|
const {proxy} = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
|
|
const difyDatasetsList = ref<DifyDatasetsVO[]>([]);
|
|
|
const buttonLoading = ref(false);
|
|
|
const loading = ref(true);
|
|
|
+const entryLoading = ref(true);
|
|
|
const showSearch = ref(true);
|
|
|
const ids = ref<Array<string | number>>([]);
|
|
|
const single = ref(true);
|
|
|
@@ -139,6 +171,7 @@ const multiple = ref(true);
|
|
|
const total = ref(0);
|
|
|
const selectedEntry = ref([]);
|
|
|
const entryList = ref([]);
|
|
|
+const productList = ref<DifyDatasetsProductVO>([]);
|
|
|
const queryFormRef = ref<ElFormInstance>();
|
|
|
const difyDatasetsFormRef = ref<ElFormInstance>();
|
|
|
const datasetsId = ref<number | string>();
|
|
|
@@ -153,6 +186,11 @@ const pushDialog = reactive<DialogOption>({
|
|
|
title: ''
|
|
|
});
|
|
|
|
|
|
+const viewDialog = reactive<DialogOption>({
|
|
|
+ visible: false,
|
|
|
+ title: ''
|
|
|
+});
|
|
|
+
|
|
|
const initFormData: DifyDatasetsForm = {
|
|
|
id: undefined,
|
|
|
name: undefined,
|
|
|
@@ -191,12 +229,22 @@ const getList = async () => {
|
|
|
total.value = res.total;
|
|
|
loading.value = false;
|
|
|
}
|
|
|
+const handleEntryList = async (row?: DifyDatasetsVO) => {
|
|
|
+ entryLoading.value = true;
|
|
|
+ viewDialog.visible = true;
|
|
|
+ viewDialog.title = '产品条目';
|
|
|
+ const datasetsId = row.id;
|
|
|
+ const res = await listProductByDatasetsId(datasetsId);
|
|
|
+ productList.value = res.data;
|
|
|
+ entryLoading.value = false;
|
|
|
+}
|
|
|
|
|
|
/** 取消按钮 */
|
|
|
const cancel = () => {
|
|
|
reset();
|
|
|
dialog.visible = false;
|
|
|
pushDialog.visible = false;
|
|
|
+ viewDialog.visible = false;
|
|
|
selectedEntry.value = [];
|
|
|
}
|
|
|
|