CzRger před 2 měsíci
rodič
revize
0d875e1b5c

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 8 - 0
src/assets/svg/filter.svg


+ 3 - 3
src/components/czr-ui/CzrContent.vue

@@ -34,10 +34,10 @@
         </div>
         <div class="filters" v-if="noFilter === false">
           <div
-            class="tools __hover"
+            class="__hover flex h-9 w-9 items-center justify-center rounded-sm bg-[var(--czr-main-color)]"
             @click="() => (state.showFieldColumn = true)"
           >
-            <SvgIcon name="czr_tools" size="18" color="#666666" />
+            <SvgIcon name="czr_tools" size="18" color="#ffffff" />
           </div>
         </div>
         <div
@@ -293,9 +293,9 @@ onMounted(() => {
       justify-content: space-between;
       margin-bottom: 12px;
       .table-title {
-        margin-right: auto;
         display: flex;
         align-items: center;
+        flex: 1;
       }
       .buttons {
         margin-left: auto;

+ 186 - 0
src/components/czr-ui/CzrDialogDrag.vue

@@ -0,0 +1,186 @@
+<template>
+  <div
+    class="__czr-dialog"
+    v-drag="{ ...layout }"
+    v-if="state.showDialog"
+    :style="{ zIndex: state.zIndex }"
+    @click="() => (state.zIndex = DialogStore.addZIndex())"
+  >
+    <div class="el-dialog" style="width: 100%; margin: 0">
+      <div class="el-dialog__header">
+        <div class="_czr-dialog-head" v-if="title">
+          <div class="__cdh-title">{{ title }}</div>
+          <div class="__cdh-slot">
+            <slot name="head" />
+          </div>
+          <div class="__cdh-close __hover" @click="CDClose()">
+            <SvgIcon name="czr_close" size="16" color="#303133" />
+          </div>
+        </div>
+      </div>
+      <div class="el-dialog__body">
+        <div
+          class="__czr-dialog-main"
+          :class="{ isFull: full !== false }"
+          v-loading="loading"
+        >
+          <div class="__czr-dialog-content">
+            <slot />
+          </div>
+          <div
+            class="__czr-dialog-foot"
+            :style="`justify-content: ${footAlign};`"
+            v-if="showSubmit || showClose || $slots.foot"
+          >
+            <slot name="foot" :close="CDClose" :submit="CDSubmit" />
+            <template v-if="footAlign === 'center'">
+              <div
+                v-if="showSubmit"
+                class="__czr-dialog-foot_submit __hover"
+                @click="CDSubmit"
+              >
+                {{ submitText }}
+              </div>
+              <div
+                v-if="showClose"
+                class="__czr-dialog-foot_cancel __hover"
+                @click="CDClose()"
+              >
+                {{ closeText }}
+              </div>
+            </template>
+            <template v-else>
+              <div
+                v-if="showClose"
+                class="__czr-dialog-foot_cancel __hover"
+                @click="CDClose()"
+              >
+                {{ closeText }}
+              </div>
+              <div
+                v-if="showSubmit"
+                class="__czr-dialog-foot_submit __hover"
+                @click="CDSubmit"
+              >
+                {{ submitText }}
+              </div>
+            </template>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { useDialogStore } from '@/stores'
+
+defineOptions({
+  name: 'CzrDialogDrag',
+})
+import { isValue } from '@/utils/czr-util'
+import { computed, onMounted, reactive, watch } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { v4 } from 'uuid'
+
+const DialogStore = useDialogStore()
+const emit = defineEmits(['update:show', 'onClose'])
+const props = defineProps({
+  show: { required: true, type: Boolean },
+  title: { default: '' },
+  width: { default: '50%' },
+  full: { default: false },
+  submitText: { default: '确定' },
+  closeText: { default: '取消' },
+  showClose: { default: true },
+  showSubmit: { default: true },
+  footAlign: { default: 'center' },
+  height: { default: 'auto' },
+  maxHeight: { default: 'unset' },
+  minHeight: { default: 'unset' },
+  closeOnClickModal: { default: false },
+  closeOnPressEscape: { default: false },
+  closeConfirm: { default: false },
+  closeConfirmText: {
+    default: {
+      title: null,
+      message: null,
+      submit: null,
+      close: null,
+    },
+  },
+  loading: {
+    default: false,
+    type: Boolean,
+  },
+  zIndex: {},
+  layout: { default: {} },
+})
+const state = reactive({
+  showDialog: false,
+  closeConfirmTextTemp: {
+    title: '提示',
+    message: '请确认是否关闭?',
+    submit: '确定',
+    close: '取消',
+  },
+  uuid: v4(),
+  zIndex: props.zIndex || DialogStore.addZIndex(),
+})
+watch(
+  () => props.show,
+  (n) => {
+    state.showDialog = n
+  },
+)
+const beforeClose = (done) => {
+  CDClose(done)
+}
+const closeConfirmTextCpt: any = computed(() => {
+  return {
+    title: isValue(props.closeConfirmText.title)
+      ? props.closeConfirmText.title
+      : state.closeConfirmTextTemp.title,
+    message: isValue(props.closeConfirmText.message)
+      ? props.closeConfirmText.message
+      : state.closeConfirmTextTemp.message,
+    submit: isValue(props.closeConfirmText.submit)
+      ? props.closeConfirmText.submit
+      : state.closeConfirmTextTemp.submit,
+    close: isValue(props.closeConfirmText.close)
+      ? props.closeConfirmText.close
+      : state.closeConfirmTextTemp.close,
+  }
+})
+const CDClose = async (done = () => {}) => {
+  if (props.closeConfirm !== false) {
+    await ElMessageBox.confirm(
+      closeConfirmTextCpt.value.message,
+      closeConfirmTextCpt.value.title,
+      {
+        confirmButtonText: closeConfirmTextCpt.value.submit,
+        cancelButtonText: closeConfirmTextCpt.value.close,
+        type: 'warning',
+      },
+    )
+      .then(() => {
+        emit('update:show', false)
+        emit('onClose')
+        done()
+      })
+      .catch(() => {})
+  } else {
+    emit('update:show', false)
+    emit('onClose')
+    done()
+  }
+}
+const CDSubmit = () => {
+  emit('onSubmit')
+}
+onMounted(() => {
+  state.showDialog = props.show
+})
+</script>
+
+<style scoped lang="scss"></style>

+ 173 - 0
src/directives/drag.ts

@@ -0,0 +1,173 @@
+// dragDirective.js
+const dragDirective = {
+  mounted(el, binding) {
+    el.style.position = 'fixed'
+    el.style.cursor = 'move'
+
+    // 解析参数
+    const options = binding.value || {}
+    const {
+      top,
+      bottom,
+      left,
+      right,
+      handle: handleSelector,
+      mouse = false, // 新增mouse参数
+    } = options
+
+    // 初始化位置函数
+    const initPosition = () => {
+      const elWidth = el.offsetWidth
+      const elHeight = el.offsetHeight
+      const windowWidth = window.innerWidth
+      const windowHeight = window.innerHeight
+
+      if (mouse) {
+        // 使用鼠标当前位置初始化
+        const mouseX = window.event.clientX + 20
+        const mouseY = window.event.clientY + 20
+
+        // 计算初始位置,确保不会超出窗口
+        let initLeft = Math.min(mouseX, windowWidth - elWidth)
+        let initTop = Math.min(mouseY, windowHeight - elHeight)
+
+        // 应用位置
+        el.style.left = `${Math.max(0, initLeft)}px`
+        el.style.top = `${Math.max(0, initTop)}px`
+        el.style.right = 'auto'
+        el.style.bottom = 'auto'
+      } else {
+        // 常规初始化
+        if (top !== undefined) {
+          el.style.top = typeof top === 'string' ? top : `${top}px`
+          el.style.bottom = 'auto'
+        } else if (bottom !== undefined) {
+          el.style.bottom = typeof bottom === 'string' ? bottom : `${bottom}px`
+          el.style.top = 'auto'
+        }
+
+        if (left !== undefined) {
+          el.style.left = typeof left === 'string' ? left : `${left}px`
+          el.style.right = 'auto'
+        } else if (right !== undefined) {
+          el.style.right = typeof right === 'string' ? right : `${right}px`
+          el.style.left = 'auto'
+        }
+      }
+    }
+
+    // 保存鼠标位置
+    const updateMousePosition = (e) => {
+      if (!el._dragDirective) return
+      el._dragDirective.mouseX = e.clientX
+      el._dragDirective.mouseY = e.clientY
+    }
+
+    // 初始化数据
+    el._dragDirective = {
+      mouseX: null,
+      mouseY: null,
+      initialized: false,
+    }
+
+    // 如果是mouse模式,监听鼠标移动获取位置
+    if (mouse) {
+      document.addEventListener('mousemove', updateMousePosition)
+
+      // 设置一个微任务延迟,确保能获取到鼠标位置
+      Promise.resolve().then(() => {
+        initPosition()
+      })
+    } else {
+      initPosition()
+    }
+
+    let startX = 0,
+      startY = 0
+    let initialMouseX = 0,
+      initialMouseY = 0
+
+    // 获取当前元素位置
+    const getCurrentPosition = () => {
+      const rect = el.getBoundingClientRect()
+      return {
+        left: rect.left,
+        top: rect.top,
+        right: window.innerWidth - rect.right,
+        bottom: window.innerHeight - rect.bottom,
+      }
+    }
+
+    // 鼠标按下事件处理
+    const mouseDownHandler = (e) => {
+      const currentPos = getCurrentPosition()
+      startX = currentPos.left
+      startY = currentPos.top
+
+      initialMouseX = e.clientX
+      initialMouseY = e.clientY
+
+      document.addEventListener('mousemove', mouseMoveHandler)
+      document.addEventListener('mouseup', mouseUpHandler)
+
+      e.preventDefault()
+      e.stopPropagation()
+    }
+
+    // 鼠标移动事件处理
+    const mouseMoveHandler = (e) => {
+      const dx = e.clientX - initialMouseX
+      const dy = e.clientY - initialMouseY
+
+      let newX = startX + dx
+      let newY = startY + dy
+
+      const windowWidth = window.innerWidth
+      const windowHeight = window.innerHeight
+      const elWidth = el.offsetWidth
+      const elHeight = el.offsetHeight
+
+      // 限制在窗口范围内
+      newX = Math.max(0, Math.min(newX, windowWidth - elWidth))
+      newY = Math.max(0, Math.min(newY, windowHeight - elHeight))
+
+      // 应用新位置
+      el.style.left = `${newX}px`
+      el.style.top = `${newY}px`
+      el.style.right = 'auto'
+      el.style.bottom = 'auto'
+    }
+
+    // 鼠标松开事件处理
+    const mouseUpHandler = () => {
+      document.removeEventListener('mousemove', mouseMoveHandler)
+      document.removeEventListener('mouseup', mouseUpHandler)
+    }
+
+    // 确定拖拽手柄元素
+    const dragHandle = handleSelector ? el.querySelector(handleSelector) : el
+    dragHandle.addEventListener('mousedown', mouseDownHandler)
+    dragHandle.style.cursor = 'move'
+
+    // 保存引用以便卸载
+    el._dragDirective.mouseDownHandler = mouseDownHandler
+    el._dragDirective.dragHandle = dragHandle
+  },
+
+  unmounted(el) {
+    if (el._dragDirective) {
+      const { mouseDownHandler, dragHandle } = el._dragDirective
+      dragHandle.removeEventListener('mousedown', mouseDownHandler)
+
+      // 移除鼠标移动监听
+      if (el._dragDirective.mouse) {
+        document.removeEventListener(
+          'mousemove',
+          el._dragDirective.updateMousePosition,
+        )
+      }
+    }
+  },
+}
+
+export default dragDirective

+ 2 - 0
src/plugins/initDirectives.ts

@@ -1,8 +1,10 @@
 import type { App } from 'vue'
 import title from '@/directives/title'
+import drag from '@/directives/drag'
 
 export default {
   install(app: App) {
     app.directive('title', title)
+    app.directive('drag', drag)
   },
 }

+ 5 - 0
src/stores/modules/dialog.ts

@@ -11,6 +11,7 @@ export const useDialogStore = defineStore('dialog', {
       onSubmit: () => {},
       onCancel: () => {},
     },
+    zIndex: 100,
   }),
   getters: {},
   actions: {
@@ -48,5 +49,9 @@ export const useDialogStore = defineStore('dialog', {
         onCancel: onCancel,
       }
     },
+    addZIndex() {
+      this.zIndex++
+      return this.zIndex
+    },
   },
 })

