1、项目整合
This commit is contained in:
15
index.html
15
index.html
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -91,18 +90,4 @@
|
||||
}
|
||||
}
|
||||
</style>
|
||||
=======
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
</html>
|
||||
|
||||
23
package.json
23
package.json
@@ -1,5 +1,4 @@
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
"name": "jurs-zun",
|
||||
"description": "Vue3 + Vite + TypeScript + Element-Plus 的后台管理模板,vue-element-admin 的 Vue3 版本",
|
||||
"version": "3.4.2",
|
||||
@@ -125,27 +124,5 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"repository": "https://gitee.com/youlaiorg/vue3-element-admin.git",
|
||||
"author": "有来开源组织",
|
||||
"license": "MIT"
|
||||
=======
|
||||
"name": "vue3-element-admin",
|
||||
"version": "0.0.0",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc --noEmit && vite build",
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"element-plus": "^1.2.0-beta.3",
|
||||
"vue": "^3.2.16",
|
||||
"vue-router": "^4.0.12",
|
||||
"vuex": "^4.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^1.9.3",
|
||||
"typescript": "^4.4.3",
|
||||
"vite": "^2.6.4",
|
||||
"vue-tsc": "^0.3.0"
|
||||
}
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
}
|
||||
|
||||
24
src/App.vue
24
src/App.vue
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
<template>
|
||||
<el-config-provider :locale="locale" :size="size">
|
||||
<!-- 开启水印 -->
|
||||
@@ -16,26 +15,3 @@ const appStore = useAppStore();
|
||||
const locale = computed(() => appStore.locale);
|
||||
const size = computed(() => appStore.size as ComponentSize);
|
||||
</script>
|
||||
=======
|
||||
<script setup lang="ts">
|
||||
// This starter template is using Vue 3 <script setup> SFCs
|
||||
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
|
||||
import HelloWorld from './components/HelloWorld.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<img alt="Vue logo" src="./assets/logo.png" />
|
||||
<router-view/>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
text-align: center;
|
||||
color: #2c3e50;
|
||||
margin-top: 60px;
|
||||
}
|
||||
</style>
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
|
||||
19
src/main.ts
19
src/main.ts
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
import { createApp } from "vue";
|
||||
import App from "./App.vue";
|
||||
import setupPlugins from "@/plugins";
|
||||
@@ -21,21 +20,3 @@ const app = createApp(App);
|
||||
// 注册插件
|
||||
app.use(setupPlugins);
|
||||
app.mount("#app");
|
||||
=======
|
||||
import { createApp } from 'vue'
|
||||
import App from './App.vue'
|
||||
import router from "./router";
|
||||
import {store,key} from './store'
|
||||
|
||||
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
|
||||
|
||||
const app=createApp(App)
|
||||
app
|
||||
.use(router)
|
||||
.use(store,key)
|
||||
.use(ElementPlus)
|
||||
.mount('#app')
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
import type { App } from "vue";
|
||||
import { createRouter, createWebHashHistory, type RouteRecordRaw } from "vue-router";
|
||||
|
||||
@@ -295,28 +294,3 @@ export function setupRouter(app: App<Element>) {
|
||||
}
|
||||
|
||||
export default router;
|
||||
=======
|
||||
import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'
|
||||
import HelloWord from '../components/HelloWorld.vue'
|
||||
|
||||
const routes: Array<RouteRecordRaw> = [
|
||||
{
|
||||
path: '',
|
||||
redirect: (_) => {
|
||||
return {path: '/home'}
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/home',
|
||||
name: 'HelloWord',
|
||||
component: HelloWord
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
routes: routes
|
||||
})
|
||||
|
||||
export default router
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
import type { App } from "vue";
|
||||
import { createPinia } from "pinia";
|
||||
|
||||
@@ -16,30 +15,3 @@ export * from "./modules/tags-view-store";
|
||||
export * from "./modules/user-store";
|
||||
export * from "./modules/dict-store";
|
||||
export { store };
|
||||
=======
|
||||
import {InjectionKey} from 'vue'
|
||||
import {createStore, Store} from 'vuex'
|
||||
|
||||
export interface State {
|
||||
count: number
|
||||
}
|
||||
|
||||
export const key: InjectionKey<Store<State>> = Symbol()
|
||||
|
||||
export const store = createStore<State>({
|
||||
state() {
|
||||
return {
|
||||
count: 0
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
increment(state: { count: number }) {
|
||||
state.count++
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
|
||||
@@ -16,11 +16,16 @@
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 委托人信息 -->
|
||||
<div class="section">
|
||||
<h2>委托人信息</h2>
|
||||
<el-table :data="formData.clients" border style="width: 100%" class="client-table">
|
||||
<el-table
|
||||
:data="formData.clients"
|
||||
border
|
||||
style="width: 100%"
|
||||
class="client-table"
|
||||
@selection-change="handleClientSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="name" label="自然人姓名/法人名称*" min-width="200">
|
||||
@@ -42,7 +47,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="table-actions">
|
||||
<el-button type="primary" @click="addClient">
|
||||
<el-icon><Plus /></el-icon>
|
||||
@@ -54,11 +58,16 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 相对方信息 -->
|
||||
<div class="section">
|
||||
<h2>相对方信息</h2>
|
||||
<el-table :data="formData.opponents" border style="width: 100%" class="opponent-table">
|
||||
<el-table
|
||||
:data="formData.opponents"
|
||||
border
|
||||
style="width: 100%"
|
||||
class="opponent-table"
|
||||
@selection-change="handleOpponentSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="index" label="序号" width="80" align="center" />
|
||||
<el-table-column prop="name" label="自然人姓名/法人名称*" min-width="200">
|
||||
@@ -80,7 +89,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="table-actions">
|
||||
<el-button type="primary" @click="addOpponent">
|
||||
<el-icon><Plus /></el-icon>
|
||||
@@ -92,7 +100,6 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 项目简述/案由 -->
|
||||
<div class="form-item">
|
||||
<label class="form-label" for="projectDescription">项目简述/案由*</label>
|
||||
@@ -106,7 +113,6 @@
|
||||
required
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 承办人员 -->
|
||||
<div class="form-item">
|
||||
<label class="form-label" for="handler">承办人员*</label>
|
||||
@@ -123,7 +129,6 @@
|
||||
<el-option label="承办人3" value="3" />
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<div class="form-actions">
|
||||
<el-button type="primary" @click="handleSubmit">提交</el-button>
|
||||
@@ -158,6 +163,11 @@ interface FormData {
|
||||
handler: string;
|
||||
}
|
||||
|
||||
// 选择的委托人
|
||||
const selectedClients = ref<Client[]>([]);
|
||||
// 选择的相对方
|
||||
const selectedOpponents = ref<Opponent[]>([]);
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive<FormData>({
|
||||
preCaseDate: "",
|
||||
@@ -181,8 +191,10 @@ const deleteClient = (index: number) => {
|
||||
formData.clients.forEach((client, idx) => {
|
||||
client.index = idx + 1;
|
||||
});
|
||||
} else if (formData.opponents.length === 0) {
|
||||
ElMessage.warning("委托方和相对方至少需要存在一个");
|
||||
} else {
|
||||
ElMessage.warning("至少保留一项委托人信息");
|
||||
formData.clients.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -192,10 +204,36 @@ const copyClient = (client: Client) => {
|
||||
formData.clients.push({ ...client, index: newIndex });
|
||||
};
|
||||
|
||||
// 处理委托人选择
|
||||
const handleClientSelectionChange = (selection: Client[]) => {
|
||||
selectedClients.value = selection;
|
||||
};
|
||||
|
||||
// 批量删除委托人
|
||||
const batchDeleteClients = () => {
|
||||
// 这里需要结合表格的selection功能实现批量删除
|
||||
ElMessage.info("批量删除功能待实现");
|
||||
if (selectedClients.value.length === 0) {
|
||||
ElMessage.warning("请选择要删除的委托人");
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否删除后还剩至少一个(或相对方存在)
|
||||
if (
|
||||
formData.clients.length - selectedClients.value.length === 0 &&
|
||||
formData.opponents.length === 0
|
||||
) {
|
||||
ElMessage.warning("委托方和相对方至少需要存在一个");
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行批量删除
|
||||
formData.clients = formData.clients.filter((client) => !selectedClients.value.includes(client));
|
||||
// 更新序号
|
||||
formData.clients.forEach((client, idx) => {
|
||||
client.index = idx + 1;
|
||||
});
|
||||
// 清空选择
|
||||
selectedClients.value = [];
|
||||
ElMessage.success("批量删除成功");
|
||||
};
|
||||
|
||||
// 新增相对方
|
||||
@@ -212,8 +250,10 @@ const deleteOpponent = (index: number) => {
|
||||
formData.opponents.forEach((opponent, idx) => {
|
||||
opponent.index = idx + 1;
|
||||
});
|
||||
} else if (formData.clients.length === 0) {
|
||||
ElMessage.warning("委托方和相对方至少需要存在一个");
|
||||
} else {
|
||||
ElMessage.warning("至少保留一项相对方信息");
|
||||
formData.opponents.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -223,10 +263,38 @@ const copyOpponent = (opponent: Opponent) => {
|
||||
formData.opponents.push({ ...opponent, index: newIndex });
|
||||
};
|
||||
|
||||
// 处理相对方选择
|
||||
const handleOpponentSelectionChange = (selection: Opponent[]) => {
|
||||
selectedOpponents.value = selection;
|
||||
};
|
||||
|
||||
// 批量删除相对方
|
||||
const batchDeleteOpponents = () => {
|
||||
// 这里需要结合表格的selection功能实现批量删除
|
||||
ElMessage.info("批量删除功能待实现");
|
||||
if (selectedOpponents.value.length === 0) {
|
||||
ElMessage.warning("请选择要删除的相对方");
|
||||
return;
|
||||
}
|
||||
|
||||
// 检查是否删除后还剩至少一个(或委托方存在)
|
||||
if (
|
||||
formData.opponents.length - selectedOpponents.value.length === 0 &&
|
||||
formData.clients.length === 0
|
||||
) {
|
||||
ElMessage.warning("委托方和相对方至少需要存在一个");
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行批量删除
|
||||
formData.opponents = formData.opponents.filter(
|
||||
(opponent) => !selectedOpponents.value.includes(opponent)
|
||||
);
|
||||
// 更新序号
|
||||
formData.opponents.forEach((opponent, idx) => {
|
||||
opponent.index = idx + 1;
|
||||
});
|
||||
// 清空选择
|
||||
selectedOpponents.value = [];
|
||||
ElMessage.success("批量删除成功");
|
||||
};
|
||||
|
||||
// 提交表单
|
||||
@@ -237,14 +305,20 @@ const handleSubmit = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证委托人信息
|
||||
// 验证委托方和相对方至少存在一个
|
||||
if (formData.clients.length === 0 && formData.opponents.length === 0) {
|
||||
ElMessage.error("委托方和相对方至少需要存在一个");
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证委托人信息(如果存在)
|
||||
const invalidClients = formData.clients.filter((client) => !client.name || !client.idNumber);
|
||||
if (invalidClients.length > 0) {
|
||||
ElMessage.error("请填写完整的委托人信息");
|
||||
return;
|
||||
}
|
||||
|
||||
// 验证相对方信息
|
||||
// 验证相对方信息(如果存在)
|
||||
const invalidOpponents = formData.opponents.filter(
|
||||
(opponent) => !opponent.name || !opponent.idNumber
|
||||
);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
<<<<<<< HEAD
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["esnext", "dom"],
|
||||
@@ -38,18 +37,4 @@
|
||||
"uno.config.ts"
|
||||
],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
=======
|
||||
"useDefineForClassFields": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"jsx": "preserve",
|
||||
"sourceMap": true,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"lib": ["esnext", "dom"]
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
|
||||
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<<<<<<< HEAD
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { type ConfigEnv, type UserConfig, loadEnv, defineConfig, PluginOption } from "vite";
|
||||
|
||||
@@ -238,12 +237,3 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
|
||||
},
|
||||
};
|
||||
});
|
||||
=======
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()]
|
||||
})
|
||||
>>>>>>> 232db255 ('首次提交')
|
||||
|
||||
Reference in New Issue
Block a user