QxSetting.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div class="manage-root personnel-create">
  3. <Header />
  4. <div class="manage-root-contain">
  5. <nav-menu
  6. class="manage-root-contain-left"
  7. :activeMenuIndex="activeMenuIndex"
  8. ></nav-menu>
  9. <div class="manage-root-contain-right">
  10. <breadcrumb
  11. :breadcrumbList="breadcrumbList"
  12. class="breadcrumb-box"
  13. ></breadcrumb>
  14. <div class="create-bottom">
  15. <h3>企信对接配置</h3>
  16. <el-form
  17. :model="registerForm"
  18. ref="registerForm"
  19. label-width="100px"
  20. class="registerForm"
  21. label-position="top"
  22. >
  23. <el-form-item label="应用键值" prop="app_key">
  24. <el-input
  25. v-model="registerForm.app_key"
  26. autocomplete="off"
  27. placeholder="请输入应用键值"
  28. @blur="handleTrim('registerForm', 'app_key')"
  29. maxlength="100"
  30. >
  31. </el-input>
  32. </el-form-item>
  33. <el-form-item label="应用密钥" prop="app_secret">
  34. <el-input
  35. v-model="registerForm.app_secret"
  36. autocomplete="off"
  37. placeholder="请输入应用密钥"
  38. @blur="handleTrim('registerForm', 'app_secret')"
  39. maxlength="200"
  40. >
  41. </el-input>
  42. </el-form-item>
  43. <el-form-item>
  44. <el-button
  45. type="primary"
  46. @click="onSubmit('registerForm')"
  47. size="small"
  48. :loading="loading"
  49. >保存</el-button
  50. >
  51. <el-button @click="onCancel('registerForm')" size="small"
  52. >取消</el-button
  53. >
  54. </el-form-item>
  55. </el-form>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  63. //例如:import 《组件名称》from ‘《组件路径》';
  64. import Header from "../../components/Header.vue";
  65. import NavMenu from "../../components/NavMenu.vue";
  66. import Breadcrumb from "../../components/Breadcrumb.vue";
  67. import { getLogin } from "@/api/ajax";
  68. export default {
  69. //import引入的组件需要注入到对象中才能使用
  70. components: { Header, NavMenu, Breadcrumb },
  71. props: {},
  72. data() {
  73. //这里存放数据
  74. return {
  75. activeMenuIndex: "qx_setting",
  76. breadcrumbList: [
  77. {
  78. icon: "setting",
  79. url: "",
  80. text: "",
  81. },
  82. {
  83. icon: "",
  84. url: "",
  85. notLink: true,
  86. text: "系统配置",
  87. },
  88. {
  89. icon: "",
  90. url: "",
  91. text: "企信对接配置",
  92. },
  93. ],
  94. registerForm: {
  95. app_key: "",
  96. app_secret: "",
  97. },
  98. loading: false,
  99. orgList: [],
  100. };
  101. },
  102. //计算属性 类似于data概念
  103. computed: {},
  104. //监控data中数据变化
  105. watch: {},
  106. //方法集合
  107. methods: {
  108. // 去掉前后空格
  109. handleTrim(form, fild) {
  110. this[form][fild] = this[form][fild].trim();
  111. },
  112. // 提交表单
  113. onSubmit(formName) {
  114. this.$refs[formName].validate((valid) => {
  115. if (valid) {
  116. this.loading = true;
  117. let MethodName =
  118. "/OrgServer/Manager/SysConfigManager/SetSysConfig_QiXin";
  119. getLogin(MethodName, this.registerForm)
  120. .then((res) => {
  121. this.loading = false;
  122. if (res.status === 1) {
  123. this.$message.success("保存成功");
  124. }
  125. })
  126. .catch((res) => {
  127. this.loading = false;
  128. });
  129. } else {
  130. return false;
  131. }
  132. });
  133. },
  134. // 取消 恢复到修改前状态
  135. onCancel(formName) {
  136. this.$refs[formName].resetFields();
  137. },
  138. // 得到配置信息
  139. getInfo() {
  140. let MethodName = "/OrgServer/Manager/SysConfigManager/GetSysConfig_QiXin";
  141. getLogin(MethodName, {})
  142. .then((res) => {
  143. if (res.status === 1) {
  144. this.registerForm = {
  145. app_key: res.app_key,
  146. app_secret: res.app_secret,
  147. };
  148. }
  149. })
  150. .catch((res) => {});
  151. },
  152. // 查询列表
  153. getOrgList() {
  154. let MethodName = "/OrgServer/Manager/PageQuery/PageQueryOrgList";
  155. let data = {
  156. name: "",
  157. type: -1,
  158. status: 1,
  159. creator_id: "",
  160. page_capacity: 100,
  161. cur_page: 1,
  162. order_column_list: ["create_time:desc"],
  163. };
  164. getLogin(MethodName, data)
  165. .then((res) => {
  166. this.tableLoading = false;
  167. if (res.status === 1) {
  168. this.orgList = res.org_list;
  169. }
  170. })
  171. .catch(() => {});
  172. },
  173. },
  174. //生命周期 - 创建完成(可以访问当前this实例)
  175. created() {
  176. this.getOrgList();
  177. this.getInfo();
  178. },
  179. //生命周期 - 挂载完成(可以访问DOM元素)
  180. mounted() {},
  181. //生命周期-创建之前
  182. beforeCreated() {},
  183. //生命周期-挂载之前
  184. beforeMount() {},
  185. //生命周期-更新之前
  186. beforUpdate() {},
  187. //生命周期-更新之后
  188. updated() {},
  189. //生命周期-销毁之前
  190. beforeDestory() {},
  191. //生命周期-销毁完成
  192. destoryed() {},
  193. //如果页面有keep-alive缓存功能,这个函数会触发
  194. activated() {},
  195. };
  196. </script>
  197. <style lang="scss" scoped>
  198. /* @import url(); 引入css类 */
  199. .create-bottom {
  200. padding: 40px 40px;
  201. background: #ffffff;
  202. border-radius: 4px;
  203. height: calc(100vh - 140px);
  204. overflow: auto;
  205. h3 {
  206. font-size: 20px;
  207. font-weight: 500;
  208. line-height: 28px;
  209. margin: 0 0 28px 0;
  210. color: #1d2129;
  211. }
  212. }
  213. </style>
  214. <style lang="scss"></style>