tabAll.vue 9.8 KB

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