manage-account-setting.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {template 'common/header'}
  2. <div class="module-account-setting" ng-controller="moduleAccountSetting" ng-cloak>
  3. <div class="we7-page-title">模块配置参数</div>
  4. <div class="we7-form">
  5. <div class="form-group" ng-repeat="(paramKey, param) in params" ng-class="{required: param.required, error: param.error}" ng-if="setting[param.name] != 'undefined'">
  6. <label class="col-sm-2 control-label">{{param.title}}</label>
  7. <div class="form-controls col-sm-8">
  8. <div class="" ng-if="param.type == 'date'">
  9. <input type="text"class="form-control" required="param.required" ng-model="setting[param.name]" we7-date-picker we7-date-value="setting[param.name]" date-type="date" readonly>
  10. </div>
  11. <div class="" ng-if="param.type == 'time'">
  12. <input type="text"class="form-control" required="param.required" ng-model="setting[param.name]" we7-date-picker we7-date-value="setting[param.name]" date-type="time" readonly>
  13. </div>
  14. <div class="" ng-if="param.type == 'datetime'">
  15. <input type="text"class="form-control" required="param.required" ng-model="setting[param.name]" we7-date-picker we7-date-value="setting[param.name]" date-type="datetime" readonly>
  16. </div>
  17. <div class="" ng-if="param.type == 'text'">
  18. <input type="text" class="form-control" required="param.required" ng-model="setting[param.name]" ng-change="test()" />
  19. </div>
  20. <div class="" ng-if="param.type == 'textarea'">
  21. <textarea class="form-control" rows="3" required="param.required" ng-model="setting[param.name]"></textarea>
  22. </div>
  23. <div class="" ng-if="param.type == 'radio'">
  24. <span ng-repeat="(key, value) in param.values ">
  25. <input type="radio" id="{{'radio-' + paramKey + '-' + key }}" required="param.required" ng-value="key" ng-model="setting[param.name]">
  26. <label class="radio-inline" for="{{'radio-' + paramKey + '-' + key }}">{{value}}</label>
  27. </span>
  28. </div>
  29. <div class="" ng-if="param.type == 'checkbox'">
  30. <span ng-repeat="(key, value) in param.values ">
  31. <input type="checkbox" id="{{'checkbox-' + paramKey + '-' + key }}" required="param.required" ng-value="key" ng-model="setting[param.name][key]">
  32. <label class="radio-inline" for="{{'checkbox-' + paramKey + '-' + key }}">{{value}}</label>
  33. </span>
  34. </div>
  35. <div class="" ng-if="param.type == 'select'">
  36. <select ng-model="setting[param.name]" style="z-index: 1;" required="param.required" ng-options="key as value for (key, value) in param.values ">
  37. <option value="" >请选择</option>
  38. </select>
  39. </div>
  40. <div class="" ng-if="param.type == 'selects'">
  41. <select ng-model="setting[param.name]" required="param.required" multiple placeholder="请选择" ng-options="key as value for (key, value) in param.values ">
  42. <!-- <option value="{{key}}" ng-repeat="(key, value) in param.values">{{value}}</option> -->
  43. </select>
  44. </div>
  45. <div class="" ng-if="param.type == 'number'">
  46. <input type="number" class="form-control" required="param.required" ng-model="setting[param.name]" />
  47. </div>
  48. <div class="" ng-if="param.type == 'color'">
  49. <we7-colorpicker we7-my-color="setting[param.name]" >12312</we7-colorpicker>
  50. </div>
  51. <div class="" ng-if="param.type == 'image'">
  52. <we7-file-up class="we7-input-img" ng-class="{active: setting[param.name]}" we7-file="test" data-key="{{paramKey}}" data-key="{{paramKey}}" on-confirm="fileChange">
  53. <img ng-src="{{setting[param.name]}}" alt="{{setting[param.name]}}">
  54. <a href="javascript:;" ng-if="!setting[param.name]" class="input-addon"> </a>
  55. </we7-file-up>
  56. </div>
  57. <div class="" ng-if="param.type == 'images'" style="display: flex;">
  58. <div class="we7-input-img active" ng-if="setting[param.name] && setting[param.name].length" ng-repeat="(imgKey, img) in setting[param.name]">
  59. <img ng-src="{{img}}" alt="{{img}}">
  60. <div class="cover-dark">
  61. <!-- <a href="" class="cut" ng-click="uploadImage()">更换</a> -->
  62. <a href="javascript:;" class="del" ng-click="delImage(paramKey, imgKey)"><i class="fa fa-times text-danger"></i></a>
  63. </div>
  64. </div>
  65. <div class="we7-input-img" we7-file-up we7-file="test" multiple="true" data-key="{{paramKey}}" on-confirm="fileChange" ng-if="(!setting[param.name] || setting[param.name].length < 5)">
  66. <a href="javascript:;" class="input-addon"> </a>
  67. </div>
  68. </div>
  69. <div class="" ng-if="param.type == 'richtext'">
  70. <we7-editor we7-my-value="setting[param.name]"></we7-editor>
  71. </div>
  72. <div class="help-block">请填写{{param.title}}</div>
  73. </div>
  74. </div>
  75. <div class="form-group" ng-if="params">
  76. <div class="form-controls col-sm-offset-2">
  77. <a href="javascript:;" class="btn btn-primary" ng-click="postData()">提交</a>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <script type="text/javascript">
  83. angular.module('moduleApp').value('config', {
  84. modulename: "{$module['name']}",
  85. token: "{$_W['token']}",
  86. apiUrl: "{php echo url('module/manage-account/setting_params', array('m' => $modulename))}"
  87. });
  88. angular.bootstrap($('.module-account-setting'), ['moduleApp']);
  89. </script>
  90. {template 'common/footer'}