From 9222905ff817796cfb618c7e1fd5f7b768effcea Mon Sep 17 00:00:00 2001 From: 李林 <z1292839451@163.com> Date: 星期一, 21 八月 2023 09:14:03 +0800 Subject: [PATCH] 修改部分全局样式 --- .env.development | 2 src/views/home/index.vue | 3 src/main.js | 8 + src/api/url.js | 7 + src/views/experiment/planAssignments/plan.vue | 255 ++++++++++++++++++++++++++++++++++++++++++ src/layout/components/AppMain.vue | 3 src/App.vue | 59 +++++++++ src/router/index.js | 2 8 files changed, 334 insertions(+), 5 deletions(-) diff --git a/.env.development b/.env.development index e363056..e5e7b7a 100644 --- a/.env.development +++ b/.env.development @@ -2,4 +2,4 @@ ENV = 'development' # base api -VUE_APP_BASE_API = 'http://192.168.110.254:1234/' +VUE_APP_BASE_API = 'http://localhost:1234/' diff --git a/src/App.vue b/src/App.vue index ec9032c..a25f956 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,3 +9,62 @@ name: 'App' } </script> + +<style> + #app{ + overflow: hidden !important; + } + + .breadcrumb-container{ + height: 40px; + } + .app-main{ + margin-top: 41px !important; + } + + .el-menu-item{ + width: 100%; + } + + /* 鍏ㄥ眬妯℃�佹鏍峰紡 */ + .el-dialog{ + border-radius: 10px; + overflow: hidden; + } + + .el-dialog__header,.el-message-box__header { + box-sizing: border-box; + height: 46px; + border-bottom: 1px solid rgb(238, 238, 238); + padding: 0px; + padding-left: 18px; + display: flex; + align-items: center; + background-color: #069cff; + } + + .el-dialog__header *{ + font-size: 16px !important; + color: #fff; + } + + .el-dialog__headerbtn .el-dialog__close{ + color: #fff; + top: -20px; + } + + .el-dialog__headerbtn{ + top: initial; + } + + .el-dialog__footer .el-button * { + font-size: 14px !important; + } + + .el-dialog__footer .el-button { + height: 36px; + border: 1px solid rgba(190, 190, 190, 0.44); + box-shadow: 0px 2px 4px rgba(220, 220, 220, 0.41); + padding: 0 14px; + } +</style> diff --git a/src/api/url.js b/src/api/url.js new file mode 100644 index 0000000..5f8f97d --- /dev/null +++ b/src/api/url.js @@ -0,0 +1,7 @@ +const url = { +} + +export default function(Vue) { + //娣诲姞鍏ㄥ眬API + Vue.prototype.$url = url +} \ No newline at end of file diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index e9e0b9f..6b65965 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -28,12 +28,11 @@ <style lang="scss" scoped> .app-main { /* 88 = navbar+baredcrumb */ - min-height: calc(100vh - 88px); + height: calc(100vh - 88px); width: 100%; position: relative; overflow: hidden; >div{ - min-height: calc(100vh - 88px); height: 100%; width: 100%; } diff --git a/src/main.js b/src/main.js index 6319eed..e996df0 100644 --- a/src/main.js +++ b/src/main.js @@ -17,6 +17,8 @@ import '@/icons' // icon import '@/permission' // permission control +import url from './api/url.js' + /** * If you don't want to use mock-server * you want to use MockJs for mock api @@ -30,11 +32,17 @@ mockXHR() } +Vue.prototype.HaveJson = (val) => { + return JSON.parse(JSON.stringify(val)) +} + // set ElementUI lang to EN Vue.use(ElementUI, { locale }) // 濡傛灉鎯宠涓枃鐗� element-ui锛屾寜濡備笅鏂瑰紡澹版槑 // Vue.use(ElementUI) +Vue.use(url); + Vue.config.productionTip = false new Vue({ diff --git a/src/router/index.js b/src/router/index.js index ba88b65..ab7ed2d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -199,7 +199,7 @@ { path: 'planAssignments', name: 'PlanAssignments', - component: () => import('@/views/experiment/planAssignments/index'), + component: () => import('@/views/experiment/planAssignments/plan'), meta: { title: '妫�楠岃鍒�', icon: 'tree' } }, { diff --git a/src/views/experiment/planAssignments/plan.vue b/src/views/experiment/planAssignments/plan.vue new file mode 100644 index 0000000..0d931cc --- /dev/null +++ b/src/views/experiment/planAssignments/plan.vue @@ -0,0 +1,255 @@ +<style scoped> + .plan { + width: 100%; + } + + .title { + height: 60px; + width: calc(100% - 20px); + background-color: white; + margin: 5px 10px; + display: flex; + align-items: center; + padding: 0 30px; + } + + .thing { + margin: 10px; + padding: 15px; + background-color: white; + height: calc(100vh - 15vh); + } +</style> +<style> + .plan .has-gutter tr th { + background-color: #f5f7fa !important; + color: #333; + } + + .plan .cell { + color: #333; + } +</style> + +<template> + <div class="plan"> + <div class="title"> + <span>椤圭洰鍚嶇О锛�</span> + <el-input v-model="search.name" size="medium" style="width: 200px;margin-right: 20px;"></el-input> + <span>妫�楠屾椂闂达細</span> + <el-date-picker v-model="search.date" type="daterange" range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" + end-placeholder="缁撴潫鏃ユ湡" size="medium" style="margin-right: 20px;"> + </el-date-picker> + <span>妫�楠屼汉锛�</span> + <el-input v-model="search.userName" size="medium" style="width: 200px;margin-right: 20px;"></el-input> + <el-button size="small" type="primary">鏌ヨ</el-button> + <el-button size="small">閲嶇疆</el-button> + </div> + <div class="thing"> + <el-table :data="tableData" style="width: 100%;" row-key="id" default-expand-all + :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :key="upIndex"> + <el-table-column type="index" width="50" label="搴忓彿"> + </el-table-column> + <el-table-column prop="date" label="鐢宠鍗曞彿"> + </el-table-column> + <el-table-column prop="name" label="妫�楠岀粨鏋�"> + </el-table-column> + <el-table-column prop="address" label="鍦板潃"> + </el-table-column> + <el-table-column label="鎿嶄綔" width="80"> + <template slot-scope="scope"> + <el-button size="mini" type="primary" v-if="isIfReport(scope.row)">涓婃姤</el-button> + <el-button size="mini" type="warning" @click="openUpDia(scope.row)" + v-else-if="scope.row.insId==undefined&&scope.row.address==null">鍒嗛厤</el-button> + <el-button size="mini" type="success" @click="openUpInsDia(scope.row)" + v-else-if="scope.row.insId==undefined&&scope.row.name==null">妫�楠�</el-button> + </template> + </el-table-column> + </el-table> + </div> + <el-dialog title="鍒嗛厤璁惧鍜屼汉鍛�" :visible.sync="upDia" width="500px" top="30vh"> + <div class="body"> + <el-row style="line-height: 46px;"> + <el-col :span="4" style="font-size: 14px;text-align: right;">浜哄憳:</el-col> + <el-col :span="16" :offset="1"> + <el-input v-model="upData.address" size="small" clearable></el-input> + </el-col> + </el-row> + </div> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitUpData">纭� 瀹�</el-button> + <el-button @click="upDia = false">鍙� 娑�</el-button> + </span> + </el-dialog> + <el-dialog title="妫�楠�" :visible.sync="upInsDia" width="500px"> + <div class="body" style="max-height: 50vh;overflow-y: auto;"> + <el-row style="line-height: 46px;"> + <el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧缂栫爜锛�</el-col> + <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="4" style="font-size: 14px;text-align: right;">鏍峰搧鍚嶇О锛�</el-col> + <el-col :span="8">{{upData.date}}</el-col> + </el-row> + <el-row style="line-height: 46px;"> + <el-col :span="4" style="font-size: 14px;text-align: right;">妫�楠岄」鐩細</el-col> + <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="4" style="font-size: 14px;text-align: right;">鍗曚綅锛�</el-col> + <el-col :span="8">{{upData.date}}</el-col> + </el-row> + <el-row style="line-height: 46px;"> + <el-col :span="4" style="font-size: 14px;text-align: right;">鏍囧噯鍊硷細</el-col> + <el-col :span="8">{{upData.date}}</el-col> + <el-col :span="4" style="font-size: 14px;text-align: right;">鍐呮帶鍊硷細</el-col> + <el-col :span="8">{{upData.date}}</el-col> + </el-row> + <el-row style="line-height: 46px;"> + <el-col style="text-align: right;"><el-button size="mini" @click="addRes">娣诲姞妫�楠屽��</el-button></el-col> + </el-row> + <el-row> + <el-col> + <el-table :data="upData.res" border style="width: 99.9%;" :key="upIndex2"> + <el-table-column type="index" width="100" label="搴忓彿"> + </el-table-column> + <el-table-column label="妫�楠屽��"> + <template slot-scope="scope"> + <el-input v-model.number="scope.row.number" size="small" clearable placeholder="璇疯緭鍏�" + @change="(val)=>scope.row.number = isNaN(val)?null:val"> + </el-input> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" width="60"> + <template slot-scope="scope"> + <el-button size="mini" type="text" + @click.native.prevent="deleteRow(scope.$index, upData.res)">鍒犻櫎</el-button> + </template> + </el-table-column> + </el-table> + </el-col> + </el-row> + </div> + <span slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitUpData">鎻� 浜�</el-button> + <el-button @click="upInsDia = false">鍙� 娑�</el-button> + </span> + </el-dialog> + </div> +</template> + +<script> + export default { + data() { + return { + search: { + name: null, + date: [], + userName: null, + }, + tableData: [{ + id: 1, + insId: 123, + date: '2016-05-02', + name: null, + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1518 寮�', + children: [{ + id: 33, + date: '2016-05-01', + name: null, + res: '[{"number": 1},{"number": 2}]', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' + }, { + id: 34, + date: '2016-05-01', + name: null, + res: '[{"number": 1,"res": "涓嶅悎鏍�"},{"number": 2}]', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' + }] + }, { + id: 2, + insId: 123, + date: '2016-05-04', + name: null, + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1517 寮�', + children: [] + }, { + id: 3, + insId: 123, + date: '2016-05-01', + children: [{ + id: 31, + date: '2016-05-01', + name: null, + res: '[{"number": 1},{"number": 2}]', + address: '涓婃捣甯傛櫘闄�鍖洪噾娌欐睙璺� 1519 寮�' + }, { + id: 32, + date: '2016-05-01', + name: null, + res: '[]', + address: null + }] + }], + upDia: false, + upData: {}, + upIndex: 0, + upInsDia: false, + upIndex2: 0 + } + }, + mounted() { + this.selectDataList() + }, + methods: { + selectDataList() { + this.tableData.forEach(a => { + a.code = '[1]' + if (a.children != undefined) { + a.children.forEach(b => { + b.code = '[2]' + b.res = JSON.parse(b.res) + }) + } + }) + this.upIndex++ + }, + isIfReport(row) { + var count = 0 + if (row.children == undefined) return false + row.children.forEach(a => { + if (a.name != null && a.name != undefined) count++ + }) + return row.insId != undefined && count == row.children.length + }, + openUpDia(row) { + this.upDia = true + this.upData = { + id: row.id, + address: row.address + } + }, + submitUpData() { + this.tableData.forEach(a => { + a.children.forEach(b => { + if (b.id == this.upData.id) { + b.address = this.upData.address + } + }) + }) + this.$message.success('淇敼鎴愬姛') + this.upIndex++ + this.upDia = false + }, + openUpInsDia(row) { + this.upInsDia = true + this.upData = this.HaveJson(row) + }, + deleteRow(index, rows) { + rows.splice(index, 1); + }, + addRes() { + this.upData.res.push({ + "number": null + }) + this.upIndex2++ + } + } + } +</script> \ No newline at end of file diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 8415e5c..f876061 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -94,4 +94,5 @@ } } } -</style> + +</style> \ No newline at end of file -- Gitblit v1.9.3