tabAll.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div class="bg">
  3. <!-- <van-nav-bar
  4. title="智慧“和顺”"
  5. left-text="民宗干事"
  6. left-arrow
  7. @click-left="onClickLeft"
  8. /> -->
  9. <!-- <van-image
  10. width="100%"
  11. height="10rem"
  12. fit="cover"
  13. src="https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400"
  14. /> -->
  15. <van-swipe :autoplay="3000" lazy-render>
  16. <van-swipe-item v-for="image in BannerImgurls" :key="image">
  17. <van-image width="100%" height="10rem" fit="cover" :src="image" />
  18. </van-swipe-item>
  19. </van-swipe>
  20. <div class="tabtitlelay" @click="goToBeDone">
  21. <div class="tabtitle1"></div>
  22. <div class="tabtitle">我的待办</div>
  23. <div class="tabtitle2">(</div>
  24. <div class="tabtitle3">{{ sum }}</div>
  25. <div class="tabtitle4">)</div>
  26. <van-icon name="ellipsis" class="tabtitle5" />
  27. </div>
  28. <div class="flexll">
  29. <div class="ffl2" id="0" @click="goToBeDone($event)">
  30. <div class="textRegular">待处理</div>
  31. <div class="textRed">{{ sum1 ? sum1 : 0 }}</div>
  32. </div>
  33. <div class="verticalLine"></div>
  34. <div class="ffl2" id="1" @click="goToBeDone($event)">
  35. <div class="textRegular">已处理</div>
  36. <div class="textBlue">{{ sum2 ? sum2 : 0 }}</div>
  37. </div>
  38. </div>
  39. <div class="hLine"></div>
  40. <div class="tabtitlelay">
  41. <div class="tabtitle1"></div>
  42. <div class="tabtitle">场所管理</div>
  43. </div>
  44. <van-grid :border="false">
  45. <van-grid-item icon="./loginbg/csdj.png" text="场所登记" @click="goPlaceRegister" />
  46. <van-grid-item icon="./loginbg/csry.png" text="场所人员信息" @click="goPlacePerson" />
  47. <van-grid-item icon="./loginbg/cspw.png" text="牌位管理" @click="goPlaceTablet" />
  48. <van-grid-item icon="./loginbg/csxf.png" text="场所消防" @click="PlaceFirefighting" />
  49. </van-grid>
  50. <div class="hLine"></div>
  51. <div class="tabtitlelay">
  52. <div class="tabtitle1"></div>
  53. <div class="tabtitle">{{ testshow }}</div>
  54. </div>
  55. <van-grid :border="false">
  56. <van-grid-item icon="./loginbg/hd_cshd.png" @click="placeActivity" text="场所活动" />
  57. <van-grid-item icon="./loginbg/hd_jc.png" text="场所检查" @click="tohd_jc" />
  58. <van-grid-item icon="./loginbg/hd_hy.png" text="负责人会议" @click="tohd_hy" />
  59. </van-grid>
  60. <div class="tabtitlelay">
  61. <div class="tabtitle1"></div>
  62. <div class="tabtitle">{{ testshow2 }}</div>
  63. </div>
  64. <van-grid :border="false">
  65. <van-grid-item icon="./loginbg/hd_ssjhd.png" @click="selfMeetingList" text="私设聚会点" />
  66. <van-grid-item icon="./loginbg/hd_xjqz.png" @click="abnormalCrowd" text="信教群众异常" />
  67. <van-grid-item icon="./loginbg/hd_af.png" text="安防设施异常" @click="tohd_af" />
  68. <van-grid-item icon="./loginbg/hd_qt.png" text="其他有害信息" @click="tohd_qt" />
  69. </van-grid>
  70. </div>
  71. </template>
  72. <script>
  73. import tool from "@/tool";
  74. import qs from "qs";
  75. import userSets from "@/api/sys/userSets";
  76. import toBeDone from '@/api/toBeDone/toBeDone';
  77. import $base from "@/utils/config";
  78. export default {
  79. data() {
  80. return {
  81. title: '民宗干事',
  82. username: "",
  83. sms: "",
  84. password: "",
  85. password2: "",
  86. con1: 0,
  87. con2: 0,
  88. testshow: "活动管理",
  89. testshow2: "异常监管",
  90. sum: "0",
  91. sum1: "0",
  92. sum2: "0",
  93. BannerImgurls: ['https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400', 'https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400']
  94. }
  95. },
  96. created() {
  97. let id = this.$route.query.id;
  98. window.xm.setNavigationBarTitle({ title: '宗教和顺' })
  99. this.TokenLogin2();
  100. this.$dictUtils.refreshDictList();
  101. },
  102. methods: {
  103. // 待办跳转
  104. goToBeDone(e) {
  105. let value = JSON.stringify(e.currentTarget.id)
  106. this.$router.push({
  107. path: "/toBeDone",
  108. query: { "name": value }
  109. });
  110. },
  111. // 场所登记跳转
  112. goPlaceRegister() {
  113. this.$router.push("/placeRegisterList");
  114. },
  115. // 人员档案跳转
  116. goPlacePerson() {
  117. this.$router.push("/placePerson");
  118. },
  119. // 牌位管理跳转
  120. goPlaceTablet() {
  121. this.$router.push("/placeTablet");
  122. },
  123. //场所消防
  124. PlaceFirefighting(){
  125. this.$router.push("/placeFirefightingList");
  126. },
  127. //待办数据获取
  128. dataNumber() {
  129. new toBeDone().list().then((res) => {
  130. this.sum1 = res.records.length;
  131. this.sum = this.sum1 + this.sum2;
  132. })
  133. new toBeDone().list2().then((res1) => {
  134. this.sum2 = res1.records.length;
  135. this.sum = this.sum1 + this.sum2;
  136. })
  137. },
  138. onClickLeft() {
  139. history.back();
  140. },
  141. tohd_jc() {
  142. //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
  143. this.$router.push("/siteInspectionList");
  144. },
  145. tohd_af() {
  146. this.$router.push("/securityFacilitiesErrList");
  147. },
  148. tohd_hy() {
  149. this.$router.push("/religiousConferenceList");
  150. },
  151. tohd_qt() {
  152. this.$router.push("/nonReligiousInformationList");
  153. },
  154. // 活动场所
  155. placeActivity() {
  156. this.$router.push("/placeActivityList")
  157. },
  158. selfMeetingList() {
  159. this.$router.push("/selfMeetingList")
  160. },
  161. abnormalCrowd() {
  162. this.$router.push("/differentbelieversList")
  163. },
  164. async TokenLogin() {
  165. let that = this;
  166. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  167. if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
  168. //SDK中 getToken() 方法获取免登token
  169. //window.xm.getToken().then(async function(token){//上线取消注释
  170. let token = "test";//上线注释
  171. const inputForm = qs.stringify({
  172. 'token': token
  173. }, { allowDots: true, arrayFormat: 'indices' })
  174. var res = await this.$API.yin.TokenLogin.get(inputForm);
  175. //存PCtoken
  176. this.$store.commit('setPcToken', res.PcToken);
  177. this.$store.commit('setUser', res.account);
  178. //})//上线取消注释
  179. }
  180. },
  181. TokenLogin2() {
  182. let that = this;
  183. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  184. if (this.$store.state.pctoken == "" || this.$store.state.pctoken == undefined) {
  185. //SDK中 getToken() 方法获取免登token
  186. window.xm.getToken().then(async function (token) {//上线取消注释
  187. // let token = "test";//上线注释
  188. new userSets()
  189. .TokenLogin({
  190. token: token
  191. })
  192. .then((res) => {
  193. xm.showToast({
  194. message: "111"+res.header['Set-Cookie'],
  195. });
  196. that.$store.commit('setPcToken', res.PcToken);
  197. that.$store.commit('setUser', res.account);
  198. that.getBannerImg();//获取轮播图
  199. that.getSelectColor();//获取主题颜色
  200. that.dataNumber();//获取待办事项数
  201. });
  202. })//上线取消注释
  203. } else {
  204. that.getBannerImg();//获取轮播图
  205. that.getSelectColor();//获取主题颜色
  206. that.dataNumber();//获取待办事项数
  207. }
  208. },
  209. getStatistics() {
  210. let that = this;
  211. new userSets()
  212. .Statistics()
  213. .then((res) => {
  214. if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
  215. that.sum = res[0].sum;
  216. }
  217. if (res[0].sum1 != undefined && res[0].sum1 != null && res[0].sum1 != "") {
  218. that.sum1 = res[0].sum1;
  219. }
  220. if (res[0].sum2 != undefined && res[0].sum2 != null && res[0].sum2 != "") {
  221. that.sum2 = res[0].sum2;
  222. }
  223. });
  224. },
  225. getBannerImg() {
  226. new userSets()
  227. .BannerImg({
  228. 'current': 1,
  229. 'size': 5,
  230. 'orders': [],
  231. })
  232. .then((res) => {
  233. let bs = [];
  234. res.records[0].bannerImg.split("|").forEach((item) => {
  235. if (item.trim().length > 0) {
  236. bs.push($base + item.replace('程序附件//', '程序附件/'),
  237. );
  238. }
  239. });
  240. this.BannerImgurls = bs;
  241. });
  242. },
  243. getSelectColor() {
  244. let that = this;
  245. new userSets()
  246. .SelectColor()
  247. .then((res) => {
  248. //console.log(res.records[0].selectColor.substring(1, 7));
  249. //存PCtoken
  250. that.$store.commit('setSelectColor', res.默认);
  251. });
  252. },
  253. //测试接口,可删除
  254. async gettest() {
  255. let that = this;
  256. //SDK中 getToken() 方法获取免登token
  257. // window.xm.getToken().then(function(token){
  258. // console.log(token);
  259. // that.con1="哈哈"+token;
  260. // window.xm.showToast({
  261. // message:that.con1
  262. // })
  263. // })
  264. //测试数据同步接口的
  265. const inputForm = {
  266. 'iamRequestId': '120010',
  267. 'iamRemoteUser': 'admin12022',
  268. 'iamRemotePwd': ''
  269. }
  270. var res = await this.$API.yin.SchemaService.post(inputForm);
  271. if (res.type == 1) {
  272. this.$router.replace({
  273. path: "/main",
  274. });
  275. } else {
  276. Toast.fail(res.message);
  277. }
  278. },
  279. //测试接口,可删除
  280. async gettest2() {
  281. var datas = {
  282. username: "admin",
  283. };
  284. var res = await this.$API.my.OrderDetails.get(datas);
  285. this.con1 = res;
  286. console.log(res);
  287. },
  288. //用户数据同步测试用(用户保存)
  289. async gettestUser1() {
  290. const inputForm = {
  291. 'iamRequestId': '120010',
  292. 'iamRemoteUser': 'admin',
  293. 'iamRemotePwd': '11',
  294. 'loginName': 'yzt2',
  295. 'name': '同步用户2',
  296. 'password': '111',
  297. 'idcard': '320911199010000002',
  298. 'email': '818166662@qq.com',
  299. 'phone': '88868882',
  300. 'mobile': '1829999992',
  301. 'loginFlag': '1',
  302. 'photo': '',
  303. 'sign': '个性签名2',
  304. }
  305. var res = await this.$API.yin.UserCreateService.post(inputForm);
  306. console.log(res);
  307. },
  308. //(用户更新)
  309. async gettestUser2() {
  310. const inputForm = {
  311. 'iamRequestId': '120010',
  312. 'iamRemoteUser': 'admin',
  313. 'iamRemotePwd': '11',
  314. 'uid': '1639158103696228354',
  315. 'loginName': 'yzt222',
  316. 'name': '11',
  317. // 'password': '',
  318. // 'idcard': '',
  319. // 'email': '',
  320. // 'phone': '',
  321. // 'mobile': '',
  322. // 'loginFlag': '',
  323. // 'photo': '',
  324. // 'sign': '',
  325. }
  326. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  327. console.log(res);
  328. },
  329. //(用户删除)
  330. async gettestUser3() {
  331. const inputForm = {
  332. 'iamRequestId': '120010',
  333. 'iamRemoteUser': 'admin',
  334. 'iamRemotePwd': '111',
  335. 'uid': '1639158103696228354',
  336. }
  337. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  338. console.log(res);
  339. },
  340. },
  341. };
  342. </script>
  343. <style>
  344. .bg {
  345. height: 100%;
  346. background: #ffffff;
  347. }
  348. </style>