From 301b1a3bbc7e26e10d1118512cdd0226bd9c0b5f Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期三, 24 七月 2024 19:49:29 +0800 Subject: [PATCH] 知识库配置页面修改 --- src/views/dmx/knowledgeLib/test.vue | 277 +++++++++++++++++++++++ src/views/dmx/knowledgeLib/index.vue | 54 +-- src/views/dmx/knowledgeLib/config.vue | 376 +++++++++++++++++++++++++++++++ 3 files changed, 674 insertions(+), 33 deletions(-) diff --git a/src/views/dmx/knowledgeLib/config.vue b/src/views/dmx/knowledgeLib/config.vue new file mode 100644 index 0000000..bf5e1be --- /dev/null +++ b/src/views/dmx/knowledgeLib/config.vue @@ -0,0 +1,376 @@ +<template> + <div class="main-container"> + <div class="main-container-lf"> + <div class="main-container-lf-down"> + <div style="margin-bottom: 10px">閰嶇疆</div> + <div style="color: #999;">鍦ㄨ繖閲屾洿鏂版偍鐨勭煡璇嗗簱璇︾粏淇℃伅锛屽挨鍏舵槸瑙f瀽鏂规硶銆�</div> + <a-divider style="margin-top: 10px" /> + <a-form ref="formRef" :size="form.size" :model="form" :style="{width:'100%'}" layout="vertical" + @submit="handleSubmit"> + <a-form-item field="name" label="鐭ヨ瘑搴撳悕绉�" + :rules="[{required:true,message:'name is required'},{minLength:5,message:'must be greater than 5 characters'}]" + :validate-trigger="['change','input']" + > + <a-input v-model="form.name" placeholder="璇疯緭鍏�" /> + </a-form-item> + <a-form-item field="section" label="鐭ヨ瘑搴撳浘鐗�"> + <a-space direction="vertical" :style="{ width: '100%' }"> + <a-upload + action="/" + :fileList="file ? [file] : []" + :show-file-list="false" + @change="onChange" + @progress="onProgress" + > + <template #upload-button> + <div + :class="`arco-upload-list-item${ + file && file.status === 'error' ? ' arco-upload-list-item-error' : '' + }`" + > + <div + class="arco-upload-list-picture custom-upload-avatar" + v-if="file && file.url" + > + <img :src="file.url" /> + <div class="arco-upload-list-picture-mask"> + <IconEdit /> + </div> + <a-progress + v-if="file.status === 'uploading' && file.percent < 100" + :percent="file.percent" + type="circle" + size="mini" + :style="{ + position: 'absolute', + left: '50%', + top: '50%', + transform: 'translateX(-50%) translateY(-50%)', + }" + /> + </div> + <div class="arco-upload-picture-card" v-else> + <div class="arco-upload-picture-card-text"> + <IconPlus /> + <div style="margin-top: 10px; font-weight: 600">涓婁紶</div> + </div> + </div> + </div> + </template> + </a-upload> + </a-space> + </a-form-item> + <a-form-item field="section" label="鎻忚堪"> + <a-textarea placeholder="" allow-clear /> + </a-form-item> + <a-form-item field="section" label="璇█" :rules="[{match:/section one/,message:'璇烽�夋嫨'}]"> + <a-select v-model="form.section" placeholder="璇烽�夋嫨" allow-clear> + <a-option value="0">涓枃</a-option> + <a-option value="1">鑻辨枃</a-option> + </a-select> + </a-form-item> + <a-form-item field="section" label="宓屽叆妯″瀷" :rules="[{match:/section one/,message:'璇烽�夋嫨'}]"> + <a-select v-model="form.section" placeholder="璇烽�夋嫨" allow-clear> + <a-option value="section one">Section One</a-option> + <a-option value="section two">Section Two</a-option> + <a-option value="section three">Section Three</a-option> + </a-select> + </a-form-item> + <a-form-item field="section" label="瑙f瀽鏂规硶" :rules="[{match:/section one/,message:'璇烽�夋嫨'}]"> + <a-select v-model="form.section" placeholder="璇烽�夋嫨" allow-clear> + <a-option value="section one">Section One</a-option> + <a-option value="section two">Section Two</a-option> + <a-option value="section three">Section Three</a-option> + </a-select> + </a-form-item> + <a-form-item field="slider" label="鍧桾oken鏁�" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.score" :max="10" /> + <a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}" placeholder="Please Enter" class="input-demo" :min="10" :max="1000"/> + </a-form-item> + <a-form-item field="slider" label="甯冨眬璇嗗埆" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-space direction="vertical" size="large"> + <a-switch v-model="form.score" checked-value="yes" unchecked-value="no" /> + </a-space> + </a-form-item> + <a-form-item field="raptor" label="浣跨敤鍙洖澧炲己RAPTOR绛栫暐"> + <a-space direction="vertical" size="large"> + <a-switch v-model="form.raptor" @change="onChangeRAPTOR" /> + </a-space> + </a-form-item> + <div v-if="form.raptor"> + <a-form-item field="section" label="鎻愮ず璇�"> + <a-textarea style="height: 10rem;border: 1px solid var(--color-fill-3);border-radius: 4px" placeholder="" allow-clear/> + </a-form-item> + <a-form-item field="slider" label="鏈�澶oken鏁�" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.score" :max="10" /> + <a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}" placeholder="Please Enter" class="input-demo" :min="10" :max="1000"/> + </a-form-item> + <a-form-item field="slider" label="闃堝��" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.score" :max="10" /> + <a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}" placeholder="Please Enter" class="input-demo" :min="10" :max="1000"/> + </a-form-item> + <a-form-item field="slider" label="鏈�澶ц仛绫绘暟" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.score" :max="10" /> + <a-input-number v-model="form.score" :style="{width:'100px',marginLeft:'2rem',borderRadius:'4px'}" placeholder="Please Enter" class="input-demo" :min="10" :max="1000"/> + </a-form-item> + <a-form-item field="slider" label="闅忔満绉嶅瓙" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-input-number v-model="form.score" :style="{width:'300px',marginRight:'1rem',borderRadius:'4px'}" placeholder="璇疯緭鍏�" class="input-demo" :min="10" :max="100"/> + <a-button type="primary" @click=""><icon-plus /></a-button> + + </a-form-item> + + </div> + + + + + + + + + <a-form-item> + <div style="width: 100%;text-align: right"> + <a-space> + <a-button type="primary" html-type="submit">淇濆瓨</a-button> + <!-- <a-button @click="$refs.formRef.resetFields()">Reset</a-button>--> + </a-space> + </div> + </a-form-item> + </a-form> + </div> + </div> + <div class="main-container-rt"> + + </div> + </div> +</template> + +<script lang="ts" setup> +import { onMounted, onBeforeMount, reactive, ref } from "vue"; +import { Message } from "@arco-design/web-vue"; + +const props = defineProps({ + record: { + type: Object, + default: () => { + return {}; + } + } +}); + + +const visible = ref(false); +const configIsShow = ref(false); +const loading = ref(false); +const formRef = ref(null); + + +const form = reactive({ + size: "medium", + name: "", + age: undefined, + section: "0", + province: "haidian", + options: [], + date: "", + time: "", + radio: "radio one", + slider: 5, + score: 5, + switch: false, + multiSelect: ["section one"], + treeSelect: "", + raptor: false +}); +const options = [ + { + value: "beijing", + label: "Beijing", + children: [ + { + value: "chaoyang", + label: "ChaoYang", + children: [ + { + value: "datunli", + label: "Datunli" + } + ] + }, + { + value: "haidian", + label: "Haidian" + }, + { + value: "dongcheng", + label: "Dongcheng" + }, + { + value: "xicheng", + label: "XiCheng" + } + ] + }, + { + value: "shanghai", + label: "Shanghai", + children: [ + { + value: "shanghaishi", + label: "Shanghai", + children: [ + { + value: "huangpu", + label: "Huangpu" + } + ] + } + ] + } +]; + + +const sayHello = () => { + Message.info("hello"); +}; + +const file = ref(); + +const onChange = (_, currentFile) => { + file.value = { + ...currentFile + // url: URL.createObjectURL(currentFile.file), + }; +}; +const onProgress = (currentFile) => { + file.value = currentFile; +}; + + +const handleSubmit = ({ values, errors }) => { + console.log("values:", values, "\nerrors:", errors); +}; + + +const onChangeRAPTOR = () => { + console.log(form.raptor); +}; + + +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) => { + Object.assign(form, { + name: "",// 鐢ㄦ埛鍚� + nameJoin: "",// 鏄电О + post: "",// 宀椾綅 + txt: ""// 澶囨敞 + }); + formRef.value.resetFields(); + console.log(props.record, "record"); + // if(props.edit == 'edit'){ + // Object.assign(form,props.record); + // } +}; + +onBeforeMount(() => { + +}); +onMounted(() => { + + +}); +</script> + +<script lang="ts"> +import { IconEdit, IconPlus } from "@arco-design/web-vue/es/icon"; + +export default { + name: "config", + components: { IconPlus, IconEdit }, + methods: {} +}; +</script> +<style scoped lang="less"> +.main-container { + display: flex; + justify-content: space-between; + height: 100%; + overflow: auto; + //background: #626aea; + background: #ffffff; + &-lf { + width: 40%; + //height: 100%; + //border: 1px solid #cccccc; + border-radius: 10px; + + &-top { + width: 100%; + height: 60px; + line-height: 60px; + //background: rgb(var(--primary-6)); + //color: #ffffff; + //text-align: center; + } + + &-down { + padding: 20px; + width: 100%; + } + } + + &-form-item-extra { + width: 100%; + height: 20rem; + border: 1px solid var(--color-fill-3); + border-radius: 6px; + overflow: hidden; + + &-top { + width: 100%; + height: 40px; + line-height: 40px; + border-bottom: 1px solid var(--color-fill-3); + //background: rgb(var(--primary-6)); + color: #999999; + text-align: center; + } + + &-down { + width: 92%; + margin-left: 4%; + margin-top: 30px; + } + + &-btn { + width: 96%; + text-align: right; + margin-top: 1rem; + } + } + + &-rt { + width: 60%; + //background: #626aea; + //border: 1px solid #cccccc; + border-radius: 10px; + } +} +</style> \ No newline at end of file diff --git a/src/views/dmx/knowledgeLib/index.vue b/src/views/dmx/knowledgeLib/index.vue index aa5d815..7680fec 100644 --- a/src/views/dmx/knowledgeLib/index.vue +++ b/src/views/dmx/knowledgeLib/index.vue @@ -263,12 +263,12 @@ </a-tab-pane> <a-tab-pane key="2" title="娴嬭瘯"> <div class="rt-container-main"> - + <test ></test> </div> </a-tab-pane> <a-tab-pane key="3" title="閰嶇疆"> <div class="rt-container-main"> - + <config ></config> </div> </a-tab-pane> </a-tabs> @@ -287,7 +287,9 @@ import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; import cloneDeep from 'lodash/cloneDeep'; import Sortable from 'sortablejs'; - import add from '@/views/user/account/add.vue' + import add from '@/views/dmx/knowledgeLib/add.vue' + import config from '@/views/dmx/knowledgeLib/config.vue' + import test from '@/views/dmx/knowledgeLib/test.vue' import { deleteAccount } from "@/api/account"; type SizeProps = 'mini' | 'small' | 'medium' | 'large'; type Column = TableColumnData & { checked?: true }; @@ -344,43 +346,29 @@ // dataIndex: 'index', // slotName: 'index', // }, - // { - // title: t('searchTable.columns.number'), - // dataIndex: 'number', - // }, { - title: t('鐢ㄦ埛鍚�'), + title: t('鍚嶇О'), dataIndex: 'name', }, - // { - // title: t('searchTable.columns.contentType'), - // dataIndex: 'contentType', - // slotName: 'contentType', - // }, - // { - // title: t('searchTable.columns.filterType'), - // dataIndex: 'filterType', - // }, - // { - // title: t('searchTable.columns.count'), - // dataIndex: 'count', - // }, { - title: t('鍒涘缓鏃堕棿'), + title: t('鍒嗗揩鏁�'), + dataIndex: 'contentType', + slotName: 'contentType', + }, + { + title: t('涓婁紶鏃堕棿'), + dataIndex: 'filterType', + }, + { + title: t('鍒涘缓浜�'), + dataIndex: 'count', + }, + { + title: t('瑙f瀽鐘舵��'), dataIndex: 'createdTime', }, { - title: t('鎵�灞為儴闂�'), - dataIndex: 'filterType', - slotName: 'filterType', - }, - { - title: t('澶囨敞'), - dataIndex: 'status', - slotName: 'status', - }, - { - title: t('searchTable.columns.operations'), + title: t('鎿嶄綔'), dataIndex: 'operations', slotName: 'operations', }, diff --git a/src/views/dmx/knowledgeLib/test.vue b/src/views/dmx/knowledgeLib/test.vue new file mode 100644 index 0000000..4e77077 --- /dev/null +++ b/src/views/dmx/knowledgeLib/test.vue @@ -0,0 +1,277 @@ + +<template> + <div class="main-container"> + <div class="main-container-lf"> + <div class="main-container-lf-top">妫�绱㈡祴璇�</div> + <div class="main-container-lf-down"> + <div style="color: #999;">鏈�鍚庝竴姝ワ紒 鎴愬姛鍚庯紝鍓╀笅鐨勫氨浜ょ粰Infiniflow AI鍚с��</div> + <a-divider style="margin-top: 10px" /> + <a-form ref="formRef" :size="form.size" :model="form" :style="{width:'100%'}" layout="vertical" @submit="handleSubmit"> + <a-form-item field="slider" label="鐩镐技搴﹂槇鍊�" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.slider" :max="10" /> + </a-form-item> + <a-form-item field="slider" label="鍏抽敭瀛楃浉浼煎害鏉冮噸" :rules="[{type:'number', min:5,message:'slider is min than 5'}]"> + <a-slider v-model="form.score" :max="10" /> + </a-form-item> + <a-form-item field="section" label="Rerank妯″瀷" :rules="[{match:/section one/,message:'璇烽�夋嫨'}]"> + <a-select v-model="form.section" placeholder="璇烽�夋嫨" allow-clear> + <a-option value="section one">Section One</a-option> + <a-option value="section two">Section Two</a-option> + <a-option value="section three">Section Three</a-option> + </a-select> + </a-form-item> + <a-form-item field="section" :rules="[{match:/section one/,message:'璇烽�夋嫨'}]"> + <div class="main-container-form-item-extra"> + <div class="main-container-form-item-extra-top">娴嬭瘯鏂囨湰</div> + <div class="main-container-form-item-extra-down"> + <a-textarea style="height: 10rem;border: 1px solid var(--color-fill-3);border-radius: 4px" placeholder="" allow-clear/> + </div> + <div class="main-container-form-item-extra-btn"> + <a-button type="primary" html-type="submit">娴嬭瘯</a-button> + </div> + </div> + </a-form-item> +<!-- <a-form-item>--> +<!-- <a-space>--> +<!-- <a-button html-type="submit">Submit</a-button>--> +<!-- <a-button @click="$refs.formRef.resetFields()">Reset</a-button>--> +<!-- </a-space>--> +<!-- </a-form-item>--> + </a-form> + </div> + </div> + <div class="main-container-rt"> + <a-collapse style="width: 96%;margin-top: 1rem;margin-left: 2%"> +<!-- <a-collapse-item header="Beijing Toutiao Technology Co., Ltd." key="1">--> +<!-- <template #extra>--> +<!-- <icon-copy />--> +<!-- </template>--> +<!-- <div>Beijing Toutiao Technology Co., Ltd.</div>--> +<!-- <div>Beijing Toutiao Technology Co., Ltd.</div>--> +<!-- </a-collapse-item>--> +<!-- <a-collapse-item header="Beijing Toutiao Technology Co., Ltd." :key="2">--> +<!-- <template #extra>--> +<!-- <a-button type="primary" size="mini" @click.stop="sayHello">hello</a-button>--> +<!-- </template>--> +<!-- <div>Beijing Toutiao Technology Co., Ltd.</div>--> +<!-- <div>Beijing Toutiao Technology Co., Ltd.</div>--> +<!-- </a-collapse-item>--> + <a-collapse-item header="0/0 閫夊畾鐨勬枃浠�" key="3"> + <template #extra> + <a-tag size="small">鍛戒腑鏁�</a-tag> + <a-tag size="small">鐪嬫硶</a-tag> + </template> + <div> + <a-empty /> + </div> + </a-collapse-item> + </a-collapse> + </div> + </div> +</template> + +<script lang="ts" setup> +import { onMounted ,onBeforeMount, reactive, ref } from "vue"; +import { Message } from '@arco-design/web-vue'; + +const props = defineProps({ + record: { + type: Object, + default: () => { + return {} + } + } +}) + + + + +const visible = ref(false); +const loading = ref(false); +const formRef = ref(null); + + + +const form = reactive({ + size: 'medium', + name: '', + age: undefined, + section: '', + province: 'haidian', + options: [], + date: '', + time: '', + radio: 'radio one', + slider: 5, + score: 5, + switch: false, + multiSelect: ['section one'], + treeSelect: '' +}); +const options = [ + { + value: 'beijing', + label: 'Beijing', + children: [ + { + value: 'chaoyang', + label: 'ChaoYang', + children: [ + { + value: 'datunli', + label: 'Datunli', + }, + ], + }, + { + value: 'haidian', + label: 'Haidian', + }, + { + value: 'dongcheng', + label: 'Dongcheng', + }, + { + value: 'xicheng', + label: 'XiCheng', + }, + ], + }, + { + value: 'shanghai', + label: 'Shanghai', + children: [ + { + value: 'shanghaishi', + label: 'Shanghai', + children: [ + { + value: 'huangpu', + label: 'Huangpu', + }, + ], + }, + ], + }, +]; + + +const sayHello = () => { + Message.info('hello'); +}; + +const handleSubmit = ({values, errors}) => { + console.log('values:', values, '\nerrors:', errors) +} + +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) => { + Object.assign(form,{ + name: '',// 鐢ㄦ埛鍚� + nameJoin: '',// 鏄电О + post: '',// 宀椾綅 + txt: '',// 澶囨敞 + }); + formRef.value.resetFields(); + console.log(props.record, 'record'); + // if(props.edit == 'edit'){ + // Object.assign(form,props.record); + // } +} + +onBeforeMount(()=>{ + +}) +onMounted(()=>{ + + +}) +</script> + +<script lang="ts"> +export default { + name: 'config', + methods: { + + } +}; +</script> +<style scoped lang="less"> + .main-container{ + display: flex; + justify-content: space-between; + height: 100%; + //background: #626aea; + &-lf{ + width: 30%; + height: 100%; + //border: 1px solid #cccccc; + background: #ffffff; + border-radius: 10px; + overflow: hidden; + &-top{ + width: 100%; + height: 60px; + line-height: 60px; + background: rgb(var(--primary-6)); + color: #ffffff; + text-align: center; + } + &-down{ + padding: 20px; + width: 100%; + } + } + &-form-item-extra{ + width: 100%; + height: 20rem; + border: 1px solid var(--color-fill-3); + border-radius: 6px; + overflow: hidden; + &-top{ + width: 100%; + height: 40px; + line-height: 40px; + border-bottom: 1px solid var(--color-fill-3); + //background: rgb(var(--primary-6)); + color: #999999; + text-align: center; + } + &-down{ + width: 92%; + margin-left: 4%; + margin-top: 30px; + } + &-btn{ + width: 96%; + text-align: right; + margin-top: 1rem; + } + } + &-rt{ + width: 69%; + height: 100%; + //background: #626aea; + //border: 1px solid #cccccc; + background: #ffffff; + border-radius: 10px; + } + } +</style> \ No newline at end of file -- Gitblit v1.8.0