-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: Optimize copywriting and style #2718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,80 +5,81 @@ | |
</template> | ||
<div class="create-dataset__main flex" v-loading="loading"> | ||
<div class="create-dataset__component main-calc-height"> | ||
<el-scrollbar> | ||
<div class="upload-document p-24"> | ||
<h4 class="title-decoration-1 mb-8"> | ||
{{ $t('views.document.feishu.selectDocument') }} | ||
</h4> | ||
<el-form | ||
ref="FormRef" | ||
:model="form" | ||
:rules="rules" | ||
label-position="top" | ||
require-asterisk-position="right" | ||
> | ||
<div class="mt-16 mb-16"> | ||
<el-radio-group v-model="form.fileType" class="app-radio-button-group"> | ||
<el-radio-button value="txt" | ||
>{{ $t('views.document.fileType.txt.label') }} | ||
</el-radio-button> | ||
</el-radio-group> | ||
<div class="upload-document p-24"> | ||
<h4 class="title-decoration-1 mb-8"> | ||
{{ $t('views.document.feishu.selectDocument') }} | ||
</h4> | ||
<el-form | ||
ref="FormRef" | ||
:model="form" | ||
:rules="rules" | ||
label-position="top" | ||
require-asterisk-position="right" | ||
> | ||
<div class="mt-16 mb-16"> | ||
<el-radio-group v-model="form.fileType" class="app-radio-button-group"> | ||
<el-radio-button value="txt" | ||
>{{ $t('views.document.fileType.txt.label') }} | ||
</el-radio-button> | ||
</el-radio-group> | ||
</div> | ||
<div class="update-info flex p-8-12 border-r-4 mb-16"> | ||
<div class="mt-4"> | ||
<AppIcon iconName="app-warning-colorful" style="font-size: 16px"></AppIcon> | ||
</div> | ||
<div class="update-info flex p-8-12 border-r-4 mb-16"> | ||
<div class="mt-4"> | ||
<AppIcon iconName="app-warning-colorful" style="font-size: 16px"></AppIcon> | ||
</div> | ||
<div class="ml-16 lighter"> | ||
<p>{{ $t('views.document.feishu.tip1') }}</p> | ||
<p>{{ $t('views.document.feishu.tip2') }}</p> | ||
</div> | ||
<div class="ml-16 lighter"> | ||
<p>{{ $t('views.document.feishu.tip1') }}</p> | ||
<p>{{ $t('views.document.feishu.tip2') }}</p> | ||
</div> | ||
<div class="card-never border-r-4 mb-16"> | ||
<el-checkbox | ||
v-model="allCheck" | ||
:label="$t('views.document.feishu.allCheck')" | ||
size="large" | ||
class="ml-24" | ||
@change="handleAllCheckChange" | ||
/> | ||
</div> | ||
|
||
<el-tree | ||
:props="props" | ||
:load="loadNode" | ||
lazy | ||
show-checkbox | ||
node-key="token" | ||
ref="treeRef" | ||
> | ||
<template #default="{ node, data }"> | ||
<div class="custom-tree-node flex align-center lighter"> | ||
<img | ||
src="@/assets/fileType/file-icon.svg" | ||
alt="" | ||
height="20" | ||
v-if="data.type === 'folder'" | ||
/> | ||
<img | ||
src="@/assets/fileType/docx-icon.svg" | ||
alt="" | ||
height="22" | ||
v-else-if="data.type === 'docx'" | ||
/> | ||
<img | ||
src="@/assets/fileType/xlsx-icon.svg" | ||
alt="" | ||
height="22" | ||
v-else-if="data.type === 'sheet'" | ||
/> | ||
|
||
<span class="ml-4">{{ node.label }}</span> | ||
</div> | ||
</template> | ||
</el-tree> | ||
</el-form> | ||
</div> | ||
</el-scrollbar> | ||
</div> | ||
<div class="card-never border-r-4 mb-16"> | ||
<el-checkbox | ||
v-model="allCheck" | ||
:label="$t('views.document.feishu.allCheck')" | ||
size="large" | ||
class="ml-24" | ||
@change="handleAllCheckChange" | ||
/> | ||
</div> | ||
<div style="height:calc(100vh - 430px)"> | ||
<el-scrollbar> | ||
<el-tree | ||
:props="props" | ||
:load="loadNode" | ||
lazy | ||
show-checkbox | ||
node-key="token" | ||
ref="treeRef" | ||
> | ||
<template #default="{ node, data }"> | ||
<div class="custom-tree-node flex align-center lighter"> | ||
<img | ||
src="@/assets/fileType/file-icon.svg" | ||
alt="" | ||
height="20" | ||
v-if="data.type === 'folder'" | ||
/> | ||
<img | ||
src="@/assets/fileType/docx-icon.svg" | ||
alt="" | ||
height="22" | ||
v-else-if="data.type === 'docx'" | ||
/> | ||
<img | ||
src="@/assets/fileType/xlsx-icon.svg" | ||
alt="" | ||
height="22" | ||
v-else-if="data.type === 'sheet'" | ||
/> | ||
|
||
<span class="ml-4">{{ node.label }}</span> | ||
</div> | ||
</template> | ||
</el-tree> | ||
</el-scrollbar> | ||
</div> | ||
</el-form> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="create-dataset__footer text-right border-t"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code snippet you provided is missing some closing tags and formatting. Here are a few suggestions to address these issues:
Here's the corrected version: <template>
<!-- ... previous code -->
</template>
<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
// component setup logic here
});
</script>
<style scoped>
/* add styles here */
.create-dataset__footer {
/* existing styles */
}
</style> Ensure that any custom Vue.js directives or functions used inside the script section work as expected as well. If there are more specific rules or requirements related to Vue.js template syntax or functionality changes since October 2021, let me know! |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
<span class="dialog-footer"> | ||
<el-button @click.prevent="dialogVisible = false"> {{ $t('common.cancel') }} </el-button> | ||
<el-button type="primary" @click="submit(fieldFormRef)" :loading="loading"> | ||
{{ isEdit ? $t('common.save') : $t('common.add') }} | ||
{{ $t('common.add') }} | ||
</el-button> | ||
</span> | ||
</template> | ||
|
@@ -34,14 +34,11 @@ import { reactive, ref, watch } from 'vue' | |
import type { FormInstance } from 'element-plus' | ||
import { cloneDeep } from 'lodash' | ||
import { t } from '@/locales' | ||
import functionLibApi from '@/api/function-lib' | ||
import { MsgSuccess } from '@/utils/message' | ||
|
||
const emit = defineEmits(['refresh']) | ||
|
||
const fieldFormRef = ref() | ||
const loading = ref<boolean>(false) | ||
const isEdit = ref(false) | ||
|
||
const form = ref<any>({ | ||
name: '' | ||
|
@@ -64,14 +61,12 @@ watch(dialogVisible, (bool) => { | |
form.value = { | ||
name: '' | ||
} | ||
isEdit.value = false | ||
} | ||
}) | ||
|
||
const open = (row: any) => { | ||
if (row) { | ||
form.value = cloneDeep(row) | ||
isEdit.value = true | ||
} | ||
|
||
dialogVisible.value = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The provided code contains an issue with the Here’s the corrected version of your code: @@ -23,7 +23,7 @@
<span class="dialog-footer">
<el-button @click.prevent="dialogVisible = false"> {{ $t('common.cancel') }} </el-button>
<el-button type="primary" @click="submit(fieldFormRef)" :loading="loading">
- {{ isEdit ? $t('common.save') : $t('common.add') }}
+ {{ $t('common.add') }}
</el-button>
</span>
</template>
@@ -34,15 +34,11 @@ import { reactive, ref, watch } from 'vue'
import type { FormInstance } from 'element-plus'
import { cloneDeep } from 'lodash'
import { t } from '@/locales'
-import functionLibApi from '@/api/function-lib'
-import { MsgSuccess } from '@/utils/message'
const emit = defineEmits(['refresh'])
const fieldFormRef = ref()
const loading = ref<boolean>(false)
const form = ref<any>({
name: ''
})
watch(dialogVisible, (bool) => {
form.value = {
name: ''
}
}) Additionally, I recommend you move the call to Here’s how you can adjust the code: watch(dialogVisible, (bool) => {
if (bool && row) {
form.value = cloneDeep(row)
}
form.value = {
name: ''
// Remove the line below as it doesn't need to be here
// isEdit.value = bool // Assuming you want to reflect visibility status here somehow
}
}) In summary:
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes you've made look generally accurate but there might be some subtle issues to consider:
Duplicate
add
andmodifySuccess
: In the original code, both "add" and "modifySuccess" were identical. This can cause confusion in certain contexts. You could remove one of them.Consistency with Naming Conventions: Ensure that all keys consistently have consistent naming styles. While this doesn't affect function, it's good practice for consistency across your translation files.
Correct Key Order: The order of properties is not strictly necessary for functionality, but maintaining a logical sequence can make the file easier to read and manage.
Here’s an optimized version of your code:
These adjustments ensure clarity and maintainability of the translations.