init
This commit is contained in:
3
.env.development
Normal file
3
.env.development
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# 开发环境配置
|
||||||
|
ENV = 'development'
|
||||||
|
VUE_APP_BASE_API = '/dev-api'
|
3
.env_production
Normal file
3
.env_production
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# 生产环境配置
|
||||||
|
ENV = 'production'
|
||||||
|
VUE_APP_BASE_API = '/prod-api'
|
23
.gitignore
vendored
Normal file
23
.gitignore
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
24
README.md
Normal file
24
README.md
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# faultsystem
|
||||||
|
|
||||||
|
## Project setup
|
||||||
|
```
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and hot-reloads for development
|
||||||
|
```
|
||||||
|
npm run serve
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compiles and minifies for production
|
||||||
|
```
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
### Lints and fixes files
|
||||||
|
```
|
||||||
|
npm run lint
|
||||||
|
```
|
||||||
|
|
||||||
|
### Customize configuration
|
||||||
|
See [Configuration Reference](https://cli.vuejs.org/config/).
|
5
babel.config.js
Normal file
5
babel.config.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
19
jsconfig.json
Normal file
19
jsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "es5",
|
||||||
|
"module": "esnext",
|
||||||
|
"baseUrl": "./",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lib": [
|
||||||
|
"esnext",
|
||||||
|
"dom",
|
||||||
|
"dom.iterable",
|
||||||
|
"scripthost"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
12319
package-lock.json
generated
Normal file
12319
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
49
package.json
Normal file
49
package.json
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
{
|
||||||
|
"name": "faultsystem",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"serve": "vue-cli-service serve",
|
||||||
|
"build": "vue-cli-service build",
|
||||||
|
"lint": "vue-cli-service lint"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"core-js": "^3.8.3",
|
||||||
|
"element-ui": "^2.4.5",
|
||||||
|
"vue": "^2.6.14",
|
||||||
|
"vue-router": "^3.5.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.12.16",
|
||||||
|
"@babel/eslint-parser": "^7.12.16",
|
||||||
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
|
"@vue/cli-plugin-eslint": "~5.0.0",
|
||||||
|
"@vue/cli-plugin-router": "~5.0.0",
|
||||||
|
"@vue/cli-service": "~5.0.0",
|
||||||
|
"axios": "^0.18.0",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"eslint-plugin-vue": "^8.0.3",
|
||||||
|
"vue-cli-plugin-axios": "^0.0.4",
|
||||||
|
"vue-cli-plugin-element": "^1.0.1",
|
||||||
|
"vue-template-compiler": "^2.6.14"
|
||||||
|
},
|
||||||
|
"eslintConfig": {
|
||||||
|
"root": true,
|
||||||
|
"env": {
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"extends": [
|
||||||
|
"plugin:vue/essential",
|
||||||
|
"eslint:recommended"
|
||||||
|
],
|
||||||
|
"parserOptions": {
|
||||||
|
"parser": "@babel/eslint-parser"
|
||||||
|
},
|
||||||
|
"rules": {}
|
||||||
|
},
|
||||||
|
"browserslist": [
|
||||||
|
"> 1%",
|
||||||
|
"last 2 versions",
|
||||||
|
"not dead"
|
||||||
|
]
|
||||||
|
}
|
BIN
public/favicon.ico
Normal file
BIN
public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
17
public/index.html
Normal file
17
public/index.html
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
1
public/mirror/css/chunk-vendors.10dd4e95.css
Normal file
1
public/mirror/css/chunk-vendors.10dd4e95.css
Normal file
File diff suppressed because one or more lines are too long
1
public/mirror/index.html
Normal file
1
public/mirror/index.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="http://101.35.140.199:8055/favicon.ico"><title>radarfaultsystem</title><script defer="defer" src="http://101.35.140.199:8055/js/chunk-vendors.bd62a80f.js"></script><script defer="defer" src="http://101.35.140.199:8055/js/app.784637d3.js"></script><link href="http://101.35.140.199:8055/css/chunk-vendors.10dd4e95.css" rel="stylesheet"><link href="http://101.35.140.199:8055/css/app.35c2f791.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but radarfaultsystem doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
23
src/App.vue
Normal file
23
src/App.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<router-view/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'app',
|
||||||
|
components: {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<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>
|
16
src/api/api.js
Normal file
16
src/api/api.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { request } from "@/plugins/axios";
|
||||||
|
|
||||||
|
export function SubmitForm(data){
|
||||||
|
return request({
|
||||||
|
url: '/api/faults/',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getStatus(){
|
||||||
|
return request(({
|
||||||
|
url:'/api/faults/dify/document/indexing-status',
|
||||||
|
method: 'get'
|
||||||
|
}))
|
||||||
|
}
|
BIN
src/assets/logo.png
Normal file
BIN
src/assets/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
58
src/components/HelloWorld.vue
Normal file
58
src/components/HelloWorld.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<div class="hello">
|
||||||
|
<h1>{{ msg }}</h1>
|
||||||
|
<p>
|
||||||
|
For a guide and recipes on how to configure / customize this project,<br>
|
||||||
|
check out the
|
||||||
|
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
|
||||||
|
</p>
|
||||||
|
<h3>Installed CLI Plugins</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Essential Links</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
|
||||||
|
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
|
||||||
|
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
|
||||||
|
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
|
||||||
|
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Ecosystem</h3>
|
||||||
|
<ul>
|
||||||
|
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
|
||||||
|
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
|
||||||
|
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
|
||||||
|
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'HelloWorld',
|
||||||
|
props: {
|
||||||
|
msg: String
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped>
|
||||||
|
h3 {
|
||||||
|
margin: 40px 0 0;
|
||||||
|
}
|
||||||
|
ul {
|
||||||
|
list-style-type: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
li {
|
||||||
|
display: inline-block;
|
||||||
|
margin: 0 10px;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
color: #42b983;
|
||||||
|
}
|
||||||
|
</style>
|
12
src/main.js
Normal file
12
src/main.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import './plugins/axios'
|
||||||
|
import App from './App.vue'
|
||||||
|
import router from './router'
|
||||||
|
import './plugins/element.js'
|
||||||
|
|
||||||
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
|
new Vue({
|
||||||
|
router,
|
||||||
|
render: h => h(App)
|
||||||
|
}).$mount('#app')
|
67
src/plugins/axios.js
Normal file
67
src/plugins/axios.js
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
import Vue from 'vue';
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
// Full config: https://github.com/axios/axios#request-config
|
||||||
|
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
|
||||||
|
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
|
||||||
|
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||||
|
|
||||||
|
let config = {
|
||||||
|
// baseURL: process.env.baseURL || process.env.apiUrl || ""
|
||||||
|
// timeout: 60 * 1000, // Timeout
|
||||||
|
// withCredentials: true, // Check cross-site Access-Control
|
||||||
|
|
||||||
|
//发送请求自动带上前缀
|
||||||
|
baseURL:process.env.VUE_APP_BASE_API,
|
||||||
|
};
|
||||||
|
|
||||||
|
const _axios = axios.create(config);
|
||||||
|
|
||||||
|
_axios.interceptors.request.use(
|
||||||
|
function(config) {
|
||||||
|
// Do something before request is sent
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
// Do something with request error
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add a response interceptor
|
||||||
|
_axios.interceptors.response.use(
|
||||||
|
function(response) {
|
||||||
|
// Do something with response data
|
||||||
|
return response;
|
||||||
|
},
|
||||||
|
function(error) {
|
||||||
|
// Do something with response error
|
||||||
|
return Promise.reject(error);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Plugin.install = function(Vue) {
|
||||||
|
Vue.axios = _axios;
|
||||||
|
window.axios = _axios;
|
||||||
|
Object.defineProperties(Vue.prototype, {
|
||||||
|
axios: {
|
||||||
|
get() {
|
||||||
|
return _axios;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
$axios: {
|
||||||
|
get() {
|
||||||
|
return _axios;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Vue.use(Plugin)
|
||||||
|
|
||||||
|
export default Plugin;
|
||||||
|
|
||||||
|
//导出供其他模块使用
|
||||||
|
export { _axios as request };
|
5
src/plugins/element.js
Normal file
5
src/plugins/element.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Element from 'element-ui'
|
||||||
|
import 'element-ui/lib/theme-chalk/index.css'
|
||||||
|
|
||||||
|
Vue.use(Element)
|
27
src/router/index.js
Normal file
27
src/router/index.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import VueRouter from 'vue-router'
|
||||||
|
import faultSystem from "@/views/faultSystem.vue";
|
||||||
|
|
||||||
|
Vue.use(VueRouter)
|
||||||
|
|
||||||
|
const routes = [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
name: 'fault',
|
||||||
|
component: faultSystem
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/about',
|
||||||
|
name: 'about',
|
||||||
|
// route level code-splitting
|
||||||
|
// this generates a separate chunk (about.[hash].js) for this route
|
||||||
|
// which is lazy-loaded when the route is visited.
|
||||||
|
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
const router = new VueRouter({
|
||||||
|
routes
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
5
src/views/AboutView.vue
Normal file
5
src/views/AboutView.vue
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<template>
|
||||||
|
<div class="about">
|
||||||
|
<h1>This is an about page</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
18
src/views/HomeView.vue
Normal file
18
src/views/HomeView.vue
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home">
|
||||||
|
<img alt="Vue logo" src="../assets/logo.png">
|
||||||
|
<HelloWorld msg="Welcome to Your Vue.js App"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// @ is an alias to /src
|
||||||
|
import HelloWorld from '@/components/HelloWorld.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'HomeView',
|
||||||
|
components: {
|
||||||
|
HelloWorld
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
509
src/views/faultSystem.vue
Normal file
509
src/views/faultSystem.vue
Normal file
@@ -0,0 +1,509 @@
|
|||||||
|
<template>
|
||||||
|
<div class="fault-form-page">
|
||||||
|
<div class="container">
|
||||||
|
<el-card class="page-header" shadow="never">
|
||||||
|
<div class="header-content">
|
||||||
|
<div class="header-left">
|
||||||
|
<el-avatar icon="el-icon-monitor" :size="40" class="brand-avatar"/>
|
||||||
|
<div class="title-wrap">
|
||||||
|
<div class="title">雷达问题提交系统</div>
|
||||||
|
<div class="subtitle">快速记录和跟踪雷达设备问题信息</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="header-right">
|
||||||
|
<el-tag type="info" effect="plain">必填项带“*”</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 分节标题:问题信息提交 -->
|
||||||
|
<el-card class="sub-header" shadow="never">
|
||||||
|
<div class="sub-header-inner">
|
||||||
|
<div class="left">
|
||||||
|
<i class="el-icon-notebook-2 icon"></i>
|
||||||
|
<span class="text">问题信息提交</span>
|
||||||
|
</div>
|
||||||
|
<div class="right">
|
||||||
|
<el-button type="text" disabled><i class="el-icon-star-on" style="margin-right:4px"></i>必填项带“*”
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" class="fault-form" label-position="left"
|
||||||
|
size="small">
|
||||||
|
<!-- 基本信息 -->
|
||||||
|
<el-card class="card-block" shadow="never">
|
||||||
|
<div slot="header" class="card-header">
|
||||||
|
<i class="el-icon-info"/>
|
||||||
|
<span>基本信息</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-row :gutter="12">
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="型号代号" prop="model_code" required>
|
||||||
|
<el-input v-model="form.model_code" placeholder="例:X-500"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="型号所属子列" prop="model_subcategory" required>
|
||||||
|
<el-input v-model="form.model_subcategory" placeholder="例:X-500-A">
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="天线类型" prop="antenna_type" required>
|
||||||
|
<el-input v-model="form.antenna_type" placeholder="请输入天线类型"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="地点" prop="location">
|
||||||
|
<el-input v-model="form.location" placeholder="例:北京·亦庄"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="阶段" prop="phase">
|
||||||
|
<el-input v-model="form.phase" placeholder="请输入阶段"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="问题提交人" prop="submitter" required>
|
||||||
|
<el-input v-model="form.submitter" placeholder="姓名/工号"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 环境信息 -->
|
||||||
|
<el-card class="card-block" shadow="never">
|
||||||
|
<div slot="header" class="card-header">
|
||||||
|
<i class="el-icon-circle-plus-outline"/>
|
||||||
|
<span>环境信息</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-row :gutter="12">
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="硬件环境" prop="hardware_env">
|
||||||
|
<el-input type="textarea" :rows="4" v-model="form.hardware_env"
|
||||||
|
placeholder="CPU/GPU/存储等硬件配置信息"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="软件环境" prop="software_env">
|
||||||
|
<el-input type="textarea" :rows="4" v-model="form.software_env"
|
||||||
|
placeholder="操作系统/中间件/版本等软件信息"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 问题信息 -->
|
||||||
|
<el-card class="card-block" shadow="never">
|
||||||
|
<div slot="header" class="card-header warn">
|
||||||
|
<i class="el-icon-warning-outline"/>
|
||||||
|
<span>问题信息</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-row :gutter="12" class="status-row">
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="工作状态" prop="work_status" required>
|
||||||
|
<el-radio-group v-model="form.work_status">
|
||||||
|
<el-radio label="运行中">运行中</el-radio>
|
||||||
|
<el-radio label="已停止">已停止</el-radio>
|
||||||
|
<el-radio label="异常">异常</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="问题类型" prop="fault_type" required>
|
||||||
|
<el-input v-model="form.fault_type" placeholder="请输入问题类型"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12" :md="8">
|
||||||
|
<el-form-item label="严重程度" prop="severity" required>
|
||||||
|
<el-select v-model="form.severity" placeholder="请选择严重程度" filterable>
|
||||||
|
<el-option v-for="opt in severityOptions" :key="opt.value" :label="opt.label" :value="opt.value">
|
||||||
|
<span :class="['severity-dot', opt.value]"></span>
|
||||||
|
<span>{{ opt.label }}</span>
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24">
|
||||||
|
<el-form-item label="问题关键字" prop="fault_keywords">
|
||||||
|
<el-input v-model="form.fault_keywords" placeholder="多个关键字用逗号分隔,便于后续检索"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<!-- 详细描述 -->
|
||||||
|
<el-card class="card-block" shadow="never">
|
||||||
|
<div slot="header" class="card-header">
|
||||||
|
<i class="el-icon-document"/>
|
||||||
|
<span>详细描述</span>
|
||||||
|
</div>
|
||||||
|
<div class="section-body">
|
||||||
|
<el-row :gutter="12">
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="问题描述" prop="fault_description" required>
|
||||||
|
<el-input type="textarea" :rows="5" v-model="form.fault_description" :maxlength="1000" show-word-limit
|
||||||
|
placeholder="请详细描述问题现象、发生时间、影响范围等"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="问题复现" prop="fault_reproduction">
|
||||||
|
<el-input type="textarea" :rows="5" v-model="form.fault_reproduction" :maxlength="1000"
|
||||||
|
show-word-limit placeholder="请描述问题复现的具体步骤"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="问题原因" prop="fault_reason">
|
||||||
|
<el-input type="textarea" :rows="5" v-model="form.fault_reason" :maxlength="1000" show-word-limit
|
||||||
|
placeholder="请描述初步分析的问题原因"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="解决措施" prop="resolution" required>
|
||||||
|
<el-input type="textarea" :rows="5" v-model="form.resolution" :maxlength="1000" show-word-limit
|
||||||
|
placeholder="请描述已采取或计划采取的解决措施"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="测试与验证" prop="validation">
|
||||||
|
<el-input type="textarea" :rows="4" v-model="form.validation" :maxlength="500" show-word-limit
|
||||||
|
placeholder="请描述验证结果和现状"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24" :sm="12">
|
||||||
|
<el-form-item label="举一反三" prop="lesson_learned">
|
||||||
|
<el-input type="textarea" :rows="4" v-model="form.lesson_learned" :maxlength="500" show-word-limit
|
||||||
|
placeholder="请总结经验教训和改进建议"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :xs="24">
|
||||||
|
<el-form-item label="排查人" prop="inspector" required>
|
||||||
|
<el-input v-model="form.inspector" placeholder="负责排查的人员姓名/工号"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<div class="form-actions">
|
||||||
|
<el-button type="primary" :loading="submitting" @click="onSubmit">提交问题信息</el-button>
|
||||||
|
<el-button @click="onReset">重置表单</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getStatus, SubmitForm} from "@/api/api";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'faultSystem',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
submitting: false,
|
||||||
|
severityOptions: [
|
||||||
|
{label: '紧急', value: 'P0'},
|
||||||
|
{label: '高', value: 'P1'},
|
||||||
|
{label: '中', value: 'P2'},
|
||||||
|
{label: '低', value: 'P3'}
|
||||||
|
],
|
||||||
|
form: {
|
||||||
|
// 基本信息
|
||||||
|
model_code: null,
|
||||||
|
model_subcategory :null,
|
||||||
|
antenna_type :null,
|
||||||
|
location :null,
|
||||||
|
hardware_env :null,
|
||||||
|
software_env :null,
|
||||||
|
phase :null,
|
||||||
|
submitter :null,
|
||||||
|
work_status :null,
|
||||||
|
fault_keywords :null,
|
||||||
|
fault_description :null,
|
||||||
|
fault_reproduction :null,
|
||||||
|
fault_analysis :null,
|
||||||
|
fault_reason :null,
|
||||||
|
fault_type :null,
|
||||||
|
severity :null,
|
||||||
|
resolution :null,
|
||||||
|
validation :null,
|
||||||
|
lesson_learned :null,
|
||||||
|
inspector :null
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
model_code: [
|
||||||
|
{required: true, message: '请输入型号代号', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
model_subcategory: [
|
||||||
|
{required: true, message: '请输入所属子列', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
antenna_type: [
|
||||||
|
{required: true, message: '请输入天线类型', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
submitter: [
|
||||||
|
{required: true, message: '请输入问题提交人', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
work_status: [
|
||||||
|
{required: true, message: '请选择工作状态', trigger: 'change'}
|
||||||
|
],
|
||||||
|
fault_type: [
|
||||||
|
{required: true, message: '请输入问题类型', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
severity: [
|
||||||
|
{required: true, message: '请选择严重程度', trigger: 'change'}
|
||||||
|
],
|
||||||
|
fault_description: [
|
||||||
|
{required: true, message: '请填写问题描述', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
resolution: [
|
||||||
|
{required: true, message: '请填写解决措施', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
inspector: [
|
||||||
|
{required: true, message: '请输入排查人', trigger: 'blur'}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
onSubmit() {
|
||||||
|
this.$refs.formRef.validate(async valid => {
|
||||||
|
if (!valid) {
|
||||||
|
this.$message.warning('请先完善必填项');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
getStatus().then(res=>{
|
||||||
|
if(res.data.status === 'succeed'){
|
||||||
|
SubmitForm(this.form);
|
||||||
|
this.$message.success('提交成功');
|
||||||
|
this.onReset();
|
||||||
|
}else{
|
||||||
|
this.$message.error('提交失败,请稍后再试');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} finally {
|
||||||
|
this.submitting = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onReset() {
|
||||||
|
this.$refs.formRef.resetFields()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.fault-form-page {
|
||||||
|
background: #f5f7fa;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-header {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-avatar {
|
||||||
|
background-color: #13ce66;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-header {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 4px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-header-inner {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-header .left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-header .icon {
|
||||||
|
margin-right: 6px;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-wrap {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-block {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header i {
|
||||||
|
margin-right: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header.warn {
|
||||||
|
color: #e6a23c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-body {
|
||||||
|
background: #f5f7fa;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 禁止label换行,避免中文被折到下一行导致错位 */
|
||||||
|
.fault-form-page >>> .el-form-item__label {
|
||||||
|
white-space: nowrap;
|
||||||
|
padding-right: 0; /* 贴近输入框 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 必填星号与文字更紧凑 */
|
||||||
|
.fault-form-page >>> .el-form-item.is-required .el-form-item__label:before {
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 统一 small 尺寸表单项的垂直对齐和行高 */
|
||||||
|
.fault-form-page >>> .el-form-item--small .el-form-item__label {
|
||||||
|
line-height: 32px;
|
||||||
|
height: 32px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-end; /* 文本右对齐,贴近输入框 */
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-form-item--small .el-form-item__content {
|
||||||
|
line-height: 32px;
|
||||||
|
min-height: 32px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 统一输入框高度 */
|
||||||
|
.fault-form-page >>> .el-input--small .el-input__inner {
|
||||||
|
height: 32px;
|
||||||
|
line-height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 全局收紧每个表单项的下间距 */
|
||||||
|
.fault-form-page >>> .el-form-item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-row .el-form-item {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-actions {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 严重程度选项前置彩色圆点(自定义slot) */
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item .severity-dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
margin-right: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item .severity-dot.P3 { /* 低 */
|
||||||
|
background: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item .severity-dot.P2 { /* 中 */
|
||||||
|
background: #e6a23c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item .severity-dot.P1 { /* 高 */
|
||||||
|
background: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fault-form-page >>> .el-select-dropdown__item .severity-dot.P0 { /* 紧急 */
|
||||||
|
background: #f5222d;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
/* 全局样式:用于 body 上的下拉弹层,渲染严重程度的彩色圆点 */
|
||||||
|
.el-select-dropdown__item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item .severity-dot {
|
||||||
|
display: inline-block;
|
||||||
|
width: 8px;
|
||||||
|
height: 8px;
|
||||||
|
margin-right: 8px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #c0c4cc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item .severity-dot.P3 { /* 低 */
|
||||||
|
background: #67c23a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item .severity-dot.P2 { /* 中 */
|
||||||
|
background: #e6a23c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item .severity-dot.P1 { /* 高 */
|
||||||
|
background: #f56c6c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__item .severity-dot.P0 { /* 紧急 */
|
||||||
|
background: #f5222d;
|
||||||
|
}
|
||||||
|
</style>
|
17
vue.config.js
Normal file
17
vue.config.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
// 配置解决跨域问题
|
||||||
|
module.exports = {
|
||||||
|
devServer:{
|
||||||
|
host:'localhost',//指定开发服务器主机地址
|
||||||
|
port:8088,//设置前端项目端口号为8088
|
||||||
|
open:true,//启动时自动打开浏览器
|
||||||
|
proxy:{//配置代理解决跨域问题
|
||||||
|
[process.env.VUE_APP_BASE_API]:{//环境变量定义代理路径前缀
|
||||||
|
target: 'http://192.168.0.10:8000',//后端项目真实地址
|
||||||
|
changeOrigin:true,//开启origin伪装,绕过跨域限制
|
||||||
|
pathRewrite: {//路径重写规则
|
||||||
|
['^' + process.env.VUE_APP_BASE_API]: ''//去除请求路径中的代理前缀
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user