liudong
2024-08-01 4fdfacbe067d10cc1adfe5a9a3f9ea4495ba5f4d
src/views/dmx/knowledgeLib/tool.vue
@@ -7,14 +7,19 @@
  </a-button>
  <a-modal
    v-model:visible="visible"
    title="解析方法"
    title=" "
    @before-open="handleOpened"
    @cancel="handleCancel"
    @opened="handleOpened"
    :footer="false"
    title-align="start"
    width="700px"
    width="900px"
  >
      <a-tabs default-active-key="1">
        <a-tab-pane key="1">
          <template #title>
            <icon-calendar/> 解析方法
          </template>
          <div style="width: 100%">
  <div style="display: flex;align-items: center;">
    <div>
      解析方法:
@@ -25,6 +30,7 @@
      </a-select>
    </div>
  </div>
            <div class="parser">
    <a-form ref="formRef" :rules="rules" :model="form"  auto-label-width @submit="handleSubmit" >
      <a-divider style="margin-top: 10px" />
      <a-form-item field="slider" label="块token数"
@@ -72,6 +78,112 @@
        </div>
      </a-form-item>
    </a-form>
            </div>
          </div>
        </a-tab-pane>
        <a-tab-pane key="2">
          <template #title>
            <icon-clock-circle/> 创建解析块
          </template>
          <div class="details">
            <div class="details-header">
              <div style="display: flex; align-items: center;justify-content: flex-end;">
                <a-radio-group v-model="radio" type="button"  style="margin-right: 10px" @change="onRadioChange">
                  <a-radio value="1">全文</a-radio>
                  <a-radio value="2">省略</a-radio>
                </a-radio-group>
                <a-popover position="bottom">
                  <a-button type="outline" class="button" style="margin-right: 10px;">批量<icon-down style="margin-left: 4px" /></a-button>
                  <template #content>
                    <a-space direction="vertical">
                      <a-checkbox :model-value="checkedAll" :indeterminate="indeterminate" @change="handleChangeAll" style="margin-left: 10px">
                        选择所有
                      </a-checkbox>
                    </a-space>
                    <a-divider style="margin: 10px 0" />
                    <p>
                      <a-button type="text" class="button" style="color: #2a2a2b">
                        <template #icon>
                          <icon-check-circle />
                        </template>
                        启用选定的
                      </a-button>
                    </p>
                    <p>
                      <a-button type="text" class="button" style="color: #2a2a2b">
                        <template #icon>
                          <icon-close-circle />
                        </template>
                        禁用选定的
                      </a-button>
                    </p>
                    <a-divider style="margin: 10px 0" />
                    <p>
                      <a-button type="text" class="button" style="color: #2a2a2b">
                        <template #icon>
                          <icon-delete />
                        </template>
                        删除选定的
                      </a-button>
                    </p>
                  </template>
                </a-popover>
                <a-button type="outline" class="button" style="margin-right: 10px">
                  <template #icon>
                    <icon-search />
                  </template>
                </a-button>
                <a-popover position="bottom">
                  <a-button type="outline" class="button" style="margin-right: 10px"><icon-sort /></a-button>
                  <template #content>
                    <a-radio-group v-model="available_int" direction="vertical" size="large" @change="onChangeavailable">
                      <a-radio value="">所有</a-radio>
                      <a-radio value="1">启用</a-radio>
                      <a-radio value="0">禁用</a-radio>
                    </a-radio-group>
                  </template>
                </a-popover>
                <addDetails></addDetails>
              </div>
            </div>
            <a-divider style="margin-top: 10px" />
            <div class="groupMain">
              <a-checkbox-group v-model="data" @change="handleChange" >
                <div class="groupList" :style="{background:keyBg=='1'?'#eff8ff':'white'}">
                  <a-checkbox  value="1"></a-checkbox>
                  <div class="groupList-content" @click="groupListContentClick('1')">
                    而 stable version 是最新稳定版,经过充分测试和验证,bug 较少,
                    适合用于生产环境。其版本号通常为双数,如 1.26。legacy versions
                    则是之前发布的稳定版,对于需要
                    特定旧版本的兼容性或安全性支持的用户有用,但一般不
                    推荐用于新项目,除非有特殊需求。在实际使用中,如果追求最新功能
                    且愿意面对可能存在的一些不稳定因素,可以尝试使用主线版本进行测试和研究;如果是用于生产环境
                  </div>
                  <div class="groupList-right">
                    <a-switch v-model="switchType"  checked-value="1" unchecked-value="0" @change="handleChangeStatus()"/>
                  </div>
                </div>
                <div class="groupList" :style="{background:keyBg=='2'?'#eff8ff':'white'}">
                  <a-checkbox  value="1"></a-checkbox>
                  <div class="groupList-content" @click="groupListContentClick('2')">
                    而 stable version 是最新稳定版,经过充分测试和验证,bug 较少,
                    适合用于生产环境。其版本号通常为双数,如 1.26。legacy versions
                    则是之前发布的稳定版,对于需要
                  </div>
                  <div class="groupList-right">
                    <a-switch v-model="switchType"  checked-value="1" unchecked-value="0" @change="handleChangeStatus()"/>
                  </div>
                </div>
              </a-checkbox-group>
            </div>
          </div>
        </a-tab-pane>
      </a-tabs>
  </a-modal>
