【更新】前端代码进行大量的优化、缩减

pull/90/head
小诺 2023-03-12 01:42:38 +08:00 committed by 俞宝山
parent 46890f08c8
commit aea1fac10b
47 changed files with 430 additions and 589 deletions

View File

@ -163,9 +163,14 @@
* @param bool Boolean
*/
refresh(bool = false) {
bool && (this.localPagination = Object.assign({}, {
current: 1, size: this.size
}))
bool &&
(this.localPagination = Object.assign(
{},
{
current: 1,
size: this.size
}
))
this.loadData()
},
/**
@ -176,18 +181,29 @@
*/
loadData(pagination, filters, sorter) {
this.localLoading = true
const parameter = Object.assign({
current: (pagination && pagination.current) ||
this.showPagination && this.localPagination.current || this.pageNum,
size: (pagination && pagination.pageSize) ||
this.showPagination && this.localPagination.pageSize || this.pageSize || this.localPagination.size
const parameter = Object.assign(
{
current:
(pagination && pagination.current) ||
(this.showPagination && this.localPagination.current) ||
this.pageNum,
size:
(pagination && pagination.pageSize) ||
(this.showPagination && this.localPagination.pageSize) ||
this.pageSize ||
this.localPagination.size
},
(sorter && sorter.field && {
sortField: sorter.field
}) || {},
(sorter && sorter.order && {
sortOrder: sorter.order
}) || {}, {
(sorter &&
sorter.field && {
sortField: sorter.field
}) ||
{},
(sorter &&
sorter.order && {
sortOrder: sorter.order
}) ||
{},
{
...filters
}
)
@ -325,7 +341,7 @@
const needTotalItems = this.needTotalList.map((item) => {
return (
<span className="mr-3">
{item.title} 总计 {' '}
{item.title} 总计{' '}
<a className="font-6">{!item.customRender ? item.total : item.customRender(item.total)}</a>
</span>
)
@ -416,10 +432,8 @@
<div className="layout-items-center s-table-tool-right">
{this.toolConfig.striped ? (
<div className="layout-items-center ml-4">
<a-checkbox
checked={this.localSettings.rowClassNameSwitch}
onChange={changeRowClass}
>斑马纹
<a-checkbox checked={this.localSettings.rowClassNameSwitch} onChange={changeRowClass}>
斑马纹
</a-checkbox>
</div>
) : null}

View File

@ -92,7 +92,7 @@
import router from '@/router'
import { required, rules } from '@/utils/formRules'
import userCenterApi from '@/api/sys/userCenterApi'
import smCrypto from "@/utils/smCrypto"
import smCrypto from '@/utils/smCrypto'
const emailResetFormRef = ref()
const emailFormData = ref({})
const islogin = ref(false)

View File

@ -93,7 +93,7 @@
import router from '@/router'
import { required, rules } from '@/utils/formRules'
import userCenterApi from '@/api/sys/userCenterApi'
import smCrypto from "@/utils/smCrypto"
import smCrypto from '@/utils/smCrypto'
const phoneLoginFormRef = ref()
const phoneFormData = ref({})
const islogin = ref(false)

View File

@ -66,7 +66,7 @@
</template>
<template v-if="column.dataIndex === 'action'">
<a-popconfirm title="确定要强退此令牌吗?" @confirm="exitToken(record)">
<a-button type="link" danger size="small" :loading="exitLoading" >强退</a-button>
<a-button type="link" danger size="small" :loading="exitLoading">强退</a-button>
</a-popconfirm>
</template>
</template>

View File

@ -88,10 +88,5 @@
})
}
//
const categoryOptions = tool.dictTypeList('THIRD_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const categoryOptions = tool.dictList('THIRD_CATEGORY')
</script>

View File

@ -124,12 +124,7 @@
sortCode: [required('请选择排序')]
}
//
let orgCategoryOptions = proxy.$TOOL.dictTypeList('ORG_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
let orgCategoryOptions = proxy.$TOOL.dictList('ORG_CATEGORY')
//
const openSelector = (id) => {
let checkedUserIds = []
@ -157,13 +152,15 @@
.then(() => {
submitLoading.value = true
formData.value.extJson = JSON.stringify(extJson.value)
bizOrgApi.submitForm(formData.value, !formData.value.id).then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
bizOrgApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
.catch(() => {})
}

View File

@ -137,28 +137,30 @@
}
//
const loadTreeData = () => {
bizOrgApi.orgTree().then((res) => {
cardLoading.value = false
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
defaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
defaultExpandedKeys.value.push(items.id)
})
bizOrgApi
.orgTree()
.then((res) => {
cardLoading.value = false
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
defaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
defaultExpandedKeys.value.push(items.id)
})
}
}
}
})
}
})
.finally(() => {
cardLoading.value = false
})
})
}
})
.finally(() => {
cardLoading.value = false
})
}
//
const treeSelect = (selectedKeys) => {

View File

@ -101,25 +101,22 @@
category: [required('请选择岗位分类')],
sortCode: [required('请选择排序')]
}
let positionCategoryOptions = proxy.$TOOL.dictTypeList('POSITION_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
let positionCategoryOptions = proxy.$TOOL.dictList('POSITION_CATEGORY')
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
bizPositionApi.submitForm(formData.value, !formData.value.id).then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
bizPositionApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
.catch(() => {})
}

