tabAll.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  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. xm.showToast({
  205. message: "111"+res.header['Set-Cookie'],
  206. });
  207. that.getBannerImg();//获取轮播图
  208. that.getSelectColor();//获取主题颜色
  209. that.dataNumber();//获取待办事项数
  210. }
  211. },
  212. getStatistics() {
  213. let that = this;
  214. new userSets()
  215. .Statistics()
  216. .then((res) => {
  217. if (res[0].sum != undefined && res[0].sum != null && res[0].sum != "") {
  218. that.sum = res[0].sum;
  219. }
  220. if (res[0].sum1 != undefined && res[0].sum1 != null && res[0].sum1 != "") {
  221. that.sum1 = res[0].sum1;
  222. }
  223. if (res[0].sum2 != undefined && res[0].sum2 != null && res[0].sum2 != "") {
  224. that.sum2 = res[0].sum2;
  225. }
  226. });
  227. },
  228. getBannerImg() {
  229. new userSets()
  230. .BannerImg({
  231. 'current': 1,
  232. 'size': 5,
  233. 'orders': [],
  234. })
  235. .then((res) => {
  236. let bs = [];
  237. res.records[0].bannerImg.split("|").forEach((item) => {
  238. if (item.trim().length > 0) {
  239. bs.push($base + item.replace('程序附件//', '程序附件/'),
  240. );
  241. }
  242. });
  243. this.BannerImgurls = bs;
  244. });
  245. },
  246. getSelectColor() {
  247. let that = this;
  248. new userSets()
  249. .SelectColor()
  250. .then((res) => {
  251. //console.log(res.records[0].selectColor.substring(1, 7));
  252. //存PCtoken
  253. that.$store.commit('setSelectColor', res.默认);
  254. });
  255. },
  256. //测试接口,可删除
  257. async gettest() {
  258. let that = this;
  259. //SDK中 getToken() 方法获取免登token
  260. // window.xm.getToken().then(function(token){
  261. // console.log(token);
  262. // that.con1="哈哈"+token;
  263. // window.xm.showToast({
  264. // message:that.con1
  265. // })
  266. // })
  267. //测试数据同步接口的
  268. const inputForm = {
  269. 'iamRequestId': '120010',
  270. 'iamRemoteUser': 'admin12022',
  271. 'iamRemotePwd': ''
  272. }
  273. var res = await this.$API.yin.SchemaService.post(inputForm);
  274. if (res.type == 1) {
  275. this.$router.replace({
  276. path: "/main",
  277. });
  278. } else {
  279. Toast.fail(res.message);
  280. }
  281. },
  282. //测试接口,可删除
  283. async gettest2() {
  284. var datas = {
  285. username: "admin",
  286. };
  287. var res = await this.$API.my.OrderDetails.get(datas);
  288. this.con1 = res;
  289. console.log(res);
  290. },
  291. //用户数据同步测试用(用户保存)
  292. async gettestUser1() {
  293. const inputForm = {
  294. 'iamRequestId': '120010',
  295. 'iamRemoteUser': 'admin',
  296. 'iamRemotePwd': '11',
  297. 'loginName': 'yzt2',
  298. 'name': '同步用户2',
  299. 'password': '111',
  300. 'idcard': '320911199010000002',
  301. 'email': '818166662@qq.com',
  302. 'phone': '88868882',
  303. 'mobile': '1829999992',
  304. 'loginFlag': '1',
  305. 'photo': '',
  306. 'sign': '个性签名2',
  307. }
  308. var res = await this.$API.yin.UserCreateService.post(inputForm);
  309. console.log(res);
  310. },
  311. //(用户更新)
  312. async gettestUser2() {
  313. const inputForm = {
  314. 'iamRequestId': '120010',
  315. 'iamRemoteUser': 'admin',
  316. 'iamRemotePwd': '11',
  317. 'uid': '1639158103696228354',
  318. 'loginName': 'yzt222',
  319. 'name': '11',
  320. // 'password': '',
  321. // 'idcard': '',
  322. // 'email': '',
  323. // 'phone': '',
  324. // 'mobile': '',
  325. // 'loginFlag': '',
  326. // 'photo': '',
  327. // 'sign': '',
  328. }
  329. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  330. console.log(res);
  331. },
  332. //(用户删除)
  333. async gettestUser3() {
  334. const inputForm = {
  335. 'iamRequestId': '120010',
  336. 'iamRemoteUser': 'admin',
  337. 'iamRemotePwd': '111',
  338. 'uid': '1639158103696228354',
  339. }
  340. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  341. console.log(res);
  342. },
  343. },
  344. };
  345. </script>
  346. <style>
  347. .bg {
  348. height: 100%;
  349. background: #ffffff;
  350. }
  351. </style>