chain-saasui 1.0.6 → 1.0.8-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,19 @@
1
+ // sass-form 表单相关样式
2
+
3
+ // select-input
4
+ .saas-select-input {
5
+ display: inline-block;
6
+ width: 100%;
7
+ }
8
+
9
+ // select-input-number
10
+
11
+ .saas-input-number {
12
+ display: inline-block;
13
+ width: 100%;
14
+ }
15
+
16
+ // 文本
17
+ .saas-text-mode {
18
+ display: inline;
19
+ }
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <div class="saas-input" :class="{ 'saas-text-mode': from === 'text' }">
3
+ <!-- text 展示模式 -->
4
+ <span v-if="from === 'text'" class="saas-input-text">{{ textValue }}</span>
5
+
6
+ <!-- 可输入模式 -->
7
+ <el-input v-else v-model="newValue" v-bind="attrs" v-on="onEvents">
8
+ <template v-if="$slots.prepend" slot="prepend">
9
+ <slot name="prepend"></slot>
10
+ </template>
11
+ <template v-if="$slots.append" slot="append">
12
+ <slot name="append"></slot>
13
+ </template>
14
+ </el-input>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import { Input } from 'element-ui';
20
+ import { omit } from 'chain-lodash';
21
+ import attrsMixin from '../mixins/attrsMixin';
22
+ export default {
23
+ name: 'SInput',
24
+ mixins: [attrsMixin],
25
+ props: {
26
+ ...omit(Input.props, ['value', 'clearable', 'maxlength']),
27
+ maxlength: {
28
+ type: Number,
29
+ default: 120,
30
+ },
31
+ placeholder: {
32
+ type: String,
33
+ default() {
34
+ return this.$t('InputPlaceholder.pleasemsg');
35
+ },
36
+ },
37
+ },
38
+ computed: {},
39
+ };
40
+ </script>
41
+
42
+ <style lang="scss" scoped></style>
@@ -0,0 +1,209 @@
1
+ <template>
2
+ <div class="saas-input-number" :class="{ 'saas-text-mode': from === 'text' }">
3
+ <!-- text 展示模式 -->
4
+ <span v-if="from === 'text'" class="saas-input-number-text">{{ textValue }}</span>
5
+
6
+ <!-- 可输入模式 -->
7
+ <el-input v-else v-model="internalValue" v-bind="attrs" v-on="mergedListeners">
8
+ <template v-if="$slots.prepend" slot="prepend">
9
+ <slot name="prepend"></slot>
10
+ </template>
11
+ <template v-if="$slots.append" slot="append">
12
+ <slot name="append"></slot>
13
+ </template>
14
+ </el-input>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import { Input } from 'element-ui';
20
+ import { omit } from 'chain-lodash';
21
+ import attrsMixin from '../mixins/attrsMixin';
22
+
23
+ export default {
24
+ name: 'SInputNumber',
25
+ mixins: [attrsMixin],
26
+ props: {
27
+ ...omit(Input.props, ['value', 'clearable']),
28
+ value: {
29
+ type: [String, Number],
30
+ default: '',
31
+ },
32
+ placeholder: {
33
+ type: String,
34
+ default() {
35
+ return this.$t('InputPlaceholder.pleasemsg');
36
+ },
37
+ },
38
+ componentType: {
39
+ type: String,
40
+ default: 'inputNumber',
41
+ },
42
+ min: {
43
+ type: Number,
44
+ default: -Infinity,
45
+ },
46
+ max: {
47
+ type: Number,
48
+ default: Infinity,
49
+ },
50
+ // 新增属性:是否允许小数
51
+ allowDecimal: {
52
+ type: Boolean,
53
+ default: false,
54
+ },
55
+ // 新增属性:小数精度
56
+ precision: {
57
+ type: Number,
58
+ default: 0,
59
+ },
60
+ },
61
+ data() {
62
+ return {
63
+ internalValue: this.value.toString(),
64
+ };
65
+ },
66
+ computed: {
67
+ mergedListeners() {
68
+ return {
69
+ ...this.onEvents,
70
+ input: this.handleInput,
71
+ blur: this.handleBlur,
72
+ };
73
+ },
74
+ },
75
+ watch: {
76
+ value(newVal) {
77
+ if (this.from !== 'text') {
78
+ this.internalValue = this.formatInputValue(newVal);
79
+ }
80
+ },
81
+ },
82
+ methods: {
83
+ // 处理输入
84
+ handleInput(value) {
85
+ let filteredValue = value;
86
+
87
+ if (this.allowDecimal) {
88
+ // 允许数字、负号和小数点
89
+ filteredValue = value.replace(/[^-?\d.]/g, '');
90
+
91
+ // 处理多个小数点的情况,只保留第一个小数点
92
+ const dotCount = (filteredValue.match(/\./g) || []).length;
93
+ if (dotCount > 1) {
94
+ const firstDotIndex = filteredValue.indexOf('.');
95
+ filteredValue = filteredValue.substring(0, firstDotIndex + 1) + filteredValue.substring(firstDotIndex + 1).replace(/\./g, '');
96
+ }
97
+
98
+ // 限制小数位数(输入时限制,避免输入过长小数)
99
+ if (dotCount > 0 && this.precision >= 0) {
100
+ const parts = filteredValue.split('.');
101
+ if (parts[1] && parts[1].length > this.precision) {
102
+ filteredValue = parts[0] + '.' + parts[1].substring(0, this.precision);
103
+ }
104
+ }
105
+ } else {
106
+ // 只允许数字和负号
107
+ filteredValue = value.replace(/[^-?\d]/g, '');
108
+ }
109
+
110
+ // 处理多个负号的情况,只保留第一个负号
111
+ const minusSignCount = (filteredValue.match(/-/g) || []).length;
112
+ if (minusSignCount > 1) {
113
+ filteredValue = filteredValue.replace(/-/g, '');
114
+ filteredValue = '-' + filteredValue;
115
+ }
116
+
117
+ // 确保负号只能在开头
118
+ if (minusSignCount === 1 && !filteredValue.startsWith('-')) {
119
+ filteredValue = filteredValue.replace(/-/g, '');
120
+ filteredValue = '-' + filteredValue;
121
+ }
122
+
123
+ // 处理多个0的情况
124
+ if (filteredValue.startsWith('0') && filteredValue.length > 1 && !filteredValue.startsWith('-')) {
125
+ filteredValue = filteredValue.replace(/^0+/, '0');
126
+ // 如果第一个字符是0且后面有数字,去掉前面的0
127
+ if (filteredValue.length > 1 && filteredValue[1] !== '.') {
128
+ filteredValue = filteredValue.replace(/^0+/, '');
129
+ }
130
+ }
131
+
132
+ // 处理负号后多个0的情况
133
+ if (filteredValue.startsWith('-0') && filteredValue.length > 2) {
134
+ // 如果是 -0.xxx 格式,则保留
135
+ if (filteredValue[2] !== '.') {
136
+ filteredValue = filteredValue.replace(/^(-)0+/, '$1');
137
+ }
138
+ // 如果负号后只有0,保留一个0
139
+ if (filteredValue === '-') {
140
+ filteredValue = '-0';
141
+ }
142
+ }
143
+
144
+ this.internalValue = filteredValue;
145
+
146
+ // 触发input事件
147
+ let emitValue;
148
+ if (filteredValue === '' || filteredValue === '-') {
149
+ emitValue = '';
150
+ } else if (this.allowDecimal) {
151
+ emitValue = parseFloat(filteredValue);
152
+ } else {
153
+ emitValue = parseInt(filteredValue, 10);
154
+ }
155
+ this.$emit('input', emitValue);
156
+ },
157
+
158
+ // 处理失焦事件,进行最终验证和格式化
159
+ handleBlur() {
160
+ let finalValue = this.internalValue;
161
+
162
+ // 空值或只有负号的处理
163
+ if (finalValue === '' || finalValue === '-') {
164
+ this.$emit('input', '');
165
+ this.internalValue = '';
166
+ this.$emit('blur', '');
167
+ return;
168
+ }
169
+
170
+ // 转换为数字
171
+ let numericValue;
172
+ if (this.allowDecimal) {
173
+ numericValue = parseFloat(finalValue);
174
+ // 根据精度进行四舍五入
175
+ if (this.precision >= 0) {
176
+ numericValue = parseFloat(numericValue.toFixed(this.precision));
177
+ }
178
+ } else {
179
+ numericValue = parseInt(finalValue, 10);
180
+ }
181
+
182
+ // 范围限制
183
+ if (numericValue < this.min) {
184
+ numericValue = this.min;
185
+ } else if (numericValue > this.max) {
186
+ numericValue = this.max;
187
+ }
188
+
189
+ // 更新值并在失焦时格式化显示
190
+ if (this.allowDecimal && this.precision >= 0) {
191
+ this.internalValue = numericValue.toString(); // 不在输入时添加.toFixed
192
+ } else {
193
+ this.internalValue = numericValue.toString();
194
+ }
195
+
196
+ this.$emit('input', numericValue);
197
+ this.$emit('blur', numericValue);
198
+ },
199
+
200
+ // 格式化输入值
201
+ formatInputValue(value) {
202
+ if (value === '' || value === null || value === undefined) {
203
+ return '';
204
+ }
205
+ return value.toString(); // 不在初始化时格式化
206
+ },
207
+ },
208
+ };
209
+ </script>
@@ -1,16 +1,7 @@
1
1
  <template>