View File

@ -136,28 +136,30 @@
})
}
//
bizOrgApi.orgTree().then((res) => {
cardLoading.value = false
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
defaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
defaultExpandedKeys.value.push(items.id)
})
bizOrgApi
.orgTree()
.then((res) => {
cardLoading.value = false
if (res !== null) {
treeData.value = res
// 2
treeData.value.forEach((item) => {
// 0
if (item.parentId === '0') {
defaultExpandedKeys.value.push(item.id)
// ID
if (item.children) {
item.children.forEach((items) => {
defaultExpandedKeys.value.push(items.id)
})
}
}
}
})
}
})
.finally(() => {
cardLoading.value = false
})
})
}
})
.finally(() => {
cardLoading.value = false
})
//
const treeSelect = (selectedKeys) => {
if (selectedKeys.length > 0) {

View File

@ -514,33 +514,13 @@
})
}
//
const genderOptions = proxy.$TOOL.dictTypeList('GENDER').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const genderOptions = proxy.$TOOL.dictList('GENDER')
//
const nationOptions = proxy.$TOOL.dictTypeList('NATION').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const nationOptions = proxy.$TOOL.dictList('NATION')
//
const idcardTypeOptions = proxy.$TOOL.dictTypeList('IDCARD_TYPE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const idcardTypeOptions = proxy.$TOOL.dictList('IDCARD_TYPE')
//
const cultureLevelOptions = proxy.$TOOL.dictTypeList('CULTURE_LEVEL').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const cultureLevelOptions = proxy.$TOOL.dictList('CULTURE_LEVEL')
//
defineExpose({

View File

@ -28,8 +28,8 @@
<a-col :span="8">
<a-form-item name="userStatus" :label="$t('user.userStatus')">
<a-select v-model:value="searchFormState.userStatus" :placeholder="$t('user.placeholderUserStatus')">
<a-select-option v-for="item in statusData" :key="item.dictValue" :value="item.dictValue">{{
item.name
<a-select-option v-for="item in statusData" :key="item.value" :value="item.value">{{
item.label
}}</a-select-option>
</a-select>
</a-form-item>
@ -207,7 +207,7 @@
width: '220px'
})
}
const statusData = tool.dictTypeList('COMMON_STATUS')
const statusData = tool.dictList('COMMON_STATUS')
const searchFormRef = ref()
let defaultExpandedKeys = ref([])
let searchFormState = reactive({})

View File

@ -59,24 +59,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -55,24 +55,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -63,24 +63,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -55,24 +55,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -63,24 +63,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -63,24 +63,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -68,20 +68,18 @@
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
configApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
onClose()
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
formRef.value.validate().then(() => {
submitLoading.value = true
configApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
onClose()
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
}
//

View File

@ -63,24 +63,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -67,24 +67,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -140,19 +140,9 @@
}
})
//
const fileEngineOptions = tool.dictTypeList('FILE_ENGINE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const fileEngineOptions = tool.dictList('FILE_ENGINE')
//
const commonSwitchOptions = tool.dictTypeList('COMMON_SWITCH').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const commonSwitchOptions = tool.dictList('COMMON_SWITCH')
const customRequest = (data) => {
formData.value.SNOWY_SYS_LOGO = ref([])

View File

@ -59,24 +59,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -59,24 +59,22 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
formRef.value.validate().then(() => {
submitLoading.value = true
let submitParam = cloneDeep(formData.value)
const param = Object.entries(submitParam).map((item) => {
return {
configKey: item[0],
configValue: item[1]
}
})
configApi
.configEditForm(param)
.then(() => {})
.finally(() => {
submitLoading.value = false
})
})
}
const layout = {
labelCol: {

View File

@ -31,7 +31,12 @@
<a-input v-model:value="formData.dictLabel" placeholder="请输入字典名称" allow-clear />
</a-form-item>
<a-form-item label="字典值:" name="dictValue">
<a-input v-model:value="formData.dictValue" placeholder="请输入字典值" allow-clear :disabled="formData.parentId === '0'"/>
<a-input
v-model:value="formData.dictValue"
placeholder="请输入字典值"
allow-clear
:disabled="formData.parentId === '0'"
/>
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-slider v-model:value="formData.sortCode" :max="100" />
@ -104,14 +109,12 @@
})
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
dictApi.submitForm(formData.value, !formData.value.id).then(() => {
visible = false
emit('successful')
})
formRef.value.validate().then(() => {
dictApi.submitForm(formData.value, !formData.value.id).then(() => {
visible = false
emit('successful')
})
})
}
//
defineExpose({

View File

@ -70,16 +70,14 @@
<script setup name="devEmail">
import { message } from 'ant-design-vue'
import tool from '@/utils/tool'
import emailApi from '@/api/dev/emailApi'
import Form from './form.vue'
import { getCurrentInstance } from 'vue'
import detail from './detail.vue'
const { proxy } = getCurrentInstance()
const table = ref(null)
const form = ref()
const searchFormRef = ref()
let searchFormState = reactive({})
const deleteLoading = ref(false)
const detailRef = ref()
const columns = [
@ -140,12 +138,7 @@
return data
})
}
const engineOptions = proxy.$TOOL.dictTypeList('EMAIL_ENGINE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const engineOptions = tool.dictList('EMAIL_ENGINE')
//
const deleteEmail = (record) => {
let params = [

View File

@ -4,13 +4,12 @@
<a-row :gutter="24">
<a-col :span="8">
<a-form-item name="searchKey" label="名称关键词">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入文件名称关键词"></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入文件名称关键词" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item name="engine" label="存储位置">
<a-select v-model:value="searchFormState.engine" placeholder="请选择存储位置" :options="engineOptions">
</a-select>
<a-select v-model:value="searchFormState.engine" placeholder="请选择存储位置" :options="engineOptions" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -197,12 +196,7 @@
})
}
//
const engineOptions = tool.dictTypeList('FILE_ENGINE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const engineOptions = tool.dictList('FILE_ENGINE')
</script>
<style scoped>

View File

@ -13,14 +13,13 @@
<a-input v-model:value="formData.name" placeholder="请输入定时任务名称" allow-clear />
</a-form-item>
<a-form-item label="分类:" name="category">
<a-select v-model:value="formData.category" placeholder="请选择分类" :options="categoryOptions"> </a-select>
<a-select v-model:value="formData.category" placeholder="请选择分类" :options="categoryOptions" />
</a-form-item>
<a-form-item label="任务类名:" name="actionClass">
<a-select v-model:value="formData.actionClass" placeholder="请选择任务类名" :options="actionClassOptions">
</a-select>
<a-select v-model:value="formData.actionClass" placeholder="请选择任务类名" :options="actionClassOptions" />
</a-form-item>
<a-form-item label="表达式:" name="cronExpression">
<cron v-model:modelValue="formData.cronExpression"></cron>
<cron v-model:modelValue="formData.cronExpression" />
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-slider v-model:value="formData.sortCode" :max="100" />
@ -98,12 +97,7 @@
})
}
//
const categoryOptions = tool.dictTypeList('JOB_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const categoryOptions = tool.dictList('JOB_CATEGORY')
//
defineExpose({
onOpen

View File

@ -4,19 +4,17 @@
<a-row :gutter="24">
<a-col :span="6">
<a-form-item label="关键字" name="searchKey">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入关键字"></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入关键字" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="分类" name="category">
<a-select v-model:value="searchFormState.category" placeholder="请选择分类" :options="categoryOptions">
</a-select>
<a-select v-model:value="searchFormState.category" placeholder="请选择分类" :options="categoryOptions" />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="状态" name="jobStatus">
<a-select v-model:value="searchFormState.jobStatus" placeholder="请选择状态" :options="jobStatusOptions">
</a-select>
<a-select v-model:value="searchFormState.jobStatus" placeholder="请选择状态" :options="jobStatusOptions" />
</a-form-item>
</a-col>
<a-col :span="6">
@ -207,17 +205,7 @@
})
}
//
const categoryOptions = tool.dictTypeList('JOB_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const categoryOptions = tool.dictList('JOB_CATEGORY')
//
const jobStatusOptions = tool.dictTypeList('JOB_STATUS').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const jobStatusOptions = tool.dictList('JOB_STATUS')
</script>

View File

@ -18,8 +18,7 @@
:options="categoryOptions"
style="width: 100%"
placeholder="请选择站内信分类"
>
</a-select>
/>
</a-form-item>
<a-form-item label="正文:" name="content">
<a-textarea v-model:value="formData.content" placeholder="请输入正文" :auto-size="{ minRows: 5, maxRows: 5 }" />
@ -27,7 +26,7 @@
<a-form-item label="接收人:" name="receiverIdList">
<a-button type="primary" @click="openUserSelector"></a-button>
<br />
<a-tag class="mt-3" v-for="(user, index) in userList" color="cyan" closable @close="removeUserTag(index)">{{
<a-tag class="mt-3" v-for="(user, index) in userList" color="cyan" :key="index" @close="removeUserTag(index)">{{
user.name
}}</a-tag>
</a-form-item>
@ -50,12 +49,12 @@
import { message } from 'ant-design-vue'
import messageApi from '@/api/dev/messageApi'
import userSelectorPlus from '@/components/Selector/userSelectorPlus.vue'
import tool from '@/utils/tool'
const sendLoading = ref(false)
let UserSelectorPlus = ref()
// emit
const emit = defineEmits({ successful: null })
const { proxy } = getCurrentInstance()
//
let visible = $ref(false)
const formRef = ref()
@ -78,12 +77,7 @@
category: [required('请选择站内信分类')]
}
//
let categoryOptions = proxy.$TOOL.dictTypeList('MESSAGE_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const categoryOptions = tool.dictList('MESSAGE_CATEGORY')
//
const openUserSelector = () => {
let ids = []

View File

@ -72,10 +72,9 @@
import { message } from 'ant-design-vue'
import smsApi from '@/api/dev/smsApi'
import Form from './form.vue'
import { getCurrentInstance } from 'vue'
import detail from './detail.vue'
import tool from '@/utils/tool'
const { proxy } = getCurrentInstance()
const table = ref(null)
const form = ref()
const searchFormRef = ref()
@ -140,12 +139,7 @@
return data
})
}
const engineOptions = proxy.$TOOL.dictTypeList('SMS_ENGINE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const engineOptions = tool.dictList('SMS_ENGINE')
//
const deleteSms = (record) => {
let params = [

View File

@ -48,20 +48,18 @@
}
//
const send = () => {
formRef.value
.validate()
.then(() => {
emit('loadingStart')
smsApi
.smsSendAliyun(formData.value)
.then(() => {
message.success('发送成功')
})
.catch(() => {})
.finally(() => {
emit('loadingEnd')
})
})
formRef.value.validate().then(() => {
emit('loadingStart')
smsApi
.smsSendAliyun(formData.value)
.then(() => {
message.success('发送成功')
})
.catch(() => {})
.finally(() => {
emit('loadingEnd')
})
})
}
//
defineExpose({

View File

@ -52,20 +52,18 @@
templateCode: [required('请输入短信服务控制台配置且审核通过的模板编码')]
}
const send = () => {
formRef.value
.validate()
.then(() => {
emit('loadingStart')
smsApi
.smsSendTencent(formData.value)
.then(() => {
message.success('发送成功')
})
.catch(() => {})
.finally(() => {
emit('loadingEnd')
})
})
formRef.value.validate().then(() => {
emit('loadingStart')
smsApi
.smsSendTencent(formData.value)
.then(() => {
message.success('发送成功')
})
.catch(() => {})
.finally(() => {
emit('loadingEnd')
})
})
}
//
defineExpose({

View File

@ -1,8 +1,6 @@
<template>
<a-card>
<a-button type="primary" @click="jump">
跳转自己并带参数
</a-button>
<a-button type="primary" @click="jump"> </a-button>
当然也可以跳到指定的路由啦
</a-card>
</template>

View File

@ -1,33 +1,33 @@
<template>
<a-carousel class="snowy-right-card-one" autoplay arrows>
<template #prevArrow>
<div class="custom-slick-arrow" style="left: 10px; z-index: 1">
<left-circle-outlined />
</div>
</template>
<template #nextArrow>
<div class="custom-slick-arrow" style="right: 10px">
<right-circle-outlined />
</div>
</template>
<img
src="/src/assets/images/index_001.png"
class="carousel-images"
@click="leaveForOpen('https://www.xiaonuo.vip')"
/>
<img
src="/src/assets/images/index_002.png"
class="carousel-images"
@click="leaveForOpen('https://www.xiaonuo.vip')"
/>
<!--
<a-carousel class="snowy-right-card-one" autoplay arrows>
<template #prevArrow>
<div class="custom-slick-arrow" style="left: 10px; z-index: 1">
<left-circle-outlined />
</div>
</template>
<template #nextArrow>
<div class="custom-slick-arrow" style="right: 10px">
<right-circle-outlined />
</div>
</template>
<img
src="/src/assets/images/index_001.png"
class="carousel-images"
@click="leaveForOpen('https://www.xiaonuo.vip')"
/>
<img
src="/src/assets/images/index_002.png"
class="carousel-images"
@click="leaveForOpen('https://www.xiaonuo.vip')"
/>
<!--
<img v-for="(item, index) in carouselList"
:src="item.images"
class="carousel-images"
@click="leaveForOpen(item.url)"
/>
-->
</a-carousel>
</a-carousel>
</template>
<script setup name="carousel">

View File

@ -25,7 +25,7 @@
//
const displayMore = () => {
return (userInfo.roleCodeList && userInfo.roleCodeList.indexOf("super") !== -1)
return userInfo.roleCodeList && userInfo.roleCodeList.indexOf('super') !== -1
}
const seleOpLogList = () => {
indexApi.indexOpLogList().then((data) => {

View File

@ -25,7 +25,7 @@
})
//
const displayMore = () => {
return (userInfo.roleCodeList && userInfo.roleCodeList.indexOf("super") !== -1)
return userInfo.roleCodeList && userInfo.roleCodeList.indexOf('super') !== -1
}
//
const seleVisLogList = () => {

View File

@ -36,8 +36,7 @@
:options="orgCategoryOptions"
style="width: 100%"
placeholder="请选择组织分类"
>
</a-select>
/>
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-slider v-model:value="formData.sortCode" :max="100" />
@ -68,12 +67,11 @@
import { required } from '@/utils/formRules'
import { message } from 'ant-design-vue'
import orgApi from '@/api/sys/orgApi'
import { getCurrentInstance } from 'vue'
import userSelectorPlus from '@/components/Selector/userSelectorPlus.vue'
import tool from '@/utils/tool'
// emit
const emit = defineEmits({ successful: null })
const { proxy } = getCurrentInstance()
//
let visible = $ref(false)
let UserSelectorPlus = ref()
@ -124,12 +122,7 @@
sortCode: [required('请选择排序')]
}
//
let orgCategoryOptions = proxy.$TOOL.dictTypeList('ORG_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const orgCategoryOptions = tool.dictList('ORG_CATEGORY')
//
const openSelector = (id) => {
let checkedUserIds = []
@ -152,21 +145,19 @@
}
//
const onSubmit = () => {
formRef.value
.validate()
.then(() => {
submitLoading.value = true
formData.value.extJson = JSON.stringify(extJson.value)
orgApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
formRef.value.validate().then(() => {
submitLoading.value = true
formData.value.extJson = JSON.stringify(extJson.value)
orgApi
.submitForm(formData.value, !formData.value.id)
.then(() => {
visible = false
emit('successful')
})
.finally(() => {
submitLoading.value = false
})
})
}
//
defineExpose({

View File

@ -36,8 +36,7 @@
:options="positionCategoryOptions"
style="width: 100%"
placeholder="请选择职位分类"
>
</a-select>
/>
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-slider v-model:value="formData.sortCode" :max="100" />
@ -52,14 +51,12 @@
<script setup name="positionForm">
import { required } from '@/utils/formRules'
import { getCurrentInstance } from 'vue'
import { message } from 'ant-design-vue'
import orgApi from '@/api/sys/orgApi'
import positionApi from '@/api/sys/positionApi'
import tool from '@/utils/tool'
// emit
const emit = defineEmits({ successful: null })
const { proxy } = getCurrentInstance()
//
let visible = $ref(false)
const formRef = ref()
@ -101,12 +98,7 @@
category: [required('请选择职位分类')],
sortCode: [required('请选择排序')]
}
let positionCategoryOptions = proxy.$TOOL.dictTypeList('POSITION_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const positionCategoryOptions = tool.dictList('POSITION_CATEGORY')
//
const onSubmit = () => {
formRef.value.validate().then(() => {

View File

@ -18,8 +18,7 @@
button-style="solid"
:options="categoryOptions"
option-type="button"
>
</a-radio-group>
/>
</a-form-item>
<a-form-item label="上级菜单:" name="parentId">
<a-tree-select
@ -39,7 +38,7 @@
selectable="false"
tree-line
@change="parentChange(formData.parentId)"
></a-tree-select>
/>
</a-form-item>
<a-form-item v-if="formData.menuType !== 'CATALOG'" name="path">
<template #label>
@ -105,7 +104,6 @@
import tool from '@/utils/tool'
import menuApi from '@/api/sys/resource/menuApi'
import IconSelector from '@/components/Selector/iconSelector.vue'
import { getCurrentInstance } from 'vue'
//
let visible = $ref(false)
const emit = defineEmits({ successful: null })
@ -180,14 +178,7 @@
component: [required('请输入组件地址')]
}
const { proxy } = getCurrentInstance()
let categoryOptions = proxy.$TOOL.dictTypeList('MENU_TYPE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const categoryOptions = tool.dictList('MENU_TYPE')
//
const onSubmit = () => {
formRef.value

View File

@ -18,8 +18,7 @@
button-style="solid"
:options="categoryOptions"
option-type="button"
>
</a-radio-group>
/>
</a-form-item>
<a-form-item name="path">
@ -82,11 +81,10 @@
</template>
<script setup name="spaForm">
import { message } from 'ant-design-vue'
import { required } from '@/utils/formRules'
import IconSelector from '@/components/Selector/iconSelector.vue'
import spaApi from '@/api/sys/resource/spaApi'
import { getCurrentInstance } from 'vue'
import tool from '@/utils/tool'
//
let visible = $ref(false)
const emit = defineEmits({ successful: null })
@ -125,19 +123,18 @@
const iconCallBack = (value) => {
formData.value.icon = value
}
const { proxy } = getCurrentInstance()
let categoryOptions = proxy.$TOOL
.dictTypeList('MENU_TYPE')
let categoryOptions = tool
.dictList('MENU_TYPE')
.filter((item) => {
//
if (item.dictValue !== 'CATALOG') {
if (item.value !== 'CATALOG') {
return item
}
})
.map((item) => {
return {
value: item['dictValue'],
label: item['name'] + '页'
value: item['value'],
label: item['label'] + '页'
}
})

View File

@ -5,7 +5,7 @@
<a-row :gutter="24">
<a-col :span="8">
<a-form-item label="名称关键词" name="searchKey">
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入单页名称关键词" allow-clear></a-input>
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入单页名称关键词" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
@ -15,7 +15,7 @@
:options="categoryOptions"
placeholder="请选择类型"
allow-clear
></a-select>
/>
</a-form-item>
</a-col>
<a-col :span="8">
@ -145,18 +145,18 @@
}
}
}
let categoryOptions = tool
.dictTypeList('MENU_TYPE')
const categoryOptions = tool
.dictList('MENU_TYPE')
.filter((item) => {
//
if (item.dictValue !== 'CATALOG') {
if (item.value !== 'CATALOG') {
return item
}
})
.map((item) => {
return {
value: item['dictValue'],
label: item['name'] + '页'
value: item['value'],
label: item['label'] + '页'
}
})
//

View File

@ -18,8 +18,7 @@
:options="categoryOptions"
style="width: 100%"
placeholder="请选择角色分类"
>
</a-select>
/>
</a-form-item>
<a-form-item v-if="formData.category === 'ORG'" label="所属机构:" name="orgId">
<a-tree-select
@ -37,7 +36,7 @@
}"
selectable="false"
tree-line
></a-tree-select>
/>
</a-form-item>
<a-form-item label="排序:" name="sortCode">
<a-slider v-model:value="formData.sortCode" :max="100" />
@ -52,13 +51,12 @@
<script setup name="roleForm">
import { required } from '@/utils/formRules'
import { getCurrentInstance } from 'vue'
import tool from '@/utils/tool'
import orgApi from '@/api/sys/orgApi'
import roleApi from '@/api/sys/roleApi'
// emit
const emit = defineEmits({ successful: null })
const { proxy } = getCurrentInstance()
//
let visible = $ref(false)
const formRef = ref()
@ -94,12 +92,7 @@
sortCode: [required('请选择排序')]
}
//
let categoryOptions = proxy.$TOOL.dictTypeList('ROLE_CATEGORY').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
let categoryOptions = tool.dictList('ROLE_CATEGORY')
//
const onSubmit = () => {
formRef.value.validate().then(() => {

View File

@ -26,7 +26,7 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="性别:" name="gender">
<a-radio-group v-model:value="formData.gender" :options="genderOptions"> </a-radio-group>
<a-radio-group v-model:value="formData.gender" :options="genderOptions" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -72,7 +72,7 @@
value: 'id'
}"
@change="selePositionData(formData.orgId, 0)"
></a-tree-select>
/>
</a-form-item>
</a-col>
<a-col :span="8">
@ -84,8 +84,7 @@
style="width: 100%"
placeholder="请选择职位"
allow-clear
>
</a-select>
/>
</a-form-item>
</a-col>
<a-col :span="8">
@ -97,8 +96,7 @@
style="width: 100%"
placeholder="请选择主管"
allow-clear
>
</a-select>
/>
</a-form-item>
</a-col>
</a-row>
@ -150,7 +148,7 @@
:tree-default-expanded-keys="treeDefaultExpandedKeys"
:field-names="{ children: 'children', label: 'name', value: 'id' }"
@select="childOrgSelect(positionInfo, 0)"
></a-tree-select>
/>
</a-form-item>
</a-col>
<a-col :span="7">
@ -165,8 +163,7 @@
style="width: 100%"
placeholder="请选择职位"
allow-clear
>
</a-select>
/>
</a-form-item>
</a-col>
<a-col :span="7">
@ -178,8 +175,7 @@
style="width: 100%"
placeholder="请选择主管"
allow-clear
>
</a-select>
/>
</a-form-item>
</a-col>
<a-col :span="3" style="margin-top: 4px">
@ -193,7 +189,7 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="民族:" name="nation">
<a-select v-model:value="formData.nation" placeholder="请选择民族" :options="nationOptions"> </a-select>
<a-select v-model:value="formData.nation" placeholder="请选择民族" :options="nationOptions" />
</a-form-item>
</a-col>
<a-col :span="12">
@ -227,8 +223,11 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="证件类型:" name="idCardType">
<a-select v-model:value="formData.idCardType" placeholder="请选择证件类型" :options="idcardTypeOptions">
</a-select>
<a-select
v-model:value="formData.idCardType"
placeholder="请选择证件类型"
:options="idcardTypeOptions"
/>
</a-form-item>
</a-col>
<a-col :span="12">
@ -244,8 +243,7 @@
v-model:value="formData.cultureLevel"
placeholder="请选择文化程度"
:options="cultureLevelOptions"
>
</a-select>
/>
</a-form-item>
</a-col>
<a-col :span="12">
@ -330,12 +328,12 @@
<script setup>
import userApi from '@/api/sys/userApi'
import { required, rules } from '@/utils/formRules'
import { required } from '@/utils/formRules'
import tool from '@/utils/tool'
//
let visible = $ref(false)
const formRef = ref()
const activeTabsKey = ref('1')
const { proxy } = getCurrentInstance()
const emit = defineEmits({ successful: null })
const formLoading = ref(false)
const treeData = ref([])
@ -514,34 +512,13 @@
})
}
//
const genderOptions = proxy.$TOOL.dictTypeList('GENDER').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const genderOptions = tool.dictList('GENDER')
//
const nationOptions = proxy.$TOOL.dictTypeList('NATION').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const nationOptions = tool.dictList('NATION')
//
const idcardTypeOptions = proxy.$TOOL.dictTypeList('IDCARD_TYPE').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const idcardTypeOptions = tool.dictList('IDCARD_TYPE')
//
const cultureLevelOptions = proxy.$TOOL.dictTypeList('CULTURE_LEVEL').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const cultureLevelOptions = tool.dictList('CULTURE_LEVEL')
//
defineExpose({
onOpen
@ -561,10 +538,6 @@
padding-top: 5px;
padding-left: 15px;
}
.dashedButton {
margin-top: 10px;
width: 100%;
}
.form-div {
padding-top: 10px;
}

View File

@ -28,8 +28,8 @@
<a-col :span="8">
<a-form-item name="userStatus" :label="$t('user.userStatus')">
<a-select v-model:value="searchFormState.userStatus" :placeholder="$t('user.placeholderUserStatus')">
<a-select-option v-for="item in statusData" :key="item.dictValue" :value="item.dictValue">{{
item.name
<a-select-option v-for="item in statusData" :key="item.value" :value="item.value">{{
item.label
}}</a-select-option>
</a-select>
</a-form-item>
@ -212,7 +212,7 @@
width: '220px'
}
]
const statusData = tool.dictTypeList('COMMON_STATUS')
const statusData = tool.dictList('COMMON_STATUS')
const searchFormRef = ref()
let defaultExpandedKeys = ref([])
let searchFormState = reactive({})

View File

@ -19,7 +19,7 @@
<p><i class="group"></i>{{ userInfo.orgName }}</p>
<p>
<i class="address"></i>
<span>{{ userInfo.homeAddress? userInfo.homeAddress : '暂无地址' }}</span>
<span>{{ userInfo.homeAddress ? userInfo.homeAddress : '暂无地址' }}</span>
</p>
</div>
<a-divider />

View File

@ -20,7 +20,7 @@
<a-input v-model:value="formData.nickname" placeholder="请输入昵称" allow-clear />
</a-form-item>
<a-form-item label="性别:" name="sex">
<a-radio-group v-model:value="formData.gender" :options="genderOptions"> </a-radio-group>
<a-radio-group v-model:value="formData.gender" :options="genderOptions" />
</a-form-item>
<a-form-item label="生日:" name="birthday">
<a-date-picker v-model:value="formData.birthday" value-format="YYYY-MM-DD" style="width: 100%" />
@ -36,13 +36,13 @@
</template>
<script setup name="AccountBasic">
import { getCurrentInstance } from 'vue'
import { required } from '@/utils/formRules'
import userCenterApi from '@/api/sys/userCenterApi'
import tool from '@/utils/tool'
import store from '@/store'
const formRef = ref()
const { proxy } = getCurrentInstance()
//
const userInfo = proxy.$TOOL.data.get('USER_INFO')
const userInfo = tool.data.get('USER_INFO')
let formData = ref({})
formData.value = userInfo
const submitLoading = ref(false)
@ -51,12 +51,7 @@
name: [required('请输入姓名')],
gender: [required('请选择性别')]
}
const genderOptions = proxy.$TOOL.dictTypeList('GENDER').map((item) => {
return {
value: item['dictValue'],
label: item['name']
}
})
const genderOptions = tool.dictList('GENDER')
//
const onSubmit = () => {
formRef.value
@ -66,8 +61,8 @@
userCenterApi.userUpdateUserInfo(formData.value).then(() => {
submitLoading.value = false
//
proxy.$store.commit('SET_userInfo', formData.value)
proxy.$TOOL.data.set('USER_INFO', formData.value)
store.commit('SET_userInfo', formData.value)
tool.data.set('USER_INFO', formData.value)
})
})
.catch(() => {

View File

@ -2,8 +2,8 @@
<a-row :gutter="10">
<a-col :span="4">
<a-menu id="userMessage" v-model:selected-keys="selectedKeys" mode="inline" @click="handleClick">
<a-menu-item :key="messageCategory.dictValue" v-for="messageCategory in messageCategoryList">{{
messageCategory.name
<a-menu-item :key="messageCategory.value" v-for="messageCategory in messageCategoryList">{{
messageCategory.label
}}</a-menu-item>
</a-menu>
</a-col>
@ -39,8 +39,8 @@
import tool from '@/utils/tool'
import { nextTick } from 'vue'
const messageCategoryList = tool.dictTypeList('MESSAGE_CATEGORY')
const selectedKeys = ref(new Array(messageCategoryList[0].dictValue))
const messageCategoryList = tool.dictList('MESSAGE_CATEGORY')
const selectedKeys = ref(new Array(messageCategoryList[0].value))
const table = ref()
const detailRef = ref()
const columns = [