post.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. {template 'common/header'}
  2. <div class="new-keyword" id="js-user-post" ng-controller="UserCreateCtrl" ng-cloak>
  3. <ol class="breadcrumb we7-breadcrumb">
  4. <a href="{url 'user/display'}"><i class="wi wi-back-circle"></i> </a>
  5. <li><a href="{url 'user/display'}">用户管理</a></li>
  6. <li>添加用户</li>
  7. </ol>
  8. <div class="we7-step">
  9. <ul>
  10. <li ng-class="{true : 'active new', false : 'new'}[create_step == 1]"><span class="content">1 基本信息</span></li>
  11. <li ng-class="{true : 'active new', false : 'new'}[create_step == 2]"><span class="content">2 设置权限</span> </li>
  12. </ul>
  13. </div>
  14. <form ng-submit="submit()" class="we7-form user-create" name="UserCreateForm" novalidate>
  15. <!-- 基本信息 start -->
  16. <div ng-show="create_step == 1">
  17. <!-- 用户名 start -->
  18. <div class="form-group">
  19. <label for="" class="control-label col-sm-2">用户名</label>
  20. <div class="form-controls col-sm-8">
  21. <input type="text" name="username" placeholder="请输入用户名,用户名为 3 到 30 个字符组成,包括汉字,大小写字母(不区分大小写)" check_username required id="username" ng-style="{'width': '600px'}" class="form-control" ng-model="user.username" placeholder="" autocomplete="off">
  22. <div class="help-block" ng-show="UserCreateForm.username.$dirty && UserCreateForm.username.$invalid">
  23. <span ng-show="UserCreateForm.username.$error.unique">用户名已经被注册!</span>
  24. <span ng-show="UserCreateForm.username.$error.required">用户名不能为空!</span>
  25. <span ng-show="UserCreateForm.username.$error.format">用户名必须为 3 到 30 个字符组成,包括汉字,大小写字母(不区分大小写)</span>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- 用户名 end -->
  30. <!-- 密码 start -->
  31. <div class="form-group">
  32. <label for="" class="control-label col-sm-2">密码</label>
  33. <div class="form-controls col-sm-8">
  34. <input type="text" value="" class="hidden"/>
  35. <input type="password" name="password" required ng-minlength="8" id="password" ng-style="{'width': '600px'}" class="form-control" ng-model="user.password" placeholder="" autocomplete="off" ng-focus="changeType($event)">
  36. <div class="help-block">请填写密码,最小长度为 8 个字符</div>
  37. </div>
  38. </div>
  39. <!-- 密码 end -->
  40. <!-- 确认密码 start -->
  41. <div class="form-group" ng-class="{error: UserCreateForm.password.$modelValue !== UserCreateForm.repassword.$modelValue}">
  42. <label for="" class="control-label col-sm-2">确认密码</label>
  43. <div class="form-controls col-sm-8">
  44. <input type="password" name="repassword" required ng-minlength="8" id="repassword" ng-style="{'width': '600px'}" class="form-control" ng-model="user.repassword" placeholder="" autocomplete="off" ng-focus="changeType($event)">
  45. <div class="help-block">重复输入密码,确认正确输入</div>
  46. </div>
  47. </div>
  48. <!-- 确认密码 end -->
  49. <!-- 备注 start -->
  50. <div class="form-group">
  51. <label for="" class="control-label col-sm-2">备注</label>
  52. <div class="form-controls col-sm-8">
  53. <textarea ng-model="user.remark" rows="6" class="form-control" ng-style="{'width': '600px'}" ng-bind="user.remark" placeholder="方便注明此用户的身份"></textarea>
  54. </div>
  55. </div>
  56. <!-- 备注 end -->
  57. </div>
  58. <!-- 基本信息 end -->
  59. <!-- 权限 start -->
  60. <div ng-show="create_step == 2" class="user-create-permission">
  61. {if permission_check_account_user('see_user_create_own_vice_founder')}
  62. <div class="form-group">
  63. <label for="" class="control-label col-sm-2">所属副创始人</label>
  64. <div class="form-controls col-sm-8">
  65. <input type="text" name="vice_founder_name" id="vice_founder" ng-style="{'width': '200px'}" class="form-control" ng-model="vice_founder_name" placeholder="" autocomplete="off">
  66. <div class="help-block">请输入副创始人姓名</div>
  67. </div>
  68. </div>
  69. {/if}
  70. <div class="form-group">
  71. <label for="" class="control-label col-sm-2">权限方式</label>
  72. <div class="form-controls col-sm-8">
  73. <div class="btn-group-sub">
  74. <a href="javascript:;" class="btn" ng-click="permissionType = 1" ng-class="{active: permissionType == '1'}">自定义权限</a>
  75. <a href="javascript:;" class="btn" ng-click="permissionType = 2" ng-class="{active: permissionType == '2'}">用户组权限</a>
  76. </div>
  77. </div>
  78. </div>
  79. <div ng-show="permissionType == 1">
  80. <!--应用权限组-->
  81. <div class="form-group">
  82. <div class="col-sm-offset-2">
  83. <div class="we7-header">应用权限组</div>
  84. <div class="we7-group-show " ng-repeat="extend in moduleGroupList.groups" ng-if="extend.checked == 1">
  85. <div class="name">
  86. {{extend.name}}
  87. </div>
  88. <div class="group-app-list">
  89. <div class="group-app-item" ng-repeat="module in extend.modules_all">
  90. <img ng-src="{{module.logo}}" class="module-img" alt="">
  91. <div class="info">
  92. <div class="title text-over">
  93. {{module.title}}
  94. </div>
  95. <div class="type-list">
  96. <i ng-class="itme.icon" ng-repeat="itme in module.group_support | moduleInfo" ></i>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="group-app-item" ng-repeat="module in extend.templates">
  101. <img ng-src="{{module.logo}}" class="template-img" alt="">
  102. <div class="info">
  103. <div class="title">
  104. {{module.title}}
  105. </div>
  106. <div class="type-list">
  107. <i class="wi wi-template"></i>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <a class="action"></a>
  113. <a href="" class="remove" ng-click="extend.checked = 0"><i class="wi wi-error"></i></a>
  114. </div>
  115. <we7-modal-app module-list="moduleGroupList" multiple="true" on-confirm="groupConfirm()">
  116. <div class="add-new-block" >
  117. <i class="wi wi-plus"></i> 添加应用权限组
  118. </div>
  119. </we7-modal-app>
  120. </div>
  121. </div>
  122. <!-- 附加应用 -->
  123. <div class="form-group">
  124. <div class="col-sm-offset-2">
  125. <div class="we7-header">附加应用</div>
  126. <div class="group-post-mudules">
  127. <div class="module-item" ng-repeat="module in user_modules.modules" ng-if="module.checked == 1">
  128. <div class="logo">
  129. <img ng-src="{{module.logo}}" class="module-img" alt="">
  130. </div>
  131. <div class="info">
  132. <div ng-bind="module.title" class="title text-over">1213</div>
  133. <div class="icon">
  134. <i class="{{module.support | moduleInfo:'icon'}}"></i>
  135. </div>
  136. </div>
  137. <div class="delete">
  138. <i class="wi wi-error" ng-click="module.checked = 0"></i>
  139. </div>
  140. </div>
  141. <div class="module-item" ng-repeat="template in user_modules.templates" ng-if="template.checked == 1">
  142. <div class="logo">
  143. <img ng-src="{{template.logo}}" class="template-img" alt="">
  144. </div>
  145. <div class="info">
  146. <div class="name text-over" ng-bind="template.title">1213</div>
  147. <div class="icon">
  148. <i class="wi wi-template"></i>
  149. </div>
  150. </div>
  151. <div class="delete">
  152. <i class="wi wi-error" ng-click="template.checked = 0"></i>
  153. </div>
  154. </div>
  155. <we7-modal-app module-list="user_modules" title="'添加应用'" multiple="true">
  156. <div class="module-item add" >
  157. <i class="wi wi-plus"></i> 添加应用
  158. </div>
  159. </we7-modal-app>
  160. </div>
  161. </div>
  162. </div>
  163. <!-- 账号权限组 -->
  164. <div class="form-group">
  165. <div class="col-sm-offset-2">
  166. <div class="we7-header">账号权限组</div>
  167. <div class="we7-account-show " ng-repeat="item in account.create_groups" ng-if="item.checked == 1">
  168. <div class="name">{{item.group_name}}</div>
  169. <div class="account-num-list">
  170. <span class="account-num-item" ng-repeat="(index,type) in account_text" ng-show="item['max' + index] > 0">
  171. <i ng-class="type.icon" ></i> {{item['max' + index]}}个
  172. </span>
  173. </div>
  174. <a href="javascript:;" class="remove" ng-click="item.checked = 0">
  175. <i class="wi wi-error"></i>
  176. </a>
  177. </div>
  178. <we7-modal-account account="account" type="2" multiple="true" >
  179. <a href="javascript:;" class="add-new-block" >
  180. <i class="wi wi-plus"></i>添加账号权限组
  181. </a>
  182. </we7-modal-account>
  183. </div>
  184. </div>
  185. <!-- 附加账号 -->
  186. <div class="form-group">
  187. <div class="col-sm-offset-2">
  188. <div class="we7-header">附加账号</div>
  189. <div class="we7-account-show" >
  190. <div class="name">附加账号</div>
  191. <div class="account-num-list">
  192. <span class="account-num-item" ng-repeat="(index,type) in account_text" ng-show="account.create_numbers['max' + index] > 0">
  193. <i ng-class="type.icon" ></i> {{account.create_numbers['max' + index]}}个
  194. </span>
  195. </div>
  196. <we7-modal-account account="account" type="3" multiple="true" >
  197. <a href="javascript:;" class="color-default">
  198. 编辑
  199. </a>
  200. </we7-modal-account>
  201. </div>
  202. </div>
  203. </div>
  204. <!--附加天数-->
  205. <div class="form-group">
  206. <div class="col-sm-offset-2">
  207. <div class="we7-header">附加天数</div>
  208. <div class="day-show">
  209. <div class="day">{{selectedDate}}</div>
  210. <div class="edit">
  211. <a class="color-default" href="#date" data-toggle="modal" data-target="#date">编辑</a>
  212. </div>
  213. </div>
  214. </div>
  215. </div>
  216. </div>
  217. <div ng-show="permissionType == 2">
  218. <div class="form-group">
  219. <label for="" class="control-label col-sm-2"></label>
  220. <div class="form-controls col-sm-3">
  221. <select name="groupid" class="" ng-model="group" ng-options="group.name for (x, group) in groups" ng-change="changeGroup()">
  222. <option value="" >请选择所属用户权限组</option>
  223. </select>
  224. <span class="help-block"> 分配用户所属用户权限组后,该用户会自动拥有此用户权限组内的模块操作权限</span>
  225. <span class="help-block"><strong class="text-danger">设置用户权限组后,系统会根据对应用户权限组的服务期限对用户的服务开始时间和结束时间进行初始化</strong></span>
  226. </div>
  227. </div>
  228. <div ng-show="group.id > 0 && selectedGroupInfo">
  229. <!--应用权限组-->
  230. <div class="form-group">
  231. <div class="col-sm-offset-2">
  232. <div class="we7-header">应用权限组</div>
  233. <div class="we7-group-show ">
  234. <div class="name">
  235. {{selectedGroupInfo['name']}}
  236. </div>
  237. <div class="group-app-list">
  238. <div class="group-app-item" ng-repeat="module in selectedGroupInfo['group_module_all']">
  239. <img ng-src="{{module.logo}}" alt="">
  240. <div class="info">
  241. <div class="title text-over">
  242. {{module.title}}
  243. </div>
  244. <div class="type-list">
  245. <i ng-class="itme.icon" ng-repeat="itme in module.group_support | moduleInfo" ></i>
  246. </div>
  247. </div>
  248. </div>
  249. <div class="group-app-item" ng-repeat="module in selectedGroupInfo['group_tempate_all']">
  250. <img ng-src="{{module.logo}}" alt="">
  251. <div class="info">
  252. <div class="title">
  253. {{module.title}}
  254. </div>
  255. <div class="type-list">
  256. <i class="wi wi-template"></i>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <a class="action"></a>
  262. </div>
  263. </div>
  264. </div>
  265. <!-- 账号权限组 -->
  266. <div class="form-group">
  267. <div class="col-sm-offset-2">
  268. <div class="we7-header">账号权限组</div>
  269. <div class="we7-account-show we7-padding" >
  270. <div class="name">{{selectedGroupInfo['name']}}</div>
  271. <div class="account-num-list">
  272. <span class="account-num-item" ng-repeat="(index,type) in account_text" ng-show="selectedGroupInfo['max' + index] > 0">
  273. <i ng-class="type.icon" ></i> {{selectedGroupInfo['max' + index]}}个
  274. </span>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <!--附加天数-->
  280. <div class="form-group">
  281. <div class="col-sm-offset-2">
  282. <div class="we7-header">有效时间</div>
  283. <div class="day-show">
  284. <div class="day">{{selectedGroupInfo['timelimit'] == 0 ? '永久有效' : selectedGroupInfo['timelimit']}}</div>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. <div class="modal fade modal-form" id="date" role="dialog">
  291. <div class="we7-modal-dialog modal-dialog">
  292. <div class="modal-content">
  293. <div class="modal-header">
  294. <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
  295. <div class="modal-title">添加有效时间</div>
  296. </div>
  297. <div class="modal-body">
  298. <div class="form-group">
  299. <div class="input-group">
  300. <input type="text" class="form-control" ng-model="selectedDate">
  301. <div class="input-group-addon">
  302. </div>
  303. </div>
  304. </div>
  305. </div>
  306. <div class="modal-footer">
  307. <button type="button" class="btn btn-primary" data-dismiss="modal" >确定</button>
  308. </div>
  309. </div>
  310. </div>
  311. </div>
  312. </div>
  313. <!-- 权限 end -->
  314. <div class="col-sm-offset-2">
  315. <input type="button" ng-if="create_step == 2" value="上一步" class="btn btn-primary" ng-click="step(1)" ng-style="{'padding': '6px 50px'}"/>
  316. <input type="button" ng-if="create_step == 1" value="下一步" class="btn btn-primary" ng-click="step(2)" ng-style="{'padding': '6px 50px'}"/>
  317. <input type="submit" ng-if="create_step == 2" name="submit" id="" value="提交" class="btn btn-primary" ng-click="checkSubmit($event)" ng-style="{'padding': '6px 50px'}"/>
  318. </div>
  319. </form>
  320. </div>
  321. <script type="text/javascript">
  322. angular.module('userManageApp').value('config', {
  323. groups: {php echo !empty($groups) ? json_encode($groups) : 'null'},
  324. /* 应用权限 - 应用模块 */
  325. user_modules: {php echo !empty($user_modules) ? json_encode($user_modules) : 'null'},
  326. /* 应用权限 - 应用权限组*/
  327. modules_group_list: {php echo !empty($modules_group_list) ? json_encode($modules_group_list) : 'null'},
  328. /* 帐号权限 - 帐号权限组*/
  329. // account_group_lists: {php echo !empty($account_group_lists) ? json_encode($account_group_lists) : 'null'},
  330. create_account: {php echo json_encode($create_account)},
  331. /* 应用权限 - 模板*/
  332. source_templates: {php echo !empty($source_templates) ? json_encode($source_templates) : 'null'},
  333. user_save_url : "{php echo url('user/create/save')}",
  334. get_user_group_detail_url : "{php echo url('user/create/get_user_group_detail_info')}",
  335. check_vice_founder_exists_url : "{php echo url('user/create/check_vice_founder_exists')}",
  336. check_user_info_url : "{php echo url('user/create/check_user_info')}",
  337. check_vice_founder_permission_limit_url : "{php echo url('user/create/check_vice_founder_permission_limit')}",
  338. });
  339. angular.bootstrap($('#js-user-post'), ['userManageApp']);
  340. </script>
  341. {template 'common/footer'}