From bd82158c1ef6b3f71115bfc1d5fe77fb7c9287db Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期四, 25 七月 2024 19:01:01 +0800 Subject: [PATCH] 知识库操作功能开发以及解析方法的开发 --- src/views/dmx/knowledgeLib/edit.vue | 103 +++++++++------------------------------------------ 1 files changed, 19 insertions(+), 84 deletions(-) diff --git a/src/views/dmx/knowledgeLib/edit.vue b/src/views/dmx/knowledgeLib/edit.vue index 56fe9f9..808619a 100644 --- a/src/views/dmx/knowledgeLib/edit.vue +++ b/src/views/dmx/knowledgeLib/edit.vue @@ -1,25 +1,21 @@ <template> - <a-button type="primary" @click="handleClick"> + <a-button type="text" @click="handleClick" size="small"> <template #icon> - <icon-plus /> + <icon-edit /> </template> - 鏂板缓鏂囦欢 </a-button> - <a-modal v-model:visible="visible" title="涓婁紶鏂囦欢" @before-open="handleOpened" @cancel="handleCancel" @before-ok="handleBeforeOk" title-align="start"> + <a-modal v-model:visible="visible" title="閲嶅懡鍚�" @before-open="handleOpened" @cancel="handleCancel" :footer="false" title-align="start"> <a-form ref="formRef" :rules="rules" :model="form" @submit="handleSubmit" > - <a-form-item field="name" label="鐢ㄦ埛鍚�"> - + <a-form-item field="name" label="鍚嶇О"> + <a-input v-model="form.name" placeholder="璇疯緭鍏ュ悕绉�"/> </a-form-item> - <a-form-item label="澶囨敞"> - <a-textarea v-model="form.txt" placeholder="璇疯緭鍏�" allow-clear/> + <a-form-item> + <div style="width: 100%;text-align: right"> + <a-button @click="visible = false">鍙栨秷</a-button> + <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button> + </div> </a-form-item> -<!-- <a-form-item>--> -<!-- <div style="width: 100%;text-align: right">--> -<!-- <a-button @click="visible = false">鍙栨秷</a-button>--> -<!-- <a-button style="margin-left: 10px" type="primary" html-type="submit">纭畾</a-button>--> -<!-- </div>--> -<!-- </a-form-item>--> </a-form> </a-modal> </template> @@ -41,69 +37,8 @@ name: [ { required: true, - message:'鐢ㄦ埛鍚嶄笉鍏佽涓虹┖', + message:'鍚嶇О涓嶅厑璁镐负绌�', }, - ], - nameJoin: [ - { - required: true, - message:'鏄电О涓嶅厑璁镐负绌�', - }, - ], - password: [ - { - required: true, - message:'password is required', - }, - ], - password2: [ - { - required: true, - message:'password is required', - }, - { - validator: (value, cb) => { - if (value !== form.password) { - cb('two passwords do not match') - } else { - cb() - } - } - } - ], - email: [ - { - type: 'email', - required: true, - } - ], - ip: [ - { - type: 'ip', - required: true, - } - ], - url: [ - { - type: 'url', - required: true, - } - ], - match: [ - { - required: true, - validator: (value, cb) => { - return new Promise((resolve) => { - if (!value) { - cb('Please enter match') - } - if (value !== 'match') { - cb('match must be match!') - } - resolve() - }) - } - } ], } @@ -116,15 +51,15 @@ visible.value = true; }; const handleBeforeOk = (done) => { - formRef.value.validate().then(res => { - console.log('form:', form) - if (!form.name) { - done(false) - }else { - console.log('璇锋眰鏁版嵁'); + formRef.value.validate().then(res => { + console.log('form:', form) + if (!form.name) { + done(false) + }else { + console.log('璇锋眰鏁版嵁'); - } - }) + } + }) }; const handleCancel = () => { visible.value = false; -- Gitblit v1.8.0