</template>
@@ -79,8 +191,11 @@
import { onMounted, onBeforeMount, reactive, ref, computed } from "vue";
import { Message } from "@arco-design/web-vue";
import {kbdocumentchangeparser} from "@/api/kbList";
import addDetails from '@/views/dmx/knowledgeLib/addDetails.vue'
const visible = ref(false);
const loading = ref(false);
const radio = ref('1');
const keyBg = ref('');
const props =  defineProps(['kbtenantInfo','item','kbdetail'])
// const emit =  defineEmits(['upTabdateItem'])
@@ -165,25 +280,14 @@
const handleClick = () => {
  visible.value = true;
};
const handleBeforeOk = (done) => {
  formRef.value.validate().then(res => {
    console.log('form:', form)
    if (!form.name) {
      done(false)
    }else {
      console.log('请求数据');
    }
  })
};
const handleCancel = () => {
  visible.value = false;
}
const handleOpened =(el) => {
  console.log('props',props.kbtenantInfo);
  console.log('props',props.item);
  console.log('props',props.kbdetail);
  // console.log('props',props.kbtenantInfo);
  // console.log('props',props.item);
  // console.log('props',props.kbdetail);
  console.log(parser_ids, 'parser_ids');
  // Object.assign(form,{
  //   name: '',// 用户名
@@ -194,9 +298,66 @@
  // formRef.value.resetFields();
}
const onChangeRAPTOR = () => {
};
const indeterminate = ref(false)
const checkedAll = ref(false)
const data = ref([])
const switchType = ref(false)
const available_int = ref('')
const onRadioChange = () => {
  console.log(radio.value);
};
const handleChangeAll = (value) => {
  indeterminate.value = false;
  if (value) {
    checkedAll.value = true;
    data.value = ['1', '2', '3']
  } else {
    checkedAll.value = false;
    data.value = []
  }
}
const handleChange = (values) => {
  if (values.length === 3) {
    checkedAll.value = true
    indeterminate.value = false;
  } else if (values.length === 0) {
    checkedAll.value = false
    indeterminate.value = false;
  } else {
    checkedAll.value = false
    indeterminate.value = true;
  }
}
const groupListContentClick = (value) => {
  keyBg.value = value;
}
const onChangeavailable = ()=>{
  console.log(available_int.value);
}
const handleChangeStatus = ()=>{
  console.log(switchType.value);
}
onBeforeMount(()=>{
@@ -207,11 +368,45 @@
})
</script>
<script lang="ts">
export default {
  name: 'add',
  methods: {
<style scoped lang="less">
.parser{
  width: 100%;
  ::v-deep .arco-btn-outline:hover, .arco-btn-outline, .arco-btn-outline[type='button']{
    color: #2a2a2b;
    border: 1px solid #2a2a2b;
  }
  .button{
    //color: #2a2a2b!important;
  }
}
.groupMain{
  width: 100%;
  height: 500px;
  overflow: auto;
  display: flex;
  justify-content: center;
  .groupList{
    display: flex;
    padding: 24px;
    border-radius: 8px;
    //background: #eff8ff;
    border: 1px solid #f0f0f0;
    margin-bottom: 20px;
    overflow: auto;
    .groupList-content{
      width: 700px;
      //height: 100px;
      overflow: auto;
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      color: rgba(0, 0, 0, 0.88);
      font-size: 14px;
      font-family: Inter;
      position: relative;
  }
};
</script>
  }
}
</style>