♻️ Refactoring code. 组件重新命名

This commit is contained in:
lbw 2023-04-01 09:32:14 +08:00
parent f3c0db99aa
commit 4dadffa872
35 changed files with 82 additions and 204 deletions

24
package-lock.json generated
View File

@ -16,6 +16,7 @@
"@wangeditor/editor-for-vue": "5.1.12",
"axios": "^1.3.3",
"crypto-js": "^3.1.9-1",
"driver.js": "^0.9.8",
"echarts": "^5.4.1",
"element-plus": "2.3.1",
"form-designer": "^0.0.2",
@ -24,7 +25,6 @@
"mitt": "^3.0.0",
"nprogress": "^0.2.0",
"pinia": "^2.0.32",
"print-js": "^1.6.0",
"qrcode": "1.5.1",
"qs": "^6.11.0",
"screenfull": "^6.0.2",
@ -1726,6 +1726,12 @@
"tslib": "^2.0.3"
}
},
"node_modules/driver.js": {
"version": "0.9.8",
"resolved": "https://registry.npmmirror.com/driver.js/-/driver.js-0.9.8.tgz",
"integrity": "sha512-bczjyKdX6XmFyCDkwtRmlaORDwfBk1xXmRO0CAe5VwNQTM98aWaG2LAIiIdTe53iV/B7W5lXlIy2xYtf0JRb7Q==",
"license": "MIT"
},
"node_modules/echarts": {
"version": "5.4.1",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.1.tgz",
@ -3333,12 +3339,6 @@
"node": ">=10.13.0"
}
},
"node_modules/print-js": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz",
"integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg==",
"license": "MIT"
},
"node_modules/prismjs": {
"version": "1.29.0",
"resolved": "https://registry.npmmirror.com/prismjs/-/prismjs-1.29.0.tgz",
@ -5720,6 +5720,11 @@
"tslib": "^2.0.3"
}
},
"driver.js": {
"version": "0.9.8",
"resolved": "https://registry.npmmirror.com/driver.js/-/driver.js-0.9.8.tgz",
"integrity": "sha512-bczjyKdX6XmFyCDkwtRmlaORDwfBk1xXmRO0CAe5VwNQTM98aWaG2LAIiIdTe53iV/B7W5lXlIy2xYtf0JRb7Q=="
},
"echarts": {
"version": "5.4.1",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.4.1.tgz",
@ -6935,11 +6940,6 @@
"integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==",
"dev": true
},
"print-js": {
"version": "1.6.0",
"resolved": "https://registry.npmmirror.com/print-js/-/print-js-1.6.0.tgz",
"integrity": "sha512-BfnOIzSKbqGRtO4o0rnj/K3681BSd2QUrsIZy/+WdCIugjIswjmx3lDEZpXB2ruGf9d4b3YNINri81+J0FsBWg=="
},
"prismjs": {
"version": "1.29.0",
"resolved": "https://registry.npmmirror.com/prismjs/-/prismjs-1.29.0.tgz",

View File

@ -1,6 +1,6 @@
import request from '/@/utils/request';
export const depttree = (params?: Object) => {
export const deptTree = (params?: Object) => {
return request({
url: '/admin/dept/tree',
method: 'get',

View File

@ -100,7 +100,7 @@ const props = defineProps({
const emit = defineEmits(['update:modelValue', 'get', 'clear']);
//
const IconList = defineAsyncComponent(() => import('/@/components/iconSelector/list.vue'));
const IconList = defineAsyncComponent(() => import('/@/components/IconSelector/list.vue'));
//
const inputWidthRef = ref();

View File

@ -1,7 +1,7 @@
<template>
<div class="head-container">
<div style="display: flex">
<el-input v-model="searchName" suffix-icon="search" :placeholder="placeholder" clearable style="margin-bottom: 20px" @change="getDeptTree" />
<el-input v-model="searchName" suffix-icon="search" :placeholder="placeholder" clearable style="margin-bottom: 20px" @change="getdeptTree" />
<el-dropdown :hide-on-click="false" class="mt10 mr10">
<el-icon style="transform: rotate(90deg)">
<MoreFilled />
@ -116,7 +116,7 @@ const handleNodeClick = (item: any) => {
/**
* 获取部门树形结构数据
*/
const getDeptTree = () => {
const getdeptTree = () => {
if (props.query instanceof Function) {
state.localLoading = true;
@ -150,11 +150,11 @@ const toggleRowExpansionAll = (status) => {
};
onMounted(() => {
getDeptTree();
getdeptTree();
});
// 便
defineExpose({
getDeptTree,
getdeptTree,
});
</script>

View File

@ -65,8 +65,7 @@
</el-row>
<el-row style="text-align: center">
<el-col :span="12" class="col-select">
<a v-if="objData.repUrl" target="_blank" :href="objData.repUrl">
<SvgIcon name="local-wx-video" :size="45" /> </a
<a v-if="objData.repUrl" target="_blank" :href="objData.repUrl"> <SvgIcon name="local-wx-video" :size="45" /> </a
></el-col>
<el-col :span="12" class="col-add">
<el-button type="success" @click="openMaterial({ type: 'video', accountId: props.objData.appId })">素材库选择 </el-button>
@ -102,11 +101,11 @@
<script setup lang="ts" name="wx-reply">
import { getMaterialVideo } from '/@/api/mp/wx-material';
import { useMessage } from '/@/hooks/message';
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/wechart/wx-material-select/main.vue'));
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/Wechat/wx-material-select/main.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/wechart/fileUpload/index.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/Wechat/fileUpload/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/wechart/wx-news/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/Wechat/wx-news/index.vue'));
const props = defineProps({
objData: {

View File

@ -1,143 +0,0 @@
<template>
<div>
<el-dialog title="更换头像" v-model="state.isShowDialog" width="769px">
<div class="cropper-warp">
<div class="cropper-warp-left">
<img :src="state.cropperImg" class="cropper-warp-left-img" />
</div>
<div class="cropper-warp-right">
<div class="cropper-warp-right-title">预览</div>
<div class="cropper-warp-right-item">
<div class="cropper-warp-right-value">
<img :src="state.cropperImgBase64" class="cropper-warp-right-value-img" />
</div>
<div class="cropper-warp-right-label">100 x 100</div>
</div>
<div class="cropper-warp-right-item">
<div class="cropper-warp-right-value">
<img :src="state.cropperImgBase64" class="cropper-warp-right-value-img cropper-size" />
</div>
<div class="cropper-warp-right-label">50 x 50</div>
</div>
</div>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="onCancel"> </el-button>
<el-button type="primary" @click="onSubmit"> </el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts" name="cropper">
import { reactive, nextTick } from 'vue';
import Cropper from 'cropperjs';
import 'cropperjs/dist/cropper.css';
//
const state = reactive({
isShowDialog: false,
cropperImg: '',
cropperImgBase64: '',
cropper: '' as RefType,
});
//
const openDialog = (imgs: string) => {
state.cropperImg = imgs;
state.isShowDialog = true;
nextTick(() => {
initCropper();
});
};
//
const closeDialog = () => {
state.isShowDialog = false;
};
//
const onCancel = () => {
closeDialog();
};
//
const onSubmit = () => {
// state.cropperImgBase64 = state.cropper.getCroppedCanvas().toDataURL('image/jpeg');
};
// cropperjs
const initCropper = () => {
const letImg = <HTMLImageElement>document.querySelector('.cropper-warp-left-img');
state.cropper = new Cropper(letImg, {
viewMode: 1,
dragMode: 'none',
initialAspectRatio: 1,
aspectRatio: 1,
preview: '.before',
background: false,
autoCropArea: 0.6,
zoomOnWheel: false,
crop: () => {
state.cropperImgBase64 = state.cropper.getCroppedCanvas().toDataURL('image/jpeg');
},
});
};
//
defineExpose({
openDialog,
});
</script>
<style scoped lang="scss">
.cropper-warp {
display: flex;
.cropper-warp-left {
position: relative;
display: inline-block;
height: 350px;
flex: 1;
border: 1px solid var(--el-border-color);
background: var(--el-color-white);
overflow: hidden;
background-repeat: no-repeat;
cursor: move;
border-radius: var(--el-border-radius-base);
.cropper-warp-left-img {
width: 100%;
height: 100%;
}
}
.cropper-warp-right {
width: 150px;
height: 350px;
.cropper-warp-right-title {
text-align: center;
height: 20px;
line-height: 20px;
}
.cropper-warp-right-item {
margin: 15px 0;
.cropper-warp-right-value {
display: flex;
.cropper-warp-right-value-img {
width: 100px;
height: 100px;
border-radius: var(--el-border-radius-circle);
margin: auto;
}
.cropper-size {
width: 50px;
height: 50px;
}
}
.cropper-warp-right-label {
text-align: center;
font-size: 12px;
color: var(--el-text-color-primary);
height: 30px;
line-height: 30px;
}
}
}
}
</style>

View File

@ -34,8 +34,8 @@
* @description 分发验证码使用
* */
import { computed, ref, toRefs, watchEffect, defineAsyncComponent } from 'vue';
const VerifySlide = defineAsyncComponent(() => import('/@/components/verifition/Verify/VerifySlide.vue'));
const VerifyPoints = defineAsyncComponent(() => import('/@/components/verifition/Verify/VerifyPoints.vue'));
const VerifySlide = defineAsyncComponent(() => import('/@/components/Verifition/Verify/VerifySlide.vue'));
const VerifyPoints = defineAsyncComponent(() => import('/@/components/Verifition/Verify/VerifyPoints.vue'));
export default {
name: 'Vue2Verify',

View File

@ -57,9 +57,9 @@
* VerifyPoints
* @description 点选
* */
import { resetSize } from './../utils/util';
import { aesEncrypt } from './../utils/ase';
import { reqGet, reqCheck } from './../api/index';
import { resetSize } from '../utils/util';
import { aesEncrypt } from '../utils/ase';
import { reqGet, reqCheck } from '../api/index';
import { onMounted, reactive, ref, nextTick, toRefs, getCurrentInstance } from 'vue';
export default {
name: 'VerifyPoints',

View File

@ -61,9 +61,9 @@
* VerifySlide
* @description 滑块
* */
import { aesEncrypt } from './../utils/ase';
import { resetSize } from './../utils/util';
import { reqCheck, reqGet } from './../api/index';
import { aesEncrypt } from '../utils/ase';
import { resetSize } from '../utils/util';
import { reqCheck, reqGet } from '../api/index';
import { computed, getCurrentInstance, nextTick, onMounted, reactive, ref, toRefs, watch } from 'vue';
export default {
name: 'VerifySlide',

View File

@ -12,7 +12,7 @@ import 'element-plus/dist/index.css';
import VForm3 from 'form-designer'; //引入VForm3库
import 'form-designer/dist/designer.style.css'; //引入VForm3样式
import elementIcons from '/@//components/svgIcon/svgicon';
import elementIcons from '/@/components/SvgIcon/svgicon';
import '/@/theme/index.scss';
import 'vxe-table/lib/style.css';
import 'xe-utils';

View File

@ -15,7 +15,7 @@ import * as CryptoJS from 'crypto-js';
import { validateNull } from './validate';
// 引入组件
const SvgIcon = defineAsyncComponent(() => import('/@/components/svgIcon/index.vue'));
const SvgIcon = defineAsyncComponent(() => import('/@/components/SvgIcon/index.vue'));
/**
* element plus svg

View File

@ -41,7 +41,7 @@
<script setup lang="ts" name="systemDeptDialog">
import { useI18n } from 'vue-i18n';
import { getObj, depttree, addObj, putObj } from '/@/api/admin/dept';
import { getObj, deptTree, addObj, putObj } from '/@/api/admin/dept';
import { useMessage } from '/@/hooks/message';
// /
@ -104,7 +104,7 @@ const onSubmit = async () => {
//
const getDeptData = async () => {
depttree().then((res) => {
deptTree().then((res) => {
parentData.value = [];
const dept = {
id: '0',

View File

@ -73,7 +73,7 @@
<script setup lang="ts" name="systemDept">
import { BasicTableProps, useTable } from '/@/hooks/table';
import { depttree, delObj } from '/@/api/admin/dept';
import { deptTree, delObj } from '/@/api/admin/dept';
import { useMessage, useMessageBox } from '/@/hooks/message';
import { useI18n } from 'vue-i18n';
import { downBlobFile } from '/@/utils/other';
@ -87,7 +87,7 @@ const excelUploadRef = ref();
const showSearch = ref(true);
const state: BasicTableProps = reactive<BasicTableProps>({
pageList: depttree,
pageList: deptTree,
queryForm: {
deptName: '',
},

View File

@ -101,7 +101,7 @@ const handleNodeClick = (data: any) => {
//
const handleRefreshTree = async (data: any) => {
await dictTreeRef.value.getDeptTree();
await dictTreeRef.value.getdeptTree();
//
handleNodeClick(data);
};
@ -117,7 +117,7 @@ const handleDelete = async (ids: string[]) => {
try {
await delObj(ids);
useMessage().success(t('common.delSuccessText'));
dictTreeRef.value.getDeptTree();
dictTreeRef.value.getdeptTree();
} catch (err: any) {
useMessage().error(err.msg);
}

View File

@ -94,7 +94,7 @@ import { useMessage } from '/@/hooks/message';
const emit = defineEmits(['refresh']);
const { t } = useI18n();
//
const IconSelector = defineAsyncComponent(() => import('/@/components/iconSelector/index.vue'));
const IconSelector = defineAsyncComponent(() => import('/@/components/IconSelector/index.vue'));
//
const visible = ref(false);

View File

@ -62,7 +62,7 @@
<script lang="ts" name="systemRoleDialog" setup>
import { rule } from '/@/utils/validate';
import { depttree } from '/@/api/admin/dept';
import { deptTree } from '/@/api/admin/dept';
import { useMessage } from '/@/hooks/message';
import { addObj, getObj, putObj, validateRoleCode, validateRoleName } from '/@/api/admin/role';
import { useI18n } from 'vue-i18n';
@ -203,7 +203,7 @@ const getRoleData = (id: string) => {
//
const getDeptData = () => {
depttree().then((res: any) => {
deptTree().then((res: any) => {
dataForm.deptData = res.data;
});
};

View File

@ -1,6 +1,6 @@
<template>
<div class="system-role-dialog-container">
<el-dialog :title="state.dialog.title" v-model="state.dialog.isShowDialog" :close-on-click-modal="false" draggable>
<el-dialog :title="state.dialog.title" width="30%" v-model="state.dialog.isShowDialog" :close-on-click-modal="false" draggable>
<el-tree
v-loading="loading"
ref="menuTree"

View File

@ -85,7 +85,7 @@
import { addObj, getObj, putObj, validatePhone, validateUsername } from '/@/api/admin/user';
import { list as roleList } from '/@/api/admin/role';
import { list as postList } from '/@/api/admin/post';
import { depttree } from '/@/api/admin/dept';
import { deptTree } from '/@/api/admin/dept';
import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
import { useMessage } from '/@/hooks/message';
@ -252,7 +252,7 @@ const getUserData = (id: string) => {
//
const getDeptData = () => {
//
depttree().then((res) => {
deptTree().then((res) => {
deptData.value = res.data;
});
};

View File

@ -132,7 +132,7 @@
<script lang="ts" name="systemUser" setup>
import { delObj, pageList } from '/@/api/admin/user';
import { depttree } from '/@/api/admin/dept';
import { deptTree } from '/@/api/admin/dept';
import { BasicTableProps, useTable } from '/@/hooks/table';
import { useDict } from '/@/hooks/dict';
import { useMessage, useMessageBox } from '/@/hooks/message';
@ -170,7 +170,7 @@ const { getDataList, currentChangeHandle, sizeChangeHandle, downBlobFile, tableS
// 使
const deptData = reactive({
queryList: (name: String) => {
return depttree({
return deptTree({
deptName: name,
});
},

View File

@ -1,11 +1,9 @@
<template>
<el-calendar v-model="calendar">
<template #date-cell="{ data }">
<div style="width: 100%" @click="handleSchedule(data)">
<div class="calendar-cell" @click="handleSchedule(data)">
{{ data.day.split('-').slice(2).join('-') }}
<span v-if="filterCellSelected(data)">
<el-icon><BellFilled /></el-icon>
</span>
<div class="box-yello" v-if="filterCellSelected(data)"></div>
</div>
</template>
</el-calendar>
@ -80,3 +78,27 @@ const handleSchedule = (data) => {
}
};
</script>
<style lang="scss" scoped>
.el-calendar-table {
.calendar-cell {
position: relative;
text-align: center;
height: 100%;
align-items: center;
display: flex;
justify-content: center;
}
.box-yello {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: #e6a23c;
opacity: 0.6;
padding: 0;
border-radius: 5%;
}
}
</style>

View File

@ -148,7 +148,7 @@ import { getPage, delObj, addObj, putObj } from '/@/api/mp/wx-auto-reply';
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
const WxReply = defineAsyncComponent(() => import('/@/components/wechart/wx-reply/index.vue'));
const WxReply = defineAsyncComponent(() => import('/@/components/Wechat/wx-reply/index.vue'));
//
const handleNodeClick = (node: any) => {

View File

@ -108,7 +108,7 @@ import { useDict } from '/@/hooks/dict';
import { useI18n } from 'vue-i18n';
import { fetchAccountList } from '/@/api/mp/wx-account';
const WxMsg = defineAsyncComponent(() => import('/@/components/wechart/wx-msg/index.vue'));
const WxMsg = defineAsyncComponent(() => import('/@/components/Wechat/wx-msg/index.vue'));
const { t } = useI18n();
//

View File

@ -93,9 +93,9 @@
import { useMessageBox } from '/@/hooks/message';
import { addObj, materialNewsUpdate } from '/@/api/mp/wx-material';
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/wechart/wx-material-select/main.vue'));
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/Wechat/wx-material-select/main.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/wechart/fileUpload/index.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/Wechat/fileUpload/index.vue'));
const WxMaterialSelectRef = ref();

View File

@ -140,8 +140,8 @@ import { delObj, getMaterialOther, getMaterialVideo, getPage } from '/@/api/mp/w
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
const NewsForm = defineAsyncComponent(() => import('./components/news-form.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/wechart/fileUpload/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/wechart/wx-news/index.vue'));
const WxFileUpload = defineAsyncComponent(() => import('/@/components/Wechat/fileUpload/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/Wechat/wx-news/index.vue'));
const deptData = reactive({
queryList: (name: string) => {

View File

@ -134,13 +134,13 @@ import { saveObj, getObj } from '/@/api/mp/wx-menu';
import { fetchAccountList } from '/@/api/mp/wx-account';
import { useMessage, useMessageBox } from '/@/hooks/message';
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/wechart/wx-material-select/main.vue'));
const WxMaterialSelect = defineAsyncComponent(() => import('/@/components/Wechat/wx-material-select/main.vue'));
const WxReply = defineAsyncComponent(() => import('/@/components/wechart/wx-reply/index.vue'));
const WxReply = defineAsyncComponent(() => import('/@/components/Wechat/wx-reply/index.vue'));
const QueryTree = defineAsyncComponent(() => import('/@/components/QueryTree/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/wechart/wx-news/index.vue'));
const WxNews = defineAsyncComponent(() => import('/@/components/Wechat/wx-news/index.vue'));
//
const handleNodeClick = (node: any) => {

View File

@ -7,7 +7,7 @@ import topLevelAwait from 'vite-plugin-top-level-await';
import { createStyleImportPlugin, VxeTableResolve } from 'vite-plugin-style-import';
import viteCompression from 'vite-plugin-compression';
// @ts-ignore
import { svgBuilder } from '/@/components/iconSelector/index';
import { svgBuilder } from '/@/components/IconSelector/index';
const pathResolve = (dir: string) => {
return resolve(__dirname, '.', dir);