Compare commits

..

6 Commits

Author SHA1 Message Date
67dd6b0760 Merge pull request '增加table单选的受控事件' (#3) from zjl into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #3
2022-12-26 19:26:18 +08:00
d46bf70433 增加table单选的受控事件 2022-12-26 19:23:54 +08:00
7aa6375f22 Merge pull request 'fix: :修正构建触发分支' (#2) from cicd into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2022-12-16 15:15:49 +08:00
565940ea8b fix: :修正构建触发分支 2022-12-16 15:15:06 +08:00
d654c05b46 Merge pull request 'build: :新增自动构建部署' (#1) from cicd into develop
Reviewed-on: #1
2022-12-16 15:07:02 +08:00
8ff16edec0 build: :新增自动构建部署 2022-12-16 15:01:54 +08:00
5 changed files with 74 additions and 10 deletions

41
.drone.yml Normal file
View File

@@ -0,0 +1,41 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: build
image: docker:dind
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: dockerconfig
path: /root/.docker
commands:
- docker build --add-host github.com:192.30.255.113 -t harbor.picaiba.com/kszny/cnbmai:1.0.0 ./ && docker push harbor.picaiba.com/kszny/cnbmai:1.0.0
- name: deploy
image: harbor.picaiba.com/tools/kubectl:1.19.8
commands:
- echo "172.27.0.20 lb.kubesphere.local" >> /etc/hosts
#- echo "52.74.223.119 github.com" >> /etc/hosts
- sleep 1
- kubectl scale --replicas=0 deployment/cnbmai -n cnbmai
- sleep 3
- kubectl scale --replicas=1 deployment/cnbmai -n cnbmai
depends_on:
- build
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: dockerconfig
host:
path: /root/.docker
trigger:
branch:
- develop
event:
- push

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM node:12 AS builder
WORKDIR /app
ADD package.json /app/
RUN npm config set registry https://registry.npmmirror.com && npm install
ADD . /app
RUN npm run build
FROM busybox
LABEL maintainer thomas.hairong@gmail.com
COPY --from=builder /app/dist /html

14
package-lock.json generated
View File

@@ -8,7 +8,7 @@
"name": "code-brick-wd",
"version": "0.1.0",
"dependencies": {
"code-brick-zj": "^0.0.1",
"code-brick-zj": "^0.0.4",
"core-js": "^3.8.3",
"element-ui": "^2.15.12",
"vue": "^2.6.14",
@@ -4007,9 +4007,9 @@
}
},
"node_modules/code-brick-zj": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.1.tgz",
"integrity": "sha512-XLvQEoiVWESDirkMKVKCIdH1jW3drkSS472uMWd1m6Ul5UVTUAiJvBQ15kEo+L7w8Zt7cC5ErF+laYHhNeoaIA=="
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.4.tgz",
"integrity": "sha512-KSQ/drfIpoZKTrcARtuwG+6olde7fBYl+38Kialqa1NSoSDhPMqXTVw2N4KfA4MlucXQ/s3KZjfUsmKVZ70KkA=="
},
"node_modules/color-convert": {
"version": "1.9.3",
@@ -14473,9 +14473,9 @@
}
},
"code-brick-zj": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.1.tgz",
"integrity": "sha512-XLvQEoiVWESDirkMKVKCIdH1jW3drkSS472uMWd1m6Ul5UVTUAiJvBQ15kEo+L7w8Zt7cC5ErF+laYHhNeoaIA=="
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/code-brick-zj/-/code-brick-zj-0.0.4.tgz",
"integrity": "sha512-KSQ/drfIpoZKTrcARtuwG+6olde7fBYl+38Kialqa1NSoSDhPMqXTVw2N4KfA4MlucXQ/s3KZjfUsmKVZ70KkA=="
},
"color-convert": {
"version": "1.9.3",

View File

@@ -8,7 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"code-brick-zj": "^0.0.1",
"code-brick-zj": "^0.0.4",
"core-js": "^3.8.3",
"element-ui": "^2.15.12",
"vue": "^2.6.14",

View File

@@ -318,7 +318,11 @@
</div>
<div class="demo-box">
<h3>单选</h3>
<el-button size="small" @click="setCurrent(1)">选中第二行</el-button>
<el-button size="small" @click="setCurrent(-1)">取消选中</el-button>
<base-table
ref="palletTable1"
id="palletTable"
:table-props="tableProps"
:table-data="tableData"
:page="1"
@@ -332,11 +336,16 @@
Table
组件提供了单选的支持只需要配置<code>highlight-current-row</code>属性即可实现单选
之后由<code>current-change</code>事件来管理选中时触发的事件它会传入<code>currentRow</code><code>oldCurrentRow</code>
使用按钮选中取消必须要传id,id的值是唯一的id的值需要和<code>setCurrent</code>中第一参数一样
</div>
<div>
<pre>
&lt;el-button size="small" @click="setCurrent(1)"&gt;选中第二行&lt;/el-button&gt;
&lt;el-button size="small" @click="setCurrent(-1)"&gt;取消选中&lt;/el-button&gt;
&lt;<span>template</span>&gt;
&lt;base-table
ref="palletTable1"
id="palletTable"
:table-props="tableProps"
:table-data="tableData"
:page="1"
@@ -345,6 +354,10 @@
@current-change="handleCurrentChange"
/&gt;
&lt;<span>/template</span>&gt;
methods:
setCurrent(index) {
this.$refs.palletTable1.setCurrent('palletTable', index)
}
</pre>
</div>
</el-collapse-item>
@@ -1168,8 +1181,8 @@ export default {
}
return ''
},
setCurrent(row) {
this.$refs.singleTable.setCurrentRow(this.tableData[row])
setCurrent(index) {
this.$refs.palletTable1.setCurrent('palletTable', index)
},
handleCurrentChange(val) {
console.log(val)