Explorar el Código

优化:
优化知识条目和产品条目的表格布局

范志成 hace 3 meses
padre
commit
4ef23d926d

+ 49 - 47
smsb-plus-ui/src/views/smsb/difyDatasetsProduct/index.vue

@@ -39,55 +39,57 @@
     </transition>
 
     <el-card shadow="never">
-      <el-table v-loading="loading" :data="difyDatasetsProductList" @selection-change="handleSelectionChange">
-<!--        <el-table-column type="selection" width="55" align="left"/>-->
-        <el-table-column label="" align="left" prop="" width="10"/>
-        <el-table-column label="产品ID" align="left" prop="id" v-if="true" width="180"/>
-        <el-table-column label="产品名称" align="left" prop="name" width="120"/>
-        <el-table-column label="产品简介" align="left" prop="note" width="350">
-          <template #default="{ row }">
-            <div @click="toggleExpand(row)" style="cursor: pointer">
-              <div v-if="row.expanded">
-                {{ row.note }}
+      <div class="table-content">
+        <el-table v-loading="loading" :data="difyDatasetsProductList" @selection-change="handleSelectionChange">
+          <!--        <el-table-column type="selection" width="55" align="left"/>-->
+          <el-table-column label="" align="left" prop="" width="10"/>
+          <el-table-column label="产品ID" align="left" prop="id" v-if="true" width="180"/>
+          <el-table-column label="产品名称" align="left" prop="name" width="120"/>
+          <el-table-column label="产品简介" align="left" prop="note" width="350">
+            <template #default="{ row }">
+              <div @click="toggleExpand(row)" style="cursor: pointer">
+                <div v-if="row.expanded">
+                  {{ row.note }}
+                </div>
+                <div v-else>
+                  {{ row.note.substring(0, 52) + (row.note.length > 52 ? '...' : '') }}
+                </div>
               </div>
-              <div v-else>
-                {{ row.note.substring(0, 52) + (row.note.length > 52 ? '...' : '') }}
-              </div>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="产品属性" align="center" width="100">
-          <template #default="scope">
-            <dict-tag :options="smsb_product_properties" :value="scope.row.property" />
-          </template>
-        </el-table-column>
-        <el-table-column label="关键词" align="left" prop="keyword" width="150" :show-overflow-tooltip="true"/>
-        <el-table-column label="产品价格" align="center" prop="price" width="100"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="产品属性" align="center" width="100">
+            <template #default="scope">
+              <dict-tag :options="smsb_product_properties" :value="scope.row.property"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="关键词" align="left" prop="keyword" width="150" :show-overflow-tooltip="true"/>
+          <el-table-column label="产品价格" align="center" prop="price" width="100"/>
 
-        <el-table-column label="排序" align="center" prop="sort" width="100"/>
-        <el-table-column label="产品图片" align="center" width="100">
-          <!--          &lt;!&ndash; 使用作用域插槽获取当前行数据 &ndash;&gt;-->
-          <template #default="scope">
-            <!--            &lt;!&ndash; 将 imgUrl 传递给自定义组件 &ndash;&gt;-->
-            <image-preview :src="scope.row.imgUrl" style="width: 40px; height: 40px; cursor: pointer" />
-          </template>
-        </el-table-column>
-        <el-table-column label="产品视频" align="left" prop="videoUrl" width="150" :show-overflow-tooltip="true"/>
-        <el-table-column label="创建人" align="left" prop="createUser" width="120" :show-overflow-tooltip="true"/>
-        <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
-        <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="100">
-          <template #default="scope">
-            <el-tooltip content="修改" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
-                         v-hasPermi="['system:difyDatasetsProduct:edit']"></el-button>
-            </el-tooltip>
-            <el-tooltip content="删除" placement="top">
-              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
-                         v-hasPermi="['system:difyDatasetsProduct:remove']"></el-button>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-      </el-table>
+          <el-table-column label="排序" align="center" prop="sort" width="100"/>
+          <el-table-column label="产品图片" align="center" width="100">
+            <!--          &lt;!&ndash; 使用作用域插槽获取当前行数据 &ndash;&gt;-->
+            <template #default="scope">
+              <!--            &lt;!&ndash; 将 imgUrl 传递给自定义组件 &ndash;&gt;-->
+              <image-preview :src="scope.row.imgUrl" style="width: 40px; height: 40px; cursor: pointer"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="产品视频" align="left" prop="videoUrl" width="150" :show-overflow-tooltip="true"/>
+          <el-table-column label="创建人" align="left" prop="createUser" width="120" :show-overflow-tooltip="true"/>
+          <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
+          <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="100">
+            <template #default="scope">
+              <el-tooltip content="修改" placement="top">
+                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
+                           v-hasPermi="['system:difyDatasetsProduct:edit']"></el-button>
+              </el-tooltip>
+              <el-tooltip content="删除" placement="top">
+                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
+                           v-hasPermi="['system:difyDatasetsProduct:remove']"></el-button>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
                   v-model:limit="queryParams.pageSize" @pagination="getList"/>
     </el-card>

+ 53 - 51
smsb-plus-ui/src/views/smsb/difyDatasetsQuestion/index.vue

