xnAttachmentEdit.html
7.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html >
<html lang="zh-CN" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Cache-Control" CONTENT="no-store">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--公共引用-->
<link rel="Shortcut Icon" href="https://cdn.xiniunet.com/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://cdn.xiniunet.com/css/xn-bootstrap/1.0.2/bootstrap.min.css" >
<link rel="stylesheet" href="https://cdn.xiniunet.com/font/xn-icon-common/2.0.7/iconfont.min.css" />
<link rel="stylesheet" href="/guide/dist/styles/local.min.css" />
<!--公共引用-->
<script type="text/javascript" src="https://cdn.xiniunet.com/js/base/1.2.0/base.min.js" ></script>
<!--源码插件-->
<link rel="stylesheet" href="/guide/vendor/code-prettify/prettify.css" />
<script type="text/javascript" src="/guide/vendor/code-prettify/prettify.js" ></script>
<!--需要加载的文件-->
<link rel="stylesheet" href="https://cdn.xiniunet.com/js/xn-common/1.1.6/style.min.css" >
<script type="text/javascript" src="https://cdn.xiniunet.com/js/xn-common/1.1.6/commons.min.js" ></script>
<link rel="stylesheet" href="https://cdn.xiniunet.com/js/xn-attachment/1.4.0/style.min.css" >
<script type="text/javascript" src="https://cdn.xiniunet.com/js/xn-attachment/1.4.0/attachments.min.js" ></script>
<!--<script type="text/javascript" src="/guide/spm_modules/xn-directive-attachment/1.3.2/directive/attachments.js" ></script>-->
</head>
<body ng-controller="PageController" >
<div class="xn-main xn-width mt-20 xn-grid-layout auto clearfix" >
<div class="xn-main-header">
<span>{{setting.name}}</span>
<span class="ml-50 font-sm">{{setting.subtitle}}</span>
</div>
<div class="xn-main-body xn-grid-14 xn-lh" >
<div class="xn-demo">
<div class="title"><span class="h3-title">示例:</span></div>
<div class="xn-input-line clearfix">
<div xn-attachment-edit ng-model="attachmentEdit" ></div>
</div>
<div class="xn-input-line clearfix">
<div class="sub-title" >ng-Model返回值</div>
<div class="xn-col-md-22 xn-col-md-offset-1 xn-callback-data" >{{attachmentEdit}}</div>
</div>
</div>
<div class="xn-options">
<div class="title"><span class="h3-title">代码:</span></div>
<div class="xn-input-line clearfix">
<pre class="prettyprint lang-html linenums prettyprinted" id="options"></pre>
</div>
</div>
<div class="xn-explain">
<div class="title"><span class="h3-title">说明:</span><span class="f-right">(点击标题查看详情)</span></div>
<div class="xn-input-line clearfix">
<div class="sub-title" >ng-model</div>
<div class="explain-content" >
<p>必填 : 传入的数据和返回的数据</p>
</div>
<pre class="prettyprint" >
$scope.attachmentEdit = {
businessId:"561002190383484928", //必填 绑定的物料id
businessType : "EMPLOYEE", //必填 businessType 类型
businessCategory : "COMMON", // 必填 businessType 类型
list:[], //必填 返回的附件数组
diskId:"762931950951731200", //可选, 网盘id 如果没有会去根据用户查找
type:"document", //可选 文件类型
size:"1", // 可选 文件大小限制
};
</pre>
</div>
<div class="xn-input-line clearfix">
<div class="sub-title" ng-click="tabSubNav(2)">max-mumber</div>
<div class="explain-content" ng-if="setting.subNavActive===2">
<p>可选:附件最多个数 <p>
</div>
</div>
</div>
</div>
<div class="xn-main-body xn-col-md-8 xn-col-md-offset-1 xn-lh" >
<div class="xn-info">
<div class="title"><span class="h3-title">基本信息</span></div>
<div class="xn-input-line clearfix ">
<label class="xn-col-md-6 xn-text-right xn-label">隶属于:</label>
<div class="xn-col-md-18">{{setting.affiliated}}</div>
</div>
<div class="xn-input-line clearfix ">
<label class="xn-col-md-6 xn-text-right xn-label">version: </label>
<div class="xn-col-md-18" >{{setting.version}}</div>
</div>
<div class="xn-input-line clearfix ">
<label class="xn-col-md-6 xn-text-right xn-label">依赖组件:</label>
<div class="xn-col-md-18">{{setting.rely}}</div>
</div>
<div class="xn-input-line clearfix ">
<label class="xn-col-md-6 xn-text-right xn-label">CDN路径:</label>
<div class="xn-col-md-18 clearfix" >
{{setting.jsUrl}}<br/>{{setting.cssUrl}}
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
// 配置设置
(function () {
function htmlEscape(s) {
return s
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>');
}
// this page's own source code
var quineHtml = htmlEscape(
'<div xn-attachment-edit \n' +
' ng-model="{object}" \n' +
' [data-max-number="{number}"] \n' +
' >\n' +
'</div>');
// Highlight the operative parts:
quineHtml = quineHtml.replace(
/<script src[\s\S]*?><\/script>|<!--\?[\s\S]*?-->|<pre\b[\s\S]*?<\/pre>/g,
'<span class="operative">$&<\/span>');
// insert into PRE
document.getElementById("options").innerHTML = quineHtml;
})();
var pageController = function ($scope,$timeout) {
var version="1.4.0";
$scope.setting={
name:"附件编辑指令(多选)",
subtitle:"xnAttachmentEdit",
affiliated:"xn.directive.attachment",
version:version,
rely:"xn.common",
jsUrl:"js/xn-select/"+version+"/selects.min.js",
cssUrl:"js/xn-select/"+version+"/style.min.css",
subNavActive:null
};
$scope.tabSubNav=function (index) {
if($scope.setting.subNavActive==index){
$scope.setting.subNavActive=null
}else {
$scope.setting.subNavActive=index
}
};
/*逻辑处理*/
$scope.attachmentEdit = {
businessId:"561002190383484928",
businessType : "EMPLOYEE",
businessCategory : "COMMON",
list:[]
};
};
var xnConfig = {
myUrl: "http://my-plat.xiniunet.com/"
};
angular.module("myApp",["xn.directive.attachment","xn.common"])
.value("xnConfig",xnConfig)
.controller("PageController", ["$scope","$timeout", pageController]);
</script>
</body>
</html>