ci-plus 1.0.3 → 1.0.6

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.
package/README.md CHANGED
@@ -1,5 +1,23 @@
1
1
  ## 安装本组件库
2
2
 
3
+ ```sh
4
+ # 1、安装组件
5
+ pnpm install ci-plus -S
6
+ # 2、安装element-plus 和引入
7
+ pnpm install element-plus@2.5.1 @element-plus/icons-vue@2.3.1 -S
8
+ # 3、安装package.json中的其他依赖(到node_modules/ci-plus/package.json目录下,把里面的依赖安装)
9
+ # 4、main.ts引入组件
10
+ import ElementPlus from 'element-plus'
11
+ import 'element-plus/dist/index.css'
12
+ import CiPlus from 'ci-plus'
13
+
14
+ # 5、全局注册
15
+ app.use(ElementPlus)
16
+ app.use(CiPlus)
17
+
18
+
19
+ ```
20
+
3
21
  ```sh
4
22
  # 本地安装项目
5
23
  pnpm install 项目package.json所在目录
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ci-plus",
3
- "version": "1.0.3",
4
- "description": "cc组件库",
3
+ "version": "1.0.6",
4
+ "description": "ci组件库",
5
5
  "main": "./index.ts",
6
6
  "scripts": {
7
7
  "build": "vite build",
package/src/index.ts CHANGED
@@ -6,6 +6,6 @@ export * from './ccapp';
6
6
  export * from './svgicon';// svg图标
7
7
  export * from './selectSuffix';
8
8
  export * from './sortableTable/index/headButtons'; // 导出排序表头按钮
9
- export * from './sortableTable/index/sortableTableTs'; // 导出排序表格
9
+ export * from './sortableTable/index/sortableTable'; // 导出排序表格
10
10
  export * from './sortableTable/index/sortableTableDialog'; // 导出表排序组件
11
11
  export * from './sortableTable/index/sortableTableColumnCell'; // 导出表列组件
@@ -1,8 +1,5 @@
1
1
  <template>
2
- <span
3
- class="el-input-number__increase"
4
- @click.stop="openTable"
5
- >
2
+ <span class="el-input-number__increase" @click.stop="openTable">
6
3
  <el-icon>
7
4
  <Operation />
8
5
  </el-icon>
@@ -15,38 +12,17 @@
15
12
  style="height: 60%; width: 800px"
16
13
  draggable
17
14
  >
18
- <div
19
- style="display: flex; flex-direction: column; height: 100%"
20
- v-loading="basic.loading"
21
- >
15
+ <div style="display: flex; flex-direction: column; height: 100%" v-loading="basic.loading">
22
16
  <el-row style="margin-bottom: 3px">
23
- <el-col
24
- v-if="mul && Array.isArray(props.modelValue)"
25
- :span="14"
26
- >
17
+ <el-col v-if="mul && Array.isArray(props.modelValue)" :span="14">
27
18
  <template v-for="(v, i) in props.modelValue">
28
- <el-tag
29
- v-if="i <= 2"
30
- :key="v"
31
- closable
32
- type=""
33
- style="width: 70px"
34
- >
19
+ <el-tag v-if="i <= 2" :key="v" closable type="" style="width: 70px">
35
20
  {{ v }}
36
21
  </el-tag>
37
22
  </template>
38
23
  </el-col>
39
- <el-col
40
- v-else
41
- :span="14"
42
- class="flex"
43
- >
44
- <el-tag
45
- v-if="props.modelValue?.length"
46
- closable
47
- type=""
48
- @close="closeTag"
49
- >
24
+ <el-col v-else :span="14" class="flex">
25
+ <el-tag v-if="props.modelValue?.length" closable type="" @close="closeTag">
50
26
  {{ tagLabel }}
51
27
  </el-tag>
52
28
  </el-col>
@@ -58,10 +34,7 @@
58
34
  @change="getTableData({}, true)"
59
35
  >
60
36
  <template #append>
61
- <el-button
62
- icon="Search"
63
- @click="getTableData({}, true)"
64
- />
37
+ <el-button icon="Search" @click="getTableData({}, true)" />
65
38
  </template>
66
39
  </el-input>
67
40
  </el-col>
@@ -75,21 +48,12 @@
75
48
  :highlight-current-row="!mul"
76
49
  >
77
50
  <template v-for="column in columns">
78
- <el-table-column
79
- v-if="column.component"
80
- v-bind="column.col"
81
- >
51
+ <el-table-column v-if="column.component" v-bind="column.col">
82
52
  <template #default="scope">
83
- <component
84
- :is="column.component(h, scope)"
85
- :scope="scope"
86
- ></component>
53
+ <component :is="column.component(h, scope)" :scope="scope"></component>
87
54
  </template>
88
55
  </el-table-column>
89
- <el-table-column
90
- v-else
91
- v-bind="column.col"
92
- />
56
+ <el-table-column v-else v-bind="column.col" />
93
57
  </template>
94
58
  </el-table>
95
59
  <el-pagination
@@ -138,7 +102,7 @@ const props = withDefaults(defineProps<SelectSuffix>(), {
138
102
  where: () => ({}), //弹出层打开需要展示Label的请求对象
139
103
  axiosConfig: () => ({}), //Axios请求配置对象
140
104
  isExist: false, // 是否选中关闭,单选默认true,多选默认false
141
- searchKey: 'search', // 模糊搜索字段,默认search
105
+ searchKey: 'search' // 模糊搜索字段,默认search
142
106
  })
143
107
  console.log('props', props)
144
108
 
@@ -149,7 +113,7 @@ const basic = reactive<Basic>({
149
113
  count: 0,
150
114
  loading: false,
151
115
  is_dialogTable: false,
152
- search: '',
116
+ search: ''
153
117
  })
154
118
  const tagLabel = ref('')
155
119
  const tableData = ref<AnyO[]>([])
@@ -190,9 +154,7 @@ const getTableData = (obj = {}, page1 = false) => {
190
154
  })
191
155
  }
192
156
  const setCurrent = (row?: AnyO) => {
193
- let chooseRow = tableData.value.find(
194
- (v) => v[props.prop.value] === props.modelValue,
195
- )
157
+ let chooseRow = tableData.value.find((v) => v[props.prop.value] === props.modelValue)
196
158
  if (chooseRow) tableRef.value!.setCurrentRow(chooseRow)
197
159
  else tableRef.value!.setCurrentRow(null)
198
160
  }
@@ -210,8 +172,8 @@ const getAxios = async (obj = {}, page1 = false): Promise<any> => {
210
172
  limit: basic.limit,
211
173
  ...searchObj,
212
174
  ...props.axiosConfig.params,
213
- ...obj,
214
- },
175
+ ...obj
176
+ }
215
177
  })
216
178
  .then((res) => {
217
179
  basic.loading = false
@@ -43,6 +43,10 @@
43
43
  {{ element.hide ? '显示' : '隐藏' }}
44
44
  </el-button>
45
45
  </div>
46
+ <div class="widths">
47
+ 宽度:
48
+ <el-input class="w-50 m-2" v-model="element.col.width" size="small" width="50"></el-input>
49
+ </div>
46
50
  <sortable-table-drag-item v-if="element.children" v-model="element.children" />
47
51
  </div>
48
52
  </template>
@@ -78,7 +82,7 @@ const handleShow = (col: SortColumn) => {
78
82
  $hoverBC: rgba(137, 182, 233, 0.5);
79
83
 
80
84
  .drag-container {
81
- display: flex;
85
+ // display: flex;
82
86
  width: 100%;
83
87
  flex-direction: column;
84
88
 
@@ -119,6 +123,12 @@ $hoverBC: rgba(137, 182, 233, 0.5);
119
123
  margin-bottom: 0;
120
124
  }
121
125
  }
126
+ .widths {
127
+ .el-input {
128
+ width: 50px !important;
129
+ margin-right: 20px;
130
+ }
131
+ }
122
132
  }
123
133
  .item-hide {
124
134
  background: rgba(218, 218, 218, 0.5);
@@ -1,9 +0,0 @@
1
- import { SortColumn } from '../utils/interface'
2
-
3
- export const setKey = (data: SortColumn[], path: number[] = []) => {
4
- data.forEach((v, i) => {
5
- const path_ = [...path, i]
6
- v.key = path_.join('_')
7
- if (v.children) setKey(v.children, path_)
8
- })
9
- }