tabAll.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  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
  46. icon="./loginbg/csdj.png"
  47. text="场所登记"
  48. @click="goPlaceRegister"
  49. />
  50. <van-grid-item
  51. icon="./loginbg/csry.png"
  52. text="场所人员信息"
  53. @click="goPlacePerson"
  54. />
  55. <van-grid-item
  56. icon="./loginbg/cspw.png"
  57. text="牌位管理"
  58. @click="goPlaceTablet"
  59. />
  60. <van-grid-item
  61. icon="./loginbg/csxf.png"
  62. text="场所消防"
  63. @click="PlaceFirefighting"
  64. />
  65. </van-grid>
  66. <div class="hLine"></div>
  67. <div class="tabtitlelay">
  68. <div class="tabtitle1"></div>
  69. <div class="tabtitle">{{ testshow }}</div>
  70. </div>
  71. <van-grid :border="false">
  72. <van-grid-item
  73. icon="./loginbg/hd_cshd.png"
  74. @click="placeActivity"
  75. text="场所活动"
  76. />
  77. <van-grid-item
  78. icon="./loginbg/hd_jc.png"
  79. text="场所检查"
  80. @click="tohd_jc"
  81. />
  82. <van-grid-item
  83. icon="./loginbg/hd_hy.png"
  84. text="负责人会议"
  85. @click="tohd_hy"
  86. />
  87. <van-grid-item
  88. icon="./loginbg/hd_qt.png"
  89. text="非宗教类信息"
  90. @click="tohd_fzj"
  91. />
  92. </van-grid>
  93. <div class="tabtitlelay">
  94. <div class="tabtitle1"></div>
  95. <div class="tabtitle">{{ testshow2 }}</div>
  96. </div>
  97. <van-grid :border="false">
  98. <van-grid-item
  99. icon="./loginbg/hd_ssjhd.png"
  100. @click="selfMeetingList"
  101. text="私设聚会点"
  102. />
  103. <van-grid-item
  104. icon="./loginbg/hd_xjqz.png"
  105. @click="abnormalCrowd"
  106. text="信教群众异常"
  107. />
  108. <van-grid-item
  109. icon="./loginbg/hd_af.png"
  110. text="安防设施异常"
  111. @click="tohd_af"
  112. />
  113. <van-grid-item
  114. icon="./loginbg/hd_qt.png"
  115. text="其他有害信息"
  116. @click="tohd_qt"
  117. />
  118. </van-grid>
  119. </div>
  120. </template>
  121. <script>
  122. import tool from "@/tool";
  123. import qs from "qs";
  124. import userSets from "@/api/sys/userSets";
  125. import toBeDone from "@/api/toBeDone/toBeDone";
  126. import $base from "@/utils/config";
  127. export default {
  128. data() {
  129. return {
  130. title: "民宗干事",
  131. username: "",
  132. sms: "",
  133. password: "",
  134. password2: "",
  135. con1: 0,
  136. con2: 0,
  137. testshow: "活动管理",
  138. testshow2: "异常监管",
  139. sum: "0",
  140. sum1: "0",
  141. sum2: "0",
  142. BannerImgurls: [
  143. "https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400",
  144. "https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400",
  145. ],
  146. };
  147. },
  148. created() {
  149. let id = this.$route.query.id;
  150. window.xm.setNavigationBarTitle({
  151. title: "宗教和顺",
  152. });
  153. this.TokenLogin2();//生产环境
  154. //this.TokenLogin();//测试环境
  155. this.$dictUtils.refreshDictList();
  156. },
  157. methods: {
  158. // 待办跳转
  159. goToBeDone(e) {
  160. let value = JSON.stringify(e.currentTarget.id);
  161. this.$router.push({
  162. path: "/toBeDone",
  163. query: {
  164. name: value,
  165. },
  166. });
  167. },
  168. // 场所登记跳转
  169. goPlaceRegister() {
  170. this.$router.push("/placeRegisterList");
  171. },
  172. // 人员档案跳转
  173. goPlacePerson() {
  174. this.$router.push("/placePerson");
  175. },
  176. // 牌位管理跳转
  177. goPlaceTablet() {
  178. this.$router.push("/placeTablet");
  179. },
  180. //场所消防
  181. PlaceFirefighting() {
  182. this.$router.push("/placeFirefightingList");
  183. },
  184. //待办数据获取
  185. dataNumber() {
  186. new toBeDone().list().then((res) => {
  187. this.sum1 = res.records.length;
  188. this.sum = this.sum1 + this.sum2;
  189. });
  190. new toBeDone().list2().then((res1) => {
  191. this.sum2 = res1.records.length;
  192. this.sum = this.sum1 + this.sum2;
  193. });
  194. },
  195. onClickLeft() {
  196. history.back();
  197. },
  198. tohd_jc() {
  199. //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
  200. this.$router.push("/siteInspectionList");
  201. },
  202. tohd_af() {
  203. this.$router.push("/securityFacilitiesErrList");
  204. },
  205. tohd_hy() {
  206. this.$router.push("/religiousConferenceList");
  207. },
  208. tohd_fzj() {
  209. this.$router.push("/secularMessageList");
  210. },
  211. tohd_qt() {
  212. this.$router.push("/nonReligiousInformationList");
  213. },
  214. // 活动场所
  215. placeActivity() {
  216. this.$router.push("/placeActivityList");
  217. },
  218. selfMeetingList() {
  219. this.$router.push("/selfMeetingList");
  220. },
  221. abnormalCrowd() {
  222. this.$router.push("/differentbelieversList");
  223. },
  224. TokenLogin() {
  225. let that = this;
  226. new userSets()
  227. .TokenLogin({
  228. token: "test",
  229. })
  230. .then((res) => {
  231. that.$store.commit("setPcToken", res.PcToken);
  232. that.$store.commit("setUser", res.account);
  233. new userSets().getMenus().then(( data ) => {
  234. that.$store.commit(
  235. "setPermissions",
  236. JSON.stringify(data.permissions || "[]")
  237. );
  238. that.getBannerImg(); //获取轮播图
  239. that.getSelectColor(); //获取主题颜色
  240. that.dataNumber(); //获取待办事项数
  241. });
  242. });
  243. },
  244. TokenLogin2() {
  245. let that = this;
  246. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  247. if (
  248. this.$store.state.pctoken == "" ||
  249. this.$store.state.pctoken == undefined
  250. ) {
  251. //SDK中 getToken() 方法获取免登token
  252. window.xm.getToken().then(async function (token) {
  253. //上线取消注释
  254. // let token = "test"; //上线注释
  255. new userSets()
  256. .TokenLogin({
  257. token: token,
  258. })
  259. .then((res) => {
  260. that.$store.commit("setPcToken", res.PcToken);
  261. that.$store.commit("setUser", res.account);
  262. new userSets().getMenus().then(( data ) => {
  263. that.$store.commit(
  264. "setPermissions",
  265. JSON.stringify(data.permissions || "[]")
  266. );
  267. that.getBannerImg(); //获取轮播图
  268. that.getSelectColor(); //获取主题颜色
  269. that.dataNumber(); //获取待办事项数
  270. });
  271. });
  272. }); //上线取消注释
  273. } else {
  274. that.getBannerImg(); //获取轮播图
  275. that.getSelectColor(); //获取主题颜色
  276. that.dataNumber(); //获取待办事项数
  277. }
  278. },
  279. getStatistics() {
  280. let that = this;
  281. new userSets().Statistics().then((res) => {
  282. if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
  283. that.sum = res[0].sum;
  284. }
  285. if (
  286. res[0].sum1 != undefined &&
  287. res[0].sum1 != null &&
  288. res[0].sum1 != ""
  289. ) {
  290. that.sum1 = res[0].sum1;
  291. }
  292. if (
  293. res[0].sum2 != undefined &&
  294. res[0].sum2 != null &&
  295. res[0].sum2 != ""
  296. ) {
  297. that.sum2 = res[0].sum2;
  298. }
  299. });
  300. },
  301. getBannerImg() {
  302. new userSets()
  303. .BannerImg({
  304. current: 1,
  305. size: 5,
  306. orders: [],
  307. })
  308. .then((res) => {
  309. let bs = [];
  310. res.records[0].bannerImg.split("|").forEach((item) => {
  311. if (item.trim().length > 0) {
  312. bs.push($base + item.replace("程序附件//", "程序附件/"));
  313. }
  314. });
  315. this.BannerImgurls = bs;
  316. });
  317. },
  318. getSelectColor() {
  319. let that = this;
  320. new userSets().SelectColor().then((res) => {
  321. //console.log(res.records[0].selectColor.substring(1, 7));
  322. //存PCtoken
  323. that.$store.commit("setSelectColor", res.默认);
  324. });
  325. },
  326. //测试接口,可删除
  327. async gettest() {
  328. let that = this;
  329. //SDK中 getToken() 方法获取免登token
  330. // window.xm.getToken().then(function(token){
  331. // console.log(token);
  332. // that.con1="哈哈"+token;
  333. // window.xm.showToast({
  334. // message:that.con1
  335. // })
  336. // })
  337. //测试数据同步接口的
  338. const inputForm = {
  339. iamRequestId: "120010",
  340. iamRemoteUser: "admin12022",
  341. iamRemotePwd: "",
  342. };
  343. var res = await this.$API.yin.SchemaService.post(inputForm);
  344. if (res.type == 1) {
  345. this.$router.replace({
  346. path: "/main",
  347. });
  348. } else {
  349. Toast.fail(res.message);
  350. }
  351. },
  352. //测试接口,可删除
  353. async gettest2() {
  354. var datas = {
  355. username: "admin",
  356. };
  357. var res = await this.$API.my.OrderDetails.get(datas);
  358. this.con1 = res;
  359. console.log(res);
  360. },
  361. //用户数据同步测试用(用户保存)
  362. async gettestUser1() {
  363. const inputForm = {
  364. iamRequestId: "120010",
  365. iamRemoteUser: "admin",
  366. iamRemotePwd: "11",
  367. loginName: "yzt2",
  368. name: "同步用户2",
  369. password: "111",
  370. idcard: "320911199010000002",
  371. email: "818166662@qq.com",
  372. phone: "88868882",
  373. mobile: "1829999992",
  374. loginFlag: "1",
  375. photo: "",
  376. sign: "个性签名2",
  377. };
  378. var res = await this.$API.yin.UserCreateService.post(inputForm);
  379. console.log(res);
  380. },
  381. //(用户更新)
  382. async gettestUser2() {
  383. const inputForm = {
  384. iamRequestId: "120010",
  385. iamRemoteUser: "admin",
  386. iamRemotePwd: "11",
  387. uid: "1639158103696228354",
  388. loginName: "yzt222",
  389. name: "11",
  390. // 'password': '',
  391. // 'idcard': '',
  392. // 'email': '',
  393. // 'phone': '',
  394. // 'mobile': '',
  395. // 'loginFlag': '',
  396. // 'photo': '',
  397. // 'sign': '',
  398. };
  399. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  400. console.log(res);
  401. },
  402. //(用户删除)
  403. async gettestUser3() {
  404. const inputForm = {
  405. iamRequestId: "120010",
  406. iamRemoteUser: "admin",
  407. iamRemotePwd: "111",
  408. uid: "1639158103696228354",
  409. };
  410. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  411. console.log(res);
  412. },
  413. },
  414. };
  415. </script>
  416. <style>
  417. .bg {
  418. height: 100%;
  419. background: #ffffff;
  420. }
  421. </style>