pengwei
2025-04-14 3e60db98fdf6c5b59768ffc81576da3679fafbea
ÏîÄ¿´úÂë/client/src/views/tts/BasicInformation/Basicinformation.vue
@@ -107,6 +107,7 @@
            >新建</el-button
          >
          <el-button
            @click="importDialogVisible = true"
            size="small"
            style="width: 5.5rem; height: 2rem; font-size: 0.88rem"
            >批量导入</el-button
@@ -114,6 +115,7 @@
          <el-button
            size="small"
            style="width: 5.5rem; height: 2rem; font-size: 0.88rem"
            @click="printExcel"
            >批量导出</el-button
          >
          <el-button
@@ -127,6 +129,7 @@
      <div style="margin-top: 1rem; height: 100%">
        <!-- ä¿¡æ¯åˆ—表 -->
        <el-table
          empty-text="暂无数据"
          v-if="isactive == 1"
          :data="tableData"
          style="width: 100%"
@@ -142,7 +145,7 @@
            fontSize: '0.88rem',
            height: '3rem',
          }"
          @select="InfoSelectionChange"
          @selection-change="InfoSelectionChange"
        >
          <el-table-column type="selection" align="center" />
          <el-table-column prop="articleName" label="信息名称" align="center" />
@@ -161,6 +164,7 @@
        <!-- å·¥å…·åˆ—表 -->
        <el-table
          empty-text="暂无数据"
          v-if="isactive == 2"
          :data="toolList"
          style="width: 100%"
@@ -176,7 +180,7 @@
            fontSize: '0.88rem',
            height: '3rem',
          }"
          @select="ToolSelectionChange"
          @selection-change="ToolSelectionChange"
        >
          <el-table-column type="selection" align="center" />
          <el-table-column prop="toolName" label="工具名称" align="center" />
@@ -315,7 +319,6 @@
            <el-form-item prop="articleRemark">
              <template #label>
                <div style="display: flex; align-items: flex-end">
                  <span style="color: red; margin-right: 0.2rem">*</span>
                  <span
                    style="font-size: 0.88rem; color: black; font-weight: bold"
                    >备注</span
@@ -445,7 +448,6 @@
            <el-form-item prop="toolremark">
              <template #label>
                <div style="display: flex; align-items: flex-end">
                  <span style="color: red; margin-right: 0.2rem">*</span>
                  <span
                    style="font-size: 0.88rem; color: black; font-weight: bold"
                    >备注</span
@@ -481,12 +483,27 @@
        </div>
      </template>
    </el-dialog>
    <el-dialog v-model="importDialogVisible">
      <UploadExcel
        @importExcelAfter="importExcelAfter"
        :url="isactive == 1 ? 'api/ArticleInfom/Import' : 'api/Tools/Import'"
        :template="{
          url:
            isactive == 1
              ? 'api/ArticleInfom/DownLoadTemplate'
              : 'api/Tools/DownLoadTemplate',
          fileName: isactive == 1 ? '信息导入模板' : '工具导入模板',
        }"
      />
    </el-dialog>
  </div>
</template>
<script setup>
import { ref, reactive, onMounted, toRef } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { formatTime } from "@/utils/index.js";
import UploadExcel from "@/components/basic/UploadExcel.vue";
import {
  getBasicinformation,
  addBasicinformation,
@@ -496,6 +513,8 @@
  editToolData,
  deleteToolData,
  deleteBasicinformation,
  ExportApi,
  ExportTool,
} from "@/api/newapi/Basicinformation.js";
// åˆå§‹åŒ–数据
const obj = {
@@ -512,7 +531,7 @@
const isactive = ref(1);
const dialogVisible = ref(false);
const dialogVisible1 = ref(false);
const importDialogVisible = ref(false); // å¯¼å…¥
const selectoptions = ref([]);
const infoOpitions = ref([
  {
@@ -708,12 +727,44 @@
  }
};
const printExcel = () => {
  // æŸ¥è¯¢æ¡ä»¶
  const startTime = formatTime(queryForm.value.selectTime[0]);
  const endTime = formatTime(queryForm.value.selectTime[1]);
  const filter = [
    {
      name: queryForm.value.selectType,
      value: queryForm.value.selectInput,
      displayType: "like",
    },
    {
      name: "pustatus",
      value: queryForm.value.selectName,
      displayType: "String",
    },
    { name: "createDate", value: startTime, displayType: "ThanOrEqual" },
    { name: "createDate", value: endTime, displayType: "LessOrEqual" },
  ];
  if (isactive.value == 1) {
    ExportApi({
      ...pageQuery.value,
      filter,
    });
  }
  if (isactive.value == 2) {
    ExportTool({
      ...pageQuery.value,
      filter,
    });
  }
};
//分页请求参数
const pageQuery = ref({
  page: 1, //当前页面
  rows: 10, //每页显示条数
  order: "desc", //排序方式
  sort: "createDate", //排序字段
  sort: "", //排序字段
  wheres: "", //条件查询
});