2
- <div class="saas-select" :class="{ 'saas-search-textbox': from === 'text' }">
3
- <span v-if="from === 'text'" class="search-dict">{{ selectValue }}</span>
4
- <el-select
5
- v-else
6
- style="width: 100%"
7
- v-model="newValue"
8
- :size="size"
9
- :multiple="multiple"
10
- :placeholder="placeholder"
11
- v-bind="$attrs"
12
- filterable
13
- clearable>
2
+ <div class="saas-select" :class="{ 'saas-text-mode': from === 'text' }">
3
+ <span v-if="from === 'text'" class="input-text">{{ textValue }}</span>
4
+ <el-select v-else class="saas-select-input" v-model="newValue" v-on="onEvents" v-bind="attrs" filterable clearable>
14
5
  <template v-for="item in options">
15
6
  <!-- 如果item有options属性,说明是分组 -->
16
7
  <el-option-group v-if="item.options" :key="item.value" :label="item.label">
@@ -30,8 +21,10 @@
30
21
  <script>
31
22
  import { isEmpty, omit } from 'chain-lodash';
32
23
  import { Select } from 'element-ui';
24
+ import attrsMixin from '../mixins/attrsMixin';
33
25
  export default {
34
26
  name: 'SSelect',
27
+ mixins: [attrsMixin],
35
28
  props: {
36
29
  ...omit(Select.props, ['value', 'clearable']),
37
30
  value: {
@@ -41,20 +34,14 @@ export default {
41
34
  type: Boolean,
42
35
  default: () => true,
43
36
  },
44
- placeholder: {
45
- type: String,
46
- default() {
47
- return this.$t('InputPlaceholder.pleasemsg');;
48
- },
49
- },
50
- from: {
51
- type: String,
52
- default: 'select',
53
- },
54
37
  options: {
55
38
  type: Array,
56
39
  default: () => [],
57
40
  },
41
+ componentType: {
42
+ type: String,
43
+ default: 'select',
44
+ },
58
45
  },
59
46
  data() {
60
47
  return {};
@@ -76,19 +63,6 @@ export default {
76
63
  this.$emit('input', val);
77
64
  },
78
65
  },
79
- selectValue() {
80
- const multiple = this.multiple;
81
- // 扁平化所有选项,包括分组中的选项
82
- const allOptions = this.flattenOptions(this.options || []);
83
-
84
- if (multiple) {
85
- const nameArr = allOptions.filter(f => this.newValue.includes(f.value)).map(m => m.label);
86
- return nameArr.length > 1 ? `${nameArr[0]} +${nameArr.length - 1}` : nameArr[0];
87
- } else {
88
- const obj = allOptions.find(f => f.value == this.newValue) || {};
89
- return obj.label || '-';
90
- }
91
- },
92
66
  },
93
67
  methods: {
94
68
  flattenOptions(options) {
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <el-switch v-model="newValue" v-bind="attrs" v-on="onEvents"></el-switch>
3
+ </template>
4
+
5
+ <script>
6
+ import { Input } from 'element-ui';
7
+ import { omit } from 'chain-lodash';
8
+ import attrsMixin from '../mixins/attrsMixin';
9
+ export default {
10
+ name: 'SSwitch',
11
+ mixins: [attrsMixin],
12
+ props: {
13
+ ...omit(Input.props, ['value']),
14
+ activeValue: {
15
+ type: [Boolean, String, Number],
16
+ default: 1,
17
+ },
18
+ inactiveValue: {
19
+ type: [Boolean, String, Number],
20
+ default: 0,
21
+ },
22
+ componentType: {
23
+ type: String,
24
+ default: 'select',
25
+ },
26
+ },
27
+ computed: {
28
+ newValue: {
29
+ get() {
30
+ return this.value;
31
+ },
32
+ set(val) {
33
+ this.$emit('input', val);
34
+ },
35
+ },
36
+ },
37
+ };
38
+ </script>
@@ -0,0 +1,4 @@
1
+ export { default as SInput } from './SInput/index';
2
+ export { default as SSelect } from './SSelect/index';
3
+ export { default as SInputNumber } from './SInputNumber/index';
4
+ export { default as SSwitch } from './SSwitch/index';
@@ -0,0 +1,87 @@
1
+ // src/mixins/fieldMixin.js
2
+ import { isEmpty } from 'chain-lodash';
3
+
4
+ export default {
5
+ props: {
6
+ value: {
7
+ type: [String, Number, Array],
8
+ default: '',
9
+ },
10
+ mode: {
11
+ // 运行方式 比如 表单、搜索
12
+ type: String, // FORM | SEARCH
13
+ default: 'FORM',
14
+ },
15
+ clearable: {
16
+ type: Boolean,
17
+ default: true,
18
+ },
19
+ from: {
20
+ // 来源 比如 是输入框 还是仅 text预览
21
+ type: String, // 'input' | 'text'
22
+ default: 'input',
23
+ },
24
+ placeholder: {
25
+ type: String,
26
+ default() {
27
+ return this.$t('selectGroup.pleaseSelect');
28
+ },
29
+ },
30
+ componentType: {
31
+ type: String,
32
+ default: 'input', // 'input' | 'select' | 'date' | 等其他类型
33
+ },
34
+ },
35
+ computed: {
36
+ newValue: {
37
+ get() {
38
+ return !isEmpty(this.value) && this.value != null ? String(this.value) : '';
39
+ },
40
+ set(val) {
41
+ this.$emit('input', val);
42
+ },
43
+ },
44
+ textValue() {
45
+ // 如果是 select,就展示选项文字
46
+ if (this.componentType == 'select') {
47
+ const allOptions = this.flattenOptions(this.options);
48
+ if (this.multiple) {
49
+ const nameArr = allOptions.filter(f => this.newValue.includes(f.value)).map(m => m.label);
50
+ return nameArr.length > 1 ? `${nameArr[0]} +${nameArr.length - 1}` : nameArr[0] || '-';
51
+ } else {
52
+ const obj = allOptions.find(f => f.value == this.newValue) || {};
53
+ return obj.label || '-';
54
+ }
55
+ }
56
+ // 默认就是 input 的文本
57
+ return this.newValue || '-';
58
+ },
59
+ attrs() {
60
+ const merged = Object.assign({}, this.defaultAttrs, this.$props, this.$attrs);
61
+ // 过滤掉一些不需要传递的属性
62
+ const exclude = ['value', 'from']; // 不需要传递给el-input的属性
63
+ return Object.keys(merged)
64
+ .filter(key => !exclude.includes(key))
65
+ .reduce((obj, key) => {
66
+ obj[key] = merged[key];
67
+ return obj;
68
+ }, {});
69
+ },
70
+ onEvents() {
71
+ return this.$listeners;
72
+ },
73
+ },
74
+ methods: {
75
+ flattenOptions(options) {
76
+ const result = [];
77
+ options.forEach(item => {
78
+ if (item.options) {
79
+ result.push(...item.options);
80
+ } else {
81
+ result.push(item);
82
+ }
83
+ });
84
+ return result;
85
+ },
86
+ },
87
+ };
@@ -11,8 +11,8 @@ import SMessagebox from './SMessagebox/index';
11
11
  import STable from './STable/index';
12
12
  import SContainer from './SContainer/index';
13
13
  import STablecolumn from './STable/STablecolumn';
14
- import SSelect from './SForm/SSelect/index';
15
-
14
+ import * as baseComponents from './SForm';
15
+ console.log(baseComponents);
16
16
  const components = {
17
17
  SDrawer,
18
18
  SDialog,
@@ -25,7 +25,7 @@ const components = {
25
25
  STableButtons,
26
26
  SContainer,
27
27
  STablecolumn,
28
- SSelect,
28
+ ...baseComponents,
29
29
  };
30
30
 
31
31
  const install = function (Vue) {
@@ -1 +1 @@
1
- module.exports=function(t){var e={};function s(a){if(e[a])return e[a].exports;var l=e[a]={i:a,l:!1,exports:{}};return t[a].call(l.exports,l,l.exports,s),l.l=!0,l.exports}return s.m=t,s.c=e,s.d=function(t,e,a){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var l in t)s.d(a,l,function(e){return t[e]}.bind(null,l));return a},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=3)}([function(t,e){t.exports=require("chain-lodash")},function(t,e){t.exports=require("element-ui")},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAAXNSR0IArs4c6QAAADBQTFRFAAAAIK9wML9wKLdoKLdwKLdsKbhpKLlqKLdqKLhrKLdpKLhrKbhrKLhqKblqKLhqgtDn1gAAAA90Uk5TABAQICBAcH+An6C/z9/vjSAyHgAAAJdJREFUKM9dzs0JwkAUReGDIkwJFmELwmA/giXYQVpICa5sw417dy4FN+IPyc0YZ2Jy7/Lw8XhUKmuPkbSg/159qUbl6kQ7Jw8n7eTKeykdxqReSHcyuSXAWnqSyeaken6RPmQSVz1QQybn2f4LJDJpYg+GkMgPlJDIVpMwvMtAPAQPheAEJzjBCU5wghOc4AQnOMGJh9AB/uTa5S04zqUAAAAASUVORK5CYII="},function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-drawer",t._g(t._b({staticClass:"saas-drawer",attrs:{wrapperClosable:!1,visible:t.show},on:{"update:visible":function(e){t.show=e}}},"el-drawer",t.bindProps,!1),t.$listeners),[t.$slots.title?s("template",{slot:"title"},[t._t("title")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-drawer-content"},[t._t("default")],2),t._v(" "),t.showFooter?s("div",{staticClass:"saas-drawer-footer"},[t.$slots.footer?t._t("footer"):[t.showCancelButton?s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),t.showConfirmButton?s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v("\n "+t._s(t.confirmText)+"\n ")]):t._e()]],2):t._e()],2)};a._withStripped=!0;var l=s(1),n=s(0);function i(t,e,s,a,l,n,i,o){var r,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),a&&(u.functional=!0),n&&(u._scopeId="data-v-"+n),i?(r=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),l&&l.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=r):l&&(r=o?function(){l.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:l),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(t,e){return r.call(e),c(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,r):[r]}return{exports:t,options:u}}var o=i({name:"SDrawer",props:{...l.Drawer.props,showFooter:{type:Boolean,default:()=>!0},size:{type:[String,Number],default:()=>"800px"},wrapperClosable:{type:Boolean,default:()=>!1},loadingBtn:{type:Boolean,default:()=>!1},appendToBody:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},showConfirmButton:{type:Boolean,default:!0},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}},bindProps(){return Object(n.omit)(this.$props,["visible"])}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("update:visible",!1),this.$emit("close")}}},a,[],!1,null,null,null).exports,r=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-dialog",t._g(t._b({staticClass:"saas-dialog",attrs:{"close-on-click-modal":!1,visible:t.show},on:{"update:visible":function(e){t.show=e}}},"el-dialog",t.bindProps,!1),t.$listeners),[t.$slots.title?s("template",{slot:"title"},[t._t("title")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-dialog-content",class:{"saas-dialog-auto":t.isAuto}},[t._t("default")],2),t._v(" "),t.showFooter?s("template",{slot:"footer"},[t.$slots.footer?t._t("footer"):s("div",[t.showCancelButton?s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),t.showConfirmButton?s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v("\n "+t._s(t.confirmText)+"\n ")]):t._e()],1)],2):t._e()],2)};r._withStripped=!0;var u=i({name:"SDialog",props:{...l.Dialog.props,showFooter:{type:Boolean,default:()=>!0},width:{type:[String,Number],default:()=>"600px"},loadingBtn:{type:Boolean,default:()=>!1},visible:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:()=>!0},showConfirmButton:{type:Boolean,default:()=>!0},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}},isAuto:{type:Boolean,default:!0}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}},bindProps(){return Object(n.omit)(this.$props,["visible"])}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("update:visible",!1),this.$emit("close")}}},r,[],!1,null,null,null).exports,c=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-detail"},[s("div",{staticClass:"saas-detail-top"},[s("div",{staticClass:"saas-detail-header"},[s("div",{staticClass:"saas-detail-backbox"},[t.showClose?s("div",{staticClass:"saas-detail-back",on:{click:t.goBack}},[s("span",{staticClass:"el-icon-arrow-left"})]):t._e()]),t._v(" "),s("div",{staticClass:"saas-detail-titlebox",style:t.computeStyle},[s("div",{staticClass:"saas-detail-title"},[s("span",{staticClass:"saas-title-line"}),t._v(" "),t.$slots.title?[t._t("title")]:s("span",[t._v("\n "+t._s(t.title)+"\n ")])],2),t._v(" "),t.titleSub?s("div",{staticClass:"saas-detail-sub"},[t._v(t._s(t.titleSub))]):t._e()]),t._v(" "),t._t("header-append")],2),t._v(" "),s("div",{staticClass:"saas-detail-content"},[t._t("default")],2)]),t._v(" "),t.showFooter?[s("div",{staticClass:"saas-detail-footer"},[t.$slots.footer?t._t("footer"):[s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]),t._v(" "),s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v(t._s(t.confirmText))])]],2)]:t._e()],2)};c._withStripped=!0;var d=i({name:"SPagedetail",props:{showFooter:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!0},loadingBtn:{type:Boolean,default:()=>!1},computeStyle:{type:Object,default:()=>({width:"1000px",margin:"0 auto"})},title:{type:String,default:""},titleSub:{type:String,default:""},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},c,[],!1,null,"063e3770",null).exports,p=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-page-table"},[s("div",{staticClass:"saas-page-table-header"},[t.showTitle?s("div",{staticClass:"saas-page-table-menu",class:{hasClose:t.showClose}},[t.showClose?[s("div",{staticClass:"saas-page-table-back",on:{click:t.goBack}},[s("span",{staticClass:"el-icon-arrow-left"})]),t._v(" "),s("span",{staticClass:"saas-page-table-back_title"},[t._v(t._s(t.$t("atSalaryFileImport.return")))]),t._v(" "),s("span",{staticClass:"saas-page-table-title_line"})]:t._e(),t._v(" "),t.showClose?t._e():s("span",{staticClass:"saas-page-title-line"}),t._v(" "),s("span",{staticClass:"saas-page-table-title"},[t.$slots.title?[t._t("title")]:s("span",[t._v(t._s(t.title))])],2),t._v(" "),t._t("header-append")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-page-table-form"},[t._t("form")],2)]),t._v(" "),s("div",{staticClass:"saas-page-table-content"},[t._t("default")],2),t._v(" "),s("div",{staticClass:"saas-page-table-footer"},[t._t("footer")],2)])};p._withStripped=!0;var h=i({name:"SPagetable",props:{showFooter:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!1},loadingBtn:{type:Boolean,default:()=>!1},computeStyle:{type:Object,default:()=>({width:"1000px",margin:"0 auto"})},title:{type:String,default(){return this.$t("saasmenu."+this.$route.meta.code)}},titleSub:{type:String,default:""},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}},showTitle:{type:Boolean,default:!0}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},p,[],!1,null,"fe71db8e",null).exports,m=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-unit"},[e("span",{class:"saas-unit-"+this.typeCom}),this._v(" "),e("span",{staticClass:"saas-unit-text"},[this._t("default",[this._v("\n "+this._s(this.getValue)+"\n ")])],2)])};m._withStripped=!0;var f=i({name:"SUnit",props:{value:[String,Number],type:{type:String,default:""},options:{type:Array,default:()=>[]},props:{type:Object,default:()=>({value:"value",label:"label",style:"style",type:"",isShowCode:!1})}},data:()=>({}),computed:{typeCom(){if(Object(n.isEmpty)(this.value))return this.type||"primary";{const t=this.props.style||"style";return Object(n.getOptionValue)(this.options,this.value,{...this.props,label:t})||"primary"}},getValue(){if(!Object(n.isEmpty)(this.value)){const t=Object(n.getOptionValue)(this.options,this.value,this.props);return Object(n.formatIfJson)(t)}return""}},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},m,[],!1,null,"0315617a",null).exports,_=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-card"},[e("div",{staticClass:"saas-card-header"},[this._t("title",[this._v("\n "+this._s(this.title)+"\n ")])],2),this._v(" "),e("div",{staticClass:"saas-card-content"},[this._t("default")],2)])};_._withStripped=!0;var v=i({name:"SCard",props:{title:{type:String,default:""},titleSub:{type:String,default:""}},data:()=>({}),computed:{},deactivated(){},methods:{}},_,[],!1,null,"f1b3ff3e",null).exports,b=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"saas-group"},t._l(t.list,(function(e,l){return a("div",{key:l,staticClass:"saas-sort-group"},t._l(e.children,(function(l,n){return a("div",{key:n,staticClass:"saas-sort-item",class:{active:t.getActive(l,e)},on:{click:function(s){return t.handleClick(l,e)}}},[a("div",{staticClass:"title",style:t.getSortStyle(l)},[t._v(t._s(l.formatValue(l,t.data)))]),t._v(" "),a("div",{staticClass:"text"},[a("span",[t._t("default",[t._v("\n "+t._s(l.label)+"\n "),l.tip?a("el-tooltip",{attrs:{content:l.tip}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:t._s(l.tip)},slot:"content"}),t._v(" "),a("i",{staticClass:"smart-info-filled",staticStyle:{color:"#a1a5b2","margin-left":"4px"}})]):t._e()],{item:l})],2)]),t._v(" "),a("img",{attrs:{src:s(2),alt:"",srcset:""}})])})),0)})),0)};b._withStripped=!0;var g=i({name:"SGroup",props:{title:{type:String,default:""},list:{type:Array,default:()=>[]},data:{type:Object,default:()=>({})},isActive:{type:Function,default:null}},data:()=>({}),computed:{},deactivated(){},methods:{getSortStyle(t){let e={};if("percent"===t.type){const s=this.data[t.field];e.color=s<=30?"#FF3B30":s<=60?"#FF9900":"#28B86A"}return e},handleClick(t,e){this.$emit("tab-click",t,e)},getActive(t,e){return!!this.isActive&&this.isActive(t,e)}}},b,[],!1,null,"a1243d5a",null).exports,y=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-table-buttons"},[t._l(t.buttonList,(function(e,a){return[s("el-tooltip",{key:a,attrs:{disabled:!e.tip,placement:"top",content:e.tip}},[s("el-button",t._b({on:{click:function(s){return t.handelClick(e.action)}}},"el-button",t.finalAttrs(e.attrs),!1),[t._v(t._s(e.label))])],1)]})),t._v(" "),t.dropdownList.length?s("el-dropdown",{on:{command:t.handleCommand}},[s("el-button",t._b({},"el-button",t.btnProps,!1),["more"==t.moreType?s("i",{staticClass:"smart-More"}):"text"==t.moreType?[t._v("\n "+t._s(t.text)+"\n "),s("i",{staticClass:"el-icon-arrow-down"})]:t._e()],2),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.dropdownList,(function(e,a){return s("el-dropdown-item",t._b({key:a,attrs:{command:e.action}},"el-dropdown-item",t.finalAttrs(e.attrs),!1),[s("el-tooltip",{attrs:{disabled:!e.tip,placement:"top",content:e.tip}},[s("span",[t._v(t._s(e.label))])])],1)})),1)],1):t._e()],2)};y._withStripped=!0;var w=i({name:"STableButtons",props:{list:{type:Array,default:()=>[]},maxLength:{type:Number,default:2},moreType:{type:String,default:"more"},text:{type:String,default(){return this.$t("buttonGroup.more")}},row:{type:Object,default:()=>({})}},data:()=>({btnProps:{size:"mini",type:"text"}}),computed:{showList(){return this.list.filter(t=>{const e=!!Object(n.isEmpty)(t.show)||t.show;return"function"==typeof e?e(this.row):Boolean(e)})},buttonList(){return this.showList.slice(0,this.maxLength)},dropdownList(){return this.showList.slice(this.maxLength)}},methods:{finalAttrs(t={}){return{...this.btnProps,...t}},handleCommand(t){this.$emit("action",t,this.row)},handelClick(t){this.$emit("action",t,this.row)}}},y,[],!1,null,null,null).exports,C=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("transition",{attrs:{name:"el-fade-in-linear"}},[t.visible?s("div",{staticClass:"message-box-overlay"},[s("div",{staticClass:"message-box"},[s("div",{staticClass:"message-box_main"},[s("div",{staticClass:"message-box_icon"},[s("span",{staticClass:"el-icon-warning"})]),t._v(" "),s("div",{staticClass:"message-box_right"},[s("div",{staticClass:"message-box__header"},[s("span",{staticClass:"message-box__title"},[t._v(t._s(t.title))])]),t._v(" "),s("div",{staticClass:"message-box__content"},[t.message&&0==t.dangerouslyUseHTMLString?s("div",[t._v(t._s(t.message))]):t._e(),t._v(" "),t.message&&t.dangerouslyUseHTMLString?s("div",{domProps:{innerHTML:t._s(t.message)}}):t._e(),t._v(" "),t.showInput?s("el-input",{staticClass:"message-box__input",attrs:{placeholder:t.inputPlaceholder},model:{value:t.inputValue,callback:function(e){t.inputValue=e},expression:"inputValue"}}):t._e()],1)])]),t._v(" "),s("div",{staticClass:"message-box__footer"},[t.showCancelButton?s("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),s("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.handleConfirm}},[t._v(t._s(t.confirmText))])],1)])]):t._e()])};C._withStripped=!0;var S=i({name:"SMessageBox",props:{},data:()=>({visible:!1,title:"",message:"",showInput:!1,inputValue:"",inputPlaceholder:"",showCancelButton:!1,resolve:null,reject:null,confirmText:"",cancelText:"",dangerouslyUseHTMLString:!1}),methods:{open(t){return this.title=t.title,this.message=t.message||"",this.showClose=!!Object(n.isEmpty)(t.showClose)||t.showClose,this.showInput=t.showInput||!1,this.dangerouslyUseHTMLString=t.dangerouslyUseHTMLString||!1,this.inputPlaceholder=t.inputPlaceholder||"",this.showCancelButton=!!Object(n.isEmpty)(t.showCancelButton)||t.showCancelButton,this.confirmText=t.confirmText,this.cancelText=t.cancelText,this.visible=!0,this.inputValue="",new Promise((t,e)=>{this.resolve=t,this.reject=e})},handleConfirm(){this.visible=!1,this.showInput?this.resolve(this.inputValue):this.resolve(!0)},handleCancel(){this.visible=!1,this.reject("cancel")}}},C,[],!1,null,null,null).exports;var x=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-table",t._g(t._b({ref:"saasTable",staticClass:"saas-table"},"el-table",t.$props,!1),t.$listeners),[t._t("default"),t._v(" "),t._l(t.columns,(function(e){return s("STablecolumn",{key:e.value,attrs:{column:e},on:{action:t.handleColumnAction},scopedSlots:t._u([{key:e.value,fn:function(s){return[t._t(e.value,null,null,t.getBindProps(s,e))]}}],null,!0)})}))],2)};x._withStripped=!0;var $=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-table-column",t._b({scopedSlots:t._u(["index"===t.column.type?{key:"default",fn:function(e){var s=e.$index,a=e.row;return[t._t("default",[t._v("\n "+t._s(t.getIndex(s))+"\n ")],{index:t.getIndex(s),row:a})]}}:"operate"===t.column.type?{key:"default",fn:function(e){return[t._t(t.column.value,[s("s-table-buttons",{attrs:{list:t.column.actionList,row:e.row},on:{action:t.handleAction}})],null,t.getBindProps(e))]}}:"unit"===t.column.type?{key:"default",fn:function(e){return[t._t(t.column.value,[s("s-unit",{attrs:{value:e.row[t.column.value],options:t.column.options}})],null,t.getBindProps(e))]}}:{key:"default",fn:function(e){return[t._t(t.column.value,[t._v("\n "+t._s(t.selectValue(e.row))+"\n ")],null,t.getBindProps(e))]}}],null,!0)},"el-table-column",t.columnProps,!1),[s("template",{slot:"header"},[t.$slots["header-"+t.column.value]?t._t("header-"+t.column.value,[t._v("\n "+t._s(t.column.label)+"\n ")],{column:t.column}):[s("span",[t._v(t._s(t.column.label))]),t._v(" "),t.column.tip?s("el-tooltip",{attrs:{placement:"top",content:t.column.tip}},[s("i",{staticClass:"smart-info-filled",staticStyle:{color:"#a1a5b2","margin-left":"6px"}})]):t._e()]],2)],2)};$._withStripped=!0;var A=i({name:"STablecolumn",components:{STableButton:w,SUnit:f},props:{column:Object,minWidth:{type:[Number,String],default:150}},data:()=>({}),computed:{columnProps(){const{type:t=null,fixed:e=null}=this.column;return{...this.column,fixed:e||("operate"===t?"right":null),"min-width":this.column.minWidth||this.minWidth,prop:this.column.value,label:this.column.label,showOverflowTooltip:null==this.column.showOverflowTooltip||this.column.showOverflowTooltip,index:this.column.indexMethod||null}}},methods:{selectValue(t){let e="";const{options:s=[],type:a="txt"}=this.column,l=t[this.column.value];if(this.column.formatValue)return this.column.formatValue(t,this.column);switch(a){case"select":let t=s.find(t=>t.value==l)||{};e=Object(n.formatIfJson)(t.label);break;case"time":e=Object(n.formatSubmitTime)(l,"DD/MM/YYYY");break;default:e=Object(n.formatIfJson)(l)}return Object(n.isEmpty)(e)?e=this.column.defaultValue||"-":e.length>500&&(e=e.slice(0,500)+"..."),e},getBindProps(t){return{...t,column:this.column}},getIndex(t){return this.indexMethod?this.indexMethod(t):t+1},handleAction(t,e){this.$emit("action",t,e,this.column)}}},$,[],!1,null,null,null).exports,T=i({name:"STable",props:{...l.Table.props,border:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]}},components:{STablecolumn:A},data:()=>({}),computed:{},deactivated(){},methods:{handleColumnAction(t,e,s){this.$emit("action",t,e,s)},getBindProps:(t,e)=>({...t,column:e})}},x,[],!1,null,null,null).exports,B=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-container"},[e("div",{staticClass:"saas-container-header"},[this._t("header")],2),this._v(" "),e("div",{staticClass:"saas-container-content"},[this._t("default")],2),this._v(" "),e("div",{staticClass:"saas-container-footer"},[this._t("footer")],2)])};B._withStripped=!0;var k=i({name:"SContainer",props:{title:{type:String,default:""},titleSub:{type:String,default:""}},data:()=>({}),computed:{},deactivated(){},methods:{}},B,[],!1,null,"2036a697",null).exports,O=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-select",class:{"saas-search-textbox":"text"===t.from}},["text"===t.from?s("span",{staticClass:"search-dict"},[t._v(t._s(t.selectValue))]):s("el-select",t._b({staticStyle:{width:"100%"},attrs:{size:t.size,multiple:t.multiple,placeholder:t.placeholder,filterable:"",clearable:""},model:{value:t.newValue,callback:function(e){t.newValue=e},expression:"newValue"}},"el-select",t.$attrs,!1),[t._l(t.options,(function(e){return[e.options?s("el-option-group",{key:e.value,attrs:{label:e.label}},t._l(e.options,(function(t){return s("el-option",{key:t.value,attrs:{disabled:t.disabled,label:t.label,value:t.value}})})),1):s("el-option",{key:e.value,attrs:{disabled:e.disabled,label:e.label,value:e.value}})]}))],2)],1)};O._withStripped=!0;const P={SDrawer:o,SDialog:u,SPagedetail:d,SUnit:f,SCard:v,SGroup:g,SPagetable:h,STable:T,STableButtons:w,SContainer:k,STablecolumn:A,SSelect:i({name:"SSelect",props:{...Object(n.omit)(l.Select.props,["value","clearable"]),value:{type:[String,Number,Array]},clearable:{type:Boolean,default:()=>!0},placeholder:{type:String,default(){return this.$t("InputPlaceholder.pleasemsg")}},from:{type:String,default:"select"},options:{type:Array,default:()=>[]}},data:()=>({}),computed:{newValue:{get(){let t=this.multiple?[]:"";return this.multiple?t=(this.value||[]).map(t=>null!=t?String(t):""):Object(n.isEmpty)(this.value)||null==this.value||(t=String(this.value)),t},set(t){this.$emit("input",t)}},selectValue(){const t=this.multiple,e=this.flattenOptions(this.options||[]);if(t){const t=e.filter(t=>this.newValue.includes(t.value)).map(t=>t.label);return t.length>1?`${t[0]} +${t.length-1}`:t[0]}return(e.find(t=>t.value==this.newValue)||{}).label||"-"}},methods:{flattenOptions(t){const e=[];return t.forEach(t=>{t.options?e.push(...t.options):e.push(t)}),e}}},O,[],!1,null,"5321246e",null).exports},V=function(t){V.installed||Object.keys(P).forEach(e=>{t.component(P[e].name,P[e])})};"undefined"!=typeof window&&window.Vue&&V(window.Vue);e.default={version:"1.0.0",install:V,SMessagebox:class{constructor(t,e,s=S){if(!t)throw new Error("[MessageBox] Vue instance is required");if(!s)throw new Error("[MessageBox] Vue component is required");this.Vue=t,this.i18n=e,this.Component=s,this.instance=null}_t(t){return this.i18n?this.i18n.t(t):t}_createInstance(){const t=this.Vue.extend(this.Component);this.instance=new t({el:document.createElement("div")}),document.body.appendChild(this.instance.$el)}_getInstance(){return this.instance||this._createInstance(),this.instance}alert(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message,showCancelButton:!1})}confirm(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message})}prompt(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message,showInput:!0})}},...P}}]).default;
1
+ module.exports=function(t){var e={};function s(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=t,s.c=e,s.d=function(t,e,a){s.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},s.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.t=function(t,e){if(1&e&&(t=s(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)s.d(a,n,function(e){return t[e]}.bind(null,n));return a},s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,"a",e),e},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},s.p="",s(s.s=3)}([function(t,e){t.exports=require("chain-lodash")},function(t,e){t.exports=require("element-ui")},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAAXNSR0IArs4c6QAAADBQTFRFAAAAIK9wML9wKLdoKLdwKLdsKbhpKLlqKLdqKLhrKLdpKLhrKbhrKLhqKblqKLhqgtDn1gAAAA90Uk5TABAQICBAcH+An6C/z9/vjSAyHgAAAJdJREFUKM9dzs0JwkAUReGDIkwJFmELwmA/giXYQVpICa5sw417dy4FN+IPyc0YZ2Jy7/Lw8XhUKmuPkbSg/159qUbl6kQ7Jw8n7eTKeykdxqReSHcyuSXAWnqSyeaken6RPmQSVz1QQybn2f4LJDJpYg+GkMgPlJDIVpMwvMtAPAQPheAEJzjBCU5wghOc4AQnOMGJh9AB/uTa5S04zqUAAAAASUVORK5CYII="},function(t,e,s){"use strict";s.r(e);var a={};s.r(a),s.d(a,"SInput",(function(){return E})),s.d(a,"SSelect",(function(){return P})),s.d(a,"SInputNumber",(function(){return M})),s.d(a,"SSwitch",(function(){return F}));var n=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-drawer",t._g(t._b({staticClass:"saas-drawer",attrs:{wrapperClosable:!1,visible:t.show},on:{"update:visible":function(e){t.show=e}}},"el-drawer",t.bindProps,!1),t.$listeners),[t.$slots.title?s("template",{slot:"title"},[t._t("title")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-drawer-content"},[t._t("default")],2),t._v(" "),t.showFooter?s("div",{staticClass:"saas-drawer-footer"},[t.$slots.footer?t._t("footer"):[t.showCancelButton?s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),t.showConfirmButton?s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v("\n "+t._s(t.confirmText)+"\n ")]):t._e()]],2):t._e()],2)};n._withStripped=!0;var l=s(1),i=s(0);function o(t,e,s,a,n,l,i,o){var r,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=s,u._compiled=!0),a&&(u.functional=!0),l&&(u._scopeId="data-v-"+l),i?(r=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},u._ssrRegister=r):n&&(r=o?function(){n.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:n),r)if(u.functional){u._injectStyles=r;var c=u.render;u.render=function(t,e){return r.call(e),c(t,e)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,r):[r]}return{exports:t,options:u}}var r=o({name:"SDrawer",props:{...l.Drawer.props,showFooter:{type:Boolean,default:()=>!0},size:{type:[String,Number],default:()=>"800px"},wrapperClosable:{type:Boolean,default:()=>!1},loadingBtn:{type:Boolean,default:()=>!1},appendToBody:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},showConfirmButton:{type:Boolean,default:!0},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}},bindProps(){return Object(i.omit)(this.$props,["visible"])}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("update:visible",!1),this.$emit("close")}}},n,[],!1,null,null,null).exports,u=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-dialog",t._g(t._b({staticClass:"saas-dialog",attrs:{"close-on-click-modal":!1,visible:t.show},on:{"update:visible":function(e){t.show=e}}},"el-dialog",t.bindProps,!1),t.$listeners),[t.$slots.title?s("template",{slot:"title"},[t._t("title")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-dialog-content",class:{"saas-dialog-auto":t.isAuto}},[t._t("default")],2),t._v(" "),t.showFooter?s("template",{slot:"footer"},[t.$slots.footer?t._t("footer"):s("div",[t.showCancelButton?s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),t.showConfirmButton?s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v("\n "+t._s(t.confirmText)+"\n ")]):t._e()],1)],2):t._e()],2)};u._withStripped=!0;var c=o({name:"SDialog",props:{...l.Dialog.props,showFooter:{type:Boolean,default:()=>!0},width:{type:[String,Number],default:()=>"600px"},loadingBtn:{type:Boolean,default:()=>!1},visible:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:()=>!0},showConfirmButton:{type:Boolean,default:()=>!0},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}},isAuto:{type:Boolean,default:!0}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}},bindProps(){return Object(i.omit)(this.$props,["visible"])}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("update:visible",!1),this.$emit("close")}}},u,[],!1,null,null,null).exports,p=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-detail"},[s("div",{staticClass:"saas-detail-top"},[s("div",{staticClass:"saas-detail-header"},[s("div",{staticClass:"saas-detail-backbox"},[t.showClose?s("div",{staticClass:"saas-detail-back",on:{click:t.goBack}},[s("span",{staticClass:"el-icon-arrow-left"})]):t._e()]),t._v(" "),s("div",{staticClass:"saas-detail-titlebox",style:t.computeStyle},[s("div",{staticClass:"saas-detail-title"},[s("span",{staticClass:"saas-title-line"}),t._v(" "),t.$slots.title?[t._t("title")]:s("span",[t._v("\n "+t._s(t.title)+"\n ")])],2),t._v(" "),t.titleSub?s("div",{staticClass:"saas-detail-sub"},[t._v(t._s(t.titleSub))]):t._e()]),t._v(" "),t._t("header-append")],2),t._v(" "),s("div",{staticClass:"saas-detail-content"},[t._t("default")],2)]),t._v(" "),t.showFooter?[s("div",{staticClass:"saas-detail-footer"},[t.$slots.footer?t._t("footer"):[s("el-button",{on:{click:t.handleClose}},[t._v(t._s(t.cancelText))]),t._v(" "),s("el-button",{directives:[{name:"preventReClick",rawName:"v-preventReClick",value:5e3,expression:"5000"}],attrs:{loading:t.loadingBtn,type:"primary"},on:{click:t.handleSubmit}},[t._v(t._s(t.confirmText))])]],2)]:t._e()],2)};p._withStripped=!0;var d=o({name:"SPagedetail",props:{showFooter:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!0},loadingBtn:{type:Boolean,default:()=>!1},computeStyle:{type:Object,default:()=>({width:"1000px",margin:"0 auto"})},title:{type:String,default:""},titleSub:{type:String,default:""},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},p,[],!1,null,"063e3770",null).exports,h=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-page-table"},[s("div",{staticClass:"saas-page-table-header"},[t.showTitle?s("div",{staticClass:"saas-page-table-menu",class:{hasClose:t.showClose}},[t.showClose?[s("div",{staticClass:"saas-page-table-back",on:{click:t.goBack}},[s("span",{staticClass:"el-icon-arrow-left"})]),t._v(" "),s("span",{staticClass:"saas-page-table-back_title"},[t._v(t._s(t.$t("atSalaryFileImport.return")))]),t._v(" "),s("span",{staticClass:"saas-page-table-title_line"})]:t._e(),t._v(" "),t.showClose?t._e():s("span",{staticClass:"saas-page-title-line"}),t._v(" "),s("span",{staticClass:"saas-page-table-title"},[t.$slots.title?[t._t("title")]:s("span",[t._v(t._s(t.title))])],2),t._v(" "),t._t("header-append")],2):t._e(),t._v(" "),s("div",{staticClass:"saas-page-table-form"},[t._t("form")],2)]),t._v(" "),s("div",{staticClass:"saas-page-table-content"},[t._t("default")],2),t._v(" "),s("div",{staticClass:"saas-page-table-footer"},[t._t("footer")],2)])};h._withStripped=!0;var m=o({name:"SPagetable",props:{showFooter:{type:Boolean,default:()=>!0},showClose:{type:Boolean,default:()=>!1},loadingBtn:{type:Boolean,default:()=>!1},computeStyle:{type:Object,default:()=>({width:"1000px",margin:"0 auto"})},title:{type:String,default(){return this.$t("saasmenu."+this.$route.meta.code)}},titleSub:{type:String,default:""},confirmText:{type:String,default(){return this.$t("buttonGroup.sure")}},cancelText:{type:String,default(){return this.$t("buttonGroup.cancel")}},showTitle:{type:Boolean,default:!0}},data:()=>({}),computed:{show:{get(){return this.visible},set(t){this.$emit("update:visible",t)}}},deactivated(){this.handleClose()},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},h,[],!1,null,"fe71db8e",null).exports,f=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-unit"},[e("span",{class:"saas-unit-"+this.typeCom}),this._v(" "),e("span",{staticClass:"saas-unit-text"},[this._t("default",[this._v("\n "+this._s(this.getValue)+"\n ")])],2)])};f._withStripped=!0;var v=o({name:"SUnit",props:{value:[String,Number],type:{type:String,default:""},options:{type:Array,default:()=>[]},props:{type:Object,default:()=>({value:"value",label:"label",style:"style",type:"",isShowCode:!1})}},data:()=>({}),computed:{typeCom(){if(Object(i.isEmpty)(this.value))return this.type||"primary";{const t=this.props.style||"style";return Object(i.getOptionValue)(this.options,this.value,{...this.props,label:t})||"primary"}},getValue(){if(!Object(i.isEmpty)(this.value)){const t=Object(i.getOptionValue)(this.options,this.value,this.props);return Object(i.formatIfJson)(t)}return""}},methods:{handleSubmit(){this.$emit("confirm")},handleClose(){this.$emit("close")},goBack(){this.$emit("close")}}},f,[],!1,null,"0315617a",null).exports,_=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-card"},[e("div",{staticClass:"saas-card-header"},[this._t("title",[this._v("\n "+this._s(this.title)+"\n ")])],2),this._v(" "),e("div",{staticClass:"saas-card-content"},[this._t("default")],2)])};_._withStripped=!0;var b=o({name:"SCard",props:{title:{type:String,default:""},titleSub:{type:String,default:""}},data:()=>({}),computed:{},deactivated(){},methods:{}},_,[],!1,null,"f1b3ff3e",null).exports,g=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"saas-group"},t._l(t.list,(function(e,n){return a("div",{key:n,staticClass:"saas-sort-group"},t._l(e.children,(function(n,l){return a("div",{key:l,staticClass:"saas-sort-item",class:{active:t.getActive(n,e)},on:{click:function(s){return t.handleClick(n,e)}}},[a("div",{staticClass:"title",style:t.getSortStyle(n)},[t._v(t._s(n.formatValue(n,t.data)))]),t._v(" "),a("div",{staticClass:"text"},[a("span",[t._t("default",[t._v("\n "+t._s(n.label)+"\n "),n.tip?a("el-tooltip",{attrs:{content:n.tip}},[a("div",{attrs:{slot:"content"},domProps:{innerHTML:t._s(n.tip)},slot:"content"}),t._v(" "),a("i",{staticClass:"smart-info-filled",staticStyle:{color:"#a1a5b2","margin-left":"4px"}})]):t._e()],{item:n})],2)]),t._v(" "),a("img",{attrs:{src:s(2),alt:"",srcset:""}})])})),0)})),0)};g._withStripped=!0;var y=o({name:"SGroup",props:{title:{type:String,default:""},list:{type:Array,default:()=>[]},data:{type:Object,default:()=>({})},isActive:{type:Function,default:null}},data:()=>({}),computed:{},deactivated(){},methods:{getSortStyle(t){let e={};if("percent"===t.type){const s=this.data[t.field];e.color=s<=30?"#FF3B30":s<=60?"#FF9900":"#28B86A"}return e},handleClick(t,e){this.$emit("tab-click",t,e)},getActive(t,e){return!!this.isActive&&this.isActive(t,e)}}},g,[],!1,null,"a1243d5a",null).exports,w=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-table-buttons"},[t._l(t.buttonList,(function(e,a){return[s("el-tooltip",{key:a,attrs:{disabled:!e.tip,placement:"top",content:e.tip}},[s("el-button",t._b({on:{click:function(s){return t.handelClick(e.action)}}},"el-button",t.finalAttrs(e.attrs),!1),[t._v(t._s(e.label))])],1)]})),t._v(" "),t.dropdownList.length?s("el-dropdown",{on:{command:t.handleCommand}},[s("el-button",t._b({},"el-button",t.btnProps,!1),["more"==t.moreType?s("i",{staticClass:"smart-More"}):"text"==t.moreType?[t._v("\n "+t._s(t.text)+"\n "),s("i",{staticClass:"el-icon-arrow-down"})]:t._e()],2),t._v(" "),s("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},t._l(t.dropdownList,(function(e,a){return s("el-dropdown-item",t._b({key:a,attrs:{command:e.action}},"el-dropdown-item",t.finalAttrs(e.attrs),!1),[s("el-tooltip",{attrs:{disabled:!e.tip,placement:"top",content:e.tip}},[s("span",[t._v(t._s(e.label))])])],1)})),1)],1):t._e()],2)};w._withStripped=!0;var S=o({name:"STableButtons",props:{list:{type:Array,default:()=>[]},maxLength:{type:Number,default:2},moreType:{type:String,default:"more"},text:{type:String,default(){return this.$t("buttonGroup.more")}},row:{type:Object,default:()=>({})}},data:()=>({btnProps:{size:"mini",type:"text"}}),computed:{showList(){return this.list.filter(t=>{const e=!!Object(i.isEmpty)(t.show)||t.show;return"function"==typeof e?e(this.row):Boolean(e)})},buttonList(){return this.showList.slice(0,this.maxLength)},dropdownList(){return this.showList.slice(this.maxLength)}},methods:{finalAttrs(t={}){return{...this.btnProps,...t}},handleCommand(t){this.$emit("action",t,this.row)},handelClick(t){this.$emit("action",t,this.row)}}},w,[],!1,null,null,null).exports,C=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("transition",{attrs:{name:"el-fade-in-linear"}},[t.visible?s("div",{staticClass:"message-box-overlay"},[s("div",{staticClass:"message-box"},[s("div",{staticClass:"message-box_main"},[s("div",{staticClass:"message-box_icon"},[s("span",{staticClass:"el-icon-warning"})]),t._v(" "),s("div",{staticClass:"message-box_right"},[s("div",{staticClass:"message-box__header"},[s("span",{staticClass:"message-box__title"},[t._v(t._s(t.title))])]),t._v(" "),s("div",{staticClass:"message-box__content"},[t.message&&0==t.dangerouslyUseHTMLString?s("div",[t._v(t._s(t.message))]):t._e(),t._v(" "),t.message&&t.dangerouslyUseHTMLString?s("div",{domProps:{innerHTML:t._s(t.message)}}):t._e(),t._v(" "),t.showInput?s("el-input",{staticClass:"message-box__input",attrs:{placeholder:t.inputPlaceholder},model:{value:t.inputValue,callback:function(e){t.inputValue=e},expression:"inputValue"}}):t._e()],1)])]),t._v(" "),s("div",{staticClass:"message-box__footer"},[t.showCancelButton?s("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v(t._s(t.cancelText))]):t._e(),t._v(" "),s("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.handleConfirm}},[t._v(t._s(t.confirmText))])],1)])]):t._e()])};C._withStripped=!0;var x=o({name:"SMessageBox",props:{},data:()=>({visible:!1,title:"",message:"",showInput:!1,inputValue:"",inputPlaceholder:"",showCancelButton:!1,resolve:null,reject:null,confirmText:"",cancelText:"",dangerouslyUseHTMLString:!1}),methods:{open(t){return this.title=t.title,this.message=t.message||"",this.showClose=!!Object(i.isEmpty)(t.showClose)||t.showClose,this.showInput=t.showInput||!1,this.dangerouslyUseHTMLString=t.dangerouslyUseHTMLString||!1,this.inputPlaceholder=t.inputPlaceholder||"",this.showCancelButton=!!Object(i.isEmpty)(t.showCancelButton)||t.showCancelButton,this.confirmText=t.confirmText,this.cancelText=t.cancelText,this.visible=!0,this.inputValue="",new Promise((t,e)=>{this.resolve=t,this.reject=e})},handleConfirm(){this.visible=!1,this.showInput?this.resolve(this.inputValue):this.resolve(!0)},handleCancel(){this.visible=!1,this.reject("cancel")}}},C,[],!1,null,null,null).exports;var $=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-table",t._g(t._b({ref:"saasTable",staticClass:"saas-table"},"el-table",t.$props,!1),t.$listeners),[t._t("default"),t._v(" "),t._l(t.columns,(function(e){return s("STablecolumn",{key:e.value,attrs:{column:e},on:{action:t.handleColumnAction},scopedSlots:t._u([{key:e.value,fn:function(s){return[t._t(e.value,null,null,t.getBindProps(s,e))]}}],null,!0)})}))],2)};$._withStripped=!0;var A=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("el-table-column",t._b({scopedSlots:t._u(["index"===t.column.type?{key:"default",fn:function(e){var s=e.$index,a=e.row;return[t._t("default",[t._v("\n "+t._s(t.getIndex(s))+"\n ")],{index:t.getIndex(s),row:a})]}}:"operate"===t.column.type?{key:"default",fn:function(e){return[t._t(t.column.value,[s("s-table-buttons",{attrs:{list:t.column.actionList,row:e.row},on:{action:t.handleAction}})],null,t.getBindProps(e))]}}:"unit"===t.column.type?{key:"default",fn:function(e){return[t._t(t.column.value,[s("s-unit",{attrs:{value:e.row[t.column.value],options:t.column.options}})],null,t.getBindProps(e))]}}:{key:"default",fn:function(e){return[t._t(t.column.value,[t._v("\n "+t._s(t.selectValue(e.row))+"\n ")],null,t.getBindProps(e))]}}],null,!0)},"el-table-column",t.columnProps,!1),[s("template",{slot:"header"},[t.$slots["header-"+t.column.value]?t._t("header-"+t.column.value,[t._v("\n "+t._s(t.column.label)+"\n ")],{column:t.column}):[s("span",[t._v(t._s(t.column.label))]),t._v(" "),t.column.tip?s("el-tooltip",{attrs:{placement:"top",content:t.column.tip}},[s("i",{staticClass:"smart-info-filled",staticStyle:{color:"#a1a5b2","margin-left":"6px"}})]):t._e()]],2)],2)};A._withStripped=!0;var B=o({name:"STablecolumn",components:{STableButton:S,SUnit:v},props:{column:Object,minWidth:{type:[Number,String],default:150}},data:()=>({}),computed:{columnProps(){const{type:t=null,fixed:e=null}=this.column;return{...this.column,fixed:e||("operate"===t?"right":null),"min-width":this.column.minWidth||this.minWidth,prop:this.column.value,label:this.column.label,showOverflowTooltip:null==this.column.showOverflowTooltip||this.column.showOverflowTooltip,index:this.column.indexMethod||null}}},methods:{selectValue(t){let e="";const{options:s=[],type:a="txt"}=this.column,n=t[this.column.value];if(this.column.formatValue)return this.column.formatValue(t,this.column);switch(a){case"select":let t=s.find(t=>t.value==n)||{};e=Object(i.formatIfJson)(t.label);break;case"time":e=Object(i.formatSubmitTime)(n,"DD/MM/YYYY");break;default:e=Object(i.formatIfJson)(n)}return Object(i.isEmpty)(e)?e=this.column.defaultValue||"-":e.length>500&&(e=e.slice(0,500)+"..."),e},getBindProps(t){return{...t,column:this.column}},getIndex(t){return this.indexMethod?this.indexMethod(t):t+1},handleAction(t,e){this.$emit("action",t,e,this.column)}}},A,[],!1,null,null,null).exports,T=o({name:"STable",props:{...l.Table.props,border:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]}},components:{STablecolumn:B},data:()=>({}),computed:{},deactivated(){},methods:{handleColumnAction(t,e,s){this.$emit("action",t,e,s)},getBindProps:(t,e)=>({...t,column:e})}},$,[],!1,null,null,null).exports,k=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"saas-container"},[e("div",{staticClass:"saas-container-header"},[this._t("header")],2),this._v(" "),e("div",{staticClass:"saas-container-content"},[this._t("default")],2),this._v(" "),e("div",{staticClass:"saas-container-footer"},[this._t("footer")],2)])};k._withStripped=!0;var V=o({name:"SContainer",props:{title:{type:String,default:""},titleSub:{type:String,default:""}},data:()=>({}),computed:{},deactivated(){},methods:{}},k,[],!1,null,"2036a697",null).exports,O=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-input",class:{"saas-text-mode":"text"===t.from}},["text"===t.from?s("span",{staticClass:"saas-input-text"},[t._v(t._s(t.textValue))]):s("el-input",t._g(t._b({model:{value:t.newValue,callback:function(e){t.newValue=e},expression:"newValue"}},"el-input",t.attrs,!1),t.onEvents),[t.$slots.prepend?s("template",{slot:"prepend"},[t._t("prepend")],2):t._e(),t._v(" "),t.$slots.append?s("template",{slot:"append"},[t._t("append")],2):t._e()],2)],1)};O._withStripped=!0;var I={props:{value:{type:[String,Number,Array],default:""},mode:{type:String,default:"FORM"},clearable:{type:Boolean,default:!0},from:{type:String,default:"input"},placeholder:{type:String,default(){return this.$t("selectGroup.pleaseSelect")}},componentType:{type:String,default:"input"}},computed:{newValue:{get(){return Object(i.isEmpty)(this.value)||null==this.value?"":String(this.value)},set(t){this.$emit("input",t)}},textValue(){if("select"==this.componentType){const t=this.flattenOptions(this.options);if(this.multiple){const e=t.filter(t=>this.newValue.includes(t.value)).map(t=>t.label);return e.length>1?`${e[0]} +${e.length-1}`:e[0]||"-"}return(t.find(t=>t.value==this.newValue)||{}).label||"-"}return this.newValue||"-"},attrs(){const t=Object.assign({},this.defaultAttrs,this.$props,this.$attrs),e=["value","from"];return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,s)=>(e[s]=t[s],e),{})},onEvents(){return this.$listeners}},methods:{flattenOptions(t){const e=[];return t.forEach(t=>{t.options?e.push(...t.options):e.push(t)}),e}}},E=o({name:"SInput",mixins:[I],props:{...Object(i.omit)(l.Input.props,["value","clearable","maxlength"]),maxlength:{type:Number,default:120},placeholder:{type:String,default(){return this.$t("InputPlaceholder.pleasemsg")}}},computed:{}},O,[],!1,null,"0b51b93c",null).exports,j=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-select",class:{"saas-text-mode":"text"===t.from}},["text"===t.from?s("span",{staticClass:"input-text"},[t._v(t._s(t.textValue))]):s("el-select",t._g(t._b({staticClass:"saas-select-input",attrs:{filterable:"",clearable:""},model:{value:t.newValue,callback:function(e){t.newValue=e},expression:"newValue"}},"el-select",t.attrs,!1),t.onEvents),[t._l(t.options,(function(e){return[e.options?s("el-option-group",{key:e.value,attrs:{label:e.label}},t._l(e.options,(function(t){return s("el-option",{key:t.value,attrs:{disabled:t.disabled,label:t.label,value:t.value}})})),1):s("el-option",{key:e.value,attrs:{disabled:e.disabled,label:e.label,value:e.value}})]}))],2)],1)};j._withStripped=!0;var P=o({name:"SSelect",mixins:[I],props:{...Object(i.omit)(l.Select.props,["value","clearable"]),value:{type:[String,Number,Array]},clearable:{type:Boolean,default:()=>!0},options:{type:Array,default:()=>[]},componentType:{type:String,default:"select"}},data:()=>({}),computed:{newValue:{get(){let t=this.multiple?[]:"";return this.multiple?t=(this.value||[]).map(t=>null!=t?String(t):""):Object(i.isEmpty)(this.value)||null==this.value||(t=String(this.value)),t},set(t){this.$emit("input",t)}}},methods:{flattenOptions(t){const e=[];return t.forEach(t=>{t.options?e.push(...t.options):e.push(t)}),e}}},j,[],!1,null,"4fc3a8c8",null).exports,L=function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"saas-input-number",class:{"saas-text-mode":"text"===t.from}},["text"===t.from?s("span",{staticClass:"saas-input-number-text"},[t._v(t._s(t.textValue))]):s("el-input",t._g(t._b({model:{value:t.internalValue,callback:function(e){t.internalValue=e},expression:"internalValue"}},"el-input",t.attrs,!1),t.mergedListeners),[t.$slots.prepend?s("template",{slot:"prepend"},[t._t("prepend")],2):t._e(),t._v(" "),t.$slots.append?s("template",{slot:"append"},[t._t("append")],2):t._e()],2)],1)};L._withStripped=!0;var M=o({name:"SInputNumber",mixins:[I],props:{...Object(i.omit)(l.Input.props,["value","clearable"]),value:{type:[String,Number],default:""},placeholder:{type:String,default(){return this.$t("InputPlaceholder.pleasemsg")}},componentType:{type:String,default:"inputNumber"},min:{type:Number,default:-1/0},max:{type:Number,default:1/0},allowDecimal:{type:Boolean,default:!1},precision:{type:Number,default:0}},data(){return{internalValue:this.value.toString()}},computed:{mergedListeners(){return{...this.onEvents,input:this.handleInput,blur:this.handleBlur}}},watch:{value(t){"text"!==this.from&&(this.internalValue=this.formatInputValue(t))}},methods:{handleInput(t){let e=t;if(this.allowDecimal){e=t.replace(/[^-?\d.]/g,"");const s=(e.match(/\./g)||[]).length;if(s>1){const t=e.indexOf(".");e=e.substring(0,t+1)+e.substring(t+1).replace(/\./g,"")}if(s>0&&this.precision>=0){const t=e.split(".");t[1]&&t[1].length>this.precision&&(e=t[0]+"."+t[1].substring(0,this.precision))}}else e=t.replace(/[^-?\d]/g,"");const s=(e.match(/-/g)||[]).length;let a;s>1&&(e=e.replace(/-/g,""),e="-"+e),1!==s||e.startsWith("-")||(e=e.replace(/-/g,""),e="-"+e),e.startsWith("0")&&e.length>1&&!e.startsWith("-")&&(e=e.replace(/^0+/,"0"),e.length>1&&"."!==e[1]&&(e=e.replace(/^0+/,""))),e.startsWith("-0")&&e.length>2&&("."!==e[2]&&(e=e.replace(/^(-)0+/,"$1")),"-"===e&&(e="-0")),this.internalValue=e,a=""===e||"-"===e?"":this.allowDecimal?parseFloat(e):parseInt(e,10),this.$emit("input",a)},handleBlur(){let t,e=this.internalValue;if(""===e||"-"===e)return this.$emit("input",""),this.internalValue="",void this.$emit("blur","");this.allowDecimal?(t=parseFloat(e),this.precision>=0&&(t=parseFloat(t.toFixed(this.precision)))):t=parseInt(e,10),t<this.min?t=this.min:t>this.max&&(t=this.max),this.allowDecimal&&this.precision,this.internalValue=t.toString(),this.$emit("input",t),this.$emit("blur",t)},formatInputValue:t=>""===t||null==t?"":t.toString()}},L,[],!1,null,null,null).exports,N=function(){var t=this,e=t.$createElement;return(t._self._c||e)("el-switch",t._g(t._b({model:{value:t.newValue,callback:function(e){t.newValue=e},expression:"newValue"}},"el-switch",t.attrs,!1),t.onEvents))};N._withStripped=!0;var F=o({name:"SSwitch",mixins:[I],props:{...Object(i.omit)(l.Input.props,["value"]),activeValue:{type:[Boolean,String,Number],default:1},inactiveValue:{type:[Boolean,String,Number],default:0},componentType:{type:String,default:"select"}},computed:{newValue:{get(){return this.value},set(t){this.$emit("input",t)}}}},N,[],!1,null,null,null).exports;console.log(a);const G={SDrawer:r,SDialog:c,SPagedetail:d,SUnit:v,SCard:b,SGroup:y,SPagetable:m,STable:T,STableButtons:S,SContainer:V,STablecolumn:B,...a},R=function(t){R.installed||Object.keys(G).forEach(e=>{t.component(G[e].name,G[e])})};"undefined"!=typeof window&&window.Vue&&R(window.Vue);e.default={version:"1.0.0",install:R,SMessagebox:class{constructor(t,e,s=x){if(!t)throw new Error("[MessageBox] Vue instance is required");if(!s)throw new Error("[MessageBox] Vue component is required");this.Vue=t,this.i18n=e,this.Component=s,this.instance=null}_t(t){return this.i18n?this.i18n.t(t):t}_createInstance(){const t=this.Vue.extend(this.Component);this.instance=new t({el:document.createElement("div")}),document.body.appendChild(this.instance.$el)}_getInstance(){return this.instance||this._createInstance(),this.instance}alert(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message,showCancelButton:!1})}confirm(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message})}prompt(t){return this._getInstance().open({...t,title:t.title||this._t("deletemsg.hint"),confirmText:t.confirmText||this._t("buttonGroup.sure"),cancelText:t.cancelText||this._t("buttonGroup.cancel"),message:t.message,showInput:!0})}},...G}}]).default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chain-saasui",
3
- "version": "1.0.6",
3
+ "version": "1.0.8-alpha.0",
4
4
  "description": "chain-saasui",
5
5
  "author": "Saas",
6
6
  "license": "MIT",