From d916dfba2efa2d9359f5b432350a15e5ed1a0af4 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期五, 18 十月 2024 13:58:31 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/model/pre/item/index.vue |  185 +++++++++++++++++++++++++++++-----------------
 1 files changed, 116 insertions(+), 69 deletions(-)

diff --git a/src/views/model/pre/item/index.vue b/src/views/model/pre/item/index.vue
index 99562f7..e0e8861 100644
--- a/src/views/model/pre/item/index.vue
+++ b/src/views/model/pre/item/index.vue
@@ -8,10 +8,19 @@
       :inline="true"
       label-width="68px"
     >
-      <el-form-item label="名称" prop="itemtypename">
+      <el-form-item label="编号" prop="itemno">
         <el-input
-          v-model="queryParams.itemtypename"
-          placeholder="请输入名称"
+          v-model="queryParams.itemno"
+          placeholder="请输入编号"
+          clearable
+          @keyup.enter="handleQuery"
+          class="!w-240px"
+        />
+      </el-form-item>
+      <el-form-item label="预测项名" prop="itemname">
+        <el-input
+          v-model="queryParams.itemname"
+          placeholder="请输入预测项名"
           clearable
           @keyup.enter="handleQuery"
           class="!w-240px"
@@ -19,11 +28,11 @@
       </el-form-item>
       <el-form-item>
         <el-button @click="handleQuery">
-          <Icon icon="ep:search" class="mr-5px" />
+          <Icon icon="ep:search" class="mr-5px"/>
           搜索
         </el-button>
         <el-button @click="resetQuery">
-          <Icon icon="ep:refresh" class="mr-5px" />
+          <Icon icon="ep:refresh" class="mr-5px"/>
           重置
         </el-button>
         <el-button
@@ -32,7 +41,7 @@
           @click="openForm('create')"
           v-hasPermi="['model:pre-item:create']"
         >
-          <Icon icon="ep:plus" class="mr-5px" />
+          <Icon icon="ep:plus" class="mr-5px"/>
           新增
         </el-button>
       </el-form-item>
@@ -42,16 +51,43 @@
   <!-- 列表 -->
   <ContentWrap>
     <el-table v-loading="loading" :data="list">