+ 56 - 58
src/style/czr.scss

@@ -180,72 +180,70 @@
       }
     }
   }
-  .el-overlay-dialog {
-    .el-dialog {
-      background-image: url('@/assets/images/dialog-bg.png');
-      background-size: 100% 100%;
-      background-repeat: no-repeat;
+  .el-dialog {
+    background-image: url('@/assets/images/dialog-bg.png');
+    background-size: 100% 100%;
+    background-repeat: no-repeat;
+    padding: 0;
+    height: var(--czr-dialog_height);
+    $borderRadius: 0.5rem;
+    border-radius: $borderRadius;
+    display: flex;
+    flex-direction: column;
+    &.is-align-center {
+      margin: auto !important;
+    }
+    .el-dialog__header {
       padding: 0;
-      height: var(--czr-dialog_height);
-      $borderRadius: 0.5rem;
-      border-radius: $borderRadius;
-      display: flex;
-      flex-direction: column;
-      &.is-align-center {
-        margin: auto !important;
-      }
-      .el-dialog__header {
-        padding: 0;
-        margin: 0;
-        ._czr-dialog-head {
-          width: 100%;
-          height: 3.13rem;
-          //background-color: var(--czr-dialog-bg);
-          display: flex;
-          align-items: center;
-          padding: 0 1rem;
-          border-radius: $borderRadius $borderRadius 0 0;
-          .__cdh-title {
-            font-weight: bold;
-            font-size: 1.13rem;
-            color: #303133;
-          }
-          .__cdh-slot {
-          }
-          .__cdh-close {
-            margin-left: auto;
-          }
+      margin: 0;
+      ._czr-dialog-head {
+        width: 100%;
+        height: 3.13rem;
+        //background-color: var(--czr-dialog-bg);
+        display: flex;
+        align-items: center;
+        padding: 0 1rem;
+        border-radius: $borderRadius $borderRadius 0 0;
+        .__cdh-title {
+          font-weight: bold;
+          font-size: 1.13rem;
+          color: #303133;
+        }
+        .__cdh-slot {
+        }
+        .__cdh-close {
+          margin-left: auto;
         }
       }
-      .el-dialog__body {
-        padding: 0;
-        height: calc(100% - 3.13rem);
+    }
+    .el-dialog__body {
+      padding: 0;
+      height: calc(100% - 3.13rem);
+      width: 100%;
+      display: flex;
+      overflow-y: hidden;
+      flex: 1;
+      .__czr-dialog-main {
         width: 100%;
         display: flex;
-        overflow-y: hidden;
-        flex: 1;
-        .__czr-dialog-main {
+        flex-direction: column;
+        .__czr-dialog-content {
+          flex: 1;
+          overflow-y: auto;
+          padding: 1rem 1.5rem 0;
+        }
+        .__czr-dialog-foot {
           width: 100%;
           display: flex;
-          flex-direction: column;
+          align-items: center;
+          box-sizing: border-box;
+          gap: 1rem;
+          margin: 1rem 0;
+        }
+        &.isFull {
+          overflow-y: auto;
           .__czr-dialog-content {
-            flex: 1;
-            overflow-y: auto;
-            padding: 1rem 1.5rem 0;
-          }
-          .__czr-dialog-foot {
-            width: 100%;
-            display: flex;
-            align-items: center;
-            box-sizing: border-box;
-            gap: 1rem;
-            margin: 1rem 0;
-          }
-          &.isFull {
-            overflow-y: auto;
-            .__czr-dialog-content {
-              overflow-y: unset;
-            }
+            overflow-y: unset;
           }
         }
       }

+ 249 - 71
src/views/manage/app/monitor/index.vue

@@ -49,22 +49,186 @@
       </div>
       <template v-if="state.tab == 1"></template>
       <template v-else-if="state.tab == 2">
+        <CzrDialogDrag
+          v-model:show="state.logs.showFilter"
+          title="高级查询"
+          :show-submit="false"
+          :show-close="false"
+          class="w-[500px]"
+          :layout="{ mouse: true }"
+        >
+          <div>
+            <CzrForm>
+              <CzrFormColumn
+                :span="24"
+                label="消息ID"
+                v-model:param="state.logs.texts.p1"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="24"
+                label="会话ID"
+                v-model:param="state.logs.texts.p2"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="24"
+                label="用户ID"
+                v-model:param="state.logs.texts.p3"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="24"
+                label="意图识别"
+                v-model:param="state.logs.texts.p4"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="24"
+                label="输入"
+                v-model:param="state.logs.texts.p5"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="24"
+                label="输出"
+                v-model:param="state.logs.texts.p6"
+                placeholder="输入内容以查询"
+              />
+              <CzrFormColumn
+                :span="13"
+                label="输入token"
+                v-model:param="state.logs.texts.p7"
+                link="number"
+                placeholder="token数量"
+              />
+              <CzrFormColumn
+                :span="11"
+                label="到"
+                label-width="40px"
+                v-model:param="state.logs.texts.p8"
+                link="number"
+                placeholder="token数量"
+              />
+              <CzrFormColumn
+                :span="13"
+                label="输出token"
+                v-model:param="state.logs.texts.p9"
+                link="number"
+                placeholder="token数量"
+              />
+              <CzrFormColumn
+                :span="11"
+                label="到"
+                label-width="40px"
+                v-model:param="state.logs.texts.p10"
+                link="number"
+                placeholder="token数量"
+              />
+              <CzrFormColumn
+                :span="13"
+                label="整体耗时(ms)"
+                v-model:param="state.logs.texts.p11"
+                link="number"
+                placeholder="输入耗时"
+              />
+              <CzrFormColumn
+                :span="11"
+                label="到"
+                label-width="40px"
+                v-model:param="state.logs.texts.p12"
+                link="number"
+                placeholder="输入耗时"
+              />
+            </CzrForm>
+          </div>
+        </CzrDialogDrag>
         <div class="log flex-1">
           <CzrContent
-            v-model:tableHead="state.query.head"
+            v-model:tableHead="state.logs.query.head"
             @handleReset="onReset"
             @handleSearch="onSearch"
           >
+            <template #tableTitle>
+              <div class="flex flex-1 gap-2">
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="10%"
+                  label-width="0px"
+                  v-model:param="state.logs.query.form.dateType"
+                  link="select"
+                  :options="[
+                    { label: '近7天', value: 1 },
+                    { label: '近30天', value: 2 },
+                    { label: '近90天', value: 3 },
+                    { label: '近180天', value: 4 },
+                  ]"
+                  placeholder="应用状态"
+                />
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="10%"
+                  label-width="0px"
+                  v-model:param="state.logs.query.form.p1"
+                  link="select"
+                  :options="[]"
+                  placeholder="反馈"
+                />
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="10%"
+                  label-width="0px"
+                  v-model:param="state.logs.query.form.p1"
+                  link="select"
+                  :options="[]"
+                  placeholder="回答效果"
+                />
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="10%"
+                  label-width="0px"
+                  v-model:param="state.logs.query.form.p1"
+                  link="select"
+                  :options="[]"
+                  placeholder="渠道"
+                />
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="24%"
+                  label-width="0px"
+                  v-model:param="state.logs.query.form.p2"
+                  link="datetime"
+                  type="datetimerange"
+                  placeholder="请求时间"
+                />
+                <CzrFormColumn
+                  class="__czr-table-form-column"
+                  width="15%"
+                  label-width="0px"
+                  v-model:param="state.logs.texts.keyword"
+                  placeholder="输入关键词以检索"
+                  :prefix-icon="Search"
+                />
+              </div>
+            </template>
+            <template #buttons>
+              <div
+                class="__hover flex h-9 w-9 items-center justify-center rounded-sm bg-[var(--czr-main-color)]"
+                @click="state.logs.showFilter = true"
+              >
+                <SvgIcon name="filter" color="#ffffff" />
+              </div>
+            </template>
             <template #table>
               <CzrTable
-                v-loading="state.query.loading"
-                :data="state.query.result.data"
-                :head="state.query.head"
-                :total="state.query.result.total"
-                :page="state.query.page.pageNum"
-                :pageSize="state.query.page.pageSize"
+                v-loading="state.logs.query.loading"
+                :data="state.logs.query.result.data"
+                :head="state.logs.query.head"
+                :total="state.logs.query.result.total"
+                :page="state.logs.query.page.pageNum"
+                :pageSize="state.logs.query.page.pageSize"
                 @handlePage="onPage"
-                v-model:selected="state.query.selected"
+                v-model:selected="state.logs.query.selected"
               >
               </CzrTable>
             </template>
@@ -94,6 +258,9 @@ import { useDictionaryStore } from '@/stores'
 import { YMDHms } from '@/utils/czr-util'
 import { debounce } from 'lodash'
 import { documentGetDocumentsByPage } from '@/api/modules/knowledge/document'
+import { Search } from '@element-plus/icons-vue'
+import CzrDialogDrag from '@/components/czr-ui/CzrDialogDrag.vue'
+import CzrContent from '@/components/czr-ui/CzrContent.vue'
 
 const DictionaryStore = useDictionaryStore()
 const route = useRoute()
@@ -105,46 +272,48 @@ const state: any = reactive({
   ID: route.params.id,
   tab: 2,
   detail: {},
-  texts: {
-    keyword: '',
-  },
-  query: {
-    init: false,
-    loading: false,
-    head: [
-      { value: 'p1', label: '消息ID', show: false },
-      { value: 'p1', label: '会话ID', show: false },
-      { value: 'p1', label: '用户ID', show: false },
-      { value: 'p1', label: '意图识别', show: true },
-      { value: 'p1', label: '输入', show: true },
-      { value: 'p1', label: '输出', show: true },
-      { value: 'p1', label: '输入Token', show: true },
-      { value: 'p1', label: '输出Token', show: true },
-      { value: 'p1', label: '请求时间', show: true },
-      { value: 'p1', label: '整体耗时', show: true },
-      { value: 'p1', label: '反馈', show: true },
-      { value: 'p1', label: '回答效果', show: true },
-      { value: 'p1', label: '渠道', show: true },
-      {
-        value: 'caozuo',
-        label: '操作',
-        show: true,
-        width: 100,
-        fixed: 'right',
-        popover: false,
+  analysis: {},
+  logs: {
+    texts: {},
+    query: {
+      init: false,
+      loading: false,
+      head: [
+        { value: 'p1', label: '消息ID', show: false },
+        { value: 'p1', label: '会话ID', show: false },
+        { value: 'p1', label: '用户ID', show: false },
+        { value: 'p1', label: '意图识别', show: true },
+        { value: 'p1', label: '输入', show: true },
+        { value: 'p1', label: '输出', show: true },
+        { value: 'p1', label: '输入token', show: true },
+        { value: 'p1', label: '输出token', show: true },
+        { value: 'p1', label: '请求时间', show: true },
+        { value: 'p1', label: '整体耗时', show: true },
+        { value: 'p1', label: '反馈', show: true },
+        { value: 'p1', label: '回答效果', show: true },
+        { value: 'p1', label: '渠道', show: true },
+        {
+          value: 'caozuo',
+          label: '操作',
+          show: true,
+          width: 100,
+          fixed: 'right',
+          popover: false,
+        },
+      ],
+      page: {
+        pageNum: 1,
+        pageSize: 20,
       },
-    ],
-    page: {
-      pageNum: 1,
-      pageSize: 20,
-    },
-    form: {},
-    formReal: {},
-    result: {
-      total: 0,
-      data: [],
+      form: {},
+      formReal: {},
+      result: {
+        total: 0,
+        data: [],
+      },
+      selected: [],
     },
-    selected: [],
+    showFilter: false,
   },
 })
 const initDetail = () => {
@@ -185,19 +354,22 @@ const initStatistic = () => {
   // }, 1000)
 }
 
-const setTexts = debounce((v) => {
-  // state.query.form[k] = v
+const setTexts = debounce((obj) => {
+  Object.entries(obj).forEach(([k, v]) => {
+    state.logs.query.form[k] = v
+  })
 }, 1000)
 watch(
-  () => state.texts,
+  () => state.logs.texts,
   (n) => {
     setTexts(n)
   },
+  { deep: true },
 )
 watch(
-  () => state.query.form,
+  () => state.logs.query.form,
   (n) => {
-    if (state.query.init) {
+    if (state.logs.query.init) {
       onSearch()
     }
   },
@@ -205,49 +377,55 @@ watch(
 )
 const onPage = (pageNum, pageSize) => {
   setTimeout(() => {
-    state.query.init = true
+    state.logs.query.init = true
   }, 100)
-  state.query.page = {
+  state.logs.query.page = {
     pageNum: pageNum,
     pageSize: pageSize,
   }
   const params = {
-    page: state.query.page.pageNum,
-    size: state.query.page.pageSize,
+    page: state.logs.query.page.pageNum,
+    size: state.logs.query.page.pageSize,
   }
   //  添加表单参数
-  for (const [k, v] of Object.entries(state.query.formReal)) {
+  for (const [k, v] of Object.entries(state.logs.query.formReal)) {
     if (proxy.$czrUtil.isValue(v)) {
       params[k] = v
     }
   }
-  state.query.loading = true
-  documentGetDocumentsByPage(params)
-    .then(({ data }: any) => {
-      state.query.result.total = data.totalElements
-      state.query.result.data = data.content
-    })
-    .catch(() => {})
-    .finally(() => {
-      state.query.loading = false
-    })
+  console.log(params)
+  // state.logs.query.loading = true
+  // documentGetDocumentsByPage(params)
+  //   .then(({ data }: any) => {
+  //     state.logs.query.result.total = data.totalElements
+  //     state.logs.query.result.data = data.content
+  //   })
+  //   .catch(() => {})
+  //   .finally(() => {
+  //     state.logs.query.loading = false
+  //   })
 }
 const onSearch = () => {
-  state.query.selected = []
-  state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
-  onPage(1, state.query.page.pageSize)
+  state.logs.query.selected = []
+  state.logs.query.formReal = JSON.parse(JSON.stringify(state.logs.query.form))
+  onPage(1, state.logs.query.page.pageSize)
 }
 const onReset = () => {
-  state.query.page = {
+  state.logs.query.page = {
     pageNum: 1,
     pageSize: 20,
   }
-  state.query.form = {}
+  state.logs.query.form = {
+    dateType: 1,
+  }
+  state.logs.texts = {}
+  state.logs.query.init = false
   onSearch()
 }
 onMounted(() => {
   initDictionary()
   initDetail()
+  onReset()
 })
 const initDictionary = () => {
   // DictionaryStore.initModelProvides()