feat:合并代码
This commit is contained in:
commit
1b2b03352a
@ -18,6 +18,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@smallwei/avue": "^3.6.2",
|
||||
"@vueuse/core": "^12.4.0",
|
||||
"axios": "^1.6.5",
|
||||
"dayjs": "^1.11.11",
|
||||
|
@ -4,7 +4,6 @@
|
||||
draggable
|
||||
title="文件导入"
|
||||
width="50%"
|
||||
top="10px"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
@close="onClose"
|
||||
|
@ -5,11 +5,13 @@ import router from './router';
|
||||
import pinia from './store';
|
||||
import ElementPlus from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import Avue from '@smallwei/avue';
|
||||
import '@smallwei/avue/lib/index.css';
|
||||
import { registerGlobalMicroApps } from './micro';
|
||||
import { registerElIcons } from './plugins/icon';
|
||||
import './utils/permission';
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(pinia).use(router).use(ElementPlus).mount('#root');
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue).mount('#root');
|
||||
registerElIcons(app);
|
||||
registerGlobalMicroApps();
|
||||
|
@ -27,12 +27,6 @@ export const constantRoutes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
// {
|
||||
// path: '/sub-government-affairs-service/:pathMatch(.*)',
|
||||
// name: 'sub-government-affairs-service',
|
||||
// component: Layout,
|
||||
// redirect: '/sub-government-affairs-service/home',
|
||||
// },
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
|
@ -1,12 +1,64 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { CONSTANTS } from '@/config';
|
||||
|
||||
export const useSettingStore = defineStore({
|
||||
id: 'settingStore',
|
||||
state: () => ({
|
||||
// menu 是否收缩
|
||||
isCollapse: true,
|
||||
//
|
||||
withoutAnimation: false,
|
||||
device: 'desktop',
|
||||
// 刷新当前页
|
||||
isReload: true,
|
||||
// 主题设置
|
||||
themeConfig: {
|
||||
// 显示设置
|
||||
showSetting: false,
|
||||
// 菜单展示模式 默认 vertical horizontal / vertical /columns
|
||||
mode: 'vertical',
|
||||
// tagsView 是否展示 默认展示
|
||||
showTag: true,
|
||||
// 页脚
|
||||
footer: true,
|
||||
// 深色模式 切换暗黑模式
|
||||
isDark: false,
|
||||
// 显示侧边栏Logo
|
||||
showLogo: true,
|
||||
// 主题颜色
|
||||
primary: CONSTANTS.PRIMARY,
|
||||
// element组件大小
|
||||
globalComSize: 'default',
|
||||
// 是否只保持一个子菜单的展开
|
||||
uniqueOpened: true,
|
||||
// 固定header
|
||||
fixedHeader: true,
|
||||
// 灰色模式
|
||||
gray: false,
|
||||
// 色弱模式
|
||||
weak: false,
|
||||
},
|
||||
}),
|
||||
getters: {},
|
||||
actions: {
|
||||
// 设置主题
|
||||
setThemeConfig({ key, val }) {
|
||||
this.themeConfig[key] = val;
|
||||
},
|
||||
// 切换 Collapse
|
||||
setCollapse(value) {
|
||||
this.isCollapse = value;
|
||||
this.withoutAnimation = false;
|
||||
},
|
||||
// 关闭侧边栏
|
||||
closeSideBar({ withoutAnimation }) {
|
||||
this.isCollapse = false;
|
||||
this.withoutAnimation = withoutAnimation;
|
||||
},
|
||||
toggleDevice(device) {
|
||||
this.device = device;
|
||||
},
|
||||
// 刷新
|
||||
setReload() {
|
||||
this.isReload = false;
|
||||
setTimeout(() => {
|
||||
|
@ -3,7 +3,7 @@ import { GenKey } from '@/config';
|
||||
import { isEmpty, encode, decode } from '@/utils';
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: GenKey('user_store'),
|
||||
id: GenKey('userStore'),
|
||||
state: () => ({
|
||||
token: null,
|
||||
userInfo: {},
|
||||
@ -52,14 +52,14 @@ export const useUserStore = defineStore({
|
||||
this.currentOrg = null;
|
||||
this.orgList = [];
|
||||
this.menus = [];
|
||||
localStorage.removeItem(GenKey('user_store'));
|
||||
localStorage.removeItem(GenKey('userStore'));
|
||||
},
|
||||
clear() {
|
||||
localStorage.removeItem(GenKey('user_store'));
|
||||
localStorage.removeItem(GenKey('userStore'));
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
key: GenKey('user_store'),
|
||||
key: GenKey('userStore'),
|
||||
storage: window.localStorage,
|
||||
},
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
@import 'common/base.scss';
|
||||
@import 'common/define.scss';
|
||||
// @import "@/assets/fonts/iconfont.css";
|
||||
@import "@/assets/fonts/iconfont.css";
|
||||
|
||||
#root,
|
||||
#app {
|
||||
|
@ -41,7 +41,7 @@ const gotoPage = (row) => {
|
||||
// curentApp,
|
||||
// });
|
||||
// console.log('===', actions.getGlobalState('user'));
|
||||
if (row.name !== 'sub-government-affairs-service') return;
|
||||
// if (row.name !== 'sub-government-affairs-service') return;
|
||||
window.history.pushState({}, row.name, row.activeRule);
|
||||
};
|
||||
</script>
|
||||
|
@ -14,46 +14,37 @@ import { resolve } from 'path';
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
console.log('vite.config.js', command, mode, loadEnv(mode, process.cwd()));
|
||||
const {
|
||||
VITE_PORT,
|
||||
VITE_APP_NAME,
|
||||
VITE_APP_BASE_API,
|
||||
VITE_APP_BASE_URL,
|
||||
VITE_APP_UPLOAD_API,
|
||||
VITE_APP_UPLOAD_URL,
|
||||
VITE_APP_SYSTEM_API,
|
||||
VITE_APP_SYSTEM_URL,
|
||||
} = loadEnv(mode, process.cwd());
|
||||
const { VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
|
||||
const config = {
|
||||
base: './',
|
||||
build: {
|
||||
target: 'ESNext',
|
||||
outDir: 'dist',
|
||||
minify: 'terser',
|
||||
// terserOptions: {
|
||||
// compress: {
|
||||
// drop_console: true,
|
||||
// drop_debugger: true,
|
||||
// pure_funcs: ['console.log'],
|
||||
// },
|
||||
// output: {
|
||||
// comments: true,
|
||||
// },
|
||||
// },
|
||||
// reportCompressedSize: false,
|
||||
// chunkSizeWarningLimit: 2000,
|
||||
// rollupOptions: {
|
||||
// output: {
|
||||
// manualChunks(id) {
|
||||
// if (id.includes('node_modules')) {
|
||||
// return id.toString().split('node_modules/')[1].split('/')[1].toString();
|
||||
// }
|
||||
// },
|
||||
// chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
// entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
// assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
// },
|
||||
// },
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
pure_funcs: ['console.log'],
|
||||
},
|
||||
output: {
|
||||
comments: true,
|
||||
},
|
||||
},
|
||||
reportCompressedSize: false,
|
||||
chunkSizeWarningLimit: 2000,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
return id.toString().split('node_modules/')[1].split('/')[1].toString();
|
||||
}
|
||||
},
|
||||
chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
@ -74,11 +65,6 @@ export default defineConfig(({ command, mode }) => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/uploadApis/, ''),
|
||||
},
|
||||
[VITE_APP_SYSTEM_API]: {
|
||||
target: VITE_APP_SYSTEM_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/systemApis/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
@ -133,13 +119,5 @@ export default defineConfig(({ command, mode }) => {
|
||||
}),
|
||||
],
|
||||
};
|
||||
if (mode === 'production') {
|
||||
config.build.terserOptions = {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
return config;
|
||||
});
|
||||
|
@ -195,7 +195,7 @@
|
||||
resolved "https://registry.npmmirror.com/@dual-bundle/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#519c1549b0e147759e7825701ecffd25e5819f7b"
|
||||
integrity sha512-+nxncfwHM5SgAtrVzgpzJOI1ol0PkumhVo469KCf9lUi21IGcY90G98VuHm9VRrUypmAzawAHO9bs6hqeADaVg==
|
||||
|
||||
"@element-plus/icons-vue@^2.3.1":
|
||||
"@element-plus/icons-vue@^2.0.6", "@element-plus/icons-vue@^2.3.1":
|
||||
version "2.3.1"
|
||||
resolved "https://registry.npmmirror.com/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz#1f635ad5fdd5c85ed936481525570e82b5a8307a"
|
||||
integrity sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg==
|
||||
@ -678,6 +678,16 @@
|
||||
resolved "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.29.2.tgz#dc89d92418ae2efa1d70e071c686cffbcf788147"
|
||||
integrity sha512-p6fTArexECPf6KnOHvJXRpAEq0ON1CBtzG/EY4zw08kCHk/kivBc5vUEtnCFNCHOpJZ2ne77fxwRLIKD4wuW2Q==
|
||||
|
||||
"@smallwei/avue@^3.6.2":
|
||||
version "3.6.2"
|
||||
resolved "https://registry.npmmirror.com/@smallwei/avue/-/avue-3.6.2.tgz#a9397aa1ae0863fe7e142f0893d570e5a5225d9d"
|
||||
integrity sha512-Ifkt0o7KLsAMptfoNMG7qYS86OL2pEet761wWZyZGu8e48wuNNPOfqx5jnibGjx2oIoKtYUFh7tFdllOCth2EQ==
|
||||
dependencies:
|
||||
"@element-plus/icons-vue" "^2.0.6"
|
||||
countup.js "^1.9.3"
|
||||
dayjs "^1.10.4"
|
||||
lodash "^4.17.21"
|
||||
|
||||
"@transloadit/prettier-bytes@0.0.7":
|
||||
version "0.0.7"
|
||||
resolved "https://registry.npmmirror.com/@transloadit/prettier-bytes/-/prettier-bytes-0.0.7.tgz#cdb5399f445fdd606ed833872fa0cabdbc51686b"
|
||||
@ -1800,6 +1810,11 @@ cosmiconfig@^9.0.0:
|
||||
js-yaml "^4.1.0"
|
||||
parse-json "^5.2.0"
|
||||
|
||||
countup.js@^1.9.3:
|
||||
version "1.9.3"
|
||||
resolved "https://registry.npmmirror.com/countup.js/-/countup.js-1.9.3.tgz#ce3e50cd7160441e478f07da31895edcc0f1c9dd"
|
||||
integrity sha512-UHf2P/mFKaESqdPq+UdBJm/1y8lYdlcDd0nTZHNC8cxWoJwZr1Eldm1PpWui446vDl5Pd8PtRYkr3q6K4+Qa5A==
|
||||
|
||||
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||
version "7.0.6"
|
||||
resolved "https://registry.npmmirror.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
|
||||
@ -1916,7 +1931,7 @@ data-view-byte-offset@^1.0.1:
|
||||
es-errors "^1.3.0"
|
||||
is-data-view "^1.0.1"
|
||||
|
||||
dayjs@^1.11.11, dayjs@^1.11.13:
|
||||
dayjs@^1.10.4, dayjs@^1.11.11, dayjs@^1.11.13:
|
||||
version "1.11.13"
|
||||
resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.13.tgz#92430b0139055c3ebb60150aa13e860a4b5a366c"
|
||||
integrity sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==
|
||||
|
1753
package-lock.json
generated
Normal file
1753
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -2,6 +2,7 @@
|
||||
VITE_PORT = 9528
|
||||
VITE_MODE = 'DEV'
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://localhost:9000'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
|
||||
|
@ -1,6 +1,7 @@
|
||||
# 生产环境
|
||||
VITE_MODE = 'PRO'
|
||||
VITE_APP_MIAN = 'daimp-front-main'
|
||||
VITE_APP_MIAN_URL = 'http://192.168.18.99:88'
|
||||
VITE_APP_NAME = 'sub-government-affairs-service'
|
||||
# 接口
|
||||
VITE_APP_BASE_API = '/apis'
|
||||
|
@ -7,7 +7,7 @@
|
||||
<title>政务服务</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="sub-app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -6,8 +6,7 @@
|
||||
"scripts": {
|
||||
"dev": "vite --mode development",
|
||||
"build": "vite build --mode production",
|
||||
"build:dev": "vite build --mode dev",
|
||||
"build:qa": "vite build --mode qa",
|
||||
"test": "vite build --mode test",
|
||||
"preview": "vite preview",
|
||||
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
|
||||
"eslint": "npx eslint --init",
|
||||
|
@ -1,43 +0,0 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/**
|
||||
* @Title: 登录
|
||||
*/
|
||||
export function Login(params, token) {
|
||||
return request('/store/login', {
|
||||
method: 'POST',
|
||||
data: null,
|
||||
params: params,
|
||||
headers: {
|
||||
'fairies-auth-token': token,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 登出
|
||||
*/
|
||||
export function LogOut() {
|
||||
return request('/store/logout', {
|
||||
method: 'POST',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 验证码
|
||||
*/
|
||||
export function GetCaptcha() {
|
||||
return request('/store/login-captcha', {
|
||||
method: 'GET',
|
||||
responseType: 'arraybuffer',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 获取菜单
|
||||
*/
|
||||
export function GetMenus() {
|
||||
return request('/store/self/menu', {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
61
sub-government-affairs-service/src/apis/plan.js
Normal file
61
sub-government-affairs-service/src/apis/plan.js
Normal file
@ -0,0 +1,61 @@
|
||||
import request from '@/utils/axios';
|
||||
|
||||
/**
|
||||
* @Title: 列表
|
||||
*/
|
||||
export function GetEntityList(params = {}) {
|
||||
return request('/land-resource/annualManage/page', {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 新增
|
||||
*/
|
||||
export function AddEntity(data = {}) {
|
||||
return request('/land-resource/annualManage/save', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 修改
|
||||
*/
|
||||
export function UpdateEntity(data = {}) {
|
||||
return request('/land-resource/annualManage/edit', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 审核
|
||||
*/
|
||||
export function AuditEntity(data = {}) {
|
||||
return request('/land-resource/annualManage/exam', {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 删除
|
||||
*/
|
||||
export function DeleteEntity(params = {}) {
|
||||
return request(`/land-resource/annualManage/delete/${params.id}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @Title: 导出
|
||||
*/
|
||||
export function ExportEntity(params = {}) {
|
||||
return request('/land-resource/annualManage/export', {
|
||||
method: 'GET',
|
||||
params,
|
||||
responseType: 'blob',
|
||||
});
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="state.visible"
|
||||
draggable
|
||||
title="溯源码"
|
||||
width="40%"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
@close="onClose"
|
||||
>
|
||||
<div class="code-panel">
|
||||
<div class="code-panel-picture">
|
||||
<el-image style="width: 200px; height: 200px" :src="row.orCodeUrl" fit="cover" lazy />
|
||||
</div>
|
||||
<el-button type="primary" @click="downloadFile(row.orCodeUrl, `${row.productName}-溯源码.png`, 'image')"> 下载溯源码</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup name="code-dialog">
|
||||
import { reactive } from 'vue';
|
||||
import { downloadFile } from '@/utils';
|
||||
const props = defineProps({
|
||||
row: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['on-close']);
|
||||
|
||||
const state = reactive({
|
||||
visible: false,
|
||||
});
|
||||
|
||||
const onClose = () => {
|
||||
state.visible = false;
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
show: () => {
|
||||
state.visible = true;
|
||||
},
|
||||
hide: () => {
|
||||
onClose();
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.code {
|
||||
&-panel {
|
||||
padding-bottom: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2023-06-20 14:29:45
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-02-14 11:39:56
|
||||
* @LastEditTime: 2025-02-18 09:48:18
|
||||
-->
|
||||
<template>
|
||||
<el-dropdown class="layout-avatar">
|
||||
@ -33,7 +33,7 @@ import { useUserStore } from '@/store/modules/user';
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView';
|
||||
import { usePermissionStore } from '@/store/modules/permission';
|
||||
import { getAssetsFile } from '@/utils';
|
||||
import { LogOut } from '@/apis/login';
|
||||
import { Logout } from '#/apis/login';
|
||||
|
||||
const router = useRouter();
|
||||
const UserStore = useUserStore();
|
||||
@ -49,7 +49,7 @@ const logOut = async () => {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}).then(async () => {
|
||||
LogOut().then((res) => {
|
||||
Logout().then((res) => {
|
||||
if (res.code === 200) {
|
||||
UserStore.logout();
|
||||
TagsViewStore.clearVisitedView();
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
import 'virtual:svg-icons-register';
|
||||
import { createApp } from 'vue';
|
||||
import { renderWithQiankun, qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import pinia from './store';
|
||||
@ -14,11 +15,10 @@ import ElementPlus from 'element-plus';
|
||||
import 'element-plus/dist/index.css';
|
||||
import Avue from '@smallwei/avue';
|
||||
import '@smallwei/avue/lib/index.css';
|
||||
import './utils/permission';
|
||||
import { registerDirective } from './directives';
|
||||
import { registerGlobalComponents } from './plugins/globalComponents';
|
||||
import { registerElIcons } from './plugins/icon';
|
||||
import { registerMicroApps } from './plugins/micro';
|
||||
import './utils/permission';
|
||||
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap';
|
||||
initAMapApiLoader({
|
||||
key: 'c843a50db7157faf295c6fa37c48719f',
|
||||
@ -27,10 +27,37 @@ initAMapApiLoader({
|
||||
// version: '2.0.0'
|
||||
//} // 如果需要使用loca组件库,需要加载Loca
|
||||
});
|
||||
const app = createApp(App);
|
||||
|
||||
const registerMicroApps = () => {
|
||||
let app = null;
|
||||
const initQiankun = () => {
|
||||
renderWithQiankun({
|
||||
bootstrap() {
|
||||
console.log('bootstrap');
|
||||
},
|
||||
mount(props) {
|
||||
console.log('mount', props);
|
||||
render(props);
|
||||
},
|
||||
update(props) {
|
||||
console.log('update', props);
|
||||
},
|
||||
unmount(props) {
|
||||
console.log('unmount', props);
|
||||
app = null;
|
||||
},
|
||||
});
|
||||
};
|
||||
const render = async ({ container }) => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
app = createApp(App);
|
||||
app.use(pinia).use(router).use(ElementPlus).use(Avue).use(VueAMap);
|
||||
registerGlobalComponents(app);
|
||||
registerElIcons(app);
|
||||
registerDirective(app);
|
||||
registerMicroApps(app);
|
||||
app.mount(container.querySelector('#sub-app') || '#sub-app');
|
||||
};
|
||||
qiankunWindow.__POWERED_BY_QIANKUN__ ? initQiankun() : render({});
|
||||
};
|
||||
|
||||
registerMicroApps();
|
||||
|
@ -24,7 +24,7 @@ export const registerMicroApps = (app) => {
|
||||
console.error('挂载容器不存在');
|
||||
return;
|
||||
}
|
||||
app.mount(container.querySelector('#app') || '#app');
|
||||
app.mount(container.querySelector('#sub-app') || '#sub-app');
|
||||
};
|
||||
qiankunWindow.__POWERED_BY_QIANKUN__ ? initQiankun() : render({});
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2023-06-20 11:48:41
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-02-17 11:47:53
|
||||
* @LastEditTime: 2025-02-18 11:22:07
|
||||
*/
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
||||
@ -28,6 +28,16 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/error/403.vue'),
|
||||
hidden: true,
|
||||
},
|
||||
// {
|
||||
// path: '/login',
|
||||
// name: 'login',
|
||||
// component: () => import('@/views/error/404.vue'),
|
||||
// hidden: true,
|
||||
// meta: {
|
||||
// title: '登录',
|
||||
// icon: 'Login',
|
||||
// },
|
||||
// },
|
||||
{
|
||||
path: '/',
|
||||
name: 'layout',
|
||||
@ -43,7 +53,7 @@ export const constantRoutes = [
|
||||
},
|
||||
],
|
||||
},
|
||||
// ...resourceRouter,
|
||||
...resourceRouter,
|
||||
...plantingAndBreedingRouter,
|
||||
...landsRoutes,
|
||||
];
|
||||
@ -52,9 +62,9 @@ export const constantRoutes = [
|
||||
* @Title notFoundRouter(找不到路由)
|
||||
*/
|
||||
export const notFoundRouter = {
|
||||
// path: '/:pathMatch(.*)',
|
||||
// name: 'notFound',
|
||||
// redirect: '/404',
|
||||
path: '/:pathMatch(.*)',
|
||||
name: 'notFound',
|
||||
redirect: '/404',
|
||||
};
|
||||
|
||||
const router = createRouter({
|
||||
|
@ -1,69 +0,0 @@
|
||||
import Layout from '@/layouts/index.vue';
|
||||
import Views from '@/layouts/Views.vue';
|
||||
|
||||
export default [
|
||||
{
|
||||
path: '/resource',
|
||||
name: 'resource',
|
||||
component: Layout,
|
||||
redirect: '/grid',
|
||||
meta: { title: '土地资源管理', icon: 'icon-test' },
|
||||
children: [
|
||||
{
|
||||
path: '/grid',
|
||||
component: () => import('@/views/resource/grid/index.vue'),
|
||||
name: 'grid',
|
||||
meta: { title: '网格化管理', icon: 'Document' },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
// {
|
||||
// path: '/resource-info',
|
||||
// name: 'resource-info-manager',
|
||||
// component: Views,
|
||||
// meta: { title: '土地信息管理', icon: 'Document' },
|
||||
// redirect: '/land',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/land',
|
||||
// component: () => import('@/views/resource/land/index.vue'),
|
||||
// name: 'land',
|
||||
// meta: { title: '土地资源', icon: 'Document' },
|
||||
// },
|
||||
// {
|
||||
// path: '/land-fill',
|
||||
// name: 'land-fill',
|
||||
// component: () => import('@/views/resource/land/index.vue'),
|
||||
// meta: { title: '土地信息填报审核', icon: 'Document' },
|
||||
// },
|
||||
// {
|
||||
// path: '/land-fill-review',
|
||||
// name: 'land-fill-review',
|
||||
// component: () => import('@/views/resource/land/index.vue'),
|
||||
// meta: { title: '土地流转信息填报审核', icon: 'Document' },
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// path: '/land-monitor',
|
||||
// name: 'land-monitor',
|
||||
// component: Views,
|
||||
// meta: { title: '土地监管', icon: 'Document' },
|
||||
// redirect: '/land-patrol',
|
||||
// children: [
|
||||
// {
|
||||
// path: '/land-patrol',
|
||||
// component: () => import('@/views/resource/land/index.vue'),
|
||||
// name: 'land-patrol',
|
||||
// meta: { title: '土地使用巡查', icon: 'Document' },
|
||||
// },
|
||||
// {
|
||||
// path: '/land-handle',
|
||||
// name: 'land-handle',
|
||||
// component: () => import('@/views/resource/land/index.vue'),
|
||||
// meta: { title: '土地违法处理', icon: 'Document' },
|
||||
// },
|
||||
// ],
|
||||
// },
|
@ -15,12 +15,12 @@ export default [
|
||||
name: 'grid',
|
||||
meta: { title: '网格化管理', icon: 'Document' },
|
||||
},
|
||||
{
|
||||
path: '/grid2',
|
||||
component: () => import('@/views/resource/grid/index.vue'),
|
||||
name: 'grid2',
|
||||
meta: { title: '网格化管理2', icon: 'Document' },
|
||||
},
|
||||
// {
|
||||
// path: '/annual-plan',
|
||||
// component: () => import('@/views/resource/plan/index.vue'),
|
||||
// name: 'annual-plan',
|
||||
// meta: { title: '年度计划', icon: 'Document' },
|
||||
// },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
@ -3,7 +3,7 @@ import { GenKey } from '@/config';
|
||||
import { isEmpty, encode, decode } from '@/utils';
|
||||
|
||||
export const useUserStore = defineStore({
|
||||
id: GenKey('user_store'),
|
||||
id: GenKey('userStore'),
|
||||
state: () => ({
|
||||
token: null,
|
||||
userInfo: {},
|
||||
@ -52,14 +52,14 @@ export const useUserStore = defineStore({
|
||||
this.currentOrg = null;
|
||||
this.orgList = [];
|
||||
this.menus = [];
|
||||
localStorage.removeItem(GenKey('user_store'));
|
||||
localStorage.removeItem(GenKey('userStore'));
|
||||
},
|
||||
clear() {
|
||||
localStorage.removeItem(GenKey('user_store'));
|
||||
localStorage.removeItem(GenKey('userStore'));
|
||||
},
|
||||
},
|
||||
persist: {
|
||||
key: GenKey('user_store'),
|
||||
key: GenKey('userStore'),
|
||||
storage: window.localStorage,
|
||||
},
|
||||
});
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2022-02-23 21:12:37
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-02-13 14:47:02
|
||||
* @LastEditTime: 2025-02-18 09:47:41
|
||||
*/
|
||||
import axios from 'axios';
|
||||
import { ElNotification } from 'element-plus';
|
||||
|
@ -5,6 +5,7 @@
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2024-02-26 13:54:43
|
||||
*/
|
||||
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
|
||||
import NProgress from 'nprogress';
|
||||
import 'nprogress/nprogress.css';
|
||||
import router from '@/router';
|
||||
@ -13,8 +14,8 @@ import { usePermissionStore } from '@/store/modules/permission';
|
||||
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
const whiteList = ['/login', '/auth-redirect']; // 设置白名单
|
||||
|
||||
const { VITE_APP_MIAN_URL } = import.meta.env;
|
||||
const whiteList = [];
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
NProgress.start();
|
||||
if (typeof to.meta.title === 'string') {
|
||||
@ -26,28 +27,30 @@ router.beforeEach(async (to, from, next) => {
|
||||
console.log('sub', hasToken);
|
||||
if (hasToken) {
|
||||
if (to.path === '/login') {
|
||||
// 如果已登录,请重定向到主页
|
||||
next({ path: '/' });
|
||||
} else {
|
||||
try {
|
||||
const PermissionStore = usePermissionStore();
|
||||
// 路由添加进去了没有及时更新 需要重新进去一次拦截
|
||||
if (!PermissionStore.routes.length) {
|
||||
// 获取权限列表进行接口访问 因为这里页面要切换权限
|
||||
const accessRoutes = await PermissionStore.generateRoutes(userStore.roles);
|
||||
accessRoutes.forEach((item) => router.addRoute(item)); // 动态添加访问路由表
|
||||
next({ ...to, replace: true }); // 这里相当于push到一个页面 不在进入路由拦截
|
||||
accessRoutes.forEach((item) => router.addRoute(item));
|
||||
next({ ...to, replace: true });
|
||||
} else {
|
||||
next(); // 如果不传参数就会重新执行路由拦截,重新进到这里
|
||||
next();
|
||||
}
|
||||
} catch (error) {
|
||||
next(`/login?redirect=${to.path}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NProgress.done();
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
next();
|
||||
} else {
|
||||
if (qiankunWindow.__POWERED_BY_QIANKUN__) {
|
||||
window.location.href = VITE_APP_MIAN_URL;
|
||||
return;
|
||||
}
|
||||
next(`/login?redirect=${to.path}`);
|
||||
}
|
||||
}
|
||||
|
@ -129,13 +129,13 @@ const state = reactive({
|
||||
},
|
||||
{
|
||||
label: '省',
|
||||
prop: 'province',
|
||||
prop: 'provinceCode',
|
||||
hide: true,
|
||||
display: false,
|
||||
},
|
||||
{
|
||||
label: '市',
|
||||
prop: 'city',
|
||||
prop: 'cityCode',
|
||||
hide: true,
|
||||
display: false,
|
||||
},
|
||||
@ -165,11 +165,6 @@ const state = reactive({
|
||||
rows: 4,
|
||||
overHidden: true,
|
||||
width: 200,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '创建时间',
|
||||
@ -272,9 +267,10 @@ const rowView = (row) => {
|
||||
|
||||
const setCity = (row) => {
|
||||
if (!isEmpty(row.cities)) {
|
||||
row.province = row?.cities[0] ?? null;
|
||||
row.city = row?.cities[1] ?? null;
|
||||
row.county = row?.cities[2] ?? null;
|
||||
row.provinceCode = row?.cities[0] ?? null;
|
||||
row.cityCode = row?.cities[1] ?? null;
|
||||
row.gridAreaCode = row?.cities[2] ?? null;
|
||||
row.townCode = row?.cities[3] ?? null;
|
||||
row.village = row?.cities[3] ?? null;
|
||||
}
|
||||
};
|
||||
@ -300,7 +296,7 @@ const rowSave = (row, done, loading) => {
|
||||
|
||||
// 编辑
|
||||
const rowEdit = (row) => {
|
||||
row.cities = compact([row.province, row.city, row.county ?? '', row.village ?? '']);
|
||||
row.cities = compact([row.provinceCode, row.cityCode, row.gridAreaCode ?? '', row.townCode ?? '', row.village ?? '']);
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
|
383
sub-government-affairs-service/src/views/resource/plan/index.vue
Normal file
383
sub-government-affairs-service/src/views/resource/plan/index.vue
Normal file
@ -0,0 +1,383 @@
|
||||
<template>
|
||||
<div class="custom-page">
|
||||
<avue-crud
|
||||
ref="crudRef"
|
||||
v-model="state.form"
|
||||
v-model:search="state.query"
|
||||
v-model:page="state.pageData"
|
||||
:table-loading="state.loading"
|
||||
:data="state.data"
|
||||
:option="state.options"
|
||||
@refresh-change="refreshChange"
|
||||
@search-reset="searchChange"
|
||||
@search-change="searchChange"
|
||||
@selection-change="selectionChange"
|
||||
@current-change="currentChange"
|
||||
@size-change="sizeChange"
|
||||
@row-save="rowSave"
|
||||
@row-update="rowUpdate"
|
||||
@row-del="rowDel"
|
||||
>
|
||||
<template #menu-left>
|
||||
<el-button type="success" icon="download" @click="onExport">导出</el-button>
|
||||
</template>
|
||||
|
||||
<template #menu="scope">
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { useApp } from '@/hooks';
|
||||
import { CRUD_OPTIONS } from '@/config';
|
||||
import { isEmpty, downloadFile } from '@/utils';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { compact } from 'lodash';
|
||||
import { GetEntityList, AddEntity, AuditEntity, UpdateEntity, DeleteEntity, ExportEntity } from '@/apis/plan';
|
||||
|
||||
const { VITE_APP_BASE_API } = import.meta.env;
|
||||
const app = useApp();
|
||||
const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
},
|
||||
form: {},
|
||||
selection: [],
|
||||
options: {
|
||||
...CRUD_OPTIONS,
|
||||
addBtnText: '添加计划',
|
||||
column: [
|
||||
{
|
||||
label: '计划编号',
|
||||
prop: 'id',
|
||||
search: true,
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
label: '计划名称',
|
||||
prop: 'planName',
|
||||
search: true,
|
||||
width: 200,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '种植面积(亩)',
|
||||
prop: 'plantingArea',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
formatter: (row) => {
|
||||
return row?.plantingArea ? row.plantingArea + '亩' : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '种植月份',
|
||||
prop: 'plantingMonths',
|
||||
type: 'select',
|
||||
dicData: [
|
||||
{ label: '1月', value: '1月' },
|
||||
{ label: '2月', value: '2月' },
|
||||
{ label: '3月', value: '3月' },
|
||||
{ label: '4月', value: '4月' },
|
||||
{ label: '5月', value: '5月' },
|
||||
{ label: '6月', value: '6月' },
|
||||
{ label: '7月', value: '7月' },
|
||||
{ label: '8月', value: '8月' },
|
||||
{ label: '9月', value: '9月' },
|
||||
{ label: '10月', value: '10月' },
|
||||
{ label: '11月', value: '11月' },
|
||||
{ label: '12月', value: '12月' },
|
||||
],
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '生长周期',
|
||||
prop: 'growthCycle',
|
||||
labelTip: '如:10周-12周',
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '计划进度',
|
||||
prop: 'planProgress',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: true,
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '状态',
|
||||
prop: 'planStatus',
|
||||
type: 'select',
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: true,
|
||||
dicData: [
|
||||
{
|
||||
label: '待提交',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
label: '已提交',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
label: '审核通过',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
label: '审核拒绝',
|
||||
value: 4,
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
prop: 'note',
|
||||
type: 'textarea',
|
||||
span: 24,
|
||||
rows: 4,
|
||||
overHidden: true,
|
||||
width: 200,
|
||||
},
|
||||
],
|
||||
actions: [
|
||||
{
|
||||
name: '查看',
|
||||
icon: 'view',
|
||||
event: ({ row }) => rowView(row),
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
icon: 'edit',
|
||||
event: ({ row }) => rowEdit(row),
|
||||
},
|
||||
{
|
||||
type: 'danger',
|
||||
name: '删除',
|
||||
icon: 'delete',
|
||||
event: ({ row }) => rowDel(row),
|
||||
},
|
||||
{
|
||||
name: '审核通过',
|
||||
type: 'success',
|
||||
icon: 'check',
|
||||
event: ({ row }) => rowCheck(row, 4),
|
||||
},
|
||||
{
|
||||
name: '审核拒绝',
|
||||
type: 'danger',
|
||||
icon: 'close',
|
||||
event: ({ row }) => rowCheck(row, 3),
|
||||
},
|
||||
],
|
||||
},
|
||||
pageData: {
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
minWeek: null,
|
||||
maxWeek: null,
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
// 加载
|
||||
const loadData = () => {
|
||||
state.loading = true;
|
||||
GetEntityList(state.query)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
const { current, size, total, records } = res.data;
|
||||
state.data = records;
|
||||
state.pageData = {
|
||||
currentPage: current || 1,
|
||||
pageSize: size || 10,
|
||||
total: total,
|
||||
};
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
state.data = [];
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
|
||||
loadData();
|
||||
|
||||
// 页数
|
||||
const currentChange = (current) => {
|
||||
state.query.current = current;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 条数
|
||||
const sizeChange = (size) => {
|
||||
state.query.size = size;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 搜索
|
||||
const searchChange = (params, done) => {
|
||||
if (done) done();
|
||||
state.query = params;
|
||||
state.query.current = 1;
|
||||
loadData();
|
||||
};
|
||||
|
||||
// 刷新
|
||||
const refreshChange = () => {
|
||||
loadData();
|
||||
app.$message.success('刷新成功');
|
||||
};
|
||||
|
||||
// 选择
|
||||
const selectionChange = (rows) => {
|
||||
state.selection = rows;
|
||||
};
|
||||
|
||||
// 查看
|
||||
const rowView = (row) => {
|
||||
// state.currentRow = row;
|
||||
crudRef.value.rowView(row);
|
||||
};
|
||||
|
||||
// 新增
|
||||
const rowSave = (row, done, loading) => {
|
||||
AddEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('添加成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const rowEdit = (row) => {
|
||||
crudRef.value.rowEdit(row);
|
||||
};
|
||||
const rowUpdate = (row, index, done, loading) => {
|
||||
UpdateEntity(row)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('更新成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loading();
|
||||
});
|
||||
};
|
||||
|
||||
// 删除
|
||||
const rowDel = (row, index, done) => {
|
||||
if (isEmpty(row)) return;
|
||||
app
|
||||
.$confirm(`删除后信息将不可查看,确认要删除吗?`, '确定删除', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(() => {
|
||||
DeleteEntity({ id: row.id })
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('删除成功!');
|
||||
done();
|
||||
loadData();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
// 审核
|
||||
const rowCheck = (row, status) => {
|
||||
const data = { id: row.id, planStatus: status };
|
||||
AuditEntity(data)
|
||||
.then((res) => {
|
||||
if (res.code === 200) {
|
||||
app.$message.success('操作成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error(err.msg);
|
||||
})
|
||||
.finally(() => {
|
||||
loadData();
|
||||
});
|
||||
};
|
||||
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
if (isEmpty(state.data)) {
|
||||
app.$message.error('当前暂时没有可供导出的数据!');
|
||||
return;
|
||||
}
|
||||
state.loading = true;
|
||||
const fileName = '年度计划明细表';
|
||||
ExportEntity(state.query)
|
||||
.then((res) => {
|
||||
if (res.status === 200) {
|
||||
downloadFile(res.data, `${fileName}.xlsx`, 'blob');
|
||||
app.$message.success('导出成功!');
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
app.$message.error('导出失败!');
|
||||
})
|
||||
.finally(() => {
|
||||
state.loading = false;
|
||||
});
|
||||
};
|
||||
</script>
|
@ -23,6 +23,11 @@
|
||||
<el-button type="success" icon="upload" @click="onUpload">导入</el-button>
|
||||
<el-button type="success" icon="download" @click="onExport">导出</el-button>
|
||||
</template>
|
||||
|
||||
<template #id="{ row }">
|
||||
<el-image style="width: 50px; height: 50px; cursor: pointer" :src="row.orCodeUrl" fit="cover" lazy @click="onViewCode(row)" />
|
||||
</template>
|
||||
|
||||
<template #productUrl-form="{ column }">
|
||||
<el-upload class="custom-form__uploader" action="#" :show-file-list="false" accept="image/*" :limit="1" :http-request="rowUploadPicture">
|
||||
<img v-if="state.form.base64" :src="state.form.base64" class="custom-form__uploader__img" />
|
||||
@ -56,6 +61,8 @@
|
||||
@on-confirm="onUploadExcel"
|
||||
/>
|
||||
|
||||
<code-dialog ref="codeRef" :row="state.currentRow" />
|
||||
|
||||
<custom-quality-add ref="qualityAddRef" :row="state.currentRow" />
|
||||
</div>
|
||||
<!-- <el-dialog v-model="qrInfo.show" title="扫码溯源" width="500" :before-close="() => (qrInfo.show = false)">
|
||||
@ -80,6 +87,7 @@ const UserStore = useUserStore();
|
||||
const crudRef = ref(null);
|
||||
const importExcelRef = ref(null);
|
||||
const qualityAddRef = ref(null);
|
||||
const codeRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -99,7 +107,6 @@ const state = reactive({
|
||||
addDisplay: false,
|
||||
editDisplay: false,
|
||||
viewDisplay: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
label: '采收批次',
|
||||
@ -285,7 +292,7 @@ const state = reactive({
|
||||
label: '原产地详细地址',
|
||||
prop: 'originAddressDetail',
|
||||
hide: true,
|
||||
// span: 24,
|
||||
viewDisplay: false,
|
||||
},
|
||||
// {
|
||||
// label: '经营主体',
|
||||
@ -620,15 +627,8 @@ const onExport = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const qrInfo = reactive({
|
||||
url: '1111111111111111111111111111111111111111',
|
||||
show: true,
|
||||
});
|
||||
|
||||
function handleShowQrcode(id) {
|
||||
// a.value = a.value + 1;
|
||||
qrInfo.url = id;
|
||||
qrInfo.show = true;
|
||||
console.log('cell', qrInfo);
|
||||
}
|
||||
const onViewCode = (row) => {
|
||||
state.currentRow = row;
|
||||
codeRef?.value && codeRef.value.show();
|
||||
};
|
||||
</script>
|
||||
|
@ -22,6 +22,10 @@
|
||||
<el-button type="danger" icon="delete" @click="onDel(state.selection)">批量删除</el-button>
|
||||
</template>
|
||||
|
||||
<template #harvestId="{ row }">
|
||||
<el-image style="width: 50px; height: 50px; cursor: pointer" :src="row.orCodeUrl" fit="cover" lazy @click="onViewCode(row)" />
|
||||
</template>
|
||||
|
||||
<template #qualityReportUrl="{ row }">
|
||||
<el-button
|
||||
v-if="row.qualityReportUrl"
|
||||
@ -45,6 +49,8 @@
|
||||
<custom-table-operate :actions="state.options.actions" :data="scope" />
|
||||
</template>
|
||||
</avue-crud>
|
||||
|
||||
<code-dialog ref="codeRef" :row="state.currentRow" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
@ -57,6 +63,7 @@ import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity } from '@/apis/qua
|
||||
|
||||
const app = useApp();
|
||||
const crudRef = ref(null);
|
||||
const codeRef = ref(null);
|
||||
const state = reactive({
|
||||
loading: false,
|
||||
query: {
|
||||
@ -74,7 +81,6 @@ const state = reactive({
|
||||
prop: 'harvestId',
|
||||
search: true,
|
||||
disabled: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
label: '采收批次',
|
||||
@ -249,6 +255,7 @@ const state = reactive({
|
||||
pageSize: 10,
|
||||
},
|
||||
data: [],
|
||||
currentRow: {},
|
||||
});
|
||||
|
||||
// 加载
|
||||
@ -405,4 +412,9 @@ const onDel = (rows = []) => {
|
||||
const rowDel = (row, index, done) => {
|
||||
onDel([row]);
|
||||
};
|
||||
|
||||
const onViewCode = (row) => {
|
||||
state.currentRow = row;
|
||||
codeRef?.value && codeRef.value.show();
|
||||
};
|
||||
</script>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* @Author: zenghua.wang
|
||||
* @Date: 2022-09-18 21:24:29
|
||||
* @LastEditors: zenghua.wang
|
||||
* @LastEditTime: 2025-02-17 10:58:12
|
||||
* @LastEditTime: 2025-02-27 09:16:00
|
||||
*/
|
||||
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
@ -23,46 +23,37 @@ import { resolve } from 'path';
|
||||
const useDevMode = true;
|
||||
|
||||
export default defineConfig(({ command, mode }) => {
|
||||
const {
|
||||
VITE_PORT,
|
||||
VITE_APP_NAME,
|
||||
VITE_APP_BASE_API,
|
||||
VITE_APP_BASE_URL,
|
||||
VITE_APP_UPLOAD_API,
|
||||
VITE_APP_UPLOAD_URL,
|
||||
VITE_APP_SYSTEM_API,
|
||||
VITE_APP_SYSTEM_URL,
|
||||
} = loadEnv(mode, process.cwd());
|
||||
const { VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
|
||||
const config = {
|
||||
base: '/sub-government-affairs-service/',
|
||||
build: {
|
||||
target: 'ESNext',
|
||||
outDir: 'dist',
|
||||
minify: 'terser',
|
||||
// terserOptions: {
|
||||
// compress: {
|
||||
// drop_console: true,
|
||||
// drop_debugger: true,
|
||||
// pure_funcs: ['console.log'],
|
||||
// },
|
||||
// output: {
|
||||
// comments: true,
|
||||
// },
|
||||
// },
|
||||
// reportCompressedSize: false,
|
||||
// chunkSizeWarningLimit: 2000,
|
||||
// rollupOptions: {
|
||||
// output: {
|
||||
// manualChunks(id) {
|
||||
// if (id.includes('node_modules')) {
|
||||
// return id.toString().split('node_modules/')[1].split('/')[1].toString();
|
||||
// }
|
||||
// },
|
||||
// chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
// entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
// assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
// },
|
||||
// },
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
pure_funcs: ['console.log'],
|
||||
},
|
||||
output: {
|
||||
comments: true,
|
||||
},
|
||||
},
|
||||
reportCompressedSize: false,
|
||||
chunkSizeWarningLimit: 2000,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks(id) {
|
||||
if (id.includes('node_modules')) {
|
||||
return id.toString().split('node_modules/')[1].split('/')[1].toString();
|
||||
}
|
||||
},
|
||||
chunkFileNames: 'assets/js/[name]-[hash].js',
|
||||
entryFileNames: 'assets/js/[name]-[hash].js',
|
||||
assetFileNames: 'assets/[ext]/[name]-[hash].[ext]',
|
||||
},
|
||||
},
|
||||
},
|
||||
server: {
|
||||
host: '0.0.0.0',
|
||||
@ -83,11 +74,6 @@ export default defineConfig(({ command, mode }) => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/uploadApis/, ''),
|
||||
},
|
||||
[VITE_APP_SYSTEM_API]: {
|
||||
target: VITE_APP_SYSTEM_URL,
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/systemApis/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
@ -142,13 +128,5 @@ export default defineConfig(({ command, mode }) => {
|
||||
}),
|
||||
],
|
||||
};
|
||||
if (mode === 'production') {
|
||||
config.build.terserOptions = {
|
||||
compress: {
|
||||
drop_console: true,
|
||||
drop_debugger: true,
|
||||
},
|
||||
};
|
||||
}
|
||||
return config;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user