浏览代码

配置界面

jiangniuniu 4 年之前
父节点
当前提交
60ac91ed32
共有 8 个文件被更改,包括 227 次插入4 次删除
  1. 1 1
      components/tm-tabbar/tm-tabbar.vue
  2. 6 0
      pages.json
  3. 143 0
      pages/configure/configure.vue
  4. 29 0
      pages/configure/model.js
  5. 25 0
      pages/configure/server.js
  6. 2 1
      pages/model.js
  7. 3 2
      utils/request.js
  8. 18 0
      yarn.lock

+ 1 - 1
components/tm-tabbar/tm-tabbar.vue

@@ -54,7 +54,7 @@
 						text: '配置', 
 						text: '配置', 
 						iconPath: '/static/tabbar/setting-unselect.png', 
 						iconPath: '/static/tabbar/setting-unselect.png', 
 						selectedIconPath: '/static/tabbar/setting-select.png', 
 						selectedIconPath: '/static/tabbar/setting-select.png', 
-						pagePath: 'pages/index/index'
+						pagePath: 'pages/configure/configure'
 					},{
 					},{
 						text: '我的', 
 						text: '我的', 
 						iconPath: '/static/tabbar/my-unselect.png', 
 						iconPath: '/static/tabbar/my-unselect.png', 

+ 6 - 0
pages.json

@@ -16,6 +16,12 @@
 			  "navigationBarTitleText": "任务",
 			  "navigationBarTitleText": "任务",
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
+		},{
+			"path": "pages/configure/configure",
+			"style": {
+			  "navigationBarTitleText": "配置",
+				"enablePullDownRefresh": false
+			}
 		}
 		}
   ],
   ],
 	"globalStyle": {
 	"globalStyle": {

+ 143 - 0
pages/configure/configure.vue

@@ -0,0 +1,143 @@
+<template>
+	<view class="configure-page">
+		<view class="greyTitle">为结果选项配置后续操作</view>
+		<view v-for="(item,index) in resultConfigList" :key="index" class="configure-cont">
+			<text class="contTitle">{{item.name}}</text>
+			<text class="contCont" v-for="items in configList" v-if="item.resultType == items.key">{{items.name}}</text>
+			<image src="../../static/查看更多_.png" class="moreImg" @click="showConfig(item,index)"></image>
+		</view>
+		<view class="sure-button">
+			<button @click="sureList">保存</button>
+		</view>
+		<view class="recovery" @click="recoveryList">恢复初始配置</view>
+	  <tm-tabbar :permission="1" />
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				resultConfigList:[],
+				configList:[
+					{
+						key:'1',
+						name:'无需操作',
+					},{
+						key:'2',
+						name:'需改善回复',
+					},{
+						key:'3',
+						name:'需使用改善工具',
+					}
+				],
+				showPopup:false,
+				radioVal:null,
+				index:null,
+			}
+		},
+		created() {
+			this.getResultConfig()
+		},
+		methods: {
+			//获取最新配置
+			getResultConfig(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'getResultConfig'
+					}
+				}).then(res=>{
+					this.resultConfigList = res?res:[];
+				})
+			},
+			//恢复最初配置
+			recoveryList(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'getDefault'
+					}
+				}).then((res)=>{
+					// console.log(res)
+					// this.resultConfigList = res?res:[];
+				})
+			},
+			//保存配置
+			sureList(){
+				this.$store.dispatch({
+					type:'configure/commActions',
+					payload:{
+						key:'postResultConfig',
+						data:{
+							list:this.resultConfigList
+						}
+					}
+				}).then(res=>{
+					// console.log(res,'kkkk')
+					this.getResultConfig();
+					// this.resultConfigList = res?res:[];
+				})
+			}
+		},
+		components: {
+		}
+	}
+</script>
+
+<style lang="less">
+	.configure-page{
+		height: 100%;
+		background-color: #F5F6FA;
+		.greyTitle{
+			padding-left:25rpx;
+			height: 105rpx;
+			line-height: 105rpx;
+			font-size: 30rpx;
+			color: #292C33;
+		}
+		.configure-cont{
+			padding-left:25rpx;
+			font-size: 22.5rpx;
+			line-height: 87.5rpx;
+			border-bottom: 0.62rpx solid #DADEE6;
+			background-color: #fff;
+			.contTitle{
+				display: inline-block;
+				width: 175rpx;
+				color: #525866;
+			}
+			.contCont{
+				color: #292C33;
+			}
+			.moreImg{
+				margin-top: 31.23rpx;
+				margin-right: 18.68rpx;
+				padding: 1.89rpx 6.31rpx;
+				float: right;
+				width: 12.37rpx;
+				height: 21.21rpx;
+			}
+		}
+		.configure-cont:nth-child(6){
+			border-bottom: none;
+		}
+		.sure-button{
+			margin: 35rpx auto;
+			button{
+				width: 625rpx;
+				height: 62.5rpx;
+				line-height: 62.5rpx;
+				border-radius: 37.5rpx;
+				background-color: #3377FF;
+				color: #fff;
+				font-size: 22.5rpx;
+			}
+		}
+		.recovery{
+			text-align: center;
+			color: #7A8599;
+			font-size: 22.5rpx;
+		}
+	}
+</style>