@@ -48,59 +48,61 @@
     </transition>
 
     <el-card shadow="never">
-      <el-table v-loading="loading" :data="difyDatasetsQuestionList" @selection-change="handleSelectionChange">
-<!--        <el-table-column type="selection" width="55" align="left"/>-->
-        <el-table-column label="" align="left" prop="" width="10"/>
-        <el-table-column label="ID" align="left" prop="id" v-if="true" width="180"/>
-        <el-table-column label="问题" align="left" prop="question" width="150">
-          <template #default="{ row }">
-            <div @click="toggleExpand(row)" style="cursor: pointer">
-            <div v-if="row.expanded">
-              {{ row.question }}
-            </div>
-            <div v-else>
-              {{ row.question.substring(0, 20) + (row.question.length > 20 ? '...' : '') }}
-            </div>
-            </div>
-          </template>
-        </el-table-column>
-<!--        :show-overflow-tooltip="true"-->
-        <el-table-column label="回答" align="left" prop="answer" width="500">
-          <template #default="{ row }">
-            <div @click="toggleExpand(row)" style="cursor: pointer">
-              <div v-if="row.expanded">
-                {{ row.answer }}
+      <div class="table-content">
+        <el-table v-loading="loading" :data="difyDatasetsQuestionList" @selection-change="handleSelectionChange">
+          <!--        <el-table-column type="selection" width="55" align="left"/>-->
+          <el-table-column label="" align="left" prop="" width="10"/>
+          <el-table-column label="ID" align="left" prop="id" v-if="true" width="180"/>
+          <el-table-column label="问题" align="left" prop="question" width="150">
+            <template #default="{ row }">
+              <div @click="toggleExpand(row)" style="cursor: pointer">
+                <div v-if="row.expanded">
+                  {{ row.question }}
+                </div>
+                <div v-else>
+                  {{ row.question.substring(0, 20) + (row.question.length > 20 ? '...' : '') }}
+                </div>
               </div>
-              <div v-else>
-                {{ row.answer.substring(0, 65) + (row.answer.length > 65 ? '...' : '') }}
+            </template>
+          </el-table-column>
+          <!--        :show-overflow-tooltip="true"-->
+          <el-table-column label="回答" align="left" prop="answer" width="500">
+            <template #default="{ row }">
+              <div @click="toggleExpand(row)" style="cursor: pointer">
+                <div v-if="row.expanded">
+                  {{ row.answer }}
+                </div>
+                <div v-else>
+                  {{ row.answer.substring(0, 65) + (row.answer.length > 65 ? '...' : '') }}
+                </div>
               </div>
-            </div>
-          </template>
-        </el-table-column>
-        <el-table-column label="排序" align="center" prop="sort" width="50"/>
-        <el-table-column label="属性" align="center" width="80">
-          <template #default="scope">
-            <dict-tag :options="smsb_question_properties" :value="scope.row.property" />
-          </template>
-        </el-table-column>
-        <el-table-column label="创建时间" align="left" prop="createTime" width="160"/>
-        <el-table-column label="创建人" align="left" prop="createUser" width="120" :show-overflow-tooltip="true"/>
-        <el-table-column label="更新时间" align="left" prop="updateTime" width="160"/>
-        <el-table-column label="更新人" align="left" prop="updateBy" width="120" :show-overflow-tooltip="true"/>
-        <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
-        <el-table-column label="操作" align="left" width="120" class-name="small-padding fixed-width">
-          <template #default="scope">
-            <el-tooltip content="修改" placement="top">
-              <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
-                         v-hasPermi="['device:difyDatasetsQuestion:edit']"></el-button>
-            </el-tooltip>
-            <el-tooltip content="删除" placement="top">
-              <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
-                         v-hasPermi="['device:difyDatasetsQuestion:remove']"></el-button>
-            </el-tooltip>
-          </template>
-        </el-table-column>
-      </el-table>
+            </template>
+          </el-table-column>
+          <el-table-column label="排序" align="center" prop="sort" width="50"/>
+          <el-table-column label="属性" align="center" width="80">
+            <template #default="scope">
+              <dict-tag :options="smsb_question_properties" :value="scope.row.property"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="创建时间" align="left" prop="createTime" width="160"/>
+          <el-table-column label="创建人" align="left" prop="createUser" width="120" :show-overflow-tooltip="true"/>
+          <el-table-column label="更新时间" align="left" prop="updateTime" width="160"/>
+          <el-table-column label="更新人" align="left" prop="updateBy" width="120" :show-overflow-tooltip="true"/>
+          <el-table-column label="备注" align="left" prop="remark" :show-overflow-tooltip="true"/>
+          <el-table-column label="操作" align="left" width="120" class-name="small-padding fixed-width">
+            <template #default="scope">
+              <el-tooltip content="修改" placement="top">
+                <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
+                           v-hasPermi="['device:difyDatasetsQuestion:edit']"></el-button>
+              </el-tooltip>
+              <el-tooltip content="删除" placement="top">
+                <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
+                           v-hasPermi="['device:difyDatasetsQuestion:remove']"></el-button>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
 
       <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
                   v-model:limit="queryParams.pageSize" @pagination="getList"/>