-      <el-table-column label="名称" align="center" prop="itemtypename" />
-      <el-table-column label="类名" align="center" prop="itemclasstype" />
-      <el-table-column label="程序集" align="center" prop="assemblyname" />
-
+      <el-table-column label="编号" align="center" prop="itemno"/>
+      <el-table-column label="预测项名" header-align="center" align="left" min-width="200" prop="itemname"/>
+      <el-table-column label="类型名称" align="center" prop="itemtypename">
+        <template #default="scope">
+          <el-tag v-if="scope.row.itemtypename === 'NormalItem'" size="small" type="success">{{scope.row.itemtypename}}</el-tag>
+          <el-tag v-else size="small" type="primary">{{scope.row.itemtypename}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column label="预测长度" align="center" prop="predictlength"/>
+      <el-table-column label="粒度" align="center" prop="granularity">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.TIME_GRANULARITY" :value="scope.row.granularity" />
+        </template>
+      </el-table-column>
+      <el-table-column label="是否融合" align="center" prop="isfuse">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.isfuse" />
+        </template>
+      </el-table-column>
+      <el-table-column label="是否检查" align="center" prop="workchecked">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.workchecked" />
+        </template>
+      </el-table-column>
+      <el-table-column label="是否启用" align="center" prop="status">
+        <template #default="scope">
+          <dict-tag :type="DICT_TYPE.COM_IS_INT" :value="scope.row.status" />
+        </template>
+      </el-table-column>
+      <el-table-column label="数据点名称" align="center" prop="tagname"/>
+      <el-table-column label="存放表" align="center" prop="tablename"/>
       <el-table-column label="操作" align="center" min-width="110" fixed="right">
         <template #default="scope">
           <el-button
             link
             type="primary"
-            @click="openForm('update', scope.row.id)"
+            @click="openForm('update', scope.row.id, scope.row.itemtypename)"
             v-hasPermi="['model:pre-item:update']"
           >
             编辑
@@ -77,75 +113,86 @@
   </ContentWrap>
 
   <!-- 表单弹窗:添加/修改 -->
-  <MmItemTypeForm ref="formRef" @success="getList" />
+  <MmPredictItemForm ref="formRef" @success="getList"/>
 
 </template>
 <script lang="ts" setup>
-import MmItemTypeForm from './ItemTypeForm.vue'
-import * as MmItemType from '@/api/model/pre/item'
+import MmPredictItemForm from './MmPredictItemForm.vue'
+import * as MmPredictItem from '@/api/model/pre/predict'
+import {DICT_TYPE} from "@/utils/dict";
 
-defineOptions({name: 'DataMmItemType'})
+defineOptions({name: 'DataMmPredictItem'})
 
-  const message = useMessage() // 消息弹窗
-  const {t} = useI18n() // 国际化
+const message = useMessage() // 消息弹窗
+const {t} = useI18n() // 国际化
 
-  const loading = ref(true) // 列表的加载中
-  const total = ref(0) // 列表的总页数
-  const list = ref([]) // 列表的数据
-  const queryParams = reactive({
-    pageNo: 1,
-    pageSize: 10,
-    itemtypename: undefined,
-  })
-  const queryFormRef = ref() // 搜索的表单
-  const exportLoading = ref(false) // 导出的加载中
+const loading = ref(true) // 列表的加载中
+const total = ref(0) // 列表的总页数
+const list = ref([]) // 列表的数据
+const queryParams = reactive({
+  pageNo: 1,
+  pageSize: 10,
+  itemno: undefined,
+  itemname: undefined,
+})
+const isList = ref([
+  {
+    code: 0,
+    name: '否'
+  },
+  {
+    code: 1,
+    name: '是'
+  }])
+const queryFormRef = ref() // 搜索的表单
+const exportLoading = ref(false) // 导出的加载中
 
-  /** 查询列表 */
-  const getList = async () => {
-    loading.value = true
-    try {
-      const page = await MmItemType.getMmItemTypePage(queryParams)
-      list.value = page.list
-      total.value = page.total
-    } finally {
-      loading.value = false
-    }
+/** 查询列表 */
+const getList = async () => {
+  loading.value = true
+  try {
+    const page = await MmPredictItem.getMmPredictItemPage(queryParams)
+    list.value = page.list
+    total.value = page.total
+  } finally {
+    loading.value = false
   }
+}
 
-  /** 搜索按钮操作 */
-  const handleQuery = () => {
-    queryParams.pageNo = 1
-    getList()
-  }
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.pageNo = 1
+  getList()
+}
 
-  /** 重置按钮操作 */
-  const resetQuery = () => {
-    queryFormRef.value.resetFields()
-    handleQuery()
-  }
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value.resetFields()
+  handleQuery()
+}
 
-  /** 添加/修改操作 */
-  const formRef = ref()
-  const openForm = (type: string, id?: number) => {
-    formRef.value.open(type, id)
-  }
+/** 添加/修改操作 */
+const formRef = ref()
+const openForm = (type: string, id?: number, itemtypename?: string) => {
+  formRef.value.open(type, id, itemtypename)
+}
 
-  /** 删除按钮操作 */
-  const handleDelete = async (id: number) => {
-    try {
-      // 删除的二次确认
-      await message.delConfirm()
-      // 发起删除
-      await MmItemType.deleteMmItemType(id)
-      message.success(t('common.delSuccess'))
-      // 刷新列表
-      await getList()
-    } catch {
-    }
-  }
-
-  /** 初始化 **/
-  onMounted(async () => {
+/** 删除按钮操作 */
+const handleDelete = async (id: number) => {
+  try {
+    // 删除的二次确认
+    await message.delConfirm()
+    // 发起删除
+    await MmPredictItem.deleteMmPredictItem(id)
+    message.success(t('common.delSuccess'))
+    // 刷新列表
     await getList()
-  })
+  } catch {
+  }
+}
+
+/** 初始化 **/
+onMounted(async () => {
+  await getList()
+})
 </script>

--
Gitblit v1.9.3