+ 29 - 0
pages/configure/model.js

@@ -0,0 +1,29 @@
+import { commServer } from './server.js';
+
+export default {
+  namespaced: true,
+  state: {
+    // baseInfo: 'test',
+    // // 包含院区,病区, 床号
+    // patParams: {
+    //   hiId: '1',
+    //   wardDm: '-10022',
+    //   bedNo: '201'
+    // }
+  },
+  mutations: {
+  //   changeBaseInfo(state, { baseInfo }) {
+  //     state.baseInfo = baseInfo;
+  //   },
+  //   // 修改第三方应用传递的参数
+  //   changePatParams(state, { patParams }) {
+  //     state.patParams = patParams;
+  //   },
+  },
+  actions: {
+    commActions({ commit, state }, { payload }) {
+	  // payload = {key,data} // data是请求数据,key是请求接口id
+      return commServer(payload);
+	},
+  }
+}

+ 25 - 0
pages/configure/server.js

@@ -0,0 +1,25 @@
+import { creatRequest } from '../../utils/request.js';
+
+const requestList = {
+	// 保存配置
+	postResultConfig: {
+		method: 'POST',
+		url: 'imed/pfm/resultConfig'
+	},
+	//最新配置
+	getResultConfig:{
+		method: 'GET',
+		url: 'imed/pfm/resultConfig'
+	},
+	//默认配置列表
+	getDefault:{
+		method: 'GET',
+		url: 'imed/pfm/resultConfig/default'
+	}
+	
+};
+
+export const commServer = ({ key, data }) => {
+  let obj = requestList[key];
+  return creatRequest(obj, data);
+}

+ 2 - 1
pages/model.js

@@ -1,3 +1,4 @@
-
+import configure from './configure/model.js';
 export default module = {
 export default module = {
+	configure
 }
 }

+ 3 - 2
utils/request.js

@@ -8,7 +8,7 @@
 import { URL } from "./requestUrl";
 import { URL } from "./requestUrl";
 import { stringify } from 'qs';
 import { stringify } from 'qs';
 
 
-const BASE_URL = `${URL}/topro/`;
+const BASE_URL = `${URL}/`;
 let AllRequestNum = 0; // 存放请求数,以保证有请求未返回就持续loading
 let AllRequestNum = 0; // 存放请求数,以保证有请求未返回就持续loading
 
 
 /**
 /**
@@ -48,7 +48,8 @@ function request(url, options, additional) {
   // 模拟token,做登录的同学将这行代码移到登录成功函数中.
   // 模拟token,做登录的同学将这行代码移到登录成功函数中.
 
 
   // uni.setStorageSync('token', 'MjU2OzE2MTE2MjIxODYwNjM7OGJjMTA2ZjNhMzMyNGUxOTRhMmFlMGExOThjMzA5OGE=');
   // uni.setStorageSync('token', 'MjU2OzE2MTE2MjIxODYwNjM7OGJjMTA2ZjNhMzMyNGUxOTRhMmFlMGExOThjMzA5OGE=');
-  const token = uni.getStorageSync('token');
+  // const token = uni.getStorageSync('token');
+  const token = '/JY28U+aEf4jsMZoXx4jVKJl1iCZjBfMgEiS8wzU8Ts='
   return uni.request({
   return uni.request({
     url: `${BASE_URL}${url}`,
     url: `${BASE_URL}${url}`,
     ...options,
     ...options,

+ 18 - 0
yarn.lock

@@ -0,0 +1,18 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+moment@^2.29.1:
+  version "2.29.1"
+  resolved "https://registry.npm.taobao.org/moment/download/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+  integrity sha1-sr52n6MZQL6e7qZGnAdeNQBvo9M=
+
+qs@^6.9.6:
+  version "6.9.6"
+  resolved "https://registry.npm.taobao.org/qs/download/qs-6.9.6.tgz?cache=0&sync_timestamp=1610598111557&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee"
+  integrity sha1-Ju08gkOkMbKSSsqEzJBHHzXVoO4=
+
+vuex@^3.6.0:
+  version "3.6.2"
+  resolved "https://registry.npm.taobao.org/vuex/download/vuex-3.6.2.tgz?cache=0&sync_timestamp=1611672210051&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvuex%2Fdownload%2Fvuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
+  integrity sha1-I2vAhqhww655lG8QfxbeWdWJXnE=